|
@@ -33,22 +33,14 @@
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="warning"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleExport"
|
|
|
|
- >导出
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="uavdeptList" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" :data="uavdeptList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
- <el-table-column label="部门名称" align="center" prop="deptName"/>
|
|
|
|
|
|
+ <el-table-column label="部门名称" align="center" prop="mapDeptName"/>
|
|
|
|
+ <el-table-column label="部门类型" align="center" prop="deptProtype" :formatter="deptProtypeFormat" />
|
|
|
|
+ <el-table-column label="指挥中心" align="center" prop="isCommandCenter" :formatter="isCommandCenterFormat" />
|
|
<el-table-column label="添加时间" align="center" prop="createTime"/>
|
|
<el-table-column label="添加时间" align="center" prop="createTime"/>
|
|
<el-table-column label="修改时间" align="center" prop="updateTime"/>
|
|
<el-table-column label="修改时间" align="center" prop="updateTime"/>
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
@@ -82,10 +74,24 @@
|
|
<!-- 添加或修改AI对应部门对话框 -->
|
|
<!-- 添加或修改AI对应部门对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
- <el-form-item label="部门名称" prop="deptId">
|
|
|
|
- <treeselect :options="deptOptions" v-model="form.deptId" :show-count="true" placeholder="请选择部门名称"
|
|
|
|
|
|
+ <el-form-item label="部门名称" prop="mapDeptId">
|
|
|
|
+ <treeselect :options="deptOptions" v-model="form.mapDeptId" :show-count="true" placeholder="请选择部门名称"
|
|
@select="hx"/>
|
|
@select="hx"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="部门类型" prop="deptProtype">
|
|
|
|
+ <el-select v-model="form.deptProtype" placeholder="请输入部门类型">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in deptProtypeOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="指挥中心" prop="isCommandCenter">
|
|
|
|
+ <el-radio v-model='form.isCommandCenter' :label='0'>否</el-radio>
|
|
|
|
+ <el-radio v-model='form.isCommandCenter' :label='1'>是</el-radio>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -97,12 +103,12 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
- listUavdept,
|
|
|
|
- getUavdept,
|
|
|
|
- delUavdept,
|
|
|
|
- addUavdept,
|
|
|
|
- updateUavdept
|
|
|
|
-} from "@/api/uav/uavdept/uavdept";
|
|
|
|
|
|
+ listAidevicedept,
|
|
|
|
+ getAidevicedept,
|
|
|
|
+ delAidevicedept,
|
|
|
|
+ addAidevicedept,
|
|
|
|
+ updateAidevicedept
|
|
|
|
+} from "@/api/centerMonitor/aidevicedept/aidevicedept";
|
|
import {treeselect} from "@/api/system/dept";
|
|
import {treeselect} from "@/api/system/dept";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
@@ -138,34 +144,70 @@ export default {
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- uavId: null,
|
|
|
|
- uavName: null,
|
|
|
|
- deptId: null,
|
|
|
|
|
|
+ deviceId: null,
|
|
|
|
+ deviceName: null,
|
|
|
|
+ mapDeptId: null,
|
|
|
|
+ mapDeptName: null,
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
- deptId: [
|
|
|
|
|
|
+ mapDeptId: [
|
|
{required: true, message: "部门名称不能为空", trigger: "blur"}
|
|
{required: true, message: "部门名称不能为空", trigger: "blur"}
|
|
],
|
|
],
|
|
|
|
+ deptProtype: [
|
|
|
|
+ { required: true, message: "部门类型不能为空", trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ isCommandCenter: [
|
|
|
|
+ { required: true, message: "请选择是否指挥中心", trigger: "blur" }
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
|
|
+ deptProtypeOptions: [
|
|
|
|
+ {value: "1", label: '责任单位,接收推送'},
|
|
|
|
+ {value: "2", label: '查看单位'}
|
|
|
|
+ ],
|
|
|
|
+ isCommandCenterOptions: [
|
|
|
|
+ {value: "0", label: '否'},
|
|
|
|
+ {value: "1", label: '是'}
|
|
|
|
+ ],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
uavId: null,
|
|
uavId: null,
|
|
uavName: null,
|
|
uavName: null,
|
|
|
|
+ uavSn: null,
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getList();
|
|
this.getList();
|
|
this.getTreeselect();
|
|
this.getTreeselect();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 部门类型字典翻译
|
|
|
|
+ deptProtypeFormat(row, column) {
|
|
|
|
+ var name = "";
|
|
|
|
+ this.deptProtypeOptions.forEach(function (item, index) {
|
|
|
|
+ if (row.deptProtype == item.value) {
|
|
|
|
+ name = item.label;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return name;
|
|
|
|
+ },
|
|
|
|
+ // 是否指挥中心字典翻译
|
|
|
|
+ isCommandCenterFormat(row, column) {
|
|
|
|
+ var name = "";
|
|
|
|
+ this.isCommandCenterOptions.forEach(function (item, index) {
|
|
|
|
+ if (row.isCommandCenter == item.value) {
|
|
|
|
+ name = item.label;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return name;
|
|
|
|
+ },
|
|
/** 查询AI对应部门列表 */
|
|
/** 查询AI对应部门列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- this.queryParams.uavId = this.uavId;
|
|
|
|
- listUavdept(this.queryParams).then(response => {
|
|
|
|
|
|
+ this.queryParams.deviceId = this.uavId;
|
|
|
|
+ listAidevicedept(this.queryParams).then(response => {
|
|
this.uavdeptList = response.rows;
|
|
this.uavdeptList = response.rows;
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -179,8 +221,8 @@ export default {
|
|
},
|
|
},
|
|
//部门ID、部门名称赋值
|
|
//部门ID、部门名称赋值
|
|
hx(node) {
|
|
hx(node) {
|
|
- this.form.deptId = node.id;
|
|
|
|
- this.form.deptName = node.label
|
|
|
|
|
|
+ this.form.mapDeptId = node.id;
|
|
|
|
+ this.form.mapDeptName = node.label
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
@@ -191,8 +233,8 @@ export default {
|
|
reset() {
|
|
reset() {
|
|
this.form = {
|
|
this.form = {
|
|
id: null,
|
|
id: null,
|
|
- uavId: null,
|
|
|
|
- deptId: null,
|
|
|
|
|
|
+ deviceId: null,
|
|
|
|
+ mapDeptId: null,
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
@@ -215,8 +257,9 @@ export default {
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.reset();
|
|
this.reset();
|
|
- this.form.uavId = this.uavId;
|
|
|
|
- this.form.uavName = this.uavName
|
|
|
|
|
|
+ this.form.deviceId = this.uavId;
|
|
|
|
+ this.form.deviceName = this.uavName;
|
|
|
|
+ this.form.deviceCode = this.uavSn;
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "添加无人机对应部门";
|
|
this.title = "添加无人机对应部门";
|
|
},
|
|
},
|
|
@@ -224,7 +267,7 @@ export default {
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
this.reset();
|
|
this.reset();
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
- getUavdept(id).then(response => {
|
|
|
|
|
|
+ getAidevicedept(id).then(response => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改无人机对应部门";
|
|
this.title = "修改无人机对应部门";
|
|
@@ -235,13 +278,13 @@ export default {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
- updateUavdept(this.form).then(response => {
|
|
|
|
|
|
+ updateAidevicedept(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- addUavdept(this.form).then(response => {
|
|
|
|
|
|
+ addAidevicedept(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
@@ -254,19 +297,13 @@ export default {
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
this.$modal.confirm('是否确认删除数据项?').then(function () {
|
|
this.$modal.confirm('是否确认删除数据项?').then(function () {
|
|
- return delUavdept(ids);
|
|
|
|
|
|
+ return delAidevicedept(ids);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.getList();
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- /** 导出按钮操作 */
|
|
|
|
- handleExport() {
|
|
|
|
- this.download('center-monitor/aidevicedept/export', {
|
|
|
|
- ...this.queryParams
|
|
|
|
- }, `aidevicedept_${new Date().getTime()}.xlsx`)
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|