整理商品管理模块

This commit is contained in:
2024-07-25 19:20:53 +08:00
parent 717c89a58e
commit cf0961afdd
48 changed files with 1814 additions and 965 deletions
+29 -10
View File
@@ -8,6 +8,7 @@
:columns="columns"
:datasource="datasource"
:customRow="customRow"
:need-page="false"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
@@ -15,7 +16,6 @@
<search
@search="reload"
:selection="selection"
:count="count"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
@@ -28,13 +28,22 @@
<template v-if="column.key === 'mpQrcode'">
<a-image :src="record.mpQrcode" :width="50" />
</template>
<template v-if="column.key === 'type'">
<a-tag v-if="record.type === 1" color="green">是</a-tag>
<a-tag
v-if="record.type === 0"
@click="updateType(record)"
class="cursor-pointer"
>否</a-tag
>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a @click="openEdit(record)">编辑</a>
</a-space>
</template>
</template>
@@ -59,7 +68,7 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import MpEdit from './components/mpEdit.vue';
import { pageMp, removeMp, removeBatchMp } from '@/api/cms/mp';
import { pageMp, removeMp, removeBatchMp, updateMp } from '@/api/cms/mp';
import type { Mp, MpParam } from '@/api/cms/mp/model';
// 表格实例
@@ -67,7 +76,6 @@
// 表格选中数据
const selection = ref<Mp[]>([]);
const count = ref<number>(0);
// 当前编辑数据
const current = ref<Mp | null>(null);
// 是否显示编辑弹窗
@@ -128,11 +136,18 @@
key: 'comments',
align: 'center'
},
{
title: '主账号',
dataIndex: 'type',
key: 'type',
align: 'center'
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center'
align: 'center',
hideInTable: true
},
{
title: '创建时间',
@@ -146,7 +161,7 @@
{
title: '操作',
key: 'action',
width: 180,
width: 120,
fixed: 'right',
align: 'center',
hideInSetting: true
@@ -170,6 +185,14 @@
showMove.value = true;
};
const updateType = (row: Mp) => {
row.type = 1;
updateMp(row).then((msg) => {
message.success(msg);
reload();
});
};
/* 删除单个 */
const remove = (row: Mp) => {
const hide = message.loading('请求中..', 0);
@@ -215,10 +238,6 @@
/* 查询 */
const query = () => {
loading.value = true;
pageMp({}).then((res) => {
console.log(res?.count);
count.value = res?.count;
});
};
/* 自定义行属性 */