| | |
| | | <template slot-scope="scope" slot="menu"> |
| | | <!-- <el-button type="text" icon="el-icon-edit" size="small" @click.stop="openEdit(scope.row,scope.index)">编辑 |
| | | </el-button> --> |
| | | <el-button type="primary" icon="el-icon-edit" size="small" @click.stop="openDilog(scope.row,scope.index)">编辑议题 |
| | | <el-button type="primary" icon="el-icon-edit" size="small" |
| | | @click.stop="openDilog(scope.row, scope.index)">编辑议题 |
| | | </el-button> |
| | | <el-button type="primary" icon="el-icon-edit" size="small" @click.stop="openUser(scope.row,0)">参与用户 |
| | | </el-button> |
| | |
| | | </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="danger" @click="deletes(row)">删除</el-button> |
| | | <el-button v-if="row.level === 1" :size="size" text type="danger" |
| | | @click="deletes(row)">删除</el-button> |
| | | <el-button v-if="row.level === 2" :size="size" text type="primary" @click="openUser(row,1)">选择此项人数 |
| | | :{{row.number}} 详情</el-button> |
| | | </template> |
| | |
| | | addPd, |
| | | updatePd, |
| | | removePd |
| | | } from "@/api/discuss/publicDiscuss"; |
| | | } from "@/api/discuss/publicDiscuss" |
| | | |
| | | import { |
| | | getLists, |
| | |
| | | add, |
| | | update, |
| | | remove |
| | | } from "@/api/discuss/topics"; |
| | | } from "@/api/discuss/topics" |
| | | |
| | | import { |
| | | getPage |
| | | } from "@/api/discuss/userTopics"; |
| | | } from "@/api/discuss/userTopics" |
| | | |
| | | import option from "@/option/discuss/publicDiscuss"; |
| | | import option from "@/option/discuss/publicDiscuss" |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | } from "vuex" |
| | | import { |
| | | getDictionary |
| | | } from '@/api/system/dict' |
| | |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | addPd(row).then( |
| | | () => { |
| | | this.onLoad(this.discussion); |
| | | this.onLoad(this.discussion) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | |
| | | |
| | |
| | | // title: data.title |
| | | // } |
| | | this.form.title = data.title |
| | | this.form.articleId = data.id; |
| | | this.form.articleId = data.id |
| | | this.onLoad(data) |
| | | }, |
| | | |
| | |
| | | |
| | | getUserPage(page, params = {}) { |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.pageUser.total = data.total; |
| | | this.userData = data.records; |
| | | }); |
| | | const data = res.data.data |
| | | this.pageUser.total = data.total |
| | | this.userData = data.records |
| | | }) |
| | | }, |
| | | |
| | | openEdit(row) { |
| | | this.discussForm = row |
| | | let times = new Date(row.endTime).getTime(); |
| | | let times = new Date(row.endTime).getTime() |
| | | this.discussForm.endTime = times |
| | | this.dialogVisiblesEdit = true |
| | | }, |
| | |
| | | if (!row.id) { |
| | | addPd(row).then(() => { |
| | | this.dialogVisiblesEdit = false |
| | | this.onLoad(this.discussion); |
| | | this.onLoad(this.discussion) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | } else { |
| | | updatePd(row).then(() => { |
| | | this.dialogVisiblesEdit = false |
| | | this.onLoad(this.discussion); |
| | | this.onLoad(this.discussion) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | // this.onLoad(this.page); |
| | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | handleClose() { |
| | |
| | | |
| | | openDilog(row, type) { |
| | | this.dialogVisibles = true |
| | | this.loading = true; |
| | | this.loading = true |
| | | this.publicDiscussId = row.id |
| | | let params = { |
| | | level: 1, |
| | | publicDiscussId: row.id |
| | | } |
| | | getLists(1, 100, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.form = data; |
| | | this.loading = false; |
| | | const data = res.data.data |
| | | this.form = data |
| | | this.loading = false |
| | | // this.selectionClear(); |
| | | }) |
| | | }, |
| | | |
| | | handleSubmit(form, done) { |
| | | done(); |
| | | done() |
| | | form.publicDiscussId = this.publicDiscussId |
| | | add(form).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }) |
| | | form = {} |
| | | this.editFlag = false |
| | | let params = { |
| | |
| | | publicDiscussId: this.publicDiscussId |
| | | } |
| | | getLists(1, 100, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.form = data; |
| | | const data = res.data.data |
| | | this.form = data |
| | | }) |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | // loading(); |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | searchHide() { |
| | | this.search = !this.search; |
| | | this.search = !this.search |
| | | }, |
| | | searchChange() { |
| | | this.onLoad(this.discussion); |
| | | this.onLoad(this.discussion) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.discussion); |
| | | this.query = {} |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.discussion) |
| | | }, |
| | | |
| | | handleAdd() { |
| | |
| | | this.title = '编辑' |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleView(row) { |
| | | this.title = '查看' |
| | | this.view = true; |
| | | this.box = true; |
| | | this.view = true |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removePd(this.ids); |
| | | return removePd(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.selectionClear(); |
| | | this.onLoad(this.discussion); |
| | | this.selectionClear() |
| | | this.onLoad(this.discussion) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.discussion); |
| | | this.onLoad(this.discussion) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetailPd(this.form.id).then((res) => { |
| | | let data = res.data.data |
| | | this.form = data; |
| | | }); |
| | | this.form = data |
| | | }) |
| | | } |
| | | if (["add"].includes(type)) { |
| | | this.form.title = this.discussion.title; |
| | | this.form.articleId = this.discussion.id; |
| | | this.form.title = this.discussion.title |
| | | this.form.articleId = this.discussion.id |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | beforeClose(done) { |
| | | done() |
| | | this.form = {}; |
| | | this.view = false; |
| | | this.form = {} |
| | | this.view = false |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.selectionList = [] |
| | | // this.$refs.table.clearSelection(); |
| | | }, |
| | | // currentChange(currentPage) { |
| | |
| | | eventType: 1, |
| | | articleId: data.id |
| | | }) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getListPd(1, 10, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |