luobisheng
2022-11-28 667e1a5b49ffc2f7af9237b4542b1c2e4d00731f
src/views/intelligentPatrol/illegalSearch/index.vue
@@ -4,8 +4,16 @@
      <div class="headerContent">
        <!-- 条件筛选 -->
        <el-form ref="condition" :model="form" label-width="100px">
          <el-form-item :label=item.label :key=item.id v-for="item in headerList">
            <el-input v-model="item.value" :placeholder="item.placeholder"></el-input>
          <el-form-item :label=item.label :key=item.id v-for="item in headerList" :prop="item.prop">
            <el-input v-if="item.type === 'input'" v-model="form[item.prop]" :placeholder="item.placeholder"></el-input>
            <el-cascader v-if="item.type === 'cascader'" :options="item.options" :props="{ value: 'id', label: 'regionName' }"
                         v-model="form[item.prop]" :placeholder="item.placeholder"></el-cascader>
            <el-select v-if="item.type === 'select'" v-model="form[item.prop]" :placeholder="item.placeholder">
              <el-option v-for="option in item.options" :value="option.id" :key="option.id" :label="option.name"></el-option>
            </el-select>
            <el-date-picker v-if="item.type === 'timepick'" type="datetimerange" v-model="form[item.prop]" start-placeholder="开始日期"
                            end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
            ></el-date-picker>
          </el-form-item>
        </el-form>
      </div>
@@ -16,10 +24,10 @@
        <div class="main-btns">
          <div class="main-btns-left">
            <el-button icon="el-icon-download">下载图片</el-button>
            <el-button icon="el-icon-folder">导出</el-button>
            <el-button icon="el-icon-folder" @click="exportTableData">导出</el-button>
          </div>
          <div class="main-btns-right">
            <el-button icon="el-icon-search">查询</el-button>
            <el-button icon="el-icon-search" @click="searchTableData">查询</el-button>
            <el-button icon="el-icon-delete-solid" @click="handleReset">重置</el-button>
          </div>
        </div>
@@ -29,17 +37,17 @@
          :data="tableData" style="width: 100%" :row-class-name="tableRowClassName">
          <el-table-column type="selection" min-width="5">
          </el-table-column>
          <el-table-column prop="number" label="事件编号" min-width="10">
          <el-table-column prop="code" label="事件编号" min-width="10">
          </el-table-column>
          <el-table-column prop="type" label="违规类型" min-width="10">
          <el-table-column prop="typeName" label="违规类型" min-width="10">
          </el-table-column>
          <el-table-column prop="source" label="事件来源" min-width="10">
          <el-table-column prop="eventSource" label="事件来源" min-width="10">
          </el-table-column>
          <el-table-column prop="level" label="事件等级" min-width="10">
          <el-table-column prop="gradeName" label="事件等级" min-width="10">
          </el-table-column>
          <el-table-column prop="point" label="报警点位" min-width="10">
          <el-table-column prop="streetName" label="报警点位" min-width="10">
          </el-table-column>
          <el-table-column prop="org" label="所属组织" min-width="10">
          <el-table-column prop="site" label="所属组织" min-width="10">
          </el-table-column>
          <el-table-column prop="alarmTime" label="报警时间" min-width="12">
          </el-table-column>
@@ -49,7 +57,7 @@
          </el-table-column>
          <el-table-column prop="state" label="审核状态" min-width="10">
          </el-table-column>
          <el-table-column prop="advice" label="处理意见" min-width="10">
          <el-table-column prop="handlingOpinion" label="处理意见" min-width="10">
          </el-table-column>
          <el-table-column prop="operation" label="操作" min-width="15">
            <template slot-scope="scope">
@@ -63,7 +71,7 @@
    </main>
    <footer>
      <!-- 查看具体信息 -->
      <el-dialog title="事件详情" :visible.sync="dialogView" width="45%" :before-close="handleClose">
      <el-dialog title="事件详情" destroy-on-close :visible.sync="dialogView" width="45%" :before-close="handleClose">
        <ViewInfo :info="info"></ViewInfo>
      </el-dialog>
    </footer>
@@ -71,163 +79,166 @@
</template>
<script>
import helper from "@/utils/mydate.js"
import ViewInfo from './viewInfo'
import helper from "@/utils/mydate.js";
import ViewInfo from './viewInfo';
import basecase from "@/api/operate/basecase";
import department from "@/api/system/department";
import { getVideoPoint } from "@/api/operate/storeManagement";
export default {
  components: {
    ViewInfo
  },
  created() {
    this.getTableData();
    // 获取组织列表
    department.getDepartmentList()
        .then(res => {
          this.headerList[0].options = res;
        })
        .catch(err => this.$message.error(err))
    getVideoPoint({ current: 1, size: 100 })
        .then(({ records }) => {
          this.headerList[4].options = records;
        })
        .catch(err => this.$message.error(err))
  },
  data() {
    return {
      tableData: [
        {
          number: '123456',
          type: '人民路右二',
          source: '视频上报',
          level: '一般事件',
          point: '123.123,123.233',
          org: '人民部',
          alarmTime: '2022-02-12 12:00:00',
          continueTime: '2小时30分钟06秒',
          carNumber: '浙B245CM',
          state: '待审核',
          advice: '需及时处理'
        },
        {
          number: '123457',
          type: '人民路左二',
          source: '视频上报',
          level: '高发事件',
          point: '123.123,123.233',
          org: '人民部',
          alarmTime: '2022-02-12 12:00:00',
          continueTime: '2小时30分钟06秒',
          carNumber: '浙B245CM',
          state: '待审核',
          advice: '需及时处理'
        },
        {
          number: '123458',
          type: '人寿路右二',
          source: '视频上报',
          level: '一般事件',
          point: '123.123,123.233',
          org: '人民部',
          alarmTime: '2022-02-12 12:00:00',
          continueTime: '2小时30分钟06秒',
          carNumber: '浙B245CM',
          state: '待审核',
          advice: '需及时处理'
        },
        {
          number: '123459',
          type: '人民路右二',
          source: '视频上报',
          level: '一般事件',
          point: '123.123,123.233',
          org: '人民部',
          alarmTime: '2022-02-12 12:00:00',
          continueTime: '2小时30分钟06秒',
          carNumber: '浙B245CM',
          state: '待审核',
          advice: '需及时处理'
        },
        {
          number: '123460',
          type: '人民路右二',
          source: '视频上报',
          level: '一般事件',
          point: '123.123,123.233',
          org: '人民部',
          alarmTime: '2022-02-12 12:00:00',
          continueTime: '2小时30分钟06秒',
          carNumber: '浙B245CM',
          state: '待审核',
          advice: '需及时处理'
        }
      ],
      context: "",
      tableData: [],
      dialogView: false,
      info: '',
      info: null,
      currentPage: 1,
      pageSize: 10,
      headerList: [
        {
          id: 1,
          label: '所属组织:',
          value: '',
          placeholder: '请输入所属组织'
          placeholder: '请输入所属组织',
          prop: 'organization',
          type: 'cascader',
          options: []
        },
        {
          id: 2,
          label: '报警时间:',
          value: '',
          placeholder: '请输入报警时间'
          placeholder: '请输入报警时间',
          prop: 'alarmTime',
          type: 'timepick'
        },
        {
          id: 3,
          label: '违规类型:',
          value: '',
          placeholder: '请输入违规类型'
          placeholder: '请输入违规类型',
          prop: 'typeId',
          type: 'input'
        },
        {
          id: 4,
          label: '事件编号:',
          value: '',
          placeholder: '请输入事件编号'
          placeholder: '请输入事件编号',
          prop: 'code',
          type: 'input'
        },
        {
          id: 5,
          label: '监控点名称:',
          value: '',
          placeholder: '请输入监控点名称'
          placeholder: '请输入监控点名称',
          prop: 'videoPointId',
          type: 'select',
          options: []
        },
        {
          id: 6,
          label: '审核状态:',
          value: '',
          placeholder: '请输入审核状态'
          placeholder: '请输入审核状态',
          type: 'select',
          options: [{ id: 7, name: '未审核' }, { id: 8, name: '已经审核' }, { id: 9, name: '结案' }]
        },
        {
          id: 7,
          label: '车牌号:',
          value: '',
          placeholder: '请输入车牌号'
          placeholder: '请输入车牌号',
          prop: 'carNumber',
          type: 'input'
        },
        {
          id: 8,
          label: '处理意见:',
          value: '',
          placeholder: '请输入事件等级'
          placeholder: '请输入事件等级',
          prop: 'handlingOpinion',
          type: 'input'
        },
        {
          id: 9,
          label: '报警时间:',
          label: '事件等级:',
          value: '',
          placeholder: '请输入所属组织'
          placeholder: '请输入事件等级',
          prop: 'gradeId',
          type: 'input'
        },
      ],
      form: {
        gradeId: null,
        alarmTime: null,
        handlingOpinion: null,
        streetId: null,
        typeId: null,
        code: null,
        carNumber: null,
        state: null,
        videoPointId: null,
        organization: null
      }
    }
  },
  methods: {
    getTableData(params) {
      basecase.getViolationList({ current: this.currentPage, pageSize: this.pageSize, ...params })
          .then(({ records }) => {
            this.tableData = records;
          })
          .catch(err => this.$message.error(err))
    },
    searchTableData() {
      const { alarmTime, organization } = this.form;
      const [startTime, endTime] = alarmTime ?? [null, null];
      const [communityId, streetId] = organization ?? [null, null];
      const params = Object.assign({}, this.form);
      delete params.alarmTime;
      delete params.organization;
      this.getTableData({ startTime, streetId, communityId, endTime, ...params });
    },
    changeTime({ createTime }) {
      return helper(createTime);
    },
    // 设置表格斑马纹
    tableRowClassName({ row, rowIndex }) {
      if ((rowIndex + 1) % 2 == 0) {
      if ((rowIndex + 1) % 2 === 0) {
        return 'warning-row';
      } else {
        return 'success-row';
      }
      return '';
    },
    // 表单重置
    handleReset() {
      this.headerList.forEach(item => {
        item.value = ''
      })
      this.$refs.condition.resetFields();
      this.getTableData();
    },
    // 关闭弹窗
    handleClose(done) {
@@ -237,15 +248,15 @@
    handleView(data) {
      this.info = data
      this.dialogView = true
      console.log(data)
    },
    // 自定义关闭弹窗
    // myCloseDialog({flag,str,index}){
    //   console.log( this[str])
    //   if(index === 0){
       
    //   }
    // }
    exportTableData() {
      basecase.exportViolationData({ current: 1 })
          .then(() => {
            this.$message.success('操作成功');
          })
          .catch(err => this.$message.error(err))
    }
  }
}
</script>
@@ -257,7 +268,6 @@
  header {
    background-color: #09152f;
    border: 1pox solid #fff;
    .headerContent {
      padding: 20px 40px;
@@ -285,7 +295,6 @@
    background-color: #09152f;
    margin-top: 20px;
    padding-bottom: 50px;
    border: 1pox solid #fff;
    .mainTitle {
      line-height: 60px;
@@ -330,10 +339,6 @@
          .el-checkbox {
            width: 80px;
            padding: 0 10px;
          }
          .el-select {
            width: 120px;
          }
          &::v-deep .el-input__inner {