|
@@ -1,132 +1,161 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryRef" :inline="true">
|
|
|
- <el-form-item label="关键字" prop="keywords">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.keywords"
|
|
|
- placeholder="请输入关键字"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="所属部门" prop="department">
|
|
|
- <el-tree-select
|
|
|
- v-model="queryParams.department"
|
|
|
- :data="deptOptions"
|
|
|
- :props="{ value: 'id', label: 'label', children: 'children' }"
|
|
|
- value-key="id"
|
|
|
- placeholder="请选择所属部门"
|
|
|
- check-strictly
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="网格类型" prop="listGridCategory">
|
|
|
- <el-select
|
|
|
- v-model="queryParams.listGridCategory"
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
- collapse-tags-tooltip
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 240px"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in gridCategoryList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="隐患分类" prop="listDangerCategory">
|
|
|
- <el-select
|
|
|
- v-model="queryParams.listDangerCategory"
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
- collapse-tags-tooltip
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 240px"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dangerCategoryList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-row>
|
|
|
+ <el-button
|
|
|
+ style="margin:0 0 10px 10px;"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="Close"
|
|
|
+ @click="proxy.$refs['treeDepartment'].setCheckedKeys([])"
|
|
|
+ >清空</el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-tree
|
|
|
+ ref="treeDepartment"
|
|
|
+ style="max-width: 600px"
|
|
|
+ clearable
|
|
|
+ show-checkbox
|
|
|
+ check-strictly
|
|
|
+ :data="deptOptions"
|
|
|
+ :props="{ value: 'id', label: 'label', children: 'children' }"
|
|
|
+ node-key="id"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
/>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="创建时间">
|
|
|
- <el-date-picker
|
|
|
- v-model="dateRangeCreateTime"
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- type="daterange"
|
|
|
- range-separator="-"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :default-time="[
|
|
|
- new Date(2000, 1, 1, 0, 0, 0),
|
|
|
- new Date(2000, 1, 1, 23, 59, 59),
|
|
|
- ]"
|
|
|
- ></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="search" @click="handleQuery"
|
|
|
- >搜索</el-button
|
|
|
- >
|
|
|
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="Plus"
|
|
|
- @click="handleAdd"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
+ </el-row>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- icon="Edit"
|
|
|
- :disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- >修改</el-button
|
|
|
+
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true">
|
|
|
+ <el-form-item label="关键字" prop="keywords">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.keywords"
|
|
|
+ placeholder="请输入关键字"
|
|
|
+ clearable
|
|
|
+ style="width:180px"
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="网格类型" prop="listGridCategory">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.listGridCategory"
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ collapse-tags-tooltip
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width:200px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in gridCategoryList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隐患分类" prop="listDangerCategory">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.listDangerCategory"
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ collapse-tags-tooltip
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width:200px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dangerCategoryList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="search" @click="handleQuery"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-collapse>
|
|
|
+ <el-collapse-item name="1">
|
|
|
+ <template #title>
|
|
|
+ <span style="position:absolute;right:45px;">更多条件</span>
|
|
|
+ </template>
|
|
|
+ <el-form-item label="创建时间">
|
|
|
+ <el-date-picker
|
|
|
+ style="width:220px"
|
|
|
+ v-model="dateRangeCreateTime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-time="[
|
|
|
+ new Date(2000, 1, 1, 0, 0, 0),
|
|
|
+ new Date(2000, 1, 1, 23, 59, 59),
|
|
|
+ ]"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ </el-form>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="Edit"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-table
|
|
|
+ :height="500"
|
|
|
+ :data="dataList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ @row-dblclick="handleDetail"
|
|
|
>
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="网格名称" align="center" prop="gridName" />
|
|
|
+ <el-table-column label="所属部门" align="center" prop="departmentName" />
|
|
|
+ <el-table-column label="网格类型" align="center" prop="gridCategoryTxt" />
|
|
|
+ <el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTimeView" />
|
|
|
+ <el-table-column label="数据创建人" align="center" prop="createByName" />
|
|
|
+ <el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="handleDetail(scope.row)"
|
|
|
+ >详情</el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ icon="Edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >修改</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
- <el-table
|
|
|
- :data="dataList"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- @row-dblclick="handleDetail"
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="网格名称" align="center" prop="gridName" />
|
|
|
- <el-table-column label="所属部门" align="center" prop="departmentName" />
|
|
|
- <el-table-column label="网格类型" align="center" prop="gridCategoryTxt" />
|
|
|
- <el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTimeView" />
|
|
|
- <el-table-column label="数据创建人" align="center" prop="createByName" />
|
|
|
- <el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
|
|
- <template #default="scope">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="handleDetail(scope.row)"
|
|
|
- >详情</el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- icon="Edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- >修改</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
@@ -313,6 +342,7 @@ const queryParams = ref({
|
|
|
keywords: undefined,
|
|
|
listStatus: undefined,
|
|
|
createTime: undefined,
|
|
|
+ listDepartment: [],
|
|
|
listGridCategory: [],
|
|
|
listDangerCategory: [],
|
|
|
});
|
|
@@ -367,6 +397,7 @@ function getList() {
|
|
|
) {
|
|
|
queryParams.value.createTimeRange = dateRangeCreateTime.value.join(" ~ ");
|
|
|
}
|
|
|
+ queryParams.value.listDepartment = proxy.$refs['treeDepartment'] ? proxy.$refs['treeDepartment'].getCheckedKeys() : [];
|
|
|
search(queryParams.value).then((response) => {
|
|
|
for(let i=0; i<response.data.list.length; i++) {
|
|
|
let item = response.data.list[i];
|