Prechádzať zdrojové kódy

feat: 冲突

cesss

ceessss
tangning 3 rokov pred
rodič
commit
a9eb194ca6

+ 1 - 0
.env.development

@@ -6,6 +6,7 @@ VITE_PUBLIC_PATH = /
 
 # Cross-domain proxy, you can configure multiple
 # Please note that no line breaks
+# http://192.168.0.38:8190/shop
 VITE_PROXY = [["/basic-api","http://192.168.0.47:8190"],["/upload","http://localhost:3300/upload"],["/zfb-api","http://192.168.0.47:7081"]]
 #["/zfb-api","http://192.168.0.47:7081"]]
 # VITE_PROXY=[["/api","https://vvbin.cn/test"]]

+ 2 - 2
mock/_util.ts

@@ -47,7 +47,7 @@ export function pagination<T = any>(pageNo: number, pageSize: number, array: T[]
 export interface requestParams {
   method: string;
   body: any;
-  headers?: { authorization?: string };
+  headers?: { token?: string };
   query: any;
 }
 
@@ -56,5 +56,5 @@ export interface requestParams {
  *
  */
 export function getRequestToken({ headers }: requestParams): string | undefined {
-  return headers?.authorization;
+  return headers?.token;
 }

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "scripts": {
     "bootstrap": "pnpm install",
     "serve": "npm run dev",
-    "dev": "vite --debug",
+    "dev": "vite",
     "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
     "build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
     "build:no-cache": "pnpm clean:cache && npm run build",

+ 3 - 0
src/api/bulletin/model.ts

@@ -3,6 +3,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
  * @description: Request list interface parameters
  */
 export type PageParams = BasicPageParams;
+export interface DeleteParams {
+  id: number;
+}
 
 export interface ListItem {
   id: number;

+ 46 - 3
src/api/bulletin/rent.ts

@@ -1,18 +1,61 @@
 import { defHttp } from '/@/utils/http/axios';
-import { PageParams, RentListGetResultModel } from './model';
+import { PageParams, RentListGetResultModel, DeleteParams } from './model';
 
 enum Api {
   selectHouseByType = '/zfb-api/zfb/house/selectHouseByType',
+  deleteHouse = '/zfb-api/zfb/house/deleteHouse',
 }
 
 /**
  * @description: Get sample list value
  */
 
-export const RentListApi = (params: PageParams) =>
+export const rentListApi = (params: PageParams) =>
   defHttp.post<RentListGetResultModel>({
     url: Api.selectHouseByType,
-    params,
+    params: {
+      type: 1,
+      ...params,
+    },
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const sellListApi = (params: PageParams) =>
+  defHttp.post<RentListGetResultModel>({
+    url: Api.selectHouseByType,
+    params: {
+      type: 2,
+      ...params,
+    },
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const decorationListApi = (params: PageParams) =>
+  defHttp.post<RentListGetResultModel>({
+    url: Api.selectHouseByType,
+    params: {
+      type: 0,
+      ...params,
+    },
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const commonDeleteApi = (params: DeleteParams) =>
+  defHttp.post<RentListGetResultModel>({
+    url: Api.deleteHouse,
+    params: {
+      type: 0,
+      ...params,
+    },
     headers: {
       // @ts-ignore
       ignoreCancelToken: true,

+ 16 - 0
src/api/corporation/list.ts

@@ -1,9 +1,12 @@
 import { defHttp } from '/@/utils/http/axios';
 import { PageParams, CorporationListGetResultModel } from './model';
 
+import { Result, UploadFileParams } from '/#/axios';
+
 enum Api {
   selectCompanyNum = '/zfb-api/zfb/company/selectCompanyNum',
   selectCompanyByType = '/zfb-api/zfb/company/selectCompanyByType',
+  uploadLogo = '/zfb-api/zfb/company/uploadLogo',
 }
 
 /**
@@ -28,3 +31,16 @@ export const ListVerifyApi = (params: PageParams) =>
       ignoreCancelToken: true,
     },
   });
+
+export function uploadLogoApi(
+  params: UploadFileParams,
+  onUploadProgress: (progressEvent: ProgressEvent) => void,
+) {
+  return defHttp.uploadFile<Result>(
+    {
+      url: Api.uploadLogo,
+      onUploadProgress,
+    },
+    params,
+  );
+}

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

@@ -2,7 +2,7 @@ import { defHttp } from '/@/utils/http/axios';
 import { PageParams, RentListGetResultModel } from './model';
 
 enum Api {
-  pageList = '/zfb-api/order/list',
+  pageList = '/basic-api/order/list',
 }
 
 /**

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

@@ -2,7 +2,7 @@ import { defHttp } from '/@/utils/http/axios';
 import { PageParams, RentListGetResultModel } from './model';
 
 enum Api {
-  pageList = '/basic-api/staff/list',
+  pageList = '/basic-api/sys/user/staffList',
 }
 
 /**

+ 10 - 3
src/api/system/system.ts

@@ -11,13 +11,17 @@ import {
   RoleListGetResultModel,
 } from './model/systemModel';
 import { defHttp } from '/@/utils/http/axios';
-
+// import { ContentTypeEnum } from '/@/enums/httpEnum';
+// sys/user/list
+// /sys/role/list
+// sys/menu/queryAll
+// sys/menu/update
 enum Api {
   AccountList = '/basic-api/system/getAccountList',
   IsAccountExist = '/basic-api/system/accountExist',
   DeptList = '/basic-api/system/getDeptList',
   setRoleStatus = '/basic-api/system/setRoleStatus',
-  MenuList = '/basic-api/system/getMenuList',
+  MenuList = '/basic-api/sys/menu/queryAll',
   RolePageList = '/basic-api/system/getRoleListByPage',
   GetAllRoleList = '/basic-api/system/getAllRoleList',
 }
@@ -29,7 +33,10 @@ export const getDeptList = (params?: DeptListItem) =>
   defHttp.get<DeptListGetResultModel>({ url: Api.DeptList, params });
 
 export const getMenuList = (params?: MenuParams) =>
-  defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params });
+  defHttp.post<MenuListGetResultModel>({
+    url: Api.MenuList,
+    params: params,
+  });
 
 export const getRoleListByPage = (params?: RolePageParams) =>
   defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params });

+ 1 - 1
src/components/Table/src/hooks/useColumns.ts

@@ -153,7 +153,7 @@ export function useColumns(
       })
       .map((column) => {
         const { slots, dataIndex, customRender, format, edit, editRow, flag } = column;
-        Reflect.deleteProperty(column, 'slots');
+
         if (!slots || !slots?.title) {
           column.slots = { title: `header-${dataIndex}`, ...(slots || {}) };
           column.customTitle = column.title;

+ 3 - 3
src/utils/http/axios/index.ts

@@ -151,9 +151,9 @@ const transform: AxiosTransform = {
     const token = getToken();
     if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
       // jwt token
-      (config as Recordable).headers.Authorization = options.authenticationScheme
-        ? `${options.authenticationScheme} ${token}`
-        : token;
+      // (config as Recordable).headers.Authorization = options.authenticationScheme
+      //   ? `${options.authenticationScheme} ${token}`
+      //   : token;
       (config as Recordable).headers.token = options.authenticationScheme
         ? `${options.authenticationScheme} ${token}`
         : token;

+ 19 - 8
src/views/dashboard/bulletin/decoration.vue

@@ -2,6 +2,9 @@
   <div class="p-4">
     <BasicTable @register="registerTable">
       <template #toolbar> </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
       <template #action>
         <TableAction
           :actions="[
@@ -36,10 +39,11 @@
   // import { Tag } from 'ant-design-vue';
   import { h } from 'vue';
   import { Switch } from 'ant-design-vue';
-  import { RentListApi } from '/@/api/bulletin/rent';
-  // param type 0
+  import { decorationListApi } from '/@/api/bulletin/rent';
+  import { Time } from '/@/components/Time';
+  // param type 1
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, Time },
     setup() {
       const { createMessage } = useMessage();
       const columns: BasicColumn[] = [
@@ -51,7 +55,8 @@
         },
         {
           title: '发布时间',
-          dataIndex: 'name',
+          dataIndex: 'createTime',
+          slots: { customRender: 'createTime' },
           width: 230,
         },
         {
@@ -61,7 +66,7 @@
         },
         {
           title: '发布账号',
-          dataIndex: 'phone',
+          dataIndex: 'userName',
           width: 120,
         },
         {
@@ -73,7 +78,7 @@
               record.pendingStatus = false;
             }
             return h(Switch, {
-              checked: record.state === '1',
+              checked: record.state === 0,
               checkedChildren: '已启用',
               unCheckedChildren: '已禁用',
               loading: false,
@@ -157,7 +162,7 @@
       // { getForm }
       const [registerTable] = useTable({
         title: '工地装修',
-        api: RentListApi,
+        api: decorationListApi,
         columns: columns,
         useSearchForm: true,
         formConfig: searchForm,
@@ -165,8 +170,14 @@
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
         rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
       });
-      // pagination.value = { pageSize: 20 };
+
       return {
         registerTable,
         createMessage,

+ 32 - 12
src/views/dashboard/bulletin/rent.vue

@@ -2,7 +2,12 @@
   <div class="p-4">
     <BasicTable @register="registerTable">
       <template #toolbar> </template>
-      <template #action>
+
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
+
+      <template #action="{ record }">
         <TableAction
           :actions="[
             {
@@ -18,9 +23,7 @@
               label: '删除',
               popConfirm: {
                 title: '是否确认删除',
-                confirm: () => {
-                  createMessage.info(`暂未接入`);
-                },
+                confirm: handleDelete.bind(null, record),
               },
             },
           ]"
@@ -36,10 +39,11 @@
   // import { Tag } from 'ant-design-vue';
   import { h } from 'vue';
   import { Switch } from 'ant-design-vue';
-  import { RentListApi } from '/@/api/bulletin/rent';
+  import { rentListApi, commonDeleteApi } from '/@/api/bulletin/rent';
+  import { Time } from '/@/components/Time';
   // param type 2
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, Time },
     setup() {
       const { createMessage } = useMessage();
       const columns: BasicColumn[] = [
@@ -51,7 +55,8 @@
         },
         {
           title: '发布时间',
-          dataIndex: 'name',
+          dataIndex: 'createTime',
+          slots: { customRender: 'createTime' },
           width: 230,
         },
         {
@@ -61,7 +66,7 @@
         },
         {
           title: '发布账号',
-          dataIndex: 'phone',
+          dataIndex: 'userName',
           width: 120,
         },
         {
@@ -73,7 +78,7 @@
               record.pendingStatus = false;
             }
             return h(Switch, {
-              checked: record.state === '1',
+              checked: record.state === 0,
               checkedChildren: '已启用',
               unCheckedChildren: '已禁用',
               loading: false,
@@ -137,7 +142,7 @@
             },
           },
           {
-            field: 'phone',
+            field: 'userName',
             label: '手机号',
             component: 'Input',
             colProps: {
@@ -157,7 +162,7 @@
       // { getForm }
       const [registerTable] = useTable({
         title: '出租信息',
-        api: RentListApi,
+        api: rentListApi,
         columns: columns,
         useSearchForm: true,
         formConfig: searchForm,
@@ -165,10 +170,25 @@
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
         rowKey: 'id',
+        //TODO
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
       });
-      // pagination.value = { pageSize: 20 };
+
+      async function handleDelete(record: Recordable) {
+        const data = await commonDeleteApi({
+          id: record.id,
+        });
+        console.log('data', data);
+      }
+
       return {
         registerTable,
+        handleDelete,
         createMessage,
       };
     },

+ 18 - 7
src/views/dashboard/bulletin/sell.vue

@@ -2,6 +2,9 @@
   <div class="p-4">
     <BasicTable @register="registerTable">
       <template #toolbar> </template>
+      <template #createTime="{ record }">
+        <Time :value="record.createTime" mode="datetime" />
+      </template>
       <template #action>
         <TableAction
           :actions="[
@@ -36,10 +39,11 @@
   // import { Tag } from 'ant-design-vue';
   import { h } from 'vue';
   import { Switch } from 'ant-design-vue';
-  import { RentListApi } from '/@/api/bulletin/rent';
+  import { sellListApi } from '/@/api/bulletin/rent';
+  import { Time } from '/@/components/Time';
   // param type 1
   export default defineComponent({
-    components: { BasicTable, TableAction },
+    components: { BasicTable, TableAction, Time },
     setup() {
       const { createMessage } = useMessage();
       const columns: BasicColumn[] = [
@@ -51,7 +55,8 @@
         },
         {
           title: '发布时间',
-          dataIndex: 'name',
+          dataIndex: 'createTime',
+          slots: { customRender: 'createTime' },
           width: 230,
         },
         {
@@ -61,7 +66,7 @@
         },
         {
           title: '发布账号',
-          dataIndex: 'phone',
+          dataIndex: 'userName',
           width: 120,
         },
         {
@@ -73,7 +78,7 @@
               record.pendingStatus = false;
             }
             return h(Switch, {
-              checked: record.state === '1',
+              checked: record.state === 0,
               checkedChildren: '已启用',
               unCheckedChildren: '已禁用',
               loading: false,
@@ -137,7 +142,7 @@
             },
           },
           {
-            field: 'phone',
+            field: 'userName',
             label: '手机号',
             component: 'Input',
             colProps: {
@@ -157,7 +162,7 @@
       // { getForm }
       const [registerTable] = useTable({
         title: '出售信息',
-        api: RentListApi,
+        api: sellListApi,
         columns: columns,
         useSearchForm: true,
         formConfig: searchForm,
@@ -165,6 +170,12 @@
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
         rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
       });
       // pagination.value = { pageSize: 20 };
       return {

+ 5 - 4
src/views/dashboard/corporation/index.vue

@@ -6,7 +6,7 @@
         <CropperAvatar
           :showBtn="false"
           :width="80"
-          :uploadApi="uploadApi"
+          :uploadApi="uploadLogoApi"
           :value="record.sceneLogo"
         />
       </template>
@@ -14,7 +14,7 @@
         <CropperAvatar
           :showBtn="false"
           :width="80"
-          :uploadApi="uploadApi"
+          :uploadApi="uploadLogoApi"
           :value="record.floorLogo"
         />
       </template>
@@ -22,7 +22,7 @@
         <CropperAvatar
           :showBtn="false"
           :width="80"
-          :uploadApi="uploadApi"
+          :uploadApi="uploadLogoApi"
           :value="record.bgMusic"
         />
       </template>
@@ -67,7 +67,7 @@
   import { uploadApi } from '/@/api/sys/upload';
   // import { Avatar } from 'ant-design-vue';
   // import { getBasicColumns, getBasicData } from './tableData';
-  import { ListApi } from '/@/api/corporation/list';
+  import { ListApi, uploadLogoApi } from '/@/api/corporation/list';
   import { useModal } from '/@/components/Modal';
   import chargeModal from './chargeModal.vue';
   import deviceModal from './deviceModal.vue';
@@ -227,6 +227,7 @@
         registerSubaccountModal,
         handleOpenModal,
         uploadApi: uploadApi as any,
+        uploadLogoApi,
         tablereload,
       };
     },

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

@@ -41,6 +41,7 @@
     name: 'MenuManagement',
     components: { BasicTable, MenuDrawer, TableAction },
     setup() {
+      // collapseAll
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerTable, { reload, expandAll }] = useTable({
         title: '菜单列表',

+ 30 - 14
src/views/dashboard/system/menu/menu.data.ts

@@ -4,14 +4,21 @@ import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
 import { Icon } from '/@/components/Icon';
 
+// const label =[]
+
 export const columns: BasicColumn[] = [
   {
     title: '菜单名称',
-    dataIndex: 'menuName',
+    dataIndex: 'name',
     width: 200,
     align: 'left',
   },
   {
+    title: '上级菜单',
+    dataIndex: 'parentName',
+    width: 100,
+  },
+  {
     title: '图标',
     dataIndex: 'icon',
     width: 50,
@@ -19,20 +26,29 @@ export const columns: BasicColumn[] = [
       return h(Icon, { icon: record.icon });
     },
   },
+  // permission
   {
     title: '权限标识',
-    dataIndex: 'permission',
-    width: 180,
+    dataIndex: 'perms',
+    width: 250,
   },
   {
-    title: '组件',
-    dataIndex: 'component',
+    title: '类型',
+    dataIndex: 'type',
+    width: 100,
+    customRender: ({ record }) => {
+      const color = 'green';
+      const type = record.type;
+
+      return h(Tag, { color: color }, () => `目录${type}`);
+    },
   },
   {
     title: '排序',
-    dataIndex: 'orderNo',
+    dataIndex: 'orderNum',
     width: 50,
   },
+
   {
     title: '状态',
     dataIndex: 'status',
@@ -40,14 +56,14 @@ export const columns: BasicColumn[] = [
     customRender: ({ record }) => {
       const status = record.status;
       const enable = ~~status === 0;
-      const color = enable ? 'green' : 'red';
+      const color = enable ? 'warning' : 'red';
       const text = enable ? '启用' : '停用';
       return h(Tag, { color: color }, () => text);
     },
   },
   {
-    title: '创建时间',
-    dataIndex: 'createTime',
+    title: '菜单URL',
+    dataIndex: 'url',
     width: 180,
   },
 ];
@@ -58,7 +74,7 @@ const isButton = (type: string) => type === '2';
 
 export const searchFormSchema: FormSchema[] = [
   {
-    field: 'menuName',
+    field: 'name',
     label: '菜单名称',
     component: 'Input',
     colProps: { span: 8 },
@@ -93,7 +109,7 @@ export const formSchema: FormSchema[] = [
     colProps: { lg: 24, md: 24 },
   },
   {
-    field: 'menuName',
+    field: 'name',
     label: '菜单名称',
     component: 'Input',
     required: true,
@@ -105,7 +121,7 @@ export const formSchema: FormSchema[] = [
     component: 'TreeSelect',
     componentProps: {
       fieldNames: {
-        label: 'menuName',
+        label: 'name',
         key: 'id',
         value: 'id',
       },
@@ -114,7 +130,7 @@ export const formSchema: FormSchema[] = [
   },
 
   {
-    field: 'orderNo',
+    field: 'orderNum',
     label: '排序',
     component: 'InputNumber',
     required: true,
@@ -128,7 +144,7 @@ export const formSchema: FormSchema[] = [
   },
 
   {
-    field: 'routePath',
+    field: 'url',
     label: '路由地址',
     component: 'Input',
     required: true,