index.vue 22.8 KB
Newer Older
qzhxx's avatar
qzhxx committed
1 2 3
<template>
  <div class="listPage H100">
    <div class="search-container">
qzhxx's avatar
qzhxx committed
4 5
      <el-form :inline="true" :model="form" ref="form" onsubmit="return false;">
        <el-form-item label>
qzhxx's avatar
qzhxx committed
6
          <el-input
qzhxx's avatar
qzhxx committed
7
            placeholder="请输入展板名称或提交人"
qzhxx's avatar
qzhxx committed
8 9 10 11
            v-model="form.name"
            @keyup.enter.native="Search"
            clearable
          ></el-input>
qzhxx's avatar
qzhxx committed
12
        </el-form-item>
xulili's avatar
xulili committed
13
        <el-form-item>
qzhxx's avatar
qzhxx committed
14 15 16 17 18 19
          <el-select v-model="form.status" placeholder="请选择审核状态">
            <el-option label="待初审" value="TBC"></el-option>
            <el-option label="已驳回" value="REFUSED"></el-option>
            <el-option label="待复审" value="TBCA"></el-option>
            <el-option label="通过" value="APPROVED_FINAL"></el-option>
          </el-select>
qzhxx's avatar
qzhxx committed
20 21 22
        </el-form-item>
        <el-form-item>
          <div class="btn-group">
qzhxx's avatar
qzhxx committed
23 24
            <el-button type="primary" @click="Search">查询</el-button>
            <el-button @click="Reset">重置</el-button>
qzhxx's avatar
qzhxx committed
25 26 27 28 29
          </div>
        </el-form-item>
      </el-form>
      <div class="page-tip">
        <span class="page-tip-title">页面说明:</span>
qzhxx's avatar
qzhxx committed
30
        <span class="page-tips">可查看展板待审核的所有内容,可根据审核类别进行筛选</span>
qzhxx's avatar
qzhxx committed
31 32 33
      </div>
    </div>
    <div class="table-content">
qzhxx's avatar
qzhxx committed
34
      <div class="party-table noAdd">
qzhxx's avatar
qzhxx committed
35 36
        <el-table
          border
xulili's avatar
xulili committed
37 38
          style="width: 100%; height: 100%"
          height="100%"
qzhxx's avatar
qzhxx committed
39 40 41 42
          ref="multipleTable"
          :data="tableData"
          @selection-change="handleSelectionChange"
        >
qzhxx's avatar
qzhxx committed
43
          <el-table-column type="index" width="120" label="序号">
44 45 46 47
            <template slot-scope="scope">
              <span>{{ (page.currentPage - 1) * 10 + scope.$index + 1 }}</span>
            </template>
          </el-table-column>
qzhxx's avatar
qzhxx committed
48
          <el-table-column label="展板名称" prop="content"></el-table-column>
xulili's avatar
xulili committed
49 50
          <el-table-column label="提交人" prop="userName"></el-table-column>
          <el-table-column label="提交日期" prop="createTime"></el-table-column>
qzhxx's avatar
qzhxx committed
51
          <el-table-column label="审核项" prop="operation">
qzhxx's avatar
qzhxx committed
52 53 54 55
            <template slot-scope="scope">
              <span class="input-item">{{keyMap[scope.row.operation]}}</span>
            </template>
          </el-table-column>
xulili's avatar
xulili committed
56 57 58 59 60
          <el-table-column label="审核状态" prop="status">
            <template slot-scope="scope">
              <span v-if="scope.row.status === 'TBC'">待初审</span>
              <span v-else-if="scope.row.status === 'REFUSED'">已驳回</span>
              <span v-else-if="scope.row.status === 'TBCA'">待复审</span>
qzhxx's avatar
qzhxx committed
61
              <span v-else-if="scope.row.status === 'APPROVED_FINAL'">通过</span>
xulili's avatar
xulili committed
62 63 64 65 66
            </template>
          </el-table-column>
          <el-table-column label="操作" header-align="center" align="center">
            <template slot-scope="scope" width="220">
              <div class="table-btn-group">
qzhxx's avatar
qzhxx committed
67
                <el-tooltip content="详情" placement="top">
qzhxx's avatar
qzhxx committed
68 69 70 71 72 73 74 75
                  <el-button
                    :disabled="
                scope.row.operation === 'REMOVE' &&
                scope.row.status === 'APPROVED_FINAL'
              "
                    circle
                    @click="openDetails(scope.row)"
                  >
qzhxx's avatar
qzhxx committed
76 77 78 79
                    <i class="icon-table icon-detail"></i>
                  </el-button>
                </el-tooltip>
              </div>
xulili's avatar
xulili committed
80 81
            </template>
          </el-table-column>
qzhxx's avatar
qzhxx committed
82
          <el-table-column label="审核" width="220" header-align="center" align="center">
qzhxx's avatar
qzhxx committed
83
            
qzhxx's avatar
qzhxx committed
84
            <template slot-scope="scope">
qzhxx's avatar
qzhxx committed
85 86 87 88 89 90 91 92 93 94 95 96
               <!-- 管理员、初审员、复审员 -->
              <div v-if="((scope.row.one)&&(scope.row.two))" class="table-btn-group">
                <el-button round class="passed" :disabled="scope.row.status === 'REFUSED' ||scope.row.status === 'APPROVED_FINAL'" @click="adopt(scope.row)">通过</el-button>
                <el-button round class="rejected" :disabled="scope.row.status === 'REFUSED' ||scope.row.status === 'APPROVED_FINAL'" @click="reject(scope.row)">驳回</el-button>
              </div>
              <div v-else-if="((scope.row.one === true)&&(scope.row.two === false))" class="table-btn-group">
                 <el-button round class="passed" :disabled="scope.row.status === 'TBCA'||scope.row.status === 'REFUSED' ||scope.row.status === 'APPROVED_FINAL'" @click="adopt(scope.row)">通过</el-button>
                <el-button round class="rejected" :disabled="scope.row.status === 'TBCA'||scope.row.status === 'REFUSED' ||scope.row.status === 'APPROVED_FINAL'" @click="reject(scope.row)">驳回</el-button>
              </div>
               <div v-else-if="((scope.row.one === false)&&(scope.row.two === true))" class="table-btn-group">
                 <el-button round class="passed" :disabled="scope.row.status === 'TBC'||scope.row.status === 'REFUSED' ||scope.row.status === 'APPROVED_FINAL'" @click="adopt(scope.row)">通过</el-button>
                <el-button round class="rejected" :disabled="scope.row.status === 'TBC'||scope.row.status === 'REFUSED' ||scope.row.status === 'APPROVED_FINAL'" @click="reject(scope.row)">驳回</el-button>
qzhxx's avatar
qzhxx committed
97
              </div>
xulili's avatar
xulili committed
98 99
            </template>
          </el-table-column>
qzhxx's avatar
qzhxx committed
100 101
        </el-table>
      </div>
xulili's avatar
xulili committed
102
      <div class="partyt-pagination">
qzhxx's avatar
qzhxx committed
103
        <el-pagination
qzhxx's avatar
qzhxx committed
104 105 106 107 108 109
          @current-change="handleCurrentChange"
          :current-page="page.currentPage"
          :page-size="page.pageSize"
          layout="prev, pager, next, jumper"
          :total="page.total"
        ></el-pagination>
xulili's avatar
xulili committed
110
      </div>
qzhxx's avatar
qzhxx committed
111
    </div>
xulili's avatar
xulili committed
112 113 114 115 116 117 118 119 120
    <!--新增弹框-->
    <el-dialog
      title="新建"
      custom-class="party-dialog"
      width="468px"
      :visible.sync="FormVisible1"
      :before-close="close1"
    >
      <div class="dialog-content">
qzhxx's avatar
qzhxx committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
        <el-form
          :model="classForm"
          ref="classForm"
          label-width="80px"
          label-position="top"
          :rules="rules"
          id="ruleo"
          class="party-form"
        >
          <el-form-item label="驳回原因:">
            <el-input type="textarea" v-model="classForm.remarks"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer btn-group">
qzhxx's avatar
qzhxx committed
136
        <el-button size="mini" type="primary" @click="permisSave">确定</el-button>
qzhxx's avatar
qzhxx committed
137
        <!-- <el-button size="mini" v-show="!type" type="primary" @click="permisEdit">确定</el-button> -->
qzhxx's avatar
qzhxx committed
138 139
        <el-button size="mini" @click="close1">取 消</el-button>
      </div>
xulili's avatar
xulili committed
140 141 142 143 144 145 146 147 148 149 150 151 152
    </el-dialog>
    <!--请填写驳回原因-->
    <el-dialog
      custom-class="party-dialog"
      title="展板详情"
      width="468px"
      :visible.sync="FormVisible"
      :before-close="close"
    >
      <div class="dialog-content">
        <el-form
          :model="editForm"
          disabled
153
          class="party-form demo-form-inline"
xulili's avatar
xulili committed
154 155 156 157 158 159
          ref="editForm"
          label-width="80px"
          label-position="top"
          :rules="rules"
        >
          <el-form-item label="展板名称" :label-width="formLabelWidth">
qzhxx's avatar
qzhxx committed
160
            <el-input size="small" v-model="editForm.name" auto-complete="off"></el-input>
xulili's avatar
xulili committed
161 162 163 164 165 166 167 168 169 170 171
          </el-form-item>
          <el-form-item label="版权方" :label-width="formLabelWidth">
            <el-input
              size="small"
              v-model="editForm.boardCopyrightOwnerName"
              auto-complete="off"
              clearable
              onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
            ></el-input>
          </el-form-item>
          <el-form-item label="宣传图" :label-width="formLabelWidth">
qzhxx's avatar
qzhxx committed
172
            <img class="imgSize" :src="editForm.cover" alt />
xulili's avatar
xulili committed
173
          </el-form-item>
174
          <el-form-item label="二维码" :label-width="formLabelWidth">
qzhxx's avatar
qzhxx committed
175
            <img class="imgSize" :src="editForm.qrcodeUrl" alt />
176
          </el-form-item>
xulili's avatar
xulili committed
177 178 179 180
          <el-form-item label="简介" :label-width="formLabelWidth">
            <el-input type="textarea" v-model="editForm.remarks"></el-input>
          </el-form-item>
          <el-form-item label="展板视频" :label-width="formLabelWidth">
qzhxx's avatar
qzhxx committed
181
            <div class="video-box" @contextmenu.prevent>
qzhxx's avatar
qzhxx committed
182
              <div class="video-item" v-for="(item, index) in editForm.videoList" :key="index">
qzhxx's avatar
qzhxx committed
183
                <video  :poster="item.thumbnail" :src="item.fileUrl" controls  controlsList='nodownload noremote footbar' />
xulili's avatar
xulili committed
184 185 186 187 188 189
                <span>{{ item.fileName }}</span>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="展板音频" :label-width="formLabelWidth">
            <div class="audio-box">
qzhxx's avatar
qzhxx committed
190
              <div class="audio-item" v-for="(item, index) in editForm.audioList" :key="index">
xulili's avatar
xulili committed
191 192 193 194 195 196 197 198 199 200 201
                <audio :src="item.fileUrl" controls />
                <span>{{ item.fileName }}</span>
              </div>
            </div>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer btn-group">
        <el-button size="mini" type="primary" @click="close">关闭</el-button>
      </div>
    </el-dialog>
qzhxx's avatar
qzhxx committed
202 203 204
  </div>
</template>
<script>
qzhxx's avatar
qzhxx committed
205
 let Base64 = require('js-base64').Base64
qzhxx's avatar
qzhxx committed
206 207 208 209 210 211 212 213 214 215 216
export default {
  data() {
    var checkIsNull = (rule, value, callback) => {
      if (value) {
        if (value.trim() == "") {
          callback(new Error("不允许只输入空格"));
        } else {
          callback();
        }
      }
    };
qzhxx's avatar
qzhxx committed
217 218 219 220 221 222 223 224 225 226
    const keyMap = {
      ADD: "新增",
      EDIT: "修改",
      REMOVE: "删除",
      DISABLE: "禁用",
      ENABLE: "启用",
      UPPER: "上架",
      LOWER: "下架"
    };

qzhxx's avatar
qzhxx committed
227
    return {
qzhxx's avatar
qzhxx committed
228
      keyMap: keyMap,
xulili's avatar
xulili committed
229
      type: true,
qzhxx's avatar
qzhxx committed
230 231 232 233 234 235 236
      value1: "",
      page: { currentPage: 1, pageSize: 10, total: 0 },
      tableData: [],
      FormVisible: false,
      FormVisible1: false,
      formLabelWidth: "100px",
      form: {
qzhxx's avatar
qzhxx committed
237
        name: "",
qzhxx's avatar
qzhxx committed
238
        type: "EXHIBITION_BOARD"
qzhxx's avatar
qzhxx committed
239
      },
qzhxx's avatar
qzhxx committed
240
      editForm: {
xulili's avatar
xulili committed
241 242
        name: "",
        cover: "",
qzhxx's avatar
qzhxx committed
243
        sort: ""
qzhxx's avatar
qzhxx committed
244 245
      },
      classForm: {
xulili's avatar
xulili committed
246 247
        status: "",
        remarks: "",
qzhxx's avatar
qzhxx committed
248
        id: ""
qzhxx's avatar
qzhxx committed
249 250 251 252 253
      },
      typeList: [],
      rules: {
        sort: [
          { required: true, message: "请输入顺序值", trigger: "change" },
qzhxx's avatar
qzhxx committed
254
          { pattern: /^(\d{1,5})?$/, message: "排序值为低于5位数的纯数字" }
qzhxx's avatar
qzhxx committed
255 256 257 258
        ],
        menuName: [
          { required: true, message: "请输入菜单名称", trigger: "change" },
          { max: 20, message: "不能超过20个字符", trigger: "change" },
qzhxx's avatar
qzhxx committed
259
          { validator: checkIsNull, trigger: "blur" }
qzhxx's avatar
qzhxx committed
260 261 262
        ],
        menuUrl: [
          { required: true, message: "请输入菜单地址", trigger: "change" },
qzhxx's avatar
qzhxx committed
263
          { validator: checkIsNull, trigger: "blur" }
qzhxx's avatar
qzhxx committed
264 265
        ],
        parentId: [
qzhxx's avatar
qzhxx committed
266 267
          { required: true, message: "请输入父级菜单", trigger: "change" }
        ]
qzhxx's avatar
qzhxx committed
268 269
      },
      value: "",
qzhxx's avatar
qzhxx committed
270
      name: ""
qzhxx's avatar
qzhxx committed
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
    };
  },
  computed: {},
  mounted() {
    this.onSearch();
    // this.getPermis();
  },
  components: {},
  methods: {
    // 渲染父级权限
    getPermis() {
      let vm = this;
      vm.$https({
        method: "get",
        url: "menu/getRoleMenu?roleId=" + sessionStorage.getItem("roleId"),
qzhxx's avatar
qzhxx committed
286
        authType: this.backToken
qzhxx's avatar
qzhxx committed
287
      }).then(
qzhxx's avatar
qzhxx committed
288
        res => {
qzhxx's avatar
qzhxx committed
289 290 291 292 293 294 295
          let data = res.data;
          vm.typeList = data.map((e, i) => {
            return {
              id: e.id,
              name:
                e.menuName.indexOf("-") == -1
                  ? e.menuName
qzhxx's avatar
qzhxx committed
296
                  : e.menuName.split("-")[1]
qzhxx's avatar
qzhxx committed
297 298 299
            };
          });
        },
qzhxx's avatar
qzhxx committed
300
        error => {
qzhxx's avatar
qzhxx committed
301 302 303 304 305 306 307 308 309
          console.log(error);
        }
      );
    },
    // 获得数据接口
    getTableData(param) {
      let vm = this;
      vm.$https(
        {
qzhxx's avatar
qzhxx committed
310 311
          url: "audit/getPageAllList",
          method: "get",
qzhxx's avatar
qzhxx committed
312
          authType: this.backToken
qzhxx's avatar
qzhxx committed
313
        },
qzhxx's avatar
qzhxx committed
314 315
        // vm.$qs.stringify(param)
        param
qzhxx's avatar
qzhxx committed
316
      )
qzhxx's avatar
qzhxx committed
317
        .then(res => {
qzhxx's avatar
qzhxx committed
318 319 320 321 322
          let data = res.data.data;
          vm.page.pageSize = data.size;
          vm.page.total = data.total;
          vm.tableData = data.records;
        })
qzhxx's avatar
qzhxx committed
323
        .catch(function(err) {
qzhxx's avatar
qzhxx committed
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343
          console.log(err);
        });
    },
    // 分页
    handleCurrentChange(val) {
      let _this = this;
      _this.page.currentPage = val;
      _this.onSearch();
    },
    onSearch() {
      let _this = this;
      let param = _this.getSearchQuery();
      _this.getTableData(param);
    },
    Search() {
      let _this = this;
      _this.page.currentPage = 1;
      let searchObj = {
        _index: 1,
        _size: _this.page.pageSize,
qzhxx's avatar
qzhxx committed
344
        name: _this.form.name,
xulili's avatar
xulili committed
345
        status: _this.form.status,
qzhxx's avatar
qzhxx committed
346
        type: "EXHIBITION_BOARD"
qzhxx's avatar
qzhxx committed
347 348 349 350
      };
      this.getTableData(searchObj);
    },
    // 重置
xulili's avatar
xulili committed
351
    Reset() {
qzhxx's avatar
qzhxx committed
352
      // this.$refs["form"].resetFields();
xulili's avatar
xulili committed
353 354
      this.form = { type: "EXHIBITION_BOARD" };
      this.Search();
qzhxx's avatar
qzhxx committed
355 356 357 358 359 360
    },
    // // 获取当前查询参数
    getSearchQuery() {
      let _this = this;
      let searchObj = {
        _index: _this.page.currentPage,
qzhxx's avatar
qzhxx committed
361
        _size: _this.page.pageSize
qzhxx's avatar
qzhxx committed
362 363 364 365 366 367 368 369 370 371 372
      };
      for (let key in _this.form) {
        if (_this.form[key]) {
          searchObj[key] = _this.form[key];
        }
      }
      return searchObj;
    },
    // 添加
    addPermis() {
      // this.$router.push({ path: "videoContentAdd", query: { type: "add" } });
xulili's avatar
xulili committed
373
      $(".el-dialog__title").html("新建");
qzhxx's avatar
qzhxx committed
374
      this.FormVisible1 = true;
xulili's avatar
xulili committed
375
      this.type = true;
qzhxx's avatar
qzhxx committed
376
    },
xulili's avatar
xulili committed
377 378

    // 请填写驳回原因视频分类确认保存
qzhxx's avatar
qzhxx committed
379
    permisEdit() {
qzhxx's avatar
qzhxx committed
380
      let _this = this;
qzhxx's avatar
qzhxx committed
381
      _this.$refs.classForm.validate(valid => {
qzhxx's avatar
qzhxx committed
382 383 384
        if (valid) {
          _this
            .$https(
xulili's avatar
xulili committed
385 386 387
              {
                url: "videoContentCat/update",
                method: "put",
qzhxx's avatar
qzhxx committed
388
                authType: this.backToken
xulili's avatar
xulili committed
389
              },
qzhxx's avatar
qzhxx committed
390 391
              _this.$qs.stringify(_this.classForm)
              // _this.classForm
qzhxx's avatar
qzhxx committed
392 393
            )
            .then(
qzhxx's avatar
qzhxx committed
394
              res => {
395
                if (res.data.resultCode == 200 || res.data.resultCode == 201) {
qzhxx's avatar
qzhxx committed
396 397
                  _this.$message({
                    type: "success",
qzhxx's avatar
qzhxx committed
398
                    message: "新建成功!"
qzhxx's avatar
qzhxx committed
399 400 401 402 403 404 405 406 407 408 409
                  });
                  //跳回用户列表
                  _this.onSearch();
                  _this.FormVisible1 = false;
                  for (let key in _this.classForm) {
                    _this.classForm[key] = null;
                  }
                  _this.$refs["classForm"].resetFields();
                } else {
                  _this.$message({
                    type: "error",
qzhxx's avatar
qzhxx committed
410
                    message: res.data.msg
qzhxx's avatar
qzhxx committed
411 412 413
                  });
                }
              },
qzhxx's avatar
qzhxx committed
414
              error => {
qzhxx's avatar
qzhxx committed
415 416
                _this.$message({
                  type: "error",
qzhxx's avatar
qzhxx committed
417
                  message: error
qzhxx's avatar
qzhxx committed
418 419 420 421 422 423
                });
              }
            );
        }
      });
    },
qzhxx's avatar
qzhxx committed
424 425
    // 请填写驳回原因关闭
    close() {
qzhxx's avatar
qzhxx committed
426
      this.editForm = {};
qzhxx's avatar
qzhxx committed
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
      this.FormVisible = false;
      // for (let key in this.classForm) {
      //   this.classForm[key] = null;
      // }
      // this.$refs["classForm"].resetFields();
      // this.FormVisible = false;
      // this.$refs["editForm"].resetFields();
    },
    // 新增关闭
    close1() {
      this.FormVisible1 = false;
      for (let key in this.classForm) {
        this.classForm[key] = null;
      }
      this.$refs["classForm"].resetFields();
    },
    // 通过
xulili's avatar
xulili committed
444 445 446 447 448
    adopt(row) {
      this.classForm.id = row.id;
      this.classForm.status = "APPROVED_FINAL";
      this.classForm.remarks = "";
      this.permisSave("classForm");
qzhxx's avatar
qzhxx committed
449 450 451
    },
    // 请填写驳回原因弹框
    reject(row) {
xulili's avatar
xulili committed
452 453 454 455 456
      this.type = false;
      $(".el-dialog__title").html("请填写驳回原因");
      let _this = this;
      _this.classForm.id = row.id;
      _this.classForm.status = "REFUSED";
qzhxx's avatar
qzhxx committed
457 458 459 460
      _this.FormVisible1 = true;
    },
    // 驳回原因保存
    permisSave() {
qzhxx's avatar
qzhxx committed
461
      let _this = this;
xulili's avatar
xulili committed
462 463 464 465 466 467
      _this
        .$https(
          {
            url: "audit/updateAuditAllById",
            headers: { "Content-Type": "application/json" },
            method: "put",
qzhxx's avatar
qzhxx committed
468
            authType: this.backToken
xulili's avatar
xulili committed
469 470 471 472 473
          },
          // _this.$qs.stringify(_this.classForm)
          _this.classForm
        )
        .then(
qzhxx's avatar
qzhxx committed
474
          res => {
xulili's avatar
xulili committed
475 476 477
            if (res.data.resultCode == 200 || res.data.resultCode == 201) {
              _this.$message({
                type: "success",
qzhxx's avatar
qzhxx committed
478
                message: "操作成功!"
xulili's avatar
xulili committed
479 480 481 482 483 484
              });
              //跳回用户列表
              _this.onSearch();
              _this.FormVisible1 = false;
              for (let key in _this.classForm) {
                _this.classForm[key] = null;
qzhxx's avatar
qzhxx committed
485
              }
xulili's avatar
xulili committed
486 487 488 489
              _this.$refs["classForm"].resetFields();
            } else {
              _this.$message({
                type: "error",
qzhxx's avatar
qzhxx committed
490
                message: res.data.msg
xulili's avatar
xulili committed
491 492 493
              });
            }
          },
qzhxx's avatar
qzhxx committed
494
          error => {
xulili's avatar
xulili committed
495 496
            _this.$message({
              type: "error",
qzhxx's avatar
qzhxx committed
497
              message: error
xulili's avatar
xulili committed
498 499 500
            });
          }
        );
qzhxx's avatar
qzhxx committed
501 502
      // _this.$refs.classForm.validate(valid => {
      //   if (valid) {
xulili's avatar
xulili committed
503

qzhxx's avatar
qzhxx committed
504 505
      //   }
      // });
qzhxx's avatar
qzhxx committed
506 507
    },
    // 获取视频分类详情
xulili's avatar
xulili committed
508
    getAssetTypeInfo(id) {
qzhxx's avatar
qzhxx committed
509 510 511
      let vm = this;
      vm.$https(
        {
qzhxx's avatar
qzhxx committed
512
          url: "videoContentCat/get/" + id,
qzhxx's avatar
qzhxx committed
513
          method: "get",
qzhxx's avatar
qzhxx committed
514
          authType: this.backToken
xulili's avatar
xulili committed
515
        }
qzhxx's avatar
qzhxx committed
516 517
        // param
      )
qzhxx's avatar
qzhxx committed
518
        .then(res => {
qzhxx's avatar
qzhxx committed
519
          let data = res.data.data;
xulili's avatar
xulili committed
520
          this.classForm = data;
qzhxx's avatar
qzhxx committed
521
        })
qzhxx's avatar
qzhxx committed
522
        .catch(function(err) {
qzhxx's avatar
qzhxx committed
523 524 525
          console.log(err);
        });
    },
qzhxx's avatar
qzhxx committed
526
    openDetails(row) {
qzhxx's avatar
qzhxx committed
527 528
      let _this = this;
      _this.FormVisible = true;
qzhxx's avatar
qzhxx committed
529
       if(row.operation === 'EDIT'){
qzhxx's avatar
qzhxx committed
530
         // 参照后台更改文档审核记录的"operation"为"EDIT"时,调用的详情接口
qzhxx's avatar
qzhxx committed
531
        this.getInfo(row.id,"exhibitionBoard/getAudit/")
qzhxx's avatar
qzhxx committed
532
      }else{
qzhxx's avatar
qzhxx committed
533
        this.getInfo(row.refItemId,"exhibitionBoard/get/");
qzhxx's avatar
qzhxx committed
534 535 536 537
      }
       $(".el-dialog__title").html(row.name + "展板详情");
    },
    
qzhxx's avatar
qzhxx committed
538
    //  获取版权方详情
qzhxx's avatar
qzhxx committed
539
    getInfo(id,url) {
qzhxx's avatar
qzhxx committed
540 541 542
      let vm = this;
      vm.$https(
        {
qzhxx's avatar
qzhxx committed
543
          url: url + id,
qzhxx's avatar
qzhxx committed
544
          method: "get",
qzhxx's avatar
qzhxx committed
545
          authType: this.backToken
qzhxx's avatar
qzhxx committed
546 547 548
        }
        // param
      )
qzhxx's avatar
qzhxx committed
549
        .then(res => {
xulili's avatar
xulili committed
550
          let resData = res.data.data;
qzhxx's avatar
qzhxx committed
551 552 553 554
          const videos = res.data.data.videoList
          for(var i=0;i<videos.length;i++){
            videos[i].fileUrl = Base64.decode(videos[i].intro)
          }
xulili's avatar
xulili committed
555
          this.editForm = resData;
qzhxx's avatar
qzhxx committed
556 557 558 559
          this.editForm.videoList = videos
          
          
          
qzhxx's avatar
qzhxx committed
560
         
qzhxx's avatar
qzhxx committed
561
        })
qzhxx's avatar
qzhxx committed
562
        .catch(function(err) {
qzhxx's avatar
qzhxx committed
563 564
          console.log(err);
        });
qzhxx's avatar
qzhxx committed
565 566 567 568 569 570 571
    },
    // 删除
    handleDelete(row) {
      let _this = this;
      this.$confirm("此操作将永久删除, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
qzhxx's avatar
qzhxx committed
572
        type: "warning"
qzhxx's avatar
qzhxx committed
573 574
      })
        .then(() => {
xulili's avatar
xulili committed
575 576 577 578
          _this
            .$https({
              method: "delete",
              url: "videoContentCat/delete/" + row.id,
qzhxx's avatar
qzhxx committed
579
              authType: this.backToken
xulili's avatar
xulili committed
580 581
            })
            .then(
qzhxx's avatar
qzhxx committed
582
              res => {
xulili's avatar
xulili committed
583 584 585
                this.$message({ type: "success", message: "删除成功!" });
                _this.Search();
              },
qzhxx's avatar
qzhxx committed
586
              error => {
xulili's avatar
xulili committed
587 588
                this.$message({
                  type: "fail",
qzhxx's avatar
qzhxx committed
589
                  message: "删除失败!" + error.response.data
xulili's avatar
xulili committed
590 591 592
                });
              }
            );
qzhxx's avatar
qzhxx committed
593 594 595 596 597 598
        })
        .catch(() => {});
    },
    // // 保存请填写驳回原因信息
    // submitForm() {
    //   let _this = this;
qzhxx's avatar
qzhxx committed
599
    //   _this.$refs.editForm.validate(valid => {
qzhxx's avatar
qzhxx committed
600 601
    //     if (valid) {
    //       let searchObj = {};
qzhxx's avatar
qzhxx committed
602 603 604
    //       for (let key in _this.editForm) {
    //         if (this.editForm[key]) {
    //           searchObj[key] = _this.editForm[key];
qzhxx's avatar
qzhxx committed
605 606
    //         }
    //       }
qzhxx's avatar
qzhxx committed
607
    //       let str = _this.editForm.menuName;
qzhxx's avatar
qzhxx committed
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
    //       let index = str.lastIndexOf("-");
    //       str = str.substring(index + 1, str.length);
    //       searchObj.menuName = str;
    //       _this
    //         .$https(
    //           {
    //             url: "menu/edit",
    //             method: "put",
    //             authType: this.backToken
    //           },
    //           _this.$qs.stringify(searchObj)
    //         )
    //         .then(
    //           res => {
    //             if (res.data.status == 200 || res.data.status == 201) {
    //               _this.$message({
    //                 type: "success",
    //                 message: res.data.message
    //               });
    //               _this.onSearch();
    //               _this.FormVisible = false;
qzhxx's avatar
qzhxx committed
629
    //               _this.$refs["editForm"].resetFields();
qzhxx's avatar
qzhxx committed
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657
    //             } else {
    //               _this.$message({
    //                 type: "error",
    //                 message: res.data.message
    //               });
    //             }
    //           },
    //           error => {
    //             _this.$message({
    //               type: "error",
    //               message: error
    //             });
    //           }
    //         );
    //     }
    //   });
    // },

    // 批量操作
    handleSelectionChange(selection) {
      let _this = this;
      _this.selection = selection;
    },
    getMultipleSelect() {
      let _this = this;
      let arr = [];
      let str = "";
      if (_this.selection) {
qzhxx's avatar
qzhxx committed
658
        _this.selection.forEach(function(e) {
qzhxx's avatar
qzhxx committed
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674
          arr.push(e.id);
        });
        str = arr.join(",");
      } else {
        str = "";
      }
      return str;
    },
    // 批量删除
    multipleDelete() {
      let _this = this;
      let str = _this.getMultipleSelect();
      if (str) {
        this.$confirm("此操作将删除选中菜单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
qzhxx's avatar
qzhxx committed
675
          type: "warning"
qzhxx's avatar
qzhxx committed
676 677 678 679 680
        }).then(() => {
          _this
            .$https({
              url: "menu/batchDel?menuIds=" + str,
              method: "DELETE",
qzhxx's avatar
qzhxx committed
681
              authType: this.backToken
qzhxx's avatar
qzhxx committed
682 683
            })
            .then(
qzhxx's avatar
qzhxx committed
684
              res => {
qzhxx's avatar
qzhxx committed
685 686 687
                if (res.data.status == 201 || res.data.status == 200) {
                  this.$message({
                    type: "success",
qzhxx's avatar
qzhxx committed
688
                    message: "删除成功!"
qzhxx's avatar
qzhxx committed
689 690 691 692 693
                  });
                }
                //重新查询数据
                _this.onSearch();
              },
qzhxx's avatar
qzhxx committed
694
              error => {}
qzhxx's avatar
qzhxx committed
695 696 697 698 699
            );
        });
      } else {
        this.$message({
          type: "info",
qzhxx's avatar
qzhxx committed
700
          message: "请至少选择一个选项!"
qzhxx's avatar
qzhxx committed
701 702
        });
      }
qzhxx's avatar
qzhxx committed
703 704
    }
  }
qzhxx's avatar
qzhxx committed
705 706 707 708
};
</script>

<style lang="less">
xulili's avatar
xulili committed
709 710 711
.imgSize {
  width: 160px;
  height: 100px;
qzhxx's avatar
qzhxx committed
712
}
xulili's avatar
xulili committed
713 714 715 716
.iconImg {
  height: 32px;
  width: 32px;
  margin-right: 8px;
qzhxx's avatar
qzhxx committed
717 718 719 720
}
// @import "../../../../style/common";
// @import "../../style/list";
@import "../../../style/dialog.less";
xulili's avatar
xulili committed
721 722 723 724
@import "../../../style/table.less";
@import "../../../style/pagination.less";
.video-box {
  width: 100%;
qzhxx's avatar
qzhxx committed
725 726 727 728 729 730 731
  .video-item {
    width: 100%;
  }
  video {
    width: 100%;
    height: 200px;
  }
xulili's avatar
xulili committed
732
}
qzhxx's avatar
qzhxx committed
733
audio:focus {
xulili's avatar
xulili committed
734 735
  outline: none;
}
qzhxx's avatar
qzhxx committed
736
</style>