luobisheng
2022-12-09 a82d79851affba166693ba617fdeea43f1848e7f
src/views/operate/disposal/casepool/escalation/index.vue
@@ -8,12 +8,11 @@
            <el-select
              v-model="mystatus"
              placeholder="违规"
              @change="setMystatus"
            >
              <el-option
                v-for="item in typeList"
                v-for="item in resourceOptions"
                :key="item.label"
                :label="item.name"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
@@ -23,31 +22,11 @@
            <el-button type="primary" @click="getUserList">查询</el-button>
          </div>
        </div>
        <!-- <div class="addUser">
                    <el-button class="addBtn" type="primary" @click="dialogCreate = true">添加</el-button>
                    <el-dialog :before-close="handleClose" :visible.sync="dialogCreate" title="请选择上报事件类型" width="45%"
                        v-if="dialogCreate">
                        <createUser @getPageProp=setDialog />
                    </el-dialog>
                    <el-dialog :before-close="handleClose" :visible.sync="dialogNewAdd"
                        :title="newAddType === 0 ? '违规事件登记' : '违建事件登记' " width="60%" v-if="dialogNewAdd">
                        <MyIll v-if="newAddType === 1" :mytype=newAddType @changeDialog=changeDialog />
                        <myVio v-else :mytype=newAddType @changeDialog=changeDialog />
                    </el-dialog>
                </div> -->
      </div>
    </header>
    <main>
      <div class="mainContent">
        <!-- 导航状态标签 -->
        <!-- <div class="nav">
                    <div @click="changeNavChecked(index)" :class="[item.checked ? 'is-active':'','nav-item']"
                        v-for="(item,index) in tagList" :key="item.name">{{item.name}}</div>
                </div>
                <div class="type-nav">
                    <div @click="changeTypeChecked(index)" v-for="(item,index) in typeList" :key="item.name"
                        :class="[item.checked ? 'is-active':'','type-item']">{{item.name}}</div>
                </div> -->
        <!-- 数据展示 -->
        <el-table
          ref="multipleTable"
@@ -90,19 +69,6 @@
          </el-table-column>
          <el-table-column prop="continueTime" label="持续时间" min-width="10">
          </el-table-column>
          <!--  <el-table-column prop="operation" label="操作" min-width="20">
            <template slot-scope="scope">
              <div class="operation">
                                <span @click="handleFind(scope.row)">上报</span>
                                <span class="line">|</span>
                                <span @click="handleDelete(scope.row)">调度</span>
                                <span class="line">|</span>
                                <span @click="handleDelete(scope.row)">在学习</span>
                                <span class="line">|</span>
                                <span @click="handleDelete(scope.row)">暂不处理</span>
                            </div>
            </template>
          </el-table-column>-->
        </el-table>
        <!-- 详情页展示 -->
        <el-dialog
@@ -163,31 +129,17 @@
  </div>
</template>
<script>
import { CATEGOTY, EVENT_SOURCE } from "@/utils/helper";
// import updateUser from "./updateUser"
import { RESOURCE_OPTIONS, EVENT_SOURCE } from "@/utils/helper";
import MyDetail from "@/components/detail";
// import createUser from "./createUser"
// import MyIll from './createUser/ill'
// import MyVio from './createUser/vio'
import basecase from "@/api/operate/basecase";
export default {
  components: {
    MyDetail,
  },
  data() {
    return {
      tableData: [
        // {
        //     code:1,
        //     eventSource:1,
        //     category:1,
        //     type:1,
        //     actionCause:'案由1111',
        //     site:'你好',
        //     streetId:1,
        //     alarmTime:'2022-21-20',
        //     continueTime:'8小时',
        // }
      ],
      tableData: [],
      context: "",
      dialogCreate: false,
      dialogView: false,
@@ -262,6 +214,8 @@
      ],
      mystatus: "",
      statusArr: [],
      resource: null,
      resourceOptions: RESOURCE_OPTIONS
    };
  },
  created() {
@@ -278,11 +232,6 @@
    this.getUserList();
  },
  methods: {
    setMystatus(value) {
      this.statusArr[1] = value;
      this.changeTypeChecked(value - 1);
      this.getUserList();
    },
    setDialog({ flag, type }) {
      this.dialogCreate = flag;
      this.dialogNewAdd = true;
@@ -339,11 +288,7 @@
      list.forEach((item) => {
        this.tempList.push(item.code);
      });
      if (list.length === this.tableData.length) {
        this.all = true;
      } else {
        this.all = false;
      }
      this.all = list.length === this.tableData.length;
    },
    // 全选
    selectAll() {
@@ -357,23 +302,27 @@
    },
    // 获取用户列表
    getUserList() {
      const { currentPage, pageSize, context, statusArr } = this;
      this.$axios({
        method: "get",
        url: `sccg/base_case/query?state=${statusArr[0]}&current=${currentPage}&size=${pageSize}&resource=2&type=${statusArr[1]}`,
      }).then((res) => {
        this.totalNum = res.data.total;
        this.tableData = res.data.records;
      });
      const params = {
        current: this.currentPage,
        state: this.statusArr[0] ?? null,
        size: this.pageSize,
        resource: this.resource,
        type: this.statusArr[1] ?? null
      }
      basecase.baseCasePoolList(params)
          .then(({ records, total }) => {
            this.tableData = records;
            this.totalNum = total;
          })
          .catch(err => this.$message.error(err))
    },
    // 设置表格斑马纹
    tableRowClassName({ row, rowIndex }) {
      if ((rowIndex + 1) % 2 == 0) {
      if ((rowIndex + 1) % 2 === 0) {
        return "warning-row";
      } else {
        return "success-row";
      }
      return "";
    },
    // 查看用户信息(不可修改)
    handleFind(rowData) {