| | |
| | | </template> |
| | | |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-circle-plus-outline" size="small" |
| | | @click.stop="openDilog(scope.row,scope.index)">编辑议题 |
| | | <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> |
| | | <el-button type="primary" icon="el-icon-edit" size="small" @click.stop="openUser(scope.row,0)">参与用户 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | <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)">选择此项人数 |
| | | <el-button v-if="row.level === 1" :size="size" text type="primary" @click="openDilog(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> |
| | | </avue-crud> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisiblesEdit" width="50%" :before-close="editHandleClose"> |
| | | <span slot="title" class="dialog-footer"> |
| | | 编辑议题 |
| | | </span> |
| | | <div id=""> |
| | | <avue-form @submit="handleSubmitEdit" :option="optionDiscuss" v-model="discussForm"></avue-form> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="50%" :before-close="userHandleClose"> |
| | | <!-- <span slot="title" class="dialog-footer"> |
| | | {{discussForm.ontitle}} |
| | | </span> --> |
| | | <avue-crud :data="data" :option="option1"></avue-crud> |
| | | </el-dialog> |
| | | |
| | | </basicContainer> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | option1: { |
| | | addBtn:false, |
| | | menu: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name' |
| | | }, { |
| | | label: '昵称', |
| | | prop: 'sex' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'sex' |
| | | }, { |
| | | label: '小区', |
| | | prop: 'sex' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'sex' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | discussForm: { |
| | | title: '', |
| | | openFlag: 0, |
| | | numberRestrictions: 0, |
| | | voteRestrictions: 0, |
| | | userRestrictions: 0, |
| | | endTime: '', |
| | | articleId: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | repeatVote: 0, |
| | | voteNumberPublic: 0, |
| | | appointUser: '', |
| | | userIds: '', |
| | | eventType: 1, |
| | | }, |
| | | dialogVisiblesEdit: false, |
| | | dialogVisiblesUser: false, |
| | | editFlag: false, |
| | | optionList: { |
| | | headerAlign: 'center', |
| | |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | }, |
| | | optionDiscuss: { |
| | | column: [{ |
| | | label: "", |
| | | // labelWidth: 20, |
| | | type: 'title', |
| | | prop: "title", |
| | | span: 24, |
| | | row: true, |
| | | offset: 2, |
| | | styles: { |
| | | // color: 'red', |
| | | fontSize: '24px' |
| | | } |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '开启投票', |
| | | prop: 'openFlag', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '开启', |
| | | value: 0 |
| | | }, { |
| | | label: '不开启', |
| | | value: 1 |
| | | }] |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '多房屋可重复', |
| | | prop: 'repeatVote', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '不可以', |
| | | value: 0 |
| | | }, { |
| | | label: '可以', |
| | | value: 1 |
| | | }] |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '投票限制', |
| | | prop: 'voteRestrictions', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '一人一票', |
| | | value: 0 |
| | | }, { |
| | | label: '一户一票', |
| | | value: 1 |
| | | }] |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '用户限制', |
| | | prop: 'userRestrictions', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '不限制', |
| | | value: 0 |
| | | }, { |
| | | label: '必须绑定手机', |
| | | value: 1 |
| | | }, { |
| | | label: '必须绑定房屋', |
| | | value: 2 |
| | | }] |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '票数公开', |
| | | prop: 'voteNumberPublic', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '全程公开', |
| | | value: 0 |
| | | }, { |
| | | label: '投票后公开', |
| | | value: 1 |
| | | }, { |
| | | label: '投票结束后公开', |
| | | value: 2 |
| | | }, { |
| | | label: '不公开', |
| | | value: 3 |
| | | }] |
| | | }, |
| | | { |
| | | label: "截止时间", |
| | | row: true, |
| | | offset: 6, |
| | | prop: "endTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "timestamp", |
| | | }, |
| | | // { |
| | | // labelWidth: 100, |
| | | // label: '人数限制', |
| | | // prop: 'numberRestrictions', |
| | | // type: 'number', |
| | | // button: true, |
| | | // row: true, |
| | | // min: 0, |
| | | // max: 99999999, |
| | | // controlsPosition: '', |
| | | // step: 10, |
| | | // offset: 6, |
| | | // }, |
| | | // { |
| | | // labelWidth: 100, |
| | | // label: '指定用户', |
| | | // prop: 'appointUser', |
| | | // type: 'radio', |
| | | // button: true, |
| | | // row: true, |
| | | // offset: 6, |
| | | // dicData: [{ |
| | | // label: '不限制', |
| | | // value: 0 |
| | | // }, { |
| | | // label: '指定用户可见', |
| | | // value: 1 |
| | | // }] |
| | | // }, |
| | | ] |
| | | }, |
| | | disCussFrom: { |
| | | discussContent: '', |
| | |
| | | }, |
| | | methods: { |
| | | |
| | | openUser(row, type) { |
| | | this.dialogVisiblesUser = true |
| | | }, |
| | | |
| | | openEdit(row) { |
| | | this.discussForm = row |
| | | let times = new Date(row.endTime).getTime(); |
| | | this.discussForm.endTime = times |
| | | this.dialogVisiblesEdit = true |
| | | }, |
| | | // 提交修改 |
| | | handleSubmitEdit(form, done) { |
| | | done() |
| | | if (!this.discussForm.id) { |
| | | addPd(this.discussForm).then(() => { |
| | | this.dialogVisiblesEdit = false |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | } else { |
| | | updatePd(this.discussForm).then(() => { |
| | | this.dialogVisiblesEdit = false |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | deletes(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | this.disCussFrom = {} |
| | | }, |
| | | |
| | | edithandleClose() { |
| | | this.dialogVisiblesEdit = false |
| | | }, |
| | | |
| | | edit(row) { |
| | | this.disCussFrom = row |
| | | this.editFlag = true |