莳松-行政管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-oa-manage-web/src/views/OKR/Management/Components/MyDuty.vue

109 lines
2.4 KiB

4 months ago
<template>
<div>
<div class="flex items-center justify-between">
<el-row>
3 months ago
<el-tree-select
v-model="searchForm.nodeId"
:data="peroidList"
:props="defaultProps"
:render-after-expand="false"
3 months ago
:default-expand-all="false"
3 months ago
style="width: 400px"
3 months ago
@change="getOkrList"
3 months ago
/>
4 months ago
</el-row>
<el-row>
2 months ago
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
4 months ago
<el-button type="success" @click="handleUpdateProcess">更新进度</el-button>
</el-row>
</div>
2 months ago
<OkrTable ref="okrTableRef" canEdit />
4 months ago
<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'
3 months ago
import { listToTree } from '@/utils/tree'
import { getMyNodeTree, getMyOkrPage } from '@/api/okr/okr'
4 months ago
const message = useMessage()
3 months ago
const defaultProps = {
value: 'nodeId',
label: 'nodeName',
children: 'children'
}
4 months ago
const okrTableRef = ref(null)
const searchForm = ref({
3 months ago
nodeId: undefined
4 months ago
})
const peroidList = ref([])
2 months ago
// onMounted(() => {
handleSearchPeroid()
// })
4 months ago
2 months ago
function handleSearchPeroid() {
3 months ago
getMyNodeTree().then((resp) => {
peroidList.value = listToTree(resp.tree, {
id: 'nodeId',
pid: 'parentId',
children: 'children'
})
searchForm.value.nodeId = resp.nodeId
getOkrList()
})
4 months ago
}
2 months ago
function getOkrList() {
3 months ago
getMyOkrPage(searchForm.value).then((resp) => {
const list = resp
nextTick(() => {
okrTableRef.value.prepareData(list)
})
4 months ago
})
}
const dialogOkrInfo = ref(null)
3 months ago
// function handleAddNode() {
// dialogOkrInfo.value.open('create', null)
// }
4 months ago
2 months ago
function handleEditOkr(nodeId = undefined) {
4 months ago
dialogOkr.value.close()
2 months ago
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 1)
4 months ago
}
function handleUpdateProcess() {
2 months ago
okrTableRef.value.updateProcess(searchForm.value.nodeId).then(() => {
message.success('更新成功')
getOkrList()
})
4 months ago
}
const dialogOkr = ref(null)
2 months ago
function handleShowOkr(id) {
dialogOkr.value.open({
nodeId: id,
2 months ago
canEdit: true,
queryType: 1
2 months ago
})
4 months ago
}
</script>
<style lang="scss" scoped>
:deep(.el-overlay-dialog) {
display: flex;
justify-content: center;
align-items: center;
}
</style>