ZaiZai преди 1 година
родител
ревизия
6dd4b4a45b

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240815180145"
+  "value": "20240819154040"
 }

+ 1 - 1
src/config/index.js

@@ -22,7 +22,7 @@ export default {
     ossUrl: 'https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com', //oss地址
     socketLimit: 10, //连接失败后,最大重连次数
     socketInterval: 10000, //连接失败后,每次重连的间隔时间,单位毫秒。
-    localModel: false, //本地模式,开启后,将关闭https强转、截图等相关功能
+    localModel: true, //本地模式,开启后,将关闭https强转、截图等相关功能
     ...config,
     //这里不再支持配置请求地址,请在 src/config/index.json 文件中配置。
     //相关参数,可查阅 src/config/index.md 文件说明

+ 2 - 1
src/config/index.json

@@ -2,9 +2,10 @@
     "version": "20230607160059",
     "target1": "http://127.0.0.1:8090",
     "target3": "http://192.168.0.125:8090",
-    "target": "http://39.108.216.210:8090",
+    "target6": "http://39.108.216.210:8090",
     "target4": "http://192.168.0.109:8090",
     "target5": "http://192.168.0.102:8090",
+    "target": "http://183.247.216.148:28090",
     "socket": "wss://measure.hczcxx.cn/websocket",
     "smsPhone": "",
     "vite": {

+ 31 - 4
src/layout/index.vue

@@ -1,5 +1,10 @@
 <template>
-    <el-container class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']">
+    <el-container
+        v-loading="isLoading"
+        class="hc-layout-box"
+        :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']"
+        element-loading-text="获取数据中..."
+    >
         <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=""> -->
@@ -45,19 +50,28 @@
 </template>
 
 <script setup>
-import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
+import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { useRoute, useRouter } from 'vue-router'
 import { initButtons } from '~sto/app'
 import { getObjValue, isNullES, useClick } from 'js-fast-way'
 import { HcSocket } from '~src/plugins/HcSocket'
+import website from '~src/config'
 
 //初始组合式
 const router = useRouter()
 const useRoutes = useRoute()
 const store = useAppStore()
 
-const reloadRouter = ref(true)
+const reloadRouter = ref(!website.localModel)
+
+const isLoading = computed(() => {
+    if (website.localModel) {
+        return !reloadRouter.value
+    } else {
+        return false
+    }
+})
 
 //子组件
 import HcTopMenuBar from './modules/HcTopMenu.vue'
@@ -126,7 +140,14 @@ let socket
 const taskCount = ref(0)
 const cascaderSend = async ({ projectId, contractId }) => {
     await useClick()
-    if (isNullES(contractId)) return
+    if (isNullES(contractId)) {
+        //本地模式
+        if (website.localModel) {
+            window.$message?.error('项目信息不存在,请联系管理员')
+            reloadRouter.value = false
+        }
+        return
+    }
     //链接webSocket
     if (!isNullES(socket)) socket.close()
     socket = new HcSocket({ projectId, contractId, userId: userId.value }, ({ data }) => {
@@ -135,6 +156,12 @@ const cascaderSend = async ({ projectId, contractId }) => {
             taskCount.value = res.data ?? 0
         }
     })
+    //本地模式
+    if (website.localModel) {
+        setTimeout(() => {
+            reloadRouter.value = true
+        }, 500)
+    }
 }
 
 //用户信息

+ 1 - 2
src/views/project/debit/contract/check-list.vue

@@ -358,7 +358,6 @@ const uuid = getRandom(4)
 
 //渲染完成
 onMounted(() => {
-    ishowTree.value = !isNullES(projectId.value)
     setSplitRef()
 })
 
@@ -399,7 +398,7 @@ const treeProps = {
           return !data.hasChild
     },
 }
-const ishowTree = ref(false)
+const ishowTree = ref(true)
 
 //自动展开缓存
 const autoExpandKeys = ref(getStoreValue('autoExpandKeys') || [])

+ 1 - 15
src/views/project/debit/contract/unit.vue

@@ -219,19 +219,6 @@ const useAppState = useAppStore()
 const projectId = computed(() => useAppState.getProjectId || '')
 const contractId = computed(() => useAppState.getContractId || '')
 
-//监听
-watch(() => projectId.value, (pid) => {
-    if (isNullES(pid)) {
-        ishowTree.value = false
-        return
-    }
-    projectId.value = pid
-    ishowTree.value = false
-    setTimeout(() => {
-        ishowTree.value = true
-    }, 100)
-})
-
 defineOptions({
     name: 'ProjectDebitContractUnit',
 })
@@ -240,7 +227,6 @@ const uuid = getRandom(4)
 
 //渲染完成
 onMounted(() => {
-    ishowTree.value = !isNullES(projectId.value)
     setSplitRef()
     // getNodeType()
 })
@@ -283,7 +269,7 @@ const treeProps = {
     children: 'children',
     isLeaf: 'notExsitChild',
 }
-const ishowTree = ref(false)
+const ishowTree = ref(true)
 //重新设置树
 const setLoading = ref(false)
 const setTree = async () => {

+ 3 - 18
src/views/project/debit/project/unit.vue

@@ -82,8 +82,8 @@
 </template>
 
 <script setup>
-import { computed, nextTick, onMounted, ref, watch } from 'vue'
-import { arrToId, formValidate, getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
+import { computed, nextTick, onMounted, ref } from 'vue'
+import { arrToId, formValidate, getArrValue, getObjValue, getRandom } from 'js-fast-way'
 import unitApi from '~api/project/debit/project/unit'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import { getDictionaryBiz } from '~api/other'
@@ -93,19 +93,6 @@ import { HcDelMsg } from 'hc-vue3-ui'
 const useAppState = useAppStore()
 const projectId = computed(() => useAppState.getProjectId || '')
 
-//监听
-watch(() => projectId.value, (pid) => {
-    if (isNullES(pid)) {
-        ishowTree.value = false
-        return
-    }
-    projectId.value = pid
-    ishowTree.value = false
-    setTimeout(() => {
-        ishowTree.value = true
-    }, 100)
-})
-
 defineOptions({
     name: 'ProjectDebitProjectUnit',
 })
@@ -114,9 +101,7 @@ const uuid = getRandom(4)
 
 //渲染完成
 onMounted(() => {
-    ishowTree.value = !isNullES(projectId.value)
     setSplitRef()
-    // getNodeType()
 })
 //获节点类型
 const nodeOptions = ref([])
@@ -167,7 +152,7 @@ const treeLoadNode = async ({ item, level }, resolve) => {
     resolve(getArrValue(data))
 }
 
-const ishowTree = ref(false)
+const ishowTree = ref(true)
 //重新设置树
 const setLoading = ref(false)
 const setTree = async ()=>{