瀏覽代碼

refactor(businessManagement): 优化代码结构和功能

- 修改 isMerchant 计算属性,移除不必要的空格
- 增加日志输出,便于调试
- 调整项目数据请求的 pageSize 参数,从 20 改为 100
- 在 shopInfo 表单中添加 ifShow 函数,控制字段显示
- 优化 staffList 中删除操作的提示信息
- 调整 UserInfo 接口,将 orgCode 的可选类型改为必选
zhangtao 2 天之前
父節點
當前提交
ea9aea9fff

+ 4 - 2
src/views/businessManagement/gymnasiumBag/index.vue

@@ -59,7 +59,7 @@
   const isSubmit = ref(false);
   const uploadId = ref<any>();
   const isMerchant = computed(() => {
-    return userInfo.value?.orgCode?.length > 3;
+    return userInfo.value?.orgCode.length > 3;
   });
   const changeData = ref(false);
   const formSchema: FormSchema[] = [
@@ -214,6 +214,8 @@
       const newDATA: any = [];
       const categoryId: any = [];
       res.appSiteCategoryRuleDTOS.map((it) => {
+        console.log(it, '数据');
+
         newDATA.push(
           ...it.appSiteRuleTimeFormDTOList.map((its) => {
             categoryId.push({ [it.categoryId]: its.id });
@@ -286,7 +288,7 @@
     }
   }
   async function getProjectData() {
-    const res = await getSprotProject({ pageSize: 20 });
+    const res = await getSprotProject({ pageSize: 100 });
     projectList.value = res.records.map((it) => {
       return { value: it.id, label: it.name };
     });

+ 21 - 0
src/views/informationManagement/shopInfo/shopInfo.data.ts

@@ -225,6 +225,9 @@ export const formSchema: FormSchema[] = [
     label: '',
     component: 'RangePicker',
     labelWidth: 0,
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
   {
     field: 'before',
@@ -234,6 +237,9 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       tipText: '支持单张上传;宽高比为5:4,且宽高均大于480px,大小5M以内。',
     },
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
   {
     field: 'after',
@@ -243,6 +249,9 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       tipText: '支持单张上传;宽高比为5:4,且宽高均大于480px,大小5M以内。',
     },
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
   {
     field: 'left',
@@ -252,6 +261,9 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       tipText: '支持单张上传;宽高比为5:4,且宽高均大于480px,大小5M以内。',
     },
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
   {
     field: 'right',
@@ -261,6 +273,9 @@ export const formSchema: FormSchema[] = [
       tipText: '支持单张上传;宽高比为5:4,且宽高均大于480px,大小5M以内。',
     },
     colProps: { xl: 12 },
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
   {
     field: 'up',
@@ -270,6 +285,9 @@ export const formSchema: FormSchema[] = [
       tipText: '支持单张上传;宽高比为5:4,且宽高均大于480px,大小5M以内。',
     },
     colProps: { xl: 12 },
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
   {
     field: 'down',
@@ -279,5 +297,8 @@ export const formSchema: FormSchema[] = [
       tipText: '支持单张上传;宽高比为5:4,且宽高均大于480px,大小5M以内。',
     },
     colProps: { xl: 12 },
+    ifShow(renderCallbackParams) {
+      return renderCallbackParams.model.type == 1;
+    },
   },
 ];

+ 1 - 1
src/views/system/staff/staffList.vue

@@ -87,7 +87,7 @@
   function handleDel(record) {
     // createMessage.success('删除成功');
     createConfirm({
-      title: '确定要删除吗?',
+      title: `确定要删除,${record.realname}这个人吗?`,
       content: '删除后将无法恢复,请谨慎操作!',
       onOk: async () => {
         await del({ id: record.id });

+ 1 - 1
types/store.d.ts

@@ -40,7 +40,7 @@ export interface UserInfo {
   homePath?: string;
   tenantid?: string | number;
   roles: RoleInfo[];
-  orgCode?: string;
+  orgCode: string;
 }
 
 export interface LoginInfo {