Compare commits
84 Commits
3db8be1280
...
dev-cl
| Author | SHA1 | Date | |
|---|---|---|---|
| 5df023dc3f | |||
|
|
1d3b4944e5 | ||
|
|
7f10d7bcd7 | ||
|
|
21b8f1bb12 | ||
| c599929cde | |||
|
|
5c53cabf22 | ||
| 2ed18556c1 | |||
|
|
9b68a06bae | ||
|
|
e620cc5cd6 | ||
|
|
c4c4e49b39 | ||
|
|
f0020d5c82 | ||
|
|
03467e1d6e | ||
|
|
15f83f7193 | ||
|
|
e45cf7db0c | ||
|
|
80d9e93e46 | ||
|
|
ec34235cc2 | ||
|
|
0409e9ef11 | ||
|
|
f3293ef14d | ||
|
|
26ff7cd434 | ||
|
|
b15e0d0f8f | ||
| b05e42f9c7 | |||
|
|
e5e86e24e5 | ||
|
|
33965c55f9 | ||
|
|
683bfa0d38 | ||
|
|
83793b6591 | ||
|
|
ab4d644526 | ||
|
|
3e8a9220f6 | ||
| 6d08fd8390 | |||
|
|
8f20e04701 | ||
|
|
e007be1f2d | ||
|
|
1f29e02135 | ||
|
|
8f2ac77fd1 | ||
|
|
dc449979fa | ||
|
|
ff3f4d9e47 | ||
|
|
5098a5cf01 | ||
| 1413ce44c7 | |||
|
|
5ee61f7f6b | ||
|
|
51140a3c41 | ||
|
|
53d66f9676 | ||
|
|
f2f14789f0 | ||
|
|
f93e1f7187 | ||
| 74efe8409f | |||
| 5d88d06707 | |||
| 85f5b87f84 | |||
|
|
0253dfa47f | ||
|
|
81a3847992 | ||
| f0afdcf18e | |||
|
|
49b5d302a9 | ||
| b019400409 | |||
|
|
8a2d976552 | ||
|
|
f1d2449599 | ||
|
|
e97de4342c | ||
|
|
bfdbef4bd7 | ||
| 69a496dc6e | |||
|
|
c519172f5e | ||
|
|
41d52f4ce7 | ||
| 7c7bf51518 | |||
| 65dae80239 | |||
|
|
79530d221f | ||
|
|
d6bfbcf96a | ||
|
|
b155d3ce9e | ||
|
|
5097cf38f6 | ||
|
|
ae11ac4dc7 | ||
|
|
b0573fdf17 | ||
|
|
b91fe3b05a | ||
|
|
75572f6104 | ||
|
|
a712e3f85f | ||
|
|
a5a64b7131 | ||
|
|
b196135ddb | ||
|
|
34de068ffa | ||
|
|
b1feb33c00 | ||
|
|
853a18df9b | ||
|
|
288770adce | ||
|
|
7bb3a74095 | ||
|
|
34a1fc56d3 | ||
|
|
926cefaee9 | ||
|
|
e5e141fb84 | ||
|
|
ca10366398 | ||
|
|
d39ea3270e | ||
|
|
4726770e3f | ||
|
|
514b602599 | ||
|
|
17208922ad | ||
|
|
82f7d4be5e | ||
|
|
30655c4219 |
@@ -4,11 +4,14 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
#VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
# VITE_UPLOAD_URL='http://114.55.169.15:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
|
||||
4
.env.dev
@@ -4,10 +4,12 @@ VITE_NODE_ENV=production
|
||||
VITE_DEV=false
|
||||
|
||||
# 请求路径
|
||||
#VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -4,10 +4,10 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
5
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/locales"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ss-oa-manage",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "莳松oa管理系统",
|
||||
"author": "ss",
|
||||
"private": false,
|
||||
@@ -39,6 +39,7 @@
|
||||
"@vueuse/core": "^10.1.2",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.10",
|
||||
"@wangeditor/plugin-upload-attachment": "^1.1.0",
|
||||
"@zxcvbn-ts/core": "^3.0.1",
|
||||
"animate.css": "^4.1.1",
|
||||
"axios": "^1.4.0",
|
||||
@@ -51,7 +52,7 @@
|
||||
"diagram-js": "^11.6.0",
|
||||
"echarts": "^5.4.2",
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "2.3.4",
|
||||
"element-plus": "2.9.4",
|
||||
"fast-xml-parser": "^4.2.2",
|
||||
"highlight.js": "^11.8.0",
|
||||
"intro.js": "^7.0.1",
|
||||
@@ -72,6 +73,7 @@
|
||||
"vue-i18n": "9.2.2",
|
||||
"vue-router": "^4.2.1",
|
||||
"vue-types": "^5.0.3",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"web-storage-cache": "^1.1.1",
|
||||
"xe-utils": "^3.5.7",
|
||||
|
||||
@@ -12,7 +12,7 @@ export const syncFalseDiligence = async (params) => {
|
||||
|
||||
// 修改考勤数据
|
||||
export const updateFalseDiligence = async (data) => {
|
||||
return await request.put({ url: '/admin-api/oa/dingtalk/attendance/update', data })
|
||||
return await request.put({ url: '/admin-api/oa/dingtalk/attendance/batchUpdate', data })
|
||||
}
|
||||
|
||||
// 封存考勤数据
|
||||
|
||||
@@ -54,3 +54,8 @@ export const getLinkHistorySalary = async () => {
|
||||
export const getCommissionDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/oa/user-salary-grant/detail', params })
|
||||
}
|
||||
|
||||
// 发送工资条通知
|
||||
export const sendSalaryNotice = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/user-salary-grant/pushUserSalaryGrantDetail', data })
|
||||
}
|
||||
|
||||
42
src/api/kpi/index.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createKpi = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/oa/examine-configuration/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateKpi = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/examine-configuration/update', data })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updateKpiStatus = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/examine-configuration/status/update', data })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getKpiPage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-configuration/page', params })
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getKpiDetail = (id) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-configuration/get', params: { id } })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteKpi = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/examine-configuration/delete', params: { id } })
|
||||
}
|
||||
|
||||
//
|
||||
export const getKpiEmployees = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/oa/employee/examinedEmployees'
|
||||
})
|
||||
}
|
||||
41
src/api/kpi/score.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 打分数据
|
||||
export const getKpiEmployees = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-score/getExamineUserExamineScore', params })
|
||||
}
|
||||
|
||||
// 保存考勤打分数据
|
||||
export const saveKpiScore = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/examine-score/update', data })
|
||||
}
|
||||
|
||||
// 删除考核项
|
||||
export const deleteKpiItem = (params) => {
|
||||
return request.delete({ url: '/admin-api/oa/examine-score/delete', params })
|
||||
}
|
||||
|
||||
// 考评分页数据
|
||||
export const getScorePage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-period/page', params })
|
||||
}
|
||||
|
||||
// 封存
|
||||
export const saveScoreRecord = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-period/confirm', params })
|
||||
}
|
||||
|
||||
// 查询周期是否已封存
|
||||
export const getKpiPeriodStatus = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-period/getExaminePeriodByPeriod', params })
|
||||
}
|
||||
|
||||
// 查询考核记录
|
||||
export const getScoreRecord = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/examine-result/periodPage', data })
|
||||
}
|
||||
|
||||
// 查详情
|
||||
export const getScoreDetail = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-result/detail', params })
|
||||
}
|
||||
38
src/api/okr/comment.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createComment = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/comments/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getCommentPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/comments/page',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取评论类型
|
||||
export const getCommentTypeOptions = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/dict-data/get-by-type',
|
||||
params: { dictType: 'comment_type' }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 点赞评论
|
||||
export const likeComment = (commentId) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/comments-likes/update',
|
||||
data: { commentId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
61
src/api/okr/meeting.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const createMeeting = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/meeting/add',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateMeeting = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/meeting/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
// 查询详情
|
||||
export const getMeetingDetail = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/meeting/get',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 取消会议
|
||||
export const cancelMeeting = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/meeting/cancel',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 分页查询
|
||||
export const getMeetingPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/meeting/page',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新微信群列表
|
||||
export const refreshWxGroupList = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/system/wx/reFreshWeChatGroupList'
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取微信群聊列表
|
||||
export const getWxGroupList = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/system/wx/getWeChatGroupList'
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
154
src/api/okr/okr.js
Normal file
@@ -0,0 +1,154 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createOkrNode = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/node/add',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateOkrNode = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/node/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getOkrNodeDetail = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/get',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 我负责的 - 节点树
|
||||
export const getMyNodeTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/my/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 我负责的 - okr列表
|
||||
export const getMyOkrPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/my/object/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 全部目标 - 节点树
|
||||
export const getAllNodeTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/all/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 全部目标 - okr列表
|
||||
export const getAllOkrPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/all/object/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取节点操作历史
|
||||
export const getOkrNodeHistory = (nodeId) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/record/list',
|
||||
params: { nodeId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取系统默认的关键成果内容
|
||||
export const getDefaultOkrOptions = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/dict-data/get-by-type',
|
||||
params: { dictType: 'key_result_source' }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 更新OKR进度
|
||||
export const updateOkrProgress = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/node/progress/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取目标关系树一级节点
|
||||
export const getOkrRelationTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/first-node',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取目标关系树下级节点数据
|
||||
export const getOkrRelationTreeChildren = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/node-tree',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取我的组员
|
||||
export const getMyMemberList = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/my-members',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取我的组员节点树
|
||||
export const getMySonNodeTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/member/node/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取我的组员OKR列表
|
||||
export const getMySonOkrPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/member/objective/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取渠道
|
||||
export const getChannelOptions = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/source'
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取统计表中的合计信息
|
||||
export const getOkrStatisticsTotal = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/data/count',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
83
src/api/okr/wait.js
Normal file
@@ -0,0 +1,83 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createWait = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/agent-work/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateWait = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/agent-work/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getWaitPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/page',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getWaitDetail = (id) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/get',
|
||||
params: { id }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteWait = (id) => {
|
||||
return request.delete({
|
||||
url: '/admin-api/okr/agent-work/delete',
|
||||
params: { id }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 催办
|
||||
export const urgeWait = (workId) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/urge',
|
||||
params: { workId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 跟进待办
|
||||
export const followWait = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/agent-work-follow/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询跟进记录
|
||||
export const getFollowWaitPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work-follow/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
export const getWaitCount = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/getAgentWorkNum',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
@@ -5,6 +5,11 @@ export const createEmployee = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/employee/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getEmployeeSimpleList = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/employee/list-all-simple', params })
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateEmployee = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/employee/update', data })
|
||||
@@ -29,3 +34,8 @@ export const getEmployeeDetail = (id) => {
|
||||
export const deleteEmployee = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/employee/delete', params: { id } })
|
||||
}
|
||||
|
||||
// 获取钉钉id
|
||||
export const getDingUserId = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/employee/getDingTalkUserIdByMobile', params })
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ export interface DeptVO {
|
||||
}
|
||||
|
||||
// 查询部门(精简)列表
|
||||
export const getSimpleDeptList = async (): Promise<DeptVO[]> => {
|
||||
return await request.get({ url: '/admin-api/system/dept/list-all-simple' })
|
||||
export const getSimpleDeptList = async (params: any): Promise<any[]> => {
|
||||
return await request.get({ url: '/admin-api/system/dept/list-all-simple', params })
|
||||
}
|
||||
|
||||
// 查询部门列表
|
||||
|
||||
@@ -47,3 +47,8 @@ export const deleteDictData = (id: number) => {
|
||||
export const exportDictData = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/dict-data/export', params })
|
||||
}
|
||||
|
||||
// 获取通用字典数据
|
||||
export const getGeneralSysDictData = (dictType: string) => {
|
||||
return request.get({ url: '/admin-api/system/dict-data/get-by-type', params: { dictType } })
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 350 B |
|
Before Width: | Height: | Size: 358 B |
|
Before Width: | Height: | Size: 355 B |
|
Before Width: | Height: | Size: 903 B |
|
Before Width: | Height: | Size: 958 B |
|
Before Width: | Height: | Size: 926 B |
|
Before Width: | Height: | Size: 926 B |
|
Before Width: | Height: | Size: 950 B |
|
Before Width: | Height: | Size: 970 B |
BIN
src/assets/imgs/login2.gif
Normal file
|
After Width: | Height: | Size: 309 KiB |
BIN
src/assets/imgs/shisong.jpg
Normal file
|
After Width: | Height: | Size: 192 KiB |
@@ -542,10 +542,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.second.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.second.type == '1'" label="范围">
|
||||
@@ -601,10 +601,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.minute.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.minute.type == '1'" label="范围">
|
||||
@@ -660,10 +660,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.hour.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.hour.type == '1'" label="范围">
|
||||
@@ -719,12 +719,12 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.day.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button label="4">本月最后一天</el-radio-button>
|
||||
<el-radio-button label="5">不指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
<el-radio-button value="4">本月最后一天</el-radio-button>
|
||||
<el-radio-button value="5">不指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.day.type == '1'" label="范围">
|
||||
@@ -780,10 +780,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.month.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.month.type == '1'" label="范围">
|
||||
@@ -840,12 +840,12 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.week.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button label="4">本月最后一周</el-radio-button>
|
||||
<el-radio-button label="5">不指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
<el-radio-button value="4">本月最后一周</el-radio-button>
|
||||
<el-radio-button value="5">不指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.week.type == '1'" label="范围">
|
||||
@@ -919,11 +919,11 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.year.type">
|
||||
<el-radio-button label="-1">忽略</el-radio-button>
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="-1">忽略</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.year.type == '1'" label="范围">
|
||||
|
||||
@@ -24,7 +24,31 @@ const props = defineProps({
|
||||
default: () => undefined
|
||||
},
|
||||
readonly: propTypes.bool.def(false),
|
||||
modelValue: propTypes.string.def('')
|
||||
modelValue: propTypes.string.def(''),
|
||||
toolbarConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
excludeKeys: [
|
||||
'insertVideo', // 网络视频
|
||||
'insertImage', // 网络图片
|
||||
'insertLink', // 链接
|
||||
'codeBlock', // 代码块
|
||||
'headerSelect', // 标题
|
||||
'blockquote', // 引用
|
||||
'fontFamily', // 字体
|
||||
'todo', // 代办
|
||||
'group-indent', // 缩进
|
||||
'emotion', // 表情
|
||||
'undo', // 撤销
|
||||
'redo', // 重做
|
||||
'fullScreen'
|
||||
],
|
||||
insertKeys: {
|
||||
index: 20, // 自定义插入的位置
|
||||
keys: ['uploadAttachment'] // “上传附件”菜单
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change', 'update:modelValue'])
|
||||
@@ -84,6 +108,12 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
},
|
||||
autoFocus: false,
|
||||
scroll: true,
|
||||
// 在编辑器中,点击选中“附件”节点时,要弹出的菜单
|
||||
hoverbarKeys: {
|
||||
attachment: {
|
||||
menuKeys: ['downloadAttachment'] // “下载附件”菜单
|
||||
}
|
||||
},
|
||||
MENU_CONF: {
|
||||
['uploadImage']: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
@@ -198,6 +228,52 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
customInsert(res: any, insertFn: InsertFnType) {
|
||||
insertFn(res.data, 'video', res.data)
|
||||
}
|
||||
},
|
||||
uploadAttachment: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
timeout: 20 * 1000, // 2s
|
||||
|
||||
fieldName: 'file',
|
||||
// meta: { token: 'xxx', a: 100 }, // 请求时附加的数据
|
||||
// metaWithUrl: true, // meta 拼接到 url 上
|
||||
// headers: { Accept: 'text/x-json' },
|
||||
// 自定义增加 http header
|
||||
headers: {
|
||||
Accept: '*',
|
||||
Authorization: 'Bearer ' + getAccessToken(),
|
||||
'tenant-id': getTenantId(),
|
||||
'instance-id': getAppId()
|
||||
},
|
||||
|
||||
maxFileSize: 20 * 1024 * 1024, // 20M
|
||||
|
||||
onBeforeUpload(file: File) {
|
||||
console.log('onBeforeUpload', file)
|
||||
return file // 上传 file 文件
|
||||
// return false // 会阻止上传
|
||||
},
|
||||
onProgress(progress: number) {
|
||||
console.log('onProgress', progress)
|
||||
},
|
||||
onSuccess(file: File, res: any) {
|
||||
console.log('onSuccess', file, res)
|
||||
},
|
||||
onFailed(file: File, res: any) {
|
||||
alert(res.message)
|
||||
console.log('onFailed', file, res)
|
||||
},
|
||||
onError(file: File, err: Error, res: any) {
|
||||
alert(err.message)
|
||||
console.error('onError', file, err, res)
|
||||
},
|
||||
// 上传成功后,用户自定义插入文件
|
||||
customInsert(res: any, file: File, insertFn: Function) {
|
||||
console.log('customInsert', res)
|
||||
|
||||
// 插入附件到编辑器
|
||||
insertFn(file.name, res.data)
|
||||
// insertFn(res.data, `customInsert-${file.name}`, res.data)
|
||||
}
|
||||
}
|
||||
},
|
||||
uploadImgShowBase64: true
|
||||
@@ -212,24 +288,6 @@ const editorStyle = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const toolbarConfig = ref({
|
||||
excludeKeys: [
|
||||
'insertVideo', // 网络视频
|
||||
'insertImage', // 网络图片
|
||||
'insertLink', // 链接
|
||||
'codeBlock', // 代码块
|
||||
'headerSelect', // 标题
|
||||
'blockquote', // 引用
|
||||
'fontFamily', // 字体
|
||||
'todo', // 代办
|
||||
'group-indent', // 缩进
|
||||
'emotion', // 表情
|
||||
'undo', // 撤销
|
||||
'redo', // 重做
|
||||
'fullScreen'
|
||||
]
|
||||
})
|
||||
|
||||
// 回调函数
|
||||
const handleChange = (editor: IDomEditor) => {
|
||||
emit('change', editor)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
v-show="total > 0"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:small="small"
|
||||
:background="true"
|
||||
:page-sizes="[10, 20, 50, 100, 200]"
|
||||
:pager-count="pagerCount"
|
||||
@@ -43,10 +42,6 @@ const props = defineProps({
|
||||
layout: {
|
||||
type: String,
|
||||
default: 'total, sizes, prev, pager, next, jumper'
|
||||
},
|
||||
small: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { config } from './config'
|
||||
const { default_headers } = config
|
||||
|
||||
const request = (option: any) => {
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm, headers } = option
|
||||
return service({
|
||||
url: url,
|
||||
method,
|
||||
@@ -14,7 +14,8 @@ const request = (option: any) => {
|
||||
data,
|
||||
responseType: responseType,
|
||||
headers: {
|
||||
'Content-Type': headersType || default_headers
|
||||
'Content-Type': headersType || default_headers,
|
||||
...headers
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -66,7 +66,8 @@ service.interceptors.request.use(
|
||||
|
||||
// 设置实例
|
||||
const appId = getAppId()
|
||||
if (appId) (config as Recordable).headers['instance-id'] = appId
|
||||
if (appId && !(config as Recordable).headers['instance-id'])
|
||||
(config as Recordable).headers['instance-id'] = appId
|
||||
|
||||
const params = config.params || {}
|
||||
const data = config.data || false
|
||||
|
||||
@@ -41,9 +41,14 @@ import '@/plugins/tongji' // 百度统计
|
||||
|
||||
import Logger from '@/utils/Logger'
|
||||
import VueDOMPurifyHTML from 'vue-dompurify-html'
|
||||
import { Boot } from '@wangeditor/editor'
|
||||
import attachmentModule from '@wangeditor/plugin-upload-attachment'
|
||||
|
||||
// 创建实例
|
||||
const setupAll = async () => {
|
||||
// 注册。要在创建编辑器之前注册,且只能注册一次,不可重复注册。
|
||||
Boot.registerModule(attachmentModule)
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
await setupI18n(app)
|
||||
|
||||
@@ -7,8 +7,8 @@ import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||
import { useDictStoreWithOut } from '@/store/modules/dict'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
import cache from '@/plugins/cache'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { getTenantId, getAppId, setTenantId, setAppId } from '@/utils/auth'
|
||||
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
@@ -20,21 +20,20 @@ const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/regis
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
start()
|
||||
loadStart()
|
||||
if (getAppId() && to.query?.appId && getAppId() != to.query?.appId) {
|
||||
removeToken()
|
||||
cache?.local?.delete('appInfo')
|
||||
cache?.local?.delete('roleRouters')
|
||||
cache?.local?.delete('user')
|
||||
cache?.local?.delete('App_ID')
|
||||
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
|
||||
} else {
|
||||
const userStore = useUserStoreWithOut()
|
||||
if (to.path == '/login') {
|
||||
userStore.resetState() // 重置用户信息状态
|
||||
}
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
if (to.query?.tenantId && to.query?.appId) {
|
||||
setApp(to.query.tenantId, to.query.appId)
|
||||
await waitTime(1500)
|
||||
}
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
@@ -50,7 +49,10 @@ router.beforeEach(async (to, from, next) => {
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
const nextData =
|
||||
to.path === redirect
|
||||
? { ...to, replace: true, query: to.query }
|
||||
: { path: redirect, query: to.query }
|
||||
next(nextData)
|
||||
} else {
|
||||
next()
|
||||
@@ -63,15 +65,32 @@ router.beforeEach(async (to, from, next) => {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/oa/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
// next(`/login?redirect=${to.fullPath}`)
|
||||
// 否则全部重定向到平台登陆页
|
||||
window.location.href = 'https://cloud.ahduima.com/ss/login'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
async function waitTime(seconds) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, seconds)
|
||||
})
|
||||
}
|
||||
|
||||
function setApp(tenantId, appId) {
|
||||
setTenantId(tenantId)
|
||||
|
||||
setAppId(appId)
|
||||
const appStore = useAppStoreWithOut()
|
||||
appStore.setAppInfo(appId)
|
||||
}
|
||||
|
||||
router.afterEach((to) => {
|
||||
useTitle(to?.meta?.title)
|
||||
done() // 结束Progress
|
||||
|
||||
@@ -110,7 +110,9 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
// path: '/Basic',
|
||||
// component: Layout,
|
||||
// name: 'Basic',
|
||||
// meta: {},
|
||||
// meta: {
|
||||
// title: '菜单管理'
|
||||
// },
|
||||
// redirect: '/Basic/menu',
|
||||
// children: [
|
||||
// {
|
||||
@@ -119,7 +121,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
// name: 'Menu',
|
||||
// meta: {
|
||||
// canTo: true,
|
||||
// hidden: true,
|
||||
// // hidden: true,
|
||||
// noTagsView: false,
|
||||
// icon: 'ep:user',
|
||||
// title: '菜单管理'
|
||||
@@ -137,6 +139,16 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
noTagsView: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/meeting-summary',
|
||||
component: () => import('@/views/OKR/Meeting/MeetingSummary.vue'),
|
||||
name: 'MeetingSummary',
|
||||
meta: {
|
||||
hidden: true,
|
||||
title: '会议纪要',
|
||||
noTagsView: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/sso',
|
||||
component: () => import('@/views/Login/Login.vue'),
|
||||
|
||||
87
src/router/modules/static.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
const staticRouter: AppCustomRouteRecordRaw[] = [
|
||||
{
|
||||
icon: 'ep:calendar',
|
||||
path: '/Okr',
|
||||
component: '',
|
||||
name: 'OKR',
|
||||
componentName: '',
|
||||
redirect: '',
|
||||
parentId: 0,
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
children: [
|
||||
{
|
||||
icon: 'ep:finished',
|
||||
path: 'okr-management',
|
||||
name: 'OKR管理',
|
||||
componentName: 'OkrManagement',
|
||||
component: 'OKR/Management/index',
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
meta: {
|
||||
title: 'OKR管理'
|
||||
},
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:alarm-clock',
|
||||
path: 'okr-wait',
|
||||
name: '待办事项',
|
||||
componentName: 'OkrWait',
|
||||
component: 'OKR/Wait/index',
|
||||
meta: {
|
||||
title: '待办事项'
|
||||
},
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:data-line',
|
||||
path: 'okr-analysis',
|
||||
name: 'OKR统计',
|
||||
componentName: 'OkrAnalysis',
|
||||
component: 'OKR/Analysis/index',
|
||||
meta: {
|
||||
title: 'OKR统计'
|
||||
},
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:data-board',
|
||||
path: 'okr-meeting',
|
||||
name: '会议管理',
|
||||
componentName: 'OkrMeeting',
|
||||
component: 'OKR/Meeting/index',
|
||||
meta: {
|
||||
title: '会议管理'
|
||||
},
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:data-board',
|
||||
path: 'okr-meeting-info/:id',
|
||||
name: '会议详情',
|
||||
componentName: 'MeetingInfo',
|
||||
component: 'OKR/Meeting/MeetingInfo',
|
||||
meta: {
|
||||
title: '会议详情'
|
||||
},
|
||||
visible: false,
|
||||
alwaysShow: true,
|
||||
redirect: '',
|
||||
keepAlive: true
|
||||
}
|
||||
],
|
||||
meta: {
|
||||
title: 'OKR',
|
||||
icon: 'ep:calendar'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default staticRouter
|
||||
@@ -45,7 +45,7 @@ export const useDictStore = defineStore('dict', {
|
||||
this.dictMap = dictMap
|
||||
this.isSetDict = true
|
||||
} else {
|
||||
const res = await listSimpleDictData()
|
||||
const res = (await listSimpleDictData()) || []
|
||||
// 设置数据
|
||||
const dictDataMap = new Map<string, any>()
|
||||
res.forEach((dictData: DictDataVO) => {
|
||||
@@ -75,7 +75,7 @@ export const useDictStore = defineStore('dict', {
|
||||
},
|
||||
async resetDict() {
|
||||
cache.session.delete(CACHE_KEY.DICT_CACHE)
|
||||
const res = await listSimpleDictData()
|
||||
const res = (await listSimpleDictData()) || []
|
||||
// 设置数据
|
||||
const dictDataMap = new Map<string, any>()
|
||||
res.forEach((dictData: DictDataVO) => {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import remainingRouter from '@/router/modules/remaining'
|
||||
import staticRouter from '@/router/modules/static'
|
||||
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
|
||||
@@ -37,6 +38,25 @@ export const usePermissionStore = defineStore('permission', {
|
||||
if (cache.local.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||
res = cache.local.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||
}
|
||||
const staticRouters = cloneDeep(staticRouter)
|
||||
// 与动态路由比较,首先判断目录是否存在,如果存在就合并,并替换动态路由中的目录
|
||||
staticRouters.forEach((item) => {
|
||||
const index = res.findIndex((item2) => item2.path === item.path)
|
||||
if (index !== -1) {
|
||||
const arr = []
|
||||
if (!item.children || item.children.length === 0) {
|
||||
item.children = arr
|
||||
}
|
||||
if (res[index].children && res[index].children.length > 0) {
|
||||
item.children = item.children.concat(res[index].children)
|
||||
}
|
||||
// routerMap[index].children = item.children
|
||||
// 插入动态路由数组的第二位
|
||||
res[index] = { ...res, ...item }
|
||||
} else {
|
||||
res = [...staticRouters, ...res]
|
||||
}
|
||||
})
|
||||
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
|
||||
// 动态路由,404一定要放到最后面
|
||||
this.addRouters = routerMap.concat([
|
||||
@@ -50,6 +70,7 @@ export const usePermissionStore = defineStore('permission', {
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
// 渲染菜单的所有路由
|
||||
this.routers = cloneDeep(remainingRouter).concat(routerMap)
|
||||
resolve()
|
||||
|
||||
@@ -63,7 +63,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
async loginOut() {
|
||||
await loginOut()
|
||||
removeToken()
|
||||
cache.local.clear()
|
||||
// cache.local.clear()
|
||||
this.resetState()
|
||||
},
|
||||
resetState() {
|
||||
@@ -75,6 +75,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
avatar: '',
|
||||
nickname: ''
|
||||
}
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
},
|
||||
refresh() {
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
|
||||
@@ -69,3 +69,41 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.dialog-okr {
|
||||
width: 94vw;
|
||||
height: 94vh;
|
||||
max-width: 1800px;
|
||||
max-height: 1000px;
|
||||
margin: 0;
|
||||
}
|
||||
.dialog-okr .el-dialog__header {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.okr-info-dialog {
|
||||
.el-dialog__body {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 去除 Chrome、Safari、Edge、Opera 中的指示器 */
|
||||
.el-input__inner::-webkit-outer-spin-button,
|
||||
.el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 去除 Firefox 中的指示器 */
|
||||
.el-input__inner[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.el-drawer__header {
|
||||
padding: 16px 16px 8px 16px !important;
|
||||
margin: 0 !important;
|
||||
line-height: 24px !important;
|
||||
font-size: 18px !important;
|
||||
color: #303133 !important;
|
||||
box-sizing: border-box !important;
|
||||
// border-bottom: 1px solid #e8e8e8 !important;
|
||||
}
|
||||
@@ -9,26 +9,34 @@ const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
// 获取token
|
||||
export const getAccessToken = () => {
|
||||
// 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
|
||||
return cache.local.get(AccessTokenKey)
|
||||
? cache.local.get(AccessTokenKey)
|
||||
: cache.local.get('ACCESS_TOKEN')
|
||||
return localStorage.getItem(AccessTokenKey)
|
||||
? localStorage.getItem(AccessTokenKey)
|
||||
: localStorage.getItem('ACCESS_TOKEN')
|
||||
// return cache.local.get(AccessTokenKey)
|
||||
// ? cache.local.get(AccessTokenKey)
|
||||
// : cache.local.get('ACCESS_TOKEN')
|
||||
}
|
||||
|
||||
// 刷新token
|
||||
export const getRefreshToken = () => {
|
||||
return cache.local.get(RefreshTokenKey)
|
||||
return localStorage.getItem(RefreshTokenKey)
|
||||
// return cache.local.get(RefreshTokenKey)
|
||||
}
|
||||
|
||||
// 设置token
|
||||
export const setToken = (token: TokenType) => {
|
||||
cache.local.set(RefreshTokenKey, token.refreshToken)
|
||||
cache.local.set(AccessTokenKey, token.accessToken)
|
||||
localStorage.setItem(AccessTokenKey, token.accessToken)
|
||||
localStorage.setItem(RefreshTokenKey, token.refreshToken)
|
||||
// cache.local.set(RefreshTokenKey, token.refreshToken)
|
||||
// cache.local.set(AccessTokenKey, token.accessToken)
|
||||
}
|
||||
|
||||
// 删除token
|
||||
export const removeToken = () => {
|
||||
cache.local.delete(AccessTokenKey)
|
||||
cache.local.delete(RefreshTokenKey)
|
||||
localStorage.removeItem(AccessTokenKey)
|
||||
localStorage.removeItem(RefreshTokenKey)
|
||||
// cache.local.delete(AccessTokenKey)
|
||||
// cache.local.delete(RefreshTokenKey)
|
||||
}
|
||||
|
||||
/** 格式化token(jwt格式) */
|
||||
|
||||
@@ -220,3 +220,30 @@ export const removeNullField = (obj: Object) => {
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
import * as XLSX from 'xlsx'
|
||||
import * as FileSaver from 'file-saver'
|
||||
export const exportTableWithVue = (domId: any, fileName: String) => {
|
||||
// const XLSX = require('xlsx')
|
||||
// 使用 this.$nextTick 是在dom元素都渲染完成之后再执行
|
||||
// this.$nextTick(function () {
|
||||
// 设置导出的内容是否只做解析,不进行格式转换 false:要解析, true:不解析
|
||||
const xlsxParam = { raw: true }
|
||||
const wb = XLSX.utils.table_to_book(document.querySelector(domId), xlsxParam)
|
||||
|
||||
const wbout = XLSX.write(wb, {
|
||||
bookType: 'xlsx',
|
||||
bookSST: true,
|
||||
type: 'array'
|
||||
})
|
||||
try {
|
||||
// 下载保存文件
|
||||
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), `${fileName}.xlsx`)
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console.log(e, wbout)
|
||||
}
|
||||
}
|
||||
return wbout
|
||||
// });
|
||||
}
|
||||
|
||||
@@ -30,11 +30,18 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="负责人" prop="leaderUserId">
|
||||
<el-select v-model="formData.leaderUserId" clearable placeholder="请输入负责人">
|
||||
<el-select
|
||||
v-model="formData.leaderUserId"
|
||||
clearable
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请输入负责人"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:disabled="item.status == 1"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -43,8 +50,8 @@
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="0"> 启用 </el-radio>
|
||||
<el-radio :label="1"> 禁用 </el-radio>
|
||||
<el-radio :value="0"> 启用 </el-radio>
|
||||
<el-radio :value="1"> 禁用 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -55,6 +62,24 @@
|
||||
<el-input-number v-model="formData.sort" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="业务系统" prop="instanceId">
|
||||
<el-select
|
||||
v-model="formData.instanceId"
|
||||
placeholder="选择主业务系统"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in instanceIdOptions"
|
||||
:key="item.instanceId"
|
||||
:label="item.instanceName"
|
||||
:disabled="item.status == 1"
|
||||
:value="item.instanceId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
@@ -73,8 +98,9 @@
|
||||
<script lang="ts" name="SystemDeptForm" setup>
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { getSimpleAppList } from '@/api/system/app'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -83,15 +109,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
parentId: undefined,
|
||||
name: undefined,
|
||||
sort: 1,
|
||||
leaderUserId: undefined,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined
|
||||
})
|
||||
const formData = ref<any>({})
|
||||
const formRules = reactive<any>({
|
||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
||||
@@ -104,7 +122,8 @@ const formRules = reactive<any>({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const deptTree = ref() // 树形结构
|
||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const employeeOptions = ref<any>([]) // 用户列表
|
||||
const instanceIdOptions = ref<any>([]) // 实例ids
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
@@ -117,12 +136,23 @@ const open = async (type: string, id?: number) => {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await DeptApi.getDept(id)
|
||||
formData.value.remark = formData.value.remark || ''
|
||||
formData.value.leaderUserId = formData.value.leaderUserId?.map((it) => it + '') || []
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
// 获得用户列表
|
||||
userList.value = await UserApi.getSimpleUserList()
|
||||
getEmployeeSimpleList().then((data) => {
|
||||
employeeOptions.value = data.map((it) => ({
|
||||
...it,
|
||||
id: it.id + ''
|
||||
}))
|
||||
})
|
||||
//实例
|
||||
getSimpleAppList().then((data) => {
|
||||
instanceIdOptions.value = data
|
||||
})
|
||||
// 获得部门树
|
||||
await getTree()
|
||||
}
|
||||
@@ -161,9 +191,10 @@ const resetForm = () => {
|
||||
parentId: undefined,
|
||||
name: undefined,
|
||||
sort: 1,
|
||||
leaderUserId: undefined,
|
||||
leaderUserId: [],
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
instanceId: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
@@ -171,7 +202,7 @@ const resetForm = () => {
|
||||
/** 获得部门树 */
|
||||
const getTree = async () => {
|
||||
deptTree.value = []
|
||||
const data = await DeptApi.getSimpleDeptList()
|
||||
const data = await DeptApi.getSimpleDeptList({ allFlag: true })
|
||||
let dept: Tree = { id: 0, name: '顶级部门', children: [] }
|
||||
dept.children = handleTree(data)
|
||||
deptTree.value.push(dept)
|
||||
|
||||
@@ -21,9 +21,16 @@
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list" row-key="id" default-expand-all border>
|
||||
<el-table-column prop="name" label="部门名称" />
|
||||
<el-table-column prop="leader" label="负责人" width="120" />
|
||||
<el-table-column prop="sort" label="排序" width="200" />
|
||||
<el-table-column prop="status" label="状态" width="100" />
|
||||
<el-table-column prop="leaderUserName" label="负责人" width="120" />
|
||||
<el-table-column prop="instanceName" label="业务系统" width="200" />
|
||||
<el-table-column prop="sort" label="排序" width="80" />
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 0 ? 'success' : 'danger'">
|
||||
{{ scope.row.status == 0 ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" class-name="fixed-width" width="160">
|
||||
<template #default="scope">
|
||||
@@ -61,6 +68,7 @@ const { t } = useI18n() // 国际化
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref() // 列表的数据
|
||||
const queryParams = reactive({
|
||||
allFlag: true,
|
||||
name: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单类型" prop="type">
|
||||
<el-radio-group v-model="formData.type">
|
||||
<el-radio-button :label="1"> 目录 </el-radio-button>
|
||||
<el-radio-button :label="2"> 菜单 </el-radio-button>
|
||||
<el-radio-button :label="3"> 按钮 </el-radio-button>
|
||||
<el-radio-button :value="1"> 目录 </el-radio-button>
|
||||
<el-radio-button :value="2"> 菜单 </el-radio-button>
|
||||
<el-radio-button :value="3"> 按钮 </el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.type !== 3" label="菜单图标">
|
||||
@@ -69,8 +69,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="0"> 启用 </el-radio>
|
||||
<el-radio :label="1"> 禁用 </el-radio>
|
||||
<el-radio :value="0"> 启用 </el-radio>
|
||||
<el-radio :value="1"> 禁用 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.type !== 3" label="显示状态" prop="visible">
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :label="1"> 男 </el-radio>
|
||||
<el-radio :label="2"> 女 </el-radio>
|
||||
<el-radio :value="1"> 男 </el-radio>
|
||||
<el-radio :value="2"> 女 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -34,7 +34,7 @@
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select
|
||||
@@ -84,7 +84,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入职日期" prop="hireDate">
|
||||
<el-date-picker
|
||||
@@ -96,7 +96,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
@@ -113,7 +113,8 @@
|
||||
</template>
|
||||
<script lang="ts" name="SystemUserForm" setup>
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
// import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
import * as RoleApi from '@/api/system/role'
|
||||
@@ -174,7 +175,7 @@ const open = async (type: string, id?: number) => {
|
||||
}
|
||||
}
|
||||
// 加载部门树
|
||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList({ allFlag: false }))
|
||||
// 加载岗位列表
|
||||
roleOptions.value = await RoleApi.getSimpleRoleList()
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-row :gutter="20"> -->
|
||||
<!-- 左侧部门树 -->
|
||||
<el-col :span="4" :xs="24">
|
||||
<!-- <el-col :span="4" :xs="24">
|
||||
<DeptTree @node-click="handleDeptNodeClick" />
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-col :span="20" :xs="24"> -->
|
||||
<!-- 搜索 -->
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="0">
|
||||
<el-form-item prop="nickname">
|
||||
<el-input
|
||||
v-model="queryParams.nickname"
|
||||
placeholder="请输入姓名"
|
||||
@@ -16,7 +16,7 @@
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入手机号码"
|
||||
@@ -42,7 +42,7 @@
|
||||
<el-table-column label="用户编号" key="id" prop="id" />
|
||||
<el-table-column label="登录账号" prop="username" />
|
||||
<el-table-column label="用户姓名" prop="nickname" />
|
||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||
<!-- <el-table-column label="部门" key="deptName" prop="deptName" /> -->
|
||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||
<el-table-column label="状态" key="status">
|
||||
<template #default="scope">
|
||||
@@ -57,12 +57,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="260">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -98,8 +93,8 @@
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- </el-col> -->
|
||||
<!-- </el-row> -->
|
||||
|
||||
<!-- 添加或修改用户对话框 -->
|
||||
<UserForm ref="formRef" @success="getList" />
|
||||
@@ -109,7 +104,7 @@ import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import UserForm from './UserForm.vue'
|
||||
import DeptTree from './DeptTree.vue'
|
||||
// import DeptTree from './DeptTree.vue'
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
@@ -150,11 +145,11 @@ const resetQuery = () => {
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 处理部门被点击 */
|
||||
const handleDeptNodeClick = async (row) => {
|
||||
queryParams.deptId = row.id
|
||||
await getList()
|
||||
}
|
||||
// /** 处理部门被点击 */
|
||||
// const handleDeptNodeClick = async (row) => {
|
||||
// queryParams.deptId = row.id
|
||||
// await getList()
|
||||
// }
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="结算方式">
|
||||
<el-radio-group v-model="formData.percentageType">
|
||||
<el-radio :label="1">
|
||||
<el-radio :value="1">
|
||||
<Tooltip message="可配置多级,命中某档位后,按照档位分级结算" />阶梯结算
|
||||
</el-radio>
|
||||
<el-radio :label="2">
|
||||
<el-radio :value="2">
|
||||
<Tooltip message="可配置多级,命中某档位后所有金额全部按照该档位结算" />常规结算
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -164,8 +164,8 @@
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="包含区域提成" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isAreaPercentage">
|
||||
<el-radio :label="true"> 是 </el-radio>
|
||||
<el-radio :label="false"> 否 </el-radio>
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -174,24 +174,24 @@
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否关联成交率" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isRelateSignRate">
|
||||
<el-radio :label="true"> 是 </el-radio>
|
||||
<el-radio :label="false"> 否 </el-radio>
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否扣除其他支出" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isDeductExtraPay">
|
||||
<el-radio :label="true"> 是 </el-radio>
|
||||
<el-radio :label="false"> 否 </el-radio>
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否扣除售后" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isDeductAfterSale">
|
||||
<el-radio :label="true"> 是 </el-radio>
|
||||
<el-radio :label="false"> 否 </el-radio>
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="奖金" prop="rewardSalary">
|
||||
<el-input-number v-model="formData.rewardSalary" :min="0" :controls="false" />
|
||||
<el-form-item label="绩效(%)">
|
||||
<el-input-number v-model="formData.meritsRate" :min="0" :max="100" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -49,6 +49,11 @@
|
||||
<el-input-number v-model="formData.fullWorkSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="奖金" prop="rewardSalary">
|
||||
<el-input-number v-model="formData.rewardSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应发" prop="extraSalary">
|
||||
<el-input-number v-model="formData.extraSalary" :min="0" :controls="false" />
|
||||
@@ -57,16 +62,11 @@
|
||||
</el-row>
|
||||
<el-divider direction="horizontal" content-position="left">应扣</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<!-- <el-col :span="12" :offset="0">
|
||||
<el-form-item label="绩效">
|
||||
<el-input placeholder="生成后录入" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="考勤">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
@@ -86,6 +86,11 @@
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="考勤">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应扣" prop="extraDeduct">
|
||||
<el-input-number v-model="formData.extraDeduct" :min="0" :controls="false" />
|
||||
@@ -127,9 +132,11 @@ const open = async (row) => {
|
||||
getOptions()
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await SalaryApi.getSalaryDetail(row.id)
|
||||
if (!formData.value) {
|
||||
const data = await SalaryApi.getSalaryDetail(row.id)
|
||||
if (!data) {
|
||||
resetForm(row.id)
|
||||
} else {
|
||||
formData.value = { ...data }
|
||||
}
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
@@ -157,7 +164,8 @@ const resetForm = (id) => {
|
||||
socialDeduct: 0,
|
||||
accumulationFundDeduct: 0,
|
||||
meritsSalary: 0,
|
||||
extraDeduct: 0
|
||||
extraDeduct: 0,
|
||||
meritsRate: 0
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
@@ -172,7 +180,7 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value
|
||||
const data = { ...formData.value }
|
||||
await SalaryApi.updateSalary(data)
|
||||
message.success('配置成功')
|
||||
dialogVisible.value = false
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.status" @change="handleQuery">
|
||||
<el-radio :label="0"> 在职 </el-radio>
|
||||
<el-radio :label="1"> 离职 </el-radio>
|
||||
<el-radio :value="0"> 在职 </el-radio>
|
||||
<el-radio :value="1"> 离职 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
:tree-props="{ children: 'userDingAttendanceRespVOList', hasChildren: 'hasChildren' }"
|
||||
:span-method="spanMethod"
|
||||
>
|
||||
<el-table-column label="姓名" min-width="90px">
|
||||
<el-table-column label="姓名" min-width="90px" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.userDingAttendanceRespVOList && row.userDingAttendanceRespVOList.length">
|
||||
<span>{{ row.period }}</span>
|
||||
@@ -67,7 +67,8 @@
|
||||
{{ row.needAttendance ? '考勤' : '不考勤' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="shouldWorkDay" label="计薪天数" min-width="90px" />
|
||||
<el-table-column prop="shouldWorkDay" label="应出勤天数" min-width="90px" />
|
||||
<el-table-column prop="paidLeaveDay" label="带薪假天数" min-width="90px" />
|
||||
<el-table-column label="出勤天数" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
@@ -81,6 +82,19 @@
|
||||
<span v-else> {{ row.reallyWorkDay }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调休天数" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="row.edit"
|
||||
v-model="row.compensatoryLeaveDay"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
size="small"
|
||||
style="width: 65px"
|
||||
/>
|
||||
<span v-else> {{ row.compensatoryLeaveDay }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="缺勤天数" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
@@ -253,11 +267,18 @@ async function getList() {
|
||||
return pre.concat(cur.userDingAttendanceRespVOList)
|
||||
}, [])
|
||||
} else {
|
||||
tableList.value = data.list.map((it, index) => ({
|
||||
tableList.value = data.list.map((it, index) => {
|
||||
const arr = it.userDingAttendanceRespVOList.filter((user) => user.needAttendance)
|
||||
return {
|
||||
...it,
|
||||
userDingAttendanceRespVOList: multiFieldSort(arr, [
|
||||
{ key: 'dept' },
|
||||
{ key: 'employeeName' }
|
||||
]),
|
||||
id: index + 1,
|
||||
edit: it.status == 1 ? '2' : '0'
|
||||
}))
|
||||
}
|
||||
})
|
||||
}
|
||||
total.value = data.total
|
||||
} catch (err) {
|
||||
@@ -267,11 +288,37 @@ async function getList() {
|
||||
}
|
||||
}
|
||||
|
||||
function multiFieldSort(arr, fields) {
|
||||
return arr.sort((a, b) => {
|
||||
// 遍历每个排序字段
|
||||
for (const field of fields) {
|
||||
const { key, order = 'asc' } = field
|
||||
const valueA = a[key]
|
||||
const valueB = b[key]
|
||||
|
||||
// 处理不同类型的比较
|
||||
let compareResult
|
||||
if (typeof valueA === 'number' && typeof valueB === 'number') {
|
||||
compareResult = valueA - valueB // 数字比较
|
||||
} else {
|
||||
compareResult = String(valueA).localeCompare(String(valueB)) // 字符串比较(兼容其他类型)
|
||||
}
|
||||
|
||||
// 如果当前字段值不相等,直接返回比较结果(根据排序方向调整)
|
||||
if (compareResult !== 0) {
|
||||
return order === 'desc' ? -compareResult : compareResult
|
||||
}
|
||||
}
|
||||
// 所有字段都相等,保持原有顺序
|
||||
return 0
|
||||
})
|
||||
}
|
||||
|
||||
function spanMethod({ row, columnIndex }) {
|
||||
if (row.userDingAttendanceRespVOList && row.userDingAttendanceRespVOList.length > 0) {
|
||||
if (columnIndex === 0) {
|
||||
return [1, 12]
|
||||
} else if (columnIndex == 12 && row.id) {
|
||||
return [1, 14]
|
||||
} else if (columnIndex == 14 && row.id) {
|
||||
return [1, 1]
|
||||
} else {
|
||||
return [0, 0]
|
||||
@@ -313,9 +360,7 @@ async function handleSave(row) {
|
||||
text: `假勤数据保存中,请稍后...`,
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
await FalseDiligenceApi.updateFalseDiligence({
|
||||
userDingAttendanceSaveReqVO: row.userDingAttendanceRespVOList
|
||||
})
|
||||
await FalseDiligenceApi.updateFalseDiligence(row.userDingAttendanceRespVOList)
|
||||
globalLoading.value.close()
|
||||
message.success('保存成功!')
|
||||
getList()
|
||||
@@ -332,6 +377,7 @@ async function handleSealup(row) {
|
||||
await FalseDiligenceApi.saveFalseDiligence({
|
||||
period: row.period
|
||||
})
|
||||
message.success('封存成功!')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch (err) {
|
||||
|
||||
@@ -1,7 +1,96 @@
|
||||
<template>
|
||||
<div> 首页 </div>
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row :gutter="20" justify="space-between">
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<div class="flex items-center">
|
||||
<img :src="avatar" alt="" class="w-40px h-40px rounded-[50%] mr-20px" />
|
||||
<div class="text-20px text-700">
|
||||
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<div class="flex h-40px items-center justify-end <sm:mt-10px">
|
||||
<div
|
||||
class="px-8px text-right"
|
||||
@click="router.push({ path: '/Okr/okr-wait', query: { type: 1 } })"
|
||||
>
|
||||
<div class="text-14px text-red-600 mb-20px">今日待办</div>
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="waitCount.dayEndAgentWorkNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<div
|
||||
class="px-8px text-right"
|
||||
@click="router.push({ path: '/Okr/okr-wait', query: { type: 2 } })"
|
||||
>
|
||||
<div class="text-14px text-gray-400 mb-20px">我的待办</div>
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="waitCount.myAgentWorkNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts" name="Home">
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
import { getWaitCount } from '@/api/okr/wait'
|
||||
|
||||
<script setup name="Home"></script>
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const router = useRouter() // 路由对象
|
||||
const loading = ref(false)
|
||||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
|
||||
const username = userStore.getUser.nickname
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
function getWaitTargetCount() {
|
||||
getWaitCount({}).then((res) => {
|
||||
waitCount.value = res
|
||||
})
|
||||
}
|
||||
|
||||
const waitCount = ref({
|
||||
dayEndAgentWorkNum: 0,
|
||||
myAgentWorkNum: 0,
|
||||
urgeAgentWorkNum: 0,
|
||||
notifyNum: 0
|
||||
})
|
||||
|
||||
const getAllApi = async () => {
|
||||
await getWaitTargetCount()
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getAllApi()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@font-face {
|
||||
font-family: numberFont;
|
||||
src: url('@/assets/fonts/DISPLAY FREE TFB.ttf');
|
||||
}
|
||||
|
||||
.number-font {
|
||||
font-family: numberFont !important;
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
:tree-props="{ children: 'userSalaryGrantRespVOList', hasChildren: 'hasChildren' }"
|
||||
:span-method="spanMethod"
|
||||
>
|
||||
<el-table-column label="姓名" min-width="90px">
|
||||
<el-table-column label="姓名" min-width="90px" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.userSalaryGrantRespVOList && row.userSalaryGrantRespVOList.length">
|
||||
<span>{{ row.period }}</span>
|
||||
@@ -57,7 +57,7 @@
|
||||
<el-table-column prop="dept" label="部门" min-width="90px" />
|
||||
<el-table-column prop="post" label="职位" min-width="90px" />
|
||||
<el-table-column label="应发工资" align="center">
|
||||
<el-table-column label="基本工资" min-width="90px">
|
||||
<el-table-column label="无责底薪" min-width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="row.edit"
|
||||
@@ -70,7 +70,7 @@
|
||||
<span v-else> {{ row.baseSalary }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绩效" min-width="90px">
|
||||
<el-table-column label="标准绩效" min-width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="row.edit"
|
||||
@@ -83,6 +83,19 @@
|
||||
<span v-else> {{ row.meritsSalary }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绩效实发" min-width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="row.edit"
|
||||
v-model="row.reallyMeritsSalary"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
size="small"
|
||||
style="width: 65px"
|
||||
/>
|
||||
<span v-else> {{ row.reallyMeritsSalary }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="补贴" min-width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
@@ -295,9 +308,24 @@
|
||||
<span v-if="row.status == 0">封存</span>
|
||||
<span v-else-if="row.status == 1">已封存</span>
|
||||
</el-button>
|
||||
<el-button type="primary" v-if="row.grantId" text @click="handleDetail(row)">
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="row.grantId"
|
||||
style="padding: 0"
|
||||
text
|
||||
@click="handleDetail(row)"
|
||||
>
|
||||
提成明细
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
v-hasPermi="['home:salary:send']"
|
||||
style="padding: 0"
|
||||
@click="handelSendNotic(row)"
|
||||
>
|
||||
发送工资条
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -364,6 +392,10 @@ async function getList() {
|
||||
} else {
|
||||
tableList.value = data.list.map((it, index) => ({
|
||||
...it,
|
||||
userSalaryGrantRespVOList: multiFieldSort(it.userSalaryGrantRespVOList, [
|
||||
{ key: 'dept' },
|
||||
{ key: 'name' }
|
||||
]),
|
||||
id: index + 1,
|
||||
edit: it.status == 1 ? '2' : '0'
|
||||
}))
|
||||
@@ -376,6 +408,32 @@ async function getList() {
|
||||
}
|
||||
}
|
||||
|
||||
function multiFieldSort(arr, fields) {
|
||||
return arr.sort((a, b) => {
|
||||
// 遍历每个排序字段
|
||||
for (const field of fields) {
|
||||
const { key, order = 'asc' } = field
|
||||
const valueA = a[key]
|
||||
const valueB = b[key]
|
||||
|
||||
// 处理不同类型的比较
|
||||
let compareResult
|
||||
if (typeof valueA === 'number' && typeof valueB === 'number') {
|
||||
compareResult = valueA - valueB // 数字比较
|
||||
} else {
|
||||
compareResult = String(valueA).localeCompare(String(valueB)) // 字符串比较(兼容其他类型)
|
||||
}
|
||||
|
||||
// 如果当前字段值不相等,直接返回比较结果(根据排序方向调整)
|
||||
if (compareResult !== 0) {
|
||||
return order === 'desc' ? -compareResult : compareResult
|
||||
}
|
||||
}
|
||||
// 所有字段都相等,保持原有顺序
|
||||
return 0
|
||||
})
|
||||
}
|
||||
|
||||
const createSalaryRef = ref()
|
||||
function craeteSalary() {
|
||||
createSalaryRef.value.open()
|
||||
@@ -389,8 +447,8 @@ function importHistorySalary() {
|
||||
function spanMethod({ row, columnIndex }) {
|
||||
if (row.userSalaryGrantRespVOList && row.userSalaryGrantRespVOList.length > 0) {
|
||||
if (columnIndex === 0) {
|
||||
return [1, 22]
|
||||
} else if (columnIndex == 22 && row.id) {
|
||||
return [1, 23]
|
||||
} else if (columnIndex == 23 && row.id) {
|
||||
return [1, 1]
|
||||
} else {
|
||||
return [0, 0]
|
||||
@@ -431,6 +489,7 @@ async function handleSealup(row) {
|
||||
grantIdList: row.userSalaryGrantRespVOList.map((it) => it.grantId),
|
||||
period: row.period
|
||||
})
|
||||
message.success('封存成功!')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch (err) {
|
||||
@@ -451,6 +510,20 @@ async function handleDetail(row) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
function handelSendNotic(row) {
|
||||
const name = row.grantId ? row.name : row.period
|
||||
const params = row.grantId ? { grantId: row.grantId } : { period: row.period }
|
||||
message.confirm('确认要发送"' + name + '"工资条吗?').then(async () => {
|
||||
try {
|
||||
await SalaryApi.sendSalaryNotice(params)
|
||||
message.success('发送成功!')
|
||||
} catch (error) {
|
||||
message.error(error)
|
||||
console.log(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
225
src/views/Kpi/Appraise/Components/DialogAppraise.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<Dialog :title="title" v-model="show" width="800px">
|
||||
<el-form v-loading="formLoading" :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="考核指标" prop="examineTarget">
|
||||
<el-input v-model="form.examineTarget" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="生效日期" prop="effectiveDate">
|
||||
<el-date-picker
|
||||
v-model="form.effectiveDate"
|
||||
type="date"
|
||||
:disabled="!!form.id"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="模式" prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio
|
||||
v-for="(item, index) in prop.kpiModeOoptions"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="权重" prop="weight">
|
||||
<el-input-number v-model="form.weight" :min="0" :step="1" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="评分上限" prop="examineScore">
|
||||
<el-input-number v-model="form.examineScore" :min="0" :step="1" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="考核内容" prop="examineContent">
|
||||
<Editor
|
||||
v-model:modelValue="form.examineContent"
|
||||
height="150px"
|
||||
:toolbarConfig="{
|
||||
toolbarKeys: []
|
||||
}"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="考核规则" prop="examineRule">
|
||||
<Editor
|
||||
v-model:modelValue="form.examineRule"
|
||||
height="150px"
|
||||
:toolbarConfig="{ toolbarKeys: [] }"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="考核员工" prop="examinedUserIdList">
|
||||
<div>
|
||||
<el-checkbox
|
||||
v-model="checkAll"
|
||||
:indeterminate="isIndeterminate"
|
||||
@change="handleCheckAllChange"
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-checkbox-group v-model="form.examinedUserIdList" @change="handleCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:disabled="item.status == 1"
|
||||
:label="item.id"
|
||||
:value="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button type="primary" :disabled="formLoading" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogAppraise">
|
||||
import * as KpiApi from '@/api/kpi/index.js'
|
||||
|
||||
const prop = defineProps({
|
||||
kpiModeOoptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
const title = ref('')
|
||||
const formType = ref('create')
|
||||
|
||||
const form = ref({})
|
||||
const formLoading = ref(false)
|
||||
const rules = ref({
|
||||
examineTarget: { required: true, message: '标题不可为空', trigger: 'blur' },
|
||||
effectiveDate: { required: true, message: '生效日期不可为空', trigger: 'blur,change' },
|
||||
examineContent: { required: true, message: '标题不可为空', trigger: 'blur' },
|
||||
examineRule: { required: true, message: '标题不可为空', trigger: 'blur' }
|
||||
})
|
||||
|
||||
async function open(type, val) {
|
||||
show.value = true
|
||||
title.value = type == 'update' ? '修改考核项' : '新增考核项'
|
||||
formType.value = type
|
||||
resetForm()
|
||||
if (val) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
form.value = await KpiApi.getKpiDetail(val)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
getOptions()
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
KpiApi.getKpiEmployees().then((data) => {
|
||||
employeeOptions.value = data
|
||||
if (formType.value == 'update') {
|
||||
handleCheckedChange(form.value.examinedUserIdList)
|
||||
} else {
|
||||
handleCheckAllChange(true)
|
||||
checkAll.value = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
form.value = {
|
||||
examineTarget: '',
|
||||
type: '3',
|
||||
weight: 0,
|
||||
examineContent: ``,
|
||||
examineRule: ``,
|
||||
examineScore: 5,
|
||||
examinedUserIdList: []
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (formType.value === 'create') {
|
||||
await KpiApi.createKpi(form.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await KpiApi.updateKpi(form.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const checkAll = ref(false)
|
||||
const isIndeterminate = ref(false)
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function handleCheckAllChange(val) {
|
||||
form.value.examinedUserIdList = val ? employeeOptions.value.map((it) => it.id) : []
|
||||
isIndeterminate.value = false
|
||||
}
|
||||
|
||||
function handleCheckedChange(value) {
|
||||
const checkedCount = value.length
|
||||
checkAll.value = checkedCount === employeeOptions.value.length
|
||||
isIndeterminate.value = checkedCount > 0 && checkedCount < employeeOptions.value.length
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
156
src/views/Kpi/Appraise/index.vue
Normal file
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="searchForm" ref="queryFormRef" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.examineTarget" placeholder="请输入考核指标" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery" v-hasPermi="['kpi:appraise:search']"> 搜索</el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['kpi:appraise:reset']"> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['kpi:appraise:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list" border>
|
||||
<el-table-column prop="examineTarget" label="考核指标" width="180" />
|
||||
<el-table-column prop="typeName" label="分值模式" width="90" :formatter="getKpiModeLabel" />
|
||||
<el-table-column prop="weight" label="权重%" width="90" />
|
||||
<el-table-column label="考核内容">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineContent"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考核规则" prop="examineRule">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineRule"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分上限" prop="examineScore" width="90" />
|
||||
<el-table-column label="考核人数" width="90">
|
||||
<template #default="{ row }">
|
||||
{{ row.examinedUserIdList?.length || 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生效日期" prop="effectiveDate" width="120" />
|
||||
<el-table-column label="操作" class-name="fixed-width" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', row.id)"
|
||||
v-hasPermi="['kpi:appraise:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(row.id)"
|
||||
v-hasPermi="['kpi:appraise:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<DialogAppraise ref="formRef" :kpiModeOoptions="kpiModeOoptions" @success="handleQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="KpiContent">
|
||||
import { removeNullField } from '@/utils'
|
||||
import DialogAppraise from './Components/DialogAppraise.vue'
|
||||
import * as KpiApi from '@/api/kpi/index.js'
|
||||
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const searchForm = ref({
|
||||
examineTarget: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
const total = ref(0)
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
const kpiModeOoptions = ref([])
|
||||
function getOptions() {
|
||||
getGeneralSysDictData('examine_type').then((data) => {
|
||||
kpiModeOoptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function getKpiModeLabel(row) {
|
||||
return kpiModeOoptions.value.find((it) => it.value == row.type)?.label
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await KpiApi.getKpiPage(removeNullField(searchForm.value))
|
||||
list.value = data.list
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
searchForm.value = {
|
||||
examineTarget: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type, id) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await KpiApi.deleteKpi(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
48
src/views/Kpi/Record/DialogScoreDetail.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<Dialog title="绩效考核详情" v-model="show" width="1200px">
|
||||
<el-table :data="list" border stripe>
|
||||
<el-table-column prop="examineTarget" label="考核指标" width="100" />
|
||||
<el-table-column prop="typeName" label="分值模式" width="90" />
|
||||
<el-table-column prop="weight" label="权重%" width="90" />
|
||||
<el-table-column label="考核内容">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineContent"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考核规则" prop="examineRule">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineRule"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分上限" prop="examineScore" width="90" />
|
||||
<el-table-column label="考核评分" width="90" prop="score" />
|
||||
<el-table-column label="评分备注" width="90" prop="remark" />
|
||||
<el-table-column label="加权得分" prop="weightSocre" width="90" />
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">关 闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogScoreDetail">
|
||||
import * as KpiApi from '@/api/kpi/score.js'
|
||||
|
||||
const show = ref(false)
|
||||
const list = ref([])
|
||||
|
||||
async function open(id) {
|
||||
show.value = true
|
||||
try {
|
||||
const data = await KpiApi.getScoreDetail({ id })
|
||||
list.value = data.list
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
201
src/views/Kpi/Record/index.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="searchForm" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.period"
|
||||
type="month"
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM"
|
||||
placeholder="年月"
|
||||
style="width: 100%"
|
||||
@change="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model.trim="searchForm.dept"
|
||||
placeholder="组织名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model.trim="searchForm.examinedUserName"
|
||||
placeholder="员工姓名"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getList" v-hasPermi="['kpi:score:search']"> 搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
stripe
|
||||
:default-expand-all="false"
|
||||
row-key="id"
|
||||
:tree-props="{ children: 'examineResultRespVOList', hasChildren: 'hasChildren' }"
|
||||
:span-method="spanMethod"
|
||||
>
|
||||
<el-table-column label="姓名" min-width="90px">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.examineResultRespVOList && row.examineResultRespVOList.length">
|
||||
<span>{{ row.period }}</span>
|
||||
<span class="ml-20px">考核人数:{{ row.examineNum }}人</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ row.examinedUserName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="period" label="年月" min-width="90px" />
|
||||
<el-table-column prop="dept" label="组织" min-width="90px" />
|
||||
<el-table-column label="考核总分" prop="score" align="center" />
|
||||
<el-table-column label="操作" fixed="right" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="danger"
|
||||
v-if="!row.examinedUser"
|
||||
:disabled="row.status == 1"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['home:false-dilegence:sealup']"
|
||||
@click="handleSealup(row)"
|
||||
>
|
||||
<span v-if="row.status == 0">封存</span>
|
||||
<span v-else-if="row.status == 1">已封存</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
v-if="row.examinedUser"
|
||||
style="padding: 0"
|
||||
v-hasPermi="['kpi:record:detail']"
|
||||
@click="handleDetail(row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="searchForm.pageNo"
|
||||
v-model:limit="searchForm.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<DialogScoreDetail ref="detailDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="KpiRecord">
|
||||
import { removeNullField } from '@/utils'
|
||||
import * as KpiApi from '@/api/kpi/score.js'
|
||||
import DialogScoreDetail from './DialogScoreDetail.vue'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
examinedUserName: undefined,
|
||||
period: undefined,
|
||||
dept: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
let params = {
|
||||
...searchForm.value
|
||||
}
|
||||
if (params.period) {
|
||||
params = {
|
||||
...params,
|
||||
year: new Date(params.period).getFullYear(),
|
||||
month: new Date(params.period).getMonth() + 1
|
||||
}
|
||||
}
|
||||
const data = await KpiApi.getScoreRecord(removeNullField(params))
|
||||
if (searchForm.value.examinedUserName) {
|
||||
tableList.value = data.list.reduce((pre, cur) => {
|
||||
return pre.concat(cur.examineResultRespVOList)
|
||||
}, [])
|
||||
} else {
|
||||
tableList.value = data.list.map((it, index) => ({
|
||||
...it,
|
||||
examineResultRespVOList: it.examineResultRespVOList,
|
||||
id: index + 1
|
||||
}))
|
||||
}
|
||||
total.value = data.total
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function spanMethod({ row, columnIndex }) {
|
||||
if (row.examineResultRespVOList && row.examineResultRespVOList.length > 0) {
|
||||
if (columnIndex === 0) {
|
||||
return [1, 4]
|
||||
} else if (columnIndex == 4 && row.id) {
|
||||
return [1, 1]
|
||||
} else {
|
||||
return [0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const detailDialogRef = ref()
|
||||
function handleDetail(row) {
|
||||
detailDialogRef.value.open(row.id)
|
||||
}
|
||||
|
||||
async function handleSealup(row) {
|
||||
try {
|
||||
// 二次确认
|
||||
await message.confirm('确认要封存"' + row.period + '"考核记录吗?')
|
||||
// 发起修改状态
|
||||
await KpiApi.saveScoreRecord({
|
||||
period: row.period
|
||||
})
|
||||
message.success('封存成功!')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-table__indent) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.el-table__placeholder) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
213
src/views/Kpi/Score/index.vue
Normal file
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="searchForm" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.period"
|
||||
type="month"
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM"
|
||||
:clearable="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getList" v-hasPermi="['kpi:score:search']"> 搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tabs v-model="employeeId" @tab-click="getList">
|
||||
<el-tab-pane
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.examinedUser"
|
||||
:name="item.examinedUser"
|
||||
>
|
||||
<template #label>
|
||||
<span>{{ item.examinedUserName }}</span>
|
||||
<el-badge :is-dot="item.notExaminedCount > 0" type="danger" />
|
||||
</template>
|
||||
<div class="mb-10px">
|
||||
<el-tag v-if="periodSaved == 1" type="danger">
|
||||
当前周期已封存,不可修改当月绩效考核
|
||||
</el-tag>
|
||||
<el-tag v-else type="warning">
|
||||
当前周期未封存,可选择修改当月绩效考核,两秒内不操作将自动保存考核结果
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
<el-table-column prop="examineTarget" label="考核指标" width="180" />
|
||||
<el-table-column prop="typeName" label="分值模式" width="90" />
|
||||
<el-table-column prop="weight" label="权重%" width="90" />
|
||||
<el-table-column label="考核内容">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineContent"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考核规则" prop="examineRule">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineRule"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分上限" prop="examineScore" width="90" />
|
||||
<el-table-column label="考核评分" width="120">
|
||||
<template #default="{ row }">
|
||||
<div v-if="periodSaved == 1">{{ row.score }}</div>
|
||||
<el-input-number
|
||||
v-else
|
||||
v-model="row.score"
|
||||
:min="0"
|
||||
:max="row.examineScore"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
@input="handleSave(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分备注" width="200">
|
||||
<template #default="{ row }">
|
||||
<div v-if="periodSaved == 1">{{ row.remark }}</div>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="row.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
@input="handleSave(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加权得分" prop="weightSocre" width="90" />
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button style="padding: 0" type="danger" text @click="handleDelete(row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="KpiScore">
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import * as KpiApi from '@/api/kpi/score.js'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const searchForm = ref({
|
||||
period: undefined
|
||||
})
|
||||
|
||||
const periodSaved = ref(0)
|
||||
|
||||
const employeeOptions = ref([])
|
||||
const employeeId = ref('')
|
||||
|
||||
onMounted(() => {
|
||||
// 默认取上个月
|
||||
const today = new Date()
|
||||
searchForm.value.period = formatDate(
|
||||
new Date(today.getFullYear(), today.getMonth() - 1),
|
||||
'YYYY-MM'
|
||||
)
|
||||
|
||||
getList()
|
||||
})
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
KpiApi.getKpiPeriodStatus({ period: searchForm.value.period }).then((data) => {
|
||||
periodSaved.value = data.status
|
||||
})
|
||||
// 获取当前要考核的人员
|
||||
const arr = await KpiApi.getKpiEmployees(searchForm.value)
|
||||
employeeOptions.value = arr || []
|
||||
if (employeeOptions.value.length > 0) {
|
||||
if (!employeeId.value) {
|
||||
employeeId.value = employeeOptions.value[0].examinedUser
|
||||
}
|
||||
} else {
|
||||
message.error('当月无待考核员工!!!')
|
||||
return
|
||||
}
|
||||
list.value =
|
||||
employeeOptions.value.find((it) => it.examinedUser == employeeId.value)
|
||||
?.examineScoreRespVOList || []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
let timer = ref(null)
|
||||
const lastId = ref('')
|
||||
function handleSave(row) {
|
||||
try {
|
||||
lastId.value == row.id && clearTimeout(timer.value)
|
||||
timer.value = setTimeout(async () => {
|
||||
lastId.value = row.id
|
||||
// message.success('正在保存数据,请稍后')
|
||||
await KpiApi.saveKpiScore({
|
||||
id: row.id,
|
||||
score: row.score,
|
||||
remark: row.remark
|
||||
})
|
||||
message.success('修改成功!')
|
||||
getList()
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDelete(row) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm(
|
||||
`删除后,该员工于${searchForm.value.period}将不再考核此项,是否确认删除?`
|
||||
)
|
||||
// 发起删除
|
||||
await KpiApi.deleteKpiItem({ id: row.id })
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function getSummaries({ columns, data }) {
|
||||
let sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index == 0) {
|
||||
sums[index] = '考核总分'
|
||||
return
|
||||
}
|
||||
const values = data.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
if (column.property == 'weightSocre') {
|
||||
const employee = employeeOptions.value.find((it) => it.examinedUser == employeeId.value)
|
||||
sums[index] = employee.scoreTotal + '分'
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,54 +1,25 @@
|
||||
<template>
|
||||
<div
|
||||
:class="prefixCls"
|
||||
class="h-[100%] relative <xl:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"
|
||||
class="h-[100%] relative dark:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"
|
||||
>
|
||||
<div class="relative h-full flex mx-auto">
|
||||
<div
|
||||
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px <xl:hidden`"
|
||||
>
|
||||
<div :class="`${prefixCls}__left w-[30%] <lg:w-[100%] left-box relative p-30px <xl:p-20px`">
|
||||
<!-- 左上角的 logo + 系统标题 -->
|
||||
<div class="flex items-center relative text-white">
|
||||
<img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
|
||||
</div>
|
||||
<!-- 左边的背景图 + 欢迎语 -->
|
||||
<div class="flex justify-center">
|
||||
<TransitionGroup
|
||||
appear
|
||||
enter-active-class="animate__animated animate__bounceInLeft"
|
||||
tag="div"
|
||||
>
|
||||
<img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />
|
||||
<!-- <div key="2" class="text-3xl text-white">{{ t('login.welcome') }}</div> -->
|
||||
</TransitionGroup>
|
||||
</div>
|
||||
|
||||
<div class="landIn">
|
||||
<transition-group name="text-animation">
|
||||
<span v-for="(char, index) in chars" :key="index">{{ char }}</span>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 p-30px <sm:p-10px dark:bg-v-dark relative">
|
||||
<!-- 右上角的主题、语言选择 -->
|
||||
<div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
|
||||
<div class="flex items-center @2xl:hidden @xl:hidden">
|
||||
<img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-end items-center space-x-10px">
|
||||
<ThemeSwitch />
|
||||
<!-- <LocaleDropdown class="<xl:text-white dark:text-white" /> -->
|
||||
</div>
|
||||
<div class="flex items-center relative">
|
||||
<h2 class="mb-3 text-2xl font-bold">
|
||||
欢迎使用 {{ underlineToHump(appInfo.instanceName) }}
|
||||
</h2>
|
||||
<!-- <img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" /> -->
|
||||
<!-- <span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span> -->
|
||||
</div>
|
||||
<!-- 右边的登录界面 -->
|
||||
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
||||
<div
|
||||
class="h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px"
|
||||
class="flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px <xl:mt-20px"
|
||||
>
|
||||
<!-- 账号登录 -->
|
||||
<LoginForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
||||
<LoginForm class="p-40px <xl:p-10px h-auto m-auto" />
|
||||
<!-- 手机登录 -->
|
||||
<!-- <MobileForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||
<!-- 二维码登录 -->
|
||||
@@ -59,6 +30,39 @@
|
||||
<!-- <SSOLoginVue class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||
</div>
|
||||
</Transition>
|
||||
<!-- 左边的背景图 + 欢迎语 -->
|
||||
<div class="flex justify-center">
|
||||
<TransitionGroup
|
||||
appear
|
||||
enter-active-class="animate__animated animate__bounceInLeft"
|
||||
tag="div"
|
||||
>
|
||||
<!-- <img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" /> -->
|
||||
<img key="1" alt="" class="w-[50%] m-auto" src="@/assets/imgs/login2.gif" />
|
||||
</TransitionGroup>
|
||||
</div>
|
||||
|
||||
<div class="landIn">
|
||||
<transition-group name="text-animation">
|
||||
<span v-for="(char, index) in chars" :key="index">{{ char }}</span>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-box flex-1 p-30px <sm:p-10px dark:bg-v-dark <lg:hidden relative">
|
||||
<!-- 右上角的主题、语言选择 -->
|
||||
<div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
|
||||
<div class="flex items-center @2xl:hidden @xl:hidden">
|
||||
<!-- <img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" /> -->
|
||||
<!-- <span class="text-20px font-bold text-black">
|
||||
欢迎使用 {{ underlineToHump(appInfo.instanceName) }}
|
||||
</span> -->
|
||||
</div>
|
||||
<div class="flex justify-end items-center space-x-10px">
|
||||
<ThemeSwitch />
|
||||
<!-- <LocaleDropdown class="<xl:text-white dark:text-white" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<img src="@/assets/imgs/shisong.jpg" width="80%" alt="" srcset="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -137,7 +141,7 @@ $prefix-cls: #{$namespace}-login;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('@/assets/svgs/login-bg.svg');
|
||||
// background-image: url('@/assets/svgs/login-bg.svg');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
content: '';
|
||||
@@ -145,6 +149,20 @@ $prefix-cls: #{$namespace}-login;
|
||||
}
|
||||
}
|
||||
|
||||
// .left-box {
|
||||
// background: #f3f4fb;
|
||||
// background-image: url('@/assets/imgs/login-left-bg.png');
|
||||
// background-repeat: no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
// }
|
||||
|
||||
.login-box {
|
||||
background-image: url('@/assets/imgs/shisong.jpg');
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 80% 80%;
|
||||
}
|
||||
|
||||
.text-animation-enter-active,
|
||||
.text-animation-leave-active {
|
||||
transition: opacity 0.5s;
|
||||
@@ -160,12 +178,11 @@ $prefix-cls: #{$namespace}-login;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-size: 18px;
|
||||
line-height: 1.8;
|
||||
font-size: 1rem;
|
||||
line-height: 1.3;
|
||||
font-family: Lora, serif;
|
||||
white-space: pre;
|
||||
font-weight: 600;
|
||||
color: #6ee1f5;
|
||||
|
||||
span {
|
||||
animation: landIn 0.8s ease-out both;
|
||||
|
||||
@@ -11,10 +11,13 @@
|
||||
>
|
||||
<el-row style="margin-left: -10px; margin-right: -10px">
|
||||
<el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<slot name="title"></slot>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<el-form-item>
|
||||
<LoginFormTitle style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantId">
|
||||
<el-input
|
||||
@@ -107,7 +110,7 @@
|
||||
</template>
|
||||
<script name="LoginForm" setup>
|
||||
import { ElLoading } from 'element-plus'
|
||||
import LoginFormTitle from './LoginFormTitle.vue'
|
||||
// import LoginFormTitle from './LoginFormTitle.vue'
|
||||
|
||||
import { useIcon } from '@/hooks/web/useIcon'
|
||||
|
||||
@@ -124,6 +127,8 @@ const formLogin = ref()
|
||||
const { validForm } = useFormValid(formLogin)
|
||||
const { setLoginState, getLoginState } = useLoginState()
|
||||
const { currentRoute, push } = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const permissionStore = usePermissionStore()
|
||||
const redirect = ref('')
|
||||
const loginLoading = ref(false)
|
||||
@@ -214,9 +219,12 @@ const handleLogin = async (params) => {
|
||||
if (redirect.value.indexOf('sso') !== -1) {
|
||||
window.location.href = window.location.href.replace('/login?redirect=', '')
|
||||
} else {
|
||||
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
||||
push({
|
||||
path: redirect.value || permissionStore.addRouters[0].path,
|
||||
query: route.redirectedFrom?.query
|
||||
})
|
||||
}
|
||||
} catch {
|
||||
} catch (err) {
|
||||
loginLoading.value = false
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
@@ -226,10 +234,12 @@ const handleLogin = async (params) => {
|
||||
}
|
||||
}
|
||||
|
||||
// const routerParams = ref(undefined)
|
||||
watch(
|
||||
() => currentRoute.value,
|
||||
(route) => {
|
||||
redirect.value = route?.query?.redirect
|
||||
(route1) => {
|
||||
redirect.value = route1?.redirectedFrom?.path
|
||||
// routerParams.value = route?.redirectedFrom?.query
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
|
||||
602
src/views/OKR/Analysis/index.vue
Normal file
@@ -0,0 +1,602 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row class="mb-10px flex justify-between items-start">
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
check-strictly
|
||||
style="width: 300px"
|
||||
@change="nodeChange"
|
||||
/>
|
||||
<div class="flex justify-end flex-1">
|
||||
<el-button type="info" @click="handleExport">导出</el-button>
|
||||
<el-popover
|
||||
ref="countRef"
|
||||
placement="left"
|
||||
:title="`${currentNode?.nodeName} 数据汇总`"
|
||||
trigger="click"
|
||||
width="500px"
|
||||
v-model:visible="showCountPop"
|
||||
>
|
||||
<template #reference><el-button>数据汇总</el-button></template>
|
||||
<el-table :data="countInfo" stripe>
|
||||
<el-table-column prop="keyResultShowName" label="项目名称" />
|
||||
<el-table-column prop="currentValue" label="当前值" width="90" />
|
||||
<el-table-column prop="targetValue" label="预期值" width="90" />
|
||||
<el-table-column label="完成度" width="150">
|
||||
<template #default="{ row }">
|
||||
<el-progress
|
||||
:percentage="parseInt((row.currentValue / row.targetValue) * 100) || 0"
|
||||
:color="customColors"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-popover>
|
||||
<el-button type="primary" @click="openDrawer(1, currentNode.nodeId, currentNode.nodeName)">
|
||||
节点笔谈
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
id="okrAnalysisTable"
|
||||
:data="originList"
|
||||
border
|
||||
:span-method="objectSpanMethod"
|
||||
:show-summary="!!tableKeywords"
|
||||
@cell-click="handleClickCell"
|
||||
>
|
||||
<el-table-column prop="objectInfo.objectiveName" label="目标">
|
||||
<template #default="{ row }">
|
||||
{{ row.objectInfo.objectiveName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="objectiveId" label="占比" width="100px">
|
||||
<template #default> 0 </template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="keyResultShowName">
|
||||
<template #header>
|
||||
<div class="flex items-center justify-center">
|
||||
<div class="flex-1 mr-10px">
|
||||
<el-input
|
||||
v-if="showTableSearch"
|
||||
v-model="tableKeywords"
|
||||
placeholder="请输入关键字"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
@change="handleTableFilter"
|
||||
/>
|
||||
<div v-else>关键成果</div>
|
||||
</div>
|
||||
<el-button type="primary" size="small" @click="handleFilterTableClick">
|
||||
{{ showTableSearch ? '取消' : '筛选' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
{{ row.sourceName ? `【${row.sourceName}】` : '' }} {{ row.keyResultShowName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="targetValue" label="目标值" width="100px" />
|
||||
<el-table-column prop="currentValue" label="当前进度" width="100px" />
|
||||
<el-table-column label="开始日期" width="120px">
|
||||
<template #default>
|
||||
{{ currentNode.startTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="完成状态" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.currentValue >= row.targetValue" type="success">完成</el-tag>
|
||||
<el-tag v-else type="danger">未完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="muis" label="差值" width="100px">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
:style="{
|
||||
color: row.targetValue >= row.currentValue ? 'red' : '#333',
|
||||
'font-weight': row.targetValue >= row.currentValue ? 'bold' : '500'
|
||||
}"
|
||||
>
|
||||
{{ parseInt(row.targetValue - row.currentValue) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="complete" label="完成度" width="200px">
|
||||
<template #default="{ row }">
|
||||
<el-progress :percentage="parseInt(row.progress)" :color="customColors" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="结束日期" width="120px">
|
||||
<template #default>
|
||||
{{ currentNode.endTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="objectInfo.progress" label="目标完成度" width="100px" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ parseInt(row.objectInfo.progress) }}%
|
||||
<!-- <el-progress :percentage="parseInt(row.objectInfo.progress)" :color="customColors" /> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-drawer
|
||||
v-if="showDrawer"
|
||||
v-model="showDrawer"
|
||||
:title="drawerTitle"
|
||||
size="60vw"
|
||||
direction="rtl"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-tabs v-model="currentType" @tab-click="searchCommentList()">
|
||||
<el-tab-pane
|
||||
v-for="item in commentTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:name="item.id"
|
||||
>
|
||||
<div v-if="item.id == currentType">
|
||||
<div v-if="addNewComment">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<el-button size="small" @click="addNewComment = false"> 取消 </el-button>
|
||||
<el-button type="primary" size="small" @click="handleSaveComment">
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-10px" v-if="addNewComment">
|
||||
<Editor
|
||||
v-model:modelValue="form.commentValue"
|
||||
height="300px"
|
||||
:toolbarConfig="toolbarConfig"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<el-button v-else type="primary" size="small" @click="handleInsertComment">
|
||||
新增
|
||||
</el-button>
|
||||
<div
|
||||
v-for="(it, index) in commentList"
|
||||
:key="it.commentId"
|
||||
class="border-b-1"
|
||||
style="padding: 10px 5px"
|
||||
>
|
||||
<div
|
||||
class="flex items-center justify-between overflow-hidden text-16px"
|
||||
style="line-height: 30px"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<el-avatar
|
||||
shape="circle"
|
||||
style="
|
||||
background-color: var(--el-color-primary-light-3);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
"
|
||||
fit="fill"
|
||||
>
|
||||
<span class="text-12px">{{ it.creatorName.slice(-2) }}</span>
|
||||
</el-avatar>
|
||||
<div class="ml-10px text-16px">{{ it.creatorName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px" v-dompurify-html="it.content"></div>
|
||||
<div
|
||||
class="ml-10px mt-10px flex items-center justify-between text-12px"
|
||||
style="line-height: 20px; color: #aaa"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="good(it)">
|
||||
<Icon
|
||||
icon="fa:thumbs-o-up"
|
||||
:size="16"
|
||||
:color="it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'"
|
||||
/>
|
||||
</el-button>
|
||||
<span
|
||||
class="ml-5px"
|
||||
:style="{
|
||||
color: it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'
|
||||
}"
|
||||
>{{ it.likeCount }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="showChildComment(index)">
|
||||
<Icon icon="ep:chat-dot-square" :size="16" color="#333" />
|
||||
</el-button>
|
||||
<span class="ml-5px" style="color: #333">{{ it.commentCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px text-13px text-gray-400">
|
||||
{{ formatDate(it.createTime, 'YYYY-MM-DD HH:mm') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 评论 -->
|
||||
<div
|
||||
v-if="showCommentIndex == index"
|
||||
class="bg-gray-100 pl-10px pr-10px pt-5px pb-5px"
|
||||
style="margin: 10px 10px 0 10px; border-radius: 4px"
|
||||
label="笔谈"
|
||||
>
|
||||
<div
|
||||
v-for="subComment in it.children.sort((a, b) => a.createTime - b.createTime)"
|
||||
:key="subComment.commentId"
|
||||
class="text-14px"
|
||||
style="line-height: 24px"
|
||||
>
|
||||
<span class="font-bold">{{ subComment.creatorName }}:</span>
|
||||
<span>
|
||||
{{ subComment.content }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10px relative">
|
||||
<!-- <el-input
|
||||
v-model="form.commentValue"
|
||||
placeholder="请输入评论"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
/> -->
|
||||
<el-mention
|
||||
v-model="form.commentValue"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
:options="employeeOptions"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
whole
|
||||
placeholder="请输入内容"
|
||||
@select="handleMention"
|
||||
>
|
||||
<template #label="scope">
|
||||
<div class="flex items-center justify-between h-full">
|
||||
<span class="text-14px text-dark-700">{{ scope.item.name }}</span>
|
||||
<span class="text-12px text-gray-400">{{ scope.item.dept }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-mention>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="position: absolute; right: 2px; bottom: 2px"
|
||||
@click="handleSendCommnet(index)"
|
||||
>
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Analysis">
|
||||
import { listToTree, findNode } from '@/utils/tree'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { getAllNodeTree, getAllOkrPage, getOkrStatisticsTotal } from '@/api/okr/okr'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import {
|
||||
getCommentTypeOptions,
|
||||
createComment,
|
||||
getCommentPage,
|
||||
likeComment
|
||||
} from '@/api/okr/comment'
|
||||
import { exportTableWithVue } from '@/utils'
|
||||
|
||||
const message = useMessage()
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const currentNode = ref(undefined)
|
||||
const showDrawer = ref(false)
|
||||
const drawerTitle = ref('详情')
|
||||
|
||||
const customColors = [
|
||||
{ color: 'rgb(196, 86.4, 86.4)', percentage: 20 },
|
||||
{ color: 'rgb(196, 86.4, 86.4)', percentage: 40 },
|
||||
{ color: 'rgb(237.5, 189.9, 118.5)', percentage: 60 },
|
||||
{ color: 'rgb(159.5, 206.5, 255)', percentage: 80 },
|
||||
{ color: 'rgb(179, 224.5, 156.5)', percentage: 100 }
|
||||
]
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
const showTableSearch = ref(false)
|
||||
const tableKeywords = ref('')
|
||||
|
||||
handleSearchPeroid()
|
||||
getOptions()
|
||||
|
||||
// 当前是否是叶子节点
|
||||
// 如果不是叶子节点,则表格数据不可修改
|
||||
const isCurrentLeafNode = ref(false)
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getAllNodeTree().then((resp) => {
|
||||
if (resp.nodeId) {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
nodeChange(resp.nodeId)
|
||||
currentNode.value = (resp.tree || []).find((item) => item.nodeId === resp.nodeId)
|
||||
} else {
|
||||
message.warning('请先创建节点数据')
|
||||
}
|
||||
})
|
||||
}
|
||||
const showCountPop = ref(false)
|
||||
function nodeChange(nodeId) {
|
||||
if (nodeId) {
|
||||
showTableSearch.value = false
|
||||
tableKeywords.value = ''
|
||||
searchForm.value.nodeId = nodeId
|
||||
getOkrList()
|
||||
getCountInfo()
|
||||
currentNode.value = findNode(peroidList.value, (node) => {
|
||||
return node.nodeId == nodeId
|
||||
})
|
||||
searchForm.value.creatorId = currentNode.value.creatorId
|
||||
if (!currentNode.value.children || currentNode.value.children.length == 0) {
|
||||
isCurrentLeafNode.value = true
|
||||
} else {
|
||||
isCurrentLeafNode.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const originList = ref([])
|
||||
const defaultTableList = ref([])
|
||||
const spanObj = ref([])
|
||||
function getOkrList() {
|
||||
getAllOkrPage(searchForm.value).then((resp) => {
|
||||
originList.value = []
|
||||
spanObj.value = []
|
||||
if (resp && resp.length) {
|
||||
resp.map((o) => {
|
||||
if (o.keyResults && o.keyResults.length) {
|
||||
const arr = o.keyResults.map((k, index) => {
|
||||
spanObj.value.push(index == 0 ? o.keyResults.length : 0)
|
||||
const obj = cloneDeep(o)
|
||||
delete obj.keyResults
|
||||
return {
|
||||
...k,
|
||||
objectInfo: obj
|
||||
}
|
||||
})
|
||||
originList.value = [...originList.value, ...arr]
|
||||
}
|
||||
})
|
||||
defaultTableList.value = [...originList.value]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const countInfo = ref([])
|
||||
function getCountInfo() {
|
||||
getOkrStatisticsTotal({ nodeId: searchForm.value.nodeId }).then(async (resp) => {
|
||||
countInfo.value = resp || []
|
||||
// await nextTick(() =)
|
||||
showCountPop.value = true
|
||||
})
|
||||
}
|
||||
|
||||
function objectSpanMethod({ column, rowIndex }) {
|
||||
if (['目标', '目标完成度'].includes(column.label)) {
|
||||
let _row = spanObj.value[rowIndex]
|
||||
let _col = _row > 0 ? 1 : 0
|
||||
return {
|
||||
rowspan: _row,
|
||||
colspan: _col
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleClickCell(row, column) {
|
||||
if (column.property === 'keyResultShowName') {
|
||||
openDrawer(2, row.keyResultId, `${row.sourceName} ${row.keyResultShowName}`)
|
||||
} else if (column.property === 'objectInfo.objectiveName') {
|
||||
openDrawer(3, row.objectInfo.objectiveId, row.objectInfo.objectiveName)
|
||||
}
|
||||
}
|
||||
|
||||
const commentTypeOptions = ref([])
|
||||
const currentType = ref(1) // 默认评论类型为1
|
||||
function getOptions() {
|
||||
getCommentTypeOptions().then((resp) => {
|
||||
commentTypeOptions.value = (resp || []).sort((pre, cur) => pre.sort - cur.sort)
|
||||
currentType.value = resp[0].id
|
||||
})
|
||||
getEmployeeSimpleList({ status: 0 }).then((resp) => {
|
||||
employeeOptions.value = resp.map((item) => ({
|
||||
...item,
|
||||
label: item.name,
|
||||
value: item.name
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
const commentList = ref([])
|
||||
const commentInfo = ref({
|
||||
businessType: undefined,
|
||||
businessId: undefined,
|
||||
commentType: undefined,
|
||||
pageSize: -1
|
||||
})
|
||||
function openDrawer(type, id, name) {
|
||||
showDrawer.value = true
|
||||
drawerTitle.value = `【${name}】笔谈`
|
||||
commentInfo.value = {
|
||||
businessType: type,
|
||||
businessId: id,
|
||||
commentType: currentType.value,
|
||||
pageSize: -1
|
||||
}
|
||||
searchCommentList()
|
||||
}
|
||||
|
||||
function searchCommentList() {
|
||||
commentInfo.value.commentType = currentType.value
|
||||
getCommentPage(commentInfo.value).then((resp) => {
|
||||
// commentList.value = resp.list
|
||||
commentList.value = listToTree(resp.list, {
|
||||
id: 'commentId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const showCommentIndex = ref(-1)
|
||||
function showChildComment(index) {
|
||||
showCommentIndex.value = showCommentIndex.value == index ? -1 : index
|
||||
}
|
||||
|
||||
function good(item) {
|
||||
likeComment(item.commentId).then(() => {
|
||||
message.success('点赞成功')
|
||||
searchCommentList()
|
||||
})
|
||||
}
|
||||
|
||||
const form = ref({
|
||||
commentValue: '',
|
||||
mentionedUserIdList: []
|
||||
})
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function handleMention(item) {
|
||||
form.value.mentionedUserIdList.push(item.id)
|
||||
}
|
||||
|
||||
function handleSendCommnet(idx) {
|
||||
try {
|
||||
// 过滤掉删除的用户,方式为遍历mentionedUserIdList,查找评论中是否有对应的用户名
|
||||
const userList = [...form.value.mentionedUserIdList]
|
||||
const arr = []
|
||||
userList.map((item) => {
|
||||
if (form.value.commentValue.indexOf(`@${item.name}`) != -1) {
|
||||
arr.push(item.id)
|
||||
// 然后移除对应的用户名,防止有多个
|
||||
form.value.commentValue = form.value.commentValue.replace(`@${item.name}`, '')
|
||||
}
|
||||
})
|
||||
const data = {
|
||||
businessType: commentInfo.value.businessType,
|
||||
businessId: commentInfo.value.businessId,
|
||||
commentType: currentType.value,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: arr,
|
||||
parentId: commentList.value[idx].commentId
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
|
||||
const addNewComment = ref(false)
|
||||
function handleInsertComment() {
|
||||
addNewComment.value = true
|
||||
form.value.commentValue = commentTypeOptions.value.find(
|
||||
(item) => item.id == currentType.value
|
||||
).remark
|
||||
}
|
||||
|
||||
const toolbarConfig = {
|
||||
toolbarKeys: [
|
||||
'bold', // 加粗
|
||||
'underline', // 下划线
|
||||
'italic', // 斜体
|
||||
'color', // 文字颜色
|
||||
'bgColor', // 背景色
|
||||
'fontSize', // 字号
|
||||
'bulletedList', // 无序列表
|
||||
'numberedList', // 有序列表
|
||||
'insertTable', // 插入表格
|
||||
'insertLink', // 插入链接
|
||||
'undo' // 撤销
|
||||
]
|
||||
}
|
||||
|
||||
function handleSaveComment() {
|
||||
addNewComment.value = false
|
||||
try {
|
||||
const data = {
|
||||
businessType: commentInfo.value.businessType,
|
||||
businessId: commentInfo.value.businessId,
|
||||
commentType: currentType.value,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: form.value.mentionedUserIdList
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
exportTableWithVue('#okrAnalysisTable', `OKR分析报表-${currentNode.value.nodeName}`)
|
||||
}
|
||||
|
||||
function handleTableFilter() {
|
||||
console.log('tableKeywords', tableKeywords.value)
|
||||
|
||||
if (tableKeywords.value) {
|
||||
originList.value = defaultTableList.value.filter(
|
||||
(item) =>
|
||||
item.keyResultShowName.includes(tableKeywords.value) ||
|
||||
item.sourceName.includes(tableKeywords.value)
|
||||
)
|
||||
} else {
|
||||
originList.value = [...defaultTableList.value]
|
||||
}
|
||||
}
|
||||
|
||||
function handleFilterTableClick() {
|
||||
showTableSearch.value = !showTableSearch.value
|
||||
if (!showTableSearch.value) {
|
||||
tableKeywords.value = ''
|
||||
originList.value = [...defaultTableList.value]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
150
src/views/OKR/Management/Components/AllTarget.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div class="flex flex-col w-full h-full p-4 bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="flex items-center justify-between">
|
||||
<el-row>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
check-strictly
|
||||
style="width: 400px"
|
||||
@change="nodeChange"
|
||||
/>
|
||||
<el-button class="ml-10px" type="primary" @click="handleAddNode">新建节点</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
v-if="currentUserId == searchForm.creatorId"
|
||||
@click="handleEditOkr(searchForm.nodeId)"
|
||||
>
|
||||
修改当前节点
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
v-if="searchForm.executor?.includes(currentUserId)"
|
||||
@click="handleUpdateProcess"
|
||||
>更新进度</el-button
|
||||
>
|
||||
</el-row>
|
||||
</div>
|
||||
<OkrTable ref="okrTableRef" :canEdit="isCurrentLeafNode" />
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" @success="handleSearchPeroid" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="AllTarget">
|
||||
import OkrTable from './OkrTable.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
|
||||
import { getAllNodeTree, getAllOkrPage } from '@/api/okr/okr'
|
||||
import { listToTree, findNode } from '@/utils/tree'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const message = useMessage()
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
handleSearchPeroid()
|
||||
|
||||
// 当前是否是叶子节点
|
||||
// 如果不是叶子节点,则表格数据不可修改
|
||||
const isCurrentLeafNode = ref(false)
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getAllNodeTree().then((resp) => {
|
||||
if (resp.nodeId) {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
nodeChange(resp.nodeId)
|
||||
} else {
|
||||
message.warning('请先创建节点数据')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function nodeChange(nodeId) {
|
||||
if (nodeId) {
|
||||
searchForm.value.nodeId = nodeId
|
||||
getOkrList()
|
||||
const currentNode = findNode(peroidList.value, (node) => {
|
||||
return node.nodeId == nodeId
|
||||
})
|
||||
searchForm.value.creatorId = currentNode.creatorId
|
||||
if (!currentNode.children || currentNode.children.length == 0) {
|
||||
isCurrentLeafNode.value = true
|
||||
} else {
|
||||
isCurrentLeafNode.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getAllOkrPage(searchForm.value).then((resp) => {
|
||||
const list = resp
|
||||
if (list && list.length > 0) {
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(list)
|
||||
})
|
||||
} else {
|
||||
// 如果没有数据,清空表格
|
||||
okrTableRef.value.prepareData([])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
function handleAddNode() {
|
||||
dialogOkrInfo.value.open('create', null)
|
||||
}
|
||||
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 2)
|
||||
}
|
||||
|
||||
function handleUpdateProcess() {
|
||||
okrTableRef.value.updateProcess(searchForm.value.nodeId).then(() => {
|
||||
message.success('更新成功')
|
||||
getOkrList()
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
function handleShowOkr(id) {
|
||||
dialogOkr.value.open({
|
||||
nodeId: id,
|
||||
canEdit: isCurrentLeafNode.value,
|
||||
queryType: 2
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
684
src/views/OKR/Management/Components/DialogOkr.vue
Normal file
@@ -0,0 +1,684 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-if="show"
|
||||
v-model="show"
|
||||
width="94vw"
|
||||
class="dialog-okr"
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<template #header>
|
||||
<div class="dialog-okr-header">
|
||||
<div class="flex-1 flex items-center" style="line-height: 50px">
|
||||
<div class="dialog-okr-title">
|
||||
<Icon icon="ep:circle-check-filled" color="#30d1fc" :size="14" />
|
||||
<span>目标</span>
|
||||
</div>
|
||||
<el-divider direction="vertical" />
|
||||
<span class="text-14px ml-0.25">ork落地</span>
|
||||
<div class="ml-20px text-14px">
|
||||
<span>【节点】</span>
|
||||
<span
|
||||
v-for="(item, index) in nodeInfo.parentNodes"
|
||||
:key="item.nodeId"
|
||||
@click="handleChildItem(item)"
|
||||
>
|
||||
<span
|
||||
class="cursor-pointer"
|
||||
:style="{
|
||||
color: index < nodeInfo.parentNodes.length - 1 ? '#409eff' : '#333',
|
||||
borderBottom:
|
||||
index < nodeInfo.parentNodes.length - 1 ? '1px solid #409eff' : 'none'
|
||||
}"
|
||||
>
|
||||
{{ item.nodeName }}
|
||||
</span>
|
||||
<span v-if="index != nodeInfo.parentNodes.length - 1"> -> </span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<el-button
|
||||
v-if="nodeInfo.creatorId == currentUserId"
|
||||
link
|
||||
@click="emit('edit', nodeInfo.nodeId)"
|
||||
>
|
||||
<el-tooltip content="编辑" placement="top" effect="dark">
|
||||
<Icon icon="ep:edit" :size="16" />
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
|
||||
<el-button link @click="show = false">
|
||||
<el-tooltip content="关闭" placement="top" effect="dark">
|
||||
<Icon icon="ep:close" :size="16" />
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="dialog-okr-body">
|
||||
<div class="dialog-okr-content pr-10px">
|
||||
<div class="dialog-okr-content-detail">
|
||||
<div class="detail-basic-title">
|
||||
<div class="basic-title-item">
|
||||
<div class="basic-title-label">创建人</div>
|
||||
<div class="basic-title-value">{{ nodeInfo.creator }}</div>
|
||||
</div>
|
||||
<div class="basic-title-item">
|
||||
<div class="basic-title-label">执行人</div>
|
||||
<div class="basic-title-value">{{ nodeInfo.executorName || '无' }}</div>
|
||||
</div>
|
||||
<div class="basic-title-item">
|
||||
<div class="basic-title-label">目标数</div>
|
||||
<div class="basic-title-value">{{ okrList.length }}</div>
|
||||
</div>
|
||||
<div class="basic-title-item" style="min-width: 200px">
|
||||
<div class="basic-title-label">总体进度</div>
|
||||
<el-progress :percentage="parseInt(nodeInfo.progress) || 0" :stroke-width="8" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex detail-basic-info">
|
||||
<span>开始日期:{{ nodeInfo.startTime }}</span>
|
||||
<span>截止日期:{{ nodeInfo.endTime }}</span>
|
||||
<span>最新更新时间:{{ nodeInfo.updateTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex" style="position: relative; flex: 1; height: 100px">
|
||||
<el-tabs v-model="workIndex" style="flex: 1">
|
||||
<el-tab-pane label="目标/关键成果" name="okr">
|
||||
<div class="content-wrap">
|
||||
<OkrTable ref="okrTableRef" :canEdit="canEdit" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-button v-if="canEdit" class="sav-btn" type="primary" @click="handleSaveProcess">
|
||||
保存并更新
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog-okr-side pl-10px">
|
||||
<el-tabs v-model="sideIndex" style="flex: 1; height: 100%">
|
||||
<el-tab-pane label="子节点" name="subNode" key=" ">
|
||||
<div class="overflow-y-auto" style="height: calc(100% - 50px)">
|
||||
<div
|
||||
v-for="item in childNodeList"
|
||||
:key="item.nodeId"
|
||||
class="border-b-1 child-item"
|
||||
style="padding: 10px 5px; cursor: pointer"
|
||||
@click="handleChildItem(item)"
|
||||
>
|
||||
<div
|
||||
class="flex justify-between items-center overflow-hidden text-16px"
|
||||
style="line-height: 30px"
|
||||
>
|
||||
<div class="child-label">【节点】{{ item.nodeName }}</div>
|
||||
<el-progress
|
||||
type="line"
|
||||
:percentage="parseInt(item.progress) || 0"
|
||||
:stroke-width="6"
|
||||
style="width: 120px"
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-10px flex items-center text-13px" style="line-height: 30px">
|
||||
<span>目标数:</span>
|
||||
<span style="color: #aaa">{{ item.objectiveNum }}</span>
|
||||
<el-divider direction="vertical" style="margin: 0 20px" />
|
||||
<div
|
||||
class="flex-1 overflow-hidden h-30px"
|
||||
style="text-overflow: ellipsis; white-space: nowrap"
|
||||
>
|
||||
<span>执行人:</span>
|
||||
<span style="color: #aaa">{{ item.executorName || '无' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ml-10px flex items-center text-12px"
|
||||
style="line-height: 20px; color: #aaa"
|
||||
>
|
||||
<span>开始日期:{{ item.startTime }}</span>
|
||||
<el-divider direction="vertical" style="margin: 0 20px" />
|
||||
<span>截止日期:{{ item.endTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="笔谈" name="conclusion" key="conclusion">
|
||||
<div class="relative overflow-y-auto" style="height: calc(100% - 50px)">
|
||||
<div v-if="addNewComment">
|
||||
<div class="flex justify-between items-center">
|
||||
<el-select
|
||||
v-model="form.commentType"
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
@change="getCommentTemplate"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in commentTypeOptions"
|
||||
:label="it.label"
|
||||
:value="it.id"
|
||||
:key="it.id"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<div>
|
||||
<el-button size="small" @click="addNewComment = false"> 取消 </el-button>
|
||||
<el-button type="primary" size="small" @click="handleSaveComment">
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-10px" v-if="addNewComment">
|
||||
<Editor
|
||||
v-model:modelValue="form.commentValue"
|
||||
height="300px"
|
||||
:toolbarConfig="toolbarConfig"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<el-button v-else type="primary" size="small" @click="handleInsertComment">
|
||||
新增笔谈
|
||||
</el-button>
|
||||
<div
|
||||
v-for="(it, index) in commentList"
|
||||
:key="it.commentId"
|
||||
class="border-b-1"
|
||||
style="padding: 10px 5px"
|
||||
>
|
||||
<div
|
||||
class="flex items-center justify-between overflow-hidden text-16px"
|
||||
style="line-height: 30px"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<el-avatar
|
||||
shape="circle"
|
||||
style="
|
||||
background-color: var(--el-color-primary-light-3);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
"
|
||||
fit="fill"
|
||||
>
|
||||
<span class="text-12px">{{ it.creatorName.slice(-2) }}</span>
|
||||
</el-avatar>
|
||||
<div class="ml-10px text-16px">{{ it.creatorName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px" v-dompurify-html="it.content"></div>
|
||||
<div
|
||||
class="ml-10px mt-10px flex items-center justify-between text-12px"
|
||||
style="line-height: 20px; color: #aaa"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="good(it)">
|
||||
<Icon
|
||||
icon="fa:thumbs-o-up"
|
||||
:size="16"
|
||||
:color="it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'"
|
||||
/>
|
||||
</el-button>
|
||||
<span
|
||||
class="ml-5px"
|
||||
:style="{
|
||||
color: it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'
|
||||
}"
|
||||
>{{ it.likeCount }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="showComment(index)">
|
||||
<Icon icon="ep:chat-dot-square" :size="16" color="#333" />
|
||||
</el-button>
|
||||
<span class="ml-5px" style="color: #333">{{ it.commentCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px text-13px text-gray-400">
|
||||
{{ formatDate(it.createTime, 'YYYY-MM-DD HH:mm') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 评论 -->
|
||||
<div
|
||||
v-if="showCommentIndex == index"
|
||||
class="bg-gray-100 pl-10px pr-10px pt-5px pb-5px"
|
||||
style="margin: 10px 10px 0 10px; border-radius: 4px"
|
||||
label="笔谈"
|
||||
>
|
||||
<div
|
||||
v-for="subComment in it.children.sort((a, b) => a.createTime - b.createTime)"
|
||||
:key="subComment.commentId"
|
||||
class="text-14px"
|
||||
style="line-height: 24px"
|
||||
>
|
||||
<span class="font-bold">{{ subComment.creatorName }}:</span>
|
||||
<span>
|
||||
{{ subComment.content }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10px relative">
|
||||
<!-- <el-input
|
||||
v-model="form.commentValue"
|
||||
placeholder="请输入评论"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
/> -->
|
||||
<el-mention
|
||||
v-model="form.commentValue"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
:options="employeeOptions"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
whole
|
||||
placeholder="请输入笔谈"
|
||||
@select="handleMention"
|
||||
>
|
||||
<template #label="{ item }">
|
||||
<div class="flex items-center justify-between h-full">
|
||||
<span class="text-14px text-dark-700">{{ item.name }}</span>
|
||||
<span class="text-12px text-gray-400">{{ item.dept }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-mention>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="position: absolute; right: 2px; bottom: 2px"
|
||||
@click="handleSendCommnet(index)"
|
||||
>
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="进度历史" name="history" key="history">
|
||||
<div class="overflow-y-auto pl-15px" style="height: calc(100% - 50px)">
|
||||
<el-timeline class="ml-10px">
|
||||
<el-timeline-item
|
||||
v-for="item in nodeRecords"
|
||||
:key="item.recordId"
|
||||
placement="bottom"
|
||||
:timestamp="formatDate(item.createTime, 'YYYY-MM-DD HH:mm:ss')"
|
||||
color="#30d1fc"
|
||||
>
|
||||
<div>{{ item.creator }}</div>
|
||||
<div class="mt-10px text-14px" style="line-height: 24px; color: #666">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogOkr">
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import OkrTable from './OkrTable.vue'
|
||||
|
||||
import { getOkrNodeDetail, getOkrNodeHistory } from '@/api/okr/okr'
|
||||
import {
|
||||
getCommentTypeOptions,
|
||||
createComment,
|
||||
getCommentPage,
|
||||
likeComment
|
||||
} from '@/api/okr/comment'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const message = useMessage()
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
const emit = defineEmits(['edit', 'close'])
|
||||
|
||||
const show = ref(false)
|
||||
|
||||
watch(
|
||||
() => show.value,
|
||||
(newValue, oldValue) => {
|
||||
if (oldValue && !newValue) {
|
||||
emit('close', nodeInfo.value)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const canEdit = ref(false)
|
||||
|
||||
const toolbarConfig = {
|
||||
toolbarKeys: [
|
||||
'bold', // 加粗
|
||||
'underline', // 下划线
|
||||
'italic', // 斜体
|
||||
'color', // 文字颜色
|
||||
'bgColor', // 背景色
|
||||
'fontSize', // 字号
|
||||
'bulletedList', // 无序列表
|
||||
'numberedList', // 有序列表
|
||||
'insertTable', // 插入表格
|
||||
'insertLink', // 插入链接
|
||||
'undo' // 撤销
|
||||
]
|
||||
}
|
||||
|
||||
const workIndex = ref('okr')
|
||||
const okrList = ref([])
|
||||
const childNodeList = ref([])
|
||||
const sideIndex = ref('subNode')
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const nodeInfo = ref({})
|
||||
|
||||
const nodeRecords = ref([])
|
||||
const commentTypeOptions = ref([])
|
||||
|
||||
const queryType = ref(1)
|
||||
function open(curNode) {
|
||||
canEdit.value = curNode.canEdit
|
||||
nodeInfo.value.nodeId = curNode.nodeId
|
||||
queryType.value = curNode.queryType
|
||||
// 获取数据详情
|
||||
searchInfo(curNode)
|
||||
show.value = true
|
||||
}
|
||||
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function searchInfo(curNode) {
|
||||
try {
|
||||
getOkrNodeDetail({ nodeId: curNode.nodeId, queryType: queryType.value }).then((resp) => {
|
||||
nodeInfo.value = {
|
||||
...resp,
|
||||
executor: resp.executor || []
|
||||
}
|
||||
canEdit.value = canEdit.value && nodeInfo.value.executor.includes(currentUserId + '')
|
||||
if (resp.objectives) {
|
||||
okrList.value = resp.objectives.map((item) => ({
|
||||
...item,
|
||||
keyResults: item.keyResults || []
|
||||
}))
|
||||
} else {
|
||||
okrList.value = []
|
||||
}
|
||||
childNodeList.value = [...resp.children]
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(okrList.value)
|
||||
})
|
||||
})
|
||||
getOkrNodeHistory(curNode.nodeId).then((resp) => {
|
||||
nodeRecords.value = resp
|
||||
})
|
||||
getEmployeeSimpleList({ status: 0 }).then((resp) => {
|
||||
employeeOptions.value = resp.map((item) => ({
|
||||
...item,
|
||||
label: item.name,
|
||||
value: item.name
|
||||
}))
|
||||
})
|
||||
getCommentTypeOptions().then((resp) => {
|
||||
commentTypeOptions.value = resp
|
||||
})
|
||||
searchCommentList()
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
}
|
||||
|
||||
defineExpose({ open, close })
|
||||
|
||||
function handleMention(item) {
|
||||
form.value.mentionedUserIdList.push(item.id)
|
||||
}
|
||||
|
||||
function handleSaveProcess() {
|
||||
okrTableRef.value.updateProcess(nodeInfo.value.nodeId).then(() => {
|
||||
message.success('更新成功')
|
||||
searchInfo({ nodeId: nodeInfo.value.nodeId })
|
||||
})
|
||||
}
|
||||
|
||||
function handleChildItem(item) {
|
||||
const arr = item.executor || []
|
||||
const isExecutor = arr.includes(currentUserId)
|
||||
canEdit.value = isExecutor && (!item.children || item.children.length == 0)
|
||||
searchInfo(item)
|
||||
}
|
||||
|
||||
const addNewComment = ref(false)
|
||||
const form = ref({
|
||||
commentValue: '',
|
||||
commentType: undefined,
|
||||
mentionedUserIdList: []
|
||||
})
|
||||
function handleInsertComment() {
|
||||
addNewComment.value = true
|
||||
const defaultComment = commentTypeOptions.value[0]
|
||||
if (defaultComment) {
|
||||
form.value = {
|
||||
commentType: defaultComment.id,
|
||||
mentionedUserIdList: []
|
||||
}
|
||||
}
|
||||
getCommentTemplate()
|
||||
}
|
||||
|
||||
function getCommentTemplate() {
|
||||
if (form.value.commentType) {
|
||||
form.value.commentValue = commentTypeOptions.value.find(
|
||||
(item) => item.id == form.value.commentType
|
||||
).remark
|
||||
} else {
|
||||
form.value.commentValue = `<h2 style=\"text-align: start;\">一、工作概况</h2><p> </p><h2 style=\"text-align: start;\">二、数据统计</h2><ol><li>呼出电话数:</li><li>有效沟通数:</li><li>销售成果</li></ol><h2 style=\"text-align: start;\">三、问题与改进方案</h2><p><br></p>`
|
||||
}
|
||||
}
|
||||
|
||||
function handleSaveComment() {
|
||||
addNewComment.value = false
|
||||
try {
|
||||
const data = {
|
||||
businessType: 1,
|
||||
businessId: nodeInfo.value.nodeId,
|
||||
contentType: 1,
|
||||
commentType: form.value.commentType,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: form.value.mentionedUserIdList
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('笔谈成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
message.error('笔谈失败')
|
||||
}
|
||||
}
|
||||
const commentList = ref([])
|
||||
|
||||
function searchCommentList() {
|
||||
getCommentPage({
|
||||
businessType: 1,
|
||||
businessId: nodeInfo.value.nodeId,
|
||||
pageNum: 1,
|
||||
pageSize: -1
|
||||
}).then((resp) => {
|
||||
commentList.value = listToTree(resp.list, {
|
||||
id: 'commentId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function good(item) {
|
||||
likeComment(item.commentId).then(() => {
|
||||
message.success('点赞成功')
|
||||
searchCommentList()
|
||||
})
|
||||
}
|
||||
|
||||
const showCommentIndex = ref(-1)
|
||||
function showComment(index) {
|
||||
showCommentIndex.value = showCommentIndex.value == index ? -1 : index
|
||||
}
|
||||
|
||||
function handleSendCommnet(idx) {
|
||||
try {
|
||||
// 过滤掉删除的用户,方式为遍历mentionedUserIdList,查找评论中是否有对应的用户名
|
||||
const userList = [...form.value.mentionedUserIdList]
|
||||
const arr = []
|
||||
userList.map((item) => {
|
||||
if (form.value.commentValue.indexOf(`@${item.name}`) != -1) {
|
||||
arr.push(item.id)
|
||||
// 然后移除对应的用户名,防止有多个
|
||||
form.value.commentValue = form.value.commentValue.replace(`@${item.name}`, '')
|
||||
}
|
||||
})
|
||||
const data = {
|
||||
businessType: 1,
|
||||
businessId: nodeInfo.value.nodeId,
|
||||
contentType: 1,
|
||||
commentType: form.value.commentType,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: arr,
|
||||
parentId: commentList.value[idx].commentId
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-okr {
|
||||
.dialog-okr-header {
|
||||
display: flex;
|
||||
height: 51px;
|
||||
min-height: 51px;
|
||||
vertical-align: middle;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
padding: 0 1.25rem;
|
||||
.dialog-okr-title {
|
||||
display: flex;
|
||||
margin-right: 5px;
|
||||
align-items: center;
|
||||
background: rgba(48, 209, 252, 0.1);
|
||||
border-radius: 3px;
|
||||
padding: 0 10px;
|
||||
line-height: 24px;
|
||||
span {
|
||||
color: #2a344b;
|
||||
font-size: 12px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.dialog-okr-body {
|
||||
display: flex;
|
||||
background: #f0f3fa;
|
||||
overflow: hidden;
|
||||
min-width: 1064px;
|
||||
height: calc(94vh - 85px);
|
||||
.dialog-okr-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 70%;
|
||||
flex: auto;
|
||||
min-width: 700px;
|
||||
background: #fff;
|
||||
margin: 0 1px 0 0;
|
||||
justify-content: space-between;
|
||||
overflow-y: hidden !important;
|
||||
.dialog-okr-content-detail {
|
||||
position: relative;
|
||||
margin-bottom: 30px;
|
||||
overflow-y: auto;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
.detail-basic-title {
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
margin-bottom: 16px;
|
||||
.basic-title-item {
|
||||
margin-right: 50px;
|
||||
.basic-title-label {
|
||||
color: #aaa;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.basic-title-value {
|
||||
color: #2a344b;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.detail-basic-info {
|
||||
font-size: 14px;
|
||||
color: #aaa;
|
||||
span {
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 15px);
|
||||
}
|
||||
}
|
||||
.dialog-okr-side {
|
||||
padding-left: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 30%;
|
||||
overflow: hidden;
|
||||
min-width: 364px;
|
||||
max-width: 500px;
|
||||
background: #fff;
|
||||
margin: 0;
|
||||
.child-item:hover {
|
||||
background: #f0f3fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sav-btn {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 0;
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
647
src/views/OKR/Management/Components/DialogOkrInfo.vue
Normal file
@@ -0,0 +1,647 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="show"
|
||||
width="88vw"
|
||||
class="dialog-okr"
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<template #header>
|
||||
<div class="dialog-okr-header">
|
||||
<div class="flex-1 flex items-center" style="line-height: 50px"> {{ title }} </div>
|
||||
<div class="flex items-center">
|
||||
<el-button type="primary" link :disabled="formLoading" @click="handleSave">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button link @click="show = false"> 关闭 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="dialog-okr-body" v-loading="formLoading">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="0">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="parentId">
|
||||
<el-tree-select
|
||||
v-model="form.parentId"
|
||||
:data="parentNodeList"
|
||||
check-strictly
|
||||
:props="{ value: 'nodeId', label: 'nodeName', children: 'children' }"
|
||||
:render-after-expand="false"
|
||||
placeholder="父节点"
|
||||
clearable
|
||||
:disabled="!!form.nodeId"
|
||||
@change="handleChangeParent"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="nodeName">
|
||||
<el-input v-model="form.nodeName" placeholder="请输入节点名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="开始日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="截止日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="executor">
|
||||
<el-select
|
||||
v-model="form.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id + ''"
|
||||
:disabled="item.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="dataScope">
|
||||
<el-select v-model="form.dataScope" placeholder="选择权限" clearable filterable>
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="relative">
|
||||
<el-button
|
||||
v-if="okrKey == 'okr'"
|
||||
style="position: absolute; right: 10px; top: 10px; z-index: 9"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="addObjective"
|
||||
>
|
||||
添加目标
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="okrKey == 'childNode'"
|
||||
style="position: absolute; right: 10px; top: 10px; z-index: 9"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="addChildNode"
|
||||
>
|
||||
添加子节点
|
||||
</el-button>
|
||||
<el-tabs v-model="okrKey">
|
||||
<el-tab-pane label="目标/关键成果" name="okr">
|
||||
<div>
|
||||
<div
|
||||
class="flex items-center w-full"
|
||||
v-for="(item, i) in objectList"
|
||||
:key="item.objectiveId"
|
||||
style="padding-bottom: 5px"
|
||||
>
|
||||
<div class="flex-1 w-100px">
|
||||
<div class="flex items-center">
|
||||
<el-tooltip content="点击可折叠/展开目标" placement="top" effect="dark">
|
||||
<el-tag
|
||||
type="success"
|
||||
class="mr-10px"
|
||||
@click="item.hideChild = !item.hideChild"
|
||||
>
|
||||
O{{ i + 1 }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
|
||||
<el-input
|
||||
v-model="item.objectiveName"
|
||||
placeholder="目标名称"
|
||||
class="flex-1 w-150px"
|
||||
:disabled="!!item.objectiveId"
|
||||
/>
|
||||
<el-select
|
||||
v-model="item.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
collapse-tags
|
||||
filterable
|
||||
style="width: 240px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in userOptions"
|
||||
:key="it.id"
|
||||
:label="it.name"
|
||||
:value="it.id + ''"
|
||||
:disabled="it.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="item.dataScope"
|
||||
placeholder="选择权限"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px; margin-left: 10px"
|
||||
>
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
<div class="ml-10px">
|
||||
<el-button type="primary" text @click="AddKR(i)">新增关键成果</el-button>
|
||||
<el-button type="danger" text @click="removeObj(i)">删除目标</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!item.hideChild" style="background: #f0f3fa; padding-bottom: 10px">
|
||||
<div
|
||||
class="ml-50px"
|
||||
v-for="(kr, index) in item.keyResults"
|
||||
:key="kr.keyResultId"
|
||||
>
|
||||
<div class="flex flex-1 items-center pb-5px pt-5px">
|
||||
<el-tag class="mr-10px">KR{{ index + 1 }}</el-tag>
|
||||
<el-select
|
||||
v-model="kr.keyResultName"
|
||||
placeholder="选择或输入关键成果"
|
||||
filterable
|
||||
:props="{ value: 'keyResultId', label: 'keyResultName' }"
|
||||
allow-create
|
||||
:reserve-keyword="false"
|
||||
class="flex-1 w-150px"
|
||||
@change="krChange(i, index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in krOptions"
|
||||
:key="it.value"
|
||||
:label="it.label"
|
||||
:value="it.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="danger" text @click="removeKR(i, index)">
|
||||
删除关键成果
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="mt-5px flex items-center">
|
||||
<el-tree-select
|
||||
v-model="kr.source"
|
||||
:data="sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
<!-- <el-radio-group v-model="kr.resultType" class="ml-10px">
|
||||
<el-radio-button :value="1">目标值</el-radio-button>
|
||||
<el-radio-button :value="2">是/否</el-radio-button>
|
||||
</el-radio-group> -->
|
||||
|
||||
<el-input
|
||||
v-if="kr.resultType == 1"
|
||||
v-model="kr.targetValue"
|
||||
type="number"
|
||||
placeholder="目标值"
|
||||
class="ml-10px"
|
||||
style="width: 120px"
|
||||
/>
|
||||
|
||||
<el-select
|
||||
v-model="kr.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
filterable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
style="width: 240px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in userOptions"
|
||||
:key="it.id"
|
||||
:label="it.name"
|
||||
:value="it.id + ''"
|
||||
:disabled="it.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="kr.dataScope"
|
||||
placeholder="选择权限"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px; margin-left: 10px"
|
||||
>
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
<el-radio-group v-model="kr.isCount" class="ml-10px">
|
||||
<el-radio :label="true" :value="true">参与统计</el-radio>
|
||||
<el-radio :label="false" :value="false">不参与统计</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="w-100px"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="子节点" name="childNode">
|
||||
<el-table :data="childNodeList">
|
||||
<el-table-column label="名称">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.nodeName" placeholder="子节点名称" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始日期" width="160px">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.startTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 130px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="截止日期" width="160px">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.endTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 130px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="权限" width="160px">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.dataScope" placeholder="请选择" style="width: 130px">
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="执行人" width="300px">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id + ''"
|
||||
:disabled="item.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="删除" :width="100">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="danger" text @click="removeChildNode($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogOkrInfo">
|
||||
import {
|
||||
getAllNodeTree,
|
||||
getOkrNodeDetail,
|
||||
createOkrNode,
|
||||
updateOkrNode,
|
||||
getAllOkrPage,
|
||||
getDefaultOkrOptions,
|
||||
getChannelOptions
|
||||
} from '@/api/okr/okr'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
|
||||
watch(
|
||||
() => show.value,
|
||||
(newValue, oldValue) => {
|
||||
if (oldValue && !newValue) {
|
||||
emit('close')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const title = ref('')
|
||||
const formType = ref('create')
|
||||
|
||||
const form = ref({})
|
||||
const formLoading = ref(false)
|
||||
const rules = ref({
|
||||
nodeName: { required: true, message: '节点名称不可为空', trigger: 'blur' },
|
||||
startTime: { required: true, message: '开始日期不可为空', trigger: 'change' },
|
||||
endTime: { required: true, message: '截止日期不可为空', trigger: 'change' }
|
||||
})
|
||||
|
||||
const okrKey = ref('okr')
|
||||
|
||||
const parentNodeList = ref([])
|
||||
|
||||
const childNodeList = ref([])
|
||||
|
||||
const userOptions = ref([])
|
||||
const krOptions = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'sourceName',
|
||||
value: 'sourceId',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
const sourceOptions = ref([])
|
||||
const objectList = ref([])
|
||||
function open(type, val, queryType) {
|
||||
show.value = true
|
||||
title.value = type == 'update' ? '修改Okr' : '新增Okr'
|
||||
formType.value = type
|
||||
resetForm()
|
||||
getEmployeeSimpleList().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
getAllNodeTree().then((resp) => {
|
||||
parentNodeList.value = listToTree(resp.tree, {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
getDefaultOkrOptions().then((resp) => {
|
||||
krOptions.value = resp
|
||||
})
|
||||
getChannelOptions().then((resp) => {
|
||||
sourceOptions.value = listToTree(resp, {
|
||||
id: 'sourceId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
if (val) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
getOkrNodeDetail({
|
||||
nodeId: val,
|
||||
queryType
|
||||
}).then((resp) => {
|
||||
form.value = resp
|
||||
if (resp.objectives) {
|
||||
objectList.value = resp.objectives.map((item) => ({
|
||||
...item,
|
||||
keyResults: item.keyResults || []
|
||||
}))
|
||||
} else {
|
||||
objectList.value = []
|
||||
}
|
||||
childNodeList.value = [...resp.children]
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
function resetForm() {
|
||||
form.value = {
|
||||
parentId: undefined,
|
||||
nodeName: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
executor: [],
|
||||
dataScope: 2
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const formRef = ref()
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success', 'close']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
function addObjective() {
|
||||
objectList.value.push({
|
||||
objectiveName: '',
|
||||
executor: form.value.executor || [],
|
||||
keyResults: [],
|
||||
dataScope: form.value.dataScope || 2
|
||||
})
|
||||
}
|
||||
|
||||
function AddKR(idx) {
|
||||
if (!objectList.value[idx].keyResults) {
|
||||
objectList.value[idx].keyResults = []
|
||||
}
|
||||
const obj = objectList.value[idx]
|
||||
objectList.value[idx].keyResults.push({
|
||||
keyResultName: undefined,
|
||||
resultType: 1,
|
||||
source: undefined,
|
||||
targetValue: undefined,
|
||||
process: undefined,
|
||||
currentValue: undefined,
|
||||
executor: obj.executor,
|
||||
dataScope: obj.dataScope,
|
||||
isCount: false
|
||||
})
|
||||
}
|
||||
|
||||
function removeObj(idx) {
|
||||
objectList.value.splice(idx, 1)
|
||||
}
|
||||
|
||||
function removeKR(oIdx, krIdx) {
|
||||
objectList.value[oIdx].keyResults.splice(krIdx, 1)
|
||||
}
|
||||
|
||||
function addChildNode() {
|
||||
childNodeList.value.push({ dataScope: 2 })
|
||||
}
|
||||
|
||||
function removeChildNode(idx) {
|
||||
childNodeList.value.splice(idx, 1)
|
||||
}
|
||||
|
||||
// 读取父节点的OKR,并展示出来
|
||||
function handleChangeParent() {
|
||||
// 通过父节点Id,查询父节点的okr,需要继承
|
||||
if (form.value.parentId) {
|
||||
getAllOkrPage({ nodeId: form.value.parentId }).then((resp) => {
|
||||
objectList.value = resp
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function getLastDayOfMonth(year, month) {
|
||||
// 创建一个日期对象,将月份设置为指定月份的下一个月,日期设置为 0
|
||||
const date = new Date(year, month + 1, 0)
|
||||
// 返回该日期对象的日期部分,即指定年月的最后一天
|
||||
return date.getDate()
|
||||
}
|
||||
|
||||
function krChange(idx, krIdx) {
|
||||
const kr = objectList.value[idx].keyResults[krIdx]
|
||||
if (kr.keyResultName) {
|
||||
const obj = krOptions.value.find((item) => item.value == kr.keyResultName)
|
||||
if (obj) {
|
||||
kr.isSys = true
|
||||
} else {
|
||||
kr.isSys = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
form.value.executor = form.value.executor || []
|
||||
if (form.value.executor.length > 1) {
|
||||
message
|
||||
.confirm('是否按照当前节点所选的多个执行人自动新增对应的员工节点?', {
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: '不新增员工节点',
|
||||
confirmButtonText: '新增员工节点'
|
||||
})
|
||||
.then(() => {
|
||||
saveOkrData(true)
|
||||
})
|
||||
.catch(() => {
|
||||
saveOkrData(false)
|
||||
})
|
||||
} else {
|
||||
saveOkrData(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function saveOkrData(isAutoAddChild = false) {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
form.value.isAutoAddChild = isAutoAddChild
|
||||
form.value.objectives = objectList.value
|
||||
form.value.children = childNodeList.value
|
||||
if (formType.value === 'create') {
|
||||
// 创建的是一级节点,且子节点为空时,自动新增12个月子节点,并且每月添加4周的周子节点
|
||||
if (!form.value.parentId) {
|
||||
if (form.value.children.length == 0) {
|
||||
const defaultTime = new Date(form.value.startTime)
|
||||
for (let month = 0; month < 12; month++) {
|
||||
form.value.children.push({
|
||||
nodeName: `${month + 1}月`,
|
||||
startTime: `${defaultTime.getFullYear()}-${String(month + 1).padStart(2, '0')}-01`,
|
||||
endTime: `${defaultTime.getFullYear()}-${String(month + 1).padStart(
|
||||
2,
|
||||
'0'
|
||||
)}-${getLastDayOfMonth(defaultTime.getFullYear(), month)}`,
|
||||
dataScope: form.value.dataScope,
|
||||
executor: form.value.executor
|
||||
// children: [
|
||||
// {
|
||||
// nodeName: `${month + 1}月第1周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// },
|
||||
// {
|
||||
// nodeName: `${month + 1}月第2周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// },
|
||||
// {
|
||||
// nodeName: `${month + 1}月第3周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// },
|
||||
// {
|
||||
// nodeName: `${month + 1}月第4周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// }
|
||||
// ]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
await createOkrNode(form.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await updateOkrNode(form.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-okr {
|
||||
.dialog-okr-header {
|
||||
display: flex;
|
||||
height: 51px;
|
||||
min-height: 51px;
|
||||
vertical-align: middle;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
padding: 0 1.25rem;
|
||||
}
|
||||
.dialog-okr-body {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
min-width: 1064px;
|
||||
height: calc(94vh - 85px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
113
src/views/OKR/Management/Components/MyDuty.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="flex items-center justify-between">
|
||||
<el-row>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
style="width: 400px"
|
||||
@change="getOkrList"
|
||||
/>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
|
||||
<el-button type="success" @click="handleUpdateProcess">更新进度</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<OkrTable ref="okrTableRef" canEdit />
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MyDuty">
|
||||
import OkrTable from './OkrTable.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
|
||||
import { getMyNodeTree, getMyOkrPage } from '@/api/okr/okr'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
// onMounted(() => {
|
||||
handleSearchPeroid()
|
||||
// })
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getMyNodeTree().then((resp) => {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
searchForm.value.nodeId = resp.nodeId
|
||||
getOkrList()
|
||||
})
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getMyOkrPage(searchForm.value).then((resp) => {
|
||||
const list = resp
|
||||
if (list && list.length > 0) {
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(list)
|
||||
})
|
||||
} else {
|
||||
// 如果没有数据,清空表格
|
||||
okrTableRef.value.prepareData([])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
// function handleAddNode() {
|
||||
// dialogOkrInfo.value.open('create', null)
|
||||
// }
|
||||
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 1)
|
||||
}
|
||||
|
||||
function handleUpdateProcess() {
|
||||
okrTableRef.value.updateProcess(searchForm.value.nodeId).then(() => {
|
||||
message.success('更新成功')
|
||||
getOkrList()
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
function handleShowOkr(id) {
|
||||
dialogOkr.value.open({
|
||||
nodeId: id,
|
||||
canEdit: true,
|
||||
queryType: 1
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
125
src/views/OKR/Management/Components/MySon.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="flex items-center justify-between">
|
||||
<el-row>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
style="width: 400px"
|
||||
@change="nodeChange"
|
||||
/>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
v-if="currentUserId == searchForm.creatorId"
|
||||
@click="handleEditOkr(searchForm.nodeId)"
|
||||
>
|
||||
修改当前节点
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<OkrTable ref="okrTableRef" canEdit />
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" @success="handleSearchPeroid" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MySon">
|
||||
import OkrTable from './OkrTable.vue'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
import { listToTree, findNode } from '@/utils/tree'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import { getMySonNodeTree, getMySonOkrPage } from '@/api/okr/okr'
|
||||
|
||||
const props = defineProps({
|
||||
userId: {
|
||||
type: Number,
|
||||
default: undefined
|
||||
}
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
handleSearchPeroid()
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getMySonNodeTree({ userId: props.userId }).then((resp) => {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
nodeChange(resp.nodeId)
|
||||
})
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getMySonOkrPage({
|
||||
...searchForm.value,
|
||||
userId: props.userId
|
||||
}).then((resp) => {
|
||||
if (resp && resp.length > 0) {
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(resp)
|
||||
})
|
||||
} else {
|
||||
// 如果没有数据,清空表格
|
||||
okrTableRef.value.prepareData([])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function nodeChange(nodeId) {
|
||||
searchForm.value.nodeId = nodeId
|
||||
getOkrList()
|
||||
const currentNode = findNode(peroidList.value, (node) => {
|
||||
return node.nodeId == nodeId
|
||||
})
|
||||
searchForm.value.creatorId = currentNode.creatorId
|
||||
}
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
function handleShowOkr(id) {
|
||||
dialogOkr.value.open({
|
||||
nodeId: id,
|
||||
canEdit: true,
|
||||
queryType: 2
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 2)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
270
src/views/OKR/Management/Components/ObjectList.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div style="height: 100vh">
|
||||
<div class="flex items-center">
|
||||
<el-popover placement="bottom" width="500px" trigger="click" @show="handleSearchPeroid">
|
||||
<template #reference>
|
||||
<div class="flex items-center border-1px w-300px h-32px p-10px peroid-select">
|
||||
<Icon icon="ep:calendar" style="color: #aaa" />
|
||||
<span class="text-14px ml-10px" style="color: #aaa">
|
||||
{{ searchForm.nodeName ? searchForm.nodeName : '选择周期' }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<div class="mt-10px" style="height: 400px">
|
||||
<el-table :data="peroidList" @row-click="handleSelectPeroid">
|
||||
<el-table-column label="节点名称">
|
||||
<template #default="{ row }">
|
||||
<el-radio v-model="searchForm.nodeId" :label="row.nodeId">{{
|
||||
row.nodeName
|
||||
}}</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始日期" prop="startTime" width="120" />
|
||||
<el-table-column label="截止日期" prop="endTime" width="120" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
<el-button class="ml-10px" type="primary" @click="handleAddNode">新建节点</el-button>
|
||||
</div>
|
||||
|
||||
<vue3-tree-org
|
||||
ref="treeOrgRef"
|
||||
:data="dataList"
|
||||
center
|
||||
collapsable
|
||||
:default-expand-keys="lastExpendKeys"
|
||||
:props="treeProps"
|
||||
@on-node-click="handleClickNode"
|
||||
>
|
||||
<template #default="{ node }">
|
||||
<div style="cursor: pointer">
|
||||
<div class="tree-org-node__text node-label">
|
||||
<el-popover placement="right" title="目标" width="270px" trigger="hover">
|
||||
<template #reference>
|
||||
<div>
|
||||
<div style="max-height: 40px; overflow: hidden">{{ node.label }}</div>
|
||||
<div class="tip"> 目标数: {{ getNodePropData(node.id, 'objectiveNum') }}</div>
|
||||
<!-- 执行人 -->
|
||||
<div class="tip">
|
||||
执行人: {{ getNodePropData(node.id, 'executorName') || '无' }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div style="font-size: 0.875rem; line-height: 1.5">
|
||||
<div v-for="i in getNodePropData(node.id, 'objectives')" :key="i.id" class="mt-5">
|
||||
<span style="color: #aaa">{{ parseInt(i.progress) }}%</span>
|
||||
<span style="margin-left: 0.5rem">
|
||||
{{ i.objectiveName }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
<div class="p-5px">
|
||||
<el-progress
|
||||
type="line"
|
||||
:percentage="parseInt(getNodePropData(node.id, 'progress')) || 0"
|
||||
text-inside
|
||||
:stroke-width="12"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</vue3-tree-org>
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" @close="openOkr" @success="resetTreeData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ObjectList">
|
||||
import { Vue3TreeOrg } from 'vue3-tree-org'
|
||||
import 'vue3-tree-org/lib/vue3-tree-org.css'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
|
||||
import { getOkrRelationTree, getOkrRelationTreeChildren } from '@/api/okr/okr'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
|
||||
const dataList = ref({})
|
||||
const helpDataList = ref([])
|
||||
const lastExpendKeys = ref([])
|
||||
const treeProps = {
|
||||
children: 'children',
|
||||
label: 'nodeName',
|
||||
id: 'nodeId',
|
||||
pid: 'parentId'
|
||||
}
|
||||
|
||||
const searchForm = ref({
|
||||
nodeName: '',
|
||||
nodeId: null
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
handleSearchPeroid()
|
||||
|
||||
function handleSearchPeroid() {
|
||||
lastExpendKeys.value = []
|
||||
getOkrRelationTree().then((resp) => {
|
||||
peroidList.value = resp
|
||||
if (resp && resp.length && !searchForm.value.nodeId) {
|
||||
searchForm.value.nodeId = resp[0].nodeId
|
||||
searchForm.value.nodeName = resp[0].nodeName
|
||||
getOkrList()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const treeOrgRef = ref(null)
|
||||
function resetTreeData() {
|
||||
if (treeOrgRef.value) {
|
||||
lastExpendKeys.value = treeOrgRef.value.getExpandKeys()
|
||||
}
|
||||
|
||||
// 重新获取tree数据
|
||||
getOkrRelationTree().then((resp) => {
|
||||
peroidList.value = resp
|
||||
if (resp && resp.length) {
|
||||
if (!searchForm.value.nodeId) {
|
||||
searchForm.value.nodeId = resp[0].nodeId
|
||||
searchForm.value.nodeName = resp[0].nodeName
|
||||
}
|
||||
getOkrRelationTreeChildren({
|
||||
nodeId: searchForm.value.nodeId
|
||||
}).then((resp) => {
|
||||
const tree = listToTree(resp, {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
// // 设置展开的keys
|
||||
// if (treeOrgRef.value) {
|
||||
// treeOrgRef.value.setExpandKeys(lastExpendKeys.value)
|
||||
// }
|
||||
helpDataList.value = resp
|
||||
if (tree && tree.length) {
|
||||
dataList.value = tree[0]
|
||||
} else {
|
||||
dataList.value = {}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getOkrRelationTreeChildren({
|
||||
nodeId: searchForm.value.nodeId
|
||||
}).then((resp) => {
|
||||
const tree = listToTree(resp, {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
helpDataList.value = resp
|
||||
if (tree && tree.length) {
|
||||
dataList.value = tree[0]
|
||||
} else {
|
||||
dataList.value = {}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleSelectPeroid(row) {
|
||||
searchForm.value.nodeName = row.nodeName
|
||||
searchForm.value.nodeId = row.nodeId
|
||||
getOkrList()
|
||||
}
|
||||
|
||||
function getNodePropData(nodeId, prop) {
|
||||
const nodeData = helpDataList.value.find((it) => it.nodeId == nodeId)
|
||||
if (nodeData) {
|
||||
return nodeData[prop]
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function toggleExpand(data, val) {
|
||||
if (Array.isArray(data)) {
|
||||
data.forEach((item) => {
|
||||
item.expand = val
|
||||
if (item.children) {
|
||||
toggleExpand(item.children, val)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
data.expand = val
|
||||
if (data.children) {
|
||||
toggleExpand(data.children, val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
toggleExpand(dataList.value, true)
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
const clickNode = ref(null)
|
||||
function handleClickNode(node, data) {
|
||||
clickNode.value = data
|
||||
openOkr()
|
||||
}
|
||||
|
||||
function openOkr() {
|
||||
clickNode.value &&
|
||||
dialogOkr.value.open({
|
||||
nodeId: clickNode.value.nodeId,
|
||||
queryType: 2,
|
||||
canEdit: !clickNode.value.children || clickNode.value.children.length == 0
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
function handleAddNode() {
|
||||
clickNode.value = null
|
||||
dialogOkrInfo.value.open('create', null)
|
||||
}
|
||||
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 2)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.peroid-select {
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
border-color: var(--el-color-primary-light-5);
|
||||
}
|
||||
}
|
||||
|
||||
.tree-org-node__text {
|
||||
min-width: 200px;
|
||||
min-height: 80px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
}
|
||||
.tip {
|
||||
position: relative;
|
||||
color: #aaa;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
:deep(.el-progress-bar__innerText) {
|
||||
display: block;
|
||||
font-size: 0.75rem !important;
|
||||
}
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
194
src/views/OKR/Management/Components/OkrTable.vue
Normal file
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<div class="flex-1 h-200px overflow-hidden">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="okrList"
|
||||
default-expand-all
|
||||
row-key="id"
|
||||
size="large"
|
||||
height="100%"
|
||||
@row-click="handleRowClick"
|
||||
@expand-change="handleExpand"
|
||||
>
|
||||
<el-table-column label="目标/关键成果">
|
||||
<template #default="{ row, $index }">
|
||||
<span
|
||||
v-if="!expandedRows[row.id]"
|
||||
class="line1"
|
||||
:style="{
|
||||
top: row.type == '目标' ? '30px' : 0,
|
||||
height: getHeight(row, $index)
|
||||
}"
|
||||
></span>
|
||||
<span v-if="row.type == '目标'">
|
||||
<el-tag type="success" size="small">目标</el-tag>
|
||||
{{ row.name }}
|
||||
</span>
|
||||
<template v-else>
|
||||
<span class="line2"></span>
|
||||
<span>
|
||||
<el-tag type="primary" size="small">关键成果</el-tag>
|
||||
<span class="font-bold text-black" v-if="row.sourceName">
|
||||
【{{ row.sourceName }}】
|
||||
</span>
|
||||
<span>{{ row.name }}</span>
|
||||
<span v-if="row.resultType == 1">达 {{ row.targetValue }}</span>
|
||||
</span>
|
||||
<div class="flex items-center mt-10px ml-50px">
|
||||
<span>当前进度:</span>
|
||||
<span v-if="row.isSys || !props.canEdit">{{ row.currentValue }}</span>
|
||||
<el-input
|
||||
v-else-if="row.resultType == 1"
|
||||
v-model="row.currentValue"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
/>
|
||||
<el-radio-group
|
||||
v-else-if="row.resultType == 2"
|
||||
v-model="row.currentValue"
|
||||
size="small"
|
||||
>
|
||||
<el-radio :value="1">是</el-radio>
|
||||
<el-radio :value="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="progress" label="进度" width="200px">
|
||||
<template #default="{ row }">
|
||||
<el-progress :percentage="parseInt(row.progress) || 0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="executorName" label="执行人" width="200px" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="OkrTable">
|
||||
import { updateOkrProgress } from '@/api/okr/okr'
|
||||
|
||||
const emit = defineEmits(['rowClick'])
|
||||
|
||||
const props = defineProps({
|
||||
canEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const okrList = ref([])
|
||||
const helpList = ref([])
|
||||
|
||||
function prepareData(list) {
|
||||
if (!list || !Array.isArray(list) || list.length === 0) {
|
||||
okrList.value = []
|
||||
return
|
||||
}
|
||||
helpList.value = []
|
||||
expandedRows.value = {}
|
||||
okrList.value = list.map((item) => {
|
||||
let obj = {
|
||||
id: item.objectiveId,
|
||||
name: item.objectiveName,
|
||||
progress: item.progress,
|
||||
executorName: item.executorName,
|
||||
type: '目标'
|
||||
}
|
||||
helpList.value.push(obj)
|
||||
if (item.keyResults) {
|
||||
obj.children = item.keyResults.map((child) => {
|
||||
let kr = {
|
||||
id: child.keyResultId,
|
||||
keyResultId: child.keyResultId,
|
||||
objectiveId: child.objectiveId,
|
||||
nodeId: child.nodeId,
|
||||
isSys: child.isSys,
|
||||
processId: child.id,
|
||||
name: child.keyResultShowName,
|
||||
progress: child.progress,
|
||||
executorName: child.executorName,
|
||||
type: '关键成果',
|
||||
resultType: child.resultType,
|
||||
targetValue: child.targetValue,
|
||||
currentValue: Number(child.currentValue),
|
||||
sourceName: child.sourceName
|
||||
}
|
||||
helpList.value.push(kr)
|
||||
return kr
|
||||
})
|
||||
}
|
||||
return obj
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
prepareData,
|
||||
updateProcess
|
||||
})
|
||||
function getHeight(row, index) {
|
||||
if (helpList.value.length - 1 == index || helpList.value[index + 1].type == '目标') {
|
||||
return '22px'
|
||||
} else {
|
||||
return '100%'
|
||||
}
|
||||
}
|
||||
|
||||
const expandedRows = ref({})
|
||||
function handleExpand(row, expanded) {
|
||||
expandedRows.value[row.id] = !expanded
|
||||
}
|
||||
|
||||
function updateProcess(nodeId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
let arr = []
|
||||
okrList.value.map((item) => {
|
||||
arr = [...arr, ...(item.children || []).map((it) => ({ ...it, id: it.processId }))]
|
||||
})
|
||||
updateOkrProgress({
|
||||
nodeId,
|
||||
keyResultProgressList: arr
|
||||
}).then((resp) => {
|
||||
resolve(resp)
|
||||
})
|
||||
} catch (error) {
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleRowClick(row) {
|
||||
emit('rowClick', row)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.line1 {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
left: 21px;
|
||||
border-left: 1px dashed #ccc;
|
||||
}
|
||||
.line2 {
|
||||
position: absolute;
|
||||
width: 26px;
|
||||
height: 1px;
|
||||
left: 21px;
|
||||
top: 22px;
|
||||
border-bottom: 1px dashed #ccc;
|
||||
&::after {
|
||||
position: absolute;
|
||||
left: 25px;
|
||||
top: -3px;
|
||||
display: block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 6px;
|
||||
margin: 0 auto;
|
||||
border: 1px solid #ddd;
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
</style>
|
||||
77
src/views/OKR/Management/index.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<div :style="{ height: `${height}px` }">
|
||||
<el-tabs tab-position="left" v-model="tabIndex" style="height: 100%">
|
||||
<el-tab-pane disabled name="-1">
|
||||
<template #label>
|
||||
<div class="w-full">
|
||||
<div style="text-align: left; transform: translateX(-10px)">目标</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="我负责的" name="0">
|
||||
<MyDuty v-if="tabIndex == 0" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="待办事项" name="1">
|
||||
<WaitTarget v-if="tabIndex == 1" />
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="全部目标" name="2">
|
||||
<AllTarget v-if="tabIndex == 2" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="目标关系树" name="3">
|
||||
<ObjectList v-if="tabIndex == 3" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane disabled v-if="employeeList.length > 0">
|
||||
<template #label>
|
||||
<div class="w-full">
|
||||
<el-divider
|
||||
direction="horizontal"
|
||||
style="width: calc(100% + 10px) !important; transform: translateX(-10px)"
|
||||
/>
|
||||
<div style="text-align: left; transform: translateX(-10px)">成员</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
v-for="item in employeeList"
|
||||
:key="item.userId"
|
||||
:label="item.userName"
|
||||
:name="item.userId"
|
||||
>
|
||||
<MySon v-if="tabIndex == item.userId" :userId="item.userId" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="OkrManagement">
|
||||
import AllTarget from './Components/AllTarget.vue'
|
||||
import MyDuty from './Components/MyDuty.vue'
|
||||
import MySon from './Components/MySon.vue'
|
||||
import ObjectList from './Components/ObjectList.vue'
|
||||
// import WaitTarget from './Components/WaitTarget.vue'
|
||||
|
||||
import { getMyMemberList } from '@/api/okr/okr'
|
||||
|
||||
const tabIndex = ref('0')
|
||||
const height = ref(innerHeight - 115)
|
||||
|
||||
const employeeList = ref([])
|
||||
onMounted(() => {
|
||||
getMyMemberList().then((res) => {
|
||||
employeeList.value = res
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-tabs__content) {
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.el-tab-pane) {
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.el-popover__title) {
|
||||
font-size: 0.875rem;
|
||||
color: #aaa !important;
|
||||
}
|
||||
</style>
|
||||
514
src/views/OKR/Meeting/MeetingInfo.vue
Normal file
@@ -0,0 +1,514 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <el-affix postion="top" :offset="95" v-if="!isDetail"> -->
|
||||
<div class="flex justify-between mb-4 bg-white" v-if="!isDetail">
|
||||
<b class="text-20px">{{ form.meetingId ? '修改会议' : '新增会议' }}</b>
|
||||
<div>
|
||||
<el-button @click="submit(true)">保存至草稿</el-button>
|
||||
<el-button type="success" @click="submit(false)">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </el-affix> -->
|
||||
<el-form
|
||||
:model="form"
|
||||
ref="formRef"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
v-loading="loading"
|
||||
:disabled="!!isDetail"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<el-form-item label="会议主题" prop="meetingSubject">
|
||||
<el-input v-model="form.meetingSubject" placeholder="请输入会议主题" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<el-form-item label="okr节点" prop="nodeId">
|
||||
<el-tree-select
|
||||
v-model="form.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
check-strictly
|
||||
clearable
|
||||
placeholder="选择OKR节点"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="会议时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
value-format="YYYY-MM-DD HH:mm"
|
||||
placeholder="请选择会议开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="预计结束时间" prop="expectEndTime">
|
||||
<el-date-picker
|
||||
v-model="form.expectEndTime"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
value-format="YYYY-MM-DD HH:mm"
|
||||
placeholder="请选择预计结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="会议地点" prop="meetingRoom">
|
||||
<el-input v-model="form.meetingRoom" placeholder="请输入会议地点" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="会议状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择会议状态" style="width: 100%">
|
||||
<el-option label="未开始" value="1" />
|
||||
<el-option label="已结束" value="2" />
|
||||
<el-option label="已取消" value="3" disabled />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="预约参会人员" prop="expectUsers">
|
||||
<el-select
|
||||
v-model="form.expectUsers"
|
||||
placeholder="选择参会人员"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
multiple
|
||||
@change="handleUserChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="item.status == 1 || item.id == userStore.getUser.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0" v-if="form.meetingId">
|
||||
<el-form-item label="实际参会人员" prop="actualUsers">
|
||||
<el-checkbox-group v-model="form.actualUsers">
|
||||
<el-checkbox
|
||||
v-for="item in expectUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0" v-if="form.meetingId && !isAllActived">
|
||||
<el-form-item label="缺席原因" prop="absentReason">
|
||||
<el-input v-model="form.absentReason" placeholder="请输入缺席原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24">
|
||||
<el-tabs v-model="currentUserId" tab-position="top" @tab-click="userTabChange">
|
||||
<el-tab-pane
|
||||
v-for="item in form.meetingContentList"
|
||||
:key="item.userId"
|
||||
:label="item.userName"
|
||||
:name="item.userId + ''"
|
||||
/>
|
||||
</el-tabs>
|
||||
<el-tabs v-model="currentContentId" tab-position="left" addable @edit="handleTabsEdit">
|
||||
<el-tab-pane
|
||||
v-for="(item, index) in form.meetingContentList.find(
|
||||
(it) => it.userId == currentUserId
|
||||
)?.userMeetingContentList"
|
||||
:key="index"
|
||||
:label="'内容' + (index + 1)"
|
||||
:name="index"
|
||||
:closable="index > 0"
|
||||
>
|
||||
<div v-if="!!isDetail" v-dompurify-html="item.content" class="w-full"></div>
|
||||
<Editor v-else v-model="item.content" height="500px" style="width: 100%" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" v-if="!!form.meetingId">
|
||||
<div v-if="!!isDetail" v-dompurify-html="form.meetingSummary" class="w-full"></div>
|
||||
<div v-else>
|
||||
<el-tabs v-model="summaryIdx" addable @edit="meetingSummaryEdit">
|
||||
<el-tab-pane
|
||||
v-for="(item, index) in form.meetingSummaryList"
|
||||
:key="index"
|
||||
:label="`会议纪要${index || ''}`"
|
||||
:name="index"
|
||||
:closable="index > 0"
|
||||
>
|
||||
<Editor
|
||||
v-model="item.summary"
|
||||
:toolbarConfig="toolbarConfig"
|
||||
height="350px"
|
||||
placeholder="请输入会议纪要"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<div class="mt-10px">
|
||||
<el-form-item label="是否创建待办" label-width="auto">
|
||||
<el-radio-group v-model="item.isCreateAgentWork">
|
||||
<el-radio :label="true" :value="true"> 创建待办 </el-radio>
|
||||
<el-radio :label="false" :value="false"> 不创建待办 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex items-center" v-if="item.isCreateAgentWork">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="item.agentUserList"
|
||||
placeholder="选择执行人"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="it in userOptions"
|
||||
:key="it.id"
|
||||
:label="it.name"
|
||||
:value="it.id"
|
||||
:disabled="it.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
class="flex-1 ml-10px"
|
||||
v-model="item.endDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择截止时间"
|
||||
/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-divider />
|
||||
<div class="text-black text-12px">
|
||||
注:如果选择创建待办,请选择执行人及截止日期,默认每天9:00循环提醒,可于待办中修改
|
||||
</div>
|
||||
<div class="mt-10px">
|
||||
<el-form-item label="会议纪要发送至群聊:" label-width="auto">
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
v-model="form.wxId"
|
||||
placeholder="请输入群聊名称"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in groupOptions"
|
||||
:key="item.wxGroupId"
|
||||
:label="item.wxGroupName"
|
||||
:value="item.wxGroupId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MeetingInfo">
|
||||
import { listToTree } from '@/utils/tree'
|
||||
import { getAllNodeTree } from '@/api/okr/okr'
|
||||
import * as MeetingApi from '@/api/okr/meeting'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const route = useRoute()
|
||||
const message = useMessage()
|
||||
const tagsViewStore = useTagsViewStore()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const isDetail = route.query.isDetail
|
||||
const currentUserId = ref(undefined)
|
||||
const currentContentId = ref(0) // 默认选中第一个标签页
|
||||
const summaryIdx = ref(0) // 会议纪要的索引
|
||||
|
||||
const toolbarConfig = {
|
||||
toolbarKeys: []
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
getWxGroupOptions()
|
||||
await getOptions()
|
||||
if (route.params.id && route.params.id != 0) {
|
||||
// 这里可以调用API获取会议详情数据
|
||||
getMeetingInfo(route.params.id)
|
||||
} else {
|
||||
form.value.meetingContentList = [
|
||||
{
|
||||
userId: userStore.getUser.id + '',
|
||||
userName: userStore.getUser.nickname,
|
||||
userMeetingContentList: [
|
||||
{
|
||||
content: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
currentContentId.value = 0
|
||||
}
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
function getOptions() {
|
||||
return Promise.all([getAllNodeTree(), getEmployeeSimpleList()])
|
||||
.then(([okrResp, employeeResp]) => {
|
||||
peroidList.value = listToTree(okrResp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
userOptions.value = employeeResp.map((it) => ({ ...it, id: it.id + '' }))
|
||||
form.value.expectUsers = [userStore.getUser.id + ''] // 默认添加当前用户为预约参会人员
|
||||
// form.value.actualUsers = [userStore.getUser.id + '']
|
||||
currentUserId.value = userStore.getUser.id + '' // 默认选中当前用户
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取数据失败:', error)
|
||||
})
|
||||
}
|
||||
|
||||
const form = ref({
|
||||
meetingId: undefined,
|
||||
meetingSubject: '',
|
||||
startTime: '',
|
||||
meetingRoom: '',
|
||||
expectEndTime: '',
|
||||
expectUsers: [],
|
||||
actualUsers: [],
|
||||
okrNodeName: '',
|
||||
status: '1',
|
||||
meetingContent: '',
|
||||
meetingSummary: '',
|
||||
absentReason: '',
|
||||
meetingContentList: [],
|
||||
meetingSummaryList: []
|
||||
})
|
||||
const rules = {
|
||||
meetingSubject: [{ required: true, message: '请输入会议主题', trigger: 'blur' }],
|
||||
startTime: [{ required: true, message: '请选择会议开始时间', trigger: 'change' }],
|
||||
expectEndTime: [{ required: true, message: '请选择预计结束时间', trigger: 'change' }],
|
||||
meetingRoom: [{ required: true, message: '请输入会议地点', trigger: 'blur' }],
|
||||
expectUsers: [{ required: true, message: '请选择参会人员', trigger: 'change' }]
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
const userOptions = ref([])
|
||||
const expectUserOptions = ref([])
|
||||
|
||||
const isAllActived = computed(() => {
|
||||
// 判断实际参会人员是否包含所有预约参会人员
|
||||
return form.value.expectUsers.every((item) => form.value.actualUsers.includes(item))
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
// 获取详情
|
||||
const getMeetingInfo = async (meetingId) => {
|
||||
try {
|
||||
loading.value = true
|
||||
// 调用API获取会议详情
|
||||
const resp = await MeetingApi.getMeetingDetail({ meetingId })
|
||||
loading.value = false
|
||||
if (resp) {
|
||||
let summaryList = []
|
||||
if (resp.meetingSummaryList && resp.meetingSummaryList.length > 0) {
|
||||
summaryList = resp.meetingSummaryList.map((item) => ({
|
||||
...item,
|
||||
isCreateAgentWork: !!item.isCreateAgentWork,
|
||||
agentUserList: item.agentUserList ? item.agentUserList.map((it) => it + '') : []
|
||||
}))
|
||||
} else {
|
||||
summaryList = [
|
||||
{
|
||||
summary: resp.meetingSummary || '',
|
||||
agentUserList: [],
|
||||
endDate: '',
|
||||
isCreateAgentWork: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
form.value = {
|
||||
...form.value,
|
||||
...resp,
|
||||
startTime: formatDate(resp.startTime, 'YYYY-MM-DD HH:mm'),
|
||||
expectEndTime: formatDate(resp.expectEndTime, 'YYYY-MM-DD HH:mm'),
|
||||
expectUsers: resp.expectUsers || [],
|
||||
actualUsers: resp.actualUsers || [],
|
||||
meetingSummaryList: summaryList
|
||||
}
|
||||
currentContentId.value = 0
|
||||
expectUserOptions.value = userOptions.value.filter((user) =>
|
||||
form.value.expectUsers.some((it) => it == user.id)
|
||||
)
|
||||
}
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
console.error('获取会议详情失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const groupOptions = ref([])
|
||||
|
||||
function getWxGroupOptions() {
|
||||
MeetingApi.refreshWxGroupList().then(() => {
|
||||
MeetingApi.getWxGroupList()
|
||||
.then((resp) => {
|
||||
groupOptions.value = resp || []
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取微信群列表失败:', error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function userTabChange() {
|
||||
currentContentId.value = 0
|
||||
}
|
||||
|
||||
function handleTabsEdit(targetName, action) {
|
||||
if (action === 'add') {
|
||||
form.value.meetingContentList.forEach((item) => {
|
||||
if (item.userId == currentUserId.value) {
|
||||
item.userMeetingContentList.push({
|
||||
content: ''
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (action === 'remove') {
|
||||
form.value.meetingContentList.forEach((item) => {
|
||||
if (item.userId == currentUserId.value) {
|
||||
item.userMeetingContentList.splice(targetName, 1)
|
||||
// 如果删除的是当前选中的标签页,则切换到下一个标签页
|
||||
if (currentContentId.value == targetName) {
|
||||
currentContentId.value = targetName - 1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function meetingSummaryEdit(targetName, action) {
|
||||
if (action === 'add') {
|
||||
form.value.meetingSummaryList.push({
|
||||
summary: '',
|
||||
agentUserList: [],
|
||||
endDate: '',
|
||||
isCreateAgentWork: true
|
||||
})
|
||||
} else if (action === 'remove') {
|
||||
form.value.meetingSummaryList.splice(targetName, 1)
|
||||
summaryIdx.value = targetName - 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleUserChange(val) {
|
||||
// 当预约参会人员变化时,更新实际参会人员选项
|
||||
expectUserOptions.value = userOptions.value.filter((user) =>
|
||||
form.value.expectUsers.some((it) => it == user.id)
|
||||
)
|
||||
if (!isDetail) {
|
||||
form.value.actualUsers = [...form.value.expectUsers]
|
||||
}
|
||||
// 先过滤掉不存在的参会人员
|
||||
form.value.meetingContentList = form.value.meetingContentList.filter((item) => {
|
||||
return val.some((it) => it == item.userId)
|
||||
})
|
||||
// 再补充新增的
|
||||
val.map((item) => {
|
||||
if (!form.value.meetingContentList.some((it) => it.userId == item)) {
|
||||
form.value.meetingContentList.push({
|
||||
userId: item,
|
||||
userName: userOptions.value.find((it) => it.id == item).name,
|
||||
userMeetingContentList: [
|
||||
{
|
||||
content: ''
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
async function submit(isDraft = false) {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
try {
|
||||
form.value.isDraft = isDraft
|
||||
// 提交表单数据
|
||||
if (form.value.meetingId) {
|
||||
if (
|
||||
form.value.status == 2 &&
|
||||
form.value.meetingSummaryList.some((it) => it.summary.trim() == '')
|
||||
) {
|
||||
message.error('会议结束时,会议纪要不能为空')
|
||||
return
|
||||
} else {
|
||||
let text = ''
|
||||
form.value.meetingSummaryList.map((item, index) => {
|
||||
if (form.value.meetingSummaryList.length > 1) {
|
||||
text += '<p>会议纪要' + (index + 1) + ':</p>'
|
||||
}
|
||||
text += item.summary
|
||||
if (item.isCreateAgentWork) {
|
||||
text += `<p>执行人:`
|
||||
item.agentUserList.map((it) => {
|
||||
if (it) {
|
||||
text += `${userOptions.value.find((user) => user.id == it).name} `
|
||||
}
|
||||
})
|
||||
text += '</p>'
|
||||
text += `<p>截止日期:${item.endDate}</p>`
|
||||
}
|
||||
text += '<p><br></p>'
|
||||
})
|
||||
form.value.meetingSummary = text
|
||||
}
|
||||
// 更新会议
|
||||
await MeetingApi.updateMeeting(form.value)
|
||||
message.success('会议更新成功')
|
||||
} else {
|
||||
form.value.actualUsers = []
|
||||
// 新增会议
|
||||
await MeetingApi.createMeeting(form.value)
|
||||
message.success('会议创建成功')
|
||||
}
|
||||
tagsViewStore.delView(route)
|
||||
const visitedViews = tagsViewStore.getVisitedViews
|
||||
const latestView = visitedViews.slice(-1)[0]
|
||||
router.push(latestView)
|
||||
} catch (error) {
|
||||
console.error('保存会议数据失败:', error)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
48
src/views/OKR/Meeting/MeetingSummary.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-descriptions :column="1" border label-width="90px" class="w-full">
|
||||
<el-descriptions-item label="会议主题">{{ meetingInfo.meetingSubject }}</el-descriptions-item>
|
||||
<el-descriptions-item label="会议时间">{{ meetingInfo.startTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发起人">{{ meetingInfo.creatorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="会议纪要">
|
||||
<div v-dompurify-html="meetingInfo.meetingSummary"></div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MeettingSummary">
|
||||
import { getMeetingDetail } from '@/api/okr/meeting'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
onMounted(() => {
|
||||
if (route.query.id && route.query.id != 0) {
|
||||
// 这里可以调用API获取会议详情数据
|
||||
getMeetingInfo(route.query.id)
|
||||
} else {
|
||||
console.error('会议不存在')
|
||||
}
|
||||
})
|
||||
|
||||
const meetingInfo = ref({})
|
||||
const getMeetingInfo = async (meetingId) => {
|
||||
try {
|
||||
// 调用API获取会议详情
|
||||
const resp = await getMeetingDetail({ meetingId })
|
||||
if (resp) {
|
||||
meetingInfo.value = {
|
||||
meetingSubject: resp.meetingSubject,
|
||||
meetingSummary: resp.meetingSummary,
|
||||
startTime: formatDate(resp.startTime, 'YYYY-MM-DD HH:mm'),
|
||||
creatorName: resp.creatorName
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取会议详情失败:', error)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
230
src/views/OKR/Meeting/index.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索条件:主题、会议状态、会议时间(时间段)、选择OKR节点 -->
|
||||
<el-form :model="searchForm" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.meetingSubject"
|
||||
placeholder="会议主题"
|
||||
style="width: 200px"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.creator"
|
||||
placeholder="发起人"
|
||||
style="width: 120px"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.status"
|
||||
placeholder="会议状态"
|
||||
style="width: 150px"
|
||||
@change="handleSearch"
|
||||
>
|
||||
<el-option label="未开始" value="1" />
|
||||
<el-option label="已结束" value="2" />
|
||||
<el-option label="已取消" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.dateRange"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
start-placeholder="会议时间"
|
||||
end-placeholder="会议时间"
|
||||
@change="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
check-strictly
|
||||
placeholder="选择OKR节点"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
@change="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button type="primary" @click="handleAdd">预约会议</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table :data="tableList" v-loading="loading" border stripe>
|
||||
<el-table-column prop="meetingSubject" label="会议主题" />
|
||||
<el-table-column prop="startTime" label="会议时间" width="170px" />
|
||||
<el-table-column prop="meetingRoom" label="会议地点" width="140px" />
|
||||
<el-table-column prop="creatorName" label="发起人" width="100px" />
|
||||
<el-table-column prop="expectEndTime" label="预计结束时间" width="170px" />
|
||||
<el-table-column prop="expectUserName" label="预约参会人员" />
|
||||
<el-table-column prop="actualUserName" label="实际参会人员" />
|
||||
<el-table-column prop="nodeName" label="关联OKR节点" width="150px" />
|
||||
<el-table-column prop="status" label="会议状态" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="['', 'info', 'success', 'warning'][row.status]" size="small">
|
||||
{{ ['', '未开始', '已结束', '已取消'][row.status] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row.status == 1 && row.creator == currentUserId">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleEdit(row.meetingId)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button type="danger" text style="padding: 0" @click="handleCancel(row)">
|
||||
取消
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
@click="handleDetail(row.meetingId)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Meeting">
|
||||
import { listToTree } from '@/utils/tree'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getAllNodeTree } from '@/api/okr/okr'
|
||||
import * as MeetingApi from '@/api/okr/meeting'
|
||||
|
||||
const currentUserId = useUserStore().getUser.id
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
const message = useMessage()
|
||||
|
||||
const searchForm = ref({
|
||||
meetingSubject: undefined,
|
||||
creator: undefined,
|
||||
status: '1',
|
||||
dateRange: [],
|
||||
nodeId: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
})
|
||||
const total = ref(0)
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
function getOptions() {
|
||||
// 获取OKR节点数据
|
||||
getAllNodeTree().then((resp) => {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const handleSearch = () => {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
// 获取会议列表
|
||||
try {
|
||||
const params = { ...searchForm.value }
|
||||
if (params.dateRange && params.dateRange.length) {
|
||||
params.startTime = params.dateRange[0] + ' 00:00:00'
|
||||
params.endTime = params.dateRange[1] + ' 23:59:59'
|
||||
delete params.dateRange
|
||||
} else {
|
||||
delete params.startTime
|
||||
delete params.endTime
|
||||
}
|
||||
MeetingApi.getMeetingPage(params)
|
||||
.then((resp) => {
|
||||
tableList.value = resp.list || []
|
||||
total.value = resp.total || 0
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('获取会议列表失败:', error)
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const handleAdd = () => {
|
||||
router.push({ name: 'MeetingInfo', params: { id: 0 } })
|
||||
}
|
||||
|
||||
const handleEdit = (id) => {
|
||||
router.push({
|
||||
name: `MeetingInfo`,
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleDetail = (id) => {
|
||||
router.push({
|
||||
name: `MeetingInfo`,
|
||||
params: {
|
||||
id
|
||||
},
|
||||
query: {
|
||||
isDetail: 1
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleCancel = async (row) => {
|
||||
try {
|
||||
await message.confirm('是否确认取消该会议?')
|
||||
// 取消会议操作
|
||||
await MeetingApi.cancelMeeting({ meetingId: row.meetingId })
|
||||
message.success('会议取消成功')
|
||||
getList() // 刷新列表
|
||||
} catch (error) {
|
||||
console.log('取消操作被用户拒绝', error)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
347
src/views/OKR/Wait/Components/DialogWait.vue
Normal file
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<Dialog :title="title" v-model="show" :width="formType == 'create' ? '750px' : '1100px'">
|
||||
<div class="flex items-baseline">
|
||||
<el-form
|
||||
:model="form"
|
||||
ref="formRef"
|
||||
:disabled="formType == 'do'"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
class="flex-1"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入待办标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<Editor
|
||||
v-model:modelValue="form.content"
|
||||
height="400px"
|
||||
:disabled="formType == 'do'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="form.priority" placeholder="选择优先级" filterable>
|
||||
<el-option
|
||||
v-for="item in props.priorityOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="完成状态" prop="completeStatus">
|
||||
<el-select v-model="form.completeStatus" placeholder="选择完成状态" filterable>
|
||||
<el-option
|
||||
v-for="item in props.statusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="截止日期" prop="endDate">
|
||||
<el-date-picker
|
||||
v-model="form.endDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="执行人" prop="userList">
|
||||
<el-select
|
||||
v-model="form.userList"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:disabled="item.status == 1"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="0">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item prop="notifyType">
|
||||
<template #label>
|
||||
<el-tooltip
|
||||
content="新增待办时会立刻发送消息通知执行人,若后续无需再次提醒,频率可选择“不提醒”"
|
||||
placement="top"
|
||||
effect="dark"
|
||||
>
|
||||
<Icon icon="ep:info-filled" :size="12" />
|
||||
</el-tooltip>
|
||||
<span>提醒频率</span>
|
||||
</template>
|
||||
<el-select v-model="form.notifyType" placeholder="选择提醒频率">
|
||||
<el-option label="不提醒" value="1" />
|
||||
<el-option label="单次提醒" value="2" />
|
||||
<el-option label="循环提醒" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0" v-if="form.notifyType != 1">
|
||||
<el-form-item label="提醒时间" prop="remindTime" class="wait-form">
|
||||
<el-input
|
||||
v-if="form.notifyType == 2"
|
||||
v-model="form.notifyBeforeTime"
|
||||
placeholder="输入小时数"
|
||||
min="0"
|
||||
type="number"
|
||||
>
|
||||
<template #prepend>
|
||||
<span>提前</span>
|
||||
</template>
|
||||
<template #append> 小时 </template>
|
||||
</el-input>
|
||||
<el-input
|
||||
v-else-if="form.notifyType == 3"
|
||||
v-model="form.intervalTime"
|
||||
placeholder="输入小时数"
|
||||
min="0"
|
||||
type="number"
|
||||
>
|
||||
<template #prepend>
|
||||
<span>每</span>
|
||||
</template>
|
||||
<template #append> 小时 </template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0" v-if="form.notifyType == 3">
|
||||
<el-form-item label="首次提醒" prop="firstNotifyTime">
|
||||
<el-time-picker
|
||||
v-model="form.firstNotifyTime"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
style="width: 100%"
|
||||
:picker-options="enableTimeRange"
|
||||
placeholder="选择时间点"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div v-if="formType != 'create'" class="w-350px ml-10px h-full">
|
||||
<div class="mb-10px" v-if="formType == 'do'">
|
||||
<Editor
|
||||
v-model:modelValue="form.followUpContent"
|
||||
height="150px"
|
||||
:toolbarConfig="toolbarConfig"
|
||||
/>
|
||||
<el-button class="absolute" style="right: 20px; top: 195px" type="primary" @click="addDo">
|
||||
更新进度
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="overflow-y-auto pl-15px" style="height: calc(100% - 50px)">
|
||||
<el-timeline class="ml-10px">
|
||||
<el-timeline-item
|
||||
v-for="item in followList"
|
||||
:key="item.followId"
|
||||
placement="bottom"
|
||||
:timestamp="formatDate(item.createTime, 'YYYY-MM-DD HH:mm:ss')"
|
||||
color="#30d1fc"
|
||||
>
|
||||
<div class="font-bold" style="font-size: 16px">{{ item.followUserName }}</div>
|
||||
<div v-dompurify-html="item.content"></div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer v-if="formType != 'do'">
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button type="primary" :disabled="formLoading" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogWait">
|
||||
import {
|
||||
createWait,
|
||||
updateWait,
|
||||
getWaitDetail,
|
||||
getFollowWaitPage,
|
||||
followWait
|
||||
} from '@/api/okr/wait'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const props = defineProps({
|
||||
priorityOptions: {
|
||||
type: Array,
|
||||
default: () => [
|
||||
{ label: '高', value: '1' },
|
||||
{ label: '中', value: '2' },
|
||||
{ label: '低', value: '3' }
|
||||
]
|
||||
},
|
||||
statusOptions: {
|
||||
type: Array,
|
||||
default: () => [
|
||||
{ label: '未完成', value: '1', tagType: 'warning' },
|
||||
{ label: '已关闭', value: '2', tagType: 'success' }
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const toolbarConfig = {
|
||||
toolbarKeys: []
|
||||
}
|
||||
|
||||
const enableTimeRange = {
|
||||
selectableRange: '07:00 - 22:00'
|
||||
}
|
||||
|
||||
const show = ref(false)
|
||||
const title = ref('')
|
||||
const formType = ref('create')
|
||||
|
||||
const form = ref({})
|
||||
const formLoading = ref(false)
|
||||
const rules = ref({
|
||||
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
|
||||
endDate: [{ required: true, message: '请选择截止日期', trigger: 'change' }],
|
||||
userList: [{ required: true, message: '请选择执行人', trigger: 'change' }]
|
||||
})
|
||||
|
||||
const followList = ref([])
|
||||
|
||||
function open(type, id) {
|
||||
show.value = true
|
||||
title.value = { create: '新增待办', update: '修改待办', do: '更新待办进度' }[type]
|
||||
formType.value = type
|
||||
resetForm()
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
// 表单数据
|
||||
getWaitDetail(id).then((info) => {
|
||||
form.value = {
|
||||
...info,
|
||||
endDate: formatDate(info.endDate, 'YYYY-MM-DD'),
|
||||
userList: info.userIdList
|
||||
}
|
||||
})
|
||||
getFollowList(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
getOptions()
|
||||
}
|
||||
|
||||
function getFollowList(id) {
|
||||
// 跟进数据
|
||||
getFollowWaitPage({
|
||||
workId: id
|
||||
}).then((data) => {
|
||||
followList.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
getEmployeeSimpleList().then((data) => {
|
||||
employeeOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
form.value = {
|
||||
title: undefined,
|
||||
content: undefined,
|
||||
priority: '1',
|
||||
completeStatus: '1',
|
||||
endDate: undefined,
|
||||
userList: [],
|
||||
notifyType: '3',
|
||||
remindTime: 12,
|
||||
firstNotifyTime: '09:00'
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (formType.value === 'create') {
|
||||
await createWait(form.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await updateWait(form.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function addDo() {
|
||||
followWait({
|
||||
workId: form.value.workId,
|
||||
content: form.value.followUpContent
|
||||
}).then(() => {
|
||||
message.success('跟进成功')
|
||||
getFollowList(form.value.workId)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wait-form {
|
||||
:deep(.el-input-group__prepend) {
|
||||
padding: 0 10px;
|
||||
}
|
||||
:deep(.el-input-group__append) {
|
||||
padding: 0 10px;
|
||||
}
|
||||
:deep(.el-input__inner) {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
297
src/views/OKR/Wait/index.vue
Normal file
@@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" inline label-width="0" @submit.prevent="searchList">
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.title" placeholder="输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.priority" placeholder="选择优先级" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in priorityOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.completeStatus"
|
||||
placeholder="选择完成状态"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button @click="searchList"> 搜索</el-button>
|
||||
<el-button type="primary" @click="handleAdd"> 新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tabs v-model="tabIndex" @tab-change="searchList">
|
||||
<el-tab-pane :name="1">
|
||||
<template #label>
|
||||
<el-badge :value="tabCount.dayEndAgentWorkNum" :max="99" :show-zero="false">
|
||||
<el-tooltip content="截止日在今日及之前的未关闭事项" placement="top" effect="dark">
|
||||
<Icon icon="ep:question-filled" />
|
||||
</el-tooltip>
|
||||
<span>今日截止</span>
|
||||
</el-badge>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="2">
|
||||
<template #label>
|
||||
<el-tooltip content="需要我执行的全部事项" placement="top" effect="dark">
|
||||
<Icon icon="ep:question-filled" />
|
||||
</el-tooltip>
|
||||
<span>我的待办</span>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="3">
|
||||
<template #label>
|
||||
<el-badge :value="tabCount.urgeAgentWorkNum" :max="99" :show-zero="false">
|
||||
<el-tooltip content="指派他人去办的事项" placement="top" effect="dark">
|
||||
<Icon icon="ep:question-filled" />
|
||||
</el-tooltip>
|
||||
<span>催办事项</span>
|
||||
</el-badge>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane :name="4">
|
||||
<template #label>
|
||||
<el-badge :value="tabCount.notifyNum" :max="99" :show-zero="false">
|
||||
<el-tooltip content="特指OKR中@我的消息" placement="top" effect="dark">
|
||||
<Icon icon="ep:question-filled" />
|
||||
</el-tooltip>
|
||||
<span>通知我的</span>
|
||||
</el-badge>
|
||||
</template>
|
||||
<el-table :data="mentionedList">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="content" label="okr标题" />
|
||||
<el-table-column prop="createUserName" label="创建人" />
|
||||
<el-table-column prop="createDate" label="创建日期" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="{ row }">
|
||||
<el-button style="padding: 0" type="primary" text @click="handleShow(row)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
|
||||
<el-table v-if="tabIndex != 4" :data="tableList">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="title" label="标题" />
|
||||
<el-table-column prop="priority" label="优先级">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="priorityFilter(row.priority)">
|
||||
{{ priorityNameFilter(row.priority) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorName" label="创建人" />
|
||||
<el-table-column prop="createTime" label="创建日期" :formatter="dateFormatter" />
|
||||
<el-table-column prop="userNameStr" label="执行人" />
|
||||
<el-table-column prop="endDate" label="截止日期" :formatter="dateFormatter" />
|
||||
<el-table-column label="状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="statusFilter(row.completeStatus)">{{
|
||||
statusNameFilter(row.completeStatus)
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="completedDate" label="关闭日期" :formatter="dateFormatter" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.userIdList.includes(currentUserId) && row.completeStatus == 1"
|
||||
style="padding: 0; margin-right: 10px"
|
||||
type="primary"
|
||||
text
|
||||
@click="handleDo(row)"
|
||||
>
|
||||
跟进
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!row.userIdList.includes(currentUserId) && row.completeStatus == 1"
|
||||
style="padding: 0; margin-right: 10px; margin-left: 0"
|
||||
type="primary"
|
||||
text
|
||||
@click="handleNotice(row)"
|
||||
>
|
||||
催办
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.creator == currentUserId && row.completeStatus == 1"
|
||||
style="padding: 0; margin-right: 10px; margin-left: 0"
|
||||
type="primary"
|
||||
text
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.creator == currentUserId && row.completeStatus == 1"
|
||||
style="padding: 0; margin-right: 10px; margin-left: 0"
|
||||
type="danger"
|
||||
text
|
||||
@click="handleDelete(row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<DialogWait ref="waitDialogRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="WaitTarget">
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import DialogWait from './Components/DialogWait.vue'
|
||||
|
||||
import { getWaitPage, deleteWait, getWaitCount, urgeWait } from '@/api/okr/wait'
|
||||
|
||||
const route = useRoute()
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const searchForm = ref({
|
||||
title: undefined,
|
||||
completeStatus: undefined,
|
||||
priority: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
})
|
||||
|
||||
const statusOptions = [
|
||||
{ label: '未完成', value: 1, tagType: 'warning' },
|
||||
{ label: '已关闭', value: 2, tagType: 'success' }
|
||||
]
|
||||
|
||||
const statusFilter = (status) => {
|
||||
return statusOptions.find((item) => item.value == status)?.tagType
|
||||
}
|
||||
|
||||
const statusNameFilter = (status) => {
|
||||
return statusOptions.find((item) => item.value == status)?.label
|
||||
}
|
||||
|
||||
const priorityOptions = [
|
||||
{ label: '高', value: '1', tagType: 'danger' },
|
||||
{ label: '中', value: '2', tagType: 'warning' },
|
||||
{ label: '低', value: '3', tagType: 'info' }
|
||||
]
|
||||
|
||||
const priorityFilter = (priority) => {
|
||||
return priorityOptions.find((item) => item.value == priority)?.tagType
|
||||
}
|
||||
|
||||
const priorityNameFilter = (priority) => {
|
||||
return priorityOptions.find((item) => item.value == priority)?.label
|
||||
}
|
||||
|
||||
const tabIndex = ref(1)
|
||||
|
||||
onMounted(() => {
|
||||
if (route?.query?.type) {
|
||||
tabIndex.value = Number(route.query.type)
|
||||
} else {
|
||||
tabIndex.value = 1
|
||||
}
|
||||
searchList()
|
||||
})
|
||||
|
||||
function searchList() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const tabCount = ref({
|
||||
dayEndAgentWorkNum: 0,
|
||||
myAgentWorkNum: 0,
|
||||
urgeAgentWorkNum: 0,
|
||||
notifyNum: 0
|
||||
})
|
||||
function getTabCount() {
|
||||
getWaitCount({
|
||||
title: searchForm.value.title,
|
||||
priority: searchForm.value.priority
|
||||
}).then((res) => {
|
||||
tabCount.value = res
|
||||
})
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
// const mentionedList = ref([])
|
||||
const total = ref(0)
|
||||
function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
searchForm.value.queryType = tabIndex.value
|
||||
getWaitPage(searchForm.value).then((res) => {
|
||||
tableList.value = res.list
|
||||
total.value = res.total
|
||||
loading.value = false
|
||||
})
|
||||
getTabCount()
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
function handleDo(row) {
|
||||
waitDialogRef.value.open('do', row.workId)
|
||||
}
|
||||
|
||||
const waitDialogRef = ref()
|
||||
function handleAdd() {
|
||||
waitDialogRef.value.open('create')
|
||||
}
|
||||
|
||||
function handleEdit(row) {
|
||||
waitDialogRef.value.open('update', row.workId)
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
message.confirm('确定删除待办事项吗?').then(() => {
|
||||
deleteWait(row.workId).then(() => {
|
||||
message.success('删除成功')
|
||||
getList()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function handleNotice(row) {
|
||||
message.confirm('即将发送微信通知提醒执行人,是否继续?').then(() => {
|
||||
urgeWait(row.workId).then(() => {
|
||||
message.success('发送成功')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// function handleShow(row) {
|
||||
// console.log(row)
|
||||
// message.success('打开okr详情页')
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -5,7 +5,7 @@
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@@ -16,8 +16,8 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :label="1"> 男 </el-radio>
|
||||
<el-radio :label="2"> 女 </el-radio>
|
||||
<el-radio :value="1"> 男 </el-radio>
|
||||
<el-radio :value="2"> 女 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -25,7 +25,14 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="组织部门" prop="dept">
|
||||
<el-input v-model="formData.dept" placeholder="请输入部门" />
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptList"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -69,8 +76,9 @@
|
||||
<el-form-item label="开通系统" prop="instanceIds">
|
||||
<el-select
|
||||
v-model="formData.instanceIds"
|
||||
placeholder="选择考勤方案"
|
||||
placeholder="选择开通系统"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
@@ -126,12 +134,52 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="钉钉手机号">
|
||||
<el-input
|
||||
v-model="formData.ddPhone"
|
||||
placeholder="请输入钉钉手机号"
|
||||
clearable
|
||||
@blur="getDingdingUserId"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="钉钉Id" prop="dingUserId">
|
||||
<el-input v-model="formData.dingUserId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="微信号" prop="wxAlias">
|
||||
<el-input v-model="formData.wxAlias" placeholder="请输入微信号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="绩效考核人" prop="meritsExamineUserList">
|
||||
<el-select
|
||||
v-model="formData.meritsExamineUserList"
|
||||
placeholder="选择绩效考核人"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
>
|
||||
<el-option
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:disabled="item.status == 1"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" />
|
||||
@@ -148,8 +196,10 @@
|
||||
<script name="DialogEmployee" setup>
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { getPlanSimpleList } from '@/api/pers/attendancePlan'
|
||||
import { getSimpleAppList } from '@/api/system/app'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
|
||||
import * as EmployeeApi from '@/api/pers/employee'
|
||||
|
||||
@@ -176,6 +226,9 @@ const formRules = ref({
|
||||
const formRef = ref() // 表单 Ref
|
||||
const attendanceSettingIdOptions = ref([])
|
||||
const instanceIdsOptions = ref([])
|
||||
const employeeOptions = ref([])
|
||||
|
||||
const deptList = ref([])
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type, id) => {
|
||||
@@ -192,6 +245,7 @@ const open = async (type, id) => {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList({ allFlag: true }))
|
||||
getOptions()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
@@ -203,6 +257,9 @@ function getOptions() {
|
||||
getPlanSimpleList().then((data) => {
|
||||
attendanceSettingIdOptions.value = data
|
||||
})
|
||||
EmployeeApi.getEmployeeSimpleList().then((data) => {
|
||||
employeeOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
@@ -249,8 +306,21 @@ const resetForm = () => {
|
||||
retireDate: undefined,
|
||||
attendanceSettingId: undefined,
|
||||
instanceIds: [],
|
||||
wxAlias: ''
|
||||
wxAlias: '',
|
||||
meritsExamineUserList: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
async function getDingdingUserId() {
|
||||
try {
|
||||
if (!formData.value.ddPhone) {
|
||||
formData.value.dingUserId = undefined
|
||||
return
|
||||
}
|
||||
const data = await EmployeeApi.getDingUserId({ mobile: formData.value.ddPhone })
|
||||
formData.value.dingUserId = data
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.status" @change="handleQuery">
|
||||
<el-radio :label="0"> 在职 </el-radio>
|
||||
<el-radio :label="1"> 离职 </el-radio>
|
||||
<el-radio :value="0"> 在职 </el-radio>
|
||||
<el-radio :value="1"> 离职 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -36,6 +36,7 @@
|
||||
<el-table-column label="微信号" prop="wxAlias" min-width="120" />
|
||||
<el-table-column label="钉钉号" prop="dingUserId" min-width="120" />
|
||||
<el-table-column label="考勤方案" prop="attendanceSettingName" width="100" />
|
||||
<el-table-column label="绩效考核人" prop="meritsExamineUserNames" width="120" />
|
||||
<el-table-column label="已开通系统" prop="instanceName" min-width="120" />
|
||||
<el-table-column label="在职状态" key="status" width="150">
|
||||
<template #default="scope">
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
<el-tab-pane :label="t('profile.info.resetPwd')" name="resetPwd">
|
||||
<ResetPwd />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="t('profile.info.userSocial')" name="userSocial">
|
||||
<!-- <el-tab-pane :label="t('profile.info.userSocial')" name="userSocial">
|
||||
<UserSocial />
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts" name="Profile">
|
||||
import { BasicInfo, ProfileUser, ResetPwd, UserSocial } from './components/'
|
||||
import { BasicInfo, ProfileUser, ResetPwd } from './components/'
|
||||
const { t } = useI18n()
|
||||
|
||||
const activeName = ref('basicInfo')
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<Form ref="formRef" :labelWidth="80" :rules="rules" :schema="schema">
|
||||
<template #sex="form">
|
||||
<el-radio-group v-model="form['sex']">
|
||||
<el-radio :label="1">{{ t('profile.user.man') }}</el-radio>
|
||||
<el-radio :label="2">{{ t('profile.user.woman') }}</el-radio>
|
||||
<el-radio :value="1">{{ t('profile.user.man') }}</el-radio>
|
||||
<el-radio :value="2">{{ t('profile.user.woman') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</Form>
|
||||
@@ -26,14 +26,14 @@ const { t } = useI18n()
|
||||
// 表单校验
|
||||
const rules = reactive<FormRules>({
|
||||
nickname: [{ required: true, message: t('profile.rules.nickname'), trigger: 'blur' }],
|
||||
email: [
|
||||
{ required: true, message: t('profile.rules.mail'), trigger: 'blur' },
|
||||
{
|
||||
type: 'email',
|
||||
message: t('profile.rules.truemail'),
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
// email: [
|
||||
// { required: true, message: t('profile.rules.mail'), trigger: 'blur' },
|
||||
// {
|
||||
// type: 'email',
|
||||
// message: t('profile.rules.truemail'),
|
||||
// trigger: ['blur', 'change']
|
||||
// }
|
||||
// ],
|
||||
mobile: [
|
||||
{ required: true, message: t('profile.rules.phone'), trigger: 'blur' },
|
||||
{
|
||||
@@ -59,6 +59,11 @@ const schema = reactive<FormSchema[]>([
|
||||
label: t('profile.user.email'),
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'wxAlias',
|
||||
label: '微信号',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
label: t('profile.user.sex'),
|
||||
|
||||
93
yarn.lock
@@ -1227,7 +1227,7 @@
|
||||
resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz#b6c75a56a1947cc916ea058772d666a2c8932f31"
|
||||
integrity sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==
|
||||
|
||||
"@element-plus/icons-vue@^2.0.6", "@element-plus/icons-vue@^2.1.0":
|
||||
"@element-plus/icons-vue@^2.1.0", "@element-plus/icons-vue@^2.3.1":
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz#1f635ad5fdd5c85ed936481525570e82b5a8307a"
|
||||
integrity sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==
|
||||
@@ -1374,25 +1374,25 @@
|
||||
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f"
|
||||
integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==
|
||||
|
||||
"@floating-ui/core@^1.0.0":
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.0.tgz#fa41b87812a16bf123122bf945946bae3fdf7fc1"
|
||||
integrity sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==
|
||||
"@floating-ui/core@^1.6.0":
|
||||
version "1.6.9"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.9.tgz#64d1da251433019dafa091de9b2886ff35ec14e6"
|
||||
integrity sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw==
|
||||
dependencies:
|
||||
"@floating-ui/utils" "^0.2.1"
|
||||
"@floating-ui/utils" "^0.2.9"
|
||||
|
||||
"@floating-ui/dom@^1.0.1":
|
||||
version "1.6.3"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.3.tgz#954e46c1dd3ad48e49db9ada7218b0985cee75ef"
|
||||
integrity sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==
|
||||
version "1.6.13"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.13.tgz#a8a938532aea27a95121ec16e667a7cbe8c59e34"
|
||||
integrity sha512-umqzocjDgNRGTuO7Q8CU32dkHkECqI8ZdMZ5Swb6QAM0t5rnlrN3lGo1hdpscRd3WS8T6DKYK4ephgIH9iRh3w==
|
||||
dependencies:
|
||||
"@floating-ui/core" "^1.0.0"
|
||||
"@floating-ui/utils" "^0.2.0"
|
||||
"@floating-ui/core" "^1.6.0"
|
||||
"@floating-ui/utils" "^0.2.9"
|
||||
|
||||
"@floating-ui/utils@^0.2.0", "@floating-ui/utils@^0.2.1":
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2"
|
||||
integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==
|
||||
"@floating-ui/utils@^0.2.9":
|
||||
version "0.2.9"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.9.tgz#50dea3616bc8191fb8e112283b49eaff03e78429"
|
||||
integrity sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==
|
||||
|
||||
"@form-create/component-elm-checkbox@^3.1.29":
|
||||
version "3.1.29"
|
||||
@@ -1901,9 +1901,9 @@
|
||||
"@types/lodash" "*"
|
||||
|
||||
"@types/lodash@*", "@types/lodash@^4.14.182":
|
||||
version "4.17.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.0.tgz#d774355e41f372d5350a4d0714abb48194a489c3"
|
||||
integrity sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==
|
||||
version "4.17.16"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.16.tgz#94ae78fab4a38d73086e962d0b65c30d816bfb0a"
|
||||
integrity sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==
|
||||
|
||||
"@types/minimist@^1.2.0", "@types/minimist@^1.2.2":
|
||||
version "1.2.5"
|
||||
@@ -2502,6 +2502,13 @@
|
||||
resolved "https://registry.yarnpkg.com/@wangeditor/list-module/-/list-module-1.0.5.tgz#3fc0b167acddf885536b45fa0c127f9c6adaea33"
|
||||
integrity sha512-uDuYTP6DVhcYf7mF1pTlmNn5jOb4QtcVhYwSSAkyg09zqxI1qBqsfUnveeDeDqIuptSJhkh81cyxi+MF8sEPOQ==
|
||||
|
||||
"@wangeditor/plugin-upload-attachment@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@wangeditor/plugin-upload-attachment/-/plugin-upload-attachment-1.1.0.tgz#a014de72703a9f3d5ae44a428ac01406640ac80a"
|
||||
integrity sha512-K6SsV3Cv1g+Ob1xjRRQ13Sh3lcj3yAa/aXMaKKbaPI76rNZiOpyAGH/iVv5i9enmwbZql01IXpvhK+HtrikVyQ==
|
||||
dependencies:
|
||||
dom7 "^4.0.4"
|
||||
|
||||
"@wangeditor/table-module@^1.1.4":
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/@wangeditor/table-module/-/table-module-1.1.4.tgz#757d4a5868b2b658041cd323854a4d707c8347e9"
|
||||
@@ -3362,6 +3369,11 @@ core-js@^3.31.1:
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.36.1.tgz#c97a7160ebd00b2de19e62f4bbd3406ab720e578"
|
||||
integrity sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA==
|
||||
|
||||
core-js@^3.6.5:
|
||||
version "3.40.0"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.40.0.tgz#2773f6b06877d8eda102fc42f828176437062476"
|
||||
integrity sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==
|
||||
|
||||
cors@^2.8.5:
|
||||
version "2.8.5"
|
||||
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
|
||||
@@ -3515,7 +3527,12 @@ data-view-byte-offset@^1.0.0:
|
||||
es-errors "^1.3.0"
|
||||
is-data-view "^1.0.1"
|
||||
|
||||
dayjs@^1.11.3, dayjs@^1.11.7:
|
||||
dayjs@^1.11.13:
|
||||
version "1.11.13"
|
||||
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c"
|
||||
integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
|
||||
|
||||
dayjs@^1.11.7:
|
||||
version "1.11.10"
|
||||
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0"
|
||||
integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
|
||||
@@ -3723,6 +3740,13 @@ dom7@^3.0.0:
|
||||
dependencies:
|
||||
ssr-window "^3.0.0-alpha.1"
|
||||
|
||||
dom7@^4.0.4:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/dom7/-/dom7-4.0.6.tgz#091a51621d7a19ce0fb86045cafb3c10035e97ed"
|
||||
integrity sha512-emjdpPLhpNubapLFdjNL9tP06Sr+GZkrIHEXLWvOGsytACUrkbeIdjO5g77m00BrHTznnlcNqgmn7pCN192TBA==
|
||||
dependencies:
|
||||
ssr-window "^4.0.0"
|
||||
|
||||
domelementtype@1, domelementtype@^1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
|
||||
@@ -3827,20 +3851,20 @@ electron-to-chromium@^1.4.668:
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.736.tgz#ecb4348f4d5c70fb1e31c347e5bad6b751066416"
|
||||
integrity sha512-Rer6wc3ynLelKNM4lOCg7/zPQj8tPOCB2hzD32PX9wd3hgRRi9MxEbmkFCokzcEhRVMiOVLjnL9ig9cefJ+6+Q==
|
||||
|
||||
element-plus@2.3.4:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-2.3.4.tgz#4319f6b0a1096cfac9c53b69da2fe23ac5aea63e"
|
||||
integrity sha512-SQr0J9z7N4z48WYk/l9NE2tizl8Q7j2OhqlpTc42k4pGncry3+rVX6dsmcsglFynn6vt3NzYxWJqmLFyDKQq+g==
|
||||
element-plus@2.9.4:
|
||||
version "2.9.4"
|
||||
resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-2.9.4.tgz#e4b75055f0f1b1c1f33186321eb3d7a6424051e5"
|
||||
integrity sha512-sGnW0wd9zf6lEGixXV2gfwx3X6VTMkP52qTkX7zbURJ2oariyslrKTBh2txt1sdn1pUvj2l0KY3OfSXoZGmDOw==
|
||||
dependencies:
|
||||
"@ctrl/tinycolor" "^3.4.1"
|
||||
"@element-plus/icons-vue" "^2.0.6"
|
||||
"@element-plus/icons-vue" "^2.3.1"
|
||||
"@floating-ui/dom" "^1.0.1"
|
||||
"@popperjs/core" "npm:@sxzz/popperjs-es@^2.11.7"
|
||||
"@types/lodash" "^4.14.182"
|
||||
"@types/lodash-es" "^4.17.6"
|
||||
"@vueuse/core" "^9.1.0"
|
||||
async-validator "^4.2.5"
|
||||
dayjs "^1.11.3"
|
||||
dayjs "^1.11.13"
|
||||
escape-html "^1.0.3"
|
||||
lodash "^4.17.21"
|
||||
lodash-es "^4.17.21"
|
||||
@@ -7235,6 +7259,11 @@ ssr-window@^3.0.0-alpha.1:
|
||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-3.0.0.tgz#fd5b82801638943e0cc704c4691801435af7ac37"
|
||||
integrity sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==
|
||||
|
||||
ssr-window@^4.0.0:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be"
|
||||
integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==
|
||||
|
||||
stable@^0.1.8:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf"
|
||||
@@ -8149,7 +8178,12 @@ vue-amap@^0.5.10:
|
||||
dependencies:
|
||||
uppercamelcase "^1.1.0"
|
||||
|
||||
vue-demi@*, vue-demi@>=0.14.5, vue-demi@>=0.14.7:
|
||||
vue-demi@*:
|
||||
version "0.14.10"
|
||||
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.10.tgz#afc78de3d6f9e11bf78c55e8510ee12814522f04"
|
||||
integrity sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==
|
||||
|
||||
vue-demi@>=0.14.5, vue-demi@>=0.14.7:
|
||||
version "0.14.7"
|
||||
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.7.tgz#8317536b3ef74c5b09f268f7782e70194567d8f2"
|
||||
integrity sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==
|
||||
@@ -8215,6 +8249,13 @@ vue-types@^5.0.3:
|
||||
dependencies:
|
||||
is-plain-object "5.0.0"
|
||||
|
||||
vue3-tree-org@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/vue3-tree-org/-/vue3-tree-org-4.2.2.tgz#6b711dc6e7c5aac99d9b7ff169a432435080cb4b"
|
||||
integrity sha512-AG2SykyD6dw0jIyqBm8iuF9j9GWli6KrwudxR1RjULCCBTDFsoNm7MmP/weKT7wowN/sPk+e2RsnvEJMw2OJMw==
|
||||
dependencies:
|
||||
core-js "^3.6.5"
|
||||
|
||||
vue@3.3.4:
|
||||
version "3.3.4"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.4.tgz#8ed945d3873667df1d0fcf3b2463ada028f88bd6"
|
||||
|
||||