Commit fea99263 by 潘建波

提交导入少token问题

1 parent c5d19691
{"commit":"dca6496e41d3bec96878153d5a1559f82c362cf0","commitDate":"2021-7-2 10:31","buildDate":"2021-7-2 14:4","version":"2.1.0","info":"【NEW】增加配置导入 token 【BUG】修改删除判定线导致车道属性丢失"}
\ No newline at end of file
{"commit":"c5d19691ac1b1f4dbf13ab54d0ee6cdbd7922f34","commitDate":"2021-7-2 14:45","buildDate":"2021-7-5 15:2","version":"2.1.0","info":"【BUG】账号锁定不生效"}
\ No newline at end of file
......@@ -21,9 +21,9 @@ export default {
this.$store.dispatch("GetMenuRole", menus).then(res => {});
}
let token = localStorage.getItem("atoken");
// if (!token) {
// this.$router.push("/").catch(err => {err});
// }
if (!token) {
this.$router.push("/").catch(err => {err});
}
},
mounted() {
window.videoEquitTableHeight = document.body.clientHeight - 142 + "px";
......
......@@ -23,5 +23,11 @@ export default {
},
ddlogin:(params) => {
return api.get(urls.ddlogin,params)
},
getloginset(params){
return api.get(urls.loginset,params)
},
loginset(params){
return api.post(urls.loginset,params)
}
};
import baseUrl from "../baseUrl";
export default {
login: baseUrl + "/api/v1/auth/users/login",
loginset: baseUrl + "/api/v1/auth/users/logininfo",
logout(userid){
return `${baseUrl}/api/v1/auth/users/${userid}/loginout`
},
......
<template>
<div class="setting-box">
<div class="search-box">
<el-col :span="4">
<el-input v-model="searchval"></el-input>
</el-col>
<el-col :span="2" class="ml10">
<el-button type="primary">查询</el-button>
</el-col>
<el-col :span="8" style="float:right">
<span class="resource-box">
<span class="title">可用分析资源:</span>
<span class="num">{{ workers.video_free }}</span>
</span>
<span class="resource-box">
<span class="title">在用分析资源:</span>
<span class="num">{{ workers.video_busy }}</span>
</span>
</el-col>
</div>
<!-- 外层内容 -->
<div class="content-box" id="eqcontentbox">
<div class="left-box">
<div
class="master-box"
v-if="devData.length > 0"
@click="getSubDev(devData[0])"
>
<div>{{ devData[0].device_name }}</div>
<div>{{ devData[0].out_ip }}</div>
</div>
<div class="submast-box">
<div
:class="{ 'submast-item': true, 'top-line': true,'oneline':subDevData.length == 1 }"
v-for="(subitem, index) in subDevData"
:key="index"
ref="subitem"
@click.stop="getleval($event, index, subitem)"
:style="
`background:rgba(${setsubcolor(
index
)},.2);borderColor:rgb(${setsubcolor(index)})`
"
>
<div
:class="{ 'sub-line': index == curindex && slaveData.length > 0 }"
:style="`background:${curlevalbordercolor}`"
></div>
<div>{{ subitem.device_name }}</div>
<div>{{ subitem.out_ip }}</div>
</div>
</div>
<!-- 叶子节点 -->
<div
v-if="istop && slaveData.length > 0"
:style="`top:${topheihgt + 1}px;left:${loopitem * 14 + 00}px`"
v-for="(loopitem, loopindex) in Math.ceil(slaveData.length / 6)"
:key="loopindex"
class="leval-box"
>
<span
class="leval-top-line"
:style="`background:${curlevalbordercolor}`"
></span>
<div
:class="{
'leval-submast-item': true,
'top-line': istop,
'bottom-line': !istop,
offline: item.online == 0
}"
v-for="(item, cindex) in setslaveData(slaveData, loopindex)"
:key="cindex"
:style="
`background:${curlevalcolor};borderColor:${curlevalbordercolor}`
"
>
<span
class="left-line"
:style="`background:${curlevalbordercolor}`"
></span>
<span
class="vertical-line"
:style="`background:${curlevalbordercolor}`"
></span>
<div>{{ item.device_name }}</div>
<div>{{ item.in_ip }}</div>
</div>
</div>
<div
v-if="!istop && slaveData.length > 0"
:style="`bottom:${bottomHeight + 5}px;left:${loopitem * 14 + 11}px`"
v-for="(loopitem, loopindex) in Math.ceil(slaveData.length / 6)"
:key="loopitem"
class="leval-bottom-box"
>
<span
class="leval-bottom-line"
:style="`background:${curlevalbordercolor}`"
></span>
<div
ref="submast"
:class="{
'leval-submast-item': true,
'top-line': istop,
'bottom-line': !istop,
offline: item.online == 0
}"
v-for="(item, xindex) in setslaveData(slaveData, loopindex)"
:key="xindex"
:style="
`background:${curlevalcolor};borderColor:${curlevalbordercolor}`
"
>
<span
class="left-line"
:style="`background:${curlevalbordercolor}`"
></span>
<span
class="vertical-line"
:style="`background:${curlevalbordercolor}`"
></span>
<div>{{ item.device_name }}</div>
<div>{{ item.in_ip }}</div>
</div>
</div>
</div>
<div class="right-box">
<div class="info-box">
<div class="info-title">
<span class="icon el-icon-star-off"></span>
<span class="title">设备信息</span>
</div>
<div class="info-content">
<div class="con-item">
<span class="con-label">平台类型:</span>
<span class="con-text"></span>
</div>
<div class="con-item">
<span class="con-label">设备类型:</span>
<span class="con-text"></span>
</div>
<div class="con-item">
<span class="con-label">设备名称:</span>
<span class="con-text">{{ curDevData.device_name }}</span>
</div>
<div class="con-item">
<span class="con-label">设备ID:</span>
<span class="con-text">{{ curDevData.device_id }}</span>
</div>
<div class="con-item">
<span class="con-label">内网信息:</span>
<span class="con-text">{{ curDevData.in_ip }}</span>
</div>
<div class="con-item">
<span class="con-label">外网信息:</span>
<span class="con-text">{{ curDevData.out_ip }}</span>
</div>
</div>
</div>
<div class="info-box">
<div class="info-title">
<span class="icon el-icon-star-off"></span>
<span class="title">系统版本</span>
</div>
<div class="info-content">
<div class="con-item">
<span class="con-label">系统版本:</span>
<span class="con-text">{{
curDevData.system_version ? curDevData.system_version : "无"
}}</span>
</div>
<div class="con-item">
<span class="con-label">算法版本:</span>
<span class="con-text">{{
curDevData.algorithm_version
? curDevData.algorithm_version
: "无"
}}</span>
</div>
<div class="con-item">
<span class="con-label">软件版本:</span>
<span class="con-text">{{
curDevData.software_version ? curDevData.software_version : "无"
}}</span>
</div>
<div class="con-item">
<span class="con-label">固件版本:</span>
<span class="con-text">{{
curDevData.firmware_version ? curDevData.firmware_version : "无"
}}</span>
</div>
</div>
</div>
<div class="info-box">
<div class="info-title">
<span class="icon el-icon-star-off"></span>
<span class="title">系统信息</span>
</div>
<div class="info-content">
<div class="con-item">
<span class="con-label">分析资源数:</span>
<span class="con-text">{{
curDevData.picture_total
? parseInt(curDevData.picture_total) +
parseInt(curDevData.video_total)
: curDevData.video_total
? parseInt(curDevData.picture_total) +
parseInt(curDevData.video_total)
: 0
}}</span>
</div>
<div class="con-item">
<span class="con-label">已用资源数:</span>
<span class="con-text">{{
curDevData.picture_busy
? parseInt(curDevData.picture_busy) +
parseInt(curDevData.video_busy)
: curDevData.video_busy
? parseInt(curDevData.picture_busy) +
parseInt(curDevData.video_busy)
: 0
}}</span>
</div>
<div class="con-item">
<span class="con-label">离线资源数:</span>
<span class="con-text">{{
curDevData.picture_free
? parseInt(curDevData.picture_free) +
parseInt(curDevData.video_free)
: curDevData.video_free
? parseInt(curDevData.picture_free) +
parseInt(curDevData.video_free)
: 0
}}</span>
</div>
</div>
</div>
</div>
</div>
<div style="clear: both;"></div>
</div>
</template>
<script>
export default {
data() {
return {
treeData: [],
subDevData: [],
workers: {
video_free: 0,
video_busy: 0
},
topheihgt: 120,
searchval: "",
styleheight: 0,
istop: true,
levallength: 5,
curindex: -1,
curlevalcolor: "#f0f0f0",
curlevalbordercolor: "#f0f0f0",
parentData: {},
slaveData: [],
devData: [],
submastcolor: [
"48,210,255",
"86,183,202",
"237,140,36",
"181,184,41",
"104,182,69",
"105,199,187",
"71,157,248",
"0,105,255",
"116,96,238",
"232,84,30"
],
curDevData: {},
defaultProps: {
children: "childs",
label: "device_name"
},
bottomHeight: 0,
stylebottom: {},
dev_unid: localStorage.getItem("dev_unid")
};
},
mounted() {
this.styleheight = 55 * 6;
this.subDevData = 0;
},
created() {
this.dataInit();
this.getDevStatus();
},
methods: {
getleval(ev, index, dev) {
this.curDevType = "sub";
let obj = {
parent_id: dev.device_id
};
this.curDevData = dev;
this.$api.device.getSubdev(this.parentData, obj).then(res => {
this.slaveData = res.list_data;
var eqc = document.getElementById("eqcontentbox").clientHeight;
this.curindex = index;
this.topheihgt = this.$refs.subitem[index].offsetTop + 70 + 30;
if (index === 2) {
this.topheihgt = this.$refs.subitem[index].offsetTop + 70 + 29;
}
if (this.topheihgt > 340) {
this.istop = false;
} else {
this.istop = true;
}
this.bottomHeight = eqc - this.$refs.subitem[index].offsetTop - 62;
if (index % 3 == 0) {
this.bottomHeight = eqc - this.$refs.subitem[index].offsetTop - 61;
}
this.curlevalcolor = this.$refs.subitem[index].style.backgroundColor;
this.curlevalbordercolor = this.$refs.subitem[index].style.borderColor;
});
},
setsubcolor(index) {
let color = "";
if (index >= 10) {
let c = String(index);
let i = Number(c[c.length - 1]);
color = this.submastcolor[i];
} else {
color = this.submastcolor[index];
}
return color;
},
dataInit: function() {
this.$api.device.getDev().then(res => {
this.parentData = res[0].dev_unid;
this.getDev();
});
},
getDev() {
this.$api.device.getSubdev(this.parentData).then(res => {
this.devData = res.list_data;
this.curDevType = "master";
this.curDevData = res.list_data[0];
});
},
getSubDev(dev) {
let obj = {
parent_id: dev.device_id
};
this.$api.device.getSubdev(this.parentData, obj).then(res => {
this.subDevData = res.list_data;
});
},
setslaveData(data, index) {
return data.slice(index * 6, 6 * (index + 1));
},
getChild(id) {
this.$api.resource
.getDevsName(
{
limit: 9999,
offset: 0,
parent_id: id
},
this.dev_unid
)
.then(res => {
this.treeData.forEach(item => {
if (item.device_id == id) {
this.treeData.childs = res.list_data;
}
});
})
.catch(error => {});
},
handleNodeClick(data) {
console.log(data);
},
getDevStatus() {
this.$api.device.getDevStatus(this.dev_unid).then(res => {
this.workers = res.works;
});
}
}
};
</script>
<style scoped="scoped" lang="scss">
.setting-box {
height: calc(100% - 58.5px);
width: 99%;
margin: 1.5vh auto 0;
background: #fff;
overflow: hidden;
border-radius: 2px;
}
.content-box {
display: flex;
height: 100%;
position: relative;
}
.search-box {
padding: 10px;
border-bottom: 1vh solid #f5f7f9;
overflow: hidden;
}
.left-box {
overflow: auto;
width: 73vw;
position: relative;
height: 100%;
margin: 0 0 12vh 0;
}
.left-box::-webkit-scrollbar {
display: none;
}
.right-box {
width: 20vw;
height: 100%;
border-left: 10px solid #f5f7f9;
}
.master-box {
position: absolute;
height: 40px;
width: 140px;
text-align: center;
background: rgba(18, 62, 108, 0.2);
border: 1px solid rgba(18, 62, 108, 1);
border-radius: 5px;
left: 30px;
top: 25px;
cursor: pointer;
}
.submast-box {
position: absolute;
left: 200px;
top: 70px;
padding: 0 0 100px 0;
}
.submast-item,
.leval-submast-item {
position: relative;
height: 40px;
width: 140px;
text-align: center;
border-radius: 5px;
margin-top: 14px;
border: 1px solid #333;
cursor: pointer;
}
.submast-item::before {
content: "";
display: block;
position: absolute;
left: -97px;
top: 20px;
background: #123e6c;
width: 97px;
height: 1px;
}
.submast-item::after {
content: "";
display: block;
position: absolute;
left: -97px;
background: #123e6c;
width: 1px;
height: 90px;
}
.leval-submast-item .left-line {
display: block;
position: absolute;
left: -5vw;
top: 2.5vh;
background: #123e6c;
width: 5vw;
height: 1px;
}
.leval-submast-item .vertical-line {
position: absolute;
left: -3vw;
top: 2.1vh;
background: #123e6c;
width: 1px;
height: 6.5vh;
}
.top-line:first-child::after {
height: 10vh;
top: -1.5vh;
}
.top-line .vertical-line {
height: 106px;
top: -25px;
}
.oneline:first-child::after{
height: 35px!important;
}
.submast-item:last-child::after {
height: 0;
}
.leval-box {
position: absolute;
}
.leval-bottom-box {
position: absolute;
}
.leval-bottom-box .left-line,
.leval-box .left-line {
left: -3vw;
background: #ed8c24;
width: 3vw;
height: 1px;
}
.leval-bottom-box .vertical-line,
.leval-box .vertical-line {
left: -3vw;
background: #ed8c24;
}
.leval-submast-item:last-child .vertical-line {
height: 0;
}
.leval-bottom-box .bottom-line .vertical-line {
height: 6.3vh;
top: 2.5vh;
}
.sub-line {
position: absolute;
height: 1px;
width: 83px;
right: -83px;
top: 20px;
}
.leval-top-line {
position: absolute;
height: 1px;
width: 16.1vw;
left: -5vw;
top: -1.1vh;
background: #ed8c24;
}
.leval-bottom-line {
position: absolute;
height: 1px;
width: 15.1vw;
left: -4vw;
bottom: -3.8vh;
background: #ed8c24;
}
.leval-bottom-box:last-child .leval-bottom-line {
width: 0;
}
.leval-box:last-child .leval-top-line {
width: 0;
}
.info-box {
padding: 1.5vw 0 0 1.5vw;
overflow: hidden;
}
.info-title .icon {
display: inline-block;
height: 30px;
width: 30px;
border-radius: 30px;
background: rgba(59, 183, 255, 1);
text-align: center;
line-height: 30px;
font-size: 20px;
color: #fff;
}
.info-title .title {
padding: 0 0 0 20px;
vertical-align: top;
font-size: 16px;
color: #000;
}
.info-content {
margin-left: 50px;
font-size: 14px;
color: #000;
}
.offline {
border: 1px solid rgba(65, 60, 60, 0.2) !important;
background: rgba(65, 60, 60, 0.2) !important;
}
.resource-box {
margin-left: 40px;
display: inline-block;
padding-top: 4px;
}
.resource-box .title {
color: #000;
padding-right: 10px;
}
.resource-box .num {
font-size: 18px;
font-weight: 600;
}
</style>
......@@ -78,6 +78,11 @@
align="center"
label="操作用户名">
</el-table-column>
<el-table-column
prop="ipAddress"
align="center"
label="操作IP">
</el-table-column>
<el-table-column
prop="remark"
align="center"
......
<template>
<div class="sys-loginbox">
<el-form label-position="left" label-width="120px" :model="loginfrom">
<el-form-item label="登录锁定次数:">
<el-input v-model="loginfrom.lockTimes" type="number">
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item label="登录锁定时长:">
<el-input v-model="loginfrom.lockDuration" type="number">
<template slot="append">分钟</template>
</el-input>
</el-form-item>
<el-form-item>
<el-button class="savebtn" type="primary" @click="onSubmit">保存</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
loginfrom:{
lockTimes:"",
lockDuration:""
}
}
},
methods:{
onSubmit(){
this.$api.login.loginset(this.loginfrom).then(res => {
if(res.ecode == "200") {
this.$message({
type:"success",
message:res.enote
})
} else {
this.$message({
type:"error",
message:res.enote
})
}
})
},
getSetInfo(){
this.$api.login.getloginset().then(res => {
debugger
if(res != "" || res.length > 0) {
this.loginfrom = res[0];
}
})
}
},
created(){
this.getSetInfo();
}
}
</script>
<style lang="stylus" scoped>
.sys-loginbox {
width: 400px;
margin-left: 20px;
}
.savebtn{
}
</style>
\ No newline at end of file
......@@ -171,6 +171,7 @@
:action="authexurl"
:on-success="authsuccessback"
:data="updata"
:headers="headers"
:on-error="onerrorback"
>
<el-button
......@@ -207,8 +208,11 @@ export default {
name:'',
vchan_type:"authfile"
},
headers:{
authorization:localStorage.getItem("atoken")
},
timeArr: [],
exurl: window.config.https? `https://${location.host}/api/v1/devconf_fx/restore"`:`"http://${location.host}/api/v1/devconf_fx/restore`,
exurl: window.config.https? `https://${location.host}/api/v1/devconf_fx/restore`:`"http://${location.host}/api/v1/devconf_fx/restore`,
authexurl:window.config.https?`https://${location.host}/api/v1/devconf_fx/devs/${localStorage.getItem("dev_unid")}/vfile_vchans`:`http://${location.host}/api/v1/devconf_fx/devs/${localStorage.getItem("dev_unid")}/vfile_vchans`,
file: null,
dev_unid: localStorage.getItem("dev_unid"),
......
......@@ -8,8 +8,11 @@
<el-tab-pane label="系统维护" name="second">
<sytemset></sytemset>
</el-tab-pane>
<el-tab-pane label="展示设置" name="third">
<!-- <el-tab-pane label="展示设置" name="third">
<showset></showset>
</el-tab-pane> -->
<el-tab-pane label="登录设置" name="four" v-if="uname=='admin'">
<setlogin></setlogin>
</el-tab-pane>
</el-tabs>
</div>
......@@ -19,17 +22,20 @@
import proofreadtime from "./systemComponents/proofreadtime";
import sytemset from "./systemComponents/sytemSet";
import showset from "./systemComponents/showSet";
import setlogin from './systemComponents/setlogin.vue'
export default {
data() {
return {
activeName: "first",
height: ""
height: "",
uname:localStorage.getItem('uname'),
};
},
components: {
proofreadtime,
sytemset,
showset
showset,
setlogin
},
mounted() {
this.height = document.body.clientHeight - 140 + "px";
......
......@@ -369,7 +369,8 @@ export default {
},
clockuser(index, row){
this.$confirm("此操作将锁定该用户, 是否继续?", "提示", {
let text = row.lock?"此操作将解锁该用户":"此操作将锁定该用户"
this.$confirm(text + ", 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......
......@@ -37,7 +37,7 @@
:on-success="sucessfile"
:file-list="fileList"
:on-error="errorfile"
:headers="updata"
:headers="headers"
>
<el-button size="small" slot="trigger" type="primary"
>点击上传</el-button
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!