From 33f5ae13b92dbf22f5455e8f648f29e5ebb2eb32 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Sat, 25 Nov 2023 13:39:32 +0800
Subject: [PATCH] 公益 议题

---
 src/views/article/publicSignUp.vue     |  182 ++++++++++++++++++++++
 src/views/article/article.vue          |    1 
 src/views/article/discussionManage.vue |  258 ++++++++++++++++++++++++++++++-
 src/option/discuss/publicDiscuss.js    |    3 
 4 files changed, 425 insertions(+), 19 deletions(-)

diff --git a/src/option/discuss/publicDiscuss.js b/src/option/discuss/publicDiscuss.js
index a9feeb7..0a1824c 100644
--- a/src/option/discuss/publicDiscuss.js
+++ b/src/option/discuss/publicDiscuss.js
@@ -5,9 +5,10 @@
   align: 'center',
   menuAlign: 'center',
   addBtn: false,
-  // editBtn: false,
+  editBtn: false,
   searchMenuSpan: 3,
   searchBtn: true,
+  menuWidth: 500,
   column: [{
       label: 'ID',
       prop: 'id',
diff --git a/src/views/article/article.vue b/src/views/article/article.vue
index 247ac47..adbc046 100644
--- a/src/views/article/article.vue
+++ b/src/views/article/article.vue
@@ -57,7 +57,6 @@
         <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm">
         </avue-form>
       </div>
-
     </el-dialog>
 
     <!-- <el-dialog title="用户数据导入" append-to-body :visible.sync="dialogVisibles" width="555px">
diff --git a/src/views/article/discussionManage.vue b/src/views/article/discussionManage.vue
index 9a296a1..c18948e 100644
--- a/src/views/article/discussionManage.vue
+++ b/src/views/article/discussionManage.vue
@@ -11,8 +11,11 @@
       </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>
@@ -33,24 +36,40 @@
           <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>
 
@@ -83,6 +102,48 @@
   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',
@@ -153,7 +214,144 @@
               }
             },
           ]
-
+        },
+        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: '',
@@ -229,6 +427,40 @@
     },
     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: "确定",
@@ -254,6 +486,10 @@
         this.disCussFrom = {}
       },
 
+      edithandleClose() {
+        this.dialogVisiblesEdit = false
+      },
+
       edit(row) {
         this.disCussFrom = row
         this.editFlag = true
diff --git a/src/views/article/publicSignUp.vue b/src/views/article/publicSignUp.vue
index 6db76ec..1f6a467 100644
--- a/src/views/article/publicSignUp.vue
+++ b/src/views/article/publicSignUp.vue
@@ -11,7 +11,31 @@
           @click="handleDelete">批量删除
         </el-button>
       </template>
+
+      <template slot-scope="scope" slot="menu">
+        <el-button type="text" icon="el-icon-s-custom" size="small" @click.stop="openDilog(scope.row,0)">
+          编辑
+        </el-button>
+        <el-button type="primary" icon="el-icon-s-custom" size="small" @click.stop="openUser(scope.row,0)">
+          参与用户
+        </el-button>
+      </template>
     </avue-crud>
+
+    <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
+      <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm">
+      </avue-form>
+    </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>
 
@@ -34,6 +58,133 @@
   export default {
     data() {
       return {
+        option1: {
+          menu: false,
+          addBtn: false,
+          column: [{
+            label: '姓名',
+            prop: 'name'
+          }, {
+            label: '昵称',
+            prop: 'sex'
+          }, {
+            label: '手机',
+            prop: 'sex'
+          }, {
+            label: '小区',
+            prop: 'sex'
+          }, {
+            label: '地址',
+            prop: 'sex'
+          }, {
+            label: '时间',
+            prop: 'createTime'
+          }]
+        },
+        discussForm: {
+          ontitle: '',
+          title: '',
+          openFlag: 0,
+          numberRestrictions: 0,
+          voteRestrictions: 0,
+          userRestrictions: 0,
+          endTime: '',
+          articleId: '',
+          createTime: '',
+          updateTime: '',
+          deleteFlag: '',
+          repeatVote: 0,
+          voteNumberPublic: 0,
+          appointUser: '',
+          userIds: '',
+          eventType: 1,
+        },
+        optionEnroll: {
+          column: [{
+              label: "",
+              type: 'title',
+              prop: "title",
+              span: 24,
+              row: true,
+              offset: 2,
+              styles: {
+                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: 'numberRestrictions',
+              type: 'number',
+              button: true,
+              row: true,
+              min: 0,
+              max: 99999999,
+              controlsPosition: '',
+              step: 10,
+              offset: 6,
+            }, {
+              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
+              }]
+            },
+            {
+              label: "截止时间",
+              row: true,
+              offset: 6,
+              prop: "endTime",
+              type: "datetime",
+              format: "yyyy-MM-dd hh:mm:ss",
+              valueFormat: "timestamp",
+            },
+          ]
+        },
+        dialogVisibles: false,
+        dialogVisiblesUser: false,
         // 弹框标题
         title: '',
         // 是否展示弹框
@@ -78,6 +229,24 @@
       }
     },
     methods: {
+      userHandleClose() {
+        this.dialogVisiblesUser = false
+      },
+      openUser(row) {
+        this.dialogVisiblesUser = true
+      },
+      openDilog(row, type) {
+        this.dialogVisibles = true
+        this.discussForm = row
+        let times = new Date(row.endTime).getTime();
+        this.discussForm.endTime = times
+        console.table(this.discussForm)
+        if (type == 0) {
+          this.discussForm.ontitle = '公益报名'
+        } else {
+          this.discussForm.ontitle = '创建议题'
+        }
+      },
       init() {},
       searchHide() {
         this.search = !this.search;
@@ -90,10 +259,11 @@
         this.page.currentPage = 1;
         this.onLoad(this.page);
       },
-      handleSubmit() {
-        if (!this.form.id) {
-          addPd(this.form).then(() => {
-            this.box = false;
+      handleSubmit(form, done) {
+        done()
+        if (!this.discussForm.id) {
+          addPd(this.discussForm).then(() => {
+            this.dialogVisibles = false
             this.onLoad(this.page);
             this.$message({
               type: "success",
@@ -101,8 +271,8 @@
             });
           });
         } else {
-          updatePd(this.form).then(() => {
-            this.box = false;
+          updatePd(this.discussForm).then(() => {
+            this.dialogVisibles = false
             this.onLoad(this.page);
             this.$message({
               type: "success",

--
Gitblit v1.9.3