Browse Source

解决缺陷16991; 移除应用注册时的授权与菜单创建等功能。前端

LT32820A 2 days ago
parent
commit
d0977b9716

+ 19 - 9
jeecgboot-vue3/src/views/appmanage/AppBaseInfo.api.ts

@@ -32,23 +32,33 @@ enum Api {
     isAppAdminOrDevOrOpe = '/sys/applicationInfo/isAppAdminOrDevOrOpe',
     isAppAdmin = '/sys/applicationInfo/isAppAdmin',
     checkMenuInfoisExist = '/sys/permission/checkPermDuplication',
+    checkMenuInfoisEdit = '/sys/applicationInfo/appMenuIsEdit',
     checkAppNameisExist = '/sys/applicationInfo/appNameIsExist',
+    checkAppNameisEdit = '/sys/applicationInfo/appNameIsEdit',
     workFlowTest1 = '/sys/applicationInfo/test1',
     workFlowTest2 = '/sys/applicationInfo/test2'
 }
-export const JFlow_Test2=()=>{
-  return defHttp.get({url: Api.workFlowTest2})
-}
+// export const JFlow_Test2=()=>{
+//   return defHttp.get({url: Api.workFlowTest2})
+// }
+//
+// export const JFlow_Test1=()=>{
+//   return defHttp.get({url: Api.workFlowTest1})
+// }
+// export const checkMenuInfoisExist=(params)=>{
+//     return defHttp.get({url: Api.checkMenuInfoisExist+"?url="+params+"&alwaysShow="+false},  { errorMessageMode: false, successMessageMode: false })
+// }
+// export const checkMenuInfoisEdit=(params)=>{
+//   return defHttp.get({url: Api.checkMenuInfoisEdit+"?url="+params},  { errorMessageMode: false, successMessageMode: false })
+// }
 
-export const JFlow_Test1=()=>{
-  return defHttp.get({url: Api.workFlowTest1})
-}
-export const checkMenuInfoisExist=(params)=>{
-    return defHttp.get({url: Api.checkMenuInfoisExist+"?url="+params+"&alwaysShow="+false},  { errorMessageMode: false, successMessageMode: false })
-}
 export const checkAppNameisExist=(params)=>{
     return defHttp.get({url: Api.checkAppNameisExist+"?appName="+params},  { errorMessageMode: false, successMessageMode: false })
 }
+export const checkAppNameisEdit=(params)=>{
+  return defHttp.get({url: Api.checkAppNameisEdit+"?appid="+params},  { errorMessageMode: false, successMessageMode: false })
+}
+
 export const isAppAdmin=()=>{
   return defHttp.get({url: Api.isAppAdmin})
 }

+ 16 - 32
jeecgboot-vue3/src/views/appmanage/AppBaseInfo.data.ts

@@ -171,22 +171,22 @@ export const Appdescschema: DescItem[] = [
             return (data.hasDevInfo as boolean)
         }
     },
-    {
-        field: 'devEnvInfo.backupLocation',
-        label: '开发-备份位置',
-        span: 1,
-        show: (data)=>{
-            return (data.hasDevInfo as boolean)
-        }
-    },
-    {
-        field: 'devEnvInfo.backupFrequency',
-        label: '开发-备份频率',
-        span: 1,
-        show: (data)=>{
-            return (data.hasDevInfo as boolean)
-        }
-    },
+    // {
+    //     field: 'devEnvInfo.backupLocation',
+    //     label: '开发-备份位置',
+    //     span: 1,
+    //     show: (data)=>{
+    //         return (data.hasDevInfo as boolean)
+    //     }
+    // },
+    // {
+    //     field: 'devEnvInfo.backupFrequency',
+    //     label: '开发-备份频率',
+    //     span: 1,
+    //     show: (data)=>{
+    //         return (data.hasDevInfo as boolean)
+    //     }
+    // },
     {
         field: 'devEnvInfo.descr',
         label: '开发-其它信息',
@@ -236,22 +236,6 @@ export const Appdescschema: DescItem[] = [
             return (data.hasTestInfo as boolean)
         }
     },
-    {
-        field: 'testEnvInfo.backupLocation',
-        label: '测试-备份位置',
-        span: 1,
-        show: (data)=>{
-            return (data.hasTestInfo as boolean)
-        }
-    },
-    {
-        field: 'testEnvInfo.backupFrequency',
-        label: '测试-备份频率',
-        span: 1,
-        show: (data)=>{
-            return (data.hasTestInfo as boolean)
-        }
-    },
     {
         field: 'testEnvInfo.descr',
         label: '测试-其它信息',

+ 1 - 1
jeecgboot-vue3/src/views/appmanage/AppInfoList.vue

@@ -462,7 +462,7 @@ export default defineComponent({
       });
       setTimeout(function (){
         isLoading.value = false
-      },1000)
+      },1800)
     },
 
     // 查看 应用环境信息

+ 6 - 5
jeecgboot-vue3/src/views/appmanage/addForm/Step1.vue

@@ -61,7 +61,7 @@
 <script lang="ts">
 import {defineComponent, reactive, ref} from 'vue';
 import {BasicForm, useForm} from '/@/components/Form';
-import {step1Schemas} from './data';
+import {dataTsxappid, isCheckAppName, step1Schemas} from './data';
 import {Divider, Input, message, Select, SelectProps} from 'ant-design-vue';
 import {string} from "vue-types";
 import {
@@ -96,7 +96,7 @@ const appAdminUseroptions = ref<SelectProps['options']>([]);
   export default defineComponent({
     props: {
       addType: string,
-      formType: string, // 接收并展示来自父组件的值
+      formType: string,
       appid: string,
       baseFormData: {
         type: Object as PropType<{
@@ -105,6 +105,7 @@ const appAdminUseroptions = ref<SelectProps['options']>([]);
           type: string;
           status: string;
           admin: string;
+          addType: string;
           requirement_user: string;
           business_user: string;
           develop_user: string;
@@ -174,8 +175,6 @@ const appAdminUseroptions = ref<SelectProps['options']>([]);
           }
           obj.type = 'isBaseFrom'
         }
-        console.log("表单一关闭时打印一下obj:")
-        console.dir(obj)
         if((obj.data as any).name === "") delete (obj.data as any).name;
         if((obj.data as any).status === undefined) delete (obj.data as any).status;
         if((obj.data as any).type === undefined) delete (obj.data as any).type;
@@ -216,11 +215,14 @@ const appAdminUseroptions = ref<SelectProps['options']>([]);
         if (this.formType === "isAdd"){
           isFormType.value = true
           unCheckTag.value = false
+          isCheckAppName.value = 'isAdd'
           if (value !== undefined) await setFieldsValue(value)
         }else {  // 作为编辑表单的初始化
           isFormType.value = false
           unCheckTag.value = true
           await setFieldsValue(formData)
+          isCheckAppName.value = 'isEdit'
+          dataTsxappid.value = formData.id
         }
       },
 
@@ -270,7 +272,6 @@ const appAdminUseroptions = ref<SelectProps['options']>([]);
       async function customSubmitFunc() {
         try {
           const values = await validate();
-          console.log("第一页:"+values)
           emit('next', values);
         } catch (error) {}
       }

+ 4 - 6
jeecgboot-vue3/src/views/appmanage/addForm/Step4.vue

@@ -136,16 +136,16 @@
                             :disabled="adduserCount===0"
                             @click="removeUserInfo('edit')"
                             v-if="!tag"  v-show="!uncheckTag" style="margin-left: 5%">移 除</a-button>
-                   <a-popconfirm
+                  <a-popconfirm
                     title="你确定要移除全部信息吗?"
                     ok-text="是"
                     cancel-text="否"
                     @confirm="removeAllUserInfo('editForm_removeUserData')"
                     @cancel="cancel">
-                  <a-button style="margin-left: 5%" v-show="(removeUserData as any).length>0">全部移除</a-button>
-                </a-popconfirm>
+                   <a-button style="margin-left: 5%" v-show="(removeUserData as any).length>0">全部移除</a-button>
+                 </a-popconfirm>
                 </div>
-             
+
               </template>
               <template #bodyCell="{ column, record }">
                 <template v-if="column.dataIndex === 'action'">
@@ -307,8 +307,6 @@ export default defineComponent({
 
     handleTableChange(pagination) {
       // 当页码或每页显示条数变化时,调用fetchData方法查询数据
-      console.log("页码变化:"+pagination.current)
-      console.dir(pagination)
       this.pagination.current = pagination.current
       this.queryAppUserMethod(pagination.current)
     },

+ 72 - 38
jeecgboot-vue3/src/views/appmanage/addForm/data.tsx

@@ -1,10 +1,15 @@
 import { FormSchema } from '/@/components/Form';
 import {ref} from "vue";
 import {ComponentTypes} from "@/views/system/menu/menu/menu.data";
-import {checkAppNameisExist, checkMenuInfoisExist} from "@/views/appmanage/AppBaseInfo.api";
+import {
+  checkAppNameisEdit,
+  checkAppNameisExist
+} from "@/views/appmanage/AppBaseInfo.api";
 
 
 export const menuInfoisshow = ref(false)
+export const isCheckAppName = ref("isAdd")// 是否触发应用名字校验规则(作为编辑表单时不触发)
+export const dataTsxappid = ref('')
 
 const isValidIp = (_rule, value, callback) => {
   if (!value) {
@@ -28,22 +33,54 @@ const isValidIpAddress = (ip) => {
   return regex.test(ip);
 };
 
-export const checkMenuInfo = async (_rule, value, callback) => {
-  const res = await checkMenuInfoisExist(value)
-  if (res === '该值可用!') {
-    callback(); // 校验通过
-  } else {
-    callback(new Error(res)); // 校验失败
-  }
-};
+// export const checkMenuInfo = async (_rule, value, callback) => {
+//   console.log("checkMenuInfo"+isCheckAppName.value)
+//   if(isCheckAppName.value === 'isEdit'){
+//     const name = await checkMenuInfoisEdit(dataTsxappid.value)
+//     if (value == name){
+//       callback()
+//     }else {
+//       const res = await checkMenuInfoisExist(value)
+//       console.log("乌拉:"+res)
+//       if (res === '该值可用!') {
+//         callback(); // 校验通过
+//       } else {
+//         callback(new Error(res)); // 校验失败
+//       }
+//     }
+//   }else {
+//     const res = await checkMenuInfoisExist(value)
+//     console.log("芜湖:"+res)
+//     if (res === '该值可用!') {
+//       callback(); // 校验通过
+//     } else {
+//       callback(new Error(res)); // 校验失败
+//     }
+//   }
+// };
 
 // 检查应用名字是否已经存在
 export const checkAppName = async (_rule, value, callback) => {
-  const res = await checkAppNameisExist(value)
-  if (res === '检查通过') {
-    callback(); // 校验通过
-  } else {
-    callback(new Error(res)); // 校验失败
+  if (isCheckAppName.value === 'isEdit'){
+    const name = await checkAppNameisEdit(dataTsxappid.value)
+    if (value == name){
+      callback()
+    }else {
+      const res = await checkAppNameisExist(value)
+      if (res === '检查通过') {
+        callback(); // 校验通过
+      } else {
+        callback(new Error(res)); // 校验失败
+      }
+    }
+  }else {
+    // @ts-ignore
+    const res = await checkAppNameisExist(value)
+    if (res === '检查通过') {
+      callback(); // 校验通过
+    } else {
+      callback(new Error(res)); // 校验失败
+    }
   }
 };
 
@@ -139,22 +176,19 @@ export const step1Schemas: FormSchema[] = [
       span: 8,
     },
   },
-  {
-    field: 'menuInfo',
-    component: 'Input',
-    label: '菜单信息',
-    ifShow: ({ values }) => !(values.component === ComponentTypes.IFrame && values.internalOrExternal),
-    rules:[{ validator: checkMenuInfo, trigger: 'blur'}],
-    // dynamicRules: ({ model, schema, values }) => {
-    //   return checkPermDuplication(model, schema, values.menuType !== 2);
-    // },
-    show: ()=>{
-      return menuInfoisshow.value
-    },
-    colProps: {
-      span: 8,
-    },
-  },
+  // {
+  //   field: 'menuInfo',
+  //   component: 'Input',
+  //   label: '菜单信息',
+  //   ifShow: ({ values }) => !(values.component === ComponentTypes.IFrame && values.internalOrExternal),
+  //   rules:[{ validator: checkMenuInfo, trigger: 'blur'}],
+  //   show: ()=>{
+  //     return menuInfoisshow.value
+  //   },
+  //   colProps: {
+  //     span: 8,
+  //   },
+  // },
   {
     field: 'descr',
     component: 'InputTextArea',
@@ -660,14 +694,14 @@ export const registerFormCheckSchemas: FormSchema[] = [
       span: 8,
     },
   },
-  {
-    field: 'menuInfo',
-    component: 'Input',
-    label: '菜单信息',
-    colProps: {
-      span: 8,
-    },
-  },
+  // {
+  //   field: 'menuInfo',
+  //   component: 'Input',
+  //   label: '菜单信息',
+  //   colProps: {
+  //     span: 8,
+  //   },
+  // },
   {
     field: 'descr',
     component: 'InputTextArea',