|
@@ -20,15 +20,23 @@
|
|
|
</file-list>
|
|
|
<!--富文本-->
|
|
|
<file-text ref="text" v-if="uploadType == '3'">
|
|
|
- <Editor ref="editor" slot="editor" :content="cacheInfo.content.content"
|
|
|
- :id="uploadCacheData.sat_sharematerialid">
|
|
|
- </Editor>
|
|
|
+ <Editor
|
|
|
+ ref="editor"
|
|
|
+ slot="editor"
|
|
|
+ :content="cacheInfo.content.content"
|
|
|
+ :id="uploadCacheData.sat_sharematerialid"
|
|
|
+ ></Editor>
|
|
|
</file-text>
|
|
|
</el-col>
|
|
|
<!-- 授权范围 -->
|
|
|
<el-col :span="10">
|
|
|
- <scopeOfauth style="margin-left:10px;" :defaultData="defaultData" :dataid="authId"
|
|
|
- appidname="sat_sharematerialid" @onChecked="onChecked" />
|
|
|
+ <scopeOfauth
|
|
|
+ style="margin-left:10px;"
|
|
|
+ :defaultData="defaultData"
|
|
|
+ :dataid="authId"
|
|
|
+ appidname="sat_sharematerialid"
|
|
|
+ @onChecked="onChecked"
|
|
|
+ />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -53,7 +61,7 @@ import removeFile from '@/utils/removeFile'
|
|
|
import { log } from '@antv/g2plot/lib/utils'
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
//新增请求配置
|
|
|
cacheInfo: {
|
|
@@ -79,7 +87,7 @@ export default {
|
|
|
defaultData: {},
|
|
|
authData: {},
|
|
|
authId: 0,
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
components: {
|
|
|
Header,
|
|
@@ -98,55 +106,55 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
//获取上传模板
|
|
|
this.uploadData(JSON.parse(window.sessionStorage.getItem("newMaterial")))
|
|
|
},
|
|
|
- beforeDestroy() {
|
|
|
+ beforeDestroy () {
|
|
|
// this.removeAllData()
|
|
|
},
|
|
|
methods: {
|
|
|
//获取素材模板
|
|
|
- uploadData(data) {
|
|
|
- this.cacheInfo.content.sat_sharematerialid = data.sat_sharematerialid;
|
|
|
- this.cacheInfo.content.title = data.title;
|
|
|
- this.cacheInfo.content.sat_sharematerial_classid = data.sat_sharematerial_classid;
|
|
|
- this.cacheInfo.content.content = data.content;
|
|
|
- this.uploadType = data.type;
|
|
|
- this.$refs.set.ruleForm.title = data.title;
|
|
|
- this.$refs.set.ruleForm.category = data.sat_sharematerial_classid;
|
|
|
- this.uploadCacheData.sat_sharematerialid = data.sat_sharematerialid;
|
|
|
- this.uploadCacheData.attinfos = data.attinfos;
|
|
|
- this.authId = this.$route.query.id;
|
|
|
- setTimeout(this.randerData, 100);
|
|
|
- if (data.title != '') this.uploadCacheData.status = "完成";
|
|
|
- this.query_auth();
|
|
|
+ uploadData (data) {
|
|
|
+ this.cacheInfo.content.sat_sharematerialid = data.sat_sharematerialid
|
|
|
+ this.cacheInfo.content.title = data.title
|
|
|
+ this.cacheInfo.content.sat_sharematerial_classid = data.sat_sharematerial_classid
|
|
|
+ this.cacheInfo.content.content = data.content
|
|
|
+ this.uploadType = data.type
|
|
|
+ this.$refs.set.ruleForm.title = data.title
|
|
|
+ this.$refs.set.ruleForm.category = data.sat_sharematerial_classid
|
|
|
+ this.uploadCacheData.sat_sharematerialid = data.sat_sharematerialid
|
|
|
+ this.uploadCacheData.attinfos = data.attinfos
|
|
|
+ this.authId = this.$route.query.id
|
|
|
+ setTimeout(this.randerData, 100)
|
|
|
+ if (data.title != '') this.uploadCacheData.status = "完成"
|
|
|
+ this.query_auth()
|
|
|
},
|
|
|
/* 更新附件列表数据 */
|
|
|
- randerData() {
|
|
|
+ randerData () {
|
|
|
if (this.uploadType != 3) this.$refs.attFileList.randerData(this.uploadCacheData.attinfos)
|
|
|
},
|
|
|
- deleteFile(id) {
|
|
|
- this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.filter(v => v.linksid != id);
|
|
|
- this.randerData();
|
|
|
+ deleteFile (id) {
|
|
|
+ this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.filter(v => v.linksid != id)
|
|
|
+ this.randerData()
|
|
|
},
|
|
|
//保存
|
|
|
- save() {
|
|
|
+ save () {
|
|
|
this.$refs.set.$refs.form.validate((val) => {
|
|
|
if (val) {
|
|
|
//判断有无内容
|
|
|
if (this.uploadType == '3') {
|
|
|
- const content = this.$refs.editor.editor.getHtml();
|
|
|
- if (content == "<p><br></p>") return this.$message.error('您还未编辑图文内容');
|
|
|
- this.cacheInfo.content.content = content;
|
|
|
+ const content = this.$refs.editor.editor.getHtml()
|
|
|
+ if (content == "<p><br></p>") return this.$message.error('您还未编辑图文内容')
|
|
|
+ this.cacheInfo.content.content = content
|
|
|
} else {
|
|
|
- if (this.uploadCacheData.attinfos.length == 0) return this.$message.error('您还未上传附件');
|
|
|
+ if (this.uploadCacheData.attinfos.length == 0) return this.$message.error('您还未上传附件')
|
|
|
}
|
|
|
- this.cacheInfo.content.type = this.uploadType;
|
|
|
+ this.cacheInfo.content.type = this.uploadType
|
|
|
//判断所属ID是否为初始ID
|
|
|
- if (this.cacheInfo.content.sat_sharematerial_classid == '9999' + JSON.parse(window.sessionStorage.getItem("active_account")).userid) return this.$message.error('请选择素材分类');
|
|
|
+ if (this.cacheInfo.content.sat_sharematerial_classid == '9999' + JSON.parse(window.sessionStorage.getItem("active_account")).userid) return this.$message.error('请选择素材分类')
|
|
|
this.$api.requested(this.cacheInfo).then(res => {
|
|
|
- this.tool.showMessage(res,() => {
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
this.uploadCacheData.status = '完成'
|
|
|
this.insertCoursewareauth()
|
|
|
this.$router.go(-1)
|
|
@@ -162,7 +170,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 查询授权信息
|
|
|
- async query_auth() {
|
|
|
+ async query_auth () {
|
|
|
const res = await this.$api.requested({
|
|
|
"classname": "webmanage.saletool.sharematerial.sharematerialAuth",
|
|
|
"method": "selectAuth",
|
|
@@ -173,12 +181,12 @@ export default {
|
|
|
this.defaultData = res.data
|
|
|
},
|
|
|
// 新增授权范围
|
|
|
- async insertCoursewareauth() {
|
|
|
+ async insertCoursewareauth () {
|
|
|
let p = {
|
|
|
"classname": "webmanage.saletool.sharematerial.sharematerialAuth",
|
|
|
"method": "insertOrUpdate",
|
|
|
"content": this.authData
|
|
|
- };
|
|
|
+ }
|
|
|
const res = await this.$api.requested(p)
|
|
|
res.code === 0 ? this.$notify({
|
|
|
title: '失败',
|
|
@@ -187,14 +195,14 @@ export default {
|
|
|
}) : ''
|
|
|
},
|
|
|
// 获取保存授权范围数据
|
|
|
- onChecked(param) {
|
|
|
+ onChecked (param) {
|
|
|
this.authData = param
|
|
|
},
|
|
|
|
|
|
//文件上传成功
|
|
|
- async onSuccess(id) {
|
|
|
- console.log(id);
|
|
|
-
|
|
|
+ async onSuccess (id) {
|
|
|
+ console.log(id)
|
|
|
+
|
|
|
let param = {
|
|
|
"classname": "system.attachment.Attachment",
|
|
|
"method": "createFileLink",
|
|
@@ -211,17 +219,17 @@ export default {
|
|
|
message: '上传失败',
|
|
|
type: 'error'
|
|
|
})
|
|
|
- this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.concat(res.data);
|
|
|
- this.randerData();
|
|
|
+ this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.concat(res.data)
|
|
|
+ this.randerData()
|
|
|
},
|
|
|
//退出后对数据进行销毁
|
|
|
- async removeAllData() {
|
|
|
+ async removeAllData () {
|
|
|
if (this.$route.params.data) {
|
|
|
this.uploadCacheData.status = "新建"
|
|
|
this.uploadCacheData.sat_sharematerialid = this.create_sat_sharematerialid
|
|
|
}
|
|
|
if (this.uploadCacheData.status == '新建') {
|
|
|
- let attinfos = this.uploadCacheData.attinfos;
|
|
|
+ let attinfos = this.uploadCacheData.attinfos
|
|
|
//删除附件
|
|
|
removeFile.removeFileList(attinfos)
|
|
|
//删除素材
|
|
@@ -236,7 +244,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//重置所有数据
|
|
|
- reSetAllData() {
|
|
|
+ reSetAllData () {
|
|
|
this.cacheInfo.content.title = ''
|
|
|
this.cacheInfo.content.sat_sharematerial_classid = ''
|
|
|
this.$refs.editor.html = ''
|
|
@@ -245,12 +253,12 @@ export default {
|
|
|
this.uploadCacheData.attinfos = []
|
|
|
},
|
|
|
/* set组件 分类选择回调 */
|
|
|
- selectChange(id) {
|
|
|
- this.cacheInfo.content.sat_sharematerial_classid = id;
|
|
|
+ selectChange (id) {
|
|
|
+ this.cacheInfo.content.sat_sharematerial_classid = id
|
|
|
},
|
|
|
/* set组件 title填写回调 */
|
|
|
- titleChange(name) {
|
|
|
- this.cacheInfo.content.title = name;
|
|
|
+ titleChange (name) {
|
|
|
+ this.cacheInfo.content.title = name
|
|
|
},
|
|
|
},
|
|
|
};
|