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");
if (!token) return
chat.initSocket()
// chat.initSocket()
const userStore = useUserStore()
userStore.getCurrentUser().then(res => {
const {

View File

@@ -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({

View File

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

View File

@@ -65,11 +65,11 @@
<view class="jnpf-tree-select-tree">
<scroll-view :scroll-y="true" style="height: 100%" :scroll-top="scrollTop" @scroll="handleScroll"
v-show="(!hasPage && !currStep) && selectType === 'all' && activeKey!=='current'">
<ly-tree ref="tree" :props="realProps" :node-key="realProps.value" :load="getGroupList" lazy
:tree-data="lazyOptions" show-node-icon :defaultExpandAll='false'
@node-click="handleTreeNodeClick" :expandOnClickNode="false" :checkOnClickNode="false"
v-if="activeKey==='position'" />
<block v-else>
<ly-tree v-show="activeKey == 'user'" ref="tree" :props="realProps" :node-key="realProps.value"
:load="loadNode" lazy :tree-data="lazyOptions" show-node-icon :defaultExpandAll='false'
@node-click="handleTreeNodeClick" :show-checkbox="multiple" :show-radio="!multiple"
:expandOnClickNode="false" :checkOnClickNode="true" :expandOnCheckNode="false" checkStrictly />
<block v-if="activeKey == 'role'">
<view class="jnpf-selcet-list" v-if="list.length">
<view class="jnpf-selcet-cell" v-for="item in list" :key="item.id"
@click.stop="handleNodeClick(item)">
@@ -129,7 +129,7 @@
const baseStore = useBaseStore()
const defaultProps = {
label: 'deptName',
value: 'id',
value: 'deptId',
icon: 'icon',
children: 'children'
}
@@ -168,7 +168,7 @@
type: Object,
default: () => ({
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 || '');

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"
@tap='downLoad(item)'>
<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 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">
@@ -163,6 +164,10 @@
watch: {
modelValue: {
handler(val) {
if(Array.isArray(val)){
this.fileList = val
return
}
if (!val || typeof val !== 'string') {
this.fileList = [];
return;

View File

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

View File

@@ -2,7 +2,7 @@
<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" />
<!-- 审批记录区域 -->
<view v-if="approvalData.length">
<view v-if="approvalData.length && isApproval">
<view class="approval-title">审批记录</view>
<view class="approval-list">
<view
@@ -98,12 +98,12 @@
</view>
<view class="process-list" v-if="!loadingProcess">
<u-radio-group @change="selectProcess">
<u-radio-group v-model="selectedProcess" @change="selectProcess">
<view
class="process-item"
v-for="(item, index) in processList"
:key="item.id"
:class="{'selected-item': selectedProcess && selectedProcess.id === item.id}"
:class="{'selected-item': selectedProcess && selectedProcess === item.id}"
>
<view class="process-item-left">
<u-radio :name="item.id">{{ item.name }}</u-radio>
@@ -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(()=>{

View File

@@ -1,10 +1,10 @@
<template>
<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"
@change="search" bg-color="#f0f2f6" shape="square" style="width: 100%;">
</u-search>
</view>
</view> -->
<mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback"
:up="upOption" :bottombar="false" @init="mescrollInit" :top="mescrollTop">
<view class="workFlow-list">

View File

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

View File

@@ -4,8 +4,8 @@
<view class="u-m-r-10">
<u-avatar size="127" @click='chooseAvatar' :src='avatarSrc'></u-avatar>
</view>
<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-flex-1 f-right" @click="personalPage('/pages/my/personalData/index','个人中心')">
<view class="u-font-36 u-m-l-16">{{baseInfo.nickname}}</view>
<view class="u-m-l-10 u-p-10">
<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
</view>
@@ -15,7 +15,7 @@
<view class="my-group-box-inner">
<u-cell-group :border="false" class="cell-group">
<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"
v-if="item.title!='app.my.scanCode'">
<template #icon>
@@ -46,7 +46,8 @@
import {
UpdateAvatar,
UserSettingInfo,
setMajor
setMajor,
getUserProfile,
} from '@/api/common'
import chat from '@/libs/chat.js'
import {
@@ -67,61 +68,63 @@
avatarSrc: '',
baseInfo: {},
loading: false,
cellGroups: [{
items: [{
title: 'app.my.organization',
page: '/pages/my/organization/index',
param: 'position',
icon: 'icon-ym-zuzhi',
color: '#6071F5',
borderBottom: true
},
{
title: 'app.my.switchIdentity',
page: '/pages/my/identity/index',
param: 'standing',
icon: 'icon-ym-position1',
color: '#F4A02F',
borderBottom: true
},
{
title: 'app.my.changeSystem',
page: '/pages/my/changeSystem/index',
icon: 'icon-ym-header-sys-toggle',
color: '#3686F2',
borderBottom: false
},
],
},
cellGroups: [
// {
// items: [{
// title: 'app.my.organization',
// page: '/pages/my/organization/index',
// param: 'position',
// icon: 'icon-ym-zuzhi',
// color: '#6071F5',
// borderBottom: true
// },
// {
// title: 'app.my.switchIdentity',
// page: '/pages/my/identity/index',
// param: 'standing',
// icon: 'icon-ym-position1',
// color: '#F4A02F',
// borderBottom: true
// },
// {
// title: 'app.my.changeSystem',
// page: '/pages/my/changeSystem/index',
// icon: 'icon-ym-header-sys-toggle',
// color: '#3686F2',
// borderBottom: false
// },
// ],
// },
{
items: [{
title: 'app.my.personalSetting',
page: '/pages/my/personalSetting/index',
page: '/pages/my/personalData/index',
icon: 'icon-ym-shezhi',
color: '#F46E1B',
name: '个人设置',
borderBottom: true
},
{
title: 'app.my.accountSecurity',
page: '/pages/my/accountSecurity/index',
icon: 'icon-ym-secure',
color: '#26C6A1',
borderBottom: true
},
{
title: 'app.my.contacts',
page: '/pages/my/contacts/index',
icon: 'icon-ym-contacts',
color: '#6071F5',
borderBottom: true
},
{
title: 'app.my.chat',
page: '/pages/message/chat/index',
icon: 'icon-ym-chat',
color: '#4CBF2A',
borderBottom: false
},
// {
// title: 'app.my.accountSecurity',
// page: '/pages/my/accountSecurity/index',
// icon: 'icon-ym-secure',
// color: '#26C6A1',
// borderBottom: true
// },
// {
// title: 'app.my.contacts',
// page: '/pages/my/contacts/index',
// icon: 'icon-ym-contacts',
// color: '#6071F5',
// borderBottom: true
// },
// {
// title: 'app.my.chat',
// page: '/pages/message/chat/index',
// icon: 'icon-ym-chat',
// color: '#4CBF2A',
// borderBottom: false
// },
],
},
{
@@ -161,7 +164,7 @@
},
onLoad() {
const chatStore = useChatStore()
if (!chatStore.getSocket) chat.initSocket()
// if (!chatStore.getSocket) chat.initSocket()
},
onShow() {
// UserSettingInfo().then(res => {
@@ -169,76 +172,12 @@
// this.avatarSrc = this.baseURL2 + this.baseInfo.avatar
// this.loading = true
// })
this.baseInfo = {
"id": "777911634713641349",
"account": "chenl",
"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
}
]
getUserProfile().then(res=>{
if(res.code == 0) {
this.baseInfo = res.data || {}
}
this.loading = true
})
uni.setNavigationBarTitle({
title: "我的"
})
@@ -286,19 +225,17 @@ this.loading = true
url: url
})
},
personalPage(path) {
personalPage(path,name) {
if (!path) return;
const neededFields = [
'realName', 'nation', 'gender', 'nativePlace', 'certificatesType',
'certificatesNumber', 'education', 'birthday', 'telePhone', 'landline',
'urgentContacts', 'urgentTelePhone', 'postalAddress', 'signature'
];
const baseInfo = neededFields.reduce((obj, key) => {
if (this.baseInfo[key] !== undefined) {
obj[key] = this.baseInfo[key];
const baseInfo = {
...this.baseInfo,
title:name,
}
return obj;
}, {});
uni.navigateTo({
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">
<u-form :model="dataForm" :errorType="['toast']" label-position="left" label-width="150" label-align="right"
ref="dataForm">
<u-form-item label="姓名" prop='realName' required>
<u-input input-align='right' v-model="dataForm.realName" placeholder="请输入"></u-input>
<u-form-item label="姓名" prop='nickname' required>
<u-input input-align='right' v-model="dataForm.nickname" :disabled="isDisabled" placeholder="请输入"></u-input>
</u-form-item>
<u-form-item label="民族">
<!-- <u-form-item label="民族">
<JnpfSelect v-model="dataForm.nation" placeholder="请选择" :options='nationOptions' />
</u-form-item>
<u-form-item label="性别">
<JnpfSelect v-model="dataForm.gender" placeholder="请选择" :options='genderOptions' :props='props' />
</u-form-item>
<u-form-item label="籍贯">
</u-form-item> -->
<!-- <u-form-item label="籍贯">
<u-input input-align='right' v-model="dataForm.nativePlace" placeholder="请输入"></u-input>
</u-form-item>
<u-form-item label="证件类型">
</u-form-item> -->
<!-- <u-form-item label="证件类型">
<JnpfSelect v-model="dataForm.certificatesType" placeholder="请选择"
:options='certificatesTypeOptions' />
</u-form-item>
<u-form-item label="证件号码">
</u-form-item> -->
<!-- <u-form-item label="证件号码">
<u-input input-align='right' v-model="dataForm.certificatesNumber" placeholder="请输入">
</u-input>
</u-form-item>
<u-form-item label="文化程度">
</u-form-item> -->
<!-- <u-form-item label="文化程度">
<JnpfSelect v-model="dataForm.education" placeholder="请选择" :options='educationOptions' />
</u-form-item>
<u-form-item label="出生年月">
</u-form-item> -->
<!-- <u-form-item label="出生年月">
<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 label="办公电话">
<u-input input-align='right' v-model="dataForm.telePhone" placeholder="请输入">
<u-form-item label="手机号">
<u-input input-align='right' v-model="dataForm.mobile" :disabled="isDisabled" placeholder="请输入">
</u-input>
</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>
</u-form-item>
@@ -51,10 +66,10 @@
</u-form-item>
<u-form-item label="自我介绍">
<u-input input-align='right' v-model="dataForm.signature" placeholder="请输入" type="textarea" />
</u-form-item>
</u-form-item> -->
</u-form>
</view>
<view class="flowBefore-actions">
<view v-if="!isDisabled" class="flowBefore-actions">
<u-button class="buttom-btn" type="primary" @click='submit'>保存</u-button>
</view>
</view>
@@ -62,7 +77,7 @@
<script>
import {
UpdateUser
profileUpdate
} from '@/api/common'
import {
useBaseStore
@@ -94,19 +109,32 @@
nation: "",
nativePlace: "",
postalAddress: "",
realName: "",
nickname: "",
signature: null,
telePhone: "",
mobile: "",
email: '',
sex: null,
deptInfoList: [],
loginDate: '',
urgentContacts: "",
urgentTelePhone: "",
id: null
},
nationOptions: [],
genderOptions: [],
genderOptions: [
{
fullName: '男',
enCode: 1
},
{
fullName: '女',
enCode: 2
}
],
certificatesTypeOptions: [],
educationOptions: [],
rules: {
realName: [{
nickname: [{
required: true,
message: '请输入姓名',
trigger: ['change', 'blur'],
@@ -118,6 +146,11 @@
computed: {
baseURL() {
return this.define.baseURL
},
isDisabled() {
const config = JSON.parse(JSON.stringify(this.personalData))
const {title} = config
return title == '个人中心'
}
},
watch: {
@@ -135,14 +168,15 @@
methods: {
init() {
let initData = JSON.parse(JSON.stringify(this.personalData))
for (let key in initData) {
for (let k in this.dataForm) {
if (key === k) {
this.dataForm[key] = initData[key]
}
}
}
this.getOptions()
// for (let key in initData) {
// for (let k in this.dataForm) {
// if (key === k) {
// this.dataForm[key] = initData[key]
// }
// }
// }
this.dataForm = initData
this.dataForm.loginDate = this.formatTime(initData.loginDate)
},
getOptions() {
baseStore.getDictionaryData({
@@ -170,7 +204,8 @@
submit() {
this.$refs.dataForm.validate(valid => {
if (valid) {
UpdateUser(this.dataForm).then(res => {
profileUpdate(this.dataForm).then(res => {
if(res.code == 0) {
uni.showToast({
title: '保存成功',
duration: 800,
@@ -179,10 +214,19 @@
setTimeout(() => {
uni.navigateBack()
}, 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>

View File

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

View File

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

View File

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

View File

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