| | |
| | | <template> |
| | | <div class="zs-main"> |
| | | <div class="zs-main fj-upload"> |
| | | <el-row class="search-title"> |
| | | <el-col :span="18" class="title"> |
| | | <div class="zs-title">上传附件</div> |
| | |
| | | clearable |
| | | placeholder="请输入文件名" |
| | | show-word-limit |
| | | style="width:200px" |
| | | style="width:280px;margin-right: 10px" |
| | | /> |
| | | <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;"> |
| | | <h4>{{ rowitem.empName }}:{{ rowitem.deptName }}</h4> |
| | | <el-timeline> |
| | | <el-aside width="210px" style="background-color: #fff;padding: 0 24px;text-align: center;height: 88vh;overflow: auto"> |
| | | <span style="font-size: 18px;font-weight: 700;">{{ rowitem.empName }}:{{ rowitem.deptName }}</span> |
| | | <el-timeline style="margin-top: 10px"> |
| | | <el-timeline-item |
| | | v-for="(activity, index) in activities" |
| | | :key="index" |
| | |
| | | > |
| | | <span |
| | | style="position: relative; top: -5px;" |
| | | @click="clickTimeline(index, activity.id)" |
| | | @click="clickTimeline(index)" |
| | | > |
| | | {{ activity.timestamp }}</span> |
| | | </el-timeline-item> |
| | | </el-timeline> |
| | | </el-aside> |
| | | <el-container> |
| | | <el-container style="height: 88vh;"> |
| | | <el-header class="text-header"> |
| | | <el-row><el-col :span="24"> |
| | | <i |
| | | class="el-icon-bell" |
| | | style=" color: #a32c30; margin-right: 10px;" |
| | | />提示:文件不要超过10个,单个文件大小不超过50M,单击或者拖动文件到下面区域,支持单个或批量文件的上传。</el-col> |
| | | style="color: #a32c30; margin-right: 10px;" |
| | | />提示:文件不要超过10个,单个文件大小不超过100M,单击或者拖动文件到下面区域,支持单个或批量文件的上传。</el-col> |
| | | </el-row> |
| | | <el-row style="background-color: rgba(0,0,0,0.2);"> |
| | | <el-col :span="16"> |
| | |
| | | >下载</el-button> |
| | | <el-button |
| | | type="primary" |
| | | class="pri-del-btn" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="delFile()" |
| | | >删除</el-button> |
| | | <el-popconfirm title="是否移动附件?" @onConfirm="mvdialogFormVisible = true"> |
| | | <el-button slot="reference" class="hr-but" type="danger">转存</el-button> |
| | | <el-button slot="reference" type="danger">转存</el-button> |
| | | </el-popconfirm> |
| | | <el-button type="warning" @click="openUpdateFileName()">重命名</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-header> |
| | | <el-dialog title="修改文件名" :visible.sync="updateFileNameFormVisible" append-to-body width="20%"> |
| | | <el-form ref="updateFileName" :model="file" :rules="mvrules"> |
| | | <el-form-item label="文件名" :label-width="formLabelWidth" prop="fileName"> |
| | | <el-input v-model="file.fileName" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="updateFileNameFormVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="updateFileName('updateFileName')">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="移动文件" |
| | | :visible.sync="mvdialogFormVisible" |
| | |
| | | <el-main style="background-color: #fff;"> |
| | | <el-row v-for="(data, index) in filesUploadData" :key="index"> |
| | | <template v-for="(node, nodeIndex) in data.node"> |
| | | <el-col v-if="node.isUpload === false" :key="node.filesid" :span="3"> |
| | | <el-col v-if="node.isUpload === false" :key="node.accessoryid" :span="3"> |
| | | <el-card |
| | | shadow="never" |
| | | @click.native="clickCard(index * 8 + nodeIndex)" |
| | | > |
| | | <img |
| | | <el-image |
| | | v-if="'tif,bmp,jpg,png,gif'.indexOf(node.filesformat) == -1" |
| | | :src="showFileImg(node.filesformat)" |
| | | class="uploading-image" |
| | | > |
| | | <el-tooltip class="item" effect="dark" :content="node.filesname" placement="bottom"> |
| | | <div style="padding-top: 14px;"> |
| | | :preview-src-list="srcList" |
| | | @click="clickImg(node)" |
| | | /> |
| | | <el-tooltip v-if="'tif,bmp,jpg,png,gif'.indexOf(node.filesformat) == -1" class="item" effect="dark" :content="node.filesname" placement="bottom"> |
| | | <div style="padding-top: 14px;text-align: center"> |
| | | <el-checkbox v-model="checkedArr[index * 8 + nodeIndex].isChecked" class="myRedCheckBox">{{ node.filesname }}</el-checkbox> |
| | | </div> |
| | | </el-tooltip> |
| | | <el-tooltip v-if="'tif,bmp,jpg,png,gif'.indexOf(node.filesformat) != -1" class="item" effect="dark" :content="node.filesname" placement="bottom"> |
| | | <div style="padding-top: 14px;"> |
| | | <el-image |
| | | style="width: 100px; height: 80px;margin-top: -10px;" |
| | | :src="getImg+node.accessoryid" |
| | | :preview-src-list="srcList" |
| | | @click="clickImg(node)" |
| | | /> |
| | | <br> |
| | | <el-checkbox v-model="checkedArr[index * 8 + nodeIndex].isChecked" class="myRedCheckBox"> |
| | | |
| | | {{ node.filesname }} |
| | | </el-checkbox> |
| | | </div> |
| | | </el-tooltip> |
| | | </el-card> |
| | |
| | | rowitem: { |
| | | type: Object, |
| | | required: true |
| | | }, |
| | | tableindex: { |
| | | type: Number, |
| | | required: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | srcList: [], |
| | | getImg: pages.getAccessoryImage, |
| | | updateFileNameFormVisible: false, |
| | | file: { |
| | | fileName: '' |
| | | }, |
| | | mvrules: { |
| | | labelid: [{ required: true, message: '请选择标签', trigger: 'change' }] |
| | | labelid: [{ required: true, message: '请选择标签', trigger: 'change' }], |
| | | fileName: [ |
| | | { required: true, message: '请输入文件名称', trigger: 'blur' }, |
| | | { min: 3, max: 50, message: '长度在 3 到 50 个字符', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | mvdialogFormVisible: false, |
| | | uploadSinglePath: pages.uploadSinglePath, |
| | |
| | | }, |
| | | mounted() { |
| | | this.initlabel() |
| | | setTimeout(() => { |
| | | this.clickTimeline(this.tableindex) |
| | | }, 1500) |
| | | }, |
| | | methods: { |
| | | clickImg(node) { |
| | | this.srcList = [] |
| | | if ('tif,bmp,jpg,png,gif'.indexOf(node.filesformat) >= 0) { |
| | | this.srcList.push(this.getImg + node.accessoryid) |
| | | } |
| | | }, |
| | | updateFileName(formName) { |
| | | this.$refs[formName].validate(valid => { |
| | | if (valid) { |
| | | var checke = '' |
| | | this.checkedArr.forEach((v, i) => { |
| | | if (v.isChecked) { |
| | | checke = v.accessoryid |
| | | } |
| | | }) |
| | | // 生成查询文件的条件 |
| | | var params = { accessoryid: checke, filesname: this.file.fileName } |
| | | this.$put('hr/empAccessory', { ...params }).then(() => { |
| | | this.$message({ |
| | | message: '重命名成功!', |
| | | type: 'success' |
| | | }) |
| | | this.file.fileName = '' |
| | | this.updateFileNameFormVisible = false |
| | | // 生成查询文件的条件 |
| | | var initFileParams = { |
| | | labelid: this.activities[this.beforeIndex].id, |
| | | filesname: this.fileName, |
| | | empid: this.rowitem.empId |
| | | } |
| | | this.initFile(initFileParams) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | openUpdateFileName() { |
| | | var checke = [] |
| | | this.checkedArr.forEach((v, i) => { |
| | | if (v.isChecked) { |
| | | checke.push(v.filesid) |
| | | } |
| | | }) |
| | | |
| | | if (checke.length <= 0) { |
| | | this.$message({ |
| | | message: '请选择一个需要重命名的文件!', |
| | | type: 'warning' |
| | | }) |
| | | } else { |
| | | this.updateFileNameFormVisible = true |
| | | } |
| | | }, |
| | | async initlabel() { |
| | | await this.$get('hr/label').then(r => { |
| | | this.activities = [] |
| | |
| | | } |
| | | }) |
| | | }, |
| | | clickTimeline(index, id) { |
| | | clickTimeline(index) { |
| | | // 不这样操作的不会响应式更新 |
| | | // 赋值到新的列表 |
| | | var list = this.activities |
| | |
| | | }, |
| | | showFileImg(type) { |
| | | switch (type) { |
| | | case 'xls': |
| | | return require('../../assets/uploading/xls.png') |
| | | case 'xlsx': |
| | | return require('../../assets/uploading/xls.png') |
| | | case 'txt': |
| | | return require('../../assets/uploading/txt.png') |
| | | case 'apk': |
| | |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | this.fileDate.labelid = this.activities[this.beforeIndex].id |
| | | const isLt50M = file.size / 1024 / 1024 < 50 |
| | | const isLt50M = file.size / 1024 / 1024 < 100 |
| | | if (!isLt50M) { |
| | | this.$message.error('上传文件不能超过 50MB!') |
| | | this.$message.error('上传文件不能超过 100MB!') |
| | | } |
| | | return isLt50M |
| | | }, |
| | |
| | | } |
| | | } |
| | | .add-folder-but { |
| | | background: #fff !important; |
| | | color: #a32c30 !important; |
| | | background: #a32c30 !important; |
| | | color: #fff !important; |
| | | margin-bottom: 20px; |
| | | } |
| | | padding: 0 15px 0 15px; |
| | |
| | | line-height: 60px; |
| | | } |
| | | .uploading-image { |
| | | width: 100%; |
| | | height: 100%; |
| | | width: 45%; |
| | | height: 45%; |
| | | display: block; |
| | | margin: 0 auto; |
| | | } |
| | | } |
| | | |
| | | .fj-upload .el-timeline-item { |
| | | padding-bottom: 1px; |
| | | } |
| | | .el-timeline-item__timestamp { |
| | | font-size: 15px; |
| | | color: #000; |
| | |
| | | /* 设置鼠标经过对勾框,对勾框边框的颜色 */ |
| | | .myRedCheckBox .el-checkbox__inner:hover { |
| | | border-color: #a32c30; |
| | | } |
| | | .myRedCheckBox .el-checkbox__label { |
| | | overflow: hidden; |
| | | text-overflow:ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | .myRedCheckBox .el-checkbox__input { |
| | | vertical-align: text-top; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload { |
| | |
| | | width: 100px; |
| | | height: 100px; |
| | | } |
| | | |
| | | .el-image .el-image-viewer__mask { |
| | | background-color: #fff !important; |
| | | opacity: 1; |
| | | } |
| | | </style> |
| | | <style lang="scss" scoped> |
| | | .el-main { |
| | |
| | | .el-input-number { |
| | | width: 100%; |
| | | } |
| | | .pri-del-btn { |
| | | background-color: rgb(64, 158, 255); |
| | | border-color: rgb(64, 158, 255); |
| | | } |
| | | |
| | | </style> |