huwhois лет назад: 5
Родитель
Сommit
0c01cd8d76

+ 5 - 10
src/views/modules/admin/lecture-add-or-update.vue

@ -25,7 +25,7 @@
25 25
          </el-option>
26 26
        </el-select>
27 27
      </template>
28
      <!-- <el-input v-model="dataForm.attendersId" placeholder="演讲人id"></el-input> --><el-input v-model="dataForm.attendersId" placeholder="参会人员id"></el-input>
28
      <!-- <el-input v-model="dataForm.attendersId" placeholder="演讲人id"></el-input> -->
29 29
    </el-form-item>
30 30
    <el-form-item label="题目" prop="topic">
31 31
      <el-input v-model="dataForm.topic" placeholder="题目"></el-input>
@ -73,9 +73,9 @@
73 73
          meetingId: [
74 74
            { required: true, message: '会议id不能为空', trigger: 'blur' }
75 75
          ],
76
          attendersId: [
77
            { required: true, message: '参会人员id不能为空', trigger: 'blur' }
78
          ],
76
          // attendersId: [
77
          //   { required: true, message: '参会人员id不能为空', trigger: 'blur' }
78
          // ],
79 79
          topic: [
80 80
            { required: true, message: '题目不能为空', trigger: 'blur' }
81 81
          ],
@ -87,12 +87,6 @@
87 87
          ],
88 88
          summary: [
89 89
            { required: true, message: '摘要不能为空', trigger: 'blur' }
90
          ],
91
          createTime: [
92
            { required: true, message: '創建時間不能为空', trigger: 'blur' }
93
          ],
94
          isDel: [
95
            { required: true, message: '是否被删除 状态  0:正常   1:删除不能为空', trigger: 'blur' }
96 90
          ]
97 91
        },
98 92
        options: [],
@ -125,6 +119,7 @@
125 119
            })
126 120
          }
127 121
        })
122
        this.meetingId = this.$route.params.id
128 123
      },
129 124
      // 表单提交
130 125
      dataFormSubmit () {

+ 2 - 0
src/views/modules/admin/lecture.vue

@ -129,10 +129,12 @@
129 129
      // 获取数据列表
130 130
      getDataList () {
131 131
        this.dataListLoading = true
132
        let meetingId = this.$route.params.id
132 133
        this.$http({
133 134
          url: this.$http.adornUrl('/admin/lecture/list'),
134 135
          method: 'get',
135 136
          params: this.$http.adornParams({
137
            'meetingId': meetingId,
136 138
            'page': this.pageIndex,
137 139
            'limit': this.pageSize,
138 140
            'key': this.dataForm.key

+ 54 - 1
src/views/modules/admin/member-add-or-update.vue

@ -23,6 +23,25 @@
23 23
      <el-form-item label="头像" prop="titlePic">
24 24
        <el-input v-model="dataForm.titlePic" placeholder="头像"></el-input>
25 25
      </el-form-item>
26
      <el-row>
27
        <img :src="showimg" alt="">
28
      </el-row>
29
      <el-upload
30
      :action="upload_url"
31
      ref="upload"
32
      :before-upload="beforeUploadHandle"
33
      :on-success="successHandle"
34
      name="upload_file"
35
      :auto-upload="false"
36
      :data="thumb"
37
      style="text-align: center;">
38
      <i class="el-icon-upload"></i>
39
       <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
40
      <div class="el-upload__tip" slot="tip">只支持jpg、png、gif格式的图片!只能上传jpg/png文件,且不超过2M</div>
41
      <el-radio v-model="radio" label="1">是</el-radio>
42
      <el-radio v-model="radio" label="0" >否</el-radio>
43
      <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
44
    </el-upload>
26 45
      <el-form-item label="所属机构" prop="organization">
27 46
        <el-input v-model="dataForm.organization" placeholder="所属机构"></el-input>
28 47
      </el-form-item>
@ -125,7 +144,11 @@ export default {
125 144
        password: [{ validator: checkPwd, trigger: 'blur' }],
126 145
        phone: [{ validator: checkPhone, trigger: 'blur' }],
127 146
        email: [{ validator: checkEmail, trigger: 'blur' }]
128
      }
147
      },
148
      upload_url: '',
149
      radio: '0',
150
      thumb: {'isthumb': 0},
151
      showimg: ''
129 152
    }
130 153
  },
131 154
  methods: {
@ -156,10 +179,13 @@ export default {
156 179
              this.dataForm.createTime = data.member.createTime
157 180
              this.dataForm.modifyTime = data.member.modifyTime
158 181
              this.dataForm.isCheck = data.member.isCheck
182
              this.showimg = 'http://121.42.53.174:9008/static' + data.member.titlePic
159 183
            }
160 184
          })
161 185
        }
162 186
      })
187
      // 上传路径
188
      this.upload_url = this.$http.adornUrl(`/sys/filemanager/uploadimg?token=${this.$cookie.get('token')}`)
163 189
    },
164 190
    // 表单提交
165 191
    dataFormSubmit () {
@ -204,6 +230,33 @@ export default {
204 230
          })
205 231
        }
206 232
      })
233
    },
234
    // 上传图像
235
    submitUpload () {
236
      this.$refs.upload.submit()
237
    },
238
    // 上传之前
239
    beforeUploadHandle (file) {
240
      this.thumb.isthumb = this.radio
241
      if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
242
        this.$message.error('只支持jpg、png、gif格式的图片!')
243
        return false
244
      }
245
    },
246
    // 上传成功
247
    successHandle (response) {
248
      console.log(response)
249
      if (response && response.code === 0) {
250
        if (response.hasOwnProperty('thumb')) {
251
          this.dataForm.titlePic = response.thumb
252
          this.showimg = 'http://121.42.53.174:9008/static' + response.thumb
253
        } else {
254
          this.showimg = 'http://121.42.53.174:9008/static' + response.picname
255
          this.dataForm.titlePic = response.picname
256
        }
257
      } else {
258
        this.$message.error(response.msg)
259
      }
207 260
    }
208 261
  }
209 262
}

+ 6 - 2
src/views/modules/admin/paper.vue

@ -2,13 +2,16 @@
2 2
  <div class="mod-config">
3 3
    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
4 4
      <el-form-item>
5
        <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
5
        <el-input v-model="dataForm.key" placeholder="请输入投稿题目/投稿人" clearable></el-input>
6 6
      </el-form-item>
7 7
      <el-form-item>
8 8
        <el-button @click="getDataList()">查询</el-button>
9
        <el-button v-if="isAuth('admin:paper:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
9
        <el-button v-if="isAuth('admin:paper:save')" type="primary" @click="addOrUpdateHandle()">添加投稿</el-button>
10 10
        <el-button v-if="isAuth('admin:paper:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
11 11
      </el-form-item>
12
       <el-form-item>
13
        <el-button v-if="isAuth('admin:paperrequire:save')" type="primary" @click="addOrUpdateHandle()">征文要求设置</el-button>
14
      </el-form-item>
12 15
    </el-form>
13 16
    <el-table
14 17
      :data="dataList"
@ -98,6 +101,7 @@
98 101
99 102
<script>
100 103
  import AddOrUpdate from './paper-add-or-update'
104
  import PagerRequireSet from './paperrequire-add-or-update'
101 105
  export default {
102 106
    data () {
103 107
      return {

+ 66 - 0
src/views/modules/admin/upload.vue

@ -0,0 +1,66 @@
1
<template>
2
  <el-dialog
3
    title="上传文件"
4
    :close-on-click-modal="false"
5
    @close="closeHandle"
6
    :visible.sync="visible">
7
    <el-upload
8
      :action="url"
9
      ref="upload"
10
      :before-upload="beforeUploadHandle"
11
      :on-success="successHandle"
12
      name="upload_file"
13
      :auto-upload="false"
14
      :data="thumb"
15
      style="text-align: center;">
16
      <i class="el-icon-upload"></i>
17
       <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
18
      <div class="el-upload__tip" slot="tip">只支持jpg、png、gif格式的图片!只能上传jpg/png文件,且不超过2M</div>
19
      <el-radio v-model="radio" label="1">是</el-radio>
20
      <el-radio v-model="radio" label="0" >否</el-radio>
21
      <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
22
    </el-upload>
23
  </el-dialog>
24
</template>
25
26
<script>
27
  export default {
28
    data () {
29
      return {
30
        visible: false,
31
        url: '',
32
        radio: '0',
33
        thumb: {'isthumb': 0}
34
      }
35
    },
36
    methods: {
37
      init (id) {
38
        this.url = this.$http.adornUrl(`/sys/filemanager/uploadimg`)
39
        this.visible = true
40
      },
41
      submitUpload () {
42
        this.$refs.upload.submit()
43
      },
44
      // 上传之前
45
      beforeUploadHandle (file) {
46
        this.thumb.isthumb = this.radio
47
        if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
48
          this.$message.error('只支持jpg、png、gif格式的图片!')
49
          return false
50
        }
51
      },
52
      // 上传成功
53
      successHandle (response) {
54
        console.log(response)
55
        if (response && response.code === 0) {
56
          this.visible = false
57
        } else {
58
          this.$message.error(response.msg)
59
        }
60
      }
61
      // // 弹窗关闭时
62
      // closeHandle () {
63
      // }
64
    }
65
  }
66
</script>