Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui

master
Chopper711 2022-12-07 17:01:28 +08:00
commit 235d582ae2
5 changed files with 608 additions and 494 deletions

174
buyer/package-lock.json generated
View File

@ -477,70 +477,6 @@
"webpack-merge": "^4.2.2"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.3.tgz",
"integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"postcss-loader": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/postcss-loader/-/postcss-loader-3.0.0.tgz",
@ -585,28 +521,6 @@
"ajv-errors": "^1.0.0",
"ajv-keywords": "^3.1.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
@ -10278,6 +10192,94 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-piczoom": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/vue-piczoom/-/vue-piczoom-1.0.6.tgz",

View File

@ -25,14 +25,25 @@
<div class="item" v-for="(item, index) in list" :key="index">
<div>{{ item.name || "暂无模板昵称" }}</div>
<div class="item-config">
<i-switch v-model="item.pageShow" @on-change="releaseTemplate(item.id)">
<i-switch
v-model="item.pageShow"
@on-change="releaseTemplate(item.id)"
>
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
<Button type="info" placement="right" @click="Template(item)" size="small"
<Button
type="info"
placement="right"
@click="Template(item)"
size="small"
>编辑</Button
>
<Button type="success" placement="right" @click="decorate(item)" size="small"
<Button
type="success"
placement="right"
@click="decorate(item)"
size="small"
>装修</Button
>
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)">
@ -42,7 +53,18 @@
</div>
<div class="no-more" v-if="list.length == 0"></div>
</div>
<Page show-total :total="total" show-sizer size="small" :page-size-opts="[10, 20, 50]" show-elevator style="float:right;overflow:hidden;" @on-change="changePageNum" @on-page-size-change="changePageSize" :page-size="searchForm.pageSize"/>
<Page
show-total
:total="total"
show-sizer
size="small"
:page-size-opts="[10, 20, 50]"
show-elevator
style="float: right; overflow: hidden"
@on-change="changePageNum"
@on-page-size-change="changePageSize"
:page-size="searchForm.pageSize"
/>
</Card>
<Modal
v-model="showModal"
@ -81,8 +103,8 @@ export default {
searchForm: {
pageNumber: 1,
pageSize: 10,
sort: 'createTime',
order: 'desc',
sort: "createTime",
order: "desc",
pageType: "INDEX",
pageClientType: "PC",
},
@ -111,7 +133,7 @@ export default {
{
type: "SPECIAL",
title: "专题",
}
},
],
list: [], //
};
@ -128,7 +150,8 @@ export default {
data.status ? (data.pageShow = "OPEN") : (data.pageShow = "CLOSE");
delete data.status;
// (data.pageType = "INDEX"), (data.pageClientType = "PC");
(data.pageType = this.searchForm.pageType), (data.pageClientType = "PC");
(data.pageType = this.searchForm.pageType),
(data.pageClientType = "PC");
if (data.id) {
API_floor.updateHome(data.id, data).then((res) => {
this.$Message.success("编辑模板成功");
@ -149,7 +172,7 @@ export default {
},
clickType(type, index) {
this.searchForm.pageNumber = 1
this.searchForm.pageNumber = 1;
this.searchForm.pageType = type;
this.selectedIndex = index;
this.getTemplateList();
@ -198,7 +221,7 @@ export default {
API_floor.getHomeList(this.searchForm).then((res) => {
if (res.success) {
// this.total
this.total = res.result.total
this.total = res.result.total;
this.list = res.result.records;
this.list.forEach((e) => {
if (e.pageShow === "OPEN") {

View File

@ -25,14 +25,25 @@
<div class="item" v-for="(item, index) in list" :key="index">
<div>{{ item.name || "暂无模板昵称" }}</div>
<div class="item-config">
<i-switch v-model="item.pageShow" @on-change="releaseTemplate(item.id)">
<i-switch
v-model="item.pageShow"
@on-change="releaseTemplate(item.id)"
>
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
<Button type="info" placement="right" @click="Template(item)" size="small"
<Button
type="info"
placement="right"
@click="Template(item)"
size="small"
>编辑</Button
>
<Button type="success" placement="right" @click="decorate(item)" size="small"
<Button
type="success"
placement="right"
@click="decorate(item)"
size="small"
>装修</Button
>
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)">
@ -42,7 +53,17 @@
</div>
<div class="no-more" v-if="list.length == 0"></div>
</div>
<Page show-total :total="total" show-sizer :page-size-opts="[10, 20, 50]" show-elevator style="float:right;overflow:hidden;" @on-change="changePageNum" @on-page-size-change="changePageSize" :page-size="searchForm.pageSize"/>
<Page
show-total
:total="total"
show-sizer
:page-size-opts="[10, 20, 50]"
show-elevator
style="float: right; overflow: hidden"
@on-change="changePageNum"
@on-page-size-change="changePageSize"
:page-size="searchForm.pageSize"
/>
</Card>
<Modal
v-model="showModal"
@ -81,9 +102,9 @@ export default {
searchForm: {
pageNumber: 1,
pageSize: 10,
sort: 'createTime',
order: 'desc',
pageClientType:'PC'
sort: "createTime",
order: "desc",
pageClientType: "PC",
},
columns: [
// column
@ -189,7 +210,7 @@ export default {
API_floor.getHomeList(this.searchForm).then((res) => {
if (res.success) {
// this.total
this.total = res.result.total
this.total = res.result.total;
this.list = res.result.records;
this.list.forEach((e) => {
if (e.pageShow === "OPEN") {

View File

@ -2,10 +2,15 @@
<div class="model-form">
<div class="model-content">
<!-- 头部广告登录信息不需要拖拽 -->
<div class="top-fixed-advert" :style="{backgroundColor:topAdvert.bgColor}">
<img :src="topAdvert.img" width="1200" height="80" alt="">
<div
class="top-fixed-advert"
:style="{ backgroundColor: topAdvert.bgColor }"
>
<!-- <img :src="topAdvert.img" width="1200" height="80" alt="" /> -->
<div class="setup-box">
<Button size="small" @click.stop="handleModel('topAdvert')">编辑</Button>
<Button size="small" @click.stop="handleModel('topAdvert')"
>编辑</Button
>
</div>
</div>
<div class="header-con">
@ -20,14 +25,15 @@
</ul>
</div>
<div class="search-con">
<img :src="require('@/assets/logo.png')" class="logo" alt="">
<img :src="require('@/assets/logo.png')" class="logo" alt="" />
<div class="search">
<i-input size="large" placeholder="输入你想查找的商品">
<Button class="soubenStore" slot="append">搜本店</Button>
<Button slot="append">搜索</Button>
</i-input>
</div>
</div>
<div class="nav-con">
<!-- <div class="nav-con">
<div class="all-categories">全部商品分类</div>
<ul class="nav-item">
<li v-for="(item, index) in navList.list" :key="index">
@ -35,19 +41,28 @@
</li>
</ul>
<div class="setup-box">
<Button size="small" @click.stop="handleModel('quickNav')">编辑</Button>
</div>
<Button size="small" @click.stop="handleModel('quickNav')"
>编辑</Button
>
</div>
</div> -->
<!-- 装修主体 -->
<div>
<draggable class="model-form-list"
<draggable
class="model-form-list"
v-model="data.list"
v-bind="{ group: 'model', ghostClass: 'ghost' }"
@end="handleMoveEnd"
@add="handleModelAdd"
>
<template v-for="(element, index) in data.list">
<model-form-item v-if="element && element.key" :key="element.key" :element="element" :index="index" :data="data"></model-form-item>
<model-form-item
v-if="element && element.key"
:key="element.key"
:element="element"
:index="index"
:data="data"
></model-form-item>
</template>
</draggable>
</div>
@ -59,26 +74,33 @@
width="800"
:z-index="100"
:mask-closable="false"
>
<!-- 顶部广告 -->
<div class="modal-top-advert">
<div>
<img class="show-image" width="600" height="40" :src="topAdvert.img" alt />
<img
class="show-image"
width="600"
height="40"
:src="topAdvert.img"
alt
/>
</div>
<div class="tips">
建议尺寸<span>{{ topAdvert.size }}</span>
</div>
<div>
图片链接<span>{{ topAdvert.url }}</span><Button size="small" type="primary" @click="handleSelectLink"></Button>
图片链接<span>{{ topAdvert.url }}</span
><Button size="small" type="primary" @click="handleSelectLink"
>选择链接</Button
>
</div>
<div>
选择图片<Button size="small" type="primary" @click="handleSelectImg"></Button>&nbsp;
</div>
<div>
选择背景色<ColorPicker v-model="topAdvert.bgColor" />
选择图片<Button size="small" type="primary" @click="handleSelectImg"
>选择图片</Button
>&nbsp;
</div>
<div>选择背景色<ColorPicker v-model="topAdvert.bgColor" /></div>
</div>
</Modal>
<Modal
@ -91,7 +113,9 @@
>
<!-- 分类tab栏 -->
<div class="modal-tab-bar">
<Button type="primary" size='small' @click="handleAddNav"></Button>
<Button type="primary" size="small" @click="handleAddNav"
>添加分类</Button
>
<table cellspacing="0">
<thead>
<tr>
@ -107,8 +131,15 @@
<td><Input v-model="item.url" disabled /></td>
<!-- <td><Input v-model="item.sort"/></td> -->
<td>
<Button type="primary" size="small" @click="handleSelectLink(item,index)"></Button>&nbsp;
<Button type="error" size="small" @click="handleDelNav(index)"></Button>
<Button
type="primary"
size="small"
@click="handleSelectLink(item, index)"
>选择链接</Button
>&nbsp;
<Button type="error" size="small" @click="handleDelNav(index)"
>删除</Button
>
</td>
</tr>
</tbody>
@ -116,29 +147,29 @@
</div>
</Modal>
<!-- 选择商品链接 -->
<liliDialog
ref="liliDialog"
@selectedLink="selectedLink"
></liliDialog>
<liliDialog ref="liliDialog" @selectedLink="selectedLink"></liliDialog>
<!-- 选择图片 -->
<Modal width="1200px" v-model="picModelFlag" footer-hide>
<ossManage @callback="callbackSelected" :isComponent="true" ref="ossManage" />
<ossManage
@callback="callbackSelected"
:isComponent="true"
ref="ossManage"
/>
</Modal>
</div>
</template>
<script>
import Draggable from 'vuedraggable'
import ModelFormItem from './modelFormItem.vue'
import Draggable from "vuedraggable";
import ModelFormItem from "./modelFormItem.vue";
import ossManage from "@/views/sys/oss-manage/ossManage";
export default {
name:'modelForm',
name: "modelForm",
components: {
Draggable,
ModelFormItem,
ossManage
ossManage,
},
props:['data'],
props: ["data"],
data() {
return {
picModelFlag: false, //
@ -146,35 +177,48 @@ export default {
showModalNav: false, // nav
selectedNav: null, //nav
//
promotionTags: [ "买2免1", "领200神券", "199减100", "母婴5折抢", "充100送20"], //
topAdvert:{ // 广
type:'topAdvert',
img:'',
url:'',
bgColor:'#de000d',
size:'1200*80'
promotionTags: [
"买2免1",
"领200神券",
"199减100",
"母婴5折抢",
"充100送20",
], //
topAdvert: {
// 广
type: "topAdvert",
img: "",
url: "",
bgColor: "#de000d",
size: "1200*80",
},
navList:{ // nav
type:'navBar',
navList: {
// nav
type: "navBar",
list: [
{name:'秒杀', url:''}, {name:'闪购', url:''}, {name:'优惠券', url:''}, {name:'拍卖', url:''}, {name:'服装城', url:''},
]
}
}
{ name: "秒杀", url: "" },
{ name: "闪购", url: "" },
{ name: "优惠券", url: "" },
{ name: "拍卖", url: "" },
{ name: "服装城", url: "" },
],
},
};
},
mounted() {
document.body.ondrop = function (event) {
let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1
let isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
if (isFirefox) {
event.preventDefault()
event.stopPropagation()
}
event.preventDefault();
event.stopPropagation();
}
};
},
methods: {
handleSelectLink(item,index) { //
handleSelectLink(item, index) {
//
if (item) this.selectedNav = item;
this.$refs.liliDialog.open('link')
this.$refs.liliDialog.open("link");
},
//
selectedLink(val) {
@ -185,22 +229,22 @@ export default {
this.topAdvert.url = this.$options.filters.formatLinkType(val);
}
},
handleDelNav(index){ //
this.navList.list.splice(index,1)
handleDelNav(index) {
//
this.navList.list.splice(index, 1);
},
handleAddNav(){ //
this.navList.list.push(
{name:'',url:''}
)
console.log(this.navList.list)
handleAddNav() {
//
this.navList.list.push({ name: "", url: "" });
console.log(this.navList.list);
},
//
handleMoveEnd({ newIndex, oldIndex }) {
console.log('index', newIndex, oldIndex)
console.log("index", newIndex, oldIndex);
},
// 广
handleModel(type) {
if(type == 'topAdvert'){
if (type == "topAdvert") {
this.showModal = true;
} else {
this.showModalNav = true;
@ -211,16 +255,21 @@ export default {
this.$refs.ossManage.selectImage = true;
this.picModelFlag = true;
},
callbackSelected (item) { //
callbackSelected(item) {
//
this.picModelFlag = false;
this.topAdvert.img = item.url;
},
handleModelAdd (evt) { //
const newIndex = evt.newIndex
handleModelAdd(evt) {
//
const newIndex = evt.newIndex;
// key
this.data.list[newIndex] = JSON.parse(JSON.stringify(this.data.list[newIndex]))
const key = Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999)
this.data.list[newIndex] = JSON.parse(
JSON.stringify(this.data.list[newIndex])
);
const key =
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
this.$set(this.data.list, newIndex, {
...this.data.list[newIndex],
options: {
@ -228,14 +277,14 @@ export default {
},
key,
//
model: this.data.list[newIndex].type + '_' + key
})
model: this.data.list[newIndex].type + "_" + key,
});
},
}
}
},
};
</script>
<style lang="scss" scoped>
@import './modelList/setup-box.scss';
@import "./modelList/setup-box.scss";
.model-form {
width: 1500px;
}
@ -265,7 +314,8 @@ export default {
line-height: 35px;
color: #999;
font-weight: bold;
div,li{
div,
li {
&:hover {
color: $theme_color;
cursor: pointer;
@ -280,7 +330,7 @@ export default {
padding-left: 10px;
}
&:last-child::after {
content:'';
content: "";
padding-left: 0;
}
&:hover::after {
@ -326,6 +376,11 @@ export default {
line-height: 1;
}
}
.soubenStore {
font-size: 14px;
font-weight: 600;
background-color: #f90;
}
}
}
/** 商品分类 */
@ -357,14 +412,17 @@ export default {
a {
color: rgb(89, 88, 88);
font-size: 15px;
&:hover{color:$theme_color}
&:hover {
color: $theme_color;
}
}
}
}
}
/** 顶部广告,头部,搜索框 end */
.top-fixed-advert, .nav-con{
.top-fixed-advert,
.nav-con {
position: relative;
&:hover {
.setup-box {

View File

@ -3,7 +3,15 @@
<!-- 左侧模块列表 -->
<div class="model-list">
<div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" >
<draggable
tag="ul"
:list="modelData"
v-bind="{
group: { name: 'model', pull: 'clone', put: false },
sort: false,
ghostClass: 'ghost',
}"
>
<li v-for="(model, index) in modelData" :key="index" class="model-item">
<Icon :type="model.icon" />
<span>{{ model.name }}</span>
@ -16,7 +24,9 @@
</div>
<!-- 操作按钮 -->
<div class="btn-bar">
<Button type="primary" :loading="submitLoading" @click="saveTemplate"></Button>
<Button type="primary" :loading="submitLoading" @click="saveTemplate"
>保存模板</Button
>
<Button class="ml_10" @click="resetTemplate"></Button>
</div>
</div>
@ -44,21 +54,21 @@ export default {
methods: {
saveTemplate() {
//
this.submitTemplate(this.$route.query.pageShow ? 'OPEN' : 'CLOSE')
this.submitTemplate(this.$route.query.pageShow ? "OPEN" : "CLOSE");
},
//
submitTemplate(pageShow) {
this.submitLoading = true
const modelForm = JSON.parse(JSON.stringify(this.modelForm))
this.submitLoading = true;
const modelForm = JSON.parse(JSON.stringify(this.modelForm));
modelForm.list.unshift(this.$refs.modelForm.navList);
modelForm.list.unshift(this.$refs.modelForm.topAdvert);
const data = {
id: this.$route.query.id,
pageData: JSON.stringify(modelForm),
pageShow
pageShow,
};
API_floor.updateHome(this.$route.query.id, data).then((res) => {
this.submitLoading = false
this.submitLoading = false;
if (res.success) {
this.$Message.success("保存模板成功");
}