feat: 新增需求

This commit is contained in:
caijun
2026-01-22 11:01:19 +08:00
parent 4243e1213f
commit 8e66789811
15 changed files with 311 additions and 242 deletions

View File

@@ -47,7 +47,7 @@
const token = uni.getStorageSync("token"); const token = uni.getStorageSync("token");
if (!token) return if (!token) return
chat.initSocket() // chat.initSocket()
const userStore = useUserStore() const userStore = useUserStore()
userStore.getCurrentUser().then(res => { userStore.getCurrentUser().then(res => {
const { const {

View File

@@ -426,6 +426,21 @@ export function getUserPositions(data) {
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() { export function UserSettingInfo() {
return request({ return request({
@@ -441,6 +456,15 @@ export function UpdateUser(data) {
data data
}) })
} }
// 更新当前用户个人资料
export function profileUpdate(data) {
return request({
url: '/admin-api/system/user/profile/update',
method: 'PUT',
data
})
}
// 更新当前用户头像 // 更新当前用户头像
export function UpdateAvatar(name) { export function UpdateAvatar(name) {
return request({ return request({

View File

@@ -142,6 +142,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
padding-top: 15rpx;
.card-tabs { .card-tabs {
width: 100%; width: 100%;

View File

@@ -65,11 +65,11 @@
<view class="jnpf-tree-select-tree"> <view class="jnpf-tree-select-tree">
<scroll-view :scroll-y="true" style="height: 100%" :scroll-top="scrollTop" @scroll="handleScroll" <scroll-view :scroll-y="true" style="height: 100%" :scroll-top="scrollTop" @scroll="handleScroll"
v-show="(!hasPage && !currStep) && selectType === 'all' && activeKey!=='current'"> v-show="(!hasPage && !currStep) && selectType === 'all' && activeKey!=='current'">
<ly-tree ref="tree" :props="realProps" :node-key="realProps.value" :load="getGroupList" lazy <ly-tree v-show="activeKey == 'user'" ref="tree" :props="realProps" :node-key="realProps.value"
:tree-data="lazyOptions" show-node-icon :defaultExpandAll='false' :load="loadNode" lazy :tree-data="lazyOptions" show-node-icon :defaultExpandAll='false'
@node-click="handleTreeNodeClick" :expandOnClickNode="false" :checkOnClickNode="false" @node-click="handleTreeNodeClick" :show-checkbox="multiple" :show-radio="!multiple"
v-if="activeKey==='position'" /> :expandOnClickNode="false" :checkOnClickNode="true" :expandOnCheckNode="false" checkStrictly />
<block v-else> <block v-if="activeKey == 'role'">
<view class="jnpf-selcet-list" v-if="list.length"> <view class="jnpf-selcet-list" v-if="list.length">
<view class="jnpf-selcet-cell" v-for="item in list" :key="item.id" <view class="jnpf-selcet-cell" v-for="item in list" :key="item.id"
@click.stop="handleNodeClick(item)"> @click.stop="handleNodeClick(item)">
@@ -129,7 +129,7 @@
const baseStore = useBaseStore() const baseStore = useBaseStore()
const defaultProps = { const defaultProps = {
label: 'deptName', label: 'deptName',
value: 'id', value: 'deptId',
icon: 'icon', icon: 'icon',
children: 'children' children: 'children'
} }
@@ -168,7 +168,7 @@
type: Object, type: Object,
default: () => ({ default: () => ({
label: 'deptName', label: 'deptName',
value: 'id', value: 'deptId',
icon: 'icon', icon: 'icon',
children: 'children', children: 'children',
isLeaf: 'isLeaf' isLeaf: 'isLeaf'
@@ -190,7 +190,7 @@
selectedIds: [], selectedIds: [],
keyword: '', keyword: '',
showPopup: false, showPopup: false,
lazyOptions: [], lazyOptions: [{}],
activeKey: 'user', activeKey: 'user',
hasPage: false, hasPage: false,
pagination: { pagination: {
@@ -284,7 +284,7 @@
getConditionOptions() { getConditionOptions() {
if (!this.ableIds.length) return if (!this.ableIds.length) return
const query = { const query = {
keyword: this.keyword, nickName: this.keyword,
ids: this.ableIds, ids: this.ableIds,
...this.pagination ...this.pagination
} }
@@ -296,15 +296,30 @@
}) })
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
const id = node.key || '0' const parentId = node.key || '0'
const type = node?.data?.type || 'organize' const level = node.level || 0
const data = { // 如果是根节点level为0直接使用已经构建好的options
id, // if (level === 0 && this.options.length > 0) {
type // resolve(this.options)
} // return
getOrgAndPosSelector(data).then(res => { // }
const list = res.data?.list || []
resolve(list) 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) { handleScroll(e) {
@@ -322,7 +337,7 @@
}, },
getUserList() { getUserList() {
let data = { let data = {
// keyword: this.keyword, nickName: this.keyword,
// ...this.pagination, // ...this.pagination,
...this.userQuery ...this.userQuery
} }
@@ -338,13 +353,10 @@
this.handleNodeClick(data) this.handleNodeClick(data)
}, },
handleNodeClick(data) { handleNodeClick(data) {
console.log(data,'data--------') const key = this.activeKey == 'user' ? 'deptId' : 'roleId'
// let key = `${this.activeKey==='position'?(data.type||'position'):this.activeKey}Id`;
// if (this.activeKey === 'user') key = 'groupId'
this.hasPage = 1 this.hasPage = 1
this.userQuery = { this.userQuery = {
// ...defaultUserQuery, [key]: data[key],
deptId: data.deptId,
fieldList: ["userId","nickName","sex","post","deptName"], fieldList: ["userId","nickName","sex","post","deptName"],
pageNo: this.hasPage, pageNo: this.hasPage,
pageSize: 10 pageSize: 10
@@ -376,6 +388,7 @@
toggloActive(key) { toggloActive(key) {
if (this.activeKey === key) return if (this.activeKey === key) return
this.currStep = 0 this.currStep = 0
this.hasPage = false
this.keyword = '' this.keyword = ''
this.resetQuery() this.resetQuery()
this.$nextTick(async () => { this.$nextTick(async () => {
@@ -387,34 +400,52 @@
}) })
}, },
async getGroupList() { async getGroupList() {
// const list = await baseStore.getGroupList()
const res = await getOrganizeSelector(this.selectType) const res = await getOrganizeSelector(this.selectType)
const list = this.formatDeptData(res.data) || [] const list = res.data || []
console.log(list,'list-------') const treeData = this.buildTree(list, 'deptId', 'deptPid', '0')
this.list = [{ treeData.forEach(item => {
deptName: '全部用户', item.isLeaf = !item.children || item.children.length === 0
icon: 'icon-ym icon-ym-generator-group1', })
id: '' // this.list = treeData
}, ...list] this.lazyOptions = treeData
}, console.log(this.list,'list---')
async getRoleList() { // const list = this.formatDeptData(res.data) || []
// const list = await baseStore.getGroupList()
const res = await getAdapterRoleList()
const list = this.formatDeptData(res.data) || []
console.log(list,'list-------role')
// this.list = [{ // this.list = [{
// deptName: '全部用户', // deptName: '全部用户',
// icon: 'icon-ym icon-ym-generator-group1', // icon: 'icon-ym icon-ym-generator-group1',
// id: '' // id: ''
// }, ...list] // }, ...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) { formatDeptData(data) {
const result = []; const result = [];
const formatItem = (item) => { const formatItem = (item) => {
// 优先使用 depthd 字段(根据打印结果) // 优先使用 deptId 字段(根据打印结果)
let deptId = item.depthd || item.id || item.deptId; let deptId = item.deptId || item.roleId;
let deptName = item.depthName || item.deptName || item.fullName || item.name || item.orgNameTree; let deptName = item.deptName || item.roleName;
// 确保ID是字符串 // 确保ID是字符串
deptId = String(deptId || ''); deptId = String(deptId || '');

View File

@@ -17,7 +17,8 @@
<view v-for='(item,index) in fileList' :key="index" class="jnpf-file-item u-type-primary u-flex u-line-1" <view v-for='(item,index) in fileList' :key="index" class="jnpf-file-item u-type-primary u-flex u-line-1"
@tap='downLoad(item)'> @tap='downLoad(item)'>
<view class="jnpf-file-item-txt u-line-1" v-if="item.fileSize"> <view class="jnpf-file-item-txt u-line-1" v-if="item.fileSize">
{{item.name+''+`${jnpf.toFileSize(item.fileSize)}`+' '}} <!-- {{item.name+''+`${jnpf.toFileSize(item.fileSize)}`+' '}} -->
{{item.name}}
</view> </view>
<view class="jnpf-file-item-txt u-line-1" v-else>{{item.name}}</view> <view class="jnpf-file-item-txt u-line-1" v-else>{{item.name}}</view>
<view class="closeBox u-flex-col" @click.stop="delFile(index)" v-if="!detailed && !disabled"> <view class="closeBox u-flex-col" @click.stop="delFile(index)" v-if="!detailed && !disabled">
@@ -163,6 +164,10 @@
watch: { watch: {
modelValue: { modelValue: {
handler(val) { handler(val) {
if(Array.isArray(val)){
this.fileList = val
return
}
if (!val || typeof val !== 'string') { if (!val || typeof val !== 'string') {
this.fileList = []; this.fileList = [];
return; return;

View File

@@ -551,7 +551,7 @@
{ {
"path": "personalData/index", "path": "personalData/index",
"style": { "style": {
"navigationBarTitleText": "%layout.header.profile%", "navigationBarTitleText": "",
"app-plus": { "app-plus": {
"bounce": "none" "bounce": "none"
} }

View File

@@ -2,7 +2,7 @@
<view class="dynamicModel-form-v jnpf-wrap jnpf-wrap-form" v-if="showPage"> <view class="dynamicModel-form-v jnpf-wrap jnpf-wrap-form" v-if="showPage">
<JnpfParser :formConf="formConf" ref="dynamicForm" @submit="sumbitForm" :key="key" v-if="!loading" /> <JnpfParser :formConf="formConf" ref="dynamicForm" @submit="sumbitForm" :key="key" v-if="!loading" />
<!-- 审批记录区域 --> <!-- 审批记录区域 -->
<view v-if="approvalData.length"> <view v-if="approvalData.length && isApproval">
<view class="approval-title">审批记录</view> <view class="approval-title">审批记录</view>
<view class="approval-list"> <view class="approval-list">
<view <view
@@ -98,12 +98,12 @@
</view> </view>
<view class="process-list" v-if="!loadingProcess"> <view class="process-list" v-if="!loadingProcess">
<u-radio-group @change="selectProcess"> <u-radio-group v-model="selectedProcess" @change="selectProcess">
<view <view
class="process-item" class="process-item"
v-for="(item, index) in processList" v-for="(item, index) in processList"
:key="item.id" :key="item.id"
:class="{'selected-item': selectedProcess && selectedProcess.id === item.id}" :class="{'selected-item': selectedProcess && selectedProcess === item.id}"
> >
<view class="process-item-left"> <view class="process-item-left">
<u-radio :name="item.id">{{ item.name }}</u-radio> <u-radio :name="item.id">{{ item.name }}</u-radio>
@@ -364,8 +364,6 @@
}, },
computed: { computed: {
getOkText() { getOkText() {
// btnType
console.log(this.btnType,'btnType--')
return this.$t('common.saveText'); return this.$t('common.saveText');
}, },
getProcessText() { getProcessText() {
@@ -381,6 +379,10 @@
idDsabled() { idDsabled() {
const {approveStatus} = this.dataForm const {approveStatus} = this.dataForm
return approveStatus == 2 || approveStatus == 4 return approveStatus == 2 || approveStatus == 4
},
isApproval(){
const {current} = this.config
return !!current
} }
}, },
onLoad(option) { onLoad(option) {
@@ -423,9 +425,18 @@
this.initMoreMenuList() 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({ uni.setNavigationBarTitle({
title: getNavigationTitle() + this.config.name title: getNavigationTitle()
}) })
this.getDesForm() this.getDesForm()
}, },
@@ -563,6 +574,9 @@
const res = await getdbformlist(this.modelId) const res = await getdbformlist(this.modelId)
if (res.code === 0 || res.code === 200) { if (res.code === 0 || res.code === 200) {
this.processList = res.data || [] this.processList = res.data || []
if(this.processList.length === 1){
this.selectProcess(res.data[0])
}
if (this.processList.length === 0) { if (this.processList.length === 0) {
uni.showToast({ uni.showToast({
title: '暂无可用流程', title: '暂无可用流程',
@@ -625,6 +639,7 @@
this.getListCreateData(params) this.getListCreateData(params)
}, },
selectProcess(item) { selectProcess(item) {
console.log(item,'item----')
this.selectedProcess = item this.selectedProcess = item
}, },
async launchSelectedProcess() { async launchSelectedProcess() {
@@ -843,23 +858,31 @@
}; };
uni.setStorageSync('dynamicModelExtra', extra); uni.setStorageSync('dynamicModelExtra', extra);
const res = await getModelInfo(this.modelId, this.dataForm.id); 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)){ if(!!res.data.approveStatus&&(res.data.approveStatus !== 0 || res.data.approveStatus == 3)){
// 不是未发起和驳回的都不可编辑 // 不是未发起和驳回的都不可编辑
this.disableAllFormFields(); this.disableAllFormFields();
} }
this.dataForm = res.data; this.dataForm = res.data;
if (!res.data) return; 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 = { this.formData = {
...res.data, ...res.data,
id: this.dataForm.id, 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, sDate: res.data.sDate,
eDate: res.data.eDate ? new Date(res.data.eDate).getTime() : null, eDate: res.data.eDate ? new Date(res.data.eDate).getTime() : null,
applyDepId: res.data.applyDepId ? String(res.data.applyDepId) : '', applyDepId: res.data.applyDepId ? String(res.data.applyDepId) : '',
applyDepName: res.data.applyDepName || '', applyDepName: res.data.applyDepName || '',
applyDepData: res.data.applyDepData || null, applyDepData: res.data.applyDepData || null,
...result
}; };
console.log(this.formData,'formData123') console.log(this.formData,'formData123')
this.$nextTick(()=>{ this.$nextTick(()=>{

View File

@@ -1,10 +1,10 @@
<template> <template>
<view class="menu-v"> <view class="menu-v">
<view class="search-box u-m-b-20"> <!-- <view class="search-box u-m-b-20">
<u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72" :show-action="false" <u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72" :show-action="false"
@change="search" bg-color="#f0f2f6" shape="square" style="width: 100%;"> @change="search" bg-color="#f0f2f6" shape="square" style="width: 100%;">
</u-search> </u-search>
</view> </view> -->
<mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback" <mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback"
:up="upOption" :bottombar="false" @init="mescrollInit" :top="mescrollTop"> :up="upOption" :bottombar="false" @init="mescrollInit" :top="mescrollTop">
<view class="workFlow-list"> <view class="workFlow-list">

View File

@@ -86,7 +86,7 @@
}, },
onLoad() { onLoad() {
const chatStore = useChatStore() const chatStore = useChatStore()
if (!chatStore.getSocket) chat && chat.initSocket() // if (!chatStore.getSocket) chat && chat.initSocket()
const userStore = useUserStore() const userStore = useUserStore()
userStore.getCurrentUser().then(() => { userStore.getCurrentUser().then(() => {
this.getSystemName() this.getSystemName()

View File

@@ -4,8 +4,8 @@
<view class="u-m-r-10"> <view class="u-m-r-10">
<u-avatar size="127" @click='chooseAvatar' :src='avatarSrc'></u-avatar> <u-avatar size="127" @click='chooseAvatar' :src='avatarSrc'></u-avatar>
</view> </view>
<view class="u-flex-1 f-right" @click="personalPage('/pages/my/personalData/index')"> <view class="u-flex-1 f-right" @click="personalPage('/pages/my/personalData/index','个人中心')">
<view class="u-font-36 u-m-l-16">{{baseInfo.realName}}</view> <view class="u-font-36 u-m-l-16">{{baseInfo.nickname}}</view>
<view class="u-m-l-10 u-p-10"> <view class="u-m-l-10 u-p-10">
<u-icon name="arrow-right" color="#969799" size="28"></u-icon> <u-icon name="arrow-right" color="#969799" size="28"></u-icon>
</view> </view>
@@ -15,7 +15,7 @@
<view class="my-group-box-inner"> <view class="my-group-box-inner">
<u-cell-group :border="false" class="cell-group"> <u-cell-group :border="false" class="cell-group">
<view v-for="(item, idx) in group.items" :key="idx"> <view v-for="(item, idx) in group.items" :key="idx">
<u-cell-item :title="$t(item.title)" @click="openPage(item.page, item.param)" <u-cell-item :title="$t(item.title)" @click="personalPage(item.page,item.name)"
:title-style="titleStyle" :border-bottom="item.borderBottom" :title-style="titleStyle" :border-bottom="item.borderBottom"
v-if="item.title!='app.my.scanCode'"> v-if="item.title!='app.my.scanCode'">
<template #icon> <template #icon>
@@ -46,7 +46,8 @@
import { import {
UpdateAvatar, UpdateAvatar,
UserSettingInfo, UserSettingInfo,
setMajor setMajor,
getUserProfile,
} from '@/api/common' } from '@/api/common'
import chat from '@/libs/chat.js' import chat from '@/libs/chat.js'
import { import {
@@ -67,61 +68,63 @@
avatarSrc: '', avatarSrc: '',
baseInfo: {}, baseInfo: {},
loading: false, loading: false,
cellGroups: [{ cellGroups: [
items: [{ // {
title: 'app.my.organization', // items: [{
page: '/pages/my/organization/index', // title: 'app.my.organization',
param: 'position', // page: '/pages/my/organization/index',
icon: 'icon-ym-zuzhi', // param: 'position',
color: '#6071F5', // icon: 'icon-ym-zuzhi',
borderBottom: true // color: '#6071F5',
}, // borderBottom: true
{ // },
title: 'app.my.switchIdentity', // {
page: '/pages/my/identity/index', // title: 'app.my.switchIdentity',
param: 'standing', // page: '/pages/my/identity/index',
icon: 'icon-ym-position1', // param: 'standing',
color: '#F4A02F', // icon: 'icon-ym-position1',
borderBottom: true // color: '#F4A02F',
}, // borderBottom: true
{ // },
title: 'app.my.changeSystem', // {
page: '/pages/my/changeSystem/index', // title: 'app.my.changeSystem',
icon: 'icon-ym-header-sys-toggle', // page: '/pages/my/changeSystem/index',
color: '#3686F2', // icon: 'icon-ym-header-sys-toggle',
borderBottom: false // color: '#3686F2',
}, // borderBottom: false
], // },
}, // ],
// },
{ {
items: [{ items: [{
title: 'app.my.personalSetting', title: 'app.my.personalSetting',
page: '/pages/my/personalSetting/index', page: '/pages/my/personalData/index',
icon: 'icon-ym-shezhi', icon: 'icon-ym-shezhi',
color: '#F46E1B', color: '#F46E1B',
name: '个人设置',
borderBottom: true borderBottom: true
}, },
{ // {
title: 'app.my.accountSecurity', // title: 'app.my.accountSecurity',
page: '/pages/my/accountSecurity/index', // page: '/pages/my/accountSecurity/index',
icon: 'icon-ym-secure', // icon: 'icon-ym-secure',
color: '#26C6A1', // color: '#26C6A1',
borderBottom: true // borderBottom: true
}, // },
{ // {
title: 'app.my.contacts', // title: 'app.my.contacts',
page: '/pages/my/contacts/index', // page: '/pages/my/contacts/index',
icon: 'icon-ym-contacts', // icon: 'icon-ym-contacts',
color: '#6071F5', // color: '#6071F5',
borderBottom: true // borderBottom: true
}, // },
{ // {
title: 'app.my.chat', // title: 'app.my.chat',
page: '/pages/message/chat/index', // page: '/pages/message/chat/index',
icon: 'icon-ym-chat', // icon: 'icon-ym-chat',
color: '#4CBF2A', // color: '#4CBF2A',
borderBottom: false // borderBottom: false
}, // },
], ],
}, },
{ {
@@ -161,7 +164,7 @@
}, },
onLoad() { onLoad() {
const chatStore = useChatStore() const chatStore = useChatStore()
if (!chatStore.getSocket) chat.initSocket() // if (!chatStore.getSocket) chat.initSocket()
}, },
onShow() { onShow() {
// UserSettingInfo().then(res => { // UserSettingInfo().then(res => {
@@ -169,76 +172,12 @@
// this.avatarSrc = this.baseURL2 + this.baseInfo.avatar // this.avatarSrc = this.baseURL2 + this.baseInfo.avatar
// this.loading = true // this.loading = true
// }) // })
this.baseInfo = { getUserProfile().then(res=>{
"id": "777911634713641349", if(res.code == 0) {
"account": "chenl", this.baseInfo = res.data || {}
"realName": "默认",
"organize": "引迈信息技术有限公司/总裁办",
"company": null,
"position": "总裁",
"manager": null,
"roleId": "",
"creatorTime": 1767604989000,
"prevLogTime": 1768896697000,
"signature": null,
"gender": "1",
"nation": null,
"nativePlace": null,
"entryDate": null,
"certificatesType": null,
"certificatesNumber": null,
"education": null,
"birthday": null,
"telePhone": null,
"landline": null,
"mobilePhone": null,
"email": null,
"urgentContacts": null,
"urgentTelePhone": null,
"postalAddress": null,
"avatar": "/api/file/Image/userAvatar/001.png",
"theme": "W-001",
"language": "zh-CN",
"ranks": null,
"isTenant": false,
"currentTenantInfo": null,
"preferenceJson": null,
"propertyJson": null,
"pcOnlineModelList": [],
"appOnlineModelList": [
{
"userId": "777911634713641349",
"userAccount": null,
"userName": "陈力/chenl",
"loginTime": "2026-01-20 16:11",
"loginIPAddress": "61.183.89.14",
"loginSystem": "iPhone 18_5",
"tenantId": "",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiI3Nzc5MTE2MzQ3MTM2NDEzNDkiLCJyblN0ciI6IkdWczEzRTRBNWRkQU4zMEVIanM3d0JXOFlSQ1h5ZUs5IiwidXNlcl9pZCI6Ijc3NzkxMTYzNDcxMzY0MTM0OSIsInVzZXJfbmFtZSI6ImNoZW5sIiwic2luZ2xlTG9naW4iOjIsImV4cCI6MTc2ODk1MDY5NjYyNywidG9rZW4iOiJsb2dpbl90b2tlbl83ODMzMjk0NTA3OTUyMDQ2NzcifQ.85PXC7GbqgLEuoEcmgeuBBXyFCfgLJX-mq8_5a-cr8Y",
"device": "APP",
"organize": null,
"loginBrowser": "Safari 18.5",
"loginAddress": "湖北省武汉市 电信",
"isCurrent": true
},
{
"userId": "777911634713641349",
"userAccount": null,
"userName": "陈力/chenl",
"loginTime": "2026-01-20 09:59",
"loginIPAddress": "61.183.89.14",
"loginSystem": "iPhone 18_5",
"tenantId": "",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiI3Nzc5MTE2MzQ3MTM2NDEzNDkiLCJyblN0ciI6Ik0yVDI5T2o3cEd0bTZiZkN1aXBYUklrR3BUaTZrT0FxIiwidXNlcl9pZCI6Ijc3NzkxMTYzNDcxMzY0MTM0OSIsInVzZXJfbmFtZSI6ImNoZW5sIiwic2luZ2xlTG9naW4iOjIsImV4cCI6MTc2ODkyODM5NDcyNywidG9rZW4iOiJsb2dpbl90b2tlbl83ODMyMzU5MDk4NDY4MjcwNzcifQ.wRKZT-ZEYc4Tao8k7LI9OPlPvnBhLFrzWdQsAljQIRA",
"device": "APP",
"organize": null,
"loginBrowser": "Safari 18.5",
"loginAddress": "湖北省武汉市 电信",
"isCurrent": false
}
]
} }
this.loading = true this.loading = true
})
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "我的" title: "我的"
}) })
@@ -286,19 +225,17 @@ this.loading = true
url: url url: url
}) })
}, },
personalPage(path) { personalPage(path,name) {
if (!path) return; if (!path) return;
const neededFields = [ const neededFields = [
'realName', 'nation', 'gender', 'nativePlace', 'certificatesType', 'realName', 'nation', 'gender', 'nativePlace', 'certificatesType',
'certificatesNumber', 'education', 'birthday', 'telePhone', 'landline', 'certificatesNumber', 'education', 'birthday', 'telePhone', 'landline',
'urgentContacts', 'urgentTelePhone', 'postalAddress', 'signature' 'urgentContacts', 'urgentTelePhone', 'postalAddress', 'signature'
]; ];
const baseInfo = neededFields.reduce((obj, key) => { const baseInfo = {
if (this.baseInfo[key] !== undefined) { ...this.baseInfo,
obj[key] = this.baseInfo[key]; title:name,
} }
return obj;
}, {});
uni.navigateTo({ uni.navigateTo({
url: `${path}?baseInfo=${JSON.stringify(baseInfo)}` url: `${path}?baseInfo=${JSON.stringify(baseInfo)}`
}); });

View File

@@ -3,37 +3,52 @@
<view style="background-color: #fff;" class="u-p-l-20 u-p-r-20"> <view style="background-color: #fff;" class="u-p-l-20 u-p-r-20">
<u-form :model="dataForm" :errorType="['toast']" label-position="left" label-width="150" label-align="right" <u-form :model="dataForm" :errorType="['toast']" label-position="left" label-width="150" label-align="right"
ref="dataForm"> ref="dataForm">
<u-form-item label="姓名" prop='realName' required> <u-form-item label="姓名" prop='nickname' required>
<u-input input-align='right' v-model="dataForm.realName" placeholder="请输入"></u-input> <u-input input-align='right' v-model="dataForm.nickname" :disabled="isDisabled" placeholder="请输入"></u-input>
</u-form-item> </u-form-item>
<u-form-item label="民族"> <!-- <u-form-item label="民族">
<JnpfSelect v-model="dataForm.nation" placeholder="请选择" :options='nationOptions' /> <JnpfSelect v-model="dataForm.nation" placeholder="请选择" :options='nationOptions' />
</u-form-item> </u-form-item>
<u-form-item label="性别"> <u-form-item label="性别">
<JnpfSelect v-model="dataForm.gender" placeholder="请选择" :options='genderOptions' :props='props' /> <JnpfSelect v-model="dataForm.gender" placeholder="请选择" :options='genderOptions' :props='props' />
</u-form-item> </u-form-item> -->
<u-form-item label="籍贯"> <!-- <u-form-item label="籍贯">
<u-input input-align='right' v-model="dataForm.nativePlace" placeholder="请输入"></u-input> <u-input input-align='right' v-model="dataForm.nativePlace" placeholder="请输入"></u-input>
</u-form-item> </u-form-item> -->
<u-form-item label="证件类型"> <!-- <u-form-item label="证件类型">
<JnpfSelect v-model="dataForm.certificatesType" placeholder="请选择" <JnpfSelect v-model="dataForm.certificatesType" placeholder="请选择"
:options='certificatesTypeOptions' /> :options='certificatesTypeOptions' />
</u-form-item> </u-form-item> -->
<u-form-item label="证件号码"> <!-- <u-form-item label="证件号码">
<u-input input-align='right' v-model="dataForm.certificatesNumber" placeholder="请输入"> <u-input input-align='right' v-model="dataForm.certificatesNumber" placeholder="请输入">
</u-input> </u-input>
</u-form-item> </u-form-item> -->
<u-form-item label="文化程度"> <!-- <u-form-item label="文化程度">
<JnpfSelect v-model="dataForm.education" placeholder="请选择" :options='educationOptions' /> <JnpfSelect v-model="dataForm.education" placeholder="请选择" :options='educationOptions' />
</u-form-item> </u-form-item> -->
<u-form-item label="出生年月"> <!-- <u-form-item label="出生年月">
<JnpfDatePicker v-model="dataForm.birthday" placeholder="请选择" /> <JnpfDatePicker v-model="dataForm.birthday" placeholder="请选择" />
</u-form-item> -->
<u-form-item label="性别">
<JnpfSelect v-model="dataForm.sex" placeholder="请选择" :disabled="isDisabled" :options='genderOptions' :props='props' />
</u-form-item> </u-form-item>
<u-form-item label="办公电话"> <u-form-item label="手机号">
<u-input input-align='right' v-model="dataForm.telePhone" placeholder="请输入"> <u-input input-align='right' v-model="dataForm.mobile" :disabled="isDisabled" placeholder="请输入">
</u-input> </u-input>
</u-form-item> </u-form-item>
<u-form-item label="办公座机"> <u-form-item label="邮箱">
<u-input input-align='right' v-model="dataForm.email" :disabled="isDisabled" placeholder="请输入">
</u-input>
</u-form-item>
<u-form-item v-if="isDisabled" label="所属部门">
<u-input input-align='right' v-model="dataForm.deptInfoList[0].deptName" disabled placeholder="请输入">
</u-input>
</u-form-item>
<u-form-item v-if="isDisabled" label="创建时间">
<u-input input-align='right' v-model="dataForm.loginDate" disabled placeholder="请输入">
</u-input>
</u-form-item>
<!-- <u-form-item label="办公座机">
<u-input input-align='right' v-model="dataForm.landline" placeholder="请输入"> <u-input input-align='right' v-model="dataForm.landline" placeholder="请输入">
</u-input> </u-input>
</u-form-item> </u-form-item>
@@ -51,10 +66,10 @@
</u-form-item> </u-form-item>
<u-form-item label="自我介绍"> <u-form-item label="自我介绍">
<u-input input-align='right' v-model="dataForm.signature" placeholder="请输入" type="textarea" /> <u-input input-align='right' v-model="dataForm.signature" placeholder="请输入" type="textarea" />
</u-form-item> </u-form-item> -->
</u-form> </u-form>
</view> </view>
<view class="flowBefore-actions"> <view v-if="!isDisabled" class="flowBefore-actions">
<u-button class="buttom-btn" type="primary" @click='submit'>保存</u-button> <u-button class="buttom-btn" type="primary" @click='submit'>保存</u-button>
</view> </view>
</view> </view>
@@ -62,7 +77,7 @@
<script> <script>
import { import {
UpdateUser profileUpdate
} from '@/api/common' } from '@/api/common'
import { import {
useBaseStore useBaseStore
@@ -94,19 +109,32 @@
nation: "", nation: "",
nativePlace: "", nativePlace: "",
postalAddress: "", postalAddress: "",
realName: "", nickname: "",
signature: null, signature: null,
telePhone: "", mobile: "",
email: '',
sex: null,
deptInfoList: [],
loginDate: '',
urgentContacts: "", urgentContacts: "",
urgentTelePhone: "", urgentTelePhone: "",
id: null id: null
}, },
nationOptions: [], nationOptions: [],
genderOptions: [], genderOptions: [
{
fullName: '男',
enCode: 1
},
{
fullName: '女',
enCode: 2
}
],
certificatesTypeOptions: [], certificatesTypeOptions: [],
educationOptions: [], educationOptions: [],
rules: { rules: {
realName: [{ nickname: [{
required: true, required: true,
message: '请输入姓名', message: '请输入姓名',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
@@ -118,6 +146,11 @@
computed: { computed: {
baseURL() { baseURL() {
return this.define.baseURL return this.define.baseURL
},
isDisabled() {
const config = JSON.parse(JSON.stringify(this.personalData))
const {title} = config
return title == '个人中心'
} }
}, },
watch: { watch: {
@@ -135,14 +168,15 @@
methods: { methods: {
init() { init() {
let initData = JSON.parse(JSON.stringify(this.personalData)) let initData = JSON.parse(JSON.stringify(this.personalData))
for (let key in initData) { // for (let key in initData) {
for (let k in this.dataForm) { // for (let k in this.dataForm) {
if (key === k) { // if (key === k) {
this.dataForm[key] = initData[key] // this.dataForm[key] = initData[key]
} // }
} // }
} // }
this.getOptions() this.dataForm = initData
this.dataForm.loginDate = this.formatTime(initData.loginDate)
}, },
getOptions() { getOptions() {
baseStore.getDictionaryData({ baseStore.getDictionaryData({
@@ -170,7 +204,8 @@
submit() { submit() {
this.$refs.dataForm.validate(valid => { this.$refs.dataForm.validate(valid => {
if (valid) { if (valid) {
UpdateUser(this.dataForm).then(res => { profileUpdate(this.dataForm).then(res => {
if(res.code == 0) {
uni.showToast({ uni.showToast({
title: '保存成功', title: '保存成功',
duration: 800, duration: 800,
@@ -179,10 +214,19 @@
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)
}
}) })
} }
}); });
} },
formatTime(timestamp) {
if (!timestamp) return '-';
const date = new Date(timestamp);
return `${date.getFullYear()}-${this.padZero(date.getMonth() + 1)}-${this.padZero(date.getDate())} ${this.padZero(date.getHours())}:${this.padZero(date.getMinutes())}:${this.padZero(date.getSeconds())}`;
},
padZero(num) {
return num.toString().padStart(2, '0');
},
} }
} }
</script> </script>

View File

@@ -17,17 +17,23 @@
}; };
}, },
onLoad(e) { onLoad(e) {
// this.baseInfo = JSON.parse(e.baseInfo) this.baseInfo = JSON.parse(e.baseInfo)
// #ifdef MP-WEIXIN || APP-HARMONY // #ifdef MP-WEIXIN || APP-HARMONY
this.baseInfo = JSON.parse(decodeURIComponent(e.baseInfo)) // this.baseInfo = JSON.parse(decodeURIComponent(e.baseInfo))
// #endif // #endif
// #ifndef MP-WEIXIN || APP-HARMONY // #ifndef MP-WEIXIN || APP-HARMONY
this.baseInfo = JSON.parse(decodeURIComponent(this.jnpf.encodeContent(e.baseInfo))) // this.baseInfo = JSON.parse(decodeURIComponent(this.jnpf.encodeContent(e.baseInfo)))
// #endif // #endif
},
onShow() {
console.log(this.baseInfo,'baseInfo------')
uni.setNavigationBarTitle({
title: this.baseInfo.title
})
}, },
methods: {} methods: {}
} }

View File

@@ -157,7 +157,7 @@
this.getPortalList() this.getPortalList()
}) })
const chatStore = useChatStore() const chatStore = useChatStore()
if (!chatStore.getSocket) chat && chat.initSocket() // if (!chatStore.getSocket) chat && chat.initSocket()
uni.$on('refresh', () => { uni.$on('refresh', () => {
this.formData = []; this.formData = [];
this.mescroll.resetUpScroll(); this.mescroll.resetUpScroll();

View File

@@ -89,9 +89,9 @@
}) })
}, },
goDetail(item) { goDetail(item) {
const {processInstance,processDefinitionId} = item const {processInstance,processDefinitionId,processInstanceId,processInstanceName} = item
const id = !!processDefinitionId ? item.id :processInstance.id const id = this.category == 4 ? processInstanceId :(!!processDefinitionId ? item.id :processInstance.id)
const name = !!processDefinitionId ? item.name : processInstance.name const name = this.category == 4 ? processInstanceName : !!processDefinitionId ? item.name : processInstance.name
getProcessBusinessInfo(id).then(res=>{ getProcessBusinessInfo(id).then(res=>{
if(res.code == 0){ if(res.code == 0){
const {dbformId,businessId} = res.data const {dbformId,businessId} = res.data

View File

@@ -2,7 +2,7 @@ import {
defineStore defineStore
} from 'pinia'; } from 'pinia';
import { import {
logout, getLogout,
getCurrentUser getCurrentUser
} from '@/api/common' } from '@/api/common'
import store from '../index' import store from '../index'
@@ -15,7 +15,7 @@ export const useUserStore = defineStore({
userInfo: {}, userInfo: {},
menuList: [], menuList: [],
tenantId: '', tenantId: '',
current: 0 current: 0,
}), }),
getters: { getters: {
getToken() { getToken() {
@@ -28,11 +28,9 @@ export const useUserStore = defineStore({
actions: { actions: {
setCurrent(current) { setCurrent(current) {
this.current = current this.current = current
console.log(current,'current--')
uni.setStorageSync('current', current) uni.setStorageSync('current', current)
}, },
setTenantId(tenantId) { setTenantId(tenantId) {
console.log(tenantId,'tenantId---')
this.tenantId = tenantId this.tenantId = tenantId
uni.setStorageSync('tenantId', tenantId) uni.setStorageSync('tenantId', tenantId)
}, },
@@ -76,7 +74,7 @@ export const useUserStore = defineStore({
}, },
logout() { logout() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout().then(() => { getLogout().then(() => {
this.setToken('') this.setToken('')
this.setTenantId('') this.setTenantId('')
this.setCid('') this.setCid('')