Commit a03847f8 by 潘建波

【NEW】20181手动拉取

1 parent fea99263
{"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 \ No newline at end of file
{"commit":"fea992631da194b9776cba2116a9162aa351378e","commitDate":"2021-7-5 15:22","buildDate":"2021-7-15 11:45","version":"2.1.0","info":"提交导入少token问题"}
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ import axios from "axios"; ...@@ -4,7 +4,7 @@ import axios from "axios";
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 = window.config.https?"https://192.168.9.245:20070":"http://192.168.9.245:20080"; // 测试环境url baseUrl = window.config.https?"https://192.168.9.245:20070":"http://192.168.9.233: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';
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
let url = ""; let url = "";
switch (devname) { switch (devname) {
case "外部设备": case "外部设备":
url = "/vchan_struct?vchan_type=extern"; url = "/devconf_fx/device_catalogs";
break; break;
case "内部设备": case "内部设备":
url = "/vchan_struct?vchan_type=camera"; url = "/vchan_struct?vchan_type=camera";
...@@ -26,11 +26,12 @@ export default { ...@@ -26,11 +26,12 @@ export default {
url = "/vchans?vchan_type=vfile"; url = "/vchans?vchan_type=vfile";
break; break;
} }
if(window.config.bigtree) { if(window.config.bigtree && devname == "外部设备") {
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}` //ztree版本 return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}` //ztree版本
} else if(devname == "外部设备"){
return api.get(`${baseUrl}/api/v1/${url}`, params);
} else { } else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`, params); return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`, params);
} }
}, },
...@@ -81,5 +82,11 @@ export default { ...@@ -81,5 +82,11 @@ export default {
}, },
gpuresource:(params)=> { gpuresource:(params)=> {
return api.get(`${baseUrl}/api/v1/gpu/resource`,params) return api.get(`${baseUrl}/api/v1/gpu/resource`,params)
},
getcatadev:(params)=> {
return api.get(`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params)
},
postcatadev:(params)=> {
return api.post(`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params)
} }
}; };
...@@ -126,5 +126,15 @@ export default { ...@@ -126,5 +126,15 @@ export default {
`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`, `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`,
params params
); );
},
getcatalogs(){
return api.get(
`${baseUrl}/api/v1/devconf_fx/device_catalogs`
);
},
refreshcatlog(){
return api.post(
`${baseUrl}/api/v1/devconf_fx/device_catalogs`
);
} }
}; };
...@@ -146,9 +146,12 @@ export default { ...@@ -146,9 +146,12 @@ export default {
this.loginMount(res, "user"); this.loginMount(res, "user");
} else { } else {
if (res.ecode == "1000") { if (res.ecode == "1000") {
debugger
sessionStorage.setItem("user_unid", res.user_unid); sessionStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("atoken", res.atoken);
this.$router.push("/resetpass") this.$router.push("/resetpass")
} else { } else {
this.$logs.oplogs(res, "serv_login", res.enote);
this.$message({ this.$message({
type: "error", type: "error",
message: res.enote, message: res.enote,
......
...@@ -107,6 +107,7 @@ export default { ...@@ -107,6 +107,7 @@ export default {
message: res.enote message: res.enote
}); });
} else { } else {
this.$logs.oplogs(res, "serv_login", `修改密码${res.enote}`);
this.$message({ this.$message({
type: "error", type: "error",
message: res.enote message: res.enote
......
...@@ -75,13 +75,13 @@ ...@@ -75,13 +75,13 @@
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip <el-tooltip
content="锁定" :content="scope.row.lock==null||scope.row.lock?'解锁':'锁定'"
placement="bottom" placement="bottom"
effect="light" effect="light"
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
:class="{'el-icon-lock editIcon':scope.row.lock,'el-icon-unlock delIcon':scope.row.lock==null||scope.row.lock==false}" :class="{'el-icon-lock delIcon':scope.row.lock,'el-icon-unlock editIcon':scope.row.lock==null||scope.row.lock==false}"
@click="clockuser(scope.$index, scope.row)" @click="clockuser(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -358,15 +358,25 @@ export default { ...@@ -358,15 +358,25 @@ export default {
}, },
//注销用户 //注销用户
logoutuser(index,row){ logoutuser(index,row){
localStorage.removeItem("menu"); localStorage.removeItem("menu");
localStorage.removeItem("curmenu"); localStorage.removeItem("curmenu");
let uid = sessionStorage.getItem("user_unid"); let uid = sessionStorage.getItem("user_unid");
this.$api.login.logout(row.user_unid).then((res) => { this.$api.login.logout(row.user_unid).then((res) => {
this.$store.commit(types.ATOKEN, ""); if(res.ecode == "200") {
this.$logs.oplogs("", "serv_auth", `注销用户${row.username}`); this.$message({
localStorage.removeItem("atoken"); type: "success",
message: "注销成功!"
});
this.$logs.oplogs("", "serv_auth", `注销用户${row.username}`);
} else {
this.$message({
type: "error",
message: "注销失败!"
});
this.$logs.oplogs("", "serv_auth", `注销用户${row.username}失败`);
}
// localStorage.removeItem("atoken");
}); });
}, },
clockuser(index, row){ clockuser(index, row){
let text = row.lock?"此操作将解锁该用户":"此操作将锁定该用户" let text = row.lock?"此操作将解锁该用户":"此操作将锁定该用户"
...@@ -381,13 +391,13 @@ export default { ...@@ -381,13 +391,13 @@ export default {
user_type:'user' user_type:'user'
} }
this.$api.ops.lockUser(row.user_unid, params).then(res => { this.$api.ops.lockUser(row.user_unid, params).then(res => {
if (!res.ecode) { if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: params.lock?"锁定成功!":"解锁成功!" message: params.lock?"锁定成功!":"解锁成功!"
}); });
this.getTableList(); this.getTableList();
this.$logs.oplogs(res,'serv_auth',`删除用户${row.username}`); this.$logs.oplogs(res,'serv_auth',`${params.lock?"锁定成功!":"解锁成功!"}${row.username}`);
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<el-form <el-form
label-position="left" label-position="left"
label-width="120px" label-width="120px"
:model="addVideoParam" :model="initParam"
ref="cameraDialog" ref="cameraDialog"
inline-message inline-message
hide-required-asterisk hide-required-asterisk
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
<el-input v-model="initParam.addr_name" disabled></el-input> <el-input v-model="initParam.addr_name" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="IP地址"> <el-form-item label="IP地址">
<el-input v-model="addVideoParam.ip"></el-input> <el-input v-model="initParam.ip"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="端口" prop="port"> <el-form-item label="端口" prop="port">
<el-input v-model="addVideoParam.port"></el-input> <el-input v-model="initParam.port"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="协议"> <el-form-item label="协议">
<el-select <el-select
v-model="addVideoParam.video_protocol_id" v-model="initParam.video_protocol_id"
placeholder="请选择协议" placeholder="请选择协议"
:popper-append-to-body="false" :popper-append-to-body="false"
> >
...@@ -40,25 +40,25 @@ ...@@ -40,25 +40,25 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="取流地址" prop="video_source_url"> <el-form-item label="取流地址" prop="video_source_url">
<el-input v-model="addVideoParam.video_source_url"></el-input> <el-input v-model="initParam.video_source_url"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户名"> <el-form-item label="用户名">
<el-input v-model="addVideoParam.user_name"></el-input> <el-input v-model="initParam.user_name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码"> <el-form-item label="密码">
<el-input v-model="addVideoParam.password"></el-input> <el-input v-model="initParam.password"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="经度"> <el-form-item label="经度">
<el-input v-model="addVideoParam.longitude"></el-input> <el-input v-model="initParam.longitude"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="纬度"> <el-form-item label="纬度">
<el-input v-model="addVideoParam.latitude"></el-input> <el-input v-model="initParam.latitude"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="扩展字段1"> <el-form-item label="扩展字段1">
<el-input v-model="addVideoParam.extend_1"></el-input> <el-input v-model="initParam.extend_1"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="扩展字段2"> <el-form-item label="扩展字段2">
<el-input v-model="addVideoParam.extend_2"></el-input> <el-input v-model="initParam.extend_2"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
export default { export default {
data() { data() {
return { return {
addVideoParam:{},
initParam: {}, initParam: {},
cameraAddVisible: false, cameraAddVisible: false,
type: "", type: "",
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<div class="sync-tree scrollbar"> <div class="sync-tree scrollbar">
<el-tree <el-tree
ref="synctree" ref="synctree"
v-if="isLoadingTree"
:accordion="true" :accordion="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
:data="syncTreeData" :data="syncTreeData"
...@@ -10,7 +9,18 @@ ...@@ -10,7 +9,18 @@
node-key="id" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="handleNodeClick" @node-click="handleNodeClick"
></el-tree> >
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>
<span class="tree-label">{{
data.label
}}</span>
</span>
<span class="tree-btn" v-if="node.label=='平台同步资源'">
<i :class="{'el-icon-refresh':true,'animterefresh':refreshload}" @click.stop="nodeRefreshClick(node, data)"></i>
</span>
</span>
</el-tree>
</div> </div>
</template> </template>
...@@ -20,6 +30,7 @@ export default { ...@@ -20,6 +30,7 @@ export default {
data() { data() {
return { return {
isLoadingTree: false, isLoadingTree: false,
refreshload:false,
syncTreeData: [ syncTreeData: [
{ {
id: "0", id: "0",
...@@ -48,7 +59,6 @@ export default { ...@@ -48,7 +59,6 @@ export default {
components: {}, components: {},
watch: { watch: {
filterText(val) { filterText(val) {
debugger;
// this.$refs.synctree.filter(val); // this.$refs.synctree.filter(val);
setTimeout(() => { setTimeout(() => {
this.$refs.synctree.filter(val); this.$refs.synctree.filter(val);
...@@ -61,6 +71,7 @@ export default { ...@@ -61,6 +71,7 @@ export default {
methods: { methods: {
initTree(data) { initTree(data) {
this.syncTreeData[0].children = data; this.syncTreeData[0].children = data;
this.refreshload = false;
this.isLoadingTree = true; this.isLoadingTree = true;
}, },
filterNode(value, data) { filterNode(value, data) {
...@@ -68,8 +79,10 @@ export default { ...@@ -68,8 +79,10 @@ export default {
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
handleNodeClick(data) { handleNodeClick(data) {
if (data.label === "平台同步资源") return; debugger
this.$emit("syncTable", data); if (data.label !== "平台同步资源" && data.is_leaf) {
this.$emit("syncTable", data);
};
}, },
handleRefresh(s, d, n) { handleRefresh(s, d, n) {
// console.log(s, d, n) // console.log(s, d, n)
...@@ -83,6 +96,10 @@ export default { ...@@ -83,6 +96,10 @@ export default {
} }
]; ];
this.$parent.getSyncTree(); this.$parent.getSyncTree();
},
nodeRefreshClick(){
this.refreshload = true;
this.$emit('refreshData')
} }
} }
}; };
...@@ -93,4 +110,14 @@ export default { ...@@ -93,4 +110,14 @@ export default {
/* max-height: 216px; */ /* max-height: 216px; */
/* overflow: hidden; */ /* overflow: hidden; */
} }
.animterefresh{
animation:turn 1s linear infinite;
}
@keyframes turn{
0%{-webkit-transform:rotate(0deg);}
25%{-webkit-transform:rotate(90deg);}
50%{-webkit-transform:rotate(180deg);}
75%{-webkit-transform:rotate(270deg);}
100%{-webkit-transform:rotate(360deg);}
}
</style> </style>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
v-model="searchText" v-model="searchText"
> >
</el-input> </el-input>
<SyncTree ref="syncRef" :filterText="searchText" :treeDatas="syncTree" @syncTable="syncTable"> <SyncTree ref="syncRef" :filterText="searchText" :treeDatas="syncTree" @syncTable="syncTable" @refreshData="refreshData">
</SyncTree> </SyncTree>
<cameraTree <cameraTree
:filterText="searchText" :filterText="searchText"
...@@ -279,16 +279,10 @@ export default { ...@@ -279,16 +279,10 @@ export default {
}, },
getSyncTree() { getSyncTree() {
this.tableType = "sync"; this.tableType = "sync";
this.$api.resource this.$api.device.getcatadev()
.treeList(
{
vchan_type: "extern"
},
this.dev_unid
)
.then(m => { .then(m => {
if (m.vchan_struct.length > 0) { if (m.ecode == 200) {
var sync_data = this.syncBuildTree(m.vchan_struct); var sync_data = this.syncBuildTree(m.result.childs);
this.$refs.syncRef.initTree(sync_data); this.$refs.syncRef.initTree(sync_data);
} else { } else {
let emptyChild = []; let emptyChild = [];
...@@ -324,13 +318,16 @@ export default { ...@@ -324,13 +318,16 @@ export default {
let newData = []; let newData = [];
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
let obj = {}; let obj = {};
obj["id"] = data[i].refid; obj["id"] = data[i].DeviceID;
obj["label"] = data[i].name === "" ? "未命名" : data[i].name; obj["label"] = data[i].Name === "" ? "未命名" : data[i].Name;
obj["typea"] = data[i].typea; obj["is_leaf"] = data[i].is_leaf;
obj["url"] = data[i].url; obj["ParentID"] = data[i].ParentID;
obj["root"] = "平台同步资源"; obj["ip"] = data[i].IPAddress;
obj["port"] = data[i].Port;
obj["latitude"] = data[i].Latitude;
obj["longitude"] = data[i].Longitude;
if (data[i].childs) { if (data[i].childs) {
obj["children"] = this.syncBuildChild(data[i].childs); obj["children"] = this.syncBuildTree(data[i].childs);
} else { } else {
obj["children"] = []; obj["children"] = [];
} }
...@@ -338,24 +335,33 @@ export default { ...@@ -338,24 +335,33 @@ export default {
} }
return newData; return newData;
}, },
syncBuildChild(data) { //重新拉取28181树形结构
var childData = []; refreshData(){
for (var i = 0; i < data.length; i++) { this.$api.device.postcatadev()
let obj = {}; .then(m => {
obj["id"] = data[i].refid; if (m.ecode == 200) {
obj["label"] = data[i].name === "" ? "未命名" : data[i].name; this.$message({
obj["typea"] = data[i].typea; type: 'success',
obj["url"] = data[i].url; message: m.enote
obj["root"] = "平台同步资源"; })
if (data[i].childs) { this.getSyncTree()
obj["children"] = this.syncBuildTree(data[i].childs); } else {
childData.push(obj); let emptyChild = [];
} else { this.$refs.syncRef.initTree(emptyChild);
obj["children"] = []; this.$message({
childData.push(obj); type: 'error',
} message: data
} })
return childData; }
})
.catch(err => {
console.log(err.message);
let emptyData = [];
// this.$message({
// type: 'error',
// message: '获取同步平台资源失败!' + err.message
// })
});
}, },
//处理树状图数据 //处理树状图数据
cameraBuildTree(data, orgObject, addrObject) { cameraBuildTree(data, orgObject, addrObject) {
......
...@@ -411,17 +411,16 @@ export default { ...@@ -411,17 +411,16 @@ export default {
.getDevtree(this.dev_unid, node.data.name, params) .getDevtree(this.dev_unid, node.data.name, params)
.then(data => { .then(data => {
// let node = require('../../assets/js/vchan_struct') // let node = require('../../assets/js/vchan_struct')
let vchans = data.vchan_struct || data.list_data; let vchans = data.vchan_struct || data.list_data || data.result.childs;
for (let i in vchans) { for (let i in vchans) {
const vchan = vchans[i]; const vchan = vchans[i];
vchan.leaf = vchan.leaf = vchan.is_leaf ||
vchan.typea == 1 ||
vchan.vchan_type == "camera" || vchan.vchan_type == "camera" ||
Boolean(vchan.vchan_refid); Boolean(vchan.vchan_refid);
vchan.disabled = !vchan.leaf; vchan.disabled = !vchan.leaf;
vchan.name = vchan.name =
vchan.name || vchan.org_name || vchan.vchan_name || "未命名"; vchan.name || vchan.org_name || vchan.vchan_name || vchan.Name ||"未命名";
vchan.leafNode = vchan.typea vchan.leafNode = vchan.DeviceID
? "extern" ? "extern"
: vchan.vchan_type === "vfile" : vchan.vchan_type === "vfile"
? "vfile" ? "vfile"
...@@ -429,7 +428,7 @@ export default { ...@@ -429,7 +428,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 || vchan.DeviceID;
} }
resolve(vchans); resolve(vchans);
this.checkvckan(); this.checkvckan();
...@@ -440,17 +439,18 @@ export default { ...@@ -440,17 +439,18 @@ export default {
const element = node.data.childs[i]; const element = node.data.childs[i];
// console.log(element.childs) // console.log(element.childs)
// element.leaf = (element.typea == 1&&element.childs&&element.childs.length < 1)|| element.vchan_type == "camera" ; // element.leaf = (element.typea == 1&&element.childs&&element.childs.length < 1)|| element.vchan_type == "camera" ;
element.leaf = element.typea == 1 || element.vchan_type == "camera" ; element.leaf = element.typea == 1 || element.vchan_type == "camera" || element.is_leaf;
element.disabled = !element.leaf; element.disabled = !element.leaf;
debugger
element.name = element.name =
element.name || element.org_name || element.vchan_name || "未命名"; element.name || element.org_name || element.vchan_name || element.Name || "未命名";
element.leafNode = element.typea element.leafNode = element.DeviceID
? "extern" ? "extern"
: element.vchan_type === "vfile" : element.vchan_type === "vfile"
? "vfile" ? "vfile"
: "camera"; : "camera";
} }
if (!node.data.childs.length) { if (!node.data.childs || !node.data.childs.length ) {
this.$message({ this.$message({
type: "info", type: "info",
message: "该组织下没有像机" message: "该组织下没有像机"
...@@ -476,7 +476,8 @@ export default { ...@@ -476,7 +476,8 @@ export default {
); );
}, },
vchanClick(node) { vchanClick(node) {
if (!node.refid && !node.vchan_refid) {
if (!node.refid && !node.vchan_refid && !node.DeviceID) {
return; return;
} }
try { try {
...@@ -519,7 +520,7 @@ export default { ...@@ -519,7 +520,7 @@ export default {
alert("播放地址不存在!"); alert("播放地址不存在!");
} }
} else { } else {
this.getSipSetting(node.refid); this.getSipSetting(node.DeviceID);
} }
// } else { // } else {
// this.getSendingCount = 1; // this.getSendingCount = 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!