Commit 094290d5 authored by 胡冲's avatar 胡冲

修改学习学习内容展板资料不联动

parent ab1bb0b7
...@@ -12,7 +12,8 @@ module.exports = { ...@@ -12,7 +12,8 @@ module.exports = {
assetsPublicPath: '/', assetsPublicPath: '/',
proxyTable: { proxyTable: {
'/mall': { '/mall': {
target: "http://111.203.232.175:8088/mall", target: "http://111.203.232.175:8088/mall",
// target: "http://wdzc.digitalfod.com/wdzcfwpt/mall",// 阿里云
// target: "http://192.168.0.106:8088/mall", // target: "http://192.168.0.106:8088/mall",
// target: "http://192.168.204.66:8088/mall", // target: "http://192.168.204.66:8088/mall",
changeOrigin: true, changeOrigin: true,
...@@ -34,7 +35,7 @@ module.exports = { ...@@ -34,7 +35,7 @@ module.exports = {
// Various Dev Server settings // Various Dev Server settings
// host: 'localhost', // can be overwritten by process.env.HOST // host: 'localhost', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 3000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 3001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,
notifyOnErrors: true, notifyOnErrors: true,
...@@ -63,7 +64,7 @@ module.exports = { ...@@ -63,7 +64,7 @@ module.exports = {
// Paths // Paths
assetsRoot: path.resolve(__dirname, '../plat'), assetsRoot: path.resolve(__dirname, '../plat'),
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: './', assetsPublicPath: '/wdzcfwpt/',
/** /**
* Source Maps * Source Maps
......
/** /**
* Created by supervisor on 2018/2/28. * Created by supervisor on 2018/2/28.
*/ */
let baseUrl=""; let baseUrl="/mall/";
let routerMode='history'; // let baseUrl="http://wdzc.digitalfod.com/wdzcfwpt/mall/"; // 阿里云
let backToken = "back"; let routerMode='history';
let backToken = "back";
let ProUrl = ""
getBaseUrl(); let ProUrl = ""
getBaseUrl();
function getBaseUrl(){
$.ajax({ function getBaseUrl(){
url: "./static/json/api.json", $.ajax({
async: false, url: "./static/json/api.json",
success: function(data){ async: false,
ProUrl = data.baseUrl || (window.location.protocol + '//' + window.location.host + '/'); success: function(data){
} ProUrl = data.baseUrl || (window.location.protocol + '//' + window.location.host + '/');
}) }
} })
}
if(process.env.NODE_ENV === 'development'){
baseUrl=ProUrl if(process.env.NODE_ENV === 'development'){
}else if(process.env.NODE_ENV === 'production'){ baseUrl=ProUrl
baseUrl=ProUrl }else if(process.env.NODE_ENV === 'production'){
} baseUrl=ProUrl
export { }
baseUrl, export {
backToken, baseUrl,
routerMode backToken,
} routerMode
// process.env 是读取系统环境变量,在node命令窗口启动时设置相关的环境变量,NODE_ENV=development node来启动命令窗口 }
// process.env 是读取系统环境变量,在node命令窗口启动时设置相关的环境变量,NODE_ENV=development node来启动命令窗口
<template> <template>
<!--新增弹框--> <!--新增弹框-->
<el-dialog <el-dialog
custom-class="party-dialog" custom-class="party-dialog"
title="新建视频版权方" title="新建视频版权方"
width="468px" width="468px"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:before-close="close" :before-close="close"
> >
<div class="dialog-content"> <div class="dialog-content">
<el-form <el-form
:model="ruleForm" :model="ruleForm"
:rules="rules" :rules="rules"
ref="ruleForm" ref="ruleForm"
label-width="140px" label-width="140px"
class="party-form form-inline" class="party-form form-inline"
label-position="top" label-position="top"
> >
<el-form-item label="版权方名称" prop="name"> <el-form-item label="版权方名称" prop="name">
<el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版权方有效期" prop="value1"> <el-form-item label="版权方有效期" prop="value1">
<el-date-picker <el-date-picker
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="ruleForm.value1" v-model="ruleForm.value1"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="请选择预设视频分类" prop="videoContentCatIdList"> <el-form-item label="请选择预设视频分类" prop="videoContentCatIdList">
<el-select <el-select
placeholder="请选择预设视频分类" placeholder="请选择预设视频分类"
@focus="getAssetTypeData" @focus="getAssetTypeData"
multiple multiple
v-model="ruleForm.videoContentCatIdList" v-model="ruleForm.videoContentCatIdList"
@change="getSelectDep" @change="getSelectDep"
> >
<el-checkbox :style="selfstyle" v-model="checkedThing" @change="selectAllThing">全选</el-checkbox> <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-option v-for="item in videoContentCat" :label="item.name" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" class="w100" prop="remarks"> <el-form-item label="备注" class="w100" prop="remarks">
<el-input type="textarea" v-model="ruleForm.remarks"></el-input> <el-input type="textarea" v-model="ruleForm.remarks"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div slot="footer" class="dialog-footer btn-group"> <div slot="footer" class="dialog-footer btn-group">
<el-button size="mini" type="primary" @click="submitForm('ruleForm')">确定</el-button> <el-button size="mini" type="primary" @click="submitForm('ruleForm')">确定</el-button>
<el-button size="mini" @click="close">取 消</el-button> <el-button size="mini" @click="close">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
value1:[], value1:[],
dialogVisible:false, dialogVisible:false,
ruleForm: { ruleForm: {
videoContentCatIdList: [], videoContentCatIdList: [],
name: "", name: "",
ownerType: "VIDEO_CONTENT" ownerType: "VIDEO_CONTENT"
}, },
videoContentCat: [ videoContentCat: [
{ {
value: "Beijing", value: "Beijing",
label: "北京" label: "北京"
}, },
{ {
value: "Shanghai", value: "Shanghai",
label: "上海" label: "上海"
} }
], ],
checkedThing: false, checkedThing: false,
selfstyle: { selfstyle: {
textAlign: "right", textAlign: "right",
width: "100%", width: "100%",
paddingRight: "10px" paddingRight: "10px"
}, },
rules: { rules: {
name: [ name: [
{ required: true, message: "请输入版权方名称", trigger: "blur" }, { required: true, message: "请输入版权方名称", trigger: "blur" },
{ min: 1, max: 20, message: "请输入1到20个字" }, { min: 1, max: 20, message: "请输入1到20个字" },
], ],
videoContentCatIdList:[ videoContentCatIdList:[
{required: true, message: "请选择视频分类", trigger: "change" } {required: true, message: "请选择视频分类", trigger: "change" }
], ],
value1:[ value1:[
{ required: true, message: "请填写版权方有效期", trigger: "change" } { required: true, message: "请填写版权方有效期", trigger: "change" }
], ],
remarks: [ remarks: [
{ min: 1, max: 100, message: "请输入1到100个字" }, { min: 1, max: 100, message: "请输入1到100个字" },
], ],
} }
}; };
}, },
methods: { methods: {
// 弹窗保存 // 弹窗保存
submitForm(formName) { submitForm(formName) {
this.ruleForm.expireDateEnd = this.ruleForm.value1[1]; this.ruleForm.expireDateEnd = this.ruleForm.value1[1];
this.ruleForm.expireDateStart = this.ruleForm.value1[0]; this.ruleForm.expireDateStart = this.ruleForm.value1[0];
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.$https( this.$https(
{ {
url: "copyrightOwner/save", url: "copyrightOwner/save",
method: "post", method: "post",
authType: this.backToken authType: this.backToken
}, },
// this.ruleForm // this.ruleForm
this.$qs.stringify(this.ruleForm) this.$qs.stringify(this.ruleForm)
) )
.then(res => { .then(res => {
if(res.data.resultCode === "200"){ if(res.data.resultCode === "200"){
this.$message({ type: "success", message: "新建视频版权方成功!" }); this.$message({ type: "success", message: "新建视频版权方成功!" });
this.dialogVisible = false this.dialogVisible = false
}else{ }else{
this.$message({ type: "error", message: res.message }); this.$message({ type: "error", message: res.data.message });
} }
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
} }
}); });
}, },
save(formName) { save(formName) {
const _this = this const _this = this
_this.ruleForm.expireDateEnd = this.ruleForm.value1[1]; _this.ruleForm.expireDateEnd = this.ruleForm.value1[1];
_this.ruleForm.expireDateStart = this.ruleForm.value1[0]; _this.ruleForm.expireDateStart = this.ruleForm.value1[0];
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.$https( this.$https(
{ {
url: "copyrightOwner/save", url: "copyrightOwner/save",
method: "post", method: "post",
authType: this.backToken authType: this.backToken
}, },
// this.ruleForm // this.ruleForm
_this.$qs.stringify(this.ruleForm) _this.$qs.stringify(this.ruleForm)
) )
.then(res => { .then(res => {
console.log(res) console.log(res)
// if(res.data.resultCode === "200"){ // if(res.data.resultCode === "200"){
// _this.$message({ type: "success", message: "新增成功!" }); // _this.$message({ type: "success", message: "新增成功!" });
// _this.dialogVisible =false // _this.dialogVisible =false
// }else{ // }else{
// _this.$message({ type: "error", message: res.data.message }); // _this.$message({ type: "error", message: res.data.message });
// } // }
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
} }
}); });
}, },
// 新增关闭 // 新增关闭
close() { close() {
this.dialogVisible = false; this.dialogVisible = false;
for (let key in this.ruleForm) { for (let key in this.ruleForm) {
this.ruleForm[key] = null; this.ruleForm[key] = null;
} }
this.$refs["ruleForm"].resetFields(); this.$refs["ruleForm"].resetFields();
}, },
// 获取视频分类列表 // 获取视频分类列表
getAssetTypeData() { getAssetTypeData() {
let vm = this; let vm = this;
vm.$https({ vm.$https({
url: "videoContentCat/getList", url: "videoContentCat/getList",
method: "get", method: "get",
authType: this.backToken authType: this.backToken
}) })
.then(res => { .then(res => {
let data = res.data.data; let data = res.data.data;
this.videoContentCat = data; this.videoContentCat = data;
// this.value1[0]=data.expireDateEnd // this.value1[0]=data.expireDateEnd
//this.value1[1]=data.expireDateStart //this.value1[1]=data.expireDateStart
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
}, },
getSelectDep(videoContentCatIdList) { getSelectDep(videoContentCatIdList) {
if (videoContentCatIdList.length === this.videoContentCat.length) { if (videoContentCatIdList.length === this.videoContentCat.length) {
this.checkedThing = true; this.checkedThing = true;
} else { } else {
this.checkedThing = false; this.checkedThing = false;
} }
}, },
selectAllThing() { selectAllThing() {
// debugger // debugger
this.ruleForm.videoContentCatIdList = []; this.ruleForm.videoContentCatIdList = [];
if (this.checkedThing) { if (this.checkedThing) {
this.videoContentCat.map(item => { this.videoContentCat.map(item => {
this.ruleForm.videoContentCatIdList.push(item.id); this.ruleForm.videoContentCatIdList.push(item.id);
}); });
} else { } else {
this.ruleForm.videoContentCatIdList = []; this.ruleForm.videoContentCatIdList = [];
} }
} }
} }
}; };
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="展板备选清单" class="w100" prop="exhibitionBoardIdList"> <el-form-item label="展板备选清单" class="w100" prop="exhibitionBoardIdList">
<div class="party-table"> <div class="party-table">
<el-table <el-table
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!--新增弹框--> <!--新增弹框-->
<el-dialog <el-dialog
custom-class="party-dialog" custom-class="party-dialog"
...@@ -296,7 +296,8 @@ export default { ...@@ -296,7 +296,8 @@ export default {
}, },
multipleSelection: [], multipleSelection: [],
multipleSelection1:[], multipleSelection1:[],
userType: "" userType: "",
tableInitFlag:false
}; };
}, },
mounted() { mounted() {
...@@ -325,6 +326,8 @@ export default { ...@@ -325,6 +326,8 @@ export default {
async init() { async init() {
if (this.$route.query.type === "Update") { if (this.$route.query.type === "Update") {
await this.getInfo(this.$route.query.id); await this.getInfo(this.$route.query.id);
}else{
this.tableInitFlag=true;
} }
await this.getLearnProject(); await this.getLearnProject();
// this.getAssetTypeData(); // this.getAssetTypeData();
...@@ -372,35 +375,45 @@ export default { ...@@ -372,35 +375,45 @@ export default {
this.getTableData(param, "update"); this.getTableData(param, "update");
}, },
async setSelctTable() { async setSelctTable() {
// console.info(this.multipleSelection)
// console.info(this.tableData)
if (!this.multipleSelection.length) { if (!this.multipleSelection.length) {
return false; return false;
} }
let arr =[]
this.multipleSelection.map(item=>{
arr.push(item.id)
})
// console.info(arr)
let _this = this; let _this = this;
let tableData = this.tableData; let tableData = this.tableData;
let multipleSelection = this.multipleSelection; let tempNum=0;
tableData.forEach(v => { tableData.forEach(v => {
multipleSelection.forEach(m => { if (arr.includes(v.id)) {
if (v.id == m.id) { _this.$refs.multipleTable.toggleRowSelection(v);
_this.$refs.multipleTable.toggleRowSelection(v); tempNum++;
if(tempNum === arr.length){
this.tableInitFlag=true
} }
}); }
}); });
await this.getTableParam1() await this.getTableParam1()
}, },
setSelctTable1() { setSelctTable1() {
// console.log(this.multipleSelection1) // console.log(this.multipleSelection1)
if (!this.multipleSelection1.length) { if (!this.multipleSelection1.length) {
return false; return false;
} }
let arr =[]
this.multipleSelection1.map(item=>{
arr.push(item.id)
})
let _this = this; let _this = this;
let tableData1 = this.tableData1; let tableData1 = this.tableData1;
let multipleSelection1 = this.multipleSelection1;
tableData1.forEach(v => { tableData1.forEach(v => {
multipleSelection1.forEach(m => { if (arr.includes(v.id)) {
if (v.id == m.id) { _this.$refs.multipleTable1.toggleRowSelection(v);
_this.$refs.multipleTable1.toggleRowSelection(v); }
}
});
}); });
}, },
// 获取展板类别列表 // 获取展板类别列表
...@@ -422,12 +435,14 @@ export default { ...@@ -422,12 +435,14 @@ export default {
}else{ }else{
this.$message.warning("请先选择展板版权方!") this.$message.warning("请先选择展板版权方!")
} }
}, },
getSelect() { getSelect() {
this.getAssetTypeData2() this.getAssetTypeData2()
this.ruleForm.copyrightOwnerIdList = [] this.ruleForm.copyrightOwnerIdList = []
this.ruleForm.exhibitionBoardCatIdList = [] this.ruleForm.exhibitionBoardCatIdList = []
this.tableData = []
this.tableData1 = []
}, },
// 获取版权方列表 // 获取版权方列表
getAssetTypeData2() { getAssetTypeData2() {
...@@ -487,13 +502,24 @@ export default { ...@@ -487,13 +502,24 @@ export default {
}, },
// 展板多选赋值 // 展板多选赋值
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; if(this.tableInitFlag){
let newArray = val.map(item => { // console.info(this.tableData.length)
return item.id; // this.getTableParam1()
}); if(val.length === 0){
this.ruleForm.exhibitionBoardIdList = newArray; this.multipleSelection1 = []
if(this.type === 'add') { this.tableData1 = []
this.getTableParam1() }
// console.info('tableInitFlag='+this.tableInitFlag)
this.multipleSelection = val;
let newArray=[]
val.map((item,index) => {
newArray.push(item.id)
this.ruleForm.exhibitionBoardIdList = newArray;
// console.info(index === (val.length-1))
if(index === (val.length-1)){
this.getTableParam1()
}
});
} }
}, },
// 展板资料多选赋值 // 展板资料多选赋值
...@@ -529,7 +555,7 @@ export default { ...@@ -529,7 +555,7 @@ export default {
}else{ }else{
this.$message({ type: "error", message: res.data.message }); this.$message({ type: "error", message: res.data.message });
} }
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
...@@ -560,7 +586,7 @@ export default { ...@@ -560,7 +586,7 @@ export default {
}else{ }else{
this.$message({ type: "success", message: "修改成功!" }); this.$message({ type: "success", message: "修改成功!" });
} }
history.go(-1); history.go(-1);
}else{ }else{
this.$message({ type: "error", message: res.data.message }); this.$message({ type: "error", message: res.data.message });
...@@ -624,6 +650,10 @@ export default { ...@@ -624,6 +650,10 @@ export default {
}, },
getTableData1 () { getTableData1 () {
let vm = this; let vm = this;
// console.log(vm.ruleForm.exhibitionBoardIdList.length+1)
if(vm.ruleForm.exhibitionBoardIdList.length === 0){
vm.tableData1 = []
}else{
vm.$https( vm.$https(
{ {
url: "asset/getAssetByBoard", url: "asset/getAssetByBoard",
...@@ -640,25 +670,24 @@ export default { ...@@ -640,25 +670,24 @@ export default {
// 选中表格数据 // 选中表格数据
// console.log(this.type) // console.log(this.type)
if(this.type === 'add'){ if(this.type === 'add'){
vm.multipleSelection1 = res.data.data vm.multipleSelection1 = data
setTimeout(() => {
vm.setSelctTable1();
}, 1000);
}else{ }else{
// console.log(this.multipleSelection1) // console.log(this.multipleSelection1)
vm.multipleSelection1 = this.multipleSelection1 vm.multipleSelection1 = this.multipleSelection1
setTimeout(() => {
vm.setSelctTable1();
}, 1000);
} }
setTimeout(() => {
vm.setSelctTable1();
}, 1000);
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
}
}, },
// 根据展板类别,版权方获取展板备选清单 // 根据展板类别,版权方获取展板备选清单
async getTableData(param, type) { async getTableData(param, type) {
let vm = this; let vm = this;
vm.$https( vm.$https(
{ {
...@@ -686,7 +715,7 @@ export default { ...@@ -686,7 +715,7 @@ export default {
}, },
selectAllThing() { selectAllThing() {
// debugger // debugger
this.ruleForm.exhibitionBoardCatIdList = []; this.ruleForm.exhibitionBoardCatIdList = [];
if (this.checkedThing) { if (this.checkedThing) {
this.videoContentCat.map(item => { this.videoContentCat.map(item => {
......
<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="applicableScope">
<!-- <span v-show="userType === '1'" value="ALL_PLAT">全平台</span> -->
<el-radio-group v-show="userType === '1'" v-model="ruleForm.applicableScope">
<el-radio v-show="userType === '1'" label="ALL_PLAT">全平台</el-radio>
</el-radio-group>
<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-item label="展板参考资料备选清单" class="w100" prop="fileList">
<div class="party-table">
<el-table
border
@selection-change="handleSelectionChange1"
style="width: 100%"
max-height="400"
ref="multipleTable1"
:data="tableData1"
>
<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="boardName"></el-table-column>
<el-table-column show-overflow-tooltip label="参考资料名称" prop="fileName"></el-table-column>
<el-table-column show-overflow-tooltip label="参考资料类型" prop="fileType"></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: [],
tableData1: [],
ruleForm: {
name: "", //学习内容名称
applicableScope: "", //适用范围
cover: "", //宣传图
projectId: '',
learningProjectId: "", //所属学习项目
exhibitionBoardCatIdList: [], //展板类别
copyrightOwnerIdList: [], //版权方
exhibitionBoardIdList: [], // 展板备选
fileList:[] // 展板资料备选
},
rules: {
name: [
{ required: true, message: "请输入学习内容名称", trigger: "blur" },
{ min: 1, max: 20, message: "请输入1到20个字" },
],
applicableScope: [
{
required: true,
message: "请选择适用范围"
}
],
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: [],
multipleSelection1:[],
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.multipleSelection1 = data.assetList
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.toString(),
exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList.toString(),
learningProjectId:this.ruleForm.learningProjectId
};
this.getTableData(param, "update");
},
// async 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);
// }
// });
// });
// await this.getTableParam1()
// },
// setSelctTable1() {
// // console.log(this.multipleSelection1)
// if (!this.multipleSelection1.length) {
// return false;
// }
// let _this = this;
// let tableData1 = this.tableData1;
// let multipleSelection1 = this.multipleSelection1;
// tableData1.forEach(v => {
// multipleSelection1.forEach(m => {
// if (v.id == m.id) {
// _this.$refs.multipleTable1.toggleRowSelection(v);
// }
// });
// });
// },
async setSelctTable() {
console.info(this.multipleSelection)
console.info(this.tableData)
if (!this.multipleSelection.length) {
return false;
}
let arr =[]
this.multipleSelection.map(item=>{
arr.push(item.id)
})
console.info(arr)
let _this = this;
let tableData = this.tableData;
tableData.forEach(v => {
if (arr.includes(v.id)) {
_this.$refs.multipleTable.toggleRowSelection(v);
}
});
await this.getTableParam1()
},
setSelctTable1() {
// console.log(this.multipleSelection1)
if (!this.multipleSelection1.length) {
return false;
}
let arr =[]
this.multipleSelection.map(item=>{
arr.push(item.id)
})
let _this = this;
let tableData1 = this.tableData1;
tableData1.forEach(v => {
if (arr.includes(v.id)) {
_this.$refs.multipleTable1.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()
this.ruleForm.copyrightOwnerIdList = []
this.ruleForm.exhibitionBoardCatIdList = []
this.tableData = []
this.tableData1 = []
},
// 获取版权方列表
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);
});
},
// 展板多选赋值
async handleSelectionChange(val) {
this.multipleSelection = val;
let newArray = val.map(item => {
return item.id;
});
this.ruleForm.exhibitionBoardIdList = newArray;
await this.getTableParam1()
},
// 展板资料多选赋值
handleSelectionChange1(val) {
this.multipleSelection1 = this.multipleSelection1.concat(val);
let newArray = val.map(item => {
return item.id;
});
this.ruleForm.fileList = 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 = []
}
},
// 筛选展板资料备选清单选项条件
getTableParam1(){
const param = {
boardList:this.ruleForm.exhibitionBoardIdList.toString()
};
if(param.boardList.length>0){
this.getTableData1(param);
}else{
this.tableData1 = []
}
},
getTableData1 () {
let vm = this;
vm.$https(
{
url: "asset/getAssetByBoard",
method: "get",
authType: this.backToken
},
{ boardList:vm.ruleForm.exhibitionBoardIdList.toString() }
)
.then(res => {
// alert(1)
const data = res.data.data;
// console.log(data)
vm.tableData1 = data;
// 选中表格数据
// console.log(this.type)
if(this.type === 'add'){
vm.multipleSelection1 = res.data.data
setTimeout(() => {
vm.setSelctTable1();
}, 1000);
}else{
// console.log(this.multipleSelection1)
vm.multipleSelection1 = this.multipleSelection1
setTimeout(() => {
vm.setSelctTable1();
}, 1000);
}
})
.catch(function(err) {
console.log(err);
});
},
// 根据展板类别,版权方获取展板备选清单
async 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>
<template> <template>
<div class="info"> <div class="info">
<div class="info-header">{{ type === 'Update'?'修改':'新建'}}视频版权方</div> <div class="info-header">{{ type === 'Update'?'修改':'新建'}}视频版权方</div>
<div class="info-container"> <div class="info-container">
<div class="info-wrapper"> <div class="info-wrapper">
<div class="pageTips"> <div class="pageTips">
<strong>页面说明:</strong> <strong>页面说明:</strong>
可新建版权方信息。“*”为必填项。预设视频分类中没有合适的选项,可点击“新建视频分类”在弹框中新建分类 可新建版权方信息。“*”为必填项。预设视频分类中没有合适的选项,可点击“新建视频分类”在弹框中新建分类
</div> </div>
<el-form <el-form
:model="ruleForm" :model="ruleForm"
:rules="rules" :rules="rules"
ref="ruleForm" ref="ruleForm"
label-width="140px" label-width="140px"
class="demo-form-inline party-form" class="demo-form-inline party-form"
:inline="true" :inline="true"
label-position="top" label-position="top"
> >
<el-form-item label="版权方名称" prop="name" class="w50"> <el-form-item label="版权方名称" prop="name" class="w50">
<el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input> <el-input oninput="value = value.trim()" v-model="ruleForm.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版权方有效期" prop="value1"> <el-form-item label="版权方有效期" prop="value1">
<el-date-picker <el-date-picker
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="ruleForm.value1" v-model="ruleForm.value1"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item class="w50" label="请选择视频分类" prop="videoContentCatIdList"> <el-form-item class="w50" label="请选择视频分类" prop="videoContentCatIdList">
<el-select <el-select
placeholder="请选择预设视频分类" placeholder="请选择预设视频分类"
@focus="getAssetTypeData" @focus="getAssetTypeData"
multiple multiple
v-model="ruleForm.videoContentCatIdList" v-model="ruleForm.videoContentCatIdList"
@change="getSelectDep" @change="getSelectDep"
> >
<el-checkbox :style="selfstyle" v-model="checkedThing" @change="selectAllThing">全选</el-checkbox> <el-checkbox :style="selfstyle" v-model="checkedThing" @change="selectAllThing">全选</el-checkbox>
<el-option <el-option
v-for="item in videoContentCat" v-for="item in videoContentCat"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
:key="item.id" :key="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item > <el-form-item >
<br> <br>
<span style="color:red">若没有相应的视频分类,请点击</span> <span style="color:red">若没有相应的视频分类,请点击</span>
<el-button type="text" @click="addVideoClass">新建视频分类</el-button> <el-button type="text" @click="addVideoClass">新建视频分类</el-button>
</el-form-item> </el-form-item>
<el-form-item label="备注" class="w100" prop="remarks"> <el-form-item label="备注" class="w100" prop="remarks">
<el-input type="textarea" v-model="ruleForm.remarks"></el-input> <el-input type="textarea" v-model="ruleForm.remarks"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!--新增弹框--> <!--新增弹框-->
<el-dialog <el-dialog
custom-class="party-dialog" custom-class="party-dialog"
title="新建视频分类" title="新建视频分类"
width="468px" width="468px"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:before-close="close" :before-close="close"
> >
<div class="dialog-content"> <div class="dialog-content">
<el-form <el-form
:model="classForm" :model="classForm"
ref="classForm" ref="classForm"
label-width="80px" label-width="80px"
label-position="top" label-position="top"
:rules="rule" :rules="rule"
id="ruleo" id="ruleo"
class="party-form" class="party-form"
> >
<el-form-item label="视频分类名称" prop="name"> <el-form-item label="视频分类名称" prop="name">
<el-input oninput="value = value.trim()" v-model="classForm.name"></el-input> <el-input oninput="value = value.trim()" v-model="classForm.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input type="textarea" v-model="classForm.remarks"></el-input> <el-input type="textarea" v-model="classForm.remarks"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div slot="footer" class="dialog-footer btn-group"> <div slot="footer" class="dialog-footer btn-group">
<el-button size="mini" type="primary" @click="save('classForm')">确定</el-button> <el-button size="mini" type="primary" @click="save('classForm')">确定</el-button>
<el-button size="mini" @click="close">取 消</el-button> <el-button size="mini" @click="close">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
<div class="info-footer"> <div class="info-footer">
<div class="btn-group"> <div class="btn-group">
<div class="btn-group"> <div class="btn-group">
<el-button <el-button
type="primary" type="primary"
v-show="type === 'add'" v-show="type === 'add'"
class="btn_form_search" class="btn_form_search"
@click="submitForm('ruleForm')" @click="submitForm('ruleForm')"
>确定</el-button> >确定</el-button>
<el-button <el-button
type="primary" type="primary"
v-show="type === 'Update'" v-show="type === 'Update'"
class="btn_form_search" class="btn_form_search"
@click="updateForm('ruleForm')" @click="updateForm('ruleForm')"
>确定</el-button> >确定</el-button>
<el-button @click="resetForm('ruleForm')">取消</el-button> <el-button @click="resetForm('ruleForm')">取消</el-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
type: this.$route.query.type, type: this.$route.query.type,
dialogVisible: false, dialogVisible: false,
classForm: {}, classForm: {},
formLabelWidth: "100px", formLabelWidth: "100px",
form: { form: {
name: "" name: ""
}, },
value1: [], value1: [],
ruleForm: { ruleForm: {
videoContentCatIdList: [], videoContentCatIdList: [],
name: "", name: "",
ownerType: "VIDEO_CONTENT" ownerType: "VIDEO_CONTENT"
}, },
videoContentCat: [ videoContentCat: [
{ {
value: "Beijing", value: "Beijing",
label: "北京" label: "北京"
}, },
{ {
value: "Shanghai", value: "Shanghai",
label: "上海" label: "上海"
} }
], ],
checkedThing: false, checkedThing: false,
selfstyle: { selfstyle: {
textAlign: "right", textAlign: "right",
width: "100%", width: "100%",
paddingRight: "10px" paddingRight: "10px"
}, },
rule:{ rule:{
name: [ name: [
{ required: true, message: "请输入版权方名称", trigger: "blur" }, { required: true, message: "请输入版权方名称", trigger: "blur" },
{ min: 1, max: 20, message: "请输入1到20个字" }, { min: 1, max: 20, message: "请输入1到20个字" },
], ],
remarks:[ remarks:[
{ min: 1, max: 100, message: "请输入1到100个字" }, { min: 1, max: 100, message: "请输入1到100个字" },
] ]
}, },
rules: { rules: {
name: [ name: [
{ required: true, message: "请输入版权方名称", trigger: "blur" }, { required: true, message: "请输入版权方名称", trigger: "blur" },
{ min: 1, max: 20, message: "请输入1到20个字" }, { min: 1, max: 20, message: "请输入1到20个字" },
], ],
videoContentCatIdList:[ videoContentCatIdList:[
{required: true, message: "请选择视频分类", trigger: "change" } {required: true, message: "请选择视频分类", trigger: "change" }
], ],
value1:[ value1:[
{ required: true, message: "请填写版权方有效期", trigger: "change" } { required: true, message: "请填写版权方有效期", trigger: "change" }
], ],
remarks:[ remarks:[
{ min: 1, max: 100, message: "请输入1到100个字" }, { min: 1, max: 100, message: "请输入1到100个字" },
] ]
} }
}; };
}, },
watch:{ watch:{
// 'ruleForm.value1'(newVal ,oldVal){ // 'ruleForm.value1'(newVal ,oldVal){
// // console.log(newVal,oldVal) // // console.log(newVal,oldVal)
// this.ruleForm.expireDateEnd = this.ruleForm.value1[1]; // this.ruleForm.expireDateEnd = this.ruleForm.value1[1];
// this.ruleForm.expireDateStart = this.ruleForm.value1[0]; // this.ruleForm.expireDateStart = this.ruleForm.value1[0];
// } // }
}, },
mounted() { mounted() {
this.init(); this.init();
}, },
methods: { methods: {
init() { init() {
if (this.$route.query.type === "Update") { if (this.$route.query.type === "Update") {
this.getInfo(); this.getInfo();
this.getAssetTypeData() this.getAssetTypeData()
} }
}, },
// 获取版权方详情 // 获取版权方详情
getInfo() { getInfo() {
let vm = this; let vm = this;
vm.$https({ vm.$https({
url: "copyrightOwner/get/" + this.$route.query.id, url: "copyrightOwner/get/" + this.$route.query.id,
method: "get", method: "get",
authType: this.backToken authType: this.backToken
}) })
.then(res => { .then(res => {
let data = res.data.data; let data = res.data.data;
this.ruleForm = data; this.ruleForm = data;
let arr = [] let arr = []
arr = [data.expireDateStart, data.expireDateEnd]; arr = [data.expireDateStart, data.expireDateEnd];
this.ruleForm.value1 = arr this.ruleForm.value1 = arr
this.ruleForm = {...this.ruleForm} this.ruleForm = {...this.ruleForm}
// this.ruleForm.value1 = [data.expireDateStart, data.expireDateEnd]; // this.ruleForm.value1 = [data.expireDateStart, data.expireDateEnd];
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
}, },
// 新建视频分类 // 新建视频分类
addVideoClass() { addVideoClass() {
this.dialogVisible = true; this.dialogVisible = true;
}, },
// 新建视频分类弹窗保存 // 新建视频分类弹窗保存
save(formName) { save(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
this.classForm.expireDateEnd = this.value1[1]; this.classForm.expireDateEnd = this.value1[1];
this.classForm.expireDateStart = this.value1[0]; this.classForm.expireDateStart = this.value1[0];
if (valid) { if (valid) {
this.$https( this.$https(
{ {
url: "videoContentCat/save", url: "videoContentCat/save",
method: "post", method: "post",
authType: this.backToken authType: this.backToken
}, },
this.$qs.stringify(this.classForm) this.$qs.stringify(this.classForm)
// this.classForm // this.classForm
) )
.then(res => { .then(res => {
console.log(res) console.log(res)
if(res.data.resultCode === "200"){ if(res.data.resultCode === "200"){
this.$message({ type: "success", message: "新增分类成功!" }); this.$message({ type: "success", message: "新增分类成功!" });
this.dialogVisible = false; this.dialogVisible = false;
}else{ }else{
this.$message({ type: "error", message: res.data.message }); this.$message({ type: "error", message: res.data.message });
} }
}) })
.catch(function(err) { .catch(function(err) {
this.$message({ this.$message({
type: "fail", type: "fail",
message: "新增失败!" + err.response.data.msg message: "新增失败!" + err.response.data.msg
}); });
console.log(err); console.log(err);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
} }
}); });
}, },
// 新增关闭 // 新增关闭
close() { close() {
this.dialogVisible = false; this.dialogVisible = false;
for (let key in this.classForm) { for (let key in this.classForm) {
this.classForm[key] = null; this.classForm[key] = null;
} }
this.$refs["classForm"].resetFields(); this.$refs["classForm"].resetFields();
}, },
// 新增 // 新增
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
this.ruleForm.expireDateEnd = this.ruleForm.value1[1]; this.ruleForm.expireDateEnd = this.ruleForm.value1[1];
this.ruleForm.expireDateStart = this.ruleForm.value1[0]; this.ruleForm.expireDateStart = this.ruleForm.value1[0];
if (valid) { if (valid) {
this.$https( this.$https(
{ {
url: "copyrightOwner/save", url: "copyrightOwner/save",
method: "post", method: "post",
authType: this.backToken authType: this.backToken
}, },
// this.ruleForm // this.ruleForm
this.$qs.stringify(this.ruleForm) this.$qs.stringify(this.ruleForm)
) )
.then(res => { .then(res => {
if(res.data.resultCode === "200"){ if(res.data.resultCode === "200"){
this.$message({ type: "success", message: "新增视频版权成功!" }); this.$message({ type: "success", message: "新增视频版权成功!" });
history.go(-1); history.go(-1);
}else{ }else{
this.$message({ type: "error", message: res.data.message }); this.$message({ type: "error", message: res.data.message });
} }
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
} }
}); });
}, },
// 修改版权方 // 修改版权方
updateForm(formName) { updateForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
this.ruleForm.id = this.$route.query.id; this.ruleForm.id = this.$route.query.id;
this.ruleForm.expireDateEnd = this.ruleForm.value1[1]; this.ruleForm.expireDateEnd = this.ruleForm.value1[1];
this.ruleForm.expireDateStart = this.ruleForm.value1[0]; this.ruleForm.expireDateStart = this.ruleForm.value1[0];
if (valid) { if (valid) {
this.$https( this.$https(
{ {
url: "copyrightOwner/update", url: "copyrightOwner/update",
method: "put", method: "put",
authType: this.backToken authType: this.backToken
}, },
this.$qs.stringify(this.ruleForm) this.$qs.stringify(this.ruleForm)
// this.ruleForm // this.ruleForm
) )
.then(res => { .then(res => {
if(res.data.resultCode === "200"){ if(res.data.resultCode === "200"){
this.$message({ type: "success", message: "修改视频版权方成功!" }); this.$message({ type: "success", message: "修改视频版权方成功!" });
history.go(-1); history.go(-1);
}else{ }else{
this.$message({ type: "error", message: res.data.message }); this.$message({ type: "error", message: res.data.message });
} }
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
} }
}); });
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
history.go(-1); history.go(-1);
}, },
// 获取视频分类列表 // 获取视频分类列表
getAssetTypeData() { getAssetTypeData() {
let vm = this; let vm = this;
vm.$https({ vm.$https({
url: "videoContentCat/getList", url: "videoContentCat/getList",
method: "get", method: "get",
authType: this.backToken authType: this.backToken
}) })
.then(res => { .then(res => {
let data = res.data.data; let data = res.data.data;
this.videoContentCat = data; this.videoContentCat = data;
// this.value1[0]=data.expireDateEnd // this.value1[0]=data.expireDateEnd
//this.value1[1]=data.expireDateStart //this.value1[1]=data.expireDateStart
}) })
.catch(function(err) { .catch(function(err) {
console.log(err); console.log(err);
}); });
}, },
getSelectDep(videoContentCatIdList) { getSelectDep(videoContentCatIdList) {
if (videoContentCatIdList.length === this.videoContentCat.length) { if (videoContentCatIdList.length === this.videoContentCat.length) {
this.checkedThing = true; this.checkedThing = true;
} else { } else {
this.checkedThing = false; this.checkedThing = false;
} }
}, },
selectAllThing() { selectAllThing() {
// debugger // debugger
this.ruleForm.videoContentCatIdList = []; this.ruleForm.videoContentCatIdList = [];
if (this.checkedThing) { if (this.checkedThing) {
this.videoContentCat.map(item => { this.videoContentCat.map(item => {
this.ruleForm.videoContentCatIdList.push(item.id); this.ruleForm.videoContentCatIdList.push(item.id);
}); });
} else { } else {
this.ruleForm.videoContentCatIdList = []; this.ruleForm.videoContentCatIdList = [];
} }
} }
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../style/dialog"; @import "../../../../style/dialog";
</style> </style>
\ No newline at end of file
...@@ -3,4 +3,3 @@ ...@@ -3,4 +3,3 @@
"baseUrl": "/mall/", "baseUrl": "/mall/",
"directory": "/plat" "directory": "/plat"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment