From b15e0d0f8f92a13f3f2e665b6595040946941a3f Mon Sep 17 00:00:00 2001 From: qsh <> Date: Thu, 29 May 2025 16:18:18 +0800 Subject: [PATCH] sc --- src/api/okr/okr.js | 9 + src/router/modules/static.ts | 26 ++ src/styles/index.scss | 9 + src/utils/tableObjectSpanMethod.js | 80 ---- src/views/Home/Index.vue | 95 ++++- src/views/OKR/Analysis/index.vue | 381 +++++++++++++++++- .../OKR/Management/Components/DialogOkr.vue | 19 +- .../Management/Components/DialogOkrInfo.vue | 9 +- src/views/OKR/Wait/index.vue | 20 +- 9 files changed, 542 insertions(+), 106 deletions(-) delete mode 100644 src/utils/tableObjectSpanMethod.js diff --git a/src/api/okr/okr.js b/src/api/okr/okr.js index 09edcd4..46b2619 100644 --- a/src/api/okr/okr.js +++ b/src/api/okr/okr.js @@ -143,3 +143,12 @@ export const getChannelOptions = () => { // headers: { 'instance-id': 1016 } }) } + +// 获取统计表中的合计信息 +export const getOkrStatisticsTotal = (params) => { + return request.get({ + url: '/admin-api/okr/node/data/count', + params + // headers: { 'instance-id': 1016 } + }) +} diff --git a/src/router/modules/static.ts b/src/router/modules/static.ts index e33943f..0faa34c 100644 --- a/src/router/modules/static.ts +++ b/src/router/modules/static.ts @@ -35,7 +35,33 @@ const staticRouter: AppCustomRouteRecordRaw[] = [ 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-metting', + // name: '会议管理', + // componentName: 'OkrMetting', + // component: 'OKR/Meeting/index', + // meta: { + // title: '会议管理' + // }, + // visible: true, + // alwaysShow: true, + // redirect: '' + // } ], meta: { title: 'OKR', diff --git a/src/styles/index.scss b/src/styles/index.scss index f4e9f17..318e27f 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -97,4 +97,13 @@ /* 去除 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; } \ No newline at end of file diff --git a/src/utils/tableObjectSpanMethod.js b/src/utils/tableObjectSpanMethod.js deleted file mode 100644 index 2dabd28..0000000 --- a/src/utils/tableObjectSpanMethod.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @Author: River_qiu - * @Date: 2021/11/18 - */ -// 表格单元格合并多列 -let [spanObj, pos] = [{}, {}] -//spanObj 存储每个key 对应的合并值 -//pos 存储的是 key合并值得索引 大概吧 -export const dataMethod = (data, isH, allColumns = []) => { - //循环数据(行) - for (let i in data) { - let dataI = data[i] - //循环数据内对象,查看有多少key - if (allColumns.length > 0) { - let preProp = undefined - // dataI.historyValue = - // 循环列数据 - for (let index = 0; index < allColumns.length; index++) { - let j = allColumns[index] - if (i == 0) { - // 第一行,每列至少展示1行 - spanObj[j] = [1] - pos[j] = 0 - } else { - if (index == 0) { - data[i].historyValue = '' - data[i - 1].historyValue = '' - } else { - data[i].historyValue += data[i][preProp] - data[i - 1].historyValue += data[i - 1][preProp] - } - // e: 当前行数据,k:上一行数据 - let [e, k] = [dataI, data[i - 1]] - // 判断上一行数据是否存在 - // 空数据不合并 - // 前一列值相同并且不为空或者为第一列 - // 存在当前的列的值与上一行是否一样 - // 判断是否有数组规定只允许那几列需要合并单元格的 - if ( - k && - e[j] && - (!preProp || (e.historyValue && e.historyValue == k.historyValue)) && - e[j] == k[j] && - (!isH || isH.length == 0 || isH.includes(j)) - ) { - //如果上一级和当前一级相当,数组就加1 数组后面就添加一个0 - spanObj[j][pos[j]] += 1 - spanObj[j].push(0) - } else { - spanObj[j].push(1) - pos[j] = i - } - preProp = j - } - } - } else { - for (let j in dataI) { - //如果只有一条数据时默认为1即可,无需合并 - if (i == 0) { - spanObj[j] = [1] - pos[j] = 0 - } else { - let [e, k] = [dataI, data[i - 1]] - //判断上一级别是否存在 , - //存在当前的key是否和上级别的key是否一样 - //判断是否有数组规定只允许那几列需要合并单元格的 - if (k && e[j] && k[j] && e[j] == k[j] && (!isH || isH.length == 0 || isH.includes(j))) { - //如果上一级和当前一级相当,数组就加1 数组后面就添加一个0 - spanObj[j][pos[j]] += 1 - spanObj[j].push(0) - } else { - spanObj[j].push(1) - pos[j] = i - } - } - } - } - } - return spanObj -} diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index 7beecf8..65b9205 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -1,7 +1,96 @@ - 首页 + + + + + + + + + {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }} + + + + + + + 今日待办 + + + + + 我的待办 + + + + + + + + + +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 - +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() +}) + + + diff --git a/src/views/OKR/Analysis/index.vue b/src/views/OKR/Analysis/index.vue index 3b8d285..3bed8cf 100644 --- a/src/views/OKR/Analysis/index.vue +++ b/src/views/OKR/Analysis/index.vue @@ -1,6 +1,6 @@ - + + + + 数据汇总 + + + + + + + + + + + + + 节点笔谈 + + - + {{ row.objectInfo.objectiveName }} @@ -69,13 +102,178 @@ + + + + + + + + + 取消 + + 发布 + + + + + + + + + 新增 + + + + + + {{ it.creatorName.slice(-2) }} + + {{ it.creatorName }} + + + + + + + + + + {{ it.likeCount }} + + + + + + {{ it.commentCount }} + + + + {{ formatDate(it.createTime, 'YYYY-MM-DD HH:mm') }} + + + + + + {{ subComment.creatorName }}: + + {{ subComment.content }} + + + + + + + + {{ scope.item.name }} + {{ scope.item.dept }} + + + + + 发布 + + + + + + + + - + diff --git a/src/views/OKR/Management/Components/DialogOkr.vue b/src/views/OKR/Management/Components/DialogOkr.vue index cabb65c..05a9d0a 100644 --- a/src/views/OKR/Management/Components/DialogOkr.vue +++ b/src/views/OKR/Management/Components/DialogOkr.vue @@ -143,7 +143,7 @@ - + @@ -178,7 +178,7 @@ - 新增评论 + 新增笔谈 @@ -492,19 +492,20 @@ function handleSaveComment() { 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('评论成功') + message.success('笔谈成功') searchCommentList() }) .finally(() => { form.value.commentValue = '' }) } catch (error) { - message.error('评论失败') + message.error('笔谈失败') } } const commentList = ref([]) @@ -552,20 +553,22 @@ function handleSendCommnet(idx) { 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('评论成功') + message.success('创建成功') searchCommentList() }) .finally(() => { form.value.commentValue = '' }) } catch (error) { - message.error('评论失败') + console.log(error) + message.error('创建失败') } } diff --git a/src/views/OKR/Management/Components/DialogOkrInfo.vue b/src/views/OKR/Management/Components/DialogOkrInfo.vue index 2dc6422..e999d29 100644 --- a/src/views/OKR/Management/Components/DialogOkrInfo.vue +++ b/src/views/OKR/Management/Components/DialogOkrInfo.vue @@ -1,7 +1,7 @@ + + 参与统计 + 不参与统计 + @@ -477,7 +481,8 @@ function AddKR(idx) { process: undefined, currentValue: undefined, executor: obj.executor, - dataScope: obj.dataScope + dataScope: obj.dataScope, + isCount: false }) } diff --git a/src/views/OKR/Wait/index.vue b/src/views/OKR/Wait/index.vue index 44e1545..188fe12 100644 --- a/src/views/OKR/Wait/index.vue +++ b/src/views/OKR/Wait/index.vue @@ -63,7 +63,7 @@ - + @@ -169,6 +169,7 @@ 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 @@ -212,6 +213,11 @@ const priorityNameFilter = (priority) => { const tabIndex = ref(1) onMounted(() => { + if (route?.query?.type) { + tabIndex.value = Number(route.query.type) + } else { + tabIndex.value = 1 + } searchList() }) @@ -237,7 +243,7 @@ function getTabCount() { const loading = ref(false) const tableList = ref([]) -const mentionedList = ref([]) +// const mentionedList = ref([]) const total = ref(0) function getList() { loading.value = true @@ -282,10 +288,10 @@ function handleNotice(row) { }) } -function handleShow(row) { - console.log(row) - message.success('打开okr详情页') -} +// function handleShow(row) { +// console.log(row) +// message.success('打开okr详情页') +// }