Commit 9ca2a12a by 夏新然

解决冲突

2 parents 5cfbf6d1 8f739a8a
Showing 64 changed files with 1370 additions and 705 deletions
No preview for this file type
...@@ -6,36 +6,37 @@ ...@@ -6,36 +6,37 @@
<script> <script>
export default { export default {
data() { data() {
return { return {};
}
}, },
created(){ created() {
let menus = JSON.parse(localStorage.getItem('menu')) let menus = JSON.parse(localStorage.getItem("menu"));
if(menus) { if (menus) {
this.$store.dispatch('GetMenuRole',menus).then(res => {}) this.$store.dispatch("GetMenuRole", menus).then(res => {});
}
let token = localStorage.getItem("atoken");
if (!token) {
console.log('errtoken')
this.$router.push("/login");
} }
}, },
mounted(){ mounted() {
window.videoEquitTableHeight = document.body.clientHeight - 142 + 'px'; window.videoEquitTableHeight = document.body.clientHeight - 142 + "px";
window.opsTableHeight = document.body.clientHeight - 260 + 'px'; window.opsTableHeight = document.body.clientHeight - 260 + "px";
if(document.body.clientWidth>1366){ if (document.body.clientWidth > 1366) {
window.oneSearchTableHeight = document.body.clientHeight - 250 + 'px'; window.oneSearchTableHeight = document.body.clientHeight - 250 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 280 + 'px'; window.twoSearchTableHeight = document.body.clientHeight - 280 + "px";
} else {
}else { window.oneSearchTableHeight = document.body.clientHeight - 280 + "px";
window.oneSearchTableHeight = document.body.clientHeight - 280 + 'px'; window.twoSearchTableHeight = document.body.clientHeight - 315 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 315 + 'px';
} }
} }
} };
</script> </script>
<style lang="scss"> <style lang="scss">
#app { #app {
height: 100%; height: 100%;
font-family:MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
......
import axios from 'axios' import axios from "axios";
import store from '../store/index.js' import store from "../store/index.js";
import router from "../router/index";
import {Message,Loading} from 'element-ui' import {Message,Loading} from 'element-ui'
let loading; let loading;
...@@ -27,15 +28,17 @@ function endLoading() { ...@@ -27,15 +28,17 @@ function endLoading() {
let service = axios.create({ let service = axios.create({
// headers: {'Content-Type': 'application/json'}, // headers: {'Content-Type': 'application/json'},
timeout: 60000 timeout: 60000
}) });
// 添加请求拦截器 // 添加请求拦截器
service.interceptors.request.use( service.interceptors.request.use(
(config) => { (config) => {
startLoading();
if (store.state.users.atoken) { // 判断是否存在token,如果存在的话,则每个http header都加上token if (store.state.users.atoken) { // 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers.authorization = store.state.users.atoken; config.headers.authorization = store.state.users.atoken;
}else{
router.push("/login");
endLoading();
} }
if (config.method == 'get') { if (config.method == 'get') {
config.params = { config.params = {
...@@ -43,16 +46,35 @@ service.interceptors.request.use( ...@@ -43,16 +46,35 @@ service.interceptors.request.use(
...config.params ...config.params
} }
} }
startLoading();
return config return config
}, },
(err) => { (err) => {
// 请求错误处理 // 请求错误处理
return Promise.reject(err) return Promise.reject(err)
// config => {
// let token = localStorage.getItem("atoken");
// if (token) {
// // 判断是否存在token,如果存在的话,则每个http header都加上token
// config.headers.authorization = token;
// } else {
// router.push("/login");
// }
// if (config.method == "get") {
// config.params = {
// _t: Date.parse(new Date()) / 1000,
// ...config.params
// };
// }
// return config;
// },
// error => {
// // 请求错误处理
// return Promise.reject(error);
} }
) );
// 添加响应拦截器 // 添加响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
endLoading(); endLoading();
...@@ -69,12 +91,12 @@ service.interceptors.response.use( ...@@ -69,12 +91,12 @@ service.interceptors.response.use(
} }
return Promise.reject(err) return Promise.reject(err)
} }
) );
/** /**
* 创建统一封装过的 axios 实例 * 创建统一封装过的 axios 实例
* @return {AxiosInstance} * @return {AxiosInstance}
*/ */
export default function() { export default function() {
return service return service;
} }
...@@ -10,7 +10,7 @@ switch (process.env.NODE_ENV) { ...@@ -10,7 +10,7 @@ switch (process.env.NODE_ENV) {
baseUrl = "https://pre-server.feleti.cn"; // 预上线环境url baseUrl = "https://pre-server.feleti.cn"; // 预上线环境url
break; break;
case "production": case "production":
baseUrl = "http://192.168.9.133:20080"; // 生产环境url baseUrl = "http://vion-panda.51vip.biz:52510"; // 生产环境url
break; break;
} }
......
...@@ -32,9 +32,12 @@ export default { ...@@ -32,9 +32,12 @@ export default {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}/vchans/${refid}`); //获取分析流 return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}/vchans/${refid}`); //获取分析流
}, },
sipSet(devid, userid) { sipSet(devid, userid) {
return api.get(`${baseUrl}/devconf_fx/devs/${devid}/${userid}/sip_server`) return api.get(`${baseUrl}/devconf_fx/devs/${devid}/${userid}/sip_server`);
}, },
getStore(params) { getStore(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params);
},
getFreelist(dev_unid, params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${dev_unid}/fx_devs/free`, params)
} }
}; };
import api from '../index' import api from "../index";
import baseUrl from '../baseUrl' import baseUrl from "../baseUrl";
export default { export default {
devs(params){ devs(params){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs`, params)
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
getCode(params,id){ getCode(params,id){
return api.get(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params) return api.get(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params)
}, },
editCamera(params,id,unid){ editCode(params,id,unid){
return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`, params) return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`, params)
}, },
delCode(params,id,unid){ delCode(params,id,unid){
...@@ -52,35 +52,48 @@ export default { ...@@ -52,35 +52,48 @@ export default {
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'}) return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'})
}, },
getResource(params,id){ getResource(params, id) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params);
}, },
getDevsName(params,id){ getDevsName(params, id) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs`, params);
}, },
getStoreConList(params){ getStoreConList(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params);
}, },
uploadStore(params){ uploadStore(params) {
return api.post(`${baseUrl}/api/v1/devconf_fx/store_confs`, params,{'Content-Type': 'multipart/form-data'}) return api.post(`${baseUrl}/api/v1/devconf_fx/store_confs`, params, {
}, "Content-Type": "multipart/form-data"
getSubTask(params,id){ });
return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`, params) },
}, getSubTask(params, id) {
delStore(params,id){ return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`, params);
return api.delete(`${baseUrl}/api/v1/devconf_fx/store_confs/${id}`, params) },
}, delStore(params, id) {
getsip(params,id,id2){ return api.delete(`${baseUrl}/api/v1/devconf_fx/store_confs/${id}`, params);
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`, params) },
}, getsip(params, id, id2) {
addSip(params,id,id2){ return api.get(
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`, params) `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`,
}, params
editSip(params,id,id2,id3){ );
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`, params) },
}, addSip(params, id, id2) {
delSip(params,id,id2,id3){ return api.post(
return api.delete(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`, params) `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`,
params
);
},
editSip(params, id, id2, id3) {
return api.post(
`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`,
params
);
},
delSip(params, id, id2, id3) {
return api.delete(
`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`,
params
);
} }
}
\ No newline at end of file \ No newline at end of file
};
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
return api.post(urls.editTask(taskid), params); return api.post(urls.editTask(taskid), params);
}, },
editSubTask(taskid, params) { editSubTask(taskid, params) {
return api.post2(urls.setSubTask(taskid), params) return api.post2(urls.setSubTask(taskid), params);
}, },
editRoi(taskid, subtaskid, params) { editRoi(taskid, subtaskid, params) {
return api.post(urls.editroi(taskid, subtaskid), params); return api.post(urls.editroi(taskid, subtaskid), params);
......
...@@ -8,7 +8,7 @@ export default { ...@@ -8,7 +8,7 @@ export default {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}`; return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}`;
}, },
editroi: (taskid, subtaskid) => { editroi: (taskid, subtaskid) => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtasks/${subtaskid}}`; // ROI设置 return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtasks/${subtaskid}`; // ROI设置
}, },
alternatestate: (taskid, subtaskid) => { alternatestate: (taskid, subtaskid) => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?s=${gitTimer()}`; return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?s=${gitTimer()}`;
......
...@@ -160,6 +160,8 @@ html,body{ ...@@ -160,6 +160,8 @@ html,body{
} }
.nav-tag-box { .nav-tag-box {
line-height: 40px; line-height: 40px;
height: 40px;
overflow: hidden;
} }
.nav-tag-box .el-tag{ .nav-tag-box .el-tag{
border-radius: 0; border-radius: 0;
...@@ -210,3 +212,6 @@ html,body{ ...@@ -210,3 +212,6 @@ html,body{
.codes-tab-box .el-tabs__item{ .codes-tab-box .el-tabs__item{
width: 112px!important; width: 112px!important;
} }
.is-opend {
background: red;
}
\ No newline at end of file \ No newline at end of file
{ {
"id": "1565499", "id": "1592179",
"name": "繁星2.0", "name": "fanxin_new",
"font_family": "iconfont", "font_family": "iconfont",
"css_prefix_text": "icon-", "css_prefix_text": "icon",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{ {
"icon_id": "831114", "icon_id": "13192442",
"name": "上",
"font_class": "shang",
"unicode": "e611",
"unicode_decimal": 58897
},
{
"icon_id": "13192443",
"name": "下",
"font_class": "xia",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "13192444",
"name": "左",
"font_class": "zuo",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "13192445",
"name": "左下",
"font_class": "zuoxia",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "13192446",
"name": "右下",
"font_class": "youxia",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "13192447",
"name": "左上",
"font_class": "zuoshang",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "13192448",
"name": " 右",
"font_class": "you",
"unicode": "e621",
"unicode_decimal": 58913
},
{
"icon_id": "13192449",
"name": "右上",
"font_class": "youshang",
"unicode": "e626",
"unicode_decimal": 58918
},
{
"icon_id": "13191358",
"name": "启动",
"font_class": "qidong",
"unicode": "e628",
"unicode_decimal": 58920
},
{
"icon_id": "13191359",
"name": "密码",
"font_class": "mima",
"unicode": "e629",
"unicode_decimal": 58921
},
{
"icon_id": "13191361",
"name": "迁移",
"font_class": "qianyi",
"unicode": "e62a",
"unicode_decimal": 58922
},
{
"icon_id": "13191411",
"name": "用户名",
"font_class": "yonghuming",
"unicode": "e62b",
"unicode_decimal": 58923
},
{
"icon_id": "13191425",
"name": "修 改",
"font_class": "xiugai",
"unicode": "e62c",
"unicode_decimal": 58924
},
{
"icon_id": "13191430",
"name": "修 改 copy",
"font_class": "xiugaicopy",
"unicode": "e62d",
"unicode_decimal": 58925
},
{
"icon_id": "13191446",
"name": "暂停",
"font_class": "zanting",
"unicode": "e62e",
"unicode_decimal": 58926
},
{
"icon_id": "13176280",
"name": "导出", "name": "导出",
"font_class": "daochu", "font_class": "daochu",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "13176281",
"name": "重型罐式",
"font_class": "zhongxingguanshi",
"unicode": "e61b",
"unicode_decimal": 58907
},
{
"icon_id": "13176282",
"name": "展示",
"font_class": "zhanshi",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "13176283",
"name": "导入",
"font_class": "daoru",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "13176284",
"name": "危险品",
"font_class": "weixianpin",
"unicode": "e61e", "unicode": "e61e",
"unicode_decimal": 58910 "unicode_decimal": 58910
}, },
{ {
"icon_id": "1010109", "icon_id": "13176288",
"name": "日历", "name": "运行路数",
"font_class": "rili", "font_class": "yunhanglushu",
"unicode": "e616", "unicode": "e622",
"unicode_decimal": 58902 "unicode_decimal": 58914
}, },
{ {
"icon_id": "1355658", "icon_id": "13176289",
"name": "导入", "name": "开启",
"font_class": "login", "font_class": "kaiqi",
"unicode": "e623",
"unicode_decimal": 58915
},
{
"icon_id": "13176290",
"name": "icon 选中智能检索",
"font_class": "iconxuanzhongzhinengjiansuo1",
"unicode": "e624",
"unicode_decimal": 58916
},
{
"icon_id": "13176291",
"name": "系统版本",
"font_class": "xitongbanben",
"unicode": "e625",
"unicode_decimal": 58917
},
{
"icon_id": "13176293",
"name": "运行异常",
"font_class": "yunhangyichang",
"unicode": "e627",
"unicode_decimal": 58919
},
{
"icon_id": "13176254",
"name": "icon 选中首页(2)",
"font_class": "iconxuanzhongshouye",
"unicode": "e600", "unicode": "e600",
"unicode_decimal": 58880 "unicode_decimal": 58880
}, },
{ {
"icon_id": "6237827", "icon_id": "13176255",
"name": "展示", "name": "icon 选中任务管理(1)",
"font_class": "zhanshi", "font_class": "iconxuanzhongrenwuguanli",
"unicode": "e87a", "unicode": "e601",
"unicode_decimal": 59514 "unicode_decimal": 58881
}, },
{ {
"icon_id": "6367958", "icon_id": "13176256",
"name": "添加", "name": "icon 选中资源管理",
"font_class": "add-circle-s", "font_class": "iconxuanzhongziyuanguanli",
"unicode": "e662", "unicode": "e602",
"unicode_decimal": 58978 "unicode_decimal": 58882
}, },
{ {
"icon_id": "7588088", "icon_id": "13176257",
"name": "播放", "name": "icon 选中首页(1)",
"font_class": "bofang1", "font_class": "iconxuanzhongshouye1",
"unicode": "e61c", "unicode": "e603",
"unicode_decimal": 58908 "unicode_decimal": 58883
},
{
"icon_id": "13176258",
"name": "icon 选中资源管理(1)",
"font_class": "iconxuanzhongziyuanguanli1",
"unicode": "e604",
"unicode_decimal": 58884
},
{
"icon_id": "13176259",
"name": "信息存储",
"font_class": "xinxicunchu",
"unicode": "e605",
"unicode_decimal": 58885
}, },
{ {
"icon_id": "7815001", "icon_id": "13176260",
"name": "播放", "name": "icon 选中系统运维",
"font_class": "bofang", "font_class": "iconxuanzhongxitongyunwei",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "13176261",
"name": "icon 选中智能检索(1)",
"font_class": "iconxuanzhongzhinengjiansuo",
"unicode": "e607", "unicode": "e607",
"unicode_decimal": 58887 "unicode_decimal": 58887
}, },
{ {
"icon_id": "7978614", "icon_id": "13176262",
"name": "删 除", "name": "icon 选中任务管理",
"font_class": "detail", "font_class": "iconxuanzhongrenwuguanli1",
"unicode": "e644", "unicode": "e608",
"unicode_decimal": 58948 "unicode_decimal": 58888
}, },
{ {
"icon_id": "8147570", "icon_id": "13176263",
"name": "迁移", "name": "删 除(1)",
"font_class": "Migration", "font_class": "shanchu",
"unicode": "e664", "unicode": "e609",
"unicode_decimal": 58980 "unicode_decimal": 58889
}, },
{ {
"icon_id": "8386986", "icon_id": "13176264",
"name": "暂停", "name": "定位 位置",
"font_class": "zanting", "font_class": "dingweiweizhi",
"unicode": "e685", "unicode": "e60a",
"unicode_decimal": 59013 "unicode_decimal": 58890
}, },
{ {
"icon_id": "9356268", "icon_id": "13176265",
"name": "暂停 停止", "name": "系统信息",
"font_class": "zantingtingzhi", "font_class": "xitongxinxi",
"unicode": "e643", "unicode": "e60b",
"unicode_decimal": 58947 "unicode_decimal": 58891
}, },
{ {
"icon_id": "10905634", "icon_id": "13176266",
"name": "修 改", "name": "分析资源",
"font_class": "xiugai", "font_class": "fenxiziyuan",
"unicode": "e632", "unicode": "e60c",
"unicode_decimal": 58930 "unicode_decimal": 58892
},
{
"icon_id": "13176267",
"name": "渣土车抓拍",
"font_class": "zhatuchezhuapai",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "13176268",
"name": "多选/选中",
"font_class": "duoxuanxuanzhong",
"unicode": "e60e",
"unicode_decimal": 58894
},
{
"icon_id": "13176269",
"name": "单选/选中",
"font_class": "danxuanxuanzhong",
"unicode": "e60f",
"unicode_decimal": 58895
},
{
"icon_id": "13176270",
"name": "设备信息",
"font_class": "shebeixinxi",
"unicode": "e610",
"unicode_decimal": 58896
},
{
"icon_id": "13176273",
"name": "icon 选中首页",
"font_class": "iconxuanzhongshouye2",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "13176274",
"name": "保存 面性",
"font_class": "baocunmianxing",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "13176276",
"name": "重置",
"font_class": "zhongzhi",
"unicode": "e616",
"unicode_decimal": 58902
},
{
"icon_id": "13176277",
"name": "添加",
"font_class": "tianjia",
"unicode": "e617",
"unicode_decimal": 58903
},
{
"icon_id": "13176278",
"name": "删 除",
"font_class": "shanchu1",
"unicode": "e618",
"unicode_decimal": 58904
} }
] ]
} }
...@@ -142,6 +142,7 @@ a:active{ ...@@ -142,6 +142,7 @@ a:active{
} }
.contentBox{ .contentBox{
padding: 12px; padding: 12px;
overflow: hidden;
} }
} }
.detaiCon span{ .detaiCon span{
......
...@@ -9,7 +9,7 @@ import resetCss from "./assets/resetElementCss/index.css"; ...@@ -9,7 +9,7 @@ import resetCss from "./assets/resetElementCss/index.css";
import api from "./api/install"; import api from "./api/install";
import "./assets/css/public.css"; import "./assets/css/public.css";
import echarts from "echarts"; import echarts from "echarts";
import "./assets/icon/icon1/iconfont.css"; // import "./assets/icon/icon1/iconfont.css";
import "./assets/icon/icon2/iconfont.css"; import "./assets/icon/icon2/iconfont.css";
import "../src/assets/js/vporto"; import "../src/assets/js/vporto";
import { buildCode } from "../src/assets/js/buildcodes"; import { buildCode } from "../src/assets/js/buildcodes";
...@@ -18,10 +18,10 @@ Vue.prototype.$echarts = echarts; ...@@ -18,10 +18,10 @@ Vue.prototype.$echarts = echarts;
Vue.prototype.$moment = moment; Vue.prototype.$moment = moment;
Vue.prototype.$buildCode = buildCode; Vue.prototype.$buildCode = buildCode;
Vue.prototype.oParse = new XML.ObjTree(); Vue.prototype.oParse = new XML.ObjTree();
Vue.prototype.axios=axios; Vue.prototype.axios = axios;
import VueParticles from 'vue-particles' // import VueParticles from "vue-particles";
Vue.use(VueParticles) // Vue.use(VueParticles);
Vue.use(api); Vue.use(api);
Vue.use(ElementUI, { size: "small", zIndex: 3000 }); Vue.use(ElementUI, { size: "small", zIndex: 3000 });
......
...@@ -8,7 +8,7 @@ export const constantRouterMap = [ ...@@ -8,7 +8,7 @@ export const constantRouterMap = [
path: "/", path: "/",
name: "首页", name: "首页",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
redirect: "/trficcshow", redirect: "/login",
children: [ children: [
{ {
path: "/trficcshow", path: "/trficcshow",
...@@ -47,7 +47,7 @@ export const asyncRouterMap = [ ...@@ -47,7 +47,7 @@ export const asyncRouterMap = [
name: "任务管理", name: "任务管理",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
meta: { meta: {
icon: "el-icon-location" icon: "icon-fanxing-iconxuanzhongrenwuguanli1"
}, },
children: [ children: [
{ {
...@@ -75,7 +75,7 @@ export const asyncRouterMap = [ ...@@ -75,7 +75,7 @@ export const asyncRouterMap = [
name: "智能检索", name: "智能检索",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
meta: { meta: {
icon: "el-icon-location" icon: "icon-fanxing-iconxuanzhongzhinengjiansuo1"
}, },
children: [ children: [
{ {
...@@ -144,7 +144,7 @@ export const asyncRouterMap = [ ...@@ -144,7 +144,7 @@ export const asyncRouterMap = [
name: "资源管理", name: "资源管理",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
meta: { meta: {
icon: "el-icon-location" icon: "icon-fanxing-iconxuanzhongziyuanguanli1"
}, },
children: [ children: [
{ {
...@@ -208,7 +208,7 @@ export const asyncRouterMap = [ ...@@ -208,7 +208,7 @@ export const asyncRouterMap = [
name: "系统运维", name: "系统运维",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
meta: { meta: {
icon: "el-icon-location" icon: "icon-fanxing-iconxuanzhongxitongyunwei"
}, },
children: [ children: [
{ {
......
...@@ -12,7 +12,6 @@ export default { ...@@ -12,7 +12,6 @@ export default {
} }
}, },
created(){ created(){
alert(1)
} }
} }
</script> </script>
......
...@@ -2,28 +2,28 @@ ...@@ -2,28 +2,28 @@
<div class="home"> <div class="home">
<el-container class="home-box"> <el-container class="home-box">
<el-header class="headers"> <el-header class="headers">
<img class="logoImg" src="../../assets/img/home/logo.png" alt=""> <img class="logoImg" src="../../assets/img/home/logo.png" alt="" />
<span :class="{'el-icon-s-fold':isopen,'el-icon-s-unfold':!isopen,'menu-switch':true}" @click="openmenu"></span>
<div class="headRight"> <div class="headRight">
<span>2019-11-15 16:50 星期一</span> <span>{{ curdate }}</span>
<img src="../../assets/img/home/user.png" alt=""> <img src="../../assets/img/home/user.png" alt="" />
<span class="exit">退出<i class="el-icon-arrow-down"></i></span> <span class="exit" @click="logout()">退出<i class="el-icon-arrow-down"></i></span>
</div> </div>
</el-header> </el-header>
<el-container style="min-height:calc(100vh - 64px);"> <el-container style="min-height:calc(100vh - 64px);">
<el-aside :width="menuwidth">
<menus @setTopBar="setTopBar" ref="leftmenu"></menus> <menus @setTopBar="setTopBar" ref="leftmenu"></menus>
</el-aside>
<el-main> <el-main>
<div class="nav"> <div class="nav">
<div class="nav-tag-box"> <div class="nav-tag-box">
<el-tag <el-tag
v-for="(tag,index) in topbarArr" :key="index" v-for="(tag, index) in topbarArr"
:key="index"
closable closable
@close="closetag(tag,index)" @close="closetag(tag, index)"
@click="toPath(tag)" @click="toPath(tag)"
> >
<i :class="tag.icon"></i> <!-- <i :class="tag.icon"></i> -->
{{tag.name}} {{ tag.name }}
</el-tag> </el-tag>
</div> </div>
</div> </div>
...@@ -35,111 +35,172 @@ ...@@ -35,111 +35,172 @@
</template> </template>
<script> <script>
import types from "../../store/types.js";
// import HelloWorld from "@/components/HelloWorld.vue"; // import HelloWorld from "@/components/HelloWorld.vue";
import menus from './menu' import menus from "./menu";
export default { export default {
name: "x", name: "x",
data(){ data() {
return{ return {
isCollapse: false, curdate: "",
conHeight:0, isopen:true,
menuwidth:"254px", conHeight: 0,
full:false, menuwidth: "15vw",
topbarArr:[] full: false,
topbarArr: []
}; };
}, },
methods:{ methods: {
setTopBar(data){ setTopBar(data) {
if(this.topbarArr.length < 1) { if (this.topbarArr.length < 1) {
this.topbarArr.push(data) this.topbarArr.push(data);
} }
let hasBar = false; let hasBar = false;
for(let i = 0; i < this.topbarArr.length; i++) { for (let i = 0; i < this.topbarArr.length; i++) {
if(this.topbarArr[i].path == data.path){ if (this.topbarArr[i].path == data.path) {
hasBar = true hasBar = true;
} }
} }
if(!hasBar) { if (!hasBar) {
this.topbarArr.push(data) this.topbarArr.push(data);
} }
}, },
toPath(data){ openmenu() {
this.$refs.leftmenu.handleSelect(data.path) this.isopen = !this.isopen;
this.$refs.leftmenu.collapsemenu();
}, },
closetag(data,index){ toPath(data) {
this.topbarArr.splice(index,1) this.$refs.leftmenu.handleSelect(data.path);
},
closetag(data, index) {
this.topbarArr.splice(index, 1);
},
getDate() {
let date = new Date();
let Y = date.getFullYear();
let M = date.getMonth() > 10 ? date.getMonth() : `0${date.getMonth()}`;
let D = date.getDate() > 10 ? date.getDate() : `0${date.getDate()}`;
let h = date.getHours() > 10 ? date.getHours() : `0${date.getHours()}`;
let m = date.getMinutes() > 10 ? date.getMinutes() : `0${date.getMinutes()}`;
let s = date.getSeconds();
let w = date.getDay();
let wtext = "";
switch (w) {
case 1:
wtext = "星期一";
break;
case 2:
wtext = "星期二";
break;
case 3:
wtext = "星期三";
break;
case 4:
wtext = "星期四";
break;
case 5:
wtext = "星期五";
break;
case 6:
wtext = "星期六";
break;
case 7:
wtext = "星期日";
break;
} }
this.curdate = `${Y}/${M}/${D} ${h}:${m}:${s} ${wtext}`;
}, },
created(){ logout() {
localStorage.removeItem("menu");
localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken");
this.$router.push("/login");
}
},
created() {
this.$api.device.getDev().then(m => { this.$api.device.getDev().then(m => {
if(m.length < 1) { if (m.length < 1) {
// this.infoFun('未发现运维服务,请联系相关人员') // this.infoFun('未发现运维服务,请联系相关人员')
this.$message({ this.$message({
message: '未发现运维服务,请联系相关人员', message: "未发现运维服务,请联系相关人员",
type: 'error' type: "error"
}); });
this.setDevunid('9cb6e39adc5176b81879f6c22f1d963') this.setDevunid("9cb6e39adc5176b81879f6c22f1d963");
return return;
} }
this.setDevunid(m[0].dev_unid) this.setDevunid(m[0].dev_unid);
}) });
}, },
components:{ components: {
menus menus
}, },
mounted(){ mounted() {
console.log(this.permission_routers) console.log(this.permission_routers);
this.conHeight=window.innerHeight-65; this.conHeight = window.innerHeight - 65;
console.log(this.conHeight) console.log(this.conHeight);
document.addEventListener("keydown", (event)=>{ document.addEventListener("keydown", event => {
var e = event || window.event || arguments.callee.caller.arguments[0]; var e = event || window.event || arguments.callee.caller.arguments[0];
if(e && e.keyCode==122 ){ // 按 Esc if (e && e.keyCode == 122) {
if(this.full) { // 按 Esc
if (this.full) {
this.menuwidth = "254px"; this.menuwidth = "254px";
this.full = false this.full = false;
return return;
} }
this.menuwidth = 0 this.menuwidth = 0;
this.full = true this.full = true;
} }
}); });
setInterval(() => {
this.getDate();
}, 1000);
}, },
beforeMount() { beforeMount() {
//建立ws连接 //建立ws连接
let uid = localStorage.getItem('user_unid'); let uid = localStorage.getItem("user_unid");
let clientid = localStorage.getItem('client_unid'); let clientid = localStorage.getItem("client_unid");
this.$api.device.getGlobalWs(uid, clientid).then(data => { this.$api.device.getGlobalWs(uid, clientid).then(data => {
this.globalWs = new WebSocket(data.ws_url); this.globalWs = new WebSocket(data.ws_url);
let ary = data.ws_url.split('/'); let ary = data.ws_url.split("/");
localStorage.setItem('cennect_unid',ary[ary.length-1]) localStorage.setItem("cennect_unid", ary[ary.length - 1]);
//监听成功 //监听成功
this.globalWs.onopen = function() { this.globalWs.onopen = function() {
console.log('全局推送服务连接成功') console.log("全局推送服务连接成功");
} };
//监听断开 //监听断开
this.globalWs.onclose = function(){ this.globalWs.onclose = function() {
console.log('全局推送服务连接断开') console.log("全局推送服务连接断开");
} };
//监听推送信息 //监听推送信息
// this.globalWs.onmessage = this.wsdeal; // this.globalWs.onmessage = this.wsdeal;
//保持连接 //保持连接
var $this = this var $this = this;
setInterval(function() { setInterval(function() {
var send_mesage = '{"type":"request","id":"' + new Date().getTime() + '","mts":"' + new Date().getTime() + '","command": "get /wsapi/v1/users/'+localStorage.getItem('cennect_unid')+'/keep_alive"}' var send_mesage =
$this.globalWs.send(send_mesage) '{"type":"request","id":"' +
}, 20000) new Date().getTime() +
}) '","mts":"' +
}, new Date().getTime() +
'","command": "get /wsapi/v1/users/' +
localStorage.getItem("cennect_unid") +
'/keep_alive"}';
$this.globalWs.send(send_mesage);
}, 20000);
});
}
}; };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.menu-switch{
color #fff
font-size 25px;
margin-left 50px;
overflow: hidden;
vertical-align: super;
}
</style> </style>
...@@ -5,26 +5,27 @@ ...@@ -5,26 +5,27 @@
class="el-menu-vertical-demo" class="el-menu-vertical-demo"
:collapse="isCollapse" :collapse="isCollapse"
@select="handleSelect" @select="handleSelect"
:unique-opened="true"
> >
<el-submenu index="1"> <el-submenu index="1" class="menu-icon">
<template slot="title"> <template slot="title">
<i class="el-icon-location"></i> <i class="icon-fanxing-iconxuanzhongshouye1"></i>
<span slot="title">首页</span> <span slot="title">首页</span>
</template> </template>
<el-menu-item index="/trficcshow"> <el-menu-item index="/trficcshow">
<i class="el-icon-location"></i>交通展示 <i class="submenuicon"></i>交通展示
</el-menu-item> </el-menu-item>
<el-menu-item index="/behaviorshow"> <el-menu-item index="/behaviorshow">
<i class="el-icon-location"></i>综治展示 <i class="submenuicon"></i>综治展示
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-submenu v-for="(fristmenu,index) in permission_routers" :index="fristmenu.path" :key="index"> <el-submenu v-for="(fristmenu,index) in permission_routers" :index="fristmenu.path" :key="index" class="menu-icon">
<template slot="title"> <template slot="title">
<i :class="fristmenu.meta.icon"></i> <i :class="fristmenu.meta.icon"></i>
<span slot="title">{{fristmenu.name}}</span> <span slot="title">{{fristmenu.name}}</span>
</template> </template>
<el-menu-item v-for="(twomenu,index) in fristmenu.children" :key="index" :index="twomenu.path"> <el-menu-item v-for="(twomenu,index) in fristmenu.children" :key="index" :index="twomenu.path">
<i :class="twomenu.meta.icon"></i>{{twomenu.name}} <i class="submenuicon"></i>{{twomenu.name}}
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
</el-menu> </el-menu>
...@@ -39,7 +40,7 @@ export default { ...@@ -39,7 +40,7 @@ export default {
return { return {
full: false, full: false,
isCollapse: false, isCollapse: false,
activemenu: "/", activemenu: "/indexshow",
topbar:[] topbar:[]
}; };
}, },
...@@ -47,28 +48,33 @@ export default { ...@@ -47,28 +48,33 @@ export default {
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
this.$router.push(key); this.$router.push(key);
localStorage.setItem("curmenu", key); localStorage.setItem("curmenu", key);
this.activemenu = key this.activemenu = key;
},
collapsemenu() {
this.isCollapse = !this.isCollapse;
} }
}, },
computed: { computed: {
...mapGetters(["permission_routers"]) ...mapGetters(["permission_routers"])
}, },
created() { created() {
let activemenu = localStorage.getItem("curmenu"); // let activemenu = localStorage.getItem("curmenu");
let activemenu = location.href.split('#')[1];
if (activemenu) { if (activemenu) {
this.activemenu = activemenu; this.activemenu = activemenu;
this.$router.push(activemenu); this.$router.push(activemenu);
} else { } else {
this.$router.push('/'); this.$router.push("/");
this.activemenu = '/'; this.activemenu = '/';
} }
}, },
watch:{ watch:{
$route(t, f){ $route(t, f){
console.log('to',t)
let obj = { let obj = {
name:f.name, name:t.name,
path:f.path, path:t.path,
icon:f.meta.icon // icon:t.meta.icon
} }
this.$emit("setTopBar",obj) this.$emit("setTopBar",obj)
} }
...@@ -77,7 +83,26 @@ export default { ...@@ -77,7 +83,26 @@ export default {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px;
min-height: 400px;
}
.box{ .box{
height 100%; height 100%;
} }
.menu-icon i{
font-size 14px;
padding-right:10px;
}
.menu-icon .submenuicon{
display inline-block;
height 3px;
width 3px;
background:rgba(0,0,0,0.85);
opacity .5;
border-radius 5px;
margin-left -10px;
margin-right 10px;
padding-right:0px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div id="login" :style="{height:innerHeight+'px'}"> <div id="login" :style="{ height: innerHeight + 'px' }">
<vue-particles <!-- <vue-particles
color="#dedede" color="#dedede"
:particleOpacity="0.7" :particleOpacity="0.7"
:particlesNumber="80" :particlesNumber="80"
...@@ -17,19 +17,34 @@ ...@@ -17,19 +17,34 @@
:clickEffect="true" :clickEffect="true"
clickMode="push" clickMode="push"
> >
</vue-particles> </vue-particles> -->
<div class="box"> <div class="box">
<h1>视频分析综合管理平台</h1> <h1>视频分析综合管理平台</h1>
<div style="width: 60%;margin: 0 auto;"> <div style="width: 60%;margin: 0 auto;">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="0px" class="demo-ruleForm"> <el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="0px"
class="demo-ruleForm"
>
<el-form-item label=" " prop="username"> <el-form-item label=" " prop="username">
<el-input v-model="ruleForm.username" placeholder="请输入用户名"></el-input> <el-input
v-model="ruleForm.username"
placeholder="请输入用户名"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" " prop="password"> <el-form-item label=" " prop="password">
<el-input v-model="ruleForm.password" type="password" placeholder="请输入密码"></el-input> <el-input
v-model="ruleForm.password"
type="password"
placeholder="请输入密码"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')">登 录</el-button> <el-button type="primary" @click="submitForm('ruleForm')"
>登 录</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -38,46 +53,42 @@ ...@@ -38,46 +53,42 @@
</template> </template>
<script> <script>
let sha1 = require('js-sha1'); let sha1 = require("js-sha1");
import types from '../store/types.js' import types from "../store/types.js";
export default { export default {
name: 'Login', name: "Login",
data() { data() {
var validatePass = (rule, value, callback) => { var validatePass = (rule, value, callback) => {
if (value === '') { if (value === "") {
callback(new Error('请输入密码')); callback(new Error("请输入密码"));
} else { } else {
callback(); callback();
} }
}; };
var validateUser = (rule, value, callback) => { var validateUser = (rule, value, callback) => {
if (value === '') { if (value === "") {
callback(new Error('请输入用户名')); callback(new Error("请输入用户名"));
} else { } else {
callback(); callback();
} }
}; };
return { return {
username: '', username: "",
password: '', password: "",
innerHeight:0, innerHeight: 0,
ruleForm:{ ruleForm: {
username:'', username: "",
password:'', password: ""
}, },
rules: { rules: {
password: [ password: [{ validator: validatePass, trigger: "change" }],
{ validator: validatePass, trigger: 'change' } username: [{ validator: validateUser, trigger: "change" }]
],
username: [
{ validator: validateUser, trigger: 'change' }
]
}
} }
};
}, },
methods: { methods: {
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.login(); this.login();
} else { } else {
...@@ -85,22 +96,23 @@ import types from '../store/types.js' ...@@ -85,22 +96,23 @@ import types from '../store/types.js'
} }
}); });
}, },
initHeight(){ initHeight() {
this.innerHeight=window.innerHeight; this.innerHeight = window.innerHeight;
}, },
login(){ login() {
this.$api.login.login({ this.$api.login
"username":this.ruleForm.username, .login({
"password":this.ruleForm.password, username: this.ruleForm.username,
"user_type": "user" password: this.ruleForm.password,
}).then(res => { user_type: "user"
if(!res.ecode){ })
this.$store.commit(types.ATOKEN,res.atoken); .then(res => {
if (!res.ecode) {
this.$store.commit(types.ATOKEN, res.atoken);
// localStorage.setItem('rtoken',m.data.rtoken) // localStorage.setItem('rtoken',m.data.rtoken)
sessionStorage.setItem('user_unid',res.user_unid) sessionStorage.setItem("user_unid", res.user_unid);
//本系统可以直接用本地缓存做 //本系统可以直接用本地缓存做
localStorage.setItem("atoken", res.atoken);
// localStorage.setItem('user_name',this.username)
// 处理登录用户权限菜单显示问题; // 处理登录用户权限菜单显示问题;
//算法配置列表 //算法配置列表
this.algoList(); this.algoList();
...@@ -114,7 +126,6 @@ import types from '../store/types.js' ...@@ -114,7 +126,6 @@ import types from '../store/types.js'
this.getDev(); this.getDev();
this.getMenu(res.user_unid); this.getMenu(res.user_unid);
} }
}).catch((err) => { }).catch((err) => {
}) })
}, },
...@@ -244,7 +255,7 @@ import types from '../store/types.js' ...@@ -244,7 +255,7 @@ import types from '../store/types.js'
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss"> <style scoped lang="scss">
#particles{ #particles {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -253,12 +264,12 @@ import types from '../store/types.js' ...@@ -253,12 +264,12 @@ import types from '../store/types.js'
background-size: cover; background-size: cover;
background-position: 50% 50%; background-position: 50% 50%;
} }
.loginTitle{ .loginTitle {
height:60px; height: 60px;
background: #dcdcdc; background: #dcdcdc;
position: relative; position: relative;
} }
.loginTitle>div{ .loginTitle > div {
position: absolute; position: absolute;
text-align: left; text-align: left;
/*left: 5%;*/ /*left: 5%;*/
...@@ -267,82 +278,82 @@ import types from '../store/types.js' ...@@ -267,82 +278,82 @@ import types from '../store/types.js'
/*background: url(../assets/daer.jpg) no-repeat;*/ /*background: url(../assets/daer.jpg) no-repeat;*/
padding-left: 50px; padding-left: 50px;
background-size: 100% 60px; background-size: 100% 60px;
width:150px width: 150px;
} }
.loginTitle>div span:first-child{ .loginTitle > div span:first-child {
position: absolute; position: absolute;
left:50px; left: 50px;
top: -5px; top: -5px;
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
font-family: "隶书"; font-family: "隶书";
} }
.loginTitle>div span:last-child{ .loginTitle > div span:last-child {
font-weight: 500; font-weight: 500;
font-size: 12px; font-size: 12px;
font-family: Aparajita; font-family: Aparajita;
position: absolute; position: absolute;
left:50px; left: 50px;
top: 16px; top: 16px;
} }
h1 { h1 {
color: #000000; color: #000000;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
padding: 60px 0px; padding: 60px 0px;
font-size:44px; font-size: 44px;
} }
#login { #login {
text-align: center; text-align: center;
position: relative; position: relative;
background: url(../assets/img/login/background.png) no-repeat 0 0; background: url(../assets/img/login/background.png) no-repeat 0 0;
background-size:cover background-size: cover;
} }
#login input:focus { #login input:focus {
outline: none; outline: none;
box-shadow: none; box-shadow: none;
} }
.box{ .box {
width: 25%; width: 25%;
position: absolute; position: absolute;
left: 52%; left: 52%;
top: 20%; top: 20%;
} }
button { button {
width: 100%; width: 100%;
margin-top: 40px; margin-top: 40px;
border-radius: 30px; border-radius: 30px;
background: #0069FF; background: #0069ff;
height: 50px; height: 50px;
font-size: 20px; font-size: 20px;
} }
button:hover { button:hover {
color: #D6D9DF color: #d6d9df;
} }
p { p {
margin: 0; margin: 0;
} }
p:nth-child(1) { p:nth-child(1) {
padding-top: 15px padding-top: 15px;
} }
@media screen and (max-width: 1366px) { @media screen and (max-width: 1366px) {
h1 { h1 {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
padding: 60px 0px; padding: 60px 0px;
font-size:34px; font-size: 34px;
} }
.box{ .box {
width: 25%; width: 25%;
position: absolute; position: absolute;
left: 57%; left: 57%;
top: 20%; top: 20%;
} }
} }
</style> </style>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="icon-fanxing-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<div class="info-content"> <div class="info-content">
<div class="con-item"> <div class="con-item">
<span class="con-label">平台类型:</span> <span class="con-label">平台类型:</span>
<span class="con-text">{{}}</span> <span class="con-text"></span>
</div> </div>
<div class="con-item"> <div class="con-item">
<span class="con-label">设备类型:</span> <span class="con-label">设备类型:</span>
...@@ -358,7 +358,7 @@ export default { ...@@ -358,7 +358,7 @@ export default {
display: none; display: none;
} }
.right-box { .right-box {
width: 10vw; width: 20vw;
height: 100%; height: 100%;
border-left: 10px solid #f5f7f9; border-left: 10px solid #f5f7f9;
} }
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="编辑角色" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="编辑角色" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="editUser(scope.$index, scope.row)"></span> <span class="icon-fanxing-xiugai editIcon" @click="editUser(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除角色" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除角色" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
systemTime:'', systemTime:'',
syncTime:false, syncTime:false,
computerTime:this.$moment().format("YYYY-MM-DD HH:mm:ss"), computerTime:this.$moment().format("YYYY-MM-DD HH:mm:ss"),
dev_unid:sessionStorage.getItem('dev_unid'), dev_unid:localStorage.getItem('dev_unid'),
device_id:sessionStorage.getItem('device_id'), device_id:sessionStorage.getItem('device_id'),
serverAdr:'' serverAdr:''
} }
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
selectFilename:'', selectFilename:'',
timeArr:[], timeArr:[],
file:null, file:null,
dev_unid:sessionStorage.getItem('dev_unid'), dev_unid:localStorage.getItem('dev_unid'),
device_id:sessionStorage.getItem('device_id'), device_id:sessionStorage.getItem('device_id'),
} }
}, },
......
...@@ -43,15 +43,15 @@ ...@@ -43,15 +43,15 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="编辑用户" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="编辑用户" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="editUser(scope.$index, scope.row)"></span> <span class="icon-fanxing-xiugai editIcon" @click="editUser(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<!-- <span class="tableSpanBorder"></span> <!-- <span class="tableSpanBorder"></span>
<el-tooltip content="重置密码" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="重置密码" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon2" @click="reset(scope.$index, scope.row)"></span> <span class="icon-fanxing-xiugai editIcon2" @click="reset(scope.$index, scope.row)"></span>
</el-tooltip> --> </el-tooltip> -->
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -83,9 +83,9 @@ export default { ...@@ -83,9 +83,9 @@ export default {
}, },
beforeDestroy: function () { beforeDestroy: function () {
if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) { // if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
this.videoplayer.pause(); // this.videoplayer.pause();
} // }
} }
}; };
......
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div> <div class="headerbox">
<span class="selectBox">
<el-select
v-model="curCateUnid"
placeholder="请选择"
@change="cateChange"
:popper-append-to-body="false"
>
<el-option
v-for="item in catesData"
:key="item"
:value="item.cate_unid"
:label="item.name"
></el-option>
</el-select>
</span>
<span class="addbox"> <span class="addbox">
<el-button type="primary" @click="addcode">添加code</el-button> <el-button type="primary" @click="addAuthor">添加授权</el-button>
</span> </span>
</div> </div>
<div class="mt10"> <div class="mt10">
...@@ -35,34 +20,25 @@ ...@@ -35,34 +20,25 @@
label="#" label="#"
width="40" width="40"
></el-table-column> ></el-table-column>
<el-table-column align="center" prop="code_unid" label="code_unid"> <el-table-column align="center" prop="code_unid" label="模板名称">
</el-table-column> </el-table-column>
<el-table-column prop="code" align="center" label="code"> <el-table-column prop="code" align="center" label="授权路数">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="name" label="名称"> <el-table-column align="center" prop="name" label="已使用路数">
</el-table-column>
<el-table-column align="center" prop="name" label="备注">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="operation" label="操作"> <el-table-column align="center" prop="operation" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip <el-tooltip
content="编辑" content="详情"
placement="bottom" placement="bottom"
effect="light" effect="light"
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-xiugai editIcon" class="iconfont el-icon-info"
@click="editCode(scope.$index, scope.row)" @click="showDetail(scope.$index, scope.row)"
></span>
</el-tooltip>
<el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="iconfont icon-detail delIcon del-btn"
@click="deleteCode(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
</template> </template>
...@@ -86,50 +62,30 @@ ...@@ -86,50 +62,30 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="设置CODE" :visible.sync="detailVisible" width="400px"> <el-dialog title="上传授权文件" :visible.sync="detailVisible" width="400px">
<el-form <el-upload
ref="trfficform" class="upload-demo"
:model="codeData" ref="upload"
label-position="left" action="https://jsonplaceholder.typicode.com/posts/"
label-width="80px" :on-preview="handlePreview"
> :on-remove="handleRemove"
<el-form-item :file-list="fileList"
label="类型" :auto-upload="false"
prop="catename"
:rules="[
{ required: true, message: '类型不能为空!', trigger: 'blur' }
]"
> >
<el-input v-model="codeData.catename" disabled></el-input> <el-button slot="trigger" size="small" type="primary"
</el-form-item> >选取文件</el-button
<el-form-item
label="CODE"
prop="code"
:rules="[
{ required: true, message: 'code不能为空!', trigger: 'blur' }
]"
> >
<el-input v-model="codeData.code"></el-input> <el-button
</el-form-item> style="margin-left: 10px;"
<el-form-item size="small"
label="名称" type="success"
prop="name" @click="submitUpload"
:rules="[ >上传到服务器</el-button
{ required: true, message: '名称不能为空!', trigger: 'blur' }
]"
> >
<el-input v-model="codeData.name"></el-input> <div slot="tip" class="el-upload__tip">
</el-form-item> 只能上传jpg/png文件,且不超过500kb
<el-form-item </div>
label="备注" </el-upload>
prop="note"
:rules="[
{ required: true, message: '备注名称不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="detailVisible = false">取 消</el-button> <el-button size="small" @click="detailVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveCode" <el-button size="small" type="primary" @click="saveCode"
...@@ -137,9 +93,13 @@ ...@@ -137,9 +93,13 @@
> >
</span> </span>
</el-dialog> </el-dialog>
<div>
<authordetail ref="detail"></authordetail>
</div>
</div> </div>
</template> </template>
<script> <script>
import authordetail from "./authorDetail";
export default { export default {
data() { data() {
return { return {
...@@ -156,88 +116,28 @@ export default { ...@@ -156,88 +116,28 @@ export default {
codeData: {} codeData: {}
}; };
}, },
components: {}, components: {
authordetail
},
created() { created() {
this.getCates(); this.getCates();
}, },
methods: { methods: {
cateChange(cateunid) { submitUpload() {
let offset = (this.page - 1) * this.pageSize; this.$refs.upload.submit();
let obj = {
limit: this.pageSize,
offset: offset
};
this.$api.codes
.codes(obj, cateunid)
.then(res => {
this.tableData = res.list_data;
})
.catch(err => {});
}, },
addcode() { handleRemove(file, fileList) {
this.codeStatus = 0; console.log(file, fileList);
this.detailVisible = true;
this.codeData.catename = this.getCateName(this.curCateUnid);
},
editCode(index, row) {
this.codeStatus = 1;
this.detailVisible = true;
this.codeData = row;
this.codeData.catename = this.getCateName(this.curCateUnid);
},
getCateName(cateunid) {
let name = "";
this.catesData.forEach(ele => {
if (ele.cate_unid === cateunid) {
name = ele.name;
}
});
return name;
},
getCates() {
this.$api.codes.cates().then(res => {
this.catesData = res.list_data;
});
},
saveCode() {
this.$refs["trfficform"].validate(valid => {
if (valid) {
if (this.editStatus === 0) {
this.saveAddCode();
}
if (this.editStatus === 1) {
this.saveEditCode();
}
} else {
console.log("error submit!!");
return false;
}
});
}, },
saveAddCode() { handlePreview(file) {
this.$api.codes console.log(file);
.addTrafficCode(this.codeData, this.curCateUnid)
.then(res => {
console.log(res);
});
}, },
saveEditCode() { showDetail(index, row) {
this.$api.codes this.$refs.detail.initahthor(row);
.editTrafficCode(
this.codeData,
this.curCateUnid,
this.codeData.code_unid
)
.then(res => {
console.log(res);
});
}, },
deleteCode(index, row) { addAuthor() {
this.$api.codes this.codeStatus = 0;
.editTrafficCode(row, this.curCateUnid, row.code_unid) this.detailVisible = true;
.then(res => {
console.log(res);
});
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val; this.pageSize = val;
...@@ -249,16 +149,11 @@ export default { ...@@ -249,16 +149,11 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.addbox { .headerbox {
float: right; overflow: hidden;
margin-right: 10px;
} }
.code-btn { .addbox {
margin-bottom: 10px;
float: right; float: right;
margin-right: 10px; margin-right: 10px;
} }
.del-btn {
padding-left: 20px;
}
</style> </style>
<template>
<div>
<el-dialog title="业务功能" :visible.sync="detailVisible" width="753px">
<div class="authordetail-box">
<div class="authitembox">
<div class="itemheader">识别</div>
<div></div>
</div>
<div class="authitembox">
<div class="itemheader">违法</div>
<div></div>
</div>
<div class="authitembox">
<div class="itemheader">事件</div>
<div></div>
</div>
<div class="authitembox">
<div class="itemheader">流量</div>
<div></div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="detailVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="detailVisible = false"
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
detailVisible: true,
detailData: {}
};
},
methods: {
initahthor(data) {
this.detailVisible = true;
this.detailData = data;
}
}
};
</script>
<style lang="scss" scoped>
.authordetail-box {
display: flex;
}
.authitembox {
width: 160px;
height: 240px;
margin-left: 15px;
border: 1px solid #E9E9E9;
border-radius: 4px;
}
.authitembox:first-child {
margin-left: 0;
}
.authitembox .itemheader {
height: 40px;
line-height: 40px;
text-align: center;
background:rgba(245,245,245,1);
border-bottom:1px solid rgba(233,233,233,1);
color: #222;
font-size: 16px;
font-weight: 600;
}
</style>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-xiugai editIcon" class="icon-fanxing-xiugai editIcon"
@click="editCode(scope.$index, scope.row)" @click="editCode(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-detail delIcon del-btn" class="el-icon-delete delIcon del-btn"
@click="deleteCode(scope.$index, scope.row)" @click="deleteCode(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-xiugai editIcon" class="icon-fanxing-xiugai editIcon"
@click="editCode(scope.$index, scope.row)" @click="editCode(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-detail delIcon del-btn" class="el-icon-delete delIcon del-btn"
@click="deleteCode(scope.$index, scope.row)" @click="deleteCode(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
], ],
}, },
user_unid:sessionStorage.getItem('user_unid'), user_unid:sessionStorage.getItem('user_unid'),
dev_unid:sessionStorage.getItem('dev_unid'), dev_unid:localStorage.getItem('dev_unid'),
isGetted:false, isGetted:false,
sipSetting:{ sipSetting:{
sip_username: '', // string sip_username: '', // string
......
...@@ -44,11 +44,11 @@ ...@@ -44,11 +44,11 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detail(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detail(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
isLeaf: 'leaf' isLeaf: 'leaf'
}, },
detailData:[], detailData:[],
dev_unid: sessionStorage.getItem('dev_unid'), dev_unid: localStorage.getItem('dev_unid'),
resource:{ resource:{
picture_busy: 0, picture_busy: 0,
picture_free: 0, picture_free: 0,
......
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
if(this.type == 'add'){ if(this.type == 'add'){
this.$refs['cameraDialog'].validate((valid) => { this.$refs['cameraDialog'].validate((valid) => {
if (valid) { if (valid) {
this.$api.resource.addCamera(this.addVideoParam,this.devsId).then(res=>{ this.$api.resource.addCamera(this.addVideoParam,localStorage.getItem('dev_unid')).then(res=>{
if(res.ecode==200){ if(res.ecode==200){
this.$message({ this.$message({
message: res.enote, message: res.enote,
......
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="修改" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="修改" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="editFun(scope.$index, scope.row)"></span> <span class="icon-fanxing-xiugai editIcon" @click="editFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false > <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false >
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="修改" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="修改" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="editVideo(scope.$index, scope.row)"></span> <span class="icon-fanxing-xiugai editIcon" @click="editVideo(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delVideo(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delVideo(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
currentIndex: 0, currentIndex: 0,
eventList: JSON.parse(window.localStorage.getItem('安防事件')), eventList: JSON.parse(window.localStorage.getItem('安防事件')),
playurl: '', playurl: '',
dev_unid: sessionStorage.getItem('dev_unid'), dev_unid: localStorage.getItem('dev_unid'),
cameraArr:[], cameraArr:[],
cameraTree:[], cameraTree:[],
videoTree:[], videoTree:[],
......
...@@ -129,9 +129,10 @@ export default { ...@@ -129,9 +129,10 @@ export default {
this.subtaskdata = vdata; this.subtaskdata = vdata;
this.$refs.setting.getTaskParams(); this.$refs.setting.getTaskParams();
if (vdata.running_status != "Running") { if (vdata.running_status != "Running") {
this.$refs.displayInfo.showInfo( this.$message({
"该任务没有运行,无法获取分析视频和抓拍信息" message: "该任务没有运行,无法获取分析视频和抓拍信息",
); type: "error"
});
return; return;
} }
this.pushSteam(vdata); this.pushSteam(vdata);
...@@ -273,7 +274,6 @@ export default { ...@@ -273,7 +274,6 @@ export default {
.task-lsit{ .task-lsit{
display inline-block display inline-block
cursor pointer cursor pointer
padding 10px 0
.icon { .icon {
padding-left 10px padding-left 10px
} }
...@@ -291,6 +291,9 @@ export default { ...@@ -291,6 +291,9 @@ export default {
} }
.task-title{ .task-title{
padding-left 10px padding-left 10px
width 100%
display inline-block
overflow hidden
} }
.tasklist{ .tasklist{
padding-left 10px; padding-left 10px;
......
...@@ -6,11 +6,19 @@ ...@@ -6,11 +6,19 @@
width="1100px" width="1100px"
:before-close="beforeHideModal" :before-close="beforeHideModal"
> >
<TraficCanvas :bgUrl='bgUrl' v-if="type=='0' || type=='5'" ref='canvas'></TraficCanvas> <TraficCanvas
<FlowCanvas :bgUrl='bgUrl' v-if="type=='1'" ref='canvas'></FlowCanvas> :bgUrl="bgUrl"
<SafeCanvas :bgUrl='bgUrl' v-if="type=='2'" ref='canvas'></SafeCanvas> v-if="type == '0' || type == '5' || type == '3'"
<FaceCanvas :bgUrl='bgUrl' v-if="type=='4'" ref='canvas'></FaceCanvas> ref="canvas"
<ComplexCanvas :bgUrl='bgUrl' v-if="type=='7'" ref='canvas'></ComplexCanvas> ></TraficCanvas>
<FlowCanvas :bgUrl="bgUrl" v-if="type == '1'" ref="canvas"></FlowCanvas>
<SafeCanvas :bgUrl="bgUrl" v-if="type == '2'" ref="canvas"></SafeCanvas>
<FaceCanvas :bgUrl="bgUrl" v-if="type == '4'" ref="canvas"></FaceCanvas>
<ComplexCanvas
:bgUrl="bgUrl"
v-if="type == '7'"
ref="canvas"
></ComplexCanvas>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="beforeHideModal">取 消</el-button> <el-button @click="beforeHideModal">取 消</el-button>
<el-button type="primary" @click="save">确 定</el-button> <el-button type="primary" @click="save">确 定</el-button>
...@@ -19,23 +27,23 @@ ...@@ -19,23 +27,23 @@
</div> </div>
</template> </template>
<script> <script>
import TraficCanvas from "./areaconfig/TraficCanvas"; import TraficCanvas from "./areaconfig/TraficCanvas";
import FlowCanvas from "./areaconfig/FlowCanvas"; import FlowCanvas from "./areaconfig/FlowCanvas";
import SafeCanvas from "./areaconfig/SafeCanvas"; import SafeCanvas from "./areaconfig/SafeCanvas";
import FaceCanvas from "./areaconfig/FaceCanvas"; import FaceCanvas from "./areaconfig/FaceCanvas";
import ComplexCanvas from "./areaconfig/ComplexCanvas"; import ComplexCanvas from "./areaconfig/ComplexCanvas";
export default { export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
isShow: false, isShow: false,
type: '0', type: "0",
btnIsactive: false, btnIsactive: false,
showClose: false, showClose: false,
roiBody: {}, roiBody: {},
XMLStr: "", XMLStr: "",
taskData:'', taskData: "",
bgUrl:'' bgUrl: ""
}; };
}, },
components: { components: {
...@@ -46,27 +54,35 @@ export default { ...@@ -46,27 +54,35 @@ export default {
ComplexCanvas ComplexCanvas
}, },
methods: { methods: {
showModal: function(data,mtaskdata) { showModal: function(data, mtaskdata) {
var _this = this; var _this = this;
this.$store.commit('setocxstate',0) this.$store.commit("setocxstate", 0);
this.taskData = mtaskdata; this.taskData = mtaskdata;
this.dialogVisible =true; this.dialogVisible = true;
this.type = data.algo_type; this.type = data.algo_type;
// this.type = 2; // this.type = 2;
this.bgUrl = ""; this.bgUrl = "";
//获取视频截图 //获取视频截图
this.$api.task.cutpic(mtaskdata.vchan.vdev_unid, mtaskdata.vchan.vchan_refid,mtaskdata.subtask_id).then(data => { this.$api.task
.cutpic(
mtaskdata.vchan.vdev_unid,
mtaskdata.vchan.vchan_refid,
mtaskdata.subtask_id
)
.then(data => {
if (!data.ecode) { if (!data.ecode) {
this.bgUrl = "data:image/png;base64," + data.pic_base64; this.bgUrl = "data:image/png;base64," + data.pic_base64;
setTimeout(() => { setTimeout(() => {
let img = document.getElementById('pic').childNodes[0] let img = document.getElementById("pic").childNodes[0];
let canvas = document.createElement("canvas"); let canvas = document.createElement("canvas");
canvas.width = 800; canvas.width = 800;
canvas.height = 500; canvas.height = 500;
try { try {
canvas.getContext("2d").drawImage(img, 0, 0, 800, 500); canvas.getContext("2d").drawImage(img, 0, 0, 800, 500);
_this.bgUrl = canvas.toDataURL("image/webp"); _this.bgUrl = canvas.toDataURL("image/webp");
} catch (error) {} } catch (error) {
console.log(error);
}
}, 500); }, 500);
} else { } else {
alert("区域设置截图失败!" + data.enote); alert("区域设置截图失败!" + data.enote);
...@@ -78,14 +94,12 @@ export default { ...@@ -78,14 +94,12 @@ export default {
setTimeout(() => { setTimeout(() => {
_this.$refs.canvas.stageInit(); _this.$refs.canvas.stageInit();
if (data.rois) { if (data.rois) {
_this.$refs.canvas.configInit( _this.$refs.canvas.configInit(data.rois[0].roi);
data.rois[0].roi
);
} }
}, 300); }, 300);
}, },
beforeHideModal: function() { beforeHideModal: function() {
this.$store.commit('setocxstate',1) this.$store.commit("setocxstate", 1);
this.dialogVisible = false; this.dialogVisible = false;
this.$refs.canvas.clear(); this.$refs.canvas.clear();
this.$refs.canvas.cindex = 0; this.$refs.canvas.cindex = 0;
...@@ -101,11 +115,12 @@ export default { ...@@ -101,11 +115,12 @@ export default {
this.btnIsactive = true; this.btnIsactive = true;
try { try {
this.EditList(1); this.EditList(1);
} catch (error) {} } catch (error) {
console.log(error);
}
}, },
save: function() { save: function() {
if (this.$refs.canvas.roadFlag === false) { if (this.$refs.canvas.roadFlag === false) {
this.$alert("车道线有修改,请检查车道属性是否正确", "提示", { this.$alert("车道线有修改,请检查车道属性是否正确", "提示", {
confirmButtonText: "确定" confirmButtonText: "确定"
}); });
...@@ -125,8 +140,6 @@ export default { ...@@ -125,8 +140,6 @@ export default {
this.beforeHideModal(); this.beforeHideModal();
} }
} }
} };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped></style>
</style>
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
title="参数设置" title="参数设置"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="50%" width="50%"
:before-close="handleClose"> :before-close="handleClose"
>
<span> <span>
<iframe <iframe
id="iframe" id="iframe"
...@@ -28,52 +29,53 @@ export default { ...@@ -28,52 +29,53 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
XMLStr:'', XMLStr: "",
basicXml:'', basicXml: "",
taskData:"" taskData: ""
}; };
}, },
methods: { methods: {
init(data){ init(data) {
this.$store.commit('setocxstate',0) this.$store.commit("setocxstate", 0);
this.dialogVisible = true; this.dialogVisible = true;
this.taskData = data; this.taskData = data;
let that = this; let that = this;
setTimeout(()=>{ setTimeout(() => {
that.xmlInit(data.mtasks[0].scenes[0]); that.xmlInit(data);
},800) }, 800);
}, },
balltaskinit(data){ balltaskinit(data) {
this.$store.commit('setocxstate',0) this.$store.commit("setocxstate", 0);
this.dialogVisible = true; this.dialogVisible = true;
setTimeout(()=>{ setTimeout(() => {
this.xmlInit(data); this.xmlInit(data);
},800) }, 800);
}, },
xmlInit: function (obj) { xmlInit: function(obj) {
this.XMLStr =
this.XMLStr = obj.config.xml || '<?xml version="1.0" encoding="GBK"?><root></root>' obj.config.xml || '<?xml version="1.0" encoding="GBK"?><root></root>';
console.log('XML:'+this.XMLStr.split('@').length) console.log("XML:" + this.XMLStr.split("@").length);
if (this.XMLStr.split('@').length>1) { if (this.XMLStr.split("@").length > 1) {
this.XMLStr = '<?xml version="1.0" encoding="GBK"?><root></root>' this.XMLStr = '<?xml version="1.0" encoding="GBK"?><root></root>';
} }
this.basicXml = obj.basicConfig.xml; this.basicXml = obj.basicConfig.xml;
this.$refs.iframe.contentWindow.loadParameterTree(this.basicXml,this.XMLStr); this.$refs.iframe.contentWindow.loadParameterTree(
this.basicXml,
this.XMLStr
);
}, },
save:function () { save: function() {
this.$refs.iframe.contentWindow.submit(); this.$refs.iframe.contentWindow.submit();
//ifram 传递回来的饿xml //ifram 传递回来的饿xml
this.XMLStr = this.$refs.iframe.contentWindow.xmlStr; this.XMLStr = this.$refs.iframe.contentWindow.xmlStr;
this.dialogVisible = false; this.dialogVisible = false;
this.$parent.submit(this.XMLStr,'config') this.$parent.submit(this.XMLStr, "config");
}, },
handleClose(done) { handleClose(done) {
this.dialogVisible = false; this.dialogVisible = false;
this.$store.commit('setocxstate',1) this.$store.commit("setocxstate", 1);
} }
} }
} };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped></style>
</style>
...@@ -5,70 +5,70 @@ ...@@ -5,70 +5,70 @@
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_UPLEFT')" @mousedown="Ytontroller('SIP_CTRL_PTZ_UPLEFT')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_UPLEFT')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_UPLEFT')"
class="control-btn el-icon-top-left" class="control-btn icon-fanxing-zuoshang"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_UP')" @mousedown="Ytontroller('SIP_CTRL_PTZ_UP')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_UP')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_UP')"
class="control-btn el-icon-top" class="control-btn icon-fanxing-shang"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_UPRIGHT')" @mousedown="Ytontroller('SIP_CTRL_PTZ_UPRIGHT')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_UPRIGHT')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_UPRIGHT')"
class="control-btn el-icon-top-right" class="control-btn icon-fanxing-youshang"
></span> ></span>
</div> </div>
<div> <div>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_LEFT')" @mousedown="Ytontroller('SIP_CTRL_PTZ_LEFT')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_LEFT')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_LEFT')"
class="control-btn el-icon-back" class="control-btn icon-fanxing-zuo"
></span> ></span>
<span <span
@mousedown="Ytontroller('12')" @mousedown="Ytontroller('12')"
@mouseup="stopYtontroller('12')" @mouseup="stopYtontroller('12')"
class="control-btn el-icon-refresh" class="control-btn icon-fanxing-zhongzhi"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_RIGHT')" @mousedown="Ytontroller('SIP_CTRL_PTZ_RIGHT')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_RIGHT')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_RIGHT')"
class="control-btn el-icon-right" class="control-btn icon-fanxing-you"
></span> ></span>
</div> </div>
<div> <div>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_DOWNLEFT')" @mousedown="Ytontroller('SIP_CTRL_PTZ_DOWNLEFT')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWNLEFT')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWNLEFT')"
class="control-btn el-icon-bottom-left" class="control-btn icon-fanxing-zuoxia"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_DOWN')" @mousedown="Ytontroller('SIP_CTRL_PTZ_DOWN')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWN')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWN')"
class="control-btn el-icon-bottom" class="control-btn icon-fanxing-xia"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_DOWNRIGHT')" @mousedown="Ytontroller('SIP_CTRL_PTZ_DOWNRIGHT')"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWNRIGHT')" @mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWNRIGHT')"
class="control-btn el-icon-bottom-right" class="control-btn icon-fanxing-youxia"
></span> ></span>
</div> </div>
</div> </div>
<div class="control-right-box"> <div class="control-right-box">
<div class="slider-box"> <div class="slider-box">
<span class="title">光圈</span> <span class="title">光圈</span>
<el-slider class="slider-item" v-model="value" show-input></el-slider> <el-slider class="slider-item" v-model="value1" show-input></el-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
<span class="title">光倍</span> <span class="title">光倍</span>
<el-slider class="slider-item" v-model="value" show-input></el-slider> <el-slider class="slider-item" v-model="value2" show-input></el-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
<span class="title">焦距</span> <span class="title">焦距</span>
<el-slider class="slider-item" v-model="value" show-input></el-slider> <el-slider class="slider-item" v-model="value3" show-input></el-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
<span class="title">速度</span> <span class="title">速度</span>
<el-slider class="slider-item" v-model="value" show-input></el-slider> <el-slider class="slider-item" v-model="value4" show-input></el-slider>
</div> </div>
<div class="right-bottom-box"> <div class="right-bottom-box">
<div class="setyzw item-box"> <div class="setyzw item-box">
...@@ -99,7 +99,11 @@ export default { ...@@ -99,7 +99,11 @@ export default {
data() { data() {
return { return {
showyt: false, showyt: false,
value: "" value: 0,
value1: 0,
value2: 0,
value3: 0,
value4: 0,
}; };
}, },
methods: { methods: {
...@@ -162,12 +166,13 @@ export default { ...@@ -162,12 +166,13 @@ export default {
.control-btn { .control-btn {
height: 5vh; height: 5vh;
margin-top: 2vh; margin-top: 2vh;
width: 3.5vw; width: 3.8vw;
overflow: hidden; overflow: hidden;
font-size: 30px; font-size: 30px;
text-align: center; text-align: center;
color: #cccccc; color: #cccccc;
font-weight: 600; font-weight: 600;
display inline-block
} }
} }
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<el-button type="primary" @click="detailVisible = false">关 闭</el-button> <el-button type="primary" @click="detailVisible = false">关 闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
<curVideo ref="visableDialog" :playersrc="playurl"></curVideo> <videoDialog ref="visableDialog" :playersrc="playurl"></videoDialog>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -142,11 +142,11 @@ ...@@ -142,11 +142,11 @@
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -173,11 +173,11 @@ ...@@ -173,11 +173,11 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -208,11 +208,11 @@ ...@@ -208,11 +208,11 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -91,11 +91,11 @@ ...@@ -91,11 +91,11 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span> <span class="el-icon-info editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span> <span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
<template>
<div class="expande-table-row">
<span class="label">视频源文件</span>
<span class="subtask-info">{{ subTaskData.vchan_name }}</span>
<span class="label">设备地址</span>
<span class="subtask-info">192.178.99.99</span>
<span class="label">已用资源</span>
<span class="subtask-info">22</span>
<span class="label">设备容量</span>
<span class="subtask-info">33</span>
<span class="label">指定设备下发</span>
<span class="subtask-info">
<el-select v-model="assign_id">
<el-option
v-for="(item, index) in freeList"
:key="index"
:value="item.device_id"
>
{{ item.in_ip }}
</el-option>
</el-select>
</span>
<span class="label sub-btn" @click="subMove">确定</span>
</div>
</template>
<script>
export default {
data() {
return {
assign_id: ""
};
},
props: ["subTaskData", "freeList", "taskData"],
methods: {
subMove() {
let taskID = this.taskData.task_id;
let subTaksID = this.subTaskData.subtask_id;
this.$api.task.getTaskParams(taskID, subTaksID).then(res => {
let obj = {};
obj.mtasks = res.mtasks;
obj.assign_to = {
id: this.assign_id,
flag: 0
};
this.subRoi(taskID, subTaksID, obj);
});
},
subRoi(taskid, subtaskid, postObj) {
this.$api.task
.editRoi(taskid, subtaskid, postObj, {
headers: {
authorization: localStorage.getItem("atoken")
}
})
.then(m => {
if (m.ecode == "200") {
this.$message({
message: "设置成功!",
type: "success"
});
}
});
}
},
created() {},
watch: {
subTaskData(val) {
console.log(val);
}
},
mounted() {
this.assign_id = this.subTaskData.assign_id
? this.subTaskData.assign_id
: "";
}
};
</script>
<style lang="scss" scoped>
.expande-table-row {
span {
float: left;
border-bottom: 1px solid #ccc;
overflow: hidden;
}
.label {
width: 6vw;
text-align: center;
border-left: 1px solid $border-color;
background: #f0f0f0;
height: 40px;
line-height: 40px;
}
.subtask-info {
border-left: 1px solid #f0f0f0;
text-align: center;
overflow: hidden;
height: 40px;
line-height: 40px;
}
.subtask-info:nth-child(2) {
width: 9vw;
overflow: hidden;
}
.subtask-info:nth-child(4) {
width: 6vw;
}
.subtask-info:nth-child(6) {
width: 4.5vw;
}
.subtask-info:nth-child(8) {
width: 4vw;
}
.subtask-info:nth-child(10) {
width: 12vw;
}
.sub-btn {
cursor: pointer;
}
}
</style>
...@@ -28,19 +28,20 @@ ...@@ -28,19 +28,20 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="场景占用"> <el-form-item label="场景占用">
<el-select <el-input
v-model="formData.type" v-model="formData.resource_use"
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
> >
<el-option key="1" label="全部" value></el-option> </el-input>
<el-option key="2" label="222" value="2"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间计划"> <el-form-item label="时间计划">
<el-input v-model="formData.type"></el-input> <el-select v-model="formData.period">
<el-option value="true" label="全天"></el-option>
<el-option value="false" label="时间"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间"> <el-form-item label="时间" v-show="formData.plate_time != 'day'">
<el-date-picker <el-date-picker
style="width:100%" style="width:100%"
v-model="formData.timer" v-model="formData.timer"
...@@ -65,6 +66,12 @@ ...@@ -65,6 +66,12 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型">
<el-input
v-model="formData.plate_type"
placeholder="请选择"
></el-input>
</el-form-item>
<el-form-item label="优先级"> <el-form-item label="优先级">
<el-select <el-select
v-model="formData.priority" v-model="formData.priority"
...@@ -127,7 +134,9 @@ export default { ...@@ -127,7 +134,9 @@ export default {
store_conf: { store_conf: {
unid: "" unid: ""
}, },
priority: "" priority: "",
plate_type: "",
plate_time: "",
}; };
} }
if (type == "edit") { if (type == "edit") {
...@@ -178,6 +187,9 @@ export default { ...@@ -178,6 +187,9 @@ export default {
end_dt: this.setUtcTime(this.formData.timer[1]), end_dt: this.setUtcTime(this.formData.timer[1]),
priority: this.formData.priority, priority: this.formData.priority,
store_conf_unid: this.formData.store_conf.unid, store_conf_unid: this.formData.store_conf.unid,
period: this.formData.period,
plate_type: this.formData.plate_type,
resource_use: this.formData.resource_use,
task_type: "normal" task_type: "normal"
// algo_comb_unid: this.formData.store_conf, // algo_comb_unid: this.formData.store_conf,
}; };
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="status" prop="running_status"
label="视频状态" label="视频状态"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-Migration moveIcon" class="icon-fanxing-qianyi moveIcon"
@click="moveFun(scope.$index, scope.row)" @click="moveFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-detail delIcon" class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)" @click="delFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -115,6 +115,7 @@ export default { ...@@ -115,6 +115,7 @@ export default {
user_unid: "", user_unid: "",
formData: {}, formData: {},
editData: {}, editData: {},
taskData:{},
setvisible: false, setvisible: false,
props: { props: {
id: "vchan_refid", id: "vchan_refid",
...@@ -152,6 +153,7 @@ export default { ...@@ -152,6 +153,7 @@ export default {
}, },
methods: { methods: {
showModal(val) { showModal(val) {
this.taskData = val;
this.tableData = []; this.tableData = [];
this.setvisible = true; this.setvisible = true;
this.$store.commit("setocxstate", 1); this.$store.commit("setocxstate", 1);
...@@ -164,12 +166,14 @@ export default { ...@@ -164,12 +166,14 @@ export default {
data[i].vchan.subtask_id = data[i].subtask_id; data[i].vchan.subtask_id = data[i].subtask_id;
data[i].vchan.refid = data[i].vchan.vchan_refid; data[i].vchan.refid = data[i].vchan.vchan_refid;
data[i].vchan.name = data[i].vchan.vchan_name; data[i].vchan.name = data[i].vchan.vchan_name;
data[i].vchan.running_status = data[i].running_status
} else { } else {
data.vchan = { data.vchan = {
subtask_id: data[i].subtask_id, subtask_id: data[i].subtask_id,
refid: "", refid: "",
vchan_name: data[i].subtask_name, vchan_name: data[i].subtask_name,
name: data[i].subtask_name name: data[i].subtask_name,
running_status: data[i].running_status
}; };
} }
ary.push(data[i].vchan); ary.push(data[i].vchan);
...@@ -184,7 +188,8 @@ export default { ...@@ -184,7 +188,8 @@ export default {
if (this.tableData.length > 0) { if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_id == data.vchan_id) { if (this.tableData[i].vchan_id == data.vchan_id) {
this.tableData.splice(i, 1); this.delFun(i, this.tableData[i],'tree')
staus = true; staus = true;
break; break;
} }
...@@ -195,6 +200,12 @@ export default { ...@@ -195,6 +200,12 @@ export default {
staus = false; staus = false;
} }
}, },
editTask(data) {
// let data = this.taskData;
this.$api.task.editTask(data, data.task_id).then(res => {
this.$emit("refresh");
});
},
editsubTask(vchan) { editsubTask(vchan) {
let data = { let data = {
is_dome: false, is_dome: false,
...@@ -206,6 +217,7 @@ export default { ...@@ -206,6 +217,7 @@ export default {
vchan_name: vchan.name vchan_name: vchan.name
} }
}; };
this.$api.task.editSubTask(this.editData.task_id, data).then(res => { this.$api.task.editSubTask(this.editData.task_id, data).then(res => {
this.tableData.push(vchan); this.tableData.push(vchan);
}); });
...@@ -213,14 +225,18 @@ export default { ...@@ -213,14 +225,18 @@ export default {
playVideo(data) { playVideo(data) {
console.log("b", data); console.log("b", data);
}, },
delFun(index, data) { delFun(index, data, action= "tree") {
debugger;
this.$api.task this.$api.task
.deleteSubTask(this.editData.task_id, data.subtask_id) .deleteSubTask(this.editData.task_id, data.subtask_id)
.then(res => { .then(res => {
this.tableData.splice(index, 1); this.tableData.splice(index, 1);
this.checkvckan();
}); });
if (action != "tree") {
setTimeout(() => {
this.checkvckan(); this.checkvckan();
}, 0);
}
}, },
append(data) { append(data) {
const newChild = { id: id++, label: "testtest", children: [] }; const newChild = { id: id++, label: "testtest", children: [] };
...@@ -423,7 +439,9 @@ export default { ...@@ -423,7 +439,9 @@ export default {
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.$refs.tree.setCheckedKeys([]); this.$refs.tree.setCheckedKeys([]);
}, },
save() {}, save() {
this.setvisible = false;
},
moveFun(index, row) { moveFun(index, row) {
this.innerVisible = true; this.innerVisible = true;
} }
......
...@@ -65,40 +65,26 @@ ...@@ -65,40 +65,26 @@
> >
</span> </span>
</div> </div>
<div style="padding: 0 23px 20px 23px;width:99%"> <div style="padding: 0 23px 20px 23px;width:98%">
<el-table <el-table
height="574" height="50vh"
:data="tableData" :data="tableData"
stripe stripe
border border
ref="table" ref="table"
style="width: 100%" style="width: 100%"
@expand-change="expandchange" @expand-change="expandchange"
:expand-row-keys="rowkey"
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<div <subTaskInfo
v-for="(item, index) in props.row.subTaskData" v-for="(item, index) in props.row.subTaskData"
:key="index" :key="index"
class="expande-table-row" :subTaskData="item"
:taskData="props.row"
:freeList="freeList"
> >
<span class="label">视频源文件</span> </subTaskInfo>
<span class="subtask-info">{{item.vchan_name}}</span>
<span class="label">设备地址</span>
<span class="subtask-info">192.178.99.99</span>
<span class="label">已用资源</span>
<span class="subtask-info">22</span>
<span class="label">设备容量</span>
<span class="subtask-info">33</span>
<span class="label">指定设备下发</span>
<span class="subtask-info">
<el-select>
<el-option>sss</el-option>
</el-select>
</span>
<span class="label">确定</span>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -134,6 +120,8 @@ ...@@ -134,6 +120,8 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="workers_count" label="资源用量"> <el-table-column align="center" prop="workers_count" label="资源用量">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="workers_count" label="设备类型">
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="priority" prop="priority"
...@@ -144,7 +132,6 @@ ...@@ -144,7 +132,6 @@
<el-table-column <el-table-column
align="center" align="center"
prop="start_dt" prop="start_dt"
width="200"
:formatter="dateFormatter" :formatter="dateFormatter"
label="时间计划" label="时间计划"
> >
...@@ -163,7 +150,7 @@ ...@@ -163,7 +150,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-xiugai editIcon" class="icon-fanxing-xiugai editIcon"
@click="editVideo(scope.$index, scope.row)" @click="editVideo(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -175,7 +162,7 @@ ...@@ -175,7 +162,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-xiugai editIcon2" class="icon-fanxing-xiugai editIcon2"
@click="editTask('edit', scope.$index, scope.row)" @click="editTask('edit', scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -187,7 +174,7 @@ ...@@ -187,7 +174,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-bofang playIcon" class="icon-fanxing-qidong playIcon"
@click="setTaskStatus(scope.row, 'start')" @click="setTaskStatus(scope.row, 'start')"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -199,7 +186,7 @@ ...@@ -199,7 +186,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-zanting pauseIcon" class="icon-fanxing-zanting pauseIcon"
@click="setTaskStatus(scope.row, 'stop')" @click="setTaskStatus(scope.row, 'stop')"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -211,7 +198,7 @@ ...@@ -211,7 +198,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="iconfont icon-detail delIcon" class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)" @click="delFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -252,6 +239,7 @@ ...@@ -252,6 +239,7 @@
<script> <script>
import editset from "./editSet"; import editset from "./editSet";
import editvideo from "./editVideo"; import editvideo from "./editVideo";
import subTaskInfo from "./subtask.vue";
export default { export default {
data() { data() {
return { return {
...@@ -260,23 +248,27 @@ export default { ...@@ -260,23 +248,27 @@ export default {
task_algo_type: "", task_algo_type: "",
total: 0, total: 0,
page: 1, page: 1,
freeList: [],
pageSize: 30, pageSize: 30,
setShow: false, setShow: false,
videoShow: false, videoShow: false,
editForm: {}, editForm: {},
tableData: [], tableData: [],
subTaskData: [], subTaskData: [],
pedittype: "add", pedittype: "add",
currentRow:{}, currentRow: {},
rowkey:["1"] assign_ip: ""
}; };
}, },
components: { components: {
editset, editset,
editvideo editvideo,
subTaskInfo
}, },
mounted() { mounted() {
this.getTaskList(); this.getTaskList();
this.getFreelist();
}, },
methods: { methods: {
expandchange(row, prow) { expandchange(row, prow) {
...@@ -291,12 +283,14 @@ export default { ...@@ -291,12 +283,14 @@ export default {
data[i].vchan.subtask_id = data[i].subtask_id; data[i].vchan.subtask_id = data[i].subtask_id;
data[i].vchan.refid = data[i].vchan.vchan_refid; data[i].vchan.refid = data[i].vchan.vchan_refid;
data[i].vchan.name = data[i].vchan.vchan_name; data[i].vchan.name = data[i].vchan.vchan_name;
data[i].vchan.assign_id = data[i].assign_to ?data[i].assign_to.id : "";
} else { } else {
data.vchan = { data.vchan = {
subtask_id: data[i].subtask_id, subtask_id: data[i].subtask_id,
refid: "", refid: "",
vchan_name: data[i].subtask_name, vchan_name: data[i].subtask_name,
name: data[i].subtask_name name: data[i].subtask_name,
assign_id: data[i].assign_id ? data[i].assign_to.id : ""
}; };
} }
ary.push(data[i].vchan); ary.push(data[i].vchan);
...@@ -334,6 +328,12 @@ export default { ...@@ -334,6 +328,12 @@ export default {
return "未知"; return "未知";
} }
}, },
getFreelist() {
this.$api.device.getFreelist(this.dev_unid).then(res => {
this.freeList = res.list_data;
});
// /
},
dateFormatter(row, column, cellValue, index) { dateFormatter(row, column, cellValue, index) {
let startDate = cellValue ? cellValue.split(" ")[0] : ""; let startDate = cellValue ? cellValue.split(" ")[0] : "";
let endDate = row.end_dt ? row.end_dt.split(" ")[0] : ""; let endDate = row.end_dt ? row.end_dt.split(" ")[0] : "";
...@@ -389,7 +389,7 @@ export default { ...@@ -389,7 +389,7 @@ export default {
this.tableData = []; this.tableData = [];
} else { } else {
res.list_data.forEach(item => { res.list_data.forEach(item => {
item.subTaskData = [] item.subTaskData = [];
if (item.start_dt) { if (item.start_dt) {
//先转utc格式 //先转utc格式
let date = this.$moment.utc(item.start_dt).format(); let date = this.$moment.utc(item.start_dt).format();
...@@ -583,38 +583,20 @@ export default { ...@@ -583,38 +583,20 @@ export default {
color: #f2365a; color: #f2365a;
font-size: 16px; font-size: 16px;
} }
.expande-table-row {
span {
display: inline-block;
}
.label {
width: 6vw;
text-align: center;
border-left: 1px solid $border-color;
background: #f0f0f0;
}
.subtask-info {
border-left: 1px solid #f0f0f0;
text-align: center;
}
.subtask-info:nth-child(2) { .subtask-info:nth-child(2) {
width: 8vw; width: 8vw;
} }
.subtask-info:nth-child(4) { .subtask-info:nth-child(4) {
width: 6vw; width: 6vw;
} }
.subtask-info:nth-child(6) { .subtask-info:nth-child(6) {
width: 4.5vw; width: 4.5vw;
} }
.subtask-info:nth-child(8) { .subtask-info:nth-child(8) {
width: 4vw; width: 4vw;
} }
.subtask-info:nth-child(10) { .subtask-info:nth-child(10) {
width: 12vw; width: 12vw;
}
line-height: 40px;
border-bottom: 1px solid #f0f0f0;
} }
</style> </style>
<template>
<div class="expande-table-row">
<span class="label">视频源文件</span>
<span class="subtask-info">{{ subTaskData.vchan_name }}</span>
<span class="label">设备地址</span>
<span class="subtask-info">192.178.99.99</span>
<span class="label">已用资源</span>
<span class="subtask-info">22</span>
<span class="label">设备容量</span>
<span class="subtask-info">33</span>
<span class="label">指定设备下发</span>
<span class="subtask-info">
<el-select v-model="assign_id">
<el-option
v-for="(item, index) in freeList"
:key="index"
:value="item.device_id"
>
{{ item.in_ip }}
</el-option>
</el-select>
</span>
<span class="label sub-btn" @click="subMove">确定</span>
</div>
</template>
<script>
export default {
data() {
return {
assign_id: ""
};
},
props: ["subTaskData", "freeList", "taskData"],
methods: {
subMove() {
let taskID = this.taskData.task_id;
let subTaksID = this.subTaskData.subtask_id;
this.$api.task.getTaskParams(taskID, subTaksID).then(res => {
let obj = {};
obj.mtasks = res.mtasks;
obj.assign_to = {
id: this.assign_id,
flag: 0
};
this.subRoi(taskID, subTaksID, obj);
});
},
subRoi(taskid, subtaskid, postObj) {
this.$api.task
.editRoi(taskid, subtaskid, postObj, {
headers: {
authorization: localStorage.getItem("atoken")
}
})
.then(m => {
if (m.ecode == "200") {
this.$message({
message: "设置成功!",
type: "success"
});
}
});
}
},
created() {},
watch: {
},
mounted() {
this.assign_id = this.subTaskData.assign_id
? this.subTaskData.assign_id
: "";
}
};
</script>
<style lang="scss" scoped>
.expande-table-row {
overflow: hidden;
span {
float: left;
border-bottom: 1px solid #ccc;
overflow: hidden;
}
.label {
width: 6vw;
text-align: center;
border-left: 1px solid $border-color;
background: #f0f0f0;
height: 40px;
line-height: 40px;
}
.subtask-info {
border-left: 1px solid #f0f0f0;
text-align: center;
overflow: hidden;
height: 40px;
line-height: 40px;
}
.subtask-info:nth-child(2) {
width: 9vw;
overflow: hidden;
}
.subtask-info:nth-child(4) {
width: 6vw;
}
.subtask-info:nth-child(6) {
width: 4.5vw;
}
.subtask-info:nth-child(8) {
width: 4vw;
}
.subtask-info:nth-child(10) {
width: 12vw;
}
.sub-btn {
cursor: pointer;
}
}
</style>
...@@ -2,12 +2,29 @@ ...@@ -2,12 +2,29 @@
<div class="alarm-event-box"> <div class="alarm-event-box">
<el-table :data="tableData" height="30vh"> <el-table :data="tableData" height="30vh">
<el-table-column type="index" align="center" label="#"></el-table-column> <el-table-column type="index" align="center" label="#"></el-table-column>
<el-table-column align="center" prop="camername" label="事件地点"></el-table-column> <el-table-column
<el-table-column align="center" prop="illname" label="抓拍类型"></el-table-column> align="center"
<el-table-column align="center" prop="illdt" label="发生时间"></el-table-column> prop="camername"
label="事件地点"
></el-table-column>
<el-table-column
align="center"
prop="illname"
label="抓拍类型"
></el-table-column>
<el-table-column
align="center"
prop="illdt"
label="发生时间"
></el-table-column>
<el-table-column align="center" prop="operation" label="操作"> <el-table-column align="center" prop="operation" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="查看" placement="bottom" effect="light" :visible-arrow="false"> <el-tooltip
content="查看"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<img <img
src="../../assets/img/home/look.png" src="../../assets/img/home/look.png"
alt alt
...@@ -16,7 +33,12 @@ ...@@ -16,7 +33,12 @@
/> />
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow="false"> <el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<img <img
src="../../assets/img/home/del.png" src="../../assets/img/home/del.png"
alt alt
...@@ -34,93 +56,104 @@ ...@@ -34,93 +56,104 @@
export default { export default {
data() { data() {
return { return {
tableData:[] tableData: []
} };
}, },
methods:{ methods: {
delFun(index, rows) { delFun(index, rows) {
rows.splice(index, 1); rows.splice(index, 1);
}, },
editVideo(index, rows){ editVideo(index, rows) {
this.$emit('event',rows) this.$emit("event", rows);
}, }
}, },
beforeMount(){ beforeMount() {
try {
let that = this; let that = this;
this.connect_id = new Date().getTime() this.connect_id = new Date().getTime();
// this.cws = new WebSocket('ws://'+ this.API.IP +'/websocket/v1/integrated/connects/' + this.connect_id) // this.cws = new WebSocket('ws://'+ this.API.IP +'/websocket/v1/integrated/connects/' + this.connect_id)
this.cws = new WebSocket(`ws://${this.$api.wsIP}/websocket/api/v1/datahandle/connects/${this.connect_id}`) this.cws = new WebSocket(
`ws://${this.$api.wsIP}/websocket/api/v1/datahandle/connects/${this.connect_id}`
);
this.cws.onopen = () =>{ this.cws.onopen = () => {
console.log('ws事件推送服务连接成功') console.log("ws事件推送服务连接成功");
} };
//事件断开 //事件断开
this.cws.onclose = () =>{ this.cws.onclose = () => {
window.clearTimeout(that.keepAlive) window.clearTimeout(that.keepAlive);
console.log('ws事件推送服务断开') console.log("ws事件推送服务断开");
that.connect_id = new Date().getTime() that.connect_id = new Date().getTime();
that.cws = new WebSocket(`ws://${this.$api.wsIP}/websocket/api/v1/datahandle/connects/${this.connect_id}`) that.cws = new WebSocket(
`ws://${this.$api.wsIP}/websocket/api/v1/datahandle/connects/${this.connect_id}`
);
that.keepAlive = setInterval(() => { that.keepAlive = setInterval(() => {
let message = { let message = {
type: 'request', type: "request",
id: new Date().getTime(), id: new Date().getTime(),
mts: new Date().getTime(), mts: new Date().getTime(),
command:'get /websocket/v1/recv_data/connects/' + this.connect_id +'/keep_alive' command:
} "get /websocket/v1/recv_data/connects/" +
this.cws.send(JSON.stringify(message)) this.connect_id +
"/keep_alive"
};
this.cws.send(JSON.stringify(message));
}, 20000); }, 20000);
} };
//事件推送信息 //事件推送信息
let _this = this; let _this = this;
this.cws.onmessage = (evt) =>{ this.cws.onmessage = evt => {
let data = JSON.parse(evt.data) let data = JSON.parse(evt.data);
try { try {
if(data.event_data.illegal.state == 1){ if (data.event_data.illegal.state == 1) {
let illname = _this.getCode('违法类型',data.event_data.illegal.code) || ''; let illname =
let camername = data.event_data.location.name _this.getCode("违法类型", data.event_data.illegal.code) || "";
let dt = this.showLocalTime(data.event_dt).split(' ')[1]; let camername = data.event_data.location.name;
console.log(data.pics[0].src_url) let dt = this.showLocalTime(data.event_dt).split(" ")[1];
let pics = data.pics[0].src_url console.log(data.pics[0].src_url);
let pos = data.event_data.location.pos let pics = data.pics[0].src_url;
let pos = data.event_data.location.pos;
let obj = { let obj = {
illname:illname, illname: illname,
illdt:dt, illdt: dt,
camername:camername, camername: camername,
pics:pics, pics: pics,
pos:pos pos: pos
} };
if(that.tableData.length > 40) { if (that.tableData.length > 40) {
that.tableData.pop(obj) that.tableData.pop(obj);
} else { } else {
that.tableData.unshift(obj) that.tableData.unshift(obj);
} }
that.tableData.unshift(obj) that.tableData.unshift(obj);
} else{
} }
} catch (error) { } catch (error) {
console.log(error);
}
if(data.command){
console.log('推送服务连接正常')
} else if(data.type =='response'){
console.log('请求任务推送成功')
} }
if (data.command) {
console.log("推送服务连接正常");
} else if (data.type == "response") {
console.log("请求任务推送成功");
} }
};
this.keepAlive = setInterval(() => { this.keepAlive = setInterval(() => {
let message = { let message = {
type: 'request', type: "request",
id: new Date().getTime(), id: new Date().getTime(),
mts: new Date().getTime(), mts: new Date().getTime(),
command:'get /websocket/v1/recv_data/connects/' + this.connect_id +'/keep_alive' command:
} "get /websocket/v1/recv_data/connects/" +
this.cws.send(JSON.stringify(message)) this.connect_id +
"/keep_alive"
};
this.cws.send(JSON.stringify(message));
}, 50000); }, 50000);
} catch (error) {
console.log(error);
}
} }
}; };
</script> </script>
<style>
</style>>
\ No newline at end of file \ No newline at end of file
<style></style>>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!