zhanghua
2023-02-21 fb1d57f4bce31fe4f8147a144f8ef4afbca0a4cd
src/views/operate/disposal/casepool/pool/index.vue
@@ -1,66 +1,35 @@
<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 @dialogCreatepro="dialogCreatepro" @getUserList ="getUserList"></MyHeader>
<!--      <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-->
<!--          >-->
<!--        </div>-->
<!--      </div>-->
    </header>
    <main>
      <div class="mainContent">
@@ -131,21 +100,22 @@
            :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">
                <div v-if="mystatus === 2">
                <span>{{
                  scope.row.buildingLength +
                  "米" +
                  "、" +
                  scope.row.buildingWidth +
                  "米" +
                  "、" +
                  scope.row.buildingHigh +
                  "米"
                }}</span>
              </div>
              <div v-else>{{ scope.row.site }}</div>
                    scope.row.buildingLength +
                    "米" +
                    "、" +
                    scope.row.buildingWidth +
                    "米" +
                    "、" +
                    scope.row.buildingHigh +
                    "米"
                  }}</span>
                </div>
                <div v-else>{{ scope.row.site }}</div>
            </template>
          </el-table-column>
          <el-table-column
@@ -246,6 +216,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 +261,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 +270,7 @@
    MyDetail,
    MyDispatch,
    MyIllDetail,
    MyHeader
  },
  data() {
    return {
@@ -361,9 +365,15 @@
        this.statusArr[1] = item.value;
      }
    });
    this.getUserList();
    this.getUserList(undefined);
  },
  mounted() {
  },
  methods: {
    dialogCreatepro(){
      console.log('-------------------')
      this.dialogCreate = true
    },
    // 调度
    handleDispatch(data) {
      this.baseId = data.id;
@@ -438,14 +448,34 @@
      });
    },
    // 获取用户列表
    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,
          alarmTime:seachData.seachData.alarmTime ==undefined?null:seachData.seachData.alarmTime,
        };
      }else {
        params = {
          current: this.currentPage,
          state: this.statusArr[0] ?? null,
          size: this.pageSize,
          type: this.statusArr[1] ?? null,
        };
      }
      basecase
        .baseCasePoolList(params)
        .then(({ records, total }) => {
@@ -652,20 +682,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 +715,8 @@
      .is-active {
        // background-color: #070f22;
        border-radius: 4px;
        color: #333;
        font-size: 500;
        color: #f5222d;
        font-weight: 700;
      }
    }
@@ -771,7 +799,7 @@
      .operation {
        display: flex;
        color: #2f54eb;
        .line {
          padding: 0 5px;
        }