Эх сурвалжийг харах

修复了select-user不显示的bug

kagg886 3 сар өмнө
parent
commit
58a07cb9b0

+ 8 - 8
src/components/gFlow/checkFlow.vue

@@ -230,14 +230,14 @@ const handleStartFlow = (row: FlowDemoTableColumns|null)=>{
       }else if(btn.api=='wfCheck'){
         resetCheckForm()
         getCheckData({wfType:btn.wfType,wfModelType:btn.wfModelType,wfTitle:btn.wfTitle,wfStatusField:btn.wfStatusField,wfFid:btn.wfFid,isProxy:btn?.isProxy}).then((response:any)=>{
-          checkWfTitle.value = response.data.data.runInfo.runName
-          flowId.value = response.data.data.runInfo.flowId
-          processId.value = response.data.data.nodeInfo.nodeId
-          wfCheckForm.value.runId = response.data.data.runInfo.id
-          wfCheckForm.value.nodeId = response.data.data.nodeInfo.nodeId
-          checkFlowInfo.value.nodeInfo = response.data.data.nodeInfo
-          checkFlowInfo.value.preprocess = response.data.data.preProcess
-          runInfo.value = response.data.data.runInfo
+          checkWfTitle.value = response.data.runInfo.runName
+          flowId.value = response.data.runInfo.flowId
+          processId.value = response.data.nodeInfo.nodeId
+          wfCheckForm.value.runId = response.data.runInfo.id
+          wfCheckForm.value.nodeId = response.data.nodeInfo.nodeId
+          checkFlowInfo.value.nodeInfo = response.data.nodeInfo
+          checkFlowInfo.value.preprocess = response.data.preProcess
+          runInfo.value = response.data.runInfo
           wfCheckForm.value.isProxy = btn?.isProxy
         })
         checkWfOpen.value = true

+ 3 - 3
src/components/selectUser/component/userList.vue

@@ -95,11 +95,11 @@ export default defineComponent({
 			},
 		});
     const setUserList = ()=>{
-      const param = {...state.tableData.param, ...props.param};
+      const param = {...state.tableData.param, ...props.param, status: -1};
 			//FIXME 没有对应的api映射,需要fix。
       system.user.getList(param).then((res:any)=>{
-        state.tableData.data = res.data.userList??[];
-        state.tableData.total = res.data.total;
+        state.tableData.data = res.list ?? [];
+        state.tableData.total = res.total;
       });
     };
     const onOpenSelectUser = (row:any) => {

+ 9 - 6
src/components/selectUser/index.vue

@@ -111,10 +111,15 @@ import { Search } from '@element-plus/icons-vue'
 import UserList from './component/userList.vue';
 import api from '/@/api/system'
 
-const getDeptTree = api.dept.getList({status: -1})
+const getDeptTree = () =>  api.dept.getList({status: -1})
 
 //TODO 批量操作需要在后端完成
-const getUserByIds = async (id: number[]) => await Promise.all(id.map(it=>api.user.detail(it)))
+const getUserByIds = ({ ids: id }: {ids: number[]}) => {
+	if (id === undefined) return Promise.resolve({code: 0,list: []})
+	if (id.length == 0) return Promise.resolve({code: 0, list: []})
+
+	return Promise.all(id.map(it=>api.user.detail(it)))
+}
 // import {getDeptTree, getUserByIds} from '/@/api/system/user/index';
 
 interface QueryParam {
@@ -171,9 +176,7 @@ export default defineComponent({
     const initData = ()=>{
       if(prop.modelValue&&prop.modelValue.length>0){
         getUserByIds({ids:prop.modelValue}).then((res:any)=>{
-          if(res.code === 0){
-            deptUser.value = res.data.userList??[];
-          }
+					deptUser.value = res ?? [];
         });
       }else{
         deptUser.value = []
@@ -209,7 +212,7 @@ export default defineComponent({
     // 初始化表格数据
     const initTableData = () => {
       getDeptTree().then((res:any)=>{
-        state.deptData = res.data.deps
+        state.deptData = res
       })
       getUserList()
     };