From 0f0c69aa3b93fd9d944af211ae2a155d2ea1318e Mon Sep 17 00:00:00 2001
From: yz_08 <yz_0812@outlook.com>
Date: 星期三, 17 二月 2021 00:55:09 +0800
Subject: [PATCH] 修改云盘智搜-附件管理,后台交互

---
 src/main.js                   |    2 
 src/views/yunpan/zhishou.vue  |   18 ---
 src/views/yunpan/uploadfj.vue |  174 ++++++++++---------------------------------
 3 files changed, 47 insertions(+), 147 deletions(-)

diff --git a/src/main.js b/src/main.js
index 43e27de..905f4c4 100644
--- a/src/main.js
+++ b/src/main.js
@@ -20,6 +20,7 @@
 
 import Selectuser from './views/user/selectuser'
 import Selectdept from './views/user/selectdept'
+import uploadfj from './views/yunpan/uploadfj'
 
 const Plugins = [
   hasPermission,
@@ -37,6 +38,7 @@
 
 Vue.component('Selectuser', Selectuser)
 Vue.component('Selectdept', Selectdept)
+Vue.component('uploadfj', uploadfj)
 
 Vue.prototype.$post = request.post
 Vue.prototype.$get = request.get
diff --git a/src/views/yunpan/uploadfj.vue b/src/views/yunpan/uploadfj.vue
index ba8c917..def10eb 100644
--- a/src/views/yunpan/uploadfj.vue
+++ b/src/views/yunpan/uploadfj.vue
@@ -1,69 +1,7 @@
 <template>
   <div class="zs-main">
-    <el-row class="search-title">
-      <el-col :span="18" class="title">
-        <div class="zs-title">附件管理</div>
-      </el-col>
-      <el-col :span="6" class="search">
-        <el-input
-          v-model="fileName"
-          maxlength="20"
-          minlength="1"
-          clearable
-          placeholder="请输入文件名"
-          show-word-limit
-          style="width:200px"
-        />
-        <el-button type="primary" @click="findFileByFileName()">查询</el-button>
-      </el-col>
-    </el-row>
     <el-container style="background-color: #fff;">
       <el-aside width="210px" style="background-color: #fff;text-align: center;">
-        <el-button class="add-folder-but" @click="dialogFormVisible = true">新增</el-button>
-        <el-button class="add-folder-but" @click="dialogDelVisible = true">删除</el-button>
-        <el-dialog
-          title="提示"
-          :visible.sync="dialogDelVisible"
-          width="20%"
-        >
-          <span>是否删除此目录?</span>
-          <span slot="footer" class="dialog-footer">
-            <el-button @click="dialogDelVisible = false">取 消</el-button>
-            <el-button type="primary" @click="delFolder()">确 定</el-button>
-          </span>
-        </el-dialog>
-
-        <el-dialog
-          title="新增文件夹"
-          :visible.sync="dialogFormVisible"
-          width="25%"
-          class="add-folder"
-        >
-          <el-form ref="folderform" :model="folderform" :rules="rules">
-            <el-form-item
-              label="文件夹名称:"
-              :label-width="formLabelWidth"
-              prop="foldername"
-            >
-              <el-input v-model="folderform.foldername" autocomplete="off" />
-            </el-form-item>
-            <el-form-item label="文件夹排序:" :label-width="formLabelWidth" prop="sort">
-              <el-input-number
-                v-model="folderform.sort"
-                :min="0"
-                :max="100"
-                label="排序"
-              />
-            </el-form-item>
-          </el-form>
-          <div slot="footer" class="dialog-footer">
-            <el-button @click="dialogFormVisible = false">取 消</el-button>
-            <el-button
-              type="primary"
-              @click="addFolderForm('folderform')"
-            >确 定</el-button>
-          </div>
-        </el-dialog>
         <el-timeline>
           <el-timeline-item
             v-for="(activity, index) in activities"
@@ -169,53 +107,64 @@
       fileDate: {
         folderid: 0
       },
-      dialogDelVisible: false,
-      dialogFormVisible: false,
       folderform: {
         foldername: '',
         sort: 0
-      },
-      rules: {
-        foldername: [
-          { required: true, message: '请输入文件夹名称', trigger: 'blur' },
-          { min: 3, max: 10, message: '长度在 3 到 10 个字符', trigger: 'blur' }
-        ],
-        sort: [{ required: true, message: '请输入排序', type: 'number', trigger: 'blur' }]
       },
       formLabelWidth: '100px',
       beforeIndex: 0,
       fileName: '',
       checkedArr: [],
       checkAll: false,
-      activities: [],
+      activities: [{
+        timestamp: '记录截图',
+        color: '#a32c30'
+      }, {
+        timestamp: '照片'
+      }, {
+        timestamp: '劳动合同'
+      }, {
+        timestamp: '身份证'
+      }, {
+        timestamp: '入职表'
+      }, {
+        timestamp: '体检表'
+      }, {
+        timestamp: '回执'
+      }, {
+        timestamp: '银行卡'
+      }, {
+        timestamp: '相关证件'
+      }, {
+        timestamp: '相关合同'
+      }, {
+        timestamp: '请假'
+      }, {
+        timestamp: '处罚'
+      }, {
+        timestamp: '辞职申请'
+      }, {
+        timestamp: '离职手续'
+      }, {
+        timestamp: '自离'
+      }, {
+        timestamp: '社保'
+      }, {
+        timestamp: '失业金'
+      }, {
+        timestamp: '意外险'
+      }, {
+        timestamp: '工伤'
+      }, {
+        timestamp: '劳资'
+      }],
       filesUploadData: [],
       updateNum: 0
     }
   },
   mounted() {
-    // 初始加载
-    this.initFolder()
   },
   methods: {
-    async initFolder() {
-      await this.$get('hr/folder').then(r => {
-        this.activities = []
-        this.beforeIndex = 0
-        r.data.data.forEach((v, i) => {
-          if (i === 0) {
-            this.activities.push({
-              timestamp: v.foldername,
-              id: v.folderid,
-              color: '#a32c30'
-            })
-          } else {
-            this.activities.push({ timestamp: v.foldername, id: v.folderid })
-          }
-        })
-      })
-      var params = { folderid: this.activities[0].id }
-      this.initFile(params)
-    },
     initFile(params) {
       var node = { node: [] }
       // 文件列表置为空
@@ -300,45 +249,6 @@
           this.$set(v, 'isChecked', false)
         })
       }
-    },
-    findFileByFileName() {
-      // 生成查询文件的条件
-      var params = {
-        folderid: this.activities[this.beforeIndex].id,
-        filesname: this.fileName
-      }
-      this.initFile(params)
-    },
-    addFolderForm(formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          this.$post('hr/folder', { ...this.folderform }).then(() => {
-            this.dialogFormVisible = false
-            this.$message({
-              message: this.$t('tips.createSuccess'),
-              type: 'success'
-            })
-            this.folderform.fileName = ''
-            this.folderform.sort = 0
-            // 初始加载
-            this.initFolder()
-          })
-        }
-      })
-    },
-    delFolder() {
-      // 生成查询文件的条件
-      var params = { folderid: this.activities[this.beforeIndex].id }
-      this.$delete('hr/folder', { ...params }).then(() => {
-        this.dialogFormVisible = false
-        this.$message({
-          message: this.$t('tips.deleteSuccess'),
-          type: 'success'
-        })
-        this.dialogDelVisible = false
-        // 初始加载
-        this.initFolder()
-      })
     },
     showFileImg(type) {
       switch (type) {
diff --git a/src/views/yunpan/zhishou.vue b/src/views/yunpan/zhishou.vue
index 0d91990..2580ee3 100644
--- a/src/views/yunpan/zhishou.vue
+++ b/src/views/yunpan/zhishou.vue
@@ -20,19 +20,9 @@
     <el-container style="background-color: #fff;">
       <el-aside width="210px" style="background-color: #fff;text-align: center;">
         <el-button class="add-folder-but" @click="dialogFormVisible = true">新增</el-button>
-        <el-button class="add-folder-but" @click="dialogDelVisible = true">删除</el-button>
-        <el-dialog
-          title="提示"
-          :visible.sync="dialogDelVisible"
-          width="20%"
-        >
-          <span>是否删除此目录?</span>
-          <span slot="footer" class="dialog-footer">
-            <el-button @click="dialogDelVisible = false">取 消</el-button>
-            <el-button type="primary" @click="delFolder()">确 定</el-button>
-          </span>
-        </el-dialog>
-
+        <el-popconfirm title="是否删除此目录?">
+          <el-button class="add-folder-but" @click="delFolder()">删除</el-button>
+        </el-popconfirm>
         <el-dialog
           title="新增文件夹"
           :visible.sync="dialogFormVisible"
@@ -169,7 +159,6 @@
       fileDate: {
         folderid: 0
       },
-      dialogDelVisible: false,
       dialogFormVisible: false,
       folderform: {
         foldername: '',
@@ -335,7 +324,6 @@
           message: this.$t('tips.deleteSuccess'),
           type: 'success'
         })
-        this.dialogDelVisible = false
         // 初始加载
         this.initFolder()
       })

--
Gitblit v1.8.0