diff --git a/App.vue b/App.vue index 53d9e42..c0e9a50 100644 --- a/App.vue +++ b/App.vue @@ -47,7 +47,7 @@ const token = uni.getStorageSync("token"); if (!token) return - chat.initSocket() + // chat.initSocket() const userStore = useUserStore() userStore.getCurrentUser().then(res => { const { diff --git a/api/common.js b/api/common.js index 7384e75..3d6cbac 100644 --- a/api/common.js +++ b/api/common.js @@ -426,6 +426,21 @@ export function getUserPositions(data) { data }) } +// 获取个人资料 +export function getUserProfile() { + return request({ + url: '/admin-api/system/user/profile/get', + method: 'GET' + }) +} +// 退出登录 +export function getLogout() { + return request({ + url: '/admin-api/system/auth/logout', + method: 'POST' + }) +} + // 获取当前用户个人资料 export function UserSettingInfo() { return request({ @@ -441,6 +456,15 @@ export function UpdateUser(data) { data }) } +// 更新当前用户个人资料 +export function profileUpdate(data) { + return request({ + url: '/admin-api/system/user/profile/update', + method: 'PUT', + data + }) +} + // 更新当前用户头像 export function UpdateAvatar(name) { return request({ diff --git a/components/CommonPane/indexSystem.vue b/components/CommonPane/indexSystem.vue index 0d995d2..e1bfe61 100644 --- a/components/CommonPane/indexSystem.vue +++ b/components/CommonPane/indexSystem.vue @@ -142,6 +142,7 @@ width: 100%; height: 100%; background-color: #fff; + padding-top: 15rpx; .card-tabs { width: 100%; diff --git a/components/Jnpf/CandidateSelect/SelectPopup.vue b/components/Jnpf/CandidateSelect/SelectPopup.vue index 6d4393d..6880f46 100644 --- a/components/Jnpf/CandidateSelect/SelectPopup.vue +++ b/components/Jnpf/CandidateSelect/SelectPopup.vue @@ -65,22 +65,22 @@ - - - - - - - {{item.deptName}} + + + + + + + {{item.deptName}} + - - - + + ({ label: 'deptName', - value: 'id', + value: 'deptId', icon: 'icon', children: 'children', isLeaf: 'isLeaf' @@ -190,7 +190,7 @@ selectedIds: [], keyword: '', showPopup: false, - lazyOptions: [], + lazyOptions: [{}], activeKey: 'user', hasPage: false, pagination: { @@ -284,7 +284,7 @@ getConditionOptions() { if (!this.ableIds.length) return const query = { - keyword: this.keyword, + nickName: this.keyword, ids: this.ableIds, ...this.pagination } @@ -296,15 +296,30 @@ }) }, loadNode(node, resolve) { - const id = node.key || '0' - const type = node?.data?.type || 'organize' - const data = { - id, - type - } - getOrgAndPosSelector(data).then(res => { - const list = res.data?.list || [] - resolve(list) + const parentId = node.key || '0' + const level = node.level || 0 + // 如果是根节点(level为0),直接使用已经构建好的options + // if (level === 0 && this.options.length > 0) { + // resolve(this.options) + // return + // } + + getOrganizeSelector(this.selectType).then(res => { + const list = res.data || [] + // 将返回的扁平数据转换为树形节点 + const treeData = this.buildTree(list, 'deptId', 'deptPid', parentId) + console.log(treeData,'-treeData') + // 设置节点的isLeaf属性(根据是否有子节点判断) + treeData.forEach(item => { + // 判断该节点是否还有子节点(根据实际情况调整) + // 如果知道接口返回是否有子节点的字段,可以替换这个判断 + item.isLeaf = !item.children || item.children.length === 0 + }) + + console.log(`加载父节点 ${parentId} 的子节点:`, treeData) + resolve(treeData) + }).catch(() => { + resolve([]) // 异常时返回空数组,避免组件报错 }) }, handleScroll(e) { @@ -322,7 +337,7 @@ }, getUserList() { let data = { - // keyword: this.keyword, + nickName: this.keyword, // ...this.pagination, ...this.userQuery } @@ -338,13 +353,10 @@ this.handleNodeClick(data) }, handleNodeClick(data) { - console.log(data,'data--------') - // let key = `${this.activeKey==='position'?(data.type||'position'):this.activeKey}Id`; - // if (this.activeKey === 'user') key = 'groupId' + const key = this.activeKey == 'user' ? 'deptId' : 'roleId' this.hasPage = 1 this.userQuery = { - // ...defaultUserQuery, - deptId: data.deptId, + [key]: data[key], fieldList: ["userId","nickName","sex","post","deptName"], pageNo: this.hasPage, pageSize: 10 @@ -376,6 +388,7 @@ toggloActive(key) { if (this.activeKey === key) return this.currStep = 0 + this.hasPage = false this.keyword = '' this.resetQuery() this.$nextTick(async () => { @@ -387,34 +400,52 @@ }) }, async getGroupList() { - // const list = await baseStore.getGroupList() const res = await getOrganizeSelector(this.selectType) - const list = this.formatDeptData(res.data) || [] - console.log(list,'list-------') - this.list = [{ - deptName: '全部用户', - icon: 'icon-ym icon-ym-generator-group1', - id: '' - }, ...list] - }, - async getRoleList() { - // const list = await baseStore.getGroupList() - const res = await getAdapterRoleList() - const list = this.formatDeptData(res.data) || [] - console.log(list,'list-------role') + const list = res.data || [] + const treeData = this.buildTree(list, 'deptId', 'deptPid', '0') + treeData.forEach(item => { + item.isLeaf = !item.children || item.children.length === 0 + }) + // this.list = treeData + this.lazyOptions = treeData + console.log(this.list,'list---') + // const list = this.formatDeptData(res.data) || [] // this.list = [{ // deptName: '全部用户', // icon: 'icon-ym icon-ym-generator-group1', // id: '' // }, ...list] }, + async getRoleList() { + const res = await getAdapterRoleList() + const list = this.formatDeptData(res.data) || [] + this.list = list + }, + buildTree(data, idKey, pidKey, rootPid) { + const result = [] + const map = {} + // 先构建ID映射 + data.forEach(item => { + map[item[idKey]] = { ...item, children: [] } + }) + // 组装父子关系 + data.forEach(item => { + const parent = map[item[pidKey]] + if (item[pidKey] === rootPid) { + result.push(map[item[idKey]]) + } else if (parent) { + parent.children.push(map[item[idKey]]) + } + }) + return result + }, formatDeptData(data) { const result = []; const formatItem = (item) => { - // 优先使用 depthd 字段(根据打印结果) - let deptId = item.depthd || item.id || item.deptId; - let deptName = item.depthName || item.deptName || item.fullName || item.name || item.orgNameTree; + // 优先使用 deptId 字段(根据打印结果) + let deptId = item.deptId || item.roleId; + let deptName = item.deptName || item.roleName; // 确保ID是字符串 deptId = String(deptId || ''); diff --git a/components/Jnpf/UploadFile/index.vue b/components/Jnpf/UploadFile/index.vue index 1875c15..443277a 100644 --- a/components/Jnpf/UploadFile/index.vue +++ b/components/Jnpf/UploadFile/index.vue @@ -17,7 +17,8 @@ - {{item.name+'('+`${jnpf.toFileSize(item.fileSize)}`+' )'}} + + {{item.name}} {{item.name}} @@ -163,6 +164,10 @@ watch: { modelValue: { handler(val) { + if(Array.isArray(val)){ + this.fileList = val + return + } if (!val || typeof val !== 'string') { this.fileList = []; return; diff --git a/pages.json b/pages.json index 2375ded..af65032 100644 --- a/pages.json +++ b/pages.json @@ -551,7 +551,7 @@ { "path": "personalData/index", "style": { - "navigationBarTitleText": "%layout.header.profile%", + "navigationBarTitleText": "", "app-plus": { "bounce": "none" } diff --git a/pages/apply/dynamicModelList/form.vue b/pages/apply/dynamicModelList/form.vue index 6cb9bdc..0334b58 100644 --- a/pages/apply/dynamicModelList/form.vue +++ b/pages/apply/dynamicModelList/form.vue @@ -2,7 +2,7 @@ - + 审批记录 - + {{ item.name }} @@ -364,8 +364,6 @@ }, computed: { getOkText() { - // btnType - console.log(this.btnType,'btnType--') return this.$t('common.saveText'); }, getProcessText() { @@ -381,6 +379,10 @@ idDsabled() { const {approveStatus} = this.dataForm return approveStatus == 2 || approveStatus == 4 + }, + isApproval(){ + const {current} = this.config + return !!current } }, onLoad(option) { @@ -423,9 +425,18 @@ this.initMoreMenuList() } - const getNavigationTitle = () => this.dataForm.id ? this.$t('common.editText') : this.$t('common.addText') + const getNavigationTitle = () =>{ + let titleName = '' + if(this.config.current){ + titleName = this.config.name + '详情' + }else { + const name = this.dataForm.id ? this.$t('common.editText') : this.$t('common.addText') + titleName = name + this.config.name + } + return titleName + } uni.setNavigationBarTitle({ - title: getNavigationTitle() + this.config.name + title: getNavigationTitle() }) this.getDesForm() }, @@ -563,6 +574,9 @@ const res = await getdbformlist(this.modelId) if (res.code === 0 || res.code === 200) { this.processList = res.data || [] + if(this.processList.length === 1){ + this.selectProcess(res.data[0]) + } if (this.processList.length === 0) { uni.showToast({ title: '暂无可用流程', @@ -625,6 +639,7 @@ this.getListCreateData(params) }, selectProcess(item) { + console.log(item,'item----') this.selectedProcess = item }, async launchSelectedProcess() { @@ -843,23 +858,31 @@ }; uni.setStorageSync('dynamicModelExtra', extra); const res = await getModelInfo(this.modelId, this.dataForm.id); - console.log(res.data,'res.data111') - console.log(res.data.jeelowcode_subtable_data,'res.data222') if(!!res.data.approveStatus&&(res.data.approveStatus !== 0 || res.data.approveStatus == 3)){ // 不是未发起和驳回的都不可编辑 this.disableAllFormFields(); } this.dataForm = res.data; if (!res.data) return; + const {fields = []} = this.formConf + const result = fields.reduce((acc,current)=>{ + const key = current.__vModel__; + if(res.data.hasOwnProperty(key)){ + acc[key] = res.data[key]; + }else if(res.data.jeelowcode_subtable_data && res.data.jeelowcode_subtable_data.hasOwnProperty(key)){ + acc[key] = res.data.jeelowcode_subtable_data[key]; + } + return acc; + },{}) this.formData = { ...res.data, id: this.dataForm.id, - lc_fire_operation_detail: res.data.jeelowcode_subtable_data?.lc_fire_operation_detail || res.data?.lc_fire_operation_detail || [], sDate: res.data.sDate, eDate: res.data.eDate ? new Date(res.data.eDate).getTime() : null, applyDepId: res.data.applyDepId ? String(res.data.applyDepId) : '', applyDepName: res.data.applyDepName || '', applyDepData: res.data.applyDepData || null, + ...result }; console.log(this.formData,'formData123') this.$nextTick(()=>{ diff --git a/pages/apply/menu/index.vue b/pages/apply/menu/index.vue index 54ac3c8..659238d 100644 --- a/pages/apply/menu/index.vue +++ b/pages/apply/menu/index.vue @@ -1,10 +1,10 @@