Commit 8f3621e2 authored by yanzhongrong's avatar yanzhongrong

bugfix

parent 8e3f9528
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build": "vue-cli-service build ", "build": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
'sidebar' 'sidebar'
]), ]),
routes() { routes() {
return this.$router.options.routes return this.$store.state.permission.routes
}, },
activeMenu() { activeMenu() {
const route = this.$route; const route = this.$route;
......
...@@ -25,15 +25,19 @@ router.beforeEach(async(to, from, next) => { ...@@ -25,15 +25,19 @@ router.beforeEach(async(to, from, next) => {
next({ path: '/' }) next({ path: '/' })
NProgress.done() NProgress.done()
} else { } else {
const hasGetUserInfo = store.getters.userName // const hasGetUserInfo = store.getters.userName
if (hasGetUserInfo) { const hasRoles = store.state.user && store.state.user.roles.length > 0
if (hasRoles) {
next() next()
} else { } else {
try { try {
// get user info // get user info
// await store.dispatch('user/getInfo') const { isAdmin } = await store.dispatch('user/getInfo')
const roles = isAdmin == 1 ? ['admin'] : ['editor']
const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
next() router.addRoutes(accessRoutes)
next({ ...to, replace: true })
} catch (error) { } catch (error) {
// remove token and go to login page to re-login // remove token and go to login page to re-login
await store.dispatch('user/resetToken') await store.dispatch('user/resetToken')
......
...@@ -38,12 +38,12 @@ export const constantRoutes = [ ...@@ -38,12 +38,12 @@ export const constantRoutes = [
hidden: true hidden: true
}, },
{ // {
path: '/404', // path: '/404',
component: () => import('@/views/404'), // component: () => import('@/views/404'),
meta:{title:"404"}, // meta:{title:"404"},
hidden: true // hidden: true
}, // },
{ {
path: '/', path: '/',
...@@ -128,7 +128,6 @@ export const constantRoutes = [ ...@@ -128,7 +128,6 @@ export const constantRoutes = [
}, },
component: () => import('@/views/setting/statistics/detail'), component: () => import('@/views/setting/statistics/detail'),
hidden: true, hidden: true,
}, },
] ]
}, },
...@@ -207,31 +206,36 @@ export const constantRoutes = [ ...@@ -207,31 +206,36 @@ export const constantRoutes = [
} }
] ]
}, },
]
export const asyncRoutes = [
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
redirect: '/dashboard', redirect: '/dashboard',
name: 'User', name: 'User',
meta: { title: '用户管理', icon: 'user' }, meta: { title: '用户管理', icon: 'user'},
children: [{ children: [{
path: 'updateUser', path: 'updateUser',
name: 'UpdateUser', name: 'UpdateUser',
component: () => import('@/views/user/updateUser'), component: () => import('@/views/user/updateUser'),
meta: { title: '个人信息管理' } meta: { title: '个人信息管理',roles: ['admin', 'editor'] },
}, },
{ {
path: 'userList', path: 'userList',
name: 'UserList', name: 'UserList',
component: () => import('@/views/user/userList'), component: () => import('@/views/user/userList'),
meta: { title: '用户信息列表' } meta: { title: '用户信息列表',roles: ['admin'] },
}, },
{ {
path: 'userLog', path: 'userLog',
name: 'UserLog', name: 'UserLog',
component: () => import('@/views/user/userLog'), component: () => import('@/views/user/userLog'),
meta: { title: '用户操作日志' } meta: { title: '用户操作日志', roles: ['admin'] },
},
] }]
}, },
// 404 page must be placed at the end !!! // 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true } { path: '*', redirect: '/404', hidden: true }
......
...@@ -6,6 +6,7 @@ import settings from './modules/settings' ...@@ -6,6 +6,7 @@ import settings from './modules/settings'
import user from './modules/user' import user from './modules/user'
import depart from './modules/depart' import depart from './modules/depart'
import alarm from './modules/alarm' import alarm from './modules/alarm'
import permission from './modules/peimission'
Vue.use(Vuex) Vue.use(Vuex)
...@@ -16,7 +17,8 @@ const store = new Vuex.Store({ ...@@ -16,7 +17,8 @@ const store = new Vuex.Store({
settings, settings,
user, user,
depart, depart,
alarm alarm,
permission
}, },
getters getters
}) })
......
import { asyncRoutes, constantRoutes } from '@/router'
/**
* Use meta.role to determine if the current user has permission
* @param roles
* @param route
*/
function hasPermission(roles, route) {
if (route.meta && route.meta.roles) {
return roles.some(role => route.meta.roles.includes(role))
} else {
return true
}
}
/**
* Filter asynchronous routing tables by recursion
* @param routes asyncRoutes
* @param roles
*/
export function filterAsyncRoutes(routes, roles) {
const res = []
routes.forEach(route => {
const tmp = { ...route }
if (hasPermission(roles, tmp)) {
if (tmp.children) {
tmp.children = filterAsyncRoutes(tmp.children, roles)
}
res.push(tmp)
}
})
return res
}
const state = {
routes: constantRoutes,
addRoutes: []
}
const mutations = {
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
}
}
const actions = {
generateRoutes({ commit }, roles) {
return new Promise(resolve => {
let accessedRoutes
if (roles.includes('admin')) {
accessedRoutes = asyncRoutes || []
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
}
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
})
}
}
export default {
namespaced: true,
state,
mutations,
actions,
}
\ No newline at end of file
...@@ -6,7 +6,8 @@ const getDefaultState = () => { ...@@ -6,7 +6,8 @@ const getDefaultState = () => {
return { return {
token: getToken(), token: getToken(),
userBaseInfo: {}, userBaseInfo: {},
userId: '' userId: '',
roles: []
} }
} }
...@@ -24,6 +25,9 @@ const mutations = { ...@@ -24,6 +25,9 @@ const mutations = {
}, },
SET_USERID: (state, data) => { SET_USERID: (state, data) => {
state.userId = data state.userId = data
},
SET_ROLES: (state, data) => {
state.roles = handleRoles(data)
} }
} }
...@@ -45,10 +49,40 @@ const actions = { ...@@ -45,10 +49,40 @@ const actions = {
}, },
// get user info // get user info
// getInfo({ commit }) {
// return new Promise((resolve, reject) => {
// getInfo({ type: 0 }).then(res => {
// if (!res) {
// reject('Verification failed, please Login again.')
// }
// commit('SET_BASEINFO', res)
// commit('SET_ROLES', res)
// resolve(res)
// })
// }).catch(error => {
// reject(error)
// })
// },
getInfo({ commit }) { getInfo({ commit }) {
return new Promise((resolve, reject) => {
getInfo({ type: 0 }).then(res => { getInfo({ type: 0 }).then(res => {
if (!res) return if (!res) {
reject('Verification failed, please Login again.')
}
const { isAdmin } = res
let roles = isAdmin==1 ? ['admin'] : ['editor']
// roles must be a non-empty array
if (!roles || roles.length <= 0) {
reject('getInfo: roles must be a non-null array!')
}
commit('SET_ROLES', roles)
commit('SET_BASEINFO', res) commit('SET_BASEINFO', res)
resolve(res)
}).catch(error => {
reject(error)
})
}) })
}, },
...@@ -56,11 +90,12 @@ const actions = { ...@@ -56,11 +90,12 @@ const actions = {
logout({ commit, state }) { logout({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
removeToken() // must remove token first removeToken() // must remove token first
removeUserName() // must remove token first removeUserName()
removeUserId() // must remove token first removeUserId()
resetRouter() resetRouter()
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
commit('SET_BASEINFO', {}) commit('SET_BASEINFO', {})
commit('SET_ROLES', [])
commit('RESET_STATE') commit('RESET_STATE')
resolve() resolve()
}) })
...@@ -84,6 +119,18 @@ const getters = { ...@@ -84,6 +119,18 @@ const getters = {
}, },
userBaseInfo(state) { userBaseInfo(state) {
return state.userBaseInfo return state.userBaseInfo
},
roles(state) {
return state.roles
}
}
function handleRoles(data) {
if (!data) return
if(data.isAdmin == 1) {
return ['admin']
} else {
return ['editor']
} }
} }
......
...@@ -90,6 +90,8 @@ export default { ...@@ -90,6 +90,8 @@ export default {
} }
}, },
date(newV) { date(newV) {
this.year = new Date().getFullYear(),
this.month = new Date().getMonth() + 1,
this.init(newV) this.init(newV)
}, },
visible(newV) { visible(newV) {
......
...@@ -138,17 +138,17 @@ ...@@ -138,17 +138,17 @@
<div class="item_data">{{ form.baseInfo.siteLongitude }}</div> <div class="item_data">{{ form.baseInfo.siteLongitude }}</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="text" :gutter="24"> <!-- <el-row class="text" :gutter="24">
<el-col :span="10"> <el-col :span="10">
<div class="item_name">站点监控时间</div> <div class="item_name">站点监控时间</div>
</el-col> </el-col>
<el-col :span="colspan"> <el-col :span="colspan">
<div class="item_data"></div> <div class="item_data"></div>
</el-col> </el-col>
</el-row> </el-row> -->
<el-row class="text" :gutter="24"> <el-row class="text" :gutter="24">
<el-col :span="10"> <el-col :span="10">
<div class="item_name">漏缆</div> <div class="item_name">漏缆</div>
</el-col> </el-col>
<el-col :span="colspan"> <el-col :span="colspan">
<div class="item_data">{{ form.count.LEAKY }}</div> <div class="item_data">{{ form.count.LEAKY }}</div>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
</el-row> </el-row>
<el-row class="text" :gutter="24"> <el-row class="text" :gutter="24">
<el-col :span="10"> <el-col :span="10">
<div class="item_name">天馈线</div> <div class="item_name">天馈线</div>
</el-col> </el-col>
<el-col :span="colspan"> <el-col :span="colspan">
<div class="item_data"></div> <div class="item_data"></div>
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-button <el-button
v-if="form.status[0].value == '紧急告警' || form.status[0].value == '重要告警' || form.status[0].value == '一般告警' v-if="form.status.length && (form.status[0].value == '紧急告警' || form.status[0].value == '重要告警' || form.status[0].value == '一般告警')
" "
class="alarmbtn" class="alarmbtn"
type="primary" type="primary"
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-button <el-button
v-if="form.status[0].value == '紧急告警' || form.status[0].value == '重要告警' || form.status[0].value == '一般告警' v-if="form.status.length && (form.status[0].value == '紧急告警' || form.status[0].value == '重要告警' || form.status[0].value == '一般告警')
" "
class="alarmbtn" class="alarmbtn"
type="primary" type="primary"
......
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
if (!token) return if (!token) return
this.$store.commit('user/SET_TOKEN', token) this.$store.commit('user/SET_TOKEN', token)
this.$store.commit('user/SET_USERID', userId) this.$store.commit('user/SET_USERID', userId)
this.$store.dispatch('user/getInfo') // this.$store.dispatch('user/getInfo')
setToken(token) setToken(token)
this.$router.push({ path: '/' }) this.$router.push({ path: '/' })
}, },
......
...@@ -112,16 +112,38 @@ ...@@ -112,16 +112,38 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btn"> <div class="btn" v-if="isEdit==1">
<el-button type="primary" @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
<div class="btn" v-else>
<el-button type="primary" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
<el-button type="primary" @click="submit">确认提交</el-button> <el-button type="primary" @click="submit">确认提交</el-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { fsusave, selectFsuItem, selectForSite, railWaylist } from "../../api"; import { fsusave, selectFsuItem, selectForSite, railWaylist, updateFsuConf } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
props: {
isEdit: {
type: Number,
default: 0
},
curInfo: {
type: Object,
default: () => {}
}
},
watch: {
curInfo: {
immediate: true,
handler(newV) {
this.FSUForm = formInit(newV)
}
}
},
data() { data() {
return { return {
type: 1, type: 1,
...@@ -193,6 +215,23 @@ export default { ...@@ -193,6 +215,23 @@ export default {
this.getAllWay() this.getAllWay()
}, },
methods: { methods: {
// 编辑的确认
confirm() {
let params = {
...this.FSUForm
}
delete params.creationTime
updateFsuConf(params).then(res => {
if(res.code == 200) {
this.$message.success('保存成功!')
}
this.cancel(true)
})
},
cancel(refersh) {
this.$emit('update', refersh)
this.reset()
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.FSUForm.wayId }).then((res) => { selectForSite({ wayId: this.FSUForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
......
...@@ -124,7 +124,11 @@ ...@@ -124,7 +124,11 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btn"> <div class="btn" v-if="isEdit==1">
<el-button type="primary" @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
<div class="btn" v-else>
<el-button type="primary" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
<el-button type="primary" @click="submit">确认提交</el-button> <el-button type="primary" @click="submit">确认提交</el-button>
</div> </div>
...@@ -137,11 +141,28 @@ import { ...@@ -137,11 +141,28 @@ import {
selectForFsu, selectForFsu,
selectForEquip, selectForEquip,
railWaylist, railWaylist,
updateLeakyCableConf
} from "../../api"; } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
props: [], props: {
components: {}, isEdit: {
type: Number,
default: 0
},
curInfo: {
type: Object,
default: () => {}
}
},
watch: {
curInfo: {
immediate: true,
handler(newV) {
this.leakyCableForm = formInit(newV)
}
}
},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -209,6 +230,24 @@ export default { ...@@ -209,6 +230,24 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
// 编辑的确认
confirm() {
let params = {
...this.leakyCableForm
}
delete params.creationTime
updateLeakyCableConf(params).then(res => {
if(res.code == 200) {
this.$message.success('保存成功!')
}
this.cancel(true)
})
},
cancel(refersh) {
this.$emit('update', refersh)
this.reset()
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.leakyCableForm.wayId }).then((res) => { selectForSite({ wayId: this.leakyCableForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
......
...@@ -118,7 +118,11 @@ ...@@ -118,7 +118,11 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btn"> <div class="btn" v-if="isEdit==1">
<el-button type="primary" @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
<div class="btn" v-else>
<el-button type="primary" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
<el-button type="primary" @click="submit">确认提交</el-button> <el-button type="primary" @click="submit">确认提交</el-button>
</div> </div>
...@@ -131,11 +135,28 @@ import { ...@@ -131,11 +135,28 @@ import {
selectForFsu, selectForFsu,
selectForEquip, selectForEquip,
railWaylist, railWaylist,
updateFeederConf
} from "../../api"; } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
props: [], props: {
components: {}, isEdit: {
type: Number,
default: 0
},
curInfo: {
type: Object,
default: () => {}
}
},
watch: {
curInfo: {
immediate: true,
handler(newV) {
this.leakyCableForm = formInit(newV)
}
}
},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -197,8 +218,24 @@ export default { ...@@ -197,8 +218,24 @@ export default {
}, },
}; };
}, },
computed: {},
methods: { methods: {
// 编辑的确认
confirm() {
let params = {
...this.leakyCableForm
}
delete params.creationTime
updateFeederConf(params).then(res => {
if(res.code == 200) {
this.$message.success('保存成功!')
}
this.cancel(true)
})
},
cancel(refersh) {
this.$emit('update', refersh)
this.reset()
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.leakyCableForm.wayId }).then((res) => { selectForSite({ wayId: this.leakyCableForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
......
...@@ -123,7 +123,11 @@ ...@@ -123,7 +123,11 @@
</el-date-picker> </el-date-picker>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<div class="btn"> <div class="btn" v-if="isEdit==1">
<el-button type="primary" @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
<div class="btn" v-else>
<el-button type="primary" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
<el-button type="primary" @click="submit">确认提交</el-button> <el-button type="primary" @click="submit">确认提交</el-button>
</div> </div>
...@@ -136,12 +140,29 @@ import { ...@@ -136,12 +140,29 @@ import {
selectMonitorItem, selectMonitorItem,
selectForSite, selectForSite,
selectForFsu, selectForFsu,
updateMonitorEquipConf
} from "../../api"; } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
props: [], props: {
components: {}, isEdit: {
type: Number,
default: 0
},
curInfo: {
type: Object,
default: () => {}
}
},
watch: {
curInfo: {
immediate: true,
handler(newV) {
this.monitorForm = formInit(newV)
}
}
},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -193,8 +214,24 @@ export default { ...@@ -193,8 +214,24 @@ export default {
}, },
}; };
}, },
computed: {},
methods: { methods: {
// 编辑的确认
confirm() {
let params = {
...this.monitorForm
}
delete params.creationTime
updateMonitorEquipConf(params).then(res => {
if(res.code == 200) {
this.$message.success('保存成功!')
}
this.cancel(true)
})
},
cancel(refersh) {
this.$emit('update', refersh)
this.reset()
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.monitorForm.wayId }).then((res) => { selectForSite({ wayId: this.monitorForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
......
...@@ -66,18 +66,38 @@ ...@@ -66,18 +66,38 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btn"> <div class="btn" v-if="isEdit==1">
<el-button type="primary" @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
<div class="btn" v-else>
<el-button type="primary" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
<el-button type="primary" @click="submit">确认提交</el-button> <el-button type="primary" @click="submit">确认提交</el-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { sitesave, railWaylist } from "../../api"; import { sitesave, railWaylist, updateSiteConf } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
props: [], props: {
components: {}, isEdit: {
type: Number,
default: 0
},
curInfo: {
type: Object,
default: () => {}
}
},
watch: {
curInfo: {
immediate: true,
handler(newV) {
this.stationForm = formInit(newV)
}
}
},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -121,6 +141,24 @@ export default { ...@@ -121,6 +141,24 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
// 编辑的确认
confirm() {
let params = {
...this.stationForm
}
delete params.creationTime
updateSiteConf(params).then(res => {
if(res.code == 200) {
this.$message.success('保存成功!')
}
this.cancel(true)
})
},
cancel(refersh) {
this.$emit('update', refersh)
this.reset()
},
readNodes(aaa = [], arrarea = []) { readNodes(aaa = [], arrarea = []) {
for (let item of aaa) { for (let item of aaa) {
arrarea.push({ id: item.id, name: item.name }); arrarea.push({ id: item.id, name: item.name });
......
...@@ -6,6 +6,7 @@ const path = { ...@@ -6,6 +6,7 @@ const path = {
railWaysave: 'railWay/save', railWaysave: 'railWay/save',
railWaybatchDelete: 'railWay/batchDelete', railWaybatchDelete: 'railWay/batchDelete',
railWayselectList: 'railWay/selectList', railWayselectList: 'railWay/selectList',
updateRailWay: 'railWay/updateRailWay',
sitelist: 'site/selectPage', sitelist: 'site/selectPage',
sitedetail: 'site/detail', sitedetail: 'site/detail',
...@@ -13,6 +14,7 @@ const path = { ...@@ -13,6 +14,7 @@ const path = {
sitebatchDelete: 'site/batchDelete', sitebatchDelete: 'site/batchDelete',
siteselectList: 'site/selectList', siteselectList: 'site/selectList',
selectForSite:'site/selectForSite',//铁路查站点 selectForSite:'site/selectForSite',//铁路查站点
updateSiteConf:'site/updateSiteConf',
fsuList: 'fsu/selectPage', fsuList: 'fsu/selectPage',
fsudetail: 'fsu/detail', fsudetail: 'fsu/detail',
...@@ -20,6 +22,7 @@ const path = { ...@@ -20,6 +22,7 @@ const path = {
fsubatchDelete: 'fsu/batchDeleteFsu', fsubatchDelete: 'fsu/batchDeleteFsu',
fsuselectList: 'fsu/selectList', fsuselectList: 'fsu/selectList',
selectForFsu: 'fsu/selectForFsu', selectForFsu: 'fsu/selectForFsu',
updateFsuConf: 'fsu/updateFsuConf',
selectFsuItem:'dict/selectFsuItem',//fsu数据字典 selectFsuItem:'dict/selectFsuItem',//fsu数据字典
...@@ -30,6 +33,7 @@ const path = { ...@@ -30,6 +33,7 @@ const path = {
monitorEquipselectList: 'monitorEquip/selectList', monitorEquipselectList: 'monitorEquip/selectList',
selectForEquip: 'monitorEquip/selectForEquip', selectForEquip: 'monitorEquip/selectForEquip',
selectMonitorItem:'dict/selectMonitorItem',//监测设备字典 selectMonitorItem:'dict/selectMonitorItem',//监测设备字典
updateMonitorEquipConf:'monitorEquip/updateMonitorEquipConf',
leakyCableList: 'leakyCable/selectPage', leakyCableList: 'leakyCable/selectPage',
leakyCabledetail: 'leakyCable/detail', leakyCabledetail: 'leakyCable/detail',
...@@ -37,125 +41,134 @@ const path = { ...@@ -37,125 +41,134 @@ const path = {
leakyCablebatchDelete: 'leakyCable/batchDeleteEquip', leakyCablebatchDelete: 'leakyCable/batchDeleteEquip',
leakyCableselectList: 'leakyCable/selectList', leakyCableselectList: 'leakyCable/selectList',
selectForCable: 'leakyCable/selectForCable', selectForCable: 'leakyCable/selectForCable',
updateLeakyCableConf: 'leakyCable/updateLeakyCableConf',
antennaFeederSave: 'antennaFeeder/save', antennaFeederSave: 'antennaFeeder/save',
antennaFeederDelete: 'antennaFeeder/batchDeleteEquip', antennaFeederDelete: 'antennaFeeder/batchDeleteEquip',
antennaFeederDetail: 'antennaFeeder/detail', antennaFeederDetail: 'antennaFeeder/detail',
antennaFeederList: 'antennaFeeder/selectFeederPage', antennaFeederList: 'antennaFeeder/selectFeederPage',
updateFeederConf: 'antennaFeeder/updateFeederConf',
} }
// 铁路线 // 铁路线
export function railWaylist() { export function railWaylist() {
return request.post(path.railWaylist, ...arguments) return request.post(path.railWaylist, ...arguments)
} }
export function railWaydetail() { export function railWaydetail() {
return request.post(path.railWaydetail, ...arguments) return request.post(path.railWaydetail, ...arguments)
} }
export function railWaysave() { export function railWaysave() {
return request.post(path.railWaysave, ...arguments) return request.post(path.railWaysave, ...arguments)
} }
export function railWaybatchDelete() { export function railWaybatchDelete() {
return request.post(path.railWaybatchDelete, ...arguments) return request.post(path.railWaybatchDelete, ...arguments)
} }
export function railWayselectList() { export function railWayselectList() {
return request.post(path.railWayselectList, ...arguments) return request.post(path.railWayselectList, ...arguments)
} }
export function updateRailWay() {
return request.post(path.updateRailWay, ...arguments)
}
//站点 //站点
export function selectForSite() { export function selectForSite() {
return request.post(path.selectForSite, ...arguments) return request.post(path.selectForSite, ...arguments)
} }
export function sitelist() { export function sitelist() {
return request.post(path.sitelist, ...arguments) return request.post(path.sitelist, ...arguments)
} }
export function sitedetail() { export function sitedetail() {
return request.post(path.sitedetail, ...arguments) return request.post(path.sitedetail, ...arguments)
} }
export function sitesave() { export function sitesave() {
return request.post(path.sitesave, ...arguments) return request.post(path.sitesave, ...arguments)
} }
export function sitebatchDelete() { export function sitebatchDelete() {
return request.post(path.sitebatchDelete, ...arguments) return request.post(path.sitebatchDelete, ...arguments)
} }
export function siteselectList() {
export function siteselectList() {
return request.post(path.siteselectList, ...arguments) return request.post(path.siteselectList, ...arguments)
} }
//fsu export function updateSiteConf() {
return request.post(path.updateSiteConf, ...arguments)
}
export function selectForFsu() { //fsu
export function selectForFsu() {
return request.post(path.selectForFsu, ...arguments) return request.post(path.selectForFsu, ...arguments)
} }
export function selectFsuItem() {//fsu字典 export function selectFsuItem() {//fsu字典
return request.post(path.selectFsuItem, ...arguments) return request.post(path.selectFsuItem, ...arguments)
} }
export function fsulist() { export function fsulist() {
return request.post(path.fsuList, ...arguments) return request.post(path.fsuList, ...arguments)
} }
export function fsudetail() {
export function fsudetail() {
return request.post(path.fsudetail, ...arguments) return request.post(path.fsudetail, ...arguments)
} }
export function fsusave() { export function fsusave() {
return request.post(path.fsusave, ...arguments) return request.post(path.fsusave, ...arguments)
} }
export function fsubatchDelete() { export function fsubatchDelete() {
return request.post(path.fsubatchDelete, ...arguments) return request.post(path.fsubatchDelete, ...arguments)
} }
export function fsuselectList() {
export function fsuselectList() {
return request.post(path.fsuselectList, ...arguments) return request.post(path.fsuselectList, ...arguments)
} }
//监测 export function updateFsuConf() {
return request.post(path.updateFsuConf, ...arguments)
}
//监测
export function selectMonitorItem() { export function selectMonitorItem() {
return request.post(path.selectMonitorItem, ...arguments) return request.post(path.selectMonitorItem, ...arguments)
} }
export function monitorEquiplist() { export function monitorEquiplist() {
return request.post(path.monitorEquipList, ...arguments) return request.post(path.monitorEquipList, ...arguments)
} }
export function monitorEquipdetail() { export function monitorEquipdetail() {
return request.post(path.monitorEquipdetail, ...arguments) return request.post(path.monitorEquipdetail, ...arguments)
} }
export function monitorEquipsave() { export function monitorEquipsave() {
return request.post(path.monitorEquipsave, ...arguments) return request.post(path.monitorEquipsave, ...arguments)
} }
export function monitorEquipbatchDelete() { export function monitorEquipbatchDelete() {
return request.post(path.monitorEquipbatchDelete, ...arguments) return request.post(path.monitorEquipbatchDelete, ...arguments)
} }
export function monitorEquipselectList() { export function monitorEquipselectList() {
return request.post(path.monitorEquipselectList, ...arguments) return request.post(path.monitorEquipselectList, ...arguments)
} }
export function selectForEquip() { export function selectForEquip() {
return request.post(path.selectForEquip, ...arguments) return request.post(path.selectForEquip, ...arguments)
} }
export function updateMonitorEquipConf() {
return request.post(path.updateMonitorEquipConf, ...arguments)
}
//漏缆 //漏缆
export function leakyCablelist() { export function leakyCablelist() {
return request.post(path.leakyCableList, ...arguments) return request.post(path.leakyCableList, ...arguments)
} }
export function leakyCabledetail() { export function leakyCabledetail() {
return request.post(path.leakyCabledetail, ...arguments) return request.post(path.leakyCabledetail, ...arguments)
} }
export function leakyCablesave() { export function leakyCablesave() {
return request.post(path.leakyCablesave, ...arguments) return request.post(path.leakyCablesave, ...arguments)
} }
export function leakyCablebatchDelete() { export function leakyCablebatchDelete() {
return request.post(path.leakyCablebatchDelete, ...arguments) return request.post(path.leakyCablebatchDelete, ...arguments)
} }
export function leakyCableselectList() { export function leakyCableselectList() {
return request.post(path.leakyCableselectList, ...arguments) return request.post(path.leakyCableselectList, ...arguments)
} }
export function selectForCable() { export function selectForCable() {
return request.post(path.selectForCable, ...arguments) return request.post(path.selectForCable, ...arguments)
} }
export function updateLeakyCableConf() {
return request.post(path.updateLeakyCableConf, ...arguments)
}
// 天馈线 // 天馈线
export function antennaFeederSave() { export function antennaFeederSave() {
...@@ -170,3 +183,6 @@ export function antennaFeederDetail() { ...@@ -170,3 +183,6 @@ export function antennaFeederDetail() {
export function antennaFeederList() { export function antennaFeederList() {
return request.post(path.antennaFeederList, ...arguments) return request.post(path.antennaFeederList, ...arguments)
} }
export function updateFeederConf() {
return request.post(path.updateFeederConf, ...arguments)
}
\ No newline at end of file
...@@ -110,18 +110,16 @@ ...@@ -110,18 +110,16 @@
/> />
<el-table-column <el-table-column
prop="action" prop="action"
label="详细信息" label="操作"
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="handleView(row)" <el-link type="primary" :underline="false" @click="handleView(row)">查看</el-link>
>查看</el-link <el-link type="primary" :underline="false" @click="toEdit(row)">编辑</el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<Pagination <Pagination
:limit="FSUForm.size" :limit="FSUForm.size"
:page="FSUForm.current" :page="FSUForm.current"
...@@ -129,13 +127,22 @@ ...@@ -129,13 +127,22 @@
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
/> />
<el-dialog
title="编辑-FSU"
:visible.sync="visible"
width="40%"
:close-on-click-modal="false"
>
<fsu :curInfo="curInfo" :isEdit="1" @update="update" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import fsu from '@/views/setting/add/comp/FSU.vue'
import { import {
fsulist, fsulist,
fsubatchDelete, fsubatchDelete,
fsudetail,
railWaylist, railWaylist,
selectForSite, selectForSite,
} from "../../api"; } from "../../api";
...@@ -144,14 +151,13 @@ import download from "@/utils/download"; ...@@ -144,14 +151,13 @@ import download from "@/utils/download";
import { exportFsu } from "@/api/export"; import { exportFsu } from "@/api/export";
export default { export default {
props: [], props: [],
components: {}, components: {fsu},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
stationSelect: [], stationSelect: [],
stationSelect2: [], stationSelect2: [],
FSUForm: formInit(), FSUForm: formInit(),
visible: false, visible: false,
tableData: [], tableData: [],
params: { params: {
...@@ -164,10 +170,21 @@ export default { ...@@ -164,10 +170,21 @@ export default {
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [], exids: [],
curInfo: {}
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
toEdit(row) {
this.visible = true
this.curInfo = row
},
update(data) {
this.visible = false
if(data) {
this.getTableData()
}
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.FSUForm.wayId }).then((res) => { selectForSite({ wayId: this.FSUForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
...@@ -291,6 +308,9 @@ function formInit(data = {}) { ...@@ -291,6 +308,9 @@ function formInit(data = {}) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-link {
margin-right: 20px;
}
.leakage-cable { .leakage-cable {
.leakage-top { .leakage-top {
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -157,14 +157,13 @@ ...@@ -157,14 +157,13 @@
<el-table-column <el-table-column
prop="action" prop="action"
label="详细信息" label="操作"
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="handleView(row)" <el-link type="primary" :underline="false" @click="handleView(row)">查看</el-link>
>查看</el-link <el-link type="primary" :underline="false" @click="toEdit(row)">编辑</el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -175,13 +174,22 @@ ...@@ -175,13 +174,22 @@
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
/> />
<el-dialog
title="编辑-漏缆"
:visible.sync="visible"
width="40%"
:close-on-click-modal="false"
>
<leakyCable :curInfo="curInfo" :isEdit="1" @update="update" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import leakyCable from '@/views/setting/add/comp/leakyCable.vue'
import { import {
leakyCablelist, leakyCablelist,
leakyCablebatchDelete, leakyCablebatchDelete,
leakyCabledetail,
railWaylist, railWaylist,
selectForSite, selectForSite,
selectForFsu, selectForFsu,
...@@ -192,8 +200,7 @@ import { successAlert, warningAlert } from "@/utils/alert"; ...@@ -192,8 +200,7 @@ import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download"; import download from "@/utils/download";
import { exportLeaky } from "@/api/export"; import { exportLeaky } from "@/api/export";
export default { export default {
props: [], components: {leakyCable},
components: {},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -213,10 +220,21 @@ export default { ...@@ -213,10 +220,21 @@ export default {
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [], exids: [],
curInfo: {},
visible: false
}; };
}, },
computed: {},
methods: { methods: {
toEdit(row) {
this.visible = true
this.curInfo = row
},
update(data) {
this.visible = false
if(data) {
this.getTableData()
}
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.leakyCableForm.wayId }).then((res) => { selectForSite({ wayId: this.leakyCableForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
...@@ -358,6 +376,9 @@ function formInit(data = {}) { ...@@ -358,6 +376,9 @@ function formInit(data = {}) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-link {
margin-right: 20px;
}
.leakage-cable { .leakage-cable {
.leakage-top { .leakage-top {
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -157,14 +157,13 @@ ...@@ -157,14 +157,13 @@
<el-table-column <el-table-column
prop="action" prop="action"
label="详细信息" label="操作"
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="handleView(row)" <el-link type="primary" :underline="false" @click="handleView(row)">查看</el-link>
>查看</el-link <el-link type="primary" :underline="false" @click="toEdit(row)">编辑</el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -175,13 +174,22 @@ ...@@ -175,13 +174,22 @@
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
/> />
<el-dialog
title="编辑-天馈线"
:visible.sync="visible"
width="40%"
:close-on-click-modal="false"
>
<lineVue :curInfo="curInfo" :isEdit="1" @update="update" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import lineVue from "../../add/comp/line.vue";
import { import {
antennaFeederList, antennaFeederList,
antennaFeederDelete, antennaFeederDelete,
antennaFeederDetail,
railWaylist, railWaylist,
selectForSite, selectForSite,
selectForFsu, selectForFsu,
...@@ -192,8 +200,7 @@ import { successAlert, warningAlert } from "@/utils/alert"; ...@@ -192,8 +200,7 @@ import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download"; import download from "@/utils/download";
import { exportFeeder } from "@/api/export"; import { exportFeeder } from "@/api/export";
export default { export default {
props: [], components: {lineVue},
components: {},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -213,10 +220,21 @@ export default { ...@@ -213,10 +220,21 @@ export default {
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [], exids: [],
curInfo: {},
visible: false,
}; };
}, },
computed: {},
methods: { methods: {
toEdit(row) {
this.visible = true
this.curInfo = row
},
update(data) {
this.visible = false
if(data) {
this.getTableData()
}
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.form.wayId }).then((res) => { selectForSite({ wayId: this.form.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
...@@ -357,6 +375,9 @@ function formInit(data = {}) { ...@@ -357,6 +375,9 @@ function formInit(data = {}) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-link {
margin-right: 20px;
}
.leakage-cable { .leakage-cable {
.leakage-top { .leakage-top {
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -119,14 +119,13 @@ ...@@ -119,14 +119,13 @@
<el-table-column prop="fsuName" label="所在FSU" align="center" /> <el-table-column prop="fsuName" label="所在FSU" align="center" />
<el-table-column <el-table-column
prop="action" prop="action"
label="详细信息" label="操作"
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="handleView(row)" <el-link type="primary" :underline="false" @click="handleView(row)">查看</el-link>
>查看</el-link <el-link type="primary" :underline="false" @click="toEdit(row)">编辑</el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -137,13 +136,23 @@ ...@@ -137,13 +136,23 @@
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
/> />
<el-dialog
title="编辑-监测设备"
:visible.sync="visible"
width="40%"
:close-on-click-modal="false"
>
<monitor :curInfo="curInfo" :isEdit="1" @update="update" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import monitor from "../../add/comp/monitorEquip.vue";
import { import {
monitorEquiplist, monitorEquiplist,
monitorEquipbatchDelete, monitorEquipbatchDelete,
monitorEquipdetail,
railWaylist, railWaylist,
selectForSite, selectForSite,
selectForFsu, selectForFsu,
...@@ -152,8 +161,7 @@ import { successAlert, warningAlert } from "@/utils/alert"; ...@@ -152,8 +161,7 @@ import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download"; import download from "@/utils/download";
import { exportMonitorEquip } from "@/api/export"; import { exportMonitorEquip } from "@/api/export";
export default { export default {
props: [], components: {monitor},
components: {},
data() { data() {
return { return {
railWaySelect: [], railWaySelect: [],
...@@ -171,10 +179,21 @@ export default { ...@@ -171,10 +179,21 @@ export default {
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [], exids: [],
visible: false,
curInfo: {}
}; };
}, },
computed: {},
methods: { methods: {
toEdit(row) {
this.visible = true
this.curInfo = row
},
update(data) {
this.visible = false
if(data) {
this.getTableData()
}
},
changerailWay() { changerailWay() {
selectForSite({ wayId: this.monitorForm.wayId }).then((res) => { selectForSite({ wayId: this.monitorForm.wayId }).then((res) => {
this.stationSelect2 = res; this.stationSelect2 = res;
...@@ -183,7 +202,6 @@ export default { ...@@ -183,7 +202,6 @@ export default {
changesite() { changesite() {
selectForFsu({ siteId: this.monitorForm.siteId }).then((res) => { selectForFsu({ siteId: this.monitorForm.siteId }).then((res) => {
this.fsuSelect2 = res; this.fsuSelect2 = res;
console.log(this.fsuSelect2);
}); });
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
...@@ -197,7 +215,6 @@ export default { ...@@ -197,7 +215,6 @@ export default {
monitorEquipbatchDelete({ ids }).then((res) => { monitorEquipbatchDelete({ ids }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
successAlert("删除成功"); successAlert("删除成功");
this.getTableData(); this.getTableData();
} else { } else {
warningAlert("删除失败"); warningAlert("删除失败");
...@@ -302,6 +319,9 @@ function formInit(data = {}) { ...@@ -302,6 +319,9 @@ function formInit(data = {}) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-link {
margin-right: 20px;
}
.leakage-cable { .leakage-cable {
.leakage-top { .leakage-top {
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -91,18 +91,16 @@ ...@@ -91,18 +91,16 @@
/> />
<el-table-column <el-table-column
prop="action" prop="action"
label="详细信息" label="操作"
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="handleView(row)" <el-link type="primary" :underline="false" @click="handleView(row)">查看</el-link>
>查看</el-link <el-link type="primary" :underline="false" @click="toEdit(row)">编辑</el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<Pagination <Pagination
:limit="railData.size" :limit="railData.size"
:page="railData.current" :page="railData.current"
...@@ -110,16 +108,56 @@ ...@@ -110,16 +108,56 @@
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
/> />
<el-dialog
title="编辑-铁路线"
:visible.sync="visible"
width="30%"
:close-on-click-modal="false"
>
<el-form
ref="formData"
:model="formData"
:rules="rules"
label-width="200px"
class="form"
>
<el-form-item label="铁路名:" prop="name">
<el-input v-model="formData.name" placeholder="请输入铁路名" />
</el-form-item>
<el-form-item label="铁路线起点站名:" prop="startPointName">
<el-input
v-model="formData.startPointName"
placeholder="请输入铁路线起点站名"
/>
</el-form-item>
<el-form-item label="铁路线终点站名:" prop="endPointName">
<el-input
v-model="formData.endPointName"
placeholder="请输入铁路线终点站名"
/>
</el-form-item>
<el-form-item label="铁路全长(公里):" prop="totalLong">
<el-input
v-model="formData.totalLong"
placeholder="请输入铁路全长公里数"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { railWaylist, railWaydetail, railWaybatchDelete } from "../../api"; import { railWaylist, updateRailWay, railWaybatchDelete } from "../../api";
import { exportRailWay } from "@/api/export"; import { exportRailWay } from "@/api/export";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download"; import download from "@/utils/download";
export default { export default {
props: [],
components: {},
data() { data() {
return { return {
railData: formInit(), railData: formInit(),
...@@ -135,6 +173,19 @@ export default { ...@@ -135,6 +173,19 @@ export default {
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [], exids: [],
formData: {},
rules: {
name: [{ required: true, message: "请输入铁路名", trigger: "blur" }],
startPointName: [
{ required: true, message: "请输入铁路线起点站名", trigger: "blur" },
],
endPointName: [
{ required: true, message: "请输入铁路线终点站名", trigger: "blur" },
],
totalLong: [
{ required: true, pattern:/^0\.([1-9]|\d[1-9])$|^[1-9]\d{0,7}\.\d{0,2}$|^[1-9]\d{0,7}$/, message: "最大输入8位整数(小数点后最多2位)", trigger: "blur" },
],
},
}; };
}, },
computed: {}, computed: {},
...@@ -142,15 +193,11 @@ export default { ...@@ -142,15 +193,11 @@ export default {
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
return rowIndex % 2 === 0 ? "" : "single-row"; return rowIndex % 2 === 0 ? "" : "single-row";
}, },
changeType(item) {
this.activeName = item.key;
},
del() { del() {
let ids = this.ids; let ids = this.ids;
railWaybatchDelete({ ids }).then((res) => { railWaybatchDelete({ ids }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
successAlert("删除成功"); successAlert("删除成功");
this.getTableData(); this.getTableData();
} else { } else {
warningAlert("删除失败"); warningAlert("删除失败");
...@@ -168,7 +215,10 @@ export default { ...@@ -168,7 +215,10 @@ export default {
this.railData = formInit(); this.railData = formInit();
this.searchQuery(); this.searchQuery();
}, },
toEdit(row) {
this.visible = true
this.formData = editForm(row)
},
exportData() { exportData() {
if (this.exids.length == 0) { if (this.exids.length == 0) {
this.$message.warning("暂无数据"); this.$message.warning("暂无数据");
...@@ -181,12 +231,10 @@ export default { ...@@ -181,12 +231,10 @@ export default {
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
// console.log(val);
this.ids = this.multipleSelection.map((i) => i.id); this.ids = this.multipleSelection.map((i) => i.id);
}, },
handleView(row) { handleView(row) {
console.log(row);
this.$router.push({ this.$router.push({
path: "/detail", path: "/detail",
query: { query: {
...@@ -216,6 +264,16 @@ export default { ...@@ -216,6 +264,16 @@ export default {
} }
}); });
}, },
confirm() {
updateRailWay({...this.formData}).then(res => {
if(res.code == 200) {
this.$message.success('保存成功!')
}
this.getTableData()
this.visible = false
})
}
}, },
created() { created() {
var that = this; var that = this;
...@@ -240,6 +298,16 @@ function formInit(data = {}) { ...@@ -240,6 +298,16 @@ function formInit(data = {}) {
...data, ...data,
}; };
} }
function editForm(data = {}) {
return {
endPointName: "",
name: "",
startPointName: "",
totalLong: '',
...data,
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.leakage-cable { .leakage-cable {
...@@ -271,6 +339,9 @@ function formInit(data = {}) { ...@@ -271,6 +339,9 @@ function formInit(data = {}) {
} }
} }
} }
.el-link {
margin-right: 20px;
}
</style> </style>
<style lang="scss"> <style lang="scss">
.statistics-table { .statistics-table {
......
...@@ -89,18 +89,16 @@ ...@@ -89,18 +89,16 @@
<el-table-column prop="railWayName" label="所在铁路线" align="center" /> <el-table-column prop="railWayName" label="所在铁路线" align="center" />
<el-table-column <el-table-column
prop="action" prop="action"
label="详细信息" label="操作"
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="handleView(row)" <el-link type="primary" :underline="false" @click="handleView(row)">查看</el-link>
>查看</el-link <el-link type="primary" :underline="false" @click="toEdit(row)">编辑</el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<Pagination <Pagination
:limit="siteForm.size" :limit="siteForm.size"
:page="siteForm.current" :page="siteForm.current"
...@@ -108,22 +106,30 @@ ...@@ -108,22 +106,30 @@
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
/> />
<el-dialog
title="编辑-站点"
:visible.sync="visible"
width="40%"
:close-on-click-modal="false"
>
<station :curInfo="curInfo" :isEdit="1" @update="update" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { sitelist, sitebatchDelete, sitedetail, railWaylist } from "../../api"; import station from '@/views/setting/add/comp/station.vue'
import { sitelist, sitebatchDelete, railWaylist } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download"; import download from "@/utils/download";
import { exportSite } from "@/api/export"; import { exportSite } from "@/api/export";
export default { export default {
props: [], components: {station},
components: {},
data() { data() {
return { return {
siteForm: formInit(), siteForm: formInit(),
railWaySelect: [], railWaySelect: [],
visible: false, visible: false,
tableData: [], tableData: [],
params: { params: {
current: 1, current: 1,
...@@ -135,10 +141,20 @@ export default { ...@@ -135,10 +141,20 @@ export default {
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [], exids: [],
curInfo: {}
}; };
}, },
computed: {},
methods: { methods: {
toEdit(row) {
this.visible = true
this.curInfo = row
},
update(data) {
this.visible = false
if(data) {
this.getTableData()
}
},
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
return rowIndex % 2 === 0 ? "" : "single-row"; return rowIndex % 2 === 0 ? "" : "single-row";
}, },
...@@ -150,7 +166,6 @@ export default { ...@@ -150,7 +166,6 @@ export default {
sitebatchDelete({ ids }).then((res) => { sitebatchDelete({ ids }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
successAlert("删除成功"); successAlert("删除成功");
this.getTableData(); this.getTableData();
} else { } else {
warningAlert("删除失败"); warningAlert("删除失败");
...@@ -159,7 +174,6 @@ export default { ...@@ -159,7 +174,6 @@ export default {
}, },
refresh() { refresh() {
this.reset(); this.reset();
}, },
searchQuery() { searchQuery() {
this.istrue = 1; this.istrue = 1;
...@@ -251,6 +265,9 @@ function formInit(data = {}) { ...@@ -251,6 +265,9 @@ function formInit(data = {}) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-link {
margin-right: 20px;
}
.leakage-cable { .leakage-cable {
.leakage-top { .leakage-top {
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -14,12 +14,17 @@ ...@@ -14,12 +14,17 @@
<el-input v-model="form.realName" /> <el-input v-model="form.realName" />
</el-form-item> </el-form-item>
<el-form-item label="所在部门:" prop="deptId"> <el-form-item label="所在部门:" prop="deptId">
<el-select v-model="form.deptId" style="width:100%" placeholder="请选择"> <el-select
v-model="form.deptId"
style="width: 100%"
placeholder="请选择"
>
<el-option <el-option
v-for="item in departList" v-for="item in departList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -29,6 +34,16 @@ ...@@ -29,6 +34,16 @@
<el-form-item label="邮箱:"> <el-form-item label="邮箱:">
<el-input v-model="form.email" /> <el-input v-model="form.email" />
</el-form-item> </el-form-item>
<el-form-item label="是否为管理员:">
<el-switch
v-model="form.isAdmin"
active-color="#13ce66"
inactive-color="#ccc"
:active-value="1"
:inactive-value="0"
>
</el-switch>
</el-form-item>
</el-form> </el-form>
<span slot="footer"> <span slot="footer">
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">取消</el-button>
...@@ -42,7 +57,6 @@ import { formInit, rules } from '../../const' ...@@ -42,7 +57,6 @@ import { formInit, rules } from '../../const'
import { updateInfo, create } from '../../api' import { updateInfo, create } from '../../api'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'edit', name: 'edit',
data() { data() {
......
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 to comment