|
@@ -4,122 +4,160 @@
|
|
|
|
|
|
<el-main>
|
|
|
<div style="margin-bottom: 10px">
|
|
|
- <el-button size="medium" icon="el-icon-back" type="text">返回</el-button>
|
|
|
+ <el-button size="medium" icon="el-icon-back" type="text" @click="back">返回</el-button>
|
|
|
<span style="margin-left: 20px; font-size: 18px">设备列表</span>
|
|
|
</div>
|
|
|
|
|
|
- <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">查询</el-button>
|
|
|
+ <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
<el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
|
|
|
|
|
|
<div style="padding: 10px;background-color: white">
|
|
|
- <el-form :inline="true" :model="searchFormData" style="background-color: white;">
|
|
|
- <el-form-item label="设备名称">
|
|
|
- <el-input placeholder="设备名称" size="mini" v-model="searchFormData.name"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备ip">
|
|
|
- <el-input placeholder="设备ip" size="mini" v-model="searchFormData.ip"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备SN">
|
|
|
- <el-input placeholder="设备SN" size="mini" v-model="searchFormData.sn"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备类型">
|
|
|
- <el-input placeholder="设备类型" size="mini" v-model="searchFormData.type"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="运营商编号">
|
|
|
- <el-input placeholder="运营商编号" size="mini" v-model="searchFormData.operatorNumber"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="项目编号">
|
|
|
- <el-input placeholder="项目编号" size="mini" v-model="searchFormData.projectNumber"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="网关编号">
|
|
|
- <el-input placeholder="网关编号" size="mini" v-model="searchFormData.gatewayNumber"></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
- <el-dialog title="设备" :visible.sync="dialogFormVisible">
|
|
|
- <el-form label-position="left" :model="formData">
|
|
|
- <el-form-item label="设备名称">
|
|
|
- <el-input v-model="formData.name"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备ip">
|
|
|
- <el-input v-model="formData.ip"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备sn">
|
|
|
- <el-input v-model="formData.sn"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备类型">
|
|
|
- <el-input v-model="formData.type"></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="运营商编号">
|
|
|
- <el-input placeholder="运营商编号" size="small" v-model="searchFormData.operatorNumber"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="项目编号">
|
|
|
- <el-input placeholder="项目编号" size="small" v-model="searchFormData.projectNumber"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="网关编号">
|
|
|
- <el-input placeholder="网关编号" size="small" v-model="searchFormData.gatewayNumber"></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancel()">取 消</el-button>
|
|
|
- <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- </el-form>
|
|
|
-
|
|
|
-
|
|
|
- <el-table :data="tableData">
|
|
|
- <el-table-column type="selection"></el-table-column>
|
|
|
- <el-table-column prop="name" label="设备名称"></el-table-column>
|
|
|
- <el-table-column prop="ip" label="设备ip"></el-table-column>
|
|
|
- <el-table-column prop="sn" label="设备sn"></el-table-column>
|
|
|
- <el-table-column prop="type" label="设备类型"></el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="设备状态">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ String(scope.row.deviceStatus) === '0' ? '已禁用' : '正常' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
-
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="medium" @click="showEdit(scope.row)">编辑</el-button>
|
|
|
- <el-button type="text" size="medium" @click="manage(scope.row)">管理</el-button>
|
|
|
- <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
|
|
|
-
|
|
|
- <el-button
|
|
|
- style="color: #c01920"
|
|
|
- type="text"
|
|
|
- size="medium"
|
|
|
- class="delBut non"
|
|
|
- @click="statusHandle(scope.row)"
|
|
|
- >
|
|
|
- {{ scope.row.deviceStatus == '1' ? '禁用' : '启用' }}
|
|
|
- </el-button>
|
|
|
-
|
|
|
-
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- </el-table>
|
|
|
-
|
|
|
-
|
|
|
- <el-pagination
|
|
|
- style="margin-top: 15px;text-align: center"
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :page-size="pager.pageSize"
|
|
|
- :current-page="pager.pageIndex"
|
|
|
- :total="pager.itemCount"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
+ <el-form :inline="true" :model="searchFormData" style="background-color: white;">
|
|
|
+ <el-form-item label="设备名称">
|
|
|
+ <el-input placeholder="设备名称" size="mini" v-model="searchFormData.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备ip">
|
|
|
+ <el-input placeholder="设备ip" size="mini" v-model="searchFormData.ip"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备SN">
|
|
|
+ <el-input placeholder="设备SN" size="mini" v-model="searchFormData.sn"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备类型">
|
|
|
+ <el-input placeholder="设备类型" size="mini" v-model="searchFormData.type"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="运营商编号" style="margin-top: 6px" size="mini">
|
|
|
+ <el-select v-model="searchFormData.operatorNumber" placeholder="运营商编号" style="width: 180px"
|
|
|
+ clearable>
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in operators" :key="index" :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="项目编号" style="margin-top: 6px" size="mini">
|
|
|
+ <el-select v-model="searchFormData.projectNumber" placeholder="项目编号" style="width: 180px;" clearable
|
|
|
+ :disabled="!searchFormData.operatorNumber">
|
|
|
+ <el-option v-for="(item) in projects" :key="item.number" :label="item.number"
|
|
|
+ :value="item.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="网关编号" style="margin-top: 6px" size="mini">
|
|
|
+ <el-select v-model="searchFormData.gatewayNumber" placeholder="网关编号" style="width: 180px;" clearable
|
|
|
+ :disabled="!searchFormData.projectNumber">
|
|
|
+ <el-option v-for="(item) in gateways" :key="item.number" :label="item.number"
|
|
|
+ :value="item.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog title="设备" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;">
|
|
|
+ <el-form label-position="left" :model="formData" :rules="rules" ref="formData">
|
|
|
+ <el-row style="margin-left: 15px">
|
|
|
+ <el-form-item label="设备名称" style="margin-left: 16px" prop="name">
|
|
|
+ <el-input v-model="formData.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备ip" style="margin-left: 26px" prop="ip">
|
|
|
+ <el-input v-model="formData.ip"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row style="margin-left: 15px ; margin-top: 20px;margin-bottom: 20px">
|
|
|
+ <el-form-item label="设备sn" style="margin-left: 28px" prop="sn">
|
|
|
+ <el-input v-model="formData.sn"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备类型" prop="type">
|
|
|
+ <el-input v-model="formData.type"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row style="margin-left: 15px ;margin-bottom: 20px">
|
|
|
+ <el-form-item label="运营商编号" style="margin-left: 0px" prop="operatorNumber">
|
|
|
+ <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 202px"
|
|
|
+ clearable>
|
|
|
+
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in operators" :key="index"
|
|
|
+ :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="项目编号" prop="projectNumber">
|
|
|
+ <el-select v-model="formData.projectNumber" placeholder="项目编号" style="width: 202px"
|
|
|
+ :disabled="!formData.operatorNumber" clearable>
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in projects" :key="index"
|
|
|
+ :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-form-item label="网关编号" style="margin-left: 30px" prop="gatewayNumber">
|
|
|
+ <el-select v-model="formData.gatewayNumber" placeholder="网关编号" style="width: 202px"
|
|
|
+ :disabled="!formData.projectNumber" clearable>
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in gateways" :key="index"
|
|
|
+ :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer" style="text-align: center">
|
|
|
+ <el-button @click="cancel()">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="addOrEditMehtond('formData')">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table :data="tableData">
|
|
|
+ <el-table-column type="selection"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="设备名称"></el-table-column>
|
|
|
+ <el-table-column prop="ip" label="设备ip"></el-table-column>
|
|
|
+ <el-table-column prop="sn" label="设备sn"></el-table-column>
|
|
|
+ <el-table-column prop="type" label="设备类型"></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="设备状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ String(scope.row.deviceStatus) === '0' ? '已禁用' : '正常' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="medium" @click="showEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="text" size="medium" @click="manage(scope.row)">管理</el-button>
|
|
|
+ <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ style="color: #c01920"
|
|
|
+ type="text"
|
|
|
+ size="medium"
|
|
|
+ class="delBut non"
|
|
|
+ @click="statusHandle(scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row.deviceStatus == '1' ? '禁用' : '启用' }}
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+
|
|
|
+ <el-pagination
|
|
|
+ style="margin-top: 15px;text-align: center"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="pager.pageSize"
|
|
|
+ :current-page="pager.pageIndex"
|
|
|
+ :total="pager.itemCount"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
</div>
|
|
|
</el-main>
|
|
|
|
|
@@ -134,6 +172,37 @@ export default {
|
|
|
name: 'project',
|
|
|
data() {
|
|
|
return {
|
|
|
+
|
|
|
+ rules: {
|
|
|
+ operatorNumber: [
|
|
|
+ {required: true, message: '请输入运营商编号', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ projectNumber: [
|
|
|
+ {required: true, message: '请输入项目编号', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ gatewayNumber: [
|
|
|
+ {required: true, message: '请输入网关编号', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ name: [
|
|
|
+ {required: true, message: '请输入设备名称', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ ip: [
|
|
|
+ {required: true, message: '请输入网关ip', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ sn: [
|
|
|
+ {required: true, message: '请输入设备sn', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ type: [
|
|
|
+ {required: true, message: '请输入设备类型', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ },
|
|
|
+
|
|
|
+ gateways: [],
|
|
|
+ projects: [],
|
|
|
+ operators: [],
|
|
|
+ operatorProject: '',
|
|
|
+ projectGateway: '',
|
|
|
+
|
|
|
api: {
|
|
|
list: this.$api.device.list,
|
|
|
delete: this.$api.device.delete,
|
|
@@ -187,6 +256,62 @@ export default {
|
|
|
|
|
|
created: function () {
|
|
|
this.loadData();
|
|
|
+ this.getOperator();
|
|
|
+ },
|
|
|
+
|
|
|
+ watch: {
|
|
|
+ 'searchFormData.operatorNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+ this.searchFormData.projectNumber = ''
|
|
|
+
|
|
|
+ this.operatorProject = oldValue;
|
|
|
+
|
|
|
+ console.log(this.operatorProject)
|
|
|
+
|
|
|
+ this.getProjectNumber();
|
|
|
+ },
|
|
|
+
|
|
|
+ 'searchFormData.projectNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+ this.searchFormData.gatewayNumber = ''
|
|
|
+
|
|
|
+ this.projectGateway = oldValue;
|
|
|
+
|
|
|
+ console.log(this.projectGateway)
|
|
|
+
|
|
|
+ this.getGateway();
|
|
|
+ },
|
|
|
+ 'formData.operatorNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+
|
|
|
+ this.operatorProject = oldValue;
|
|
|
+
|
|
|
+ console.log(this.operatorProject)
|
|
|
+
|
|
|
+ this.getProjectNumber();
|
|
|
+ },
|
|
|
+
|
|
|
+ 'formData.projectNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+
|
|
|
+ this.projectGateway = oldValue;
|
|
|
+
|
|
|
+ console.log(this.projectGateway)
|
|
|
+
|
|
|
+ this.getGateway();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -195,6 +320,38 @@ export default {
|
|
|
this.loadData(index)
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+ getOperator() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.operator.list).then((resp) => {
|
|
|
+ vm.operators = resp.data.data.operators
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getProjectNumber() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.project.list, {
|
|
|
+ params: {
|
|
|
+ operatorNumber: this.operatorProject,
|
|
|
+ }
|
|
|
+ }).then((resp) => {
|
|
|
+ console.log(resp.data.data.projects)
|
|
|
+ vm.projects = resp.data.data.projects
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getGateway() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.gateway.list, {
|
|
|
+ params: {
|
|
|
+ projectNumber: this.projectGateway,
|
|
|
+ }
|
|
|
+ }).then((resp) => {
|
|
|
+ console.log(resp.data.data.gateways)
|
|
|
+ vm.gateways = resp.data.data.gateways
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
loadData(index) {
|
|
|
const vm = this;
|
|
|
vm.$http.get(vm.api.list, {
|
|
@@ -236,90 +393,103 @@ export default {
|
|
|
this.formData.operatorNumber = '',
|
|
|
this.formData.projectNumber = '',
|
|
|
this.formData.gatewayNumber = ''
|
|
|
+ this.addOrEdit = 1
|
|
|
},
|
|
|
|
|
|
showEdit(row) {
|
|
|
-
|
|
|
console.log(row)
|
|
|
|
|
|
this.dialogFormVisible = true;
|
|
|
|
|
|
- this.formData = row
|
|
|
+ this.editRow = JSON.parse(JSON.stringify(row));
|
|
|
+ this.formData = this.editRow
|
|
|
+
|
|
|
|
|
|
this.addOrEdit = 2
|
|
|
},
|
|
|
|
|
|
|
|
|
- addOrEditMehtond() {
|
|
|
- const vm = this;
|
|
|
- if (this.addOrEdit == 2) {
|
|
|
- vm.$http.get(vm.api.update, {
|
|
|
- params: {
|
|
|
- name: this.formData.name,
|
|
|
- ip: this.formData.ip,
|
|
|
- sn: this.formData.sn,
|
|
|
- type: this.formData.type,
|
|
|
-
|
|
|
- operatorNumber: this.formData.operatorNumber,
|
|
|
- projectNumber: this.formData.projectNumber,
|
|
|
- gatewayNumber: this.formData.gatewayNumber,
|
|
|
- operatorCode: this.formData.operatorCode,
|
|
|
- projectCode: this.formData.projectCode,
|
|
|
- gatewayCode: this.formData.gatewayCode,
|
|
|
- }
|
|
|
- })
|
|
|
- .then((response) => {
|
|
|
- console.log(response)
|
|
|
+ addOrEditMehtond(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const vm = this;
|
|
|
+ if (this.addOrEdit == 2) {
|
|
|
+ vm.$http.get(vm.api.update, {
|
|
|
+ params: {
|
|
|
+ code: this.editRow.code,
|
|
|
+ name: this.formData.name,
|
|
|
+ ip: this.formData.ip,
|
|
|
+ sn: this.formData.sn,
|
|
|
+ type: this.formData.type,
|
|
|
+
|
|
|
+ operatorNumber: this.formData.operatorNumber,
|
|
|
+ projectNumber: this.formData.projectNumber,
|
|
|
+ gatewayNumber: this.formData.gatewayNumber,
|
|
|
+ operatorCode: this.formData.operatorCode,
|
|
|
+ projectCode: this.formData.projectCode,
|
|
|
+ gatewayCode: this.formData.gatewayCode,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
+ console.log(response)
|
|
|
|
|
|
- if (response.data.status == 200) {
|
|
|
+ if (response.data.status == 200) {
|
|
|
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- showClose: true,
|
|
|
- message: response.data.desc
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ message: response.data.desc
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- this.dialogFormVisible = false;
|
|
|
+ this.dialogFormVisible = false;
|
|
|
|
|
|
- this.loadData();
|
|
|
+ this.loadData();
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ if (this.addOrEdit == 1) {
|
|
|
+ vm.$http.get(vm.api.add, {
|
|
|
+ params: {
|
|
|
+ name: this.formData.name,
|
|
|
+ ip: this.formData.ip,
|
|
|
+ sn: this.formData.sn,
|
|
|
+ type: this.formData.type,
|
|
|
+ deviceStatus: 1,
|
|
|
+
|
|
|
+ operatorNumber: this.formData.operatorNumber,
|
|
|
+ projectNumber: this.formData.projectNumber,
|
|
|
+ gatewayNumber: this.formData.gatewayNumber,
|
|
|
+ operatorCode: this.formData.operatorCode,
|
|
|
+ projectCode: this.formData.projectCode,
|
|
|
+ gatewayCode: this.formData.gatewayCode,
|
|
|
+ }
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- });
|
|
|
- }
|
|
|
+ .then((response) => {
|
|
|
+ if (response.data.status == 200) {
|
|
|
|
|
|
- if (this.addOrEdit == 1) {
|
|
|
- vm.$http.get(vm.api.add, {
|
|
|
- params: {
|
|
|
- name: this.formData.name,
|
|
|
- ip: this.formData.ip,
|
|
|
- sn: this.formData.sn,
|
|
|
- type: this.formData.type,
|
|
|
-
|
|
|
- operatorNumber: this.formData.operatorNumber,
|
|
|
- projectNumber: this.formData.projectNumber,
|
|
|
- gatewayNumber: this.formData.gatewayNumber,
|
|
|
- operatorCode: this.formData.operatorCode,
|
|
|
- projectCode: this.formData.projectCode,
|
|
|
- gatewayCode: this.formData.gatewayCode,
|
|
|
- }
|
|
|
- })
|
|
|
- .then((response) => {
|
|
|
- if (response.data.status == 200) {
|
|
|
+ this.dialogFormVisible = false;
|
|
|
|
|
|
- this.dialogFormVisible = false;
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ message: response.data.desc
|
|
|
+ })
|
|
|
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- showClose: true,
|
|
|
- message: response.data.desc
|
|
|
+ this.loadData();
|
|
|
+ }
|
|
|
})
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
- this.loadData();
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
del(row) {
|
|
@@ -360,6 +530,7 @@ export default {
|
|
|
type: 'info'
|
|
|
});
|
|
|
|
|
|
+ this.$refs.formData.clearValidate();
|
|
|
this.dialogFormVisible = false;
|
|
|
},
|
|
|
|
|
@@ -413,15 +584,20 @@ export default {
|
|
|
|
|
|
manage() {
|
|
|
let vm = this;
|
|
|
- vm.$router.push('/runningState')
|
|
|
- }
|
|
|
+ vm.$router.push('/')
|
|
|
+ },
|
|
|
+
|
|
|
+ back() {
|
|
|
+ let vm = this;
|
|
|
+ vm.$router.back()
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.el-form-item{
|
|
|
+.el-form-item {
|
|
|
margin-right: 10px;
|
|
|
margin-left: 10px;
|
|
|
margin-bottom: 10px;
|