Просмотр исходного кода

始宁农业管理后台:内容管理-通知管理

panyong 2 лет назад
Родитель
Сommit
ee65a4d012

+ 33 - 1
htmldev/shiningManage/src/App.vue

@@ -1,12 +1,44 @@
 <template>
   <div id="app">
     <router-view/>
+    <!-- 视频预览 -->
+    <el-dialog
+      :visible.sync="videoPlayDialog.show"
+      width="540px"
+      top="50px"
+      title="视频预览"
+      :append-to-body="true"
+      :beforeClose="handlePause"
+      :modal-append-to-body="true"
+      :close-on-click-modal="true">
+      <div>
+        <video
+          v-if="videoPlayDialog.show"
+          id="playVideo"
+          :src="videoPlayDialog.src"
+          controls
+          style="display: block; height: 500px; width: 500px;margin: 0 auto;"></video>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 export default {
-  name: 'App'
+  name: 'App',
+  computed: {
+    videoPlayDialog() {
+      return this.$store.state.common.videoPlayDialog
+    }
+  },
+  methods: {
+    handlePause() {
+      this.$store.commit('common/SET_VIDEOPLAYDIALOG', {
+        src: '',
+        show: false
+      })
+    }
+  }
 }
 </script>
 <style lang="scss">

+ 14 - 2
htmldev/shiningManage/src/router/modules/contentManage.js

@@ -12,13 +12,25 @@ const contentManage = {
       path: 'banner',
       name: 'contentManageBanner',
       component: () => import('@/views/contentManage/banner/index'),
-      meta: { title: '轮播管理' }
+      meta: { title: '轮播管理', icon: 'el-icon-picture-outline' }
     },
     {
       path: 'notify',
       name: 'contentManageNotify',
       component: () => import('@/views/contentManage/notify/index'),
-      meta: { title: '通知管理' }
+      meta: { title: '通知管理', icon: 'el-icon-message' }
+    },
+    {
+      path: 'news',
+      name: 'contentManageNews',
+      component: () => import('@/views/contentManage/news/index'),
+      meta: { title: '农事天地', icon: 'el-icon-news' }
+    },
+    {
+      path: 'video',
+      name: 'contentManageVideo',
+      component: () => import('@/views/contentManage/video/index'),
+      meta: { title: '村长说农事', icon: 'el-icon-video-camera' }
     }
   ]
 }

+ 18 - 1
htmldev/shiningManage/src/store/modules/common.js

@@ -83,7 +83,21 @@ const state = {
       name: '审核未通过',
       value: '3'
     }
-  ]
+  ],
+  arrHideAndShow: [
+    {
+      name: '隐藏',
+      value: '1'
+    },
+    {
+      name: '显示',
+      value: '2'
+    }
+  ],
+  videoPlayDialog: {
+    src: '',
+    show: false
+  }
 }
 
 const mutations = {
@@ -95,6 +109,9 @@ const mutations = {
   },
   SET_ROLEARR: (state, arr) => {
     state.roleArr = arr
+  },
+  SET_VIDEOPLAYDIALOG(state, obj) {
+    state.videoPlayDialog = obj
   }
 }
 

+ 189 - 0
htmldev/shiningManage/src/views/contentManage/news/details.vue

@@ -0,0 +1,189 @@
+<template>
+  <div>
+    <el-dialog
+      :title="exData.id ? '编辑': '新增'"
+      :visible.sync="dialog"
+      width="900px"
+      :close-on-click-modal="false"
+      top="50px">
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="formRules"
+        label-width="120px">
+        <el-form-item
+          prop="user_name"
+          label="农户编号:">
+          <el-input
+            v-model="form.user_name"
+            placeholder=""
+            disabled
+            clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="user_card"
+          label="农户名字:">
+          <el-input
+            v-model="form.user_card"
+            placeholder=""
+            disabled
+            clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="shop_name"
+          label="发布内容:">
+        </el-form-item>
+        <el-form-item
+          prop="user_card"
+          label="显示状态:">
+          <el-select
+            style="width: 100%;"
+            v-model="form.lunbo_status"
+            filterable
+            clearable
+            placeholder="请选择是否显示">
+            <el-option
+              :label="item.name"
+              :value="item.value"
+              v-for="item in arrHideAndShow"
+              :key="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer text-center">
+        <el-button @click="dialog = false">取 消</el-button>
+        <el-button
+          type="primary"
+          :disabled="booLock"
+          @click="handleSubmit">确 定
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    value: {
+      type: Boolean,
+      default: true
+    },
+    exData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data() {
+    return {
+      dialog: !!this.value,
+      form: {
+        // 'shop_id': '', // 店铺ID
+        'user_name': '', // 用户名称
+        'user_card': '', // 身份证
+        'shop_phone': '', // 手机号码
+        'shop_name': '', // 店铺名称
+        'shop_img_url': [], // 店铺图片
+        'country_msg': '', // 村信息
+        'user_wechat_code': '', // 微信号
+        'user_code_url': [], // 微信二维码
+        'shop_address': '', // 地址
+        'shop_remark': '' // 备注
+      },
+      shop_img_url: [],
+      user_code_url: [],
+      booLock: false
+    }
+  },
+  computed: {
+    arrHideAndShow() {
+      return this.$store.state.common.arrHideAndShow
+    }
+  },
+  methods: {
+    handleSubmit() {
+      const url = this.exData.id ? '/api/admin/shop/modify' : ''
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(this.form))
+          const postData = {
+            ...formData,
+            user_code_url: formData.user_code_url[0],
+            shop_img_url: formData.shop_img_url[0]
+          }
+          this.booLock = true
+          const data = await this.$fetch(url, postData)
+          this.booLock = false
+          if (data.code === 200) {
+            this.$message.success('提交成功')
+            this.$emit('success')
+            this.dialog = false
+          }
+        }
+      })
+    }
+  },
+  mounted() {
+    if (this.exData.id) {
+      this.$set(this.form, 'shop_id', this.exData.id)
+      this.shop_img_url = [
+        {
+          name: '',
+          url: this.exData.shop_img_url
+        }
+      ]
+      this.user_code_url = [
+        {
+          name: '',
+          url: this.exData.user_code_url
+        }
+      ]
+      for (const key in this.exData) {
+        if (this.form.hasOwnProperty(key)) {
+          let value = this.exData[key]
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
+            if (key === 'user_code_url' || key === 'shop_img_url') {
+              value = [value]
+            }
+            if (key === 'sort_id') {
+              value = value.toString()
+            }
+            if (key === 'shop_address' && Object.prototype.toString.call(value) === '[object Object]') {
+              value = value.address_name + value.name
+            }
+            this.$set(this.form, key, value)
+          }
+        }
+      }
+    }
+  },
+  watch: {
+    dialog(val) {
+      if (!val) this.$emit('input', val)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.top-tip {
+  margin-top: -20px;
+  margin-bottom: 20px;
+}
+
+.af-put-line-radio {
+  display: flex;
+  align-items: center;
+
+  p.lalel {
+    padding: 0 10px;
+  }
+
+  p {
+    padding: 0;
+    margin: 0;
+  }
+}
+</style>

+ 160 - 0
htmldev/shiningManage/src/views/contentManage/news/index.vue

@@ -0,0 +1,160 @@
+<template>
+  <div class="padding-20">
+    <div class="search-box">
+      <el-form
+        ref="form"
+        :inline="true"
+        :model="searchForm"
+        clearable
+        label-width="80px"
+        class="mt-10">
+        <el-form-item label="姓名:">
+          <el-input v-model="searchForm.user_name" placeholder="请输入姓名" clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          class="key-word"
+          label="关键词:">
+          <el-input v-model="searchForm.key_word" placeholder="请输入手机号后4位或身份证后6位" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="申请时间:">
+          <el-date-picker
+            :editable="false"
+            v-model="time"
+            @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item class="ml-10">
+          <el-button
+            icon="el-icon-search"
+            type="primary"
+            @click="searchSubmit">查询
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table
+      :data="tableData"
+      stripe
+      v-loading="tableLoading"
+      fit
+      class="marginT-10 order-table"
+      border
+      :max-height="vheight">
+      <el-table-column label="发布人" prop="user_id"><!-- 农户编号、农户名字 --></el-table-column>
+      <el-table-column label="发布内容" prop="user_name"></el-table-column>
+      <el-table-column label="发布时间" prop="user_card"></el-table-column>
+      <el-table-column label="显示状态" prop="shop_phone"><!-- 隐藏、显示 --></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" @click="edit(scope.row)">操作</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      class="marginT-20"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :hide-on-single-page="true"
+      :current-page="page"
+      :page-size="page_size"
+      :page-sizes="[10, 20, 100, 200, 300, 400]"
+      background
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="totalCount"/>
+    <detail
+      v-if="detailsDialog.show"
+      v-model="detailsDialog.show"
+      :exData="detailsDialog.exData"
+      @success="init"></detail>
+  </div>
+</template>
+
+<script>
+import page from '@/mixin/page'
+import detail from './details'
+
+export default {
+  mixins: [page],
+  components: {
+    detail
+  },
+  data() {
+    return {
+      detailsDialog: {
+        show: false,
+        exData: {}
+      },
+      time: [],
+      searchForm: {},
+      tableData: [],
+      tableUrl: '/api/admin/shop/list'
+    }
+  },
+  computed: {
+    // 店铺类型
+    shopType() {
+      return [
+        {
+          name: '普通',
+          value: '0'
+        },
+        {
+          name: '优秀',
+          value: '1'
+        }
+      ]
+    },
+    arrShopStatus() {
+      return [
+        {
+          name: '审核中',
+          value: '0'
+        },
+        {
+          name: '审核通过',
+          value: '1'
+        },
+        {
+          name: '未通过',
+          value: '2'
+        }
+      ]
+    }
+  },
+  methods: {
+    edit(row) {
+      this.detailsDialog.exData = row
+      this.detailsDialog.show = true
+    },
+    getShopStatusText(val) {
+      const index = this.arrShopStatus.findIndex(item => item.value === val + '')
+      if (index > -1) {
+        return this.arrShopStatus[index].name
+      }
+      return ''
+    },
+    getShopTypeText(val) {
+      const index = this.shopType.findIndex(item => item.value === val + '')
+      if (index > -1) {
+        return this.shopType[index].name
+      }
+      return ''
+    }
+  },
+  mounted() {
+    this.init()
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.key-word {
+  ::v-deep .el-form-item__content {
+    width: 260px;
+  }
+}
+</style>

+ 312 - 0
htmldev/shiningManage/src/views/contentManage/video/details.vue

@@ -0,0 +1,312 @@
+<template>
+  <div>
+    <el-dialog
+      :title="exData.id ? '编辑': '新增'"
+      :visible.sync="dialog"
+      width="900px"
+      :close-on-click-modal="false"
+      top="50px">
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="formRules"
+        label-width="120px">
+        <el-form-item
+          prop="video_name"
+          :rules="formRules.required"
+          label="视频名称:">
+          <el-input
+            v-model="form.video_name"
+            placeholder="请输入视频名称"
+            clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="video_introduce"
+          :rules="formRules.required"
+          label="视频简介:">
+          <el-input
+            type="textarea"
+            :rows="4"
+            placeholder="请输入视频简介"
+            v-model="form.video_introduce">
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          prop="video_cover_url"
+          :rules="formRules.uploadImgs"
+          label="视频封面:">
+          <el-upload
+            :on-remove="(file) => {handleRemove(file, 'video_cover_url')}"
+            :on-success="(file) => {handleAvatarSuccess(file, 'video_cover_url')}"
+            :before-upload="beforeAvatarUpload"
+            :on-exceed="hadnleExceed"
+            :accept="'image/*'"
+            :limit="1"
+            :file-list="video_cover_url"
+            list-type="picture-card"
+            action="/api/upload/img"
+            multiple
+            ref="video_cover_url">
+            <i class="el-icon-plus"></i>
+            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5M</div>
+          </el-upload>
+        </el-form-item>
+        <el-form-item
+          prop="video_url"
+          :rules="formRules.uploadImgs"
+          label="视频:">
+          <el-upload
+            :on-remove="(file) => {handleRemove(file, 'video_url')}"
+            :on-success="(file) => {handleAvatarSuccess(file, 'video_url')}"
+            :accept="'video/mp4'"
+            :limit="1"
+            :file-list="video_url"
+            action="/api/upload/img"
+            :multiple="false"
+            :show-file-list="false"
+            ref="video_url">
+            <el-button
+              icon="el-icon-plus"
+              type="text"
+              slot="trigger"
+              v-if="form.video_url.length < 1">选择视频
+            </el-button>
+            <template v-if="form.video_url.length > 0">
+              <el-button
+                icon="el-icon-video-play"
+                type="text"
+                slot="tip"
+                @click="showVideoPlayDialog">视频预览
+              </el-button>
+              <el-button
+                style="margin-left: 20px;"
+                icon="el-icon-delete"
+                type="text"
+                slot="tip"
+                @click="resetVideoUrl">删除
+              </el-button>
+            </template>
+          </el-upload>
+        </el-form-item>
+        <el-form-item
+          prop="video_auther"
+          :rules="formRules.required"
+          label="出镜人员:">
+          <el-input
+            type="textarea"
+            :rows="4"
+            placeholder="请输入出镜人员"
+            v-model="form.video_auther">
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          prop="lunbo_status"
+          :rules="formRules.select"
+          label="置顶推荐:">
+          <el-select
+            style="width: 100%;"
+            v-model="form.lunbo_status"
+            filterable
+            clearable
+            placeholder="请选择是否置顶推荐">
+            <el-option
+              :label="item.name"
+              :value="item.value"
+              v-for="item in arrRecommend"
+              :key="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          prop="video_status"
+          :rules="formRules.select"
+          label="状态:">
+          <el-select
+            style="width: 100%;"
+            v-model="form.video_status"
+            filterable
+            clearable
+            placeholder="请选择状态">
+            <el-option
+              :label="item.name"
+              :value="item.value"
+              v-for="item in arrLunboStatus"
+              :key="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer text-center">
+        <el-button @click="dialog = false">取 消</el-button>
+        <el-button
+          type="primary"
+          :disabled="booLock"
+          @click="handleSubmit">确 定
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    value: {
+      type: Boolean,
+      default: true
+    },
+    exData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    },
+    arrRecommend: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      dialog: !!this.value,
+      form: {
+        'video_name': '', // 视频名称
+        'video_introduce': '', // 视频简介
+        'video_cover_url': [], // 封面地址
+        'video_url': [], // 视频地址
+        'video_type_id': 1, // 类别ID todo
+        'video_type_name': 'sd', // 类别名称 todo
+        'video_auther': '', // 出境人
+        'lunbo_status': '0', // 置顶推荐(0否1是)
+        'video_status': '0' // 视频状态(0未审核1审核通过2审核拒绝) todo
+      },
+      video_cover_url: [],
+      video_url: [],
+      booLock: false
+    }
+  },
+  computed: {
+    arrLunboStatus() {
+      return this.$store.state.common.arrLunboStatus
+    }
+  },
+  methods: {
+    beforeAvatarUpload(file) {
+      const isLt2M = file.size / 1024 / 1024 < 5
+      if (!isLt2M) {
+        this.$message.error('上传图片大小不能超过 5MB!')
+      }
+      return isLt2M
+    },
+    hadnleExceed(files, fileList) {
+      this.$message({
+        message: '最多上传一张',
+        type: 'warning'
+      })
+    },
+    handleRemove(file, formKey) {
+      let path = file.url
+      if (file.response && file.response.data) {
+        path = file.response.data.path
+      }
+      this.form[formKey] = this.form[formKey].filter(item => item !== path)
+    },
+    handleAvatarSuccess(res, formKey) {
+      if (res.code === 200) {
+        const { path } = res.data
+        this.form[formKey].push(path)
+      } else {
+        this.$message.error('图片上传失败')
+      }
+    },
+    handleSubmit() {
+      const url = this.exData.id ? '/api/admin/video/modify' : '/api/admin/video/add'
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(this.form))
+          const postData = {
+            ...formData,
+            video_cover_url: formData.video_cover_url[0],
+            video_url: formData.video_url[0]
+          }
+          this.booLock = true
+          const data = await this.$fetch(url, postData)
+          this.booLock = false
+          if (data.code === 200) {
+            this.$message.success('提交成功')
+            this.$emit('success')
+            this.dialog = false
+          }
+        }
+      })
+    },
+    showVideoPlayDialog() {
+      this.$store.commit('common/SET_VIDEOPLAYDIALOG', {
+        src: this.form.video_url[0],
+        show: true
+      })
+    },
+    resetVideoUrl() {
+      this.form.video_url.splice(0, 1)
+      this.video_url.splice(0, 1)
+    }
+  },
+  mounted() {
+    if (this.exData.id) {
+      this.$set(this.form, 'id', this.exData.id)
+      this.video_cover_url = [
+        {
+          name: '',
+          url: this.exData.video_cover_url
+        }
+      ]
+      this.video_url = [
+        {
+          name: '',
+          url: this.exData.video_url
+        }
+      ]
+      for (const key in this.exData) {
+        if (this.form.hasOwnProperty(key)) {
+          let value = this.exData[key]
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
+            if (key === 'video_cover_url' || key === 'video_url') {
+              value = [value]
+            }
+            if (key === 'lunbo_status' || key === 'video_status') {
+              value = value + ''
+            }
+            this.$set(this.form, key, value)
+          }
+        }
+      }
+    }
+  },
+  watch: {
+    dialog(val) {
+      if (!val) this.$emit('input', val)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.top-tip {
+  margin-top: -20px;
+  margin-bottom: 20px;
+}
+
+.af-put-line-radio {
+  display: flex;
+  align-items: center;
+
+  p.lalel {
+    padding: 0 10px;
+  }
+
+  p {
+    padding: 0;
+    margin: 0;
+  }
+}
+</style>

+ 154 - 0
htmldev/shiningManage/src/views/contentManage/video/index.vue

@@ -0,0 +1,154 @@
+<template>
+  <div class="padding-20">
+    <!--todo 筛选 视频名称 显示状态 置顶推荐 创建时间-->
+    <el-table
+      :data="tableData"
+      stripe
+      v-loading="tableLoading"
+      fit
+      class="marginT-10 order-table"
+      border
+      :max-height="vheight">
+      <el-table-column label="视频名称" prop="video_name" min-width="140" show-overflow-tooltip></el-table-column>
+      <el-table-column label="视频简介" prop="video_introduce" min-width="140" show-overflow-tooltip></el-table-column>
+      <el-table-column label="视频预览" prop="video_cover_url" min-width="100">
+        <template slot-scope="scope">
+          <el-image
+            class="el-icon-video-play"
+            style="display:block;width: 80px; height: 80px;font-size: 0;position: relative;left: 0;top: 0;cursor: pointer;"
+            :src="scope.row.video_cover_url"
+            @click.native="showVideoPlayDialog(scope.row)">
+          </el-image>
+        </template>
+      </el-table-column>
+      <el-table-column label="频道" prop="video_type_name" min-width="140"></el-table-column>
+      <el-table-column label="出镜人员" prop="video_auther" min-width="140" show-overflow-tooltip></el-table-column>
+      <el-table-column label="显示状态" prop="video_status">
+        <template slot-scope="scope">{{ scope.row.video_status === 1 ? '显示' : '隐藏' }}</template>
+      </el-table-column>
+      <el-table-column label="置顶推荐" prop="lunbo_status">
+        <template slot-scope="scope">{{ scope.row.lunbo_status === 1 ? '已推荐' : '' }}</template>
+      </el-table-column>
+      <el-table-column label="播放数" prop="video_act_num"></el-table-column>
+      <el-table-column label="点赞数" prop="video_good_num"></el-table-column>
+      <el-table-column label="评论数" prop="video_comment_num"></el-table-column>
+      <el-table-column label="转发数" prop="video_transfer_num"></el-table-column>
+      <!-- TODO 发布时间 -->
+      <el-table-column label="创建时间" prop="created_at" min-width="160"></el-table-column>
+      <el-table-column label="更新时间" prop="updated_at" min-width="160"></el-table-column>
+      <el-table-column label="操作" min-width="100">
+        <template slot-scope="scope">
+          <el-button type="text" @click="edit(scope.row)">操作</el-button>
+          <el-button type="text" @click="del(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      class="marginT-20"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :hide-on-single-page="true"
+      :current-page="page"
+      :page-size="page_size"
+      :page-sizes="[10, 20, 100, 200, 300, 400]"
+      background
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="totalCount"/>
+    <detail
+      v-if="detailsDialog.show"
+      v-model="detailsDialog.show"
+      :exData="detailsDialog.exData"
+      :arrRecommend="arrRecommend"
+      @success="init"></detail>
+  </div>
+</template>
+
+<script>
+import page from '@/mixin/page'
+import detail from './details'
+
+export default {
+  mixins: [page],
+  components: {
+    detail
+  },
+  data() {
+    return {
+      detailsDialog: {
+        show: false,
+        exData: {}
+      },
+      time: [],
+      searchForm: {},
+      tableData: [],
+      tableUrl: '/api/admin/video/list',
+      arrRecommend: [
+        {
+          name: '否',
+          value: '0'
+        },
+        {
+          name: '是',
+          value: '1'
+        }
+      ]
+    }
+  },
+  methods: {
+    add() {
+      this.detailsDialog.exData = {}
+      this.detailsDialog.show = true
+    },
+    edit(row) {
+      this.detailsDialog.exData = row
+      this.detailsDialog.show = true
+    },
+    del(row) {
+      this.$confirm('确定要删除吗', '确认', {
+        type: 'warning'
+      }).then(async () => {
+        const data = await this.$fetch('/api/admin/video/delete', { id: row.id })
+        if (data.code === 200) {
+          this.$message.success('删除成功')
+          this.init()
+        }
+      }).catch(() => {
+      })
+    },
+    showVideoPlayDialog(row) {
+      const { video_url } = row
+      if (!video_url) {
+        this.$message.error('视频不存在')
+        return
+      }
+      this.$store.commit('common/SET_VIDEOPLAYDIALOG', {
+        src: video_url,
+        show: true
+      })
+    }
+  },
+  mounted() {
+    this.init()
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.key-word {
+  ::v-deep .el-form-item__content {
+    width: 260px;
+  }
+}
+
+.el-icon-video-play {
+  &:before {
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    z-index: 1;
+    font-size: 30px;
+    color: #999;
+    transform: translate(-50%, -50%);
+  }
+}
+</style>