|
@@ -34,9 +34,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, h } from 'vue';
|
|
|
- import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
|
|
|
- import { Switch } from 'ant-design-vue';
|
|
|
+ import { defineComponent } from 'vue';
|
|
|
+ import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
+
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { uploadApi } from '/@/api/sys/upload';
|
|
|
// import { Switch } from 'ant-design-vue';
|
|
@@ -48,6 +48,7 @@
|
|
|
import { useDrawer } from '/@/components/Drawer';
|
|
|
import ProductDrawer from './productDrawer.vue';
|
|
|
// import { PageWrapper } from '/@/components/Page';
|
|
|
+ import { columns, searchForm } from './list.data';
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: { BasicTable, TableAction, ProductDrawer },
|
|
@@ -56,112 +57,6 @@
|
|
|
const go = useGo();
|
|
|
const { t } = useI18n();
|
|
|
const [registerDrawer, { openDrawer }] = useDrawer();
|
|
|
- const columns: BasicColumn[] = [
|
|
|
- {
|
|
|
- title: 'ID',
|
|
|
- dataIndex: 'id',
|
|
|
- fixed: 'left',
|
|
|
- width: 60,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '商品名称',
|
|
|
- dataIndex: 'name',
|
|
|
-
|
|
|
- width: 160,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '商品描述',
|
|
|
- dataIndex: 'desc',
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '购买链接',
|
|
|
- dataIndex: 'link',
|
|
|
- slots: { customRender: 'link' },
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '商品分类',
|
|
|
- dataIndex: 'productType',
|
|
|
- slots: { customRender: 'productType' },
|
|
|
- sorter: true,
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '直播间名称',
|
|
|
- dataIndex: 'steamRoom.name',
|
|
|
- sorter: true,
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '零售价格',
|
|
|
- dataIndex: 'unit',
|
|
|
- sorter: true,
|
|
|
- width: 80,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '销售量',
|
|
|
- dataIndex: 'amount',
|
|
|
- sorter: true,
|
|
|
- width: 80,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '市场价',
|
|
|
- dataIndex: 'marketingUnit',
|
|
|
- sorter: true,
|
|
|
- width: 80,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '下单时间',
|
|
|
- dataIndex: 'createTime',
|
|
|
- sorter: true,
|
|
|
- width: 140,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '上架状态',
|
|
|
- dataIndex: 'isLaunched',
|
|
|
- width: 180,
|
|
|
- customRender: ({ record }) => {
|
|
|
- if (!Reflect.has(record, 'pendingStatus')) {
|
|
|
- record.pendingStatus = false;
|
|
|
- }
|
|
|
- return h(Switch, {
|
|
|
- checked: record.isLaunched,
|
|
|
- checkedChildren: '上架',
|
|
|
- unCheckedChildren: '下架',
|
|
|
- loading: false,
|
|
|
- onChange(checked: boolean) {
|
|
|
- record.pendingStatus = true;
|
|
|
- const newStatus = checked ? '1' : '0';
|
|
|
- const { createMessage } = useMessage();
|
|
|
- createMessage.info(`暂未接入` + newStatus);
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: '',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- fixed: 'right',
|
|
|
- width: 140,
|
|
|
- },
|
|
|
- ];
|
|
|
-
|
|
|
- const searchForm: Partial<FormProps> = {
|
|
|
- labelWidth: 100,
|
|
|
- schemas: [
|
|
|
- {
|
|
|
- field: 'orderNo',
|
|
|
- label: '商品名称',
|
|
|
- component: 'Input',
|
|
|
- colProps: {
|
|
|
- xl: 5,
|
|
|
- xxl: 5,
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
|
|
|
const [registerTable] = useTable({
|
|
|
title: '商品列表',
|