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