diff --git a/src/main.js b/src/main.js index bd73c6b3b51520c84ce6f7df1c9e9db266835919..8e6724b90c1a06e5b670cdce1cb34de749da765e 100644 --- a/src/main.js +++ b/src/main.js @@ -1,55 +1,81 @@ -// The Vue build version to load with the `import` command -// (runtime-only or standalone) has been set in webpack.base.conf with an alias. -import Vue from 'vue' -import ElementUI from 'element-ui' -import 'element-ui/lib/theme-chalk/index.css' -import App from './App' -import router from './router' - -import $ from 'jquery' - -import moment from 'moment' -import Vuex from 'vuex' -import qs from 'qs' -import axios from 'axios' -import {backToken} from './config/env' -import http from './config/httpServer' - -import echarts from 'echarts' -import Video from 'video.js' -import 'video.js/dist/video-js.css' - -Vue.prototype.$echarts = echarts - - - -// 引入JsPdf -import exportToPdf from "@/utils/exportToPdf" -Vue.use(exportToPdf) - -Vue.filter('dateformat', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { - return moment(dataStr).format(pattern) -}) - - - -Vue.prototype.$querystring = qs//其他的代ç 用到比较多 就新增一个å¯ä»¥äº† - -Vue.prototype.$qs = qs -Vue.prototype.$http = axios -Vue.prototype.$https = http -Vue.prototype.backToken=backToken -Vue.prototype.moment = moment - -Vue.use(ElementUI); -Vue.use(Vuex); -Vue.config.productionTip = false - -/* eslint-disable no-new */ -new Vue({ - el: '#app', - router, - components: { App }, - template: '<App/>' -}) - +// The Vue build version to load with the `import` command +// (runtime-only or standalone) has been set in webpack.base.conf with an alias. +import Vue from 'vue' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import App from './App' +import router from './router' + +import $ from 'jquery' + +import moment from 'moment' +import Vuex from 'vuex' +import qs from 'qs' +import axios from 'axios' +import {backToken} from './config/env' +import http from './config/httpServer' + +import echarts from 'echarts' +import Video from 'video.js' +import 'video.js/dist/video-js.css' + +Vue.prototype.$echarts = echarts + + + +// 引入JsPdf +import exportToPdf from "@/utils/exportToPdf" +Vue.use(exportToPdf) + +Vue.filter('dateformat', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { + return moment(dataStr).format(pattern) +}) + + + +Vue.prototype.$querystring = qs//其他的代ç 用到比较多 就新增一个å¯ä»¥äº† + +Vue.prototype.$qs = qs +Vue.prototype.$http = axios +Vue.prototype.$https = http +Vue.prototype.backToken=backToken +Vue.prototype.moment = moment + +Vue.use(ElementUI); +Vue.use(Vuex); +Vue.config.productionTip = false + +Vue.directive("defaultSelect", { + componentUpdated (el, bindings) { + const [defaultValues] = bindings.value + + const dealStyle = function (tags) { + // å› ä¸ºä¸å¯åˆ 除原有值,所以原有值的index是ä¸ä¼šå˜çš„,也就是将å‰n个tagçš„closeéšè—掉å³å¯ã€‚nå³å·²æœ‰å€¼çš„长度defaultValues.length + tags.forEach((el, index) => { + if (index<=defaultValues.length-1 && ![...el.classList].includes('select-tag-close-none')) { + el.classList.add('none') + } + }) + } + // è®¾ç½®æ ·å¼ éšè—close icon + const tags = el.querySelectorAll('.el-tag__close') + if (tags.length === 0) { + // åˆå§‹åŒ–tagsä¸ºç©ºå¤„ç† + setTimeout(() => { + const tagTemp = el.querySelectorAll('.el-tag__close') + dealStyle(tagTemp) + }) + } else { + dealStyle(tags) + } + } +}); + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + router, + components: { App }, + template: '<App/>' +}) + diff --git a/src/page/content/components/uploadVue/uploadImg.vue b/src/page/content/components/uploadVue/uploadImg.vue index 0f2b638f8b228e458fa38b5012ae4c0eed81fb9e..ee4c755c500be11f8b8e5c84da289e6ce5ab1a9a 100644 --- a/src/page/content/components/uploadVue/uploadImg.vue +++ b/src/page/content/components/uploadVue/uploadImg.vue @@ -24,17 +24,18 @@ <script> export default { - props:{ - fileList:{ - type:Array, - default:[] - }, - }, + // props:{ + // fileList:{ + // type: Array, + // default: () => [], + // }, + // }, data() { return { + fileList: [], dialogImageUrl: "", dialogVisible: false, - imageUrl:"" + imageUrl:"", }; }, computed: { diff --git a/src/page/content/display/content/add.vue b/src/page/content/display/content/add.vue index 7e552ed842428dc3ac6157d87b50a93517d255c0..bd376ee58def8f3c55c6a6032a3cb2a8e0484391 100644 --- a/src/page/content/display/content/add.vue +++ b/src/page/content/display/content/add.vue @@ -1,495 +1,495 @@ -<template> - <div class="info"> - <div class="info-header">{{ type === 'Update'?'修改':'新建'}}展æ¿</div> - <div class="info-container"> - <div class="info-wrapper"> - <div class="pageTips"> - <strong>页é¢è¯´æ˜Žï¼š</strong> - 创建展æ¿å†…容,“*â€ä¸ºå¿…å¡«é¡¹ï¼ŒéŸ³é¢‘èµ„æ–™æ”¯æŒæ±‰è¯ã€è’™è¯ã€è—è¯ã€ç»´å¾å°”è¯ã€è‹±è¯äº”ç§è¨€éŸ³é¢‘ä¸Šä¼ ï¼Œå‚考资料支æŒå¤šæ–‡ä»¶ä¸Šä¼ 。 - </div> - <el-collapse v-model="activeNames"> - <el-collapse-item title="展æ¿åŸºæœ¬ä¿¡æ¯" name="1"> - <el-form - :model="ruleForm" - :rules="rules" - ref="ruleForm" - label-width="140px" - class="party-form" - :inline="true" - label-position="top" - > - - <!-- <el-form-item label="å¤šæ–‡ä»¶ä¸Šä¼ æµ‹è¯•" > - <div style="color:red;"> - ï¼ˆå¯æ”¯æŒwordã€PDFã€pptã€è§†é¢‘类型文件åŠå›¾ç‰‡ä¸Šä¼ ) - </div> - <upload-folder ></upload-folder> - - </el-form-item> --> - <el-form-item label="展æ¿åç§°" prop="name" class="w100"> - <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> - </el-form-item> - - <el-form-item label="展æ¿ç‰ˆæƒæ–¹" class="w50" prop="boardCopyrightOwnerId"> - <el-select - placeholder="请选择展æ¿ç‰ˆæƒæ–¹" - v-model="ruleForm.boardCopyrightOwnerId" - clearable - @change="clearBoardCat" - > - <el-option - v-for="item in boardCopyrightOwnerId" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="展æ¿åˆ†ç±»" prop="exhibitionBoardCatId"> - <el-select - placeholder="请选择展æ¿åˆ†ç±»" - v-model="ruleForm.exhibitionBoardCatId" - @focus="getExhibitionBoardCatId" - clearable - > - <el-option - v-for="item in exhibitionBoardCatId" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="展æ¿å›¾ç‰‡" class="w50" prop="cover" required> - <upload-img :fileList="ruleForm.imageList" @imgUrl="imgUrl" ></upload-img> - </el-form-item> - <el-form-item label="展æ¿äºŒç»´ç " class prop="qrcodeUrl" required> - <upload-qrcode :fileList="ruleForm.qrcodeList" @qrcodeUrl="qrcodeUrl" ></upload-qrcode> - </el-form-item> - <el-form-item label="展æ¿ç®€ä»‹" style="width:100%" prop="remarks"> - <el-input type="textarea" v-model="ruleForm.remarks"></el-input> - </el-form-item> - </el-form> - </el-collapse-item> - <el-collapse-item title="展æ¿å½±éŸ³ä¿¡æ¯" name="2"> - <el-form - :model="ruleForm" - :rules="rules" - ref="ruleForm" - label-width="140px" - class="party-form" - :inline="true" - label-position="top" - > - <el-form-item label="è¯·é€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹" class="w50" prop="videoContentCopyrightOwnerId"> - <el-select - placeholder="è¯·é€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹" - v-model="ruleForm.videoContentCopyrightOwnerId" - @change="clearVideoCat" - clearable - > - <el-option - v-for="item in copyrightOwner" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="请选择视频分类" prop="videoContentCatId"> - <el-select - placeholder="请选择视频分类" - v-model="ruleForm.videoContentCatId" - @focus="getVideoContentCatData" - @change="clearVideo" - clearable - > - <el-option - v-for="item in videoContentCat" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="请选择视频" prop="videoContentId" class="w100"> - <el-select - @focus="getVideoData" - placeholder="请选择视频" - v-model="ruleForm.videoContentId" - clearable - > - <el-option - v-for="item in videoContentId" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item></el-form-item> - <el-form-item label="è¯éŸ³å¯¼è§ˆ" prop="audioIdList" > - <div style="color:red;">(å¯ä¸Šä¼ 汉è¯ã€è’™è¯ã€è—è¯ã€ç»´å¾å°”è¯ã€è‹±è¯äº”ç§è¯è¨€éŸ³é¢‘èµ„æ–™ï¼Œå‘½åæ–¹å¼ä¸ºå±•æ¿åç§°+è¯è¨€ï¼‰</div> - <upload-audio :fileList="ruleForm.audioList" @audioList="audioList"></upload-audio> - </el-form-item> - <el-form-item label="å‚考资料" prop="datumIdList" > - <div style="color:red;"> - ï¼ˆå¯æ”¯æŒwordã€PDFã€pptã€è§†é¢‘类型文件åŠå›¾ç‰‡ä¸Šä¼ ) - </div> - <upload-datum :fileList="ruleForm.datumList" @datumList="datumList"></upload-datum> - </el-form-item> - </el-form> - </el-collapse-item> - </el-collapse> - </div> - </div> - <div class="info-footer"> - <div class="btn-group"> - <el-button class="btn_form_search" @click="close">å…³é—</el-button> - <el-button v-show="type === 'add'" type="primary" class="btn_form_search" @click="submitForm('ruleForm')">æäº¤å®¡æ ¸</el-button> - <el-button v-show="type === 'Update'" type="primary" class="btn_form_search" @click="updateForm('ruleForm')">æäº¤å®¡æ ¸</el-button> - </div> - </div> - </div> -</template> - -<script> -import uploadImg from "@/page/content/components/uploadVue/uploadImg"; -import uploadQrcode from "@/page/content/components/uploadVue/uploadQrcode"; -import uploadFile from "@/page/content/components/uploadVue/uploadFile"; -import uploadDatum from "@/page/content/components/uploadVue/uploadDatum"; -import uploadAudio from "@/page/content/components/uploadVue/uploadAudio"; -import mulDisplay from "@/page/content/components/mulClassify/mulDisplay"; -import addCopyright from "@/page/content/components/dialog/addCopyright"; -import uploadFolder from "@/page/content/components/uploadVue/uploadFolder"; -export default { - components: { - uploadImg, - uploadFile, - uploadDatum, - uploadAudio, - mulDisplay, - addCopyright, - uploadQrcode, - uploadFolder - }, - data() { - return { - activeNames: ["1", "2"], - type: this.$route.query.type, - boardCopyrightOwnerId:[], // 展æ¿ç‰ˆæƒæ–¹ - exhibitionBoardCatId:[], // 展æ¿åˆ†ç±» - copyrightOwner: [], // è§†é¢‘ç‰ˆæƒæ–¹ - videoContentCat: [], // 视频分类 - videoContentId:[], // 视频 - formLabelWidth: "100px", - ruleForm: { - name: "", - exhibitionBoardCatId:'', - boardCopyrightOwnerId:"", - videoContentCopyrightOwnerId: "", - videoContentCatId: "", - videoContentId:"", - audioIdList: [], - datumIdList: [], - datumList:[], - audioList:[], - imageList:[], - qrcodeList:[] - }, - rules: { - name: [ - { required: true, message: "è¯·è¾“å…¥ç‰ˆæƒæ–¹åç§°", trigger: "blur" }, - { min: 1, max: 20, message: "请输入1到20个å—" }, - ], - boardCopyrightOwnerId: [ - { required: true, message: "请选择展æ¿ç‰ˆæƒæ–¹", trigger: "change" } - ], - exhibitionBoardCatId: [ - { required: true, message: "请选择展æ¿åˆ†ç±»", trigger: "change" } - ], - videoContentCopyrightOwnerId: [ - { required: true, message: "è¯·é€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹", trigger: "change" } - ], - videoContentCatId: [ - { required: true, message: "请选择视频分类", trigger: "change" } - ], - videoContentId: [ - { required: true, message: "请选择视频", trigger: "change" } - ], - audioIdList:[ - { required: true, message: "è¯·ä¸Šä¼ éŸ³é¢‘", trigger: "blur" } - ], - datumIdList:[ - { required: true, message: "è¯·ä¸Šä¼ å‚考资料", trigger: "blur" } - ], - remarks: [ - { min: 1, max: 100, message: "请输入1到100个å—" }, - ], - - }, - - }; - }, - mounted(){ - this.init() - }, - methods: { - init() { - // this.getVideoContentCatData(); - this.getVideoContentCopyrightData(); - // this.getExhibitionBoardCatId(); - this.getBoardCopyrightOwnerId(); - // this.getVideoData(); - if (this.$route.query.type === "Update") { - this.getInfo(this.$route.query.id); - - } - }, - // æ›´æ¢å±•æ¿ç‰ˆæƒæ–¹ï¼Œå±•æ¿åˆ†ç±»æ¸…空 - clearBoardCat(){ - this.ruleForm.exhibitionBoardCatId = '' - }, - // æ›´æ¢è§†é¢‘ç‰ˆæƒæ–¹ï¼Œè§†é¢‘分类清空 - clearVideoCat(){ - this.ruleForm.videoContentCatId = '' - this.ruleForm.videoContentId = '' - }, - // 获å–ç‰ˆæƒæ–¹è¯¦æƒ… - getInfo(id) { - let vm = this; - vm.$https( - { - url: "exhibitionBoard/get/" + id, - method: "get", - authType: this.backToken - } - ).then(res => { - let data = res.data.data; - this.ruleForm = { - videoContentCopyrightOwnerId :data.videoContentCopyrightOwnerId, - videoContentId:data.videoContentId, - videoContentCatId:data.videoContentCatId, - boardCopyrightOwnerId:data.boardCopyrightOwnerId, - cover:data.cover, - exhibitionBoardCatId:data.exhibitionBoardCatId, - id:data.id, - name:data.name, - qrcodeUrl:data.qrcodeUrl, - remarks:data.remarks, - audioIdList:data.audioIdList, - datumIdList:data.datumIdList, - datumList:data.datumList.map(item=>{return {id:item.id,name:item.fileName,url:item.fileUrl}}), - audioList:data.audioList.map(item=>{return {id:item.id,name:item.fileName,url:item.fileUrl}}), - imageList:[{url:data.cover}], - qrcodeList:[{url:data.qrcodeUrl}] - } - // console.log(this.ruleForm) - this.getVideoContentCatData(); - this.getExhibitionBoardCatId(); - this.getVideoData(); - }).catch(function(err) { - console.log(err); - }); - }, - // 缩略图 - imgUrl(url) { - this.ruleForm.cover = url; - }, - // 二维ç - qrcodeUrl(url){ - this.ruleForm.qrcodeUrl = url - }, - // 音频 - audioList(list){ - this.ruleForm.audioIdList = list; - }, - // 资料 - datumList(list){ - this.ruleForm.datumIdList = list; - }, - - // 新增 - submitForm(formName) { - console.log(this.ruleForm) - this.$refs[formName].validate(valid => { - if (valid) { - this.$https( - { - url: "exhibitionBoard/save", - method: "post", - authType: this.backToken - }, - this.$qs.stringify(this.ruleForm) - ).then(res => { - if(res.data.resultCode === "200"){ - this.$message({ type: "success", message: "新增展æ¿ç”³è¯·å·²æäº¤,å¾…å®¡æ ¸ï¼" }); - history.go(-1); - }else{ - this.$message({ type: "error", message: res.data.message }); - } - }).catch(function(err) { - console.log(err); - }); - } - }); - }, - // 修改 - updateForm(formName) { - this.$refs[formName].validate(valid => { - if (valid) { - const params = JSON.parse(JSON.stringify(this.ruleForm)) - delete params.datumList - delete params.audioList - delete params.imageList - delete params.qrcodeList - console.log(params) - this.$https( - { - url: "exhibitionBoard/update", - method: "put", - authType: this.backToken - }, - this.$qs.stringify(params) - ).then(res => { - if(res.data.resultCode === "200"){ - this.$message({ type: "success", message: "修改展æ¿ç”³è¯·å·²æäº¤,å¾…å®¡æ ¸ï¼" }); - history.go(-1); - }else{ - this.$message({ type: "error", message: res.data.message }); - } - }).catch(function(err) { - console.log(err); - }); - } - }); - }, - // 获å–è§†é¢‘ç‰ˆæƒæ–¹ - getVideoContentCopyrightData() { - let vm = this; - vm.$https( - { - url: "copyrightOwner/getList", - method: "get", - authType: this.backToken - }, - { copyrightOwnerType: "VIDEO_CONTENT" } - ) - .then(res => { - this.copyrightOwner = res.data.data; - }) - .catch(function(err) { - console.log(err); - }); - }, - // 获å–展æ¿ç‰ˆæƒæ–¹ - getBoardCopyrightOwnerId() { - let vm = this; - vm.$https({ - url: "copyrightOwner/getList", - method: "get", - authType: this.backToken - }, - { copyrightOwnerType: "EXHIBITION_BOARD" } - ).then(res => { - this.boardCopyrightOwnerId = res.data.data; - }).catch(function(err) { - console.log(err); - }); - }, - //获å–展æ¿åˆ†ç±» - getExhibitionBoardCatId(){ - let vm = this; - if(this.ruleForm.boardCopyrightOwnerId){ - vm.$https({ - url: "exhibitionBoardCat/getList", - method: "post", - authType: this.backToken - },this.$qs.stringify({copyrightOwnerId:this.ruleForm.boardCopyrightOwnerId})).then(res => { - this.exhibitionBoardCatId = res.data.data - }).catch(function(err) { - console.log(err); - }); - }else{ - this.$message.warning("请先选择展æ¿ç‰ˆæƒæ–¹ï¼") - } - - - }, - // 获å–视频分类列表 - getVideoContentCatData() { - let vm = this; - if(this.ruleForm.videoContentCopyrightOwnerId){ - vm.$https({ - url: "videoContentCat/getList", - method: "get", - authType: this.backToken - },{copyrightOwnerId:this.ruleForm.videoContentCopyrightOwnerId}).then(res => { - this.videoContentCat = res.data.data; - }).catch(function(err) { - console.log(err); - }); - }else{ - this.$message.warning("è¯·å…ˆé€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹ï¼") - - } - - }, - // è§†é¢‘ç‰ˆæƒæ–¹æˆ–视频分类å‘生å˜åŒ–时,é‡ç½®è§†é¢‘的值 - clearVideo(){ - this.ruleForm.videoContentId = '' - }, - // 获å–视频列表 - getVideoData() { - const param = { - videoContentCatId:this.ruleForm.videoContentCatId, - videoContentCopyrightOwnerId:this.ruleForm.videoContentCopyrightOwnerId - } - if((this.ruleForm.videoContentCatId)&&(this.ruleForm.videoContentCopyrightOwnerId)){ - let vm = this; - vm.$https({ - url: "videoContent/getList", - method: "get", - authType: this.backToken - }, - param).then(res => { - this.videoContentId = res.data.data; - }).catch(function(err) { - console.log(err); - }); - }else{ - this.$message.warning("è¯·å…ˆé€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹å’Œè§†é¢‘分类ï¼") - this.videoContentId = [] - } - - }, - // å…³é— - close() { - this.$router.go(-1); - }, - } -}; -</script> - -<style lang="less" scoped> -.info-add { - /deep/.el-collapse-item__wrap { - padding: 16px; - } - /deep/.el-collapse-item__header { - position: relative; - padding-left: 20px; - font-size: 18px; - color: #333; - &::before { - content: ""; - position: absolute; - top: 14px; - left: 0px; - width: 4px; - height: 18px; - background: #000; - } - } -} -</style> +<template> + <div class="info"> + <div class="info-header">{{ type === 'Update'?'修改':'新建'}}展æ¿</div> + <div class="info-container"> + <div class="info-wrapper"> + <div class="pageTips"> + <strong>页é¢è¯´æ˜Žï¼š</strong> + 创建展æ¿å†…容,“*â€ä¸ºå¿…å¡«é¡¹ï¼ŒéŸ³é¢‘èµ„æ–™æ”¯æŒæ±‰è¯ã€è’™è¯ã€è—è¯ã€ç»´å¾å°”è¯ã€è‹±è¯äº”ç§è¨€éŸ³é¢‘ä¸Šä¼ ï¼Œå‚考资料支æŒå¤šæ–‡ä»¶ä¸Šä¼ 。 + </div> + <el-collapse v-model="activeNames"> + <el-collapse-item title="展æ¿åŸºæœ¬ä¿¡æ¯" name="1"> + <el-form + :model="ruleForm" + :rules="rules" + ref="ruleForm" + label-width="140px" + class="party-form" + :inline="true" + label-position="top" + > + + <!-- <el-form-item label="å¤šæ–‡ä»¶ä¸Šä¼ æµ‹è¯•" > + <div style="color:red;"> + ï¼ˆå¯æ”¯æŒwordã€PDFã€pptã€è§†é¢‘类型文件åŠå›¾ç‰‡ä¸Šä¼ ) + </div> + <upload-folder ></upload-folder> + + </el-form-item> --> + <el-form-item label="展æ¿åç§°" prop="name" class="w100"> + <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> + </el-form-item> + + <el-form-item label="展æ¿ç‰ˆæƒæ–¹" class="w50" prop="boardCopyrightOwnerId"> + <el-select + placeholder="请选择展æ¿ç‰ˆæƒæ–¹" + v-model="ruleForm.boardCopyrightOwnerId" + clearable + @change="clearBoardCat" + > + <el-option + v-for="item in boardCopyrightOwnerId" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="展æ¿åˆ†ç±»" prop="exhibitionBoardCatId"> + <el-select + placeholder="请选择展æ¿åˆ†ç±»" + v-model="ruleForm.exhibitionBoardCatId" + @focus="getExhibitionBoardCatId" + clearable + > + <el-option + v-for="item in exhibitionBoardCatId" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="展æ¿å›¾ç‰‡" class="w50" prop="cover" required> + <upload-img :fileList="ruleForm.imageList" @imgUrl="imgUrl" ></upload-img> + </el-form-item> + <el-form-item label="展æ¿äºŒç»´ç " class prop="qrcodeUrl" required> + <upload-qrcode :fileList="ruleForm.qrcodeList" @qrcodeUrl="qrcodeUrl" ></upload-qrcode> + </el-form-item> + <el-form-item label="展æ¿ç®€ä»‹" style="width:100%" prop="remarks"> + <el-input type="textarea" v-model="ruleForm.remarks"></el-input> + </el-form-item> + </el-form> + </el-collapse-item> + <el-collapse-item title="展æ¿å½±éŸ³ä¿¡æ¯" name="2"> + <el-form + :model="ruleForm" + :rules="rules" + ref="ruleForm" + label-width="140px" + class="party-form" + :inline="true" + label-position="top" + > + <el-form-item label="è¯·é€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹" class="w50" prop="videoContentCopyrightOwnerId"> + <el-select + placeholder="è¯·é€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹" + v-model="ruleForm.videoContentCopyrightOwnerId" + @change="clearVideoCat" + clearable + > + <el-option + v-for="item in copyrightOwner" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="请选择视频分类" prop="videoContentCatId"> + <el-select + placeholder="请选择视频分类" + v-model="ruleForm.videoContentCatId" + @focus="getVideoContentCatData" + @change="clearVideo" + clearable + > + <el-option + v-for="item in videoContentCat" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="请选择视频" prop="videoContentId" class="w100"> + <el-select + @focus="getVideoData" + placeholder="请选择视频" + v-model="ruleForm.videoContentId" + clearable + > + <el-option + v-for="item in videoContentId" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item></el-form-item> + <el-form-item label="è¯éŸ³å¯¼è§ˆ" prop="audioIdList" > + <div style="color:red;">(å¯ä¸Šä¼ 汉è¯ã€è’™è¯ã€è—è¯ã€ç»´å¾å°”è¯ã€è‹±è¯äº”ç§è¯è¨€éŸ³é¢‘èµ„æ–™ï¼Œå‘½åæ–¹å¼ä¸ºå±•æ¿åç§°+è¯è¨€ï¼‰</div> + <upload-audio :fileList="ruleForm.audioList" @audioList="audioList"></upload-audio> + </el-form-item> + <el-form-item label="å‚考资料" prop="datumIdList" > + <div style="color:red;"> + ï¼ˆå¯æ”¯æŒwordã€PDFã€pptã€è§†é¢‘类型文件åŠå›¾ç‰‡ä¸Šä¼ ) + </div> + <upload-datum :fileList="ruleForm.datumList" @datumList="datumList"></upload-datum> + </el-form-item> + </el-form> + </el-collapse-item> + </el-collapse> + </div> + </div> + <div class="info-footer"> + <div class="btn-group"> + <el-button class="btn_form_search" @click="close">å…³é—</el-button> + <el-button v-show="type === 'add'" type="primary" class="btn_form_search" @click="submitForm('ruleForm')">æäº¤å®¡æ ¸</el-button> + <el-button v-show="type === 'Update'" type="primary" class="btn_form_search" @click="updateForm('ruleForm')">æäº¤å®¡æ ¸</el-button> + </div> + </div> + </div> +</template> + +<script> +import uploadImg from "@/page/content/components/uploadVue/uploadImg"; +import uploadQrcode from "@/page/content/components/uploadVue/uploadQrcode"; +import uploadFile from "@/page/content/components/uploadVue/uploadFile"; +import uploadDatum from "@/page/content/components/uploadVue/uploadDatum"; +import uploadAudio from "@/page/content/components/uploadVue/uploadAudio"; +import mulDisplay from "@/page/content/components/mulClassify/mulDisplay"; +import addCopyright from "@/page/content/components/dialog/addCopyright"; +import uploadFolder from "@/page/content/components/uploadVue/uploadFolder"; +export default { + components: { + uploadImg, + uploadFile, + uploadDatum, + uploadAudio, + mulDisplay, + addCopyright, + uploadQrcode, + uploadFolder + }, + data() { + return { + activeNames: ["1", "2"], + type: this.$route.query.type, + boardCopyrightOwnerId:[], // 展æ¿ç‰ˆæƒæ–¹ + exhibitionBoardCatId:[], // 展æ¿åˆ†ç±» + copyrightOwner: [], // è§†é¢‘ç‰ˆæƒæ–¹ + videoContentCat: [], // 视频分类 + videoContentId:[], // 视频 + formLabelWidth: "100px", + ruleForm: { + name: "", + exhibitionBoardCatId:'', + boardCopyrightOwnerId:"", + videoContentCopyrightOwnerId: "", + videoContentCatId: "", + videoContentId:"", + audioIdList: [], + datumIdList: [], + datumList:[], + audioList:[], + imageList:[], + qrcodeList:[] + }, + rules: { + name: [ + { required: true, message: "è¯·è¾“å…¥ç‰ˆæƒæ–¹åç§°", trigger: "blur" }, + { min: 1, max: 20, message: "请输入1到20个å—" }, + ], + boardCopyrightOwnerId: [ + { required: true, message: "请选择展æ¿ç‰ˆæƒæ–¹", trigger: "change" } + ], + exhibitionBoardCatId: [ + { required: true, message: "请选择展æ¿åˆ†ç±»", trigger: "change" } + ], + videoContentCopyrightOwnerId: [ + { required: true, message: "è¯·é€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹", trigger: "change" } + ], + videoContentCatId: [ + { required: true, message: "请选择视频分类", trigger: "change" } + ], + videoContentId: [ + { required: true, message: "请选择视频", trigger: "change" } + ], + audioIdList:[ + { required: true, message: "è¯·ä¸Šä¼ éŸ³é¢‘", trigger: "blur" } + ], + datumIdList:[ + { required: true, message: "è¯·ä¸Šä¼ å‚考资料", trigger: "blur" } + ], + remarks: [ + { min: 1, max: 100, message: "请输入1到100个å—" }, + ], + + }, + + }; + }, + mounted(){ + this.init() + }, + methods: { + init() { + // this.getVideoContentCatData(); + this.getVideoContentCopyrightData(); + // this.getExhibitionBoardCatId(); + this.getBoardCopyrightOwnerId(); + // this.getVideoData(); + if (this.$route.query.type === "Update") { + this.getInfo(this.$route.query.id); + + } + }, + // æ›´æ¢å±•æ¿ç‰ˆæƒæ–¹ï¼Œå±•æ¿åˆ†ç±»æ¸…空 + clearBoardCat(){ + this.ruleForm.exhibitionBoardCatId = '' + }, + // æ›´æ¢è§†é¢‘ç‰ˆæƒæ–¹ï¼Œè§†é¢‘分类清空 + clearVideoCat(){ + this.ruleForm.videoContentCatId = '' + this.ruleForm.videoContentId = '' + }, + // 获å–ç‰ˆæƒæ–¹è¯¦æƒ… + getInfo(id) { + let vm = this; + vm.$https( + { + url: "exhibitionBoard/get/" + id, + method: "get", + authType: this.backToken + } + ).then(res => { + let data = res.data.data; + this.ruleForm = { + videoContentCopyrightOwnerId :data.videoContentCopyrightOwnerId, + videoContentId:data.videoContentId, + videoContentCatId:data.videoContentCatId, + boardCopyrightOwnerId:data.boardCopyrightOwnerId, + cover:data.cover, + exhibitionBoardCatId:data.exhibitionBoardCatId, + id:data.id, + name:data.name, + qrcodeUrl:data.qrcodeUrl, + remarks:data.remarks, + audioIdList:data.audioIdList, + datumIdList:data.datumIdList, + datumList:data.datumList.map(item=>{return {id:item.id,name:item.fileName,url:item.fileUrl}}), + audioList:data.audioList.map(item=>{return {id:item.id,name:item.fileName,url:item.fileUrl}}), + imageList:[{url:data.cover}], + qrcodeList:[{url:data.qrcodeUrl}] + } + // console.log(this.ruleForm) + this.getVideoContentCatData(); + this.getExhibitionBoardCatId(); + this.getVideoData(); + }).catch(function(err) { + console.log(err); + }); + }, + // 缩略图 + imgUrl(url) { + this.ruleForm.cover = url; + }, + // 二维ç + qrcodeUrl(url){ + this.ruleForm.qrcodeUrl = url + }, + // 音频 + audioList(list){ + this.ruleForm.audioIdList = list; + }, + // 资料 + datumList(list){ + this.ruleForm.datumIdList = list; + }, + + // 新增 + submitForm(formName) { + // console.log(this.ruleForm) + this.$refs[formName].validate(valid => { + if (valid) { + this.$https( + { + url: "exhibitionBoard/save", + method: "post", + authType: this.backToken + }, + this.$qs.stringify(this.ruleForm) + ).then(res => { + if(res.data.resultCode === "200"){ + this.$message({ type: "success", message: "新增展æ¿ç”³è¯·å·²æäº¤,å¾…å®¡æ ¸ï¼" }); + history.go(-1); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + }).catch(function(err) { + console.log(err); + }); + } + }); + }, + // 修改 + updateForm(formName) { + this.$refs[formName].validate(valid => { + if (valid) { + const params = JSON.parse(JSON.stringify(this.ruleForm)) + delete params.datumList + delete params.audioList + delete params.imageList + delete params.qrcodeList + // console.log(params) + this.$https( + { + url: "exhibitionBoard/update", + method: "put", + authType: this.backToken + }, + this.$qs.stringify(params) + ).then(res => { + if(res.data.resultCode === "200"){ + this.$message({ type: "success", message: "修改展æ¿ç”³è¯·å·²æäº¤,å¾…å®¡æ ¸ï¼" }); + history.go(-1); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + }).catch(function(err) { + console.log(err); + }); + } + }); + }, + // 获å–è§†é¢‘ç‰ˆæƒæ–¹ + getVideoContentCopyrightData() { + let vm = this; + vm.$https( + { + url: "copyrightOwner/getList", + method: "get", + authType: this.backToken + }, + { copyrightOwnerType: "VIDEO_CONTENT" } + ) + .then(res => { + this.copyrightOwner = res.data.data; + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–展æ¿ç‰ˆæƒæ–¹ + getBoardCopyrightOwnerId() { + let vm = this; + vm.$https({ + url: "copyrightOwner/getList", + method: "get", + authType: this.backToken + }, + { copyrightOwnerType: "EXHIBITION_BOARD" } + ).then(res => { + this.boardCopyrightOwnerId = res.data.data; + }).catch(function(err) { + console.log(err); + }); + }, + //获å–展æ¿åˆ†ç±» + getExhibitionBoardCatId(){ + let vm = this; + if(this.ruleForm.boardCopyrightOwnerId){ + vm.$https({ + url: "exhibitionBoardCat/getList", + method: "post", + authType: this.backToken + },this.$qs.stringify({copyrightOwnerId:this.ruleForm.boardCopyrightOwnerId})).then(res => { + this.exhibitionBoardCatId = res.data.data + }).catch(function(err) { + console.log(err); + }); + }else{ + this.$message.warning("请先选择展æ¿ç‰ˆæƒæ–¹ï¼") + } + + + }, + // 获å–视频分类列表 + getVideoContentCatData() { + let vm = this; + if(this.ruleForm.videoContentCopyrightOwnerId){ + vm.$https({ + url: "videoContentCat/getList", + method: "get", + authType: this.backToken + },{copyrightOwnerId:this.ruleForm.videoContentCopyrightOwnerId}).then(res => { + this.videoContentCat = res.data.data; + }).catch(function(err) { + console.log(err); + }); + }else{ + this.$message.warning("è¯·å…ˆé€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹ï¼") + + } + + }, + // è§†é¢‘ç‰ˆæƒæ–¹æˆ–视频分类å‘生å˜åŒ–时,é‡ç½®è§†é¢‘的值 + clearVideo(){ + this.ruleForm.videoContentId = '' + }, + // 获å–视频列表 + getVideoData() { + const param = { + videoContentCatId:this.ruleForm.videoContentCatId, + videoContentCopyrightOwnerId:this.ruleForm.videoContentCopyrightOwnerId + } + if((this.ruleForm.videoContentCatId)&&(this.ruleForm.videoContentCopyrightOwnerId)){ + let vm = this; + vm.$https({ + url: "videoContent/getList", + method: "get", + authType: this.backToken + }, + param).then(res => { + this.videoContentId = res.data.data; + }).catch(function(err) { + console.log(err); + }); + }else{ + this.$message.warning("è¯·å…ˆé€‰æ‹©è§†é¢‘ç‰ˆæƒæ–¹å’Œè§†é¢‘分类ï¼") + this.videoContentId = [] + } + + }, + // å…³é— + close() { + this.$router.go(-1); + }, + } +}; +</script> + +<style lang="less" scoped> +.info-add { + /deep/.el-collapse-item__wrap { + padding: 16px; + } + /deep/.el-collapse-item__header { + position: relative; + padding-left: 20px; + font-size: 18px; + color: #333; + &::before { + content: ""; + position: absolute; + top: 14px; + left: 0px; + width: 4px; + height: 18px; + background: #000; + } + } +} +</style> diff --git a/src/page/content/learn/content/add.vue b/src/page/content/learn/content/add.vue index 83cde64cd562485e6d7e53bbfe8a611a2959c682..ba5c1fca28163c7fd840587247a78b96ea60dcd7 100644 --- a/src/page/content/learn/content/add.vue +++ b/src/page/content/learn/content/add.vue @@ -1,638 +1,645 @@ -<template> - <div class="info"> - <video-dialog ref="videoDialog"></video-dialog> - <!-- <div class="info-header">新建å¦ä¹ 内容</div> --> - <div class="info-header">{{ type === 'Update'?'修改':'新建'}}å¦ä¹ 内容</div> - <div class="info-container"> - <div class="info-wrapper"> - <div class="pageTips"> - <strong>页é¢è¯´æ˜Žï¼š</strong> - “*â€ä¸ºå¿…填项。展æ¿ç±»åˆ«åŠç‰ˆæƒæ–¹æ”¯æŒå¤šé€‰ã€‚展æ¿å¤‡é€‰æ¸…å•ä¸å¯é¢„览备选展æ¿è¯¦æƒ…åŠå±•æ¿å†…包å«çš„视频。 - </div> - <el-form - :model="ruleForm" - :rules="rules" - ref="ruleForm" - label-width="140px" - class="demo-form-inline party-form" - :inline="true" - label-position="top" - > - <el-form-item label="å¦ä¹ 内容åç§°" prop="name" class="w50" style="padding-right: 100px"> - <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> - </el-form-item> - <el-form-item label="适用范围"> - <span v-show="userType === '1'">全平å°</span> - <el-radio-group v-show="userType !== '1'" v-model="ruleForm.applicableScope"> - <el-radio label="THIS_ORGAN">仅本å•ä½</el-radio> - <el-radio label="THIS_ORGAN_SUB">本å•ä½åŠä¸‹å±žå•ä½</el-radio> - </el-radio-group> - </el-form-item> - <el-form-item label="所属å¦ä¹ 项目" class="w50" prop="learningProjectId"> - <el-select placeholder="请选所属å¦ä¹ 项目" v-model="ruleForm.learningProjectId"> - <el-option - v-for="item in learningProjectIdList" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="å¦ä¹ å†…å®¹å®£ä¼ å›¾" prop="cover" class="w100"> - <upload-img ref="uploadImg" @imgUrl="imgUrl"></upload-img> - </el-form-item> - <el-form-item label="展æ¿ç‰ˆæƒæ–¹" class="w50" prop="copyrightOwnerIdList"> - <el-select - placeholder="è¯·é€‰æ‹©ç‰ˆæƒæ–¹" - multiple - v-model="ruleForm.copyrightOwnerIdList" - @change="getSelectDep2" - > - <el-checkbox :style="selfstyle" v-model="checkedThing2" @change="selectAllThing2">全选</el-checkbox> - <el-option - v-for="item in assetType2" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="展æ¿ç±»åˆ«" prop="exhibitionBoardCatIdList"> - <el-select - placeholder="请选择展æ¿ç±»åˆ«" - multiple - v-model="ruleForm.exhibitionBoardCatIdList" - @focus="getAssetTypeData" - @change="getSelectDep" - > - <el-checkbox :style="selfstyle" v-model="checkedThing" @change="selectAllThing">全选</el-checkbox> - <el-option - v-for="item in videoContentCat" - :label="item.name" - :value="item.id" - :key="item.id" - ></el-option> - </el-select> - </el-form-item> - - <el-form-item label="展æ¿å¤‡é€‰æ¸…å•" class="w100" prop="exhibitionBoardIdList"> - <div class="party-table"> - <el-table - border - @selection-change="handleSelectionChange" - style="width: 100%" - max-height="400" - ref="multipleTable" - :data="tableData" - > - <el-table-column type="selection" width="55"></el-table-column> - <el-table-column type="index" width="120" label="åºå·"> - </el-table-column> - <el-table-column show-overflow-tooltip label="展æ¿åç§°" prop="name"></el-table-column> - <el-table-column show-overflow-tooltip label="展æ¿ç±»åˆ«" prop="exhibitionBoardCatName"></el-table-column> - <el-table-column show-overflow-tooltip label="展æ¿ç‰ˆæƒæ–¹" prop="boardCopyrightOwnerName"></el-table-column> - <el-table-column label="æ“作" width="180"> - <template slot-scope="scope"> - <div class="table-btn-group"> - <el-tooltip content="视频预览" placement="top"> - <el-button circle @click="videoPreview(scope.row)"> - <i class="icon-table icon-video"></i> - </el-button> - </el-tooltip> - <el-tooltip content="展æ¿é¢„览" placement="top"> - <el-button circle @click="displayPreview(scope.row)"> - <i class="icon-table icon-board"></i> - </el-button> - </el-tooltip> - </div> - - <!-- <el-button - type="text" - style="padding: 0" - @click="videoPreview(scope.row)" - >视频预览</el-button - > - <el-button - type="text" - style="padding: 0" - @click="displayPreview(scope.row)" - >展æ¿é¢„览</el-button - >--> - </template> - </el-table-column> - </el-table> - </div> - </el-form-item> - - </el-form> - - <!--新增弹框--> - <el-dialog - custom-class="party-dialog" - title="展æ¿é¢„览区" - width="468px" - :visible.sync="dialogVisible" - :before-close="closeDialog" - > - <div class="dialog-content"> - <el-form - :model="classForm" - ref="classForm" - label-width="80px" - label-position="top" - :rules="rules" - id="ruleo" - class="party-form" - > - <el-form-item label="展æ¿åç§°"> - <el-input v-model="classForm.name" readonly></el-input> - </el-form-item> - <el-form-item label="ç‰ˆæƒæ–¹"> - <el-input v-model="classForm.boardCopyrightOwnerName" readonly></el-input> - </el-form-item> - <el-form-item label="展æ¿åˆ†ç±»"> - <el-input v-model="classForm.exhibitionBoardCatName" readonly></el-input> - </el-form-item> - <el-form-item label="展æ¿å®£ä¼ 图"> - <img class="imgSize" :src="classForm.cover" alt /> - </el-form-item> - <el-form-item label="简介"> - <el-input type="textarea" v-model="classForm.remarks" readonly></el-input> - </el-form-item> - </el-form> - </div> - </el-dialog> - </div> - </div> - <div class="info-footer"> - <div class="btn-group"> - <!-- 确定ã€å–消 --> - - <el-button - v-show="type === 'add'" - size="mini" - type="primary" - class="btn_form_search" - @click="submitForm('ruleForm')" - >æäº¤å®¡æ ¸</el-button> - <el-button - v-show="type === 'Update'" - size="mini" - type="primary" - class="btn_form_search" - @click="updateForm('ruleForm')" - >æäº¤å®¡æ ¸</el-button> - <el-button size="mini" class="btn_form_search" @click="close">å–æ¶ˆ</el-button> - </div> - </div> - </div> -</template> - -<script> - -let Base64 = require('js-base64').Base64 -import uploadImg from "@/page/content/components/uploadVue/uploadImg"; -import videoDialog from "@/page/content/components/dialog/videoDialog"; -import audioPlay from "@/page/content/components/audioPlay"; -export default { - components: { - uploadImg, - videoDialog, - audioPlay - }, - data() { - return { - dialogVisible: false, - classForm: {}, - type: this.$route.query.type, - learningProjectIdList: "", - videoContentCat: [], - assetType2: [], // ç‰ˆæƒæ–¹åˆ—表 - checkedThing: false, - checkedThing2: false, - selfstyle: { - textAlign: "right", - width: "100%", - paddingRight: "10px" - }, - tableData: [], - ruleForm: { - name: "", //å¦ä¹ 内容åç§° - applicableScope: "ALL_PLAT", //适用范围 - cover: "", //å®£ä¼ å›¾ - learningProjectId: "", //所属å¦ä¹ 项目 - exhibitionBoardCatIdList: [], //展æ¿ç±»åˆ« - copyrightOwnerIdList: [], //ç‰ˆæƒæ–¹ - exhibitionBoardIdList: [] // 展æ¿å¤‡é€‰ - }, - rules: { - name: [ - { required: true, message: "请输入å¦ä¹ 内容åç§°", trigger: "blur" }, - { min: 1, max: 20, message: "请输入1到20个å—" }, - ], - cover: [ - { - required: true, - message: "请选择å¦ä¹ å†…å®¹å®£ä¼ å›¾" - } - ], - learningProjectId: [ - { required: true, message: "请选择所属å¦ä¹ 项目", trigger: "change" } - ], - exhibitionBoardCatIdList: [ - { - required: true, - type: "array", - message: "请选择展æ¿ç±»åˆ«", - trigger: "change" - } - ], - copyrightOwnerIdList: [ - { - required: true, - type: "array", - message: "è¯·é€‰æ‹©ç‰ˆæƒæ–¹", - trigger: "change" - } - ], - exhibitionBoardIdList: [ - { - required: true, - type: "array", - message: "请选择展æ¿", - trigger: "change" - } - ] - }, - multipleSelection: [], - userType: "" - }; - }, - mounted() { - this.userType = localStorage.getItem("userType"); - this.init(); - }, - methods: { - // 视频预览 - videoPreview(row) { - this.$refs.videoDialog.dialogVisible = true; - const videos = row.videoList - for(var i=0;i<videos.length;i++){ - videos[i].fileUrl = Base64.decode(videos[i].intro) - } - this.$refs.videoDialog.videoList = videos - }, - // 展æ¿é¢„览 - displayPreview(row) { - this.dialogVisible = true; - this.classForm = row; - }, - // å…³é—弹窗 - closeDialog() { - this.dialogVisible = false; - }, - init() { - this.getLearnProject(); - // this.getAssetTypeData(); - this.getAssetTypeData2(); - if (this.$route.query.type === "Update") { - this.getInfo(this.$route.query.id); - } - }, - // 获å–ç‰ˆæƒæ–¹è¯¦æƒ… - getInfo(id) { - let vm = this; - vm.$https({ - url: "learningContent/get/" + id, - method: "get", - authType: this.backToken - }) - .then(res => { - let data = res.data.data; - this.ruleForm = data; - this.ruleForm = { - name: data.name, - applicableScope: data.applicableScope, - copyrightOwnerIdList: data.copyrightOwnerIdList, - cover: data.cover, - learningProjectId: data.learningProjectId, - exhibitionBoardCatIdList: data.exhibitionBoardCatIdList, - id: data.id, - exhibitionBoardIdList: data.exhibitionBoardIdList - }; - // this.tableData = data.exhibitionBoardList; - this.multipleSelection = data.exhibitionBoardList; - this.$refs.uploadImg.showImg(this.ruleForm.cover); - this.getExhibitionBoardTable(); - this.getAssetTypeData() - }) - .catch(function(err) { - console.log(err); - }); - }, - getExhibitionBoardTable() { - const param = { - boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList, - exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList - }; - this.getTableData(param, "update"); - }, - setSelctTable() { - if (!this.multipleSelection.length) { - return false; - } - let _this = this; - let tableData = this.tableData; - let multipleSelection = this.multipleSelection; - tableData.forEach(v => { - multipleSelection.forEach(m => { - if (v.id == m.id) { - _this.$refs.multipleTable.toggleRowSelection(v); - } - }); - }); - }, - // 获å–展æ¿ç±»åˆ«åˆ—表 - getAssetTypeData() { - let vm = this; - if(this.ruleForm.copyrightOwnerIdList.length>0){ - vm.$https({ - url: "exhibitionBoardCat/getList", - method: "post", - authType: this.backToken - },this.$qs.stringify({copyrightOwnerId:this.ruleForm.copyrightOwnerIdList.toString()})) - .then(res => { - let data = res.data.data; - vm.videoContentCat = data; - }) - .catch(function(err) { - console.log(err); - }); - }else{ - this.$message.warning("请先选择展æ¿ç‰ˆæƒæ–¹ï¼") - } - - }, - // 获å–ç‰ˆæƒæ–¹åˆ—表 - getAssetTypeData2() { - let vm = this; - vm.$https( - { - url: "copyrightOwner/getList", - method: "get", - authType: this.backToken - }, - { copyrightOwnerType: "EXHIBITION_BOARD" } - ) - .then(res => { - let data = res.data.data; - console.log(data,"dhwdhwid") - vm.assetType2 = data; - }) - .catch(function(err) { - console.log(err); - }); - }, - // 获å–å¦ä¹ 项目列表 - getLearnProject() { - let vm = this; - vm.$https({ - url: "learningProject/getList", - method: "get", - authType: this.backToken - }) - .then(res => { - let data = res.data.data; - vm.learningProjectIdList = data; - }) - .catch(function(err) { - console.log(err); - }); - }, - // 获å–获å–å¦ä¹ 内容展æ¿å…¨éƒ¨åˆ—表 - getLearnContentBoard() { - let vm = this; - vm.$https( - { - url: "learningContentBoard/getList", - method: "get", - authType: this.backToken - }, - { learningContentId: this.$route.query.id } - ) - .then(res => { - let data = res.data.data; - console.log(data); - }) - .catch(function(err) { - console.log(err); - }); - }, - // 多选赋值 - handleSelectionChange(val) { - this.multipleSelection = val; - let newArray = val.map(item => { - return item.id; - }); - this.ruleForm.exhibitionBoardIdList = newArray; - }, - // 新增 - submitForm(formName) { - this.$refs[formName].validate(valid => { - console.log(this.ruleForm); - if (valid) { - this.$https( - { - url: "/learningContent/save", - method: "post", - authType: this.backToken - }, - // this.ruleForm - this.$qs.stringify(this.ruleForm) - ) - .then(res => { - if(res.data.resultCode === "200"){ - if(this.userType === '1'){ - this.$message({ type: "success", message: "新增å¦ä¹ 内容申请已æäº¤,å¾…å®¡æ ¸ï¼" }); - }else{ - this.$message({ type: "success", message: "新增æˆåŠŸï¼" }); - } - history.go(-1); - }else{ - this.$message({ type: "error", message: res.data.message }); - } - - }) - .catch(function(err) { - console.log(err); - }); - } else { - console.log("error submit!!"); - return false; - } - }); - }, - // ä¿®æ”¹ç‰ˆæƒæ–¹ - updateForm(formName) { - this.$refs[formName].validate(valid => { - if (valid) { - this.$https( - { - url: "learningContent/update", - method: "put", - authType: this.backToken - }, - this.$qs.stringify(this.ruleForm) - // this.ruleForm - ) - .then(res => { - if(res.data.resultCode === "200"){ - if(this.userType === '1'){ - this.$message({ type: "success", message: "修改å¦ä¹ 内容申请已æäº¤,å¾…å®¡æ ¸ï¼" }); - }else{ - this.$message({ type: "success", message: "修改æˆåŠŸï¼" }); - } - - history.go(-1); - }else{ - this.$message({ type: "error", message: res.data.message }); - } - }) - .catch(function(err) { - console.log(err); - }); - } else { - console.log("error submit!!"); - return false; - } - }); - }, - - imgUrl(url) { - this.ruleForm.cover = url; - this.$refs.ruleForm.validateField("cover"); - }, - // 展æ¿ç±»åˆ«å‘生å˜åŒ– - getSelectDep(exhibitionBoardCatIdList) { - if (exhibitionBoardCatIdList.length === this.videoContentCat.length) { - this.checkedThing = true; - } else { - this.checkedThing = false; - } - this.getTableParam() - }, - // - getSelectDep2(exhibitionBoardCatIdList) { - if (exhibitionBoardCatIdList.length === this.assetType2.length) { - this.checkedThing2 = true; - } else { - this.checkedThing2 = false; - } - // this.getTableParam() - }, - // ç›é€‰å±•æ¿å¤‡é€‰æ¸…å•选项æ¡ä»¶ - getTableParam(){ - // debugger - const param = { - boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList.toString(), - exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList.toString() - }; - if((param.boardCopyrightOwnerIdList.length>0)&&(param.exhibitionBoardCatIdList.length>0)){ - this.getTableData(param); - }else{ - this.tableData = [] - } - }, - // æ ¹æ®å±•æ¿ç±»åˆ«ï¼Œç‰ˆæƒæ–¹èŽ·å–展æ¿å¤‡é€‰æ¸…å• - getTableData(param, type) { - - let vm = this; - vm.$https( - { - url: "exhibitionBoard/getList", - method: "post", - authType: this.backToken - }, - vm.$qs.stringify(param) - ) - .then(res => { - // alert(1) - // console.log(res) - let data = res.data.data; - vm.tableData = data; - if (type) { - // 选ä¸è¡¨æ ¼æ•°æ® - setTimeout(() => { - vm.setSelctTable(); - }, 1000); - } - }) - .catch(function(err) { - console.log(err); - }); - }, - - selectAllThing() { - // debugger - - this.ruleForm.exhibitionBoardCatIdList = []; - if (this.checkedThing) { - this.videoContentCat.map(item => { - this.ruleForm.exhibitionBoardCatIdList.push(item.id); - }); - } else { - this.ruleForm.exhibitionBoardCatIdList = []; - } - this.getTableParam() - }, - selectAllThing2() { - // debugger - this.ruleForm.copyrightOwnerIdList = []; - if (this.checkedThing2) { - this.assetType2.map(item => { - this.ruleForm.copyrightOwnerIdList.push(item.id); - }); - } else { - this.ruleForm.copyrightOwnerIdList = []; - } - }, - - // 新增 - addSubmit() { - // è‡³å°‘é€‰ä¸€ä¸ªå¤‡é€‰æ¸…å• æç¤º - alert("请先至少选择一个展æ¿å¤‡é€‰æ¸…å•"); - }, - close() { - history.go(-1); - }, - moveUpward(row, index) { - if (index > 0) { - let upData = this.tableData[index - 1]; - this.tableData.splice(index - 1, 1); - this.tableData.splice(index, 0, upData); - } else { - this.$message({ - message: "å·²ç»æ˜¯ç¬¬ä¸€æ¡ï¼Œä¸Šç§»å¤±è´¥", - type: "warning" - }); - } - }, - moveDown(row, index) { - if (index + 1 == this.tableData.length) { - this.$message({ - message: "å·²ç»æ˜¯æœ€åŽä¸€æ¡ï¼Œä¸‹ç§»å¤±è´¥", - type: "warning" - }); - } else { - let downData = this.tableData[index + 1]; - this.tableData.splice(index + 1, 1); - this.tableData.splice(index, 0, downData); - } - } - } -}; -</script> - -<style lang="less"> -@import "../../../../style/table.less"; -</style> +<template> + <div class="info"> + <video-dialog ref="videoDialog"></video-dialog> + <!-- <div class="info-header">新建å¦ä¹ 内容</div> --> + <div class="info-header">{{ type === 'Update'?'修改':'新建'}}å¦ä¹ 内容</div> + <div class="info-container"> + <div class="info-wrapper"> + <div class="pageTips"> + <strong>页é¢è¯´æ˜Žï¼š</strong> + “*â€ä¸ºå¿…填项。展æ¿ç±»åˆ«åŠç‰ˆæƒæ–¹æ”¯æŒå¤šé€‰ã€‚展æ¿å¤‡é€‰æ¸…å•ä¸å¯é¢„览备选展æ¿è¯¦æƒ…åŠå±•æ¿å†…包å«çš„视频。 + </div> + <el-form + :model="ruleForm" + :rules="rules" + ref="ruleForm" + label-width="140px" + class="demo-form-inline party-form" + :inline="true" + label-position="top" + > + <el-form-item label="å¦ä¹ 内容åç§°" prop="name" class="w50" style="padding-right: 100px"> + <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> + </el-form-item> + <el-form-item label="适用范围"> + <span v-show="userType === '1'">全平å°</span> + <el-radio-group v-show="userType !== '1'" v-model="ruleForm.applicableScope"> + <el-radio label="THIS_ORGAN">仅本å•ä½</el-radio> + <el-radio label="THIS_ORGAN_SUB">本å•ä½åŠä¸‹å±žå•ä½</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="所属å¦ä¹ 项目" class="w50" prop="learningProjectId"> + <el-select placeholder="请选所属å¦ä¹ 项目" v-model="ruleForm.learningProjectId" @change="getSelect(ruleForm.learningProjectId)"> + <el-option + v-for="item in learningProjectIdList" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="å¦ä¹ å†…å®¹å®£ä¼ å›¾" prop="cover" class="w100"> + <upload-img ref="uploadImg" @imgUrl="imgUrl"></upload-img> + </el-form-item> + <el-form-item label="展æ¿ç‰ˆæƒæ–¹" class="w50" prop="copyrightOwnerIdList"> + <el-select + placeholder="è¯·é€‰æ‹©ç‰ˆæƒæ–¹" + multiple + v-model="ruleForm.copyrightOwnerIdList" + @change="getSelectDep2" + > + <el-checkbox :style="selfstyle" v-model="checkedThing2" @change="selectAllThing2">全选</el-checkbox> + <el-option + v-for="item in assetType2" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="展æ¿ç±»åˆ«" prop="exhibitionBoardCatIdList"> + <el-select + placeholder="请选择展æ¿ç±»åˆ«" + multiple + v-model="ruleForm.exhibitionBoardCatIdList" + @focus="getAssetTypeData" + @change="getSelectDep" + > + <el-checkbox :style="selfstyle" v-model="checkedThing" @change="selectAllThing">全选</el-checkbox> + <el-option + v-for="item in videoContentCat" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + + <el-form-item label="展æ¿å¤‡é€‰æ¸…å•" class="w100" prop="exhibitionBoardIdList"> + <div class="party-table"> + <el-table + border + @selection-change="handleSelectionChange" + style="width: 100%" + max-height="400" + ref="multipleTable" + :data="tableData" + > + <el-table-column type="selection" width="55"></el-table-column> + <el-table-column type="index" width="120" label="åºå·"> + </el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿åç§°" prop="name"></el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿ç±»åˆ«" prop="exhibitionBoardCatName"></el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿ç‰ˆæƒæ–¹" prop="boardCopyrightOwnerName"></el-table-column> + <el-table-column label="æ“作" width="180"> + <template slot-scope="scope"> + <div class="table-btn-group"> + <el-tooltip content="视频预览" placement="top"> + <el-button circle @click="videoPreview(scope.row)"> + <i class="icon-table icon-video"></i> + </el-button> + </el-tooltip> + <el-tooltip content="展æ¿é¢„览" placement="top"> + <el-button circle @click="displayPreview(scope.row)"> + <i class="icon-table icon-board"></i> + </el-button> + </el-tooltip> + </div> + + <!-- <el-button + type="text" + style="padding: 0" + @click="videoPreview(scope.row)" + >视频预览</el-button + > + <el-button + type="text" + style="padding: 0" + @click="displayPreview(scope.row)" + >展æ¿é¢„览</el-button + >--> + </template> + </el-table-column> + </el-table> + </div> + </el-form-item> + + </el-form> + + <!--新增弹框--> + <el-dialog + custom-class="party-dialog" + title="展æ¿é¢„览区" + width="468px" + :visible.sync="dialogVisible" + :before-close="closeDialog" + > + <div class="dialog-content"> + <el-form + :model="classForm" + ref="classForm" + label-width="80px" + label-position="top" + :rules="rules" + id="ruleo" + class="party-form" + > + <el-form-item label="展æ¿åç§°"> + <el-input v-model="classForm.name" readonly></el-input> + </el-form-item> + <el-form-item label="ç‰ˆæƒæ–¹"> + <el-input v-model="classForm.boardCopyrightOwnerName" readonly></el-input> + </el-form-item> + <el-form-item label="展æ¿åˆ†ç±»"> + <el-input v-model="classForm.exhibitionBoardCatName" readonly></el-input> + </el-form-item> + <el-form-item label="展æ¿å®£ä¼ 图"> + <img class="imgSize" :src="classForm.cover" alt /> + </el-form-item> + <el-form-item label="简介"> + <el-input type="textarea" v-model="classForm.remarks" readonly></el-input> + </el-form-item> + </el-form> + </div> + </el-dialog> + </div> + </div> + <div class="info-footer"> + <div class="btn-group"> + <!-- 确定ã€å–消 --> + + <el-button + v-show="type === 'add'" + size="mini" + type="primary" + class="btn_form_search" + @click="submitForm('ruleForm')" + >æäº¤å®¡æ ¸</el-button> + <el-button + v-show="type === 'Update'" + size="mini" + type="primary" + class="btn_form_search" + @click="updateForm('ruleForm')" + >æäº¤å®¡æ ¸</el-button> + <el-button size="mini" class="btn_form_search" @click="close">å–æ¶ˆ</el-button> + </div> + </div> + </div> +</template> + +<script> + +let Base64 = require('js-base64').Base64 +import uploadImg from "@/page/content/components/uploadVue/uploadImg"; +import videoDialog from "@/page/content/components/dialog/videoDialog"; +import audioPlay from "@/page/content/components/audioPlay"; +export default { + components: { + uploadImg, + videoDialog, + audioPlay + }, + data() { + return { + dialogVisible: false, + classForm: {}, + type: this.$route.query.type, + learningProjectIdList: "", + videoContentCat: [], + assetType2: [], // ç‰ˆæƒæ–¹åˆ—表 + checkedThing: false, + checkedThing2: false, + selfstyle: { + textAlign: "right", + width: "100%", + paddingRight: "10px" + }, + tableData: [], + ruleForm: { + name: "", //å¦ä¹ 内容åç§° + applicableScope: "ALL_PLAT", //适用范围 + cover: "", //å®£ä¼ å›¾ + projectId: '', + learningProjectId: "", //所属å¦ä¹ 项目 + exhibitionBoardCatIdList: [], //展æ¿ç±»åˆ« + copyrightOwnerIdList: [], //ç‰ˆæƒæ–¹ + exhibitionBoardIdList: [] // 展æ¿å¤‡é€‰ + }, + rules: { + name: [ + { required: true, message: "请输入å¦ä¹ 内容åç§°", trigger: "blur" }, + { min: 1, max: 20, message: "请输入1到20个å—" }, + ], + cover: [ + { + required: true, + message: "请选择å¦ä¹ å†…å®¹å®£ä¼ å›¾" + } + ], + learningProjectId: [ + { required: true, message: "请选择所属å¦ä¹ 项目", trigger: "change" } + ], + exhibitionBoardCatIdList: [ + { + required: true, + type: "array", + message: "请选择展æ¿ç±»åˆ«", + trigger: "change" + } + ], + copyrightOwnerIdList: [ + { + required: true, + type: "array", + message: "è¯·é€‰æ‹©ç‰ˆæƒæ–¹", + trigger: "change" + } + ], + exhibitionBoardIdList: [ + { + required: true, + type: "array", + message: "请选择展æ¿", + trigger: "change" + } + ] + }, + multipleSelection: [], + userType: "" + }; + }, + mounted() { + this.userType = localStorage.getItem("userType"); + this.init(); + }, + methods: { + // 视频预览 + videoPreview(row) { + this.$refs.videoDialog.dialogVisible = true; + const videos = row.videoList + for(var i=0;i<videos.length;i++){ + videos[i].fileUrl = Base64.decode(videos[i].intro) + } + this.$refs.videoDialog.videoList = videos + }, + // 展æ¿é¢„览 + displayPreview(row) { + this.dialogVisible = true; + this.classForm = row; + }, + // å…³é—弹窗 + closeDialog() { + this.dialogVisible = false; + }, + async init() { + if (this.$route.query.type === "Update") { + await this.getInfo(this.$route.query.id); + } + await this.getLearnProject(); + // this.getAssetTypeData(); + }, + // 获å–ç‰ˆæƒæ–¹è¯¦æƒ… + async getInfo(id) { + let vm = this; + vm.$https({ + url: "learningContent/get/" + id, + method: "get", + authType: this.backToken + }) + .then(res => { + let data = res.data.data; + this.ruleForm = data; + // console.log(11111,this.ruleForm.learningProjectId) + this.ruleForm = { + name: data.name, + applicableScope: data.applicableScope, + copyrightOwnerIdList: data.copyrightOwnerIdList, + cover: data.cover, + learningProjectId: data.learningProjectId, + exhibitionBoardCatIdList: data.exhibitionBoardCatIdList, + id: data.id, + exhibitionBoardIdList: data.exhibitionBoardIdList, + }; + // this.tableData = data.exhibitionBoardList; + this.multipleSelection = data.exhibitionBoardList; + this.$refs.uploadImg.showImg(this.ruleForm.cover); + this.getExhibitionBoardTable(); + this.getAssetTypeData() + this.getAssetTypeData2(); + }) + .catch(function(err) { + console.log(err); + }); + }, + getExhibitionBoardTable() { + const param = { + boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList, + exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList + }; + this.getTableData(param, "update"); + }, + setSelctTable() { + if (!this.multipleSelection.length) { + return false; + } + let _this = this; + let tableData = this.tableData; + let multipleSelection = this.multipleSelection; + tableData.forEach(v => { + multipleSelection.forEach(m => { + if (v.id == m.id) { + _this.$refs.multipleTable.toggleRowSelection(v); + } + }); + }); + }, + // 获å–展æ¿ç±»åˆ«åˆ—表 + getAssetTypeData() { + let vm = this; + if(this.ruleForm.copyrightOwnerIdList.length>0){ + vm.$https({ + url: "exhibitionBoardCat/getListByProjectAndCopyright", + method: "post", + authType: this.backToken + },this.$qs.stringify({copyrightIds:this.ruleForm.copyrightOwnerIdList.toString(),learningProjectId:this.ruleForm.learningProjectId})) + .then(res => { + let data = res.data.data; + vm.videoContentCat = data; + }) + .catch(function(err) { + console.log(err); + }); + }else{ + this.$message.warning("请先选择展æ¿ç‰ˆæƒæ–¹ï¼") + } + + }, + getSelect() { + this.getAssetTypeData2() + }, + // 获å–ç‰ˆæƒæ–¹åˆ—表 + getAssetTypeData2() { + let vm = this; + // console.log(this.ruleForm) + vm.$https( + { + url: "copyrightOwner/getListByLearningProjectId", + method: "get", + authType: this.backToken + }, + { copyrightOwnerType: "EXHIBITION_BOARD",learningProjectId: vm.ruleForm.learningProjectId} + ) + .then(res => { + let data = res.data.data; + // console.log(data,"dhwdhwid") + vm.assetType2 = data; + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–å¦ä¹ 项目列表 + getLearnProject() { + let vm = this; + vm.$https({ + url: "learningProject/getList", + method: "get", + authType: this.backToken + }) + .then(res => { + let data = res.data.data; + vm.learningProjectIdList = data; + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–获å–å¦ä¹ 内容展æ¿å…¨éƒ¨åˆ—表 + getLearnContentBoard() { + let vm = this; + vm.$https( + { + url: "learningContentBoard/getList", + method: "get", + authType: this.backToken + }, + { learningContentId: this.$route.query.id } + ) + .then(res => { + let data = res.data.data; + // console.log(data); + }) + .catch(function(err) { + console.log(err); + }); + }, + // 多选赋值 + handleSelectionChange(val) { + this.multipleSelection = val; + let newArray = val.map(item => { + return item.id; + }); + this.ruleForm.exhibitionBoardIdList = newArray; + }, + // 新增 + submitForm(formName) { + this.$refs[formName].validate(valid => { + // console.log(this.ruleForm); + if (valid) { + this.$https( + { + url: "/learningContent/save", + method: "post", + authType: this.backToken + }, + // this.ruleForm + this.$qs.stringify(this.ruleForm) + ) + .then(res => { + if(res.data.resultCode === "200"){ + if(this.userType === '1'){ + this.$message({ type: "success", message: "新增å¦ä¹ 内容申请已æäº¤,å¾…å®¡æ ¸ï¼" }); + }else{ + this.$message({ type: "success", message: "新增æˆåŠŸï¼" }); + } + history.go(-1); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + + }) + .catch(function(err) { + console.log(err); + }); + } else { + console.log("error submit!!"); + return false; + } + }); + }, + // ä¿®æ”¹ç‰ˆæƒæ–¹ + updateForm(formName) { + this.$refs[formName].validate(valid => { + if (valid) { + this.$https( + { + url: "learningContent/update", + method: "put", + authType: this.backToken + }, + this.$qs.stringify(this.ruleForm) + // this.ruleForm + ) + .then(res => { + if(res.data.resultCode === "200"){ + if(this.userType === '1'){ + this.$message({ type: "success", message: "修改å¦ä¹ 内容申请已æäº¤,å¾…å®¡æ ¸ï¼" }); + }else{ + this.$message({ type: "success", message: "修改æˆåŠŸï¼" }); + } + + history.go(-1); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + }) + .catch(function(err) { + console.log(err); + }); + } else { + console.log("error submit!!"); + return false; + } + }); + }, + + imgUrl(url) { + this.ruleForm.cover = url; + this.$refs.ruleForm.validateField("cover"); + }, + // 展æ¿ç±»åˆ«å‘生å˜åŒ– + getSelectDep(exhibitionBoardCatIdList) { + if (exhibitionBoardCatIdList.length === this.videoContentCat.length) { + this.checkedThing = true; + } else { + this.checkedThing = false; + } + this.getTableParam() + }, + // + getSelectDep2(exhibitionBoardCatIdList) { + if (exhibitionBoardCatIdList.length === this.assetType2.length) { + this.checkedThing2 = true; + } else { + this.checkedThing2 = false; + } + // this.getTableParam() + }, + // ç›é€‰å±•æ¿å¤‡é€‰æ¸…å•选项æ¡ä»¶ + getTableParam(){ + // debugger + const param = { + boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList.toString(), + exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList.toString(), + learningProjectId:this.ruleForm.learningProjectId + }; + if((param.boardCopyrightOwnerIdList.length>0)&&(param.exhibitionBoardCatIdList.length>0)){ + this.getTableData(param); + }else{ + this.tableData = [] + } + }, + // æ ¹æ®å±•æ¿ç±»åˆ«ï¼Œç‰ˆæƒæ–¹èŽ·å–展æ¿å¤‡é€‰æ¸…å• + getTableData(param, type) { + + let vm = this; + vm.$https( + { + url: "exhibitionBoard/getListByLearningId", + method: "post", + authType: this.backToken + }, + vm.$qs.stringify(param) + ) + .then(res => { + // alert(1) + // console.log(res) + let data = res.data.data; + vm.tableData = data; + if (type) { + // 选ä¸è¡¨æ ¼æ•°æ® + setTimeout(() => { + vm.setSelctTable(); + }, 1000); + } + }) + .catch(function(err) { + console.log(err); + }); + }, + + selectAllThing() { + // debugger + + this.ruleForm.exhibitionBoardCatIdList = []; + if (this.checkedThing) { + this.videoContentCat.map(item => { + this.ruleForm.exhibitionBoardCatIdList.push(item.id); + }); + } else { + this.ruleForm.exhibitionBoardCatIdList = []; + } + this.getTableParam() + }, + selectAllThing2() { + // debugger + this.ruleForm.copyrightOwnerIdList = []; + if (this.checkedThing2) { + this.assetType2.map(item => { + this.ruleForm.copyrightOwnerIdList.push(item.id); + }); + } else { + this.ruleForm.copyrightOwnerIdList = []; + } + }, + + // 新增 + addSubmit() { + // è‡³å°‘é€‰ä¸€ä¸ªå¤‡é€‰æ¸…å• æç¤º + alert("请先至少选择一个展æ¿å¤‡é€‰æ¸…å•"); + }, + close() { + history.go(-1); + }, + moveUpward(row, index) { + if (index > 0) { + let upData = this.tableData[index - 1]; + this.tableData.splice(index - 1, 1); + this.tableData.splice(index, 0, upData); + } else { + this.$message({ + message: "å·²ç»æ˜¯ç¬¬ä¸€æ¡ï¼Œä¸Šç§»å¤±è´¥", + type: "warning" + }); + } + }, + moveDown(row, index) { + if (index + 1 == this.tableData.length) { + this.$message({ + message: "å·²ç»æ˜¯æœ€åŽä¸€æ¡ï¼Œä¸‹ç§»å¤±è´¥", + type: "warning" + }); + } else { + let downData = this.tableData[index + 1]; + this.tableData.splice(index + 1, 1); + this.tableData.splice(index, 0, downData); + } + } + } +}; +</script> + +<style lang="less"> +@import "../../../../style/table.less"; +</style> diff --git a/src/page/content/learn/content/details.vue b/src/page/content/learn/content/details.vue index a663761a1a323d5315e345cb6ee4d534ce693647..b71acb7fd3bc3655767988778fe18b199be77e3a 100644 --- a/src/page/content/learn/content/details.vue +++ b/src/page/content/learn/content/details.vue @@ -1,294 +1,294 @@ -<template> - <div class="info"> - <div class="info-header">å¦ä¹ 内容详情</div> - <div class="info-container"> - <div class="info-wrapper"> - <div class="pageTips"> - <strong>页é¢è¯´æ˜Žï¼š</strong> - 坿Ÿ¥çœ‹å¦ä¹ 内容包å«çš„å®£ä¼ å›¾åŠå±•æ¿åˆ—è¡¨ï¼Œå¯æ‰‹åŠ¨è°ƒæ•´å±•æ¿æ’放顺åºï¼Œè°ƒæ•´åŽå³åˆ»ç”Ÿæ•ˆã€‚ - </div> - <el-collapse v-model="activeNames" @change="handleChange"> - <el-collapse-item title="å®¡æ ¸æ„è§" name="1"> - <el-form - class="demo-form-inline" - :inline="true" - :model="checkForm" - label-position="top" - > - <el-form-item label="å®¡æ ¸å±‚çº§" class="w100"> - <span class="w50 l-float"> - <strong>åˆå®¡</strong> {{checkForm.firstTime}} - </span> - <span class="w50"> - <strong>å¤å®¡</strong> {{checkForm.secondTime}} - </span> - </el-form-item> - <el-form-item label="å®¡æ ¸ç»“æžœ" class="w50"> - <span v-if="checkForm.status === 'TBC'">å¾…åˆå®¡</span> - <span v-else-if="checkForm.status === 'TBCA'">å¾…å¤å®¡</span> - <span v-else-if="checkForm.status === 'REFUSED'">驳回</span> - <span v-else-if="checkForm.status === 'APPROVED_FINAL'">通过</span> - </el-form-item> - <el-form-item - label="é©³å›žåŽŸå› " - class="w100" - > - {{checkForm.firstRemarks}} - {{checkForm.secondRemarks}} - </el-form-item> - </el-form> - </el-collapse-item> - <el-collapse-item title="å¦ä¹ 内容" name="2"> - <el-form - class="demo-form-inline" - :inline="true" - :model="formInline" - label-position="top" - > - <el-form-item label="å¦ä¹ 内容åç§°" class="w50">{{ruleForm.name}}</el-form-item> - <el-form-item label="å¦ä¹ å†…å®¹å®£ä¼ å›¾" class="w50"> - <img class="imgSize" :src="ruleForm.cover" alt /> - </el-form-item> - </el-form> - </el-collapse-item> - <el-collapse-item title="展æ¿åˆ—表" name="3"> - <!-- {{tableData}} --> - <div class="party-table"> - <!-- {{tableData[0]}} --> - <el-table - border - style="width: 100%;height:100%" - height="100%" - ref="multipleTable" - :data="tableData" - > - <el-table-column type="index" width="120" label="åºå·"> - <!-- <template slot-scope="scope"> - <span>{{ (page.currentPage - 1) * 10 + scope.$index + 1 }}</span> - </template> --> - </el-table-column> - <el-table-column show-overflow-tooltip label="展æ¿åç§°" prop="name"></el-table-column> - <el-table-column label="æ“作"> - <template slot-scope="scope"> - <el-button - type="text" - style="padding:0" - :disabled="scope.$index == 0" - @click="moveUpward(scope.row, scope.$index)" - >上移</el-button> - <el-button - type="text" - style="padding:0" - :disabled="(scope.$index + 1) == tableData.length" - @click="moveDown(scope.row, scope.$index)" - >下移</el-button> - </template> - </el-table-column> - </el-table> - </div> - </el-collapse-item> - </el-collapse> - </div> - </div> - <div class="info-footer"> - <div class="btn-group"> - <!-- 确定ã€å–消 --> - <el-button size="mini" type="primary" class="btn_form_search" @click="close">å…³é—</el-button> - </div> - </div> - </div> -</template> - -<script> -export default { - data() { - return { - checkForm:{ - firstTime:"", - secondTime:"", - status:"", - - }, - ruleForm:{ - - }, - tableData: [ - { - id: "1", - name: "" - }, - { - id: "2", - name: "" - }, - { - id: "3", - name: "" - } - ], - activeNames: ["1","2","3"], - formInline: { - user: "", - region: "" - } - }; - }, - mounted(){ - this.init() - }, - methods: { - init() { - this.getInfo(this.$route.query.id); - // this.getLearnContentBoard() - this.getCheckInfo(this.$route.query.id) - }, - // 获å–å®¡æ ¸è¯¦æƒ… - getCheckInfo(id) { - let vm = this; - vm.$https( - { - url: "audit/getById", - method: "get", - authType: this.backToken - }, - {id:id, - type:"LEARNING_CONTENT"} - // this.$qs.stringify({ - // id:id, - // type:"LEARNING_CONTENT" - // }) - ) - .then(res => { - let data = res.data.data; - this.checkForm = data; - - }) - .catch(function(err) { - console.log(err); - }); - }, - // 获å–å¦ä¹ 内容详情 - getInfo(id) { - let vm = this; - vm.$https( - { - url: "learningContent/get/" + id, - method: "get", - authType: this.backToken - } - // param - ) - .then(res => { - let data = res.data.data; - this.ruleForm = data; - console.log(this.ruleForm) - // this.ruleForm = { - // name :data.name, - // applicableScope:data.applicableScope, - // copyrightOwnerIdList:data.copyrightOwnerIdList, - // cover:data.cover, - // learningProjectId:data.learningProjectId, - // exhibitionBoardCatIdList:data.exhibitionBoardCatIdList, - // id:data.id, - // exhibitionBoardIdList:data.exhibitionBoardIdList, - // } - this.tableData = data.exhibitionBoardList - // this.multipleSelection = data.exhibitionBoardList - - }) - .catch(function(err) { - console.log(err); - }); - }, - // 获å–获å–å¦ä¹ 内容展æ¿å…¨éƒ¨åˆ—表 - getLearnContentBoard(){ - let vm = this; - vm.$https({ - url: "learningContentBoard/getList", - method: "get", - authType: this.backToken - }, - {learningContentId:this.$route.query.id} - ) - .then(res => { - let data = res.data.data; - console.log(data) - this.tableData = data - // this.multipleSelection = data - }) - .catch(function(err) { - console.log(err); - }); - }, - close() { - history.go(-1); - }, - handleChange(val) { - console.log(val); - }, - moveUpward(row, index) { - this.getSort(row.id,(this.tableData[index - 1]).id) - if (index > 0) { - let upData = this.tableData[index - 1]; - this.tableData.splice(index - 1, 1); - this.tableData.splice(index, 0, upData); - } else { - this.$message({ - message: "å·²ç»æ˜¯ç¬¬ä¸€æ¡ï¼Œä¸Šç§»å¤±è´¥", - type: "warning" - }); - } - }, - moveDown(row, index) { - this.getSort(row.id,(this.tableData[index + 1]).id) - if (index + 1 == this.tableData.length) { - this.$message({ - message: "å·²ç»æ˜¯æœ€åŽä¸€æ¡ï¼Œä¸‹ç§»å¤±è´¥", - type: "warning" - }); - } else { - let downData = this.tableData[index + 1]; - this.tableData.splice(index + 1, 1); - this.tableData.splice(index, 0, downData); - } - }, - // æŽ’åºæŽ¥å£ - getSort(sourceId,targetId){ - let _this = this; - _this - .$https({ - method: "put", - // url: "learningContentBoard/sort", - url: "learningContentBoard/sortById", - authType: this.backToken - }, - _this.$qs.stringify({ - id:this.$route.query.id, - sourceId:sourceId, - targetId:targetId - })) - .then( - res => { - if(res.data.resultCode === "200"){ - this.$message({ - type: "success", - message: "æˆåŠŸ!" - }); - }else{ - this.$message({ type: "error", message: res.data.message }); - } - }, - error => { - this.$message({ - type: "fail", - message: "失败!" + error.response.data - }); - } - ); - }, - } -}; -</script> - -<style lang="less"> +<template> + <div class="info"> + <div class="info-header">å¦ä¹ 内容详情</div> + <div class="info-container"> + <div class="info-wrapper"> + <div class="pageTips"> + <strong>页é¢è¯´æ˜Žï¼š</strong> + 坿Ÿ¥çœ‹å¦ä¹ 内容包å«çš„å®£ä¼ å›¾åŠå±•æ¿åˆ—è¡¨ï¼Œå¯æ‰‹åŠ¨è°ƒæ•´å±•æ¿æ’放顺åºï¼Œè°ƒæ•´åŽå³åˆ»ç”Ÿæ•ˆã€‚ + </div> + <el-collapse v-model="activeNames" @change="handleChange"> + <el-collapse-item title="å®¡æ ¸æ„è§" name="1"> + <el-form + class="demo-form-inline" + :inline="true" + :model="checkForm" + label-position="top" + > + <el-form-item label="å®¡æ ¸å±‚çº§" class="w100"> + <span class="w50 l-float"> + <strong>åˆå®¡</strong> {{checkForm.firstTime}} + </span> + <span class="w50"> + <strong>å¤å®¡</strong> {{checkForm.secondTime}} + </span> + </el-form-item> + <el-form-item label="å®¡æ ¸ç»“æžœ" class="w50"> + <span v-if="checkForm.status === 'TBC'">å¾…åˆå®¡</span> + <span v-else-if="checkForm.status === 'TBCA'">å¾…å¤å®¡</span> + <span v-else-if="checkForm.status === 'REFUSED'">驳回</span> + <span v-else-if="checkForm.status === 'APPROVED_FINAL'">通过</span> + </el-form-item> + <el-form-item + label="é©³å›žåŽŸå› " + class="w100" + > + {{checkForm.firstRemarks}} + {{checkForm.secondRemarks}} + </el-form-item> + </el-form> + </el-collapse-item> + <el-collapse-item title="å¦ä¹ 内容" name="2"> + <el-form + class="demo-form-inline" + :inline="true" + :model="formInline" + label-position="top" + > + <el-form-item label="å¦ä¹ 内容åç§°" class="w50">{{ruleForm.name}}</el-form-item> + <el-form-item label="å¦ä¹ å†…å®¹å®£ä¼ å›¾" class="w50"> + <img class="imgSize" :src="ruleForm.cover" alt /> + </el-form-item> + </el-form> + </el-collapse-item> + <el-collapse-item title="展æ¿åˆ—表" name="3"> + <!-- {{tableData}} --> + <div class="party-table"> + <!-- {{tableData[0]}} --> + <el-table + border + style="width: 100%;height:100%" + height="100%" + ref="multipleTable" + :data="tableData" + > + <el-table-column type="index" width="120" label="åºå·"> + <!-- <template slot-scope="scope"> + <span>{{ (page.currentPage - 1) * 10 + scope.$index + 1 }}</span> + </template> --> + </el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿åç§°" prop="name"></el-table-column> + <el-table-column label="æ“作"> + <template slot-scope="scope"> + <el-button + type="text" + style="padding:0" + :disabled="scope.$index == 0" + @click="moveUpward(scope.row, scope.$index)" + >上移</el-button> + <el-button + type="text" + style="padding:0" + :disabled="(scope.$index + 1) == tableData.length" + @click="moveDown(scope.row, scope.$index)" + >下移</el-button> + </template> + </el-table-column> + </el-table> + </div> + </el-collapse-item> + </el-collapse> + </div> + </div> + <div class="info-footer"> + <div class="btn-group"> + <!-- 确定ã€å–消 --> + <el-button size="mini" type="primary" class="btn_form_search" @click="close">å…³é—</el-button> + </div> + </div> + </div> +</template> + +<script> +export default { + data() { + return { + checkForm:{ + firstTime:"", + secondTime:"", + status:"", + + }, + ruleForm:{ + + }, + tableData: [ + { + id: "1", + name: "" + }, + { + id: "2", + name: "" + }, + { + id: "3", + name: "" + } + ], + activeNames: ["1","2","3"], + formInline: { + user: "", + region: "" + } + }; + }, + mounted(){ + this.init() + }, + methods: { + init() { + this.getInfo(this.$route.query.id); + // this.getLearnContentBoard() + this.getCheckInfo(this.$route.query.id) + }, + // 获å–å®¡æ ¸è¯¦æƒ… + getCheckInfo(id) { + let vm = this; + vm.$https( + { + url: "audit/getById", + method: "get", + authType: this.backToken + }, + {id:id, + type:"LEARNING_CONTENT"} + // this.$qs.stringify({ + // id:id, + // type:"LEARNING_CONTENT" + // }) + ) + .then(res => { + let data = res.data.data; + this.checkForm = data; + + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–å¦ä¹ 内容详情 + getInfo(id) { + let vm = this; + vm.$https( + { + url: "learningContent/get/" + id, + method: "get", + authType: this.backToken + } + // param + ) + .then(res => { + let data = res.data.data; + this.ruleForm = data; + // console.log(this.ruleForm) + // this.ruleForm = { + // name :data.name, + // applicableScope:data.applicableScope, + // copyrightOwnerIdList:data.copyrightOwnerIdList, + // cover:data.cover, + // learningProjectId:data.learningProjectId, + // exhibitionBoardCatIdList:data.exhibitionBoardCatIdList, + // id:data.id, + // exhibitionBoardIdList:data.exhibitionBoardIdList, + // } + this.tableData = data.exhibitionBoardList + // this.multipleSelection = data.exhibitionBoardList + + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–获å–å¦ä¹ 内容展æ¿å…¨éƒ¨åˆ—表 + getLearnContentBoard(){ + let vm = this; + vm.$https({ + url: "learningContentBoard/getList", + method: "get", + authType: this.backToken + }, + {learningContentId:this.$route.query.id} + ) + .then(res => { + let data = res.data.data; + console.log(data) + this.tableData = data + // this.multipleSelection = data + }) + .catch(function(err) { + console.log(err); + }); + }, + close() { + history.go(-1); + }, + handleChange(val) { + console.log(val); + }, + moveUpward(row, index) { + this.getSort(row.id,(this.tableData[index - 1]).id) + if (index > 0) { + let upData = this.tableData[index - 1]; + this.tableData.splice(index - 1, 1); + this.tableData.splice(index, 0, upData); + } else { + this.$message({ + message: "å·²ç»æ˜¯ç¬¬ä¸€æ¡ï¼Œä¸Šç§»å¤±è´¥", + type: "warning" + }); + } + }, + moveDown(row, index) { + this.getSort(row.id,(this.tableData[index + 1]).id) + if (index + 1 == this.tableData.length) { + this.$message({ + message: "å·²ç»æ˜¯æœ€åŽä¸€æ¡ï¼Œä¸‹ç§»å¤±è´¥", + type: "warning" + }); + } else { + let downData = this.tableData[index + 1]; + this.tableData.splice(index + 1, 1); + this.tableData.splice(index, 0, downData); + } + }, + // æŽ’åºæŽ¥å£ + getSort(sourceId,targetId){ + let _this = this; + _this + .$https({ + method: "put", + // url: "learningContentBoard/sort", + url: "learningContentBoard/sortById", + authType: this.backToken + }, + _this.$qs.stringify({ + id:this.$route.query.id, + sourceId:sourceId, + targetId:targetId + })) + .then( + res => { + if(res.data.resultCode === "200"){ + this.$message({ + type: "success", + message: "æˆåŠŸ!" + }); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + }, + error => { + this.$message({ + type: "fail", + message: "失败!" + error.response.data + }); + } + ); + }, + } +}; +</script> + +<style lang="less"> </style> \ No newline at end of file diff --git a/src/page/content/learn/project/add.vue b/src/page/content/learn/project/add.vue new file mode 100644 index 0000000000000000000000000000000000000000..925f42a3a221bc0c2b9931cfe9804bd10deec469 --- /dev/null +++ b/src/page/content/learn/project/add.vue @@ -0,0 +1,671 @@ +<template> + <div class="info"> + <video-dialog ref="videoDialog"></video-dialog> + <!-- <div class="info-header">新建å¦ä¹ 内容</div> --> + <div class="info-header">{{ type === 'Update'?'修改':'新建'}}å¦ä¹ 项目</div> + <div class="info-container"> + <div class="info-wrapper"> + <div class="pageTips"> + <strong>页é¢è¯´æ˜Žï¼š</strong> + “*â€ä¸ºå¿…填项。展æ¿ç±»åˆ«åŠç‰ˆæƒæ–¹æ”¯æŒå¤šé€‰ã€‚展æ¿å¤‡é€‰æ¸…å•ä¸å¯é¢„览备选展æ¿è¯¦æƒ…åŠå±•æ¿å†…包å«çš„视频。 + </div> + <el-form + :model="ruleForm" + :rules="rules" + ref="ruleForm" + label-width="140px" + class="demo-form-inline party-form" + :inline="true" + label-position="top" + > + <el-form-item label="å¦ä¹ 项目åç§°" prop="name" class="w50" style="padding-right: 100px"> + <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> + </el-form-item> + <el-form-item label="å¦ä¹ 项目备注" prop="remarks" class="w50" style="padding-right: 100px"> + <el-input type="textarea" v-model="ruleForm.remarks" style="min-height: 33px;width: 280px;"></el-input> + </el-form-item> + <el-form-item label="主å¦ä¹ 内容åç§°" prop="major" class="w50" style="padding-right: 100px"> + <el-input oninput="value = value.trim()" v-model="ruleForm.major"></el-input> + </el-form-item> + <!-- <el-form-item label="适用范围"> + <span v-show="userType === '1'">全平å°</span> + <el-radio-group v-show="userType !== '1'" v-model="ruleForm.applicableScope"> + <el-radio label="THIS_ORGAN">仅本å•ä½</el-radio> + <el-radio label="THIS_ORGAN_SUB">本å•ä½åŠä¸‹å±žå•ä½</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="所属å¦ä¹ 项目" class="w50" prop="learningProjectId"> + <el-select placeholder="请选择所属å¦ä¹ 项目" v-model="ruleForm.learningProjectId"> + <el-option + v-for="item in learningProjectIdList" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> --> + <el-form-item label="å¦ä¹ å†…å®¹å®£ä¼ å›¾" prop="cover" class="w100"> + <upload-img ref="uploadImg" @imgUrl="imgUrl"></upload-img> + </el-form-item> + <el-form-item label="展æ¿ç‰ˆæƒæ–¹" class="w50" prop="copyrightOwnerIdList"> + <el-select + placeholder="è¯·é€‰æ‹©ç‰ˆæƒæ–¹" + multiple + v-model="ruleForm.copyrightOwnerIdList" + @change="getSelectDep2" + > + <el-checkbox :style="selfstyle" v-model="checkedThing2" @change="selectAllThing2">全选</el-checkbox> + <el-option + v-for="item in assetType2" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="展æ¿ç±»åˆ«" prop="exhibitionBoardCatIdList"> + <el-select + placeholder="请选择展æ¿ç±»åˆ«" + multiple + v-model="ruleForm.exhibitionBoardCatIdList" + @focus="getAssetTypeData" + @change="getSelectDep" + > + <el-checkbox :style="selfstyle" v-model="checkedThing" @change="selectAllThing">全选</el-checkbox> + <el-option + v-for="item in videoContentCat" + :label="item.name" + :value="item.id" + :key="item.id" + ></el-option> + </el-select> + </el-form-item> + + <el-form-item label="展æ¿å¤‡é€‰æ¸…å•" class="w100" prop="exhibitionBoardIdList"> + <div class="party-table"> + <el-table + border + @selection-change="handleSelectionChange" + style="width: 100%" + max-height="400" + ref="multipleTable" + :data="tableData" + > + <el-table-column type="selection" width="55"></el-table-column> + <el-table-column type="index" width="120" label="åºå·"> + </el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿åç§°" prop="name"></el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿ç±»åˆ«" prop="exhibitionBoardCatName"></el-table-column> + <el-table-column show-overflow-tooltip label="展æ¿ç‰ˆæƒæ–¹" prop="boardCopyrightOwnerName"></el-table-column> + <el-table-column label="æ“作" width="180"> + <template slot-scope="scope"> + <div class="table-btn-group"> + <el-tooltip content="视频预览" placement="top"> + <el-button circle @click="videoPreview(scope.row)"> + <i class="icon-table icon-video"></i> + </el-button> + </el-tooltip> + <el-tooltip content="展æ¿é¢„览" placement="top"> + <el-button circle @click="displayPreview(scope.row)"> + <i class="icon-table icon-board"></i> + </el-button> + </el-tooltip> + </div> + + <!-- <el-button + type="text" + style="padding: 0" + @click="videoPreview(scope.row)" + >视频预览</el-button + > + <el-button + type="text" + style="padding: 0" + @click="displayPreview(scope.row)" + >展æ¿é¢„览</el-button + >--> + </template> + </el-table-column> + </el-table> + </div> + </el-form-item> + + </el-form> + + <!--新增弹框--> + <el-dialog + custom-class="party-dialog" + title="展æ¿é¢„览区" + width="468px" + :visible.sync="dialogVisible" + :before-close="closeDialog" + > + <div class="dialog-content"> + <el-form + :model="classForm" + ref="classForm" + label-width="80px" + label-position="top" + :rules="rules" + id="ruleo" + class="party-form" + > + <el-form-item label="展æ¿åç§°"> + <el-input v-model="classForm.name" readonly></el-input> + </el-form-item> + <el-form-item label="ç‰ˆæƒæ–¹"> + <el-input v-model="classForm.boardCopyrightOwnerName" readonly></el-input> + </el-form-item> + <el-form-item label="展æ¿åˆ†ç±»"> + <el-input v-model="classForm.exhibitionBoardCatName" readonly></el-input> + </el-form-item> + <el-form-item label="展æ¿å®£ä¼ 图"> + <img class="imgSize" :src="classForm.cover" alt /> + </el-form-item> + <el-form-item label="简介"> + <el-input type="textarea" v-model="classForm.remarks" readonly></el-input> + </el-form-item> + </el-form> + </div> + </el-dialog> + </div> + </div> + <div class="info-footer"> + <div class="btn-group"> + <!-- 确定ã€å–消 --> + + <el-button + v-show="type === 'add'" + size="mini" + type="primary" + class="btn_form_search" + @click="submitForm('ruleForm')" + >æäº¤å®¡æ ¸</el-button> + <el-button + v-show="type === 'Update'" + size="mini" + type="primary" + class="btn_form_search" + @click="updateForm('ruleForm')" + >æäº¤å®¡æ ¸</el-button> + <el-button size="mini" class="btn_form_search" @click="close">å–æ¶ˆ</el-button> + </div> + </div> + </div> +</template> + +<script> + +let Base64 = require('js-base64').Base64 +import uploadImg from "@/page/content/components/uploadVue/uploadImg"; +import videoDialog from "@/page/content/components/dialog/videoDialog"; +import audioPlay from "@/page/content/components/audioPlay"; +export default { + components: { + uploadImg, + videoDialog, + audioPlay + }, + data() { + return { + selectedFood: [], // 已有值,打开编辑页é¢è°ƒæŽ¥å£æ—¶æ‹¿åˆ° + selectedFood1:[], + dialogVisible: false, + classForm: {}, + type: this.$route.query.type, + learningProjectIdList: "", + videoContentCat: [], + assetType2: [], // ç‰ˆæƒæ–¹åˆ—表 + checkedThing: false, + checkedThing2: false, + selfstyle: { + textAlign: "right", + width: "100%", + paddingRight: "10px" + }, + tableData: [], + ruleForm: { + name: '', + remarks: '', + major: "", //主å¦ä¹ 内容åç§° + // applicableScope: "ALL_PLAT", //适用范围 + cover: "", //å®£ä¼ å›¾ + // learningProjectId: "", //所属å¦ä¹ 项目 + exhibitionBoardCatIdList: [], //展æ¿ç±»åˆ« + copyrightOwnerIdList: [], //ç‰ˆæƒæ–¹ + exhibitionBoardIdList: [] // 展æ¿å¤‡é€‰ + }, + minorLearningContentBoard: [], + rules: { + name: [ + { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, + { min: 1, max: 20, message: "请输入1到20个å—" }, + ], + cover: [ + { + required: true, + message: "请选择å¦ä¹ å†…å®¹å®£ä¼ å›¾" + } + ], + major: [ + { required: true, message: "请输入主å¦ä¹ 内容åç§°", trigger: "blur" }, + { min: 1, max: 20, message: "请输入1到20个å—" } + ], + learningProjectId: [ + { required: true, message: "请选择所属å¦ä¹ 项目", trigger: "change" } + ], + exhibitionBoardCatIdList: [ + { + required: true, + type: "array", + message: "请选择展æ¿ç±»åˆ«", + trigger: "change" + } + ], + copyrightOwnerIdList: [ + { + required: true, + type: "array", + message: "è¯·é€‰æ‹©ç‰ˆæƒæ–¹", + trigger: "change" + } + ], + exhibitionBoardIdList: [ + { + required: true, + type: "array", + message: "请选择展æ¿", + trigger: "change" + } + ] + }, + multipleSelection: [], + userType: "" + }; + }, + mounted() { + this.userType = localStorage.getItem("userType"); + this.init(); + }, + methods: { + // selectInit (row) { + // if(this.minorLearningContentBoard.some(el=>{return el===row.id})){ + // return false; + // }else{ + // return true; + // } + // }, + // 视频预览 + videoPreview(row) { + this.$refs.videoDialog.dialogVisible = true; + const videos = row.videoList + for(var i=0;i<videos.length;i++){ + videos[i].fileUrl = Base64.decode(videos[i].intro) + } + this.$refs.videoDialog.videoList = videos + }, + // 展æ¿é¢„览 + displayPreview(row) { + this.dialogVisible = true; + this.classForm = row; + }, + // å…³é—弹窗 + closeDialog() { + this.dialogVisible = false; + }, + init() { + this.getLearnProject(); + // this.getAssetTypeData(); + this.getAssetTypeData2(); + if (this.$route.query.type === "Update") { + this.getInfo(this.$route.query.id); + } + }, + // 获å–ç‰ˆæƒæ–¹è¯¦æƒ… + getInfo(id) { + let vm = this; + vm.$https({ + url: "learningProject/get/" + id, + method: "get", + authType: this.backToken + }) + .then(res => { + let data = res.data.data; + this.ruleForm = data; + this.ruleForm = { + name: data.name, + remarks:data.remarks, + major: data.majorLearning.name, + applicableScope: data.majorLearning.applicableScope, + copyrightOwnerIdList: data.majorLearning.copyrightOwnerIdList, + cover: data.majorLearning.cover, + learningProjectId: data.majorLearning.learningProjectId, + exhibitionBoardCatIdList: data.majorLearning.exhibitionBoardCatIdList, + id: data.id, + exhibitionBoardIdList: data.majorLearning.exhibitionBoardIdList + }; + // this.tableData = data.exhibitionBoardList; + this.multipleSelection = data.majorLearning.exhibitionBoardList + this.minorLearningContentBoard = data.minorLearningContentBoard + this.selectedFood = data.minorLearningContentCopyright + this.selectedFood1 = data.minorLearningContentCatBoard + this.$refs.uploadImg.showImg(this.ruleForm.cover); + this.getExhibitionBoardTable(); + this.getAssetTypeData() + }) + .catch(function(err) { + console.log(err); + }); + }, + getExhibitionBoardTable() { + const param = { + boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList, + exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList + }; + this.getTableData(param, "update"); + }, + setSelctTable() { + if (!this.multipleSelection.length) { + return false; + } + let _this = this; + let tableData = this.tableData; + let multipleSelection = this.multipleSelection; + tableData.forEach(v => { + multipleSelection.forEach(m => { + if (v.id == m.id) { + _this.$refs.multipleTable.toggleRowSelection(v); + } + }); + }); + }, + // 获å–展æ¿ç±»åˆ«åˆ—表 + getAssetTypeData() { + let vm = this; + if(this.ruleForm.copyrightOwnerIdList.length>0){ + vm.$https({ + url: "exhibitionBoardCat/getList", + method: "post", + authType: this.backToken + },this.$qs.stringify({copyrightOwnerId:this.ruleForm.copyrightOwnerIdList.toString()})) + .then(res => { + let data = res.data.data; + vm.videoContentCat = data; + }) + .catch(function(err) { + console.log(err); + }); + }else{ + this.$message.warning("请先选择展æ¿ç‰ˆæƒæ–¹ï¼") + } + + }, + // 获å–ç‰ˆæƒæ–¹åˆ—表 + getAssetTypeData2() { + let vm = this; + vm.$https( + { + url: "copyrightOwner/getList", + method: "get", + authType: this.backToken + }, + { copyrightOwnerType: "EXHIBITION_BOARD" } + ) + .then(res => { + let data = res.data.data; + // console.log(data,"dhwdhwid") + vm.assetType2 = data; + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–å¦ä¹ 项目列表 + getLearnProject() { + let vm = this; + vm.$https({ + url: "learningProject/getList", + method: "get", + authType: this.backToken + }) + .then(res => { + let data = res.data.data; + vm.learningProjectIdList = data; + }) + .catch(function(err) { + console.log(err); + }); + }, + // 获å–获å–å¦ä¹ 内容展æ¿å…¨éƒ¨åˆ—表 + getLearnContentBoard() { + let vm = this; + vm.$https( + { + url: "learningContentBoard/getList", + method: "get", + authType: this.backToken + }, + { learningContentId: this.$route.query.id } + ) + .then(res => { + let data = res.data.data; + console.log(data); + }) + .catch(function(err) { + console.log(err); + }); + }, + // 多选赋值 + handleSelectionChange(val) { + this.multipleSelection = val; + let newArray = val.map(item => { + return item.id; + }); + this.ruleForm.exhibitionBoardIdList = newArray; + }, + // 新增 + submitForm(formName) { + this.$refs[formName].validate(valid => { + // console.log(this.ruleForm); + if (valid) { + this.$https( + { + url: "/learningProject/save", + method: "post", + authType: this.backToken + }, + // this.ruleForm + this.$qs.stringify(this.ruleForm) + ) + .then(res => { + if(res.data.resultCode === "200"){ + if(this.userType === '1'){ + this.$message({ type: "success", message: "新增å¦ä¹ 内容申请已æäº¤,å¾…å®¡æ ¸ï¼" }); + }else{ + this.$message({ type: "success", message: "新增æˆåŠŸï¼" }); + } + history.go(-1); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + }) + .catch(function(err) { + console.log(err); + }); + } else { + console.log("error submit!!"); + return false; + } + }); + }, + // ä¿®æ”¹ç‰ˆæƒæ–¹ + updateForm(formName) { + this.$refs[formName].validate(valid => { + if (valid) { + this.$https( + { + url: "learningProject/update", + method: "put", + authType: this.backToken + }, + this.$qs.stringify(this.ruleForm) + // this.ruleForm + ) + .then(res => { + if(res.data.resultCode === "200"){ + if(this.userType === '1'){ + this.$message({ type: "success", message: "修改å¦ä¹ 内容申请已æäº¤,å¾…å®¡æ ¸ï¼" }); + }else{ + this.$message({ type: "success", message: "修改æˆåŠŸï¼" }); + } + + history.go(-1); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + }) + .catch(function(err) { + console.log(err); + }); + } else { + console.log("error submit!!"); + return false; + } + }); + }, + + imgUrl(url) { + this.ruleForm.cover = url; + this.$refs.ruleForm.validateField("cover"); + }, + // 展æ¿ç±»åˆ«å‘生å˜åŒ– + getSelectDep(exhibitionBoardCatIdList) { + if (exhibitionBoardCatIdList.length === this.videoContentCat.length) { + this.checkedThing = true; + } else { + this.checkedThing = false; + } + this.getTableParam() + }, + clearData(list) { + // console.log(list) + }, + // + getSelectDep2(exhibitionBoardCatIdList) { + if (exhibitionBoardCatIdList.length === this.assetType2.length) { + this.checkedThing2 = true; + } else { + this.checkedThing2 = false; + } + // this.getTableParam() + }, + // ç›é€‰å±•æ¿å¤‡é€‰æ¸…å•选项æ¡ä»¶ + getTableParam(){ + // debugger + const param = { + boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList.toString(), + exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList.toString() + }; + if((param.boardCopyrightOwnerIdList.length>0)&&(param.exhibitionBoardCatIdList.length>0)){ + this.getTableData(param); + }else{ + this.tableData = [] + } + }, + // æ ¹æ®å±•æ¿ç±»åˆ«ï¼Œç‰ˆæƒæ–¹èŽ·å–展æ¿å¤‡é€‰æ¸…å• + getTableData(param, type) { + + let vm = this; + vm.$https( + { + url: "exhibitionBoard/getList", + method: "post", + authType: this.backToken + }, + vm.$qs.stringify(param) + ) + .then(res => { + // alert(1) + // console.log(res) + let data = res.data.data; + vm.tableData = data; + // console.log(222222222222,vm.tableData) + if (type) { + // 选ä¸è¡¨æ ¼æ•°æ® + setTimeout(() => { + vm.setSelctTable(); + }, 1000); + } + }) + .catch(function(err) { + console.log(err); + }); + }, + + selectAllThing() { + // debugger + + this.ruleForm.exhibitionBoardCatIdList = []; + if (this.checkedThing) { + this.videoContentCat.map(item => { + this.ruleForm.exhibitionBoardCatIdList.push(item.id); + }); + } else { + this.ruleForm.exhibitionBoardCatIdList = []; + } + this.getTableParam() + }, + selectAllThing2() { + // debugger + this.ruleForm.copyrightOwnerIdList = []; + if (this.checkedThing2) { + this.assetType2.map(item => { + this.ruleForm.copyrightOwnerIdList.push(item.id); + }); + } else { + this.ruleForm.copyrightOwnerIdList = []; + } + }, + + // 新增 + addSubmit() { + // è‡³å°‘é€‰ä¸€ä¸ªå¤‡é€‰æ¸…å• æç¤º + alert("请先至少选择一个展æ¿å¤‡é€‰æ¸…å•"); + }, + close() { + history.go(-1); + }, + moveUpward(row, index) { + if (index > 0) { + let upData = this.tableData[index - 1]; + this.tableData.splice(index - 1, 1); + this.tableData.splice(index, 0, upData); + } else { + this.$message({ + message: "å·²ç»æ˜¯ç¬¬ä¸€æ¡ï¼Œä¸Šç§»å¤±è´¥", + type: "warning" + }); + } + }, + moveDown(row, index) { + if (index + 1 == this.tableData.length) { + this.$message({ + message: "å·²ç»æ˜¯æœ€åŽä¸€æ¡ï¼Œä¸‹ç§»å¤±è´¥", + type: "warning" + }); + } else { + let downData = this.tableData[index + 1]; + this.tableData.splice(index + 1, 1); + this.tableData.splice(index, 0, downData); + } + } + } +}; +</script> + +<style lang="less"> +.none { + display: none !important; +} +@import "../../../../style/table.less"; +</style> diff --git a/src/page/content/learn/project/index.vue b/src/page/content/learn/project/index.vue index 6f62848ccb50560a334da80e7e9ec70476cd8f96..ff0c829d056a2d62fba6de2027f4e01e2af395fc 100644 --- a/src/page/content/learn/project/index.vue +++ b/src/page/content/learn/project/index.vue @@ -1,397 +1,401 @@ -<template> - <div class="listPage H100"> - <div class="search-container"> - <el-form :inline="true" :model="form" ref="form" onsubmit="return false;"> - <el-form-item> - <el-input - placeholder="请输入å¦ä¹ 项目åç§°" - v-model="form.nameOrCode" - @keyup.enter.native="Search" - clearable - ></el-input> - </el-form-item> - <el-form-item> - <el-date-picker - value-format="yyyy-MM-dd" - v-model="value1" - type="daterange" - range-separator="至" - start-placeholder="开始日期" - end-placeholder="ç»“æŸæ—¥æœŸ" - ></el-date-picker> - </el-form-item> - <el-form-item> - <div class="btn-group"> - <el-button type="primary" class="btn_form_search" @click="Search" - >查询</el-button - > - <el-button class="btn_form_search" @click="Reset">é‡ç½®</el-button> - </div> - </el-form-item> - </el-form> - <div class="page-tip"> - <span class="page-tip-title">页é¢è¯´æ˜Ž:</span> - <span class="page-tips" - >展示系统所有的å¦ä¹ é¡¹ç›®ï¼Œå¯æŒ‰ç…§æ—¶é—´åŠç›¸å…³åç§°è¿›è¡Œå¿«é€Ÿä¿¡æ¯æœç´¢ã€‚</span - > - </div> - </div> - <div class="table-content"> - <div class="btn-group"> - <el-button type="primary" @click="addPermis()">新建å¦ä¹ 项目</el-button> - </div> - <div class="party-table"> - <el-table - border - style="width: 100%; height: 100%" - height="100%" - ref="multipleTable" - :data="tableData" - > - <el-table-column type="index" width="120" label="åºå·"> - <template slot-scope="scope"> - <span>{{ (page.currentPage - 1) * 10 + scope.$index + 1 }}</span> - </template> - </el-table-column> - <el-table-column label="å¦ä¹ 项目åç§°" prop="name"></el-table-column> - <el-table-column label="创建时间" prop="createTime"></el-table-column> - <el-table-column - label="相关å¦ä¹ 内容" - prop="learningContentNames" - ></el-table-column> - <el-table-column label="备注" prop="remarks"></el-table-column> - <el-table-column label="æ“作" header-align="center" align="center"> - <template slot-scope="scope" width="220"> - <div class="table-btn-group"> - <el-tooltip content="修改" placement="top"> - <el-button circle @click="openEdit(scope.row)"> - <i class="icon-table icon-edit"></i> - </el-button> - </el-tooltip> - <el-tooltip content="åˆ é™¤" placement="top"> - <el-button circle @click="handleDelete(scope.row)"> - <i class="icon-table icon-del"></i> - </el-button> - </el-tooltip> - </div> - </template> - </el-table-column> - </el-table> - </div> - <div class="partyt-pagination"> - <el-pagination - @current-change="handleCurrentChange" - :current-page="page.currentPage" - :page-size="page.pageSize" - layout="prev, pager, next, jumper" - :total="page.total" - ></el-pagination> - </div> - </div> - <!--新增弹框--> - <el-dialog - title="新建" - custom-class="party-dialog" - width="468px" - :visible.sync="FormVisible1" - :before-close="close" - > - <div class="dialog-content"> - <el-form - :model="classForm" - ref="classForm" - label-width="80px" - label-position="top" - :rules="rule" - id="ruleo" - class="party-form" - > - <el-form-item label="å¦ä¹ 项目åç§°" prop="name"> - <el-input oninput="value = value.trim()" v-model="classForm.name"></el-input> - </el-form-item> - <el-form-item label="备注" prop="remarks"> - <el-input type="textarea" v-model="classForm.remarks"></el-input> - </el-form-item> - </el-form> - </div> - <div slot="footer" class="dialog-footer btn-group"> - <el-button size="mini" v-show="type" type="primary" @click="handleSubmit('save')" - >确定</el-button - > - <el-button size="mini" v-show="!type" type="primary" @click="handleSubmit('edit')" - >确定</el-button - > - <el-button size="mini" @click="close">å– æ¶ˆ</el-button> - </div> - </el-dialog> - </div> -</template> -<script> -export default { - data() { - return { - type: true, - value1: "", - page: { currentPage: 1, pageSize: 10, total: 0 }, - tableData: [], - FormVisible: false, - FormVisible1: false, - formLabelWidth: "100px", - form: { - name: "", - }, - editform: { - menuName: "", - menuUrl: "", - parentId: "", - sort: "", - id: "", - }, - classForm: { - id: "", - name: "", - remarks: "", - }, - typeList: [], - rule:{ - name: [ - { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, - { min: 1, max: 20, message: "请输入1到20个å—" }, - ], - remarks:[ - { min: 1, max: 100, message: "请输入1到100个å—" }, - ] - }, - rules: { - name: [ - { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, - { min: 1, max: 20, message: "请输入1到20个å—" }, - ], - // remarks:[ - // { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, - // { min: 1, max: 2, message: "请输入1到20个å—" }, - // ] - }, - value: "", - name: "", - }; - }, - computed: {}, - mounted() { - this.onSearch(); - }, - components: {}, - methods: { - // èŽ·å¾—æ•°æ®æŽ¥å£ - getTableData(param) { - let vm = this; - vm.$https( - { - url: "learningProject/getPageList", - method: "post", - authType: this.backToken, - }, - vm.$qs.stringify(param) - // param - ) - .then((res) => { - let data = res.data.data; - vm.page.pageSize = data.size; - vm.page.total = data.total; - vm.tableData = data.records; - }) - .catch(function (err) { - console.log(err); - }); - }, - // 分页 - handleCurrentChange(val) { - let _this = this; - _this.page.currentPage = val; - _this.onSearch(); - }, - onSearch() { - let _this = this; - let param = _this.getSearchQuery(); - _this.getTableData(param); - }, - Search() { - let _this = this; - _this.page.currentPage = 1; - let searchObj = { - _index: 1, - _size: _this.page.pageSize, - nameOrCode: _this.form.nameOrCode, - startDate: this.value1 ? this.value1[0] : "", - endDate: this.value1 ? this.value1[1] : "", - }; - this.getTableData(searchObj); - }, - // é‡ç½® - Reset() { - this.form = {}; - this.value1= [] - this.Search(); - }, - // // 获å–当剿Ÿ¥è¯¢å‚æ•° - getSearchQuery() { - let _this = this; - let searchObj = { - _index: _this.page.currentPage, - _size: _this.page.pageSize, - }; - for (let key in _this.form) { - if (_this.form[key]) { - searchObj[key] = _this.form[key]; - } - } - return searchObj; - }, - // æ·»åŠ - addPermis() { - // this.$router.push({ path: "videoContentAdd", query: { type: "add" } }); - $(".el-dialog__title").html("新建"); - this.FormVisible1 = true; - this.type = true; - }, - handleSubmit(type) { - let httpUrl, httpMethod,requestParams; - if (type === "save") { - httpUrl = "learningProject/save"; - httpMethod = "post"; - } - if (type === "edit") { - httpUrl = "learningProject/update"; - httpMethod = "put"; - } - requestParams = {...this.classForm} - this.handleSave(httpUrl,httpMethod,requestParams) - }, - handleSave(url,method,requestParams){ - let _this = this; - _this.$refs.classForm.validate((valid) => { - if (valid) { - _this.$https( - { - url: url, - method: method, - authType: this.backToken, - }, - _this.$qs.stringify(requestParams) - ) - .then( - (res) => { - if (res.data.resultCode === "200" || res.data.resultCode === "201") { - _this.$message({ - type: "success", - message: res.data.message, - }); - //跳回用户列表 - _this.onSearch(); - _this.FormVisible1 = false; - for (let key in _this.classForm) { - _this.classForm[key] = null; - } - _this.$refs["classForm"].resetFields(); - } else { - _this.$message({ - type: "error", - message: res.data.message, - }); - } - }, - (error) => { - _this.$message({ - type: "error", - message: error, - }); - } - ); - } - }); - }, - // ç¼–è¾‘å…³é— - close() { - this.FormVisible1 = false; - for (let key in this.classForm) { - this.classForm[key] = null; - } - this.$refs["classForm"].resetFields(); - }, - // 编辑弹框 - openEdit(row) { - this.type = false; - $(".el-dialog__title").html("编辑"); - let _this = this; - _this.FormVisible1 = true; - this.getAssetTypeInfo(row.id); - }, - // 获å–视频分类详情 - getAssetTypeInfo(id) { - let vm = this; - vm.$https( - { - url: "learningProject/get/" + id, - method: "get", - authType: this.backToken, - } - // param - ) - .then((res) => { - let data = res.data.data; - this.classForm.id = data.id; - this.classForm.name = data.name; - this.classForm.remarks = data.remarks; - }) - .catch(function (err) { - console.log(err); - }); - }, - openDetails() { - let _this = this; - _this.FormVisible = true; - }, - // åˆ é™¤ - handleDelete(row) { - let _this = this; - this.$confirm("æ¤æ“ä½œå°†æ°¸ä¹…åˆ é™¤, 是å¦ç»§ç»?", "æç¤º", { - confirmButtonText: "确定", - cancelButtonText: "å–æ¶ˆ", - type: "warning", - }) - .then(() => { - _this - .$https({ - method: "delete", - url: "learningProject/delete/" + row.id, - authType: this.backToken, - }) - .then( - (res) => { - if(res.data.resultCode==='200'){ - this.$message({ type: "success", message: "åˆ é™¤æˆåŠŸ!" }); - _this.Search(); - }else{ - this.$message({ type: "error", message: res.data.message }); - } - - }, - (error) => { - this.$message({ - type: "fail", - message: "åˆ é™¤å¤±è´¥!" + error.response.data, - }); - } - ); - }) - .catch(() => {}); - } - } -}; -</script> - -<style lang="less"> -@import "../../../../style/dialog.less"; -@import "../../../../style/table.less"; -@import "../../../../style/pagination.less"; -</style> +<template> + <div class="listPage H100"> + <div class="search-container"> + <el-form :inline="true" :model="form" ref="form" onsubmit="return false;"> + <el-form-item> + <el-input + placeholder="请输入å¦ä¹ 项目åç§°" + v-model="form.nameOrCode" + @keyup.enter.native="Search" + clearable + ></el-input> + </el-form-item> + <el-form-item> + <el-date-picker + value-format="yyyy-MM-dd" + v-model="value1" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="ç»“æŸæ—¥æœŸ" + ></el-date-picker> + </el-form-item> + <el-form-item> + <div class="btn-group"> + <el-button type="primary" class="btn_form_search" @click="Search" + >查询</el-button + > + <el-button class="btn_form_search" @click="Reset">é‡ç½®</el-button> + </div> + </el-form-item> + </el-form> + <div class="page-tip"> + <span class="page-tip-title">页é¢è¯´æ˜Ž:</span> + <span class="page-tips" + >展示系统所有的å¦ä¹ é¡¹ç›®ï¼Œå¯æŒ‰ç…§æ—¶é—´åŠç›¸å…³åç§°è¿›è¡Œå¿«é€Ÿä¿¡æ¯æœç´¢ã€‚</span + > + </div> + </div> + <div class="table-content"> + <div class="btn-group"> + <el-button type="primary" @click="addPermis()">新建å¦ä¹ 项目</el-button> + </div> + <div class="party-table"> + <el-table + border + style="width: 100%; height: 100%" + height="100%" + ref="multipleTable" + :data="tableData" + > + <el-table-column type="index" width="120" label="åºå·"> + <template slot-scope="scope"> + <span>{{ (page.currentPage - 1) * 10 + scope.$index + 1 }}</span> + </template> + </el-table-column> + <el-table-column label="å¦ä¹ 项目åç§°" prop="name"></el-table-column> + <el-table-column label="创建时间" prop="createTime"></el-table-column> + <el-table-column + label="相关å¦ä¹ 内容" + prop="learningContentNames" + ></el-table-column> + <el-table-column label="备注" prop="remarks"></el-table-column> + <el-table-column label="æ“作" header-align="center" align="center"> + <template slot-scope="scope" width="220"> + <div class="table-btn-group"> + <el-tooltip content="修改" placement="top"> + <el-button circle @click="openEdit(scope.row)"> + <i class="icon-table icon-edit"></i> + </el-button> + </el-tooltip> + <el-tooltip content="åˆ é™¤" placement="top"> + <el-button circle @click="handleDelete(scope.row)"> + <i class="icon-table icon-del"></i> + </el-button> + </el-tooltip> + </div> + </template> + </el-table-column> + </el-table> + </div> + <div class="partyt-pagination"> + <el-pagination + @current-change="handleCurrentChange" + :current-page="page.currentPage" + :page-size="page.pageSize" + layout="prev, pager, next, jumper" + :total="page.total" + ></el-pagination> + </div> + </div> + <!--新增弹框--> + <el-dialog + title="新建" + custom-class="party-dialog" + width="468px" + :visible.sync="FormVisible1" + :before-close="close" + > + <div class="dialog-content"> + <el-form + :model="classForm" + ref="classForm" + label-width="80px" + label-position="top" + :rules="rule" + id="ruleo" + class="party-form" + > + <el-form-item label="å¦ä¹ 项目åç§°" prop="name"> + <el-input oninput="value = value.trim()" v-model="classForm.name"></el-input> + </el-form-item> + <el-form-item label="备注" prop="remarks"> + <el-input type="textarea" v-model="classForm.remarks"></el-input> + </el-form-item> + </el-form> + </div> + <div slot="footer" class="dialog-footer btn-group"> + <el-button size="mini" v-show="type" type="primary" @click="handleSubmit('save')" + >确定</el-button + > + <el-button size="mini" v-show="!type" type="primary" @click="handleSubmit('edit')" + >确定</el-button + > + <el-button size="mini" @click="close">å– æ¶ˆ</el-button> + </div> + </el-dialog> + </div> +</template> +<script> +export default { + data() { + return { + type: true, + value1: "", + page: { currentPage: 1, pageSize: 10, total: 0 }, + tableData: [], + FormVisible: false, + FormVisible1: false, + formLabelWidth: "100px", + form: { + name: "", + }, + editform: { + menuName: "", + menuUrl: "", + parentId: "", + sort: "", + id: "", + }, + classForm: { + id: "", + name: "", + remarks: "", + }, + typeList: [], + rule:{ + name: [ + { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, + { min: 1, max: 20, message: "请输入1到20个å—" }, + ], + remarks:[ + { min: 1, max: 100, message: "请输入1到100个å—" }, + ] + }, + rules: { + name: [ + { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, + { min: 1, max: 20, message: "请输入1到20个å—" }, + ], + // remarks:[ + // { required: true, message: "请输入å¦ä¹ 项目åç§°", trigger: "blur" }, + // { min: 1, max: 2, message: "请输入1到20个å—" }, + // ] + }, + value: "", + name: "", + }; + }, + computed: {}, + mounted() { + this.onSearch(); + }, + components: {}, + methods: { + // èŽ·å¾—æ•°æ®æŽ¥å£ + getTableData(param) { + let vm = this; + vm.$https( + { + url: "learningProject/getPageList", + method: "post", + authType: this.backToken, + }, + vm.$qs.stringify(param) + // param + ) + .then((res) => { + let data = res.data.data; + vm.page.pageSize = data.size; + vm.page.total = data.total; + vm.tableData = data.records; + }) + .catch(function (err) { + console.log(err); + }); + }, + // 分页 + handleCurrentChange(val) { + let _this = this; + _this.page.currentPage = val; + _this.onSearch(); + }, + onSearch() { + let _this = this; + let param = _this.getSearchQuery(); + _this.getTableData(param); + }, + Search() { + let _this = this; + _this.page.currentPage = 1; + let searchObj = { + _index: 1, + _size: _this.page.pageSize, + nameOrCode: _this.form.nameOrCode, + startDate: this.value1 ? this.value1[0] : "", + endDate: this.value1 ? this.value1[1] : "", + }; + this.getTableData(searchObj); + }, + // é‡ç½® + Reset() { + this.form = {}; + this.value1= [] + this.Search(); + }, + // // 获å–当剿Ÿ¥è¯¢å‚æ•° + getSearchQuery() { + let _this = this; + let searchObj = { + _index: _this.page.currentPage, + _size: _this.page.pageSize, + }; + for (let key in _this.form) { + if (_this.form[key]) { + searchObj[key] = _this.form[key]; + } + } + return searchObj; + }, + // æ·»åŠ + addPermis() { + this.$router.push({ path: "learnProjectAdd", query: { type: "add" } }); + // $(".el-dialog__title").html("新建"); + // this.FormVisible1 = true; + // this.type = true; + }, + handleSubmit(type) { + let httpUrl, httpMethod,requestParams; + if (type === "save") { + httpUrl = "learningProject/save"; + httpMethod = "post"; + } + if (type === "edit") { + httpUrl = "learningProject/update"; + httpMethod = "put"; + } + requestParams = {...this.classForm} + this.handleSave(httpUrl,httpMethod,requestParams) + }, + handleSave(url,method,requestParams){ + let _this = this; + _this.$refs.classForm.validate((valid) => { + if (valid) { + _this.$https( + { + url: url, + method: method, + authType: this.backToken, + }, + _this.$qs.stringify(requestParams) + ) + .then( + (res) => { + if (res.data.resultCode === "200" || res.data.resultCode === "201") { + _this.$message({ + type: "success", + message: res.data.message, + }); + //跳回用户列表 + _this.onSearch(); + _this.FormVisible1 = false; + for (let key in _this.classForm) { + _this.classForm[key] = null; + } + _this.$refs["classForm"].resetFields(); + } else { + _this.$message({ + type: "error", + message: res.data.message, + }); + } + }, + (error) => { + _this.$message({ + type: "error", + message: error, + }); + } + ); + } + }); + }, + // ç¼–è¾‘å…³é— + close() { + this.FormVisible1 = false; + for (let key in this.classForm) { + this.classForm[key] = null; + } + this.$refs["classForm"].resetFields(); + }, + // 编辑弹框 + openEdit(row) { + this.$router.push({ + path: "learnProjectUpdate", + query: { type: "Update", id: row.id }, + }); + // this.type = false; + // $(".el-dialog__title").html("编辑"); + // let _this = this; + // _this.FormVisible1 = true; + // this.getAssetTypeInfo(row.id); + }, + // 获å–视频分类详情 + getAssetTypeInfo(id) { + let vm = this; + vm.$https( + { + url: "learningProject/get/" + id, + method: "get", + authType: this.backToken, + } + // param + ) + .then((res) => { + let data = res.data.data; + this.classForm.id = data.id; + this.classForm.name = data.name; + this.classForm.remarks = data.remarks; + }) + .catch(function (err) { + console.log(err); + }); + }, + openDetails() { + let _this = this; + _this.FormVisible = true; + }, + // åˆ é™¤ + handleDelete(row) { + let _this = this; + this.$confirm("æ¤æ“ä½œå°†æ°¸ä¹…åˆ é™¤, 是å¦ç»§ç»?", "æç¤º", { + confirmButtonText: "确定", + cancelButtonText: "å–æ¶ˆ", + type: "warning", + }) + .then(() => { + _this + .$https({ + method: "delete", + url: "learningProject/delete/" + row.id, + authType: this.backToken, + }) + .then( + (res) => { + if(res.data.resultCode==='200'){ + this.$message({ type: "success", message: "åˆ é™¤æˆåŠŸ!" }); + _this.Search(); + }else{ + this.$message({ type: "error", message: res.data.message }); + } + + }, + (error) => { + this.$message({ + type: "fail", + message: "åˆ é™¤å¤±è´¥!" + error.response.data, + }); + } + ); + }) + .catch(() => {}); + } + } +}; +</script> + +<style lang="less"> +@import "../../../../style/dialog.less"; +@import "../../../../style/table.less"; +@import "../../../../style/pagination.less"; +</style> diff --git a/src/router/learn.js b/src/router/learn.js index 8d20112a02587516657390716747aa61550fe069..d3ac2cfb438b31e1b062188569e0e0ae81505877 100644 --- a/src/router/learn.js +++ b/src/router/learn.js @@ -1,237 +1,255 @@ -// å†…å®¹ç®¡ç† -const videoCopyrightAdd = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightAdd'); -const videoCopyrightUpdate = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightUpdate'); - -const videoContentAdd = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentAdd'); -const videoContentUpdate = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentUpdate'); -export let learnRoute = [ - { - path: '/videoCopyrightAdd', - name: 'æ–°å»ºç‰ˆæƒæ–¹', - component: videoCopyrightAdd, - meta: { - showBreadcrumb: true, - title: 'æ–°å»ºç‰ˆæƒæ–¹', - } - }, - { - path: '/videoCopyrightUpdate', - name: 'ä¿®æ”¹ç‰ˆæƒæ–¹', - component: videoCopyrightUpdate, - meta: { - showBreadcrumb: true, - title: 'ä¿®æ”¹ç‰ˆæƒæ–¹', - } - }, - { - path: '/videoContentAdd', - name: '新建视频', - component: videoContentAdd, - meta: { - showBreadcrumb: true, - title: '新建视频', - } - }, - { - path: '/videoContentUpdate', - name: '修改视频', - component: videoContentUpdate, - meta: { - showBreadcrumb: true, - title: '修改视频', - } - }, - { - path: '/videoCopyright', - name: 'è§†é¢‘ç‰ˆæƒæ–¹ç®¡ç†', - component: () => import('@/page/content/video/copyright/index'), - meta: { - showBreadcrumb: true, - title: 'è§†é¢‘ç‰ˆæƒæ–¹ç®¡ç†', - } - }, - { - path: '/videoClassify', - name: '视频分类管ç†', - component: () => import('@/page/content/video/classify/index'), - meta: { - showBreadcrumb: true, - title: '视频分类管ç†', - } - }, - { - path: '/videoContent', - name: '视频内容管ç†', - component: () => import('@/page/content/video/content/index'), - meta: { - showBreadcrumb: true, - title: '视频内容管ç†', - } - }, - { - path: '/videoRemit', - name: '视频汇出', - component: () => import('@/page/content/video/remit/index'), - meta: { - showBreadcrumb: true, - title: '视频汇出', - } - }, - // --- å±•æ¿ - { - path: '/displayCopyright', - name: '展æ¿ç‰ˆæƒæ–¹ç®¡ç†', - component: () => import('@/page/content/display/copyright/index'), - meta: { - showBreadcrumb: true, - title: '展æ¿ç‰ˆæƒæ–¹ç®¡ç†', - } - }, - { - path: '/displayCopyrightAdd', - name: '新建展æ¿ç‰ˆæƒæ–¹', - component: () => import('@/page/content/display/copyright/add'), - meta: { - showBreadcrumb: true, - title: '新建展æ¿ç‰ˆæƒæ–¹', - } - }, - { - path: '/displayCopyrightUpdate', - name: '修改展æ¿ç‰ˆæƒæ–¹', - component: () => import('@/page/content/display/copyright/add'), - meta: { - showBreadcrumb: true, - title: '修改展æ¿ç‰ˆæƒæ–¹', - } - }, - { - path: '/displayClassify', - name: '展æ¿åˆ†ç±»ç®¡ç†', - component: () => import('@/page/content/display/classify/index'), - meta: { - showBreadcrumb: true, - title: '展æ¿åˆ†ç±»ç®¡ç†', - } - }, - { - path: '/displayContent', - name: '展æ¿å†…容管ç†', - component: () => import('@/page/content/display/content/index'), - meta: { - showBreadcrumb: true, - title: '展æ¿å†…容管ç†', - } - }, - { - path: '/displayContentAdd', - name: '新建展æ¿', - component: () => import('@/page/content/display/content/add'), - meta: { - showBreadcrumb: true, - title: '新建展æ¿', - } - }, - { - path: '/displayContentUpdate', - name: '修改展æ¿', - component: () => import('@/page/content/display/content/add'), - meta: { - showBreadcrumb: true, - title: '修改展æ¿', - } - }, - { - path: '/displayContentDetails', - name: '展æ¿ç®¡ç†è¯¦æƒ…', - component: () => import('@/page/content/display/content/details'), - meta: { - showBreadcrumb: true, - title: '展æ¿ç®¡ç†è¯¦æƒ…', - } - }, - // --å¦ä¹ - { - path: '/learnProject', - name: 'å¦ä¹ 项目管ç†', - component: () => import('@/page/content/learn/project/index'), - meta: { - showBreadcrumb: true, - title: 'å¦ä¹ 项目管ç†', - } - }, - { - path: '/learnContent', - name: 'å¦ä¹ 内容制作', - component: () => import('@/page/content/learn/content/index'), - meta: { - showBreadcrumb: true, - title: 'å¦ä¹ 内容制作', - } - }, - { - path: '/learnContentAdd', - name: '新建å¦ä¹ 内容', - component: () => import('@/page/content/learn/content/add'), - meta: { - showBreadcrumb: true, - title: '新建å¦ä¹ 内容', - } - }, - { - path: '/learnContentUpdate', - name: '修改å¦ä¹ 内容', - component: () => import('@/page/content/learn/content/add'), - meta: { - showBreadcrumb: true, - title: '修改å¦ä¹ 内容', - } - }, - { - path: '/learnContentDetails', - name: 'å¦ä¹ 内容详情', - component: () => import('@/page/content/learn/content/details'), - meta: { - showBreadcrumb: true, - title: 'å¦ä¹ 内容详情', - } - }, - - // å®¡æ ¸ - { - path: '/checkVideo', - name: 'è§†é¢‘å®¡æ ¸', - component: () => import('@/page/check/video/index'), - meta: { - showBreadcrumb: true, - title: 'è§†é¢‘å®¡æ ¸', - } - }, - { - path: '/checkDisplay', - name: '展æ¿å®¡æ ¸', - component: () => import('@/page/check/display/index'), - meta: { - showBreadcrumb: true, - title: '展æ¿å®¡æ ¸', - } - }, - { - path: '/checkLearn', - name: 'å¹³å°å¦ä¹ å†…å®¹å®¡æ ¸', - component: () => import('@/page/check/learn/index'), - meta: { - showBreadcrumb: true, - title: 'å¹³å°å¦ä¹ å†…å®¹å®¡æ ¸', - } - }, - { - path: '/checkLearnDetails', - name: 'å¦ä¹ 内容详情', - component: () => import('@/page/check/learn/details'), - meta: { - showBreadcrumb: true, - title: 'å¦ä¹ 内容详情', - } - } -] +// å†…å®¹ç®¡ç† +const videoCopyrightAdd = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightAdd'); +const videoCopyrightUpdate = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightUpdate'); + +const videoContentAdd = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentAdd'); +const videoContentUpdate = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentUpdate'); +export let learnRoute = [ + { + path: '/videoCopyrightAdd', + name: 'æ–°å»ºç‰ˆæƒæ–¹', + component: videoCopyrightAdd, + meta: { + showBreadcrumb: true, + title: 'æ–°å»ºç‰ˆæƒæ–¹', + } + }, + { + path: '/videoCopyrightUpdate', + name: 'ä¿®æ”¹ç‰ˆæƒæ–¹', + component: videoCopyrightUpdate, + meta: { + showBreadcrumb: true, + title: 'ä¿®æ”¹ç‰ˆæƒæ–¹', + } + }, + { + path: '/videoContentAdd', + name: '新建视频', + component: videoContentAdd, + meta: { + showBreadcrumb: true, + title: '新建视频', + } + }, + { + path: '/videoContentUpdate', + name: '修改视频', + component: videoContentUpdate, + meta: { + showBreadcrumb: true, + title: '修改视频', + } + }, + { + path: '/videoCopyright', + name: 'è§†é¢‘ç‰ˆæƒæ–¹ç®¡ç†', + component: () => import('@/page/content/video/copyright/index'), + meta: { + showBreadcrumb: true, + title: 'è§†é¢‘ç‰ˆæƒæ–¹ç®¡ç†', + } + }, + { + path: '/videoClassify', + name: '视频分类管ç†', + component: () => import('@/page/content/video/classify/index'), + meta: { + showBreadcrumb: true, + title: '视频分类管ç†', + } + }, + { + path: '/videoContent', + name: '视频内容管ç†', + component: () => import('@/page/content/video/content/index'), + meta: { + showBreadcrumb: true, + title: '视频内容管ç†', + } + }, + { + path: '/videoRemit', + name: '视频汇出', + component: () => import('@/page/content/video/remit/index'), + meta: { + showBreadcrumb: true, + title: '视频汇出', + } + }, + // --- å±•æ¿ + { + path: '/displayCopyright', + name: '展æ¿ç‰ˆæƒæ–¹ç®¡ç†', + component: () => import('@/page/content/display/copyright/index'), + meta: { + showBreadcrumb: true, + title: '展æ¿ç‰ˆæƒæ–¹ç®¡ç†', + } + }, + { + path: '/displayCopyrightAdd', + name: '新建展æ¿ç‰ˆæƒæ–¹', + component: () => import('@/page/content/display/copyright/add'), + meta: { + showBreadcrumb: true, + title: '新建展æ¿ç‰ˆæƒæ–¹', + } + }, + { + path: '/displayCopyrightUpdate', + name: '修改展æ¿ç‰ˆæƒæ–¹', + component: () => import('@/page/content/display/copyright/add'), + meta: { + showBreadcrumb: true, + title: '修改展æ¿ç‰ˆæƒæ–¹', + } + }, + { + path: '/displayClassify', + name: '展æ¿åˆ†ç±»ç®¡ç†', + component: () => import('@/page/content/display/classify/index'), + meta: { + showBreadcrumb: true, + title: '展æ¿åˆ†ç±»ç®¡ç†', + } + }, + { + path: '/displayContent', + name: '展æ¿å†…容管ç†', + component: () => import('@/page/content/display/content/index'), + meta: { + showBreadcrumb: true, + title: '展æ¿å†…容管ç†', + } + }, + { + path: '/displayContentAdd', + name: '新建展æ¿', + component: () => import('@/page/content/display/content/add'), + meta: { + showBreadcrumb: true, + title: '新建展æ¿', + } + }, + { + path: '/displayContentUpdate', + name: '修改展æ¿', + component: () => import('@/page/content/display/content/add'), + meta: { + showBreadcrumb: true, + title: '修改展æ¿', + } + }, + { + path: '/displayContentDetails', + name: '展æ¿ç®¡ç†è¯¦æƒ…', + component: () => import('@/page/content/display/content/details'), + meta: { + showBreadcrumb: true, + title: '展æ¿ç®¡ç†è¯¦æƒ…', + } + }, + // --å¦ä¹ + { + path: '/learnProject', + name: 'å¦ä¹ 项目管ç†', + component: () => import('@/page/content/learn/project/index'), + meta: { + showBreadcrumb: true, + title: 'å¦ä¹ 项目管ç†', + } + }, + { + path: '/learnContent', + name: 'å¦ä¹ 内容制作', + component: () => import('@/page/content/learn/content/index'), + meta: { + showBreadcrumb: true, + title: 'å¦ä¹ 内容制作', + } + }, + { + path: '/learnContentAdd', + name: '新建å¦ä¹ 内容', + component: () => import('@/page/content/learn/content/add'), + meta: { + showBreadcrumb: true, + title: '新建å¦ä¹ 内容', + } + }, + { + path: '/learnProjectAdd', + name: '新建å¦ä¹ 项目', + component: () => import('@/page/content/learn/project/add'), + meta: { + showBreadcrumb: true, + title: '新建å¦ä¹ 项目', + } + }, + { + path: '/learnProjectUpdate', + name: '修改å¦ä¹ 项目', + component: () => import('@/page/content/learn/project/add'), + meta: { + showBreadcrumb: true, + title: '修改å¦ä¹ 项目', + } + }, + { + path: '/learnContentUpdate', + name: '修改å¦ä¹ 内容', + component: () => import('@/page/content/learn/content/add'), + meta: { + showBreadcrumb: true, + title: '修改å¦ä¹ 内容', + } + }, + { + path: '/learnContentDetails', + name: 'å¦ä¹ 内容详情', + component: () => import('@/page/content/learn/content/details'), + meta: { + showBreadcrumb: true, + title: 'å¦ä¹ 内容详情', + } + }, + + // å®¡æ ¸ + { + path: '/checkVideo', + name: 'è§†é¢‘å®¡æ ¸', + component: () => import('@/page/check/video/index'), + meta: { + showBreadcrumb: true, + title: 'è§†é¢‘å®¡æ ¸', + } + }, + { + path: '/checkDisplay', + name: '展æ¿å®¡æ ¸', + component: () => import('@/page/check/display/index'), + meta: { + showBreadcrumb: true, + title: '展æ¿å®¡æ ¸', + } + }, + { + path: '/checkLearn', + name: 'å¹³å°å¦ä¹ å†…å®¹å®¡æ ¸', + component: () => import('@/page/check/learn/index'), + meta: { + showBreadcrumb: true, + title: 'å¹³å°å¦ä¹ å†…å®¹å®¡æ ¸', + } + }, + { + path: '/checkLearnDetails', + name: 'å¦ä¹ 内容详情', + component: () => import('@/page/check/learn/details'), + meta: { + showBreadcrumb: true, + title: 'å¦ä¹ 内容详情', + } + } +]