Bläddra i källkod

页面绘制v1.3

喻文俊 3 år sedan
förälder
incheckning
250b54ccba

+ 4 - 4
.env.development

@@ -2,12 +2,12 @@
 ENV = 'development'
 
 # 测试地址 API接口
-# VUE_APP_BASE_API = 'https://zplma-b.caimei365.com'
-VUE_APP_BASE_API = 'http://192.168.2.68:8012'
+VUE_APP_BASE_API = 'https://zplma-b.caimei365.com'
+# VUE_APP_BASE_API = 'http://192.168.2.68:8012'
 
 # 文件上传 API接口地址
-# VUE_APP_UPLOAD_API='https://zplma-b.caimei365.com'
-VUE_APP_UPLOAD_API='http://192.168.2.68:8012'
+VUE_APP_UPLOAD_API='https://zplma-b.caimei365.com'
+# VUE_APP_UPLOAD_API='http://192.168.2.68:8012'
 
 # 二维码生成链接location
 VUE_APP_BASE_SERVER = 'https://www-b.caimei365.com'

+ 131 - 0
src/components/FileUpload/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="file-upload">
+    <el-upload
+      ref="upload"
+      :class="{'hide-upload':hideUpload}"
+      :action="action"
+      :multiple="multiple"
+      :limit="limit"
+      :on-preview="handlePreview"
+      :on-remove="handleRemove"
+      :before-remove="beforeRemove"
+      :on-success="onSuccess"
+      :on-error="onError"
+      :on-exceed="handleExceed"
+      :on-change="handleChange"
+      :file-list="uploadList"
+      :auto-upload="autoUpload"
+      :accept="acceptType"
+    >
+      <el-button size="small" type="primary">点击上传</el-button>
+      <div v-if="uploadTip" slot="tip" class="el-upload__tip">{{ uploadTip }}</div>
+    </el-upload>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    uploadTip: {
+      type: String,
+      default: ''
+    },
+    limit: {
+      type: Number,
+      default: 9
+    },
+    fileList: {
+      type: Array,
+      default: () => []
+    },
+    multiple: {
+      type: Boolean,
+      default: false
+    },
+    autoUpload: {
+      type: Boolean,
+      default: false
+    },
+    acceptType: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      action: '',
+      uploadList: []
+    }
+  },
+  computed: {
+    hideUpload() {
+      if (this.multiple) {
+        return this.uploadList.length === this.limit
+      } else {
+        return this.uploadList.length === 1
+      }
+    }
+  },
+  created() {
+    console.log(this.$props)
+    this.action = process.env.VUE_APP_UPLOAD_API + '/upload/file'
+    this.uploadList = this.fileList
+  },
+  methods: {
+    handleRemove(file, fileList) {
+      this.uploadList = fileList
+      this.$emit('change', fileList)
+    },
+    beforeRemove(file, fileList) {
+      this.uploadList = fileList
+      return this.$confirm(`确定移除 ${file.name}?`)
+    },
+    handlePreview(file) {
+      console.log(file)
+    },
+    handleExceed(files, fileList) {
+      this.uploadList = fileList
+      this.$message.warning(`当前限制选择 ${this.limit} 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
+    },
+    onSuccess(response, file, fileList) {
+      this.uploadList = fileList
+      this.$emit('change', fileList)
+    },
+    onError(err, file, fileList) {
+      console.log(err)
+      this.uploadList = fileList
+    },
+    handleChange(file, fileList) {
+      this.uploadList = fileList
+      this.$emit('change', fileList)
+    },
+    submit() {
+      console.log('手动上传')
+      this.$refs.upload.submit()
+    },
+    clearAllFiles() {
+      this.uploadList = []
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.hide-upload{
+.el-upload{
+  display: none;
+}
+.el-upload-list__item:first-child{
+    margin-top: 6px;
+}
+
+}
+.file-upload{
+  position: relative;
+  .upload-btn{
+    position: absolute;
+    top: 2px;
+    left: 0;
+  }
+}
+</style>

+ 2 - 0
src/router/index.js

@@ -10,6 +10,7 @@ import supplierRoutes from './modules/supplier'
 import authRoutes from './modules/auth'
 import productRoutes from './modules/product'
 import reviewRoutes from './modules/review'
+import heloperRoutes from './modules/helper'
 // import proxyRoutes from './modules/proxy'
 import docRoutes from './modules/doc'
 import feedbackRoutes from './modules/feedback'
@@ -100,6 +101,7 @@ export const asyncRoutes = [
   // ...proxyRoutes,
   ...docRoutes,
   ...feedbackRoutes,
+  ...heloperRoutes,
 
   // 404页面 放在最后面
   { path: '*', redirect: '/404', hidden: true }

+ 44 - 0
src/router/modules/helper.js

@@ -0,0 +1,44 @@
+/* Layout */
+import Layout from '@/layout'
+
+// 授权管理页面
+const heloperRoutes = [
+  {
+    path: '/helper',
+    component: Layout,
+    alwaysShow: true,
+    redirect: '/helper/video',
+    name: 'Helper',
+    meta: { title: '新手帮助', icon: 'el-icon-s-promotion', roles: ['admin', 'normal'], noCache: true, proxy: true },
+    children: [
+      {
+        path: 'video',
+        component: () => import('@/views/authentic/helper/video'),
+        name: 'HelperVideo',
+        meta: {
+          title: '视频教程',
+          icon: 'el-icon-menu',
+          roles: ['admin', 'normal'],
+          affix: false,
+          noCache: true,
+          proxy: false
+        }
+      },
+      {
+        path: 'document',
+        component: () => import('@/views/authentic/helper/document'),
+        name: 'HelperDocument',
+        meta: {
+          title: '文档教程',
+          icon: 'el-icon-menu',
+          roles: ['admin', 'normal'],
+          affix: false,
+          noCache: true,
+          proxy: false
+        }
+      }
+    ]
+  }
+]
+
+export default heloperRoutes

+ 100 - 3
src/views/authentic/auth/index.vue

@@ -33,6 +33,8 @@
       </el-select>
       <el-button icon="el-icon-search" type="primary" @click="getList">查询</el-button>
       <el-button v-if="userIdentity === 2 || proxyInfo!==null" icon="el-icon-edit" type="primary" @click="handleShowEditDialog('添加品牌授权')">添加品牌授权</el-button>
+      <el-button icon="el-icon-upload" type="primary" @click="improtDialogVisible = true">导入</el-button>
+      <el-button icon="el-icon-document" type="primary">导出</el-button>
     </div>
     <!-- 表格区域 -->
     <el-table
@@ -144,17 +146,39 @@
         <el-button type="primary" :disabled="disabled" @click="handleUpdateBrandAuth">确 定</el-button>
       </span>
     </el-dialog>
+    <!-- 导入对话框 -->
+    <!-- dialog Start -->
+    <el-dialog
+      title="导入"
+      :visible.sync="improtDialogVisible"
+      width="30%"
+      @close="improtDialogClose"
+    >
+      <el-form ref="dialogForm" :model="improtDialogFormData" label-width="86px" :rules="improtDialogFormRules">
+        <el-form-item label="文件路径:" prop="fileUrl">
+          <file-upload ref="fileUpload" :file-list="uploadFileList" @change="fileUploadChange" />
+          <el-input v-show="false" v-model="improtDialogFormData.fileUrl" />
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="improtDialogVisible = false">取 消</el-button>
+        <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- dialog END -->
   </div>
 </template>
 
 <script>
+import FileUpload from '@/components/FileUpload'
 import { fecthAuthList, saveBrandAuth, changeAuthStatus, removeAuth } from '@/api/auth'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import { mapGetters } from 'vuex'
 import { formatDate } from '@/utils'
+import { debounce } from '@/utils/tools'
 export default {
   name: 'ComplexTable',
-  components: { Pagination },
+  components: { Pagination, FileUpload },
   filters: {
     formatTime(time) {
       if (!time) {
@@ -197,11 +221,30 @@ export default {
       disabled: false,
       // 审核未通过
       auditFailedList: [],
-      auditNoticeFlag: true
+      auditNoticeFlag: true,
+      // ------------------
+      improtDialogVisible: false,
+      requestLoading: false,
+      uploadFileList: [],
+      improtDialogFormData: {
+        fileUrl: ''
+      },
+      improtDialogFormRules: {
+        fileUrl: [
+          {
+            required: true,
+            message: '请选择文件', trigger: 'change'
+          }
+        ]
+      }
     }
   },
   computed: {
-    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo'])
+    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo']),
+    saveBtnClickable() {
+      return this.uploadFileList.length > 0
+    }
+
   },
   created() {
     this.listQuery.authUserId = this.$route.query.id || this.proxyInfo?.authUserId || this.authUserId
@@ -217,6 +260,60 @@ export default {
     // this.$store.commit('user/SET_PROXY_INFO', null)
   },
   methods: {
+    // 上传文件
+    submitUpload() {
+      this.$refs.dialogForm.validate(valid => {
+        console.log(valid)
+        if (!valid) return
+        this.requestLoading = true // 上传文件
+        this.$refs.fileUpload.submit()
+      })
+    },
+    // 监听上传文件的状态变化
+    async fileUploadChange(fileList) {
+      this.uploadFileList = fileList
+      try {
+        await this.handleFileUploadStatus(fileList)
+        this.handleSave.apply(this)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 保存 TODO
+    handleSave: debounce(function() {
+      console.log('保存')
+      console.log(this.improtDialogFormData)
+      setTimeout(() => {
+        this.requestLoading = false
+      }, 500)
+    }, 200),
+
+    // 处理文件上传状态
+    handleFileUploadStatus(fileList) {
+      // 文件列表为空
+      if (fileList.length <= 0) {
+        this.improtDialogFormData.fileUrl = ''
+        return Promise.reject('faild')
+      }
+      // 取第一个文件
+      const { response, status } = fileList[0]
+      // 文件已选择但未上传
+      if (status === 'ready') {
+        this.improtDialogFormData.fileUrl = status
+        return Promise.reject('faild')
+      }
+      // 文件已上传
+      if (status === 'success') {
+        this.improtDialogFormData.fileUrl = response.previewUrl
+        return Promise.resolve('success')
+      }
+    },
+    improtDialogClose() {
+      console.log(123)
+      // this.uploadFileList = []
+      this.$refs.fileUpload.clearAllFiles()
+      this.$refs.dialogForm.resetFields()
+    },
     // 获取授权列表
     getList() {
       this.listLoading = true

+ 333 - 0
src/views/authentic/helper/document.vue

@@ -0,0 +1,333 @@
+<template>
+  <div class="app-container">
+    <!-- 搜索区域 -->
+    <div class="filter-container">
+      <span>标题:</span>
+      <el-input
+        v-model="listQuery.articleTitle"
+        placeholder="标题"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="getList"
+      />
+      <span>所属模块:</span>
+      <el-select
+        v-model="listQuery.auditStatus"
+        placeholder="所属模块"
+        clearable
+        style="width: 200px"
+        class="filter-item"
+        @change="getList"
+      >
+        <el-option label="全部" value="" />
+        <el-option label="待审核" :value="2" />
+        <el-option label="审核通过" :value="1" />
+        <el-option label="审核未通过" :value="0" />
+      </el-select>
+      <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      <el-button
+        v-if="userIdentity === 1"
+        icon="el-icon-edit"
+        type="primary"
+        @click="dialogVisible = true"
+      >添加</el-button>
+    </div>
+    <!-- 搜索区域END -->
+    <!-- 表格区域 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      style="width: 100%"
+      border
+      fit
+      highlight-current-row
+      cell-class-name="table-cell"
+    >
+      <el-table-column label="序号" :index="indexMethod" type="index" width="80" align="center" />
+      <el-table-column label="标题" prop="articleTitle" align="center" />
+      <el-table-column label="所属模块" align="center" />
+      <el-table-column label="创建时间" width="240px" align="center">
+        <template slot-scope="{ row }">
+          {{ row.createTime | formatTime }}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="240px" align="center">
+        <template slot-scope="{ row }">
+          <template v-if="userIdentity === 1">
+            <el-button
+              type="primary"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-edit"
+            >编辑</el-button>
+            <el-button
+              type="danger"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-s-check"
+              @click="handleRemove(row)"
+            >删除</el-button>
+          </template>
+          <el-button
+            type="danger"
+            size="mini"
+            style="margin-right:5px"
+            icon="el-icon-s-check"
+            @click="handleRemove(row)"
+          >播放</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 表格区域END -->
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList(listQuery)" />
+
+    <!-- dialog Start -->
+    <el-dialog
+      title="添加视频"
+      :visible.sync="dialogVisible"
+      width="30%"
+      @close="dialogClose"
+    >
+
+      <el-form ref="dialogForm" :model="dialogFormData" label-width="86px" :rules="rules">
+        <el-form-item label="标题:" prop="title">
+          <el-input v-model="dialogFormData.title" placeholder="请输入标题" />
+        </el-form-item>
+        <el-form-item label="视频路径:" prop="videoUrl">
+          <file-upload ref="fileUpload" :file-list="uploadFileList" accept-type="application/*" @change="fileUploadChange" />
+          <el-input v-show="false" v-model="dialogFormData.videoUrl" />
+        </el-form-item>
+        <el-form-item label="所属模块:" prop="belongMoudule">
+          <el-select v-model="dialogFormData.belongMoudule">
+            <el-option label="请选择模块" value="" />
+            <el-option label="供应商管理/供应商列表" :value="1" />
+            <el-option label="供应商管理/供应商列表" :value="2" />
+            <el-option label="供应商管理/供应商列表" :value="3" />
+            <el-option label="供应商管理/供应商列表" :value="4" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- dialog END -->
+  </div>
+</template>
+
+<script>
+import FileUpload from '@/components/FileUpload'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import { formatDate } from '@/utils'
+import { mapGetters } from 'vuex'
+import { changeArticleStatus, getArticleList, removeArticle } from '@/api/doc'
+import { debounce } from '@/utils/tools'
+export default {
+  components: { Pagination, FileUpload },
+  filters: {
+    formatTime(time) {
+      if (!time) {
+        return ''
+      }
+      return formatDate(time, 'yyyy-MM-DD HH:mm:ss')
+    }
+  },
+  data() {
+    return {
+      listLoading: false,
+      dialogVisible: false,
+      requestLoading: false,
+      total: 0,
+      listQuery: {
+        authUserId: '', // 机构id
+        auditStatus: '', // 审核状态
+        articleTitle: '', // 文章标题
+        listType: 1, // 列表类型:1文章列表,2文章审核列表
+        pageNum: 1, // 页码
+        pageSize: 10, // 分页大小
+        status: '' // 文章状态:0已下线,1已上线,2待上线
+      },
+      list: [],
+      uploadFileList: [],
+      dialogFormData: {
+        title: '',
+        videoUrl: '',
+        belongMoudule: ''
+      },
+      rules: {
+        title: [{
+          required: true,
+          message: '请输入标题', trigger: ['change', 'blur']
+        }],
+        videoUrl: [
+          {
+            required: true,
+            message: '请选择文件', trigger: 'change'
+          }
+        ],
+        belongMoudule: [{
+          required: true,
+          message: '请选择所属模块', trigger: 'change'
+        }]
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo']),
+    saveBtnClickable() {
+      return this.uploadFileList.length > 0
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 上传文件
+    submitUpload() {
+      this.$refs.dialogForm.validate(valid => {
+        console.log(valid)
+        if (!valid) return
+        this.requestLoading = true // 上传文件
+        this.$refs.fileUpload.submit()
+      })
+    },
+    // 监听上传文件的状态变化
+    async fileUploadChange(fileList) {
+      this.uploadFileList = fileList
+      try {
+        await this.handleFileUploadStatus(fileList)
+        this.handleSave.apply(this)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 保存 TODO
+    handleSave: debounce(function() {
+      console.log('保存')
+      console.log(this.dialogFormData)
+      setTimeout(() => {
+        this.requestLoading = false
+      }, 500)
+    }, 200),
+
+    // 处理文件上传状态
+    handleFileUploadStatus(fileList) {
+      // 文件列表为空
+      if (fileList.length <= 0) {
+        this.dialogFormData.videoUrl = ''
+        return Promise.reject('faild')
+      }
+      // 取第一个文件
+      const { response, status } = fileList[0]
+      // 文件已选择但未上传
+      if (status === 'ready') {
+        this.dialogFormData.videoUrl = status
+        return Promise.reject('faild')
+      }
+      // 文件已上传
+      if (status === 'success') {
+        this.dialogFormData.videoUrl = response.previewUrl
+        return Promise.resolve('success')
+      }
+    },
+    // 获取列表数据
+    getList() {
+      this.listLoading = true
+      this.listQuery.authUserId = this.authUserId
+      getArticleList(this.listQuery)
+        .then(res => {
+          if (res.code !== 0) return
+          this.list = res.data.list
+          console.log(res)
+          this.total = res.data.total
+        })
+        .finally(() => {
+          this.listLoading = false
+        })
+    },
+    // 删除
+    async handleRemove(row) {
+      const text = await this.$confirm('确认删除该文章吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).catch(() => {
+        this.$message.info('已取消操作')
+      })
+      if (text !== 'confirm') return
+      removeArticle({ articleId: row.articleId })
+        .then(res => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList(this.listQuery)
+        })
+    },
+    // 状态改变
+    handleChangeStatus(item) {
+      this.listLoading = true
+      // const params = {
+      //   authId: item.authId,
+      //   status: item.status ? 1 : 0
+      // }
+      console.log(item)
+      const params = {
+        articleId: item.articleId,
+        status: item.status === 1 ? 0 : 1
+      }
+      changeArticleStatus(params).then(res => {
+        // this.$message.success(res.data)
+        this.$message({
+          message: res.data,
+          duration: 500,
+          type: 'success'
+        })
+        this.getList()
+      }).catch(err => {
+        console.log(err)
+      }).finally(() => {
+        this.listLoading = false
+      })
+    },
+    // 表格索引
+    indexMethod(index) {
+      return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
+    },
+    // 编辑视频
+    handleAdd() {},
+    dialogClose() {
+      console.log(123)
+      // this.uploadFileList = []
+      this.$refs.fileUpload.clearAllFiles()
+      this.$refs.dialogForm.resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.filter-container {
+  span {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+    font-size: 14px;
+  }
+  .el-button {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+  }
+  .el-input,
+  .el-select {
+    margin-right: 10px;
+    margin-left: 10px;
+  }
+}
+.el-table .cell {
+  overflow: visible;
+}
+.el-badge {
+  margin: 0 6px;
+}
+</style>

+ 324 - 0
src/views/authentic/helper/video.vue

@@ -0,0 +1,324 @@
+<template>
+  <div class="app-container">
+    <!-- 搜索区域 -->
+    <div class="filter-container">
+      <span>标题:</span>
+      <el-input
+        v-model="listQuery.articleTitle"
+        placeholder="标题"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="getList"
+      />
+      <span>所属模块:</span>
+      <el-select
+        v-model="listQuery.auditStatus"
+        placeholder="所属模块"
+        clearable
+        style="width: 200px"
+        class="filter-item"
+        @change="getList"
+      >
+        <el-option label="全部" value="" />
+        <el-option label="待审核" :value="2" />
+        <el-option label="审核通过" :value="1" />
+        <el-option label="审核未通过" :value="0" />
+      </el-select>
+      <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      <el-button
+        v-if="userIdentity === 1"
+        icon="el-icon-edit"
+        type="primary"
+        @click="dialogVisible = true"
+      >添加</el-button>
+    </div>
+    <!-- 搜索区域END -->
+    <!-- 表格区域 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      style="width: 100%"
+      border
+      fit
+      highlight-current-row
+      cell-class-name="table-cell"
+    >
+      <el-table-column label="序号" :index="indexMethod" type="index" width="80" align="center" />
+      <el-table-column label="标题" prop="articleTitle" align="center" />
+      <el-table-column label="所属模块" align="center" />
+      <el-table-column label="创建时间" width="240px" align="center">
+        <template slot-scope="{ row }">
+          {{ row.createTime | formatTime }}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="240px" align="center">
+        <template slot-scope="{ row }">
+          <el-button
+            type="primary"
+            size="mini"
+            style="margin-right:5px"
+            icon="el-icon-edit"
+          >编辑</el-button>
+          <el-button
+            type="danger"
+            size="mini"
+            style="margin-right:5px"
+            icon="el-icon-s-check"
+            @click="handleRemove(row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 表格区域END -->
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList(listQuery)" />
+
+    <!-- 视频编辑dialog -->
+    <el-dialog
+      title="添加视频"
+      :visible.sync="dialogVisible"
+      width="30%"
+      @close="dialogClose"
+    >
+
+      <el-form ref="dialogForm" :model="dialogFormData" label-width="86px" :rules="rules">
+        <el-form-item label="标题:" prop="title">
+          <el-input v-model="dialogFormData.title" placeholder="请输入标题" />
+        </el-form-item>
+        <el-form-item label="视频路径:" prop="videoUrl">
+          <file-upload ref="fileUpload" :file-list="uploadFileList" accept-type="video/*" @change="fileUploadChange" />
+          <el-input v-show="false" v-model="dialogFormData.videoUrl" />
+        </el-form-item>
+        <el-form-item label="所属模块:" prop="belongMoudule">
+          <el-select v-model="dialogFormData.belongMoudule">
+            <el-option label="请选择模块" value="" />
+            <el-option label="供应商管理/供应商列表" :value="1" />
+            <el-option label="供应商管理/供应商列表" :value="2" />
+            <el-option label="供应商管理/供应商列表" :value="3" />
+            <el-option label="供应商管理/供应商列表" :value="4" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- 视频编辑dialog END -->
+  </div>
+</template>
+
+<script>
+import FileUpload from '@/components/FileUpload'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import { formatDate } from '@/utils'
+import { mapGetters } from 'vuex'
+import { changeArticleStatus, getArticleList, removeArticle } from '@/api/doc'
+import { debounce } from '@/utils/tools'
+export default {
+  components: { Pagination, FileUpload },
+  filters: {
+    formatTime(time) {
+      if (!time) {
+        return ''
+      }
+      return formatDate(time, 'yyyy-MM-DD HH:mm:ss')
+    }
+  },
+  data() {
+    return {
+      listLoading: false,
+      dialogVisible: false,
+      requestLoading: false,
+      total: 0,
+      listQuery: {
+        authUserId: '', // 机构id
+        auditStatus: '', // 审核状态
+        articleTitle: '', // 文章标题
+        listType: 1, // 列表类型:1文章列表,2文章审核列表
+        pageNum: 1, // 页码
+        pageSize: 10, // 分页大小
+        status: '' // 文章状态:0已下线,1已上线,2待上线
+      },
+      list: [],
+      uploadFileList: [],
+      dialogFormData: {
+        title: '',
+        videoUrl: '',
+        belongMoudule: ''
+      },
+      rules: {
+        title: [{
+          required: true,
+          message: '请输入标题', trigger: ['change', 'blur']
+        }],
+        videoUrl: [
+          {
+            required: true,
+            message: '请选择文件', trigger: 'change'
+          }
+        ],
+        belongMoudule: [{
+          required: true,
+          message: '请选择所属模块', trigger: 'change'
+        }]
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo']),
+    saveBtnClickable() {
+      return this.uploadFileList.length > 0
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 上传文件
+    submitUpload() {
+      this.$refs.dialogForm.validate(valid => {
+        console.log(valid)
+        if (!valid) return
+        this.requestLoading = true // 上传文件
+        this.$refs.fileUpload.submit()
+      })
+    },
+    // 监听上传文件的状态变化
+    async fileUploadChange(fileList) {
+      this.uploadFileList = fileList
+      try {
+        await this.handleFileUploadStatus(fileList)
+        this.handleSave.apply(this)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 保存 TODO
+    handleSave: debounce(function() {
+      console.log('保存')
+      console.log(this.dialogFormData)
+      setTimeout(() => {
+        this.requestLoading = false
+      }, 500)
+    }, 200),
+
+    // 处理文件上传状态
+    handleFileUploadStatus(fileList) {
+      // 文件列表为空
+      if (fileList.length <= 0) {
+        this.dialogFormData.videoUrl = ''
+        return Promise.reject('faild')
+      }
+      // 取第一个文件
+      const { response, status } = fileList[0]
+      // 文件已选择但未上传
+      if (status === 'ready') {
+        this.dialogFormData.videoUrl = status
+        return Promise.reject('faild')
+      }
+      // 文件已上传
+      if (status === 'success') {
+        this.dialogFormData.videoUrl = response.previewUrl
+        return Promise.resolve('success')
+      }
+    },
+    // 获取列表数据
+    getList() {
+      this.listLoading = true
+      this.listQuery.authUserId = this.authUserId
+      getArticleList(this.listQuery)
+        .then(res => {
+          if (res.code !== 0) return
+          this.list = res.data.list
+          console.log(res)
+          this.total = res.data.total
+        })
+        .finally(() => {
+          this.listLoading = false
+        })
+    },
+    // 删除
+    async handleRemove(row) {
+      const text = await this.$confirm('确认删除该文章吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).catch(() => {
+        this.$message.info('已取消操作')
+      })
+      if (text !== 'confirm') return
+      removeArticle({ articleId: row.articleId })
+        .then(res => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList(this.listQuery)
+        })
+    },
+    // 状态改变
+    handleChangeStatus(item) {
+      this.listLoading = true
+      // const params = {
+      //   authId: item.authId,
+      //   status: item.status ? 1 : 0
+      // }
+      console.log(item)
+      const params = {
+        articleId: item.articleId,
+        status: item.status === 1 ? 0 : 1
+      }
+      changeArticleStatus(params).then(res => {
+        // this.$message.success(res.data)
+        this.$message({
+          message: res.data,
+          duration: 500,
+          type: 'success'
+        })
+        this.getList()
+      }).catch(err => {
+        console.log(err)
+      }).finally(() => {
+        this.listLoading = false
+      })
+    },
+    // 表格索引
+    indexMethod(index) {
+      return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
+    },
+    // 编辑视频
+    handleAdd() {},
+    dialogClose() {
+      console.log(123)
+      // this.uploadFileList = []
+      this.$refs.fileUpload.clearAllFiles()
+      this.$refs.dialogForm.resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.filter-container {
+  span {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+    font-size: 14px;
+  }
+  .el-button {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+  }
+  .el-input,
+  .el-select {
+    margin-right: 10px;
+    margin-left: 10px;
+  }
+}
+.el-table .cell {
+  overflow: visible;
+}
+.el-badge {
+  margin: 0 6px;
+}
+</style>