From e2ffe9683ef007a45afbcdd897985d64cdcc7391 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期四, 24 十一月 2022 11:26:31 +0800
Subject: [PATCH] 修改
---
src/views/systemSetting/platform/portalSetting/index.vue | 185 ++++++++++++++++++++++++++++++++-------------
1 files changed, 131 insertions(+), 54 deletions(-)
diff --git a/src/views/systemSetting/platform/portalSetting/index.vue b/src/views/systemSetting/platform/portalSetting/index.vue
index 8c6a40d..4157562 100644
--- a/src/views/systemSetting/platform/portalSetting/index.vue
+++ b/src/views/systemSetting/platform/portalSetting/index.vue
@@ -1,8 +1,8 @@
<template>
<div class="log">
<header>
- <div clas="headerTitle">
- 绯荤粺璁剧疆 銆嬮棬鎴风鐞� 銆媗ogo绠$悊
+ <div class="headerTitle">
+ 绯荤粺璁剧疆 >> 闂ㄦ埛绠$悊 > logo绠$悊
</div>
</header>
<main>
@@ -11,30 +11,23 @@
<li>
<div class="desc">浜у搧鍥炬爣锛氫富瑕佺敤浜庣綉椤靛ご閮�</div>
<div class="upload">
- <div class="uploadBtn">
- <i class="el-icon-plus"></i>
- <span>涓婁紶鍥剧墖</span>
- </div>
+ <MyUpload @getPicUrl="setPicUrl" mykey="chromeLinkUrl" :picUrl="icon.chromeLinkUrl"></MyUpload>
<div class="uploadTip"><span>鍙厑璁镐笂浼爅pg,jpeg,png,svg鏍煎紡鐨勫浘鐗囷紝寤鸿灏哄涓�105px*105px</span></div>
</div>
</li>
<li>
<div class="desc">缃戠珯鍥炬爣锛氫富瑕佺敤浜庢祻瑙堝櫒鏍囩椤�</div>
<div class="upload">
- <div class="uploadBtn">
- <i class="el-icon-plus"></i>
- <span>涓婁紶鍥剧墖</span>
- </div>
+ <MyUpload @getPicUrl="setPicUrl" mykey="websiteHeadUrl" :picUrl="icon.websiteHeadUrl">
+ </MyUpload>
<div class="uploadTip"><span>鍙厑璁镐笂浼爅pg,jpeg,png,svg鏍煎紡鐨勫浘鐗囷紝寤鸿灏哄涓�105px*105px</span></div>
</div>
</li>
<li>
<div class="desc">鐧诲綍椤靛浘鏍囷細涓昏鐢ㄤ簬鐧诲綍椤�</div>
<div class="upload">
- <div class="uploadBtn">
- <i class="el-icon-plus"></i>
- <span>涓婁紶鍥剧墖</span>
- </div>
+ <MyUpload @getPicUrl="setPicUrl" mykey="loginPageIconUrl" :picUrl="icon.loginPageIconUrl">
+ </MyUpload>
<div class="uploadTip"><span>鍙厑璁镐笂浼爅pg,jpeg,png,svg鏍煎紡鐨勫浘鐗囷紝寤鸿灏哄涓�105px*105px</span></div>
</div>
</li>
@@ -44,28 +37,119 @@
<div class="webTitle">
<div class="text">缃戠珯鏍囬:</div>
<div class="inner">
- <el-input type="text" placeholder="閬傛槍鎵ф硶灞�" v-model="title"></el-input>
+ <el-input type="text" placeholder="閬傛槍鎵ф硶灞�" v-model="icon.title"></el-input>
</div>
</div>
<div class="footerBtn">
<el-button class="cancel">杩斿洖</el-button>
- <el-button type="primary">鎻愪氦</el-button>
+ <el-button type="primary" @click="changeLogo">鎻愪氦</el-button>
</div>
</footer>
</div>
</template>
<script>
+import MyUpload from '@/components/Upload'
export default {
+ components: {
+ MyUpload,
+ },
data() {
return {
- title:'',
- icon:{
- login:'',
- website:'',
- product:'',
- }
+ icon: {
+ loginPageIconUrl: '',
+ websiteHeadUrl: '',
+ chromeLinkUrl: '',
+ title: '',
+ },
}
- }
+
+ },
+ methods: {
+ setPicUrl({ obj, value }) {
+ const { icon } = this;
+ const baseUrl = 'http://140.143.152.226:8410/';
+ for (let key in icon) {
+ if (key === value) {
+ icon[key] = baseUrl + obj.url1;
+ }
+ }
+ this.icon = icon;
+ },
+ // 鏇存敼logo鍏ュ彛
+ async changeLogo() {
+ const { icon } = this;
+ console.log(icon);
+ const preIcon = await this.getIcon();
+ if (preIcon.length === 0) {
+ this.handleChangeLogo();
+ return;
+ }
+ for (let key in icon) {
+ if (icon[key] !== '') {
+ preIcon[key] = icon[key];
+ }
+ }
+ this.handleChangeLogo(preIcon);
+ },
+ // 鑾峰彇鏇存敼鍓嶇殑logo
+ async getIcon() {
+ let result;
+ await this.$axios({
+ method: 'get',
+ url: 'sccg/system/portal/logo/search',
+ }).then(res => {
+ result = res.data;
+ })
+ return result;
+ },
+ // 鎵ц鏇存敼logo鎿嶄綔
+ handleChangeLogo(obj = null) {
+ if (obj === null) {
+ const { icon } = this;
+ for (let key in icon) {
+ if (icon[key] === '') {
+ delete icon[key];
+ }
+ }
+ let length = Object.keys(icon).length;
+ if (length !== 0) {
+ // 鍙戦�佽姹�
+ this.$axios({
+ method: 'post',
+ url: 'sccg/system/portal/logo/add',
+ data: icon
+ }).then(res => {
+ if (res.code == 200) {
+ this.$axios({
+ method: 'get',
+ url: 'sccg/system/portal/logo/search',
+ }).then(res => {
+ this.$message({
+ message: res.message,
+ type: 'success'
+ })
+ sessionStorage.setItem('pic', JSON.stringify(result));
+ })
+ }
+ })
+ }
+ } else {
+ // 鍙戦�佽姹�
+ this.$axios({
+ method: 'put',
+ url: 'sccg/system/portal/logo/update',
+ data: obj
+ }).then(res => {
+ this.$message({
+ message: res.message,
+ type: 'success'
+ })
+ })
+ }
+ window.location.href = '';
+
+ }
+ },
}
</script>
<style lang="scss" scoped>
@@ -98,6 +182,7 @@
li {
margin-top: 30px;
+
.desc {
line-height: 22px;
}
@@ -107,31 +192,13 @@
line-height: 100px;
margin-top: 15px;
- .uploadBtn {
- width: 120px;
- height: 120px;
- background-color:rgba(249, 249, 249, 1);
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- border-radius: 4px;
- i {
- font-size: 30px;
- font-weight: 650;
- }
-
- span {
- line-height: 22px;
- }
- }
-
.uploadTip {
display: flex;
align-items: flex-end;
margin-left: 20px;
font-size: 14px;
- span{
+
+ span {
line-height: 22px;
}
}
@@ -139,34 +206,44 @@
}
}
}
- footer{
+
+ footer {
padding: 0 20px;
- .webTitle{
+
+ .webTitle {
display: flex;
line-height: 40px;
- margin:30px 0;
- .text{
+ margin: 30px 0;
+
+ .text {
flex: 1;
}
- .inner{
+
+ .inner {
flex: 13;
- .el-input{
+
+ .el-input {
width: 496px;
}
- &::v-deep .el-input__inner{
+
+ &::v-deep .el-input__inner {
background-color: #09152f;
- border: 1px solid #17324c;;
+ border: 1px solid #17324c;
+ ;
}
}
}
- .footerBtn{
+
+ .footerBtn {
display: flex;
justify-content: center;
- &::v-deep .el-button{
+
+ &::v-deep .el-button {
padding: 12px 40px;
font-weight: 600;
}
- .cancel{
+
+ .cancel {
border: 2px solid #0079fe;
color: #0079fe;
}
--
Gitblit v1.8.0