| | |
| | | <template> |
| | | <basic-container> |
| | | <template v-if="isResult"> |
| | | <ul class="task-box"> |
| | | <li v-for="(taskType, index) in taskTypeList" :key="index" @click="tabClick(taskType.value, index)" |
| | | :class="{ 'active-type': index === defaultTaskType }"> |
| | | {{ taskType.label }} |
| | | </li> |
| | | </ul> |
| | | <avue-tabs :option="taskTypeList" @change="tabChange"></avue-tabs> |
| | | <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading" |
| | | :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate" |
| | | @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
| | |
| | | // 考核结果参数 |
| | | resultParams: {}, |
| | | defaultTaskType: 0, |
| | | taskTypeList: [ |
| | | { |
| | | label: '全部', |
| | | value: null |
| | | }, |
| | | { |
| | | label: '个人考核任务', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '部门考核任务', |
| | | value: 1 |
| | | } |
| | | ] |
| | | taskTypeList: { |
| | | column: [ |
| | | { |
| | | label: '个人考核任务', |
| | | prop: 0 |
| | | }, |
| | | { |
| | | label: '部门考核任务', |
| | | prop: 1 |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | watch: { |
| | | defaultTaskType(n) { |
| | | const taskType = this.taskTypeList[n].value; |
| | | let params = {} |
| | | taskType === void 0 ? params = {} : params = { type: taskType } |
| | | this.query = params; |
| | | this.query['type'] = n |
| | | let params = { |
| | | type: n |
| | | } |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | } |
| | |
| | | } = this.query; |
| | | |
| | | let values = { |
| | | ...this.query |
| | | ...this.query, |
| | | ...params |
| | | }; |
| | | |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | tabClick(value, index) { |
| | | this.defaultTaskType = index |
| | | tabChange(value) { |
| | | this.defaultTaskType = value.prop |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .task-box { |
| | | margin: 0; |
| | | padding: 0; |
| | | list-style-type: none; |
| | | display: flex; |
| | | align-items: end; |
| | | margin-bottom: 10px; |
| | | height: 35px; |
| | | |
| | | li { |
| | | margin-left: 20px; |
| | | padding-bottom: 5px; |
| | | cursor: pointer; |
| | | transition: all .3s ease-in-out; |
| | | |
| | | &:first-child { |
| | | margin-left: 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .active-type { |
| | | font-size: 20px; |
| | | font-weight: 400; |
| | | position: relative; |
| | | |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 2px; |
| | | bottom: 0; |
| | | left: 0; |
| | | background-color: var(--el-color-primary); |
| | | } |
| | | }</style> |
| | | </style> |