UPDATE: 根据计划的状态调按钮显示还是隐藏。

This commit is contained in:
贾同学
2025-09-17 16:27:46 +08:00
parent c88128b63b
commit dea0844829
3 changed files with 24 additions and 10 deletions

View File

@@ -36,7 +36,7 @@
新增子计划 新增子计划
</el-button> </el-button>
<el-button <el-button
v-if="isTabPlanFather" v-if="isTabPlanFather && planFormContent?.testState === 0"
v-auth.plan="'add_subplan'" v-auth.plan="'add_subplan'"
icon="Edit" icon="Edit"
type="primary" type="primary"
@@ -45,7 +45,7 @@
编辑子计划 编辑子计划
</el-button> </el-button>
<el-button <el-button
v-if="isTabPlanFather" v-if="isTabPlanFather && planFormContent?.testState === 0"
v-auth.plan="'export_subplan'" v-auth.plan="'export_subplan'"
icon="Download" icon="Download"
type="primary" type="primary"
@@ -56,6 +56,7 @@
<el-button <el-button
v-auth.plan="'import_subplan'" v-auth.plan="'import_subplan'"
:disabled="!scope.isSelected" :disabled="!scope.isSelected"
v-if="planFormContent?.importFlag === 1"
icon="Download" icon="Download"
type="primary" type="primary"
@click="exportPlanCheckResultData(scope.selectedListIds)" @click="exportPlanCheckResultData(scope.selectedListIds)"
@@ -63,7 +64,12 @@
数据下载 数据下载
</el-button> </el-button>
<el-button <el-button
v-if="!isTabPlanFather && planFormContent && planFormContent?.children.length > 0" v-if="
!isTabPlanFather &&
planFormContent &&
planFormContent.children &&
planFormContent?.children?.length > 0
"
v-auth.plan="'add_subplan'" v-auth.plan="'add_subplan'"
icon="Box" icon="Box"
type="primary" type="primary"
@@ -82,7 +88,7 @@
批量移除 批量移除
</el-button> </el-button>
<el-dropdown <el-dropdown
v-if="planFormContent && planFormContent?.children.length > 0" v-if="planFormContent && planFormContent.children && planFormContent.children?.length > 0"
v-auth.plan="'add_subplan'" v-auth.plan="'add_subplan'"
:disabled="!scope.isSelected" :disabled="!scope.isSelected"
placement="right-start" placement="right-start"
@@ -110,13 +116,13 @@
</template> </template>
</el-dropdown> </el-dropdown>
<el-dropdown <el-dropdown
v-if="planFormContent && planFormContent?.children.length > 0" v-if="planFormContent && planFormContent.children && planFormContent.children?.length > 0"
v-auth.plan="'add_subplan'" v-auth.plan="'add_subplan'"
placement="right-start" placement="right-start"
trigger="hover" trigger="hover"
> >
<el-button <el-button
v-if="!isTabPlanFather" v-if="!isTabPlanFather && planFormContent.testState === 0"
icon="ScaleToOriginal" icon="ScaleToOriginal"
style="margin-left: 10px" style="margin-left: 10px"
type="primary" type="primary"
@@ -150,6 +156,7 @@
</el-button> </el-button>
<el-button <el-button
v-if="isTabPlanFather" v-if="isTabPlanFather"
:disabled="scope.row.checkState != 0"
icon="Delete" icon="Delete"
link link
type="primary" type="primary"
@@ -167,10 +174,10 @@
<ImportZip ref="planCheckDataImportZip" @result="importResult" /> <ImportZip ref="planCheckDataImportZip" @result="importResult" />
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { ElFormItem, ElMessage, ElMessageBox, ElSwitch, TabPaneName } from 'element-plus' import { ElFormItem, ElMessage, ElMessageBox, ElSwitch, type TabPaneName } from 'element-plus'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件 import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
import { Plan } from '@/api/plan/interface' import { type Plan } from '@/api/plan/interface'
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
import type { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface' import type { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface'
import { import {

View File

@@ -834,7 +834,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
user_Result: any user_Result: any
if (mode.value === '比对式') { if (mode.value === '比对式') {
if (data.importFlag === 1) { if (data.importFlag === 1 || (data.testState !== 0 && plan === 0)) {
allDisabled.value = true allDisabled.value = true
formContent.leader = data.leader formContent.leader = data.leader
} }

View File

@@ -73,7 +73,14 @@
> >
编辑 编辑
</el-button> </el-button>
<el-button type="primary" v-auth.plan="'delete'" link :icon="Delete" @click="handleDelete(scope.row)"> <el-button
type="primary"
v-if="scope.row.testState === 0"
v-auth.plan="'delete'"
link
:icon="Delete"
@click="handleDelete(scope.row)"
>
删除 删除
</el-button> </el-button>
<el-button <el-button