瀏覽代碼

feat(api): 旧系统 product api

gemercheung 3 年之前
父節點
當前提交
9f0d8681d1

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

@@ -2,8 +2,9 @@ import { defHttp } from '/@/utils/http/axios';
 import { PageParams, RentListGetResultModel } from './model';
 
 enum Api {
-  pageList = '/basic-api/product/list',
-  category = '/basic-api/product/category',
+  pageList = '/basic-api/brand/brandBindList',
+  category = '/basic-api/category/queryAll',
+  ref = '/basic-api/specification/list',
 }
 
 /**

+ 6 - 1
src/utils/http/axios/index.ts

@@ -57,6 +57,7 @@ const transform: AxiosTransform = {
       data &&
       Reflect.has(data, 'code') &&
       (code === ResultEnum.SUCCESS || code === ResultEnum.NORMAL);
+
     if (hasSuccess) {
       const converterResult = data.message;
       const converterMessage = error;
@@ -81,6 +82,10 @@ const transform: AxiosTransform = {
         if (message) {
           timeoutMsg = message;
         }
+        //TODO 由于后端HACKCODE error当信息string
+        if (error) {
+          timeoutMsg = error;
+        }
     }
 
     // errorMessageMode=‘modal’的时候会显示modal错误弹窗,而不是消息提示,用于一些比较重要的错误
@@ -90,7 +95,7 @@ const transform: AxiosTransform = {
     } else if (options.errorMessageMode === 'message') {
       createMessage.error(timeoutMsg);
     }
-
+    console.log('timeoutMsg', timeoutMsg);
     throw new Error(timeoutMsg || t('sys.api.apiRequestFailed'));
   },
 

+ 28 - 15
src/views/dashboard/feedback/list.vue

@@ -2,9 +2,14 @@
   <div class="p-4">
     <BasicTable @register="registerTable">
       <template #toolbar> </template>
-      <template #feedbackType="{ record }">
-        {{ renderFeedbackType(record.feedbackType) }}
+      <template #feedType="{ record }">
+        {{ renderFeedbackType(record.feedType) }}
       </template>
+
+      <template #addTime="{ record }">
+        <Time :value="record.addTime" mode="datetime" />
+      </template>
+
       <template #action="{ record }">
         <TableAction
           :actions="[
@@ -40,23 +45,24 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
+  import { Time } from '/@/components/Time';
 
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, Time },
     setup() {
       const { createMessage } = useMessage();
       const go = useGo();
       const { t } = useI18n();
       const columns: BasicColumn[] = [
-        {
-          title: 'ID',
-          dataIndex: 'id',
-          fixed: 'left',
-          width: 60,
-        },
+        // {
+        //   title: 'ID',
+        //   dataIndex: 'userId',
+        //   fixed: 'left',
+        //   width: 60,
+        // },
         {
           title: '会员名称',
-          dataIndex: 'name',
+          dataIndex: 'userName',
           width: 160,
         },
         {
@@ -66,13 +72,13 @@
         },
         {
           title: '手机',
-          dataIndex: 'phone',
+          dataIndex: 'mobile',
           width: 80,
         },
         {
           title: '反馈类型',
-          dataIndex: 'feedbackType',
-          slots: { customRender: 'feedbackType' },
+          dataIndex: 'feedType',
+          slots: { customRender: 'feedType' },
           sorter: true,
           width: 80,
         },
@@ -83,7 +89,8 @@
         },
         {
           title: '反馈时间',
-          dataIndex: 'createTime',
+          dataIndex: 'addTime',
+          slots: { customRender: 'addTime' },
           width: 130,
         },
         // {
@@ -119,9 +126,15 @@
         showTableSetting: true,
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
-        rowKey: 'id',
+        // rowKey: 'userId',
         pagination: { pageSize: 20 },
         bordered: true,
+        fetchSetting: {
+          pageField: 'page',
+          sizeField: 'limit',
+          listField: 'list',
+          totalField: 'totalCount',
+        },
       });
 
       function renderFeedbackType(type: number): string {

+ 2 - 2
src/views/dashboard/member/list.vue

@@ -93,7 +93,7 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
         },
         {
           title: '会员名称',
-          dataIndex: 'nickname',
+          dataIndex: 'username',
           sorter: true,
           width: 160,
         },
@@ -125,7 +125,7 @@ weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A"
         },
         {
           title: '微信名',
-          dataIndex: 'username',
+          dataIndex: 'nickname',
           width: 120,
         },
         {

+ 18 - 2
src/views/dashboard/order/list.vue

@@ -42,8 +42,14 @@ userId: 17
 userName: "微信用户q0zj95zuo4pv" -->
 <template>
   <div class="p-4">
-    <BasicTable @register="registerTable">
-      <template #toolbar> </template>
+    <BasicTable
+      @register="registerTable"
+      :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
+    >
+      <template #toolbar>
+        <a-button type="primary" @click="sendPackage"> 发货</a-button>
+        <!-- dashed  link  text-->
+      </template>
       <template #cover="{ record }">
         <TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
       </template>
@@ -274,6 +280,14 @@ userName: "微信用户q0zj95zuo4pv" -->
         }
       }
 
+      function sendPackage() {
+        console.log('sendPackage');
+      }
+      function onSelectChange(selectedRowKeys: (string | number)[]) {
+        console.log(selectedRowKeys);
+        // checkedKeys.value = selectedRowKeys;
+      }
+
       return {
         registerTable,
         createMessage,
@@ -283,6 +297,8 @@ userName: "微信用户q0zj95zuo4pv" -->
         renderOrderStatusLabel,
         rendershippingStatusLabel,
         renderpayStatusLabel,
+        sendPackage,
+        onSelectChange,
         uploadApi: uploadApi as any,
       };
     },

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

@@ -72,6 +72,12 @@
         rowKey: 'id',
         pagination: { pageSize: 20 },
         bordered: true,
+        fetchSetting: {
+          pageField: 'page',
+          sizeField: 'limit',
+          listField: 'list',
+          totalField: 'totalCount',
+        },
       });
 
       function renderProductTypeLabel(type: number): string {