优化国标级联目录订阅通知以及目录查询回复

This commit is contained in:
648540858
2022-07-17 23:17:36 +08:00
parent be5dbc9a21
commit 4451994959
50 changed files with 1159 additions and 819 deletions

View File

@@ -143,7 +143,7 @@ export default {
});
},
chooseChannel: function(platform) {
this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, platform.name, platform.catalogId, this.initData)
this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, platform.name, platform.catalogId, platform.treeType, this.initData)
},
initData: function() {
this.getPlatformList();

View File

@@ -56,7 +56,7 @@
<el-table-column label="开始时间" min-width="200">
<template slot-scope="scope">
<el-button-group>
{{ dateFormat(parseInt(scope.row.createStamp)) }}
{{ scope.row.pushTime == null? "-":scope.row.pushTime }}
</el-button-group>
</template>
</el-table-column>
@@ -242,19 +242,6 @@ export default {
console.error(error);
});
},
dateFormat: function (/** timestamp=0 **/) {
let ts = arguments[0] || 0;
let t, y, m, d, h, i, s;
t = ts ? new Date(ts) : new Date();
y = t.getFullYear();
m = t.getMonth() + 1;
d = t.getDate();
h = t.getHours();
i = t.getMinutes();
s = t.getSeconds();
// 可根据需要在这里定义时间格式
return y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d) + ' ' + (h < 10 ? '0' + h : h) + ':' + (i < 10 ? '0' + i : i) + ':' + (s < 10 ? '0' + s : s);
},
importChannel: function () {
this.$refs.importChannel.openDialog(() => {

View File

@@ -49,11 +49,43 @@ export default {
props: ['platformId'],
created() {},
data() {
let checkId = (rule, value, callback) => {
console.log("checkId")
console.log(this.treeType)
console.log(rule)
console.log(value)
console.log(value.length)
console.log(this.level)
if (!value) {
return callback(new Error('编号不能为空'));
}
if (this.treeType === "BusinessGroup" && value.length !== 20) {
return callback(new Error('编号必须由20位数字组成'));
}
if (this.treeType === "CivilCode" && value.length <= 8 && value.length%2 !== 0) {
return callback(new Error('行政区划必须是八位以下的偶数个数字组成'));
}
if (this.treeType === "BusinessGroup") {
let catalogType = value.substring(10, 13);
console.log(catalogType)
// 216 为虚拟组织 215 为业务分组;目录第一级必须为业务分组, 业务分组下为虚拟组织,虚拟组织下可以有其他虚拟组织
if (this.level === 1 && catalogType !== "215") {
return callback(new Error('业务分组模式下第一层目录的编号10到13位必须为215'));
}
if (this.level > 1 && catalogType !== "216") {
return callback(new Error('业务分组模式下第一层以下目录的编号10到13位必须为216'));
}
}
callback();
}
return {
submitCallback: null,
showDialog: false,
isLoging: false,
isEdit: false,
treeType: null,
level: 0,
form: {
id: null,
name: null,
@@ -62,12 +94,12 @@ export default {
},
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
id: [{ required: true, message: "请输入ID", trigger: "blur" }]
id: [{ trigger: "blur",validator: checkId }]
},
};
},
methods: {
openDialog: function (isEdit, id, name, parentId, callback) {
openDialog: function (isEdit, id, name, parentId, treeType, level, callback) {
console.log("parentId: " + parentId)
console.log(this.form)
this.isEdit = isEdit;
@@ -77,6 +109,8 @@ export default {
this.form.parentId = parentId;
this.showDialog = true;
this.submitCallback = callback;
this.treeType = treeType;
this.level = level;
},
onSubmit: function () {
console.log("onSubmit");

View File

@@ -8,7 +8,7 @@
<el-tab-pane label="目录结构" name="catalog">
<el-container>
<el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}">
<chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" ></chooseChannelForCatalog>
<chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog>
</el-main>
</el-container>
</el-tab-pane>
@@ -66,18 +66,20 @@ export default {
platformName: "",
defaultCatalogId: "",
showDialog: false,
treeType: null,
chooseData: {},
winHeight: window.innerHeight - 250,
};
},
methods: {
openDialog(platformId, platformName, defaultCatalogId, closeCallback) {
openDialog(platformId, platformName, defaultCatalogId, treeType, closeCallback) {
this.platformId = platformId
this.platformName = platformName
this.defaultCatalogId = defaultCatalogId
this.showDialog = true
this.closeCallback = closeCallback
this.treeType = treeType
},
tabClick (tab, event){

View File

@@ -38,7 +38,7 @@
import catalogEdit from './catalogEdit.vue'
export default {
name: 'chooseChannelForCatalog',
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange'],
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
created() {
this.chooseId = this.defaultCatalogId;
this.defaultCatalogIdSign = this.defaultCatalogId;
@@ -102,8 +102,9 @@ export default {
},
addCatalog: function (parentId, node){
let that = this;
console.log(this.treeType)
// 打开添加弹窗
that.$refs.catalogEdit.openDialog(false, null, null, parentId, ()=>{
that.$refs.catalogEdit.openDialog(false, null, null, parentId, this.treeType, node.level, ()=>{
node.loaded = false
node.expand();
});

View File

@@ -174,7 +174,6 @@ export default {
page: that.currentPage,
count: that.count,
query: that.searchSrt,
pushing: that.pushing,
platformId: that.platformId,
catalogId: that.catalogId,
mediaServerId: that.mediaServerId

View File

@@ -78,6 +78,12 @@
<el-option label="8" value="8"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目录结构" prop="treeType" >
<el-select v-model="platform.treeType" style="width: 100%" >
<el-option key="WGS84" label="行政区划" value="CivilCode"></el-option>
<el-option key="GCJ02" label="业务分组" value="BusinessGroup"></el-option>
</el-select>
</el-form-item>
<el-form-item label="字符集" prop="characterSet">
<el-select
v-model="platform.characterSet"
@@ -157,6 +163,7 @@ export default {
startOfflinePush: false,
catalogGroup: 1,
administrativeDivision: null,
treeType: "BusinessGroup",
},
rules: {
name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
@@ -194,6 +201,7 @@ export default {
that.platform.devicePort = res.data.devicePort;
that.platform.username = res.data.username;
that.platform.password = res.data.password;
that.platform.treeType = res.data.treeType;
that.platform.administrativeDivision = res.data.username.substr(0, 6);
}).catch(function (error) {
console.log(error);
@@ -222,6 +230,7 @@ export default {
this.platform.startOfflinePush = platform.startOfflinePush;
this.platform.catalogGroup = platform.catalogGroup;
this.platform.administrativeDivision = platform.administrativeDivision;
this.platform.treeType = platform.treeType;
this.onSubmit_text = "保存";
this.saveUrl = "/api/platform/save";
}
@@ -242,32 +251,49 @@ export default {
},
onSubmit: function () {
if (this.onSubmit_text === "保存") {
this.$confirm("修改目录结构会导致关联目录与通道数据被清空", '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true,
type: 'warning'
}).then(() => {
this.saveForm()
}).catch(() => {
});
}else {
this.saveForm()
}
},
saveForm: function (){
var that = this;
that.$axios({
method: 'post',
url: this.saveUrl,
data: that.platform
}).then(function (res) {
if (res.data.code === 0) {
that.$message({
showClose: true,
message: "保存成功",
type: "success",
});
that.showDialog = false;
if (that.listChangeCallback != null) {
that.listChangeCallback();
}
}else {
that.$message({
showClose: true,
message: res.data.msg,
type: "error",
});
if (res.data.code === 0) {
that.$message({
showClose: true,
message: "保存成功",
type: "success",
});
that.showDialog = false;
if (that.listChangeCallback != null) {
that.listChangeCallback();
}
}).catch(function (error) {
console.log(error);
});
}else {
that.$message({
showClose: true,
message: res.data.msg,
type: "error",
});
}
}).catch(function (error) {
console.log(error);
});
},
close: function () {
this.showDialog = false;
@@ -293,6 +319,7 @@ export default {
keepTimeout: 60,
transport: "UDP",
characterSet: "GB2312",
treeType: "BusinessGroup",
shareAllLiveStream: false,
startOfflinePush: false,
catalogGroup: 1,