ZaiZai 1 year ago
parent
commit
3d1e0461eb

+ 4 - 5
App.vue

@@ -11,20 +11,19 @@
                 userInfo: {}, refreshLock: false, isSocket: false
             }
         },
-		onLaunch: function() {
-			//console.log('App Launch')
+		onLaunch() {
+            this.setInitSocket()
 		},
-		onShow: function() {
+		onShow() {
 			//console.log('App Show')
 		},
-		onHide: function() {
+		onHide() {
 			//console.log('App Hide')
 		},
         mounted() {
             const store = useAppStore()
             this.userInfo = store.userInfo
             this.getRefreshToken()
-            this.setInitSocket()
         },
         methods:{
             //刷新token

+ 4 - 2
config/index.js

@@ -11,8 +11,10 @@ export default {
     tokenTime: 1700,
     //测试环境
     testApi: {
-        api: 'http://192.168.0.109:8090/',  //请求地址
-        form: 'http://192.168.0.109:5173/', //表单地址
+        //api: 'http://192.168.0.109:8090/',  //请求地址
+        //form: 'http://192.168.0.109:5173/', //表单地址
+        api: 'http://47.110.251.215:8090/', //请求地址
+        form: 'https://user.hcxxy.com/',    //表单地址
         wss: 'wss://business.hcxxy.com/wss/websocket/', //长连接地址
     },
     //正式环境

+ 16 - 0
httpApi/modules/user/index.js

@@ -72,4 +72,20 @@ export default {
             params: form,
         })
     },
+    //用户配置详情
+    async userConfigInfo(form) {
+        return httpApi({
+            url: '/api/blade-business/defaultConfig/detail',
+            method: 'get',
+            params: form,
+        })
+    },
+    //用户配置保存
+    async userConfigSave(form) {
+        return httpApi({
+            url: '/api/blade-business/defaultConfig/saveOrUpdate',
+            method: 'post',
+            data: form,
+        })
+    },
 }

+ 2 - 1
pages/data-fill/editTable.vue

@@ -24,6 +24,7 @@ import {getStorage} from "@/utils/storage";
 import {useAppStore} from "@/store";
 import wbsApi from '~api/data-fill/wbs';
 import {getFormApiUrl} from '@/config/envApi';
+import {date} from "@/uni_modules/uv-ui-tools/libs/function/test";
 
 const store = useAppStore()
 const instance = getCurrentInstance().proxy
@@ -59,7 +60,7 @@ onShow(() => {
 //表格地址
 const webSrc = ref('');
 const envUrl = getFormApiUrl()
-const htmlsrc = `${envUrl}/#/app/table-form?source=app&type=data-fill`
+const htmlsrc = `${envUrl}/#/app/table-form?date=${new Date().getTime()}&source=app&type=data-fill`
 
 //渲染完成
 onReady(() => {

+ 10 - 1
pages/index/index.vue

@@ -207,7 +207,8 @@
 <script setup>
 import {ref} from "vue";
 import {useAppStore} from "@/store";
-import {onShow, onHide} from '@dcloudio/uni-app'
+import {onLoad, onShow, onHide} from '@dcloudio/uni-app'
+import mainApi from '~api/user/index';
 
 //变量
 const store = useAppStore()
@@ -223,12 +224,20 @@ onShow(()=>{
     if(store.isAnimation) {
         isAnimation.value = true
     }
+    userConfigInfo()
 })
 
 onHide(() => {
     isAnimation.value = false
 })
 
+//获取配置
+const userConfigInfo = async () => {
+    //appCheck
+    const { data } = await mainApi.userConfigInfo()
+    console.log(data)
+}
+
 //资料填报
 const isPopovershow = ref(false);
 const isDataFill = () => {

+ 1 - 1
pages/ledger/editTable.vue

@@ -85,7 +85,7 @@ onShow(() => {
 //表格地址
 const webSrc = ref('');
 const envUrl = getFormApiUrl()
-const htmlsrc = `${envUrl}/#/app/table-form?source=app&type=log-fill`
+const htmlsrc = `${envUrl}/#/app/table-form?date=${new Date().getTime()}&source=app&type=log-fill`
 
 //渲染完成
 onReady(() => {

+ 5 - 1
pages/ledger/index.vue

@@ -199,6 +199,10 @@ const queryLogTimeTreeList = async () => {
 
 //查看
 const handleTableQuery = async (item) => {
+    if (item.pdfUrl) {
+        toPdfPreview(item.pdfUrl).then()
+        return false
+    }
     uni.showLoading({title: '获取pdf文件中...', mask: true});
     const {excelId, primaryKeyId} = tabItem.value
     const { error, code, data } = await mainApi.getBussPdfInfo({
@@ -211,7 +215,7 @@ const handleTableQuery = async (item) => {
     const resData = isString(data) ? data || '' : ''
     uni.hideLoading();
     if (!error && code === 200 && resData) {
-        toPdfPreview(resData)
+        toPdfPreview(resData).then()
     } else {
         errorToast('暂无PDF,无法预览')
     }