Commit dd51de5d by 潘建波

6月16提交带任务状态版本

1 parent 07463a28
Showing 44 changed files with 1152 additions and 904 deletions
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>fanxing</title> <title>fanxing</title>
<script src="<%= BASE_URL %>js/kinetic-v5.1.0.min.js"></script> <script src="<%= BASE_URL %>js/kinetic-v5.1.0.min.js"></script>
<script src="<%= BASE_URL %>js/ObjTree.js"></script> <script src="<%= BASE_URL %>js/ObjTree.js"></script>
......
...@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV); ...@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url // baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.233:20080"; // 测试环境url baseUrl = "http://192.168.9.62:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url // baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
editTrafficCode(params, cate_unid, code_unid) { editTrafficCode(params, cate_unid, code_unid) {
return api.post(urls.editTrafficCode(cate_unid, code_unid), params); return api.post(urls.editTrafficCode(cate_unid, code_unid), params);
}, },
deleteTrafficCode(params, code_unid) { deleteTrafficCode(cate_unid,code_unid,params) {
return api.delete(urls.editTrafficCode(cate_unid, code_unid), params); return api.delete(urls.editTrafficCode(cate_unid, code_unid), params);
} }
}; };
...@@ -279,6 +279,11 @@ body{ ...@@ -279,6 +279,11 @@ body{
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
} }
.taskstatus .statusbox{
height: 25px;
line-height: 25px;
font-size: 12px;
}
.runningbox { .runningbox {
background: #36BEA6; background: #36BEA6;
} }
...@@ -296,4 +301,7 @@ body{ ...@@ -296,4 +301,7 @@ body{
} }
.el-table--small td, .el-table--small th { .el-table--small td, .el-table--small th {
height: 55px; height: 55px;
}
.el-radio__label{
color: #333;
} }
\ No newline at end of file \ No newline at end of file
...@@ -117,7 +117,15 @@ Vue.prototype.timeForm = function(obj) { ...@@ -117,7 +117,15 @@ Vue.prototype.timeForm = function(obj) {
nowY + "-" + nowM + "-" + nowD + " " + nowH + ":" + nowMi + ":" + nowS; nowY + "-" + nowM + "-" + nowD + " " + nowH + ":" + nowMi + ":" + nowS;
return timeNow; return timeNow;
}; };
Vue.prototype.yesterDay = function() {
var data = new Date().getTime() - 24 * 60 * 60 * 1000;
var curdate = this.timeForm(new Date(data));
return curdate.split(" ")[0] + " " + "00:00:00";
};
Vue.prototype.nowDay = function(){
var data = new Date();
return this.timeForm(data);
};
/** /**
* @param {obj} * @param {obj}
* UTC时间处理 * UTC时间处理
......
...@@ -36,4 +36,3 @@ new Vue({ ...@@ -36,4 +36,3 @@ new Vue({
// window.onunload = function() { // window.onunload = function() {
// localStorage.clear(); // localStorage.clear();
// }; // };
...@@ -174,15 +174,15 @@ export const asyncRouterMap = [ ...@@ -174,15 +174,15 @@ export const asyncRouterMap = [
component: resolve => component: resolve =>
require(["../views/resource/store_confs.vue"], resolve) require(["../views/resource/store_confs.vue"], resolve)
}, },
{ // {
path: "/resource/author", // path: "/resource/author",
name: "授权管理", // name: "授权管理",
meta: { // meta: {
icon: "el-icon-location" // icon: "el-icon-location"
}, // },
component: resolve => // component: resolve =>
require(["../views/resource/Author/author.vue"], resolve) // require(["../views/resource/Author/author.vue"], resolve)
}, // },
{ {
path: "/resource/nationalStandard", path: "/resource/nationalStandard",
name: "国标配置", name: "国标配置",
...@@ -244,14 +244,14 @@ export const asyncRouterMap = [ ...@@ -244,14 +244,14 @@ export const asyncRouterMap = [
}, },
component: resolve => require(["../views/ops/role_manage.vue"], resolve) component: resolve => require(["../views/ops/role_manage.vue"], resolve)
}, },
{ // {
path: "/ops/batch_upgrade", // path: "/ops/batch_upgrade",
name: "批量升级", // name: "批量升级",
meta: { // meta: {
icon: "el-icon-location" // icon: "el-icon-location"
}, // },
component: resolve => require(["../views/ops/log_manage.vue"], resolve) // component: resolve => require(["../views/ops/log_manage.vue"], resolve)
}, // },
{ {
path: "/ops/log_manage", path: "/ops/log_manage",
name: "日志管理", name: "日志管理",
......
...@@ -25,5 +25,8 @@ export default { ...@@ -25,5 +25,8 @@ export default {
}, },
setDevList(state, data) { setDevList(state, data) {
state.devList = data; state.devList = data;
},
setCodeState(state, data) {
state.codestate = data;
} }
}; };
...@@ -2,5 +2,6 @@ export default { ...@@ -2,5 +2,6 @@ export default {
ocxstate: 0, ocxstate: 0,
mapopen: false, mapopen: false,
addRouter: [], addRouter: [],
devList: [] devList: [],
codestate: ""
} }
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-col :span="2" class="ml10"> <el-col :span="2" class="ml10">
<el-button type="primary">查询</el-button> <el-button type="primary">查询</el-button>
</el-col> </el-col>
<el-col :span="8" style="float:right"> <el-col :span="8" style="float:right" hidden>
<span class="resource-box"> <span class="resource-box">
<span class="title">可用分析资源:</span> <span class="title">可用分析资源:</span>
<span class="num">{{ workers.video_free }}</span> <span class="num">{{ workers.video_free }}</span>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
<template> <template>
<div style="padding-left: 28px;"> <div style="padding-left: 28px;">
<el-form ref="form" label-width="100px"> <el-form ref="form" label-width="100px">
<!-- 手动校时 --> <!-- 手动校时 -->
<div class="lineBox big"> <div class="lineBox big" hidden>
<el-radio v-model="typeRadio" label="1">手动校时</el-radio> <el-radio v-model="typeRadio" label="1">手动校时</el-radio>
</div> </div>
<div class="radioContent"> <div class="radioContent" hidden>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="当前时间:"> <el-form-item label="当前时间:">
<span>{{computerTime}}</span> <span>{{ computerTime }}</span>
</el-form-item> </el-form-item>
</div> </div>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="设备时间:"> <el-form-item label="设备时间:">
<el-date-picker <el-date-picker
:disabled="typeRadio=='2'" :disabled="typeRadio == '2'"
v-model="systemTime" v-model="systemTime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" type="datetime"
placeholder="选择日期时间"> placeholder="选择日期时间"
</el-date-picker> >
<span style="margin-left: 30px;"> <el-checkbox v-model="syncTime" @change="syncTimeFun" :disabled="typeRadio=='2'">与计算机时间同步</el-checkbox></span> </el-date-picker>
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='2'" @click="manualClick">校时</el-button> <span style="margin-left: 30px;">
</el-form-item> <el-checkbox
</div> v-model="syncTime"
</div> @change="syncTimeFun"
<div class="line"></div> :disabled="typeRadio == '2'"
<!-- NTP校时 --> >与计算机时间同步</el-checkbox
<div class="lineBox big"> ></span
<el-radio v-model="typeRadio" label="2">NTP校时</el-radio> >
</div> <el-button
<div class="radioContent"> type="primary"
<div class="lineBox"> size="small"
<el-form-item label="服务器地址:"> class="primaryButton rightButton"
<span class="inputBox"> :disabled="typeRadio == '2'"
<el-input placeholder="请输入服务器地址" v-model="serverAdr" :disabled="typeRadio=='1'"></el-input> @click="manualClick"
</span> >校时</el-button
</el-form-item> >
</div> </el-form-item>
<div class="lineBox"> </div>
<el-form-item label="NTP端口:"> </div>
<span class="inputBox"> <div class="line" hidden></div>
<el-input placeholder="请输入NTP端口" v-model="ntpPort" :disabled="typeRadio=='1'"></el-input> <!-- NTP校时 -->
</span> <div class="lineBox big">
</el-form-item> <el-radio v-model="typeRadio" label="2">NTP校时</el-radio>
</div> </div>
<div class="lineBox"> <div class="radioContent">
<el-radio v-model="ntpRadio" label="1" :disabled="typeRadio=='1'">定时校时</el-radio> <div class="lineBox">
</div> <el-form-item label="服务器地址:">
<el-form ref="inlineform" label-width="100px" inline> <span class="inputBox">
<div class="lineBox"> <el-input
<el-form-item label="每天:"> placeholder="请输入服务器地址"
<el-time-select v-model="serverAdr"
:disabled="typeRadio=='1'||ntpRadio=='2'" :disabled="typeRadio == '1'"
v-model="timeArr[0]" ></el-input>
value-format="HH:mm" </span>
placeholder="选择时间"> </el-form-item>
</el-time-select> </div>
</el-form-item> <div class="lineBox">
<el-form-item label="每天:"> <el-form-item label="NTP端口:">
<el-time-select <span class="inputBox">
:disabled="typeRadio=='1'||ntpRadio=='2'" <el-input
value-format="HH:mm" placeholder="请输入NTP端口"
v-model="timeArr[1]" v-model="ntpPort"
placeholder="选择时间"> :disabled="typeRadio == '1'"
</el-time-select> ></el-input>
</el-form-item> </span>
<el-form-item label="每天:"> </el-form-item>
<el-time-select </div>
:disabled="typeRadio=='1'||ntpRadio=='2'" <div class="lineBox">
v-model="timeArr[2]" <el-radio v-model="ntpRadio" label="1" :disabled="typeRadio == '1'"
value-format="HH:mm" >定时校时</el-radio
placeholder="选择时间"> >
</el-time-select> </div>
</el-form-item> <el-form ref="inlineform" label-width="100px" inline>
</div> <div class="lineBox">
<div class="lineBox"> <el-form-item label="每天:">
<el-form-item label="每天:"> <el-time-select
<el-time-select :disabled="typeRadio == '1' || ntpRadio == '2'"
:disabled="typeRadio=='1'||ntpRadio=='2'" v-model="timeArr[0]"
v-model="timeArr[3]" value-format="HH:mm"
value-format="HH:mm" placeholder="选择时间"
placeholder="选择时间"> >
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
:disabled="typeRadio=='1'||ntpRadio=='2'" :disabled="typeRadio == '1' || ntpRadio == '2'"
v-model="timeArr[4]" value-format="HH:mm"
value-format="HH:mm" v-model="timeArr[1]"
placeholder="选择时间"> placeholder="选择时间"
</el-time-select> >
</el-form-item> </el-time-select>
<el-form-item label=" "> </el-form-item>
<span>自动进行校时(可设置多个时间点,不得超过5个)</span> <el-form-item label="每天:">
</el-form-item> <el-time-select
</div> :disabled="typeRadio == '1' || ntpRadio == '2'"
</el-form> v-model="timeArr[2]"
<div class="lineBox"> value-format="HH:mm"
<el-radio v-model="ntpRadio" label="2" :disabled="typeRadio=='1'">周期校时</el-radio> placeholder="选择时间"
</div> >
<div class="lineBox"> </el-time-select>
<el-form-item label="每隔:"> </el-form-item>
<span class="inputBox" style="width: 60px;"> </div>
<el-input placeholder="" v-model.number="weekMinutes" :disabled="typeRadio=='1'||ntpRadio=='1'"></el-input> <div class="lineBox">
</span> <el-form-item label="每天:">
<span style="margin-left: 14px;">秒,自动进行校时</span> <el-time-select
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='1'" @click="saveClick">保存设置</el-button> :disabled="typeRadio == '1' || ntpRadio == '2'"
</el-form-item> v-model="timeArr[3]"
</div> value-format="HH:mm"
</div> placeholder="选择时间"
</el-form> >
</div> </el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
:disabled="typeRadio == '1' || ntpRadio == '2'"
v-model="timeArr[4]"
value-format="HH:mm"
placeholder="选择时间"
>
</el-time-select>
</el-form-item>
<el-form-item label=" ">
<span>自动进行校时(可设置多个时间点,不得超过5个)</span>
</el-form-item>
</div>
</el-form>
<div class="lineBox">
<el-radio v-model="ntpRadio" label="2" :disabled="typeRadio == '1'"
>周期校时</el-radio
>
</div>
<div class="lineBox">
<el-form-item label="每隔:">
<span class="inputBox" style="width: 60px;">
<el-input
placeholder=""
v-model.number="weekMinutes"
:disabled="typeRadio == '1' || ntpRadio == '1'"
></el-input>
</span>
<span style="margin-left: 14px;">秒,自动进行校时</span>
<el-button
type="primary"
size="small"
class="primaryButton rightButton"
:disabled="typeRadio == '1'"
@click="saveClick"
>保存设置</el-button
>
</el-form-item>
</div>
</div>
</el-form>
</div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return{ return {
typeRadio:'1', typeRadio: "2",
ntpRadio:'1', ntpRadio: "1",
timeArr:['','','','',''], timeArr: ["", "", "", "", ""],
ntpPort:'', ntpPort: "",
weekMinutes:'', weekMinutes: "",
activeName: 'first', activeName: "first",
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:localStorage.getItem('dev_unid'), dev_unid: localStorage.getItem("dev_unid"),
device_id:sessionStorage.getItem('device_id'), device_id: sessionStorage.getItem("device_id"),
serverAdr:'' serverAdr: ""
} };
}, },
components:{}, components: {},
mounted(){ mounted() {
this.timer(); this.timer();
this.getDevTimes(); this.getDevTimes();
this.getNtpTimes(); this.getNtpTimes();
}, },
methods:{ methods: {
handleClick(tab, event) { handleClick(tab, event) {},
timer() {
}, setInterval(() => {
timer(){ this.computerTime = this.$moment().format("YYYY-MM-DD HH:mm:ss");
setInterval(()=>{ }, 1000);
this.computerTime=this.$moment().format("YYYY-MM-DD HH:mm:ss") },
},1000) getDevTimes() {
}, this.$api.ops.getDevsTime({}, this.dev_unid, this.device_id).then(res => {
getDevTimes () { if (res.ecode != undefined && res.ecode != 200) {
this.$api.ops.getDevsTime({ //console.log('获取设备时间失败!' + utcTimes.enote);
},this.dev_unid,this.device_id).then(res=>{ this.$message({
if (res.ecode != undefined && res.ecode != 200) { type: "error",
//console.log('获取设备时间失败!' + utcTimes.enote); message: "获取设备时间失败!" + res.enote
this.$message({ });
type: 'error', } else {
message: '获取设备时间失败!' + res.enote if (res && typeof res === "string") {
}); //先转utc格式
} else { let date = this.$moment.utc(res).format();
if(res && typeof res === 'string') { //再utc时间转本地时间
//先转utc格式 this.systemTime = this.$moment(date)
let date = this.$moment.utc(res).format(); .local()
//再utc时间转本地时间 .format("YYYY-MM-DD HH:mm:ss");
this.systemTime = this.$moment(date) }
.local() }
.format("YYYY-MM-DD HH:mm:ss"); });
} },
} syncTimeFun() {
}) if (this.syncTime) {
}, this.systemTime = this.computerTime;
syncTimeFun(){ }
if(this.syncTime){ },
this.systemTime=this.computerTime; manualClick() {
} let time = this.$moment(this.systemTime)
}, .utc()
manualClick() { .format("YYYY-MM-DD HH:mm:ss");
let time=this.$moment(this.systemTime).utc().format("YYYY-MM-DD HH:mm:ss"); this.$api.ops
this.$api.ops.manualTime({ .manualTime(
time:time {
},this.dev_unid,this.device_id).then(res=>{ time: time
if(res.ecode != 200) { },
this.$message({ this.dev_unid,
type: 'error', this.device_id
message: '手动校时失败!' + res.enote )
}) .then(res => {
} else { if (res.ecode != 200) {
this.$message({ this.$message({
type: 'success', type: "error",
message: '手动校时成功!' message: "手动校时失败!" + res.enote
}) });
} } else {
}) this.$message({
type: "success",
}, message: "手动校时成功!"
getNtpTimes () { });
//获取ntp校时配置 }
this.$api.ops.getNtp({ });
},this.dev_unid,this.device_id).then(res=>{ },
if(res.ecode != undefined && res.ecode != 200) { getNtpTimes() {
this.$message({ //获取ntp校时配置
type: 'error', this.$api.ops
message: '获取NTP校时失败!' + res.enote .getNtp({}, this.dev_unid, this.device_id)
}); .then(res => {
} else { if (res.ecode != undefined && res.ecode != 200) {
if(res.enable_ntp == 1) { this.$message({
this.typeRadio = '2'; type: "error",
this.serverAdr = res.ntp_server_ip; message: "获取NTP校时失败!" + res.enote
this.ntpPort = res.ntp_server_port; });
console.log('获取NTP时间:', res.timing_times) } else {
this.timeArr=res.timing_times; if (res.enable_ntp == 1) {
this.weekMinutes = res.timing_interval; this.typeRadio = "2";
if(res.timing_policy == "fix"){ this.serverAdr = res.ntp_server_ip;
this.ntpRadio = '1'; this.ntpPort = res.ntp_server_port;
} console.log("获取NTP时间:", res.timing_times);
if(res.timing_policy == "interval"){ this.timeArr = res.timing_times;
this.ntpRadio = '2'; this.weekMinutes = res.timing_interval;
} if (res.timing_policy == "fix") {
} else { this.ntpRadio = "1";
this.typeRadio = '1'; }
} if (res.timing_policy == "interval") {
} this.ntpRadio = "2";
}).catch(err => { }
console.log('获取ntp校时设置异常:', err.message); } else {
}); this.typeRadio = "1";
}, }
saveClick() { }
if(this.serverAdr != "" &&this.ntpPort != ""){ })
let timing_policy='' .catch(err => {
if(this.ntpRadio=='1'){ console.log("获取ntp校时设置异常:", err.message);
//如果定时校时 });
timing_policy='fix' },
//数组去空值 saveClick() {
let arr=[]; if (this.serverAdr != "" && this.ntpPort != "") {
this.timeArr.forEach(item=>{ let timing_policy = "";
if(item!=""&&typeof(item)!="undefined"){ if (this.ntpRadio == "1") {
arr.push(item) //如果定时校时
} timing_policy = "fix";
}) //数组去空值
if(new Set(arr).size !== arr.length){ let arr = [];
  this.$message({ this.timeArr.forEach(item => {
type: 'error', if (item != "" && typeof item != "undefined") {
message: '定时时间重复,请重新选择' arr.push(item);
}); }
return false; });
} if (new Set(arr).size !== arr.length) {
}else if(this.ntpRadio=='2'){ this.$message({
//周期校时 type: "error",
timing_policy='interval' message: "定时时间重复,请重新选择"
if(this.weekMinutes === '') { });
this.$message({ return false;
type: 'warning', }
message: '未设置周期时间!' } else if (this.ntpRadio == "2") {
}) //周期校时
return; timing_policy = "interval";
} if (this.weekMinutes === "") {
} this.$message({
let ntpTimingData = { type: "warning",
device_id: this.device_id, message: "未设置周期时间!"
enable_ntp: 1, });
ntp_server_ip: this.serverAdr, return;
ntp_server_port: this.ntpPort, }
timing_policy: timing_policy, }
timing_times: this.timeArr, let ntpTimingData = {
timing_interval: this.weekMinutes device_id: this.device_id,
} enable_ntp: 1,
this.ntpTimeSet(ntpTimingData); ntp_server_ip: this.serverAdr,
}else { ntp_server_port: this.ntpPort,
this.$message({ timing_policy: timing_policy,
type: 'warning', timing_times: this.timeArr,
message: '服务器地址以及ntp端口不能为空!' timing_interval: this.weekMinutes
}) };
} this.ntpTimeSet(ntpTimingData);
}, } else {
ntpTimeSet(data){ this.$message({
this.$api.ops.ntpTime(data,this.dev_unid,this.device_id).then(res=>{ type: "warning",
if(res.ecode == 200){ message: "服务器地址以及ntp端口不能为空!"
this.$message({ });
type: 'success', }
message: 'NTP校时成功!' },
}) ntpTimeSet(data) {
} else { this.$api.ops
this.$message({ .ntpTime(data, this.dev_unid, this.device_id)
type: 'error', .then(res => {
message: 'NTP校时失败!' + res.enote if (res.ecode == 200) {
}) this.$message({
} type: "success",
}).catch(err => { message: "NTP校时成功!"
console.log('ntp校时异常:', error.message) });
}); } else {
} this.$message({
}, type: "error",
} message: "NTP校时失败!" + res.enote
});
}
})
.catch(err => {
console.log("ntp校时异常:", error.message);
});
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.line{
height:1px;
background:rgba(232,232,232,1);
margin-top: 18px;
margin-bottom: 15px;
}
.lineBox{
padding: 12px 0 12px 50px;
}
.radioContent{
margin-left: 24px;
}
.rightButton{
float: right;
margin-right: 20%;
}
.inputBox{
width: 220px;
}
</style>
\ No newline at end of file \ No newline at end of file
.line {
height: 1px;
background: rgba(232, 232, 232, 1);
margin-top: 18px;
margin-bottom: 15px;
}
.lineBox {
padding: 12px 0 12px 50px;
}
.radioContent {
margin-left: 24px;
}
.rightButton {
float: right;
margin-right: 20%;
}
.inputBox {
width: 220px;
}
</style>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[20, 30, 50, 100, 200]" :page-sizes="[20, 30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
...@@ -86,14 +86,14 @@ ...@@ -86,14 +86,14 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="margin-top: 28px;"> <div style="margin-top: 28px;" hidden>
<el-pagination <el-pagination
style="float: right;" style="float: right;"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[20, 30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
return { return {
total: 0, total: 0,
page: 1, page: 1,
pageSize: 20, pageSize: 50,
tableData: [], tableData: [],
detailVisible: false, detailVisible: false,
eventCateData: [], eventCateData: [],
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
}, },
components: {}, components: {},
created() { created() {
// this.getEventList(); this.getEventList();
this.getEventCate(); this.getEventCate();
}, },
methods: { methods: {
...@@ -197,8 +197,14 @@ export default { ...@@ -197,8 +197,14 @@ export default {
this.tableData = res.list_data; this.tableData = res.list_data;
}); });
}, },
cateChange() { cateChange(unid) {
this.$api.codes.eventType({}, this.curcate).then(res => { let offset = (this.page - 1) * this.pageSize;
let obj = {
limit: this.pageSize,
offset: offset
};
this.tableData = [];
this.$api.codes.eventType(obj, unid).then(res => {
this.tableData = res.list_data; this.tableData = res.list_data;
}); });
}, },
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
type="index" type="index"
align="center" align="center"
label="#" label="#"
width="40" width="60"
></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="code_unid">
</el-table-column> </el-table-column>
...@@ -77,14 +77,14 @@ ...@@ -77,14 +77,14 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="margin-top: 28px;"> <div style="margin-top: 28px;" hidden>
<el-pagination <el-pagination
style="float: right;" style="float: right;"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[20, 30, 50, 100, 200]" :page-sizes="[20, 30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -242,34 +242,54 @@ export default { ...@@ -242,34 +242,54 @@ export default {
}); });
}, },
saveAddCode() { saveAddCode() {
this.$api.codes let data = {
.addTrafficCode(this.codeData, this.curCateUnid) code_unid: this.codeData.code_unid,
.then(res => { code: this.codeData.code,
console.log(res); name: this.codeData.name,
}); note: this.codeData.note,
active: this.codeData.active
};
this.$api.codes.addTrafficCode(data, this.curCateUnid).then(res => {
console.log(res);
this.detailVisible = false;
this.cateChange(this.curCateUnid);
});
}, },
saveEditCode() { saveEditCode() {
let data = { let data = {
"code_unid": this.codeData.code_unid, code_unid: this.codeData.code_unid,
"code":this.codeData.code, code: this.codeData.code,
"name":this.codeData.name, name: this.codeData.name,
"note":this.codeData.note, note: this.codeData.note,
"active":this.codeData.active } active: this.codeData.active
};
this.$api.codes this.$api.codes
.editTrafficCode( .editTrafficCode(data, this.curCateUnid, this.codeData.code_unid)
data,
this.curCateUnid,
this.codeData.code_unid
)
.then(res => { .then(res => {
console.log(res); console.log(res);
this.detailVisible = false;
this.cateChange(this.curCateUnid);
}); });
}, },
deleteCode(index, row) { deleteCode(index, row) {
this.$api.codes this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
.editTrafficCode(row, this.curCateUnid, row.code_unid) confirmButtonText: "确定",
.then(res => { cancelButtonText: "取消",
console.log(res); type: "warning"
})
.then(() => {
this.$api.codes
.deleteTrafficCode(this.curCateUnid, row.code_unid)
.then(res => {
console.log(res);
this.cateChange(this.curCateUnid);
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
});
}); });
}, },
handleSizeChange(val) { handleSizeChange(val) {
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div style="padding:8px 20px;"> <div style="padding:8px 20px;">
<span class="inputBox"> <span class="inputBox">
<el-input v-model="storename" placeholder="请输入存储配置名称"></el-input> <el-input
</span> v-model="storename"
<el-button type="primary" style="position: relative;top: -2px;" @click="query">查询</el-button> placeholder="请输入存储配置名称"
<span style="float: right;"> ></el-input>
<el-button type="info" icon="el-icon-search" @click="add">添加</el-button> </span>
</span> <el-button
</div> type="primary"
<div style="padding: 0 15px 20px 23px;"> style="position: relative;top: -2px;"
<el-table @click="query"
:height="tableHeight" >查询</el-button
:data="tableData" >
stripe <span style="float: right;">
border <el-button type="info" icon="el-icon-search" @click="add"
style="width: 100%"> >添加</el-button
<el-table-column >
align="center" </span>
prop="name" </div>
label="名称"> <div style="padding: 0 15px 20px 23px;">
</el-table-column> <el-table
<el-table-column :height="tableHeight"
prop="create_dt" :data="tableData"
align="center" stripe
label="上传时间"> border
</el-table-column> style="width: 100%"
<el-table-column >
align="center" <el-table-column align="center" prop="name" label="名称">
prop="task_list" </el-table-column>
label="应用任务"> <el-table-column prop="create_dt" align="center" label="上传时间">
<template slot-scope="scope"> </el-table-column>
<el-tooltip :content="scope.row.ellipsis" placement="bottom" effect="light" :visible-arrow=false> <el-table-column align="center" prop="task_list" label="应用任务">
<span class="ellipsis">{{scope.row.ellipsis}}</span> <template slot-scope="scope">
</el-tooltip> <el-tooltip
</template> :content="scope.row.ellipsis"
</el-table-column> placement="bottom"
<el-table-column effect="light"
align="center" :visible-arrow="false"
width="300" >
prop="operation" <span class="ellipsis">{{ scope.row.ellipsis }}</span>
label="操作"> </el-tooltip>
<template slot-scope="scope"> </template>
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> </el-table-column>
<span class="el-icon-info editIcon" @click="detail(scope.$index, scope.row)"></span> <el-table-column
</el-tooltip> align="center"
<span class="tableSpanBorder"></span> width="300"
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false> prop="operation"
<span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span> label="操作"
</el-tooltip> >
</template> <template slot-scope="scope">
</el-table-column> <el-tooltip
</el-table> content="详情"
<div style="margin-top: 28px;"> placement="bottom"
<el-pagination effect="light"
style="float: right;" :visible-arrow="false"
background >
prev-text="上一页" <span
next-text="下一页" class="el-icon-info editIcon"
:page-sizes="[30, 50, 100, 200]" @click="detail(scope.$index, scope.row)"
layout="prev, pager, next,sizes" ></span>
:current-page="page" </el-tooltip>
@size-change="handleSizeChange" <span class="tableSpanBorder"></span>
@current-change="handleCurrentChange" <el-tooltip
:total="total"> content="删除"
</el-pagination> placement="bottom"
<div style="clear: both;"></div> effect="light"
</div> :visible-arrow="false"
>
</div> <span
</div> class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)"
<el-dialog ></span>
title="添加" </el-tooltip>
:visible.sync="addVisible" </template>
width="450px"> </el-table-column>
<div> </el-table>
<el-form label-position="left" label-width="120px"> <div style="margin-top: 28px;">
<el-form-item label="配置名称"> <el-pagination
<el-input v-model="names"></el-input> style="float: right;"
</el-form-item> background
<el-form-item label="添加文件"> prev-text="上一页"
<el-upload next-text="下一页"
ref="upload" :page-sizes="[30, 50, 100, 200]"
action="uploadUrl" layout="total, prev, pager, next,sizes, jumper"
:http-request="httpRequest" :current-page="page"
multiple @size-change="handleSizeChange"
name="file" @current-change="handleCurrentChange"
:auto-upload="false"> :total="total"
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> >
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> --> </el-pagination>
</el-upload> <div style="clear: both;"></div>
</el-form-item> </div>
</el-form> </div>
</div> </div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible=false">取 消</el-button> <el-dialog title="添加" :visible.sync="addVisible" width="450px">
<el-button type="primary" @click="save">上 传</el-button> <div>
</span> <el-form label-position="left" label-width="120px">
</el-dialog> <el-form-item label="配置名称">
<el-input v-model="names"></el-input>
<el-dialog title="详情" :visible.sync="detailVisible" width="30%"> </el-form-item>
<div class="title">任务列表</div> <el-form-item label="添加文件">
<div class="maxHeight"> <el-upload
<el-tree ref="upload"
:props="props" action="uploadUrl"
:load="loadNode" :http-request="httpRequest"
lazy> :on-success="uploadsuccess"
</el-tree> multiple
</div> name="file"
</el-dialog> :auto-upload="false"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
>
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
</el-upload>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<el-button type="primary" @click="save">上 传</el-button>
</span>
</el-dialog>
<el-dialog title="详情" :visible.sync="detailVisible" width="30%">
<div class="title">任务列表</div>
<div class="maxHeight">
<el-tree :props="props" :load="loadNode" lazy> </el-tree>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return{ return {
addVisible:false, addVisible: false,
uploadUrl: '', uploadUrl: "",
names:'', names: "",
file:[], file: [],
props: { props: {
label: 'name', label: "name",
children: 'child', children: "child",
isLeaf: 'leaf' isLeaf: "leaf"
}, },
detailData:[], detailData: [],
dev_unid: localStorage.getItem('dev_unid'), dev_unid: localStorage.getItem("dev_unid"),
resource:{ resource: {
picture_busy: 0, picture_busy: 0,
picture_free: 0, picture_free: 0,
video_busy: 0, video_busy: 0,
video_free: 0, video_free: 0
}, },
total:0, total: 0,
page:1, page: 1,
pageSize:30, pageSize: 30,
tableData: [], tableData: [],
devsList:[], devsList: [],
selectDevs:'', selectDevs: "",
detailVisible:false, detailVisible: false,
storename:'', storename: "",
curentSubList:[], curentSubList: [],
tableHeight:window.opsTableHeight tableHeight: window.opsTableHeight
} };
}, },
components:{ components: {},
}, mounted() {
mounted(){ this.query();
this.query(); },
}, methods: {
methods:{ // 自定义的上传函数
// 自定义的上传函数 httpRequest(param) {
httpRequest(param) { this.file = [];
this.file=[]; // 一般情况下是在这里创建FormData对象,但我们需要上传多个文件,为避免发送多次请求,因此在这里只进行文件的获取,param可以拿到文件上传的所有信息
// 一般情况下是在这里创建FormData对象,但我们需要上传多个文件,为避免发送多次请求,因此在这里只进行文件的获取,param可以拿到文件上传的所有信息 this.file.push(param.file);
this.file.push(param.file) },
}, save() {
save(){ this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件 // 最重要的就是这段代码
// 最重要的就是这段代码 var upData = new FormData(); // 首先创建FormData对象
var upData = new FormData() // 首先创建FormData对象 this.file.forEach(file => {
this.file.forEach((file)=>{ upData.append("file", file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行 upData.append("name", this.names);
upData.append('name', this.names); upData.append("is_temp", 0);
upData.append("is_temp", 0); });
}) this.$api.resource.uploadStore(upData).then(res => {
this.$api.resource.uploadStore(upData).then(res=>{ this.query();
this.query(); });
}) },
uploadsuccess() {
}, this.addVisible = false;
loadNode(node, resolve) { },
if (node.level === 0) { loadNode(node, resolve) {
return resolve(this.curentSubList); if (node.level === 0) {
} return resolve(this.curentSubList);
if (node.level > 1) return resolve([]); }
if (node.level > 1) return resolve([]);
this.$api.resource.getSubTask({},node.data.unid).then(res=>{
if(res.list_data==null){ this.$api.resource.getSubTask({}, node.data.unid).then(res => {
res.list_data=[]; if (res.list_data == null) {
} res.list_data = [];
res.list_data.forEach(item=>{ }
item.name=item.subtask_name; res.list_data.forEach(item => {
item['leaf']=true; item.name = item.subtask_name;
}) item["leaf"] = true;
resolve(res.list_data) });
}) resolve(res.list_data);
}, });
query(){ },
this.tableData=[]; query() {
let offset = (this.page - 1) * this.pageSize; this.tableData = [];
this.$api.resource.getStoreConList({ let offset = (this.page - 1) * this.pageSize;
limit: this.pageSize, this.$api.resource
offset: offset, .getStoreConList(
name__like: this.storename, {
},this.dev_unid).then((res)=>{ limit: this.pageSize,
this.total=res.total_num; offset: offset,
if(res.list_data==null){ name__like: this.storename
this.tableData=[] },
}else{ this.dev_unid
this.tableData=res.list_data; )
} .then(res => {
this.tableData.forEach(list=>{ this.total = res.total_num;
let ellipsisText=''; if (res.list_data == null) {
list.task_list.forEach(item=>{ this.tableData = [];
ellipsisText+=item.name+',' } else {
}) this.tableData = res.list_data;
ellipsisText=ellipsisText.substring(0,ellipsisText.length-1); }
list['ellipsis']=ellipsisText; this.tableData.forEach(list => {
//树状图有子节点 let ellipsisText = "";
list['leaf']=false; list.task_list.forEach(item => {
}) ellipsisText += item.name + ",";
console.log(this.tableData) });
}).catch((error)=>{ ellipsisText = ellipsisText.substring(0, ellipsisText.length - 1);
list["ellipsis"] = ellipsisText;
}) //树状图有子节点
}, list["leaf"] = false;
add(){ });
this.addVisible=true; console.log(this.tableData);
}, })
taskFormatter(row, column, cellValue, index){ .catch(error => {});
let columnText=''; },
row.task_list.forEach(item=>{ add() {
columnText+=item.name+',' this.addVisible = true;
}) },
columnText=columnText.substring(0,columnText.length-1); taskFormatter(row, column, cellValue, index) {
return columnText let columnText = "";
}, row.task_list.forEach(item => {
handleSizeChange(val) { columnText += item.name + ",";
this.pageSize=val; });
this.query(); columnText = columnText.substring(0, columnText.length - 1);
}, return columnText;
handleCurrentChange(val) { },
this.page=val; handleSizeChange(val) {
this.query(); this.pageSize = val;
}, this.query();
detail(index,row){ },
this.detailVisible=true; handleCurrentChange(val) {
this.curentSubList=[]; this.page = val;
this.curentSubList=row.task_list; this.query();
}, },
delFun(index,row){ detail(index, row) {
this.$confirm('此操作将永久删除该选项, 是否继续?', '提示', { this.detailVisible = true;
confirmButtonText: '确定', this.curentSubList = [];
cancelButtonText: '取消', this.curentSubList = row.task_list;
type: 'warning' },
}).then(() => { delFun(index, row) {
this.$api.resource.delStore({},row.unid).then(res=>{ this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", {
if(res.ecode==200){ confirmButtonText: "确定",
this.$message({ cancelButtonText: "取消",
type: 'success', type: "warning"
message: '删除成功!' })
}); .then(() => {
this.query(); this.$api.resource.delStore({}, row.unid).then(res => {
} if (res.ecode == 200) {
}) this.$message({
type: "success",
}).catch(() => { message: "删除成功!"
this.$message({ });
type: 'info', this.query();
message: '已取消删除' }
}); });
}); })
} .catch(() => {
}, this.$message({
} type: "info",
message: "已取消删除"
});
});
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.topCon{
background: $white-back-color;
margin-bottom: 12px;
height: 100px;
.left{
display: inline-block;
margin: {
top: 22px;
left: 30px;
};
img{
width:65px ;
height: 55px;
margin-right: 11px;
}
.topText{
font-size:24px;
font-family:MicrosoftYaHeiUI-Bold,MicrosoftYaHeiUI;
font-weight:bold;
margin-bottom: 4px;
}
.bottomText{
font-size:14px;
font-family:MicrosoftYaHeiUI;
}
}
.right{
float: right;
.topText{
font-size:28px;
font-family:MicrosoftYaHeiUI-Bold,MicrosoftYaHeiUI;
font-weight:bold;
}
.bottomText{
position: relative;
top: -1px;
font-size:14px;
font-family:MicrosoftYaHeiUI;
}
}
.textCon{
display: inline-block;
vertical-align: top;
}
.border{
display: inline-block;
height: 40px;
border: {
left: 2px solid $border-color;
};
}
.rightBox{
margin-top: 14px;
display: inline-block;
img{
margin:{
top:15px;
right: 22px;
}
}
}
.rightBox:nth-of-type(1){
img{
width: 34px;
height: 34px;
}
.textCon{
margin-right:114px ;
}
}
.rightBox:nth-of-type(2){
position: relative;
top: 4px;
img{
width: 40px;
height: 40px;
margin-left: 102px;
}
.textCon{
margin-right:101px ;
}
}
.rightBox:nth-of-type(3){
img{
width: 34px;
height: 35px;
margin-left: 104px;
}
.textCon{
margin-right:184px ;
}
}
}
.title{
font-size: 18px;
margin-bottom: 6px;
}
.maxHeight{
max-height: 400px;
overflow-y: auto;
}
.ellipsis{
display: inline-block;
width: 200px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.resourceDiv{
display: inline-block;
margin-left: 10%;
span{
margin-right: 5%;
}
}
.content{
background: #FFFFFF;
}
.inputBox{
margin-right: 20px;
}
.selectBox{
margin-right: 20px;
}
.editIcon{
cursor: pointer;
color:#0069ff;
font-size:16px;
}
.editIcon2{
cursor: pointer;
color:#87d14b;
font-size:16px;
}
.playIcon{
cursor: pointer;
color:#34b3a2;
font-size:16px;
}
.pauseIcon{
cursor: pointer;
color:#ffc62e;
font-size:14px;
}
.delIcon{
cursor: pointer;
color:#f2365a;
font-size:16px;
}
</style>
\ No newline at end of file \ No newline at end of file
.topCon {
background: $white-back-color;
margin-bottom: 12px;
height: 100px;
.left {
display: inline-block;
margin: {
top: 22px;
left: 30px;
}
img {
width: 65px;
height: 55px;
margin-right: 11px;
}
.topText {
font-size: 24px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
margin-bottom: 4px;
}
.bottomText {
font-size: 14px;
font-family: MicrosoftYaHeiUI;
}
}
.right {
float: right;
.topText {
font-size: 28px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
}
.bottomText {
position: relative;
top: -1px;
font-size: 14px;
font-family: MicrosoftYaHeiUI;
}
}
.textCon {
display: inline-block;
vertical-align: top;
}
.border {
display: inline-block;
height: 40px;
border: {
left: 2px solid $border-color;
}
}
.rightBox {
margin-top: 14px;
display: inline-block;
img {
margin: {
top: 15px;
right: 22px;
}
}
}
.rightBox:nth-of-type(1) {
img {
width: 34px;
height: 34px;
}
.textCon {
margin-right: 114px;
}
}
.rightBox:nth-of-type(2) {
position: relative;
top: 4px;
img {
width: 40px;
height: 40px;
margin-left: 102px;
}
.textCon {
margin-right: 101px;
}
}
.rightBox:nth-of-type(3) {
img {
width: 34px;
height: 35px;
margin-left: 104px;
}
.textCon {
margin-right: 184px;
}
}
}
.title {
font-size: 18px;
margin-bottom: 6px;
}
.maxHeight {
max-height: 400px;
overflow-y: auto;
}
.ellipsis {
display: inline-block;
width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.resourceDiv {
display: inline-block;
margin-left: 10%;
span {
margin-right: 5%;
}
}
.content {
background: #ffffff;
}
.inputBox {
margin-right: 20px;
}
.selectBox {
margin-right: 20px;
}
.editIcon {
cursor: pointer;
color: #0069ff;
font-size: 16px;
}
.editIcon2 {
cursor: pointer;
color: #87d14b;
font-size: 16px;
}
.playIcon {
cursor: pointer;
color: #34b3a2;
font-size: 16px;
}
.pauseIcon {
cursor: pointer;
color: #ffc62e;
font-size: 14px;
}
.delIcon {
cursor: pointer;
color: #f2365a;
font-size: 16px;
}
</style>
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
unid: this.addVideoParam.addr_unid unid: this.addVideoParam.addr_unid
}; };
this.$emit("getAllData", data); this.$emit("getAllData", data);
// this.$parent.$parent.$parent.submitLaterGet(data) // this.$parent.$parent.$parent.$parent.submitLaterGet(data);
this.cameraAddVisible = false; this.cameraAddVisible = false;
} else { } else {
this.$message.error(res.enote); this.$message.error(res.enote);
...@@ -251,6 +251,11 @@ export default { ...@@ -251,6 +251,11 @@ export default {
}); });
} }
} }
},
created(){
this.dirCodeList = localStorage.getItem("卡口方向")
? JSON.parse(localStorage.getItem("卡口方向"))
: [];
} }
}; };
</script> </script>
......
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
data.vchan_name == "" ? "未命名" : data.vchan_name data.vchan_name == "" ? "未命名" : data.vchan_name
}}</span> }}</span>
</span> </span>
<span class="tree-btn" v-if="data.label || data.label == ''"> <span class="tree-btn" v-if="(data.label || data.label == '') && data.vtype ? false:true" >
<i class="el-icon-plus" @click.stop="nodeAddClick(node, data)"></i> <i class="el-icon-plus" @click.stop="nodeAddClick(node, data)"></i>
<i <i
class="el-icon-edit" class="el-icon-edit"
@click.stop="nodeEditClick(node, data)" @click.stop="nodeEditClick(node, data)"
v-if="data.org_type != 'root'" v-if="data.org_type != 'root'"
></i> ></i>
<i <i
class="el-icon-delete" class="el-icon-delete"
@click.stop="nodeDelClick(node, data)" @click.stop="nodeDelClick(node, data)"
v-if="data.org_type != 'root'" v-if="data.org_type != 'root'"
......
...@@ -135,7 +135,6 @@ export default { ...@@ -135,7 +135,6 @@ export default {
console.log("error", req); console.log("error", req);
}, },
handleNodeClick(data) { handleNodeClick(data) {
debugger
this.$emit("clickHandle", data, "video"); this.$emit("clickHandle", data, "video");
// this.$parent.$parent.getVideoTable(data,'video') // this.$parent.$parent.getVideoTable(data,'video')
}, },
......
...@@ -314,8 +314,8 @@ export default { ...@@ -314,8 +314,8 @@ export default {
.then(res => { .then(res => {
this.cameraTree = res.vchan_struct; this.cameraTree = res.vchan_struct;
this.cameraArr = []; this.cameraArr = [];
this.cameraBuildTree(res.vchan_struct); this.cameraTreeData = this.cameraBuildTree(res.vchan_struct);
this.getTable(data, "camera"); // this.getTable(data, "camera");
}); });
}, },
syncBuildTree(data) { syncBuildTree(data) {
...@@ -394,6 +394,7 @@ export default { ...@@ -394,6 +394,7 @@ export default {
obj["label"] = obj["label"] =
data[i].vchan_name === "" ? "未命名" : data[i].vchan_name; data[i].vchan_name === "" ? "未命名" : data[i].vchan_name;
obj["type"] = data[i].vchan_type; obj["type"] = data[i].vchan_type;
obj["vtype"] = "camera";
obj["root"] = "手动添加相机资源"; obj["root"] = "手动添加相机资源";
obj["orgNode"] = orgObject; obj["orgNode"] = orgObject;
obj["addrNode"] = addrObject; obj["addrNode"] = addrObject;
...@@ -459,6 +460,10 @@ export default { ...@@ -459,6 +460,10 @@ export default {
vchan_type: "camera", vchan_type: "camera",
org_unid: data.unid org_unid: data.unid
}; };
if (data.vtype) {
this.formattterData.push(data);
return;
}
this.$api.resource this.$api.resource
.getCameraTable(search_params, this.dev_unid) .getCameraTable(search_params, this.dev_unid)
.then(res => { .then(res => {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
:key="subTask.subtask_id" :key="subTask.subtask_id"
:class="[ :class="[
{ subtaskActive: subTask.subtask_id == currentSubtaskId }, { subtaskActive: subTask.subtask_id == currentSubtaskId },
{ disabledColor: subTask.running_status != 'Running' } { disabledColor: subTask.enableStatus == 5 }
]" ]"
:data-subtask="subTask.subtask_id" :data-subtask="subTask.subtask_id"
:id="subTask.vchan.vdev_unid + ',' + subTask.vchan.vchan_refid" :id="subTask.vchan.vdev_unid + ',' + subTask.vchan.vchan_refid"
...@@ -128,6 +128,10 @@ export default { ...@@ -128,6 +128,10 @@ export default {
}); });
}, },
subTasksClick(vdata) { subTasksClick(vdata) {
//删除中的任务不能点击
if (vdata.enableStatus == 5) {
return;
}
this.$store.commit("setocxstate", 1); this.$store.commit("setocxstate", 1);
this.currentSubtaskId = vdata.subtask_id; this.currentSubtaskId = vdata.subtask_id;
this.subtaskdata = vdata; this.subtaskdata = vdata;
...@@ -331,6 +335,11 @@ export default { ...@@ -331,6 +335,11 @@ export default {
color #01ce82 color #01ce82
} }
} }
.disabledColor{
color #c0c0c0!important;
text-decoration: line-through;
cursor text
}
.subtaskActive { .subtaskActive {
// background #0c3b87 // background #0c3b87
} }
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
<el-select <el-select
v-if="drawState == 2 && selectedShape" v-if="drawState == 2 && selectedShape"
v-model="markLineDirect" v-model="markLineDirect"
placeholder="方向选择"
> >
<el-option value="0" label="去向"></el-option> <el-option value="0" label="去向"></el-option>
<el-option value="1" label="来向"></el-option> <el-option value="1" label="来向"></el-option>
...@@ -83,6 +84,7 @@ ...@@ -83,6 +84,7 @@
<span v-if="drawState == 2 && selectedShape">车道号</span> <span v-if="drawState == 2 && selectedShape">车道号</span>
<el-input <el-input
type="number" type="number"
placeholder="车道号"
v-model="lineNum" v-model="lineNum"
min="1" min="1"
v-if=" v-if="
...@@ -134,6 +136,7 @@ ...@@ -134,6 +136,7 @@
disabled="disabled" disabled="disabled"
type="text" type="text"
class="w120" class="w120"
style="margin-top:10px"
placeholder="区域ID" placeholder="区域ID"
></el-input> ></el-input>
<el-input <el-input
...@@ -147,13 +150,14 @@ ...@@ -147,13 +150,14 @@
<div v-if="canvasState" sytle="textAlign:center"> <div v-if="canvasState" sytle="textAlign:center">
<!-- <button>撤销</button> --> <!-- <button>撤销</button> -->
<el-radio-group v-model="polyline" @change="polyChang"> <el-radio-group v-model="polyline" @change="polyChang">
<el-radio <div>
class="radio" <el-radio
:label="0" class="radio"
:style="lineRadioStyle" :label="0"
v-if="drawState == 1" :style="lineRadioStyle"
>直线</el-radio v-if="drawState == 1"
> >直线</el-radio>
</div>
<el-radio <el-radio
class="radio" class="radio"
:label="1" :label="1"
...@@ -2051,13 +2055,7 @@ export default { ...@@ -2051,13 +2055,7 @@ export default {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
console.log("#######################");
console.log(lanaAry);
console.log("#######################");
this.roiBody.lanes = {
lane_count: lanaAry.length ? lanaAry.length : 0,
lane: lanaAry ? lanaAry : []
};
//对向车道 //对向车道
try { try {
this.subtendLayer.get(".rect").forEach((el, index) => { this.subtendLayer.get(".rect").forEach((el, index) => {
...@@ -2094,7 +2092,13 @@ export default { ...@@ -2094,7 +2092,13 @@ export default {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
console.log("#######################");
console.log(lanaAry);
console.log("#######################");
this.roiBody.lanes = {
lane_count: lanaAry.length ? lanaAry.length : 0,
lane: lanaAry ? lanaAry : []
};
// 红绿灯区域 // 红绿灯区域
let lightAry = []; let lightAry = [];
try { try {
...@@ -2382,6 +2386,7 @@ button { ...@@ -2382,6 +2386,7 @@ button {
.modal-editbox .modal-lb { .modal-editbox .modal-lb {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 150px;
} }
.modal-right { .modal-right {
position: relative; position: relative;
......
...@@ -112,7 +112,6 @@ export default { ...@@ -112,7 +112,6 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
curType: 0, curType: 0,
canvasState: 0,
data: {}, data: {},
type: "0", type: "0",
btnIsactive: false, btnIsactive: false,
...@@ -287,7 +286,7 @@ export default { ...@@ -287,7 +286,7 @@ export default {
this.signLayer.add(line); this.signLayer.add(line);
} }
}); });
changeModelData("car") changeModelData("car");
this.initModel(); this.initModel();
}, },
initModel(){ initModel(){
...@@ -308,9 +307,8 @@ export default { ...@@ -308,9 +307,8 @@ export default {
); );
this.signLayer.add(line); this.signLayer.add(line);
this.stage.draw(); this.stage.draw();
let P1 = {}, let P1 = {},
P2 = {}; P2 = {};
P1.x = Number((po[0] / 800).toFixed(6)); P1.x = Number((po[0] / 800).toFixed(6));
P1.y = Number((po[1] / 500).toFixed(6)); P1.y = Number((po[1] / 500).toFixed(6));
P2.x = Number((po[2] / 800).toFixed(6)); P2.x = Number((po[2] / 800).toFixed(6));
...@@ -331,6 +329,7 @@ export default { ...@@ -331,6 +329,7 @@ export default {
return; return;
} }
this.changeIdnex = index; this.changeIdnex = index;
this.modelnum = 0;
//清除之前的模型和模型线 //清除之前的模型和模型线
let allLine = this.signLayer.get(".line"); let allLine = this.signLayer.get(".line");
let allModel = this.signLayer.get(".model"); let allModel = this.signLayer.get(".model");
...@@ -352,9 +351,9 @@ export default { ...@@ -352,9 +351,9 @@ export default {
this.signLayer.draw(); this.signLayer.draw();
//变换线模型 //变换线模型
let mtype = index == 0 ? "car" : "person"; let mtype = index == 0 ? "car" : "person";
changeModelData(mtype); changeModelData(mtype);
this.initModel(); this.initModel();
this.cancleSelectedGroup();
}, },
changeCanvasState: function() { changeCanvasState: function() {
...@@ -386,6 +385,7 @@ export default { ...@@ -386,6 +385,7 @@ export default {
makeSelectedGroup: function(shape) { makeSelectedGroup: function(shape) {
let points = shape.attrs.points; let points = shape.attrs.points;
let color = this.drawState ? "blue" : "red"; let color = this.drawState ? "blue" : "red";
this.modelnum = 0;
for (let i = 0; i < points.length; i += 2) { for (let i = 0; i < points.length; i += 2) {
const pos = { const pos = {
x: points[i], x: points[i],
...@@ -523,7 +523,6 @@ export default { ...@@ -523,7 +523,6 @@ export default {
modelnum: this.modelnum, modelnum: this.modelnum,
// a Kinetic.Canvas renderer is passed into the drawFunc function // a Kinetic.Canvas renderer is passed into the drawFunc function
drawFunc: function(ctx) { drawFunc: function(ctx) {
debugger;
ctx.beginPath(); ctx.beginPath();
ctx.lineTo(data[0].x, data[0].y); ctx.lineTo(data[0].x, data[0].y);
ctx.lineTo(data[1].x, data[1].y); ctx.lineTo(data[1].x, data[1].y);
...@@ -563,6 +562,7 @@ export default { ...@@ -563,6 +562,7 @@ export default {
}); });
this.signLayer.add(customShape); this.signLayer.add(customShape);
this.signLayer.draw(); this.signLayer.draw();
this.canvasState = 0;
}, },
//绘制箭头 //绘制箭头
drawArrows(c1, c2) { drawArrows(c1, c2) {
...@@ -657,7 +657,6 @@ export default { ...@@ -657,7 +657,6 @@ export default {
points.push(ele.attrs.x); points.push(ele.attrs.x);
points.push(ele.attrs.y); points.push(ele.attrs.y);
}); });
this.selectedShape.attrs.points = points; this.selectedShape.attrs.points = points;
let curmodelnun = this.selectedShape.attrs.linenum; let curmodelnun = this.selectedShape.attrs.linenum;
//标定线变化变换模型 //标定线变化变换模型
...@@ -675,7 +674,6 @@ export default { ...@@ -675,7 +674,6 @@ export default {
}, },
//根据模型线改变模型改变箭头 //根据模型线改变模型改变箭头
changeModel(modelnum) { changeModel(modelnum) {
console.log(modelnum);
let mlinepoints = this.selectedShape.attrs.points; let mlinepoints = this.selectedShape.attrs.points;
let curmodel = this.signLayer.get(".model"); let curmodel = this.signLayer.get(".model");
let arrows = this.signLayer.get(".arrows"); let arrows = this.signLayer.get(".arrows");
...@@ -709,7 +707,6 @@ export default { ...@@ -709,7 +707,6 @@ export default {
}); });
}, },
drawLine: function(start, end, col, types, linenum) { drawLine: function(start, end, col, types, linenum) {
debugger;
linenum = linenum ? linenum : 0; linenum = linenum ? linenum : 0;
let points = [start.x, start.y, end.x, end.y]; let points = [start.x, start.y, end.x, end.y];
let line = new Kinetic.Line({ let line = new Kinetic.Line({
......
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
<el-table-column align="center" label="预设位置配置" width="120"> <el-table-column align="center" label="预设位置配置" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="yzw-setbox"> <div class="yzw-setbox">
<span class="icon el-icon-delete" @click="resetRoi(scope.row)"></span> <span
class="icon el-icon-delete"
@click="resetRoi(scope.row)"
></span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -42,11 +45,32 @@ ...@@ -42,11 +45,32 @@
<el-table-column prop="address" align="center" label="参数设置"> <el-table-column prop="address" align="center" label="参数设置">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="table-set"> <div class="table-set">
<span @click="setParam(scope.row, scope.$index)">参数设置</span> <el-tooltip
<span @click="setArea(scope.row, scope.$index)">区域设置</span> class="item"
<span @click="setDemarcate(scope.row, scope.$index)" effect="dark"
>标定设置</span :content="taskInfo.param_status == 0 ? '运行中' : '下发中'"
placement="top"
> >
<span @click="setParam(scope.row, scope.$index)">参数设置</span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
:content="taskInfo.roi_status == 0 ? '运行中' : '下发中'"
placement="top"
>
<span @click="setArea(scope.row, scope.$index)">区域设置</span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
:content="taskInfo.calibration_status == 0 ? '运行中' : '下发中'"
placement="top"
>
<span @click="setDemarcate(scope.row, scope.$index)"
>标定设置</span
>
</el-tooltip>
<!-- <span @click="setTimer(scope.row, scope.$index)">时间设置</span> --> <!-- <span @click="setTimer(scope.row, scope.$index)">时间设置</span> -->
</div> </div>
</template> </template>
...@@ -125,7 +149,7 @@ export default { ...@@ -125,7 +149,7 @@ export default {
switchstate: false switchstate: false
}; };
}, },
props: ["taskid", "subtaskid", "playurl", "vchan"], props: ["taskid", "subtaskid", "playurl", "vchan", "subtaskdata"],
components: { components: {
areas, areas,
demarcate, demarcate,
...@@ -138,7 +162,7 @@ export default { ...@@ -138,7 +162,7 @@ export default {
setParam(scenesdata, index) { setParam(scenesdata, index) {
if (this.checkpollstate()) { if (this.checkpollstate()) {
this.curindex = index; this.curindex = index;
this.$refs.parameter.init(scenesdata); this.$refs.parameter.init(scenesdata, this.taskInfo);
} }
}, },
setArea(roidata, index) { setArea(roidata, index) {
...@@ -216,11 +240,12 @@ export default { ...@@ -216,11 +240,12 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
debugger debugger;
that.taskInfo.mtasks[0].scenes.map(ele => { that.taskInfo.mtasks[0].scenes.map(ele => {
if (ele.scene_unid == row.scene_unid) { if (ele.scene_unid == row.scene_unid) {
ele.config = {}; ele.config = {};
ele.rois[0].roi = '<?xml version="1.0" encoding="UTF-8" ?><roi><flow_roi><flow_type></flow_type><flow_region><polygon_point_count>0</polygon_point_count></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>0</polygon_point_count></detect_polygon></plate_detect_region><lane_line><line_count>0</line_count></lane_line><lanes><lane_count>0</lane_count></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>0</region_count></no_stop_region><pedestrian_detection_region><region_count>0</region_count></pedestrian_detection_region><median_lines><lane_count>0</lane_count></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>'; ele.rois[0].roi =
'<?xml version="1.0" encoding="UTF-8" ?><roi><flow_roi><flow_type></flow_type><flow_region><polygon_point_count>0</polygon_point_count></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>0</polygon_point_count></detect_polygon></plate_detect_region><lane_line><line_count>0</line_count></lane_line><lanes><lane_count>0</lane_count></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>0</region_count></no_stop_region><pedestrian_detection_region><region_count>0</region_count></pedestrian_detection_region><median_lines><lane_count>0</lane_count></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>';
ele.runtime = 0; ele.runtime = 0;
} }
}); });
...@@ -344,15 +369,18 @@ export default { ...@@ -344,15 +369,18 @@ export default {
roi: xml roi: xml
} }
]; ];
postObj.conf_type = "rois";
} else if (type == "config") { } else if (type == "config") {
postObj.mtasks[0].scenes[this.curindex].config = { postObj.mtasks[0].scenes[this.curindex].config = {
xml: xml xml: xml
}; };
postObj.conf_type = "paramsconfig";
} else if (type == "calibration") { } else if (type == "calibration") {
console.log(xml); console.log(xml);
postObj.mtasks[0].scenes[this.curindex].calibration = { postObj.mtasks[0].scenes[this.curindex].calibration = {
calibration: xml calibration: xml
}; };
postObj.conf_type = "calibration";
} }
this.$api.task this.$api.task
.editRoi(this.taskid, this.subtaskid, postObj, { .editRoi(this.taskid, this.subtaskid, postObj, {
...@@ -368,6 +396,7 @@ export default { ...@@ -368,6 +396,7 @@ export default {
}); });
switch (type) { switch (type) {
case "roi": case "roi":
this.taskInfo.roi_status = 1;
this.taskInfo.mtasks[0].scenes[this.curindex].rois = [ this.taskInfo.mtasks[0].scenes[this.curindex].rois = [
{ {
roi: xml roi: xml
...@@ -375,6 +404,13 @@ export default { ...@@ -375,6 +404,13 @@ export default {
]; ];
break; break;
case "calibration": case "calibration":
this.taskInfo.calibration_status = 1;
this.taskInfo.mtasks[0].scenes[this.curindex].calibration = {
calibration: xml
};
break;
case "config":
this.taskInfo.param_status = 1;
this.taskInfo.mtasks[0].scenes[this.curindex].calibration = { this.taskInfo.mtasks[0].scenes[this.curindex].calibration = {
calibration: xml calibration: xml
}; };
...@@ -382,11 +418,16 @@ export default { ...@@ -382,11 +418,16 @@ export default {
default: default:
break; break;
} }
} else {
this.$message({
message: m.enote,
type: "error"
});
} }
}); });
} }
}, },
created(){ created() {
this.user_unid = window.sessionStorage.getItem("user_unid"); this.user_unid = window.sessionStorage.getItem("user_unid");
}, },
watch: { watch: {
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
prop="index" prop="index"
align="center" align="center"
label="#" label="#"
:formatter="indexFormatter" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -259,9 +259,8 @@ ...@@ -259,9 +259,8 @@
import videoDialog from "@/components/video"; import videoDialog from "@/components/video";
export default { export default {
data() { data() {
let start_dt = let start_dt = this.yesterDay();
this.$moment("2019-12-20").format("YYYY-MM-DD") + " 00:00:00"; let end_dt = this.nowDay();
let end_dt = this.$moment().format("YYYY-MM-DD") + " 23:59:59";
return { return {
detailObj: {}, detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"), carImg: require("@/assets/img/home/defaultImg.png"),
......
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
prop="index" prop="index"
align="center" align="center"
label="#" label="#"
:formatter="indexFormatter" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -348,9 +348,8 @@ ...@@ -348,9 +348,8 @@
import videoDialog from "@/components/video"; import videoDialog from "@/components/video";
export default { export default {
data() { data() {
let start_dt = let start_dt = this.yesterDay();
this.$moment("2019-12-20").format("YYYY-MM-DD") + " 00:00:00"; let end_dt = this.nowDay();
let end_dt = this.$moment().format("YYYY-MM-DD") + " 23:59:59";
return { return {
loading: false, loading: false,
playurl: "", playurl: "",
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
prop="index" prop="index"
align="center" align="center"
label="#" label="#"
:formatter="indexFormatter" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -202,9 +202,8 @@ ...@@ -202,9 +202,8 @@
<script> <script>
export default { export default {
data() { data() {
let start_dt = let start_dt = this.yesterDay();
this.$moment("2019-12-20").format("YYYY-MM-DD") + " 00:00:00"; let end_dt = this.nowDay();
let end_dt = this.$moment().format("YYYY-MM-DD") + " 23:59:59";
return { return {
loading: false, loading: false,
dates: [start_dt, end_dt], dates: [start_dt, end_dt],
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
prop="index" prop="index"
align="center" align="center"
label="#" label="#"
:formatter="indexFormatter" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -360,9 +360,8 @@ ...@@ -360,9 +360,8 @@
<script> <script>
export default { export default {
data() { data() {
let start_dt = let start_dt = this.yesterDay();
this.$moment("2019-12-20").format("YYYY-MM-DD") + " 00:00:00"; let end_dt = this.nowDay();
let end_dt = this.$moment().format("YYYY-MM-DD") + " 23:59:59";
return { return {
detailObj: {}, detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"), carImg: require("@/assets/img/home/defaultImg.png"),
......
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
prop="index" prop="index"
align="center" align="center"
label="#" label="#"
:formatter="indexFormatter" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -452,9 +452,8 @@ ...@@ -452,9 +452,8 @@
<script> <script>
export default { export default {
data() { data() {
let start_dt = let start_dt = this.yesterDay();
this.$moment("2019-12-20").format("YYYY-MM-DD") + " 00:00:00"; let end_dt = this.nowDay();
let end_dt = this.$moment().format("YYYY-MM-DD") + " 23:59:59";
return { return {
detailObj: {}, detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"), carImg: require("@/assets/img/home/defaultImg.png"),
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -229,11 +229,11 @@ ...@@ -229,11 +229,11 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
let start_dt = let start_dt = this.yesterDay();
this.$moment("2019-12-20").format("YYYY-MM-DD") + " 00:00:00"; let end_dt = this.nowDay();
let end_dt = this.$moment().format("YYYY-MM-DD") + " 23:59:59";
return { return {
detailObj: {}, detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"), carImg: require("@/assets/img/home/defaultImg.png"),
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="场景占用" class="form-item" prop="resource_use"> <el-form-item label="场景占用" class="form-item" prop="resource_use">
<el-select <el-select
v-model="formData.resource_use" v-model="formData.resource_use"
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="时间" label="时间"
v-show="formData.plate_time != 'day'" v-show="!formData.period"
prop="timer" prop="timer"
class="form-item" class="form-item"
> >
...@@ -86,11 +86,14 @@ ...@@ -86,11 +86,14 @@
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间" end-placeholder="结束时间"
placeholder="选择时间范围" placeholder="选择时间范围"
:disabled="pedittype != 'add'"
> >
</el-time-picker> </el-time-picker>
</el-form-item> </el-form-item>
<el-form-item label="存储配置" class="form-item"> <el-form-item
label="存储配置"
class="form-item"
prop="store_conf_unid"
>
<el-select <el-select
v-model="formData.store_conf.unid" v-model="formData.store_conf.unid"
placeholder="请选择" placeholder="请选择"
...@@ -105,7 +108,10 @@ ...@@ -105,7 +108,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型" class="form-item"> <el-form-item label="设备类型" class="form-item">
<el-select v-model="formData.plate_type" :disabled="pedittype != 'add'"> <el-select
v-model="formData.plate_type"
:disabled="pedittype != 'add'"
>
<el-option <el-option
v-for="(item, index) in platT" v-for="(item, index) in platT"
:key="index" :key="index"
...@@ -139,9 +145,16 @@ ...@@ -139,9 +145,16 @@
<script> <script>
export default { export default {
data() { data() {
var checkStore = (rule, value, callback) => {
if (!this.formData.store_conf.unid) {
return callback(new Error("存储配置不能为空"));
} else {
callback()
}
};
return { return {
setvisible: false, setvisible: false,
timer:["00:00:00", "23:59:59"], timer: ["00:00:00", "23:59:59"],
formData: { formData: {
task_name: "", task_name: "",
task_algo_type: "", task_algo_type: "",
...@@ -162,9 +175,10 @@ export default { ...@@ -162,9 +175,10 @@ export default {
stores: [ stores: [
{ required: true, message: "存储配置不能为空!", trigger: "change" } { required: true, message: "存储配置不能为空!", trigger: "change" }
], ],
resource_use:[ resource_use: [
{ required: true, message: "场景占用不能为空!", trigger: "change" } { required: true, message: "场景占用不能为空!", trigger: "change" }
] ],
store_conf_unid: [{ required: true, validator: checkStore, trigger: "change" }]
} }
}; };
}, },
...@@ -187,10 +201,9 @@ export default { ...@@ -187,10 +201,9 @@ export default {
var freeArr = []; var freeArr = [];
this.freeList.forEach(ele => { this.freeList.forEach(ele => {
if (ele.license_info && ele.license_info.platType) { if (ele.license_info && ele.license_info.platType) {
this.platT.push(ele.license_info.platType); this.platT.push(ele.license_info.platType);
} }
}); });
this.platT = new Set(this.platT);
} }
}, },
initData(type, pdata) { initData(type, pdata) {
......
...@@ -158,6 +158,8 @@ export default { ...@@ -158,6 +158,8 @@ export default {
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; data[i].vchan.running_status = data[i].running_status;
data[i].vchan.play_url = data[i].rtsp_url; data[i].vchan.play_url = data[i].rtsp_url;
data[i].vchan.play_url = data[i].rtsp_url;
data[i].vchan.enableStatus = data[i].enableStatus;
} else { } else {
data.vchan = { data.vchan = {
subtask_id: data[i].subtask_id, subtask_id: data[i].subtask_id,
...@@ -165,7 +167,8 @@ export default { ...@@ -165,7 +167,8 @@ export default {
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, running_status: data[i].running_status,
play_url: data[i].rtsp_url play_url: data[i].rtsp_url,
enableStatus: data[i].enableStatus
}; };
} }
ary.push(data[i].vchan); ary.push(data[i].vchan);
...@@ -175,18 +178,26 @@ export default { ...@@ -175,18 +178,26 @@ export default {
}); });
}, },
statusFormatter(row) { statusFormatter(row) {
if (row.running_status == "Running") { let data = row.enableStatus;
if (data == 2) {
return "<span class='runningbox statusbox'>工作中</span>"; return "<span class='runningbox statusbox'>工作中</span>";
} else if (row.running_status == "Finished") { } else if (data == 1) {
return "<span class='finishedbox statusbox'>已完成</span>"; return "<span class='nomoralbox statusbox'>部署中</span>";
} else if (row.running_status == "Pause") { } else if (data == 3) {
return "<span class='pausebox statusbox'>暂停</span>"; return "<span class='pausebox statusbox'>暂停中</span>";
} else if (row.running_status == "Error") { } else if (data == 4) {
return "<span class='errorbox statusbox'>异常</span>"; return "<span class='pausebox statusbox'>已暂停</span>";
} else if (row.running_status == "Deleted") { } else if (data == 5) {
return "<span class='deletebox statusbox'>删除中</span>";
} else if (data == 6) {
return "<span class='deletebox statusbox'>已删除</span>"; return "<span class='deletebox statusbox'>已删除</span>";
} else { } else if (data == 7) {
return "<span class='pausebox statusbox'>启动中</span>";
} else if (data == 0) {
return "<span class='nomoralbox statusbox'>未部署</span>"; return "<span class='nomoralbox statusbox'>未部署</span>";
} else {
// return "<span class='errorbox statusbox'>异常</span>";
return "<span class='nomoralbox statusbox'>部署中</span>";
} }
}, },
handleCheckChange(data, node) { handleCheckChange(data, node) {
...@@ -244,7 +255,6 @@ export default { ...@@ -244,7 +255,6 @@ export default {
console.log("b", data); console.log("b", data);
}, },
delFun(index, data, action = "tree") { delFun(index, data, action = "tree") {
console.log("da",data);
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.$confirm("删除视频源, 是否继续?", "提示", { this.$confirm("删除视频源, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -255,13 +265,20 @@ export default { ...@@ -255,13 +265,20 @@ export default {
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.$message({ if (res.ecode == "200") {
type: "success", this.$message({
message: "删除成功!" type: "success",
}); message: "删除成功!"
this.tableData.splice(index, 1); });
this.checkvckan(); this.tableData.splice(index, 1);
this.$store.commit("setocxstate", 1); this.checkvckan();
this.$store.commit("setocxstate", 1);
} else {
this.$message({
type: "error",
message: res.enote
});
}
}); });
if (action != "tree") { if (action != "tree") {
setTimeout(() => { setTimeout(() => {
...@@ -291,7 +308,7 @@ export default { ...@@ -291,7 +308,7 @@ export default {
this.tableData.forEach(ele => { this.tableData.forEach(ele => {
arr.push(ele.vchan_refid); arr.push(ele.vchan_refid);
}); });
console.log(arr) console.log(arr);
this.$refs.tree.setCheckedKeys(arr); this.$refs.tree.setCheckedKeys(arr);
}, },
rowclick(row) { rowclick(row) {
...@@ -357,8 +374,7 @@ export default { ...@@ -357,8 +374,7 @@ export default {
if (vchan.leaf) { if (vchan.leaf) {
vchan.childs = ""; vchan.childs = "";
} }
vchan.vchan_refid = vchan.refid || vchan.vchan_refid vchan.vchan_refid = vchan.refid || vchan.vchan_refid;
} }
resolve(vchans); resolve(vchans);
setTimeout(() => { setTimeout(() => {
...@@ -388,7 +404,7 @@ export default { ...@@ -388,7 +404,7 @@ export default {
} }
return resolve(node.data.childs); return resolve(node.data.childs);
}, },
renderContent(h, { node, data, store }){ renderContent(h, { node, data, store }) {
return ( return (
<span class="custom-tree-node"> <span class="custom-tree-node">
<el-tooltip <el-tooltip
...@@ -399,7 +415,8 @@ export default { ...@@ -399,7 +415,8 @@ export default {
> >
<span>{node.label}</span> <span>{node.label}</span>
</el-tooltip> </el-tooltip>
</span>); </span>
);
}, },
vchanClick(node) { vchanClick(node) {
if (!node.refid && !node.vchan_refid) { if (!node.refid && !node.vchan_refid) {
...@@ -575,4 +592,4 @@ export default { ...@@ -575,4 +592,4 @@ export default {
border: 1px solid #444444; border: 1px solid #444444;
margin-bottom: 14px; margin-bottom: 14px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<el-table-column <el-table-column
align="center" align="center"
prop="num" prop="num"
:formatter="numFormatter" type="index"
label="序号" label="序号"
width="60" width="60"
> >
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -310,6 +310,10 @@ export default { ...@@ -310,6 +310,10 @@ export default {
? data[i].video_total ? data[i].video_total
: ""; : "";
data[i].vchan.plate_type = row.plate_type ? row.plate_type : ""; data[i].vchan.plate_type = row.plate_type ? row.plate_type : "";
data[i].vchan.running_status = data[i].running_status
? data[i].running_status
: "";
data[i].vchan.enableStatus = data[i].enableStatus ? data[i].enableStatus : "";
} }
ary.push(data[i].vchan); ary.push(data[i].vchan);
} }
...@@ -473,7 +477,7 @@ export default { ...@@ -473,7 +477,7 @@ export default {
} }
}); });
}); });
}, }
}, },
mounted() { mounted() {
this.getTaskList(); this.getTaskList();
...@@ -551,7 +555,8 @@ export default { ...@@ -551,7 +555,8 @@ export default {
height: 34px; height: 34px;
} }
.textCon { .textCon {
margin-right: 114px; margin-right: 64px;
// margin-right: 114px;
} }
} }
.rightBox:nth-of-type(2) { .rightBox:nth-of-type(2) {
...@@ -561,6 +566,7 @@ export default { ...@@ -561,6 +566,7 @@ export default {
width: 40px; width: 40px;
height: 40px; height: 40px;
margin-left: 1vw; margin-left: 1vw;
// margin-left: 3vw;
} }
.textCon { .textCon {
margin-right: 101px; margin-right: 101px;
......
<template> <template>
<div class="expande-table-row"> <div class="expande-table-row">
<span class="label">{{ subindex + 1 }}</span> <span class="label labelindex">{{ subindex + 1 }}</span>
<el-tooltip class="item" effect="dark" :content="subTaskData.info" placement="top-start"><span class="subtask-info taskstatus" v-html="formater(subTaskData)"></span></el-tooltip>
<span class="label">视频源文件</span> <span class="label">视频源文件</span>
<span class="subtask-info">{{ subTaskData.vchan_name }}</span> <span class="subtask-info">{{ subTaskData.vchan_name }}</span>
<span class="label">任务ID</span> <span class="label">任务ID</span>
...@@ -19,7 +20,10 @@ ...@@ -19,7 +20,10 @@
:key="index" :key="index"
:value="item.device_id" :value="item.device_id"
:label="item.in_ip" :label="item.in_ip"
v-if="subTaskData.plate_type && item.license_info.platType === subTaskData.plate_type" v-if="
subTaskData.plate_type &&
item.license_info.platType === subTaskData.plate_type
"
> >
{{ item.in_ip }} {{ item.license_info.platType }} {{ item.in_ip }} {{ item.license_info.platType }}
</el-option> </el-option>
...@@ -75,6 +79,27 @@ export default { ...@@ -75,6 +79,27 @@ export default {
}); });
} }
}); });
},
formater(data) {
if (data.enableStatus == 2) {
return "<span class='runningbox statusbox'>工作中</span>";
} else if (data.enableStatus == 1) {
return "<span class='nomoralbox statusbox'>部署中</span>";
} else if (data.enableStatus == 3) {
return "<span class='pausebox statusbox'>暂停中</span>";
} else if (data.enableStatus == 4) {
return "<span class='pausebox statusbox'>已暂停</span>";
} else if (data.enableStatus == 5) {
return "<span class='deletebox statusbox'>删除中</span>";
} else if (data.enableStatus == 6) {
return "<span class='deletebox statusbox'>已删除</span>";
} else if (data.enableStatus == 7) {
return "<span class='pausebox statusbox'>启动中</span>";
} else if (data.enableStatus == 0) {
return "<span class='nomoralbox statusbox'>未部署</span>";
} else {
return "<span class='errorbox statusbox'>异常</span>";
}
} }
}, },
created() { created() {
...@@ -98,6 +123,7 @@ export default { ...@@ -98,6 +123,7 @@ export default {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
overflow: hidden; overflow: hidden;
} }
.label { .label {
width: 5vw; width: 5vw;
text-align: center; text-align: center;
...@@ -106,6 +132,12 @@ export default { ...@@ -106,6 +132,12 @@ export default {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
.labelindex {
width: 3vw;
}
.taskstatus {
width: 5vw;
}
.subtask-info { .subtask-info {
border-left: 1px solid #f0f0f0; border-left: 1px solid #f0f0f0;
text-align: center; text-align: center;
...@@ -113,24 +145,24 @@ export default { ...@@ -113,24 +145,24 @@ export default {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
.subtask-info:nth-child(3) { .subtask-info:nth-child(4) {
width: 7vw; width: 7vw;
overflow: hidden; overflow: hidden;
} }
.subtask-info:nth-child(5) { .subtask-info:nth-child(6) {
width: 8vw; width: 8vw;
} }
.subtask-info:nth-child(7) { .subtask-info:nth-child(8) {
width: 6vw; width: 6vw;
} }
.subtask-info:nth-child(9) { .subtask-info:nth-child(10) {
width: 4vw; width: 3vw;
} }
.subtask-info:nth-child(11) { .subtask-info:nth-child(12) {
width: 4vw; width: 3vw;
} }
.subtask-info:nth-child(13) { .subtask-info:nth-child(14) {
width: 9vw; width: 7vw;
} }
.sub-btn { .sub-btn {
cursor: pointer; cursor: pointer;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!