| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table |
| | | ref="competencyTable" |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="recordList" |
| | |
| | | }" |
| | | border |
| | | > |
| | | <el-table-column type="index" label="序号" width="80"></el-table-column> |
| | | <el-table-column type="index" label="序号" width="80" fixed="left"></el-table-column> |
| | | <el-table-column |
| | | prop="userName" |
| | | label="人员名称" |
| | | min-width="120" |
| | | fixed="left" |
| | | width="120" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="postName" |
| | | label="岗位" |
| | | fixed="left" |
| | | min-width="120" |
| | | width="120" |
| | | ></el-table-column> |
| | |
| | | levelDictList:[], |
| | | tableHeight:0, |
| | | downloadLoading:false, |
| | | postList:[] |
| | | postList:[], |
| | | layoutTimer: null |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getLevelDict() |
| | | this.getTableHeader(); |
| | | this.getList(); |
| | | this.getTableHeight() |
| | | this.getPostList() |
| | | this.$nextTick(()=>{ |
| | | this.getTableHeight() |
| | | }) |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.getTableHeight); |
| | | this.scheduleTableLayout() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener("resize", this.getTableHeight); |
| | | if (this.layoutTimer) { |
| | | clearTimeout(this.layoutTimer) |
| | | this.layoutTimer = null |
| | | } |
| | | }, |
| | | methods: { |
| | | scheduleTableLayout() { |
| | | if (this.layoutTimer) { |
| | | clearTimeout(this.layoutTimer) |
| | | } |
| | | this.layoutTimer = setTimeout(() => { |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.competencyTable |
| | | if (table && typeof table.doLayout === 'function') { |
| | | table.doLayout() |
| | | } |
| | | }) |
| | | }, 0) |
| | | }, |
| | | getPostList(){ |
| | | optionSelect().then(res=>{ |
| | | if(res.code===200){ |
| | |
| | | const innerHeight = window.innerHeight; |
| | | const otherHeight = 50+46+40+51; |
| | | this.tableHeight = innerHeight - otherHeight; |
| | | this.scheduleTableLayout() |
| | | }, |
| | | changeSkillLevel(row, itemId){ |
| | | const configObj = {...row[itemId]} |
| | |
| | | this.levelDictList = response.data; |
| | | }); |
| | | }, |
| | | getTableHeader() { |
| | | listConfig({ isEnable: true }).then((response) => { |
| | | this.tableHeaderList = this.handleTree(response.data, "id"); |
| | | }); |
| | | }, |
| | | /** 查询列表 */ |
| | | getList() { |
| | | this.loading = true |
| | | this.getTableHeader(); |
| | | getPageList(this.queryParams).then(res=>{ |
| | | if(res.code===200){ |
| | | this.recordList = res.data |
| | | Promise.all([ |
| | | listConfig({ isEnable: true }), |
| | | getPageList(this.queryParams) |
| | | ]).then(([headerRes, listRes]) => { |
| | | this.tableHeaderList = this.handleTree(headerRes.data, "id"); |
| | | if(listRes.code===200){ |
| | | this.recordList = listRes.data |
| | | } |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | this.scheduleTableLayout() |
| | | }); |
| | | }, |
| | | /** 搜索按钮操作 */ |