| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getLists = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-topics/topics/lists', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-topics/topics/list', |
| | |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose"> |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="60%" :before-close="handleClose"> |
| | | <span slot="title" class="dialog-footer"> |
| | | {{ontitle}} |
| | | </span> |
| | | <avue-form @submit="handleSubmit" :option="optionDiscuss" v-model="disCussFrom"> |
| | | |
| | | <div id="" v-if="editFlag"> |
| | | <avue-form @submit="handleSubmit" :option="optionDiscuss" @reset-change="handleReset" v-model="disCussFrom"> |
| | | </avue-form> |
| | | </div> |
| | | |
| | | <div id=""> |
| | | <avue-crud :option="optionList" :data="form" ref="crud" @row-save="rowSave" @row-update="rowUpdate" |
| | | @row-del="rowDel"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="add()">添加 |
| | | </el-button> |
| | | |
| | | <!-- <el-button v-if="editFlag" type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="canl()">取消 |
| | | </el-button> --> |
| | | |
| | | </template> |
| | | <template #icon="scope"> |
| | | <i :class="scope.row.icon" style="font-size:14px"></i> |
| | | </template> |
| | | <template #menu="{row,size}"> |
| | | <el-button v-if="row.level === 1" :size="size" text type="primary" @click="edit(row)">编辑</el-button> |
| | | <el-button v-if="row.level === 1" :size="size" text type="primary" @click="deletes(row)">删除</el-button> |
| | | <el-button v-if="row.level === 2" :size="size" text type="primary" @click="handleAdd(row)">选择此项人数 |
| | | :{{row.number}} 详情</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | </basicContainer> |
| | | </template> |
| | |
| | | } from "@/api/discuss/publicDiscuss"; |
| | | |
| | | import { |
| | | getLists, |
| | | getList, |
| | | getDetail, |
| | | add, |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | editFlag: false, |
| | | optionList: { |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | border: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | defaultExpandAll: true, |
| | | rowKey: 'id', |
| | | rowParentKey: 'parentId', |
| | | column: [{ |
| | | label: '标题', |
| | | prop: 'discussContent', |
| | | }, |
| | | { |
| | | label: '选项内容', |
| | | prop: 'optionContent', |
| | | } |
| | | ] |
| | | }, |
| | | optionDiscuss: { |
| | | emptyText: '取消', |
| | | column: [{ |
| | | label: '议题', |
| | | prop: 'discussContent', |
| | |
| | | row: true, |
| | | }, { |
| | | label: '选项范围', |
| | | prop: 'option', |
| | | prop: 'optionRange', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | |
| | | }, |
| | | disCussFrom: { |
| | | discussContent: '', |
| | | option: 0, |
| | | optionRange: 0, |
| | | sort: 1, |
| | | optionContent: '', |
| | | optionDetail: '', |
| | |
| | | total: 0 |
| | | }, |
| | | // 表单数据 |
| | | form: {}, |
| | | form: [], |
| | | // 选择行 |
| | | selectionList: [], |
| | | // 表单配置 |
| | |
| | | }, |
| | | methods: { |
| | | |
| | | deletes(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | // this.onLoad(this.page); |
| | | this.dialogVisibles = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | handleClose() { |
| | | this.editFlag = false |
| | | this.dialogVisibles = false |
| | | this.disCussFrom = {} |
| | | }, |
| | | |
| | | edit(row) { |
| | | this.disCussFrom = row |
| | | this.editFlag = true |
| | | }, |
| | | |
| | | add() { |
| | | this.editFlag = true |
| | | }, |
| | | |
| | | handleReset() { |
| | | this.editFlag = false |
| | | }, |
| | | |
| | | openDilog(row, type) { |
| | | this.dialogVisibles = true |
| | | this.loading = true; |
| | | let params = {} |
| | | getList(1, 100, Object.assign(params, this.query)).then(res => { |
| | | // this.disCussFrom.publicDiscussId = row.id |
| | | let params = { |
| | | level: 1 |
| | | } |
| | | getLists(1, 100, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.dataTop = data.records; |
| | | this.form = data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }) |
| | |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.dialogVisibles = false |
| | | done(); |
| | | this.editFlag = false |
| | | let params = { |
| | | level: 1 |
| | | } |
| | | getLists(1, 100, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.form = data; |
| | | }) |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |