GuLiMmo
2023-12-29 462b2f149d02b9e7ecca82922a68dfbba4b4baa5
src/views/evaluate/components/taskSetting.vue
@@ -1,9 +1,11 @@
<template>
    <el-dialog v-model="props.params.visible" :title="`${taskParams.evaluateTaskName}-候选人列表`" width="60%" destroy-on-close
    <el-dialog v-model="props.params.visible" :title="`${taskParams.evaluateTaskName}-${curType ? '部门列表' : '候选人列表'}`" width="60%" destroy-on-close
        align-center>
        <avue-crud :data="table.data" :option="candidatesOptions" v-model:page="table.page" @refresh-change="refreshChange">
        <avue-crud :data="table.data" :option="option" v-model:page="table.page" @refresh-change="refreshChange">
            <template #menu-left>
                <el-button type="primary" icon="el-icon-plus" @click="addCandidateDialog">新增候选人</el-button>
                <el-button type="primary" icon="el-icon-plus" @click="addCandidateDialog">
                    {{ curType? '添加部门' : '添加候选人' }}
                </el-button>
            </template>
            <template #menu="{ row }">
                <el-button type="primary" icon="el-icon-plus" text plain @click="addAssessor(row)">添加评定人</el-button>
@@ -22,7 +24,7 @@
<script setup>
import addCandidate from './addCandidate.vue';
import addAssessors from './addAssessors.vue';
import { markRaw, reactive, watch } from 'vue';
import { computed, inject, markRaw, reactive, watch } from 'vue';
import { getCandidateList, removeCandidate } from '@/api/evaluate/evaluateTask'
import { ElMessage } from 'element-plus';
@@ -30,6 +32,8 @@
    visible: false,
    taskParams: {}
})
const type = inject('type')
const props = defineProps({
    params: {
@@ -99,6 +103,50 @@
    ]
})
const setcionOptions = markRaw({
    height: '400',
    calcHeight: 30,
    tip: false,
    searchShow: true,
    searchMenuSpan: 6,
    border: true,
    index: true,
    viewBtn: false,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    selection: false,
    dialogClickModal: false,
    menuFixed: 'right',
    labelWidth: '70',
    column: [
        {
            label: '任务id',
            prop: 'evaluateTaskId',
            type: 'input',
            hide: true,
        },
        {
            label: '任务名称',
            prop: 'evaluateTaskName',
            type: 'input'
        },
        {
            label: '部门id',
            prop: 'deptId',
            type: 'input',
            hide: true,
        },
        {
            label: '部门名称',
            prop: 'deptName',
            type: 'input'
        },
    ]
})
const option = computed(() => type() ? setcionOptions : candidatesOptions)
const table = reactive({
    data: [],
    page: {
@@ -139,6 +187,8 @@
    candidateInfo: {}
})
const curType = computed(() => type())
const addAssessor = (row) => {
    dialogAssessorParams.visible = true
    dialogAssessorParams.taskInfo = taskParams