li.shaoyi 2 лет назад
Родитель
Сommit
44be49da99

+ 8 - 4
app/main.js

@@ -78,15 +78,19 @@ const createWindow = () => {
     Menu.setApplicationMenu(null)
 
     const win = new BrowserWindow({
+        show: false,
         center: true,
-        minWidth: 1280,
-        minHeight: 800,
+        minWidth: 1024,
+        minHeight: 768,
         icon: path.resolve(__dirname, 'dist/favicon.ico')
     })
 
-    win.maximize()
     win.loadFile(path.resolve(__dirname, 'dist/index.html'))
-    win.on('ready-to-show', () => updateHandle(win))
+    win.maximize()
+    win.once('ready-to-show', () => {
+        win.show()
+        updateHandle(win)
+    })
 }
 
 // 阻止应用多开

+ 1 - 1
app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "trading",
-  "version": "1.0.19",
+  "version": "1.0.13",
   "main": "main.js",
   "dependencies": {
     "electron-updater": "^6.1.4",

+ 3 - 3
oem/gstj/config/appconfig.json

@@ -1,9 +1,9 @@
 {
   "appName": "甘肃碳交",
-  "version": "1.0.12",
-  "versionCode": "100012",
+  "version": "1.0.13",
+  "versionCode": "100013",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
-  "tradeChannel": "http",
+  "tradeChannel": "ws",
   "modules": [
     "register",
     "delivery"

+ 3 - 3
oem/qdhs/config/appconfig.json

@@ -1,9 +1,9 @@
 {
   "appName": "青岛海商",
-  "version": "1.0.6",
-  "versionCode": "100006",
+  "version": "1.0.8",
+  "versionCode": "100008",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
-  "tradeChannel": "http",
+  "tradeChannel": "ws",
   "modules": [
     "delivery"
   ]

+ 3 - 3
public/config/appconfig.json

@@ -1,9 +1,9 @@
 {
   "appName": "多元世纪",
-  "version": "1.0.3",
-  "versionCode": "10003",
+  "version": "1.0.5",
+  "versionCode": "10005",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
-  "tradeChannel": "http",
+  "tradeChannel": "ws",
   "modules": [
     "register",
     "delivery"

+ 14 - 0
src/packages/pc/assets/themes/default/default.less

@@ -462,4 +462,18 @@
             padding: 0;
         }
     }
+}
+
+.g-fieldset{
+    border: 1px solid #162534;
+    padding: 20px;
+
+    &:not(:first-child) {
+        margin-top: 20px;
+    }
+
+    &__legend {
+        font-weight: bold;
+        margin-left: 10px;
+    }
 }

+ 6 - 0
src/packages/pc/components/base/drawer/index.less

@@ -71,4 +71,10 @@
         padding: 20px;
         padding-top: 0;
     }
+
+    .app-table .el-table {
+        --el-table-header-text-color: #88a0ae; // 表头文字颜色
+        --el-table-header-bg-color: transparent; // 表头背景颜色
+        --el-table-border-color: #213141; // 表格边框颜色
+    }
 }

+ 0 - 11
src/packages/pc/components/base/table-details/index.less

@@ -1,15 +1,4 @@
 .app-table-details {
-    border: 1px solid #162534;
-    padding: 20px;
-
-    &:not(:first-child) {
-        margin-top: 20px;
-    }
-
-    &__title {
-        margin-left: 10px;
-    }
-
     >table {
         table-layout: fixed;
         border-collapse: collapse;

+ 5 - 4
src/packages/pc/components/base/table-details/index.vue

@@ -1,6 +1,6 @@
 <template>
-    <fieldset class="app-table-details" :style="fieldsetStyle">
-        <legend class="app-table-details__title" v-if="title">
+    <fieldset class="g-fieldset app-table-details" :style="fieldsetStyle">
+        <legend class="g-fieldset__legend" v-if="title">
             <slot name="title">
                 {{ title }}
             </slot>
@@ -14,7 +14,8 @@
                                 {{ item.label }}
                             </slot>
                         </th>
-                        <td :colspan="(items.length - 1) === n ? (column * 2 - items.length * 2) + 1 : 1" :style="valueStyle">
+                        <td :colspan="(items.length - 1) === n ? (column * 2 - items.length * 2) + 1 : 1"
+                            :style="valueStyle">
                             <slot :name="item.prop" :value="data[item.prop]">
                                 {{ handleValue(item) }}
                             </slot>
@@ -74,7 +75,7 @@ const props = defineProps({
     // 边框颜色
     borderColor: {
         type: String,
-        default: '#ebeef5'
+        default: '#213141'
     },
 })
 

+ 68 - 85
src/packages/pc/components/layouts/header/components/report/index.vue

@@ -7,15 +7,16 @@
                     <el-option v-for="option in selectList" :key="option.value" :value="option.value"
                         :label="option.label" />
                 </el-select>
-                <el-date-picker :type="reporttype === 1 ? 'date' : 'month'" placeholder="查询日期"
-                    :value-format="reporttype === 1 ? 'YYYYMMDD' : 'YYYYMM'" v-model="cycletime" />
-                <el-button type="primary" @click="reloadData">查询</el-button>
+                <el-date-picker :type="pickerType" placeholder="查询日期" :value-format="pickerFormat" :clearable="false"
+                    v-model="cycletime" />
+                <el-button type="primary" :loading="loading" @click="reloadData">查询</el-button>
             </div>
         </div>
-        <app-table-details title="账户信息" :data="ta" :label-width="180" :cell-props="accountDetailProps" :column="2">
+        <app-table-details title="账户信息" :data="currentAccount" :label-width="180" :cell-props="accountDetailProps"
+            :column="2">
             <!-- 名称 -->
             <template #accountname>
-                {{ userinfo?.customername }}
+                {{ userInfo?.customername }}
             </template>
             <!-- 币种 -->
             <template #currencyid>
@@ -26,25 +27,20 @@
                 {{ formatDate(value) }}
             </template>
         </app-table-details>
-        <app-table-details v-if="reporttype === 1 && dtaaccounts.length != 0" title="资金信息" :data="dtaaccounts[0]"
-            :label-width="180" :cell-props="taDetailProps" :column="2"></app-table-details>
-        <app-table-details v-if="reporttype === 2 && mtaaccounts.length != 0" title="资金信息" :data="mtaaccounts[0]"
-            :label-width="180" :cell-props="taDetailProps" :column="2"></app-table-details>
-        <app-table :data="logs" v-model:columns="logsTableColumns">
-            <template #headerLeft>
-                <span>出入金明细</span>
-            </template>
-        </app-table>
-        <app-table :data="dpostions" v-model:columns="dpostionsTableColumns" >
-            <template #headerLeft>
-                <span>持仓汇总</span>
-            </template>
-        </app-table>
-        <app-table :data="tradedetails" v-model:columns="tradeDetailsTableColumns" >
-            <template #headerLeft>
-                <span>成交明细</span>
-            </template>
-        </app-table>
+        <app-table-details title="资金信息" :data="taaccount" :label-width="180" :cell-props="taDetailProps" :column="2"
+            v-if="taaccount" />
+        <fieldset class="g-fieldset">
+            <legend class="g-fieldset__legend">出入金明细</legend>
+            <app-table :data="logs" v-model:columns="logsTableColumns" />
+        </fieldset>
+        <fieldset class="g-fieldset">
+            <legend class="g-fieldset__legend">持仓汇总</legend>
+            <app-table :data="dpostions" v-model:columns="dpostionsTableColumns" />
+        </fieldset>
+        <fieldset class="g-fieldset">
+            <legend class="g-fieldset__legend">成交明细</legend>
+            <app-table :data="tradedetails" v-model:columns="tradeDetailsTableColumns" />
+        </fieldset>
         <template #footer>
             <el-button type="info" @click="onDisAgree">不同意</el-button>
             <el-button type="primary" @click="onAgree">同意</el-button>
@@ -53,7 +49,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, shallowRef } from 'vue'
+import { ref, shallowRef, computed } from 'vue'
 import { useRouter } from 'vue-router'
 import eventBus from '@/services/bus'
 import { useAccountStore, useUserStore } from '@/stores'
@@ -68,18 +64,21 @@ import AppTableDetails from '@pc/components/base/table-details/index.vue'
 const show = ref(true)
 const refresh = ref(false)
 const router = useRouter()
+const loading = ref(false)
 /// 报表类型 日报表-1 月报表-2
 const reporttype = ref(1)
 /// 查询时间
 const cycletime = shallowRef(formatDate(new Date().toISOString(), 'YYYYMMDD'))
 
-const ta = useAccountStore().currentAccount
-const userinfo = useUserStore().userInfo
+const pickerType = computed(() => reporttype.value === 1 ? 'date' : 'month')
+const pickerFormat = computed(() => reporttype.value === 1 ? 'YYYYMMDD' : 'YYYYMM')
 
+const currentAccount = useAccountStore().currentAccount
+const userInfo = useUserStore().userInfo
+
+const taaccount = shallowRef<Model.ReportMonthTaaccountRsp | Model.ReportReckonDayTaaccountRsp>()
 const logs = shallowRef<Model.ReportBankAccountOutInLogRsp[]>([])
-const mtaaccounts = shallowRef<Model.ReportMonthTaaccountRsp[]>([])
 const dpostions = shallowRef<Model.ReportReckonDayPositionRsp[]>([])
-const dtaaccounts = shallowRef<Model.ReportReckonDayTaaccountRsp[]>([])
 const tradedetails = shallowRef<Model.ReportTradeDetailRsp[]>([])
 
 const onAgree = () => {
@@ -98,74 +97,58 @@ const onDisAgree = () => {
 }
 
 const reloadData = () => {
-    /// 报表 - 交易商结算单 - 出入金明细
-    queryReportBankAccountOutInLog({
-        data: {
-            tradedate: cycletime.value,
-            reporttype: reporttype.value,
-        }
-    }).then(res => {
-        /// 查询成功
-        if (res.data.length) {
-            logs.value = res.data
-        }
-    })
-
-    if (reporttype.value === 2) {
-        /// 表 - 交易商结算单 - 资金信息(月)
-        queryReportMonthTaaccount({
+    loading.value = true
+    Promise.all([
+        /// 报表 - 交易商结算单 - 出入金明细
+        queryReportBankAccountOutInLog({
             data: {
-                cycletime: cycletime.value,
+                tradedate: cycletime.value,
+                reporttype: reporttype.value,
             }
-        }).then(res => {
-            /// 查询成功
-            if (res.data.length) {
-                mtaaccounts.value = res.data
+        }),
+        (() => {
+            if (reporttype.value === 2) {
+                /// 表 - 交易商结算单 - 资金信息(月)
+                return queryReportMonthTaaccount({
+                    data: {
+                        cycletime: cycletime.value,
+                    }
+                })
+            } else {
+                /// 报表 - 交易商结算单 - 资金信息(日)
+                return queryReportReckonDayTaaccount({
+                    data: {
+                        reckondate: cycletime.value,
+                    }
+                })
             }
-        })
-    } else {
-        /// 报表 - 交易商结算单 - 资金信息(日)
-        queryReportReckonDayTaaccount({
+        })(),
+        /// 报表 - 交易商结算单 - 持仓汇总
+        queryReportReckonDayPosition({
             data: {
                 reckondate: cycletime.value,
+                reporttype: reporttype.value
             }
-        }).then(res => {
-            /// 查询成功
-            if (res.data.length) {
-                dtaaccounts.value = res.data
+        }),
+        /// 报表 - 交易商结算单 - 成交明细
+        queryReportTradeDetail({
+            data: {
+                histradedate: cycletime.value,
+                reporttype: reporttype.value
             }
         })
-    }
-
-    /// 报表 - 交易商结算单 - 持仓汇总
-    queryReportReckonDayPosition({
-        data: {
-            reckondate: cycletime.value,
-            reporttype: reporttype.value
-        }
-    }).then(res => {
-        /// 查询成功
-        if (res.data.length) {
-            dpostions.value = res.data
-        }
-    })
-
-    /// 报表 - 交易商结算单 - 成交明细
-    queryReportTradeDetail({
-        data: {
-            histradedate: cycletime.value,
-            reporttype: reporttype.value
-        }
-    }).then(res => {
-        /// 查询成功
-        if (res.data.length) {
-            tradedetails.value = res.data
-        }
+    ]).then(([res1, res2, res3, res4]) => {
+        logs.value = res1.data
+        taaccount.value = res2.data[0]
+        dpostions.value = res3.data
+        tradedetails.value = res4.data
+    }).finally(() => {
+        loading.value = false
     })
 }
 
 const onChange = () => {
-    cycletime.value = formatDate(cycletime.value, reporttype.value === 1 ? 'YYYYMMDD' : 'YYYYMM')
+    cycletime.value = formatDate(new Date().toISOString(), pickerFormat.value)
 }
 
 /// 账户信息

+ 2 - 2
src/packages/pc/components/layouts/header/index.vue

@@ -10,7 +10,7 @@
                 <el-badge type="danger" :is-dot="noticeStore.unreadList.length > 0">
                     <app-icon icon="g-icon--notice" @click="openComponent('notice')" />
                 </el-badge>
-                <!-- <app-icon icon="Tickets" @click="openComponent('report')" /> -->
+                <app-icon icon="Tickets" @click="openComponent('report')" />
                 <app-icon icon="Setting" @click="openComponent('setting')" />
                 <span class="g-icon--minimize" @click="exitFullSreen" v-if="fullScreen"></span>
                 <span class="g-icon--maximize" @click="setFullSreen" v-else></span>
@@ -80,7 +80,7 @@ const exitFullSreen = () => {
 onMounted(() => {
     /// 如果未同意 或者跨天
     if (!localData.getValue('isReportAgree') || diffDays(localData.getValue('reportTime')) > 0) {
-        //openComponent('report')
+        openComponent('report')
     }
     // 监听全屏变化
     window.addEventListener('fullscreenchange', () => {

+ 14 - 12
vue.config.js

@@ -68,29 +68,31 @@ module.exports = defineConfig({
     // const manifest = JSON.parse(manifestContents)
     // console.log(manifest)
 
-
-    // 打包自动修改版本号
     if (process.env.NODE_ENV === 'production') {
       const configPath = oem ? convertPath(oem + 'config/appconfig.json') : convertPath('public/config/appconfig.json')
       const cfgContents = fs.readFileSync(configPath, 'utf-8')
       const cfg = JSON.parse(cfgContents)
 
-      const arr = cfg.version.split('.').map(Number)
-      arr[arr.length - 1] += 1 // 版本号自动+1
+      // 自动修改版本号
+      if (process.argv.includes('ver')) {
+        const arr = cfg.version.split('.').map(Number)
+        arr[arr.length - 1] += 1 // 版本号自动+1
 
-      // 版本号100进1
-      for (let i = arr.length - 1; i >= 0; i--) {
-        if (i > 0 && arr[i] > 99) {
-          arr[i] = 0
-          if (arr[i - 1] > -1) {
-            arr[i - 1] += 1
+        // 版本号100进1
+        for (let i = arr.length - 1; i >= 0; i--) {
+          if (i > 0 && arr[i] > 99) {
+            arr[i] = 0
+            if (arr[i - 1] > -1) {
+              arr[i - 1] += 1
+            }
           }
         }
+
+        cfg.version = arr.join('.')
+        cfg.versionCode = (Number(cfg.versionCode) + 1).toString()
       }
 
       cfg.appName = process.env.VUE_APP_NAME
-      cfg.version = arr.join('.')
-      cfg.versionCode = (Number(cfg.versionCode) + 1).toString()
       cfg.tradeChannel = process.env.VUE_APP_TRADE_CHANNEL
 
       fs.writeFileSync(configPath, JSON.stringify(cfg, null, 2))