forked from xxhjsb/hbt-prevention-ui
fixed:修复安全检查计划的bug
parent
81ce4e55ce
commit
8d001ac056
|
@ -7,13 +7,13 @@ VUE_APP_GATEWAY_URL="/dev-api"
|
||||||
# 服务地址
|
# 服务地址
|
||||||
VUE_APP_BASE_API_URL="http://192.168.2.187:8081"
|
VUE_APP_BASE_API_URL="http://192.168.2.187:8081"
|
||||||
# 服务前-- 请严格遵守格式 不允许换行
|
# 服务前-- 请严格遵守格式 不允许换行
|
||||||
VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file","prevention":"/prevention-yx","bpm":"/bpm"}'
|
VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file","prevention":"/prevention-zsz","bpm":"/bpm"}'
|
||||||
# 是否显示全部菜单
|
# 是否显示全部菜单
|
||||||
VUE_APP_ALL_MENU = false
|
VUE_APP_ALL_MENU = false
|
||||||
# # 微前端地址
|
# # 微前端地址
|
||||||
# VUE_APP_REMOTES_URL="http://192.168.1.20:8090"
|
VUE_APP_REMOTES_URL="http://192.168.2.14:8090"
|
||||||
# # 当前应用部署地址
|
# # 当前应用部署地址
|
||||||
# VUE_APP_EXPOSES_URL="http://192.168.1.20:8090"
|
# VUE_APP_EXPOSES_URL="http://192.168.1.20:8090"
|
||||||
VUE_APP_REMOTES_URL="http://119.45.158.12/common_dev/"
|
# VUE_APP_REMOTES_URL="http://119.45.158.12/common_dev/"
|
||||||
# 当前应用部署地址
|
# 当前应用部署地址
|
||||||
VUE_APP_EXPOSES_URL=""
|
VUE_APP_EXPOSES_URL=""
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
||||||
<el-table-column v-if="!isAction && !(isManager && params.type>1)" type="selection"
|
<el-table-column v-if="!(isManager && params.type>1)" type="selection"
|
||||||
:selectable="selectable" fixed label="全选" width="40">
|
:selectable="selectable" fixed label="全选" width="40">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="序号" width="60">
|
<el-table-column label="序号" width="60">
|
||||||
|
@ -39,22 +39,9 @@
|
||||||
<el-button type="text" v-if="isBase || isFile || isManager"
|
<el-button type="text" v-if="isBase || isFile || isManager"
|
||||||
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
|
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
|
||||||
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || scope.row.planType === 2 && scope.row.state===1)"
|
|
||||||
@click="showUpdateModel(scope.row)">修改</el-button>
|
@click="showUpdateModel(scope.row)">修改</el-button>
|
||||||
<el-button type="text" v-if="isBase"
|
<el-button type="text" v-if="isBase"
|
||||||
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || scope.row.planType === 2 && scope.row.state===1)"
|
|
||||||
@click="deleteData([scope.row.id])">删除</el-button>
|
@click="deleteData([scope.row.id])">删除</el-button>
|
||||||
<el-button type="text" v-if="isPlan && !scope.row.status"
|
|
||||||
:disabled="scope.row.planType===2 && scope.row.state===0"
|
|
||||||
@click="openSendModel(scope.row)">下发</el-button>
|
|
||||||
<el-button type="text" v-if="isPlan && scope.row.planType===2 && !scope.row.state"
|
|
||||||
@click="changeState(scope.row)">启用</el-button>
|
|
||||||
<el-button type="text" v-if="isPlan && scope.row.planType===2 && scope.row.state"
|
|
||||||
@click="changeState(scope.row)">停用</el-button>
|
|
||||||
<el-button type="text" v-if="isPlan && scope.row.planType===1" @click="openRecordModel(scope.row)">检查情况</el-button>
|
|
||||||
<el-button type="text" v-if="isPlan && scope.row.planType===2 " @click="openRecordModel(scope.row)">最新检查情况</el-button>
|
|
||||||
<el-button type="text" v-if="isAction && scope.row.status !==4&& (scope.row.status !==2 &&(nowDate > scope.row.taskStartTime ? true :
|
|
||||||
false) ) && scope.row.tag===0 " @click="openRecordModel(scope.row)">检查</el-button>
|
|
||||||
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
|
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
|
||||||
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button> -->
|
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button> -->
|
||||||
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"
|
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"
|
||||||
|
@ -72,117 +59,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 检查表记录 -->
|
|
||||||
<el-dialog v-if="isPlan || isAction" :close-on-click-modal="false" :title="isPlan?'检查表记录':'检查表'"
|
|
||||||
:visible.sync="showRecord" width="1080px" :before-close="handleClose" destroy-on-close>
|
|
||||||
<div class="full">
|
|
||||||
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
|
||||||
<el-radio-button :label="item.id" v-for="item in tableTabs"
|
|
||||||
:key="item.id">{{item.name}}</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="full" style="margin: 20px 0;">
|
|
||||||
<el-table :data="currentTable.tableItems" tooltip-effect="dark" border width="100%" height="250">
|
|
||||||
<el-table-column label="序号" width="60">
|
|
||||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查项目" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemName}}</div>
|
|
||||||
<el-input type="text" v-else v-model="scope.row.name"></el-input>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查内容" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemContent}}</div>
|
|
||||||
<el-input type="textarea" v-else v-model="scope.row.content"></el-input>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查依据" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemReason}}</div>
|
|
||||||
<el-input type="textarea" v-else v-model="scope.row.reason"></el-input>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="执行人">
|
|
||||||
<div slot-scope="scope">{{scope.row.itemExecuteNames}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查人">
|
|
||||||
<div slot-scope="scope">{{scope.row.inspectUserName?scope.row.inspectUserName :'--'}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查结果" width="160px">
|
|
||||||
<div slot-scope="scope">
|
|
||||||
<span
|
|
||||||
v-if="hideActions || isPlan || (isAction && !scope.row.userIds.includes(account.userId)) || (scope.row.inspectUserName && scope.row.inspectUserName!=account.userId) "
|
|
||||||
:class="'color_'+scope.row.itemResult">{{['异常','正常'][scope.row.itemResult]}}</span>
|
|
||||||
<el-radio-group v-else v-model="scope.row.itemResult">
|
|
||||||
<el-radio :label="1">正常</el-radio>
|
|
||||||
<el-radio :label="0">异常</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查记录" width="280px">
|
|
||||||
<div slot-scope="scope">
|
|
||||||
<span
|
|
||||||
v-if="hideActions || isPlan || (isAction && !scope.row.userIds.includes(account.userId))">{{scope.row.itemRecord}}</span>
|
|
||||||
<el-input v-else type="textarea" v-model="scope.row.itemRecord"></el-input>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<div class="sub-title" v-if="!hideActions">隐患登记情况</div>
|
|
||||||
<div class="full" style="margin-bottom: 20px;" v-if="isAction && !hideActions">
|
|
||||||
<el-button type="success" plain @click="showUpdateModel()" icon="el-icon-plus">添加</el-button>
|
|
||||||
<el-button type="danger" plain @click="callback({value:'delete'})" icon="el-icon-delete">批量删除</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="full" style="margin-bottom: 20px;" v-if="!hideActions">
|
|
||||||
<el-table ref="multipleTable" @selection-change="handleSelectionChange" :data="troubleTableData" border
|
|
||||||
tooltip-effect="dark" width="100%" height="250">
|
|
||||||
<el-table-column v-if="isAction" type="selection" fixed="left" label="全选" width="60">
|
|
||||||
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="序号" width="60">
|
|
||||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="隐患类型" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope">{{$store.getters.prevention_dangrous_type_map[scope.row.classify]}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="隐患等级" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope">{{levelMap[scope.row.level]}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="整改方式" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope">{{reformModeMap[scope.row.reformMode]}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="隐患描述" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope" style="display: flex; align-items: center;">
|
|
||||||
{{scope.row.description}}
|
|
||||||
<!-- <el-image style="width: 60px; margin-left: 10px;" :src="scope.row.urls[0]"
|
|
||||||
:preview-src-list="scope.row.urls">
|
|
||||||
</el-image> -->
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="隐患照片" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope" style="display: flex; align-items: center;">
|
|
||||||
<el-image style="width: 60px; margin-left: 10px;" :src="scope.row.urls[0]"
|
|
||||||
:preview-src-list="scope.row.urls">
|
|
||||||
</el-image>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="整改部门" :show-overflow-tooltip="true">
|
|
||||||
<div slot-scope="scope">{{scope.row.reformDeptName}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="责任人">
|
|
||||||
<div slot-scope="scope"> {{scope.row.reformUserName}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" fixed="right" v-if="isAction">
|
|
||||||
<div slot-scope="scope">
|
|
||||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
|
||||||
<el-button type="text" @click="showUpdateModel(scope.row)">编辑</el-button>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<div class="full" style="text-align: center;" v-if="isAction">
|
|
||||||
<el-button @click="handleClose">取消</el-button>
|
|
||||||
<el-button type="primary" @click="doCheck" v-if="!hideActions">保存并提交</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'"
|
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'"
|
||||||
:visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close>
|
:visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close>
|
||||||
|
@ -232,56 +108,6 @@
|
||||||
:actions="updateActions" :full-btn="true" @change="change" btn-position="center"></FormComponent>
|
:actions="updateActions" :full-btn="true" @change="change" btn-position="center"></FormComponent>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 下发 -->
|
|
||||||
<el-dialog v-if="isPlan" :close-on-click-modal="false" title="下发" :visible.sync="showSend" width="980px"
|
|
||||||
:before-close="handleClose" destroy-on-close>
|
|
||||||
<FormComponent :options="sendOptions" :data.sync="sendParams" @change="change" :fullBtn="true"
|
|
||||||
btn-position="center" @actionCallback="sendCallback" :actions="updateActions">
|
|
||||||
<div class="full" style="margin-bottom: 20px;">
|
|
||||||
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
|
||||||
<el-radio-button :label="item.id" v-for="item in tableTabs"
|
|
||||||
:key="item.id">{{item.name}}</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
<div class="full" style="margin-bottom: 20px;">
|
|
||||||
<el-table :data="currentTable.tableItems" tooltip-effect="dark" border height="400px" width="100%">
|
|
||||||
<el-table-column label="序号" width="60">
|
|
||||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查项目">
|
|
||||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.name}}</div>
|
|
||||||
<el-input type="text" v-else v-model="scope.row.name"></el-input>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查内容">
|
|
||||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.content}}</div>
|
|
||||||
<el-input type="textarea" v-else v-model="scope.row.content"></el-input>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检查依据">
|
|
||||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.reason}}</div>
|
|
||||||
<el-input type="textarea" v-else v-model="scope.row.reason"></el-input>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="选择执行人">
|
|
||||||
<div slot-scope="scope" >
|
|
||||||
<el-select v-model="scope.row.userList" multiple filterable placeholder="请选择" >
|
|
||||||
<el-option v-for="item in $store.state.userList" :key="item.value" :label="item.name"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="操作" fixed="right">
|
|
||||||
<div slot-scope="scope">
|
|
||||||
<el-button type="text" v-if="!scope.row.edit" @click="scope.row.edit = true">编辑</el-button>
|
|
||||||
<el-button type="text" v-else @click="scope.row.edit = false">确定</el-button>
|
|
||||||
<el-button type="text" @click="deleteSendData(scope.$index)">删除</el-button>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</FormComponent>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
|
|
||||||
<el-dialog v-if="showMap" :close-on-click-modal="false" destroy-on-close title="地图定位" :visible.sync="showMap"
|
<el-dialog v-if="showMap" :close-on-click-modal="false" destroy-on-close title="地图定位" :visible.sync="showMap"
|
||||||
|
|
|
@ -30,10 +30,6 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||||
public isAction = true;
|
public isAction = true;
|
||||||
// 显示计划列表按钮
|
// 显示计划列表按钮
|
||||||
public isPlan = false;
|
public isPlan = false;
|
||||||
// 是否显示删改查按钮
|
|
||||||
public isBase = false;
|
|
||||||
public isFile = false;
|
|
||||||
public isManager = false;
|
|
||||||
public tableActionWidth = "80px";
|
public tableActionWidth = "80px";
|
||||||
public statusList = ["", "检查中", "已检查", "待检查", "超期未检查"];
|
public statusList = ["", "检查中", "已检查", "待检查", "超期未检查"];
|
||||||
public account = JSON.parse(localStorage.getItem("account") as string);
|
public account = JSON.parse(localStorage.getItem("account") as string);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component } from 'vue-property-decorator';
|
import { Component } from 'vue-property-decorator';
|
||||||
import template from "../common.component.html"
|
import template from "./safe.component.html"
|
||||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||||
import TableComponent from "hbt-common/components/common/table.component.vue"
|
import TableComponent from "hbt-common/components/common/table.component.vue"
|
||||||
|
@ -32,24 +32,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
public unitService = new UnitService();
|
public unitService = new UnitService();
|
||||||
|
|
||||||
public checkTableService = new TableService();
|
public checkTableService = new TableService();
|
||||||
// 是否隐藏隐患登记情况
|
|
||||||
public hideActions = false;
|
|
||||||
|
|
||||||
public params = {} as any;
|
public params = {} as any;
|
||||||
// 是否显示删改查按钮
|
|
||||||
public isBase = true;
|
|
||||||
public isClap = false;
|
|
||||||
// 显示计划列表按钮
|
|
||||||
public isPlan = true;
|
|
||||||
|
|
||||||
public isFile = false;
|
|
||||||
|
|
||||||
public isAction = false;
|
|
||||||
|
|
||||||
public isReadonly = false as any;
|
public isReadonly = false as any;
|
||||||
|
|
||||||
public isManager = false;
|
|
||||||
|
|
||||||
public showSend = false;
|
public showSend = false;
|
||||||
|
|
||||||
public showRecord = false;
|
public showRecord = false;
|
||||||
|
@ -63,6 +50,13 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
public showFile = false;
|
public showFile = false;
|
||||||
|
|
||||||
|
public isAction = false;
|
||||||
|
|
||||||
|
public hideActions = false;
|
||||||
|
|
||||||
|
|
||||||
|
public isPlan = true;
|
||||||
|
|
||||||
public formActions = [{
|
public formActions = [{
|
||||||
name: "查询",
|
name: "查询",
|
||||||
value: "search",
|
value: "search",
|
||||||
|
@ -124,6 +118,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
name: "保存",
|
name: "保存",
|
||||||
value: "save",
|
value: "save",
|
||||||
type: "primary"
|
type: "primary"
|
||||||
|
}, {
|
||||||
|
name: "保存并继续添加",
|
||||||
|
hide:false,
|
||||||
|
value: "saveAndContinue",
|
||||||
|
type: "primary"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
public selectData = [];
|
public selectData = [];
|
||||||
|
@ -163,12 +162,19 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
public currentPlan: any;
|
public currentPlan: any;
|
||||||
|
|
||||||
|
public filters = [{
|
||||||
|
text: "停用",
|
||||||
|
value: 0
|
||||||
|
}, {
|
||||||
|
text: "启用",
|
||||||
|
value: 1
|
||||||
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.loadAreaData();
|
this.loadAreaData();
|
||||||
this.loadUnitData();
|
|
||||||
this.getCheckList();
|
this.getCheckList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +355,9 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
value: item.id
|
value: item.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.buildUpdateForm()
|
const option = this.updateOptions.find(item => item.key === "unitIds") as any;
|
||||||
|
option.datas = this.unitList;
|
||||||
|
// this.buildUpdateForm()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,7 +383,9 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '状态', render: (data) => {
|
name: '状态', filters: this.filters, filterMethod: (data, row) => {
|
||||||
|
return row.state === data && row.planType == 2
|
||||||
|
}, render: (data) => {
|
||||||
return data.planType == 1 ? "--" : `<span class="color_${data.state}">${this.stateMap[data.state]}</span>`
|
return data.planType == 1 ? "--" : `<span class="color_${data.state}">${this.stateMap[data.state]}</span>`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -435,12 +445,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
if (item && item.key === "chargeUserId") {
|
if (item && item.key === "chargeUserId") {
|
||||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data]
|
this.updateParams.chargeUserName = this.$store.getters.user_map[data]
|
||||||
}
|
}
|
||||||
if (item && item.key === "analControlIds") {
|
if (item && item.key === "inspectCycleValue") {
|
||||||
this.updateParams.analControls = data.map((itm) => {
|
console.log(data)
|
||||||
return {
|
this.updateParams.inspectCycleValue = data;
|
||||||
id: itm,
|
setTimeout(() => {
|
||||||
name: this.$store.getters.prevention_anal_control_map[itm]
|
this.updateParams.inspectCycleValue = Math.floor(data)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (item && item.key === "time") {
|
if (item && item.key === "time") {
|
||||||
|
@ -476,8 +485,8 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
this.showUpdateModel()
|
this.showUpdateModel()
|
||||||
} else if (data && data.value === "delete") {
|
} else if (data && data.value === "delete") {
|
||||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||||
} else if (data && data.value === "save") {
|
} else if (data && data.value.indexOf("save")>=0 ) {
|
||||||
this.doSave()
|
this.doSave(data.value==="save")
|
||||||
} else if (data && data.value === "cancel") {
|
} else if (data && data.value === "cancel") {
|
||||||
this.handleClose()
|
this.handleClose()
|
||||||
}
|
}
|
||||||
|
@ -485,6 +494,10 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
public selectable(row) {
|
public selectable(row) {
|
||||||
//
|
//
|
||||||
|
if ((row.planType === 1 && row.status === 1) || (row.planType === 2 && row.state === 1)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
public sendCallback(data) {
|
public sendCallback(data) {
|
||||||
|
@ -520,15 +533,16 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 打开增改查弹窗
|
// 打开增改查弹窗
|
||||||
public showUpdateModel(row?, isRead?) {
|
public showUpdateModel(row?, isRead?) {
|
||||||
|
this.updateActions[2].hide = false;
|
||||||
this.isReadonly = !!isRead;
|
this.isReadonly = !!isRead;
|
||||||
if (row) {
|
if (row) {
|
||||||
this.updateParams = Object.assign({
|
this.updateParams = Object.assign({
|
||||||
analControls: row.analControlIds,
|
|
||||||
planTypeName: this.planTypeMap[row.planType],
|
planTypeName: this.planTypeMap[row.planType],
|
||||||
areaNames: row.areaIds.map(item => this.areaMap[item]).join(","),
|
areaNames: row.areaIds.map(item => this.areaMap[item]).join(","),
|
||||||
unitNames: row.unitIds.map(item => this.unitMap[item]).join(","),
|
unitNames: row.unitIds.map(item => this.unitMap[item]).join(","),
|
||||||
|
@ -536,12 +550,12 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
inspectCycleUnitName: this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit],
|
inspectCycleUnitName: this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit],
|
||||||
}, row);
|
}, row);
|
||||||
if (row.planType === 1) {
|
if (row.planType === 1) {
|
||||||
this.updateParams.time = isRead ? row.startTime + "~" + row.endTime : [row.startTime, row.endTime]
|
this.$set(this.updateParams, "time", isRead ? row.startTime + "~" + row.endTime : [row.startTime, row.endTime])
|
||||||
} else if (row.planType === 2) {
|
} else if (row.planType === 2) {
|
||||||
this.updateParams.startTime = row.startTime
|
this.updateParams.startTime = row.startTime
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.updateParams = { planType: 1 } as any;
|
this.updateParams = { planType: 1 , time :[]} as any;
|
||||||
}
|
}
|
||||||
this.buildUpdateForm();
|
this.buildUpdateForm();
|
||||||
this.showUpdate = true
|
this.showUpdate = true
|
||||||
|
@ -549,6 +563,12 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
// 打开下发弹窗
|
// 打开下发弹窗
|
||||||
public openSendModel(row) {
|
public openSendModel(row) {
|
||||||
|
const now = moment().format("YYYY-MM-DD HH:mm")
|
||||||
|
if (row.startTime < now) {
|
||||||
|
this.$message.error("检查开始时间不能早于当前时间,请先修改数据");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.updateActions[2].hide = true;
|
||||||
this.currentPlan = row;
|
this.currentPlan = row;
|
||||||
this.showSend = true;
|
this.showSend = true;
|
||||||
this.tableTabs = [];
|
this.tableTabs = [];
|
||||||
|
@ -627,11 +647,27 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
this.showUpdate = false;
|
this.showUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public doSave() {
|
public doSave(needClose?) {
|
||||||
|
|
||||||
|
this.updateParams.analControls = this.updateParams.analControlIds.map((itm) => {
|
||||||
|
return {
|
||||||
|
id: itm,
|
||||||
|
name: this.$store.getters.prevention_anal_control_map[itm]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const now = moment().format("YYYY-MM-DD HH:mm")
|
||||||
|
if (this.updateParams.startTime < now) {
|
||||||
|
this.$message.error("检查开始时间不能早于当前时间");
|
||||||
|
return
|
||||||
|
}
|
||||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
|
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
|
||||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!")
|
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!")
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
this.handleClose();
|
if (needClose) {
|
||||||
|
this.handleClose();
|
||||||
|
} else {
|
||||||
|
this.showUpdateModel()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +686,10 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
public toggleAll() {
|
public toggleAll() {
|
||||||
|
|
||||||
this.tableData.datas.forEach((item, index) => {
|
this.tableData.datas.forEach((item, index) => {
|
||||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
if ((item.planType === 1 && !item.status) || (item.planType === 2 && !item.state)) {
|
||||||
|
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
public selectAll() {
|
public selectAll() {
|
||||||
|
@ -659,7 +698,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
} else {
|
} else {
|
||||||
this.tableData.datas.forEach((item, index) => {
|
this.tableData.datas.forEach((item, index) => {
|
||||||
const find = this.selectData.find((data: any) => data.id === item.id);
|
const find = this.selectData.find((data: any) => data.id === item.id);
|
||||||
if (!find) {
|
if (!find && ((item.planType === 1 && !item.status) || (item.planType === 2 && !item.state))) {
|
||||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,239 @@
|
||||||
|
<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="getTableData" btn-position="end"></FormComponent>
|
||||||
|
</div>
|
||||||
|
<div class="table-box flex-1">
|
||||||
|
<TableComponent style="flex: 1; height: 1px;" :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 row-key="checked"
|
||||||
|
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
||||||
|
<el-table-column v-if="isPlan" type="selection"
|
||||||
|
:selectable="selectable" fixed label="全选" width="40">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="序号" width="60">
|
||||||
|
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<template v-for="item in tableColumn">
|
||||||
|
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters"
|
||||||
|
:filter-method="item.filterMethod" :width="item.width" :key="item.key"
|
||||||
|
:sortable="item.sortable">
|
||||||
|
<div slot-scope="scope" @click="" v-html="item.render(scope.row)"
|
||||||
|
style="pointer-events: none;" @click="rowCallback($event,scope.row)"></div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-else :prop="item.key" :label="item.name" :filters="item.filters"
|
||||||
|
:filter-method="item.filterMethod" :width="item.width" :key="item.key"
|
||||||
|
:sortable="item.sortable">
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text"
|
||||||
|
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||||
|
<el-button type="text"
|
||||||
|
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1))"
|
||||||
|
@click="showUpdateModel(scope.row)">修改</el-button>
|
||||||
|
<el-button type="text"
|
||||||
|
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1))"
|
||||||
|
@click="deleteData([scope.row.id])">删除</el-button>
|
||||||
|
<el-button type="text" v-if="isPlan && !scope.row.status" :disabled="scope.row.planType===2 && scope.row.state===0"
|
||||||
|
@click="openSendModel(scope.row)">下发</el-button>
|
||||||
|
<el-button type="text" v-if="isPlan && scope.row.planType===2 && !scope.row.state"
|
||||||
|
@click="changeState(scope.row)">启用</el-button>
|
||||||
|
<el-button type="text" v-if="isPlan && scope.row.planType===2 && scope.row.state"
|
||||||
|
@click="changeState(scope.row)">停用</el-button>
|
||||||
|
<el-button type="text" v-if="isPlan && scope.row.planType===1" @click="openRecordModel(scope.row)">检查情况</el-button>
|
||||||
|
<el-button type="text" v-if="isPlan && scope.row.planType===2 " @click="openRecordModel(scope.row)">最新检查情况</el-button>
|
||||||
|
<el-button type="text" v-if="isAction && scope.row.status !==4&& (scope.row.status !==2 &&(nowDate > scope.row.taskStartTime ? true :
|
||||||
|
false) ) && scope.row.tag===0 " @click="openRecordModel(scope.row)">检查</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</TableComponent>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 检查表记录 -->
|
||||||
|
<el-dialog :close-on-click-modal="false" :title="isPlan?'检查表记录':'检查表'"
|
||||||
|
:visible.sync="showRecord" width="1080px" :before-close="handleClose" destroy-on-close>
|
||||||
|
<div class="full">
|
||||||
|
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
||||||
|
<el-radio-button :label="item.id" v-for="item in tableTabs"
|
||||||
|
:key="item.id">{{item.name}}</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full" style="margin: 20px 0;">
|
||||||
|
<el-table :data="currentTable.tableItems" tooltip-effect="dark" border width="100%" height="250">
|
||||||
|
<el-table-column label="序号" width="60">
|
||||||
|
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查项目" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemName}}</div>
|
||||||
|
<el-input type="text" v-else v-model="scope.row.name"></el-input>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查内容" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemContent}}</div>
|
||||||
|
<el-input type="textarea" v-else v-model="scope.row.content"></el-input>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查依据" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemReason}}</div>
|
||||||
|
<el-input type="textarea" v-else v-model="scope.row.reason"></el-input>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="执行人">
|
||||||
|
<div slot-scope="scope">{{scope.row.itemExecuteNames}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查人">
|
||||||
|
<div slot-scope="scope">{{scope.row.inspectUserName?scope.row.inspectUserName :'--'}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查结果" width="160px">
|
||||||
|
<div slot-scope="scope">
|
||||||
|
<span
|
||||||
|
v-if="hideActions || isPlan || (isAction && !scope.row.userIds.includes(account.userId)) || (scope.row.inspectUserName && scope.row.inspectUserName!=account.userId) "
|
||||||
|
:class="'color_'+scope.row.itemResult">{{['异常','正常'][scope.row.itemResult]}}</span>
|
||||||
|
<el-radio-group v-else v-model="scope.row.itemResult">
|
||||||
|
<el-radio :label="1">正常</el-radio>
|
||||||
|
<el-radio :label="0">异常</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查记录" width="280px">
|
||||||
|
<div slot-scope="scope">
|
||||||
|
<span
|
||||||
|
v-if="hideActions || isPlan || (isAction && !scope.row.userIds.includes(account.userId))">{{scope.row.itemRecord}}</span>
|
||||||
|
<el-input v-else type="textarea" v-model="scope.row.itemRecord"></el-input>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="sub-title" v-if="!hideActions">隐患登记情况</div>
|
||||||
|
<div class="full" style="margin-bottom: 20px;" v-if="isAction && !hideActions">
|
||||||
|
<el-button type="success" plain @click="showUpdateModel()" icon="el-icon-plus">添加</el-button>
|
||||||
|
<el-button type="danger" plain @click="callback({value:'delete'})" icon="el-icon-delete">批量删除</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full" style="margin-bottom: 20px;" v-if="!hideActions">
|
||||||
|
<el-table ref="multipleTable" @selection-change="handleSelectionChange" :data="troubleTableData" border
|
||||||
|
tooltip-effect="dark" width="100%" height="250">
|
||||||
|
<el-table-column v-if="isAction" type="selection" fixed="left" label="全选" width="60">
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="序号" width="60">
|
||||||
|
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="隐患类型" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope">{{$store.getters.prevention_dangrous_type_map[scope.row.classify]}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="隐患等级" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope">{{levelMap[scope.row.level]}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="整改方式" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope">{{reformModeMap[scope.row.reformMode]}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="隐患描述" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope" style="display: flex; align-items: center;">
|
||||||
|
{{scope.row.description}}
|
||||||
|
<!-- <el-image style="width: 60px; margin-left: 10px;" :src="scope.row.urls[0]"
|
||||||
|
:preview-src-list="scope.row.urls">
|
||||||
|
</el-image> -->
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="隐患照片" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope" style="display: flex; align-items: center;">
|
||||||
|
<el-image style="width: 60px; margin-left: 10px;" :src="scope.row.urls[0]"
|
||||||
|
:preview-src-list="scope.row.urls">
|
||||||
|
</el-image>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="整改部门" :show-overflow-tooltip="true">
|
||||||
|
<div slot-scope="scope">{{scope.row.reformDeptName}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="责任人">
|
||||||
|
<div slot-scope="scope"> {{scope.row.reformUserName}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" v-if="isAction">
|
||||||
|
<div slot-scope="scope">
|
||||||
|
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||||
|
<el-button type="text" @click="showUpdateModel(scope.row)">编辑</el-button>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="full" style="text-align: center;" v-if="isAction">
|
||||||
|
<el-button @click="handleClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="doCheck" v-if="!hideActions">保存并提交</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'"
|
||||||
|
:visible.sync="showUpdate" width="1050px" :before-close="handleClose" destroy-on-close>
|
||||||
|
<FormComponent ref="form" :options="updateOptions"
|
||||||
|
:isReadonly="isReadonly" labelWidth="140px"
|
||||||
|
labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions"
|
||||||
|
:full-btn="true" @change="change" btn-position="center"></FormComponent>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 下发 -->
|
||||||
|
<el-dialog v-if="isPlan" :close-on-click-modal="false" title="下发" :visible.sync="showSend" width="980px"
|
||||||
|
:before-close="handleClose" destroy-on-close>
|
||||||
|
<FormComponent :options="sendOptions" :data.sync="sendParams" @change="change" :fullBtn="true"
|
||||||
|
btn-position="center" @actionCallback="sendCallback" :actions="updateActions">
|
||||||
|
<div class="full" style="margin-bottom: 20px;">
|
||||||
|
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
||||||
|
<el-radio-button :label="item.id" v-for="item in tableTabs"
|
||||||
|
:key="item.id">{{item.name}}</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<div class="full" style="margin-bottom: 20px;">
|
||||||
|
<el-table :data="currentTable.tableItems" tooltip-effect="dark" border height="400px" width="100%">
|
||||||
|
<el-table-column label="序号" width="60">
|
||||||
|
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查项目">
|
||||||
|
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.name}}</div>
|
||||||
|
<el-input type="text" v-else v-model="scope.row.name"></el-input>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查内容">
|
||||||
|
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.content}}</div>
|
||||||
|
<el-input type="textarea" v-else v-model="scope.row.content"></el-input>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查依据">
|
||||||
|
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.reason}}</div>
|
||||||
|
<el-input type="textarea" v-else v-model="scope.row.reason"></el-input>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="选择执行人">
|
||||||
|
<div slot-scope="scope">
|
||||||
|
<el-select v-model="scope.row.userList" multiple filterable placeholder="请选择">
|
||||||
|
<el-option v-for="item in $store.state.userList" :key="item.value" :label="item.name"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" fixed="right">
|
||||||
|
<div slot-scope="scope">
|
||||||
|
<el-button type="text" v-if="!scope.row.edit" @click="scope.row.edit = true">编辑</el-button>
|
||||||
|
<el-button type="text" v-else @click="scope.row.edit = false">确定</el-button>
|
||||||
|
<el-button type="text" @click="deleteSendData(scope.$index)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</FormComponent>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
|
||||||
|
width="680px">
|
||||||
|
<img :src="currentUrl" style="width: 100%;" alt="">
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -1,23 +1,23 @@
|
||||||
const { defineConfig } = require('@vue/cli-service')
|
const { defineConfig } = require("@vue/cli-service");
|
||||||
const CompressionPlugin = require('compression-webpack-plugin')
|
const CompressionPlugin = require("compression-webpack-plugin");
|
||||||
const TerserPlugin = require('terser-webpack-plugin');
|
const TerserPlugin = require("terser-webpack-plugin");
|
||||||
|
|
||||||
const path = require('path')
|
const path = require("path");
|
||||||
const resolve = (dir)=>{
|
const resolve = (dir) => {
|
||||||
return path.join(__dirname, dir)
|
return path.join(__dirname, dir);
|
||||||
}
|
};
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
publicPath:'./',
|
publicPath: "",
|
||||||
productionSourceMap:process.env.NODE_ENV!=="production",
|
productionSourceMap: process.env.NODE_ENV !== "production",
|
||||||
transpileDependencies: true,
|
transpileDependencies: true,
|
||||||
lintOnSave: true, // 在保存时校验格式
|
lintOnSave: true, // 在保存时校验格式
|
||||||
runtimeCompiler:true,
|
runtimeCompiler: true,
|
||||||
css:{
|
css: {
|
||||||
loaderOptions:{
|
loaderOptions: {
|
||||||
scss:{
|
scss: {
|
||||||
additionalData:`@import "@/assets/common/scss/hbt-base.scss";`
|
additionalData: `@import "@/assets/common/scss/hbt-base.scss";`,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
optimization: {
|
optimization: {
|
||||||
|
@ -47,48 +47,49 @@ module.exports = defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
// http://doc.hbt.vip/hbt-vue/other/faq.html#使用gzip解压缩静态文件
|
// http://doc.hbt.vip/hbt-vue/other/faq.html#使用gzip解压缩静态文件
|
||||||
new CompressionPlugin({
|
new CompressionPlugin({
|
||||||
cache: false, // 不启用文件缓存
|
cache: false, // 不启用文件缓存
|
||||||
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
||||||
filename: '[path].gz[query]', // 压缩后的文件名
|
filename: "[path].gz[query]", // 压缩后的文件名
|
||||||
algorithm: 'gzip', // 使用gzip压缩
|
algorithm: "gzip", // 使用gzip压缩
|
||||||
minRatio: 0.8 // 压缩率小于1才会压缩
|
minRatio: 0.8, // 压缩率小于1才会压缩
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
chainWebpack: config => {
|
chainWebpack: (config) => {
|
||||||
config.extensions = ['.js', '.ts','.scss', '.vue', '.html'];
|
config.extensions = [".js", ".ts", ".scss", ".vue", ".html"];
|
||||||
|
|
||||||
config.plugin('module-federation-plugin').use(require("webpack").container.ModuleFederationPlugin,[{
|
config
|
||||||
name: "test",
|
.plugin("module-federation-plugin")
|
||||||
filename: "test.js",
|
.use(require("webpack").container.ModuleFederationPlugin, [
|
||||||
|
{
|
||||||
|
name: "test",
|
||||||
|
filename: "test.js",
|
||||||
|
|
||||||
remotes: {
|
remotes: {
|
||||||
common:`common@${process.env.VUE_APP_REMOTES_URL}/common.js`
|
common: `common@${process.env.VUE_APP_REMOTES_URL}/common.js`,
|
||||||
|
},
|
||||||
|
shared: require("./package.json").dependencies,
|
||||||
},
|
},
|
||||||
shared:require("./package.json").dependencies,
|
]);
|
||||||
}]);
|
|
||||||
config.module
|
config.module
|
||||||
.rule("html")
|
.rule("html")
|
||||||
.test(/\.html$/)
|
.test(/\.html$/)
|
||||||
.use('html-loader')
|
.use("html-loader")
|
||||||
.loader('html-loader')//预读,识别html文件
|
.loader("html-loader") //预读,识别html文件
|
||||||
.end()
|
.end();
|
||||||
// set svg-sprite-loader
|
// set svg-sprite-loader
|
||||||
|
config.module.rule("svg").exclude.add(resolve("src/assets")).end();
|
||||||
config.module
|
config.module
|
||||||
.rule('svg')
|
.rule("icons")
|
||||||
.exclude.add(resolve('src/assets'))
|
|
||||||
.end()
|
|
||||||
config.module
|
|
||||||
.rule('icons')
|
|
||||||
.test(/\.svg$/)
|
.test(/\.svg$/)
|
||||||
.include.add(resolve('src/assets'))
|
.include.add(resolve("src/assets"))
|
||||||
.end()
|
.end()
|
||||||
.use('svg-sprite-loader')
|
.use("svg-sprite-loader")
|
||||||
.loader('svg-sprite-loader')
|
.loader("svg-sprite-loader")
|
||||||
.options({
|
.options({
|
||||||
symbolId: 'icon-[name]'
|
symbolId: "icon-[name]",
|
||||||
})
|
})
|
||||||
.end()
|
.end();
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
client: {
|
client: {
|
||||||
|
@ -100,10 +101,10 @@ module.exports = defineConfig({
|
||||||
target: process.env.VUE_APP_BASE_API_URL,
|
target: process.env.VUE_APP_BASE_API_URL,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_GATEWAY_URL]: ""
|
["^" + process.env.VUE_APP_GATEWAY_URL]: "",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
// disableHostCheck: true
|
// disableHostCheck: true
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
|
Loading…
Reference in New Issue