Browse Source

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

tangning 3 years ago
parent
commit
fd418f78ce

+ 1 - 0
package.json

@@ -46,6 +46,7 @@
     "dayjs": "^1.10.7",
     "dayjs": "^1.10.7",
     "echarts": "^5.2.2",
     "echarts": "^5.2.2",
     "intro.js": "^4.3.0",
     "intro.js": "^4.3.0",
+    "js-base64": "^3.7.2",
     "lodash-es": "^4.17.21",
     "lodash-es": "^4.17.21",
     "mockjs": "^1.1.0",
     "mockjs": "^1.1.0",
     "moment": "^2.29.1",
     "moment": "^2.29.1",

+ 6 - 0
pnpm-lock.yaml

@@ -65,6 +65,7 @@ specifiers:
   inquirer: ^8.2.0
   inquirer: ^8.2.0
   intro.js: ^4.3.0
   intro.js: ^4.3.0
   jest: ^27.4.5
   jest: ^27.4.5
+  js-base64: ^3.7.2
   less: ^4.1.2
   less: ^4.1.2
   lint-staged: 12.1.4
   lint-staged: 12.1.4
   lodash-es: ^4.17.21
   lodash-es: ^4.17.21
@@ -138,6 +139,7 @@ dependencies:
   dayjs: 1.10.7
   dayjs: 1.10.7
   echarts: 5.2.2
   echarts: 5.2.2
   intro.js: 4.3.0
   intro.js: 4.3.0
+  js-base64: 3.7.2
   lodash-es: 4.17.21
   lodash-es: 4.17.21
   mockjs: 1.1.0
   mockjs: 1.1.0
   moment: 2.29.1
   moment: 2.29.1
@@ -7768,6 +7770,10 @@ packages:
     resolution: {integrity: sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==}
     resolution: {integrity: sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==}
     dev: true
     dev: true
 
 
+  /js-base64/3.7.2:
+    resolution: {integrity: sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==}
+    dev: false
+
   /js-stringify/1.0.2:
   /js-stringify/1.0.2:
     resolution: {integrity: sha1-Fzb939lyTyijaCrcYjCufk6Weds=}
     resolution: {integrity: sha1-Fzb939lyTyijaCrcYjCufk6Weds=}
     dev: true
     dev: true

+ 35 - 2
src/api/order/list.ts

@@ -1,8 +1,12 @@
 import { defHttp } from '/@/utils/http/axios';
 import { defHttp } from '/@/utils/http/axios';
-import { PageParams, RentListGetResultModel } from './model';
+import { OrderInfoParams, PageParams, ListGetResultModel } from './model';
 
 
 enum Api {
 enum Api {
   pageList = '/basic-api/order/list',
   pageList = '/basic-api/order/list',
+  getOrderInfo = '/basic-api/order/info',
+  shippingList = '/basic-api/shipping/list',
+  brandList = '/basic-api/brand/queryAll',
+  sendGoods = '/basic-api/order/sendGoods',
 }
 }
 
 
 /**
 /**
@@ -10,7 +14,7 @@ enum Api {
  */
  */
 
 
 export const ListApi = (params: PageParams) =>
 export const ListApi = (params: PageParams) =>
-  defHttp.post<RentListGetResultModel>({
+  defHttp.post<ListGetResultModel>({
     url: Api.pageList,
     url: Api.pageList,
     params,
     params,
     headers: {
     headers: {
@@ -18,3 +22,32 @@ export const ListApi = (params: PageParams) =>
       ignoreCancelToken: true,
       ignoreCancelToken: true,
     },
     },
   });
   });
+export const ShippingListApi = (params: PageParams) =>
+  defHttp.post<ListGetResultModel>({
+    url: Api.shippingList,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const BrandListApi = (params: PageParams) =>
+  defHttp.post<ListGetResultModel>({
+    url: Api.brandList,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const GetOrderInfoApi = (params: OrderInfoParams) =>
+  defHttp.get<ListGetResultModel>({
+    url: `${Api.getOrderInfo}/${params.id}/${params.brandId}`,
+    joinTime: false,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

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

@@ -4,6 +4,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
  */
  */
 export type PageParams = BasicPageParams;
 export type PageParams = BasicPageParams;
 
 
+export interface OrderInfoParams {
+  id: number;
+  brandId: number;
+}
+
 export interface OrderListItem {
 export interface OrderListItem {
   id: number;
   id: number;
   name: string;
   name: string;
@@ -16,4 +21,4 @@ export interface OrderListItem {
 /**
 /**
  * @description: Request list return value
  * @description: Request list return value
  */
  */
-export type RentListGetResultModel = BasicFetchResult<OrderListItem>;
+export type ListGetResultModel = BasicFetchResult<OrderListItem>;

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

@@ -1,5 +1,5 @@
 import { defHttp } from '/@/utils/http/axios';
 import { defHttp } from '/@/utils/http/axios';
-import { PageParams, RentListGetResultModel } from './model';
+import { PageParams, ListGetResultModel } from './model';
 
 
 enum Api {
 enum Api {
   pageList = '/basic-api/sys/user/staffList',
   pageList = '/basic-api/sys/user/staffList',
@@ -10,7 +10,7 @@ enum Api {
  */
  */
 
 
 export const ListApi = (params: PageParams) =>
 export const ListApi = (params: PageParams) =>
-  defHttp.get<RentListGetResultModel>({
+  defHttp.get<ListGetResultModel>({
     url: Api.pageList,
     url: Api.pageList,
     params,
     params,
     headers: {
     headers: {

+ 1 - 1
src/api/staff/model.ts

@@ -17,4 +17,4 @@ export interface StaffListItem {
 /**
 /**
  * @description: Request list return value
  * @description: Request list return value
  */
  */
-export type RentListGetResultModel = BasicFetchResult<StaffListItem>;
+export type ListGetResultModel = BasicFetchResult<StaffListItem>;

+ 3 - 3
src/api/sys/model/userModel.ts

@@ -2,8 +2,8 @@
  * @description: Login interface parameters
  * @description: Login interface parameters
  */
  */
 export interface LoginParams {
 export interface LoginParams {
-  username: string;
-  password: string;
+  userName: string;
+  userPassword: string;
   captcha: string;
   captcha: string;
 }
 }
 
 
@@ -39,7 +39,7 @@ export interface RoleInfo {
  * @description: Login interface return value
  * @description: Login interface return value
  */
  */
 export interface LoginResultModel {
 export interface LoginResultModel {
-  userId?: string | number;
+  id?: string | number;
   token: string;
   token: string;
   role?: RoleInfo;
   role?: RoleInfo;
   user: RoleInfo;
   user: RoleInfo;

+ 17 - 8
src/api/sys/user.ts

@@ -2,9 +2,12 @@ import { defHttp } from '/@/utils/http/axios';
 import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel';
 import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel';
 import { encodeStr } from '/@/utils/encodeUtil';
 import { encodeStr } from '/@/utils/encodeUtil';
 import { ErrorMessageMode } from '/#/axios';
 import { ErrorMessageMode } from '/#/axios';
+import { ContentTypeEnum } from '/@/enums/httpEnum';
+import { encode } from 'js-base64';
 
 
 enum Api {
 enum Api {
-  Login = '/basic-api/sys/login',
+  // Login = '/basic-api/sys/login',
+  Login = '/zfb-api/zfb/loginBackground',
   Logout = '/logout',
   Logout = '/logout',
   GetUserInfo = '/basic-api/sys/user/infoAnon',
   GetUserInfo = '/basic-api/sys/user/infoAnon',
   GetPermCode = '/getPermCode',
   GetPermCode = '/getPermCode',
@@ -14,17 +17,23 @@ enum Api {
  * @description: user login api
  * @description: user login api
  */
  */
 export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal') {
 export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal') {
-  const form = new FormData();
-  const encryptPassword: string = encodeStr(window.btoa(params.password));
-  form.append('username', params.username);
-  form.append('password', encryptPassword);
-  form.append('captcha', params.captcha);
+  // const form = new FormData();
+  // const encryptPassword: string = encodeStr(window.btoa(params.password));
+  // form.append('username', params.username);
+  // form.append('password', encryptPassword);
+  // form.append('captcha', params.captcha);
+
+  const paramData: LoginParams = {
+    ...params,
+    userPassword: encodeStr(encode(params.userPassword)),
+  };
+
   return defHttp.post<LoginResultModel>(
   return defHttp.post<LoginResultModel>(
     {
     {
       url: Api.Login,
       url: Api.Login,
       // params,
       // params,
-      params: form,
-      headers: { 'Content-Type': 'multipart/form-data' },
+      params: paramData,
+      headers: { 'Content-Type': ContentTypeEnum.JSON },
     },
     },
     {
     {
       errorMessageMode: mode,
       errorMessageMode: mode,

+ 2 - 2
src/api/system/system.ts

@@ -21,8 +21,8 @@ enum Api {
   IsAccountExist = '/basic-api/system/accountExist',
   IsAccountExist = '/basic-api/system/accountExist',
   DeptList = '/basic-api/sys/dept/list',
   DeptList = '/basic-api/sys/dept/list',
   setRoleStatus = '/basic-api/system/setRoleStatus',
   setRoleStatus = '/basic-api/system/setRoleStatus',
-  MenuList = '/basic-api/sys/menu/queryAll',
-  RolePageList = '/basic-api/sys/role/list',
+  MenuList = '/zfb-api/zfb/shop/sys/menu/queryAll',
+  RolePageList = '/zfb-api/zfb/shop/sys/role/list',
   GetAllRoleList = '/basic-api/system/getAllRoleList',
   GetAllRoleList = '/basic-api/system/getAllRoleList',
 }
 }
 
 

+ 3 - 0
src/locales/lang/en/modal.ts

@@ -0,0 +1,3 @@
+export default {
+  atLeastOne: 'at least chose one please!',
+};

+ 3 - 0
src/locales/lang/zh-CN/modal.ts

@@ -0,0 +1,3 @@
+export default {
+  atLeastOne: '请至少选择一项',
+};

+ 9 - 9
src/router/routes/modules/system.ts

@@ -63,15 +63,15 @@ const system: AppRouteModule = {
       },
       },
       component: () => import('/@/views/dashboard/system/dept/index.vue'),
       component: () => import('/@/views/dashboard/system/dept/index.vue'),
     },
     },
-    {
-      path: 'changePassword',
-      name: 'ChangePassword',
-      meta: {
-        title: t('routes.demo.system.password'),
-        ignoreKeepAlive: true,
-      },
-      component: () => import('/@/views/dashboard/system/password/index.vue'),
-    },
+    // {
+    //   path: 'changePassword',
+    //   name: 'ChangePassword',
+    //   meta: {
+    //     title: t('routes.demo.system.password'),
+    //     ignoreKeepAlive: true,
+    //   },
+    //   component: () => import('/@/views/dashboard/system/password/index.vue'),
+    // },
   ],
   ],
 };
 };
 
 

+ 3 - 3
src/settings/componentSetting.ts

@@ -11,11 +11,11 @@ export default {
       // The field name of the current page passed to the background
       // The field name of the current page passed to the background
       pageField: 'page',
       pageField: 'page',
       // The number field name of each page displayed in the background
       // The number field name of each page displayed in the background
-      sizeField: 'pageSize',
+      sizeField: 'limit',
       // Field name of the form data returned by the interface
       // Field name of the form data returned by the interface
-      listField: 'items',
+      listField: 'list',
       // Total number of tables returned by the interface field name
       // Total number of tables returned by the interface field name
-      totalField: 'total',
+      totalField: 'totalCount',
     },
     },
     // Number of pages that can be selected
     // Number of pages that can be selected
     pageSizeOptions: ['10', '50', '80', '100'],
     pageSizeOptions: ['10', '50', '80', '100'],

+ 12 - 11
src/store/modules/user.ts

@@ -7,7 +7,8 @@ import { PageEnum } from '/@/enums/pageEnum';
 import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY } from '/@/enums/cacheEnum';
 import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY } from '/@/enums/cacheEnum';
 import { getAuthCache, setAuthCache } from '/@/utils/auth';
 import { getAuthCache, setAuthCache } from '/@/utils/auth';
 import { GetUserInfoModel, LoginParams } from '/@/api/sys/model/userModel';
 import { GetUserInfoModel, LoginParams } from '/@/api/sys/model/userModel';
-import { doLogout, getUserInfo, loginApi } from '/@/api/sys/user';
+// doLogout
+import { getUserInfo, loginApi } from '/@/api/sys/user';
 import { useI18n } from '/@/hooks/web/useI18n';
 import { useI18n } from '/@/hooks/web/useI18n';
 import { useMessage } from '/@/hooks/web/useMessage';
 import { useMessage } from '/@/hooks/web/useMessage';
 import { router } from '/@/router';
 import { router } from '/@/router';
@@ -94,10 +95,10 @@ export const useUserStore = defineStore({
       try {
       try {
         const { goHome = true, mode, ...loginParams } = params;
         const { goHome = true, mode, ...loginParams } = params;
         const data = await loginApi(loginParams, mode);
         const data = await loginApi(loginParams, mode);
-        const { token, user } = data;
+        const { id, token } = data;
 
 
-        console.log('user', user);
-        const userID: number = user.userId;
+        console.log('user', data);
+        const userID = Number(id);
 
 
         // save token
         // save token
         this.setToken(token);
         this.setToken(token);
@@ -148,13 +149,13 @@ export const useUserStore = defineStore({
      * @description: logout
      * @description: logout
      */
      */
     async logout(goLogin = false) {
     async logout(goLogin = false) {
-      if (this.getToken) {
-        try {
-          await doLogout();
-        } catch {
-          console.log('注销Token失败');
-        }
-      }
+      // if (this.getToken) {
+      //   try {
+      //     await doLogout();
+      //   } catch {
+      //     console.log('注销Token失败');
+      //   }
+      // }
       this.setToken(undefined);
       this.setToken(undefined);
       this.setSessionTimeout(false);
       this.setSessionTimeout(false);
       this.setUserInfo(null);
       this.setUserInfo(null);

+ 1 - 1
src/views/dashboard/corporation/index.vue

@@ -228,7 +228,7 @@
         registerSubaccountModal,
         registerSubaccountModal,
         handleOpenModal,
         handleOpenModal,
         uploadApi: uploadApi as any,
         uploadApi: uploadApi as any,
-        uploadLogoApi,
+        uploadLogoApi: uploadLogoApi as any,
         tablereload,
         tablereload,
       };
       };
     },
     },

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

@@ -154,6 +154,12 @@
         tableSetting: { fullScreen: true },
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
         showIndexColumn: false,
         rowKey: 'id',
         rowKey: 'id',
+        fetchSetting: {
+          pageField: 'page',
+          sizeField: 'limit',
+          listField: 'list',
+          totalField: 'totalCount',
+        },
       });
       });
       // pagination.value = { pageSize: 20 };
       // pagination.value = { pageSize: 20 };
       function rendercameraTypeLabel(cameraType: number): string {
       function rendercameraTypeLabel(cameraType: number): string {

+ 0 - 5
src/views/dashboard/order/category.vue

@@ -1,5 +0,0 @@
-<template>
-  <div> 设备管理 </div>
-</template>
-
-<script lang="ts" setup></script>

+ 83 - 0
src/views/dashboard/order/confirmModal.vue

@@ -0,0 +1,83 @@
+<template>
+  <BasicModal v-bind="$attrs" @register="register" title="发货" @ok="handleSubmit">
+    <BasicForm @register="registerForm" />
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, reactive } from 'vue';
+  import { BasicForm, useForm, FormSchema } from '/@/components/Form/index';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { ShippingListApi, GetOrderInfoApi } from '/@/api/order/list';
+
+  export default defineComponent({
+    name: 'ConfirmModal',
+    components: { BasicModal, BasicForm },
+    emits: ['success', 'register'],
+    setup() {
+      // const isUpdate = ref(true);
+      let modalRecord = reactive({
+        id: 0,
+        brandId: 0,
+      });
+      const formSchema: FormSchema[] = [
+        {
+          field: 'shippingId',
+          label: '快递公司',
+          component: 'ApiSelect',
+          componentProps: {
+            api: ShippingListApi,
+            resultField: 'list',
+            labelField: 'name',
+            valueField: 'id',
+            immediate: true,
+            params: {
+              page: 1,
+              limit: 1000,
+            },
+          },
+          required: true,
+        },
+        {
+          field: 'orderSn',
+          label: '快递单号',
+          component: 'Input',
+          required: true,
+        },
+      ];
+      const [registerForm, { validate }] = useForm({
+        labelWidth: 120,
+        schemas: formSchema,
+        showActionButtonGroup: false,
+        baseColProps: { lg: 20, md: 20, offset: 1 },
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      function onDataReceive(data) {
+        console.log('data', data);
+        modalRecord.id = data.id;
+        modalRecord.brandId = data.brandId;
+      }
+      async function handleSubmit() {
+        console.log('handleSubmit');
+        try {
+          const values = await validate();
+          console.log('modalRecord', modalRecord);
+          console.log('values', values);
+          const orderInfo = await GetOrderInfoApi(modalRecord);
+          console.log('orderInfo', orderInfo);
+          // Reflect.set(modalRecord, 'shippingNo', values.shippingNo);
+          // Reflect.set(modalRecord, 'shippingId', values.shippingNo);
+        } catch (error) {}
+      }
+
+      return {
+        register,
+        registerForm,
+        handleSubmit,
+        closeModal,
+      };
+    },
+  });
+</script>

+ 116 - 22
src/views/dashboard/order/list.vue

@@ -42,13 +42,17 @@ userId: 17
 userName: "微信用户q0zj95zuo4pv" -->
 userName: "微信用户q0zj95zuo4pv" -->
 <template>
 <template>
   <div class="p-4">
   <div class="p-4">
-    <BasicTable
-      @register="registerTable"
-      :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
-    >
+    <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="sendPackage"> 发货</a-button>
-        <!-- dashed  link  text-->
+        <!-- <a-button type="primary" @click="sendPackage"> 发货</a-button> -->
+        <PopConfirmButton
+          title="是否确定收货?"
+          primary
+          color="error"
+          @confirm="handleConfirmReceive"
+        >
+          确定收货</PopConfirmButton
+        >
       </template>
       </template>
       <template #cover="{ record }">
       <template #cover="{ record }">
         <TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
         <TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
@@ -70,6 +74,12 @@ userName: "微信用户q0zj95zuo4pv" -->
         <TableAction
         <TableAction
           :actions="[
           :actions="[
             {
             {
+              icon: 'mdi:truck-delivery',
+              label: '发货',
+              color: 'warning',
+              onClick: sendPackage.bind(null, record),
+            },
+            {
               icon: 'mdi:information-outline',
               icon: 'mdi:information-outline',
               label: '详情',
               label: '详情',
               onClick: () => {
               onClick: () => {
@@ -88,6 +98,7 @@ userName: "微信用户q0zj95zuo4pv" -->
         />
         />
       </template>
       </template>
     </BasicTable>
     </BasicTable>
+    <ConfirmModal @register="registerConfirmModal" />
   </div>
   </div>
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
@@ -101,17 +112,19 @@ userName: "微信用户q0zj95zuo4pv" -->
     TableImg,
     TableImg,
   } from '/@/components/Table';
   } from '/@/components/Table';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { uploadApi } from '/@/api/sys/upload';
   // import { Switch } from 'ant-design-vue';
   // import { Switch } from 'ant-design-vue';
   // import { h } from 'vue';
   // import { h } from 'vue';
-  import { ListApi } from '/@/api/order/list';
+  import { ListApi, BrandListApi } from '/@/api/order/list';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
   import { useGo } from '/@/hooks/web/usePage';
   import { Time } from '/@/components/Time';
   import { Time } from '/@/components/Time';
+  import { PopConfirmButton } from '/@/components/Button';
 
 
+  import { useModal } from '/@/components/Modal';
+  import ConfirmModal from './confirmModal.vue';
   export default defineComponent({
   export default defineComponent({
-    components: { BasicTable, TableAction, TableImg, Time },
+    components: { BasicTable, TableAction, TableImg, Time, PopConfirmButton, ConfirmModal },
     setup() {
     setup() {
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const go = useGo();
       const go = useGo();
@@ -126,8 +139,8 @@ userName: "微信用户q0zj95zuo4pv" -->
         {
         {
           title: '订单号',
           title: '订单号',
           dataIndex: 'orderSn',
           dataIndex: 'orderSn',
-
-          width: 160,
+          ellipsis: false,
+          width: 180,
         },
         },
         {
         {
           title: '会员昵称',
           title: '会员昵称',
@@ -192,7 +205,8 @@ userName: "微信用户q0zj95zuo4pv" -->
           dataIndex: '',
           dataIndex: '',
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
           fixed: 'right',
           fixed: 'right',
-          width: 140,
+          align: 'center',
+          width: 230,
         },
         },
       ];
       ];
 
 
@@ -200,7 +214,7 @@ userName: "微信用户q0zj95zuo4pv" -->
         labelWidth: 100,
         labelWidth: 100,
         schemas: [
         schemas: [
           {
           {
-            field: 'orderNo',
+            field: 'orderSn',
             label: '订单号',
             label: '订单号',
             component: 'Input',
             component: 'Input',
             colProps: {
             colProps: {
@@ -208,15 +222,87 @@ userName: "微信用户q0zj95zuo4pv" -->
               xxl: 5,
               xxl: 5,
             },
             },
           },
           },
+          {
+            field: 'orderStatus',
+            label: '订单状态',
+            component: 'Select',
+            colProps: {
+              xl: 5,
+              xxl: 5,
+            },
+            componentProps: {
+              options: [
+                {
+                  label: '全部订单',
+                  value: '',
+                  key: '1',
+                },
+                {
+                  label: '待付款',
+                  value: '0',
+                  key: '2',
+                },
+                {
+                  label: '订单已取消',
+                  value: '101',
+                  key: '3',
+                },
+                {
+                  label: '订单已付款',
+                  value: '201',
+                  key: '4',
+                },
+                {
+                  label: '订单已发货',
+                  value: '1',
+                  key: '5',
+                },
+                {
+                  label: '订单已收货',
+                  value: '2',
+                  key: '6',
+                },
+                {
+                  label: '完成',
+                  value: '501',
+                  key: '7',
+                },
+              ],
+            },
+          },
+          {
+            field: 'brandId',
+            label: 'VR场景',
+            component: 'ApiSelect',
+            componentProps: {
+              api: BrandListApi,
+              // resultField: 'list',
+              numberToString: true,
+              labelField: 'name',
+              valueField: 'id',
+              immediate: true,
+              params: {
+                page: 1,
+                limit: 1000,
+              },
+            },
+            colProps: {
+              xl: 5,
+              xxl: 5,
+            },
+          },
         ],
         ],
       };
       };
 
 
-      const [registerTable] = useTable({
+      const [registerConfirmModal, { openModal: openConfirmModal }] = useModal();
+
+      const [registerTable, { getSelectRowKeys }] = useTable({
         title: '订单列表',
         title: '订单列表',
         api: ListApi,
         api: ListApi,
         columns: columns,
         columns: columns,
         useSearchForm: true,
         useSearchForm: true,
         formConfig: searchForm,
         formConfig: searchForm,
+        clickToRowSelect: false,
         showTableSetting: true,
         showTableSetting: true,
         tableSetting: { fullScreen: true },
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
         showIndexColumn: false,
@@ -279,13 +365,20 @@ userName: "微信用户q0zj95zuo4pv" -->
             return '';
             return '';
         }
         }
       }
       }
-
-      function sendPackage() {
-        console.log('sendPackage');
+      // function onSelectChange(selectedRowKeys: (string | number)[]) {
+      //   console.log(selectedRowKeys);
+      //   // checkedKeys.value = selectedRowKeys;
+      // }
+      function sendPackage(record: Recordable) {
+        openConfirmModal(true, record);
       }
       }
-      function onSelectChange(selectedRowKeys: (string | number)[]) {
-        console.log(selectedRowKeys);
-        // checkedKeys.value = selectedRowKeys;
+
+      function handleConfirmReceive() {
+        const keys = getSelectRowKeys();
+        if (keys.length === 0) {
+          createMessage.info(t('modal.atLeastOne'));
+          return;
+        }
       }
       }
 
 
       return {
       return {
@@ -298,8 +391,9 @@ userName: "微信用户q0zj95zuo4pv" -->
         rendershippingStatusLabel,
         rendershippingStatusLabel,
         renderpayStatusLabel,
         renderpayStatusLabel,
         sendPackage,
         sendPackage,
-        onSelectChange,
-        uploadApi: uploadApi as any,
+        // onSelectChange,
+        handleConfirmReceive,
+        registerConfirmModal,
       };
       };
     },
     },
   });
   });

+ 9 - 2
src/views/dashboard/product/category.vue

@@ -98,10 +98,17 @@
           fixed: undefined,
           fixed: undefined,
         },
         },
         afterFetch(data) {
         afterFetch(data) {
-          console.log('11', data);
-          // return [];
+          console.log('data', data);
+          const nest = (items, id = -1, link = 'parentId') =>
+            items
+              .filter((item) => item[link] === id)
+              .map((item) => ({ ...item, children: nest(items, item.id) }));
+
+          console.log('11', nest(data));
+          return nest(data);
         },
         },
       });
       });
+
       function handleCreate() {}
       function handleCreate() {}
       function handleEdit() {}
       function handleEdit() {}
       function handleDelete() {}
       function handleDelete() {}

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

@@ -184,7 +184,7 @@ updateUserId: 247
         const keys = getSelectRowKeys();
         const keys = getSelectRowKeys();
         console.log('key', keys);
         console.log('key', keys);
         if (keys.length === 0) {
         if (keys.length === 0) {
-          createMessage.info('请至少选择一项');
+          createMessage.info(t('modal.atLeastOne'));
           return;
           return;
         }
         }
         handleDelete(keys);
         handleDelete(keys);
@@ -192,9 +192,8 @@ updateUserId: 247
       async function handlePatchEnSale() {
       async function handlePatchEnSale() {
         try {
         try {
           const keys = getSelectRowKeys();
           const keys = getSelectRowKeys();
-          console.log('key', keys);
           if (keys.length === 0) {
           if (keys.length === 0) {
-            createMessage.info('请至少选择一项');
+            createMessage.info(t('modal.atLeastOne'));
             return;
             return;
           }
           }
           await EnSaleApi(keys);
           await EnSaleApi(keys);

+ 18 - 13
src/views/dashboard/staff/list.vue

@@ -8,6 +8,9 @@
       <template #status="{ record }">
       <template #status="{ record }">
         {{ renderStatus(record.status) }}
         {{ renderStatus(record.status) }}
       </template>
       </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
           :actions="[
           :actions="[
@@ -43,9 +46,10 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
   import { useGo } from '/@/hooks/web/usePage';
+  import { Time } from '/@/components/Time';
 
 
   export default defineComponent({
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, Time },
     setup() {
     setup() {
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const go = useGo();
       const go = useGo();
@@ -53,29 +57,29 @@
       const columns: BasicColumn[] = [
       const columns: BasicColumn[] = [
         {
         {
           title: 'ID',
           title: 'ID',
-          dataIndex: 'id',
+          dataIndex: 'userId',
           fixed: 'left',
           fixed: 'left',
           width: 60,
           width: 60,
         },
         },
         {
         {
           title: '所属公司',
           title: '所属公司',
-          dataIndex: 'company',
+          dataIndex: 'deptName',
           width: 160,
           width: 160,
         },
         },
         {
         {
           title: '员工名称',
           title: '员工名称',
-          dataIndex: 'name',
+          dataIndex: 'username',
           width: 80,
           width: 80,
         },
         },
         {
         {
           title: '手机',
           title: '手机',
-          dataIndex: 'phone',
+          dataIndex: 'mobile',
           width: 80,
           width: 80,
         },
         },
         {
         {
           title: '角色',
           title: '角色',
-          dataIndex: 'role',
-          slots: { customRender: 'role' },
+          dataIndex: 'roleName',
+          // slots: { customRender: 'role' },
           sorter: true,
           sorter: true,
           width: 80,
           width: 80,
         },
         },
@@ -90,6 +94,7 @@
         {
         {
           title: '创建时间',
           title: '创建时间',
           dataIndex: 'createTime',
           dataIndex: 'createTime',
+          slots: { customRender: 'createTime' },
           width: 130,
           width: 130,
         },
         },
         // {
         // {
@@ -129,10 +134,10 @@
         pagination: { pageSize: 20 },
         pagination: { pageSize: 20 },
         bordered: true,
         bordered: true,
         fetchSetting: {
         fetchSetting: {
-          pageField: 'pageSize',
-          sizeField: 'pageNum',
-          // listField: 'list',
-          // totalField: 'totalCount',
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'totalCount',
         },
         },
       });
       });
 
 
@@ -148,9 +153,9 @@
       }
       }
       function renderStatus(type: number): string {
       function renderStatus(type: number): string {
         switch (type) {
         switch (type) {
-          case 0:
-            return '正常';
           case 1:
           case 1:
+            return '正常';
+          case 0:
             return '非正常';
             return '非正常';
           default:
           default:
             return '';
             return '';

+ 5 - 0
src/views/dashboard/system/menu/index.vue

@@ -68,8 +68,13 @@
           slots: { customRender: 'action' },
           slots: { customRender: 'action' },
           fixed: undefined,
           fixed: undefined,
         },
         },
+        afterFetch: handleAfterFetch,
       });
       });
 
 
+      function handleAfterFetch(data) {
+        console.log('data', data);
+      }
+
       function handleCreate() {
       function handleCreate() {
         openDrawer(true, {
         openDrawer(true, {
           isUpdate: false,
           isUpdate: false,

+ 3 - 2
src/views/dashboard/system/menu/menu.data.ts

@@ -99,6 +99,7 @@ export const formSchema: FormSchema[] = [
     label: '菜单类型',
     label: '菜单类型',
     component: 'RadioButtonGroup',
     component: 'RadioButtonGroup',
     defaultValue: '0',
     defaultValue: '0',
+
     componentProps: {
     componentProps: {
       options: [
       options: [
         { label: '目录', value: '0' },
         { label: '目录', value: '0' },
@@ -122,8 +123,8 @@ export const formSchema: FormSchema[] = [
     componentProps: {
     componentProps: {
       fieldNames: {
       fieldNames: {
         label: 'name',
         label: 'name',
-        key: 'id',
-        value: 'id',
+        key: 'menuId',
+        value: 'menuId',
       },
       },
       getPopupContainer: () => document.body,
       getPopupContainer: () => document.body,
     },
     },

+ 2 - 2
src/views/dashboard/system/role/role.data.ts

@@ -12,8 +12,8 @@ export const columns: BasicColumn[] = [
     width: 200,
     width: 200,
   },
   },
   {
   {
-    title: '角色值',
-    dataIndex: 'roleValue',
+    title: '所属部门',
+    dataIndex: 'deptName',
     width: 180,
     width: 180,
   },
   },
   {
   {

+ 3 - 3
src/views/sys/login/LoginForm.vue

@@ -180,8 +180,8 @@
     try {
     try {
       loading.value = true;
       loading.value = true;
       const userInfo = await userStore.login({
       const userInfo = await userStore.login({
-        password: data.password,
-        username: data.account,
+        userPassword: data.password,
+        userName: data.account,
         captcha: data.captcha,
         captcha: data.captcha,
         mode: 'none', //不要默认的错误提示
         mode: 'none', //不要默认的错误提示
       });
       });
@@ -189,7 +189,7 @@
       if (userInfo) {
       if (userInfo) {
         notification.success({
         notification.success({
           message: t('sys.login.loginSuccessTitle'),
           message: t('sys.login.loginSuccessTitle'),
-          description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realName}`,
+          description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.username}`,
           duration: 3,
           duration: 3,
         });
         });
       }
       }