Эх сурвалжийг харах

Merge branch 'main' into feature/v1.0.53

lianbingjie 1 жил өмнө
parent
commit
76ef12f232

+ 1 - 0
apps/bigmember_pc/.env.development

@@ -3,3 +3,4 @@ VITE_APP_BASE_API='/dev-api'
 VITE_APP_BASE_URL='/swordfish/page_big_pc'
 VITE_APP_BASE_PUBLIC='/'
 VITE_APP_WORK_DESKTOP_URL='/page_workDesktop/work-bench/app'
+VITE_APP_GIT_BRANCH='v0.0.1'

+ 1 - 0
apps/bigmember_pc/.env.production

@@ -3,3 +3,4 @@ VITE_APP_BASE_API=''
 VITE_APP_BASE_URL='/page_big_pc'
 VITE_APP_BASE_PUBLIC='/page_big_pc/'
 VITE_APP_WORK_DESKTOP_URL='/page_workDesktop/work-bench/app/big'
+VITE_APP_GIT_BRANCH='v1.0.54.1'

+ 7 - 4
apps/bigmember_pc/package.json

@@ -4,19 +4,22 @@
   "private": true,
   "scripts": {
     "dev": "vite",
-    "build": "vite build",
+    "build": "pnpm run update && pnpm run build:vite",
+    "build:vite": "vite build",
+    "update": "node ./scripts/updateGitInfo.js",
     "preview": "vite preview --port 4173",
     "lint": "eslint . --ext .vue,.js,.jsx --fix",
     "format": "prettier --write \"./**/*.{,vue,ts,js,json,md}\""
   },
   "dependencies": {
-    "@jy/util": "workspace:^",
-    "@jy/data-models": "workspace:^",
-    "@jy/pc-ui": "workspace:^",
     "@jianyu/easy-fix-sub-app": "^0.0.2",
     "@jianyu/easy-inject-qiankun": "^0.1.11",
     "@jianyu/icon": "^0.1.7",
     "@jianyu/reset.css": "~0.1.1",
+    "@jy/data-models": "workspace:^",
+    "@jy/pc-ui": "workspace:^",
+    "@jy/util": "workspace:^",
+    "@sentry/vue": "^7.64.0",
     "dayjs": "^1.11.7",
     "echarts": "4.8.0",
     "element-ui": "^2.15.16-rc",

+ 52 - 0
apps/bigmember_pc/scripts/updateGitInfo.js

@@ -0,0 +1,52 @@
+const { exec } = require('child_process')
+const fs = require('fs')
+
+const getGitBranch = () => {
+  return new Promise((resolve, reject) => {
+    exec(
+      'git symbolic-ref --quiet --short HEAD || git describe --all --exact-match HEAD',
+      (error, stdout, stderr) => {
+        if (error) {
+          reject(error)
+        } else {
+          const branch = stdout.trim()
+          resolve(branch)
+        }
+      }
+    )
+  })
+}
+
+const extractVersion = (branch) => {
+  const versionRegex = /(v.*?)$/
+  const matches = branch.match(versionRegex)
+  return matches ? matches[0] : ''
+}
+
+const updateEnvFile = (branch) => {
+  try {
+    const envFilePath = '.env.production'
+    const existingContent = fs.readFileSync(envFilePath, 'utf8')
+    const updatedBranch = extractVersion(branch)
+    const updatedContent = existingContent.replace(
+      /(VITE_APP_GIT_BRANCH=).*/,
+      `$1'${updatedBranch}'`
+    )
+    fs.writeFileSync(envFilePath, updatedContent)
+    console.log(
+      'Git 分支信息已更新到 .env.production 文件',
+      branch,
+      updatedBranch
+    )
+  } catch (error) {
+    console.error('更新 .env.production 文件失败:', error)
+  }
+}
+
+getGitBranch()
+  .then((branch) => {
+    updateEnvFile(branch)
+  })
+  .catch((error) => {
+    console.error('获取 Git 分支失败:', error)
+  })

+ 4 - 0
apps/bigmember_pc/src/main.js

@@ -21,6 +21,7 @@ import '@/utils/directive'
 import '@/utils/prototype'
 import MetaInfo from 'vue-meta-info'
 import JyIcon from '@jianyu/icon' // 需要单独引入icon/index.css
+import { initSentry } from './sentry'
 
 Vue.use(VueCookies)
 Vue.use(Loading.directive)
@@ -56,6 +57,9 @@ const app = easySubAppRegister(
   {
     bootstrap() {
       fixGetComputedStyle()
+
+      // Sentry 异常监控
+      initSentry()
     }
   }
 )

+ 15 - 0
apps/bigmember_pc/src/sentry.js

@@ -0,0 +1,15 @@
+import * as Sentry from '@sentry/vue'
+
+export function initSentry() {
+  if (!import.meta.env.DEV) {
+    Sentry.init({
+      dsn: 'https://1009883edc154953bec82b5e9ec88bce@jysentry.jydev.jianyu360.cn/7',
+      release: import.meta.env.VITE_APP_GIT_BRANCH,
+      environment: 'produce',
+      sampleRate: 0.1
+    })
+    Sentry.setTag('url', location.href)
+    const id = document.cookie.match(/(^|;)\s*ud_safe\s*=\s*([^;]+)/)
+    Sentry.setUser({ id: id && id[2] })
+  }
+}

+ 22 - 3
apps/bigmember_pc/src/views/portrayal/UnitPortrayal.vue

@@ -4,7 +4,7 @@
     :needAd="layoutNeedAd"
     :contentWithState="layoutContentWithState"
   >
-    <div class="unit-portrayal-content" v-loading="loading">
+    <div class="unit-portrayal-content" v-loading="pageLoading">
       <div class="unit-type">
         <div class="u-top-container">
           <h1 class="u-name">{{ info.buyerName }}</h1>
@@ -744,7 +744,8 @@ export default {
         visited: false,
         balance: 0 // 剩余次数
       }, // 画像访问量
-      freeTrial: false,
+      freeTrial: true,
+      freeTrialLoaded: false,
       showFreeOpen: false,
       sendData: {
         type: 'UnitPortrayal',
@@ -831,6 +832,19 @@ export default {
     isFreeOrNoLogin() {
       return this.userInfo.isFree || !this.loginFlag
     },
+    pageLoading () {
+      return this.loading || !this.getTrailLoaded
+    },
+    getTrailLoaded () {
+      const info = this.userInfo
+      // 免费用户 体验过期 浏览过
+      const freeTail = info.isFree && info.freeBuyerPort < 0
+      if (freeTail) {
+        return this.freeTrialLoaded
+      } else {
+        return true
+      }
+    },
     conf7() {
       const power = this.userInfo.power
       if (power) {
@@ -1336,7 +1350,12 @@ export default {
     },
     // 获取免费用户是否体验过该采购单位
     getIsTrail(data) {
-      this.freeTrial = data ? data : false
+      if (typeof data === 'boolean') {
+        this.freeTrial = data
+      } else {
+        this.freeTrial = false
+      }
+      this.freeTrialLoaded = true
     },
     // 等待画像接口请求完成再调用usage接口
     getUse(data) {

+ 1 - 3
apps/bigmember_pc/src/views/portrayal/components/UnitChart.vue

@@ -1010,9 +1010,7 @@ export default {
       if (res.error_code === 0) {
         if (res.data && Object.keys(res.data).length > 0) {
           this.showChart = true
-          if (res.data.onTrial) {
-            this.$emit('isTrial', res.data.onTrial)
-          }
+          this.$emit('isTrial', res.data?.onTrial || false)
           this.initData('', res.data)
         } else {
           this.getSectionChartData('a', newval)

+ 3 - 3
apps/bigmember_pc/src/views/search/bidding/components/search-bid-filter.vue

@@ -65,19 +65,19 @@ async function getCustomInfo () {
   const { error_code:code, data = [] } = await getCMCustomInfo()
   if(code === 0) {
     if (data) {
-      const expandSearchParams = {}
+      // const expandSearchParams = {}
       data.forEach(item => {
         if(item.key && item.defaultVal) {
           const par = {
             key: item.key,
             value: item.defaultVal
           }
-          expandSearchParams[item.key] = item.defaultVal
+          // expandSearchParams[item.key] = item.defaultVal
           updateFilterBase(par)
         }
       })
       doUpdateData(data, 'more')
-      doQuery(expandSearchParams, 'firstPage')
+      doQuery({}, 'firstPage')
     }
   }
 }

+ 13 - 9
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -663,14 +663,6 @@ export default function () {
     if(activeItemStyleType.value === 'T') {
       restoreListTabActive()
     }
-    // 存储筛选条件
-    if(isInApp.value && isLogin.value && listState.pageNum === 1 && !inBIPropertyIframe) {
-      saveSearchGroupToLocal()
-
-      if(inputKeywordsState.value.input) {
-        saveFilterToLocal()
-      }
-    }
 
     //P271需求--潜客圈进引流需求
     if(!advancedInfo.show && !getShowChart.value && inputKeywordsState.value.input) {
@@ -696,6 +688,14 @@ export default function () {
   }
   // 处理查询请求后的数据以及其他业务
   function afterQueryAjax (res, searchType) {
+    // 存储筛选条件
+    if(isInApp.value && isLogin.value && listState.pageNum === 1 && !inBIPropertyIframe) {
+      saveSearchGroupToLocal()
+
+      if(inputKeywordsState.value.input) {
+        saveFilterToLocal()
+      }
+    }
     // 变更搜索模式
     changeSearchMode(searchType)
 
@@ -912,6 +912,8 @@ export default function () {
       Object.assign(resultFilter, expandFilter)
     }
     doChangeTab({ key: resultFilter.searchGroup })
+
+    const _expand = resultFilter._expand || {}
     filterState.value = {
       bidField: isBidField ? 'medical' : '',
       publishTime: resultFilter.publishTime,
@@ -927,7 +929,9 @@ export default function () {
       notkey: resultFilter.notkey,
       buyer: resultFilter.buyer,
       winner: resultFilter.winner,
-      agency: resultFilter.agency
+      agency: resultFilter.agency,
+      ..._expand,
+      _expand: _expand
     }
     inputKeywordsState.value = {
       input: resultFilter.input,

+ 4 - 0
apps/bigmember_pc/src/views/search/bidding/model/modules/data-export-actions.js

@@ -33,6 +33,8 @@ export function dataExportActionsModel () {
     if (!listState.total) return
 
     filterFormatParams.value = FilterHistoryViewModel2AjaxModel.formatAll(filter)
+    const _expand = filter._expand || {}
+    Object.assign(filterFormatParams.value, _expand)
     exportLoading.value = true
     // 查询是否需要弹窗
     const { error_code: code, isPrompt } = await ajaxGetDontPromptAgain()
@@ -98,6 +100,8 @@ export function dataExportActionsModel () {
   function toPayDataExport (config) {
    const { listState, selectCheckboxCount, selectIds, filter } = config
    filterFormatParams.value = FilterHistoryViewModel2AjaxModel.formatAll(filter)
+    const _expand = filter._expand || {}
+    filterFormatParams.value = Object.assign(filterFormatParams.value, _expand)
     // 未登录跳转登录
     if (!isLogin.value) {
       $bus.$emit('bidding:goLogin')

+ 12 - 6
apps/bigmember_pc/src/views/search/bidding/model/modules/filter.js

@@ -100,6 +100,7 @@ export function useSearchFilterModel(conf) {
     if(typeof (_expand) === 'object' && Object.keys(_expand).length > 0) {
       for(let key in _expand) {
         expandTag[key] = filterState.value[key]
+        _expand[key] = filterState.value[key]
       }
     }
 
@@ -181,12 +182,17 @@ export function useSearchFilterModel(conf) {
     const {key, value } = keyObj
 
     if(keyObj && Object.keys(keyObj).length > 0) {
-      filterBase.value = Object.assign(filterBase.value, {
-        [key]: value
-      })
-      filterBase.value._expand = Object.assign({}, {
-        [key]: value
-      })
+      const _expand = filterBase.value._expand || {}
+      if(!filterBase.value[key]) {
+        filterBase.value = Object.assign(filterBase.value, {
+          [key]: value
+        })
+      }
+      if(Object.keys(_expand).length === 0 || !_expand[key]) {
+        filterBase.value._expand = Object.assign(_expand, {
+          [key]: value
+        })
+      }
       if(!inBIPropertyIframe) {
         filterState.value = Object.assign(filterBase.value, filterState.value)
       }

+ 25 - 37
pnpm-lock.yaml

@@ -72,6 +72,9 @@ importers:
       '@jy/util':
         specifier: workspace:^
         version: link:../../packages/util
+      '@sentry/vue':
+        specifier: ^7.64.0
+        version: 7.64.0(vue@2.7.16)
       dayjs:
         specifier: ^1.11.7
         version: 1.11.8
@@ -4925,6 +4928,7 @@ packages:
     resolution: {integrity: sha512-p9rGKYkHdFMzhckOTFubfxgyIO1vw//7IIjBBRVzyZebWlzRLeNhqxuSaZ7kCEKVkm/kuC9fVRW9HkC/zNRG2w==}
     cpu: [arm64]
     os: [linux]
+    libc: [glibc]
     requiresBuild: true
     dev: true
     optional: true
@@ -4942,6 +4946,7 @@ packages:
     resolution: {integrity: sha512-nDY6Yz5xS/Y4M2i9JLQd3Rofh5OR8Bn8qe3Mv/qCVpHFlwtZSBYSPaU4mrGazWkXrdQ98GB//H0BirGR/SKFSw==}
     cpu: [arm64]
     os: [linux]
+    libc: [musl]
     requiresBuild: true
     dev: true
     optional: true
@@ -4959,6 +4964,7 @@ packages:
     resolution: {integrity: sha512-im7HE4VBL+aDswvcmfx88Mp1soqL9OBsdDBU8NqDEYtkri0qV0THhQsvZtZeNNlLeCUQ16PZyv7cqutjDF35qw==}
     cpu: [ppc64le]
     os: [linux]
+    libc: [glibc]
     requiresBuild: true
     dev: true
     optional: true
@@ -4967,6 +4973,7 @@ packages:
     resolution: {integrity: sha512-RWdiHuAxWmzPJgaHJdpvUUlDz8sdQz4P2uv367T2JocdDa98iRw2UjIJ4QxSyt077mXZT2X6pKfT2iYtVEvOFw==}
     cpu: [riscv64]
     os: [linux]
+    libc: [glibc]
     requiresBuild: true
     dev: true
     optional: true
@@ -4975,6 +4982,7 @@ packages:
     resolution: {integrity: sha512-VMgaGQ5zRX6ZqV/fas65/sUGc9cPmsntq2FiGmayW9KMNfWVG/j0BAqImvU4KTeOOgYSf1F+k6at1UfNONuNjA==}
     cpu: [s390x]
     os: [linux]
+    libc: [glibc]
     requiresBuild: true
     dev: true
     optional: true
@@ -4983,6 +4991,7 @@ packages:
     resolution: {integrity: sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==}
     cpu: [x64]
     os: [linux]
+    libc: [glibc]
     requiresBuild: true
     dev: true
     optional: true
@@ -5000,6 +5009,7 @@ packages:
     resolution: {integrity: sha512-JNEG/Ti55413SsreTguSx0LOVKX902OfXIKVg+TCXO6Gjans/k9O6ww9q3oLGjNDaTLxM+IHFMeXy/0RXL5R/g==}
     cpu: [x64]
     os: [linux]
+    libc: [musl]
     requiresBuild: true
     dev: true
     optional: true
@@ -5804,7 +5814,7 @@ packages:
       regenerator-runtime: 0.13.11
       systemjs: 6.14.3
       terser: 5.19.2
-      vite: 4.3.9(sass@1.71.1)(terser@5.19.2)
+      vite: 4.3.9(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
     transitivePeerDependencies:
       - supports-color
     dev: true
@@ -5847,7 +5857,7 @@ packages:
       vite: ^3.0.0 || ^4.0.0
       vue: ^2.7.0-0
     dependencies:
-      vite: 4.3.9(sass@1.71.1)(terser@5.19.2)
+      vite: 4.3.9(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
       vue: 2.7.16
     dev: true
 
@@ -6239,7 +6249,7 @@ packages:
       '@vue/cli-service': ^3.0.0 || ^4.0.0 || ^5.0.0-0
       eslint: '>=7.5.0'
     dependencies:
-      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(sass-loader@12.6.0)(vue-template-compiler@2.7.14)(vue@2.7.14)
+      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.16)
       '@vue/cli-shared-utils': 5.0.8
       eslint: 7.32.0
       eslint-webpack-plugin: 3.2.0(eslint@7.32.0)(webpack@5.88.2)
@@ -6259,7 +6269,7 @@ packages:
     peerDependencies:
       '@vue/cli-service': ^3.0.0 || ^4.0.0 || ^5.0.0-0
     dependencies:
-      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.14)
+      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.16)
       '@vue/cli-shared-utils': 5.0.8
     transitivePeerDependencies:
       - encoding
@@ -6270,7 +6280,7 @@ packages:
     peerDependencies:
       '@vue/cli-service': ^3.0.0 || ^4.0.0 || ^5.0.0-0
     dependencies:
-      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(sass-loader@12.6.0)(vue-template-compiler@2.7.14)(vue@2.7.14)
+      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.16)
       '@vue/cli-shared-utils': 5.0.8
     transitivePeerDependencies:
       - encoding
@@ -6281,7 +6291,7 @@ packages:
     peerDependencies:
       '@vue/cli-service': ^3.0.0 || ^4.0.0 || ^5.0.0-0
     dependencies:
-      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.14)
+      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.16)
     dev: true
 
   /@vue/cli-plugin-vuex@5.0.8(@vue/cli-service@5.0.1):
@@ -6289,7 +6299,7 @@ packages:
     peerDependencies:
       '@vue/cli-service': ^3.0.0 || ^4.0.0 || ^5.0.0-0
     dependencies:
-      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(sass-loader@12.6.0)(vue-template-compiler@2.7.14)(vue@2.7.14)
+      '@vue/cli-service': 5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.16)
     dev: true
 
   /@vue/cli-service@5.0.1(@babel/core@7.22.9)(lodash@4.17.21)(sass-loader@12.0.0)(vue-template-compiler@2.6.14)(vue@2.7.14):
@@ -7760,8 +7770,8 @@ packages:
     peerDependencies:
       postcss: ^8.1.0
     dependencies:
-      browserslist: 4.23.0
-      caniuse-lite: 1.0.30001591
+      browserslist: 4.21.9
+      caniuse-lite: 1.0.30001517
       fraction.js: 4.2.0
       normalize-range: 0.1.2
       picocolors: 1.0.0
@@ -15688,7 +15698,7 @@ packages:
       vfile-message: 4.0.2
     dev: true
 
-  /vite-node@0.34.6(@types/node@20.4.5):
+  /vite-node@0.34.6(@types/node@20.4.5)(sass@1.63.2):
     resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==}
     engines: {node: '>=v14.18.0'}
     hasBin: true
@@ -15698,28 +15708,6 @@ packages:
       mlly: 1.4.2
       pathe: 1.1.1
       picocolors: 1.0.0
-      vite: 4.5.1(@types/node@20.4.5)(sass@1.71.1)(terser@5.19.2)
-    transitivePeerDependencies:
-      - '@types/node'
-      - less
-      - lightningcss
-      - sass
-      - stylus
-      - sugarss
-      - supports-color
-      - terser
-    dev: true
-
-  /vite-node@0.34.6(@types/node@20.4.5)(sass@1.63.2):
-    resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==}
-    engines: {node: '>=v14.18.0'}
-    hasBin: true
-    dependencies:
-      cac: 6.7.14
-      debug: 4.3.4
-      mlly: 1.6.1
-      pathe: 1.1.2
-      picocolors: 1.0.0
       vite: 4.5.1(@types/node@20.4.5)(sass@1.63.2)
     transitivePeerDependencies:
       - '@types/node'
@@ -15739,8 +15727,8 @@ packages:
     dependencies:
       cac: 6.7.14
       debug: 4.3.4
-      mlly: 1.6.1
-      pathe: 1.1.2
+      mlly: 1.4.2
+      pathe: 1.1.1
       picocolors: 1.0.0
       vite: 4.5.1(@types/node@20.4.5)(sass@1.71.1)(terser@5.19.2)
     transitivePeerDependencies:
@@ -15791,7 +15779,7 @@ packages:
       '@types/eslint': 8.44.1
       eslint: 8.37.0
       rollup: 2.79.1
-      vite: 4.3.9(sass@1.71.1)(terser@5.19.2)
+      vite: 4.3.9(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
     dev: true
 
   /vite-plugin-externals@0.6.2(vite@4.3.9):
@@ -15804,7 +15792,7 @@ packages:
       es-module-lexer: 0.4.1
       fs-extra: 10.1.0
       magic-string: 0.25.9
-      vite: 4.3.9(sass@1.71.1)(terser@5.19.2)
+      vite: 4.3.9(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
     dev: true
 
   /vite-plugin-html-redirect@1.0.4:
@@ -16181,7 +16169,7 @@ packages:
       tinybench: 2.5.1
       tinypool: 0.7.0
       vite: 4.5.1(@types/node@20.4.5)(sass@1.71.1)(terser@5.19.2)
-      vite-node: 0.34.6(@types/node@20.4.5)
+      vite-node: 0.34.6(@types/node@20.4.5)(sass@1.71.1)(terser@5.19.2)
       why-is-node-running: 2.2.2
     transitivePeerDependencies:
       - less