|
@@ -43,79 +43,81 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive } from 'vue';
|
|
|
|
|
-import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
|
|
-import TopicsEdit from './components/topics-edit.vue';
|
|
|
|
|
-import { EleMessage } from 'ele-admin-plus/es';
|
|
|
|
|
-
|
|
|
|
|
-defineOptions({ name: 'TopicsList' });
|
|
|
|
|
-
|
|
|
|
|
-const tableRef = ref(null);
|
|
|
|
|
-const editDialogRef = ref(null);
|
|
|
|
|
-const searchQuery = ref('');
|
|
|
|
|
-
|
|
|
|
|
-const pageConfig = reactive({
|
|
|
|
|
- pageUrl: '/salesOps/topics/list',
|
|
|
|
|
- fileName: '专题列表',
|
|
|
|
|
- cacheKey: 'topics-list',
|
|
|
|
|
- params: {}
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-const columns = ref([
|
|
|
|
|
- { type: 'selection', width: 50, align: 'center' },
|
|
|
|
|
- { label: '编号', prop: 'code', width: 100, align: 'center' },
|
|
|
|
|
- { label: '专题名称', prop: 'name', align: 'center' },
|
|
|
|
|
- { label: '发布时间', prop: 'publishTime', align: 'center', width: 180 },
|
|
|
|
|
- { label: '专题类型', prop: 'typeLabel', align: 'center' },
|
|
|
|
|
- { label: '相关单品', prop: 'relatedItems', align: 'center' },
|
|
|
|
|
- { label: '状态', prop: 'status', slot: 'status', align: 'center' },
|
|
|
|
|
- { label: '排序', prop: 'sort', align: 'center', width: 80 },
|
|
|
|
|
- { label: '操作', prop: 'action', slot: 'action', align: 'center', width: 250 }
|
|
|
|
|
-]);
|
|
|
|
|
-
|
|
|
|
|
-const handleSearch = () => {
|
|
|
|
|
- reload();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleReset = () => {
|
|
|
|
|
- searchQuery.value = '';
|
|
|
|
|
- reload();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const reload = () => {
|
|
|
|
|
- tableRef.value?.reload();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleAdd = () => {
|
|
|
|
|
- editDialogRef.value?.handleOpen();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleEdit = (row) => {
|
|
|
|
|
- editDialogRef.value?.handleOpen(row);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleDetail = (row) => {
|
|
|
|
|
- EleMessage.info(`查看 ${row.name} 详情`);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleDelete = (row) => {
|
|
|
|
|
- EleMessage.confirm(`确定要删除 ${row.name} 吗?`)
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- // TODO: Call API to delete
|
|
|
|
|
- // tableRef.value?.operatBatch({ method: 'delete', row, url: '/salesOps/topics/delete' });
|
|
|
|
|
- EleMessage.success('删除成功');
|
|
|
|
|
- reload();
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => { });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleStatusToggle = (row) => {
|
|
|
|
|
- // TODO: Call API to update status
|
|
|
|
|
- // tableRef.value?.operatBatch({ method: 'post', row, url: '/salesOps/topics/updateStatus' });
|
|
|
|
|
- EleMessage.success(`${row.name} 已${row.status === 'online' ? '上架' : '下架'}`);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleSuccess = () => {
|
|
|
|
|
- reload();
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ import { ref, reactive } from 'vue';
|
|
|
|
|
+ import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
|
|
+ import TopicsEdit from './components/topics-edit.vue';
|
|
|
|
|
+ import { EleMessage } from 'ele-admin-plus/es';
|
|
|
|
|
+
|
|
|
|
|
+ defineOptions({ name: 'TopicsList' });
|
|
|
|
|
+
|
|
|
|
|
+ const tableRef = ref(null);
|
|
|
|
|
+ const editDialogRef = ref(null);
|
|
|
|
|
+ const searchQuery = ref('');
|
|
|
|
|
+
|
|
|
|
|
+ const pageConfig = reactive({
|
|
|
|
|
+ pageUrl: '/book/showIndex/queryBindBook',
|
|
|
|
|
+ fileName: '专题列表',
|
|
|
|
|
+ cacheKey: 'topics-list',
|
|
|
|
|
+ params: {
|
|
|
|
|
+ type: 1
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const columns = ref([
|
|
|
|
|
+ { type: 'selection', width: 50, align: 'center' },
|
|
|
|
|
+ { label: '编号', prop: 'code', width: 100, align: 'center' },
|
|
|
|
|
+ { label: '专题名称', prop: 'name', align: 'center' },
|
|
|
|
|
+ { label: '发布时间', prop: 'publishTime', align: 'center', width: 180 },
|
|
|
|
|
+ { label: '专题类型', prop: 'typeLabel', align: 'center' },
|
|
|
|
|
+ { label: '相关单品', prop: 'relatedItems', align: 'center' },
|
|
|
|
|
+ { label: '状态', prop: 'status', slot: 'status', align: 'center' },
|
|
|
|
|
+ { label: '排序', prop: 'sort', align: 'center', width: 80 },
|
|
|
|
|
+ { label: '操作', prop: 'action', slot: 'action', align: 'center', width: 250 }
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ const handleSearch = () => {
|
|
|
|
|
+ reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleReset = () => {
|
|
|
|
|
+ searchQuery.value = '';
|
|
|
|
|
+ reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const reload = () => {
|
|
|
|
|
+ tableRef.value?.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleAdd = () => {
|
|
|
|
|
+ editDialogRef.value?.handleOpen();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleEdit = (row) => {
|
|
|
|
|
+ editDialogRef.value?.handleOpen(row);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleDetail = (row) => {
|
|
|
|
|
+ EleMessage.info(`查看 ${row.name} 详情`);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleDelete = (row) => {
|
|
|
|
|
+ EleMessage.confirm(`确定要删除 ${row.name} 吗?`)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ // TODO: Call API to delete
|
|
|
|
|
+ // tableRef.value?.operatBatch({ method: 'delete', row, url: '/salesOps/topics/delete' });
|
|
|
|
|
+ EleMessage.success('删除成功');
|
|
|
|
|
+ reload();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => { });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleStatusToggle = (row) => {
|
|
|
|
|
+ // TODO: Call API to update status
|
|
|
|
|
+ // tableRef.value?.operatBatch({ method: 'post', row, url: '/salesOps/topics/updateStatus' });
|
|
|
|
|
+ EleMessage.success(`${row.name} 已${row.status === 'online' ? '上架' : '下架'}`);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleSuccess = () => {
|
|
|
|
|
+ reload();
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|