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来启动命令窗口
...@@ -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 => {
......
This diff is collapsed.
This diff is collapsed.
...@@ -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