浏览代码

feat(api): 旧系统 goods list

gemercheung 3 年之前
父节点
当前提交
25b5eca1c2

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

@@ -10,7 +10,7 @@ enum Api {
  */
 
 export const ListApi = (params: PageParams) =>
-  defHttp.get<RentListGetResultModel>({
+  defHttp.post<RentListGetResultModel>({
     url: Api.pageList,
     params,
     headers: {

+ 2 - 2
src/api/product/list.ts

@@ -2,7 +2,7 @@ import { defHttp } from '/@/utils/http/axios';
 import { PageParams, RentListGetResultModel } from './model';
 
 enum Api {
-  pageList = '/basic-api/brand/brandBindList',
+  pageList = '/basic-api/goods/list',
   ref = '/basic-api/specification/list',
 }
 
@@ -11,7 +11,7 @@ enum Api {
  */
 
 export const ListApi = (params: PageParams) =>
-  defHttp.get<RentListGetResultModel>({
+  defHttp.post<RentListGetResultModel>({
     url: Api.pageList,
     params,
     headers: {

+ 8 - 4
src/views/dashboard/product/category.vue

@@ -1,9 +1,9 @@
 <template>
   <BasicTable @register="registerTable">
     <template #toolbar>
-      <a-button type="primary" @click="handleCreate"> 新增商品分类</a-button>
-      <a-button type="warning" @click="expandAll">展开全部</a-button>
-      <a-button type="error" @click="collapseAll">折叠全部</a-button>
+      <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
@@ -83,11 +83,11 @@
         title: '商品分类',
         api: categoryApi,
         columns: columns,
+        isTreeTable: true,
         useSearchForm: true,
         showTableSetting: true,
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
-        isTreeTable: true,
         rowKey: 'id',
         bordered: true,
         actionColumn: {
@@ -97,6 +97,10 @@
           slots: { customRender: 'action' },
           fixed: undefined,
         },
+        afterFetch(data) {
+          console.log('11', data);
+          // return [];
+        },
       });
       function handleCreate() {}
       function handleEdit() {}

+ 19 - 19
src/views/dashboard/product/list.data.ts

@@ -8,7 +8,7 @@ export const searchForm: Partial<FormProps> = {
   labelWidth: 100,
   schemas: [
     {
-      field: 'orderNo',
+      field: 'name',
       label: '商品名称',
       component: 'Input',
       colProps: {
@@ -19,21 +19,20 @@ export const searchForm: Partial<FormProps> = {
   ],
 };
 export const columns: BasicColumn[] = [
-  {
-    title: 'ID',
-    dataIndex: 'id',
-    fixed: 'left',
-    width: 60,
-  },
+  // {
+  //   title: 'ID',
+  //   dataIndex: 'id',
+  //   fixed: 'left',
+  //   width: 60,
+  // },
   {
     title: '商品名称',
     dataIndex: 'name',
-
     width: 160,
   },
   {
     title: '商品描述',
-    dataIndex: 'desc',
+    dataIndex: 'goodsSimpleDesc',
     width: 150,
   },
   {
@@ -51,47 +50,48 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '直播间名称',
-    dataIndex: 'steamRoom',
-    customRender: ({ record }) => {
-      return record.steamRoom.name as unknown as {};
-    },
+    dataIndex: 'brandName',
+    // customRender: ({ record }) => {
+    //   return record.steamRoom.name as unknown as {};
+    // },
     sorter: true,
     width: 120,
   },
   {
     title: '零售价格',
-    dataIndex: 'unit',
+    dataIndex: 'retailPrice',
     sorter: true,
     width: 80,
   },
   {
     title: '销售量',
-    dataIndex: 'amount',
+    dataIndex: 'sellVolume',
     sorter: true,
     width: 80,
   },
   {
     title: '市场价',
-    dataIndex: 'marketingUnit',
+    dataIndex: 'marketPrice',
     sorter: true,
     width: 80,
   },
   {
     title: '下单时间',
-    dataIndex: 'createTime',
+    dataIndex: 'addTime',
+    slots: { customRender: 'addTime' },
     sorter: true,
     width: 140,
   },
   {
     title: '上架状态',
-    dataIndex: 'isLaunched',
+    dataIndex: 'isOnSale',
     width: 180,
     customRender: ({ record }) => {
       if (!Reflect.has(record, 'pendingStatus')) {
         record.pendingStatus = false;
       }
       return h(Switch, {
-        checked: record.isLaunched,
+        checked: record.isOnSale === 1,
         checkedChildren: '上架',
         unCheckedChildren: '下架',
         loading: false,

+ 54 - 2
src/views/dashboard/product/list.vue

@@ -1,3 +1,51 @@
+<!-- 
+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 @register="registerTable">
@@ -9,6 +57,9 @@
       </template>
       <template #orderType="{ record }"> {{ renderProductTypeLabel(record.orderType) }} </template>
 
+      <template #addTime="{ record }">
+        <Time :value="record.addTime" mode="datetime" />
+      </template>
       <template #action="{ record }">
         <TableAction
           :actions="[
@@ -51,9 +102,10 @@
   import ProductDrawer from './productDrawer.vue';
   // import { PageWrapper } from '/@/components/Page';
   import { columns, searchForm } from './list.data';
+  import { Time } from '/@/components/Time';
 
   export default defineComponent({
-    components: { BasicTable, TableAction, ProductDrawer },
+    components: { BasicTable, TableAction, ProductDrawer, Time },
     setup() {
       const { createMessage } = useMessage();
       const go = useGo();
@@ -68,7 +120,7 @@
         formConfig: searchForm,
         showTableSetting: true,
         tableSetting: { fullScreen: true },
-        showIndexColumn: false,
+        showIndexColumn: true,
         rowKey: 'id',
         pagination: { pageSize: 20 },
         bordered: true,

+ 6 - 0
src/views/dashboard/staff/list.vue

@@ -128,6 +128,12 @@
         rowKey: 'id',
         pagination: { pageSize: 20 },
         bordered: true,
+        fetchSetting: {
+          pageField: 'pageSize',
+          sizeField: 'pageNum',
+          // listField: 'list',
+          // totalField: 'totalCount',
+        },
       });
 
       function renderRoleType(type: number): string {