Pārlūkot izejas kodu

一河一策管理系统\河道蓝线资源管理\沙场资源管理\垃圾站资源管理\河段资源管理\水库资源管理\河流资源管理\排污口资源管理\涉水桥涵资源管理\闸口资源管理\水利工程资源管理\保洁员管理\河长牌管理\网格管理\水势数据管理

刘浩男 1 gadu atpakaļ
vecāks
revīzija
b0b5233369
27 mainītis faili ar 1069 papildinājumiem un 761 dzēšanām
  1. 17 1
      data-ui/src/views/data/digitalwater/battlefield/index.vue
  2. 224 208
      data-ui/src/views/data/digitalwater/ceaner/index.vue
  3. 305 286
      data-ui/src/views/data/digitalwater/channelblueline/index.vue
  4. 17 1
      data-ui/src/views/data/digitalwater/garbagestation/index.vue
  5. 266 250
      data-ui/src/views/data/digitalwater/hechang/index.vue
  6. 16 2
      data-ui/src/views/data/digitalwater/length/index.vue
  7. 17 1
      data-ui/src/views/data/digitalwater/outletsewage/index.vue
  8. 17 1
      data-ui/src/views/data/digitalwater/reach/index.vue
  9. 17 1
      data-ui/src/views/data/digitalwater/reservoir/index.vue
  10. 17 1
      data-ui/src/views/data/digitalwater/river/index.vue
  11. 17 1
      data-ui/src/views/data/digitalwater/wadebridgeculvert/index.vue
  12. 17 1
      data-ui/src/views/data/digitalwater/watergate/index.vue
  13. 17 1
      data-ui/src/views/data/digitalwater/waterproject/index.vue
  14. 1 0
      src/main/java/com/sooka/sponest/data/digitalresource/mapper/CenterdataTFarmBasicFarmlandMapper.java
  15. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicBattlefieldMapper.xml
  16. 8 2
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicCeanerMapper.xml
  17. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicChannelBluelineMapper.xml
  18. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicGarbageStationMapper.xml
  19. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicOutletSewageMapper.xml
  20. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicReachMapper.xml
  21. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicReservoirMapper.xml
  22. 8 2
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicRiverHechangMapper.xml
  23. 8 2
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicRiverLengthMapper.xml
  24. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicRiverMapper.xml
  25. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicWadeBridgeCulvertMapper.xml
  26. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicWaterGateMapper.xml
  27. 8 0
      src/main/resources/mapper/digitalwater/CenterdataTHydraulicWaterProjectMapper.xml

+ 17 - 1
data-ui/src/views/data/digitalwater/battlefield/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -19,6 +19,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
 <!--      <el-form-item label="法人" prop="legalPerson">-->
 <!--        <el-input-->
 <!--          v-model="queryParams.legalPerson"-->
@@ -299,6 +308,8 @@
           pageSize: 10,
           name: null,
           scale: null,
+          deptId: null,
+          deptName: 0,
           legalPerson: null,
           creditCode: null,
         },
@@ -418,9 +429,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 224 - 208
data-ui/src/views/data/digitalwater/ceaner/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
       <el-form-item label="姓名" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -10,6 +10,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -69,7 +79,7 @@
     <el-table v-loading="loading" :data="ceanerList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="姓名" align="center" prop="name"/>
-<!--      <el-table-column label="性别" align="center" prop="sex"/>-->
+      <!--      <el-table-column label="性别" align="center" prop="sex"/>-->
       <el-table-column label="性别" align="center" prop="sex">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
@@ -121,12 +131,12 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-<!--            <el-form-item label="性别" prop="sex">-->
-<!--              <el-select v-model="form.sex" placeholder="请输入性别">-->
-<!--                <el-option label="男" value="男" />-->
-<!--                <el-option label="女" value="女" />-->
-<!--              </el-select>-->
-<!--            </el-form-item>-->
+            <!--            <el-form-item label="性别" prop="sex">-->
+            <!--              <el-select v-model="form.sex" placeholder="请输入性别">-->
+            <!--                <el-option label="男" value="男" />-->
+            <!--                <el-option label="女" value="女" />-->
+            <!--              </el-select>-->
+            <!--            </el-form-item>-->
             <el-form-item label="性别" prop="sex">
               <el-select v-model="form.sex" placeholder="请选择性别">
                 <el-option
@@ -155,20 +165,20 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="负责区域" prop="area">
-              <el-input v-model="form.area" placeholder="请输入负责区域"  maxlength="20"/>
+              <el-input v-model="form.area" placeholder="请输入负责区域" maxlength="20"/>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
-              <el-input v-model="form.remark" placeholder="请输入备注"  type="textarea" maxlength="200" />
+              <el-input v-model="form.remark" placeholder="请输入备注" type="textarea" maxlength="200"/>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="头像" prop="attachId" >
+            <el-form-item label="头像" prop="attachId">
               <ImageUpload ref="ImageUpload" :limit="1" :fileType="['png', 'jpg', 'jpeg']" :value="form.attachId"
                            @input="getUrl"></ImageUpload>
             </el-form-item>
@@ -184,204 +194,210 @@
 </template>
 
 <script>
-    import {listCeaner, getCeaner, delCeaner, addCeaner, updateCeaner} from "@/api/data/digitalwater/ceaner";
-    import Deptselector from '@/views/components/deptselector.vue';
-    import { validPhoneMobile } from "@/api/rules/rules";
-    import {treeselect} from "@/api/system/dept";
-    import Treeselect from "@riophae/vue-treeselect";
-    import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-    export default {
-        components: {Deptselector,Treeselect},
-      dicts: ['sys_user_sex'],
-        name: "Ceaner",
-        data() {
-            return {
-                // 遮罩层
-                loading: true,
-                deptOptions: undefined,
-                // 选中数组
-                ids: [],
-                // 非单个禁用
-                single: true,
-                // 非多个禁用
-                multiple: true,
-                // 显示搜索条件
-                showSearch: true,
-                // 总条数
-                total: 0,
-                // 保洁员管理表格数据
-                ceanerList: [],
-                // 弹出层标题
-                title: "",
-                // 是否显示弹出层
-                open: false,
-                // 查询参数
-                queryParams: {
-                    pageNum: 1,
-                    pageSize: 10,
-                    name: null,
-                    sex: null,
-                    phone: null,
-                    attachId: null,
-                    area: null,
-                    deptId: null,
-                    deptName: null,
-                    createName: null,
-                    updateName: null,
-                    dataStatus: null
-                },
-                // 表单参数
-                form: {
-                  attachId: null
-                },
-                // 表单校验
-                rules: {
+import {listCeaner, getCeaner, delCeaner, addCeaner, updateCeaner} from "@/api/data/digitalwater/ceaner";
+import Deptselector from '@/views/components/deptselector.vue';
+import {validPhoneMobile} from "@/api/rules/rules";
+import {treeselect} from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
-                    name: [
-                        {required: true, message: "姓名不能为空", trigger: "blur"}
-                    ],
-                    sex: [
-                        {required: true, message: "性别不能为空", trigger: "change"}
-                    ],
-                    phone: [
-                      { validator: validPhoneMobile,trigger: 'blur'}
-                    ],
+export default {
+  components: {Deptselector, Treeselect},
+  dicts: ['sys_user_sex'],
+  name: "Ceaner",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      deptOptions: undefined,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 保洁员管理表格数据
+      ceanerList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        sex: null,
+        phone: null,
+        attachId: null,
+        area: null,
+        deptId: null,
+        deptName: 0,
+        createName: null,
+        updateName: null,
+        dataStatus: null
+      },
+      // 表单参数
+      form: {
+        attachId: null
+      },
+      // 表单校验
+      rules: {
 
-                    deptId: [
-                        {required: true, message: "所属部门不能为空", trigger: "change"}
-                    ],
-                }
-            };
-        },
-        created() {
-            this.getList();
-            this.getTreeselect();
-        },
-        methods: {
-          getTreeselect() {
-            treeselect().then(response => {
-              this.deptOptions = response.data
-            })
-          },
-          hx(node) {
-            this.form.dataDeptId = node.id
-            this.form.deptId = node.id
-            this.form.deptName = node.label
-            this.$refs.form.validateField("deptId")
-          },
-            getUrl(url) {
-                this.form.attachId = url;
-            },
-            setDataDeptId(e) {
-                this.form.deptId = e.deptId;
-                this.form.deptName = e.deptName;
-            },
-            /** 查询保洁员管理列表 */
-            getList() {
-                this.loading = true;
-                listCeaner(this.queryParams).then(response => {
-                    this.ceanerList = response.rows;
-                    this.total = response.total;
-                    this.loading = false;
-                });
-            },
-            // 取消按钮
-            cancel() {
-                this.open = false;
-                this.reset();
-            },
-            // 表单重置
-            reset() {
-                this.form = {
-                    id: null,
-                    name: null,
-                    sex: null,
-                    phone: null,
-                    attachId: null,
-                    area: null,
-                    remark: null,
-                    deptId: null,
-                    deptName: null,
-                    createBy: null,
-                    createName: null,
-                    createTime: null,
-                    updateBy: null,
-                    updateName: null,
-                    updateTime: null,
-                    dataStatus: "0"
-                };
-                this.resetForm("form");
-            },
-            /** 搜索按钮操作 */
-            handleQuery() {
-                this.queryParams.pageNum = 1;
-                this.getList();
-            },
-            /** 重置按钮操作 */
-            resetQuery() {
-                this.resetForm("queryForm");
-                this.handleQuery();
-            },
-            // 多选框选中数据
-            handleSelectionChange(selection) {
-                this.ids = selection.map(item => item.id)
-                this.single = selection.length !== 1
-                this.multiple = !selection.length
-            },
-            /** 新增按钮操作 */
-            handleAdd() {
-                this.reset();
-                this.open = true;
-                this.title = "添加保洁员管理";
-            },
-            /** 修改按钮操作 */
-            handleUpdate(row) {
-                this.reset();
-                const id = row.id || this.ids
-                getCeaner(id).then(response => {
-                    this.form = response.data;
-                    this.open = true;
-                    this.title = "修改保洁员管理";
-                });
-            },
-            /** 提交按钮 */
-            submitForm() {
-              console.log( this.form.sex)
-                this.$refs["form"].validate(valid => {
-                    if (valid) {
-                        if (this.form.id != null) {
-                            updateCeaner(this.form).then(response => {
-                                this.$modal.msgSuccess("修改成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        } else {
-                            addCeaner(this.form).then(response => {
-                                this.$modal.msgSuccess("新增成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        }
-                    }
-                });
-            },
-            /** 删除按钮操作 */
-            handleDelete(row) {
-                const ids = row.id || this.ids;
-                this.$modal.confirm('是否确认删除选中的数据项?').then(function () {
-                    return delCeaner(ids);
-                }).then(() => {
-                    this.getList();
-                    this.$modal.msgSuccess("删除成功");
-                }).catch(() => {
-                });
-            },
-            /** 导出按钮操作 */
-            handleExport() {
-                this.download('center-data/ceaner/export', {
-                    ...this.queryParams
-                }, `保洁员管理_${new Date().getTime()}.xlsx`)
-            }
-        }
+        name: [
+          {required: true, message: "姓名不能为空", trigger: "blur"}
+        ],
+        sex: [
+          {required: true, message: "性别不能为空", trigger: "change"}
+        ],
+        phone: [
+          {validator: validPhoneMobile, trigger: 'blur'}
+        ],
+
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"}
+        ],
+      }
     };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
+    hx(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField("deptId")
+    },
+    getUrl(url) {
+      this.form.attachId = url;
+    },
+    setDataDeptId(e) {
+      this.form.deptId = e.deptId;
+      this.form.deptName = e.deptName;
+    },
+    /** 查询保洁员管理列表 */
+    getList() {
+      this.loading = true;
+      listCeaner(this.queryParams).then(response => {
+        this.ceanerList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        sex: null,
+        phone: null,
+        attachId: null,
+        area: null,
+        remark: null,
+        deptId: null,
+        deptName: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        dataStatus: "0"
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加保洁员管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getCeaner(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改保洁员管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      console.log(this.form.sex)
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateCeaner(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCeaner(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除选中的数据项?').then(function () {
+        return delCeaner(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('center-data/ceaner/export', {
+        ...this.queryParams
+      }, `保洁员管理_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
 </script>

+ 305 - 286
data-ui/src/views/data/digitalwater/channelblueline/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -29,6 +29,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptionsa" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -99,14 +109,14 @@
       <el-table-column label="所在河流" align="center" prop="river">
         <template slot-scope="scope">
           <span v-for="river in riverList" :key="river.id" :label="river.name" :value="river.id">
-            <span v-if="scope.row.river == river.id">{{river.name}}</span>
+            <span v-if="scope.row.river == river.id">{{ river.name }}</span>
           </span>
         </template>
       </el-table-column>
       <el-table-column label="所在河段" align="center" prop="reach">
         <template slot-scope="scope">
           <span v-for="reach in reachList" :key="reach.id" :label="reach.name" :value="reach.id">
-            <span v-if="scope.row.reach == reach.id">{{reach.name}}</span>
+            <span v-if="scope.row.reach == reach.id">{{ reach.name }}</span>
           </span>
         </template>
       </el-table-column>
@@ -175,7 +185,8 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="归属机构" prop="institutionId">
-              <Treeselect v-model="form.institutionId" :options="deptOptionsa" :show-count="true" placeholder="请选择归属机构"
+              <Treeselect v-model="form.institutionId" :options="deptOptionsa" :show-count="true"
+                          placeholder="请选择归属机构"
                           @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
             </el-form-item>
           </el-col>
@@ -240,12 +251,12 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="面积m³" prop="area">
-              <el-input v-model="form.area" placeholder="请输入面积" maxlength = "20"/>
+              <el-input v-model="form.area" placeholder="请输入面积" maxlength="20"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="所属部门" prop="deptId">
-<!--              <Deptselector :setValue=setDataDeptId :dataDeptId="form.deptId"/>-->
+              <!--              <Deptselector :setValue=setDataDeptId :dataDeptId="form.deptId"/>-->
               <treeselect v-model="form.deptId" :options="deptOptionsa" multiple:false :show-count="true"
                           placeholder="请选择部门" @select="bm" :noResultsText="'空'" :noOptionsText="'空'"/>
 
@@ -285,289 +296,297 @@
 </template>
 
 <script>
-    import {
-        addChannelblueline,
-        delChannelblueline,
-        getChannelblueline,
-        listAllReach,
-        listChannelblueline,
-        updateChannelblueline
-    } from "@/api/data/digitalwater/channelblueline";
-    import {listAllRiver} from "@/api/data/digitalwater/reach";
-    import {checkPositiveDecimal,checkLat,checkLon,validPhoneMobile} from "@/api/rules/rules";
-    import {treeselect} from "@/api/system/dept";
-    import Deptselector from '@/views/components/deptselector.vue';
-    import Supermap from '@/views/components/supermap.vue';
-    import Treeselect from "@riophae/vue-treeselect";
-    import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-    import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
-    import ISuperMap from "@/views/data/common/ISuperMap";
-    import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-    import DataImageUpload from "@/components/ImageUpload/dataUpload.vue";
-    export default {
-        name: "Channelblueline",
-        components: {DataImageUpload, Deptselector, Supermap, Treeselect,ISuperMap},
-        dicts: ['centerdata_attr_type'],
-        data() {
-            return {
-                // 遮罩层
-                loading: true,
-                deptOptionsa: undefined,
-                sign: 1,
-                ISuperMapvisible: false,
+import {
+  addChannelblueline,
+  delChannelblueline,
+  getChannelblueline,
+  listAllReach,
+  listChannelblueline,
+  updateChannelblueline
+} from "@/api/data/digitalwater/channelblueline";
+import {listAllRiver} from "@/api/data/digitalwater/reach";
+import {checkPositiveDecimal, checkLat, checkLon, validPhoneMobile} from "@/api/rules/rules";
+import {treeselect} from "@/api/system/dept";
+import Deptselector from '@/views/components/deptselector.vue';
+import Supermap from '@/views/components/supermap.vue';
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
+import ISuperMap from "@/views/data/common/ISuperMap";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import DataImageUpload from "@/components/ImageUpload/dataUpload.vue";
 
-              // 选中数组
-                ids: [],
-                // 非单个禁用
-                single: true,
-                // 非多个禁用
-                multiple: true,
-                // 显示搜索条件
-                showSearch: true,
-                // 总条数
-                total: 0,
-              cameraList:[],//设备集合
-                // 河道蓝线资源表格数据
-                channelbluelineList: [],
-                // 弹出层标题
-                title: "",
-                // 是否显示弹出层
-                open: false,
-                // 查询参数
-                queryParams: {
-                    pageNum: 1,
-                    pageSize: 10,
-                    name: null,
-                    attrType: null,
-                    riverLeader: null,
-                },
-                // 表单参数
-                form: {},
-                checkPositiveDecimal: checkPositiveDecimal,
+export default {
+  name: "Channelblueline",
+  components: {DataImageUpload, Deptselector, Supermap, Treeselect, ISuperMap},
+  dicts: ['centerdata_attr_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      deptOptionsa: undefined,
+      sign: 1,
+      ISuperMapvisible: false,
 
-                // 表单校验
-                rules: {
-                    name: [
-                        {required: true, message: "名称不能为空", trigger: "blur"}
-                    ],
-                    attrType: [
-                        {required: true, message: "属性类型不能为空", trigger: "change"}
-                    ],
-                    institutionId: [
-                        {required: true, message: "归属机构不能为空", trigger: "change"}
-                    ],
-                    river: [
-                        {required: true, message: "所在河流不能为空", trigger: "change"}
-                    ],
-                    reach: [
-                        {required: true, message: "所在河段不能为空", trigger: "change"}
-                    ],
-                    riverLeader: [
-                        {required: true, message: "河长不能为空", trigger: "change"}
-                    ],
-                    longitude: [
-                        {required: true, message: "经度不能为空", trigger: "change"},
-                        {validator: checkLon, trigger: 'blur'}
-                    ],
-                    latitude: [
-                        {required: true, message: "纬度不能为空", trigger: "change"},
-                      {validator: checkLat, trigger: 'blur'}
-                    ],
-                    contactsPhone: [
-                      {required: true, message: '电话不能为空', trigger: 'blur'},
-                      {validator: validPhoneMobile, trigger: 'blur'}
-                    ],
-                    area: [
-                        {validator: checkPositiveDecimal, trigger: 'blur'}
-                    ],
-                    deptId: [
-                        {required: true, message: "所属部门不能为空", trigger: "change"}
-                    ],
-                },
-                showLongitude: false,
-                riverList: [],
-                reachList: []
-            };
-        },
-        created() {
-            this.getList();
-            this.getTreeselect();
-            listAllRiver(this.queryParams).then(response => {
-                this.riverList = response.data;
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      cameraList: [],//设备集合
+      // 河道蓝线资源表格数据
+      channelbluelineList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        attrType: null,
+        riverLeader: null,
+        deptId: null,
+        deptName: 0,
+      },
+      // 表单参数
+      form: {},
+      checkPositiveDecimal: checkPositiveDecimal,
+
+      // 表单校验
+      rules: {
+        name: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        attrType: [
+          {required: true, message: "属性类型不能为空", trigger: "change"}
+        ],
+        institutionId: [
+          {required: true, message: "归属机构不能为空", trigger: "change"}
+        ],
+        river: [
+          {required: true, message: "所在河流不能为空", trigger: "change"}
+        ],
+        reach: [
+          {required: true, message: "所在河段不能为空", trigger: "change"}
+        ],
+        riverLeader: [
+          {required: true, message: "河长不能为空", trigger: "change"}
+        ],
+        longitude: [
+          {required: true, message: "经度不能为空", trigger: "change"},
+          {validator: checkLon, trigger: 'blur'}
+        ],
+        latitude: [
+          {required: true, message: "纬度不能为空", trigger: "change"},
+          {validator: checkLat, trigger: 'blur'}
+        ],
+        contactsPhone: [
+          {required: true, message: '电话不能为空', trigger: 'blur'},
+          {validator: validPhoneMobile, trigger: 'blur'}
+        ],
+        area: [
+          {validator: checkPositiveDecimal, trigger: 'blur'}
+        ],
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"}
+        ],
+      },
+      showLongitude: false,
+      riverList: [],
+      reachList: []
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+    listAllRiver(this.queryParams).then(response => {
+      this.riverList = response.data;
+    });
+    listAllReach(this.queryParams).then(response => {
+      this.reachList = response.data;
+    });
+    selectCenterMonitorlList(this.queryParams).then(response => {
+      this.cameraList = response.data;
+    });
+  },
+  methods: {
+    /** 上传 */
+    getUrl(url) {
+      this.form.attachPaths = url
+    },
+    riverLabel(river) {
+      this.form.riverLabel = river.name
+    },
+    reachLabel(reach) {
+      this.form.reachLabel = reach.name
+    },
+    bm(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField("deptId")
+    },
+    showLatLng: function (lat, lng) {
+      this.form.latitude = lat;
+      this.form.longitude = lng;
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptionsa = response.data;
+      });
+    },
+    hx(node) {
+      this.form.institutionId = node.id;
+      this.form.institutionName = node.label;
+    },
+    /** 查询河道蓝线资源列表 */
+    getList() {
+      this.loading = true;
+      listChannelblueline(this.queryParams).then(response => {
+        this.channelbluelineList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        attrType: null,
+        institutionId: null,
+        institutionName: null,
+        address: null,
+        river: null,
+        reach: null,
+        riverLeader: null,
+        contactsPhone: null,
+        area: null,
+        longitude: null,
+        latitude: null,
+        deptId: null,
+        deptName: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        dataStatus: "0"
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加河道蓝线资源";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getChannelblueline(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改河道蓝线资源";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateChannelblueline(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
             });
-            listAllReach(this.queryParams).then(response => {
-                this.reachList = response.data;
+          } else {
+            addChannelblueline(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
             });
-          selectCenterMonitorlList(this.queryParams).then(response => {
-            this.cameraList = response.data;
-          });
-        },
-        methods: {
-          /** 上传 */
-          getUrl(url) {
-            this.form.attachPaths=url
-          },
-          riverLabel(river) {
-            this.form.riverLabel = river.name
-          },
-          reachLabel(reach) {
-            this.form.reachLabel = reach.name
-          },
-          bm(node) {
-            this.form.dataDeptId = node.id
-            this.form.deptId = node.id
-            this.form.deptName = node.label
-            this.$refs.form.validateField("deptId")
-          },
-            showLatLng: function (lat, lng) {
-                this.form.latitude = lat;
-                this.form.longitude = lng;
-            },
-            /** 查询部门下拉树结构 */
-            getTreeselect() {
-                treeselect().then(response => {
-                    this.deptOptionsa = response.data;
-                });
-            },
-            hx(node) {
-                this.form.institutionId = node.id;
-                this.form.institutionName = node.label;
-            },
-            /** 查询河道蓝线资源列表 */
-            getList() {
-                this.loading = true;
-                listChannelblueline(this.queryParams).then(response => {
-                    this.channelbluelineList = response.rows;
-                    this.total = response.total;
-                    this.loading = false;
-                });
-            },
-            // 取消按钮
-            cancel() {
-                this.open = false;
-                this.reset();
-            },
-            // 表单重置
-            reset() {
-                this.form = {
-                    id: null,
-                    name: null,
-                    attrType: null,
-                    institutionId: null,
-                    institutionName: null,
-                    address: null,
-                    river: null,
-                    reach: null,
-                    riverLeader: null,
-                    contactsPhone: null,
-                    area: null,
-                    longitude: null,
-                    latitude: null,
-                    deptId: null,
-                    deptName: null,
-                    createBy: null,
-                    createName: null,
-                    createTime: null,
-                    updateBy: null,
-                    updateName: null,
-                    updateTime: null,
-                    dataStatus: "0"
-                };
-                this.resetForm("form");
-            },
-            /** 搜索按钮操作 */
-            handleQuery() {
-                this.queryParams.pageNum = 1;
-                this.getList();
-            },
-            /** 重置按钮操作 */
-            resetQuery() {
-                this.resetForm("queryForm");
-                this.handleQuery();
-            },
-            // 多选框选中数据
-            handleSelectionChange(selection) {
-                this.ids = selection.map(item => item.id)
-                this.single = selection.length !== 1
-                this.multiple = !selection.length
-            },
-            /** 新增按钮操作 */
-            handleAdd() {
-                this.reset();
-                this.open = true;
-                this.title = "添加河道蓝线资源";
-            },
-            /** 修改按钮操作 */
-            handleUpdate(row) {
-                this.reset();
-                const id = row.id || this.ids
-                getChannelblueline(id).then(response => {
-                    this.form = response.data;
-                    this.open = true;
-                    this.title = "修改河道蓝线资源";
-                });
-            },
-            /** 提交按钮 */
-            submitForm() {
-                this.$refs["form"].validate(valid => {
-                    if (valid) {
-                        if (this.form.id != null) {
-                            updateChannelblueline(this.form).then(response => {
-                                this.$modal.msgSuccess("修改成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        } else {
-                            addChannelblueline(this.form).then(response => {
-                                this.$modal.msgSuccess("新增成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        }
-                    }
-                });
-            },
-            /** 删除按钮操作 */
-            handleDelete(row) {
-                const ids = row.id || this.ids;
-                this.$modal.confirm('是否确认删除所选数据项?').then(function () {
-                    return delChannelblueline(ids);
-                }).then(() => {
-                    this.getList();
-                    this.$modal.msgSuccess("删除成功");
-                }).catch(() => {
-                });
-            },
-
-          showMap() {
-            this.ISuperMapvisible = true;
-            this.$nextTick(() => {
-              this.$refs.ISuperMap.init(this.sign, {
-                id: this.form.id,
-                longitude: this.form.longitude,
-                latitude: this.form.latitude,
-                xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
-              })
-            })
-          },
-          send(val) {
-            if (val===true){
-              this.ISuperMapvisible = false;
-              return;
-            }
-            if (this.sign === 1) {
-              this.form.longitude = val.longitude;
-              this.form.latitude = val.latitude;
-            }
-            if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
-            this.ISuperMapvisible = false
-          },
-            /** 导出按钮操作 */
-            handleExport() {
-                this.download('sooka-sponest-center-data/channelblueline/export', {
-                    ...this.queryParams
-                }, `河道蓝线资源_${new Date().getTime()}.xlsx`)
-            }
+          }
         }
-    };
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除所选数据项?').then(function () {
+        return delChannelblueline(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+
+    showMap() {
+      this.ISuperMapvisible = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.init(this.sign, {
+          id: this.form.id,
+          longitude: this.form.longitude,
+          latitude: this.form.latitude,
+          xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
+        })
+      })
+    },
+    send(val) {
+      if (val === true) {
+        this.ISuperMapvisible = false;
+        return;
+      }
+      if (this.sign === 1) {
+        this.form.longitude = val.longitude;
+        this.form.latitude = val.latitude;
+      }
+      if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
+      this.ISuperMapvisible = false
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('sooka-sponest-center-data/channelblueline/export', {
+        ...this.queryParams
+      }, `河道蓝线资源_${new Date().getTime()}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    }
+  }
+};
 </script>

+ 17 - 1
data-ui/src/views/data/digitalwater/garbagestation/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -28,6 +28,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -267,6 +276,8 @@
           name: null,
           code: null,
           principal: null,
+          deptId: null,
+          deptName: 0,
         },
         // 表单参数
         form: {},
@@ -368,9 +379,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 266 - 250
data-ui/src/views/data/digitalwater/hechang/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -10,6 +10,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -167,259 +177,265 @@
 </template>
 
 <script>
-    import {listHechang, getHechang, delHechang, addHechang, updateHechang} from "@/api/data/digitalwater/hechang";
-    import {listAll} from "@/api/data/digitalwater/length";
+import {listHechang, getHechang, delHechang, addHechang, updateHechang} from "@/api/data/digitalwater/hechang";
+import {listAll} from "@/api/data/digitalwater/length";
 
-    import deptselector from '@/views/components/deptselector'
-    import supermap from '@/views/components/supermap'
-    import {checkLat,checkLon} from "@/api/rules/rules";
-    import {treeselect} from "@/api/system/dept";
-    import ISuperMap from "@/views/data/common/ISuperMap";
-    import Treeselect from "@riophae/vue-treeselect";
-    import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-    export default {
-        components: {
-            deptselector,
-            supermap,
-          ISuperMap,
-          Treeselect
-        },
-        name: "Hechang",
-        data() {
-            return {
-                // 信息弹出层上的坐标弹层
-                showLongitude: false,
-                titleLongitude: '',
-                deptOptions: undefined,
-                sign: 1,
-                ISuperMapvisible: false,
+import deptselector from '@/views/components/deptselector'
+import supermap from '@/views/components/supermap'
+import {checkLat, checkLon} from "@/api/rules/rules";
+import {treeselect} from "@/api/system/dept";
+import ISuperMap from "@/views/data/common/ISuperMap";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
-              // 遮罩层
-                loading: true,
-                // 选中数组
-                ids: [],
-                // 非单个禁用
-                single: true,
-                // 非多个禁用
-                multiple: true,
-                // 显示搜索条件
-                showSearch: true,
-                // 总条数
-                total: 0,
-                // 河长牌表格数据
-                hechangList: [],
-                lengthList: [],
-                // 弹出层标题
-                title: "",
-                // 是否显示弹出层
-                open: false,
-                // 查询参数
-                queryParams: {
-                    pageNum: 1,
-                    pageSize: 10,
-                    name: null,
-                    number: null,
-                    longitude: null,
-                    latitude: null,
-                    hechangId: null,
-                    address: null,
-                    introduction: null,
-                    attachId: null,
-                    deptId: null,
-                    deptName: null,
-                    createName: null,
-                    updateName: null,
-                    dataStatus: null
-                },
-                // 表单参数
-                form: {
-                    dataDeptId: '',
-                    dialogImageUrl: '',
-                  attachId:null,
-                },
-                // 表单校验
-                rules: {
-                    name: [
-                        {required: true, message: '名称不能为空', trigger: 'blur'}
-                    ],
-                    deptId: [
-                        {required: true, message: '所属部门不能为空', trigger: 'change'}
-                    ],
-                    longitude: [
-                        {required: true, message: '经度不能为空', trigger: 'change'},
-                      {validator: checkLon, trigger: 'blur'}
-                    ],
-                    latitude: [
-                        {required: true, message: '纬度不能为空', trigger: 'change'},
-                        {validator: checkLat, trigger: 'blur'}
-                    ],
-                    hechangId: [
-                        {required: true, message: '所属河长不能为空', trigger: 'change'}
-                    ]
+export default {
+  components: {
+    deptselector,
+    supermap,
+    ISuperMap,
+    Treeselect
+  },
+  name: "Hechang",
+  data() {
+    return {
+      // 信息弹出层上的坐标弹层
+      showLongitude: false,
+      titleLongitude: '',
+      deptOptions: undefined,
+      sign: 1,
+      ISuperMapvisible: false,
 
-                }
-            };
-        },
-        created() {
-            this.getList();
-            this.getTreeselect();
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 河长牌表格数据
+      hechangList: [],
+      lengthList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        number: null,
+        longitude: null,
+        latitude: null,
+        hechangId: null,
+        address: null,
+        introduction: null,
+        attachId: null,
+        deptId: null,
+        deptName: 0,
+        createName: null,
+        updateName: null,
+        dataStatus: null
+      },
+      // 表单参数
+      form: {
+        dataDeptId: '',
+        dialogImageUrl: '',
+        attachId: null,
+      },
+      // 表单校验
+      rules: {
+        name: [
+          {required: true, message: '名称不能为空', trigger: 'blur'}
+        ],
+        deptId: [
+          {required: true, message: '所属部门不能为空', trigger: 'change'}
+        ],
+        longitude: [
+          {required: true, message: '经度不能为空', trigger: 'change'},
+          {validator: checkLon, trigger: 'blur'}
+        ],
+        latitude: [
+          {required: true, message: '纬度不能为空', trigger: 'change'},
+          {validator: checkLat, trigger: 'blur'}
+        ],
+        hechangId: [
+          {required: true, message: '所属河长不能为空', trigger: 'change'}
+        ]
 
-        },
-        methods: {
-          getTreeselect() {
-            treeselect().then(response => {
-              this.deptOptions = response.data
-            })
-          },
-          hx(node) {
-            this.form.dataDeptId = node.id
-            this.form.deptId = node.id
-            this.form.deptName = node.label
-            this.$refs.form.validateField("deptId")
-          },
-          showMap() {
-            this.ISuperMapvisible = true;
-            this.$nextTick(() => {
-              this.$refs.ISuperMap.init(this.sign, {
-                id: this.form.id,
-                longitude: this.form.longitude,
-                latitude: this.form.latitude,
-                xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
-              })
-            })
-          },
-          send(val) {
-            if (val===true){
-              this.ISuperMapvisible = false;
-              return;
-            }
-            if (this.sign === 1) {
-              this.form.longitude = val.longitude;
-              this.form.latitude = val.latitude;
-            }
-            if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
-            this.ISuperMapvisible = false
-          },
-            getUrl(url) {
-                this.form.dialogImageUrl = url;
-                this.form.attachId = url;
-            },
-            setDataDeptId(e) {
-                this.form.deptId = e.deptId
-                this.form.deptName = e.deptName
-            },
-            /** 查询河长牌列表 */
-            getList() {
-                this.loading = true;
-                listHechang(this.queryParams).then(response => {
-                    this.hechangList = response.rows;
-                    this.total = response.total;
-                    this.loading = false;
-                });
-                this.queryParams.type = 2
-                listAll(this.queryParams).then(response => {
-                    this.lengthList = response.data
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
 
-                });
-            },
-            // 取消按钮
-            cancel() {
-                this.open = false;
-                this.reset();
-            },
-            // 表单重置
-            reset() {
-                this.form = {
-                    id: null,
-                    name: null,
-                    number: null,
-                    longitude: null,
-                    latitude: null,
-                    hechangId: null,
-                    address: null,
-                    introduction: null,
-                    attachId: null,
-                    deptId: null,
-                    deptName: null,
-                    createBy: null,
-                    createName: null,
-                    createTime: null,
-                    updateBy: null,
-                    updateName: null,
-                    updateTime: null,
-                    dataStatus: "0"
-                };
-                this.resetForm("form");
-            },
-            /** 搜索按钮操作 */
-            handleQuery() {
-                this.queryParams.pageNum = 1;
-                this.getList();
-            },
-            /** 重置按钮操作 */
-            resetQuery() {
-                this.resetForm("queryForm");
-                this.handleQuery();
-            },
-            // 多选框选中数据
-            handleSelectionChange(selection) {
-                this.ids = selection.map(item => item.id)
-                this.single = selection.length !== 1
-                this.multiple = !selection.length
-            },
-            /** 新增按钮操作 */
-            handleAdd() {
-                this.reset();
-                this.open = true;
-                this.title = "添加河长牌";
-            },
-            /** 修改按钮操作 */
-            handleUpdate(row) {
-                this.reset();
-                const id = row.id || this.ids
-                getHechang(id).then(response => {
-                    this.form = response.data;
-                    this.open = true;
-                    this.title = "修改河长牌";
-                });
-            },
-            /** 提交按钮 */
-            submitForm() {
-                this.$refs["form"].validate(valid => {
-                    if (valid) {
-                        if (this.form.id != null) {
-                            updateHechang(this.form).then(response => {
-                                this.$modal.msgSuccess("修改成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        } else {
-                            addHechang(this.form).then(response => {
-                                this.$modal.msgSuccess("新增成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        }
-                    }
-                });
-            },
-            /** 删除按钮操作 */
-            handleDelete(row) {
-                const ids = row.id || this.ids;
-                this.$modal.confirm('是否确认删除所选数据项?').then(function () {
-                    return delHechang(ids);
-                }).then(() => {
-                    this.getList();
-                    this.$modal.msgSuccess("删除成功");
-                }).catch(() => {
-                });
-            },
-            /** 导出按钮操作 */
-            handleExport() {
-                this.download('sooka-sponest-center-data/hechang/export', {
-                    ...this.queryParams
-                }, `河长牌_${new Date().getTime()}.xlsx`)
-            }
+  },
+  methods: {
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
+    hx(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField("deptId")
+    },
+    showMap() {
+      this.ISuperMapvisible = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.init(this.sign, {
+          id: this.form.id,
+          longitude: this.form.longitude,
+          latitude: this.form.latitude,
+          xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
+        })
+      })
+    },
+    send(val) {
+      if (val === true) {
+        this.ISuperMapvisible = false;
+        return;
+      }
+      if (this.sign === 1) {
+        this.form.longitude = val.longitude;
+        this.form.latitude = val.latitude;
+      }
+      if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
+      this.ISuperMapvisible = false
+    },
+    getUrl(url) {
+      this.form.dialogImageUrl = url;
+      this.form.attachId = url;
+    },
+    setDataDeptId(e) {
+      this.form.deptId = e.deptId
+      this.form.deptName = e.deptName
+    },
+    /** 查询河长牌列表 */
+    getList() {
+      this.loading = true;
+      listHechang(this.queryParams).then(response => {
+        this.hechangList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+      this.queryParams.type = 2
+      listAll(this.queryParams).then(response => {
+        this.lengthList = response.data
+
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        number: null,
+        longitude: null,
+        latitude: null,
+        hechangId: null,
+        address: null,
+        introduction: null,
+        attachId: null,
+        deptId: null,
+        deptName: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        dataStatus: "0"
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加河长牌";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getHechang(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改河长牌";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateHechang(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addHechang(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
         }
-    };
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除所选数据项?').then(function () {
+        return delHechang(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('sooka-sponest-center-data/hechang/export', {
+        ...this.queryParams
+      }, `河长牌_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
 </script>

+ 16 - 2
data-ui/src/views/data/digitalwater/length/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="姓名" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -10,6 +10,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -277,7 +286,7 @@ export default {
         introduction: null,
         riverwayLengthCounty: null,
         deptId: null,
-        deptName: null,
+        deptName: 0,
         createName: null,
         updateName: null,
         dataStatus: null
@@ -412,9 +421,14 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.deptName = 0;
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)

+ 17 - 1
data-ui/src/views/data/digitalwater/outletsewage/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -20,6 +20,15 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -287,6 +296,8 @@
         queryParams: {
           pageNum: 1,
           pageSize: 10,
+          deptId: null,
+          deptName: 0,
           name: null,
           sewageAttr: null,
         },
@@ -432,9 +443,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 17 - 1
data-ui/src/views/data/digitalwater/reach/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -28,6 +28,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -302,6 +311,8 @@
           pageSize: 10,
           name: null,
           code: null,
+          deptId: null,
+          deptName: 0,
           riverLeader: null,
         },
         // 表单参数
@@ -479,9 +490,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 17 - 1
data-ui/src/views/data/digitalwater/reservoir/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -28,6 +28,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -290,6 +299,8 @@
           pageSize: 10,
           name: null,
           scale: null,
+          deptId: null,
+          deptName: 0,
           principal: null,
         },
         // 表单参数
@@ -438,6 +449,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -447,6 +459,10 @@
         this.single = selection.length !== 1
         this.multiple = !selection.length
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       /** 新增按钮操作 */
       handleAdd() {
         this.reset();

+ 17 - 1
data-ui/src/views/data/digitalwater/river/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -28,6 +28,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -274,6 +283,8 @@
           pageSize: 10,
           name: null,
           riverSource: null,
+          deptId: null,
+          deptName: 0,
           estuary: null,
         },
         // 表单参数
@@ -409,9 +420,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 17 - 1
data-ui/src/views/data/digitalwater/wadebridgeculvert/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -19,6 +19,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -259,6 +268,8 @@
         queryParams: {
           pageNum: 1,
           pageSize: 10,
+          deptId: null,
+          deptName: 0,
           name: null,
           texture: null,
         },
@@ -401,9 +412,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 17 - 1
data-ui/src/views/data/digitalwater/watergate/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -10,6 +10,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -266,6 +275,8 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        deptId: null,
+        deptName: 0,
         name: null,
       },
       // 表单参数
@@ -399,9 +410,14 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.deptName = 0;
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)

+ 17 - 1
data-ui/src/views/data/digitalwater/waterproject/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -28,6 +28,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -244,6 +253,8 @@
           pageNum: 1,
           pageSize: 10,
           name: null,
+          deptId: null,
+          deptName: 0,
           projectType: null,
           company: null,
           principal: null,
@@ -355,9 +366,14 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+      },
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)

+ 1 - 0
src/main/java/com/sooka/sponest/data/digitalresource/mapper/CenterdataTFarmBasicFarmlandMapper.java

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.digitalresource.mapper;
 
 import com.sooka.sponest.data.digitalresource.domain.CenterdataTFarmBasicFarmland;
+import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
 

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicBattlefieldMapper.xml

@@ -42,6 +42,14 @@
             <if test="scale != null  and scale != ''">and scale = #{scale}</if>
             <if test="legalPerson != null  and legalPerson != ''">and legal_person = #{legalPerson}</if>
             <if test="creditCode != null  and creditCode != ''">and credit_code = #{creditCode}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 2
src/main/resources/mapper/digitalwater/CenterdataTHydraulicCeanerMapper.xml

@@ -37,8 +37,14 @@
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
             <if test="attachId != null  and attachId != ''">and attach_id = #{attachId}</if>
             <if test="area != null  and area != ''">and area = #{area}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="createName != null  and createName != ''">and create_name like concat('%', #{createName}, '%')
             </if>
             <if test="updateName != null  and updateName != ''">and update_name like concat('%', #{updateName}, '%')

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicChannelBluelineMapper.xml

@@ -41,6 +41,14 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="attrType != null ">and attr_type = #{attrType}</if>
             <if test="riverLeader != null  and riverLeader != ''">and river_leader like concat('%', #{riverLeader}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicGarbageStationMapper.xml

@@ -36,6 +36,14 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="code != null  and code != ''">and code = #{code}</if>
             <if test="principal != null  and principal != ''">and principal = #{principal}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicOutletSewageMapper.xml

@@ -38,6 +38,14 @@
         <where>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="sewageAttr != null ">and sewage_attr = #{sewageAttr}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicReachMapper.xml

@@ -40,6 +40,14 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="code != null  and code != ''">and code = #{code}</if>
             <if test="riverLeader != null  and riverLeader != ''">and river_leader = #{riverLeader}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicReservoirMapper.xml

@@ -41,6 +41,14 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="scale != null  and scale != ''">and scale = #{scale}</if>
             <if test="principal != null  and principal != ''">and principal = #{principal}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 2
src/main/resources/mapper/digitalwater/CenterdataTHydraulicRiverHechangMapper.xml

@@ -42,8 +42,14 @@
             <if test="address != null  and address != ''">and address = #{address}</if>
             <if test="introduction != null  and introduction != ''">and introduction = #{introduction}</if>
             <if test="attachId != null  and attachId != ''">and attach_id = #{attachId}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="createName != null  and createName != ''">and create_name like concat('%', #{createName}, '%')
             </if>
             <if test="updateName != null  and updateName != ''">and update_name like concat('%', #{updateName}, '%')

+ 8 - 2
src/main/resources/mapper/digitalwater/CenterdataTHydraulicRiverLengthMapper.xml

@@ -51,8 +51,14 @@
             <if test="riverwayLengthCounty != null and riverwayLengthCounty != ''">and riverway_length_county =
                 #{riverwayLengthCounty}
             </if>
-            <if test="deptId != null">and dept_id = #{deptId}</if>
-            <if test="deptName != null and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="createName != null and createName != ''">and create_name like concat('%', #{createName}, '%')
             </if>
             <if test="updateName != null and updateName != ''">and update_name like concat('%', #{updateName}, '%')

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicRiverMapper.xml

@@ -38,6 +38,14 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="riverSource != null  and riverSource != ''">and river_source = #{riverSource}</if>
             <if test="estuary != null  and estuary != ''">and estuary = #{estuary}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicWadeBridgeCulvertMapper.xml

@@ -37,6 +37,14 @@
         <where>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="texture != null  and texture != ''">and texture = #{texture}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicWaterGateMapper.xml

@@ -37,6 +37,14 @@
         left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
         <where>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 0
src/main/resources/mapper/digitalwater/CenterdataTHydraulicWaterProjectMapper.xml

@@ -41,6 +41,14 @@
             <if test="projectType != null  and projectType != ''">and project_type = #{projectType}</if>
             <if test="company != null  and company != ''">and company = #{company}</if>
             <if test="principal != null  and principal != ''">and principal = #{principal}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc