소스 검색

更新依赖

ZaiZai 1 년 전
부모
커밋
662bff5354

+ 2 - 2
package.json

@@ -21,7 +21,7 @@
         "dayjs": "^1.11.10",
         "echarts": "^5.5.0",
         "element-plus": "2.6.1",
-        "hc-vue3-ui": "^3.2.8",
+        "hc-vue3-ui": "^3.4.0",
         "js-base64": "^3.7.7",
         "js-fast-way": "^0.4.6",
         "js-md5": "^0.8.3",
@@ -41,7 +41,7 @@
         "archiver": "^7.0.1",
         "bignumber.js": "^9.1.2",
         "eslint": "^8.57.0",
-        "eslint-plugin-vue": "^9.22.0",
+        "eslint-plugin-vue": "^9.23.0",
         "sass": "^1.71.1",
         "unocss": "^0.58.5",
         "unocss-preset-extra": "^0.5.3",

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240228102614"
+  "value": "20240312100125"
 }

+ 0 - 102
src/components/echarts/echarts.vue

@@ -1,102 +0,0 @@
-<template>
-    <div class="hc-echarts-box">
-        <div ref="echart" class="hc-echarts" :style="`width : ${chart?.clientWidth}px`" />
-    </div>
-</template>
-
-<script setup>
-import * as echarts from 'echarts'
-import { getObjValue } from 'js-fast-way'
-import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
-const props = defineProps({
-    option: {
-        type: Object,
-        default: () => ({}),
-    },
-})
-
-defineOptions({
-    name: 'HcCharts',
-})
-
-//初始变量
-let chart = null
-const echart = ref(null)
-const options = ref(getObjValue(props.option))
-
-//深度监听
-watch(() => [
-    props.option,
-], ([option]) => {
-    options.value = getObjValue(option)
-    setOptions(options.value)
-}, { deep: true })
-
-//初始化图表
-const initChart = () => {
-    chart = echarts.init(echart.value)
-    setOptions(options.value)
-}
-
-//监听浏览器窗口变化
-const windowResize = () => {
-    window.addEventListener('resize', resizeEvent)
-}
-
-const resizeEvent = () => {
-    window.requestAnimationFrame(() => {
-        chart.resize()
-    })
-}
-
-//设置图表
-const setOptions = (option) => {
-    nextTick(() => {
-        chart.setOption(option)
-    })
-}
-
-//渲染完成
-onMounted(() => {
-    nextTick(() => {
-        initChart()
-        windowResize()
-    })
-})
-
-//被卸载
-onUnmounted(() => {
-    window.removeEventListener('resize', resizeEvent)
-    chart.dispose()
-    chart = null
-})
-
-const onResize = () => {
-    nextTick(() => {
-        chart.resize()
-    })
-}
-
-// 暴露出去
-defineExpose({
-    onResize,
-})
-</script>
-
-<style lang="scss" scoped>
-.hc-echarts-box {
-    display: block;
-    height: 100%;
-    overflow: hidden;
-    position: relative;
-    .hc-echarts {
-        position: absolute;
-        bottom: 0;
-        left: 0;
-        right: 0;
-        z-index: 2;
-        width: 100%;
-        height: 100%;
-    }
-}
-</style>

+ 0 - 4
src/components/index.js

@@ -4,9 +4,7 @@ import HcChoiceUser from './choice-user/choice-user.vue'
 import HcReportDialog from './hc-report/hc-report.vue'
 import HcInfoTable from './info-table/info-table.vue'
 import HcInfoTableTd from './info-table/info-table-td.vue'
-import HcCharts from './echarts/echarts.vue'
 import HcTitle from './hc-title/hc-title.vue'
-import HcSearchInput from './search-input/search-input.vue'
 import HcTasksUser from './hc-tasks-user/index.vue'
 import HcViewReport from './view-report/view-report.vue'
 import HcGradientCard from './gradient-card/index.vue'
@@ -21,9 +19,7 @@ export const setupComponents = (App) => {
     App.component('HcReportDialog', HcReportDialog)
     App.component('HcInfoTable', HcInfoTable)
     App.component('HcInfoTableTd', HcInfoTableTd)
-    App.component('HcCharts', HcCharts)
     App.component('HcTitle', HcTitle)
-    App.component('HcSearchInput', HcSearchInput)
     App.component('HcTasksUser', HcTasksUser)
     App.component('HcViewReport', HcViewReport)
     App.component('HcPdfs', HcPdfs)

+ 0 - 1
src/components/message/index.vue

@@ -11,7 +11,6 @@
 
 <script setup>
 import { ref, watch } from 'vue'
-import { HcLottie } from 'hc-vue3-ui'
 //参数
 const props = defineProps({
     type: {

+ 0 - 59
src/components/search-input/search-input.vue

@@ -1,59 +0,0 @@
-<template>
-    <div class="hc-search-input-box">
-        <el-input v-model="queryValue" class="w-60" clearable :placeholder="placeholder" @keyup="keyUpEvent" />
-        <el-button type="primary" @click="searchClick">{{ text }}</el-button>
-    </div>
-</template>
-
-<script setup>
-defineProps({
-    placeholder: {
-        type: String,
-        default: '请输入关键词检索',
-    },
-    text: {
-        type: String,
-        default: '查询',
-    },
-})
-
-const emit = defineEmits(['search'])
-
-defineOptions({
-    name: 'HcSearchInput',
-})
-
-//双向绑定
-// eslint-disable-next-line no-undef
-const queryValue = defineModel('modelValue', {
-    default: '',
-})
-
-//回车搜索
-const keyUpEvent = (e) => {
-    if (e.key === 'Enter') {
-        searchClick()
-    }
-}
-
-//搜索
-const searchClick = () => {
-    emit('search', queryValue.value)
-}
-</script>
-
-<style lang="scss">
-.hc-search-input-box {
-    position: relative;
-    display: flex;
-    align-items: center;
-    .el-input__wrapper {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-    }
-    .el-button {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-    }
-}
-</style>

+ 10 - 0
src/layout/index.scss

@@ -449,3 +449,13 @@
     color: white;
     background-color: var(--el-color-primary-dark-2);
 }
+
+//没有 layout
+.hc-layout-box.is-no-layout {
+    .hc-layout-header, .hc-layout-aside, .hc-router-menu-bar {
+        display: none !important;
+    }
+    .hc-layout-container .hc-layout-main .hc-main-page {
+        height: 100%;
+    }
+}

+ 15 - 6
src/layout/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-container class="hc-layout-box">
+    <el-container class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']">
         <el-header class="hc-layout-header">
             <div class="hc-layout-header-logo" :style="`width: ${isCollapse ? '0px' : '200px'};`" @click="logoClick">
                 <!-- <img id="logo-icon" :src="appLogoIcon" alt=""> -->
@@ -44,15 +44,16 @@
 </template>
 
 <script setup>
-import { nextTick, onMounted, ref } from 'vue'
+import { nextTick, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
-import { useRouter } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import { initButtons } from '~sto/app'
 import HcSocket from '~src/plugins/HcSocket'
 import { getObjValue, isNullES } from 'js-fast-way'
 
 //初始组合式
 const router = useRouter()
+const useRoutes = useRoute()
 const store = useAppStore()
 
 const reloadRouter = ref(true)
@@ -66,18 +67,26 @@ import ConfigBar from './modules/ConfigBar.vue'
 import RouterMenu from './modules/RouterMenu.vue'
 import MenuBar from '~src/layout/modules/MenuBar.vue'
 
-// logo
-const appLogoIcon = ref(store.getLogoIcon)
-
 //菜单数据
 const menuBarKey = ref('')
 const menuBarData = ref([])
+const isLayout = ref('')
 
 //渲染完成
 onMounted(() => {
+    const layout = useRoutes?.query?.layout, layout2 = store.isLayout
+    isLayout.value = layout ?? layout2
     initButtons()
 })
 
+//监听layout
+watch(() => [
+    useRoutes?.query?.layout,
+    store.isLayout,
+], ([layout, layout2]) => {
+    isLayout.value = layout ?? layout2
+}, { deep: true })
+
 //路由信息
 const routerMenuLoad = ({ key }) => {
     menuBarKey.value = key

+ 7 - 0
src/store/index.js

@@ -38,6 +38,7 @@ export const useAppStore = defineStore('main', {
         dragModalSortTop: [], //拖拽弹窗排序
         barMenuName: '',
         isSource: getStoreValue('isSource') || '', //来源
+        isLayout: getStoreValue('isLayout') || '', //是否显示layout
     }),
     getters: {
         //系统信息
@@ -68,6 +69,7 @@ export const useAppStore = defineStore('main', {
         getCollapse: state => state.isCollapse,
         getDragModalSortTop: state => state.dragModalSortTop,
         getIsSource: state => state.isSource,
+        getIsLayout: state => state.isLayout,
     },
     actions: {
         //系统信息
@@ -168,6 +170,10 @@ export const useAppStore = defineStore('main', {
             this.isSource = value
             setStoreValue('isSource', value)
         },
+        setIsLayout(value) {
+            this.isLayout = value
+            setStoreValue('isLayout', value)
+        },
         //清除缓存和token
         clearStoreData() {
             //清除状态
@@ -188,6 +194,7 @@ export const useAppStore = defineStore('main', {
             this.isCollapse = false
             this.dragModalSortTop = []
             this.isSource = ''
+            this.isLayout = ''
             //清除缓存
             clearStoreAll()
             removeToken()

+ 12 - 6
src/views/home/auth.vue

@@ -34,17 +34,20 @@ store.clearStoreData()
 //变量
 const loading = ref(true)
 const isErrorShow = ref(false)
+const toUrl = ref('')
 
 //渲染完成
 onMounted(() => {
-    // http://档案的域名/#/auth-token?token=xxx&tid=xxx&pid=xxx&cid=xxx
-    const { token, tid, pid, cid } = getObjValue(useRoutes.query)
+    // http://档案的域名/#/auth-token?token=xxx&tid=xxx&pid=xxx&cid=xxx&layout=no&url=xxx
+    const { token, tid, pid, cid, layout, url } = getObjValue(useRoutes.query)
     if (!isNullES(token)) {
         isErrorShow.value = false
+        toUrl.value = url ?? ''
         //缓存数据
         store.setTokenVal(token)
         store.setProjectId(pid)
         store.setContractId(cid)
+        store.setIsLayout(layout)
         //处理授权登录
         setLoginByTokenData(token, tid)
     } else {
@@ -67,7 +70,6 @@ const setLoginByTokenData = async (token, tenant_id) => {
     await loginByTokenApi({ token, tenantId })
 }
 
-
 //请求授权登录
 const loginByTokenApi = async (form) => {
     const { error, code, data } = await loginByToken(form)
@@ -78,9 +80,13 @@ const loginByTokenApi = async (form) => {
             loading.value = false
             isErrorShow.value = false
             window?.$message?.success('授权登录成功')
-            router.push({
-                name: store.homeUrl ?? 'home',
-            })
+            if (isNullES(toUrl.value)) {
+                router.push({
+                    name: store.homeUrl ?? 'home',
+                })
+            } else {
+                router.push({ path: toUrl.value })
+            }
         }, 1500)
     } else {
         window.$message?.error('授权登录失败')

+ 22 - 8
yarn.lock

@@ -1618,10 +1618,10 @@ escape-string-regexp@^4.0.0:
   resolved "http://39.108.216.210:9000/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
   integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
 
-eslint-plugin-vue@^9.22.0:
-  version "9.22.0"
-  resolved "http://39.108.216.210:9000/eslint-plugin-vue/-/eslint-plugin-vue-9.22.0.tgz#e8a625adb0b6ce3b65635dd74fec8345146f8e26"
-  integrity sha512-7wCXv5zuVnBtZE/74z4yZ0CM8AjH6bk4MQGm7hZjUC2DBppKU5ioeOk5LGSg/s9a1ZJnIsdPLJpXnu1Rc+cVHg==
+eslint-plugin-vue@^9.23.0:
+  version "9.23.0"
+  resolved "http://39.108.216.210:9000/eslint-plugin-vue/-/eslint-plugin-vue-9.23.0.tgz#1354a33b0cd21e0cb373557ff73c5d7a6698fbcd"
+  integrity sha512-Bqd/b7hGYGrlV+wP/g77tjyFmp81lh5TMw0be9093X02SyelxRRfCI6/IsGq/J7Um0YwB9s0Ry0wlFyjPdmtUw==
   dependencies:
     "@eslint-community/eslint-utils" "^4.4.0"
     natural-compare "^1.4.0"
@@ -1955,10 +1955,19 @@ has-flag@^4.0.0:
   resolved "http://39.108.216.210:9000/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
   integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
 
-hc-vue3-ui@^3.2.8:
-  version "3.2.8"
-  resolved "http://39.108.216.210:9000/hc-vue3-ui/-/hc-vue3-ui-3.2.8.tgz#e5cbab7fa802a3d85354129855a8cacda1a858ce"
-  integrity sha512-PJmL+l5LH6h3c/+ZAqH7kj3h/3olDm79Y/a4nD1Dq6joD0nY3v3WQmDbR7HAJ3an9tpmDFzJqNPtSRfHe7PHjw==
+hc-vue3-ui@^3.4.0:
+  version "3.4.0"
+  resolved "http://39.108.216.210:9000/hc-vue3-ui/-/hc-vue3-ui-3.4.0.tgz#ed86cc070ca775486815453e96d7f90ff7be06c2"
+  integrity sha512-PugGUa7UMd+ufKzWURJLNzl2d79WwLGGEqWYLX+eUajKanN++ZrXGjxxdxNN1MTZz7BumBePWjXH5/L+PoXHmA==
+  dependencies:
+    axios "^1.6.7"
+    dayjs "^1.11.10"
+    js-base64 "^3.7.7"
+    js-fast-way "^0.4.6"
+    js-md5 "^0.8.3"
+    sortablejs "^1.15.1"
+    split.js "^1.6.5"
+    vue "3.4.21"
 
 human-signals@^2.1.0:
   version "2.1.0"
@@ -2699,6 +2708,11 @@ sortablejs@1.14.0:
   resolved "http://39.108.216.210:9000/sortablejs/-/sortablejs-1.14.0.tgz#6d2e17ccbdb25f464734df621d4f35d4ab35b3d8"
   integrity sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==
 
+sortablejs@^1.15.1:
+  version "1.15.2"
+  resolved "http://39.108.216.210:9000/sortablejs/-/sortablejs-1.15.2.tgz#4e9f7bda4718bd1838add9f1866ec77169149809"
+  integrity sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA==
+
 "source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1, source-map-js@^1.0.2:
   version "1.0.2"
   resolved "http://39.108.216.210:9000/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"