fuliqi
2024-11-14 7603e24bb41407d62d2335276758a61270530067
src/views/system/point/index.vue
@@ -1,8 +1,23 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" @submit.native.prevent>
      <el-form-item label="点位名称" prop="pointName">
        <el-input v-model="queryParams.pointName" placeholder="输入点位名称" clearable @keyup.enter.native="handleQuery" />
        <el-input v-model="queryParams.pointName" placeholder="输入点位名称" clearable @clear="handleQuery" @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="单位" prop="unit">
        <el-select
          v-model="queryParams.unitId"
          placeholder="请选择单位"
          clearable
          @change="handleQuery"
        >
          <el-option
            v-for="unit in unitList"
            :key="unit.id"
            :label="unit.value"
            :value="unit.id"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -61,6 +76,7 @@
              size="small"
              v-model="ywTimes"
              type="daterange"
              value-format="yyyy-MM-dd"
              range-separator="至"
              start-placeholder="更换运维时间"
              end-placeholder="更换运维时间">
@@ -142,7 +158,7 @@
              </el-cascader>
            </el-form-item>
            <el-form-item label="运维单位" prop="unitId">
              <el-select v-model="form.unitId" placeholder="运维单位">
              <el-select v-model="form.unitId" placeholder="运维单位" clearable @clear = "clearTime">
                <el-option v-for="item in unitList" :key="item.id" :label="item.value" :value="item.id">
                </el-option>
              </el-select>
@@ -245,7 +261,6 @@
import { unitSelect } from "@/api/platform/unit";
import { getCascader } from '@/api/platform/region'
import { cascader } from '@/api/system/dept'
export default {
  name: "Point",
  dicts: ['point_tag', 'area_code'],
@@ -258,7 +273,7 @@
      provinceTag: false,
      importantCommandImageTag: false,
      timeList: [],
      timezone: [],
      timezone: null,
      ywTimes: [],
      fileList: [],
      importFile: null,
@@ -339,6 +354,10 @@
    this.getDyColumn();
  },
  methods: {
    clearTime() {
      console.log("生效")
      this.timezone = '';
    },
    getDyColumn() {
      // 查询动态列
      let params = {
@@ -440,7 +459,12 @@
    handleEditBatch() {
      this.batchOpen = true;
    },
    // 运维公司下拉数据
    selectUnit() {
      workList(this.queryParams).then(res => {
        this.unitList = res.data;
      })
    },
    // 获取区县级联
    getCascader() {
      getCascader().then(res => {
@@ -531,6 +555,13 @@
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          if (this.timezone && this.timezone.length > 0) {
            this.form.startTime = this.timezone[0]
            this.form.endTime = this.timezone[1]
          } else {
            this.form.startTime = null
            this.form.endTime = null
          }
          if (this.form.deptId && this.form.deptId.length > 0) {
            this.form.deptId = this.form.deptId[this.form.deptId.length - 1]
          }