forked from xxhjsb/hbt-prevention-ui
fit:修复bug
parent
fbd7bb3596
commit
598c8b67fa
|
@ -1153,7 +1153,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
|
||||
}
|
||||
}
|
||||
//整理数据
|
||||
|
||||
public collationAnalysisDataMethod() {
|
||||
this.analysisUpdateParams.measuresNum = this.analysisUpdateParams.measures.length;
|
||||
this.analysisUpdateParams.seriousResult = this.analysisUpdateParams.seriousResult.join(",");
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="update-box">
|
||||
<div class="form-box">
|
||||
<FormComponent v-if="viewModel!=='list'" labelWidth="56px" :isReadonly="isReadonly" :fullBtn="true" :btnPosition="'center'" @change="change" :data.sync="updateParams" @actionCallback="callback" :options="options" :actions="actions"></FormComponent>
|
||||
<FormComponent v-else labelWidth="56px" @change="change" :data.sync="listParams" :options="listForm" ></FormComponent>
|
||||
<FormComponent v-else labelWidth="56px" @input="change" :data.sync="listParams" :options="listForm" ></FormComponent>
|
||||
</div>
|
||||
<div class="tree-box" v-if="viewModel==='list'">
|
||||
<el-tree :data="treeData" :props="{children:'children',label:'name'}" :expand-on-click-node="false" default-expand-all highlight-current
|
||||
|
|
|
@ -18,7 +18,7 @@ export default class MapComponent extends Vue {
|
|||
@PropSync("position",{
|
||||
required:false,
|
||||
default:()=>{
|
||||
return [118.751353,31.969568]
|
||||
return [119.592977,34.523847]
|
||||
}
|
||||
})
|
||||
center:number[]
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
declare module 'common/notFound';
|
||||
declare module 'common/index';
|
||||
declare module 'common/layout';
|
||||
declare module 'common/login';
|
||||
declare module 'file-saver'
|
|
@ -2,6 +2,7 @@ import Vue from 'vue'
|
|||
import VueRouter, { RouteConfig } from 'vue-router'
|
||||
import pageNoFoundComponent from 'common/notFound'
|
||||
import indexComponent from 'common/index'
|
||||
import LoginComponent from 'common/login'
|
||||
import LayoutComponent from "common/layout"
|
||||
import HomeComponent from '@/views/home/home.component.vue'
|
||||
import BlankComponent from "@/views/blank.component.vue"
|
||||
|
@ -316,6 +317,11 @@ const routes: Array<RouteConfig> = [
|
|||
name: 'index',
|
||||
component:indexComponent
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component:LoginComponent
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
name: '404',
|
||||
|
|
|
@ -36,6 +36,12 @@ export default class UnitService extends BaseService<any>{
|
|||
return this.post(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
//获取单元详情
|
||||
public getUnitDetail(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/repairList';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
|
|
@ -195,7 +195,7 @@
|
|||
color: #F56C6C;
|
||||
margin-left: -43px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: -20px;
|
||||
margin-top: -10px;
|
||||
font-size: 20px;
|
||||
scale:0.5;
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
<div class="common-box dis-flex " >
|
||||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
|
||||
@pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="100%" border
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
|
@ -19,96 +19,99 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip"
|
||||
:filters="item.filters" :filter-method="item.filterMethod" :label="item.name"
|
||||
: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" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
<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="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change"
|
||||
btn-position="center">
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true"
|
||||
@change="change" btn-position="center" ref="checkForm">
|
||||
<div class="sub-title" v-if="isManager">检查项目</div>
|
||||
|
||||
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn"
|
||||
@actionCallback="subCallback($event)" actionPosition="flex-start" :actions="!isReadonly?updateTableActions:[]"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
|
||||
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn"
|
||||
@actionCallback="subCallback($event)" actionPosition="flex-start"
|
||||
:actions="!isReadonly?updateTableActions:[]" :showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.tableItems" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly">
|
||||
<el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly">
|
||||
</el-table-column>
|
||||
<template v-for="item in updateTableColumn">
|
||||
<el-table-column v-if="item.render" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-if="item.render" :filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip" :label="item.name" :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" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="200" v-if="!isReadonly">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showSubUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showSubUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="showSubUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="doSubDelete([scope.$index])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'" :visible.sync="showSubUpdate"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="subCallback" :actions="updateActions" :full-btn="true" @change="subChange"
|
||||
btn-position="center">
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'"
|
||||
:visible.sync="showSubUpdate" :before-close="handleClose">
|
||||
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="subUpdateParams" @actionCallback="subCallback" :actions="updateActions" :full-btn="true"
|
||||
@change="subChange" btn-position="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="'批量添加'" :visible.sync="showSubMutilUpdate"
|
||||
:before-close="handleClose" destroy-on-close>
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="'批量添加'" :visible.sync="showSubMutilUpdate"
|
||||
:before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="mutilAddOptions" @change="loadRuleTable" :data.sync="ruleParams"></FormComponent>
|
||||
<TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn" @pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')"
|
||||
:showFooter="true">
|
||||
|
||||
<el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" fixed label="全选" width="40px" >
|
||||
<TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn"
|
||||
@pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')"
|
||||
:showFooter="true">
|
||||
|
||||
<el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" fixed label="全选" width="40px">
|
||||
</el-table-column>
|
||||
<template v-for="item in updateTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<template v-for="item in updateTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name" :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" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
<div class="dis-flex" style="justify-content: center; margin-top: 20px;">
|
||||
<el-button @click="cancelMutilAdd"> 取消</el-button>
|
||||
<el-button type="primary" @click="doMutilAdd"> 确定</el-button>
|
||||
</div>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
<div class="dis-flex" style="justify-content: center; margin-top: 20px;">
|
||||
<el-button @click="cancelMutilAdd"> 取消</el-button>
|
||||
<el-button type="primary" @click="doMutilAdd"> 确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
|
@ -12,7 +12,7 @@ import RuleService from '@/service/rule.service';
|
|||
import { number } from 'echarts';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
|
@ -28,45 +28,45 @@ export default class RulesComponent extends BaseRecordComponent<any> {
|
|||
public isManager = false;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查项目",
|
||||
key:"name",
|
||||
type:"text",
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "检查项目",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
public updateParams = {} as any;
|
||||
public updateOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
|
||||
public showDraw = false;
|
||||
|
@ -74,184 +74,201 @@ export default class RulesComponent extends BaseRecordComponent<any> {
|
|||
public drawModel = "list";
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
value:"cancel"
|
||||
},{
|
||||
name:"保存并继续添加",
|
||||
value:"saveAndContinue",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"save",
|
||||
type:"primary"
|
||||
}];
|
||||
public updateActions = [] as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
|
||||
created(){
|
||||
|
||||
created() {
|
||||
|
||||
}
|
||||
|
||||
public getTableCallback(){
|
||||
public getTableCallback() {
|
||||
this.updateOptions = [{
|
||||
name:"检查标准编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
disable:true,
|
||||
},{
|
||||
name:"检查项目",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查内容",
|
||||
key:"content",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查依据",
|
||||
key:"reason",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"类型",
|
||||
key:"type",
|
||||
format:"typeName",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
name: "检查标准编号",
|
||||
key: "number",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "检查项目",
|
||||
key: "name",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "检查内容",
|
||||
key: "content",
|
||||
type: "textarea",
|
||||
width: "100%",
|
||||
require: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "检查依据",
|
||||
key: "reason",
|
||||
type: "textarea",
|
||||
width: "100%",
|
||||
require: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "类型",
|
||||
key: "type",
|
||||
format: "typeName",
|
||||
type: "select",
|
||||
width: "100%",
|
||||
require: true,
|
||||
multiple: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}]
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'检查项目',key:"name"});
|
||||
this.tableColumn.push({name:'检查内容',key:"content",showTip:true});
|
||||
this.tableColumn.push({name:'检查依据',key:"reason",showTip:true});
|
||||
this.tableColumn.push({name:'分类',key:"type",render:(data)=>{
|
||||
return this.$store.getters.prevention_dangrous_type_map[data.type]
|
||||
}});
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '检查项目', key: "name" });
|
||||
this.tableColumn.push({ name: '检查内容', key: "content", showTip: true });
|
||||
this.tableColumn.push({ name: '检查依据', key: "reason", showTip: true });
|
||||
this.tableColumn.push({
|
||||
name: '分类', key: "type", render: (data) => {
|
||||
return data.type.split(',').map(item => {
|
||||
return this.$store.getters.prevention_dangrous_type_map[item]
|
||||
}).join(",")
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
public change(data, item) {
|
||||
//
|
||||
}
|
||||
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
public callback(data, type?) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data && data.value==="search"){
|
||||
if (data && data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data && data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data && data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data && data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data && data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data && data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data && data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data && data.value === "add"){
|
||||
} else if (data && data.value === "add") {
|
||||
this.showUpdateModel()
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id));
|
||||
} else if (data && data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id));
|
||||
this.clearSelect()
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSave(data.value!=="save")
|
||||
}else{
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else {
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
name:"",
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
name: "",
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public doSave(goOn?){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
|
||||
/**
|
||||
* 数据保存
|
||||
* @param goOn
|
||||
*/
|
||||
public doSave(goOn?) {
|
||||
this.updateParams.type = this.updateParams.type.join(',')
|
||||
this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then((res => {
|
||||
this.$message.success(this.currentId === -1 ? "新增成功!" : "编辑成功");
|
||||
this.showUpdate = !!goOn;
|
||||
this.updateParams = {number:null} as any;
|
||||
if(goOn){
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.updateParams = { number: null } as any;
|
||||
if (goOn) {
|
||||
this.tableService.getNumber().then(res => {
|
||||
this.updateParams.number = res.data
|
||||
})
|
||||
}
|
||||
this.getTableData();
|
||||
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(row?,isRead?){
|
||||
|
||||
this.updateParams = Object.assign({number:null})
|
||||
public showUpdateModel(row?, isRead?) {
|
||||
this.updateParams = Object.assign({ number: null })
|
||||
this.isReadonly = !!isRead;
|
||||
if(!row){
|
||||
if (!row) {
|
||||
this.currentId = -1;
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.tableService.getNumber().then(res => {
|
||||
this.updateParams.number = res.data
|
||||
})
|
||||
}else{
|
||||
this.updateParams = Object.assign({number:null,typeName:this.$store.getters.prevention_dangrous_type_map[row.type]},row)
|
||||
} else {
|
||||
this.updateParams = Object.assign({
|
||||
number: null,
|
||||
typeName: row.type.split(',').map(item => {
|
||||
return this.$store.getters.prevention_dangrous_type_map[item]
|
||||
}).join(",")
|
||||
}, row)
|
||||
this.updateParams.type = row.type.split(',').map((item: any) => parseInt(item))
|
||||
this.currentId = row.id;
|
||||
}
|
||||
this.clearSelect();
|
||||
this.showUpdate = true
|
||||
this.getTableCallback()
|
||||
this.showUpdate = true;
|
||||
}
|
||||
|
||||
public clearSelect(){
|
||||
public clearSelect() {
|
||||
(this.$refs.multipleTable as any).clearSelection();
|
||||
this.selectData = [];
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
this.clearSelect();
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.id === item.id);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.id === item.id);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -544,6 +544,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public getMap(map) {
|
||||
|
|
|
@ -111,7 +111,7 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
created() {
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
public buildFormOptions() {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
<FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback"
|
||||
:actions="formActions" :full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
|
||||
@pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
|
@ -54,12 +54,9 @@
|
|||
:data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true"
|
||||
@change="change" btn-position="center">
|
||||
<span class="tips" v-if="isArea">*注:安全风险分析对象编码即危险化学品登记综合服务系统中的危险源编码</span>
|
||||
|
||||
|
||||
<div class="sub-title" v-if="!isArea && isReadonly">停用/检修记录</div>
|
||||
|
||||
<TableComponent v-if="!isArea && isReadonly" :tableData="repairTableData" :tableColumn="repairTableColumn"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
:showFooter="false" style="margin-bottom: 20px;height: 200px;">
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
|
||||
|
|
|
@ -91,11 +91,7 @@
|
|||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}">
|
||||
<el-radio v-model="scope.row.value" :label="4"">{{scope.row.type4}}</el-radio></div>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
</el-table-column>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop=" value" :label="popTitle==='L'?'Ln':'Sn'">
|
||||
<div slot-scope="scope">
|
||||
|
|
|
@ -144,11 +144,18 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
this.showUpdate = true
|
||||
}
|
||||
|
||||
// 新增 添加L/S值
|
||||
public addVal(el, row) {
|
||||
/**
|
||||
* 新增 添加L/S值
|
||||
* @param el
|
||||
* @param row 当前行数据
|
||||
*/
|
||||
public addVal(el: any, row: any) {
|
||||
this.riskLDatas = [];
|
||||
this.riskSDatas = [];
|
||||
this.currentRow = row;
|
||||
this.cacheCurrentRow = JSON.parse(JSON.stringify(row));
|
||||
this.riskLDatas = riskLData;
|
||||
this.riskLDatas = JSON.parse(JSON.stringify(riskLData));
|
||||
this.riskSDatas = JSON.parse(JSON.stringify(riskSData));
|
||||
this.popTitle = 'L';
|
||||
const lData = JSON.parse(row.analLikelihoodContent || "[]");
|
||||
const sData = JSON.parse(row.analSeverityContent || "[]");
|
||||
|
@ -222,7 +229,30 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
if (row[column.property] !== '/') {
|
||||
row.value = column.index - 1
|
||||
this.countEstimateValue()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public countEstimateValue() {
|
||||
let value: number = 0;
|
||||
let len: number = 0;
|
||||
let tmpRiskDatas = []
|
||||
if (this.popTitle === 'L') {
|
||||
tmpRiskDatas = this.riskLDatas
|
||||
}
|
||||
if (this.popTitle === 'S') {
|
||||
tmpRiskDatas = this.riskSDatas
|
||||
}
|
||||
tmpRiskDatas.forEach((item: any) => {
|
||||
if (item.value && typeof (item.value) === 'number') {
|
||||
len = len + 1
|
||||
value = value + item.value
|
||||
}
|
||||
})
|
||||
tmpRiskDatas.forEach((item: any) => {
|
||||
item.result = Math.round(value / len).toString()
|
||||
})
|
||||
}
|
||||
|
||||
public startEdit(row) {
|
||||
|
@ -274,7 +304,9 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
this.popTitle = 'S';
|
||||
this.stepsActive = 2;
|
||||
this.riskLDatas[0].value = value;
|
||||
this.riskSDatas = JSON.parse(JSON.stringify(riskSData));
|
||||
if (this.riskSDatas.length === 0) {
|
||||
this.riskSDatas = JSON.parse(JSON.stringify(riskSData));
|
||||
}
|
||||
this.updateBtn();
|
||||
} else {
|
||||
this.currentRow.analSeverityContent = content;
|
||||
|
@ -304,7 +336,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
|
||||
//单选
|
||||
public selectRadioData(data) {
|
||||
console.log('data', data);
|
||||
// console.log('data', data);
|
||||
}
|
||||
|
||||
//点击L 步骤
|
||||
|
|
|
@ -120,7 +120,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide:this.updateParams.id
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
|
@ -137,7 +137,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide:this.stepUpdateParams.index
|
||||
hide: this.stepUpdateParams.index
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
|
@ -470,6 +470,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
this.showSubUpdate = true;
|
||||
this.subUpdateActionsForm();
|
||||
this.buildUpdateForm();
|
||||
}
|
||||
|
||||
public doSubDelete(indexs) {
|
||||
|
@ -486,6 +487,10 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public doSave(goOn?) {
|
||||
if (this.updateParams.steps.length === 0) {
|
||||
this.$message.warning("请您至少添加一条作业步骤!");
|
||||
return
|
||||
}
|
||||
// 如果是新增步骤
|
||||
if (this.showSubUpdate) {
|
||||
// 新增
|
||||
|
@ -598,7 +603,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
const find = this.selectData.find((data: any) => data.id === item.id);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
|
|
|
@ -601,13 +601,13 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
|
||||
//删除成员
|
||||
public deleteSubData(indexs) {
|
||||
if(indexs.length === 0){
|
||||
if (indexs.length === 0) {
|
||||
this.$message.warning("请选择要删除的数据!")
|
||||
}else{
|
||||
} else {
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
for (let i = this.updateParams.members.length - 1; i >= 0; i--) {
|
||||
if (indexs.includes(i)) {
|
||||
|
|
Loading…
Reference in New Issue