|
@@ -26,7 +26,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['park:proj:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -37,7 +38,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['park:proj:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -48,7 +50,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['park:proj:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -58,18 +61,25 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['park:proj:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="projList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="编号" align="center" prop="id" />
|
|
|
- <el-table-column label="巡检内容" align="center" prop="projContent" />
|
|
|
- <el-table-column label="经度" align="center" prop="lng" />
|
|
|
- <el-table-column label="维度" align="center" prop="lat" />
|
|
|
- <el-table-column label="有效半径" align="center" prop="radius" />
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="编号" align="center" prop="id"/>
|
|
|
+ <el-table-column label="巡检内容" align="center" prop="projContent">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-for="item in scope.row.projContent">
|
|
|
+ {{ item.projName }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="经度" align="center" prop="lng"/>
|
|
|
+ <el-table-column label="维度" align="center" prop="lat"/>
|
|
|
+ <el-table-column label="有效半径" align="center" prop="radius"/>
|
|
|
<el-table-column label="巡检类型" align="center" prop="projType">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.inspect_proj_type" :value="scope.row.projType"/>
|
|
@@ -83,14 +93,16 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['park:proj:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['park:proj:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -105,19 +117,7 @@
|
|
|
|
|
|
<!-- 添加或修改巡检项对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
|
|
- <el-form-item label="巡检内容">
|
|
|
- <editor v-model="form.projContent" :min-height="192"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="经度" prop="lng">
|
|
|
- <el-input v-model="form.lng" placeholder="请输入经度" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="维度" prop="lat">
|
|
|
- <el-input v-model="form.lat" placeholder="请输入维度" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="有效半径" prop="radius">
|
|
|
- <el-input v-model="form.radius" placeholder="请输入有效半径" />
|
|
|
- </el-form-item>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="巡检类型" prop="projType">
|
|
|
<el-select v-model="form.projType" placeholder="请选择巡检类型">
|
|
|
<el-option
|
|
@@ -128,8 +128,17 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="租户id" prop="tenantId">
|
|
|
- <el-input v-model="form.tenantId" placeholder="请输入租户id" />
|
|
|
+ <el-form-item label="巡检内容">
|
|
|
+ <el-input v-model="form.projContent" placeholder="请输入巡检内容"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="经度" prop="lng">
|
|
|
+ <el-input v-model="form.lng" placeholder="请输入经度"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="维度" prop="lat">
|
|
|
+ <el-input v-model="form.lat" placeholder="请输入维度"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="有效半径(m)" prop="radius">
|
|
|
+ <el-input v-model="form.radius" placeholder="请输入有效半径"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -141,7 +150,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listProj, getProj, delProj, addProj, updateProj } from "@/api/park/proj";
|
|
|
+import {addProj, delProj, getProj, listProj, updateProj} from "@/api/park/proj";
|
|
|
|
|
|
export default {
|
|
|
name: "Proj",
|
|
@@ -176,8 +185,7 @@ export default {
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -228,7 +236,7 @@ export default {
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
+ this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
@@ -243,6 +251,7 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getProj(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
+ this.form.projContent = this.form.projContent[0]?.projName;
|
|
|
this.open = true;
|
|
|
this.title = "修改巡检项";
|
|
|
});
|
|
@@ -250,15 +259,21 @@ export default {
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
+ let params = JSON.parse(JSON.stringify(this.form))
|
|
|
+ if (this.form.projContent != null) {
|
|
|
+ params.projContent = [{
|
|
|
+ projName: this.form.projContent
|
|
|
+ }]
|
|
|
+ }
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
- updateProj(this.form).then(response => {
|
|
|
+ updateProj(params).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addProj(this.form).then(response => {
|
|
|
+ addProj(params).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
@@ -270,12 +285,13 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除巡检项编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ this.$modal.confirm('是否确认删除巡检项编号为"' + ids + '"的数据项?').then(function () {
|
|
|
return delProj(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|