diff --git a/package.json b/package.json index b5d033c..eac52df 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,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", diff --git a/src/api/okr/okr.js b/src/api/okr/okr.js new file mode 100644 index 0000000..2798975 --- /dev/null +++ b/src/api/okr/okr.js @@ -0,0 +1,65 @@ +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 = (nodeId) => { + return request.get({ + url: '/admin-api/okr/node/get', + params: { nodeId }, + 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 } + }) +} diff --git a/src/api/okr/wait.js b/src/api/okr/wait.js new file mode 100644 index 0000000..2431c03 --- /dev/null +++ b/src/api/okr/wait.js @@ -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 } + }) +} diff --git a/src/components/Crontab/src/Crontab.vue b/src/components/Crontab/src/Crontab.vue index 13096f7..d8e4eaa 100644 --- a/src/components/Crontab/src/Crontab.vue +++ b/src/components/Crontab/src/Crontab.vue @@ -542,10 +542,10 @@ const submit = () => { - 任意值 - 范围 - 间隔 - 指定 + 任意值 + 范围 + 间隔 + 指定 @@ -601,10 +601,10 @@ const submit = () => { - 任意值 - 范围 - 间隔 - 指定 + 任意值 + 范围 + 间隔 + 指定 @@ -660,10 +660,10 @@ const submit = () => { - 任意值 - 范围 - 间隔 - 指定 + 任意值 + 范围 + 间隔 + 指定 @@ -719,12 +719,12 @@ const submit = () => { - 任意值 - 范围 - 间隔 - 指定 - 本月最后一天 - 不指定 + 任意值 + 范围 + 间隔 + 指定 + 本月最后一天 + 不指定 @@ -780,10 +780,10 @@ const submit = () => { - 任意值 - 范围 - 间隔 - 指定 + 任意值 + 范围 + 间隔 + 指定 @@ -840,12 +840,12 @@ const submit = () => { - 任意值 - 范围 - 间隔 - 指定 - 本月最后一周 - 不指定 + 任意值 + 范围 + 间隔 + 指定 + 本月最后一周 + 不指定 @@ -919,11 +919,11 @@ const submit = () => { - 忽略 - 任意值 - 范围 - 间隔 - 指定 + 忽略 + 任意值 + 范围 + 间隔 + 指定 diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index ad9f6cf..7587f1f 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -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 } }) diff --git a/src/config/axios/index.ts b/src/config/axios/index.ts index f857d5a..f0687f6 100644 --- a/src/config/axios/index.ts +++ b/src/config/axios/index.ts @@ -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 } }) } diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 3009121..d49464d 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -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 diff --git a/src/views/Basic/Dept/DeptForm.vue b/src/views/Basic/Dept/DeptForm.vue index 9f61981..fdccab9 100644 --- a/src/views/Basic/Dept/DeptForm.vue +++ b/src/views/Basic/Dept/DeptForm.vue @@ -43,8 +43,8 @@ - 启用 - 禁用 + 启用 + 禁用 diff --git a/src/views/Basic/Menu/MenuForm.vue b/src/views/Basic/Menu/MenuForm.vue index 6bc0346..a01fd5a 100644 --- a/src/views/Basic/Menu/MenuForm.vue +++ b/src/views/Basic/Menu/MenuForm.vue @@ -32,9 +32,9 @@ - 目录 - 菜单 - 按钮 + 目录 + 菜单 + 按钮 @@ -69,8 +69,8 @@ - 启用 - 禁用 + 启用 + 禁用 diff --git a/src/views/Basic/User/UserForm.vue b/src/views/Basic/User/UserForm.vue index a745737..4a6c70a 100644 --- a/src/views/Basic/User/UserForm.vue +++ b/src/views/Basic/User/UserForm.vue @@ -16,8 +16,8 @@ - - + + diff --git a/src/views/Finance/Commission/Comp/DialogPlan.vue b/src/views/Finance/Commission/Comp/DialogPlan.vue index 2007de8..9a27449 100644 --- a/src/views/Finance/Commission/Comp/DialogPlan.vue +++ b/src/views/Finance/Commission/Comp/DialogPlan.vue @@ -17,10 +17,10 @@ - + 阶梯结算 - + 常规结算 @@ -164,8 +164,8 @@ - - + + @@ -174,24 +174,24 @@ - - + + - - + + - - + + diff --git a/src/views/Finance/Salary/index.vue b/src/views/Finance/Salary/index.vue index 5dcff1f..8a86667 100644 --- a/src/views/Finance/Salary/index.vue +++ b/src/views/Finance/Salary/index.vue @@ -11,8 +11,8 @@ - 在职 - 离职 + 在职 + 离职 diff --git a/src/views/OKR/Management/Components/AllTarget.vue b/src/views/OKR/Management/Components/AllTarget.vue index e3ba603..2b0ae3f 100644 --- a/src/views/OKR/Management/Components/AllTarget.vue +++ b/src/views/OKR/Management/Components/AllTarget.vue @@ -2,42 +2,26 @@
- - -
-
- - - - - - - -
-
-
+ 新建节点
- + 修改当前节点 更新进度
- +
@@ -48,161 +32,46 @@ import OkrTable from './OkrTable.vue' import DialogOkrInfo from './DialogOkrInfo.vue' import DialogOkr from './DialogOkr.vue' +import { getAllNodeTree, getAllOkrPage } from '@/api/okr/okr' +import { listToTree } from '@/utils/tree' + const message = useMessage() +const defaultProps = { + value: 'nodeId', + label: 'nodeName', + children: 'children' +} + const okrTableRef = ref(null) const searchForm = ref({ - peroidName: '', - peroidId: null + nodeId: undefined }) const peroidList = ref([]) onMounted(() => { handleSearchPeroid() - if (!searchForm.value.peroidId && peroidList.value.length) { - searchForm.value.peroidId = peroidList.value[0].id - searchForm.value.peroidName = peroidList.value[0].name - } - getOkrList() }) -async function handleSearchPeroid() { - peroidList.value = [ - { - id: 1, - name: '2025年寻驾okr', - startDate: '2022-01-01', - endDate: '2022-01-31' - }, - { - id: 2, - name: '2024年寻驾okr', - startDate: '2022-02-01', - endDate: '2022-02-28' - } - ] -} - -function handleSelectPeroid(row) { - searchForm.value.peroidName = row.name - searchForm.value.peroidId = row.id - handleSearchOkr() -} - -function handleSearchOkr() { - console.log(searchForm.value) +function handleSearchPeroid() { + getAllNodeTree().then((resp) => { + peroidList.value = listToTree(resp.tree, { + id: 'nodeId', + pid: 'parentId', + children: 'children' + }) + searchForm.value.nodeId = resp.nodeId + getOkrList() + }) } -async function getOkrList() { - const list = [ - { - id: 1, - name: '销售成交额达到1000万,总体成交率15%', - process: 60, - type: 'object', - children: [ - { - id: 11, - type: 'keyresult', - channelName: '抖音', - target: '线索目标', - targetType: 'value', - isSystem: true, - targetNum: 10000, - targetValue: false, - currentNum: 5000, - currentValue: false, - process: 60, - users: '张三、李四' - }, - { - id: 12, - type: 'keyresult', - channelName: '抖音', - target: '成交数', - isSystem: true, - targetType: 'value', - targetNum: 2500, - targetValue: false, - currentNum: 500, - currentValue: false, - process: 60, - users: '张三、李四' - } - ] - }, - { - id: 2, - name: '运营消耗预算控制在20万以内,获得10万条线索', - process: 80, - type: 'object', - children: [ - { - id: 21, - type: 'keyresult', - target: '本月抖音运营投入相较上月少10%', - targetType: 'radio', - isSystem: false, - targetNum: 0, - targetValue: false, - currentNum: 0, - currentValue: false, - process: 0, - users: '' - }, - { - id: 22, - type: 'keyresult', - target: '累计输出作品', - process: 15, - users: '', - isSystem: false, - targetType: 'value', - targetNum: 200, - targetValue: false, - currentNum: 30, - currentValue: false - } - ] - }, - { - id: 3, - name: '目标3', - process: 40, - type: 'object', - children: [ - { - id: 31, - type: 'keyresult', - target: '关键成果1', - process: 100, - users: '', - isSystem: false, - targetType: 'radio', - targetNum: 0, - targetValue: false, - currentNum: 0, - currentValue: true - }, - { - id: 22, - type: 'keyresult', - target: '关键成果2', - process: 15, - users: '', - isSystem: false, - targetType: 'value', - targetNum: 200, - targetValue: false, - currentNum: 30, - currentValue: false - } - ] - } - ] - nextTick(() => { - okrTableRef.value.prepareData(list) +function getOkrList() { + getAllOkrPage(searchForm.value).then((resp) => { + const list = resp + nextTick(() => { + okrTableRef.value.prepareData(list) + }) }) } @@ -213,7 +82,7 @@ function handleAddNode() { function handleEditOkr() { dialogOkr.value.close() - dialogOkrInfo.value.open('update', 1) + dialogOkrInfo.value.open('update', searchForm.value.nodeId) } function handleUpdateProcess() { @@ -222,9 +91,9 @@ function handleUpdateProcess() { } const dialogOkr = ref(null) -function handleShowOkr(row) { - dialogOkr.value.open(row.id) -} +// function handleShowOkr(row) { +// dialogOkr.value.open(row.id) +// }