Commit fad2f3bd by 夏新然

Merge branch 'fanxing' of http://git.keliuyun.com:55676/platform/fanxing_new into fanxing

2 parents b7de4728 fc2a6ee2
...@@ -18,8 +18,8 @@ export default { ...@@ -18,8 +18,8 @@ export default {
eventCates(params) { eventCates(params) {
return api.get(urls.eventCates, params); return api.get(urls.eventCates, params);
}, },
eventType(params, event_type_unid) { eventType(params, event_cate_unid) {
return api.get(urls.eventType(event_type_unid), params); return api.get(urls.eventType(event_cate_unid), params);
}, },
eventTypes(params, id) { eventTypes(params, id) {
return api.get(urls.eventTypes, params); return api.get(urls.eventTypes, params);
...@@ -32,5 +32,14 @@ export default { ...@@ -32,5 +32,14 @@ export default {
}, },
deleteEventType(params, event_unid) { deleteEventType(params, event_unid) {
return api.delete(urls.editEventType(event_unid), params); return api.delete(urls.editEventType(event_unid), params);
},
addTrafficCode(params, cate_unid) {
return api.post(urls.addTrafficCode(cate_unid), params);
},
editTrafficCode(params, cate_unid, code_unid) {
return api.post(urls.editTrafficCode(cate_unid, code_unid), params);
},
deleteTrafficCode(params, code_unid) {
return api.delete(urls.editTrafficCode(cate_unid, code_unid), params);
} }
}; };
...@@ -6,8 +6,8 @@ export default { ...@@ -6,8 +6,8 @@ export default {
menus: baseUrl + "/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus", menus: baseUrl + "/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus",
eventCates: baseUrl + "/api/v1/codes/event_cates", eventCates: baseUrl + "/api/v1/codes/event_cates",
eventTypes: baseUrl + "/api/v1/codes/event_types", eventTypes: baseUrl + "/api/v1/codes/event_types",
eventType(event_type_unid) { eventType(event_cate_unid) {
return `${baseUrl}/api/v1/codes/event_types?event_cate=${event_type_unid}`; return `${baseUrl}/api/v1/codes/event_types?event_cate=${event_cate_unid}`;
}, },
editEventType(event_unid) { editEventType(event_unid) {
return `${baseUrl}/api/v1/codes/event_types/${event_unid}`; return `${baseUrl}/api/v1/codes/event_types/${event_unid}`;
......
...@@ -95,15 +95,15 @@ export const asyncRouterMap = [ ...@@ -95,15 +95,15 @@ export const asyncRouterMap = [
}, },
component: resolve => require(["../views/search/xcycle.vue"], resolve) component: resolve => require(["../views/search/xcycle.vue"], resolve)
}, },
// { // {
// path: "/search/pedestrian", // path: "/search/pedestrian",
// name: "行人检索", // name: "行人检索",
// meta: { // meta: {
// icon: "el-icon-location" // icon: "el-icon-location"
// }, // },
// component: resolve => // component: resolve =>
// require(["../views/search/pedestrian.vue"], resolve) // require(["../views/search/pedestrian.vue"], resolve)
// }, // },
{ {
path: "/search/event", path: "/search/event",
name: "事件检索", name: "事件检索",
...@@ -123,19 +123,20 @@ export const asyncRouterMap = [ ...@@ -123,19 +123,20 @@ export const asyncRouterMap = [
{ {
path: "/search/traficflow", path: "/search/traficflow",
name: "流量检索", name: "流量检索",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
component: resolve => require(["../views/search/traficflow.vue"], resolve), component: resolve =>
}, require(["../views/search/traficflow.vue"], resolve)
// { }
// path: "/search/flow", // {
// name: "公共客流", // path: "/search/flow",
// meta: { // name: "公共客流",
// icon: "el-icon-location" // meta: {
// }, // icon: "el-icon-location"
// component: resolve => require(["../views/search/publicFlow.vue"], resolve), // },
// } // component: resolve => require(["../views/search/publicFlow.vue"], resolve),
// }
] ]
}, },
{ {
...@@ -146,48 +147,63 @@ export const asyncRouterMap = [ ...@@ -146,48 +147,63 @@ export const asyncRouterMap = [
icon: "el-icon-location" icon: "el-icon-location"
}, },
children: [ children: [
{ {
path: "/resource/video", path: "/resource/video",
name: "视频设备", name: "视频设备",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
component: resolve => require(["../views/resource/videoEquipment.vue"], resolve), component: resolve =>
}, require(["../views/resource/videoEquipment.vue"], resolve)
{ },
path: "/resource/equipment", {
name: "分析设备", path: "/resource/equipment",
meta: { name: "分析设备",
icon: "el-icon-location" meta: {
}, icon: "el-icon-location"
component: resolve => require(["../views/resource/analysis.vue"], resolve), },
}, component: resolve =>
{ require(["../views/resource/analysis.vue"], resolve)
path: "/resource/store_confs", },
name: "存储配置", {
meta: { path: "/resource/store_confs",
icon: "el-icon-location" name: "存储配置",
}, meta: {
component: resolve => require(["../views/resource/store_confs.vue"], resolve), icon: "el-icon-location"
}, },
{ component: resolve =>
path: "/resource/nationalStandard", require(["../views/resource/store_confs.vue"], resolve)
name: "国标配置", },
meta: { {
icon: "el-icon-location" path: "/resource/author",
}, name: "授权管理",
component: resolve => require(["../views/resource/nationalStandard.vue"], resolve), meta: {
}, icon: "el-icon-location"
{ },
path: "/resource/codes", component: resolve =>
name: "字典管理", require(["../views/resource/Author/author.vue"], resolve)
meta: { },
icon: "el-icon-location" {
}, path: "/resource/nationalStandard",
component: resolve => require(["../views/resource/Codes/codes.vue"], resolve), name: "国标配置",
}, meta: {
] icon: "el-icon-location"
},{ },
component: resolve =>
require(["../views/resource/nationalStandard.vue"], resolve)
},
{
path: "/resource/codes",
name: "字典管理",
meta: {
icon: "el-icon-location"
},
component: resolve =>
require(["../views/resource/Codes/codes.vue"], resolve)
}
]
},
{
path: "/ops", path: "/ops",
name: "系统运维", name: "系统运维",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
...@@ -195,50 +211,56 @@ export const asyncRouterMap = [ ...@@ -195,50 +211,56 @@ export const asyncRouterMap = [
icon: "el-icon-location" icon: "el-icon-location"
}, },
children: [ children: [
{ {
path: "/ops/equipment_manage", path: "/ops/equipment_manage",
name: "设备管理", name: "设备管理",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
component: resolve => require(["../views/ops/equipment_manage"], resolve), component: resolve =>
},{ require(["../views/ops/equipment_manage"], resolve)
path: "/ops/system_manage", },
name: "系统配置", {
meta: { path: "/ops/system_manage",
icon: "el-icon-location" name: "系统配置",
}, meta: {
component: resolve => require(["../views/ops/system_manage"], resolve), icon: "el-icon-location"
},{ },
path: "/ops/user_manage", component: resolve => require(["../views/ops/system_manage"], resolve)
name: "用户管理", },
meta: { {
icon: "el-icon-location" path: "/ops/user_manage",
}, name: "用户管理",
component: resolve => require(["../views/ops/user_manage.vue"], resolve), meta: {
},{ icon: "el-icon-location"
path: "/ops/role_manage", },
name: "角色管理", component: resolve => require(["../views/ops/user_manage.vue"], resolve)
meta: { },
icon: "el-icon-location" {
}, path: "/ops/role_manage",
component: resolve => require(["../views/ops/role_manage.vue"], resolve), name: "角色管理",
},{ meta: {
path: "/ops/batch_upgrade", icon: "el-icon-location"
name: "批量升级", },
meta: { component: resolve => require(["../views/ops/role_manage.vue"], resolve)
icon: "el-icon-location" },
}, {
component: resolve => require(["../views/ops/log_manage.vue"], resolve), path: "/ops/batch_upgrade",
},{ name: "批量升级",
path: "/ops/log_manage", meta: {
name: "日志管理", icon: "el-icon-location"
meta: { },
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",
] name: "日志管理",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/ops/log_manage.vue"], resolve)
}
]
} }
]; ];
const router = new VueRouter({ const router = new VueRouter({
......
<template>
<div class="contentBox">
<div class="content">
<div>
<span class="selectBox">
<el-select
v-model="curCateUnid"
placeholder="请选择"
@change="cateChange"
:popper-append-to-body="false"
>
<el-option
v-for="item in catesData"
:key="item"
:value="item.cate_unid"
:label="item.name"
></el-option>
</el-select>
</span>
<span class="addbox">
<el-button type="primary" @click="addcode">添加code</el-button>
</span>
</div>
<div class="mt10">
<el-table
height="574"
:data="tableData"
stripe
border
style="width: 100%"
>
<el-table-column
type="index"
align="center"
label="#"
width="40"
></el-table-column>
<el-table-column align="center" prop="code_unid" label="code_unid">
</el-table-column>
<el-table-column prop="code" align="center" label="code">
</el-table-column>
<el-table-column align="center" prop="name" label="名称">
</el-table-column>
<el-table-column align="center" prop="operation" label="操作">
<template slot-scope="scope">
<el-tooltip
content="编辑"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="iconfont icon-xiugai editIcon"
@click="editCode(scope.$index, scope.row)"
></span>
</el-tooltip>
<el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="iconfont icon-detail delIcon del-btn"
@click="deleteCode(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 28px;">
<el-pagination
style="float: right;"
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[20, 30, 50, 100, 200]"
layout="prev, pager, next,sizes"
:current-page="page"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:total="total"
>
</el-pagination>
<div style="clear: both;"></div>
</div>
</div>
</div>
<el-dialog title="设置CODE" :visible.sync="detailVisible" width="400px">
<el-form
ref="trfficform"
:model="codeData"
label-position="left"
label-width="80px"
>
<el-form-item
label="类型"
prop="catename"
:rules="[
{ required: true, message: '类型不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.catename" disabled></el-input>
</el-form-item>
<el-form-item
label="CODE"
prop="code"
:rules="[
{ required: true, message: 'code不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.code"></el-input>
</el-form-item>
<el-form-item
label="名称"
prop="name"
:rules="[
{ required: true, message: '名称不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.name"></el-input>
</el-form-item>
<el-form-item
label="备注"
prop="note"
:rules="[
{ required: true, message: '备注名称不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="detailVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveCode"
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
detailData: [],
total: 0,
page: 1,
curCateUnid: "",
pageSize: 20,
tableData: [],
catesData: [],
selectDevs: "",
detailVisible: false,
codeStatus: 0,
codeData: {}
};
},
components: {},
created() {
this.getCates();
},
methods: {
cateChange(cateunid) {
let offset = (this.page - 1) * this.pageSize;
let obj = {
limit: this.pageSize,
offset: offset
};
this.$api.codes
.codes(obj, cateunid)
.then(res => {
this.tableData = res.list_data;
})
.catch(err => {});
},
addcode() {
this.codeStatus = 0;
this.detailVisible = true;
this.codeData.catename = this.getCateName(this.curCateUnid);
},
editCode(index, row) {
this.codeStatus = 1;
this.detailVisible = true;
this.codeData = row;
this.codeData.catename = this.getCateName(this.curCateUnid);
},
getCateName(cateunid) {
let name = "";
this.catesData.forEach(ele => {
if (ele.cate_unid === cateunid) {
name = ele.name;
}
});
return name;
},
getCates() {
this.$api.codes.cates().then(res => {
this.catesData = res.list_data;
});
},
saveCode() {
this.$refs["trfficform"].validate(valid => {
if (valid) {
if (this.editStatus === 0) {
this.saveAddCode();
}
if (this.editStatus === 1) {
this.saveEditCode();
}
} else {
console.log("error submit!!");
return false;
}
});
},
saveAddCode() {
this.$api.codes
.addTrafficCode(this.codeData, this.curCateUnid)
.then(res => {
console.log(res);
});
},
saveEditCode() {
this.$api.codes
.editTrafficCode(
this.codeData,
this.curCateUnid,
this.codeData.code_unid
)
.then(res => {
console.log(res);
});
},
deleteCode(index, row) {
this.$api.codes
.editTrafficCode(row, this.curCateUnid, row.code_unid)
.then(res => {
console.log(res);
});
},
handleSizeChange(val) {
this.pageSize = val;
},
handleCurrentChange(val) {
this.page = val;
}
}
};
</script>
<style lang="scss" scoped>
.addbox {
float: right;
margin-right: 10px;
}
.code-btn {
margin-bottom: 10px;
float: right;
margin-right: 10px;
}
.del-btn {
padding-left: 20px;
}
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div> <div>
<span class="selectBox"> <span class="selectBox">
<el-select <el-select
v-model="selectDevs" v-model="curCateUnid"
placeholder="请选择" placeholder="请选择"
@change="cateChange" @change="cateChange"
:popper-append-to-body="false" :popper-append-to-body="false"
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</el-select> </el-select>
</span> </span>
<span class="addbox"> <span class="addbox">
<el-button type="primary">添加code</el-button> <el-button type="primary" @click="addcode">添加code</el-button>
</span> </span>
</div> </div>
<div class="mt10"> <div class="mt10">
...@@ -29,13 +29,44 @@ ...@@ -29,13 +29,44 @@
border border
style="width: 100%" style="width: 100%"
> >
<el-table-column type="index" align="center" label="#" width="40"></el-table-column> <el-table-column
type="index"
align="center"
label="#"
width="40"
></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>
<el-table-column prop="code" align="center" label="code"> <el-table-column prop="code" align="center" label="code">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="name" label="名称"> <el-table-column align="center" prop="name" label="名称">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="operation" label="操作">
<template slot-scope="scope">
<el-tooltip
content="编辑"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="iconfont icon-xiugai editIcon"
@click="editCode(scope.$index, scope.row)"
></span>
</el-tooltip>
<el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="iconfont icon-detail delIcon del-btn"
@click="deleteCode(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table> </el-table>
<div style="margin-top: 28px;"> <div style="margin-top: 28px;">
<el-pagination <el-pagination
...@@ -55,7 +86,56 @@ ...@@ -55,7 +86,56 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="详情" :visible.sync="detailVisible" width="20%"> <el-dialog title="设置CODE" :visible.sync="detailVisible" width="400px">
<el-form
ref="trfficform"
:model="codeData"
label-position="left"
label-width="80px"
>
<el-form-item
label="类型"
prop="catename"
:rules="[
{ required: true, message: '类型不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.catename" disabled></el-input>
</el-form-item>
<el-form-item
label="CODE"
prop="code"
:rules="[
{ required: true, message: 'code不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.code"></el-input>
</el-form-item>
<el-form-item
label="名称"
prop="name"
:rules="[
{ required: true, message: '名称不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.name"></el-input>
</el-form-item>
<el-form-item
label="备注"
prop="note"
:rules="[
{ required: true, message: '备注名称不能为空!', trigger: 'blur' }
]"
>
<el-input v-model="codeData.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="detailVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveCode"
>确 定</el-button
>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -66,11 +146,14 @@ export default { ...@@ -66,11 +146,14 @@ export default {
detailData: [], detailData: [],
total: 0, total: 0,
page: 1, page: 1,
curCateUnid: "",
pageSize: 20, pageSize: 20,
tableData: [], tableData: [],
catesData: [], catesData: [],
selectDevs: "", selectDevs: "",
detailVisible: false detailVisible: false,
codeStatus: 0,
codeData: {}
}; };
}, },
components: {}, components: {},
...@@ -83,7 +166,7 @@ export default { ...@@ -83,7 +166,7 @@ export default {
let obj = { let obj = {
limit: this.pageSize, limit: this.pageSize,
offset: offset offset: offset
} };
this.$api.codes this.$api.codes
.codes(obj, cateunid) .codes(obj, cateunid)
.then(res => { .then(res => {
...@@ -91,11 +174,71 @@ export default { ...@@ -91,11 +174,71 @@ export default {
}) })
.catch(err => {}); .catch(err => {});
}, },
addcode() {
this.codeStatus = 0;
this.detailVisible = true;
this.codeData.catename = this.getCateName(this.curCateUnid);
},
editCode(index, row) {
this.codeStatus = 1;
this.detailVisible = true;
this.codeData = row;
this.codeData.catename = this.getCateName(this.curCateUnid);
},
getCateName(cateunid) {
let name = "";
this.catesData.forEach(ele => {
if (ele.cate_unid === cateunid) {
name = ele.name;
}
});
return name;
},
getCates() { getCates() {
this.$api.codes.cates().then(res => { this.$api.codes.cates().then(res => {
this.catesData = res.list_data; this.catesData = res.list_data;
}); });
}, },
saveCode() {
this.$refs["trfficform"].validate(valid => {
if (valid) {
if (this.editStatus === 0) {
this.saveAddCode();
}
if (this.editStatus === 1) {
this.saveEditCode();
}
} else {
console.log("error submit!!");
return false;
}
});
},
saveAddCode() {
this.$api.codes
.addTrafficCode(this.codeData, this.curCateUnid)
.then(res => {
console.log(res);
});
},
saveEditCode() {
this.$api.codes
.editTrafficCode(
this.codeData,
this.curCateUnid,
this.codeData.code_unid
)
.then(res => {
console.log(res);
});
},
deleteCode(index, row) {
this.$api.codes
.editTrafficCode(row, this.curCateUnid, row.code_unid)
.then(res => {
console.log(res);
});
},
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val; this.pageSize = val;
}, },
...@@ -106,8 +249,16 @@ export default { ...@@ -106,8 +249,16 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.addbox{ .addbox {
float: right;
margin-right: 10px;
}
.code-btn {
margin-bottom: 10px;
float: right; float: right;
margin-right: 10px; margin-right: 10px;
} }
.del-btn {
padding-left: 20px;
}
</style> </style>
...@@ -532,7 +532,7 @@ export default { ...@@ -532,7 +532,7 @@ export default {
img { img {
width: 40px; width: 40px;
height: 40px; height: 40px;
margin-left: 102px; margin-left: 1vw;
} }
.textCon { .textCon {
margin-right: 101px; margin-right: 101px;
...@@ -542,7 +542,7 @@ export default { ...@@ -542,7 +542,7 @@ export default {
img { img {
width: 34px; width: 34px;
height: 35px; height: 35px;
margin-left: 104px; margin-left: 1vw;
} }
.textCon { .textCon {
margin-right: 184px; margin-right: 184px;
...@@ -588,7 +588,7 @@ export default { ...@@ -588,7 +588,7 @@ export default {
display: inline-block; display: inline-block;
} }
.label { .label {
width: 7vw; width: 6vw;
text-align: center; text-align: center;
border-left: 1px solid $border-color; border-left: 1px solid $border-color;
background: #f0f0f0; background: #f0f0f0;
...@@ -608,7 +608,10 @@ export default { ...@@ -608,7 +608,10 @@ export default {
width: 4.5vw; width: 4.5vw;
} }
.subtask-info:nth-child(8) { .subtask-info:nth-child(8) {
width: 4.5vw; width: 4vw;
}
.subtask-info:nth-child(10) {
width: 12vw;
} }
line-height: 40px; line-height: 40px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!