ljc 1 miesiąc temu
rodzic
commit
8f9b1adc3b

+ 3 - 3
components/cwg-complex-search.vue

@@ -159,7 +159,7 @@ const dateLimit = computed(() => {
         return `${y}-${m}-${d2}`
     }
 
-    return {
+    return props.noData ? {start:'',end: ''}: {
         start: format(startDate),
         end: format(endDate)
     }
@@ -183,9 +183,9 @@ const getDefaultDateValue = (field) => {
     }
 
     if (field.type === 'daterange') {
-        return [formatDate(firstDay), formatDate(today)]
+        return props.noData?['','']: [formatDate(firstDay), formatDate(today)]
     } else if (field.type === 'date') {
-        return formatDate(today)
+        return props.noData?'': formatDate(today)
     }
     return ''
 }

+ 1 - 1
components/cwg-notice.vue

@@ -106,7 +106,7 @@ onMounted(() => {
   })
 })
 onUnmounted(() => {
-  uni.off('updateUnreadCount')
+  uni.$off('updateUnreadCount')
 })
 </script>
 

+ 1 - 0
components/cwg-popup.vue

@@ -241,6 +241,7 @@ defineExpose({
 
 .dialog-content {
     padding: px2rpx(20) px2rpx(30);
+    min-height: px2rpx(150);
     max-height: 60vh;
     overflow-y: auto;
 

+ 1 - 0
components/cwg-right-drawer.vue

@@ -132,6 +132,7 @@ async function handleLogout() {
         await userApi.logout()
     } catch (e) { }
     userStore.clearUserInfo()
+    uni.$emit('updateSystemList')
     router.push('/pages/login/index')
     close()
 }

+ 2 - 1
components/cwg-system.vue

@@ -87,7 +87,7 @@ const applySystemList = (data: any[]) => {
 
 async function getSystemList(type = false) {
   const cached = getCache()
-  console.log(1)
+  console.log(1,type)
   if (!type){
     if (cached && cached.timestamp && Date.now() - cached.timestamp < CACHE_DURATION) {
       applySystemList(cached.data || [])
@@ -99,6 +99,7 @@ async function getSystemList(type = false) {
   try {
     const res: any = await customApi.getSystemList({})
     if (res && res.code === Code.StatusOK) {
+      console.log(res.data,'sys')
       const data = res.data || []
       applySystemList(data)
       setCache(data)

+ 2 - 1
pages/login/index.vue

@@ -94,6 +94,7 @@ async function getCustomLoginInfo() {
   try {
     const res = await userApi.getUserInfo()
     userStore.saveUserInfo(res.data)
+    uni.$emit('updateSystemList')
     if (res.code === 200) {
       switch (modeStore.value) {
         case 'customer':
@@ -161,7 +162,7 @@ function pickFields(source, fields = ['content', 'enContent']) {
 }
 
 onMounted(() => {
-
+  uni.$emit('updateSystemList')
   const accountInfo = userStore.accountInfo
   if (accountInfo?.rememberPassword) {
     form.value.loginName = accountInfo?.loginName || ''

+ 2 - 0
pages/login/regist.vue

@@ -560,6 +560,7 @@ const getLoginInfo = async () => {
     let res = await userApi.getUserInfo()
     if (res.code == 200) { // Code.StatusOK
       userStore.saveUserInfo(res.data)
+      uni.$emit('updateSystemList')
       showToast(t('Msg.LoginSuccess'))
       setTimeout(() => {
         uni.reLaunch({
@@ -577,6 +578,7 @@ const getLoginInfo = async () => {
 
 
 onMounted(() => {
+  uni.$emit('updateSystemList')
   getCountry()
   getCountryMsg()