This commit is contained in:
wangchengming 2025-06-21 19:15:39 +08:00
commit 753ee55ca4
22 changed files with 670 additions and 168 deletions

2
public/config.js vendored
View File

@ -1,4 +1,4 @@
window.AppConfig = { window.AppConfig = {
systemTitle: '末端数据接入处理系统', systemTitle: '末端数据接入处理系统',
apiUrl: 'http://pbl1.natapp1.cc/jeecg-boot' apiUrl: 'http://pbl.natapp1.cc/jeecg-boot'
} }

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,7 +37,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
@ -75,10 +93,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -114,7 +134,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -131,16 +154,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()
@ -168,11 +223,10 @@ export default {
}, },
handleEdit(record) { handleEdit(record) {
console.log('编辑', this.queryParam.dataType)
// this.$refs.modalForm.eidt(record, this.queryParam.dataType);
// this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.queryParam.schemaName = record.schemaName this.$refs.subPage.queryParam.schemaName = record.schemaName
this.$refs.subPage.shipModel = this.queryParam.shipModel
this.$refs.subPage.shipNumber = this.queryParam.shipNumber
this.$refs.subPage.datetypeF = this.queryParam.dataType this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置"; this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true this.$refs.subPage.pagevisible = true

View File

@ -70,8 +70,8 @@ export default {
// this.loadData(); // this.loadData();
}, },
methods: { methods: {
getQuerytableColumns(dataType, tableName) { getQuerytableColumns(dataType, tableName,shipModel,shipNumber) {
querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { querytableColumns({ dataType: dataType, tableName: tableName,shipModel:shipModel,shipNumber:shipNumber }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {
@ -91,8 +91,8 @@ export default {
} }
}, },
add(schemaName,tableName, dataType) { add(schemaName,tableName, dataType,shipModel,shipNumber) {
this.getQuerytableColumns(dataType, tableName) this.getQuerytableColumns(dataType, tableName,shipModel,shipNumber)
this.form = { this.form = {
tableName: tableName, tableName: tableName,
transfFileds: null, transfFileds: null,
@ -102,7 +102,7 @@ export default {
this.checkedList = [] this.checkedList = []
this.visible = true; this.visible = true;
}, },
eidt(record, dataType1) { eidt(record, dataType,shipModel,shipNumber) {
if (record.id) { if (record.id) {
queryById({ id: record.id }).then(res => { queryById({ id: record.id }).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -119,7 +119,7 @@ export default {
schemaName:record.schemaName schemaName:record.schemaName
} }
} }
this.getQuerytableColumns(dataType1, record.tableName) this.getQuerytableColumns(dataType, record.tableName,shipModel,shipNumber)
this.visible = true; this.visible = true;
}, },
close() { close() {

View File

@ -59,8 +59,11 @@ export default {
title: '', title: '',
datetypeF: '', datetypeF: '',
pagevisible: false, pagevisible: false,
shipModel:'',
shipNumber:'',
queryParam: { queryParam: {
tableName: null tableName: null,
schemaName:null
}, },
dataSource: [], dataSource: [],
columns: [ columns: [
@ -117,11 +120,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF); this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF); this.$refs.modalForm.eidt(record, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "编辑"; this.$refs.modalForm.title = "编辑";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,7 +37,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
@ -75,10 +93,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -114,7 +134,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -131,16 +154,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()
@ -173,6 +228,8 @@ export default {
// this.$refs.modalForm.title = ""; // this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.queryParam.schemaName = record.schemaName this.$refs.subPage.queryParam.schemaName = record.schemaName
this.$refs.subPage.shipModel = this.queryParam.shipModel
this.$refs.subPage.shipNumber = this.queryParam.shipNumber
this.$refs.subPage.datetypeF = this.queryParam.dataType this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置"; this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true this.$refs.subPage.pagevisible = true

View File

@ -77,8 +77,8 @@ export default {
// this.loadData(); // this.loadData();
}, },
methods: { methods: {
getQuerytableColumns(dataType, tableName) { getQuerytableColumns(dataType, tableName,shipModel,shipNumber) {
querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { querytableColumns({ dataType: dataType, tableName: tableName,shipModel:shipModel,shipNumber:shipNumber }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {
@ -98,8 +98,8 @@ export default {
} }
}, },
add(schemaName,tableName, dataType) { add(schemaName,tableName, dataType,shipModel,shipNumber) {
this.getQuerytableColumns(dataType, tableName) this.getQuerytableColumns(dataType, tableName,shipModel,shipNumber)
this.form = { this.form = {
tableName: tableName, tableName: tableName,
columnName: null, columnName: null,
@ -109,7 +109,7 @@ export default {
} }
this.visible = true; this.visible = true;
}, },
eidt(record, dataType1) { eidt(record, dataType,shipModel,shipNumber) {
console.log('sfdsafa',record, dataType1) console.log('sfdsafa',record, dataType1)
if (record.id) { if (record.id) {
queryById({ id: record.id }).then(res => { queryById({ id: record.id }).then(res => {
@ -125,7 +125,7 @@ export default {
schemaName:record.schemaName schemaName:record.schemaName
} }
} }
this.getQuerytableColumns(dataType1, record.tableName) this.getQuerytableColumns(dataType, record.tableName,shipModel,shipNumber)
this.visible = true; this.visible = true;
}, },
close() { close() {

View File

@ -62,8 +62,11 @@ export default {
title: '', title: '',
datetypeF: '', datetypeF: '',
pagevisible: false, pagevisible: false,
shipModel:'',
shipNumber:'',
queryParam: { queryParam: {
tableName: null tableName: null,
schemaName:null
}, },
dataSource: [], dataSource: [],
columns: [ columns: [
@ -126,11 +129,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF); this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF); this.$refs.modalForm.eidt(record, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "编辑"; this.$refs.modalForm.title = "编辑";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,7 +37,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
@ -80,10 +98,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -136,7 +156,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -153,16 +176,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()
@ -189,11 +244,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.dataType); this.$refs.modalForm.add(this.queryParam);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.queryParam.dataType); this.$refs.modalForm.eidt(record, this.queryParam);
this.$refs.modalForm.title = "配置"; this.$refs.modalForm.title = "配置";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -83,7 +83,7 @@ export default {
}, },
methods: { methods: {
getQuerytableColumns(dataType, tableName) { getQuerytableColumns(dataType, tableName) {
querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { querytableColumns({ dataType: dataType.dataType, tableName: tableName,shipModel:dataType.shipModel,shipNumber:dataType.shipNumber }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,15 +37,9 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名" v-decorator="['msgName',{ <a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input>
rules: [
{ required: true, message: '报文名不能为空' },
{ min: 1, max: 60, message: '长度1-60位' },
],
validateTrigger: 'change'
}]" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
@ -82,10 +94,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -160,7 +174,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -177,16 +194,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,17 +37,17 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="4" :sm="24">
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button> <a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
</a-col> </a-col>
<a-col :md="6" :sm="24" style="text-align: right;"> <!-- <a-col :md="4" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button> <a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col> </a-col> -->
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@ -80,10 +98,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -130,7 +150,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -147,16 +170,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(key) { handleTypeChange(key) {
this.queryParam.dataType = key this.queryParam.dataType = key
this.getQueryPage() this.getQueryPage()
@ -183,11 +238,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.dataType); this.$refs.modalForm.add(this.queryParam);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.queryParam.dataType); this.$refs.modalForm.eidt(record, this.queryParam);
this.$refs.modalForm.title = "配置"; this.$refs.modalForm.title = "配置";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -69,7 +69,7 @@ export default {
}, },
methods: { methods: {
getQuerytableColumns(dataType) { getQuerytableColumns(dataType) {
getTables({dataType: dataType}).then(res => { getTables({dataType: dataType.dataType,shipModel:dataType.shipModel,shipNumber:dataType.shipNumber}).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,9 +37,9 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
@ -75,10 +93,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -114,7 +134,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -131,16 +154,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()
@ -173,6 +228,8 @@ export default {
// this.$refs.modalForm.title = ""; // this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.queryParam.schemaName = record.schemaName this.$refs.subPage.queryParam.schemaName = record.schemaName
this.$refs.subPage.shipModel = this.queryParam.shipModel
this.$refs.subPage.shipNumber = this.queryParam.shipNumber
this.$refs.subPage.datetypeF = this.queryParam.dataType this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置"; this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true this.$refs.subPage.pagevisible = true

View File

@ -79,8 +79,8 @@ export default {
created() { created() {
}, },
methods: { methods: {
getQuerytableColumns(dataType, tableName) { getQuerytableColumns(dataType, tableName,shipModel,shipNumber) {
querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { querytableColumns({ dataType: dataType, tableName: tableName,shipModel:shipModel,shipNumber:shipNumber }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {
@ -93,7 +93,7 @@ export default {
} }
}) })
}, },
add(schemaName,tableName, dataType) { add(schemaName,tableName, dataType,shipModel,shipNumber) {
this.form = { this.form = {
tableName: tableName, tableName: tableName,
strategy: null, strategy: null,
@ -104,9 +104,9 @@ export default {
}, },
this.visible = true; this.visible = true;
this.dataType = dataType this.dataType = dataType
this.getQuerytableColumns(dataType, tableName) this.getQuerytableColumns(dataType, tableName,shipModel,shipNumber)
}, },
eidt(record, dataType) { eidt(record, dataType,shipModel,shipNumber) {
if (record.id) { if (record.id) {
queryById({ id: record.id }).then(res => { queryById({ id: record.id }).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -124,7 +124,7 @@ export default {
schemaName:record.schemaName schemaName:record.schemaName
} }
} }
this.getQuerytableColumns(dataType, record.tableName) this.getQuerytableColumns(dataType, record.tableName,shipModel,shipNumber)
this.visible = true; this.visible = true;
}, },

View File

@ -61,8 +61,11 @@ export default {
title: '', title: '',
datetypeF: '', datetypeF: '',
pagevisible: false, pagevisible: false,
shipModel:'',
shipNumber:'',
queryParam: { queryParam: {
tableName: null tableName: null,
schemaName:null
}, },
dataSource: [], dataSource: [],
columns: [ columns: [
@ -129,11 +132,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF); this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF); this.$refs.modalForm.eidt(record, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "编辑"; this.$refs.modalForm.title = "编辑";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,7 +37,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
@ -75,10 +93,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -114,7 +134,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -131,16 +154,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()
@ -173,6 +228,8 @@ export default {
// this.$refs.modalForm.title = ""; // this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.queryParam.schemaName = record.schemaName this.$refs.subPage.queryParam.schemaName = record.schemaName
this.$refs.subPage.shipModel = this.queryParam.shipModel
this.$refs.subPage.shipNumber = this.queryParam.shipNumber
this.$refs.subPage.datetypeF = this.queryParam.dataType this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置"; this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true this.$refs.subPage.pagevisible = true

View File

@ -78,8 +78,8 @@ export default {
// this.loadData(); // this.loadData();
}, },
methods: { methods: {
getQuerytableColumns(dataType, tableName) { getQuerytableColumns(dataType, tableName,shipModel,shipNumber) {
querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { querytableColumns({ dataType: dataType, tableName: tableName,shipModel:shipModel,shipNumber:shipNumber }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {
@ -99,8 +99,8 @@ export default {
} }
}, },
add(schemaName,tableName, dataType) { add(schemaName,tableName, dataType,shipModel,shipNumber) {
this.getQuerytableColumns(dataType, tableName) this.getQuerytableColumns(dataType, tableName,shipModel,shipNumber)
this.form = { this.form = {
tableName: tableName, tableName: tableName,
field: null, field: null,
@ -111,7 +111,7 @@ export default {
this.checkedList = [] this.checkedList = []
this.visible = true; this.visible = true;
}, },
eidt(record, dataType1) { eidt(record, dataType,shipModel,shipNumber) {
if (record.id) { if (record.id) {
queryById({ id: record.id }).then(res => { queryById({ id: record.id }).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -128,7 +128,7 @@ export default {
schemaName:record.schemaName schemaName:record.schemaName
} }
} }
this.getQuerytableColumns(dataType1, record.tableName) this.getQuerytableColumns(dataType, record.tableName,shipModel,shipNumber)
this.visible = true; this.visible = true;
}, },
close() { close() {

View File

@ -63,8 +63,11 @@ export default {
title: '', title: '',
datetypeF: '', datetypeF: '',
pagevisible: false, pagevisible: false,
shipModel:'',
shipNumber:'',
queryParam: { queryParam: {
tableName: null tableName: null,
schemaName:null
}, },
dataSource: [], dataSource: [],
columns: [ columns: [
@ -127,11 +130,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF); this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF); this.$refs.modalForm.eidt(record, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "编辑"; this.$refs.modalForm.title = "编辑";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,9 +37,9 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名" v-model="queryParam.msgName" allow-clear></a-input> <a-input placeholder="请输入报文名" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
@ -75,10 +93,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -114,7 +134,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -131,16 +154,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()
@ -173,6 +228,8 @@ export default {
// this.$refs.modalForm.title = ""; // this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.queryParam.schemaName = record.schemaName this.$refs.subPage.queryParam.schemaName = record.schemaName
this.$refs.subPage.shipModel = this.queryParam.shipModel
this.$refs.subPage.shipNumber = this.queryParam.shipNumber
this.$refs.subPage.datetypeF = this.queryParam.dataType this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置"; this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true this.$refs.subPage.pagevisible = true

View File

@ -80,8 +80,8 @@ export default {
created() { created() {
}, },
methods: { methods: {
getQuerytableColumns(dataType, tableName) { getQuerytableColumns(dataType, tableName,shipModel,shipNumber) {
querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { querytableColumns({ dataType: dataType, tableName: tableName,shipModel:shipModel,shipNumber:shipNumber }).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.treeData = [] this.treeData = []
res.result.forEach(element => { res.result.forEach(element => {
@ -97,7 +97,7 @@ export default {
handleChange(value) { handleChange(value) {
this.getQuerytableColumns(this.dataType, this.form.tableName) this.getQuerytableColumns(this.dataType, this.form.tableName)
}, },
add(schemaName,tableName, dataType) { add(schemaName,tableName, dataType,shipModel,shipNumber) {
this.form = { this.form = {
id: null, id: null,
tableName: tableName, tableName: tableName,
@ -108,9 +108,9 @@ export default {
this.dataType = dataType this.dataType = dataType
this.checkedList =[] this.checkedList =[]
this.visible = true; this.visible = true;
this.getQuerytableColumns(dataType, tableName) this.getQuerytableColumns(dataType, tableName,shipModel,shipNumber)
}, },
eidt(record, dataType) { eidt(record, dataType,shipModel,shipNumber) {
this.form = { this.form = {
id: null, id: null,
tableName: record.tableName, tableName: record.tableName,
@ -127,7 +127,7 @@ export default {
}) })
} }
this.dataType = dataType this.dataType = dataType
this.getQuerytableColumns(dataType, record.tableName) this.getQuerytableColumns(dataType, record.tableName,shipModel,shipNumber)
this.visible = true; this.visible = true;
}, },
close() { close() {

View File

@ -117,11 +117,11 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF); this.$refs.modalForm.add(this.queryParam.schemaName,this.queryParam.tableName, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "新增"; this.$refs.modalForm.title = "新增";
}, },
handleEdit(record) { handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF); this.$refs.modalForm.eidt(record, this.datetypeF,this.shipModel,this.shipNumber);
this.$refs.modalForm.title = "编辑"; this.$refs.modalForm.title = "编辑";
}, },
handleRemove(recordId) { handleRemove(recordId) {

View File

@ -10,6 +10,24 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="型号">
<a-select placeholder="选择型号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipModel" @change="changeshipModel">
<a-select-option v-for="item in shipModel" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="舷号">
<a-select placeholder="选择舷号" option-filter-prop="children" show-search :filter-option="filterOption" v-model="queryParam.shipNumber" @change="changeshipNumber">
<a-select-option v-for="item in shipNumber" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
@ -19,15 +37,9 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="4" :sm="8">
<a-form-item label="报文名"> <a-form-item label="报文名">
<a-input placeholder="请输入报文名" v-decorator="['msgName',{ <a-input placeholder="请输入报文名称" v-model="queryParam.msgName" allow-clear></a-input>
rules: [
{ required: true, message: '报文名不能为空' },
{ min: 1, max: 60, message: '长度1-60位' },
],
validateTrigger: 'change'
}]" v-model="queryParam.msgName" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
@ -82,10 +94,12 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
dataType: 'biandui', dataType: '',
msgName: null, msgName: null,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
shipModel:'',
shipNumber:''
}, },
pagination: { pagination: {
defaultCurrent: 1, // defaultCurrent: 1, //
@ -160,7 +174,10 @@ export default {
align: "center", align: "center",
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
] ],
shipModel:[],
shipNumber:[],
existingDataTypes:{}
} }
}, },
@ -177,16 +194,48 @@ export default {
getDataType() { getDataType() {
getAction("/dataType/getExistingDataTypes", {}).then((res) => { getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) { if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL this.existingDataTypes = res.result.result.original
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){ var ship = Object.keys(this.existingDataTypes)
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName ship.forEach((element, index) => {
} this.shipModel.push(element);
});
var number = Object.keys(this.existingDataTypes[this.shipModel[0]])
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[this.shipModel[0]][this.shipNumber[0]]
this.queryParam.shipModel = this.shipModel[0]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage() this.getQueryPage()
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}); });
}, },
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
changeshipModel(value) {
this.queryParam.shipModel = value
var number = Object.keys(this.existingDataTypes[value])
this.shipNumber = []
number.forEach((element, index) => {
this.shipNumber.push(element);
});
this.dataTypeList =this.existingDataTypes[value][this.shipNumber[0]]
this.queryParam.shipNumber = this.shipNumber[0]
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
changeshipNumber(value) {
this.dataTypeList =this.existingDataTypes[this.queryParam.shipModel][value]
this.queryParam.shipNumber = value
this.queryParam.dataType = this.dataTypeList[0].enName
this.getQueryPage()
},
handleTypeChange(value) { handleTypeChange(value) {
this.queryParam.dataType = value this.queryParam.dataType = value
this.getQueryPage() this.getQueryPage()