Commit 4b64e700 by 潘建波

【BUG】存储配置导出

1 parent 3ef59f66
......@@ -39,7 +39,7 @@
body {
background: rgba(23, 39, 68, .6);
height: 400px!important;
height: 100vh!important;
padding: 0 3%!important;
}
</style>
......
{"commit":"343145f35878188a308c8d0af5a85a7ca617ef08","commitDate":"2021-9-6 14:21","buildDate":"2021-9-13 16:1","version":"2.1.0","info":"【BUG】参数多次保存出现值为空的情况"}
\ No newline at end of file
{"commit":"3ef59f66af81a9e75a2f779b3a4fc9ef8731c21e","commitDate":"2021-9-13 16:11","buildDate":"2021-9-27 16:26","version":"2.1.0","info":"【new】增加存储配置导出功能"}
\ No newline at end of file
......@@ -13,7 +13,7 @@ let wsIP = "";
let flvIP = "";
switch (process.env.NODE_ENV) {
case "development":
wsIP = window.config.https?"192.168.9.227":"192.168.9.233"; // 测试环境url
wsIP = window.config.https?"192.168.9.227":"192.168.9.233:20080"; // 测试环境url
flvIP = window.config.https?"192.168.9.233":"192.168.9.233";
break;
case "pre":
......
......@@ -94,4 +94,10 @@ export default {
getNvs3000:(params)=>{
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/nvs3000`,params)
},
getConfig:(conf,params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/content?name=${conf}`,params)
},
saveConfig:(id,params) => {
return api.post(`${baseUrl}/api/v1/devconf_fx/content/${id}`,params)
}
};
......@@ -139,6 +139,7 @@ class Codes {
} catch (err) {
this.result.vehicle_plate_text = "未识别";
}
// 违法类型
try {
this.result.illegalTypestate = parseInt(this.allData.event_data.illegal.state);
......@@ -346,6 +347,7 @@ class Codes {
} catch (error) {
this.result.xcycle_plate_text = "未识别";
}
// 骑车类型
// console.log(this.allData.event_data.xcycle_type)
if (!this.allData.event_data.xcycle_type) {
......@@ -369,28 +371,21 @@ class Codes {
this.result.xcycle_type_text = "未识别";
}
}
console.log('company',this.allData.event_data.xcycle.company.code)
try {
if (this.result.xcycle_type_text === "自行车") {
this.result.company = this.allData.event_data.xcycle.company.name;
} else if (this.result.xcycle_type_text === "摩托车") {
if (typeof this.allData.event_data.xcycle.company.code !== "number") {
this.result.company = "未识别";
} else {
this.result.company = this.getCode(
"外卖公司",
this.allData.event_data.xcycle.company.code
);
}
} else if (this.result.xcycle_type_text === "三轮车") {
if (typeof this.allData.event_data.xcycle.company.code !== "number") {
this.result.company = "未识别";
} else {
this.result.company = this.getCode(
"快递公司",
this.allData.event_data.xcycle.company.code
);
}
} else {
this.result.company = "无";
}
......
......@@ -235,6 +235,14 @@ export const asyncRouterMap = [{
},
component: resolve =>
require(["../views/resource/Codes/codes.vue"], resolve)
},{
path: "/resource/publicconfg",
name: "参数模板",
meta: {
icon: "el-icon-location"
},
component: resolve =>
require(["../views/resource/publicConfig/index.vue"], resolve)
}
]
},
......
......@@ -31,15 +31,6 @@ export default {
},
startFunc(url) {
let playerel = document.getElementById("flvvideo");
// if (typeof player !== "undefined") {
// if (this.player != null) {
// // this.player.unload();
// // this.player.detachMediaElement();
// // this.player.destroy();
// // this.player = null;
// this.flv_destroy();
// }
// }
if(this.player) {
this.destoryVideo(this.player);
}
......
<!--
* @Author: panda
* @Date: 2021-09-27 13:40:37
* @LastEditTime: 2021-09-27 17:04:20
* @LastEditors: Please set LastEditors
* @Description: 参数缺省设置
* @FilePath: /fanxing_new/src/views/resource/publicConfig/index.vue
-->
<template>
<div class="config-box">
<div class="switch-box">
<el-radio v-model="radio" label="defaultConfig">正常配置</el-radio>
<el-radio v-model="radio" label="illegalStopDefaultConfig">违停配置</el-radio>
</div>
<el-row>
<el-col :span="3" class="search-box">
<el-input placeholder="请输入内容" v-model="paramsval" class="input-with-select">
<el-button
slot="append"
icon="el-icon-search"
@click="$refs.iframeconfig.contentWindow.clickButton(paramsval)"
></el-button>
</el-input>
</el-col>
</el-row>
<el-row>
<el-col :span="20" class="content-box">
<iframe
id="iframeconfig"
ref="iframeconfig"
src="./dynamicParameters.html"
frameborder="0"
width="100%"
height="600"
scrolling="no"
></iframe>
</el-col>
<el-col :span="1" :offset="19">
<el-button type="primary" @click="saveConfig" class="save-btn">保存</el-button>
</el-col>
</el-row>
</div>
</template>
<script>
import xml from './baseConfig.js'
export default {
data() {
return {
paramsval:'',
radio: 'defaultConfig',
config:'',
configid:''
}
},
watch:{
radio(val){
this.getbaseConf(val)
}
},
methods:{
xmlInit: function(obj) {
this.$refs.iframeconfig.contentWindow.loadParameterTree(
obj.content,
'<?xml version="1.0" encoding="GBK"?><root></root>'
);
},
getbaseConf(type){
this.$api.device.getConfig(type).then(res => {
this.config = res.data.content
this.configid = res.data.id
this.xmlInit(res.data)
})
},
saveConfig(){
this.$refs.iframeconfig.contentWindow.submit();
//ifram 传递回来的饿xml
let XMLStr = this.$refs.iframeconfig.contentWindow.xmlStr;
if(!XMLStr) {
XMLStr = this.config
}
this.$api.device.saveConfig(this.configid,{content:XMLStr}).then(res => {
if(res.ecode == 200) {
this.$message({
type: "success",
message: '保存成功!'
});
} else {
this.$message({
type: "error",
message: '保存失败!'
});
}
})
},
},
mounted(){
setTimeout(() => {
this.getbaseConf('defaultConfig')
}, 2000);
}
}
</script>
<style>
.config-box{
margin:10px;
background: #fff;
overflow: hidden;
}
.switch-box{
margin:10px 0 0 10px
}
.search-box,.content-box{
margin:10px;
}
.save-btn{
float: right;
margin-bottom: 20px;
}
</style>
......@@ -325,7 +325,7 @@ export default {
},
exportFun(index, row){
let url = location.origin;
console.log(`${url}/api/v1/devconf_fx/store_confs/export/${row.unid}`)
location.href = `${url}/api/v1/devconf_fx/store_confs/export/${row.unid}`
}
}
};
......
......@@ -590,8 +590,7 @@ export default {
this.$api.device.getDevtreeLike(this.dev_unid,'内部设备',{vchan_name_like:this.searchText }).then(camerares => {
this.$api.device.getDevtreeLike(this.dev_unid,'短视频',{vchan_name_like:this.searchText }).then(vchanres => {
setTimeout(() => {
debugger
this.zNodes[0].childs = res.result.childs
this.zNodes[0].childs = res.result?res.result.childs:[]
this.zNodes[1].childs = camerares.vchan_struct
this.zNodes[2].childs = vchanres.list_data
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!