|
@@ -4,6 +4,7 @@
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="33%"
|
|
|
:before-close="handleClose"
|
|
|
+ v-loading.fullscreen.lock="fullscreenLoading"
|
|
|
>
|
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="分类名称:" prop="typeId">
|
|
@@ -14,8 +15,8 @@
|
|
|
@change="classifyChange"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in classifyList"
|
|
|
- :key="item.value"
|
|
|
+ v-for="(item,index) in classifyList"
|
|
|
+ :key="index"
|
|
|
:label="item.name"
|
|
|
:value="item.typeId"
|
|
|
>
|
|
@@ -71,6 +72,7 @@ import * as api from '@/api/api'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ fullscreenLoading:false,
|
|
|
dialogVisible: false,
|
|
|
form: {
|
|
|
docUrl: '',
|
|
@@ -116,6 +118,7 @@ export default {
|
|
|
if (val) {
|
|
|
this.refList = val
|
|
|
if (val.id) {
|
|
|
+ this.visbleChange(true)
|
|
|
this.details()
|
|
|
}
|
|
|
}
|
|
@@ -128,6 +131,7 @@ export default {
|
|
|
api.GET('/doc/getDetail', { id: this.refList.id }).then(data => {
|
|
|
if (data.code == 0) {
|
|
|
this.form = data.data
|
|
|
+ this.fileList = [{name:this.form.name,url:this.form.docUrl}]
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -162,10 +166,14 @@ export default {
|
|
|
}
|
|
|
api.IMPORT('/api/file/local/upload', files).then(data => {
|
|
|
if (data.code == 0) {
|
|
|
+ data.data.name = data.data.fileName
|
|
|
+ this.fileList = [data.data]
|
|
|
this.form.docUrl = data.data.url
|
|
|
this.form.fileSize = data.data.size
|
|
|
this.$message.success('上传成功')
|
|
|
}
|
|
|
+ }).catch(()=>{
|
|
|
+ this.fileList = []
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
@@ -179,7 +187,9 @@ export default {
|
|
|
/**
|
|
|
* @method 上传成功
|
|
|
* **/
|
|
|
- handleSuccess() {},
|
|
|
+ handleSuccess(file,fileList) {
|
|
|
+ console.log(file,fileList)
|
|
|
+ },
|
|
|
/**
|
|
|
* @method 文件删除
|
|
|
* **/
|
|
@@ -205,6 +215,7 @@ export default {
|
|
|
addList(formName) {
|
|
|
this.$refs[formName].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ this.fullscreenLoading = true
|
|
|
let code = {
|
|
|
docUrl: this.form.docUrl,
|
|
|
linkUrl: this.form.linkUrl,
|
|
@@ -225,18 +236,25 @@ export default {
|
|
|
if (data.code == 0) {
|
|
|
this.$message.success(data.message)
|
|
|
this.handleClose()
|
|
|
+ this.fullscreenLoading = false
|
|
|
}
|
|
|
+ }).catch(()=>{
|
|
|
+ this.fullscreenLoading = false
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* @method 编辑文件
|
|
|
* **/
|
|
|
- editfile() {
|
|
|
- api.PUT('/doc/updateDoc').then(data => {
|
|
|
+ editfile(val) {
|
|
|
+ val.id = this.form.id
|
|
|
+ api.PUT('/doc/updateDoc',val).then(data => {
|
|
|
if (data.code == 0) {
|
|
|
this.$message.success(data.message)
|
|
|
this.handleClose()
|
|
|
+ this.fullscreenLoading = false
|
|
|
}
|
|
|
+ }).catch(()=>{
|
|
|
+ this.fullscreenLoading = false
|
|
|
})
|
|
|
}
|
|
|
}
|