|
|
|
@ -46,6 +46,7 @@ |
|
|
|
|
id="okrAnalysisTable" |
|
|
|
|
:data="originList" |
|
|
|
|
border |
|
|
|
|
:show-summary="!!tableKeywords" |
|
|
|
|
:span-method="objectSpanMethod" |
|
|
|
|
@cell-click="handleClickCell" |
|
|
|
|
> |
|
|
|
@ -57,7 +58,26 @@ |
|
|
|
|
<!-- <el-table-column prop="objectiveId" label="占比" width="100px"> |
|
|
|
|
<template #default> 0 </template> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column prop="keyResultShowName" label="关键成果"> |
|
|
|
|
<el-table-column prop="keyResultShowName"> |
|
|
|
|
<template #header> |
|
|
|
|
<div class="flex items-center justify-center"> |
|
|
|
|
<div class="flex-1 mr-10px"> |
|
|
|
|
<el-input |
|
|
|
|
v-if="showTableSearch" |
|
|
|
|
v-model="tableKeywords" |
|
|
|
|
placeholder="请输入关键字" |
|
|
|
|
size="small" |
|
|
|
|
style="width: 100%" |
|
|
|
|
clearable |
|
|
|
|
@change="handleTableFilter" |
|
|
|
|
/> |
|
|
|
|
<div v-else>关键成果</div> |
|
|
|
|
</div> |
|
|
|
|
<el-button type="primary" size="small" @click="handleFilterTableClick"> |
|
|
|
|
{{ showTableSearch ? '取消' : '筛选' }} |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
{{ row.sourceName ? `【${row.sourceName}】` : '' }} {{ row.keyResultShowName }} |
|
|
|
|
</template> |
|
|
|
@ -302,6 +322,9 @@ const customColors = [ |
|
|
|
|
|
|
|
|
|
const peroidList = ref([]) |
|
|
|
|
|
|
|
|
|
const showTableSearch = ref(false) |
|
|
|
|
const tableKeywords = ref('') |
|
|
|
|
|
|
|
|
|
handleSearchPeroid() |
|
|
|
|
getOptions() |
|
|
|
|
|
|
|
|
@ -343,6 +366,7 @@ function nodeChange(nodeId) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const originList = ref([]) |
|
|
|
|
const defaultTableList = ref([]) |
|
|
|
|
const spanObj = ref([]) |
|
|
|
|
function getOkrList() { |
|
|
|
|
getAllOkrPage(searchForm.value).then((resp) => { |
|
|
|
@ -363,6 +387,7 @@ function getOkrList() { |
|
|
|
|
originList.value = [...originList.value, ...arr] |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
defaultTableList.value = [...originList.value] |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -548,6 +573,28 @@ function handleSaveComment() { |
|
|
|
|
function handleExport() { |
|
|
|
|
exportTableWithVue('#okrAnalysisTable', `OKR分析报表-${currentNode.value.nodeName}`) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleTableFilter() { |
|
|
|
|
console.log('tableKeywords', tableKeywords.value) |
|
|
|
|
|
|
|
|
|
if (tableKeywords.value) { |
|
|
|
|
originList.value = defaultTableList.value.filter( |
|
|
|
|
(item) => |
|
|
|
|
item.keyResultName.includes(tableKeywords.value) || |
|
|
|
|
item.sourceName.includes(tableKeywords.value) |
|
|
|
|
) |
|
|
|
|
} else { |
|
|
|
|
originList.value = [...defaultTableList.value] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleFilterTableClick() { |
|
|
|
|
showTableSearch.value = !showTableSearch.value |
|
|
|
|
if (!showTableSearch.value) { |
|
|
|
|
tableKeywords.value = '' |
|
|
|
|
originList.value = [...defaultTableList.value] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style> |
|
|
|
|