Commit 53b30b7e authored by xinzhedeai's avatar xinzhedeai
parents 72c3563f fff35e9c
...@@ -39,5 +39,62 @@ export default { ...@@ -39,5 +39,62 @@ export default {
method: 'get', method: 'get',
params params
}) })
} },
// 报警列表
drybeachequipinforalarmList: (params) => {
return request({
url: 'tab/drybeachequipinfor/alarmList',
method: 'get',
params
})
},
//确认忽略报警
drybeachequipinforalarmListput: (params) => {
return request({
url: 'tab/drybeachequipinfor/alarmList',
method: 'put',
data:params
})
},
// 边坡设备列表
sensorList: (params) => {
return request({
url: 'data/mp/sensorList',
method: 'get',
params
})
},
// 温度设备列表
sensorListwen: (params) => {
return request({
url: 'data/sz/sensorList/wen',
method: 'get',
params
})
},
// 风速设备列表
sensorListfeng: (params) => {
return request({
url: 'data/sz/sensorList/feng',
method: 'get',
params
})
},
// 降雨设备列表
sensorListrg: (params) => {
return request({
url: '/data/rg/sensorList',
method: 'get',
params
})
},
//边坡设置报警级别
drybeachequipinforlevel: (params) => {
return request({
url: 'tab/drybeachequipinfor/level',
method: 'put',
data:params
})
},
} }
import request from '@/utils/request'
export default {
getkdFile: (pageParam) => {
return request({
url: 'api/kdFile',
method: 'get',
params: pageParam
})
},
// 新增
add: (notice) => {
return request({
url: 'api/notice/add',
method: 'post',
data: notice
})
},
// 标记已读(查询权限)
read: (responseId) => {
return request({
url: 'api/notice/read',
method: 'post',
data: {
id: responseId
}
})
},
// 删除
del: (notice) => {
return request({
url: 'api/notice/del',
method: 'post',
data: {
id: notice.id
}
})
}
}
\ No newline at end of file
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-button
class="filter-item"
size="mini"
@click="handleAlertManage"
>报警值管理</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="报警时间"
align="center"
>
</el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="state"
label="处置状态"
align="center"
>
<template slot-scope="scope">
<div v-if="scope.row.state==1">
未处置
</div>
<div v-if="scope.row.state==2">已确认</div>
<div v-if="scope.row.state==3">已忽略</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.state==1">
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,2)"
>确认报警</el-button
>
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,3)"
>忽略报警</el-button
>
</template>
<template v-else><div>已经处理</div></template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<el-dialog
title="报警值管理"
:visible.sync="open"
width="580px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="设备" prop="equipno">
<el-select
v-model="form.equipno"
multiple
placeholder="请选择设备"
>
<el-option
v-for="dict in equipnoData"
:key="dict.equipNo"
:label="dict.equipName"
:value="dict.equipNo"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="一级报警" prop="onelevelalarm">
<el-input-number
v-model="form.onelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级报警" prop="twolevelalarm">
<el-input-number
v-model="form.twolevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三级报警" prop="threelevelalarm">
<el-input-number
v-model="form.threelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="四级报警" prop="fourlevelalarm">
<el-input-number
v-model="form.fourlevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog2Show" title="报警处置" width="580px">
<div>
<span>是否操作报警数据?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog2Show=false">取消</el-button>
<el-button :loading="dialog2Saving" type="primary" @click="dialog2Submit">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
dialog2Saving:false,
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 0,
form:{},
equipnoData:[],
open:false,
dialog2Show:false,
dialog2form:{
id:null,
state:null,
}
};
},
components: { DateRangePicker },
mounted() {
this.search()
this.getsensorList()
},
methods: {
resetForm(){
this.form={
equipno:[],
onelevelalarm:0,
twolevelalarm:0,
threelevelalarm:0,
fourlevelalarm:0,
}
},
getData() {
this.loading = true;
API.drybeachequipinforalarmList({
page: this.page,
size: this.size,
deviceType:3,
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
getsensorList(){
API.sensorList().then(res=>{
this.equipnoData = res.body;
})
},
// clearSearch() {
// this.equipname = ''
// this.datarealtime = ''
// this.size = 10;
// this.page = 0;
// this.getData();
// },
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSure(row,state){
console.log(row.id)
this.dialog2Show = true
this.dialog2form.id = row.id;
this.dialog2form.state = state;
},
handleAlertManage(){
this.resetForm;
this.open = true;
},
submitForm(){
API.drybeachequipinforlevel(this.form).then(res => {
this.$message.success('设置成功');
this.open = false;
})
},
dialog2Submit(){
API.drybeachequipinforalarmListput(this.dialog2form).then(()=>{
this.$message.success('处置成功');
this.getData();
this.dialog2Show = false;
})
},
cancel(){
this.open = false;
}
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-button
class="filter-item"
size="mini"
@click="handleAlertManage"
>报警值管理</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="报警时间"
align="center"
>
</el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="state"
label="处置状态"
align="center"
>
<template slot-scope="scope">
<div v-if="scope.row.state==1">
未处置
</div>
<div v-if="scope.row.state==2">已确认</div>
<div v-if="scope.row.state==3">已忽略</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.state==1">
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,2)"
>确认报警</el-button
>
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,3)"
>忽略报警</el-button
>
</template>
<template v-else><div>已经处理</div></template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<el-dialog
title="报警值管理"
:visible.sync="open"
width="580px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="设备" prop="equipno">
<el-select
v-model="form.equipno"
multiple
placeholder="请选择设备"
>
<el-option
v-for="dict in equipnoData"
:key="dict.equipNo"
:label="dict.equipName"
:value="dict.equipNo"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="一级报警" prop="onelevelalarm">
<el-input-number
v-model="form.onelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级报警" prop="twolevelalarm">
<el-input-number
v-model="form.twolevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三级报警" prop="threelevelalarm">
<el-input-number
v-model="form.threelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="四级报警" prop="fourlevelalarm">
<el-input-number
v-model="form.fourlevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog2Show" title="报警处置" width="580px">
<div>
<span>是否操作报警数据?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog2Show=false">取消</el-button>
<el-button :loading="dialog2Saving" type="primary" @click="dialog2Submit">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
dialog2Saving:false,
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 0,
form:{},
equipnoData:[],
open:false,
dialog2Show:false,
dialog2form:{
id:null,
state:null,
}
};
},
components: { DateRangePicker },
mounted() {
this.search()
this.getsensorList()
},
methods: {
resetForm(){
this.form={
equipno:[],
onelevelalarm:0,
twolevelalarm:0,
threelevelalarm:0,
fourlevelalarm:0,
}
},
getData() {
this.loading = true;
API.drybeachequipinforalarmList({
page: this.page,
size: this.size,
deviceType:8,
different:'温度'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
getsensorList(){
API.sensorListwen().then(res=>{
this.equipnoData = res.body;
})
},
// clearSearch() {
// this.equipname = ''
// this.datarealtime = ''
// this.size = 10;
// this.page = 0;
// this.getData();
// },
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSure(row,state){
console.log(row.id)
this.dialog2Show = true
this.dialog2form.id = row.id;
this.dialog2form.state = state;
},
handleAlertManage(){
this.resetForm;
this.open = true;
},
submitForm(){
API.drybeachequipinforlevel(this.form).then(res => {
this.$message.success('设置成功');
this.open = false;
})
},
dialog2Submit(){
API.drybeachequipinforalarmListput(this.dialog2form).then(()=>{
this.$message.success('处置成功');
this.getData();
this.dialog2Show = false;
})
},
cancel(){
this.open = false;
}
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-button
class="filter-item"
size="mini"
@click="handleAlertManage"
>报警值管理</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="报警时间"
align="center"
>
</el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="state"
label="处置状态"
align="center"
>
<template slot-scope="scope">
<div v-if="scope.row.state==1">
未处置
</div>
<div v-if="scope.row.state==2">已确认</div>
<div v-if="scope.row.state==3">已忽略</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.state==1">
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,2)"
>确认报警</el-button
>
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,3)"
>忽略报警</el-button
>
</template>
<template v-else><div>已经处理</div></template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<el-dialog
title="报警值管理"
:visible.sync="open"
width="580px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="设备" prop="equipno">
<el-select
v-model="form.equipno"
multiple
placeholder="请选择设备"
>
<el-option
v-for="dict in equipnoData"
:key="dict.equipNo"
:label="dict.equipName"
:value="dict.equipNo"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="一级报警" prop="onelevelalarm">
<el-input-number
v-model="form.onelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级报警" prop="twolevelalarm">
<el-input-number
v-model="form.twolevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三级报警" prop="threelevelalarm">
<el-input-number
v-model="form.threelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="四级报警" prop="fourlevelalarm">
<el-input-number
v-model="form.fourlevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog2Show" title="报警处置" width="580px">
<div>
<span>是否操作报警数据?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog2Show=false">取消</el-button>
<el-button :loading="dialog2Saving" type="primary" @click="dialog2Submit">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
dialog2Saving:false,
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 0,
form:{},
equipnoData:[],
open:false,
dialog2Show:false,
dialog2form:{
id:null,
state:null,
}
};
},
components: { DateRangePicker },
mounted() {
this.search()
this.getsensorList()
},
methods: {
resetForm(){
this.form={
equipno:[],
onelevelalarm:0,
twolevelalarm:0,
threelevelalarm:0,
fourlevelalarm:0,
}
},
getData() {
this.loading = true;
API.drybeachequipinforalarmList({
page: this.page,
size: this.size,
deviceType:8,
different:'风速'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
getsensorList(){
API.sensorListfeng().then(res=>{
this.equipnoData = res.body;
})
},
// clearSearch() {
// this.equipname = ''
// this.datarealtime = ''
// this.size = 10;
// this.page = 0;
// this.getData();
// },
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSure(row,state){
console.log(row.id)
this.dialog2Show = true
this.dialog2form.id = row.id;
this.dialog2form.state = state;
},
handleAlertManage(){
this.resetForm;
this.open = true;
},
submitForm(){
API.drybeachequipinforlevel(this.form).then(res => {
this.$message.success('设置成功');
this.open = false;
})
},
dialog2Submit(){
API.drybeachequipinforalarmListput(this.dialog2form).then(()=>{
this.$message.success('处置成功');
this.getData();
this.dialog2Show = false;
})
},
cancel(){
this.open = false;
}
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-button
class="filter-item"
size="mini"
@click="handleAlertManage"
>报警值管理</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="报警时间"
align="center"
>
</el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="state"
label="处置状态"
align="center"
>
<template slot-scope="scope">
<div v-if="scope.row.state==1">
未处置
</div>
<div v-if="scope.row.state==2">已确认</div>
<div v-if="scope.row.state==3">已忽略</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.state==1">
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,2)"
>确认报警</el-button
>
<el-button
size="mini"
type="text"
@click="handleSure(scope.row,3)"
>忽略报警</el-button
>
</template>
<template v-else><div>已经处理</div></template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<el-dialog
title="报警值管理"
:visible.sync="open"
width="580px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="设备" prop="equipno">
<el-select
v-model="form.equipno"
multiple
placeholder="请选择设备"
>
<el-option
v-for="dict in equipnoData"
:key="dict.equipNo"
:label="dict.equipName"
:value="dict.equipNo"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="一级报警" prop="onelevelalarm">
<el-input-number
v-model="form.onelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级报警" prop="twolevelalarm">
<el-input-number
v-model="form.twolevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三级报警" prop="threelevelalarm">
<el-input-number
v-model="form.threelevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="四级报警" prop="fourlevelalarm">
<el-input-number
v-model="form.fourlevelalarm"
controls-position="right"
:min="0"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog2Show" title="报警处置" width="580px">
<div>
<span>是否操作报警数据?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog2Show=false">取消</el-button>
<el-button :loading="dialog2Saving" type="primary" @click="dialog2Submit">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
dialog2Saving:false,
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 0,
form:{},
equipnoData:[],
open:false,
dialog2Show:false,
dialog2form:{
id:null,
state:null,
}
};
},
components: { DateRangePicker },
mounted() {
this.search()
this.getsensorList()
},
methods: {
resetForm(){
this.form={
equipno:[],
onelevelalarm:0,
twolevelalarm:0,
threelevelalarm:0,
fourlevelalarm:0,
}
},
getData() {
this.loading = true;
API.drybeachequipinforalarmList({
page: this.page,
size: this.size,
deviceType:6,
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
getsensorList(){
API.sensorListrg().then(res=>{
this.equipnoData = res.body;
})
},
// clearSearch() {
// this.equipname = ''
// this.datarealtime = ''
// this.size = 10;
// this.page = 0;
// this.getData();
// },
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSure(row,state){
console.log(row.id)
this.dialog2Show = true
this.dialog2form.id = row.id;
this.dialog2form.state = state;
},
handleAlertManage(){
this.resetForm;
this.open = true;
},
submitForm(){
API.drybeachequipinforlevel(this.form).then(res => {
this.$message.success('设置成功');
this.open = false;
})
},
dialog2Submit(){
API.drybeachequipinforalarmListput(this.dialog2form).then(()=>{
this.$message.success('处置成功');
this.getData();
this.dialog2Show = false;
})
},
cancel(){
this.open = false;
}
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-select v-model="searchParam._mineIndex" placeholder="所属矿山" clearable size="small" class="filter-item" style="width: 200px;">
<el-option v-for="mine in mineList" :key="mine.index" :label="mine.name" :value="mine.index" />
</el-select>
<el-input v-model="searchParam.nameLike" clearable size="small" placeholder="物资名称" style="width: 200px;" class="filter-item" />
<el-select v-model="searchParam.dict37" :disabled="searchParam._mineIndex==null" clearable size="small" placeholder="物资类型" style="width: 200px;" class="filter-item">
<el-option v-for="item in dict37ListSearchParam" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="searchParamReset">重置</el-button>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip>
</div>
<!-- <el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="doAdd()">新增</el-button> -->
</div>
<!--弹出框1-->
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog1Show" :title="editState==1?'新增':editState==2?'修改':'查看'" width="960px">
<el-form ref="dialog1Form" :model="dialog1Data" :hide-required-asterisk="!dialog1Editing" :rules="dialog1Rules" size="mini" label-width="180px" style="margin-right: 80px;">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物资类型:" prop="dict37">
<span v-show="!dialog1Editing">{{ dialog1Data.dict37Name }}</span>
<el-select v-show="dialog1Editing" v-model="dialog1Data.dict37" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict37List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="照片:" prop="photoPath">
<div v-for="file in dialog1Data._fileList" v-show="!dialog1Editing" :key="file.url">
<el-link type="primary" @click="openFile(file)">{{ file.name }}</el-link>
</div>
<el-upload
v-show="dialog1Editing"
class="upload-demo"
action="/api/file/upload"
multiple
:headers="httpHeaders"
:limit="1"
:on-success="upFileSuccess"
:on-remove="upFileRemove"
:on-error="upFileError"
:on-exceed="upFileExceed"
:before-upload="upFileBefore"
:on-preview="openFile"
:file-list="dialog1Data._fileListShow"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过20M</div>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div v-show="dialog1Editing" slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog1Show=false">取消</el-button>
<el-button :loading="dialog1Saving" type="primary" @click="dialog1Submit">确认</el-button>
</div>
</el-dialog>
<!--弹出框2-->
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog2Show" :title="'确认删除'" width="580px">
<div>
<span>确认要删除物资:</span><span style="font-weight: bold;">{{ dialog2Data.name }}</span><span>吗?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog2Show=false">取消</el-button>
<el-button :loading="dialog2Saving" type="primary" @click="dialog2Submit">确认</el-button>
</div>
</el-dialog>
<!--表格-->
<el-table ref="table" v-loading="searching" :data="tableData" row-key="id">
<el-table-column :show-overflow-tooltip="true" prop="id" label="编号" width="100px" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="mineName" label="所属矿山" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="name" label="名称" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="dict37Name" label="物资类型" align="center" />
<el-table-column label="操作" width="300px" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" round @click="doEdit(scope.row.id,false)">查看</el-button>
<!-- <el-button size="mini" round @click="doEdit(scope.row.id,true)">修改</el-button> -->
<!-- <el-button size="mini" round @click="doDelete(scope.row.id)">删除</el-button> -->
</template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="searchParam.page"
:page-size.sync="searchParam.count"
:total="searchResult.total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="searchSubmit"
@current-change="searchSubmit"
/>
</div>
</template>
<script>
import emergencySuppliesApi from '@/api/kd/emergencySupplies'
import dictionaryApi from '@/api/kd/dictionary'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
import AMapSearchPoint from '@/components/AMap/AMapSearchPoint'
import mineApi from '@/api/kd/mine'
import { downloadFile } from '@/utils'
import picApi from '@/api/picManage/pic'
const searchParam = {// 默认搜索条件
page: 1,
count: 10,
enterpriseId:5,
type:8,
}
export default {
name: 'CEmergencySupplies', // 本页面名
components: { AMapSearchPoint },
data() {
return {
mineList: [],
httpHeaders: {
'Authorization': getToken()
},
dict37List: [],
dict38List: [],
dict39List: [],
searching: false,
exporting: false,
searchParam: {},
searchResult: {
total: 0,
results: [] // 搜索结果
},
dialog1Show: false,
dialog1Editing: false,
dialog1Saving: false,
dialog1Data: {},
dialog1Rules: {
name: [
{ required: true, message: '请填写' }
],
brand: [
{ required: true, message: '请填写' }
]
},
editState: 0, // (刚打开窗口时)记录了上次窗口作用;(保存编辑时)记录了当前窗口作用; 0无 1新增 2修改 3查看
addingData: {}, // 上次正在新增时的内容,下次打开dialog1窗口时记录下来
dialog2Show: false,
dialog2Saving: false,
dialog2Data: {}
}
},
computed: {
...mapGetters([
'user',
'baseApi'
]),
dict37ListSearchParam() {
const result = []
if (!this.searchParam._mineIndex) {
return result
}
const mine = this.mineList[this.searchParam._mineIndex - 1]
for (const i in this.dict37List) {
if (this.dict37List[i] && this.dict37List[i].enterpriseId === mine.enterpriseId) {
result.push(this.dict37List[i])
}
}
return result
},
tableData() {
// 此处对返回值进行算法重组
return this.searchResult.results
},
mapPoint() {
if (this.dialog1Data.longitude && this.dialog1Data.latitude) {
return [this.dialog1Data.longitude * 1, this.dialog1Data.latitude * 1]
}
return null
}
},
mounted() {
// 字典选项卡
const dictGroups = [37, 38, 39]
dictGroups.forEach(i => {
dictionaryApi.getList({ 'groupCode': i }).then(response => {
this['dict' + i + 'List'] = response.results
})
})
// 矿山选项卡
mineApi.getEnableMine().then(response => {
let i = 1
response.results.forEach(x => { x.index = i++ })
this.mineList = response.results
})
// this.searchParamReset()
// this.searchSubmit()
this.getData()
},
methods: {
getData(){
picApi.getkdFile(this.searchParam).then(response => {
console.log(response)
})
},
searchParamReset() {
this.searchParam = JSON.parse(JSON.stringify(searchParam))
},
searchSubmit() {
this.searching = true
if (this.searchParam._mineIndex) {
const mine = this.mineList[this.searchParam._mineIndex - 1]
this.searchParam.mineType = mine.mineType
this.searchParam.mineId = mine.id
} else {
this.searchParam.mineType = null
this.searchParam.mineId = null
}
emergencySuppliesApi.getPage(this.searchParam).then(response => {
this.searching = false
this.searchResult = response
}).catch(() => {
this.searching = false
})
},
exportSubmit() {
this.exporting = true
if (this.searchParam._mineIndex) {
const mine = this.mineList[this.searchParam._mineIndex - 1]
this.searchParam.mineType = mine.mineType
this.searchParam.mineId = mine.id
} else {
this.searchParam.mineType = null
this.searchParam.mineId = null
}
emergencySuppliesApi.export(this.searchParam).then(response => {
downloadFile(response, '物资装备', 'xlsx')
this.exporting = false
}).catch(() => {
this.exporting = false
})
},
dialog1Submit() {
this.$refs['dialog1Form'].validate(valid => {
if (!valid) {
this.$message.error('请检查填写内容')
return
} else {
this.dialog1Saving = true
if (this.dialog1Data._fileList) {
this.dialog1Data.photoPath = JSON.stringify(this.dialog1Data._fileList)
}
if (this.editState === 1) { // 新增
emergencySuppliesApi.add(this.dialog1Data).then(() => {
this.dialog1Show = false
this.$message.success('保存成功')
setTimeout(() => { // 立即清除会导致输入框Validate一闪变红
this.dialog1Data = {}
this.dialog1Saving = false
}, 500)
this.searchSubmit()
}).catch(() => {
this.dialog1Saving = false
})
} else if (this.editState === 2) { // 修改
emergencySuppliesApi.set(this.dialog1Data).then(() => {
this.dialog1Show = false
this.$message.success('修改成功')
setTimeout(() => { // 立即清除会导致输入框Validate一闪变红
this.dialog1Data = {}
this.dialog1Saving = false
}, 500)
this.searchSubmit()
}).catch(() => {
this.dialog1Saving = false
})
} else {
this.$message.error('出错啦,请重试')
this.dialog1Saving = false
}
}
})
},
beforeDialog1Open() { // 窗口打开前的统一操作
if (this.editState === 1) {
this.addingData = this.dialog1Data
}
},
doAdd() {
this.beforeDialog1Open()
this.editState = 1
this.dialog1Editing = true
this.dialog1Data = this.addingData // 初始值:上次编辑的内容
this.dialog1Show = true
this.$nextTick(() => {
this.$refs['dialog1Form'].clearValidate()
})
},
doEdit(id, isEdit) {
this.beforeDialog1Open()
this.editState = isEdit ? 2 : 3
emergencySuppliesApi.getById(id).then(response => {
this.dialog1Data = response
if (this.dialog1Data.photoPath) {
this.dialog1Data._fileList = JSON.parse(this.dialog1Data.photoPath)
this.dialog1Data._fileListShow = JSON.parse(this.dialog1Data.photoPath) // 数据存放与原始绑定分开,可以防止中途赋值产生的闪烁问题
}
this.dialog1Editing = isEdit
this.dialog1Show = true
}).catch(() => {
this.searchSubmit()
})
},
dialog2Submit() {
this.dialog2Saving = true
emergencySuppliesApi.del(this.dialog2Data).then(() => {
this.dialog2Show = false
this.$message.success('删除成功')
this.dialog2Data = {}
this.dialog2Saving = false
this.searchSubmit()
}).catch(() => {
this.dialog2Saving = false
})
},
doDelete(id) {
emergencySuppliesApi.getById(id).then(response => {
this.dialog2Data = response
this.dialog2Show = true
}).catch(() => {
this.searchSubmit()
})
},
elementuiUpListFormat(fileList) {
const filePathArray = []
fileList.forEach(f => {
if (f.response && f.response.result) {
filePathArray.push({
name: f.name,
url: f.response.result
})
} else if (f.name && f.url) {
filePathArray.push({
name: f.name,
url: f.url
})
}
})
return filePathArray
},
upFileSuccess(response, file, fileList) {
if (!this.dialog1Data._fileList) {
this.dialog1Data._fileList = []
}
this.dialog1Data._fileList.push({
name: file.name,
url: response.result
})
},
upFileRemove(file, fileList) {
this.dialog1Data._fileList = this.elementuiUpListFormat(fileList)
},
upFileError() {
this.$message.error('上传失败,请稍后再试')
},
upFileExceed() {
this.$message.error('文件数量已达上限')
},
upFileBefore(file) {
const isIMG = file.type === 'image/jpeg' || file.type === 'image/png'
const isLtSize = file.size / 1024 / 1024 < 20
if (!isIMG) {
this.$message.error('上传图片只能是 JPG/JPEG/PNG 格式')
return false
}
if (!isLtSize) {
this.$message.error('上传图片大小不能超过 20MB')
return false
}
return true
},
openFile(file) {
if (file.url) {
window.open(this.baseApi + '/file' + file.url)
} else if (file.response && file.response.result) {
window.open(this.baseApi + '/file' + file.response.result)
}
},
choosePoint(lnglat) {
if (lnglat) {
this.dialog1Data.longitude = lnglat[0]
this.dialog1Data.latitude = lnglat[1]
} else {
this.dialog1Data.longitude = null
this.dialog1Data.latitude = null
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<el-select v-model="searchParam._mineIndex" placeholder="所属矿山" clearable size="small" class="filter-item" style="width: 200px;">
<el-option v-for="mine in mineList" :key="mine.index" :label="mine.name" :value="mine.index" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">查看</el-button>
</div>
<!--图-->
<template v-if="underfloorPlanListShow && underfloorPlanListShow.length>0">
<div style="width: 100%;">
<el-image v-for="file in underfloorPlanListShow" :key="file.url" style="width: 100%; height: auto" :src="baseApi+'/file'+file.url" fit="contain" />
</div>
</template>
</div>
</template>
<script>
import mineApi from '@/api/picManage/pic'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
name: 'CUnderfloorPlan', // 本页面名:没有Person前缀!这个功能和person没有直接关系~
components: {},
data() {
return {
mineList: [],
httpHeaders: {
'Authorization': getToken()
},
searchParam: {},
underfloorPlanPath: null,
underfloorPlanList: [],
underfloorPlanListShow: []
}
},
computed: {
...mapGetters([
'user',
'baseApi'
])
},
mounted() {
let form = {
enterpriseId:5,
page:1,
size:10
}
// 矿山选项卡
mineApi.getkdFile(form).then(response => {
// let i = 1
// response.results.forEach(x => { x.index = i++ })
// this.mineList = response.results
})
},
methods: {
searchSubmit() {
this.underfloorPlanPath = null
this.underfloorPlanList = []
this.underfloorPlanListShow = []
if (this.searchParam._mineIndex) {
const mine = this.mineList[this.searchParam._mineIndex - 1]
this.searchParam.mineType = mine.mineType
this.searchParam.mineId = mine.id
} else {
this.$message.warning('请选择矿山')
return
}
mineApi.getUndergroundById(this.searchParam.mineId).then(response => {
this.underfloorPlanPath = response.underfloorPlanPath
if (this.underfloorPlanPath) {
this.underfloorPlanListShow = JSON.parse(this.underfloorPlanPath)
} else {
this.$message.warning('当前矿山未上传井下平面图')
}
})
},
submit() {
this.underfloorPlanPath = JSON.stringify(this.underfloorPlanList)
console.log(this.underfloorPlanPath)
mineApi.setUnderground({
id: this.searchParam.mineId,
underfloorPlanPath: this.underfloorPlanPath
}).then(() => {
this.$message.success('修改成功')
this.searchSubmit()
})
},
upFileSuccess(response, file, fileList) {
if (!this.underfloorPlanList) {
this.underfloorPlanList = []
}
this.underfloorPlanList.push({
name: file.name,
url: response.result
})
},
upFileError() {
this.$message.error('上传失败,请稍后再试')
},
upFileRemove() {
this.underfloorPlanList = []
},
upFileBefore(file) {
const isIMG = file.type === 'image/jpeg' || file.type === 'image/png'
const isLtSize = file.size / 1024 / 1024 < 20
if (!isIMG) {
this.$message.error('上传图片只能是 JPG/JPEG/PNG 格式')
return false
}
if (!isLtSize) {
this.$message.error('上传图片大小不能超过 20MB')
return false
}
return true
},
upFileExceed() {
this.$message.error('您已经上传了一张图,请删除后重新上传')
},
openFile(file) {
if (file.url) {
window.open(this.baseApi + '/file' + file.url)
} else if (file.response && file.response.result) {
window.open(this.baseApi + '/file' + file.response.result)
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
1
</div>
</template>
\ No newline at end of file
<template>
<div class="app-container">
1
</div>
</template>
\ No newline at end of file
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<el-select v-model="searchParam._mineIndex" placeholder="所属矿山" clearable size="small" class="filter-item" style="width: 200px;">
<el-option v-for="mine in mineList" :key="mine.id" :label="mine.name" :value="mine.id" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">查看</el-button>
</div>
<!--图-->
<template v-if="underfloorPlanListShow && underfloorPlanListShow.length>0">
<div style="width: 100%;">
<el-image v-for="file in underfloorPlanListShow" :key="file.url" style="width: 100%; height: auto" :src="baseApi+'/file'+file.url" fit="contain" />
</div>
</template>
</div>
</template>
<script>
import mineApi from '@/api/kd/mine'
import picApi from '@/api/picManage/pic'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
name: 'CUnderfloorPlan', // 本页面名:没有Person前缀!这个功能和person没有直接关系~
components: {},
data() {
return {
dataList:[],
total:0,
form:{},
searchForm:{
page:1,
size:10,
type:8,
enterpriseId:5,
},
mineList: [],
httpHeaders: {
'Authorization': getToken()
},
searchParam: {},
underfloorPlanPath: null,
underfloorPlanList: [],
underfloorPlanListShow: []
}
},
computed: {
...mapGetters([
'user',
'baseApi'
])
},
mounted() {
// 矿山选项卡
mineApi.getEnableMine().then(response => {
let i = 1
response.results.forEach(x => { x.index = i++ })
this.mineList = response.results
})
// 矿山选项卡
},
methods: {
reset(){
this.form={
enterpriseId:null,
fileName:null,
filePath:null,
id:null,
type:8,
}
},
getData(){
picApi.getkdFile(this.searchForm).then(response => {
this.dataList = response.body.list
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
1
</div>
</template>
\ No newline at end of file
<template>
<div class="app-container">
1
</div>
</template>
\ No newline at end of file
<template>
<div class="app-container">
1
</div>
</template>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="head-container"> <div class="head-container">
<div v-if="crud.props.searchToggle"> <div v-if="crud.props.searchToggle">
<!-- 搜索 --> <!-- 搜索 -->
<el-input v-model="query.name" clearable size="small" placeholder="输入部门名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.name" clearable size="small" placeholder="输入行政区划名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<date-range-picker v-model="query.createTime" class="date-item" /> <date-range-picker v-model="query.createTime" class="date-item" />
<el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 90px" @change="crud.toQuery"> <el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 90px" @change="crud.toQuery">
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" /> <el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
</div> </div>
<!--表单组件--> <!--表单组件-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="600px">
<el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="部门名称" prop="name"> <el-form-item label="行政区划名称" prop="name">
<el-input v-model="form.name" style="width: 370px;" /> <el-input v-model="form.name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="部门排序" prop="deptSort"> <el-form-item label="行政区划排序" prop="deptSort">
<el-input-number <el-input-number
v-model.number="form.deptSort" v-model.number="form.deptSort"
:min="0" :min="0"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
style="width: 370px;" style="width: 370px;"
/> />
</el-form-item> </el-form-item>
<el-form-item label="顶级部门"> <el-form-item label="顶级行政区划">
<el-radio-group v-model="form.isTop" style="width: 140px"> <el-radio-group v-model="form.isTop" style="width: 140px">
<el-radio label="1"></el-radio> <el-radio label="1"></el-radio>
<el-radio label="0"></el-radio> <el-radio label="0"></el-radio>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<el-form-item label="状态" prop="enabled"> <el-form-item label="状态" prop="enabled">
<el-radio v-for="item in dict.dept_status" :key="item.id" v-model="form.enabled" :label="item.value">{{ item.label }}</el-radio> <el-radio v-for="item in dict.dept_status" :key="item.id" v-model="form.enabled" :label="item.value">{{ item.label }}</el-radio>
</el-form-item> </el-form-item>
<el-form-item v-if="form.isTop === '0'" style="margin-bottom: 0;" label="上级部门" prop="pid"> <el-form-item v-if="form.isTop === '0'" style="margin-bottom: 0;" label="上级行政区划" prop="pid">
<treeselect <treeselect
v-model="form.pid" v-model="form.pid"
:load-options="loadDepts" :load-options="loadDepts"
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
name: 'Dept', name: 'Dept',
components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker }, components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker },
cruds() { cruds() {
return CRUD({ title: '部门', url: 'api/dept', crudMethod: { ...crudDept }}) return CRUD({ title: '行政区划', url: 'api/dept', crudMethod: { ...crudDept }})
}, },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
// 设置数据字典 // 设置数据字典
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
}) })
}) })
}, },
// 获取弹窗内部门数据 // 获取弹窗内行政区划数据
loadDepts({ action, parentNode, callback }) { loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) { if (action === LOAD_CHILDREN_OPTIONS) {
crudDept.getDepts({ enabled: true, pid: parentNode.id }).then(res => { crudDept.getDepts({ enabled: true, pid: parentNode.id }).then(res => {
...@@ -208,7 +208,7 @@ export default { ...@@ -208,7 +208,7 @@ export default {
[CRUD.HOOK.afterValidateCU]() { [CRUD.HOOK.afterValidateCU]() {
if (this.form.pid !== null && this.form.pid === this.form.id) { if (this.form.pid !== null && this.form.pid === this.form.id) {
this.$message({ this.$message({
message: '上级部门不能为空', message: '上级行政区划不能为空',
type: 'warning' type: 'warning'
}) })
return false return false
...@@ -220,7 +220,7 @@ export default { ...@@ -220,7 +220,7 @@ export default {
}, },
// 改变状态 // 改变状态
changeEnabled(data, val) { changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.dept_status[val] + '" ' + data.name + '部门, 是否继续?', '提示', { this.$confirm('此操作将 "' + this.dict.label.dept_status[val] + '" ' + data.name + '行政区划, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
......
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