Przeglądaj źródła

feat: 修改logo, 增加echart和table的选项联动效果

sunxiao 6 miesięcy temu
rodzic
commit
627a7d2a48

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 人工智能运营体决策助手
+VITE_APP_TITLE = LibraAI智能体运营平台
 
 # 开发环境配置
 VITE_APP_ENV = 'development'

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 人工智能运营体决策助手
+VITE_APP_TITLE = LibraAI智能体运营平台
 
 # 生产环境配置
 VITE_APP_ENV = 'production'

+ 1 - 1
.env.staging

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 人工智能运营体决策助手
+VITE_APP_TITLE = LibraAI智能体运营平台
 
 # 生产环境配置
 VITE_APP_ENV = 'staging'

+ 1 - 1
.env.test

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 人工智能运营体决策助手
+VITE_APP_TITLE = LibraAI智能体运营平台
 
 # 开发环境配置
 VITE_APP_ENV = 'development'

+ 1 - 1
index.html

@@ -9,7 +9,7 @@
       content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
     />
     <link rel="icon" href="/favicon.ico" />
-    <title>人工智能运营体决策助手 - 后台管理系统</title>
+    <title>LibraAI智能体运营平台 - 后台管理系统</title>
     <!--[if lt IE 11
       ]><script>
         window.location.href = "/html/ie.html";

BIN
src/assets/fonts/AlimamaShuHeiTi-Bold.otf


BIN
src/assets/fonts/AlimamaShuHeiTi-Bold.ttf


BIN
src/assets/fonts/AlimamaShuHeiTi-Bold.woff


BIN
src/assets/fonts/AlimamaShuHeiTi-Bold.woff2


Plik diff jest za duży
+ 6 - 0
src/assets/logo/logo.svg


+ 0 - 8
src/views/business/assistant/index.vue

@@ -9,14 +9,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <!-- <el-form-item label="类型" prop="category">
-        <el-input
-          v-model="queryParams.category"
-          placeholder="请输入分类"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item> -->
       <el-form-item>
         <el-button type="primary" icon="search" size="small" @click="handleQuery">搜索</el-button>
         <el-button icon="refresh" size="small" @click="resetQuery">重置</el-button>

+ 22 - 6
src/views/business/comparison/components/LineEchart.vue

@@ -1,5 +1,5 @@
 <script setup>
-import { ref, onMounted, onUnmounted, computed } from 'vue';
+import { ref, onMounted, onUnmounted, computed, watch } from 'vue';
 import * as echarts from 'echarts';
 import { getEchartData } from "@/api/business/comparison";
 import { getEchartLineOption } from "./echartConfig";
@@ -11,6 +11,10 @@ const props = defineProps({
   category: {
     type: Array,
     default: () => []
+  },
+  echartParams: {
+    type: Object,
+    default: () => ({})
   }
 })
 
@@ -20,11 +24,21 @@ const activeIndex = ref(0);
 
 const activeItem = computed(() => props.category[activeIndex.value]);
 
-const formatData = async () => {
+watch(() => props.echartParams, () => {
+  formatData();
+})
 
+const formatData = async (type) => {
+  const { timeBegin, timeEnd, category } = props.echartParams || {};
+  
   echart.showLoading();
+  
+  if ( (category || category == null) && type != 'slef') {
+    const index = props.category.findIndex(item => item.value == category);
+    activeIndex.value = index === -1 ? 0 : index;
+  }
 
-  const data = await getEchartData({ category: activeItem.value.value });
+  const data = await getEchartData({ category: activeItem.value.value, timeBegin, timeEnd });
   
   const xAxisData = [];
   const realOneList = [];
@@ -70,8 +84,6 @@ const formatData = async () => {
 
   const option = getEchartLineOption({ xAxisData, echartData })
 
-  console.log("option", option);
-
   echart.setOption(option);
 
   echart.hideLoading();
@@ -79,7 +91,7 @@ const formatData = async () => {
 
 const changeActive = (i) => {
   activeIndex.value = i;
-  formatData();
+  formatData('slef');
 }
 
 const legendselectchanged = () => {
@@ -126,6 +138,10 @@ onUnmounted(() => {
   window.addEventListener('resize', windowResize);
 })
 
+defineExpose({
+  initEchart: formatData
+})
+
 </script>
 
 <template>

+ 11 - 4
src/views/business/comparison/index.vue

@@ -30,7 +30,7 @@
     </el-form>
 
     <el-card shadow="never" class="card-chart_container">
-      <LineEchart :category="category"></LineEchart>
+      <LineEchart :category="category" :echartParams="echartParams" ref="refEchart"></LineEchart>
       </el-card>
     <el-card shadow="never" body-class="card-table_container">
       <el-row :gutter="10" class="mb8">
@@ -208,7 +208,9 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      echartParams: {},
+      refEchart: null,
     };
   },
   created() {
@@ -223,12 +225,17 @@ export default {
       let timeEnd = '';
    
       if ( begin ) {
-        timeBegin = dayjs(begin).format('YYYY/MM/DD H');
-        timeEnd = dayjs(end).format('YYYY/MM/DD H');
+        const endHour = dayjs(end).format('HH');
+        timeBegin = dayjs(begin).format('YYYY/MM/DD HH');
+        timeEnd = endHour === '00' ? dayjs(end).format('YYYY/MM/DD') + ' 24' : dayjs(end).format('YYYY/MM/DD HH')
       }
       
       const params = { ...this.queryParams, timeBegin, timeEnd };
+
       delete params.daterange;
+      
+      this.echartParams = params
+
       listComparison(params).then(response => {
         const whiteList = {
           xsy1: '#1NO₃⁻',

+ 40 - 24
src/views/login.vue

@@ -2,7 +2,10 @@
   <div class="login">
 
     <div class="header">
-      <svg-icon icon-class="logo" class="logo" />
+      <div class="logo_inner">
+        <img src="@/assets/logo/logo.svg" alt="">
+        <span>LibraAI智能体运营平台</span>
+      </div>
       <span class="line"></span>
       <span class="title">后台管理系统</span>
     </div>
@@ -15,25 +18,13 @@
       <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
         <h3 class="title">系统登录</h3>
         <el-form-item prop="username">
-          <el-input
-            v-model="loginForm.username"
-            type="text"
-            size="large"
-            auto-complete="off"
-            placeholder="账号"
-          >
+          <el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
             <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
           </el-input>
         </el-form-item>
         <el-form-item prop="password">
-          <el-input
-            v-model="loginForm.password"
-            type="password"
-            size="large"
-            auto-complete="off"
-            placeholder="密码"
-            @keyup.enter="handleLogin"
-          >
+          <el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码"
+            @keyup.enter="handleLogin">
             <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
           </el-input>
         </el-form-item>
@@ -54,13 +45,7 @@
         </el-form-item> -->
         <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
         <el-form-item style="width:100%;">
-          <el-button
-            :loading="loading"
-            size="large"
-            type="primary"
-            style="width:100%;"
-            @click.prevent="handleLogin"
-          >
+          <el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin">
             <span v-if="!loading">登 录</span>
             <span v-else>登 录 中...</span>
           </el-button>
@@ -111,7 +96,7 @@ const register = ref(false);
 const redirect = ref(undefined);
 
 watch(route, (newRoute) => {
-    redirect.value = newRoute.query && newRoute.query.redirect;
+  redirect.value = newRoute.query && newRoute.query.redirect;
 }, { immediate: true });
 
 function handleLogin() {
@@ -176,6 +161,16 @@ getCookie();
 </script>
 
 <style lang='scss' scoped>
+@font-face {
+  font-display: swap;
+  font-family: 'AlimamaShuHeiTi';
+  src: url('@/assets/fonts/AlimamaShuHeiTi-Bold.woff2') format('woff2'),
+    url('@/assets/fonts/AlimamaShuHeiTi-Bold.woff') format('woff'),
+    url('@/assets/fonts/AlimamaShuHeiTi-Bold.ttf') format('ttf');
+  font-weight: normal;
+  font-style: normal;
+}
+
 .login {
   position: relative;
   display: flex;
@@ -198,6 +193,20 @@ getCookie();
   font-weight: bold;
   color: #000;
 
+  .logo_inner {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-family: AlimamaShuHeiTi;
+    font-size: 12px;
+    span {
+      display: inline-block;
+      width: 90px;
+      line-height: 14px;
+      padding-left: 6px;
+    }
+  }
+
   .logo {
     width: 106px;
     height: 28px;
@@ -242,30 +251,36 @@ getCookie();
 
   .el-input {
     height: 40px;
+
     input {
       height: 40px;
     }
   }
+
   .input-icon {
     height: 39px;
     width: 14px;
     margin-left: 0px;
   }
 }
+
 .login-tip {
   font-size: 13px;
   text-align: center;
   color: #bfbfbf;
 }
+
 .login-code {
   width: 33%;
   height: 40px;
   float: right;
+
   img {
     cursor: pointer;
     vertical-align: middle;
   }
 }
+
 .el-login-footer {
   height: 40px;
   line-height: 40px;
@@ -278,6 +293,7 @@ getCookie();
   font-size: 12px;
   letter-spacing: 1px;
 }
+
 .login-code-img {
   height: 40px;
   padding-left: 12px;

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików