Commit 63dde948 by changjin

联调外部系统管理接口

parent a2a0bc5c
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<div class="sideMenu"> <div class="sideMenu">
<el-menu theme="dark" :default-active="onRoutes" class="el-menu-demo" unique-opened router> <el-menu theme="dark" :default-active="onRoutes" class="el-menu-demo" unique-opened router>
<template v-for="(item,index) in sideMenu"> <template v-for="(item,index) in sideMenu">
<el-menu-item :class="{'is-active':menuActive==item.name}" :index="item.url" v-on:click="menuActive = item.name" :key="index"> <el-menu-item :class="{'is-active':menuActive==item.name}" :index="item.webUrl" v-on:click="menuActive = item.name" :key="index">
<span class="icon icon1" v-if="item.name == '全部设备'"></span> <span class="icon icon1" v-if="item.name == '全部设备'"></span>
<span class="icon icon2" v-if="item.name == '设备报警'"></span> <span class="icon icon2" v-if="item.name == '设备报警'"></span>
<span class="icon icon3" v-if="item.name == '车辆审核'"></span> <span class="icon icon3" v-if="item.name == '车辆审核'"></span>
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
name:'设备管理', name:'设备管理',
id: 1, id: 1,
url: '/equipment/list', url: '/equipment/list',
childNodes:[ childrenList:[
{ {
name:'全部设备', name:'全部设备',
url:'/equipment/list', url:'/equipment/list',
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
name: '车辆管理', name: '车辆管理',
id: 2, id: 2,
url: '/vehicle/list', url: '/vehicle/list',
childNodes:[ childrenList:[
{ {
name:'车辆审核', name:'车辆审核',
url:'/vehicle/vehicleAudit', url:'/vehicle/vehicleAudit',
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
name: 'IOC后台管理', name: 'IOC后台管理',
id: 3, id: 3,
url: '/IOC/notice', url: '/IOC/notice',
childNodes:[ childrenList:[
{ {
name:'公告管理', name:'公告管理',
url:'/IOC/notice', url:'/IOC/notice',
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
name: '系统设置', name: '系统设置',
id: 5, id: 5,
url: '/system/project', url: '/system/project',
childNodes:[ childrenList:[
{ {
name:'项目管理', name:'项目管理',
url:'/system/project', url:'/system/project',
...@@ -200,32 +200,32 @@ export default { ...@@ -200,32 +200,32 @@ export default {
}, },
created () { created () {
var that = this var that = this
this.changeMenu(this.items[0]) // this.changeMenu(this.items[0])
that.items.forEach(function (info, index) { // that.items.forEach(function (info, index) {
if (that.pageNameList[1].pageName === info.name) { // if (that.pageNameList[1].pageName === info.name) {
that.changeMenu(info) // that.changeMenu(info)
} // }
}) // })
// this.getData() this.getData()
this.menuActive = this.pageNameList[this.pageNameList.length - 1].pageName this.menuActive = this.pageNameList[this.pageNameList.length - 1].pageName
}, },
update (){ update (){
var that = this var that = this
// this.getData() this.getData()
this.changeMenu(this.items[0]) // this.changeMenu(this.items[0])
that.items.forEach(function (info, index) { // that.items.forEach(function (info, index) {
if (that.pageNameList[1].pageName === info.name) { // if (that.pageNameList[1].pageName === info.name) {
that.changeMenu(info) // that.changeMenu(info)
} // }
}) // })
this.menuActive = this.pageNameList[this.pageNameList.length - 1].pageName this.menuActive = this.pageNameList[this.pageNameList.length - 1].pageName
}, },
methods: { methods: {
getData () { getData () {
this.$axios.get('/baseInfo/initPersonalMenu').then((res) =>{ this.$axios.get('/baseInfo/initPersonalMenu').then((res) =>{
if(res.data.code === '0') { if(res.data.code === '0') {
this.items = res.data.data.menuMap this.items = res.data.data.menuResponseList
console.log(this.items.MenuResponse) this.changeMenu(this.items[0])
window.sessionStorage.setItem('projectId',res.data.data.projectId) window.sessionStorage.setItem('projectId',res.data.data.projectId)
} }
}) })
...@@ -235,20 +235,20 @@ export default { ...@@ -235,20 +235,20 @@ export default {
console.log(menu.name) console.log(menu.name)
if (menu.name == '外部系统管理') { if (menu.name == '外部系统管理') {
this.menuActive = menu.name this.menuActive = menu.name
this.$router.push({path: menu.url}) this.$router.push({path: menu.webUrl})
this.sideMenu = [] this.sideMenu = []
this.curMenu = menu.id this.curMenu = menu.id
} else { } else {
this.menuActive = menu.childNodes[0].name this.menuActive = menu.childrenList[0].name
this.$router.push({path: menu.childNodes[0].url}) this.$router.push({path: menu.childrenList[0].webUrl})
this.sideMenu = menu.childNodes this.sideMenu = menu.childrenList
this.curMenu = menu.id this.curMenu = menu.id
} }
} else { } else {
this.sideMenu = [] this.sideMenu = []
this.curMenu = menu.id this.curMenu = menu.id
this.menuActive = menu.name this.menuActive = menu.name
this.sideMenu = menu.childNodes this.sideMenu = menu.childrenList
} }
}, },
} }
......
...@@ -4,19 +4,22 @@ ...@@ -4,19 +4,22 @@
<div class="searchBox"> <div class="searchBox">
<el-row> <el-row>
<el-form label-width="70px" :model="searchForm"> <el-form label-width="70px" :model="searchForm">
<el-col :span="8"> <el-col :span="7">
<el-form-item label="设备类型"> <el-form-item label="设备类型">
<el-select v-model="searchForm.blockId" placeholder="请选择"> <el-select v-model="searchForm.groupId" placeholder="请选择">
<el-option label="不限" value=""></el-option> <el-option value="" label="全部">全部</el-option>
<el-option label="男" value="MAN"></el-option> <el-option
<el-option label="女" value="WOMAN"></el-option> v-for="item in typeList"
<el-option label="未知" value="SECRECY"></el-option> :key="item.groupId"
:label="item.groupName"
:value="item.groupId">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="7">
<el-form-item label="报警类型"> <el-form-item label="报警类型">
<el-select v-model="searchForm.blockId" placeholder="请选择"> <el-select v-model="searchForm.warnState" placeholder="请选择">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<el-option label="男" value="MAN"></el-option> <el-option label="男" value="MAN"></el-option>
<el-option label="女" value="WOMAN"></el-option> <el-option label="女" value="WOMAN"></el-option>
...@@ -24,18 +27,13 @@ ...@@ -24,18 +27,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-form-item label="设备名称"> <el-form-item label="设备名称">
<el-input v-model="searchForm.customerName" placeholder="请输入设备名称"></el-input> <el-input v-model="searchForm.deviceName" placeholder="请输入设备名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="3" :offset="1">
<p class="font12 prompt"><i class="icon"></i>当前数据已发生变化,请手动刷新<i class="closeIcon"></i></p> <el-button @click="getData()" class="mt5">查询</el-button>
</el-col>
<el-col :span="16" class="text-right">
<el-button @click="getData()">查询</el-button>
<!-- <el-button class="mt5 ml10" @click="reset()">重置</el-button> -->
<el-button type="primary" @click="allotBtn(0)">刷新</el-button>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
...@@ -127,18 +125,42 @@ export default { ...@@ -127,18 +125,42 @@ export default {
data: () => ({ data: () => ({
loading: false, loading: false,
activeName: 'first', activeName: 'first',
value1: '', searchForm:{},
searchForm:{
},
data:{ data:{
page: '1', page: '1',
list:[] list:[]
}, },
size: '10', size: '10',
typeList: []
}), }),
created () { created () {
this.projectId = window.sessionStorage.getItem('projectId')
this.projectId = 'beijing'
this.getTypeList(this.projectId)
this.getData()
}, },
methods: { methods: {
getData(){
this.$axios.post('/deviceVehicle/findAlarmList',{
p: this.data.page,
c: this.size,
groupId: this.searchForm.groupId,
deviceName: this.searchForm.deviceName,
warnState: this.searchForm.warnState,
projectId: this.projectId,
}).then((res) =>{
if(res.data.code === '0') {
this.data = res.data.data
}
})
},
getTypeList (projectId) {
this.$axios.get('/deviceVehicle/findProductTypeList?projectId=' + projectId).then((res) =>{
if(res.data.code === '0') {
this.typeList = res.data.data
}
})
},
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
}, },
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-col :span="10"> <el-col :span="10">
<el-form-item label="操作时间"> <el-form-item label="操作时间">
<el-date-picker <el-date-picker
v-model="value1" v-model="searchForm.date"
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
...@@ -17,36 +17,37 @@ ...@@ -17,36 +17,37 @@
</el-col> </el-col>
<el-col :span="13" :offset="1"> <el-col :span="13" :offset="1">
<el-button class="mt5 ml10" @click="getData()">查询</el-button> <el-button class="mt5 ml10" @click="getData()">查询</el-button>
<el-button type="primary" class="mt5" @click="allotBtn(0)">刷新</el-button>
<el-button @click="goBack()" class="lightBtn ml10 mt5">返回</el-button> <el-button @click="goBack()" class="lightBtn ml10 mt5">返回</el-button>
</el-col> </el-col>
<el-col :span="8" class="clear">
<p class="font12 prompt"><i class="icon"></i>当前数据已发生变化,请手动刷新<i class="closeIcon"></i></p>
</el-col>
</el-form> </el-form>
</el-row> </el-row>
</div> </div>
<div class="infoBox"> <div class="infoBox">
<el-row> <el-row>
<el-col :span="6" class="text-left ml20 rightLine"> <el-col :span="6" class="text-left ml20 rightLine">
<p>设备名称<b class="ml10">门禁001</b></p> <p>设备名称<b class="ml10">{{deviceName}}</b></p>
</el-col> </el-col>
<el-col :span="6" class="text-center rightLine"> <el-col :span="6" class="text-center rightLine">
<p>所在位置<b class="ml10">1号楼东北角</b></p> <p>所在位置<b class="ml10">{{site}}</b></p>
</el-col> </el-col>
<el-col :span="6" class="text-center rightLine"> <el-col :span="6" class="text-center rightLine">
<p>在线状态<b class="ml10 green">在线</b></p> <p>在线状态
<b class="ml10 red" v-if="status === 'DISABLE'">禁用</b>
<b class="ml10 gray" v-if="status === 'OFFLINE'">离线</b>
<b class="ml10 green" v-if="status === 'ONLINE'">在线</b>
<b class="ml10 red" v-if="status === 'UNACTIVE'">未激活</b>
</p>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="mainContent tableCont"> <div class="mainContent tableCont">
<div class="tabCont"> <div class="tabCont">
<div class="title">门禁001操作记录</div> <div class="title">{{deviceName}}操作记录</div>
<el-table :data="data.list"> <el-table :data="data.list">
<el-table-column type="index" label="序号"></el-table-column> <el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="name" label="操作事件"></el-table-column> <el-table-column prop="iotInfo" label="操作事件"></el-table-column>
<el-table-column prop="actualTime" label="操作时间" ></el-table-column> <el-table-column prop="createTime" label="操作时间" ></el-table-column>
</el-table> </el-table>
<div class="block text-right mt20" v-if="data.page"> <div class="block text-right mt20" v-if="data.page">
<el-pagination <el-pagination
...@@ -62,27 +63,39 @@ ...@@ -62,27 +63,39 @@
</template> </template>
<script> <script>
import moment from 'moment'
export default { export default {
data: () => ({ data: () => ({
loading: false, loading: false,
searchForm:{ searchForm:{},
},
data:{ data:{
page: '1', page: '1',
list:[
{
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}
]
}, },
size: '10', size: '10',
value1: '' deviceName: '',
status: '',
site: ''
}), }),
created () { created () {
this.getData()
this.deviceName = this.$route.params.name
this.site = this.$route.params.site
this.status = this.$route.params.status
}, },
methods: { methods: {
getData () {
this.$axios.post('/deviceVehicle/findDeviceClickInfoById',{
p: this.data.page,
c: this.size,
iotId: this.$route.params.iotId,
beginTime: this.searchForm.date ? moment(new Date(this.searchForm.date[0]).getTime()).format('YYYY-MM-DD' + ' 00:00:00') : null,
endTime: this.searchForm.date ? moment(new Date(this.searchForm.date[1]).getTime()).format('YYYY-MM-DD' + ' 23:59:59') : null
}).then((res) =>{
if(res.data.code === '0') {
this.data = res.data.data
}
})
},
goBack () { goBack () {
this.$router.go(-1) this.$router.go(-1)
}, },
...@@ -94,10 +107,6 @@ export default { ...@@ -94,10 +107,6 @@ export default {
this.data.page = val this.data.page = val
this.getData() this.getData()
}, },
reset () {
this.searchForm = {}
this.getData(1)
},
showAlert: function (cont) { showAlert: function (cont) {
this.$alert(cont, '温馨提示', { this.$alert(cont, '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<el-table-column prop="deviceName" label="设备名称"></el-table-column> <el-table-column prop="deviceName" label="设备名称"></el-table-column>
<el-table-column prop="iotId" label="设备ID"></el-table-column> <el-table-column prop="iotId" label="设备ID"></el-table-column>
<el-table-column prop="deviceType" label="设备类型"></el-table-column> <el-table-column prop="deviceType" label="设备类型"></el-table-column>
<el-table-column prop="ipAddress" label="所在位置"></el-table-column> <el-table-column prop="site" label="所在位置"></el-table-column>
<el-table-column prop="status" label="是否在线" > <el-table-column prop="status" label="是否在线" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status === 'DISABLE'">禁用</span> <span v-if="scope.row.status === 'DISABLE'">禁用</span>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<el-table-column label="操作" width="160"> <el-table-column label="操作" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<router-link :to="'/equipment/attribute/' + scope.row.iotId" class="line">属性</router-link> <router-link :to="'/equipment/attribute/' + scope.row.iotId" class="line">属性</router-link>
<router-link :to="'/equipment/events/' + scope.row.iotId" class="line ml10">事件</router-link> <router-link :to="'/equipment/events/' + scope.row.iotId + '/' + scope.row.deviceName + '/' +scope.row.site+ '/' + scope.row.status " class="line ml10">事件</router-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
this.projectId = window.sessionStorage.getItem('projectId') this.projectId = window.sessionStorage.getItem('projectId')
this.projectId = 'beijing' this.projectId = 'beijing'
this.getTypeList(this.projectId) this.getTypeList(this.projectId)
this.getData(this.projectId) this.getData()
}, },
methods: { methods: {
getData(){ getData(){
...@@ -154,10 +154,6 @@ export default { ...@@ -154,10 +154,6 @@ export default {
this.data.page = val this.data.page = val
this.getData() this.getData()
}, },
reset () {
this.searchForm = {}
this.getData(1)
},
showAlert: function (cont) { showAlert: function (cont) {
this.$alert(cont, '温馨提示', { this.$alert(cont, '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
......
<template> <template>
<div class="mainContent"> <div class="mainContent">
<div class="btnBox"> <div class="btnBox">
<el-button class="addBtn" @click="addBtn"><img src="../../../../static/img/add.png" class="addIcon"><span>新增</span></el-button> <el-button class="addBtn" @click="addBtn(0)"><img src="../../../../static/img/add.png" class="addIcon"><span>新增</span></el-button>
</div> </div>
<div class="mainBox"> <div class="mainBox">
<div class="left boxDiv"> <div class="left boxDiv" v-for="item in data">
<div class="imgDiv"><img src="../../../../static/img/img.png"></div> <div class="imgDiv"><img :src="item.photoUrl"></div>
<p class="text-center font14">监控后台管理系统</p> <p class="text-center font14">{{item.name}}</p>
<div class="operateDiv text-center font12 mt20"> <div class="operateDiv text-center font12 mt10">
<span class="line green pointer" @click="addBtn()"><img src="../../../../static/img/edit.png">修改</span> <span class="line green pointer" @click="addBtn(1,item)"><img src="../../../../static/img/edit.png">修改</span>
<span class="line red ml15 pointer"><img src="../../../../static/img/del.png">删除</span> <span class="line red ml15 pointer" @click="delBtn(item.id)"><img src="../../../../static/img/del.png">删除</span>
</div> </div>
<el-button class="lightBtn">进入系统</el-button> <el-button class="lightBtn" @click="goBtn(item.url)">进入系统</el-button>
</div> </div>
</div> </div>
<el-dialog title="新增外部系统" :visible.sync="dialogVisible" width="35%"> <el-dialog :title="title" :visible.sync="dialogVisible" width="35%">
<el-row class="searchBox"> <el-row class="searchBox">
<el-form label-width="100px"> <el-form label-width="100px" :model="dataForm">
<el-col :span="18" :offset="1"> <el-col :span="18" :offset="1">
<el-form-item label="系统名称" required> <el-form-item label="系统名称" required>
<el-input v-model="data.oldPwd" placeholder=""></el-input> <el-input v-model="dataForm.name"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="18" :offset="1"> <el-col :span="18" :offset="1">
<el-form-item label="URL链接" required> <el-form-item label="URL链接" required>
<el-input v-model="data.newPwd" placeholder=""></el-input> <el-input v-model="dataForm.url"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="18" :offset="1"> <el-col :span="18" :offset="1">
<el-form-item label="上传封面" required> <el-form-item label="上传封面" required>
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
action="https://jsonplaceholder.typicode.com/posts/" :action="this.baseURL + 'baseInfo/uploadPhoto'"
:show-file-list="false" :show-file-list="false"
:headers="headers"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"> :before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar"> <img v-if="photoUrl" :src="photoUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
<span class="red span">仅支持JPG/PNG格式,不得大于4M</span> <span class="red span">仅支持JPG/PNG格式,不得大于4M</span>
...@@ -55,22 +56,121 @@ ...@@ -55,22 +56,121 @@
export default { export default {
data: () => ({ data: () => ({
dialogVisible: false, dialogVisible: false,
data: {}, data: [],
imageUrl: '' photoUrl: '',
dataForm: {},
token: '',
title: ''
}), }),
created () { created () {
this.getData()
}, },
computed: {
headers(){
return {
"token":window.sessionStorage.getItem('token')
}
}
},
methods: { methods: {
addBtn () { getData () {
this.$axios.get('/baseInfo/findAllOutProject').then((res) =>{
if(res.data.code === '0') {
this.data = res.data.data
}
})
},
//进入系统
goBtn (url) {
window.open(url);
},
submit () {
let that = this
if (!that.dataForm.name) {
that.showAlert('请输入系统名称~')
return false
}
if (!that.dataForm.url) {
that.showAlert('请输入URL链接~')
return false
}
let reUrl = /(http|https):\/\/([\w.]+\/?)\S*/
if (that.dataForm.url && reUrl.test(that.dataForm.url) === false) {
that.showAlert('URL链接格式不对~')
return false
}
if (!that.photoUrl) {
that.showAlert('请上传封面~')
return false
}
let url
if (this.type === 0) {
url = '/baseInfo/addOutProject'
} else {
url = '/baseInfo/editOutProject'
}
that.$axios.post(url,{
"name": that.dataForm.name,
"photoUrl": that.photoUrl,
"url": that.dataForm.url,
"id": that.dataForm.id
}).then((res) =>{
if(res.data.code === '0') {
if (this.type === 0) {
this.$message({message: '新增成功~',type: 'success'});
} else {
this.$message({message: '修改成功~',type: 'success'});
}
this.dialogVisible = false
that.getData()
} else {
if (this.type === 0) {
this.$message({message: '新增失败~',type: 'error'});
} else {
this.$message({message: '修改失败~',type: 'error'});
}
}
})
},
delBtn (id) {
this.$confirm('确定删除当前系统?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios.get('/baseInfo/deleteOutProjectById?id=' + id).then((res) =>{
if(res.data.code === '0') {
this.$message({message: '删除成功~',type: 'success'});
this.getData()
} else {
this.$message({message: '删除失败~',type: 'error'});
}
})
}).catch(() => {})
},
addBtn (type,item) {
this.dialogVisible = true this.dialogVisible = true
this.type = type
if (type === 0) {
this.title = '新增外部系统'
this.dataForm = {}
this.photoUrl = ''
} else {
this.title = '修改外部系统'
this.photoUrl = item.photoUrl
this.dataForm = {
"name": item.name,
"url": item.url,
"id": item.id
}
}
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw); this.photoUrl = res.data
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || 'image/png'; const isJPG = file.type === 'image/jpeg' || 'image/png';
const isLt4M = file.size / 1024 / 1024 < 4; const isLt4M = file.size / 1024 / 1024 < 4;
if (!isJPG) { if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG/PNG 格式!'); this.$message.error('上传头像图片只能是 JPG/PNG 格式!');
} }
...@@ -108,6 +208,7 @@ ...@@ -108,6 +208,7 @@
margin: 0 10px 10px 0; margin: 0 10px 10px 0;
.imgDiv{ .imgDiv{
width: 182px; width: 182px;
height: 110px;
margin: 8px auto; margin: 8px auto;
img{width: 100%;height: 100%;} img{width: 100%;height: 100%;}
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
<div class="mainContent tableCont"> <div class="mainContent tableCont">
<div class="tabCont"> <div class="tabCont">
<el-button class="addBtn" @click="addBtn(0)"><img src="../../../../static/img/add.png" class="addIcon"><span>新增</span></el-button> <el-button class="addBtn" v-if="isAddBtn" @click="addBtn(0)"><img src="../../../../static/img/add.png" class="addIcon"><span>新增</span></el-button>
<el-table :data="data.list"> <el-table :data="data.list">
<el-table-column type="index" label="序号"></el-table-column> <el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="cityName" label="城市名称"></el-table-column> <el-table-column prop="cityName" label="城市名称"></el-table-column>
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
<el-table-column prop="massif" label="地块名称" ></el-table-column> <el-table-column prop="massif" label="地块名称" ></el-table-column>
<el-table-column prop="massifId" label="地块ID" ></el-table-column> <el-table-column prop="massifId" label="地块ID" ></el-table-column>
<el-table-column prop="massifCode" label="地块编码" ></el-table-column> <el-table-column prop="massifCode" label="地块编码" ></el-table-column>
<el-table-column label="操作" width="160"> <el-table-column label="操作" width="160" v-if="isEditBtn && isDelBtn">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="green line pointer" @click="addBtn(1,scope.row)">修改</span> <span class="green line pointer" v-if="isEditBtn" @click="addBtn(1,scope.row)">修改</span>
<span class="red line ml10 pointer" @click="delBtn(scope.row.id)">删除</span> <span class="red line ml10 pointer" v-if="isDelBtn" @click="delBtn(scope.row.id)">删除</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -108,12 +108,37 @@ export default { ...@@ -108,12 +108,37 @@ export default {
id: '', id: '',
data:{page:'1'}, data:{page:'1'},
size: '10', size: '10',
title: '' title: '',
isAddBtn: false,
isEditBtn: false,
isDelBtn: false
}), }),
created () { created () {
this.getData() this.getData()
this.getPermissionsBtn()
}, },
methods: { methods: {
getPermissionsBtn () {
this.$axios.get('/baseInfo/initPersonalMenu').then((res) =>{
if(res.data.code === '0') {
res.data.data.menuResponseList.forEach(item=>{
item.childrenList.forEach(info=>{
info.childrenList.forEach(btn=>{
if(btn.id === '1003-01-001-003') {
this.isDelBtn = true
}
if (btn.id === '1003-01-001-002') {
this.isEditBtn = true
}
if (btn.id === '1003-01-001-001') {
this.isAddBtn = true
}
})
})
})
}
})
},
getData () { getData () {
this.$axios.post('/baseInfo/findProjectPageInfo',{ this.$axios.post('/baseInfo/findProjectPageInfo',{
p: this.data.page, p: this.data.page,
...@@ -205,6 +230,7 @@ export default { ...@@ -205,6 +230,7 @@ export default {
this.type = type this.type = type
if (type === 0) { if (type === 0) {
this.title = '新增项目' this.title = '新增项目'
this.dataForm = {}
} else { } else {
this.title = '修改项目' this.title = '修改项目'
this.id = item.id this.id = item.id
......
...@@ -51,7 +51,7 @@ export default new Router({ ...@@ -51,7 +51,7 @@ export default new Router({
require(['../components/page/equipment/attribute.vue'], resolve), require(['../components/page/equipment/attribute.vue'], resolve),
}, },
{ {
path: '/equipment/events/:id', path: '/equipment/events/:id/:name/:site/:status',
name: 'equipmentEvents', name: 'equipmentEvents',
meta: { meta: {
pageName: '操作事件' pageName: '操作事件'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment