forked from xxhjsb/hbt-prevention-ui
feat:新增风险区域单元逻辑
parent
cdef5d6121
commit
385b163a0e
|
@ -7,7 +7,7 @@ VUE_APP_GATEWAY_URL="/dev-api"
|
|||
# 服务地址
|
||||
VUE_APP_BASE_API_URL="http://192.168.2.3:8081/"
|
||||
# 服务前-- 请严格遵守格式 不允许换行
|
||||
VUE_APP_SERVICE_PREFIX= '{"system":"/system","prevention":"/prevention-yx"}'
|
||||
VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file-zy","prevention":"/prevention-yx"}'
|
||||
# 是否显示全部菜单
|
||||
VUE_APP_ALL_MENU = false
|
||||
# 微前端地址
|
||||
|
|
|
@ -21,6 +21,11 @@ export default class AreaService extends BaseService<any>{
|
|||
return this.get(url,null)
|
||||
}
|
||||
|
||||
public getQrCode(params){
|
||||
const url = this.prefix.file+'/qrCode/createQrCode';
|
||||
return this.post(url,params)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/area';
|
||||
|
|
|
@ -29,6 +29,20 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
majorHazardFlag:null
|
||||
} as any;
|
||||
|
||||
public filters = [{
|
||||
text:"未绘制",
|
||||
value:0
|
||||
},{
|
||||
text:"已绘制",
|
||||
value:1
|
||||
}]
|
||||
|
||||
|
||||
public showQrCode = false;
|
||||
public qrUrl = "";
|
||||
|
||||
|
||||
|
||||
|
||||
// 列表搜索条件按钮
|
||||
public formActions = [{
|
||||
|
@ -138,7 +152,7 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"majorHazardFlag",
|
||||
format:"majorHazardName",
|
||||
format:"majorHazardFlagName",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
|
@ -229,6 +243,26 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
}]
|
||||
}
|
||||
|
||||
public getQrCode(row){
|
||||
this.tableService.getQrCode({
|
||||
url:"/",
|
||||
id:row.id,
|
||||
system:"prevention",
|
||||
type:0,
|
||||
data:"",
|
||||
params:{
|
||||
"区域名称" : row.name,
|
||||
"区域编号" : row.number,
|
||||
"责任人" : row.chargeUserName,
|
||||
"责任部门" : row.chargeDeptName,
|
||||
"重大危险源名称" : row.majorHazardName
|
||||
}
|
||||
}).then((res:any)=>{
|
||||
this.showQrCode = true;
|
||||
this.qrUrl = res.data.url;
|
||||
})
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'区域名称',key:"name"});
|
||||
this.tableColumn.push({name:'责任部门',key:"chargeDeptName"});
|
||||
|
@ -236,7 +270,13 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
this.tableColumn.push({name:'是否属于重大危险源',key:"majorHazardFlag",render:(data)=>{
|
||||
return this.$store.getters.common_yes_no_map[data.majorHazardFlag]
|
||||
}});
|
||||
this.tableColumn.push({name:'绘制情况',render:(data)=>{
|
||||
this.tableColumn.push({name:'绘制情况',filters:this.filters,filterMethod:(data,row)=>{
|
||||
if(data){
|
||||
return row.geoJson && row.geoJson!=="[]"
|
||||
}else{
|
||||
return !row.geoJson || row.geoJson === "[]"
|
||||
}
|
||||
}, render:(data)=>{
|
||||
if(data.geoJson==='[]' || !data.geoJson){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
|
@ -337,7 +377,7 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
this.getCreateNumber();
|
||||
}else{
|
||||
this.currentId = data.id;
|
||||
this.updateParams = Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]",majorHazardName:this.$store.getters.common_yes_no_map[data.majorHazardFlag]},data);
|
||||
this.updateParams = Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]",majorHazardFlagName:this.$store.getters.common_yes_no_map[data.majorHazardFlag]},data);
|
||||
|
||||
this.isReadonly = !!isRead;
|
||||
this.buildFormOptions();
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
<el-table-column type="selection" label="全选">
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters" :filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-else :prop="item.key" :filters="item.filters" :label="item.name" :filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200">
|
||||
|
@ -25,7 +25,7 @@
|
|||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text">二维码</el-button>
|
||||
<el-button type="text" @click="getQrCode(scope.row)">二维码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -45,4 +45,10 @@
|
|||
btn-position="center"></FormComponent>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'查看二维码'" :visible.sync="showQrCode" >
|
||||
|
||||
<img :src="qrUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
</div>
|
|
@ -25,6 +25,18 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
public params = {} as any;
|
||||
|
||||
|
||||
public filters = [{
|
||||
text:"未绘制",
|
||||
value:0
|
||||
},{
|
||||
text:"已绘制",
|
||||
value:1
|
||||
}]
|
||||
public showQrCode = false;
|
||||
|
||||
public qrUrl = "";
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public formActions = [{
|
||||
|
@ -180,11 +192,38 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
}]
|
||||
}
|
||||
|
||||
public getQrCode(row){
|
||||
this.areaService.getQrCode({
|
||||
url:"/",
|
||||
id:row.id,
|
||||
system:"prevention",
|
||||
type:0,
|
||||
data:"",
|
||||
params:{
|
||||
"区域编号" : row.areaNo,
|
||||
"单元名称" : row.name,
|
||||
"单元编号" : row.number,
|
||||
"责任人" : row.chargeUserName,
|
||||
"责任部门" : row.chargeDeptName,
|
||||
}
|
||||
}).then((res:any)=>{
|
||||
this.showQrCode = true;
|
||||
this.qrUrl = res.data.url;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'风险分析单元',key:"name"});
|
||||
this.tableColumn.push({name:'责任部门',key:"chargeDeptName"});
|
||||
this.tableColumn.push({name:'责任人',key:"chargeUserName"});
|
||||
this.tableColumn.push({name:'绘制情况',render:(data)=>{
|
||||
this.tableColumn.push({name:'绘制情况',filters:this.filters,filterMethod:(data,row)=>{
|
||||
if(data){
|
||||
return row.geoJson && row.geoJson!=="[]"
|
||||
}else{
|
||||
return !row.geoJson || row.geoJson === "[]"
|
||||
}
|
||||
},render:(data)=>{
|
||||
if(data.geoJson==='[]' || !data.geoJson){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
|
@ -235,7 +274,6 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public callback(data,item?){
|
||||
console.log(data,item)
|
||||
// 新增编辑选择部门
|
||||
if(item && item.key === "chargeDeptId"){
|
||||
this.updateParams.chargeDeptName = this.$store.state.deptList.find(item=>item.value === data)?.name;
|
||||
|
|
Loading…
Reference in New Issue