Commit 623a71c0 authored by 黄媛媛's avatar 黄媛媛
parents 54a142e9 b5c2943f
......@@ -28,13 +28,15 @@
</el-table-column>
<el-table-column prop="IsHome" label="设为首页" width="80">
<template slot-scope="scope">
<el-switch v-model="scope.row.IsHome" active-color="#409EFF" :active-value="1" :inactive-value="0">
<el-switch v-model="scope.row.IsHome" active-color="#409EFF" :active-value="1" :inactive-value="0"
@change="updateIsHome(scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column prop="IsUse" label="禁用/启用" width="85">
<template slot-scope="scope">
<el-switch v-model="scope.row.IsUse" active-color="#409EFF" :active-value="1" :inactive-value="0">
<el-switch v-model="scope.row.IsUse" active-color="#409EFF" :active-value="1" :inactive-value="0"
@change="updateIsUse(scope.row)">
</el-switch>
</template>
</el-table-column>
......@@ -136,6 +138,34 @@
},
methods: {
//更新是否禁用
updateIsUse(item) {
this.apipost("/api/Template/SetMiniprogramPageTemplIsUse", {
Id: item.Id,
IsUse: item.IsUse
}, res => {
if (res.data.resultCode == 1) {
this.getList();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
}
})
},
//更新是否为首页
updateIsHome(item) {
this.apipost("/api/Template/SetMiniprogramPageTemplIsHome", {
Id: item.Id,
IsHome: item.IsHome
}, res => {
if (res.data.resultCode == 1) {
this.getList();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
}
})
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
......@@ -144,7 +174,6 @@
this.apipost("/api/Template/GetMiniprogramPageTemplPageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
console.log("this.dataList", this.dataList);
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
......
......@@ -36,7 +36,7 @@
</div>
</el-form-item>
<el-form-item class="chooseLink" label="版权链接">
<el-input v-model="data.link.url" placeholder="点击选择链接" :disabled="true" size="small">
<el-input v-model="data.link" placeholder="点击选择链接" :disabled="true" size="small">
<el-button slot="append" size="small" @click="isShowLink=true">选择链接</el-button>
</el-input>
</el-form-item>
......@@ -96,7 +96,7 @@
getChoiceLink() {
//调用子组件方法
var obj = this.$refs.chooseMeun.getChooseMenu();
this.data.link.url=obj.PageUrl
this.data.link=obj.PageUrl
this.isShowLink = false;
},
},
......
......@@ -33,7 +33,7 @@
</div>
</div>
<div class="diy-component-edit imgVisible" :class="{'visibleA':imageData.isCked}">
<UE :defaultMsg="defaultMsg" :config="config" ref="ue" @input="input"></UE>
<UE :defaultMsg="data.content" :config="config" ref="ue" @input="input"></UE>
</div>
</div>
</div>
......@@ -48,7 +48,6 @@
data() {
return {
data: this.imageData.data,
defaultMsg: '',
config: {
initialFrameWidth: null,
initialFrameHeight: 350,
......@@ -60,7 +59,6 @@
methods: {
//向父组件传值 并调用排序
resetSord(IsUp) {
console.log(IsUp);
this.$emit('getSord', this.index, IsUp);
},
//点击触发父组件删除
......@@ -76,11 +74,7 @@
this.$refs.ue.InitData();
},
watch: {
defaultMsg: {
handler(newVal, oldVal) {
},
deep: true
}
}
};
......
......@@ -286,6 +286,7 @@
//调用子组件方法
var obj = this.$refs.chooseMeun.getChooseMenu();
this.data.link.name=obj.PageName;
this.data.link.url=obj.PageUrl;
this.isShowLink = false;
},
......
......@@ -448,6 +448,10 @@
},
},
methods: {
//删除链接
deleteRubik(index) {
this.cList.splice(index);
},
// 魔方展示样式(preview)
blockStyle(index) {
if (index === 8) {
......@@ -710,11 +714,11 @@
this.choicImg = false;
},
//向父组件传值 并调用排序
resetSord(IsUp){
this.$emit('getSord', this.index,IsUp);
resetSord(IsUp) {
this.$emit('getSord', this.index, IsUp);
},
//点击触发父组件删除
delPlugin(){
delPlugin() {
this.$emit('comDelPlugin', this.index);
}
},
......
......@@ -164,14 +164,14 @@
<template>
<div class="templateEdit">
<div class="tpEdit_header">
<span style="color:rgb(64, 158, 255);cursor:pointer;">模板管理</span><span
<span style="color:rgb(64, 158, 255);cursor:pointer;" @click="CommonJump('templateManage',{})">模板管理</span><span
style="margin:0 9px;color:#C0C4CC">/</span><span>新增</span>
</div>
<div flex="box:first" class="tpEdit_Content">
<div class="all-components">
<el-form label-width="80px">
<el-form-item label="模板名称">
<el-input type="text" size="small" v-model="addMsg.TemplateName"></el-input>
<el-input type="text" size="small" v-model="addMsg.TemplateName" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="背景设置">
<el-button size="small">设置</el-button>
......@@ -262,8 +262,8 @@
:index="index" :dataLeng="dataList.length"></modal>
<quickNav v-if="item.Id=='quick-nav'" :quickData="item" @getSord="getSord" @comDelPlugin="comDelPlugin"
:index="index" :dataLeng="dataList.length"></quickNav>
<imageText v-if="item.Id=='image-text'" :imageData="item" @getSord="getSord" @comDelPlugin="comDelPlugin"
:index="index" :dataLeng="dataList.length"></imageText>
<imageText v-if="item.Id=='image-text'" :imageData="item" @getSord="getSord"
@comDelPlugin="comDelPlugin" :index="index" :dataLeng="dataList.length"></imageText>
</div>
</div>
</div>
......@@ -313,9 +313,9 @@
Id: 0, //编号
TemplateName: '', //模板名称
TemplateData: '',
ComponentDataList:[],
ComponentDataList: [],
},
//左侧组件列表
allComponents: [],
dataList: [],
//是否为空
......@@ -363,7 +363,6 @@
this.apipost("/api/Tenant/GetPlugInList", {}, res => {
if (res.data.resultCode == 1) {
this.allComponents = res.data.data;
console.log(this.allComponents);
} else {
this.Info(res.data.message);
}
......@@ -561,11 +560,7 @@
data: {
picUrl: '',
text: '',
link: {
url: '',
openType: '',
data: {},
},
link: '',
backgroundColor: '#fff',
}
}
......@@ -1060,7 +1055,6 @@
}
this.dataList.push(quickObj);
break;
}
},
//给子组件调用 重新排序上移下移
......@@ -1094,36 +1088,47 @@
//点击保存
SaveData() {
this.addMsg.ComponentDataList = this.dataList;
console.log("addMsg", this.addMsg);
this.apipost("/api/Template/SetMiniTemplate", this.addMsg, res => {
console.log(res.data)
if (res.data.resultCode == 1) {
this.addMsg.Id = res.data.data;
this.CommonJump('templateEdit', {
Id: res.data.data
});
this.GetData();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
}
})
},
//获取数据
GetData() {
this.apipost("/api/Template/SetMiniTemplate", {
this.apipost("/api/Template/GetMiniTemplate", {
Id: this.addMsg.Id
}, res => {
console.log(res.data)
if (res.data.resultCode == 1) {} else {
if (res.data.resultCode == 1) {
var jsonData = res.data.data;
console.log("jsonData", jsonData);
this.addMsg.Id = jsonData.Id;
this.addMsg.TemplateName = jsonData.TemplateName;
this.addMsg.ComponentDataList = jsonData.ComponentDataList;
if (jsonData.ComponentDataList) {
this.dataList = jsonData.ComponentDataList;
}
} else {
this.Info(res.data.message);
}
})
}
},
mounted() {
this.GetPlugInList();
if (this.$route.query.Id) {
this.addMsg.Id = this.$route.query.Id;
}
if (this.addMsg.Id > 0) {
this.GetData();
}
this.GetPlugInList();
}
};
......
......@@ -73,6 +73,7 @@
this.apipost("/api/Template/GetMiniTemplatePageList", this.qMsg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
console.log("this.dataList",this.dataList);
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
......
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