浏览代码

logo配置bug

lxf 1 年之前
父节点
当前提交
432a85893c
共有 1 个文件被更改,包括 18 次插入5 次删除
  1. 18 5
      src/views/systemTenant/tenant/logoConfiguration/index.vue

+ 18 - 5
src/views/systemTenant/tenant/logoConfiguration/index.vue

@@ -9,7 +9,8 @@
         :show-file-list="false"
         :on-success="handleAvatarSuccess"
         :before-upload="uploadFile">
-        <img v-if="imageUrl" :src="imageUrl" class="avatar" />
+        <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> -->
+        <el-image v-if="imageUrl" style="width: 120px; height: 30px" :src="imageUrl" fit="scale-down" />
         <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
       </el-upload>
     </div>
@@ -20,9 +21,9 @@
         <el-image v-if="imageUrl" style="width: 120px; height: 30px" :src="imageUrl" fit="scale-down" />
         <img v-else :src="'/img/logo2.png'" />
       </div>
-      <div style="height: 50px; background-color: black">
+      <div style="height: 50px; background-color: black; list-style-type: none">
         <li class="header-bar-hover-warp nav-li active">
-          <div class="menu-modal">
+          <div>
             <i class="iconfont icon-icomx_gongndh" style="margin: 0 5px 0 0"></i>
             功能导览
             <i class="iconfont icon-iconm_xialan1" style="margin: 0 0 0 3px"></i>
@@ -42,7 +43,7 @@ import { ref } from "vue";
 import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
-const imageUrl = ref("/img/logo2.png");
+const imageUrl = ref("");
 const fileList = ref([
   {
     id: "11111111111",
@@ -50,6 +51,18 @@ const fileList = ref([
     fileUrl: "/img/logo2.png",
   },
 ]);
+const getLogo = () => {
+  proxy.post("/tenantInfo/getLogo", {}).then((res) => {
+    if (res && res.length > 0 && res[0].fileUrl) {
+      imageUrl.value = res[0].fileUrl;
+      fileList.value[0].fileUrl = res[0].fileUrl
+    } else {
+      imageUrl.value = "/img/logo2.png";
+    }
+    console.log(fileList.value);
+  });
+};
+getLogo();
 const uploadData = ref({});
 const uploadFile = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
@@ -131,7 +144,7 @@ const clickSubmit = () => {
   background: #0084ff;
   color: #fff;
   height: 50px;
-  padding: 0 20px;
+  padding: 15px 20px;
   a {
     color: #fff;
   }