GuLiMmo
2023-12-20 d058cd91a5864b15adbf260b28a89a973eaba99b
src/views/evaluate/evaluateTask.vue
@@ -15,6 +15,7 @@
      <template #menu="{ size, row, index }">
        <el-button type="primary" text plain icon="el-icon-edit" @click="editDialog(row)">编辑</el-button>
        <el-button type="primary" text plain icon="el-icon-position" @click="publicTimeBtn(row)" v-if="row.status === 2">发布</el-button>
        <el-button type="primary" v-if="row.type === 0" text plain icon="el-icon-plus" @click="addCandidateHandle(row)">新增候选人</el-button>
        <el-button type="primary" text plain icon="el-icon-download">导出</el-button>
      </template>
    </avue-crud>
@@ -35,6 +36,8 @@
    </el-dialog>
    <!-- 新增编辑弹窗 -->
    <addDialog :params="addParams" @refreshTable="this.onLoad" />
    <!-- 新增候选人 -->
    <addCandidate :params="addCandidateParams" @refreshTable="this.onLoad"  />
  </basic-container>
</template>
@@ -49,11 +52,13 @@
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import addDialog from './components/addDialog.vue';
import addCandidate from './components/addCandidate.vue';
import { getDeptTree } from '@/api/system/dept';
export default {
  components: {
    addDialog,
    addCandidate
  },
  data() {
    return {
@@ -93,6 +98,8 @@
          },
        ],
      },
      // 新增候选人params
      addCandidateParams: {},
    };
  },
  watch: {
@@ -310,6 +317,7 @@
        const result = deptResult.data.data;
        let deptList = [];
        result.forEach(dept => {
          console.log(dept);
          if (dept.children) {
            deptList = result.concat(dept.children);
            delete dept.children;
@@ -347,6 +355,15 @@
      );
      this.dialogVisible = false;
    },
    addCandidateHandle(row) {
      this.addCandidateParams = {
        visible: true,
        type: 0,
        data: {
          ...row
        }
      }
    },
    tabChange(value) {
      this.defaultTaskType = value.prop;
    },