linwe
2023-11-25 33f5ae13b92dbf22f5455e8f648f29e5ebb2eb32
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",