| | |
| | | <template #menu="{ size, row, index }"> |
| | | <el-button type="primary" text plain icon="el-icon-edit" @click="editDialog(row)">编辑</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-position" @click="publicTimeBtn(row)" v-if="row.status === 2">发布</el-button> |
| | | <el-button type="primary" v-if="row.type === 0" text plain icon="el-icon-plus" @click="addCandidateHandle(row)">新增候选人</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-download">导出</el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </el-dialog> |
| | | <!-- 新增编辑弹窗 --> |
| | | <addDialog :params="addParams" @refreshTable="this.onLoad" /> |
| | | <!-- 新增候选人 --> |
| | | <addCandidate :params="addCandidateParams" @refreshTable="this.onLoad" /> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import addDialog from './components/addDialog.vue'; |
| | | import addCandidate from './components/addCandidate.vue'; |
| | | import { getDeptTree } from '@/api/system/dept'; |
| | | |
| | | export default { |
| | | components: { |
| | | addDialog, |
| | | addCandidate |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | // 新增候选人params |
| | | addCandidateParams: {}, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | const result = deptResult.data.data; |
| | | let deptList = []; |
| | | result.forEach(dept => { |
| | | console.log(dept); |
| | | if (dept.children) { |
| | | deptList = result.concat(dept.children); |
| | | delete dept.children; |
| | |
| | | ); |
| | | this.dialogVisible = false; |
| | | }, |
| | | addCandidateHandle(row) { |
| | | this.addCandidateParams = { |
| | | visible: true, |
| | | type: 0, |
| | | data: { |
| | | ...row |
| | | } |
| | | } |
| | | }, |
| | | tabChange(value) { |
| | | this.defaultTaskType = value.prop; |
| | | }, |