莳松-行政管理系统
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

102 lines
2.1 KiB

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