|
@@ -4,33 +4,20 @@
|
|
|
<div class="manageTitle">节点信息维护</div>
|
|
|
</div>
|
|
|
<div class="nodeLnformation_content">
|
|
|
- <org-tree
|
|
|
- :dataList="dataList"
|
|
|
- :renderContent="renderContent"
|
|
|
- @expandData="expandData"
|
|
|
- />
|
|
|
+ <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">是否确认删除{{ rmObj.AuthName }}?</div>
|
|
|
+ <div class="log">
|
|
|
+ 是否确认删除{{ rmObj.locationCode }}?
|
|
|
+ </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
|
|
|
- >
|
|
|
+ <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>
|
|
@@ -39,49 +26,21 @@
|
|
|
<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 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-input v-model="ruleForm.locationCode" size="medium" placeholder="请输入节点名称(必填)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="跟踪节点标识符" prop="nodeCode">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.nodeCode"
|
|
|
- size="medium"
|
|
|
- placeholder="请输入跟踪节点标识符(必填)"
|
|
|
- />
|
|
|
+ <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-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
|
|
|
- >
|
|
|
+ <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>
|
|
@@ -95,41 +54,14 @@ import { getQuery, generalDataReception } from "@/api/flight";
|
|
|
export default {
|
|
|
name: "NodeLnformation",
|
|
|
components: { orgTree, Dialog },
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
dataList: {
|
|
|
id: 0,
|
|
|
nodeCode: "BSM",
|
|
|
Type: 0,
|
|
|
locationCode: "行李源报文",
|
|
|
- children: [
|
|
|
- {
|
|
|
- AuthName: "BSM",
|
|
|
- Type: 1,
|
|
|
- id: 1,
|
|
|
- Desc: "行李源报文",
|
|
|
- children: [
|
|
|
- {
|
|
|
- AuthName: "BSM",
|
|
|
- Type: 2,
|
|
|
- id: 3,
|
|
|
- Desc: "行李源报文",
|
|
|
- },
|
|
|
- {
|
|
|
- AuthName: "BSM",
|
|
|
- Type: 2,
|
|
|
- id: 4,
|
|
|
- Desc: "行李源报文",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- AuthName: "BSM",
|
|
|
- Type: 1,
|
|
|
- id: 2,
|
|
|
- Desc: "行李源报文",
|
|
|
- },
|
|
|
- ],
|
|
|
+ children: []
|
|
|
},
|
|
|
removeDialogVisible: false,
|
|
|
editDialogVisible: false,
|
|
@@ -152,16 +84,17 @@ export default {
|
|
|
{ required: true, message: "请输入跟踪节点标识符", trigger: "blur" },
|
|
|
],
|
|
|
},
|
|
|
- type: "",
|
|
|
- typeObj: {},
|
|
|
- };
|
|
|
+ type: '',
|
|
|
+ disFlag: false,
|
|
|
+ typeObj: {}
|
|
|
+ }
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getTreeData();
|
|
|
},
|
|
|
methods: {
|
|
|
//渲染节点
|
|
|
- renderContent(h, data) {
|
|
|
+ renderContent (h, data) {
|
|
|
return (
|
|
|
<div
|
|
|
onClick={() => this.renderSub(data)}
|
|
@@ -207,46 +140,60 @@ 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();
|
|
|
- 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
|
|
|
+ } else {
|
|
|
+ this.disFlag = false
|
|
|
+ this.ruleForm.nodeCode = ''
|
|
|
+ }
|
|
|
+ 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.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;
|
|
|
- if (this.type == "add") {
|
|
|
+ const { Type } = this.typeObj
|
|
|
+ if (this.ruleForm.operate) {
|
|
|
+ delete this.ruleForm.operate
|
|
|
+ }
|
|
|
+ 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 {
|
|
|
- if (Type == 1) {
|
|
|
- this.ruleForm.operate = 2;
|
|
|
- this.nodeTreeData(21, this.ruleForm);
|
|
|
- } else {
|
|
|
- }
|
|
|
+ this.ruleForm.operate = "2"
|
|
|
+ this.nodeTreeData(21, this.ruleForm)
|
|
|
+
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.resetForm("ruleForm");
|
|
@@ -255,104 +202,76 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 重置
|
|
|
- resetForm(formName) {
|
|
|
+ resetForm (formName) {
|
|
|
// this.ruleForm = {}
|
|
|
- this.$refs[formName].resetFields();
|
|
|
- this.editDialogVisible = false;
|
|
|
+ // if (this.type == 'add') {
|
|
|
+ // this.$refs[formName].resetFields()
|
|
|
+ // }
|
|
|
+ this.editDialogVisible = false
|
|
|
},
|
|
|
// 删除-弹框
|
|
|
- showRemoveDialog(item) {
|
|
|
+ showRemoveDialog (item) {
|
|
|
this.rmObj = item;
|
|
|
this.removeDialogVisible = true;
|
|
|
},
|
|
|
// 确认删除
|
|
|
- removeSubmit() {
|
|
|
- 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 addSubmit() {
|
|
|
- try {
|
|
|
- const res = await GeneralDataReception({
|
|
|
- serviceId: "1",
|
|
|
- dataContent: JSON.stringify(this.ruleForm),
|
|
|
- });
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success(res.message ?? "成功");
|
|
|
- } else {
|
|
|
- this.$message.error(res.message ?? "失败");
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log("错误", error);
|
|
|
- }
|
|
|
- },
|
|
|
- async editSubmit() {
|
|
|
- try {
|
|
|
- const res = await GeneralDataReception({
|
|
|
- serviceId: "1",
|
|
|
- dataContent: JSON.stringify(this.ruleForm),
|
|
|
- });
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success(res.message ?? "成功");
|
|
|
- } else {
|
|
|
- this.$message.error(res.message ?? "失败");
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log("错误", error);
|
|
|
- }
|
|
|
- },
|
|
|
// 获取二级节点
|
|
|
- async getTreeData() {
|
|
|
+ async getTreeData () {
|
|
|
try {
|
|
|
const { returnData, message } = await getQuery({
|
|
|
id: 63,
|
|
|
dataContent: [],
|
|
|
});
|
|
|
if (returnData && returnData.length) {
|
|
|
- returnData.forEach((item) => {
|
|
|
- item["Type"] = 1;
|
|
|
- item["children"] = [{}];
|
|
|
- });
|
|
|
- this.dataList.children = returnData;
|
|
|
- console.log(this.dataList);
|
|
|
+ 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,
|
|
|
- dataContent,
|
|
|
- });
|
|
|
+ "serviceId": `${serviceId}`,
|
|
|
+ "dataContent": JSON.stringify(dataContent)
|
|
|
+ })
|
|
|
if (code == 0) {
|
|
|
- this.$message.success(message);
|
|
|
+ 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;
|
|
|
- console.log(datas);
|
|
|
- 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;
|
|
|
}
|