浏览代码

Merge branch 'feature/mockApi' of http://face3d.4dage.com:7005/zhangyupeng/zfb_mp into feature/mockApi

tangning 3 年之前
父节点
当前提交
ba14f5e4fb

二进制
public/resource/img/pic_bg@2x.png


+ 2 - 1
src/api/device/list.ts

@@ -14,7 +14,8 @@ enum Api {
 export const ListApi = (params: PageParams) =>
   defHttp.post<RentListGetResultModel>({
     url: Api.pageList,
-    params,
+    params: params,
+    // data: params,
     headers: {
       // @ts-ignore
       ignoreCancelToken: true,

+ 17 - 1
src/api/order/list.ts

@@ -1,5 +1,11 @@
 import { defHttp } from '/@/utils/http/axios';
-import { OrderInfoParams, PageParams, ListGetResultModel } from './model';
+import {
+  OrderInfoParams,
+  PageParams,
+  ListGetResultModel,
+  ExportExcelParams,
+  ExportExcelModel,
+} from './model';
 
 enum Api {
   pageList = '/basic-api/order/list',
@@ -7,6 +13,7 @@ enum Api {
   shippingList = '/basic-api/shipping/list',
   brandList = '/basic-api/brand/queryAll',
   sendGoods = '/basic-api/order/sendGoods',
+  exportExcel = '/basic-api/order/export',
 }
 
 /**
@@ -61,3 +68,12 @@ export const GetOrderInfoApi = (params: OrderInfoParams) =>
       ignoreCancelToken: true,
     },
   });
+export const exportExcelApi = (params: ExportExcelParams) =>
+  defHttp.post<ExportExcelModel>({
+    url: Api.exportExcel,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 6 - 0
src/api/order/model.ts

@@ -4,6 +4,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
  */
 export type PageParams = BasicPageParams;
 
+export interface ExportExcelParams {
+  orderSnList: string;
+}
 export interface OrderInfoParams {
   id: number;
   brandId: number;
@@ -18,6 +21,9 @@ export interface OrderListItem {
   isShow: boolean;
 }
 
+export interface ExportExcelModel {
+  url: string;
+}
 /**
  * @description: Request list return value
  */

+ 15 - 0
src/api/product/category.ts

@@ -1,5 +1,6 @@
 import { defHttp } from '/@/utils/http/axios';
 import { PageParams, updateItem, RentListGetResultModel } from './model';
+import { Result, UploadFileParams } from '/#/axios';
 
 enum Api {
   category = '/basic-api/category/queryAll',
@@ -7,6 +8,7 @@ enum Api {
   delete = '/basic-api/specification/delete',
   update = '/basic-api/specification/update',
   save = '/basic-api/specification/save',
+  uploadBanner = '/basic-api/sys/oss/upload',
 }
 
 /**
@@ -62,3 +64,16 @@ export const attributeDleteApi = (params: string) =>
       ignoreCancelToken: true,
     },
   });
+
+export function uploadBannerApi(
+  params: UploadFileParams,
+  onUploadProgress: (progressEvent: ProgressEvent) => void,
+) {
+  return defHttp.uploadFile<Result>(
+    {
+      url: Api.uploadBanner,
+      onUploadProgress,
+    },
+    params,
+  );
+}

+ 1 - 0
src/utils/treeUtils.ts

@@ -5,6 +5,7 @@ export interface TreeNode {
   parentId: number;
   name: string;
   key?: string;
+  level?: string;
   children?: TreeNode[];
 }
 export interface TreeMenuNode {

+ 40 - 39
src/views/devices/list.vue

@@ -108,48 +108,41 @@
       const searchForm: Partial<FormProps> = {
         labelWidth: 100,
         schemas: [
+          // {
+          //   field: 'part',
+          //   component: 'Select',
+          //   label: t('routes.devices.deviceList'),
+          //   defaultValue: '1',
+          //   colProps: {
+          //     span: 4,
+          //   },
+          //   componentProps: {
+          //     options: [
+          //       {
+          //         label: '全部',
+          //         value: '1',
+          //         key: '1',
+          //       },
+          //       {
+          //         label: '正常',
+          //         value: '2',
+          //         key: '2',
+          //       },
+          //       {
+          //         label: '已关闭',
+          //         value: '2',
+          //         key: '2',
+          //       },
+          //     ],
+          //   },
+          // },
           {
-            field: 'part',
-            component: 'Select',
-            label: t('routes.devices.deviceList'),
-            defaultValue: '1',
-            colProps: {
-              span: 4,
-            },
-            componentProps: {
-              options: [
-                {
-                  label: '全部',
-                  value: '1',
-                  key: '1',
-                },
-                {
-                  label: '正常',
-                  value: '2',
-                  key: '2',
-                },
-                {
-                  label: '已关闭',
-                  value: '2',
-                  key: '2',
-                },
-              ],
-            },
-          },
-          {
-            field: 'phone',
-            label: '手机号',
+            field: 'searchKey',
+            label: '手机号(用户名)',
+            labelWidth: 160,
             component: 'Input',
             colProps: {
-              span: 6,
-            },
-          },
-          {
-            field: 'fieldTime',
-            component: 'RangePicker',
-            label: '时间字段',
-            colProps: {
-              span: 8,
+              span: 12,
             },
           },
         ],
@@ -171,6 +164,14 @@
           listField: 'list',
           totalField: 'totalCount',
         },
+        handleSearchInfoFn: function (searchData) {
+          if (searchData.fieldTime) {
+            searchData.startDate = searchData.fieldTime[0];
+            searchData.endDate = searchData.fieldTime[1];
+            delete searchData.fieldTime;
+          }
+          return searchData;
+        },
       });
       // pagination.value = { pageSize: 20 };
       function rendercameraTypeLabel(cameraType: number): string {

+ 53 - 20
src/views/order/list.vue

@@ -2,7 +2,7 @@
   <div class="p-4">
     <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
       <template #toolbar>
-        <!-- <a-button type="primary" @click="sendPackage"> 发货</a-button> -->
+        <a-button type="primary" @click="exportExcel"> 导出</a-button>
         <PopConfirmButton
           title="是否确定收货?"
           primary
@@ -57,6 +57,7 @@
       </template>
     </BasicTable>
     <ConfirmModal @register="registerConfirmModal" @reload="reload" />
+    <PrintModal @register="registerPrintModal" @reload="reload" />
   </div>
 </template>
 <script lang="ts">
@@ -70,19 +71,34 @@
     TableImg,
   } from '/@/components/Table';
   import { useMessage } from '/@/hooks/web/useMessage';
-  // import { Switch } from 'ant-design-vue';
-  // import { h } from 'vue';
-  import { ListApi, BrandListApi } from '/@/api/order/list';
+
+  import { ListApi, BrandListApi, GetOrderInfoApi, exportExcelApi } from '/@/api/order/list';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
   import { Time } from '/@/components/Time';
   import { PopConfirmButton } from '/@/components/Button';
-  import printJS from 'print-js';
+
   import { useModal } from '/@/components/Modal';
   import ConfirmModal from './confirmModal.vue';
+  import PrintModal from './printModal.vue';
+  import {
+    downloadByUrl,
+    // downloadByData,
+    // downloadByBase64,
+    // downloadByOnlineUrl,
+  } from '/@/utils/file/download';
+
   export default defineComponent({
-    components: { BasicTable, TableAction, TableImg, Time, PopConfirmButton, ConfirmModal },
+    components: {
+      BasicTable,
+      TableAction,
+      TableImg,
+      Time,
+      PopConfirmButton,
+      ConfirmModal,
+      PrintModal,
+    },
     setup() {
       const { createMessage } = useMessage();
       const go = useGo();
@@ -254,7 +270,9 @@
 
       const [registerConfirmModal, { openModal: openConfirmModal }] = useModal();
 
-      const [registerTable, { getSelectRowKeys, reload }] = useTable({
+      const [registerPrintModal, { openModal: openPrintModal }] = useModal();
+
+      const [registerTable, { getSelectRowKeys, getSelectRows, reload }] = useTable({
         title: '订单列表',
         api: ListApi,
         columns: columns,
@@ -266,6 +284,7 @@
         showIndexColumn: false,
         rowKey: 'id',
         pagination: { pageSize: 20 },
+        ellipsis: false,
         fetchSetting: {
           pageField: 'page',
           sizeField: 'limit',
@@ -337,21 +356,33 @@
           return;
         }
       }
-      function printDetail(record: Recordable) {
+      async function printDetail(record: Recordable) {
         console.log('record', record);
-        printJS({
-          printable: [
-            { name: '订单号', email: '20210908174503807397842', phone: '123' },
-            { name: 'qq', email: '456@gmail.com', phone: '456' },
-          ],
-          properties: ['name', 'email', 'phone'],
-          type: 'json',
-          gridHeaderStyle: 'color: red;  border: 2px solid #3971A5;',
-          gridStyle: 'border: 2px solid #3971A5;',
-          header: '<h3 class="custom-h3">订单详情</h3>',
-          documentTitle: '订单详情',
-          style: '.custom-h3 { color: red; }',
+        const orderInfo = await GetOrderInfoApi({
+          id: record.id,
+          brandId: record.brandId,
         });
+        console.log('orderInfo', orderInfo);
+        openPrintModal(true, orderInfo);
+      }
+      async function exportExcel() {
+        const rows = getSelectRows();
+        if (rows.length === 0) {
+          createMessage.info(t('modal.atLeastOne'));
+          return;
+        }
+
+        const data = rows.reduce((pre, current) => pre.concat(current['orderSn']), []).join(',');
+        console.log('data', data);
+        const res = await exportExcelApi({
+          orderSnList: data,
+        });
+        if (res.url) {
+          downloadByUrl({
+            url: res.url,
+            target: '_self',
+          });
+        }
       }
 
       return {
@@ -369,6 +400,8 @@
         registerConfirmModal,
         reload,
         printDetail,
+        registerPrintModal,
+        exportExcel,
       };
     },
   });

+ 149 - 0
src/views/order/printModal.vue

@@ -0,0 +1,149 @@
+<template>
+  <BasicModal v-bind="$attrs" @register="register" title="打印票据" width="80%">
+    <BasicTable @register="registerTable" id="printTable">
+      <template #tableTitle>
+        <div class="pb-30px pl-15px">
+          <address>
+            <div
+              ><strong>{{ modalRecord.consignee }}</strong></div
+            >
+            <div>{{ modalRecord.address }}</div>
+            <abbr title="phone"> 联系方式: </abbr> {{ modalRecord.mobile }}
+          </address>
+        </div>
+      </template>
+
+      <template #toolbar>
+        <div class="pb-30px pl-15px">
+          <div
+            ><strong>单据编号 :</strong>
+            <span style="color: #1ab394">{{ modalRecord.orderSn }}</span></div
+          >
+          <div><strong>日期 :</strong> : <Time :value="modalRecord.addTime" mode="datetime" /></div>
+        </div>
+      </template>
+      <template #footer>
+        <div style="text-align: right; min-width: 100px"> 总计:¥{{ modalRecord.goodsPrice }} </div>
+      </template>
+      <template #retailPrice="{ record }">
+        <div>¥{{ record.retailPrice }} </div>
+      </template>
+      <template #marketPrice="{ record }">
+        <div>¥{{ record.marketPrice }} </div>
+      </template>
+    </BasicTable>
+
+    <template #footer>
+      <a-button type="primary" @click="handlePrint" class="mr-2">打印</a-button>
+    </template>
+  </BasicModal>
+</template>
+<script lang="ts">
+  // reactive
+  import { defineComponent, nextTick, reactive } from 'vue';
+  import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { cloneDeep } from 'lodash-es';
+  import { Time } from '/@/components/Time';
+  import printJS from 'print-js';
+  export default defineComponent({
+    name: 'PrintModal',
+    components: { BasicModal, BasicTable, Time },
+    emits: ['success', 'register', 'reload'],
+    setup() {
+      // const isUpdate = ref(true);
+      let modalRecord = reactive({
+        id: 0,
+        address: '',
+        consignee: '',
+        mobile: '',
+        orderSn: '',
+        addTime: '',
+        goodsPrice: '',
+      });
+      const columns: BasicColumn[] = [
+        {
+          title: '清单',
+          dataIndex: 'goodsName',
+          width: 180,
+        },
+        {
+          title: '数量',
+          dataIndex: 'number',
+          ellipsis: false,
+          width: 180,
+        },
+        {
+          title: '单价',
+          dataIndex: 'retailPrice',
+          ellipsis: false,
+          width: 180,
+          slots: { customRender: 'retailPrice' },
+        },
+        {
+          title: '总价',
+          dataIndex: 'marketPrice',
+          ellipsis: false,
+          width: 180,
+          slots: { customRender: 'marketPrice' },
+        },
+      ];
+
+      const [registerTable, { setTableData, redoHeight }] = useTable({
+        title: '订单列表',
+
+        columns: columns,
+        // useSearchForm: false,
+        // formConfig: searchForm,
+        // clickToRowSelect: false,
+        // showTableSetting: true,
+        // tableSetting: { fullScreen: true },
+        showIndexColumn: false,
+        // maxHeight: 250,
+        // resizeHeightOffset: 0,
+        isCanResizeParent: true,
+        // rowKey: 'id',
+        pagination: false,
+
+        bordered: true,
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      function onDataReceive(data) {
+        console.log('data', data);
+        // modalRecord = { ...cloneDeep(data) };
+        // console.log('modalRecord', modalRecord);
+        modalRecord.consignee = data.consignee;
+        modalRecord.address = data.address;
+        modalRecord.mobile = data.mobile;
+        modalRecord.orderSn = data.orderSn;
+        modalRecord.addTime = data.addTime;
+        modalRecord.goodsPrice = data.goodsPrice;
+        // modalRecord.brandId = data.brandId;
+
+        nextTick(() => {
+          setTableData(cloneDeep(data.goodsList));
+          redoHeight();
+        });
+      }
+      async function handlePrint() {
+        printJS({
+          printable: 'printTable',
+          type: 'html',
+          style: 'table th td { border: 1px solid black; border-collapse: collapse; }  }',
+        });
+      }
+
+      return {
+        register,
+
+        closeModal,
+        registerTable,
+        modalRecord,
+        handlePrint,
+      };
+    },
+  });
+</script>

+ 164 - 0
src/views/product/addCategoryModal.vue

@@ -0,0 +1,164 @@
+<!-- bannerUrl: ""
+iconUrl: ""
+imgUrl: ""
+isShow: "0"
+level: "L1"
+name: "test"
+type: 0
+wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-oss-process=image/resize,m_fixed,w_100,h_100" -->
+<template>
+  <BasicModal v-bind="$attrs" @register="register" title="新 增" @ok="handleOk">
+    <div class="pt-3px pr-3px">
+      <BasicForm @register="registerForm" :model="model" />
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref } from 'vue';
+  import { categoryApi, uploadBannerApi } from '/@/api/product/category';
+  import { TreeNode } from '/@/utils/treeUtils';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+
+  const isLevel2 = (type: string) => type === 'L2';
+  const schemas: FormSchema[] = [
+    {
+      field: 'name',
+      component: 'Input',
+      label: '分类名称',
+      colProps: {
+        span: 24,
+      },
+      required: true,
+    },
+    {
+      field: 'level',
+      component: 'RadioGroup',
+      label: '级别',
+      defaultValue: 'L1',
+      colProps: {
+        span: 24,
+      },
+      componentProps: {
+        options: [
+          {
+            label: '一级分类',
+            value: 'L1',
+          },
+          {
+            label: '二级分类',
+            value: 'L2',
+          },
+        ],
+      },
+    },
+
+    {
+      field: 'parent_id',
+      component: 'ApiSelect',
+      label: '上级分类',
+      ifShow: ({ values }) => isLevel2(values.level),
+      colProps: {
+        span: 18,
+      },
+      componentProps: {
+        api: async function (params) {
+          console.log('params', params);
+          const res = (await categoryApi(params)) as any as TreeNode[];
+          // const treeData = makeTree(res);
+          return res.filter((i) => i.level === 'L1');
+        },
+        labelField: 'name',
+        valueField: 'id',
+      },
+    },
+    {
+      field: 'isShow',
+      component: 'RadioGroup',
+      label: '是否显示',
+      defaultValue: '1',
+      colProps: {
+        span: 24,
+      },
+      componentProps: {
+        options: [
+          {
+            label: '不显示',
+            value: '0',
+          },
+          {
+            label: '显示',
+            value: '1',
+          },
+        ],
+      },
+    },
+    {
+      field: 'type',
+      component: 'InputNumber',
+      label: '排序',
+      defaultValue: 1,
+      colProps: {
+        span: 24,
+      },
+    },
+    {
+      field: 'wapBannerUrl',
+      component: 'Upload',
+      label: '主图',
+      rules: [{ required: true, message: '请选择上传文件' }],
+      componentProps: {
+        api: uploadBannerApi,
+        maxNumber: 1,
+        afterFetch: function (data) {
+          Reflect.set(data, 'url', data.message.url);
+          return data;
+        },
+      },
+      required: true,
+    },
+  ];
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    setup() {
+      const modelRef = ref({});
+      const [
+        registerForm,
+        {
+          // setFieldsValue,
+          getFieldsValue,
+        },
+      ] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+
+      function onDataReceive(data) {
+        console.log('Data Received', data);
+
+        modelRef.value = { field2: data.data, field1: data.info };
+      }
+
+      async function handleOk() {
+        let data = getFieldsValue();
+        console.log('data', data);
+        // let res = await saveItemApi(data);
+
+        closeModal();
+      }
+
+      return { register, schemas, registerForm, model: modelRef, handleOk };
+    },
+  });
+</script>

+ 36 - 26
src/views/product/category.vue

@@ -1,29 +1,32 @@
 <template>
-  <BasicTable @register="registerTable">
-    <template #toolbar>
-      <a-button primary color="error" @click="handleCreate"> 新增商品分类</a-button>
-      <a-button ghost color="warning" @click="expandAll">展开全部</a-button>
-      <a-button type="primary" @click="collapseAll">折叠全部</a-button>
-    </template>
-    <template #action="{ record }">
-      <TableAction
-        :actions="[
-          {
-            icon: 'clarity:note-edit-line',
-            onClick: handleEdit.bind(null, record),
-          },
-          {
-            icon: 'ant-design:delete-outlined',
-            color: 'error',
-            popConfirm: {
-              title: '是否确认删除',
-              confirm: handleDelete.bind(null, record),
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button primary color="error" @click="handleCreate"> 新增商品分类</a-button>
+        <a-button ghost color="warning" @click="expandAll">展开全部</a-button>
+        <a-button type="primary" @click="collapseAll">折叠全部</a-button>
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              icon: 'clarity:note-edit-line',
+              onClick: handleEdit.bind(null, record),
             },
-          },
-        ]"
-      />
-    </template>
-  </BasicTable>
+            {
+              icon: 'ant-design:delete-outlined',
+              color: 'error',
+              popConfirm: {
+                title: '是否确认删除',
+                confirm: handleDelete.bind(null, record),
+              },
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <addCategoryModal @register="registeraddCategoryModal" />
+  </div>
 </template>
 
 <script lang="ts">
@@ -36,8 +39,11 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { makeTree } from '/@/utils/treeUtils';
 
+  import addCategoryModal from './addCategoryModal.vue';
+  import { useModal } from '/@/components/Modal';
+
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, addCategoryModal },
     setup() {
       const { createMessage } = useMessage();
 
@@ -84,6 +90,7 @@
           width: 180,
         },
       ];
+      const [registeraddCategoryModal, { openModal }] = useModal();
 
       const [registerTable, { expandAll, collapseAll }] = useTable({
         title: '商品分类',
@@ -111,7 +118,9 @@
         },
       });
 
-      function handleCreate() {}
+      function handleCreate(record: Recordable) {
+        openModal(true, record);
+      }
       function handleEdit() {}
       function handleDelete() {}
       return {
@@ -123,6 +132,7 @@
         handleDelete,
         expandAll,
         collapseAll,
+        registeraddCategoryModal,
       };
     },
   });

+ 0 - 48
src/views/product/list.vue

@@ -1,51 +1,3 @@
-<!-- 
-ddTime: 1631589637000
-appExclusivePrice: null
-attributeCategory: null
-attributeCategoryName: null
-attributeEntityList: []
-brandId: 1046505
-brandName: "0907更新部署直播间"
-categoryId: 1036110
-categoryName: "6041分类"
-counterPrice: null
-createUserDeptId: 176
-createUserId: 247
-extraPrice: null
-ggContent: "[{\"value\":\"32\",\"picUrl\":\"https://4dkk.4dage.com/shop/huafa/20210914/11201310556ed1.png\",\"uuid\":\"1-1\",\"specificationId\":50,\"inputVal\":{\"goodsNumber\":\"\",\"goodsSn\":\"\",\"retailPrice\":\"\",\"marketPrice\":\"\"}}]"
-goodsBrief: null
-goodsDesc: ""
-goodsImgList: []
-goodsNumber: 45
-goodsSimpleDesc: "1234"
-goodsSn: "2314"
-goodsSpecificationList: []
-goodsUnit: null
-guigeArr: "[{\"name\":\"test数据\",\"val\":[{\"name\":\"32\",\"picUrl\":\"https://4dkk.4dage.com/shop/huafa/20210914/11201310556ed1.png\",\"uuid\":\"1-1\"}],\"show\":false,\"picUrl\":\"\",\"specificationId\":50}]"
-id: 77006332
-isAppExclusive: 0
-isDelete: 0
-isHot: 0
-isLimited: 0
-isNew: 1
-isOnSale: 0
-keywords: null
-listPicUrl: "https://4dkk.4dage.com/shop/huafa/20210914/11203269611dc.png?x-oss-process=image/resize,m_fixed,w_400,h_400"
-marketPrice: 1233
-name: "3214"
-primaryPicUrl: "https://4dkk.4dage.com/shop/huafa/20210914/112028835f7db0.png?x-oss-process=image/resize,m_fixed,w_300,h_300"
-primaryProductId: null
-productList: []
-promotionDesc: null
-promotionTag: null
-realShopUrl: null
-retailPrice: 1233
-sellVolume: null
-sortOrder: null
-unitPrice: null
-updateTime: 1631589637000
-updateUserId: 247 
--->
 <template>
   <div>
     <BasicTable

+ 1 - 0
src/views/scenes/bindModal.vue

@@ -146,6 +146,7 @@
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
         immediate: false,
+        isCanResizeParent: true,
         rowKey: 'id',
         pagination: false,
         clickToRowSelect: false,

+ 25 - 10
src/views/scenes/list.vue

@@ -1,11 +1,19 @@
 <template>
   <div class="p-4">
-    <BasicTable @register="registerTable">
-      <template #toolbar> </template>
-      <template #cover="{ record }">
-        <TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
+    <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
+      <template #toolbar>
+        <a-button type="primary" @click="() => {}"> 新增</a-button>
+        <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
+        <a-button type="primary" color="error" @click="() => {}"> 删除</a-button>
       </template>
 
+      <template #cover="{ record }">
+        <TableImg
+          :size="120"
+          :simpleShow="true"
+          :imgList="[record.appListPicUrl || '/resource/img/pic_bg@2x.png']"
+        />
+      </template>
       <template #action="{ record }">
         <TableAction
           :actions="[
@@ -68,12 +76,12 @@
       const { t } = useI18n();
 
       const columns: BasicColumn[] = [
-        // {
-        //   title: 'ID',
-        //   dataIndex: 'id',
-        //   fixed: 'left',
-        //   width: 80,
-        // },
+        {
+          title: 'ID',
+          dataIndex: 'id',
+          width: 80,
+          defaultHidden: true,
+        },
         {
           title: t('routes.scenes.sceneName'),
           dataIndex: 'sceneName',
@@ -93,6 +101,12 @@
           width: 180,
         },
         {
+          title: t('routes.scenes.appListPicUrl'),
+          dataIndex: 'appListPicUrl',
+          slots: { customRender: 'cover' },
+          width: 150,
+        },
+        {
           title: t('routes.scenes.childName'),
           dataIndex: 'childName',
           width: 120,
@@ -181,6 +195,7 @@
         formConfig: searchForm,
         showTableSetting: true,
         tableSetting: { fullScreen: true },
+        clickToRowSelect: false,
         showIndexColumn: false,
         rowKey: 'id',
         //TODO

+ 31 - 21
src/views/scenes/live.vue

@@ -1,7 +1,11 @@
 <template>
   <div class="p-4">
-    <BasicTable @register="registerTable">
-      <template #toolbar> </template>
+    <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
+      <template #toolbar>
+        <a-button type="primary" @click="() => {}"> 新增</a-button>
+        <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button> -->
+        <!-- <a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
+      </template>
       <template #cover="{ record }">
         <TableImg
           v-if="record.appListPicUrl"
@@ -19,21 +23,26 @@
             {
               icon: 'eos-icons:role-binding',
               label: t('routes.scenes.bindAnchor'),
-              color: 'warning',
+              color: 'success',
               onClick: handleBindAnchor.bind(null, record),
             },
-
-            // {
-            //   icon: 'ant-design:delete-outlined',
-            //   color: 'error',
-            //   label: '删除',
-            //   popConfirm: {
-            //     title: '是否确认删除',
-            //     confirm: () => {
-            //       createMessage.info(`暂未接入`);
-            //     },
-            //   },
-            // },
+            {
+              icon: 'ant-design:delete-outlined',
+              color: 'warning',
+              label: '编辑',
+              onClick: () => {},
+            },
+            {
+              icon: 'ant-design:delete-outlined',
+              color: 'error',
+              label: '删除',
+              popConfirm: {
+                title: '是否确认删除',
+                confirm: () => {
+                  createMessage.info(`暂未接入`);
+                },
+              },
+            },
           ]"
         />
       </template>
@@ -117,7 +126,7 @@
           dataIndex: 'livestreamStatus',
           width: 180,
           customRender: ({ record }) => {
-            const enable = record.livestreamStatus === 0;
+            const enable = record.livestreamStatus === 1;
             const color = enable ? 'green' : 'red';
             const text = enable ? t('common.yes') : t('common.no');
             return h(Tag, { color: color }, () => text);
@@ -150,7 +159,7 @@
           title: t('common.operation'),
           dataIndex: '',
           slots: { customRender: 'action' },
-          width: 120,
+          width: 230,
           fixed: 'right',
         },
       ];
@@ -200,16 +209,16 @@
                 {
                   label: t('common.all'),
                   value: '',
-                  key: '1',
+                  key: '0',
                 },
                 {
                   label: t('common.yes'),
-                  value: '',
-                  key: '2',
+                  value: 1,
+                  key: '1',
                 },
                 {
                   label: t('common.no'),
-                  value: '0',
+                  value: 0,
                   key: '2',
                 },
               ],
@@ -243,6 +252,7 @@
         showIndexColumn: false,
         rowKey: 'id',
         pagination: { pageSize: 20 },
+        clickToRowSelect: false,
         fetchSetting: {
           pageField: 'page',
           sizeField: 'limit',

+ 2 - 2
src/views/system/account/account.data.ts

@@ -47,13 +47,13 @@ export const columns: BasicColumn[] = [
 
 export const searchFormSchema: FormSchema[] = [
   {
-    field: 'account',
+    field: 'userName',
     label: '用户名',
     component: 'Input',
     colProps: { span: 8 },
   },
   {
-    field: 'nickname',
+    field: 'nickName',
     label: '昵称',
     component: 'Input',
     colProps: { span: 8 },