li.shaoyi преди 2 години
родител
ревизия
c40be5d015

+ 2 - 2
.env.gstj

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'gstj'
-VUE_APP_TITLE = 甘肃碳交
+VUE_APP_NAME = 甘肃碳交
 VUE_APP_ROOT = src/packages/gstj/
 VUE_APP_OEM = oem/gstj/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 2 - 2
.env.gstj@pc

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'pc'
-VUE_APP_TITLE = 甘肃碳交
+VUE_APP_NAME = 甘肃碳交
 VUE_APP_ROOT = src/packages/pc/
 VUE_APP_OEM = oem/gstj/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = ws

+ 2 - 2
.env.mobile

@@ -1,4 +1,4 @@
 VUE_APP_ENV = 'mobile'
-VUE_APP_TITLE = 多元世纪
+VUE_APP_NAME = 多元世纪
 VUE_APP_ROOT = src/packages/mobile/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 3 - 2
.env.pc

@@ -1,4 +1,5 @@
 VUE_APP_ENV = 'pc'
-VUE_APP_TITLE = 多元世纪
+VUE_APP_NAME = 多元世纪
 VUE_APP_ROOT = src/packages/pc/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = ws
+VUE_APP_API_BETA = http://103.40.249.126:18280/cfg?key=mtp_20

+ 2 - 2
.env.qdhs

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'qdhs'
-VUE_APP_TITLE = 青岛海商
+VUE_APP_NAME = 青岛海商
 VUE_APP_ROOT = src/packages/qdhs/
 VUE_APP_OEM = oem/qdhs/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 2 - 2
.env.qdhs@pc

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'pc'
-VUE_APP_TITLE = 青岛海商
+VUE_APP_NAME = 青岛海商
 VUE_APP_ROOT = src/packages/pc/
 VUE_APP_OEM = oem/qdhs/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = ws

+ 2 - 2
.env.qxst

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'qxst'
-VUE_APP_TITLE = 贵茶数字化
+VUE_APP_NAME = 贵茶数字化
 VUE_APP_ROOT = src/packages/qxst/
 VUE_APP_OEM = oem/qxst/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 4 - 2
.env.qxst@pc

@@ -1,5 +1,7 @@
 VUE_APP_ENV = 'pc'
-VUE_APP_TITLE = 贵州茶交数字化中心
+VUE_APP_NAME = 贵州茶交数字化中心
 VUE_APP_ROOT = src/packages/pc/
 VUE_APP_OEM = oem/qxst/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = ws
+VUE_APP_API_BETA = http://8.130.132.95:8280/cfg?key=mtp_20
+VUE_APP_API_RELEASE = http://8.130.72.213:8280/cfg?key=mtp_20

+ 2 - 2
.env.sbyj

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'sbyj'
-VUE_APP_TITLE = 水贝亿爵
+VUE_APP_NAME = 水贝亿爵
 VUE_APP_ROOT = src/packages/sbyj/
 VUE_APP_OEM = oem/sbyj/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 2 - 2
.env.tc

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'tc'
-VUE_APP_TITLE = 探茶
+VUE_APP_NAME = 探茶
 VUE_APP_ROOT = src/packages/tc/
 VUE_APP_OEM = oem/tc/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 2 - 2
.env.tc@pc

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'pc'
-VUE_APP_TITLE = 探茶
+VUE_APP_NAME = 探茶
 VUE_APP_ROOT = src/packages/pc/
 VUE_APP_OEM = oem/tc/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = ws

+ 2 - 2
.env.zrwyt

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'zrwyt'
-VUE_APP_TITLE = 中融文遗通
+VUE_APP_NAME = 中融文遗通
 VUE_APP_ROOT = src/packages/zrwyt/
 VUE_APP_OEM = oem/zrwyt/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = http

+ 2 - 2
.env.zrwyt@pc

@@ -1,5 +1,5 @@
 VUE_APP_ENV = 'pc'
-VUE_APP_TITLE = 中融文遗通
+VUE_APP_NAME = 中融文遗通
 VUE_APP_ROOT = src/packages/pc/
 VUE_APP_OEM = oem/zrwyt/
-VUE_APP_HOST = localhost
+VUE_APP_TRADE_CHANNEL = ws

+ 3 - 1
app/electron.build.js

@@ -10,6 +10,7 @@ const convertPath = (dir) => path.resolve(__dirname, dir)
 const outputDir = convertPath('dist_electron') // 打包输出目录
 const fileContents = fs.readFileSync(convertPath('dist/config/appconfig.json'), 'utf-8')
 const appConfig = JSON.parse(fileContents)
+const isBeta = process.argv.includes('demo') // 是否测试版
 
 // 打包之前清空目录
 exec('rd/s/q ' + outputDir)
@@ -17,6 +18,7 @@ exec('rd/s/q ' + outputDir)
 // 打包自动修改版本号
 const pkgContents = fs.readFileSync(convertPath('package.json'), 'utf-8')
 const pkg = JSON.parse(pkgContents)
+pkg.name = pkg.name + (isBeta ? '-beta' : '')
 pkg.version = appConfig.version
 fs.writeFileSync(convertPath('package.json'), JSON.stringify(pkg, null, 2))
 
@@ -25,7 +27,7 @@ axios.get(appConfig.apiUrl).then((res) => {
     console.log(data)
 
     const config = {
-        productName: appConfig.appName,
+        productName: appConfig.appName + (isBeta ? '模拟盘' : ''),
         directories: {
             output: outputDir
         },

+ 2 - 2
app/package.json

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

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

@@ -1,7 +1,7 @@
 {
-  "appName": "贵茶数字化",
-  "version": "1.0.0",
-  "versionCode": "100000",
+  "appName": "贵数字化中心",
+  "version": "1.0.17",
+  "versionCode": "100017",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [

+ 2 - 2
oem/zrwyt/config/appconfig.json

@@ -1,7 +1,7 @@
 {
   "appName": "中融文遗通",
-  "version": "1.0.0",
-  "versionCode": "100000",
+  "version": "1.0.8",
+  "versionCode": "100008",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [

+ 4 - 4
package.json

@@ -12,13 +12,13 @@
     "dev:zrwyt": "vue-cli-service serve --mode zrwyt",
     "dev:qdhs": "vue-cli-service serve --mode qdhs",
     "dev:tc": "vue-cli-service serve --mode tc",
-    "build:pc": "set \"NODE_ENV=production\" && vue-cli-service build --mode pc",
     "build:mobile": "set \"NODE_ENV=production\" && vue-cli-service build --mode mobile",
+    "build:pc": "set \"NODE_ENV=production\" && vue-cli-service build --mode pc",
     "build:gstj": "vue-cli-service build --mode gstj",
     "build:gstj@pc": "vue-cli-service build --mode gstj@pc",
     "build:sbyj": "vue-cli-service build --mode sbyj",
-    "build:qxst": "vue-cli-service build --mode qxst",
-    "build:qxst@pc": "vue-cli-service build --mode qxst@pc",
+    "build:qxst": "set \"NODE_ENV=production\" && vue-cli-service build --mode qxst",
+    "build:qxst@pc": "set \"NODE_ENV=production\" && vue-cli-service build --mode qxst@pc",
     "build:zrwyt": "vue-cli-service build --mode zrwyt",
     "build:zrwyt@pc": "vue-cli-service build --mode zrwyt@pc",
     "build:qdhs": "vue-cli-service build --mode qdhs",
@@ -87,4 +87,4 @@
     "vconsole": "^3.14.6",
     "worker-loader": "^3.0.8"
   }
-}
+}

+ 2 - 2
public/config/appconfig.json

@@ -1,7 +1,7 @@
 {
   "appName": "多元世纪交易中心",
-  "version": "1.0.15",
-  "versionCode": "100015",
+  "version": "1.0.0",
+  "versionCode": "10000",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [

+ 16 - 1
src/packages/mobile/router/animateRouter.ts

@@ -154,6 +154,21 @@ export default new (class {
 
         actionName.value = '';
         goStep.value = 0
-        sessionStorage.setItem(this.storageKey, JSON.stringify(this._state.value));
+
+        // 处理对象循环引用
+        const getCircularReplacer = () => {
+            const seen = new WeakSet()
+            return (key: string, value: unknown) => {
+                if (typeof value === 'object' && value !== null) {
+                    if (seen.has(value)) {
+                        return
+                    }
+                    seen.add(value)
+                }
+                return value
+            }
+        }
+
+        sessionStorage.setItem(this.storageKey, JSON.stringify(this._state.value, getCircularReplacer()))
     }
 })

+ 19 - 4
src/packages/pc/components/layouts/header/components/setting/index.vue

@@ -1,7 +1,7 @@
 <!-- 快捷设置 -->
 <template>
-    <app-drawer title="快捷设置" width="420" v-model:show="show">
-        <el-form ref="formRef" class="el-form--vertical" label-width="120px" :model="formData">
+    <app-drawer title="快捷设置" width="800" v-model:show="show">
+        <el-form ref="formRef" class="el-form--horizontal" label-width="140px" :model="formData">
             <el-form-item prop="orderFocusType" label="下单价格类型">
                 <el-select placeholder="请选择" v-model="formData.orderPriceType">
                     <el-option label="现价" :value="1" />
@@ -10,14 +10,29 @@
                     <el-option label="实时对手价" :value="4" />
                 </el-select>
             </el-form-item>
+            <el-form-item label="单笔最大下单量">
+                <el-input-number placeholder="请输入" v-model="formData.orderMaxQty" :min="1" :max="1000000" />
+            </el-form-item>
             <el-form-item prop="orderFocusType" label="下单后默认焦点">
                 <el-select placeholder="请选择" v-model="formData.orderFocusType">
                     <el-option label="价格" :value="1" />
                     <el-option label="数量" :value="2" />
                 </el-select>
             </el-form-item>
-            <el-form-item prop="orderQtyIsEmpty">
-                <el-checkbox v-model="formData.orderQtyIsEmpty" label="下单后清空数量" />
+            <el-form-item prop="showOrderDialog" label="下单确认提示框">
+                <el-switch v-model="formData.showOrderDialog" />
+            </el-form-item>
+            <el-form-item prop="orderQtyIsEmpty" label="下单后清空数量">
+                <el-switch v-model="formData.orderQtyIsEmpty" />
+            </el-form-item>
+            <el-form-item prop="showOrderSuccessMessage" label="下单成功消息">
+                <el-switch v-model="formData.showOrderSuccessMessage" />
+            </el-form-item>
+            <el-form-item prop="showOrderEnableQty" label="显示预估订立量">
+                <el-switch v-model="formData.showOrderEnableQty" />
+            </el-form-item>
+            <el-form-item prop="showOrderFailMessage" label="下单失败消息">
+                <el-switch v-model="formData.showOrderFailMessage" />
             </el-form-item>
         </el-form>
         <template #footer>

+ 25 - 14
src/packages/pc/views/market/trade/goods/list/listing/index.vue

@@ -38,12 +38,14 @@
                 </el-form-item>
                 <el-form-item prop="OrderQty" label="数量">
                     <div class="g-qty-group">
-                        <el-input-number ref="qtyRef" placeholder="请输入" :min="0" :precision="0" :step="qtyStep || 1"
+                        <el-input-number ref="qtyRef" placeholder="请输入" :min="0"
+                            :max="settingStore.getSettingValue('orderMaxQty')" :precision="0" :step="qtyStep || 1"
                             v-model="formData.OrderQty" @keyup.enter="submitFocus" />
                         <el-radio-group size="small" v-model="qtyStep" :validate-event="false" @change="onRadioChange">
                             <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
                         </el-radio-group>
-                        <div style="line-height: 1;font-size: 12px;color: #7a8a94;" v-if="false">可用资金订立量:{{ enableQty }}
+                        <div style="line-height: 1;font-size: 12px;color: #7a8a94;"
+                            v-if="settingStore.getSettingValue('showOrderEnableQty')">可用资金订立量:{{ enableQty }}
                         </div>
                     </div>
                 </el-form-item>
@@ -63,7 +65,8 @@
                     <template v-if="formData.BuyOrSell === BuyOrSell.Sell">
                         <el-button ref="submitRef" type="warning" :loading="loading"
                             :disabled="!selectedGoodsId || !formData.OrderQty"
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="!isTrademode16 && !selectedGoods?.iscannotsell">订立</el-button>
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)"
+                            v-if="!isTrademode16 && !selectedGoods?.iscannotsell">订立</el-button>
                         <el-button type="primary" :loading="loading"
                             :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
@@ -203,16 +206,20 @@ const onBeforeSubmit = (buildType: EBuildType) => {
     formRef.value?.validate((valid) => {
         if (valid) {
             formData.BuildType = buildType
-            if (isTrademode16.value) {
-                ElMessageBox.confirm(
-                    '是否立即挂牌?',
-                    '提示'
-                ).then(() => onSubmit())
+            if (settingStore.getSettingValue('showOrderDialog')) {
+                if (isTrademode16.value) {
+                    ElMessageBox.confirm(
+                        '是否立即挂牌?',
+                        '提示'
+                    ).then(() => onSubmit())
+                } else {
+                    ElMessageBox.confirm(
+                        '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
+                        '是否立即挂牌?'
+                    ).then(() => onSubmit())
+                }
             } else {
-                ElMessageBox.confirm(
-                    '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
-                    '是否立即挂牌?'
-                ).then(() => onSubmit())
+                onSubmit()
             }
         }
     })
@@ -235,9 +242,13 @@ const onSubmit = () => {
             formData.OrderQty = undefined
             qtyStep.value = 0
         }
-        ElMessage.success('挂牌成功')
+        if (settingStore.getSettingValue('showOrderSuccessMessage')) {
+            ElMessage.success('挂牌成功')
+        }
     }).catch((err) => {
-        ElMessage.error('挂牌失败:' + err)
+        if (settingStore.getSettingValue('showOrderFailMessage')) {
+            ElMessage.error('挂牌失败:' + err)
+        }
     }).finally(() => {
         const focusType = settingStore.getSettingValue('orderFocusType')
         if (focusType === 2 || isDisabled.value) {

+ 5 - 3
src/stores/modules/setting.ts

@@ -12,11 +12,13 @@ export const useSettingStore = defineStore(() => {
 
     const settingIndex = computed(() => settings.findIndex(((e) => e.loginId === loginStore.userId)))
 
-    const userSetting = computed(() => (settings[settingIndex.value] ?? {
+    const userSetting = computed<Model.LocalSetting>(() => (settings[settingIndex.value] ?? {
         loginId: 0,
         showOrderDialog: true,
-        showOrderSuccessDialog: false,
-        showOrderFailDialog: false,
+        showOrderSuccessMessage: true,
+        showOrderFailMessage: true,
+        showOrderEnableQty: false,
+        orderMaxQty: 10000,
         orderFocusType: 1,
         orderPriceType: 1,
         orderQtyIsEmpty: false

+ 4 - 3
src/types/model/common.d.ts

@@ -328,12 +328,13 @@ declare global {
         interface LocalSetting {
             loginId: number;
             showOrderDialog: boolean; // 挂/摘牌时弹出提示确认对话框
-            showOrderSuccessDialog: boolean; // 挂/摘牌成功使用对话框提示
-            showOrderFailDialog: boolean; // 挂/摘牌失败使用对话框提示
+            showOrderSuccessMessage: boolean; // 挂/摘牌成功是否显示消息提示
+            showOrderFailMessage: boolean; // 挂/摘牌失败是否显示消息提示
+            showOrderEnableQty: boolean; // 挂/摘牌是否显示预估订立量
+            orderMaxQty: number; // 单笔最大下单量
             orderFocusType: number; // 下单后默认焦点对象,1=价格,2=数量
             orderPriceType: number; // 下单默认价格类型,1=现价,2=对手价,3=实时价,4=实时对手价
             orderQtyIsEmpty: boolean; // 下单后是否清空数量输入框
-            maxOrderQty: number; // 单笔最大下单量
         }
 
         /** 查询会员商品限制配置表 请求 */

+ 4 - 1
vue.config.js

@@ -19,7 +19,7 @@ module.exports = defineConfig({
       entry: process.env.VUE_APP_ROOT + 'main.ts',
       template: process.env.VUE_APP_ROOT + 'index.html',
       filename: 'index.html',
-      title: process.env.VUE_APP_TITLE,
+      title: process.env.VUE_APP_NAME,
       meta: {
         revised: moment(new Date()).format('YYYYMMDDHHmmss')  // 打包生成版本号
       }
@@ -88,8 +88,11 @@ module.exports = defineConfig({
         }
       }
 
+      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))
       console.log(cfg)
     }