|
@@ -4,27 +4,40 @@
|
|
|
<Header>
|
|
|
<save slot="save" @btnClick="save()"></save>
|
|
|
</Header>
|
|
|
- <!--标题 分类-->
|
|
|
- <Set ref="set"></Set>
|
|
|
- <!--文件列表-->
|
|
|
- <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>
|
|
|
- <template v-slot:download="scope">
|
|
|
- <download :data="scope.data"></download>
|
|
|
- </template>
|
|
|
- </file-list>
|
|
|
- <!--富文本-->
|
|
|
- <file-text ref="text" v-if="uploadType == '3'">
|
|
|
- <Editor ref="editor" slot="editor" :content="cacheInfo.content.content" :id="uploadCacheData.sat_sharematerialid">
|
|
|
- </Editor>
|
|
|
- </file-text>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="14">
|
|
|
+ <!-- 基础功能 -->
|
|
|
+ <!--标题 分类-->
|
|
|
+ <Set ref="set" @setSelectChange="selectChange" @setTitleChange="titleChange" />
|
|
|
+ <!--文件列表-->
|
|
|
+ <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>
|
|
|
+ <template v-slot:download="scope">
|
|
|
+ <download :data="scope.data"></download>
|
|
|
+ </template>
|
|
|
+ </file-list>
|
|
|
+ <!--富文本-->
|
|
|
+ <file-text ref="text" v-if="uploadType == '3'">
|
|
|
+ <Editor ref="editor" slot="editor" :content="cacheInfo.content.content"
|
|
|
+ :id="uploadCacheData.sat_sharematerialid">
|
|
|
+ </Editor>
|
|
|
+ </file-text>
|
|
|
+ </el-col>
|
|
|
+ <!-- 授权范围 -->
|
|
|
+ <el-col :span="10">
|
|
|
+ <scopeOfauth :defaultData="defaultData" appid="sat_sharematerialid" @onChecked="onChecked" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import scopeOfauth from '@/components/scopeOfAuthority/index.vue'
|
|
|
+
|
|
|
import Header from '@/SManagement/archives_upload/components/Header'
|
|
|
import Set from '@/SManagement/archives_upload/components/Set'
|
|
|
import FileList from '@/SManagement/archives_upload/components/FileList'
|
|
@@ -39,6 +52,7 @@ import Editor from '@/components/my-editor/Editor'
|
|
|
|
|
|
import { weAtob, weBtoa } from "@/utils/weapp-jwt"
|
|
|
import removeFile from '@/utils/removeFile'
|
|
|
+import { log } from '@antv/g2plot/lib/utils'
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
data() {
|
|
@@ -62,7 +76,10 @@ export default {
|
|
|
uploadCacheData: '',
|
|
|
//创建素材模板的id
|
|
|
create_sat_sharematerialid: 0,
|
|
|
- uploadType: window.sessionStorage.getItem('uploadType')
|
|
|
+ uploadType: window.sessionStorage.getItem('uploadType'),
|
|
|
+ /* 授权使用 */
|
|
|
+ defaultData: {},
|
|
|
+ authData: {},
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
@@ -75,7 +92,8 @@ export default {
|
|
|
reset,
|
|
|
delete1,
|
|
|
download,
|
|
|
- Editor
|
|
|
+ Editor,
|
|
|
+ scopeOfauth
|
|
|
},
|
|
|
computed: {
|
|
|
},
|
|
@@ -112,6 +130,7 @@ export default {
|
|
|
message: '上传成功',
|
|
|
type: 'success'
|
|
|
})
|
|
|
+ this.insertCoursewareauth();
|
|
|
this.$router.go(-1)
|
|
|
}
|
|
|
})
|
|
@@ -126,13 +145,44 @@ export default {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ // 查询授权信息
|
|
|
+ async query_auth() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "classname": "webmanage.saletool.sharematerial.sharematerialAuth",
|
|
|
+ "method": "selectAuth",
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialid": this.uploadCacheData.sat_sharematerialid,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.defaultData = res.data
|
|
|
+ },
|
|
|
+ // 新增授权范围
|
|
|
+ async insertCoursewareauth() {
|
|
|
+ let p = {
|
|
|
+ "classname": "webmanage.saletool.sharematerial.sharematerialAuth",
|
|
|
+ "method": "insertOrUpdate",
|
|
|
+ "content": this.authData
|
|
|
+ };
|
|
|
+ const res = await this.$api.requested(p)
|
|
|
+ console.log("新增授权范围", res)
|
|
|
+ console.log("新增授权范围", p)
|
|
|
+ res.code === 0 ? this.$notify({
|
|
|
+ title: '失败',
|
|
|
+ message: res.data,
|
|
|
+ type: 'error'
|
|
|
+ }) : ''
|
|
|
+ },
|
|
|
+ // 获取保存授权范围数据
|
|
|
+ onChecked(param) {
|
|
|
+ this.authData = param
|
|
|
+ },
|
|
|
//获取上传数据模板
|
|
|
getFileCache() {
|
|
|
this.$api.requested(this.cacheInfo).then(res => {
|
|
|
this.uploadCacheData = res.data
|
|
|
this.create_sat_sharematerialid = this.uploadCacheData.sat_sharematerialid
|
|
|
this.cacheInfo.content.sat_sharematerialid = this.uploadCacheData.sat_sharematerialid
|
|
|
-
|
|
|
+ this.query_auth();
|
|
|
this.isEditFile()
|
|
|
})
|
|
|
},
|
|
@@ -208,10 +258,25 @@ export default {
|
|
|
this.$refs.set.ruleForm.title = ''
|
|
|
this.$refs.set.ruleForm.category = ''
|
|
|
this.uploadCacheData.attinfos = []
|
|
|
- }
|
|
|
+ },
|
|
|
+ /* set组件 分类选择回调 */
|
|
|
+ selectChange(id) {
|
|
|
+ this.cacheInfo.content.sat_sharematerial_classid = id;
|
|
|
+ },
|
|
|
+ /* set组件 title填写回调 */
|
|
|
+ titleChange(name) {
|
|
|
+ this.cacheInfo.content.title = name;
|
|
|
+ console.log(this.cacheInfo.content.title);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.mandate {
|
|
|
+ width: 732px;
|
|
|
+ height: 500px;
|
|
|
+ background: #fff;
|
|
|
+ margin-left: 16px;
|
|
|
+}
|
|
|
</style>
|