门口门禁开发
parent
ed0584275f
commit
69c66c667a
|
@ -0,0 +1,175 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="level-title">
|
||||
<h1>{{ this.$parent.AREA_ID == '' ? "新增" : "修改" }}</h1>
|
||||
</div>
|
||||
<div>
|
||||
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="区域名称:" prop="AREA_NAME">
|
||||
<el-input v-model="form.AREA_NAME" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="区域范围:">
|
||||
<el-input v-model="form.AREA_RANGE" placeholder="区域范围"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="区域级别:" prop="AREA_LEAVE">
|
||||
<el-select v-model="form.AREA_LEAVE" disabled style="width: 100%;">
|
||||
<el-option v-for="item in leaveList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="ui-foot">
|
||||
<el-button type="success" @click="confirm">保 存</el-button>
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import { requestFN } from '@/utils/request'
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
export default {
|
||||
|
||||
components: { Pagination, SelectTree },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
dialogFormVisible: false,
|
||||
dialogTableVisible: false,
|
||||
PERSON_CHARGE: '',
|
||||
DEPARTMENT_ID_OLD: '',
|
||||
form: {
|
||||
AREA_NAME: '',
|
||||
AREA_RANGE: '',
|
||||
AREA_LEAVE: '',
|
||||
AREA_PARENT_ID: '',
|
||||
AREA_ID: ''
|
||||
},
|
||||
riskForm: {},
|
||||
KEYWORDS: '',
|
||||
rules: {
|
||||
AREA_NAME: [{ required: true, message: '区域名称不为空', trigger: 'blur' }],
|
||||
AREA_LEAVE: [{ required: true, message: '区域级别不为空', trigger: 'blur' }]
|
||||
},
|
||||
formLabelWidth: '120px',
|
||||
fullscreenLoading: false,
|
||||
total: 0,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
multipleSelection: [],
|
||||
accidentList: [],
|
||||
leaveList: [
|
||||
{ ID: '1', NAME: '一级' },
|
||||
{ ID: '2', NAME: '二级' },
|
||||
{ ID: '3', NAME: '三级' }
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
async created() {
|
||||
this.AREA_ID = this.$parent.AREA_ID
|
||||
this.form.AREA_LEAVE = this.$parent.AREA_LEAVE
|
||||
this.form.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
||||
if (this.AREA_ID) {
|
||||
this.getDataByID()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
if (this.$parent.AREA_ID == '') {
|
||||
this.handleAdd()
|
||||
} else {
|
||||
if (valid) {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmjArea/edit',
|
||||
this.form
|
||||
).then((data) => {
|
||||
if (data.code != 0) {
|
||||
this.$message.warning(data.msg)
|
||||
} else {
|
||||
this.$message.success(data.msg)
|
||||
this.listLoading = false
|
||||
this.dialogFormEdit = false
|
||||
if (this.form.AREA_LEAVE === '1') {
|
||||
this.$parent.activeName = 'List'
|
||||
} else if (this.form.AREA_LEAVE === '2') {
|
||||
this.$parent.activeName = 'ListTwo'
|
||||
} else if (this.form.AREA_LEAVE === '3') {
|
||||
this.$parent.activeName = 'ListThree'
|
||||
}
|
||||
this.$parent.$refs.list.getList()
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
requestFN(
|
||||
'/mkmjArea/add',
|
||||
this.form
|
||||
).then((data) => {
|
||||
if (this.form.AREA_LEAVE === '1') {
|
||||
this.$parent.activeName = 'List'
|
||||
} else if (this.form.AREA_LEAVE === '2') {
|
||||
this.$parent.activeName = 'ListTwo'
|
||||
} else if (this.form.AREA_LEAVE === '3') {
|
||||
this.$parent.activeName = 'ListThree'
|
||||
}
|
||||
this.$parent.$refs.list.getList()
|
||||
}).catch((e) => {
|
||||
})
|
||||
},
|
||||
getDataByID() {
|
||||
this.listLoading = true
|
||||
this.dialogFormVisible = true
|
||||
requestFN(
|
||||
'/mkmjArea/goEdit',
|
||||
{ AREA_ID: this.AREA_ID }
|
||||
).then((data) => {
|
||||
this.form = data.pd
|
||||
this.dialogFormVisible = false
|
||||
}).catch((e) => {
|
||||
this.dialogFormVisible = false
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 返回列表
|
||||
goBack() {
|
||||
if (this.form.AREA_LEAVE === '1') {
|
||||
this.$parent.activeName = 'List'
|
||||
} else if (this.form.AREA_LEAVE === '2') {
|
||||
this.$parent.activeName = 'ListTwo'
|
||||
} else if (this.form.AREA_LEAVE === '3') {
|
||||
this.$parent.activeName = 'ListThree'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,198 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="level-title">
|
||||
<h1>{{ this.$parent.AREA_GATE_ID == '' ? "新增" : "修改" }}</h1>
|
||||
</div>
|
||||
<div>
|
||||
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="闸机名称:" prop="GATE_NAME">
|
||||
<el-input v-model="form.GATE_NAME" placeholder="闸机名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="闸机标识:">
|
||||
<el-input v-model="form.GATE_NUMBER" placeholder="闸机标识"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="闸机类型:" prop="GATE_TYPE">
|
||||
<el-select v-model="form.GATE_TYPE" style="width: 100%;">
|
||||
<el-option v-for="item in leaveList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="闸机型号:">
|
||||
<el-input v-model="form.GATE_MODEL" placeholder="闸机型号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="闸机位置:">
|
||||
<el-input v-model="form.GATE_POSITION" placeholder="闸机位置"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否相邻区域:" prop="IS_ADJACENT">
|
||||
<el-select v-model="form.IS_ADJACENT" style="width: 100%;">
|
||||
<el-option v-for="item in IsAdjacentList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item v-if="form.IS_ADJACENT=='1'" label="相邻区域:" prop="ADJACENT_AREA_ID">
|
||||
<el-select v-model="form.ADJACENT_AREA_ID" style="width: 100%;">
|
||||
<el-option v-for="item in AreaList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="ui-foot">
|
||||
<el-button type="success" @click="confirm">保 存</el-button>
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import { requestFN } from '@/utils/request'
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
export default {
|
||||
|
||||
components: { Pagination, SelectTree },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
dialogFormVisible: false,
|
||||
dialogTableVisible: false,
|
||||
PERSON_CHARGE: '',
|
||||
DEPARTMENT_ID_OLD: '',
|
||||
AREA_GATE_ID: '',
|
||||
form: {
|
||||
GATE_NAME: '',
|
||||
GATE_NUMBER: '',
|
||||
GATE_TYPE: '',
|
||||
GATE_MODEL: '',
|
||||
GATE_POSITION: '',
|
||||
IS_ADJACENT: '',
|
||||
ADJACENT_AREA_ID: '',
|
||||
AREA_ID: '',
|
||||
AREA_GATE_ID: ''
|
||||
},
|
||||
riskForm: {},
|
||||
KEYWORDS: '',
|
||||
rules: {
|
||||
GATE_NAME: [{ required: true, message: '闸机名称不为空', trigger: 'blur' }],
|
||||
GATE_TYPE: [{ required: true, message: '闸机类型不为空', trigger: 'blur' }],
|
||||
IS_ADJACENT: [{ required: true, message: '是否相邻区域不为空', trigger: 'blur' }],
|
||||
ADJACENT_AREA_ID: [{ required: true, message: '相邻区域不为空', trigger: 'blur' }]
|
||||
},
|
||||
formLabelWidth: '120px',
|
||||
fullscreenLoading: false,
|
||||
total: 0,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
multipleSelection: [],
|
||||
accidentList: [],
|
||||
leaveList: [
|
||||
{ ID: '1', NAME: '入' },
|
||||
{ ID: '2', NAME: '出' }
|
||||
],
|
||||
IsAdjacentList: [
|
||||
{ ID: '0', NAME: '否' },
|
||||
{ ID: '1', NAME: '是' }
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
async created() {
|
||||
this.form.AREA_ID = this.$parent.AREA_ID
|
||||
this.form.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
||||
this.AREA_GATE_ID = this.$parent.AREA_GATE_ID
|
||||
if (this.AREA_GATE_ID) {
|
||||
this.getDataByID()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.AREA_GATE_ID) {
|
||||
this.handleAdd()
|
||||
} else {
|
||||
if (valid) {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmjAreaGate/edit',
|
||||
this.form
|
||||
).then((data) => {
|
||||
if (data.code != 0) {
|
||||
this.$message.warning(data.msg)
|
||||
} else {
|
||||
this.$message.success(data.msg)
|
||||
this.listLoading = false
|
||||
this.dialogFormEdit = false
|
||||
this.$parent.activeName = 'ListGate'
|
||||
this.$parent.$refs.list.getList()
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
requestFN(
|
||||
'/mkmjAreaGate/add',
|
||||
this.form
|
||||
).then((data) => {
|
||||
this.$parent.AREA_GATE_ID = ''
|
||||
this.$parent.activeName = 'ListGate'
|
||||
this.$parent.$refs.list.getList()
|
||||
}).catch((e) => {
|
||||
})
|
||||
},
|
||||
getDataByID() {
|
||||
this.listLoading = true
|
||||
this.dialogFormVisible = true
|
||||
requestFN(
|
||||
'/mkmjAreaGate/goEdit',
|
||||
{ AREA_GATE_ID: this.AREA_GATE_ID }
|
||||
).then((data) => {
|
||||
this.form = data.pd
|
||||
this.dialogFormVisible = false
|
||||
}).catch((e) => {
|
||||
this.dialogFormVisible = false
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 返回列表
|
||||
goBack() {
|
||||
this.$parent.activeName = 'ListGate'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,253 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="rightCont">
|
||||
<el-form label-width="50px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="区域名称/编码" label-width="110px">
|
||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"/>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
ref="multipleTable"
|
||||
:data="varList"
|
||||
:row-key="getRowKey"
|
||||
border
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%">
|
||||
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column prop="GATE_NAME" label="闸机名称"/>
|
||||
<el-table-column prop="GATE_NUMBER" label="闸机标识"/>
|
||||
<el-table-column label="闸机类型">
|
||||
<template slot-scope="{row}">
|
||||
<span v-if="row.AREA_LEAVE === '1'" >入</span>
|
||||
<span v-if="row.AREA_LEAVE === '2'" >出</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="GATE_MODEL" label="闸机型号"/>
|
||||
<el-table-column prop="GATE_POSITION" label="闸机位置"/>
|
||||
<el-table-column prop="ADJACENT_AREA_NAME" label="相邻区域名称"/>
|
||||
<el-table-column label="操作" width="400">
|
||||
<template slot-scope="{row}">
|
||||
<el-button
|
||||
v-show="edit"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleEdit(row.AREA_GATE_ID)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="handleDelete(row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="page-btn-group">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList()"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-foot">
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import { requestFN } from '@/utils/request'
|
||||
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
|
||||
export default {
|
||||
|
||||
components: { Pagination, SelectTree },
|
||||
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
AREA_ID: '',
|
||||
AREA_LEAVE: '',
|
||||
addBtnType: true,
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
ls: [],
|
||||
dates: [],
|
||||
total: 0,
|
||||
KEYWORDS: '',
|
||||
// 树形菜单
|
||||
filterText: '',
|
||||
varList: [],
|
||||
pd: [],
|
||||
defaultProps: {
|
||||
value: 'id',
|
||||
children: 'nodes',
|
||||
label: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.AREA_LEAVE = this.$parent.AREA_LEAVE
|
||||
this.AREA_ID = this.$parent.AREA_ID
|
||||
this.getList()
|
||||
this.hasButton()
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
getRowKey(row) {
|
||||
return row.AREA_GATE_ID
|
||||
},
|
||||
selectable(row, index) {
|
||||
return row.ITEMCOUNT == 0
|
||||
},
|
||||
// 添加
|
||||
handleAdd() {
|
||||
this.$parent.activeName = 'EditGate'
|
||||
this.$parent.AREA_ID = this.AREA_ID
|
||||
this.$parent.AREA_GATE_ID == ''
|
||||
},
|
||||
// 搜索
|
||||
getQuery() {
|
||||
// this.$refs.multipleTable.clearSelection()
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
getList(pid) {
|
||||
this.listLoading = true
|
||||
this.varList = []
|
||||
this.HIDDENREGION_ID = pid
|
||||
requestFN(
|
||||
'/mkmjAreaGate/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
KEYWORDS: this.KEYWORDS,
|
||||
AREA_ID: this.AREA_ID
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
this.total = data.page.totalResult
|
||||
this.hasButton()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}, goKeyReset() {
|
||||
this.KEYWORDS = ''
|
||||
this.getList()
|
||||
},
|
||||
handleEdit(AREA_GATE_ID) {
|
||||
this.$parent.AREA_GATE_ID = AREA_GATE_ID
|
||||
this.$parent.activeName = 'EditGate'
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定要删除[' + row.GATE_NAME + ']吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmjAreaGate/delete',
|
||||
{
|
||||
AREA_GATE_ID: row.AREA_GATE_ID
|
||||
}
|
||||
).then(() => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.listLoading = false
|
||||
this.varList = []
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
hasButton: function() {
|
||||
var keys = 'listmanager:add,listmanager:del,listmanager:edit,toExcel'
|
||||
requestFN(
|
||||
'/head/hasButton',
|
||||
{
|
||||
keys: keys
|
||||
}
|
||||
).then((data) => {
|
||||
this.add = data.listmanagerfhadminadd // 新增权限
|
||||
this.del = data.listmanagerfhadmindel // 删除权限
|
||||
this.edit = data.listmanagerfhadminedit // 修改权限
|
||||
this.toExcel = data.toExcel // 导出到excel权限
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 返回列表
|
||||
goBack() {
|
||||
if (this.AREA_LEAVE === '1') {
|
||||
this.$parent.activeName = 'List'
|
||||
} else if (this.AREA_LEAVE === '2') {
|
||||
this.$parent.activeName = 'ListTwo'
|
||||
} else if (this.AREA_LEAVE === '3') {
|
||||
this.$parent.activeName = 'ListThree'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.returnBtn {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.app-container {
|
||||
display: flex; /**/
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.rightCont {
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,272 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="rightCont">
|
||||
<el-form label-width="50px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="区域名称/编码" label-width="110px">
|
||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"/>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
ref="multipleTable"
|
||||
:data="varList"
|
||||
:row-key="getRowKey"
|
||||
border
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%">
|
||||
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column label="区域名称">
|
||||
<template slot-scope="{row}">
|
||||
<span>
|
||||
<a style="color: #1e9fff;text-decoration:underline" @click="clickChild(row)">{{ row.AREA_NAME }}</a>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="AREA_RANGE" label="区域范围"/>
|
||||
<el-table-column label="区域级别">
|
||||
<template slot-scope="{row}">
|
||||
<span v-if="row.AREA_LEAVE === '1'" >一级</span>
|
||||
<span v-if="row.AREA_LEAVE === '2'" >二级</span>
|
||||
<span v-if="row.AREA_LEAVE === '3'" >三级</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="CHILDCOUNT" label="下级区域数"/>
|
||||
<el-table-column prop="GATECOUNT" label="区域下闸机数"/>
|
||||
<el-table-column label="操作" width="400">
|
||||
<template slot-scope="{row}">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-circle-close"
|
||||
size="mini"
|
||||
@click="handleClose(row.FIRE_REGION_ID,row.FIRE_REGION_NAME)">进出记录
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show="edit"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleEdit(row.AREA_ID)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="edit && row.CHILDCOUNT == 0"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="handleDelete(row)">删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-circle-check"
|
||||
size="mini"
|
||||
@click="handleOpen(row)">闸机
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="page-btn-group">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList()"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import { requestFN } from '@/utils/request'
|
||||
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
|
||||
export default {
|
||||
|
||||
components: { Pagination, SelectTree },
|
||||
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
AREA_ID: '',
|
||||
AREA_LEAVE: '1',
|
||||
AREA_PARENT_ID: '0',
|
||||
addBtnType: true,
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
ls: [],
|
||||
dates: [],
|
||||
total: 0,
|
||||
KEYWORDS: '',
|
||||
// 树形菜单
|
||||
filterText: '',
|
||||
varList: [],
|
||||
pd: [],
|
||||
defaultProps: {
|
||||
value: 'id',
|
||||
children: 'nodes',
|
||||
label: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
console.log(val)
|
||||
this.$refs.tree.filter(val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.hasButton()
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
getRowKey(row) {
|
||||
return row.AREA_ID
|
||||
},
|
||||
selectable(row, index) {
|
||||
return row.ITEMCOUNT == 0
|
||||
},
|
||||
// 添加
|
||||
handleAdd() {
|
||||
this.$parent.activeName = 'Edit'
|
||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
||||
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
|
||||
this.$parent.AREA_ID = this.AREA_ID
|
||||
},
|
||||
// 搜索
|
||||
getQuery() {
|
||||
// this.$refs.multipleTable.clearSelection()
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
getList(pid) {
|
||||
this.listLoading = true
|
||||
this.varList = []
|
||||
this.HIDDENREGION_ID = pid
|
||||
requestFN(
|
||||
'/mkmjArea/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
KEYWORDS: this.KEYWORDS,
|
||||
AREA_LEAVE: this.AREA_LEAVE,
|
||||
AREA_PARENT_ID: this.AREA_PARENT_ID
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
this.total = data.page.totalResult
|
||||
this.hasButton()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}, goKeyReset() {
|
||||
this.KEYWORDS = ''
|
||||
this.getList()
|
||||
},
|
||||
handleEdit(AREA_ID) {
|
||||
this.$parent.AREA_ID = AREA_ID
|
||||
this.$parent.activeName = 'Edit'
|
||||
},
|
||||
handleOpen(row) {
|
||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
||||
this.$parent.AREA_ID = row.AREA_ID
|
||||
this.$parent.activeName = 'ListGate'
|
||||
},
|
||||
clickChild(row) {
|
||||
this.$parent.AREA_PARENT_ID = row.AREA_ID
|
||||
this.$parent.AREA_OLD_ID = row.AREA_ID
|
||||
this.$parent.activeName = 'ListTwo'
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmjArea/delete',
|
||||
{
|
||||
AREA_ID: row.AREA_ID
|
||||
}
|
||||
).then(() => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.listLoading = false
|
||||
this.varList = []
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
hasButton: function() {
|
||||
var keys = 'listmanager:add,listmanager:del,listmanager:edit,toExcel'
|
||||
requestFN(
|
||||
'/head/hasButton',
|
||||
{
|
||||
keys: keys
|
||||
}
|
||||
).then((data) => {
|
||||
this.add = data.listmanagerfhadminadd // 新增权限
|
||||
this.del = data.listmanagerfhadmindel // 删除权限
|
||||
this.edit = data.listmanagerfhadminedit // 修改权限
|
||||
this.toExcel = data.toExcel // 导出到excel权限
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.returnBtn {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.app-container {
|
||||
display: flex; /**/
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.rightCont {
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,270 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="rightCont">
|
||||
<el-form label-width="50px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="区域名称/编码" label-width="110px">
|
||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"/>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
ref="multipleTable"
|
||||
:data="varList"
|
||||
:row-key="getRowKey"
|
||||
border
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%">
|
||||
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column prop="AREA_NAME" label="区域名称" />
|
||||
<el-table-column prop="AREA_RANGE" label="区域范围"/>
|
||||
<el-table-column label="区域级别">
|
||||
<template slot-scope="{row}">
|
||||
<span v-if="row.AREA_LEAVE === '1'" >一级</span>
|
||||
<span v-if="row.AREA_LEAVE === '2'" >二级</span>
|
||||
<span v-if="row.AREA_LEAVE === '3'" >三级</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="CHILDCOUNT" label="下级区域数"/>
|
||||
<el-table-column prop="GATECOUNT" label="区域下闸机数"/>
|
||||
<el-table-column label="操作" width="400">
|
||||
<template slot-scope="{row}">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-circle-close"
|
||||
size="mini"
|
||||
@click="handleClose(row.FIRE_REGION_ID,row.FIRE_REGION_NAME)">进出记录
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show="edit"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleEdit(row.AREA_ID)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="edit && row.CHILDCOUNT == 0"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="handleDelete(row)">删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-circle-check"
|
||||
size="mini"
|
||||
@click="handleOpen(row)">闸机
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="page-btn-group">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList()"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-foot">
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import { requestFN } from '@/utils/request'
|
||||
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
|
||||
export default {
|
||||
|
||||
components: { Pagination, SelectTree },
|
||||
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
AREA_ID: '',
|
||||
AREA_LEAVE: '3',
|
||||
AREA_PARENT_ID: '',
|
||||
addBtnType: true,
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
ls: [],
|
||||
dates: [],
|
||||
total: 0,
|
||||
KEYWORDS: '',
|
||||
// 树形菜单
|
||||
filterText: '',
|
||||
varList: [],
|
||||
pd: [],
|
||||
defaultProps: {
|
||||
value: 'id',
|
||||
children: 'nodes',
|
||||
label: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
console.log(val)
|
||||
this.$refs.tree.filter(val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
||||
this.getList()
|
||||
this.hasButton()
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
getRowKey(row) {
|
||||
return row.AREA_ID
|
||||
},
|
||||
selectable(row, index) {
|
||||
return row.ITEMCOUNT == 0
|
||||
},
|
||||
// 添加
|
||||
handleAdd() {
|
||||
this.$parent.activeName = 'Edit'
|
||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
||||
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
|
||||
this.$parent.AREA_ID = this.AREA_ID
|
||||
},
|
||||
// 搜索
|
||||
getQuery() {
|
||||
// this.$refs.multipleTable.clearSelection()
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
getList(pid) {
|
||||
this.listLoading = true
|
||||
this.varList = []
|
||||
this.HIDDENREGION_ID = pid
|
||||
requestFN(
|
||||
'/mkmjArea/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
KEYWORDS: this.KEYWORDS,
|
||||
AREA_LEAVE: this.AREA_LEAVE,
|
||||
AREA_PARENT_ID: this.AREA_PARENT_ID
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
this.total = data.page.totalResult
|
||||
this.hasButton()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}, goKeyReset() {
|
||||
this.KEYWORDS = ''
|
||||
this.getList()
|
||||
},
|
||||
handleEdit(AREA_ID) {
|
||||
this.$parent.AREA_ID = AREA_ID
|
||||
this.$parent.activeName = 'Edit'
|
||||
},
|
||||
handleOpen(row) {
|
||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
||||
this.$parent.AREA_ID = row.AREA_ID
|
||||
this.$parent.activeName = 'ListGate'
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmjArea/delete',
|
||||
{
|
||||
AREA_ID: row.AREA_ID
|
||||
}
|
||||
).then(() => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.listLoading = false
|
||||
this.varList = []
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
hasButton: function() {
|
||||
var keys = 'listmanager:add,listmanager:del,listmanager:edit,toExcel'
|
||||
requestFN(
|
||||
'/head/hasButton',
|
||||
{
|
||||
keys: keys
|
||||
}
|
||||
).then((data) => {
|
||||
this.add = data.listmanagerfhadminadd // 新增权限
|
||||
this.del = data.listmanagerfhadmindel // 删除权限
|
||||
this.edit = data.listmanagerfhadminedit // 修改权限
|
||||
this.toExcel = data.toExcel // 导出到excel权限
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 返回列表
|
||||
goBack() {
|
||||
this.$parent.AREA_LEAVE = '2'
|
||||
this.$parent.AREA_PARENT_ID = this.$parent.AREA_OLD_ID
|
||||
this.$parent.activeName = 'ListTwo'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.returnBtn {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.app-container {
|
||||
display: flex; /**/
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.rightCont {
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,280 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="rightCont">
|
||||
<el-form label-width="50px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="区域名称/编码" label-width="110px">
|
||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"/>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
ref="multipleTable"
|
||||
:data="varList"
|
||||
:row-key="getRowKey"
|
||||
border
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%">
|
||||
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column label="区域名称">
|
||||
<template slot-scope="{row}">
|
||||
<span>
|
||||
<a style="color: #1e9fff;text-decoration:underline" @click="clickChild(row)">{{ row.AREA_NAME }}</a>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="AREA_RANGE" label="区域范围"/>
|
||||
<el-table-column label="区域级别">
|
||||
<template slot-scope="{row}">
|
||||
<span v-if="row.AREA_LEAVE === '1'" >一级</span>
|
||||
<span v-if="row.AREA_LEAVE === '2'" >二级</span>
|
||||
<span v-if="row.AREA_LEAVE === '3'" >三级</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="CHILDCOUNT" label="下级区域数"/>
|
||||
<el-table-column prop="GATECOUNT" label="区域下闸机数"/>
|
||||
<el-table-column label="操作" width="400">
|
||||
<template slot-scope="{row}">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-circle-close"
|
||||
size="mini"
|
||||
@click="handleClose(row.FIRE_REGION_ID,row.FIRE_REGION_NAME)">进出记录
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show="edit"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleEdit(row.AREA_ID)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="edit && row.CHILDCOUNT == 0"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="handleDelete(row)">删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-circle-check"
|
||||
size="mini"
|
||||
@click="handleOpen(row)">闸机
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="page-btn-group">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList()"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-foot">
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import { requestFN } from '@/utils/request'
|
||||
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
|
||||
export default {
|
||||
|
||||
components: { Pagination, SelectTree },
|
||||
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
AREA_ID: '',
|
||||
AREA_LEAVE: '2',
|
||||
AREA_PARENT_ID: '',
|
||||
addBtnType: true,
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
ls: [],
|
||||
dates: [],
|
||||
total: 0,
|
||||
KEYWORDS: '',
|
||||
// 树形菜单
|
||||
filterText: '',
|
||||
varList: [],
|
||||
pd: [],
|
||||
defaultProps: {
|
||||
value: 'id',
|
||||
children: 'nodes',
|
||||
label: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
console.log(val)
|
||||
this.$refs.tree.filter(val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
||||
this.getList()
|
||||
this.hasButton()
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
getRowKey(row) {
|
||||
return row.AREA_ID
|
||||
},
|
||||
selectable(row, index) {
|
||||
return row.ITEMCOUNT == 0
|
||||
},
|
||||
// 添加
|
||||
handleAdd() {
|
||||
this.$parent.activeName = 'Edit'
|
||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
||||
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
|
||||
this.$parent.AREA_ID = this.AREA_ID
|
||||
},
|
||||
clickChild(row) {
|
||||
this.$parent.AREA_PARENT_ID = row.AREA_ID
|
||||
this.$parent.activeName = 'ListThree'
|
||||
},
|
||||
// 搜索
|
||||
getQuery() {
|
||||
// this.$refs.multipleTable.clearSelection()
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
getList(pid) {
|
||||
this.listLoading = true
|
||||
this.varList = []
|
||||
this.HIDDENREGION_ID = pid
|
||||
requestFN(
|
||||
'/mkmjArea/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
KEYWORDS: this.KEYWORDS,
|
||||
AREA_LEAVE: this.AREA_LEAVE,
|
||||
AREA_PARENT_ID: this.AREA_PARENT_ID
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
this.total = data.page.totalResult
|
||||
this.hasButton()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}, goKeyReset() {
|
||||
this.KEYWORDS = ''
|
||||
this.getList()
|
||||
},
|
||||
handleEdit(AREA_ID) {
|
||||
this.$parent.AREA_ID = AREA_ID
|
||||
this.$parent.activeName = 'Edit'
|
||||
},
|
||||
handleOpen(row) {
|
||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
||||
this.$parent.AREA_ID = row.AREA_ID
|
||||
this.$parent.activeName = 'ListGate'
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmjArea/delete',
|
||||
{
|
||||
AREA_ID: row.AREA_ID
|
||||
}
|
||||
).then(() => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.listLoading = false
|
||||
this.varList = []
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
hasButton: function() {
|
||||
var keys = 'listmanager:add,listmanager:del,listmanager:edit,toExcel'
|
||||
requestFN(
|
||||
'/head/hasButton',
|
||||
{
|
||||
keys: keys
|
||||
}
|
||||
).then((data) => {
|
||||
this.add = data.listmanagerfhadminadd // 新增权限
|
||||
this.del = data.listmanagerfhadmindel // 删除权限
|
||||
this.edit = data.listmanagerfhadminedit // 修改权限
|
||||
this.toExcel = data.toExcel // 导出到excel权限
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 返回列表
|
||||
goBack() {
|
||||
this.$parent.AREA_LEAVE = '1'
|
||||
this.$parent.AREA_PARENT_ID = '0'
|
||||
this.$parent.activeName = 'List'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.returnBtn {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.app-container {
|
||||
display: flex; /**/
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.rightCont {
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,47 @@
|
|||
<template>
|
||||
<!-- <component :is="activeName" />-->
|
||||
<div>
|
||||
<List v-if="activeName=='List'" ref="list" />
|
||||
<ListTwo v-if="activeName=='ListTwo'" />
|
||||
<ListThree v-if="activeName=='ListThree'" />
|
||||
<ListGate v-if="activeName=='ListGate'" />
|
||||
<Edit v-if="activeName=='Edit'" />
|
||||
<EditGate v-if="activeName=='EditGate'" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import List from './components/listOne'
|
||||
import ListTwo from './components/listTwo'
|
||||
import ListThree from './components/listThree'
|
||||
import ListGate from './components/listGate'
|
||||
import Edit from './components/edit'
|
||||
import EditGate from './components/editGate'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
List: List,
|
||||
Edit: Edit,
|
||||
ListTwo: ListTwo,
|
||||
ListThree: ListThree,
|
||||
ListGate: ListGate,
|
||||
EditGate: EditGate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'List'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
activeName(val) {
|
||||
if (val == 'List') {
|
||||
this.$refs.list.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue