feige
2025-01-02 43e1199ca0c75787fb6b52bef7d595abd115ceab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<template>
  <div class="app-container" style="width:100%; height: 100%;">
    <!-- 回到顶部 -->
    <el-backtop :bottom="150" :right="30">
      <el-button type="primary" circle class="el-icon-top"></el-button>
    </el-backtop>
 
    <!-- 标题 -->
    <h1 style="font-size:21px;padding-top:30px;display: flex;">
      <span>直播</span>
      <div class="button-container"></div>
      <div style="display: flex; align-items: center;">
      </div>
    </h1>
    <hr>
 
    <!-- 搜索 -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
 
      <el-form-item label="直播标题" prop="title">
        <el-input v-model="queryParams.title" placeholder="请输入直播标题" clearable style="width: 200px;
                   height: 35px;
                   border-radius: 16px 16px 16px 16px;
                   opacity: 0.5;" @keyup.enter.native="handleQuery" />
      </el-form-item>
 
      <el-form-item>
        <el-button size="mini" @click="handleQuery" style=" width: 65px; height: 32px;background: #FFDDE3;
          border-radius: 6px 6px 6px 6px;opacity:1;">搜索</el-button>
        <el-button size="mini" @click="resetQuery" style=" width: 65px;height: 32px; background: #FFDDE3;
          border-radius: 6px 6px 6px 6px;
          opacity: 1;">重置</el-button>
      </el-form-item>
    </el-form>
 
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="newRequest"
          v-hasPermi="['person:information:memo']"
        >新增</el-button>
      </el-col>
 
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
 
    <el-row :gutter="0" v-loading="loading">
      <el-col :span="4" v-for="(item,i) in webcastList">
        <div class="module" @click="toLook(item.id)">
          <div class="video">
            66666666
          </div>
          <span class="span1">{{ item.title }}</span>
          <div class="tubiao"><i class="el-icon-view">10000</i></div>
          <p class="author">{{ item.applyPerson }}</p>
          <img :src="item.avatar"
          style="margin-left: 15px;margin-top: 190px; background-color: pink; width: 50px; height: 50px;"/>
 
        </div>
      </el-col>
 
 
    </el-row>
 
    <pagination
      v-show="total>0"
      :total="total"
      :page-sizes="pageSizes"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
      style="background: #FEF7FC;"
    />
 
 
    <!-- 直播申请对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
 
        <el-form-item label="开始时间" prop="startTime">
          <el-date-picker v-model="formDat.startTime" type="datetime" placeholder="选择开始时间"
            value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
 
        <el-form-item label="时长(分钟)" prop="duration">
          <el-input v-model="formDat.duration" type="number" placeholder="请输入会议时长(分钟)" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
 
        <el-form-item label="房间号" prop="roomId">
          <el-input v-model="formDat.roomId" type="number" :min="1" placeholder="请输入房间号" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
 
        <el-form-item label="最多人数" prop="maxPerson">
          <el-input v-model="formDat.maxPerson" type="number" placeholder="请输入最多人数" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
 
        <el-form-item label="会议标题" prop="title">
          <el-input v-model="formDat.title" placeholder="请输入会议标题" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
 
        <el-form-item label="申请人" prop="applyPerson">
          <el-input v-model="formDat.applyPerson" placeholder="请输入申请人" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
 
        <el-form-item label="联系人" prop="contactPerson">
          <el-input v-model="formDat.contactPerson" placeholder="请输入联系人" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
 
        <el-form-item label="联系电话" prop="contactPhone">
          <el-input v-model="formDat.contactPhone" placeholder="请输入联系电话" clearable :style="{width: '100%'}"></el-input>
        </el-form-item>
 
 
        <h4 class="form-header">主播头像 </h4>
            <el-upload
              action="#"
              accept="image/jpeg, image/png,image/jpg, image/WMF,image/gif"
              list-type="picture-card"
              :http-request="requestUpload"
              :file-list="fileList"
              :limit="1"
            >
              <i slot="default" class="el-icon-plus"></i>
              <div slot="file" slot-scope="{ file }">
                <template v-if="fileList">
                  <img
                    class="el-upload-list__item-thumbnail"
                    :src="file.url"
                    alt=""
                    style="width: 100%; height: 100%; object-fit: cover;"
                    fit="cover"
                    :preview-src-list="[file.url]"
                  >
                </template>
                <span class="el-upload-list__item-actions">
          <span
            class="el-upload-list__item-preview"
            @click="handlePictureCardPreview(file)"
          >
            <i class="el-icon-zoom-in"></i>
          </span>
          <span
            v-if="!disabled"
            class="el-upload-list__item-delete"
            @click="handleRemove(file)"
          >
            <i class="el-icon-delete"></i>
          </span>
        </span>
              </div>
            </el-upload>
 
 
      </el-form>
 
 
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitDataScope">保 存</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
 
    <el-dialog  :visible.sync="dialogVisible">
      <img w-full :src="dialogImageUrl"    style="width: 100%; height: 100%" alt="Preview Image" />
    </el-dialog>
 
 
  </div>
</template>
<script>
  import {
    listRole,
    getRole,
    delRole,
    addRole,
    updateRole,
    dataScope,
    changeRoleStatus,
    deptTreeSelect
  } from "@/api/system/role";
  import {
    treeselect as menuTreeselect,
    roleMenuTreeselect
  } from "@/api/system/menu";
  import {
    Notification,
    MessageBox,
    Message,
    Loading
  } from 'element-ui'
 
  //导入接口函数  --接好了
  import {
    addWebcast,
    listWebcast,
    getWebcastInfo,
    uploadPic,
    uploadPic1,
  } from "@/api/meeting/index";
 
  export default {
    created() {
      this.getList();
    },
    data() {
      return {
        showSearch: true,
        pageSizes: [12, 24, 36],
        webcastList:[],
        // 总条数
        total: 0,
        loading: true,
        dateRange: [],
        queryParams: {
          pageNum: 1,
          pageSize: 12,
          title: undefined,
          applyPerson: undefined,
          contactPerson: undefined,
          happenStartTime: undefined,
          happenEndTime: undefined
        },
        // 遮罩层
        disabled: false,
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        formDat: {
          startTime: undefined,
          endTime: undefined,
          title: undefined,
          applyPerson: undefined,
          contactPerson: undefined,
          contactPhone: undefined,
          createTime: undefined,
          roomId:undefined,
          maxPerson:undefined,
          duration:undefined,
          avatar:undefined,
        },
                    uploadFileList: [],
      fileList:[],
      dialogImageUrl: '',
      dialogVisible: false,
      }
    },
    methods: {
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.dateRange = [];
        this.resetForm("queryForm");
        this.handleQuery();
      },
      newRequest() {
        // this.reset();
        this.open = true;
        this.title = "直播申请";
      },
      cancel() {
        this.open = false;
        // this.reset();
      },
      submitDataScope: function() {
        let ul = this.fileList[0].url
        this.formDat.avatar = ul,
        // alert(this.formDat.avatar)
        this.$refs["elForm"].validate(valid => {
          if (valid && this.formDat.roomId > 0) {
            addWebcast(this.formDat).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              // 清空formDat对象的数据
              Object.keys(this.formDat).forEach(key => {
                this.formDat[key] = '';
              });
              // for(let i = 0; i <= this.fileList.length; i++)
              // {
              //   this.handleRemove(this.fileList[0]);
              // }
              // for(let i = 0; i < this.fileListOther.length; i++){
              //   this.handleRemoveFile(this.fileListOther[0]);
              // }
              this.fileList = []
              this.getList();
            });
          }else{
            this.$message.error("新增失败,房间号不能是负数");
            this.open = false;
            Object.keys(this.formDat).forEach(key => {
              this.formDat[key] = '';
            });
          }
 
        });
 
      },
      getList() {
        this.loading = true;
        // console.log(this.queryParams)
        //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
        this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
        this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
        listWebcast(this.queryParams).then(response => {
            this.webcastList = response.data.data;
            console.log(this.webcastList,'webcastListwebcastListwebcastList')
            this.total = response.data.total;
            this.loading = false;
          }
 
        );
      },
      toLook(id) {
        this.$router.push('/meeting/webcast/Home/' + id)
      },
 
    requestUpload(params)
    {
      var file = params.file;
      var formData = new FormData();
 
      formData.append('uploadFile', file);
      let _this = this
      console.log(formData,'123123')
 
      uploadPic1(formData).then(response => {
        let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
        _this.fileList.push({name:response.data.fileName, url:response.data.url})
        console.log(this.fileList)
        // _this.fileList2.push({name:response.data.fileName, url:response.data.url})
        // alert('ok')
      })
 
    },
      handlePictureCardPreview(file) {
        alert(file.url)
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      },
      handleRemove(file) {
        for(let i = 0; i < this.fileList.length; i++)
        {
          if(this.fileList[i].url==file.url)
            this.$delete(this.fileList,i);
        }
      },
 
 
 
    }
  }
</script>
<style scoped="">
  .video {
    background-color: black;
    width: 90%;
    margin-top: 5%;
    margin-left: 5%;
    height: 70%;
    position: absolute;
  }
 
  .app-container {
    background-color: #FEF7FC;
    /*   width: 2000px;
    height: 1500px; */
  }
 
  .button-container {
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-grow: 1;
  }
 
  .el-table {
    border-radius: 14px 14px 14px 14px;
  }
 
  .el-col {
    border-radius: 4px;
  }
 
  .module {
    /* display: flex; */
    width: 250px;
    height: 250px;
    background-color: rgb(255, 255, 255);
    border-color: red;
    border-radius: 6%;
    margin-top: 20px;
    margin-bottom: 20px;
    /*    margin-left: 5px;
    margin-right: 5px; */
    position: relative;
    cursor: pointer;
  }
 
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
 
  .span1 {
    float: left;
    font-size: 15px;
    position: absolute;
    bottom: 40px;
    left: 80px;
  }
 
  .tubiao {
    position: absolute;
    bottom: 20px;
    right: 10px;
  }
 
  .author {
    position: absolute;
    bottom: 10px;
    left: 80px;
  }
 
  .form {
    background: center/11% no-repeat url('../../assets/icons/add1.png');
 
  }
</style>