|
|
@@ -7,8 +7,8 @@
|
|
|
<!--标题 分类-->
|
|
|
<Set ref="set"></Set>
|
|
|
<!--文件列表-->
|
|
|
- <file-list :attinfos="uploadCacheData.attinfos">
|
|
|
- <upload slot="upload" @onSuccess="onSuccess" target="archives" classType="image"></upload>
|
|
|
+ <file-list :attinfos="uploadCacheData.attinfos" v-if="uploadType == '1' || uploadType == '2'">
|
|
|
+ <upload slot="upload" @onSuccess="onSuccess" target="archives" :classType="uploadType"></upload>
|
|
|
<template v-slot:delete="scope">
|
|
|
<delete1 :data="scope.data"></delete1>
|
|
|
</template>
|
|
|
@@ -17,7 +17,7 @@
|
|
|
</template>
|
|
|
</file-list>
|
|
|
<!--富文本-->
|
|
|
- <file-text ref="text">
|
|
|
+ <file-text ref="text" v-if="uploadType == '3'">
|
|
|
<Editor ref="editor" slot="editor" :content="cacheInfo.content.content" :id="uploadCacheData.sat_sharematerialid">
|
|
|
</Editor>
|
|
|
</file-text>
|
|
|
@@ -37,7 +37,7 @@ import delete1 from '@/SManagement/archives_upload/components/delete'
|
|
|
import download from '@/SManagement/archives_upload/components/download'
|
|
|
import Editor from '@/components/my-editor/Editor'
|
|
|
|
|
|
-
|
|
|
+import {weAtob,weBtoa} from "@/utils/weapp-jwt"
|
|
|
import removeFile from '@/utils/removeFile'
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
@@ -54,13 +54,15 @@ export default {
|
|
|
"tag": [],
|
|
|
"canfiledownload": 1,
|
|
|
"content": "",
|
|
|
- "sat_sharematerialid": 0
|
|
|
+ "sat_sharematerialid": 0,
|
|
|
+ "type":''
|
|
|
}
|
|
|
},
|
|
|
//上传的初始数据
|
|
|
uploadCacheData: '',
|
|
|
//创建素材模板的id
|
|
|
- create_sat_sharematerialid:0
|
|
|
+ create_sat_sharematerialid: 0,
|
|
|
+ uploadType: window.sessionStorage.getItem('uploadType')
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
@@ -89,8 +91,10 @@ export default {
|
|
|
//保存
|
|
|
save () {
|
|
|
this.$refs.set.$refs.form.validate((val) => {
|
|
|
+ var that = this
|
|
|
if (val) {
|
|
|
- this.cacheInfo.content.content = btoa(this.$refs.editor.editor.getHtml())
|
|
|
+ if (this.uploadType == '3') this.cacheInfo.content.content = weBtoa(this.$refs.editor.editor.getHtml())
|
|
|
+ this.cacheInfo.content.type = this.uploadType
|
|
|
this.$api.requested(this.cacheInfo).then(res => {
|
|
|
let param = {
|
|
|
"classname": "webmanage.saletool.sharematerial.sharematerial",
|
|
|
@@ -142,7 +146,7 @@ export default {
|
|
|
this.cacheInfo.content.title = data.title
|
|
|
this.cacheInfo.content.sat_sharematerial_classid = data.sat_sharematerial_classid
|
|
|
this.cacheInfo.content.content = data.content
|
|
|
-
|
|
|
+
|
|
|
this.$refs.set.ruleForm.title = data.title
|
|
|
this.$refs.set.ruleForm.category = data.sat_sharematerial_classid
|
|
|
this.uploadCacheData.sat_sharematerialid = data.sat_sharematerialid
|
|
|
@@ -179,7 +183,7 @@ export default {
|
|
|
},
|
|
|
//退出后对数据进行销毁
|
|
|
async removeAllData () {
|
|
|
- if(this.$route.params.data) {
|
|
|
+ if (this.$route.params.data) {
|
|
|
this.uploadCacheData.status = "新建"
|
|
|
this.uploadCacheData.sat_sharematerialid = this.create_sat_sharematerialid
|
|
|
}
|
|
|
@@ -199,13 +203,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//重置所有数据
|
|
|
- reSetAllData() {
|
|
|
- this.cacheInfo.content.title = ''
|
|
|
- this.cacheInfo.content.sat_sharematerial_classid = ''
|
|
|
- this.$refs.editor.html = ''
|
|
|
- this.$refs.set.ruleForm.title = ''
|
|
|
- this.$refs.set.ruleForm.category = ''
|
|
|
- this.uploadCacheData.attinfos = []
|
|
|
+ reSetAllData () {
|
|
|
+ this.cacheInfo.content.title = ''
|
|
|
+ this.cacheInfo.content.sat_sharematerial_classid = ''
|
|
|
+ this.$refs.editor.html = ''
|
|
|
+ this.$refs.set.ruleForm.title = ''
|
|
|
+ this.$refs.set.ruleForm.category = ''
|
|
|
+ this.uploadCacheData.attinfos = []
|
|
|
}
|
|
|
},
|
|
|
};
|