|
@@ -1,49 +1,16 @@
|
|
|
<template>
|
|
|
- <div class="nodeLnformation">
|
|
|
- <div class="nodeLnformation_head">
|
|
|
- <div class="manageTitle">节点信息维护</div>
|
|
|
- </div>
|
|
|
- <div class="nodeLnformation_content">
|
|
|
- <org-tree :dataList="dataList" :renderContent="renderContent" @expandData="expandData" />
|
|
|
- </div>
|
|
|
- <!--删除弹框-->
|
|
|
- <Dialog :flag="removeDialogVisible">
|
|
|
- <div class="airportInfoDialog">
|
|
|
- <div class="Deltitle">删除源数据</div>
|
|
|
- <div class="content er">
|
|
|
- <div class="log">
|
|
|
- <span class="DelIcon"></span>您确定是否要删除<span class="DelTxt">{{ rmObj.locationCode }}</span>?
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="DelFoot right t30">
|
|
|
- <el-button size="medium" class="r25 r26" type="danger" @click="removeSubmit()">删除</el-button>
|
|
|
- <el-button size="medium" class="r26" @click="removeDialogVisible = false">取消</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Dialog>
|
|
|
- <!--新增/编辑-->
|
|
|
- <Dialog :flag="editDialogVisible" width="508px" :show-flag="true">
|
|
|
- <div class="airportInfoDialog dialog-public-background">
|
|
|
- <div class="title">{{ editDialogTitle }}</div>
|
|
|
- <div class="content">
|
|
|
- <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="130px" class="demo-ruleForm">
|
|
|
- <el-form-item label="节点名称" prop="locationCode">
|
|
|
- <el-input v-model="ruleForm.locationCode" size="medium" placeholder="请输入节点名称(必填)" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="跟踪节点标识符" prop="nodeCode">
|
|
|
- <el-input v-model="ruleForm.nodeCode" :disabled="disFlag" size="medium" placeholder="请输入跟踪节点标识符(必填)" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="跟踪节点描述" prop="locationCodeDescribe">
|
|
|
- <el-input v-model="ruleForm.locationCodeDescribe" size="medium" type="textarea" :rows="3" placeholder="请输入跟踪节点描述" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <div class="foot center t30">
|
|
|
- <el-button size="medium" type="primary" class="r25 r26" @click="submitClickHandler()">提交</el-button>
|
|
|
- <el-button size="medium" class="r26" @click="resetForm('ruleForm')">取消</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Dialog>
|
|
|
+ <div class="airportInfo">
|
|
|
+ <DataTable
|
|
|
+ data-id="54"
|
|
|
+ :rows="12"
|
|
|
+ label-width="100px"
|
|
|
+ :min-height="70"
|
|
|
+ width="800px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :with-column-set="true"
|
|
|
+ @handleAdd="handleAdd"
|
|
|
+ @handleEdit="handleEdit"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -51,17 +18,18 @@
|
|
|
import orgTree from "@/layout/components/OrgTree";
|
|
|
import Dialog from "@/layout/components/Dialog/index.vue";
|
|
|
import { getQuery, generalDataReception } from "@/api/flight";
|
|
|
+import DataTable from "@/components/Table";
|
|
|
export default {
|
|
|
name: "NodeLnformation",
|
|
|
- components: { orgTree, Dialog },
|
|
|
- data () {
|
|
|
+ components: { orgTree, Dialog, DataTable },
|
|
|
+ data() {
|
|
|
return {
|
|
|
dataList: {
|
|
|
id: 0,
|
|
|
nodeCode: "BSM",
|
|
|
Type: 0,
|
|
|
locationCode: "行李源报文",
|
|
|
- children: []
|
|
|
+ children: [],
|
|
|
},
|
|
|
removeDialogVisible: false,
|
|
|
editDialogVisible: false,
|
|
@@ -84,17 +52,17 @@ export default {
|
|
|
{ required: true, message: "请输入跟踪节点标识符", trigger: "blur" },
|
|
|
],
|
|
|
},
|
|
|
- type: '',
|
|
|
+ type: "",
|
|
|
disFlag: false,
|
|
|
- typeObj: {}
|
|
|
- }
|
|
|
+ typeObj: {},
|
|
|
+ };
|
|
|
},
|
|
|
- created () {
|
|
|
- this.getTreeData();
|
|
|
+ created() {
|
|
|
+ // this.getTreeData();
|
|
|
},
|
|
|
methods: {
|
|
|
//渲染节点
|
|
|
- renderContent (h, data) {
|
|
|
+ renderContent(h, data) {
|
|
|
return (
|
|
|
<div
|
|
|
onClick={() => this.renderSub(data)}
|
|
@@ -140,60 +108,59 @@ export default {
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
|
- onNodeClick (data, e) {
|
|
|
+ onNodeClick(data, e) {
|
|
|
e.stopPropagation();
|
|
|
this.rmObj = data;
|
|
|
this.removeDialogVisible = true;
|
|
|
},
|
|
|
- renderSub (data) {
|
|
|
+ renderSub(data) {
|
|
|
console.log(data, "click");
|
|
|
},
|
|
|
- onNodeSub (data, e) {
|
|
|
+ onNodeSub(data, e) {
|
|
|
e.stopPropagation();
|
|
|
- const { Type, nodeCode } = data
|
|
|
- this.editDialogTitle = '新增节点信息'
|
|
|
- this.editDialogVisible = true
|
|
|
- this.type = 'add'
|
|
|
- this.typeObj = data
|
|
|
+ const { Type, nodeCode } = data;
|
|
|
+ this.editDialogTitle = "新增节点信息";
|
|
|
+ this.editDialogVisible = true;
|
|
|
+ this.type = "add";
|
|
|
+ this.typeObj = data;
|
|
|
if (Type != 0) {
|
|
|
- this.disFlag = true
|
|
|
- this.ruleForm.nodeCode = nodeCode
|
|
|
+ this.disFlag = true;
|
|
|
+ this.ruleForm.nodeCode = nodeCode;
|
|
|
} else {
|
|
|
- this.disFlag = false
|
|
|
- this.ruleForm.nodeCode = ''
|
|
|
+ this.disFlag = false;
|
|
|
+ this.ruleForm.nodeCode = "";
|
|
|
}
|
|
|
- this.ruleForm.locationCode = ''
|
|
|
- this.ruleForm.locationCodeDescribe = ''
|
|
|
+ this.ruleForm.locationCode = "";
|
|
|
+ this.ruleForm.locationCodeDescribe = "";
|
|
|
},
|
|
|
- onNodeEdit (data, e) {
|
|
|
+ onNodeEdit(data, e) {
|
|
|
e.stopPropagation();
|
|
|
- this.editDialogTitle = '编辑节点信息'
|
|
|
- this.editDialogVisible = true
|
|
|
- this.type = 'edit'
|
|
|
- this.typeObj = data
|
|
|
- this.ruleForm = data
|
|
|
- this.disFlag = true
|
|
|
+ this.editDialogTitle = "编辑节点信息";
|
|
|
+ this.editDialogVisible = true;
|
|
|
+ this.type = "edit";
|
|
|
+ this.typeObj = data;
|
|
|
+ this.ruleForm = data;
|
|
|
+ this.disFlag = true;
|
|
|
},
|
|
|
// 新增/编辑-确认
|
|
|
- submitClickHandler () {
|
|
|
+ submitClickHandler() {
|
|
|
this.$refs["ruleForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- const { Type } = this.typeObj
|
|
|
+ const { Type } = this.typeObj;
|
|
|
if (this.ruleForm.operate) {
|
|
|
- delete this.ruleForm.operate
|
|
|
+ delete this.ruleForm.operate;
|
|
|
}
|
|
|
- delete this.ruleForm.Type
|
|
|
- delete this.ruleForm.children
|
|
|
- if (this.type == 'add') {
|
|
|
+ delete this.ruleForm.Type;
|
|
|
+ delete this.ruleForm.children;
|
|
|
+ if (this.type == "add") {
|
|
|
if (Type == 0) {
|
|
|
this.nodeTreeData(20, this.ruleForm);
|
|
|
} else {
|
|
|
this.nodeTreeData(21, this.ruleForm);
|
|
|
}
|
|
|
} else {
|
|
|
- this.ruleForm.operate = "2"
|
|
|
- this.nodeTreeData(21, this.ruleForm)
|
|
|
-
|
|
|
+ this.ruleForm.operate = "2";
|
|
|
+ this.nodeTreeData(21, this.ruleForm);
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.resetForm("ruleForm");
|
|
@@ -202,88 +169,88 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 重置
|
|
|
- resetForm (formName) {
|
|
|
+ resetForm(formName) {
|
|
|
// this.ruleForm = {}
|
|
|
// if (this.type == 'add') {
|
|
|
// this.$refs[formName].resetFields()
|
|
|
// }
|
|
|
- this.editDialogVisible = false
|
|
|
+ this.editDialogVisible = false;
|
|
|
},
|
|
|
// 删除-弹框
|
|
|
- showRemoveDialog (item) {
|
|
|
+ showRemoveDialog(item) {
|
|
|
this.rmObj = item;
|
|
|
this.removeDialogVisible = true;
|
|
|
},
|
|
|
// 确认删除
|
|
|
- removeSubmit () {
|
|
|
- this.ruleForm = this.rmObj
|
|
|
- this.ruleForm.operate = "3"
|
|
|
- this.nodeTreeData(21, this.ruleForm)
|
|
|
- this.removeDialogVisible = false
|
|
|
+ removeSubmit() {
|
|
|
+ this.ruleForm = this.rmObj;
|
|
|
+ this.ruleForm.operate = "3";
|
|
|
+ this.nodeTreeData(21, this.ruleForm);
|
|
|
+ this.removeDialogVisible = false;
|
|
|
// this.$message.success('删除成功')
|
|
|
},
|
|
|
// 获取二级节点
|
|
|
- async getTreeData () {
|
|
|
+ async getTreeData() {
|
|
|
try {
|
|
|
const { returnData, message } = await getQuery({
|
|
|
- id: 63,
|
|
|
+ id: 54,
|
|
|
dataContent: [],
|
|
|
});
|
|
|
if (returnData && returnData.length) {
|
|
|
- returnData.forEach(item => {
|
|
|
- item['Type'] = 1
|
|
|
- item['children'] = [{}]
|
|
|
- })
|
|
|
- this.dataList.children = returnData
|
|
|
+ returnData.forEach((item) => {
|
|
|
+ item["Type"] = 1;
|
|
|
+ item["children"] = [{}];
|
|
|
+ });
|
|
|
+ this.dataList.children = returnData;
|
|
|
} else {
|
|
|
- this.$message.error(message ?? '获取节点信息数据失败');
|
|
|
+ this.$message.error(message ?? "获取节点信息数据失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
},
|
|
|
//节点操作
|
|
|
- async nodeTreeData (serviceId, dataContent) {
|
|
|
+ async nodeTreeData(serviceId, dataContent) {
|
|
|
try {
|
|
|
const { message, code } = await generalDataReception({
|
|
|
- "serviceId": `${serviceId}`,
|
|
|
- "dataContent": JSON.stringify(dataContent)
|
|
|
- })
|
|
|
+ serviceId: `${serviceId}`,
|
|
|
+ dataContent: JSON.stringify(dataContent),
|
|
|
+ });
|
|
|
if (code == 0) {
|
|
|
- this.$message.success(message ?? '操作成功')
|
|
|
- this.getTreeData()
|
|
|
+ this.$message.success(message ?? "操作成功");
|
|
|
+ this.getTreeData();
|
|
|
} else {
|
|
|
- this.$message.error(message ?? '操作失败');
|
|
|
+ this.$message.error(message ?? "操作失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
},
|
|
|
//三级展开获取数据
|
|
|
- async expandData (data) {
|
|
|
+ async expandData(data) {
|
|
|
try {
|
|
|
const { returnData, message } = await getQuery({
|
|
|
id: 64,
|
|
|
dataContent: [data.nodeCode],
|
|
|
});
|
|
|
if (returnData && returnData.length) {
|
|
|
- const datas = this.dataList.children
|
|
|
- returnData.forEach(item => {
|
|
|
- item['Type'] = 2
|
|
|
- })
|
|
|
- datas.forEach(item => {
|
|
|
+ const datas = this.dataList.children;
|
|
|
+ returnData.forEach((item) => {
|
|
|
+ item["Type"] = 2;
|
|
|
+ });
|
|
|
+ datas.forEach((item) => {
|
|
|
if (item.nodeCode == data.nodeCode) {
|
|
|
- item.children = returnData
|
|
|
+ item.children = returnData;
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- const arrs = this.dataList.children
|
|
|
- arrs.forEach(item => {
|
|
|
+ const arrs = this.dataList.children;
|
|
|
+ arrs.forEach((item) => {
|
|
|
if (item.locationCodeID == data.locationCodeID) {
|
|
|
- item['children'] = []
|
|
|
+ item["children"] = [];
|
|
|
}
|
|
|
- })
|
|
|
- this.$message.error(message ?? '获取节点信息失败')
|
|
|
+ });
|
|
|
+ this.$message.error(message ?? "获取节点信息失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error);
|