Commit dd51de5d by 潘建波

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

1 parent 07463a28
...@@ -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;
} }
...@@ -297,3 +302,6 @@ body{ ...@@ -297,3 +302,6 @@ 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"
......
...@@ -2,30 +2,45 @@ ...@@ -2,30 +2,45 @@
<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> </el-date-picker>
<span style="margin-left: 30px;"> <el-checkbox v-model="syncTime" @change="syncTimeFun" :disabled="typeRadio=='2'">与计算机时间同步</el-checkbox></span> <span style="margin-left: 30px;">
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='2'" @click="manualClick">校时</el-button> <el-checkbox
v-model="syncTime"
@change="syncTimeFun"
:disabled="typeRadio == '2'"
>与计算机时间同步</el-checkbox
></span
>
<el-button
type="primary"
size="small"
class="primaryButton rightButton"
:disabled="typeRadio == '2'"
@click="manualClick"
>校时</el-button
>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div class="line"></div> <div class="line" hidden></div>
<!-- NTP校时 --> <!-- NTP校时 -->
<div class="lineBox big"> <div class="lineBox big">
<el-radio v-model="typeRadio" label="2">NTP校时</el-radio> <el-radio v-model="typeRadio" label="2">NTP校时</el-radio>
...@@ -34,62 +49,77 @@ ...@@ -34,62 +49,77 @@
<div class="lineBox"> <div class="lineBox">
<el-form-item label="服务器地址:"> <el-form-item label="服务器地址:">
<span class="inputBox"> <span class="inputBox">
<el-input placeholder="请输入服务器地址" v-model="serverAdr" :disabled="typeRadio=='1'"></el-input> <el-input
placeholder="请输入服务器地址"
v-model="serverAdr"
:disabled="typeRadio == '1'"
></el-input>
</span> </span>
</el-form-item> </el-form-item>
</div> </div>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="NTP端口:"> <el-form-item label="NTP端口:">
<span class="inputBox"> <span class="inputBox">
<el-input placeholder="请输入NTP端口" v-model="ntpPort" :disabled="typeRadio=='1'"></el-input> <el-input
placeholder="请输入NTP端口"
v-model="ntpPort"
:disabled="typeRadio == '1'"
></el-input>
</span> </span>
</el-form-item> </el-form-item>
</div> </div>
<div class="lineBox"> <div class="lineBox">
<el-radio v-model="ntpRadio" label="1" :disabled="typeRadio=='1'">定时校时</el-radio> <el-radio v-model="ntpRadio" label="1" :disabled="typeRadio == '1'"
>定时校时</el-radio
>
</div> </div>
<el-form ref="inlineform" label-width="100px" inline> <el-form ref="inlineform" label-width="100px" inline>
<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[0]"
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'"
value-format="HH:mm" value-format="HH:mm"
v-model="timeArr[1]" v-model="timeArr[1]"
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[2]" v-model="timeArr[2]"
value-format="HH:mm" value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间"
>
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
</div> </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[3]" 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]" v-model="timeArr[4]"
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=" ">
...@@ -98,15 +128,28 @@ ...@@ -98,15 +128,28 @@
</div> </div>
</el-form> </el-form>
<div class="lineBox"> <div class="lineBox">
<el-radio v-model="ntpRadio" label="2" :disabled="typeRadio=='1'">周期校时</el-radio> <el-radio v-model="ntpRadio" label="2" :disabled="typeRadio == '1'"
>周期校时</el-radio
>
</div> </div>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="每隔:"> <el-form-item label="每隔:">
<span class="inputBox" style="width: 60px;"> <span class="inputBox" style="width: 60px;">
<el-input placeholder="" v-model.number="weekMinutes" :disabled="typeRadio=='1'||ntpRadio=='1'"></el-input> <el-input
placeholder=""
v-model.number="weekMinutes"
:disabled="typeRadio == '1' || ntpRadio == '1'"
></el-input>
</span> </span>
<span style="margin-left: 14px;">秒,自动进行校时</span> <span style="margin-left: 14px;">秒,自动进行校时</span>
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='1'" @click="saveClick">保存设置</el-button> <el-button
type="primary"
size="small"
class="primaryButton rightButton"
:disabled="typeRadio == '1'"
@click="saveClick"
>保存设置</el-button
>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -114,49 +157,46 @@ ...@@ -114,49 +157,46 @@
</div> </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(() => {
this.computerTime = this.$moment().format("YYYY-MM-DD HH:mm:ss");
}, 1000);
}, },
timer(){ getDevTimes() {
setInterval(()=>{ this.$api.ops.getDevsTime({}, this.dev_unid, this.device_id).then(res => {
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=>{
if (res.ecode != undefined && res.ecode != 200) { if (res.ecode != undefined && res.ecode != 200) {
//console.log('获取设备时间失败!' + utcTimes.enote); //console.log('获取设备时间失败!' + utcTimes.enote);
this.$message({ this.$message({
type: 'error', type: "error",
message: '获取设备时间失败!' + res.enote message: "获取设备时间失败!" + res.enote
}); });
} else { } else {
if(res && typeof res === 'string') { if (res && typeof res === "string") {
//先转utc格式 //先转utc格式
let date = this.$moment.utc(res).format(); let date = this.$moment.utc(res).format();
//再utc时间转本地时间 //再utc时间转本地时间
...@@ -165,91 +205,100 @@ ...@@ -165,91 +205,100 @@
.format("YYYY-MM-DD HH:mm:ss"); .format("YYYY-MM-DD HH:mm:ss");
} }
} }
}) });
}, },
syncTimeFun(){ syncTimeFun() {
if(this.syncTime){ if (this.syncTime) {
this.systemTime=this.computerTime; this.systemTime = this.computerTime;
} }
}, },
manualClick() { manualClick() {
let time=this.$moment(this.systemTime).utc().format("YYYY-MM-DD HH:mm:ss"); let time = this.$moment(this.systemTime)
this.$api.ops.manualTime({ .utc()
time:time .format("YYYY-MM-DD HH:mm:ss");
},this.dev_unid,this.device_id).then(res=>{ this.$api.ops
if(res.ecode != 200) { .manualTime(
{
time: time
},
this.dev_unid,
this.device_id
)
.then(res => {
if (res.ecode != 200) {
this.$message({ this.$message({
type: 'error', type: "error",
message: '手动校时失败!' + res.enote message: "手动校时失败!" + res.enote
}) });
} else { } else {
this.$message({ this.$message({
type: 'success', type: "success",
message: '手动校时成功!' message: "手动校时成功!"
}) });
} }
}) });
}, },
getNtpTimes () { getNtpTimes() {
//获取ntp校时配置 //获取ntp校时配置
this.$api.ops.getNtp({ this.$api.ops
},this.dev_unid,this.device_id).then(res=>{ .getNtp({}, this.dev_unid, this.device_id)
if(res.ecode != undefined && res.ecode != 200) { .then(res => {
if (res.ecode != undefined && res.ecode != 200) {
this.$message({ this.$message({
type: 'error', type: "error",
message: '获取NTP校时失败!' + res.enote message: "获取NTP校时失败!" + res.enote
}); });
} else { } else {
if(res.enable_ntp == 1) { if (res.enable_ntp == 1) {
this.typeRadio = '2'; this.typeRadio = "2";
this.serverAdr = res.ntp_server_ip; this.serverAdr = res.ntp_server_ip;
this.ntpPort = res.ntp_server_port; this.ntpPort = res.ntp_server_port;
console.log('获取NTP时间:', res.timing_times) console.log("获取NTP时间:", res.timing_times);
this.timeArr=res.timing_times; this.timeArr = res.timing_times;
this.weekMinutes = res.timing_interval; this.weekMinutes = res.timing_interval;
if(res.timing_policy == "fix"){ if (res.timing_policy == "fix") {
this.ntpRadio = '1'; this.ntpRadio = "1";
} }
if(res.timing_policy == "interval"){ if (res.timing_policy == "interval") {
this.ntpRadio = '2'; this.ntpRadio = "2";
} }
} else { } else {
this.typeRadio = '1'; this.typeRadio = "1";
} }
} }
}).catch(err => { })
console.log('获取ntp校时设置异常:', err.message); .catch(err => {
console.log("获取ntp校时设置异常:", err.message);
}); });
}, },
saveClick() { saveClick() {
if(this.serverAdr != "" &&this.ntpPort != ""){ if (this.serverAdr != "" && this.ntpPort != "") {
let timing_policy='' let timing_policy = "";
if(this.ntpRadio=='1'){ if (this.ntpRadio == "1") {
//如果定时校时 //如果定时校时
timing_policy='fix' timing_policy = "fix";
//数组去空值 //数组去空值
let arr=[]; let arr = [];
this.timeArr.forEach(item=>{ this.timeArr.forEach(item => {
if(item!=""&&typeof(item)!="undefined"){ if (item != "" && typeof item != "undefined") {
arr.push(item) arr.push(item);
} }
}) });
if(new Set(arr).size !== arr.length){ if (new Set(arr).size !== arr.length) {
  this.$message({ this.$message({
type: 'error', type: "error",
message: '定时时间重复,请重新选择' message: "定时时间重复,请重新选择"
}); });
return false; return false;
} }
}else if(this.ntpRadio=='2'){ } else if (this.ntpRadio == "2") {
//周期校时 //周期校时
timing_policy='interval' timing_policy = "interval";
if(this.weekMinutes === '') { if (this.weekMinutes === "") {
this.$message({ this.$message({
type: 'warning', type: "warning",
message: '未设置周期时间!' message: "未设置周期时间!"
}) });
return; return;
} }
} }
...@@ -261,53 +310,56 @@ ...@@ -261,53 +310,56 @@
timing_policy: timing_policy, timing_policy: timing_policy,
timing_times: this.timeArr, timing_times: this.timeArr,
timing_interval: this.weekMinutes timing_interval: this.weekMinutes
} };
this.ntpTimeSet(ntpTimingData); this.ntpTimeSet(ntpTimingData);
}else { } else {
this.$message({ this.$message({
type: 'warning', type: "warning",
message: '服务器地址以及ntp端口不能为空!' message: "服务器地址以及ntp端口不能为空!"
}) });
} }
}, },
ntpTimeSet(data){ ntpTimeSet(data) {
this.$api.ops.ntpTime(data,this.dev_unid,this.device_id).then(res=>{ this.$api.ops
if(res.ecode == 200){ .ntpTime(data, this.dev_unid, this.device_id)
.then(res => {
if (res.ecode == 200) {
this.$message({ this.$message({
type: 'success', type: "success",
message: 'NTP校时成功!' message: "NTP校时成功!"
}) });
} else { } else {
this.$message({ this.$message({
type: 'error', type: "error",
message: 'NTP校时失败!' + res.enote message: "NTP校时失败!" + res.enote
}) });
} }
}).catch(err => { })
console.log('ntp校时异常:', error.message) .catch(err => {
console.log("ntp校时异常:", error.message);
}); });
} }
},
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.line{ .line {
height:1px; height: 1px;
background:rgba(232,232,232,1); background: rgba(232, 232, 232, 1);
margin-top: 18px; margin-top: 18px;
margin-bottom: 15px; margin-bottom: 15px;
} }
.lineBox{ .lineBox {
padding: 12px 0 12px 50px; padding: 12px 0 12px 50px;
} }
.radioContent{ .radioContent {
margin-left: 24px; margin-left: 24px;
} }
.rightButton{ .rightButton {
float: right; float: right;
margin-right: 20%; margin-right: 20%;
} }
.inputBox{ .inputBox {
width: 220px; width: 220px;
} }
</style> </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,
name: this.codeData.name,
note: this.codeData.note,
active: this.codeData.active
};
this.$api.codes.addTrafficCode(data, this.curCateUnid).then(res => {
console.log(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.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.$api.codes this.$api.codes
.editTrafficCode(row, this.curCateUnid, row.code_unid) .deleteTrafficCode(this.curCateUnid, row.code_unid)
.then(res => { .then(res => {
console.log(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"
......
...@@ -3,11 +3,21 @@ ...@@ -3,11 +3,21 @@
<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
v-model="storename"
placeholder="请输入存储配置名称"
></el-input>
</span> </span>
<el-button type="primary" style="position: relative;top: -2px;" @click="query">查询</el-button> <el-button
type="primary"
style="position: relative;top: -2px;"
@click="query"
>查询</el-button
>
<span style="float: right;"> <span style="float: right;">
<el-button type="info" icon="el-icon-search" @click="add">添加</el-button> <el-button type="info" icon="el-icon-search" @click="add"
>添加</el-button
>
</span> </span>
</div> </div>
<div style="padding: 0 15px 20px 23px;"> <div style="padding: 0 15px 20px 23px;">
...@@ -16,24 +26,21 @@ ...@@ -16,24 +26,21 @@
:data="tableData" :data="tableData"
stripe stripe
border border
style="width: 100%"> style="width: 100%"
<el-table-column >
align="center" <el-table-column align="center" prop="name" label="名称">
prop="name"
label="名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="create_dt" align="center" label="上传时间">
prop="create_dt"
align="center"
label="上传时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" prop="task_list" label="应用任务">
align="center"
prop="task_list"
label="应用任务">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip :content="scope.row.ellipsis" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip
<span class="ellipsis">{{scope.row.ellipsis}}</span> :content="scope.row.ellipsis"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span class="ellipsis">{{ scope.row.ellipsis }}</span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
...@@ -41,14 +48,31 @@ ...@@ -41,14 +48,31 @@
align="center" align="center"
width="300" width="300"
prop="operation" prop="operation"
label="操作"> label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false> <el-tooltip
<span class="el-icon-info editIcon" @click="detail(scope.$index, scope.row)"></span> content="详情"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<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
<span class="el-icon-delete delIcon" @click="delFun(scope.$index, scope.row)"></span> content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<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>
...@@ -60,22 +84,19 @@ ...@@ -60,22 +84,19 @@
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"
:total="total"> :total="total"
>
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
</div> </div>
</div> </div>
<el-dialog <el-dialog title="添加" :visible.sync="addVisible" width="450px">
title="添加"
:visible.sync="addVisible"
width="450px">
<div> <div>
<el-form label-position="left" label-width="120px"> <el-form label-position="left" label-width="120px">
<el-form-item label="配置名称"> <el-form-item label="配置名称">
...@@ -86,17 +107,21 @@ ...@@ -86,17 +107,21 @@
ref="upload" ref="upload"
action="uploadUrl" action="uploadUrl"
:http-request="httpRequest" :http-request="httpRequest"
:on-success="uploadsuccess"
multiple multiple
name="file" name="file"
:auto-upload="false"> :auto-upload="false"
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> >
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
>
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> --> <!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="addVisible=false">取 消</el-button> <el-button @click="addVisible = false">取 消</el-button>
<el-button type="primary" @click="save">上 传</el-button> <el-button type="primary" @click="save">上 传</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -104,73 +129,70 @@ ...@@ -104,73 +129,70 @@
<el-dialog title="详情" :visible.sync="detailVisible" width="30%"> <el-dialog title="详情" :visible.sync="detailVisible" width="30%">
<div class="title">任务列表</div> <div class="title">任务列表</div>
<div class="maxHeight"> <div class="maxHeight">
<el-tree <el-tree :props="props" :load="loadNode" lazy> </el-tree>
:props="props"
:load="loadNode"
lazy>
</el-tree>
</div> </div>
</el-dialog> </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:{
}, },
mounted(){ components: {},
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) { loadNode(node, resolve) {
if (node.level === 0) { if (node.level === 0) {
...@@ -178,244 +200,249 @@ ...@@ -178,244 +200,249 @@
} }
if (node.level > 1) return resolve([]); if (node.level > 1) return resolve([]);
this.$api.resource.getSubTask({},node.data.unid).then(res=>{ this.$api.resource.getSubTask({}, node.data.unid).then(res => {
if(res.list_data==null){ if (res.list_data == null) {
res.list_data=[]; res.list_data = [];
} }
res.list_data.forEach(item=>{ res.list_data.forEach(item => {
item.name=item.subtask_name; item.name = item.subtask_name;
item['leaf']=true; item["leaf"] = true;
}) });
resolve(res.list_data) resolve(res.list_data);
}) });
}, },
query(){ query() {
this.tableData=[]; this.tableData = [];
let offset = (this.page - 1) * this.pageSize; let offset = (this.page - 1) * this.pageSize;
this.$api.resource.getStoreConList({ this.$api.resource
.getStoreConList(
{
limit: this.pageSize, limit: this.pageSize,
offset: offset, offset: offset,
name__like: this.storename, name__like: this.storename
},this.dev_unid).then((res)=>{ },
this.total=res.total_num; this.dev_unid
if(res.list_data==null){ )
this.tableData=[] .then(res => {
}else{ this.total = res.total_num;
this.tableData=res.list_data; if (res.list_data == null) {
} this.tableData = [];
this.tableData.forEach(list=>{ } else {
let ellipsisText=''; this.tableData = res.list_data;
list.task_list.forEach(item=>{ }
ellipsisText+=item.name+',' this.tableData.forEach(list => {
}) let ellipsisText = "";
ellipsisText=ellipsisText.substring(0,ellipsisText.length-1); list.task_list.forEach(item => {
list['ellipsis']=ellipsisText; ellipsisText += item.name + ",";
});
ellipsisText = ellipsisText.substring(0, ellipsisText.length - 1);
list["ellipsis"] = ellipsisText;
//树状图有子节点 //树状图有子节点
list['leaf']=false; list["leaf"] = false;
}) });
console.log(this.tableData) console.log(this.tableData);
}).catch((error)=>{
}) })
.catch(error => {});
}, },
add(){ add() {
this.addVisible=true; this.addVisible = true;
}, },
taskFormatter(row, column, cellValue, index){ taskFormatter(row, column, cellValue, index) {
let columnText=''; let columnText = "";
row.task_list.forEach(item=>{ row.task_list.forEach(item => {
columnText+=item.name+',' columnText += item.name + ",";
}) });
columnText=columnText.substring(0,columnText.length-1); columnText = columnText.substring(0, columnText.length - 1);
return columnText return columnText;
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize=val; this.pageSize = val;
this.query(); this.query();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page=val; this.page = val;
this.query(); this.query();
}, },
detail(index,row){ detail(index, row) {
this.detailVisible=true; this.detailVisible = true;
this.curentSubList=[]; this.curentSubList = [];
this.curentSubList=row.task_list; this.curentSubList = row.task_list;
}, },
delFun(index,row){ delFun(index, row) {
this.$confirm('此操作将永久删除该选项, 是否继续?', '提示', { this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}).then(() => { })
this.$api.resource.delStore({},row.unid).then(res=>{ .then(() => {
if(res.ecode==200){ this.$api.resource.delStore({}, row.unid).then(res => {
if (res.ecode == 200) {
this.$message({ this.$message({
type: 'success', type: "success",
message: '删除成功!' message: "删除成功!"
}); });
this.query(); this.query();
} }
});
}) })
.catch(() => {
}).catch(() => {
this.$message({ this.$message({
type: 'info', type: "info",
message: '已取消删除' message: "已取消删除"
}); });
}); });
} }
},
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.topCon{ .topCon {
background: $white-back-color; background: $white-back-color;
margin-bottom: 12px; margin-bottom: 12px;
height: 100px; height: 100px;
.left{ .left {
display: inline-block; display: inline-block;
margin: { margin: {
top: 22px; top: 22px;
left: 30px; left: 30px;
}; }
img{ img {
width:65px ; width: 65px;
height: 55px; height: 55px;
margin-right: 11px; margin-right: 11px;
} }
.topText{ .topText {
font-size:24px; font-size: 24px;
font-family:MicrosoftYaHeiUI-Bold,MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight:bold; font-weight: bold;
margin-bottom: 4px; margin-bottom: 4px;
} }
.bottomText{ .bottomText {
font-size:14px; font-size: 14px;
font-family:MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI;
} }
} }
.right{ .right {
float: right; float: right;
.topText{ .topText {
font-size:28px; font-size: 28px;
font-family:MicrosoftYaHeiUI-Bold,MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight:bold; font-weight: bold;
} }
.bottomText{ .bottomText {
position: relative; position: relative;
top: -1px; top: -1px;
font-size:14px; font-size: 14px;
font-family:MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI;
} }
} }
.textCon{ .textCon {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
.border{ .border {
display: inline-block; display: inline-block;
height: 40px; height: 40px;
border: { border: {
left: 2px solid $border-color; left: 2px solid $border-color;
};
} }
.rightBox{ }
.rightBox {
margin-top: 14px; margin-top: 14px;
display: inline-block; display: inline-block;
img{ img {
margin:{ margin: {
top:15px; top: 15px;
right: 22px; right: 22px;
} }
} }
} }
.rightBox:nth-of-type(1){ .rightBox:nth-of-type(1) {
img{ img {
width: 34px; width: 34px;
height: 34px; height: 34px;
} }
.textCon{ .textCon {
margin-right:114px ; margin-right: 114px;
} }
} }
.rightBox:nth-of-type(2){ .rightBox:nth-of-type(2) {
position: relative; position: relative;
top: 4px; top: 4px;
img{ img {
width: 40px; width: 40px;
height: 40px; height: 40px;
margin-left: 102px; margin-left: 102px;
} }
.textCon{ .textCon {
margin-right:101px ; margin-right: 101px;
} }
} }
.rightBox:nth-of-type(3){ .rightBox:nth-of-type(3) {
img{ img {
width: 34px; width: 34px;
height: 35px; height: 35px;
margin-left: 104px; margin-left: 104px;
} }
.textCon{ .textCon {
margin-right:184px ; margin-right: 184px;
}
} }
} }
.title{ }
.title {
font-size: 18px; font-size: 18px;
margin-bottom: 6px; margin-bottom: 6px;
} }
.maxHeight{ .maxHeight {
max-height: 400px; max-height: 400px;
overflow-y: auto; overflow-y: auto;
} }
.ellipsis{ .ellipsis {
display: inline-block; display: inline-block;
width: 200px; width: 200px;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.resourceDiv{ .resourceDiv {
display: inline-block; display: inline-block;
margin-left: 10%; margin-left: 10%;
span{ span {
margin-right: 5%; margin-right: 5%;
} }
} }
.content{ .content {
background: #FFFFFF; background: #ffffff;
} }
.inputBox{ .inputBox {
margin-right: 20px; margin-right: 20px;
} }
.selectBox{ .selectBox {
margin-right: 20px; margin-right: 20px;
} }
.editIcon{ .editIcon {
cursor: pointer; cursor: pointer;
color:#0069ff; color: #0069ff;
font-size:16px; font-size: 16px;
} }
.editIcon2{ .editIcon2 {
cursor: pointer; cursor: pointer;
color:#87d14b; color: #87d14b;
font-size:16px; font-size: 16px;
} }
.playIcon{ .playIcon {
cursor: pointer; cursor: pointer;
color:#34b3a2; color: #34b3a2;
font-size:16px; font-size: 16px;
} }
.pauseIcon{ .pauseIcon {
cursor: pointer; cursor: pointer;
color:#ffc62e; color: #ffc62e;
font-size:14px; font-size: 14px;
} }
.delIcon{ .delIcon {
cursor: pointer; cursor: pointer;
color:#f2365a; color: #f2365a;
font-size:16px; font-size: 16px;
} }
</style> </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,7 +21,7 @@ ...@@ -21,7 +21,7 @@
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"
......
...@@ -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">
<div>
<el-radio <el-radio
class="radio" class="radio"
:label="0" :label="0"
:style="lineRadioStyle" :style="lineRadioStyle"
v-if="drawState == 1" v-if="drawState == 1"
>直线</el-radio >直线</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(){
...@@ -310,7 +309,6 @@ export default { ...@@ -310,7 +309,6 @@ export default {
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">
<el-tooltip
class="item"
effect="dark"
:content="taskInfo.param_status == 0 ? '运行中' : '下发中'"
placement="top"
>
<span @click="setParam(scope.row, scope.$index)">参数设置</span> <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> <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 @click="setDemarcate(scope.row, scope.$index)"
>标定设置</span >标定设置</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"),
......
...@@ -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" }]
} }
}; };
}, },
...@@ -190,7 +204,6 @@ export default { ...@@ -190,7 +204,6 @@ export default {
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,6 +265,7 @@ export default { ...@@ -255,6 +265,7 @@ 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 => {
if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!"
...@@ -262,6 +273,12 @@ export default { ...@@ -262,6 +273,12 @@ export default {
this.tableData.splice(index, 1); this.tableData.splice(index, 1);
this.checkvckan(); this.checkvckan();
this.$store.commit("setocxstate", 1); 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) {
......
...@@ -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!