|
@@ -4,20 +4,33 @@
|
|
|
<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.AuthName }}?</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>
|
|
@@ -26,21 +39,49 @@
|
|
|
<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"
|
|
|
+ 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>
|
|
@@ -48,83 +89,94 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import orgTree from '@/layout/components/OrgTree';
|
|
|
-import Dialog from '@/layout/components/Dialog/index.vue';
|
|
|
-import { getQuery, generalDataReception } from '@/api/flight'
|
|
|
+import orgTree from "@/layout/components/OrgTree";
|
|
|
+import Dialog from "@/layout/components/Dialog/index.vue";
|
|
|
+import { getQuery, generalDataReception } from "@/api/flight";
|
|
|
export default {
|
|
|
name: "NodeLnformation",
|
|
|
components: { orgTree, Dialog },
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
dataList: {
|
|
|
id: 0,
|
|
|
- nodeCode: 'BSM',
|
|
|
+ nodeCode: "BSM",
|
|
|
Type: 0,
|
|
|
- locationCode: '行李源报文',
|
|
|
+ locationCode: "行李源报文",
|
|
|
children: [
|
|
|
{
|
|
|
- AuthName: 'BSM',
|
|
|
+ AuthName: "BSM",
|
|
|
Type: 1,
|
|
|
id: 1,
|
|
|
- Desc: '行李源报文',
|
|
|
+ Desc: "行李源报文",
|
|
|
children: [
|
|
|
{
|
|
|
- AuthName: 'BSM',
|
|
|
+ AuthName: "BSM",
|
|
|
Type: 2,
|
|
|
id: 3,
|
|
|
- Desc: '行李源报文',
|
|
|
+ Desc: "行李源报文",
|
|
|
},
|
|
|
{
|
|
|
- AuthName: 'BSM',
|
|
|
+ AuthName: "BSM",
|
|
|
Type: 2,
|
|
|
id: 4,
|
|
|
- Desc: '行李源报文',
|
|
|
- }
|
|
|
- ]
|
|
|
+ Desc: "行李源报文",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
- AuthName: 'BSM',
|
|
|
+ AuthName: "BSM",
|
|
|
Type: 1,
|
|
|
id: 2,
|
|
|
- Desc: '行李源报文',
|
|
|
- }
|
|
|
- ]
|
|
|
+ Desc: "行李源报文",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
removeDialogVisible: false,
|
|
|
editDialogVisible: false,
|
|
|
rmObj: {
|
|
|
- protocolName: ''
|
|
|
+ protocolName: "",
|
|
|
},
|
|
|
- editDialogTitle: '新增节点信息',
|
|
|
+ editDialogTitle: "新增节点信息",
|
|
|
ruleForm: {
|
|
|
// 协议信息表单
|
|
|
- locationCode: '',
|
|
|
- nodeCode: '',
|
|
|
- locationCodeDescribe: ''
|
|
|
+ locationCode: "",
|
|
|
+ nodeCode: "",
|
|
|
+ locationCodeDescribe: "",
|
|
|
},
|
|
|
rules: {
|
|
|
// 协议信息表单验证
|
|
|
- locationCode: [{ required: true, message: '请输入节点名称', trigger: 'blur' }],
|
|
|
- nodeCode: [{ required: true, message: '请输入跟踪节点标识符', trigger: 'blur' }]
|
|
|
+ locationCode: [
|
|
|
+ { required: true, message: "请输入节点名称", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ nodeCode: [
|
|
|
+ { required: true, message: "请输入跟踪节点标识符", trigger: "blur" },
|
|
|
+ ],
|
|
|
},
|
|
|
- type: '',
|
|
|
- typeObj: {}
|
|
|
- }
|
|
|
+ type: "",
|
|
|
+ typeObj: {},
|
|
|
+ };
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.getTreeData();
|
|
|
},
|
|
|
methods: {
|
|
|
//渲染节点
|
|
|
- renderContent (h, data) {
|
|
|
+ renderContent(h, data) {
|
|
|
return (
|
|
|
- <div onClick={() => this.renderSub(data)} class="account-left-content-teams">
|
|
|
+ <div
|
|
|
+ onClick={() => this.renderSub(data)}
|
|
|
+ class="account-left-content-teams"
|
|
|
+ >
|
|
|
<div class="team">
|
|
|
<div class="list">
|
|
|
<div class="flex info">
|
|
|
<div class="name">
|
|
|
<span>{data.locationCode}</span>
|
|
|
- <span v-show={data.Type === 1 || data.Type === 2} onClick={(e) => this.onNodeEdit(data, e)} class="cap cap-edit icon"></span>
|
|
|
+ <span
|
|
|
+ v-show={data.Type === 1 || data.Type === 2}
|
|
|
+ onClick={(e) => this.onNodeEdit(data, e)}
|
|
|
+ class="cap cap-edit icon"
|
|
|
+ ></span>
|
|
|
</div>
|
|
|
<div class="icon">
|
|
|
<span
|
|
@@ -135,9 +187,7 @@ export default {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="details">
|
|
|
- <div class="details-msg">
|
|
|
- {data.nodeCode}
|
|
|
- </div>
|
|
|
+ <div class="details-msg">{data.nodeCode}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -157,166 +207,165 @@ export default {
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
|
- onNodeClick (data, e) {
|
|
|
+ onNodeClick(data, e) {
|
|
|
e.stopPropagation();
|
|
|
this.rmObj = data;
|
|
|
this.removeDialogVisible = true;
|
|
|
},
|
|
|
- renderSub (data) {
|
|
|
- console.log(data, 'click');
|
|
|
+ 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
|
|
|
+ this.editDialogTitle = "新增节点信息";
|
|
|
+ this.editDialogVisible = true;
|
|
|
+ this.type = "add";
|
|
|
+ this.typeObj = data;
|
|
|
},
|
|
|
- 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;
|
|
|
},
|
|
|
// 新增/编辑-确认
|
|
|
- submitClickHandler () {
|
|
|
- this.$refs['ruleForm'].validate(valid => {
|
|
|
+ submitClickHandler() {
|
|
|
+ this.$refs["ruleForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- const { Type } = this.typeObj
|
|
|
- if (this.type == 'add') {
|
|
|
+ const { Type } = this.typeObj;
|
|
|
+ if (this.type == "add") {
|
|
|
if (Type == 0) {
|
|
|
- this.nodeTreeData(20, this.ruleForm)
|
|
|
+ this.nodeTreeData(20, this.ruleForm);
|
|
|
} else {
|
|
|
- this.nodeTreeData(21, this.ruleForm)
|
|
|
+ this.nodeTreeData(21, this.ruleForm);
|
|
|
}
|
|
|
} else {
|
|
|
if (Type == 1) {
|
|
|
- this.ruleForm.operate = 2
|
|
|
- this.nodeTreeData(21, this.ruleForm)
|
|
|
+ this.ruleForm.operate = 2;
|
|
|
+ this.nodeTreeData(21, this.ruleForm);
|
|
|
} else {
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- this.resetForm('ruleForm')
|
|
|
+ this.resetForm("ruleForm");
|
|
|
}, 100);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 重置
|
|
|
- resetForm (formName) {
|
|
|
+ resetForm(formName) {
|
|
|
// this.ruleForm = {}
|
|
|
- this.$refs[formName].resetFields()
|
|
|
- this.editDialogVisible = false
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ this.editDialogVisible = false;
|
|
|
},
|
|
|
// 删除-弹框
|
|
|
- showRemoveDialog (item) {
|
|
|
- this.rmObj = item
|
|
|
- this.removeDialogVisible = true
|
|
|
+ showRemoveDialog(item) {
|
|
|
+ this.rmObj = item;
|
|
|
+ this.removeDialogVisible = true;
|
|
|
},
|
|
|
// 确认删除
|
|
|
- removeSubmit () {
|
|
|
- this.ruleForm.operate = 3
|
|
|
- this.nodeTreeData(21, this.ruleForm)
|
|
|
- this.removeDialogVisible = false
|
|
|
+ removeSubmit() {
|
|
|
+ this.ruleForm.operate = 3;
|
|
|
+ this.nodeTreeData(21, this.ruleForm);
|
|
|
+ this.removeDialogVisible = false;
|
|
|
// this.$message.success('删除成功')
|
|
|
},
|
|
|
- async addSubmit () {
|
|
|
+ async addSubmit() {
|
|
|
try {
|
|
|
const res = await GeneralDataReception({
|
|
|
- serviceId: '1',
|
|
|
- dataContent: JSON.stringify(this.ruleForm)
|
|
|
- })
|
|
|
+ serviceId: "1",
|
|
|
+ dataContent: JSON.stringify(this.ruleForm),
|
|
|
+ });
|
|
|
if (res.code === 0) {
|
|
|
- this.$message.success(res.message ?? '成功')
|
|
|
+ this.$message.success(res.message ?? "成功");
|
|
|
} else {
|
|
|
- this.$message.error(res.message ?? '失败')
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log('错误', error)
|
|
|
+ console.log("错误", error);
|
|
|
}
|
|
|
},
|
|
|
- async editSubmit () {
|
|
|
+ async editSubmit() {
|
|
|
try {
|
|
|
const res = await GeneralDataReception({
|
|
|
- serviceId: '1',
|
|
|
- dataContent: JSON.stringify(this.ruleForm)
|
|
|
- })
|
|
|
+ serviceId: "1",
|
|
|
+ dataContent: JSON.stringify(this.ruleForm),
|
|
|
+ });
|
|
|
if (res.code === 0) {
|
|
|
- this.$message.success(res.message ?? '成功')
|
|
|
+ this.$message.success(res.message ?? "成功");
|
|
|
} else {
|
|
|
- this.$message.error(res.message ?? '失败')
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log('错误', error)
|
|
|
+ console.log("错误", error);
|
|
|
}
|
|
|
},
|
|
|
// 获取二级节点
|
|
|
- async getTreeData () {
|
|
|
+ async getTreeData() {
|
|
|
try {
|
|
|
const { returnData, message } = await getQuery({
|
|
|
id: 63,
|
|
|
- dataContent: []
|
|
|
- })
|
|
|
+ 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;
|
|
|
+ console.log(this.dataList);
|
|
|
} else {
|
|
|
- this.$message.error(message)
|
|
|
+ this.$message.error(message);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log(error)
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
},
|
|
|
//节点操作
|
|
|
- async nodeTreeData (serviceId, dataContent) {
|
|
|
+ async nodeTreeData(serviceId, dataContent) {
|
|
|
try {
|
|
|
const { message, code } = await generalDataReception({
|
|
|
serviceId,
|
|
|
- dataContent
|
|
|
- })
|
|
|
+ dataContent,
|
|
|
+ });
|
|
|
if (code == 0) {
|
|
|
- this.$message.success(message)
|
|
|
+ this.$message.success(message);
|
|
|
} else {
|
|
|
- this.$message.error(message)
|
|
|
+ this.$message.error(message);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log(error)
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
},
|
|
|
//三级展开获取数据
|
|
|
- async expandData (data) {
|
|
|
+ async expandData(data) {
|
|
|
try {
|
|
|
const { returnData, message } = await getQuery({
|
|
|
id: 64,
|
|
|
- dataContent: [data.nodeCode]
|
|
|
- })
|
|
|
+ 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;
|
|
|
+ console.log(datas);
|
|
|
+ returnData.forEach((item) => {
|
|
|
+ item["Type"] = 2;
|
|
|
+ });
|
|
|
+ datas.forEach((item) => {
|
|
|
if (item.nodeCode == data.nodeCode) {
|
|
|
- item.children = returnData
|
|
|
+ item.children = returnData;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.$message.error(message)
|
|
|
+ this.$message.error(message);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log(error)
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|