+
+
+
+
+
+
+
+
+ {{ row.objectInfo.objectiveName }}
+
+
+
+
+
+ {{ row.sourceName ? `【${row.sourceName}】` : '' }} {{ row.keyResultShowName }}
+
+
+
+
+
+
+ {{ currentNode.startTime }}
+
+
+
+
+ 完成
+ 未完成
+
+
+
+
+
+ {{ parseInt(row.targetValue - row.currentValue) }}
+
+
+
+
+
+
+
+
+
+
+ {{ currentNode.endTime }}
+
+
+
+
+ {{ parseInt(row.objectInfo.progress) }}%
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/OKR/Management/Components/AllTarget.vue b/src/views/OKR/Management/Components/AllTarget.vue
index ea757e1..55a7f7a 100644
--- a/src/views/OKR/Management/Components/AllTarget.vue
+++ b/src/views/OKR/Management/Components/AllTarget.vue
@@ -72,7 +72,7 @@ const isCurrentLeafNode = ref(false)
function handleSearchPeroid() {
getAllNodeTree().then((resp) => {
if (resp.nodeId) {
- peroidList.value = listToTree(resp.tree, {
+ peroidList.value = listToTree(resp?.tree || [], {
id: 'nodeId',
pid: 'parentId',
children: 'children'
@@ -103,9 +103,14 @@ function nodeChange(nodeId) {
function getOkrList() {
getAllOkrPage(searchForm.value).then((resp) => {
const list = resp
- nextTick(() => {
- okrTableRef.value.prepareData(list)
- })
+ if (list && list.length > 0) {
+ nextTick(() => {
+ okrTableRef.value.prepareData(list)
+ })
+ } else {
+ // 如果没有数据,清空表格
+ okrTableRef.value.prepareData([])
+ }
})
}
diff --git a/src/views/OKR/Management/Components/MyDuty.vue b/src/views/OKR/Management/Components/MyDuty.vue
index f5a833d..6373f79 100644
--- a/src/views/OKR/Management/Components/MyDuty.vue
+++ b/src/views/OKR/Management/Components/MyDuty.vue
@@ -53,7 +53,7 @@ handleSearchPeroid()
function handleSearchPeroid() {
getMyNodeTree().then((resp) => {
- peroidList.value = listToTree(resp.tree, {
+ peroidList.value = listToTree(resp?.tree || [], {
id: 'nodeId',
pid: 'parentId',
children: 'children'
@@ -66,9 +66,14 @@ function handleSearchPeroid() {
function getOkrList() {
getMyOkrPage(searchForm.value).then((resp) => {
const list = resp
- nextTick(() => {
- okrTableRef.value.prepareData(list)
- })
+ if (list && list.length > 0) {
+ nextTick(() => {
+ okrTableRef.value.prepareData(list)
+ })
+ } else {
+ // 如果没有数据,清空表格
+ okrTableRef.value.prepareData([])
+ }
})
}
diff --git a/src/views/OKR/Management/Components/MySon.vue b/src/views/OKR/Management/Components/MySon.vue
index f407afc..2b2ad26 100644
--- a/src/views/OKR/Management/Components/MySon.vue
+++ b/src/views/OKR/Management/Components/MySon.vue
@@ -66,7 +66,7 @@ handleSearchPeroid()
function handleSearchPeroid() {
getMySonNodeTree({ userId: props.userId }).then((resp) => {
- peroidList.value = listToTree(resp.tree, {
+ peroidList.value = listToTree(resp?.tree || [], {
id: 'nodeId',
pid: 'parentId',
children: 'children'
@@ -80,9 +80,14 @@ function getOkrList() {
...searchForm.value,
userId: props.userId
}).then((resp) => {
- nextTick(() => {
- okrTableRef.value.prepareData(resp)
- })
+ if (resp && resp.length > 0) {
+ nextTick(() => {
+ okrTableRef.value.prepareData(resp)
+ })
+ } else {
+ // 如果没有数据,清空表格
+ okrTableRef.value.prepareData([])
+ }
})
}
diff --git a/src/views/OKR/Management/Components/OkrTable.vue b/src/views/OKR/Management/Components/OkrTable.vue
index bb5c7a4..d1f165c 100644
--- a/src/views/OKR/Management/Components/OkrTable.vue
+++ b/src/views/OKR/Management/Components/OkrTable.vue
@@ -82,6 +82,10 @@ 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) => {
diff --git a/src/views/OKR/Management/index.vue b/src/views/OKR/Management/index.vue
index 95c367b..c8c9d0c 100644
--- a/src/views/OKR/Management/index.vue
+++ b/src/views/OKR/Management/index.vue
@@ -11,9 +11,9 @@