From 5d388771fdf911e576adfa868ff954a044b9cacb Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Tue, 21 Apr 2026 10:09:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editEl/carousel1.vue | 7 +-- src/components/editEl/indexSwiper.vue | 6 ++- src/layout/index.vue | 47 +++++++++++++++++++ src/router/index.js | 27 +++++++---- src/views/editPage/index.vue | 36 +++++++++----- src/views/productCenter/edit/produceModel.vue | 1 + 6 files changed, 94 insertions(+), 30 deletions(-) create mode 100644 src/layout/index.vue diff --git a/src/components/editEl/carousel1.vue b/src/components/editEl/carousel1.vue index cecc5b8..304825a 100644 --- a/src/components/editEl/carousel1.vue +++ b/src/components/editEl/carousel1.vue @@ -1,15 +1,14 @@ diff --git a/src/components/editEl/indexSwiper.vue b/src/components/editEl/indexSwiper.vue index b9449cc..ec0fe76 100644 --- a/src/components/editEl/indexSwiper.vue +++ b/src/components/editEl/indexSwiper.vue @@ -4,8 +4,10 @@
-
{{ item.portalConfigTitle }}
-
{{ +
+ {{ item.portalConfigTitle }} +
+
{{ item.portalConfigDesc }}
diff --git a/src/layout/index.vue b/src/layout/index.vue new file mode 100644 index 0000000..70c7130 --- /dev/null +++ b/src/layout/index.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/router/index.js b/src/router/index.js index 5a948ad..6a5b832 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,17 +1,24 @@ import Vue from 'vue' import Router from 'vue-router' +import Layout from '@/layout' Vue.use(Router) export default new Router({ - routes: [{ - path: '/', redirect: '/editor', - }, - { - path: '/editor', component: () => import('@/views/editPage/index.vue'), - }, - { - path: '/productCenter/edit', component: () => import('@/views/productCenter/edit/index.vue'), - } - ] + routes: [ + + { + path: '', + component: Layout, + redirect: '/editor', + children: [ + { + path: '/editor', component: () => import('@/views/editPage/index.vue'), + }, + { + path: '/productCenter/edit', component: () => import('@/views/productCenter/edit/index.vue'), + } + ] + }, + ] }) diff --git a/src/views/editPage/index.vue b/src/views/editPage/index.vue index 20cc793..6ac42a5 100644 --- a/src/views/editPage/index.vue +++ b/src/views/editPage/index.vue @@ -60,7 +60,7 @@
- +
@@ -438,9 +438,16 @@ export default { } }, mounted() { - if (this.$route.query.type && this.$route.query.id) { - - if (this.$route.query.type === '1') { + this.initByRoute(); + }, + watch: { + $route() { + this.initByRoute(); + } + }, + methods: { + initByRoute() { + if (this.$route.query.type === '1' && this.$route.query.id) { this.props = {checkStrictly: true, value: 'webMenuId', label: 'webMenuName'} selectMenuTree().then(v => { this.options = v.data.find(vv => vv.webMenuId === 4).children @@ -451,11 +458,10 @@ export default { }) }) } - if (this.$route.query.type === '2') { + if (this.$route.query.type === '2' && this.$route.query.id) { this.props = {checkStrictly: true, value: 'id', label: 'name', children: 'list'} getHwWeb(7).then(res => { this.options = JSON.parse(res?.data?.webJsonString || '{}').productList || [] - this.type = this.$route.query.type this.value = this.$route.query.id.split(',').map(v => parseFloat(v)) listHwWeb1({webCode: this.value[0], typeId: this.value[1], deviceId: this.value[2]}).then(e => { @@ -463,10 +469,14 @@ export default { }) }) } - - } - }, - methods: { + if (this.$route.query.type === '3') { + this.type = '3' + this.value = [] + getHwWeb(-1).then(res => { + this.components = JSON.parse(res?.data?.webJsonString || '{}') + }) + } + }, edit(key, e) { this[key] = e.target.innerText }, @@ -574,7 +584,6 @@ export default { } }, typeChange(e) { - console.log(e) if (e === '1') { selectMenuTree().then(v => { this.options = v.data.find(vv => vv.webMenuId === 4).children @@ -582,6 +591,7 @@ export default { this.props = {checkStrictly: true, value: 'webMenuId', label: 'webMenuName'} } if (e === '2') { + console.log(1) getHwWeb(7).then(res => { this.options = JSON.parse(res?.data?.webJsonString || '{}').productList || [] // this.pageData = JSON.parse(res?.data?.webJsonString || '[]') @@ -591,7 +601,6 @@ export default { if (e === '3') { getHwWeb(-1).then(res => { this.components = JSON.parse(res?.data?.webJsonString || '{}') - this.$set(this.components, 'swiper', []) console.log(this.components) }) } @@ -665,4 +674,5 @@ export default { width: 100%; text-align: center; } - \ No newline at end of file + + diff --git a/src/views/productCenter/edit/produceModel.vue b/src/views/productCenter/edit/produceModel.vue index b59a1e3..6eddc1d 100644 --- a/src/views/productCenter/edit/produceModel.vue +++ b/src/views/productCenter/edit/produceModel.vue @@ -121,6 +121,7 @@ export default { top: 10px; cursor: pointer; } + .title { padding-top: 4.2vw; width: 100%;