|
@@ -28,11 +28,11 @@
|
|
|
placeholder="请输入关键字"
|
|
placeholder="请输入关键字"
|
|
|
@keyup.enter.native="handleQuery"/>
|
|
@keyup.enter.native="handleQuery"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="Iot状态" prop="iotStatus">
|
|
|
|
|
|
|
+ <el-form-item label="链接状态" prop="iotStatus">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="queryParams.iotStatus"
|
|
v-model="queryParams.iotStatus"
|
|
|
clearable
|
|
clearable
|
|
|
- placeholder="请选择服务状态"
|
|
|
|
|
|
|
+ placeholder="请选择链接状态"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in dict.type.iot_connect_status"
|
|
v-for="dict in dict.type.iot_connect_status"
|
|
@@ -49,28 +49,6 @@
|
|
|
placeholder="请输入关键字"
|
|
placeholder="请输入关键字"
|
|
|
@keyup.enter.native="handleQuery"/>
|
|
@keyup.enter.native="handleQuery"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item class="searchTitle" label="上报时间">
|
|
|
|
|
- <DataRangePicker
|
|
|
|
|
- v-model="queryParams.dateRange"
|
|
|
|
|
- key="daterange"
|
|
|
|
|
- type="daterange"
|
|
|
|
|
- :clearable="timeClearable"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="设备类型" prop="deviceType">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryParams.deviceType"
|
|
|
|
|
- clearable
|
|
|
|
|
- placeholder="请选择设备类型"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="dict in dict.type.sensor_device_type"
|
|
|
|
|
- :key="dict.value"
|
|
|
|
|
- :label="dict.label"
|
|
|
|
|
- :value="dict.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>-->
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<el-row :gutter="10">
|
|
<el-row :gutter="10">
|
|
@@ -80,7 +58,7 @@
|
|
|
icon="el-icon-search"
|
|
icon="el-icon-search"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="handleQuery"
|
|
@click="handleQuery"
|
|
|
- >搜索
|
|
|
|
|
|
|
+ >搜索
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
@@ -89,7 +67,7 @@
|
|
|
icon="el-icon-refresh"
|
|
icon="el-icon-refresh"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="resetQuery"
|
|
@click="resetQuery"
|
|
|
- >重置
|
|
|
|
|
|
|
+ >重置
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
@@ -126,15 +104,15 @@
|
|
|
height="600"
|
|
height="600"
|
|
|
size="small"
|
|
size="small"
|
|
|
>
|
|
>
|
|
|
- <el-table-column label="序号" type="index" align="center" width="70">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- {{
|
|
|
|
|
- (queryParams.pageNum - 1) * queryParams.pageSize +
|
|
|
|
|
- scope.$index +
|
|
|
|
|
- 1
|
|
|
|
|
- }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ <el-table-column label="序号" type="index" align="center" width="70">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{
|
|
|
|
|
+ (queryParams.pageNum - 1) * queryParams.pageSize +
|
|
|
|
|
+ scope.$index +
|
|
|
|
|
+ 1
|
|
|
|
|
+ }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="地区" align="center" prop="firstOrgName" width="120"/>
|
|
<el-table-column label="地区" align="center" prop="firstOrgName" width="120"/>
|
|
|
<el-table-column label="行社名称" align="center" prop="secondOrgName" width="220"/>
|
|
<el-table-column label="行社名称" align="center" prop="secondOrgName" width="220"/>
|
|
|
<el-table-column label="所属机构" align="center" prop="orgName" width="150"/>
|
|
<el-table-column label="所属机构" align="center" prop="orgName" width="150"/>
|
|
@@ -142,7 +120,7 @@
|
|
|
<el-table-column label="Iot编码" align="center" prop="iotCode" width="220" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="Iot编码" align="center" prop="iotCode" width="220" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="Iot注册码" align="center" prop="registerCode" width="220"/>
|
|
<el-table-column label="Iot注册码" align="center" prop="registerCode" width="220"/>
|
|
|
<el-table-column label="Iot服务IP" align="center" prop="iotIp" width="150"/>
|
|
<el-table-column label="Iot服务IP" align="center" prop="iotIp" width="150"/>
|
|
|
- <el-table-column label="状态" align="center" prop="iotStatus" width="150">
|
|
|
|
|
|
|
+ <el-table-column label="链接状态" align="center" prop="iotStatus" width="150">
|
|
|
<template slot-scope="r"
|
|
<template slot-scope="r"
|
|
|
>{{
|
|
>{{
|
|
|
getLabel(dict.type.iot_connect_status, r.row.iotStatus, "未知")
|
|
getLabel(dict.type.iot_connect_status, r.row.iotStatus, "未知")
|
|
@@ -150,6 +128,13 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="状态更新时间" align="center" prop="lastConnectTime" width="180"/>
|
|
<el-table-column label="状态更新时间" align="center" prop="lastConnectTime" width="180"/>
|
|
|
|
|
+ <el-table-column label="状态" align="center" prop="enable" width="150">
|
|
|
|
|
+ <template slot-scope="r"
|
|
|
|
|
+ >{{
|
|
|
|
|
+ getLabel(dict.type.sys_normal_disable, r.row.enable.toString(), "未知")
|
|
|
|
|
+ }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="操作"
|
|
label="操作"
|
|
|
align="center"
|
|
align="center"
|
|
@@ -158,12 +143,12 @@
|
|
|
class-name="small-padding fixed-width"
|
|
class-name="small-padding fixed-width"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
-<!-- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="text"
|
|
|
|
|
- icon="el-icon-view"
|
|
|
|
|
- @click="lookView(scope.row)"
|
|
|
|
|
- >历史数据</el-button>-->
|
|
|
|
|
|
|
+ <!-- <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
|
+ @click="lookView(scope.row)"
|
|
|
|
|
+ >历史数据</el-button>-->
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
@@ -175,7 +160,6 @@
|
|
|
|
|
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- <DetailDialog ref="detailDialog" @success="refresh(true)"></DetailDialog>
|
|
|
|
|
<pagination
|
|
<pagination
|
|
|
v-show="total > 0"
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
:total="total"
|
|
@@ -228,6 +212,17 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="状态" prop="enable">
|
|
|
|
|
+ <el-radio-group v-model="form.enable">
|
|
|
|
|
+ <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">
|
|
|
|
|
+ {{ dict.label }}
|
|
|
|
|
+ </el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -239,18 +234,18 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import {list, add, getIot, edit} from "@/api/iot/server";
|
|
|
|
|
-import { getLabel } from "./../../commonOption";
|
|
|
|
|
-import DetailDialog from "./dialog.detail.vue";
|
|
|
|
|
|
|
+import {add, edit, getIot, list} from "@/api/iot/server";
|
|
|
|
|
+import {getLabel} from "./../../commonOption";
|
|
|
import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
|
|
import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
|
|
|
|
+import {mapGetters} from "vuex";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
|
import orgSelect from "@/components/orgSelect/zl.orgSelect.vue";
|
|
import orgSelect from "@/components/orgSelect/zl.orgSelect.vue";
|
|
|
import {deptTreeSelect} from "@/api/system/public";
|
|
import {deptTreeSelect} from "@/api/system/public";
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
- components: { orgSelect, OrgTree,DetailDialog },
|
|
|
|
|
|
|
+ components: {orgSelect, OrgTree},
|
|
|
name: "Task",
|
|
name: "Task",
|
|
|
- dicts: ["sys_org_type",'iot_connect_status'],
|
|
|
|
|
|
|
+ dicts: ["sys_org_type", 'iot_connect_status', 'sys_normal_disable'],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -280,12 +275,13 @@ export default {
|
|
|
iotStatus: null,
|
|
iotStatus: null,
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
- iotName: [{ required: true, message: "请输入Iot名称", trigger: "blur" }],
|
|
|
|
|
- orgId: [{ required: true, message: "请选择所属机构", trigger: "blur" }],
|
|
|
|
|
|
|
+ iotName: [{required: true, message: "请输入Iot名称", trigger: "blur"}],
|
|
|
|
|
+ orgId: [{required: true, message: "请选择所属机构", trigger: "blur"}],
|
|
|
|
|
+ enable: [{required: true, message: "请选择是否启用", trigger: "blur"}],
|
|
|
},
|
|
},
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
|
- dataList:[],
|
|
|
|
|
|
|
+ dataList: [],
|
|
|
deptOptions: [],
|
|
deptOptions: [],
|
|
|
|
|
|
|
|
};
|
|
};
|
|
@@ -311,7 +307,8 @@ export default {
|
|
|
closeHandler() {
|
|
closeHandler() {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
},
|
|
},
|
|
|
- handleImport() {},
|
|
|
|
|
|
|
+ handleImport() {
|
|
|
|
|
+ },
|
|
|
getDefaultOrg(org) {
|
|
getDefaultOrg(org) {
|
|
|
this.orgName = org.name;
|
|
this.orgName = org.name;
|
|
|
this.selectedOrgName = org.shortName;
|
|
this.selectedOrgName = org.shortName;
|
|
@@ -348,13 +345,13 @@ export default {
|
|
|
id: null,
|
|
id: null,
|
|
|
orgId: null,
|
|
orgId: null,
|
|
|
iotName: null,
|
|
iotName: null,
|
|
|
|
|
+ enable: null,
|
|
|
};
|
|
};
|
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
this.queryParams.pageNum = 1;
|
|
|
- //this.queryParams.dateRange = [];
|
|
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -366,20 +363,22 @@ export default {
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "新增Iot服务";
|
|
this.title = "新增Iot服务";
|
|
|
},
|
|
},
|
|
|
- editIot(){
|
|
|
|
|
|
|
+ editIot() {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
this.$refs["form"].validate((valid) => {
|
|
|
- if (this.form.id==null){
|
|
|
|
|
- add(this.form).then(() => {
|
|
|
|
|
- this.closeDialog();
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.$modal.msgSuccess("新增成功,等待Iot服务接入!");
|
|
|
|
|
- })
|
|
|
|
|
- }else {
|
|
|
|
|
- edit(this.form).then(() => {
|
|
|
|
|
- this.closeDialog();
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.$modal.msgSuccess("编辑成功!");
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (this.form.id == null) {
|
|
|
|
|
+ add(this.form).then(() => {
|
|
|
|
|
+ this.closeDialog();
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.$modal.msgSuccess("新增成功,等待Iot服务接入!");
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ edit(this.form).then(() => {
|
|
|
|
|
+ this.closeDialog();
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.$modal.msgSuccess("编辑成功!");
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -389,10 +388,11 @@ export default {
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
this.getDeptTree();
|
|
this.getDeptTree();
|
|
|
this.reset();
|
|
this.reset();
|
|
|
- this.disable=true;
|
|
|
|
|
|
|
+ this.disable = true;
|
|
|
const id = row.id || this.ids;
|
|
const id = row.id || this.ids;
|
|
|
getIot(id).then((response) => {
|
|
getIot(id).then((response) => {
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
|
|
+ this.form.enable = response.data.enable + '';
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "编辑Iot服务";
|
|
this.title = "编辑Iot服务";
|
|
|
});
|
|
});
|
|
@@ -409,7 +409,6 @@ export default {
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
lookView(row) {
|
|
lookView(row) {
|
|
|
- this.$refs["detailDialog"].show(row);
|
|
|
|
|
},
|
|
},
|
|
|
closeDialog() {
|
|
closeDialog() {
|
|
|
this.cancel();
|
|
this.cancel();
|