xtz 4 years ago
parent
commit
e9d3fef975

+ 1 - 1
.env.production

@@ -2,7 +2,7 @@
 module.exports={
   NODE_ENV = production
   VUE_APP_API = https://api.batterycloud.com.cn
-  VUE_APP_IMG = https://cdn.batterycloud.com.cn
+  VUE_APP_IMG = https://cdn.yc1min.com
   VUE_APP_VER = 0.0.1
   VUE_APP_DAT = new Date().getTime()
   VUE_APP_DOMAIN = info666.com

+ 18 - 17
src/common/api/axios.js

@@ -15,6 +15,7 @@ const whiteList = ['test', 'production']
 const allowList = [ // 文件请求路径数组
   '/admin/export/export2Web'
 ]
+const fileUpload = ['/upload/uploadImg']
 
 const service = axios.create({
   baseURL: process.env.VUE_APP_API + '/admin',
@@ -24,19 +25,20 @@ const service = axios.create({
 
 service.interceptors.request.use(
   config => {
-    // if (allowList.indexOf(config.url) === -1) {
-    let data = {
-      'from': 0,
-      'page': 1,
-      'rows': 10,
-      'companyId': localStorage.getItem('managerid') - 0,
-      'sidx': '',
-      'sord': '',
-      'token': localStorage.getItem('token'),
-      'reqdata': {}
+    console.log(config.url)
+    if (!fileUpload.includes(config.url)) {
+      let data = {
+        'from': 0,
+        'page': 1,
+        'rows': 10,
+        'companyId': localStorage.getItem('managerid') - 0,
+        'sidx': '',
+        'sord': '',
+        'token': localStorage.getItem('token'),
+        'reqdata': {}
+      }
+      config.data = Object.assign(data, config.data)
     }
-    config.data = Object.assign(data, config.data)
-    // }
     loading = Loading.service({
       lock: true,
       text: 'Loading',
@@ -98,11 +100,10 @@ service.interceptors.response.use(
           location.reload()
         }, 100)
       }
-      // if (allowList.indexOf(api) !== -1) {
-      //   loading.close()
-      //   resolve(res.data)
-      // } else {
-      if (res.status === 200) {
+      if (fileUpload.indexOf(api) !== -1) {
+        loading.close()
+        resolve(res.data)
+      } else if (res.status === 200) {
         if (res.data.state !== 100) {
           Message({
             message: res.data.msg,

+ 8 - 8
src/components/vNav/vNav.vue

@@ -45,20 +45,20 @@ export default {
           to: 'formManage'
         },
         {
-          name: '面试问题设置',
-          menuid: 506,
-          to: 'procedureManage'
-        },
-        {
           name: '视频库管理',
           menuid: 507,
           to: 'videoManage'
         },
         {
-          name: '应用场景管理',
-          menuid: 508,
-          to: 'sceneManage'
+          name: '面试问题设置',
+          menuid: 506,
+          to: 'procedureManage'
         },
+        // {
+        //   name: '应用场景管理',
+        //   menuid: 508,
+        //   to: 'sceneManage'
+        // },
         {
           name: '邀约管理',
           menuid: 509,

+ 16 - 13
src/components/wangEnduit/wangEnduit.vue

@@ -1,10 +1,10 @@
 <template lang="html">
-  <div class="editor">
+<div class="editor">
     <div ref="toolbar" class="toolbar">
     </div>
     <div ref="editor" class="text">
     </div>
-  </div>
+</div>
 </template>
 
 <script>
@@ -59,8 +59,8 @@ export default {
       // http://192.168.2.125:8080/admin/storage/create
       this.editor = new E(this.$refs.toolbar, this.$refs.editor)
       this.editor.customConfig.uploadImgShowBase64 = false // base 64 存储图片
-      this.editor.customConfig.uploadImgServer = this.$url + '/platform/upload/platformUploadImg'// 配置服务器端地址
-      this.editor.customConfig.uploadImgHeaders = { }// 自定义 header
+      this.editor.customConfig.uploadImgServer = this.$url + '/admin/upload/uploadImg' // 配置服务器端地址
+      this.editor.customConfig.uploadImgHeaders = {} // 自定义 header
       this.editor.customConfig.uploadFileName = 'file' // 后端接受上传文件的参数名
       this.editor.customConfig.uploadImgMaxSize = 10 * 1024 * 1024 // 将图片大小限制为 10M
       this.editor.customConfig.uploadImgMaxLength = 20 // 限制一次最多上传 20 张图片
@@ -115,7 +115,7 @@ export default {
       let formData = new FormData()
       formData.append('file', files[0])
       let file = Array.from(files)
-      this.$api.post('/platform/upload/platformUploadImg', formData).then(res => {
+      this.$api.post('/upload/uploadImg', formData).then(res => {
         this.loading.close()
         console.log(res, 'upload is finally')
         const img = this.$img + res
@@ -132,21 +132,24 @@ export default {
 </script>
 
 <style lang="css" scoped>
-  .editor {
+.editor {
     width: 100%;
     margin: 0 auto;
     position: relative;
     z-index: 0;
-  }
-  .toolbar {
+}
+
+.toolbar {
     border: 1px solid #ccc;
-  }
-  .text {
+}
+
+.text {
     border: 1px solid #ccc;
     height: 400px;
     width: 100%;
-  }
-  img {
+}
+
+img {
     max-width: 100%;
-  }
+}
 </style>

+ 5 - 4
src/views/candidateManage/statistics.vue

@@ -121,8 +121,8 @@ export default {
         })
         .then((res) => {
           console.log(res)
-          this.timeList = res.object.weekList
-          this.clubRecruit = res.object.countList
+          this.timeList = res.object.weekList || []
+          this.clubRecruit = res.object.countList || []
           this.clubTotal = res.object.countTotal
           this.clubWeek = this.clubRecruit[this.clubRecruit.length - 1]
           this.$api
@@ -133,8 +133,9 @@ export default {
             })
             .then((res) => {
               let arr = []
-              arr.length = this.timeList.indexOf(res.object.weekList[0])
-              this.schoolRecruit = [...arr, ...res.object.countList]
+              let length = this.timeList.indexOf(res.object.weekList && res.object.weekList[0])
+              arr.length = length === -1 ? 0 : length
+              this.schoolRecruit = [...arr, ...(res.object.countList || [])]
               this.schoolTotal = res.object.countTotal
               // console.log(this.schoolTotal)
               this.schoolWeek = this.schoolRecruit[this.schoolRecruit.length - 1]

+ 89 - 90
src/views/companyManage/formManage.vue

@@ -7,50 +7,43 @@
  * @LastEditTime: 2020-08-11 17:27:00
 -->
 <template>
-  <div class="indexPage">
+<div class="indexPage">
     <v-input :btn="btn" :list="list" @add="add"></v-input>
-    <v-table
-      :table="table"
-      :tableList="tableList"
-      :sortType="true"
-      :queryData="queryData"
-      @details="details"
-      @editor="editor"
-      @del="del"
-    ></v-table>
+    <v-table :table="table" :tableList="tableList" :sortType="true" :queryData="queryData" @details="details" @editor="editor" @del="del"></v-table>
     <v-pager @page="callPage" :total="totalrecords"></v-pager>
     <el-dialog :visible.sync="dialogFormVisible" width="650px" :before-close="close" :close-on-click-modal="false">
-      <el-form :model="form" ref="form" label-width="140px" :rules="state!==2 ? rules : {}" label-position="left">
-        <el-form-item label="表单名称" prop="formName">
-          <el-input v-if="state!==2" v-model="form.formName" placeholder="请输入表单名称" autocomplete="off"></el-input>
-          <div v-else>{{form.formName}}</div>
-        </el-form-item>
-        <el-form-item label="说明" prop="formIntroduce">
-          <el-input v-if="state!==2" type="textarea" :rows="4" resize="none" placeholder="请输入说明" v-model="form.formIntroduce"></el-input>
-          <div v-else>{{form.formIntroduce}}</div>
-        </el-form-item>
-        <el-form-item :label="state!==2?'选择需要的表单项':'已选择的表单项'" prop="checkList">
-          <div v-if="state!==2">勾选需要的表单选项,点击生成表单即可</div>
-          <el-checkbox-group v-if="state!==2" v-model="form.checkList">
-            <div v-for="item in formConfigList" :key="item.id" >
-              <el-checkbox :label="item.id">{{item.configName + ' ' + (item.type === 0 ? '单行输入框' : item.type === 1 ? '多行输入框' : '下拉选择框')}}</el-checkbox>
-            </div>
-          </el-checkbox-group>
-          <div v-else>
-            <div v-for="item in formConfigList.filter(i => form.checkList.includes(i.id))" :key="item.id">
-              <el-input class="p10" v-if="item.type === 0" :placeholder="'请输入' + item.configName"></el-input>
-              <el-input class="p10" v-else-if="item.type === 1" type="textarea" :rows="4" resize="none" :placeholder="'请输入' + item.configName"></el-input>
-              <el-select class="p10" v-else :placeholder="'请选择' + item.configName"></el-select>
-            </div>
-          </div>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" v-if="state!==2" @click="determine">生成表单</el-button>
-      </div>
+        <el-form :model="form" ref="form" label-width="140px" :rules="state!==2 ? rules : {}" label-position="left">
+            <el-form-item label="表单名称" prop="formName">
+                <el-input v-if="state!==2" v-model="form.formName" placeholder="请输入表单名称" autocomplete="off"></el-input>
+                <div v-else>{{form.formName}}</div>
+            </el-form-item>
+            <el-form-item label="说明" prop="formIntroduce">
+                <el-input v-if="state!==2" type="textarea" :rows="4" resize="none" placeholder="请输入说明" v-model="form.formIntroduce"></el-input>
+                <div v-else>{{form.formIntroduce}}</div>
+            </el-form-item>
+            <el-form-item :label="state!==2?'选择需要的表单项':'已选择的表单项'" prop="checkList">
+                <div v-if="state!==2">勾选需要的表单选项,点击生成表单即可</div>
+                <el-checkbox-group v-if="state!==2" v-model="form.checkList">
+                    <div v-for="item in formConfigList" :key="item.id">
+                        <el-checkbox :label="item.id">{{item.configName + ' ' + (item.type === 0 ? '单行输入框' : item.type === 1 ? '多行输入框' : '下拉选择框')}}</el-checkbox>
+                    </div>
+                </el-checkbox-group>
+                <div v-else>
+                    <div v-for="item in formConfigList.filter(i => form.checkList.includes(i.id))" :key="item.id">
+                        <div>{{item.configName}}</div>
+                        <el-input class="p10" v-if="item.type === 0" :placeholder="'请输入' + item.configName"></el-input>
+                        <el-input class="p10" v-else-if="item.type === 1" type="textarea" :rows="4" resize="none" :placeholder="'请输入' + item.configName"></el-input>
+                        <el-select class="p10" v-else :placeholder="'请选择' + item.configName"></el-select>
+                    </div>
+                </div>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" v-if="state!==2" @click="determine">生成表单</el-button>
+        </div>
     </el-dialog>
-  </div>
+</div>
 </template>
 
 <script>
@@ -77,55 +70,56 @@ export default {
       totalrecords: 0,
       pickList: [],
       rules: {
-        formName: [
-          { required: true, message: '请选择活动区域', trigger: 'blur' }
-        ],
-        formIntroduce: [
-          { required: true, message: '请选择活动区域', trigger: 'blur' }
-        ],
-        checkList: [
-          { validator: validcodeName, trigger: 'blur' }
-        ]
+        formName: [{
+          required: true,
+          message: '请选择活动区域',
+          trigger: 'blur'
+        }],
+        formIntroduce: [{
+          required: true,
+          message: '请选择活动区域',
+          trigger: 'blur'
+        }],
+        checkList: [{
+          validator: validcodeName,
+          trigger: 'blur'
+        }]
       },
       list: [],
-      btn: [
+      btn: [{
+        name: '添加',
+        type: 'success',
+        method: 'add'
+      }],
+      table: {
+        column: [{
+          label: '编号',
+          props: 'id'
+        },
         {
-          name: '添加',
-          type: 'success',
-          method: 'add'
+          label: '表单名称',
+          props: 'formName'
+        },
+        {
+          label: '说明',
+          props: 'formIntroduce'
         }
-      ],
-      table: {
-        column: [
-          {
-            label: '编号',
-            props: 'id'
-          },
-          {
-            label: '表单名称',
-            props: 'formName'
-          },
-          {
-            label: '说明',
-            props: 'formIntroduce'
-          }
         ],
-        handle: [
-          {
-            title: '查看',
-            method: 'details',
-            type: 'info'
-          },
-          {
-            title: '编辑',
-            method: 'editor',
-            type: 'warning'
-          },
-          {
-            title: '删除',
-            method: 'del',
-            type: 'danger'
-          }
+        handle: [{
+          title: '查看',
+          method: 'details',
+          type: 'info'
+        },
+        {
+          title: '编辑',
+          method: 'editor',
+          type: 'warning'
+        },
+        {
+          title: '删除',
+          method: 'del',
+          type: 'danger'
+        }
         ]
       }
     }
@@ -164,7 +158,9 @@ export default {
       this.state = 0
     },
     getDetails (row) {
-      let reqdata = { id: row.id }
+      let reqdata = {
+        id: row.id
+      }
       this.$api
         .post('/form/queryFormDetail', {
           reqdata
@@ -189,7 +185,9 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let reqdata = { id: row.id }
+        let reqdata = {
+          id: row.id
+        }
         this.$api
           .post('/form/deleteForm', {
             reqdata
@@ -260,12 +258,13 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-  .dialog-footer {
+.dialog-footer {
     display: flex;
     justify-content: center;
     align-items: center;
-  }
-  .p10 {
+}
+
+.p10 {
     padding: 8px;
-  }
+}
 </style>

+ 100 - 92
src/views/companyManage/positionInfo.vue

@@ -7,49 +7,34 @@
  * @LastEditTime: 2020-08-15 11:18:19
 -->
 <template>
-  <div class="indexPage">
+<div class="indexPage">
     <v-input :btn="btn" :list="list" @add="add"></v-input>
-    <v-table
-      :table="table"
-      :tableList="tableList"
-      :sortType="true"
-      :queryData="queryData"
-      @details="details"
-      @editor="editor"
-      @del="del"
-    ></v-table>
+    <v-table :table="table" :tableList="tableList" :sortType="true" :queryData="queryData" @details="details" @editor="editor" @del="del"></v-table>
     <v-pager @page="callPage" :total="totalrecords"></v-pager>
     <el-dialog width="600px" :visible.sync="dialogFormVisible" :before-close="close" :close-on-click-modal="false">
-      <el-form :model="form" ref="form" label-width="140px" :rules="rules" label-position="left">
-        <el-form-item label="职位名称" prop="positionName">
-          <el-input v-if="state!==2" v-model="form.positionName" placeholder="请输入职位名称" autocomplete="off"></el-input>
-          <div v-else>{{form.positionName}}</div>
-        </el-form-item>
-        <el-form-item label="职位描述" prop="positionIntroduce">
-          <el-input
-            v-if="state!==2"
-            type="textarea"
-            :rows="4"
-            resize="none"
-            placeholder="请输入内容"
-            v-model="form.positionIntroduce"
-          ></el-input>
-          <div v-else>{{form.positionIntroduce}}</div>
-        </el-form-item>
-        <el-form-item label="职位状态" prop="isDisable">
-          <el-radio-group v-if="state!==2" v-model="form.isDisable">
-            <el-radio :label="0">启用</el-radio>
-            <el-radio :label="1">禁用</el-radio>
-          </el-radio-group>
-          <div v-else>{{['启用', '禁用'][form.isDisable]}}</div>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" v-if="state!==2" @click="determine">确 定</el-button>
-      </div>
+        <el-form :model="form" ref="form" label-width="140px" :rules="rules" label-position="left">
+            <el-form-item label="职位名称" prop="positionName">
+                <el-input v-if="state!==2" v-model="form.positionName" placeholder="请输入职位名称" autocomplete="off"></el-input>
+                <div v-else>{{form.positionName}}</div>
+            </el-form-item>
+            <el-form-item label="职位描述" prop="positionIntroduce">
+                <el-input v-if="state!==2" type="textarea" :rows="4" resize="none" placeholder="请输入内容" v-model="form.positionIntroduce"></el-input>
+                <div v-else>{{form.positionIntroduce}}</div>
+            </el-form-item>
+            <el-form-item label="职位状态" prop="isDisable">
+                <el-radio-group v-if="state!==2" v-model="form.isDisable">
+                    <el-radio :label="0">启用</el-radio>
+                    <el-radio :label="1">禁用</el-radio>
+                </el-radio-group>
+                <div v-else>{{['启用', '禁用'][form.isDisable]}}</div>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" v-if="state!==2" @click="determine">确 定</el-button>
+        </div>
     </el-dialog>
-  </div>
+</div>
 </template>
 
 <script>
@@ -68,54 +53,62 @@ export default {
       state: 0,
       pickList: [],
       rules: {
-        positionName: [{ required: true, message: '请填写职位名称', trigger: 'change' }],
-        positionIntroduce: [{ required: true, message: '请填写职位描述', trigger: 'change' }],
-        isDisable: [{ required: true, message: '请选择职位状态', trigger: 'change' }]
+        positionName: [{
+          required: true,
+          message: '请填写职位名称',
+          trigger: 'change'
+        }],
+        positionIntroduce: [{
+          required: true,
+          message: '请填写职位描述',
+          trigger: 'change'
+        }],
+        isDisable: [{
+          required: true,
+          message: '请选择职位状态',
+          trigger: 'change'
+        }]
       },
       list: [],
-      btn: [
+      btn: [{
+        name: '添加',
+        type: 'success',
+        method: 'add'
+      }],
+      table: {
+        column: [{
+          label: '编号',
+          props: 'id'
+        },
+        {
+          label: '职位名称',
+          props: 'positionName'
+        },
         {
-          name: '添加',
-          type: 'success',
-          method: 'add'
+          label: '职位描述',
+          props: 'positionIntroduce'
+        },
+        {
+          label: '职位状态',
+          props: 'isDisable',
+          options: ['有效', '禁用']
         }
-      ],
-      table: {
-        column: [
-          {
-            label: '编号',
-            props: 'id'
-          },
-          {
-            label: '职位名称',
-            props: 'positionName'
-          },
-          {
-            label: '职位描述',
-            props: 'positionIntroduce'
-          },
-          {
-            label: '职位状态',
-            props: 'isDisable',
-            options: ['有效', '禁用']
-          }
         ],
-        handle: [
-          {
-            title: '查看',
-            method: 'details',
-            type: 'info'
-          },
-          {
-            title: '编辑',
-            method: 'editor',
-            type: 'warning'
-          },
-          {
-            title: '删除',
-            method: 'del',
-            type: 'danger'
-          }
+        handle: [{
+          title: '查看',
+          method: 'details',
+          type: 'info'
+        },
+        {
+          title: '编辑',
+          method: 'editor',
+          type: 'warning'
+        },
+        {
+          title: '删除',
+          method: 'del',
+          type: 'danger'
+        }
         ]
       }
     }
@@ -143,7 +136,9 @@ export default {
       this.state = 0
     },
     getDetails (row) {
-      let reqdata = { id: row.id }
+      let reqdata = {
+        id: row.id
+      }
       this.$api
         .post('/position/queryPositionDetail', {
           reqdata
@@ -162,13 +157,26 @@ export default {
       this.state = 1
     },
     del (row) {
-      this.$api
-        .post('/position/deletePosition', {
-          reqdata: { id: row.id }
-        })
-        .then((res) => {
-          this.queryData()
+      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$api
+          .post('/position/deletePosition', {
+            reqdata: {
+              id: row.id
+            }
+          })
+          .then((res) => {
+            this.queryData()
+          })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
         })
+      })
     },
     determine () {
       let a
@@ -217,8 +225,8 @@ export default {
 
 <style lang="scss" scoped>
 .dialog-footer {
-  display: flex;
-  justify-content: center;
-  align-items: center;
+    display: flex;
+    justify-content: center;
+    align-items: center;
 }
 </style>

+ 83 - 72
src/views/companyManage/sceneManage.vue

@@ -7,35 +7,27 @@
  * @LastEditTime: 2020-08-11 15:48:44
 -->
 <template>
-  <div class="indexPage">
+<div class="indexPage">
     <v-input :btn="btn" :list="list" @add="add"></v-input>
-    <v-table
-      :table="table"
-      :tableList="tableList"
-      :sortType="true"
-      :queryData="queryData"
-      @details="details"
-      @editor="editor"
-      @del="del"
-    ></v-table>
+    <v-table :table="table" :tableList="tableList" :sortType="true" :queryData="queryData" @details="details" @editor="editor" @del="del"></v-table>
     <v-pager @page="callPage" :total="totalrecords"></v-pager>
     <el-dialog :visible.sync="dialogFormVisible" width="650px" :before-close="close" :close-on-click-modal="false">
-      <el-form :model="form" ref="form" label-width="140px" :rules="rules" label-position="left">
-        <el-form-item label="场景名称" prop="sceneName">
-          <el-input v-if="state!==2" v-model="form.sceneName" placeholder="请输入场景名称" autocomplete="off"></el-input>
-          <div v-else>{{form.sceneName}}</div>
-        </el-form-item>
-        <el-form-item label="场景描述" prop="sceneIntroduce">
-          <el-input v-if="state!==2" type="textarea" :rows="4" resize="none" placeholder="请输入场景描述" v-model="form.sceneIntroduce"></el-input>
-          <div v-else>{{form.sceneIntroduce}}</div>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" v-if="state!==2" @click="determine">确 定</el-button>
-      </div>
+        <el-form :model="form" ref="form" label-width="140px" :rules="rules" label-position="left">
+            <el-form-item label="场景名称" prop="sceneName">
+                <el-input v-if="state!==2" v-model="form.sceneName" placeholder="请输入场景名称" autocomplete="off"></el-input>
+                <div v-else>{{form.sceneName}}</div>
+            </el-form-item>
+            <el-form-item label="场景描述" prop="sceneIntroduce">
+                <el-input v-if="state!==2" type="textarea" :rows="4" resize="none" placeholder="请输入场景描述" v-model="form.sceneIntroduce"></el-input>
+                <div v-else>{{form.sceneIntroduce}}</div>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" v-if="state!==2" @click="determine">确 定</el-button>
+        </div>
     </el-dialog>
-  </div>
+</div>
 </template>
 
 <script>
@@ -50,48 +42,52 @@ export default {
       state: 0,
       pickList: [],
       rules: {
-        sceneName: [{ required: true, message: '请输入场景名称', trigger: 'blur' }],
-        sceneIntroduce: [{ required: true, message: '请输入场景描述', trigger: 'blur' }]
+        sceneName: [{
+          required: true,
+          message: '请输入场景名称',
+          trigger: 'blur'
+        }],
+        sceneIntroduce: [{
+          required: true,
+          message: '请输入场景描述',
+          trigger: 'blur'
+        }]
       },
       list: [],
-      btn: [
+      btn: [{
+        name: '添加',
+        type: 'success',
+        method: 'add'
+      }],
+      table: {
+        column: [{
+          label: '编号',
+          props: 'id'
+        },
+        {
+          label: '场景名称',
+          props: 'sceneName'
+        },
         {
-          name: '添加',
-          type: 'success',
-          method: 'add'
+          label: '场景描述',
+          props: 'sceneIntroduce'
         }
-      ],
-      table: {
-        column: [
-          {
-            label: '编号',
-            props: 'id'
-          },
-          {
-            label: '场景名称',
-            props: 'sceneName'
-          },
-          {
-            label: '场景描述',
-            props: 'sceneIntroduce'
-          }
         ],
-        handle: [
-          {
-            title: '查看',
-            method: 'details',
-            type: 'info'
-          },
-          {
-            title: '编辑',
-            method: 'editor',
-            type: 'warning'
-          },
-          {
-            title: '删除',
-            method: 'del',
-            type: 'danger'
-          }
+        handle: [{
+          title: '查看',
+          method: 'details',
+          type: 'info'
+        },
+        {
+          title: '编辑',
+          method: 'editor',
+          type: 'warning'
+        },
+        {
+          title: '删除',
+          method: 'del',
+          type: 'danger'
+        }
         ]
       }
     }
@@ -119,7 +115,9 @@ export default {
       this.state = 0
     },
     getDetails (row) {
-      let reqdata = { id: row.id }
+      let reqdata = {
+        id: row.id
+      }
       this.$api
         .post('/scene/querySceneDetail', {
           reqdata
@@ -138,14 +136,27 @@ export default {
       this.state = 1
     },
     del (row) {
-      let reqdata = { id: row.id }
-      this.$api
-        .post('/scene/deleteScene', {
-          reqdata
-        })
-        .then((res) => {
-          this.queryData()
+      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let reqdata = {
+          id: row.id
+        }
+        this.$api
+          .post('/scene/deleteScene', {
+            reqdata
+          })
+          .then((res) => {
+            this.queryData()
+          })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
         })
+      })
     },
     determine () {
       let a
@@ -189,9 +200,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-  .dialog-footer {
+.dialog-footer {
     display: flex;
     justify-content: center;
     align-items: center;
-  }
+}
 </style>

+ 20 - 9
src/views/companyManage/templateManage.vue

@@ -271,16 +271,27 @@ export default {
       this.state = 1
     },
     del (row) {
-      let reqdata = {
-        id: row.id
-      }
-      this.$api
-        .post('/template/deleteTemplate', {
-          reqdata
-        })
-        .then((res) => {
-          this.queryData()
+      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let reqdata = {
+          id: row.id
+        }
+        this.$api
+          .post('/template/deleteTemplate', {
+            reqdata
+          })
+          .then((res) => {
+            this.queryData()
+          })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
         })
+      })
     },
     determine () {
       let a

+ 88 - 84
src/views/companyManage/videoManage.vue

@@ -7,49 +7,32 @@
  * @LastEditTime: 2020-08-11 15:45:22
 -->
 <template>
-  <div class="indexPage">
+<div class="indexPage">
     <v-input :btn="btn" :list="list" @add="add"></v-input>
-    <v-table
-      :table="table"
-      :tableList="tableList"
-      :sortType="true"
-      :queryData="queryData"
-      @details="details"
-      @editor="editor"
-      @del="del"
-    ></v-table>
+    <v-table :table="table" :tableList="tableList" :sortType="true" :queryData="queryData" @details="details" @editor="editor" @del="del"></v-table>
     <v-pager @page="callPage" :total="totalrecords"></v-pager>
     <el-dialog width="650px" :visible.sync="dialogFormVisible" :before-close="close" :close-on-click-modal="false">
-      <el-form :model="form" ref="form" label-width="100px" :rules="state !== 2 ? rules : {}" label-position="left">
-        <el-form-item label="视频名称" prop="videoName">
-          <el-input v-if="state!==2" v-model="form.videoName" placeholder="请输入视频名称" autocomplete="off"></el-input>
-          <div v-else>{{form.videoName}}</div>
-        </el-form-item>
-        <el-form-item prop="videoPath">
-          <el-upload
-            class="upload-demo"
-            drag
-            v-if="state!==2"
-            :action="$url+'/upload/uploadVideo'"
-            accept=".MP4,.mp4"
-            :show-file-list="false"
-            :on-success="handleAvatarSuccess"
-            :before-upload="beforeAvatarUpload"
-            multiple>
-            <video v-if="form.videoPath" width="500" :src="$img+form.videoPath" class="avatar"></video>
-            <i class="el-icon-upload"></i>
-            <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em>,限mp4格式</div>
-            <!-- <div class="el-upload__tip" slot="tip"></div> -->
-          </el-upload>
-          <video v-else width="400" controls :src="$img+form.videoPath" class="avatar"></video>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" v-if="state!==2" @click="determine">确 定</el-button>
-      </div>
+        <el-form :model="form" ref="form" label-width="100px" :rules="state !== 2 ? rules : {}" label-position="left">
+            <el-form-item label="视频名称" prop="videoName">
+                <el-input v-if="state!==2" v-model="form.videoName" placeholder="请输入视频名称" autocomplete="off"></el-input>
+                <div v-else>{{form.videoName}}</div>
+            </el-form-item>
+            <el-form-item prop="videoPath">
+                <el-upload class="upload-demo" drag v-if="state!==2" :headers="{Authorization:token}" :action="$url+'/admin/upload/uploadVideo'" accept=".MP4,.mp4" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" multiple>
+                    <video v-if="form.videoPath" width="500" :src="$img+form.videoPath" class="avatar"></video>
+                    <i class="el-icon-upload"></i>
+                    <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em>,限mp4格式</div>
+                    <!-- <div class="el-upload__tip" slot="tip"></div> -->
+                </el-upload>
+                <video v-else width="400" controls :src="$img+form.videoPath" class="avatar"></video>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" v-if="state!==2" @click="determine">确 定</el-button>
+        </div>
     </el-dialog>
-  </div>
+</div>
 </template>
 
 <script>
@@ -57,6 +40,7 @@ export default {
   data () {
     return {
       tableList: [],
+      token: localStorage.getItem('token'),
       dialogFormVisible: false,
       form: {
         videoName: '',
@@ -68,44 +52,48 @@ export default {
       url: '',
       pickList: [],
       rules: {
-        videoName: [{ required: true, message: '请输入视频名称', trigger: 'blur' }],
-        videoPath: [{ required: true, message: '请上传视频', trigger: 'blur' }]
+        videoName: [{
+          required: true,
+          message: '请输入视频名称',
+          trigger: 'blur'
+        }],
+        videoPath: [{
+          required: true,
+          message: '请上传视频',
+          trigger: 'blur'
+        }]
       },
       list: [],
-      btn: [
+      btn: [{
+        name: '添加',
+        type: 'success',
+        method: 'add'
+      }],
+      table: {
+        column: [{
+          label: '编号',
+          props: 'id'
+        },
         {
-          name: '添加',
-          type: 'success',
-          method: 'add'
+          label: '视频名称',
+          props: 'videoName'
         }
-      ],
-      table: {
-        column: [
-          {
-            label: '编号',
-            props: 'id'
-          },
-          {
-            label: '视频名称',
-            props: 'videoName'
-          }
         ],
-        handle: [
-          {
-            title: '查看',
-            method: 'details',
-            type: 'info'
-          },
-          {
-            title: '编辑',
-            method: 'editor',
-            type: 'warning'
-          },
-          {
-            title: '删除',
-            method: 'del',
-            type: 'danger'
-          }
+        handle: [{
+          title: '查看',
+          method: 'details',
+          type: 'info'
+        },
+        {
+          title: '编辑',
+          method: 'editor',
+          type: 'warning'
+        },
+        {
+          title: '删除',
+          method: 'del',
+          type: 'danger'
+        }
         ]
       }
     }
@@ -134,7 +122,9 @@ export default {
     },
     getDetails (row) {
       console.log(row)
-      let reqdata = { id: row.id }
+      let reqdata = {
+        id: row.id
+      }
       this.$api
         .post('/video/queryVideoDetail', {
           reqdata
@@ -153,14 +143,27 @@ export default {
       this.state = 1
     },
     del (row) {
-      let reqdata = { id: row.id }
-      this.$api
-        .post('/video/deleteVideo', {
-          reqdata
-        })
-        .then((res) => {
-          this.queryData()
+      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let reqdata = {
+          id: row.id
+        }
+        this.$api
+          .post('/video/deleteVideo', {
+            reqdata
+          })
+          .then((res) => {
+            this.queryData()
+          })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
         })
+      })
     },
     determine () {
       let a
@@ -210,13 +213,14 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-  .dialog-footer {
+.dialog-footer {
     display: flex;
     justify-content: center;
     align-items: center;
-  }
-  .avatar {
+}
+
+.avatar {
     width: 100%;
     display: block;
-  }
+}
 </style>