|
|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<el-card shadow="never" class="aui-card--fill"> |
|
|
|
<el-card shadow="never" class="aui-card--fill" v-loading="pageloading"> |
|
|
|
<div class="mod-__masteruserrelation}"> |
|
|
|
<el-form label-width="500px" label-position="left" :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :disabled="pageDisabled"> |
|
|
|
<div v-for="(item, index) in this.dataForm.totalConfigList" :key="index"> |
|
|
|
@ -51,6 +51,22 @@ |
|
|
|
</el-dialog> |
|
|
|
<div><font color="gray">1~9张图</font></div> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px"> |
|
|
|
<el-upload |
|
|
|
class="upload-demo" |
|
|
|
:action="uploadUrl" |
|
|
|
:before-remove="beforeFileRemove" |
|
|
|
:file-list="dataForm.files" |
|
|
|
:before-upload="beforeAvatarFileUpload" |
|
|
|
:on-remove="handleFileRemove" |
|
|
|
:on-success="handleAvatarFileSuccess" |
|
|
|
:on-error="handelError" |
|
|
|
:on-preview="handleFileCardPreview" |
|
|
|
style="width:480px"> |
|
|
|
<el-button size="small">点击上传</el-button> |
|
|
|
<div slot="tip" class="el-upload__tip">支持.word、PDF、Excel文件</div> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form> |
|
|
|
<el-form-item style="margin-left:35px;"> |
|
|
|
@ -76,6 +92,7 @@ export default { |
|
|
|
content: '', |
|
|
|
state: '', |
|
|
|
images: [], |
|
|
|
files: [], |
|
|
|
totalConfigList: [] |
|
|
|
}, |
|
|
|
isShowArr: [ |
|
|
|
@ -88,8 +105,10 @@ export default { |
|
|
|
pageDisabled: false, |
|
|
|
uploadUrl: '', |
|
|
|
loading: false, |
|
|
|
fileloading: false, |
|
|
|
dialogImageUrl: '', |
|
|
|
dialogVisible: false |
|
|
|
dialogVisible: false, |
|
|
|
pageloading: true |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -102,16 +121,12 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created: function () { |
|
|
|
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` |
|
|
|
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}` |
|
|
|
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}` |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.pageDisabled = this.$route.query.disabled |
|
|
|
this.hideUpload = this.$route.query.disabled |
|
|
|
// if (this.$route.query.id !== '' && this.$route.query.id != null) { |
|
|
|
// this.dataForm.id = this.$route.query.id |
|
|
|
// this.getInfo() |
|
|
|
// } |
|
|
|
this.getFormDataInfo() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -150,6 +165,7 @@ export default { |
|
|
|
}, |
|
|
|
handelError () { |
|
|
|
this.loading = false |
|
|
|
this.fileloading = false |
|
|
|
this.isAble = false |
|
|
|
this.$message.error('上传文件失败!') |
|
|
|
}, |
|
|
|
@ -166,28 +182,40 @@ export default { |
|
|
|
this.dialogImageUrl = file.url |
|
|
|
this.dialogVisible = true |
|
|
|
}, |
|
|
|
// ----------文件上传下载---------- |
|
|
|
handleFileCardPreview (file) { |
|
|
|
window.location.href = `${window.SITE_CONFIG['apiURL']}/oss/file/download?fileUrl=${file.url}` |
|
|
|
// window.location.href = `http://219.146.91.110:10000/epdc-api/oss/file/download?fileUrl=${file.url}` |
|
|
|
}, |
|
|
|
beforeFileRemove (file, fileList) { |
|
|
|
return this.$confirm(`确定移除${file.name}?`) |
|
|
|
}, |
|
|
|
handleAvatarFileSuccess (res, file) { |
|
|
|
this.fileloading = false |
|
|
|
this.isAble = false |
|
|
|
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName, name: res.data.fileName }) |
|
|
|
}, |
|
|
|
handleFileRemove (file, fileList) { |
|
|
|
for (var i = 0; i < this.dataForm.files.length; i++) { |
|
|
|
let item = this.dataForm.files[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.dataForm.files.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
beforeAvatarFileUpload (file) { |
|
|
|
this.fileloading = true |
|
|
|
this.isAble = true |
|
|
|
// const isJPG = file.type === 'image/jpeg' |
|
|
|
// const isPNG = file.type === 'image/png' |
|
|
|
// const isLt1M = file.size / 1024 / 1024 < 1 |
|
|
|
}, |
|
|
|
// 返回按钮点击事件 |
|
|
|
backToUserRelationList () { |
|
|
|
this.$emit('refreshDataList') |
|
|
|
this.$parent.selectComponent = 'Weekrecordinfo' |
|
|
|
this.$router.push({ path: '/workRecord-weekrecordinforoute' }) |
|
|
|
}, |
|
|
|
// 获取信息 |
|
|
|
// getInfo () { |
|
|
|
// this.$http.get(`/workRecord/weekrecordinfo/${this.dataForm.id}`).then(({ data: res }) => { |
|
|
|
// if (res.code !== 0) { |
|
|
|
// return this.$message.error(res.msg) |
|
|
|
// } |
|
|
|
// this.dataForm = { |
|
|
|
// ...this.dataForm, |
|
|
|
// ...res.data |
|
|
|
// } |
|
|
|
// // 判断是否存在九张照片,九张照片隐藏上传操作按钮(非查看状态下) |
|
|
|
// if (!this.$route.query.disabled) { |
|
|
|
// this.hideUpload = this.dataForm.images.length >= 9 |
|
|
|
// } |
|
|
|
// }).catch(() => {}) |
|
|
|
// }, |
|
|
|
// 获取生成代码所需信息信息 |
|
|
|
getFormDataInfo () { |
|
|
|
let postData = { |
|
|
|
@ -195,6 +223,7 @@ export default { |
|
|
|
isAdd: this.$route.query.isAdd |
|
|
|
} |
|
|
|
this.$http.post(`/workRecord/resourcesdictionary/getResourcesDictionaryInitInfo`, postData).then(({ data: res }) => { |
|
|
|
this.pageloading = false |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
|