GuLiMmo
2024-01-02 44567ade6fc16bda1f1d22fef8019661375e9615
src/views/assessment/assessmentTask.vue
@@ -1,6 +1,6 @@
<template>
  <basic-container>
    <template v-if="isResult">
    <template v-if="curIndex === 0">
      <avue-tabs ref="tabs" :option="taskTypeList" @change="tabChange"></avue-tabs>
      <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading"
        :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate"
@@ -20,11 +20,17 @@
          </el-button> -->
        </template>
        <template #menu="{ row }">
          <el-button type="primary" icon="el-icon-plus" size="small" @click="handleTaskResult(row)">
          <el-button type="primary" icon="el-icon-setting" text @click="handleTaskSetting(row)">
            考核设置
          </el-button>
          <el-button type="primary" icon="el-icon-view" text @click="handleTaskResult(row)">
            考核结果
          </el-button>
        </template>
      </avue-crud>
    </template>
    <template v-else-if="curIndex === 1">
      <assessmentTaskSetting :params="resultParams" @changeIs="changeIs"/>
    </template>
    <template v-else>
      <taskResult :params="resultParams" @changeIs="changeIs" />
@@ -45,15 +51,17 @@
import 'nprogress/nprogress.css';
import taskResult from './components/taskResult.vue'
import addTaskDialog from "./components/addTaskDialog.vue";
import assessmentTaskSetting from "./components/assessmentTaskSetting.vue";
export default {
  components: {
    taskResult,
    addTaskDialog
    addTaskDialog,
    assessmentTaskSetting
  },
  data() {
    return {
      isResult: true,
      curIndex: 0,
      form: {},
      query: {},
      search: {},
@@ -124,13 +132,18 @@
    }
  },
  methods: {
    handleTaskResult(row) {
      this.isResult = false;
    handleTaskSetting(row) {
      this.curIndex = 1;
      this.resultParams = row
      this.resultParams.type = this.defaultTaskType
    },
    changeIs(is) {
      this.isResult = is
    handleTaskResult(row) {
      this.curIndex = 2;
      this.resultParams = row
      this.resultParams.type = this.defaultTaskType
    },
    changeIs(num) {
      this.curIndex = num
      this.$nextTick(() => {
        this.$refs.tabs.active = this.defaultTaskType.toString()
      })