luobisheng
2022-12-08 0b0ce5c2bd14c1ff390dc7750ac5fd473e0b8c55
src/views/operate/viewEvent/index.vue
@@ -15,19 +15,17 @@
        <div class="contentItem">
          <div style="width: 80px">按类型:</div>
          <div class="search">
            <el-input
              placeholder=" 请输入类型"
              v-model="searchData.categories"
            ></el-input>
            <el-select clearable v-model="searchData.categories" placeholder=" 请选择类型">
              <el-option v-for="option in categoryOptions" :key="option.id" :label="option.label" :value="option.value"></el-option>
            </el-select>
          </div>
        </div>
        <div class="contentItem">
          <div style="width: 80px">按社区:</div>
          <div class="search">
            <el-input
              placeholder=" 请输入社区"
              v-model="searchData.communityId"
            ></el-input>
            <el-select clearable v-model="searchData.communityId" placeholder="请选择社区">
              <el-option v-for="option in communityOptions" :key="option.id" :value="option.id" :label="option.regionName"></el-option>
            </el-select>
          </div>
        </div>
        <div class="contentItem">
@@ -80,7 +78,7 @@
        >
          <el-table-column prop="code" label="事件编号" min-width="18">
            <template slot-scope="scope">
              <el-link>{{ scope.row.code }}</el-link>
              <el-link @click="handleView(scope.row)">{{ scope.row.code }}</el-link>
            </template>
          </el-table-column>
          <el-table-column prop="category" label="问题类别" min-width="8">
@@ -186,6 +184,7 @@
import helper from "@/utils/mydate";
import casequery from "@/api/operate/basecase";
import { CATEGOTY } from "@/utils/helper";
import department from "@/api/system/department";
export default {
  components: {
@@ -207,18 +206,8 @@
      totalNum: null,
      pageSize: 10,
      currentPage: 1,
      typeList: [
        {
          name: "违规",
          value: 1,
          checked: true,
        },
        {
          name: "违建",
          value: 2,
          checked: false,
        },
      ],
      categoryOptions: CATEGOTY,
      communityOptions: [],
      myproblem: 1,
      number: "",
      searchData: {
@@ -233,6 +222,7 @@
  },
  created() {
    this.getList();
    this.getCommunityOptions();
  },
  methods: {
    // 获取列表
@@ -251,6 +241,16 @@
          this.tableData = [];
        });
    },
    // 获取社区和街道
    getCommunityOptions() {
      department.getDepartmentList()
          .then(res => {
            this.communityOptions = res;
          })
          .catch(err => this.$message.error(err))
    },
    // 设置表格斑马纹
    tableRowClassName({ row, rowIndex }) {
      if ((rowIndex + 1) % 2 === 0) {
@@ -289,9 +289,15 @@
    closeDialog({ flag }) {
      this.dialogExamine = flag;
      this.dialogClosure = flag;
      this.dialogView = false;
      this.getList();
    },
    async handleView(rowData) {
      this.info = await casequery.getBaseCaseDetail(rowData.code);
      this.dialogView = true;
    },
    filterTime(time) {
      return helper(time);
    },