zhanghua
2023-10-24 5b1a4f4e29652cf1b2f4eb406d96700acffc9e8c
src/views/operate/disposal/casepool/pool/index.vue
@@ -1,66 +1,11 @@
<template>
  <div class="userList">
    <header>
      <div class="headerContent">
        <div class="search">
          <span>来源查询:</span>
          <div class="option">
            <el-select clearable v-model="resource" placeholder="请选择来源">
              <el-option
                v-for="item in eventSourceOptions"
                :key="item.label"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div class="findBtn">
            <el-button type="primary" @click="getUserList">查询</el-button>
          </div>
        </div>
        <div class="addUser">
          <el-button
            class="addBtn button-addition"
            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="80%"
            v-if="dialogNewAdd"
          >
            <!-- 违建登记 -->
            <MyIll
              v-if="newAddType === 1"
              :refresh="getUserList"
              :mytype="newAddType"
              @changeDialog="changeDialog"
            />
            <!-- 违规登记 -->
            <myVio
              v-else
              :refresh="getUserList"
              :mytype="newAddType"
              @changeDialog="changeDialog"
            />
          </el-dialog>
        </div>
      </div>
      <MyHeader
        ref="myHeader"
        @dialogCreatepro="dialogCreatepro"
        @getUserList="getUserList"
      ></MyHeader>
    </header>
    <main>
      <div class="mainContent">
@@ -100,7 +45,8 @@
          :row-class-name="tableRowClassName"
          @selection-change="tableChange"
        >
          <el-table-column type="selection" min-width="5"> </el-table-column>
          <el-table-column label="序号" type="index" min-width="10">
          </el-table-column>
          <el-table-column prop="code" label="事件编号" min-width="18">
            <template slot-scope="scope">
              <el-link @click="JumpView(scope.row)">{{
@@ -111,7 +57,7 @@
          <el-table-column prop="eventSource" label="问题来源" min-width="8">
            <template slot-scope="scope">
              <span>{{
                scope.row.eventSource === 2 ? "人工上传" : "视频巡查"
                scope.row.eventSource === 2 ? "网格巡查" : "视频巡查"
              }}</span>
            </template>
          </el-table-column>
@@ -131,6 +77,7 @@
            :prop="mystatus === 1 ? 'site' : ''"
            :label="mystatus === 1 ? '报警点位' : '违法建筑长、宽、高'"
            :min-width="mystatus === 1 ? '10' : '20'"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <div v-if="mystatus === 2">
@@ -173,7 +120,7 @@
          <el-table-column prop="operation" label="操作" min-width="20">
            <template slot-scope="scope">
              <div class="operation" v-if="statusArr[0] === 0">
                <span @click="handleFind(scope.row)">上报</span>
                <span @click="handleUpload(scope.row)">上报</span>
                <span class="line">|</span>
                <span @click="handleDispatch(scope.row)">调度</span>
                <span class="line">|</span>
@@ -189,14 +136,22 @@
        </el-table>
        <!-- 详情页展示 -->
        <el-dialog
          custom-class="customWidth"
          :visible.sync="dialogView"
          width="60%"
          title="基础信息(人工)"
          v-if="dialogView"
          :before-close="handleClose"
          :before-close="handleClose2"
        >
          <MyDetail :info="info" v-if="mystatus === 1"></MyDetail>
          <MyIllDetail :info="info" v-else></MyIllDetail>
          <MyDetail
            style="min-width: 300px"
            :info="info"
            v-if="mystatus === 1"
          ></MyDetail>
          <MyIllDetail
            style="min-width: 500px"
            :info="info"
            v-else
          ></MyIllDetail>
        </el-dialog>
        <!-- 调度 -->
        <el-dialog
@@ -246,6 +201,39 @@
        </div>
      </div>
    </main>
    <!-- 选择登记类型 -->
    <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="80%"
      v-if="dialogNewAdd"
    >
      <!-- 违建登记 -->
      <MyIll
        v-if="newAddType === 1"
        :refresh="getUserList"
        :mytype="newAddType"
        @changeDialog="changeDialog"
      />
      <!-- 违规登记 -->
      <myVio
        v-else
        :refresh="getUserList"
        :mytype="newAddType"
        @changeDialog="changeDialog"
      />
    </el-dialog>
  </div>
</template>
<script>
@@ -258,7 +246,7 @@
import helper from "@/utils/mydate";
import { RESOURCE_OPTIONS } from "@/utils/helper";
import basecase from "@/api/operate/basecase";
import MyHeader from "@/components/seachHeader/index";
export default {
  components: {
    createUser,
@@ -267,6 +255,7 @@
    MyDetail,
    MyDispatch,
    MyIllDetail,
    MyHeader,
  },
  data() {
    return {
@@ -361,9 +350,13 @@
        this.statusArr[1] = item.value;
      }
    });
    this.getUserList();
    this.getUserList(undefined);
  },
  mounted() {},
  methods: {
    dialogCreatepro() {
      this.dialogCreate = true;
    },
    // 调度
    handleDispatch(data) {
      this.baseId = data.id;
@@ -438,14 +431,57 @@
      });
    },
    // 获取用户列表
    getUserList() {
      const params = {
        current: this.currentPage,
        state: this.statusArr[0] ?? null,
        size: this.pageSize,
        resource: this.resource,
        type: this.statusArr[1] ?? null,
      };
    getUserList(seachData) {
      // console.log(seachData.seachData.resource)
      let params;
      if (seachData) {
        params = {
          current: this.currentPage,
          state: this.statusArr[0] ?? null,
          size: this.pageSize,
          resource:
            seachData.seachData.resource == undefined
              ? null
              : seachData.seachData.resource,
          region:
            seachData.seachData.region == undefined
              ? null
              : seachData.seachData.region,
          type: this.statusArr[1] ?? null,
          code:
            seachData.seachData.code == undefined
              ? null
              : seachData.seachData.code,
          categoryBig:
            seachData.seachData.categoryBig == undefined
              ? null
              : seachData.seachData.categoryBig,
          categorySmall:
            seachData.seachData.categorySmall == undefined
              ? null
              : seachData.seachData.categorySmall,
          site:
            seachData.seachData.site == undefined
              ? null
              : seachData.seachData.site,
          street:
            seachData.seachData.street == undefined
              ? null
              : seachData.seachData.street,
        };
        if (seachData.seachData.alarmTime) {
          params.startTime = seachData.seachData.alarmTime[0];
          params.endTime = seachData.seachData.alarmTime[1];
        }
      } else {
        params = {
          current: this.currentPage,
          state: this.statusArr[0] ?? null,
          size: this.pageSize,
          type: this.statusArr[1] ?? null,
        };
      }
      basecase
        .baseCasePoolList(params)
        .then(({ records, total }) => {
@@ -462,8 +498,16 @@
        return "success-row";
      }
    },
    // 查看用户信息(不可修改)
    handleFind(rowData) {},
    handleUpload(rowData) {
      debugger;
      basecase
        .uploadEvent(rowData.id)
        .then((res) => {
          debugger;
        })
        .catch((err) => this.$message.error(err));
    },
    // 当前页改变触发事件
    changeCurrentPage(page) {
      this.currentPage = page;
@@ -475,6 +519,12 @@
      this.dialogCreate = flag;
      this.dialogView = flag;
      this.dialogDispatch = flag;
    },
    handleClose2(done) {
      this.dialogCreate = false;
      this.dialogNewAdd = false;
      this.dialogDispatch = false;
      this.dialogView = false;
    },
    handleClose(done) {
      this.$confirm("确认关闭?")
@@ -498,6 +548,7 @@
      this.statusArr[0] = this.tagList[idx].value;
      this.statusArr[1] = 1;
      this.getUserList();
      this.$refs.myHeader.seachData = {};
    },
    // 更改违规/违建
    changeTypeChecked(idx) {
@@ -507,6 +558,7 @@
      this.mystatus = idx + 1;
      this.statusArr[1] = this.typeList[idx].value;
      this.getUserList();
      this.$refs.myHeader.seachData = {};
    },
    async JumpView(data) {
      await this.getEventInfo(data.code);
@@ -652,20 +704,18 @@
    .nav {
      display: flex;
      line-height: 40px;
      .is-active {
        // background-color: #070f22;
        //color: #333;
        color: #f5222d;
        font-weight: 700;
      }
      .nav-item {
        width: 80px;
        text-align: center;
        &:hover {
          cursor: pointer;
        }
      }
      .is-active {
        // background-color: #070f22;
        color: #333;
        font-size: 500;
      }
    }
@@ -687,8 +737,8 @@
      .is-active {
        // background-color: #070f22;
        border-radius: 4px;
        color: #333;
        font-size: 500;
        color: #f5222d;
        font-weight: 700;
      }
    }
@@ -771,7 +821,7 @@
      .operation {
        display: flex;
        color: #2f54eb;
        .line {
          padding: 0 5px;
        }
@@ -784,3 +834,8 @@
  }
}
</style>
<style>
.customWidth {
  width: 1000px !important;
}
</style>