XiaXxxxxx 2 lat temu
rodzic
commit
6390c6040f

+ 2 - 0
.env.production

@@ -30,6 +30,8 @@ VITE_GLOB_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
 
 VITE_GLOB_API_URL=http://192.168.119.143:9200
 VITE_GLOB_API_URL2=http://192.168.119.143:31895
+VITE_GLOB_API_MAPTOOLS=/mapTools
+
 
 # File upload address, optional
 # It can be forwarded by nginx or write the actual address directly

+ 8 - 0
build/vite/proxy.ts

@@ -28,6 +28,14 @@ export function createProxy(list: ProxyList = []) {
       rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''),
       // https is require secure=false
       ...(isHttps ? { secure: false } : {}),
+      // configure: (proxy, options) => {
+      //   proxy.on('proxyReq', (proxyReq, req, res) => {
+      //     console.log(`[Proxy] ${req.method} ${req.url}`);
+      //   });
+      //   proxy.on('proxyRes', (proxyRes, req, res) => {
+      //     console.log(`[Proxy] ${res.statusCode} ${req.method} ${req.url}`);
+      //   });
+      // }
     };
   }
   return ret;

+ 4 - 3
src/api/resource/examine.ts

@@ -2,15 +2,16 @@
  * @Author: tengmingxue 1473375109@qq.com
  * @Date: 2023-09-11 19:36:34
  * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2023-09-12 16:40:21
+ * @LastEditTime: 2023-09-16 09:55:47
  * @FilePath: \xld-gis-admin\src\api\resource\examine.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @Description: 流程配置信息api
  */
 import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
     SelectFlowInfo = '/base-center/flow/selectFlowInfo',   //查询流程信息
-    SaveFlowInfo = '/base-center/flow/saveFlowInfo'              //新增、更新流程信息
+    SaveFlowInfo = '/base-center/flow/saveFlowInfo',        //新增、更新流程信息
+    SaveFlowInfoAll = '/base-center/flow/insertFlowInfoAll', //新增流程、节点、节点人员信息
 }
 
 /**

+ 19 - 1
src/api/sys/user.ts

@@ -12,6 +12,7 @@ import md5 from 'js-md5';
 import type { ErrorMessageMode } from '/#/axios';
 import permissions from "/@/mock/role_me_permissions.json";
 import tool from "/@/utils/Tool.js";
+import { getJwtToken } from '/@/utils/auth';
 import moment from 'moment';
 
 enum Api {
@@ -37,7 +38,8 @@ enum Api {
   GetRoleMenus = "/base-center/newmenu/getRoleMenus",
   GetUserMenus = "/base-center/newmenu/getUserMenus",
   allSys = '/datastore/dir/sys/list',
-  GetUserDetailInfo = '/user-center/role/selectMHRoleByUserId'
+  GetUserDetailInfo = '/user-center/role/selectMHRoleByUserId',
+  GetPersonByDepId = '/user-center/user/getPersonByDepId',  ///api-user/user/getPersonByDepId
 }
 
 const client = {
@@ -332,3 +334,19 @@ export const getUserToken = (id: string) => {
     url: `/third/login/id/${id}`,
   });
 };
+
+/**
+ * 获取部门下所有人员基本信息
+ * @params 
+ *    depId  	部门id
+*/
+export const queryPersonByDepId = (params) => {
+  const token = getJwtToken();
+  params = Object.assign(params,{Authorization:token})
+  return new Promise<void>((resolve) => {
+      defHttp.post({ url: Api.GetPersonByDepId, params }).then((res) => {
+          resolve(res)
+      })
+  })
+
+};

+ 2 - 0
src/utils/env.ts

@@ -25,6 +25,7 @@ export function getAppEnvConfig() {
     VITE_GLOB_APP_TITLE,
     VITE_GLOB_API_URL,
     VITE_GLOB_API_URL2,
+    VITE_GLOB_API_URL3,
     VITE_GLOB_APP_SHORT_NAME,
     VITE_GLOB_API_URL_PREFIX,
     VITE_GLOB_UPLOAD_URL,
@@ -48,6 +49,7 @@ export function getAppEnvConfig() {
     VITE_GLOB_APP_TITLE,
     VITE_GLOB_API_URL,
     VITE_GLOB_API_URL2,
+    VITE_GLOB_API_URL3,
     VITE_GLOB_APP_SHORT_NAME,
     VITE_GLOB_API_URL_PREFIX,
     VITE_GLOB_UPLOAD_URL,

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

@@ -101,7 +101,7 @@ const transform: AxiosTransform = {
   requestInterceptors: (config, options) => {
     // 请求之前处理config
     const token = getJwtToken();
-    if (token && (config as Recordable)?.requestOptions?.withToken !== false &&config.url != '/agent/callProvider') {
+    if (token && (config as Recordable)?.requestOptions?.withToken !== false && config.url != '/agent/callProvider') {
       // jwt token
       // config.headers['X-Authorization'] = options.authenticationScheme ? `${options.authenticationScheme} ${token}` : token;
       config.headers['Authorization'] = options.authenticationScheme ? `${options.authenticationScheme} ${token}` : token;

+ 1 - 1
src/views/dashboard/workbench/component/SpatialAnnlysis.vue

@@ -40,7 +40,7 @@ export default defineComponent({
     const mychart = shallowRef(null);
 
     /**
-     * 查询统计数据
+     * 查询空间数据统计分析数据
      */
     const queryData = async () => {
       //const res = await queryBusinessStatistics()

+ 65 - 15
src/views/dataAdmin/dataAdmin/configProcess/AddProcess.vue

@@ -25,6 +25,7 @@
                 v-model:value="formState.type"
                 placeholder="请选择业务类型"
                 :disabled="getTitle === '查看流程配置'"
+                @change="businessChange"
               >
                 <template v-for="item in dicBusiness" :key="item.value">
                   <a-select-option :value="item.value">{{ item.label }}</a-select-option>
@@ -57,6 +58,7 @@
                 :currStep="currStep"
                 @editStep="updateStep"
                 @reduceStep="reduceStep"
+                ref="addStepForm"
               ></add-step-form>
             </div>
           </div>
@@ -110,6 +112,7 @@ export default defineComponent({
     const postData = ref(null);
     const formState: UnwrapRef<FormState> = reactive({
       type: '',
+      name:'',
       steps: ref([{ xh: 1, name: '', model: 'update', dept: [], user: [] }]),
     });
     const rules = {
@@ -119,6 +122,8 @@ export default defineComponent({
     const dicBusiness = busType;
     const pColumns = stepColumns;
     const currStep = ref(null);
+    const addStepForm = ref(null);
+    const { createMessage } = useMessage();
     onMounted(async () => {
       //判断当前类型是否新增
     });
@@ -145,13 +150,31 @@ export default defineComponent({
     const getTitle = computed(() =>
       !unref(isUpdate) ? (unref(postData) ? '查看流程配置' : '新增流程配置') : '编辑流程配置'
     );
+
+    /**
+     * 提交数据
+     */
     async function handleSubmit() {
       setModalProps({ confirmLoading: true });
       try {
-        const { createMessage } = useMessage();
-        closeModal();
-        emit('success');
-        createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
+        //校验当前界面是否数据完整
+        const flag = await addStepForm.value.validateForm();
+        if(!flag){
+          return createMessage.warning('请填写必填数据');
+        }
+        formRef.value
+          .validate()
+          .then(() => {
+            const forms = toRaw(formState);
+            if (forms.steps.value.length < 2) {
+              createMessage.warning('请维护至少两个步骤');
+              return;
+            }
+            addProcess(forms);
+          })
+          .catch((error: ValidateErrorEntity<FormState>) => {
+            console.log('error', error);
+          });
       } finally {
         setTimeout(() => {
           setModalProps({ confirmLoading: false });
@@ -215,16 +238,40 @@ export default defineComponent({
       currStep.value = formState.steps[formState.steps.length - 1];
     };
 
-    const onSubmit = () => {
-      formRef.value
-        .validate()
-        .then(() => {
-          console.log('values', formState, toRaw(formState));
-        })
-        .catch((error: ValidateErrorEntity<FormState>) => {
-          console.log('error', error);
-        });
+    const businessChange = (value) => {
+      const obj = dicBusiness.find((item) => item.value === value);
+      if (obj) formState.steps[0].name = obj.label;
+      //console.log('业务类型改变',value,obj)
+      currStep.value = formState.steps[0];
+      if (obj) formState.name = obj.label
     };
+
+    /**
+     * 新增流程
+     */
+    const addProcess = (formData) => {
+      console.log('新增流程数据', formData);
+      closeModal();
+      emit('success');
+      createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
+    };
+
+    const formDataHandle = (formData) => {
+      //流程数据
+      let flowInfo = {
+        flowdiscription:'',
+        flowname:formData.name,
+      }
+      //流程结点数据
+      let flowNode = []
+      //审核人数据
+      let flowNodePerson = []
+      //不加入第一个结点
+      for(let i = 1; i < formData.steps.length; i++){
+        
+      }
+    }
+
     const resetForm = () => {
       formRef.value.resetFields();
     };
@@ -234,7 +281,6 @@ export default defineComponent({
         on: {
           // 鼠标单击行
           click: (event) => {
-            debugger
             event.currentTarget.parentNode.querySelectorAll('tr').forEach((item) => {
               item.style.background = 'white';
             });
@@ -252,17 +298,21 @@ export default defineComponent({
       dicBusiness,
       pColumns,
       currStep,
+      addStepForm,
+      createMessage,
       customRow,
       registerModal,
       registerForm,
       handleSubmit,
       getTitle,
       show1,
-      onSubmit,
       resetForm,
       editStep,
       updateStep,
       reduceStep,
+      businessChange,
+      addProcess,
+      formDataHandle
     };
   },
 });

+ 128 - 26
src/views/dataAdmin/dataAdmin/configProcess/addStepForm.vue

@@ -2,7 +2,7 @@
  * @Author: tengmingxue 1473375109@qq.com
  * @Date: 2023-08-29 16:44:32
  * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2023-08-30 17:04:36
+ * @LastEditTime: 2023-09-17 19:16:57
  * @FilePath: \xld-gis-admin\src\views\dataAdmin\dataAdmin\configProcess\addStepForm.vue
  * @Description: 流程步骤配置表单
 -->
@@ -62,7 +62,7 @@
       :labelCol="{ span: 4 }"
       :wrapper-col="{ span: 12 }"
     >
-      <a-select
+      <!-- <a-select
         v-model:value="formState.dept"
         placeholder="请选择处理部门"
         mode="multiple"
@@ -71,7 +71,24 @@
       >
         <a-select-option value="1">部门1</a-select-option>
         <a-select-option value="2">部门2</a-select-option>
-      </a-select>
+      </a-select> -->
+      <a-tree-select
+        show-search
+        style="width: 100%"
+        :replaceFields="replaceFields"
+        :tree-data="treeData"
+        v-model:value="formState.dept"
+        :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+        placeholder="Please select"
+        allow-clear
+        multiple
+        tree-default-expand-all
+        @change="treeSelectChange"
+      >
+        <template #title="{ key, value }">
+          <span style="color: #08c" v-if="key === '0-0-1'">Child Node1 {{ value }}</span>
+        </template>
+      </a-tree-select>
     </a-form-item>
     <a-form-item
       v-if="formState.xh !== 1"
@@ -89,7 +106,7 @@
         style="width: 100%"
       >
         <template v-for="user in handlers" :key="user.userid">
-          <a-select-option :value="user.userid">{{ user.username }}</a-select-option>
+          <a-select-option :value="user.userId">{{ user.userName }}</a-select-option>
         </template>
       </a-select>
     </a-form-item>
@@ -102,8 +119,18 @@
       style="height: 100%"
     >
       <template #operation="{ record }">
-        <a v-if="record.xh !== 1" style="color: #2d74e7;margin: 10px;" @click="moveClick(-1,record)">上移</a>
-        <a v-if="record.xh < userList.length" style="color: #2d74e7;margin: 10px;" @click="moveClick(1,record)">下移</a>
+        <a
+          v-if="record.xh !== 1"
+          style="color: #2d74e7; margin: 10px"
+          @click="moveClick(-1, record)"
+          >上移</a
+        >
+        <a
+          v-if="record.xh < userList.length"
+          style="color: #2d74e7; margin: 10px"
+          @click="moveClick(1, record)"
+          >下移</a
+        >
       </template>
     </a-table>
   </a-form>
@@ -113,6 +140,9 @@ import { defineComponent, ref, reactive, onMounted, watch, UnwrapRef, toRaw } fr
 import { cloneDeep } from 'lodash-es';
 import { DeleteOutlined } from '@ant-design/icons-vue';
 import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import { structureList } from '/@/api/sys/position';
+import { queryPersonByDepId } from '/@/api/sys/user';
+
 const props = {
   currStep: { type: Object, require: true },
 };
@@ -139,7 +169,7 @@ export default defineComponent({
       },
       {
         title: '人员',
-        dataIndex: 'username',
+        dataIndex: 'userName',
         width: '40%',
         align: 'center',
       },
@@ -151,11 +181,17 @@ export default defineComponent({
         slots: { customRender: 'operation' },
       },
     ];
-    const handlers = [
-      { userid: '001', username: '张三' },
-      { userid: '002', username: '王维' },
-      { userid: '003', username: '李白' },
-    ];
+
+    const replaceFields = { children: 'children', title: 'departName', key: 'id', value: 'value' };
+
+    const treeData = ref([]);
+
+    const handlers = ref([
+      // { userId: '001', userName: '张三' },
+      // { userId: '002', userName: '王维' },
+      // { userId: '003', userName: '李白' },
+    ]);
+
     const userList = ref([]);
     const formState: UnwrapRef<FormState> = reactive({
       xh: 1,
@@ -189,9 +225,9 @@ export default defineComponent({
     watch(
       () => formState.user,
       (list) => {
-        userList.value = []
+        userList.value = [];
         list.map((item, index) => {
-          const obj = handlers.find((user) => user.userid === item);
+          const obj = handlers.value.find((user) => user.userId === item);
           if (obj) {
             obj['xh'] = index + 1;
             userList.value.push(obj);
@@ -199,9 +235,10 @@ export default defineComponent({
         });
       }
     );
+
     /**
      * 信息内容改变
-    */
+     */
     const stepInfoChange = () => {
       emit('editStep', formState);
     };
@@ -237,28 +274,88 @@ export default defineComponent({
       }
     };
 
+    /**
+     * 校验数据完整性
+     */
+    const validateForm = () => {
+      return new Promise((resolve) => {
+        formRef.value
+          .validate()
+          .then(() => {
+            resolve(true);
+          })
+          .catch((error: ValidateErrorEntity<FormState>) => {
+            console.log('校验失败', error);
+            resolve(false);
+          });
+      });
+    };
+
     /**
      * 审核顺序改变
-    */
-    const moveClick = (flag,row) => {
+     */
+    const moveClick = (flag, row) => {
       //1、修改顺序
       const obj = userList.value.find((item) => item.xh === row.xh);
       const index = userList.value.indexOf(obj);
-      if(index < 0) return
-      const temp = cloneDeep(userList.value[index])
-      const increment = flag
-      userList.value[index] = cloneDeep(userList.value[index + increment])
-      userList.value[index + increment] = cloneDeep(temp)
+      if (index < 0) return;
+      const temp = cloneDeep(userList.value[index]);
+      const increment = flag;
+      userList.value[index] = cloneDeep(userList.value[index + increment]);
+      userList.value[index + increment] = cloneDeep(temp);
       //2、重新生成序号
-      userList.value.forEach((item,index)=>{
-        item['xh'] = index + 1
-      })
+      userList.value.forEach((item, index) => {
+        item['xh'] = index + 1;
+      });
+    };
+
+    const queryDept = async () => {
+      const res = await structureList();
+      if (res && res.length > 0) {
+        treeData.value = dealData(res);
+      }
+    };
+    /**
+     * 查询人员信息
+     */
+    const queryUsers = async (nodeIds) => {
+      const formData = new FormData();
+      formData.append('depId', nodeIds.toString());
+      const res = await queryPersonByDepId(formData);
+      if(res && res.resp_code === 0){
+        //过滤userId不存在的
+        handlers.value =  res?.datas ? res?.datas : []
+        handlers.value = handlers.value.filter(user=>user.userId != null)
+      }
+    };
+
+    const treeSelectChange = (nodeIds, nodeNames, nodes) => {
+      //console.log('选择部门',nodeIds,nodeNames,nodes)
+      if (nodeIds.length > 0) queryUsers(nodeIds);
+      else {
+        handlers.value = []
+      }
     };
 
-    onMounted(async () => {});
+    /**
+     * 处理显示的数据只有叶子节点可以被选中
+     */
+    const dealData = (param) => {
+      return param.map((item) => ({
+        ...item,
+        disabled: !!item.children,
+        children: item.children ? dealData(item.children) : [],
+      }));
+    };
+
+    onMounted(async () => {
+      queryDept();
+    });
 
     return {
       formRef,
+      treeData,
+      replaceFields,
       formState,
       rules,
       rules1,
@@ -267,8 +364,13 @@ export default defineComponent({
       userList,
       stepEdit,
       currStep,
+      validateForm,
       stepInfoChange,
       moveClick,
+      queryDept,
+      queryUsers,
+      dealData,
+      treeSelectChange,
     };
   },
 });

+ 5 - 5
src/views/dataAdmin/dataAdmin/configProcess/configData.js

@@ -2,7 +2,7 @@
  * @Author: tengmingxue 1473375109@qq.com
  * @Date: 2023-08-28 21:12:52
  * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2023-08-29 22:24:09
+ * @LastEditTime: 2023-09-16 15:00:15
  * @FilePath: \xld-gis-admin\src\views\dataAdmin\dataAdmin\configProcess\configData.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -68,10 +68,10 @@ export const busType = [
   { value: '0', label: '地图资源上传' },
   { value: '1', label: '场景资源上传' },
   { value: '2', label: '文件资源上传' },
-  { value: '3', label: '地图资源申请' },
-  { value: '4', label: '场景资源申请' },
-  { value: '5', label: '文件资源申请' },
-  { value: '6', label: '组件资源上传' },
+  { value: '3', label: '组件资源上传' },
+  { value: '4', label: '地图资源申请' },
+  { value: '5', label: '场景资源申请' },
+  { value: '6', label: '文件资源申请' },
   { value: '7', label: '组件资源申请' },
 ]
 

+ 1 - 1
src/views/dataAdmin/dataAdmin/configProcess/index.vue

@@ -177,7 +177,7 @@ export default defineComponent({
     }
 
     function changeCheck(row) {
-      console.log(row);
+      //console.log(row);
     }
 
     return {

+ 1 - 0
types/config.d.ts

@@ -169,6 +169,7 @@ export interface GlobEnvConfig {
   // Service interface url
   VITE_GLOB_API_URL: string;
   VITE_GLOB_API_URL2: string;
+  VITE_GLOB_API_URL3: string;
   // Service interface url prefix
   VITE_GLOB_API_URL_PREFIX?: string;
   // Project abbreviation