Compare commits

..

3 Commits

3 changed files with 268 additions and 338 deletions

View File

@ -11,7 +11,7 @@ module.exports = {
assetsPublicPath: '/', assetsPublicPath: '/',
proxyTable: { proxyTable: {
'/api': { '/api': {
target: 'http://192.168.0.29:8088/', target: 'http://192.168.0.112:8088/',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '' '^/api': ''
@ -20,7 +20,7 @@ module.exports = {
}, },
// Various Dev Server settings // Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST host: '192.168.0.118', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,

View File

@ -1,21 +1,21 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 顶部搜索能力 -->
<el-form :model="searchParmas" label-width="130px"> <el-form :model="searchParmas" label-width="130px">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="企业名称"> <el-form-item label="企业名称">
<el-input v-model="searchParmas.enterpriseName" placeholder="请输入企业名称"/> <el-input v-model="searchParmas.enterpriseName" placeholder="请输入企业名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="集团单位"> <el-form-item label="集团单位">
<el-input v-model="searchParmas.groupUnit" placeholder="请输入集团单位"/> <el-input v-model="searchParmas.groupUnit" placeholder="请输入集团单位" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="股份主管部门" style="margin-right: 20px;"> <el-form-item label="股份主管部门" style="margin-right: 20px">
<el-input v-model="searchParmas.shareSuperdepart" placeholder="请输入股份主管部门"/> <el-input v-model="searchParmas.shareSuperdepart" placeholder="请输入股份主管部门" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -36,7 +36,7 @@
v-loading="loading" v-loading="loading"
ref="multipleTable" ref="multipleTable"
:data="varList" :data="varList"
:header-cell-style="{ 'font-weight': 'bold', 'color': '#000' }" :header-cell-style="{ 'font-weight': 'bold', color: '#000' }"
:max-height="tableMaxHeight" :max-height="tableMaxHeight"
tooltip-effect="dark" tooltip-effect="dark"
border border
@ -45,35 +45,33 @@
highlight-current-row highlight-current-row
@selection-change="selectionChange" @selection-change="selectionChange"
@select-all="selectAll" @select-all="selectAll"
@row-click="rowClick" @row-click="rowClick">
> <!-- 固定列 -->
<el-table-column :selectable="handleSelectWithDifferentStatus" type="selection" width="55" fixed align="center"/> <el-table-column :selectable="handleSelectWithDifferentStatus" type="selection" width="55" fixed align="center" />
<el-table-column type="index" label="序号" align="center" width="90">
<!-- 序号列及弹出框 -->
<el-table-column type="index" fixed="left" label="序号" align="center" width="90">
<template slot="header"> <template slot="header">
<el-popover <el-popover ref="tablePopover" v-model="popoverVisible" width="240" trigger="manual">
ref="tablePopover" <span slot="reference" style="cursor: pointer" @click="openPopover">
v-model="popoverVisible" 序号
width="240" <i class="el-icon-finished" style="font-weight: bold" />
trigger="manual"
>
<span slot="reference" style="cursor: pointer;" @click="openPopover">
操作
<i class="el-icon-finished" style="font-weight: bold;"/>
</span> </span>
<div class="popoverCheckBoxArea"> <div class="popoverCheckBoxArea">
<el-checkbox :indeterminate="isIndeterminate" @change="handleCheckAllChange"></el-checkbox> <el-checkbox
<div style="margin: 10px 0;"/> v-model="checked"
:indeterminate="indeterminate"
@change="handleCheckAllChange">全选</el-checkbox>
<div style="margin: 10px 0" />
<el-tree <el-tree
ref="treeRef" ref="treeRef"
:data="optionsColumns" :data="dataSourceForTree"
:props="defaultProps" :props="defaultProps"
:default-expand-all="true" :default-expand-all="true"
:default-checked-keys="checkedColumns"
show-checkbox show-checkbox
node-key="id" node-key="id"
class="treeColumnStyle" class="treeColumnStyle"
@check-change="handleCheckChange" @check-change="changeCheck" />
/>
</div> </div>
<div class="popoverCheckBoxButton"> <div class="popoverCheckBoxButton">
<el-button size="mini" @click="canclePopover"></el-button> <el-button size="mini" @click="canclePopover"></el-button>
@ -82,20 +80,21 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="RELEVANT_UNIT_NAME" label="企业名称" align="center" show-overflow-tooltip width="120"/>
<el-table-column prop="CORP_TYPE_NAME" label="集团单位" show-overflow-tooltip align="center" width="120"/>
<el-table-column prop="MAIN_DEPARTMENT_NAME" label="股份主管部门" align="center" width="120"/>
<el-table-column prop="CORP_SIZE_NAME" label="企业规模" align="center" width="120"/>
<el-table-column prop="CONTACT_PERSON" label="主要负责人" align="center" width="120"/>
<el-table-column prop="CONTACT_TEL" label="主要负责人联系电话" align="center" width="120"/>
<el-table-column prop="REGISTER_COUNT" label="注册人数" align="center" width="120"/>
<el-table-column prop="PASS_COUNT" label="培训合格人数" align="center" width="120"/>
<el-table-column prop="personAgeStruc" label="人员年龄结构" align="center"> <el-table-column v-if="showColumn('RELEVANT_UNIT_NAME')" prop="RELEVANT_UNIT_NAME" label="企业名称" align="center" show-overflow-tooltip width="120"/>
<el-table-column prop="AVG_AGE" label="平均年龄" align="center" width="120"/> <el-table-column v-if="showColumn('CORP_TYPE_NAME')" prop="CORP_TYPE_NAME" label="集团单位" show-overflow-tooltip align="center" width="120"/>
<el-table-column prop="MORE_THAN_60_COUNT" label="大于60岁人数" align="center" width="120"/> <el-table-column v-if="showColumn('MAIN_DEPARTMENT_NAME')" prop="MAIN_DEPARTMENT_NAME" label="股份主管部门" align="center" width="120"/>
<el-table-column prop="BETWEEN_55_AND_60_COUNT" label="55-60岁人数" align="center" width="120"/> <el-table-column v-if="showColumn('CORP_SIZE_NAME')" prop="CORP_SIZE_NAME" label="企业规模" align="center" width="120"/>
<el-table-column prop="LESS_THAN_55_COUNT" label="55岁以下人数" align="center" width="120"/> <el-table-column v-if="showColumn('CONTACT_PERSON')" prop="CONTACT_PERSON" label="主要负责人" align="center" width="120"/>
<el-table-column v-if="showColumn('CONTACT_TEL')" prop="CONTACT_TEL" label="主要负责人联系电话" align="center" width="120"/>
<el-table-column v-if="showColumn('REGISTER_COUNT')" prop="REGISTER_COUNT" label="注册人数" align="center" width="120"/>
<el-table-column v-if="showColumn('PASS_COUNT')" prop="PASS_COUNT" label="培训合格人数" align="center" width="120"/>
<el-table-column v-if="showColumn('personAgeStruc')" prop="personAgeStruc" label="人员年龄结构" align="center">
<el-table-column v-if="showColumn('AVG_AGE')" prop="AVG_AGE" label="平均年龄" align="center" width="120"/>
<el-table-column v-if="showColumn('MORE_THAN_60_COUNT')" prop="MORE_THAN_60_COUNT" label="大于60岁人数" align="center" width="120"/>
<el-table-column v-if="showColumn('BETWEEN_55_AND_60_COUNT')" prop="BETWEEN_55_AND_60_COUNT" label="55-60岁人数" align="center" width="120"/>
<el-table-column v-if="showColumn('LESS_THAN_55_COUNT')" prop="LESS_THAN_55_COUNT" label="55岁以下人数" align="center" width="120"/>
</el-table-column> </el-table-column>
<el-table-column v-if="false" prop="workExprien" label="在港工作经历(年)" align="center" width="120"/> <el-table-column v-if="false" prop="workExprien" label="在港工作经历(年)" align="center" width="120"/>
@ -137,13 +136,14 @@
<el-table-column prop="MOTOR_VEHICLE" label="企业内机动车辆作业" align="center" width="130"/> <el-table-column prop="MOTOR_VEHICLE" label="企业内机动车辆作业" align="center" width="130"/>
<el-table-column prop="OTHER_SPECIAL" label="其他特种作业" align="center" width="120"/> <el-table-column prop="OTHER_SPECIAL" label="其他特种作业" align="center" width="120"/>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div> <div>
<el-button type="primary" icon="el-icon-upload2" @click="handleExportBtn"></el-button> <el-button type="primary" icon="el-icon-upload2" @click="handleExportBtn"></el-button>
</div> </div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div> </div>
</div> </div>
</template> </template>
@ -152,12 +152,16 @@
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' import waves from '@/directive/waves'
import axios from 'axios'
import moment from 'moment'
export default { export default {
components: { Pagination }, components: { Pagination },
directives: { waves }, directives: { waves },
data() { data() {
return { return {
config: config,
searchParmas: { searchParmas: {
enterpriseName: '', enterpriseName: '',
groupUnit: '', groupUnit: '',
@ -175,11 +179,12 @@ export default {
}, },
total: 0, total: 0,
// //
optionsColumns: [ dataSourceForTree: [
{ {
id: '1', id: '1',
label: '企业名称', label: '企业名称',
value: 'RELEVANT_UNIT_NAME', value: 'RELEVANT_UNIT_NAME',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -187,14 +192,15 @@ export default {
id: '2', id: '2',
label: '集团单位', label: '集团单位',
value: 'CORP_TYPE_NAME', value: 'CORP_TYPE_NAME',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
{ {
id: '3', id: '3',
label: '股份主管部门', label: '股份主管部门',
value: 'MAIN_DEPARTMENT_NAME', value: 'MAIN_DEPARTMENT_NAME',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -202,20 +208,23 @@ export default {
id: '4', id: '4',
label: '企业规模', label: '企业规模',
value: 'CORP_SIZE_NAME', value: 'CORP_SIZE_NAME',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
{ {
id: '5', id: '5',
label: '企业名称', label: '主要负责人',
value: 'enterpriseName', value: 'CONTACT_PERSON',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
{ {
id: '6', id: '6',
label: '主要负责人', label: '主要负责人联系电话',
value: 'CONTACT_PERSON', value: 'CONTACT_TEL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -223,6 +232,7 @@ export default {
id: '7', id: '7',
label: '注册人数', label: '注册人数',
value: 'REGISTER_COUNT', value: 'REGISTER_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -230,19 +240,22 @@ export default {
id: '8', id: '8',
label: '培训合格人数', label: '培训合格人数',
value: 'PASS_COUNT', value: 'PASS_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
{ {
id: '9', id: '9',
label: '人员年龄结构', label: '人员年龄结构',
value: 'personAgeStruct', disabled: false,
value: 'personAgeStruc',
show: true, show: true,
children: [ children: [
{ {
id: '9-1', id: '9-1',
label: '平均年龄', label: '平均年龄',
value: 'AVG_AGE', value: 'AVG_AGE',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -250,6 +263,7 @@ export default {
id: '9-2', id: '9-2',
label: '大于60岁人数', label: '大于60岁人数',
value: 'MORE_THAN_60_COUNT', value: 'MORE_THAN_60_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -257,6 +271,7 @@ export default {
id: '9-3', id: '9-3',
label: '55-60岁人数:', label: '55-60岁人数:',
value: 'BETWEEN_55_AND_60_COUNT', value: 'BETWEEN_55_AND_60_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -264,21 +279,16 @@ export default {
id: '9-4', id: '9-4',
label: '55岁以下人数', label: '55岁以下人数',
value: 'LESS_THAN_55_COUNT', value: 'LESS_THAN_55_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
} }
] ]
}, },
{
id: '10',
label: '在港工作经历(年)',
value: 'workExprien',
show: true,
children: []
},
{ {
id: '11', id: '11',
label: '人员学历', label: '人员学历',
disabled: false,
value: 'personEducation', value: 'personEducation',
show: true, show: true,
children: [ children: [
@ -286,6 +296,7 @@ export default {
id: '11-1', id: '11-1',
label: '高中以下', label: '高中以下',
value: 'BELOW_HIGH_SCHOOL', value: 'BELOW_HIGH_SCHOOL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -293,6 +304,7 @@ export default {
id: '11-2', id: '11-2',
label: '高中', label: '高中',
value: 'HIGH_SCHOOL', value: 'HIGH_SCHOOL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -300,6 +312,7 @@ export default {
id: '11-3', id: '11-3',
label: '技工', label: '技工',
value: 'TECHNICAL_SCHOOL', value: 'TECHNICAL_SCHOOL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -307,6 +320,7 @@ export default {
id: '11-4', id: '11-4',
label: '中专或中等技术学校', label: '中专或中等技术学校',
value: 'TECHNICAL_SECONDARY_SCHOOL', value: 'TECHNICAL_SECONDARY_SCHOOL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -314,6 +328,7 @@ export default {
id: '11-5', id: '11-5',
label: '大学专科或专科院校', label: '大学专科或专科院校',
value: 'JUNIOR_COLLEGE', value: 'JUNIOR_COLLEGE',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -321,6 +336,7 @@ export default {
id: '11-6', id: '11-6',
label: '大学本科', label: '大学本科',
value: 'UNDERGRADUATE', value: 'UNDERGRADUATE',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -328,6 +344,7 @@ export default {
id: '11-7', id: '11-7',
label: '大学本科以上', label: '大学本科以上',
value: 'ABOVE_UNDERGRADUATE', value: 'ABOVE_UNDERGRADUATE',
disabled: false,
show: true, show: true,
children: [] children: []
} }
@ -338,11 +355,13 @@ export default {
label: '男职工', label: '男职工',
value: 'man', value: 'man',
show: true, show: true,
disabled: false,
children: [ children: [
{ {
id: '12-1', id: '12-1',
label: '人数', label: '人数',
value: 'MAN_COUNT', value: 'MAN_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -350,6 +369,7 @@ export default {
id: '12-2', id: '12-2',
label: '占比', label: '占比',
value: 'MAN_PERCENT', value: 'MAN_PERCENT',
disabled: false,
show: true, show: true,
children: [] children: []
} }
@ -358,13 +378,15 @@ export default {
{ {
id: '13', id: '13',
label: '女职工', label: '女职工',
value: 'woman',
show: true, show: true,
value: 'woman',
disabled: false,
children: [ children: [
{ {
id: '13-1', id: '13-1',
label: '人数', label: '人数',
value: 'WOMAN_COUNT', value: 'WOMAN_COUNT',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -372,6 +394,7 @@ export default {
id: '13-2', id: '13-2',
label: '占比', label: '占比',
value: 'WOMAN_PERCENT', value: 'WOMAN_PERCENT',
disabled: false,
show: true, show: true,
children: [] children: []
} }
@ -381,12 +404,14 @@ export default {
id: '14', id: '14',
label: '保险相关', label: '保险相关',
value: 'insurance', value: 'insurance',
disabled: false,
show: true, show: true,
children: [ children: [
{ {
id: '14-1', id: '14-1',
label: '有社保人数', label: '有社保人数',
value: 'SOCIAL', value: 'SOCIAL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -394,6 +419,7 @@ export default {
id: '14-2', id: '14-2',
label: '有工伤保险人数', label: '有工伤保险人数',
value: 'OCCUPATIONAL_INJURY', value: 'OCCUPATIONAL_INJURY',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -401,6 +427,7 @@ export default {
id: '14-3', id: '14-3',
label: '有商业保险人数', label: '有商业保险人数',
value: 'COMMERCIAL_INSURANCE', value: 'COMMERCIAL_INSURANCE',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -408,6 +435,7 @@ export default {
id: '14-4', id: '14-4',
label: '其他保险人数', label: '其他保险人数',
value: 'OTHER_INSURANCE', value: 'OTHER_INSURANCE',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -415,6 +443,7 @@ export default {
id: '14-5', id: '14-5',
label: '无保险人数', label: '无保险人数',
value: 'NO_INSURANCE', value: 'NO_INSURANCE',
disabled: false,
show: true, show: true,
children: [] children: []
} }
@ -424,12 +453,14 @@ export default {
id: '15', id: '15',
label: '取得特种作业证书人数', label: '取得特种作业证书人数',
value: 'numOfSpecialOperation', value: 'numOfSpecialOperation',
disabled: false,
show: true, show: true,
children: [ children: [
{ {
id: '15-1', id: '15-1',
label: '总人数', label: '总人数',
value: 'SPECIAL_TOTAL', value: 'SPECIAL_TOTAL',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -437,6 +468,7 @@ export default {
id: '15-2', id: '15-2',
label: '电工作业', label: '电工作业',
value: 'ELECTRICIAN', value: 'ELECTRICIAN',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -444,6 +476,7 @@ export default {
id: '15-3', id: '15-3',
label: '焊接与热切割作业', label: '焊接与热切割作业',
value: 'WELDING', value: 'WELDING',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -451,6 +484,7 @@ export default {
id: '15-4', id: '15-4',
label: '高处作业', label: '高处作业',
value: 'HIGH_WORK', value: 'HIGH_WORK',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -458,6 +492,7 @@ export default {
id: '15-5', id: '15-5',
label: '起重机械作业', label: '起重机械作业',
value: 'CRANE_OPERATION', value: 'CRANE_OPERATION',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -465,6 +500,7 @@ export default {
id: '15-6', id: '15-6',
label: '企业内机动车辆作业', label: '企业内机动车辆作业',
value: 'MOTOR_VEHICLE', value: 'MOTOR_VEHICLE',
disabled: false,
show: true, show: true,
children: [] children: []
}, },
@ -472,24 +508,30 @@ export default {
id: '15-7', id: '15-7',
label: '其他特种作业', label: '其他特种作业',
value: 'OTHER_SPECIAL', value: 'OTHER_SPECIAL',
disabled: false,
show: true, show: true,
children: [] children: []
} }
] ]
} }
], ],
treeCheckedIds: [], // id
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
}, },
checked: true, //
popoverVisible: false, popoverVisible: false,
checkedColumns: [], // id indeterminate: false, //
isIndeterminate: false selectionSelected: [],
head: []
} }
}, },
created() { created() {
// el-table // el-table
this.tableMaxHeight = window.innerHeight - 230 this.tableMaxHeight = window.innerHeight - 230
// ,
this.getList() //
}, },
mounted() { mounted() {
// el-table // el-table
@ -497,20 +539,12 @@ export default {
window.onresize = () => { window.onresize = () => {
this.tableMaxHeight = window.innerHeight - 230 this.tableMaxHeight = window.innerHeight - 230
} }
this.$refs.treeRef.setCheckedNodes(
this.dataSourceForTree.filter(node => !node.disabled)
)
}) })
this.checkedColumns = this.getIds(this.optionsColumns)
}, },
methods: { methods: {
getIds(optionsColumns) {
let ids = []
for (const column of optionsColumns) {
ids.push(column.id)
if (column.children && column.children.length > 0) {
ids = ids.concat(this.getIds(column.children))
}
}
return ids
},
handleSelectWithDifferentStatus(row, rowIndex) { handleSelectWithDifferentStatus(row, rowIndex) {
return true return true
}, },
@ -532,65 +566,195 @@ export default {
} }
this.getQuery() this.getQuery()
}, },
/** 获取列表数据 */
getList() { getList() {
this.loading = true this.loading = true
requestFN( requestFN(
'/openApi/user/statistics?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page, '/openApi/user/statistics?showCount=' +
this.listQuery.limit +
'&currentPage=' +
this.listQuery.page,
{ KEYWORDS: this.KEYWORDS, ISSMALL: '2' } { KEYWORDS: this.KEYWORDS, ISSMALL: '2' }
).then((data) => { )
.then(data => {
this.loading = false this.loading = false
this.varList = data.list this.varList = data.list
this.total = data.page.totalResult this.total = data.page.totalResult
}).catch((e) => { })
.catch(e => {
console.log(e) console.log(e)
this.loading = false this.loading = false
}) })
}, },
selectionChange(row) { selectionChange(row) {
console.log('row :>> ', row) this.selectionSelected = row
}, },
selectAll(selection) { selectAll(selection) {
console.log('selection :>> ', selection) this.selectionSelected = selection
}, },
rowClick(row, column, event) { rowClick(row, column, event) {
console.log('row :>> ', row) console.log('row :>> ', row)
}, },
handleExportBtn() { handleExportBtn() {
console.log('批量导出暂未开发!') const ids = this.selectionSelected
.map(item => {
return item.CORPINFO_ID
})
.toString(',')
const result = this.collectValues(this.dataSourceForTree)
this.head = result.toString(',')
if (
this.selectionSelected.map(item => {
return item.CORPINFO_ID
}).length === 0
) {
this.$message.error('请选择数据项后导出!')
}
this.exportExcelHandler(ids, this.head)
},
collectValues(data, resultArray = []) {
data.forEach(item => {
if (item.show) {
resultArray.push(item.value) // value
}
if (item.children && item.children.length > 0) {
this.collectValues(item.children, resultArray) //
}
})
return resultArray
},
// excel
exportExcelHandler(ids, head) {
return new Promise((resolve, reject) => {
axios
.post(
config.httpurl + '/openApi/excel?' + `ids=${ids}&head=${head}`,
{},
{
responseType: 'blob'
}
)
.then(res => {
setTimeout(() => {
const blob = new Blob([res.data], {
type: 'application/vnd.ms-excel'
})
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
downloadElement.style.display = 'none'
downloadElement.href = href
downloadElement.download = moment().format('YYYY-MM-DD HH:mm:ss')
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
resolve(res)
}, 2000)
})
.catch(e => {
reject(e)
this.$message.error('导出失败,或未查询到隐患')
})
})
}, },
// //
openPopover() { openPopover() {
this.popoverVisible = true this.popoverVisible = true
this.$nextTick(() => {
document.getElementsByClassName('el-popover el-popper')[0].style.display = 'none'
})
},
//
handleCheckAllChange(val) {
const columnsValueList = []
this.getIds(this.optionsColumns).map(item => {
columnsValueList.push(item)
})
this.checkedColumns = val ? columnsValueList : []
console.log('this.checkedColumns :>> ', this.checkedColumns)
// const treeRef = this.$refs.treeRef
// if (val) {
// treeRef.setCheckedNodes(this.getIds(this.optionsColumns))
// } else {
// treeRef.setCheckedNodes([])
// }
}, },
//
canclePopover() { canclePopover() {
this.popoverVisible = false this.popoverVisible = false
}, },
// //
handleCheckChange(currentRow, selfCheck, subCheck) { handleCheckAllChange() {
console.log('currentRow :>> ', currentRow) if (this.checked) {
this.$refs.treeRef.setCheckedNodes(
this.dataSourceForTree.filter(node => !node.disabled)
)
this.treeCheckedIds = this.$refs.treeRef
.getCheckedNodes(false, true)
.map(i => i.id)
this.head = this.$refs.treeRef.getCheckedNodes(false, true).map(i => i.value)
} else {
this.$refs.treeRef.setCheckedNodes([])
this.treeCheckedIds = []
this.head = []
}
}, },
// //
changeCheck(checkedNode, isChecked, selfNode) {
const res = this.updateShowProperty(
this.dataSourceForTree,
checkedNode,
isChecked
)
this.dataSourceForTree = res
},
updateShowProperty(dataSource, curNode, isChecked) {
//
function recursiveUpdate(node) {
//
let allChildrenUnchecked = true
//
if (node.children && node.children.length > 0) {
node.children.forEach(child => {
const childChecked = recursiveUpdate(child)
if (childChecked) {
allChildrenUnchecked = false
}
})
}
// show
if (node.id === curNode.id) {
node.show = isChecked
}
// show
if (node.children && node.children.length > 0) {
if (allChildrenUnchecked) {
node.show = false
} else {
node.show = true
}
}
return node.show // show
}
//
dataSource.forEach(node => recursiveUpdate(node))
return dataSource
},
//
confirmPopover() { confirmPopover() {
this.popoverVisible = false this.popoverVisible = false
},
//
showColumn(columnValue) {
//
const findItem = (data, value) => {
for (let i = 0; i < data.length; i++) {
const item = data[i]
if (item.value === value) {
return item
}
if (item.children && item.children.length > 0) {
const foundInChildren = findItem(item.children, value)
if (foundInChildren) {
return foundInChildren
}
}
}
return null
}
//
const foundItem = findItem(this.dataSourceForTree, columnValue)
// show false
return foundItem ? foundItem.show : false
} }
} }
} }

View File

@ -1,234 +0,0 @@
var mockVarList = [
{
enterpriseName: '风力杭天',
groupUnit: '集团企业',
shareSuperdepart: '供水除尘部',
scale: '大型',
mainerPerson: '小美',
mainerPersonPhone: '13933293932',
enrollment: 90,
numQualiTrain: 120,
averageAge: 55,
ageUpperSixty: 4,
fiftyFiveAndSixty: 8,
ageUnderFiftyFive: 18,
workExprien: null,
belowHigh: 50,
high: 4,
mechanic: 40,
technicalOrSecondary: 20,
collegeOrCollege: 39,
graduateCollege: 1,
undergraduateCollege: 9,
manpersonNum: 2,
manRatio: '80%',
womanPersonNum: 9,
womanRatio: '30%',
numOfSecure: 40,
numOfworkRelated: 98,
numOfCommercial: 20,
numOfOther: 12,
numOfNone: 6,
totalPerson: 1200,
electricianWork: 9,
weldingAndHotCuttingWork: 3,
heightsWork: 1,
hoistingMachineryWork: 90,
motorVehiclesWork: 130,
otherSpecialWork: 34
},
{
enterpriseName: '行里力杭天',
groupUnit: '集团企业',
shareSuperdepart: '火力除尘部',
scale: '中小型',
mainerPerson: '轩里',
mainerPersonPhone: '150244938491',
enrollment: 90,
numQualiTrain: 120,
averageAge: 55,
ageUpperSixty: 4,
fiftyFiveAndSixty: 8,
ageUnderFiftyFive: 18,
workExprien: null,
belowHigh: 50,
high: 4,
mechanic: 40,
technicalOrSecondary: 20,
collegeOrCollege: 39,
graduateCollege: 1,
undergraduateCollege: 9,
manpersonNum: 2,
manRatio: '80%',
womanPersonNum: 9,
womanRatio: '30%',
numOfSecure: 40,
numOfworkRelated: 98,
numOfCommercial: 20,
numOfOther: 12,
numOfNone: 6,
totalPerson: 1200,
electricianWork: 9,
weldingAndHotCuttingWork: 3,
heightsWork: 1,
hoistingMachineryWork: 90,
motorVehiclesWork: 130,
otherSpecialWork: 34
},
{
enterpriseName: '意下提取',
groupUnit: '集团企业',
shareSuperdepart: '火力除尘部',
scale: '中小型',
mainerPerson: '轩里',
mainerPersonPhone: '150244938491',
enrollment: 90,
numQualiTrain: 120,
averageAge: 55,
ageUpperSixty: 4,
fiftyFiveAndSixty: 8,
ageUnderFiftyFive: 18,
workExprien: null,
belowHigh: 50,
high: 4,
mechanic: 40,
technicalOrSecondary: 20,
collegeOrCollege: 39,
graduateCollege: 1,
undergraduateCollege: 9,
manpersonNum: 2,
manRatio: '80%',
womanPersonNum: 9,
womanRatio: '30%',
numOfSecure: 40,
numOfworkRelated: 98,
numOfCommercial: 20,
numOfOther: 12,
numOfNone: 6,
totalPerson: 1200,
electricianWork: 9,
weldingAndHotCuttingWork: 3,
heightsWork: 1,
hoistingMachineryWork: 90,
motorVehiclesWork: 130,
otherSpecialWork: 34
},
{
enterpriseName: '燕来客机民众',
groupUnit: '集团企业',
shareSuperdepart: '火力除尘部',
scale: '中小型',
mainerPerson: '轩里',
mainerPersonPhone: '150244938491',
enrollment: 90,
numQualiTrain: 120,
averageAge: 55,
ageUpperSixty: 4,
fiftyFiveAndSixty: 8,
ageUnderFiftyFive: 18,
workExprien: null,
belowHigh: 50,
high: 4,
mechanic: 40,
technicalOrSecondary: 20,
collegeOrCollege: 39,
graduateCollege: 1,
undergraduateCollege: 9,
manpersonNum: 2,
manRatio: '80%',
womanPersonNum: 9,
womanRatio: '30%',
numOfSecure: 40,
numOfworkRelated: 98,
numOfCommercial: 20,
numOfOther: 12,
numOfNone: 6,
totalPerson: 1200,
electricianWork: 9,
weldingAndHotCuttingWork: 3,
heightsWork: 1,
hoistingMachineryWork: 90,
motorVehiclesWork: 130,
otherSpecialWork: 34
},
{
enterpriseName: '天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星',
groupUnit: '集团企业',
shareSuperdepart: '火力除尘部',
scale: '中小型',
mainerPerson: '轩里',
mainerPersonPhone: '150244938491',
enrollment: 90,
numQualiTrain: 120,
averageAge: 55,
ageUpperSixty: 4,
fiftyFiveAndSixty: 8,
ageUnderFiftyFive: 18,
workExprien: null,
belowHigh: 50,
high: 4,
mechanic: 40,
technicalOrSecondary: 20,
collegeOrCollege: 39,
graduateCollege: 1,
undergraduateCollege: 9,
manpersonNum: 2,
manRatio: '80%',
womanPersonNum: 9,
womanRatio: '30%',
numOfSecure: 40,
numOfworkRelated: 98,
numOfCommercial: 20,
numOfOther: 12,
numOfNone: 6,
totalPerson: 1200,
electricianWork: 9,
weldingAndHotCuttingWork: 3,
heightsWork: 1,
hoistingMachineryWork: 90,
motorVehiclesWork: 130,
otherSpecialWork: 34
},
{
enterpriseName: '天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星天河夜星',
groupUnit: '集团企业',
shareSuperdepart: '火力除尘部',
scale: '中小型',
mainerPerson: '轩里',
mainerPersonPhone: '150244938491',
enrollment: 90,
numQualiTrain: 120,
averageAge: 55,
ageUpperSixty: 4,
fiftyFiveAndSixty: 8,
ageUnderFiftyFive: 18,
workExprien: null,
belowHigh: 50,
high: 4,
mechanic: 40,
technicalOrSecondary: 20,
collegeOrCollege: 39,
graduateCollege: 1,
undergraduateCollege: 9,
manpersonNum: 2,
manRatio: '80%',
womanPersonNum: 9,
womanRatio: '30%',
numOfSecure: 40,
numOfworkRelated: 98,
numOfCommercial: 20,
numOfOther: 12,
numOfNone: 6,
totalPerson: 1200,
electricianWork: 9,
weldingAndHotCuttingWork: 3,
heightsWork: 1,
hoistingMachineryWork: 90,
motorVehiclesWork: 130,
otherSpecialWork: 34
}
]
export {
mockVarList
}