Bladeren bron

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 jaren geleden
bovenliggende
commit
11853c46ca
35 gewijzigde bestanden met toevoegingen van 1305 en 493 verwijderingen
  1. 130 0
      package-lock.json
  2. 1 1
      package.json
  3. 1 1
      public/config/app.config.json
  4. 1 0
      src/common/components/echart/echart-base/setup.ts
  5. 116 120
      src/common/components/echart/echart-kline/index.vue
  6. 20 11
      src/common/components/echart/echart-kline/setup.ts
  7. 77 47
      src/common/components/echart/echart-timeline/index.vue
  8. 26 17
      src/common/components/echart/echart-timeline/setup.ts
  9. 4 3
      src/common/components/permanceTemp/addPermanceTemp.vue
  10. 30 2
      src/common/constants/enumsName.ts
  11. 2 1
      src/services/bus/goods.ts
  12. 30 0
      src/services/bus/holdPosition.ts
  13. 2 2
      src/services/go/ermcp/order/index.ts
  14. 10 10
      src/services/go/quote/interface.ts
  15. 26 3
      src/services/go/wrtrade/interface.ts
  16. 13 1
      src/services/socket/quota/adapter/index.ts
  17. 2 2
      src/views/market/spot_trade/spot_trade_order_transaction/components/stock-exchange/index.vue
  18. 63 60
      src/views/market/spot_trade/spot_trade_reference_market/components/container/index.vue
  19. 1 1
      src/views/market/spot_trade/spot_trade_reference_market/index.vue
  20. 10 15
      src/views/order/commodity_contract/components/commodity_contract_bargain/index.vue
  21. 74 0
      src/views/order/commodity_contract/components/commodity_contract_commission/components/cancel/index.vue
  22. 15 3
      src/views/order/commodity_contract/components/commodity_contract_commission/index.vue
  23. 16 43
      src/views/order/commodity_contract/components/commodity_contract_summary/index.vue
  24. 21 3
      src/views/order/financing_manager/components/financing_manager_apply_order/index.vue
  25. 42 12
      src/views/order/funding_information/components/funding_information_funding_summary/index.vue
  26. 200 0
      src/views/order/funding_information/components/funding_information_funding_summary/setup.ts
  27. 1 1
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/components/cancle/index.vue
  28. 2 1
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/components/detail/index.vue
  29. 18 2
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/index.vue
  30. 168 0
      src/views/order/setup.ts
  31. 1 1
      src/views/order/spot_warran/components/spot_warrant_pending_order/components/cancle/index.vue
  32. 2 1
      src/views/order/spot_warran/components/spot_warrant_pending_order/components/detail/index.vue
  33. 19 2
      src/views/order/spot_warran/components/spot_warrant_pending_order/index.vue
  34. 61 48
      swagger-to-ts/swagger.ts
  35. 100 79
      swagger-to-ts/swagger.txt

+ 130 - 0
package-lock.json

@@ -5191,8 +5191,13 @@
     },
     "echarts": {
       "version": "5.2.1",
+<<<<<<< HEAD
+      "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.2.1.tgz",
+      "integrity": "sha512-OJ79b22eqRfbSV8vYmDKmA+XWfNbr0Uk/OafWcFNIGDWti2Uw9A6eVCiJLmqPa9Sk+EWL+t5v26aak0z3gxiZw==",
+=======
       "resolved": "https://registry.nlark.com/echarts/download/echarts-5.2.1.tgz?cache=0&sync_timestamp=1632191214180&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fecharts%2Fdownload%2Fecharts-5.2.1.tgz",
       "integrity": "sha1-vVjsARzYLe9KcU5AOO9Lc7hBe8M=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
       "requires": {
         "tslib": "2.3.0",
         "zrender": "5.2.1"
@@ -5200,8 +5205,13 @@
       "dependencies": {
         "tslib": {
           "version": "2.3.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
+          "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
+=======
           "resolved": "https://registry.nlark.com/tslib/download/tslib-2.3.0.tgz?cache=0&sync_timestamp=1628722556410&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-2.3.0.tgz",
           "integrity": "sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4="
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
         }
       }
     },
@@ -6228,8 +6238,13 @@
     },
     "fork-ts-checker-webpack-plugin-v5": {
       "version": "npm:fork-ts-checker-webpack-plugin@5.2.1",
+<<<<<<< HEAD
+      "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz",
+      "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==",
+=======
       "resolved": "https://registry.npmmirror.com/fork-ts-checker-webpack-plugin/download/fork-ts-checker-webpack-plugin-5.2.1.tgz",
       "integrity": "sha1-eTJthpeXkG+osk4qvPlCH8gFRQ0=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
       "dev": true,
       "optional": true,
       "requires": {
@@ -6248,8 +6263,13 @@
       "dependencies": {
         "ansi-styles": {
           "version": "4.3.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+=======
           "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1618995588464&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz",
           "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6258,8 +6278,13 @@
         },
         "chalk": {
           "version": "4.1.2",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+=======
           "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646697260&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz",
           "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6269,8 +6294,13 @@
         },
         "color-convert": {
           "version": "2.0.1",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+=======
           "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
           "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6279,8 +6309,13 @@
         },
         "cosmiconfig": {
           "version": "6.0.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",
+          "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",
+=======
           "resolved": "https://registry.nlark.com/cosmiconfig/download/cosmiconfig-6.0.0.tgz?cache=0&sync_timestamp=1629602330801&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcosmiconfig%2Fdownload%2Fcosmiconfig-6.0.0.tgz",
           "integrity": "sha1-2k/uhTxS9rHmk19BwaL8UL1KmYI=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6293,15 +6328,25 @@
         },
         "deepmerge": {
           "version": "4.2.2",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
+          "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
+=======
           "resolved": "https://registry.nlark.com/deepmerge/download/deepmerge-4.2.2.tgz",
           "integrity": "sha1-RNLqNnm49NT/ujPwPYZfwee/SVU=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true
         },
         "fs-extra": {
           "version": "9.1.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
+          "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
+=======
           "resolved": "https://registry.nlark.com/fs-extra/download/fs-extra-9.1.0.tgz",
           "integrity": "sha1-WVRGDHZKjaIJS6NVS/g55rmnyG0=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6313,15 +6358,25 @@
         },
         "has-flag": {
           "version": "4.0.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+=======
           "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz",
           "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true
         },
         "jsonfile": {
           "version": "6.1.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+          "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+=======
           "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-6.1.0.tgz?cache=0&sync_timestamp=1604161876665&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsonfile%2Fdownload%2Fjsonfile-6.1.0.tgz",
           "integrity": "sha1-vFWyY0eTxnnsZAMJTrE2mKbsCq4=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6331,8 +6386,13 @@
         },
         "lru-cache": {
           "version": "6.0.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+          "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+=======
           "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz",
           "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6341,8 +6401,13 @@
         },
         "schema-utils": {
           "version": "2.7.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
+          "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
+=======
           "resolved": "https://registry.nlark.com/schema-utils/download/schema-utils-2.7.0.tgz?cache=0&sync_timestamp=1626694835325&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fschema-utils%2Fdownload%2Fschema-utils-2.7.0.tgz",
           "integrity": "sha1-FxUfdtjq5n+793lgwzxnatn078c=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6353,8 +6418,13 @@
         },
         "semver": {
           "version": "7.3.5",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
+          "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
+=======
           "resolved": "https://registry.nlark.com/semver/download/semver-7.3.5.tgz?cache=0&sync_timestamp=1618846864940&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-7.3.5.tgz",
           "integrity": "sha1-C2Ich5NI2JmOSw5L6Us/EuYBjvc=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6363,8 +6433,13 @@
         },
         "supports-color": {
           "version": "7.2.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+=======
           "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz",
           "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -6373,8 +6448,13 @@
         },
         "universalify": {
           "version": "2.0.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+          "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
+=======
           "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-2.0.0.tgz?cache=0&sync_timestamp=1603180004159&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-2.0.0.tgz",
           "integrity": "sha1-daSYTv7cSwiXXFrrc/Uw0C3yVxc=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true
         }
@@ -8565,8 +8645,13 @@
     },
     "memfs": {
       "version": "3.3.0",
+<<<<<<< HEAD
+      "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.3.0.tgz",
+      "integrity": "sha512-BEE62uMfKOavX3iG7GYX43QJ+hAeeWnwIAuJ/R6q96jaMtiLzhsxHJC8B1L7fK7Pt/vXDRwb3SG/yBpNGDPqzg==",
+=======
       "resolved": "https://registry.nlark.com/memfs/download/memfs-3.3.0.tgz",
       "integrity": "sha1-TaLR/ECgSxcKVmIscWTGvixMvvI=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
       "dev": true,
       "optional": true,
       "requires": {
@@ -12901,8 +12986,13 @@
     },
     "vue-loader-v16": {
       "version": "npm:vue-loader@16.8.1",
+<<<<<<< HEAD
+      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.1.tgz",
+      "integrity": "sha512-V53TJbHmzjBhCG5OYI2JWy/aYDspz4oVHKxS43Iy212GjGIG1T3EsB3+GWXFm/1z5VwjdjLmdZUFYM70y77vtQ==",
+=======
       "resolved": "https://registry.npmmirror.com/vue-loader/download/vue-loader-16.8.1.tgz?cache=0&sync_timestamp=1632349858333&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.8.1.tgz",
       "integrity": "sha1-NU8SvAiXlUFYtxWQ+AApVxOneS0=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
       "dev": true,
       "optional": true,
       "requires": {
@@ -12913,8 +13003,13 @@
       "dependencies": {
         "ansi-styles": {
           "version": "4.3.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+=======
           "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1618995588464&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz",
           "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -12923,8 +13018,13 @@
         },
         "chalk": {
           "version": "4.1.2",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+=======
           "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646697260&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz",
           "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -12934,8 +13034,13 @@
         },
         "color-convert": {
           "version": "2.0.1",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+=======
           "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
           "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -12944,15 +13049,25 @@
         },
         "has-flag": {
           "version": "4.0.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+=======
           "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz",
           "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true
         },
         "loader-utils": {
           "version": "2.0.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
+          "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
+=======
           "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
           "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -12963,8 +13078,13 @@
         },
         "supports-color": {
           "version": "7.2.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+=======
           "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz",
           "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
           "dev": true,
           "optional": true,
           "requires": {
@@ -13955,16 +14075,26 @@
     },
     "zrender": {
       "version": "5.2.1",
+<<<<<<< HEAD
+      "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.2.1.tgz",
+      "integrity": "sha512-M3bPGZuyLTNBC6LiNKXJwSCtglMp8XUEqEBG+2MdICDI3d1s500Y4P0CzldQGsqpRVB7fkvf3BKQQRxsEaTlsw==",
+=======
       "resolved": "https://registry.nlark.com/zrender/download/zrender-5.2.1.tgz",
       "integrity": "sha1-X0u9qRW6bUErCxncJDG+qtBUF7s=",
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
       "requires": {
         "tslib": "2.3.0"
       },
       "dependencies": {
         "tslib": {
           "version": "2.3.0",
+<<<<<<< HEAD
+          "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
+          "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
+=======
           "resolved": "https://registry.nlark.com/tslib/download/tslib-2.3.0.tgz?cache=0&sync_timestamp=1628722556410&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-2.3.0.tgz",
           "integrity": "sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4="
+>>>>>>> d75268513425dcf4c74db37b8a6dd59085c59e8e
         }
       }
     }

+ 1 - 1
package.json

@@ -52,4 +52,4 @@
         "prettier": "^1.19.1",
         "typescript": "^4.2.3"
     }
-}
+}

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.135:8080/cfg?key=test_135"
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
 }

+ 1 - 0
src/common/components/echart/echart-base/setup.ts

@@ -79,6 +79,7 @@ export function useEchart(el: HTMLElement, ctx: SetupContext): UseEchart {
 
     onUnmounted(() => {
         removeEventListener();
+        echart.dispose();
     })
 
     // 针对 keepalive 缓存组件

+ 116 - 120
src/common/components/echart/echart-kline/index.vue

@@ -6,8 +6,9 @@
 import { defineComponent, PropType, ref, watch, watchEffect } from 'vue';
 import { QueryHistoryDatasRsp, QueryQuoteDayRsp, QueryHistoryDatas, CycleType } from '@/services/go/quote/interface';
 import { QueryHistoryDatas as queryHistoryDatas } from '@/services/go/quote';
-import { handleEchart, ChartData } from './setup';
+import { debounce } from '@/utils/time';
 import EchartBase from '../echart-base/index.vue';
+import { handleEchart } from './setup';
 import moment from 'moment';
 
 export default defineComponent({
@@ -29,55 +30,54 @@ export default defineComponent({
     },
     setup(props) {
         const loading = ref(true);
+        const historyIndexs: number[] = []; // 行情历史数据中所有非补充数据的索引位置(用于计算均线)
         const { chartData, options, updateOptions, initOptions } = handleEchart();
 
         // 处理图表数据
-        const handleData = (rawData: QueryHistoryDatasRsp[]): ChartData => {
+        const handleData = (rawData: QueryHistoryDatasRsp[]): void => {
+            historyIndexs.length = 0; // 清空数据
             const datas: number[][] = [],
                 times: string[] = [];
 
-            rawData.forEach((item) => {
+            rawData.forEach((item, index) => {
                 const { o, c, h, l, ts } = item;
-                times.push(moment(ts).format('YYYY-MM-DD HH:mm:ss'));
                 datas.push([o, c, h, l]);
+                times.push(moment(ts).format('MM-DD HH:mm'));
+                if (!item.f) historyIndexs.push(index); // 排除补充数据
             });
 
-            return {
-                datas,
-                times,
-                ma5: calcMA(rawData, 5),
-                ma10: calcMA(rawData, 10),
-                ma15: calcMA(rawData, 15),
-                ...calcMACD(datas),
-            };
+            chartData.datas = datas;
+            chartData.times = times;
+            chartData.ma5 = calcMA(datas, 5);
+            chartData.ma10 = calcMA(datas, 10);
+            chartData.ma15 = calcMA(datas, 15);
+
+            const { macd, dif, dea } = calcMACD(datas);
+            chartData.macd = macd;
+            chartData.dif = dif;
+            chartData.dea = dea;
         };
 
         // 计算平均线
-        const calcMA = (rawData: QueryHistoryDatasRsp[], count: number) => {
+        const calcMA = (data: number[][], count: number) => {
             const result: string[] = [];
-            if (rawData.length >= count) {
-                // 所有非补充数据的索引id
-                const dataIndexs = rawData.reduce((prev: number[], cur, index) => {
-                    if (!cur.f) prev.push(index);
-                    return prev;
-                }, []);
+            if (data.length >= count) {
                 // 均线起始位置
-                const startIndex = dataIndexs[count - 1];
-
-                rawData.forEach((item, index) => {
+                const startIndex = historyIndexs[count - 1];
+                data.forEach((item, index) => {
                     if (index < startIndex) {
                         result.push('-');
                     } else {
-                        const j = dataIndexs.findIndex((val) => val === index);
+                        const j = historyIndexs.findIndex((val) => val === index);
                         // 判断是否补充数据
                         if (j === -1) {
                             // 取上个平均值
                             result.push(result[result.length - 1]);
                         } else {
                             // 向后取MA数
-                            const splitIndexs = dataIndexs.slice(j - (count - 1), j + 1);
-                            // 计算总价
-                            const total = splitIndexs.reduce((sum, val) => sum + rawData[val].c, 0);
+                            const maIndexs = historyIndexs.slice(j - (count - 1), j + 1);
+                            // 计算总价,data[val][1]=收盘价
+                            const total = maIndexs.reduce((sum, val) => sum + data[val][1], 0);
                             // 计算均线
                             result.push((total / count).toFixed(2));
                         }
@@ -87,30 +87,19 @@ export default defineComponent({
             return result;
         };
 
-        // 计算最后一根平均线
-        const calcLastMA = (rawData: number[][], count: number): string | undefined => {
-            if (rawData.length >= count) {
-                const index = rawData.length - 1;
-                // 向后取MA数
-                const datas = rawData.slice(index - (count - 1), index + 1);
-                // 计算总价,val[1]=收盘价
-                const total = datas.reduce((sum, val) => sum + val[1], 0);
-                // 计算均线
-                return (total / count).toFixed(2);
-            }
-        };
-
         // 计算EMA
-        const calcEMA = (data: number[], n: number) => {
+        const calcEMA = (close: number[], n: number) => {
             const result: number[] = [],
                 a = 2 / (n + 1); // 平滑系数
 
-            for (let i = 0; i < data.length; i++) {
+            for (let i = 0; i < close.length; i++) {
                 if (i === 0) {
-                    result.push(data[i]);
+                    //第一个EMA(n)是前n个收盘价代数平均
+                    const ema = close.slice(0, n).reduce((sum, val) => sum + val, 0) / n;
+                    result.push(ema);
                 } else {
                     // EMA(n) = α × Close + (1 - α) × EMA(n - 1)
-                    const ema = a * data[i] + (1 - a) * result[i - 1];
+                    const ema = a * close[i] + (1 - a) * result[i - 1];
                     result.push(ema);
                 }
             }
@@ -123,12 +112,12 @@ export default defineComponent({
         };
 
         // 计算DIF
-        const calcDIF = (data: number[]) => {
+        const calcDIF = (close: number[]) => {
             const result: number[] = [],
-                emaShort = calcEMA(data, 12),
-                emaLong = calcEMA(data, 26);
+                emaShort = calcEMA(close, 12),
+                emaLong = calcEMA(close, 26);
 
-            for (let i = 0; i < data.length; i++) {
+            for (let i = 0; i < close.length; i++) {
                 const dif = emaShort[i] - emaLong[i];
                 result.push(dif);
             }
@@ -136,9 +125,9 @@ export default defineComponent({
         };
 
         // 计算MACD
-        const calcMACD = (rawData: number[][]) => {
+        const calcMACD = (data: number[][]) => {
             const macd = [],
-                close = rawData.map((item) => item[1]), // 收盘价数据
+                close = data.map((item) => item[1]), // 收盘价数据
                 dif = calcDIF(close),
                 dea = calcDEA(dif);
 
@@ -152,90 +141,97 @@ export default defineComponent({
             };
         };
 
+        // 更新图表K线数据
+        const updateChartData = () => {
+            const { datas, times } = chartData,
+                lastIndex = datas.length - 1, // 历史行情最后索引位置
+                lastTime = moment(times[times.length - 1]), // 历史行情最后时间
+                newTime = moment(props.quoteData.lasttime), // 实时行情最新时间
+                newPrice = props.quoteData.last; // 实时行情最新价
+
+            let cycleMilliseconds = 60 * 1000; // 周期毫秒数
+
+            switch (props.cycleType) {
+                case CycleType.minutes5:
+                    cycleMilliseconds *= 5;
+                    break;
+                case CycleType.minutes30:
+                    cycleMilliseconds *= 30;
+                    break;
+                case CycleType.minutes60:
+                    cycleMilliseconds *= 60;
+                    break;
+                case CycleType.hours2:
+                    cycleMilliseconds *= 2 * 60;
+                    break;
+                case CycleType.Hours4:
+                    cycleMilliseconds *= 4 * 60;
+                    break;
+                case CycleType.days:
+                    cycleMilliseconds *= 24 * 60;
+                    break;
+            }
+
+            const diffTime = newTime.valueOf() - lastTime.valueOf(); // 计算时间差
+            // 判断时间差是否大于周期时间
+            if (diffTime > cycleMilliseconds) {
+                lastTime.add(cycleMilliseconds, 'ms');
+                times.push(lastTime.format('MM-DD HH:mm')); // 添加历史行情时间
+                datas.push([newPrice, newPrice, newPrice, newPrice]); // 添加历史行情数据
+                historyIndexs.push(lastIndex + 1); // 添加历史行情索引
+            } else {
+                const lastPrice = datas[lastIndex];
+                if (lastPrice[2] > newPrice) {
+                    lastPrice[2] = newPrice; //更新最低价
+                }
+                if (lastPrice[3] < newPrice) {
+                    lastPrice[3] = newPrice; //更新最高价
+                }
+                lastPrice[1] = newPrice; //更新收盘价
+                datas[lastIndex] = lastPrice; // 更新历史行情数据
+            }
+
+            // 延迟图表更新,减少卡顿
+            debounce(() => {
+                chartData.ma5 = calcMA(datas, 5);
+                chartData.ma10 = calcMA(datas, 10);
+                chartData.ma15 = calcMA(datas, 15);
+
+                const { dif, dea, macd } = calcMACD(datas);
+                chartData.dif = dif;
+                chartData.dea = dea;
+                chartData.macd = macd;
+
+                updateOptions();
+            }, 1000);
+        };
+
+        watch(
+            () => props.quoteData.last,
+            () => {
+                if (!loading.value) {
+                    updateChartData();
+                }
+            }
+        );
+
         // 监听周期选择变化
         watchEffect(() => {
             loading.value = true;
             const params: QueryHistoryDatas = {
                 cycleType: props.cycleType,
                 goodsCode: props.quoteData.goodscode,
-                isAsc: true,
+                count: 1440,
             };
             // 查询K线数据
             queryHistoryDatas(params).then((res) => {
-                chartData.value = handleData(res);
+                // 日期升序排序
+                const kdata = res.sort((a, b) => moment(a.ts).valueOf() - moment(b.ts).valueOf());
+                handleData(kdata);
                 initOptions();
             });
         });
 
-        watch(
-            () => props.quoteData.last,
-            (val) => {
-                if (!loading.value) {
-                    console.log('lastTime', props.quoteData.lasttime);
-                    const { datas, times, ma5, ma10, ma15 } = chartData.value,
-                        lastTime = moment(times[times.length - 1]), // 行情最后时间
-                        newTime = moment(props.quoteData.lasttime); // 实时最新时间
-
-                    let cycleMilliseconds = 60 * 1000; // 周期毫秒数
-
-                    switch (props.cycleType) {
-                        case CycleType.minutes5:
-                            cycleMilliseconds *= 5;
-                            break;
-                        case CycleType.minutes30:
-                            cycleMilliseconds *= 30;
-                            break;
-                        case CycleType.minutes60:
-                            cycleMilliseconds *= 60;
-                            break;
-                        case CycleType.hours2:
-                            cycleMilliseconds *= 2 * 60;
-                            break;
-                        case CycleType.Hours4:
-                            cycleMilliseconds *= 4 * 60;
-                            break;
-                        case CycleType.days:
-                            cycleMilliseconds *= 24 * 60;
-                            break;
-                    }
-
-                    const diffTime = newTime.valueOf() - lastTime.valueOf(); // 计算时间差
-                    // 判断时间差是否大于周期时间
-                    if (diffTime > cycleMilliseconds) {
-                        lastTime.add(cycleMilliseconds, 'ms');
-                        times.push(lastTime.format());
-                        datas.push([val, val, val, val]);
-                    } else {
-                        const lastIndex = datas.length - 1,
-                            lastData = datas[lastIndex];
-                        if (lastData[2] > val) {
-                            lastData[2] = val; //更新最低价
-                        }
-                        if (lastData[3] < val) {
-                            lastData[3] = val; //更新最高价
-                        }
-                        lastData[1] = val; //更新收盘价
-                        datas[lastIndex] = lastData; // 更新数据
-                    }
-
-                    const _ma5 = calcLastMA(datas, 5),
-                        _ma10 = calcLastMA(datas, 10),
-                        _ma15 = calcLastMA(datas, 15);
-
-                    if (_ma5) ma5[ma5.length - 1] = _ma5;
-                    if (_ma10) ma10[ma10.length - 1] = _ma10;
-                    if (_ma15) ma15[ma15.length - 1] = _ma15;
-
-                    const { dif, dea, macd } = calcMACD(datas);
-                    chartData.value.dif = dif;
-                    chartData.value.dea = dea;
-                    chartData.value.macd = macd;
-
-                    updateOptions();
-                }
-            }
-        );
-
         return {
             loading,
             options,

+ 20 - 11
src/common/components/echart/echart-kline/setup.ts

@@ -32,7 +32,7 @@ export function handleEchart() {
     // 当前主题
     const theme = getTheme();
     // 图表数据
-    const chartData = ref<ChartData>({
+    const chartData: ChartData = {
         datas: [],
         times: [],
         ma5: [],
@@ -41,14 +41,15 @@ export function handleEchart() {
         dif: [],
         dea: [],
         macd: []
-    });
+    };
     // 图表当前指示数据
     let chartDataIndex = 0;
 
     // 初始化图表配置
     const initOptions = () => {
-        const { datas, times, ma5, ma10, ma15, dea, dif, macd } = chartData.value;
+        const { datas, times, ma5, ma10, ma15, dea, dif, macd } = chartData;
         const option: EChartsOption = {
+            animation: false,
             axisPointer: {
                 link: [
                     {
@@ -60,7 +61,7 @@ export function handleEchart() {
                 {
                     //图例控件,点击图例控制哪些系列不显示
                     type: 'scroll',
-                    data: ['K线', 'MA5', 'MA10', 'MA15'],
+                    data: ['MA5', 'MA10', 'MA15'],
                     itemWidth: 14,
                     itemHeight: 2,
                     left: '5%',
@@ -72,7 +73,7 @@ export function handleEchart() {
                 {
                     //图例控件,点击图例控制哪些系列不显示
                     type: 'scroll',
-                    data: ['MACD', 'DIF', 'DEA'],
+                    data: ['DIF', 'DEA'],
                     itemWidth: 14,
                     itemHeight: 2,
                     left: '5%',
@@ -99,7 +100,7 @@ export function handleEchart() {
                     let result = '';
                     params.forEach((item: any) => {
                         if (item.seriesType === 'candlestick') {
-                            result += '<div class="tooltip-title">' + moment(item.name).format('YYYY/MM/DD') + '</div>';
+                            result += '<div class="tooltip-title">' + item.name + '</div>';
                             item.value.forEach((data: number[], i: number) => {
                                 if (i > 0) {
                                     result += '<div class="tooltip-item"><span><i style="background-color:' + item.color + ';"></i>';
@@ -183,11 +184,10 @@ export function handleEchart() {
                 {
                     type: 'inside',
                     xAxisIndex: [0, 1],
-                    // 起始显示K线条数(最新200条)
-                    startValue: times.length - 200,
+                    startValue: times.length - 120, // 起始显示K线条数(最新120条)
                     endValue: times.length,
-                    // 限制窗口缩放显示最少数据条数
-                    minValueSpan: 30,
+                    minValueSpan: 60, // 限制窗口缩放显示最少数据条数
+                    maxValueSpan: 400, // 限制窗口缩放显示最大数据条数
                 },
                 {
                     show: false,
@@ -265,6 +265,7 @@ export function handleEchart() {
                     data: macd,
                     xAxisIndex: 1,
                     yAxisIndex: 1,
+                    barWidth: '20%',
                 },
                 {
                     name: 'DIF',
@@ -302,9 +303,17 @@ export function handleEchart() {
 
     // 动态更新数据
     const updateOptions = () => {
-        const { datas, ma5, ma10, ma15, macd, dif, dea } = chartData.value;
+        const { datas, times, ma5, ma10, ma15, macd, dif, dea } = chartData;
         if (datas.length) {
             options.value = {
+                xAxis: [
+                    {
+                        data: times,
+                    },
+                    {
+                        data: times,
+                    },
+                ],
                 series: [
                     {
                         name: 'K线',

+ 77 - 47
src/common/components/echart/echart-timeline/index.vue

@@ -6,11 +6,11 @@
 import { defineComponent, ref, watch, PropType } from 'vue';
 import { QueryTSDataRsp, QueryQuoteDayRsp } from '@/services/go/quote/interface';
 import { QueryTSData } from '@/services/go/quote';
-import { getGoodsByCode } from '@/services/bus/goods';
-import { handleEchart, ChartData } from './setup';
-import EchartBase from '../echart-base/index.vue';
-import { getRangeTime } from '@/utils/time';
+import { debounce, getRangeTime } from '@/utils/time';
 import { toDecimalFull } from '@/utils/number';
+import EchartBase from '../echart-base/index.vue';
+import { handleEchart } from './setup';
+import moment from 'moment';
 
 export default defineComponent({
     name: 'EchartTime',
@@ -26,39 +26,50 @@ export default defineComponent({
     },
     setup(props) {
         const loading = ref(true);
+        const historyIndexs: number[] = []; // 行情历史数据中所有非补充数据的索引位置(用于计算均线)
         const { chartData, options, updateOptions, initOptions } = handleEchart();
 
         // 处理图表数据
-        const handleData = (rawData: QueryTSDataRsp): ChartData => {
-            const datas = rawData.historyDatas!.map((item) => item.c),
-                startTime = rawData.startTime!,
-                endTime = rawData.endTime!,
-                times = getRangeTime(startTime, endTime, 'HH:mm', 'm'),
-                yestclose = rawData.preSettle!,
-                decimal = rawData.decimalPlace!;
+        const handleData = (rawData: QueryTSDataRsp): void => {
+            historyIndexs.length = 0; // 清空数据
+            const datas: number[] = [],
+                times: string[] = [],
+                xAxisTimes: string[] = [],
+                yestclose = rawData.preSettle,
+                decimal = rawData.decimalPlace;
 
-            const { last, lasttime: lastTime } = props.quoteData;
-            const { min, max } = calcDataLine(datas, yestclose, last);
+            rawData.historyDatas.forEach((item, index) => {
+                const { c, ts } = item;
+                datas.push(c);
+                times.push(moment(ts).format('MM-DD HH:mm'));
+                if (!item.f) historyIndexs.push(index);
+            });
 
-            return {
+            rawData.runSteps.forEach((item) => {
+                const { start, end } = item;
+                const rangeTime = getRangeTime(start, end, 'HH:mm', 'm');
+                xAxisTimes.push(...rangeTime);
+            });
+
+            chartData.value = {
                 datas,
                 times,
+                xAxisTimes,
                 yestclose,
-                last,
-                lastTime,
                 decimal,
-                min,
-                max,
-                ma5: calcMA(rawData, 5),
+                ma5: calcMA(datas, 5, decimal),
+                ...calcDataLine(datas, yestclose),
             };
         };
 
         // 计算图表最高低指标线
-        const calcDataLine = (datas: number[], yestclose: number, last: number) => {
-            let max = Math.max(...datas, last); // 取历历史数据最高价
-            let min = Math.min(...datas, last); // 取历史数据最低价
-            const a = yestclose - min; // 计算收盘价和最低价的差值
-            const b = max - yestclose; // 计算收盘价和最高价的差值
+        const calcDataLine = (datas: number[], yestclose: number) => {
+            let max = Math.max(...datas); // 取历史行情最高价
+            let min = Math.min(...datas); // 取历史行情最低价
+
+            const last = datas[datas.length - 1], // 历史行情最后收盘价
+                a = yestclose - min, // 计算收盘价和最低价的差值
+                b = max - yestclose; // 计算收盘价和最高价的差值
 
             // 比较差值大小
             if (a > b) {
@@ -84,37 +95,28 @@ export default defineComponent({
         };
 
         // 计算平均线
-        const calcMA = (rawData: QueryTSDataRsp, count: number) => {
-            const datas = rawData.historyDatas!,
-                decimal = rawData.decimalPlace!;
-
+        const calcMA = (datas: number[], count: number, decimal: number) => {
             const result: string[] = [];
             if (datas.length >= count) {
-                // 所有非补充数据的索引id
-                const dataIndexs = datas.reduce((prev: number[], cur, index) => {
-                    if (!cur.f) prev.push(index);
-                    return prev;
-                }, []);
                 // 均线起始位置
-                const startIndex = dataIndexs[count - 1];
-
+                const startIndex = historyIndexs[count - 1];
                 datas.forEach((item, index) => {
                     if (index < startIndex) {
                         result.push('-');
                     } else {
-                        const j = dataIndexs.findIndex((val) => val === index);
+                        const j = historyIndexs.findIndex((val) => val === index);
                         // 判断是否补充数据
                         if (j === -1) {
                             // 取上个平均值
                             result.push(result[result.length - 1]);
                         } else {
                             // 向后取MA数
-                            const splitIndexs = dataIndexs.slice(j - (count - 1), j + 1);
+                            const maIndexs = historyIndexs.slice(j - (count - 1), j + 1);
                             // 计算总价
-                            const total = splitIndexs.reduce((sum, val) => sum + datas[val].c, 0);
+                            const total = maIndexs.reduce((sum, val) => sum + datas[val], 0);
                             // 计算均线
-                            const average = toDecimalFull(total / count, decimal);
-                            result.push(average);
+                            const ma = toDecimalFull(total / count, decimal);
+                            result.push(ma);
                         }
                     }
                 });
@@ -122,21 +124,49 @@ export default defineComponent({
             return result;
         };
 
+        // 更新图表K线数据
+        const updateChartData = () => {
+            const { datas, times } = chartData.value,
+                lastIndex = datas.length - 1, // 历史行情最后索引位置
+                lastTime = moment(times[times.length - 1]), // 历史行情最后时间
+                newTime = moment(props.quoteData.lasttime), // 实时行情最新时间
+                newPrice = props.quoteData.last; // 实时行情最新价
+
+            const cycleMilliseconds = 60 * 1000; // 周期毫秒数
+
+            const diffTime = newTime.valueOf() - lastTime.valueOf(); // 计算时间差
+            // 判断时间差是否大于周期时间
+            if (diffTime > cycleMilliseconds) {
+                lastTime.add(cycleMilliseconds, 'ms');
+                times.push(lastTime.format('MM-DD HH:mm')); // 添加历史行情时间
+                datas.push(newPrice); // 添加历史行情数据
+                historyIndexs.push(lastIndex + 1); // 添加历史行情索引
+            } else {
+                datas[lastIndex] = newPrice; // 更新历史行情数据
+            }
+
+            // 延迟图表更新,减少卡顿
+            debounce(() => {
+                const { min, max } = calcDataLine(datas, chartData.value.yestclose);
+                chartData.value.ma5 = calcMA(datas, 5, chartData.value.decimal);
+                chartData.value.min = min;
+                chartData.value.max = max;
+
+                updateOptions();
+            }, 1000);
+        };
+
         // 查询分时数据
         QueryTSData(props.quoteData.goodscode).then((res) => {
-            chartData.value = handleData(res);
+            handleData(res);
             initOptions();
         });
 
         watch(
             () => props.quoteData.last,
-            (val) => {
+            () => {
                 if (!loading.value) {
-                    const { min, max } = calcDataLine(chartData.value.datas, chartData.value.yestclose, val);
-                    chartData.value.last = val;
-                    chartData.value.min = min;
-                    chartData.value.max = max;
-                    updateOptions();
+                    updateChartData();
                 }
             }
         );

+ 26 - 17
src/common/components/echart/echart-timeline/setup.ts

@@ -23,10 +23,9 @@ type Colors = {
 // 图表数据
 export type ChartData = {
     datas: number[], // 历史数据
-    times: string[], // 历史日期
+    times: string[], // 历史时间
+    xAxisTimes: string[], // X轴时间数据
     yestclose: number, // 昨日收盘价
-    last: number, // 最新行情价
-    lastTime: string, // 最新行情时间
     decimal: number, // 保留小数位
     min: number, // Y轴最低指标线
     max: number, // Y轴最高指标线
@@ -41,9 +40,8 @@ export function handleEchart() {
     const chartData = ref<ChartData>({
         datas: [],
         times: [],
+        xAxisTimes: [],
         yestclose: 0,
-        last: 0,
-        lastTime: '',
         decimal: 0,
         min: 0,
         max: 0,
@@ -58,8 +56,9 @@ export function handleEchart() {
 
     // 初始化图表配置
     const initOptions = () => {
-        const { datas, times, yestclose, last, min, max, ma5, decimal } = chartData.value;
+        const { datas, times, yestclose, min, max, ma5, decimal, xAxisTimes } = chartData.value;
         const option: EChartsOption = {
+            animation: false,
             legend: {
                 //图例控件,点击图例控制哪些系列不显示
                 type: 'scroll',
@@ -83,13 +82,12 @@ export function handleEchart() {
                 textStyle: {
                     color: '#4d535c',
                 },
-                // eslint-disable-next-line
                 formatter: (params: any) => {
                     const i = params[0].dataIndex;
-                    const result = `
-    <div><span style="display: inline-block; width: 40px">当前价:</span><span style="display: inline-block; width: 100px; text-align: right">${datas[i]}</span></div>
-    <div><span style="display: inline-block; width: 40px">均价:</span><span style="display: inline-block; width: 100px; text-align: right">${ma5[i]}</span></div>
-    <div><span style="display: inline-block; width: 40px">涨幅:</span><span style="display: inline-block; width: 100px; text-align: right">${calcRatio(datas[i])}</span></div>`;
+                    let result = '<div class="tooltip-title">' + times[i] + '</div>';
+                    result += '<div class="tooltip-item"><span><i style="background-color:' + params[0].color + ';"></i>收盘</span><span>' + datas[i] + '</span></div>';
+                    result += '<div class="tooltip-item"><span><i style="background-color:' + params[2].color + ';"></i>均价</span><span>' + ma5[i] + '</span></div>';
+                    result += '<div class="tooltip-item"><span><i></i>涨幅</span><span>' + calcRatio(datas[i]) + '</span></div>';
                     return result;
                 },
             },
@@ -102,11 +100,16 @@ export function handleEchart() {
             xAxis: {
                 type: 'category',
                 // X轴时间线
-                data: times,
+                data: xAxisTimes,
                 splitLine: {
                     // 坐标分隔线
                     show: true,
                 },
+                axisLabel: {
+                    showMinLabel: true,
+                    showMaxLabel: true,
+                    interval: 50,
+                }
             },
             yAxis: [
                 // Y轴左侧标签
@@ -136,12 +139,12 @@ export function handleEchart() {
             // series 中不指定 yAxisId 或 yAxisIndex 默认关联 yAxis 第一个配置,xAxis 配置同理
             series: [
                 {
-                    name: '当前价',
+                    name: '分时',
                     type: 'line',
                     yAxisId: 'leftPrice',
                     data: chartData.value.datas,
                     smooth: true,
-                    symbol: 'circle', //中时有小圆点
+                    symbol: 'none', //中时有小圆点
                     lineStyle: {
                         opacity: 0.8,
                         width: 1,
@@ -153,7 +156,7 @@ export function handleEchart() {
                         data: [
                             {
                                 // 最新价
-                                yAxis: last,
+                                yAxis: datas[datas.length - 1],
                             },
                             {
                                 // 昨结价
@@ -196,7 +199,7 @@ export function handleEchart() {
 
     // 动态更新数据
     const updateOptions = () => {
-        const { datas, last, yestclose, min, max } = chartData.value;
+        const { datas, yestclose, ma5, min, max } = chartData.value;
         if (datas.length) {
             options.value = {
                 yAxis: [
@@ -215,11 +218,13 @@ export function handleEchart() {
                 ],
                 series: [
                     {
+                        name: '分时',
+                        data: datas,
                         markLine: {
                             data: [
                                 {
                                     // 最新价
-                                    yAxis: last,
+                                    yAxis: datas[datas.length - 1],
                                 },
                                 {
                                     // 昨结价
@@ -234,6 +239,10 @@ export function handleEchart() {
                             ],
                         },
                     },
+                    {
+                        name: '均价',
+                        data: ma5,
+                    },
                 ],
             };
         }

+ 4 - 3
src/common/components/permanceTemp/addPermanceTemp.vue

@@ -162,6 +162,7 @@ const useEditeTemp = (typeList: Ref<QueryWrPerformanceStepTypeRsp[]>) => {
     function stepTypeChange(item: PermanceTemp) {
         const stepType = findTemp(item)!;
         item.steptypename = stepType.steptypename;
+        item.stepvalue = null;
         // 卖方收款汇总值必须为100%;
         // if (!isSummary(item)) {
         //     item.stepvalue = 100;
@@ -287,15 +288,15 @@ export default defineComponent({
                     message.error('未配置仓单转移步骤');
                     return;
                 }
-                const performancesteps: PerfomanceStempTempInfo[] = res.domains.map((el) => {
-                    const { steptypeid, stepvalue, stepdays, isauto, remark, stepindex } = el;
+                const performancesteps: PerfomanceStempTempInfo[] = res.domains.map((el, i) => {
+                    const { steptypeid, stepvalue, stepdays, isauto, remark } = el;
                     return {
                         steptypeid: steptypeid as number,
                         stepvalue: stepvalue as number,
                         stepdays: stepdays as number,
                         isauto,
                         remark,
-                        stepindex,
+                        stepindex: i + 1,
                     };
                 });
                 const param: AddPerformanceTemp = {

+ 30 - 2
src/common/constants/enumsName.ts

@@ -1008,7 +1008,7 @@ export function getInterestSettleModeName(type: number) {
 }
 
 //    interestratemode: number;//利率方式 - 1:年利率 2:日利率 3:日固定值
-export function getInterestrateModeName(mode: number, value: number) {
+export function getInterestrateModeName(mode: number, value: number, enumdicname: string) {
     let result = "--"
     switch (mode) {  // 1:年利率
         case 1:
@@ -1018,7 +1018,7 @@ export function getInterestrateModeName(mode: number, value: number) {
             result = (value * 10000).toFixed(2).toString() + '‱'
             break
         case 3: // 日固定值
-            result = value.toFixed(2).toString()
+            result = value.toFixed(2).toString() + enumdicname
             break;
     }
     return result
@@ -1309,4 +1309,32 @@ export function getBarmaginApplyStatus(status: number) {
             break
     }
     return result
+}
+
+export function getTaacountStatus(status: number) {
+    let result = '--'
+    switch (status) {
+        case 1:
+            result = '正常'
+            break
+        case 2:
+            result = '受限'
+            break
+        case 3:
+            result = '冻结'
+            break
+        case 4:
+            result = '禁止建仓'
+            break
+        case 5:
+            result = '禁止交易'
+            break
+        case 6:
+            result = '待激活'
+            break
+        case 7:
+            result = '已注销'
+            break
+    }
+    return result
 }

+ 2 - 1
src/services/bus/goods.ts

@@ -32,7 +32,8 @@ export function getQutoGoodsByTradeMode(trademode: TradeMode) {
         const marketInfo = getMarketByTradeMode(trademode)
         if (marketInfo) {
             // 过滤商品信息
-            const goodsList = getGoodsList().filter(e => e.marketid === marketInfo.marketid)
+            // goodsstatus: number;//商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
+            const goodsList = getGoodsList().filter(e => (e.goodsstatus === 3 && e.marketid === marketInfo.marketid))
             goodsList.forEach(el => {
                 // 找到行情数据
                 const quote = getQuoteDayInfoByCode(el.goodscode);

+ 30 - 0
src/services/bus/holdPosition.ts

@@ -0,0 +1,30 @@
+import { QueryTradePositionRsp } from "../go/ermcp/order/interface";
+import { getQuoteDayInfoByCodeFindPrice } from "./goods";
+
+
+// 持仓盈亏
+// 浮动盈亏	持仓单:
+// 收益权=(最新价-持仓价)*持仓数量*合约单位*方向(买[1]:卖[-1])(*汇率)
+// 所有权=(最新价*持仓数量*合约单位(*汇率) - 持仓金额)
+export const useProfitloss = (record: QueryTradePositionRsp) => {
+    // 最新价
+    const lastPrice = getQuoteDayInfoByCodeFindPrice(record.goodscode);
+    if (lastPrice !== '--') {
+        const { averageprice, decimalplace, agreeunit, curpositionqty } = record;
+        return ((+lastPrice - averageprice) * curpositionqty * agreeunit).toFixed(decimalplace);
+    } else {
+        return lastPrice;
+    }
+}
+
+// 持仓金额(市值(所有权)) = 数量 * 现价 * 合约单位
+export const useHolderprice = (record: QueryTradePositionRsp) => {
+    // 最新价
+    const lastPrice = getQuoteDayInfoByCodeFindPrice(record.goodscode);
+    if (lastPrice !== '--') {
+        const { decimalplace, agreeunit, curpositionqty } = record;
+        return (+lastPrice * curpositionqty * agreeunit).toFixed(decimalplace);
+    } else {
+        return lastPrice
+    }
+}

+ 2 - 2
src/services/go/ermcp/order/index.ts

@@ -1,6 +1,6 @@
 
 /** ================================= 通用单据相关接口 ================================**/
-import { getSelectedAccountId } from "@/services/bus/account";
+import { getAccoutIdList, getSelectedAccountId } from "@/services/bus/account";
 import { commonSearch_go } from "@/services/go";
 import {
     QueryHisTradeDetailReq,
@@ -70,7 +70,7 @@ export function queryTradeOrderDetail(req: QueryTradeOrderDetailReq): Promise<Qu
  * @param //  交易模式 - 格式:1,2,3
  */
 export function queryTradePosition(radeMode?: string): Promise<QueryTradePositionRsp[]> {
-    const accountID = getSelectedAccountId()?.toString()
+    const accountID = getAccoutIdList()
     const param = radeMode ? { accountID, radeMode } : { accountID }
     return commonSearch_go('/Order/QueryTradePosition', param).catch((err) => {
         throw new Error(`仓汇总查询(合约市场): ${err}`);

+ 10 - 10
src/services/go/quote/interface.ts

@@ -67,16 +67,16 @@ export interface historyDatas {
     tv: number;
 }
 export interface QueryTSDataRsp {
-    Count?: number;
-    decimalPlace?: number;
-    endTime?: string;
-    goodsCode?: string;
-    outGoodsCode?: string;
-    preSettle?: number;
-    startTime?: string;
-    tradeDate?: string;
-    historyDatas?: historyDatas[];
-    RunSteps?: RunSteps[];
+    Count: number;
+    decimalPlace: number;
+    endTime: string;
+    goodsCode: string;
+    outGoodsCode: string;
+    preSettle: number;
+    startTime: string;
+    tradeDate: string;
+    historyDatas: historyDatas[];
+    runSteps: RunSteps[];
 }
 
 export interface RunSteps {

+ 26 - 3
src/services/go/wrtrade/interface.ts

@@ -93,33 +93,55 @@ export interface QueryWrOrderDetailReq {
  * 查询仓单委托单(挂单)返回
  */
 export interface WrOrderDetail {
+    accountid: number;//交易账号(资金账号)
+    allfriendsflag: number;//是否全好友可见 - number;
+    //:否 1:是
+    amount: number;//挂牌金额 = 委托数量  固定价或升贴水
     buyorsell: number;//买卖 - number;
     //:买 1:卖(挂牌类型 买为采购 卖为销售)
+    canbargain: number;//是否可议价 - number;
+    //:不可 1:可
     cancelqty: number;//撤销数量
+    canpart: number;//是否允许部份摘牌 - number;
+    //:不允许(要求整单) 1:允许(可以不整单)
+    delistminqty: number;//起摘数量
     deliverygoodscode: string;//品种代码
     deliverygoodsid: number;//品种ID
     deliverygoodsname: string;//品种名称
     deliverymonth: string;//交收月
     enumdicname: string;//单位名称
     fixedprice: number;//固定价格 - [挂牌]
+    freezemargin: number;//冻结保证金(保证金)
     futupricemove: number;//期货升贴水
     futushow: string;//期货合约/升贴水
     goodscode: string;//期货合约
     goodsid: number;//期货商品id
+    goodsname: string;//商品名称
     haswr: number;//是否有仓单-卖方 - number;
     //:无仓单 1:有仓单
+    isspecified: number;//是否指定对手 - number;
+    //:不指定 1:指定 - [挂牌]
+    ladingbillid: string;//提单ID(2number;
+    //8+Unix秒时间戳(1number;
+    //位)+xxxxxx)
+    marginvalue: number;//保证金设置值(履约保证金)
     marketid: number;//市场ID
+    matchusername: string;//对手方名称(当ISSPECIFIED=1时,有值,指定朋友的名称)
+    minivalue: number;//现货商品最小变动值
     optioncompare: string;//选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
     orderqty: number;//委托数量
     ordertime: string;//委托时间(挂牌时间)
+    performancetemplateid: number;//履约模板id
     pricemove: number;//升贴水(浮动价时填写) - [挂牌]
+    taname: string;//交易用户名称(资金账号名称)
     tradedate: string;//交易日(yyyyMMdd)
     tradeprice: number;//成交价格 - [摘牌] (浮动价 ((商品1价格商品1价格系数+升贴水) 商品1重量系数 + 商品2价格商品2价格系数+商品2升贴水) 商品2重量系数 …) 委托单价格系数 + 委托单升贴水)
     tradeqty: number;//成交数量
     userid: number;//用户ID
+    validtime: string;//挂牌有效期
     warehouseid: number;//仓库ID
     warehousename: string;//仓库名称
-    wrfactortypeid: number;//仓单要素类型ID(212+Unix秒时间戳(1number;
+    wrfactortypeid: string;//仓单要素类型ID(212+Unix秒时间戳(1number;
     //位)+xxxxxx)
     wrfactortypename: string;//仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
     wrpricetype: number;//价格方式 - 1:固定价 2-浮动价 - [挂牌]
@@ -129,8 +151,9 @@ export interface WrOrderDetail {
     wrtradeorderid: string;//仓单贸易委托单ID(32number;
     //+Unix秒时间戳(1number;
     //位)+xxxxxx)
-    wrtradeorderstatus: number;//委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
-    //:挂牌部分成交 11:仓单生成失败 12:首付扣款失败 13:履约失败 14:撤单解冻贷款失败 15:部成部撤
+    wrtradeorderstatus: number;//委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:部成 8:已成 9:部成部撤 1number;
+    //:成交失败 11:委托拒绝 12:经过摘牌(先摘后挂专用) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用) 17:冻结PD成功 18:冻结PD失败 19:冻结能量成功 2number;
+    //:冻结能量失败 21:预约已报价 22:过期未付 23:优惠券处理中 24:仓单生成失败 25:首付扣款失败 26:履约失败 27:撤单解冻贷款失败
     wrtradetype: number;//仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
     wrtypename: string;//商品
 }

+ 13 - 1
src/services/socket/quota/adapter/index.ts

@@ -9,6 +9,7 @@ import { Package40 } from '@/utils/websocket/package';
 import Long from 'long';
 import { SubscribeInfoType } from '../interface';
 import { byteArrayToUInt, subscribeInfosToByteArrary } from './byteUtils';
+import moment from 'moment';
 
 /**
  * 构建行情订阅请求包
@@ -43,10 +44,13 @@ export function parseSubscribeRsp(rspPackage: any): Promise<string | SubscribeIn
         switch (count) {
             case -1:
                 reject('订阅失败');
+                break;
             case -2:
                 reject('Token校验失败');
+                break;
             case -3:
                 reject('无对应商品信息');
+                break;
             default:
                 break;
         }
@@ -161,6 +165,8 @@ export function parseReceivePush(quotationData: any) {
                 goodsQuoteTik.preclose = goodsQuoteTik.preclose ? (fn(goodsQuoteTik.preclose)) : '--'
                 goodsQuoteTik.settle = goodsQuoteTik.settle ? (fn(goodsQuoteTik.settle)) : '--'
                 goodsQuoteTik.strikeprice = goodsQuoteTik.strikeprice ? (fn(goodsQuoteTik.strikeprice)) : '--'
+                
+                goodsQuoteTik.lasttime = moment(goodsQuoteTik.date + goodsQuoteTik.time, 'YYYYMMDDHHmmss').format('YYYY-MM-DD HH:mm:ss')
 
                 // !goodsQuoteTik.bidvolume && (goodsQuoteTik.bidvolume = '--')
                 // !goodsQuoteTik.askvolume && (goodsQuoteTik.askvolume = '--')
@@ -175,7 +181,13 @@ export function parseReceivePush(quotationData: any) {
 
             // 注意:此处已 go 服务查询出来的盘面数据为基准,查询盘面 先修改成go 服务,第一次进入项目时候回查询一次所有盘面
             // 之前是 通过 websocket 查询的,故 可能存在字段发生变化问题,如遇到,则进行优化处理
-            mergeObj(itemQuote, goodsQuoteTik);
+            
+            // 判断是一下行情时间是否比现在的要早
+            const quoteTime = moment(goodsQuoteTik.lasttime, 'YYYY-MM-DD HH:mm:ss')
+            const localTime = moment(itemQuote.lasttime, 'YYYY-MM-DD HH:mm:ss')
+            if (quoteTime >= localTime) {
+                mergeObj(itemQuote, goodsQuoteTik);
+            }
         } else {
             // 此处 待优化(存在字段变化问题)
             quoteDayInfo.push(itemQuote);

+ 2 - 2
src/views/market/spot_trade/spot_trade_order_transaction/components/stock-exchange/index.vue

@@ -46,8 +46,8 @@ import { formatTime } from '@/common/methods';
 
 const columnsList = [
     { title: '时间', key: 'TS', dataIndex: 'TS', align: 'center' },
-    { title: '成交价', key: 'Vol', dataIndex: 'Vol', align: 'center' },
-    { title: '成交量', key: 'PE', dataIndex: 'PE', align: 'center' },
+    { title: '成交价', key: 'PE', dataIndex: 'PE', align: 'center' },
+    { title: '成交量', key: 'Vol', dataIndex: 'Vol', align: 'center' },
 ];
 
 export default defineComponent({

+ 63 - 60
src/views/market/spot_trade/spot_trade_reference_market/components/container/index.vue

@@ -1,68 +1,71 @@
 <template>
-    <!-- 买卖大厅 -->
-    <div class="buy-sell-market">
-        <div class="buy-sell-market-title">
-            <a class="backIcon" @click="cancelAction">
-                <LeftOutlined />
-            </a>
-            <div class="titleBtn">
-                <div class="name">{{ selectedRow.goodscode }} {{ selectedRow.goodsname }}</div>
-                <div class="arrowRightIcon"></div>
+  <!-- 买卖大厅 -->
+  <div class="buy-sell-market">
+    <div class="buy-sell-market-title">
+      <a class="backIcon"
+         @click="cancelAction">
+        <LeftOutlined />
+      </a>
+      <div class="titleBtn">
+        <div class="name">{{ selectedRow.goodscode }} {{ selectedRow.goodsname }}</div>
+        <div class="arrowRightIcon"></div>
+      </div>
+      <div class="inlineBar">
+        <div class="valNums bdf1 ml10">
+          <!-- 最新价 -->
+          <div class="firstNum start"
+               :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
+            {{ selectedRow.last }}</div>
+          <div class="lastNum start">
+            <!-- 涨跌值 -->
+            <div :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
+              {{ quoteChange(selectedRow, selectedRow.decimalplace) }}</div>
+            <!-- 涨跌幅 -->
+            <div class="ml20"
+                 :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
+              {{ quoteAmplituOfVibration(selectedRow, selectedRow.decimalplace) }}</div>
+          </div>
+        </div>
+        <div class="priceBar ml20">
+          <div class="inlineBar start">
+            <div class="greenBar green">
+              <div class="numBlock ml15">
+                <div class="first">卖价</div>
+                <div class="last"
+                     :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)">
+                  {{ selectedRow.ask }}</div>
+              </div>
+              <div class="numBlock">
+                <div class="first">卖量</div>
+                <div class="last">{{ selectedRow.askvolume }}</div>
+              </div>
             </div>
-            <div class="inlineBar">
-                <div class="valNums bdf1 ml10">
-                    <!-- 最新价 -->
-                    <div class="firstNum start" :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"> {{ selectedRow.last }}</div>
-                    <div class="lastNum start">
-                        <!-- 涨跌值 -->
-                        <div :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"> {{ quoteChange(selectedRow, selectedRow.decimalplace) }}</div>
-                        <!-- 涨跌幅 -->
-                        <div class="ml20" :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"> {{ quoteAmplituOfVibration(selectedRow, selectedRow.decimalplace) }}</div>
-                    </div>
-                </div>
-                <div class="priceBar ml20">
-                    <div class="inlineBar start">
-                        <div class="greenBar green">
-                            <div class="numBlock ml15">
-                                <div class="first">卖价</div>
-                                <div class="last" :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)"> {{ selectedRow.ask }}</div>
-                            </div>
-                            <div class="numBlock">
-                                <div class="first">卖量</div>
-                                <div class="last">{{ selectedRow.askvolume }}</div>
-                            </div>
-                        </div>
-                        <div class="greenBar green">
-                            <div class="numBlock ml15">
-                                <div class="first">卖价</div>
-                                <div class="last">{{ selectedRow.sellprice }}</div>
-                            </div>
-                            <div class="numBlock">
-                                <div class="first">卖量</div>
-                                <div class="last">{{ selectedRow.sellqty }}</div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="inlineBar start">
-                        <div class="redBar red1">
-                            <div class="numBlock">
-                                <div class="first">买价</div>
-                                <div class="last" :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)"> {{ selectedRow.bid }}</div>
-                            </div>
-                            <div class="numBlock">
-                                <div class="first">买量</div>
-                                <div class="last">{{ selectedRow.bidvolume }}</div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
+          </div>
+          <div class="inlineBar start">
+            <div class="redBar red1">
+              <div class="numBlock">
+                <div class="first">买价</div>
+                <div class="last"
+                     :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)">
+                  {{ selectedRow.bid }}</div>
+              </div>
+              <div class="numBlock">
+                <div class="first">买量</div>
+                <div class="last">{{ selectedRow.bidvolume }}</div>
+              </div>
             </div>
+          </div>
         </div>
-        <!-- 交易图表 -->
-        <Chart v-if="showComponentsId === ComponentType.chart" @update="changeComponent" :selectedRow="selectedRow" />
-        <!-- 成交明细 -->
-        <StockExchange :selectedRow="selectedRow" v-if="showComponentsId === ComponentType.tradeDetail" />
+      </div>
     </div>
+    <!-- 交易图表 -->
+    <Chart v-if="showComponentsId === ComponentType.chart"
+           @update="changeComponent"
+           :selectedRow="selectedRow" />
+    <!-- 成交明细 -->
+    <StockExchange :selectedRow="selectedRow"
+                   v-if="showComponentsId === ComponentType.tradeDetail" />
+  </div>
 </template>
 
 <script lang="ts">

+ 1 - 1
src/views/market/spot_trade/spot_trade_reference_market/index.vue

@@ -20,7 +20,7 @@
       </template>
       <!-- 幅度 -->
       <template #amplitude="{ record }">
-        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+        <span>{{quoteAmplitude(record, record.decimalplace)}}</span>
       </template>
       <!-- 振幅 -->
       <template #vibration="{ record }">

+ 10 - 15
src/views/order/commodity_contract/components/commodity_contract_bargain/index.vue

@@ -56,29 +56,24 @@
 </template>
 
 <script lang="ts">
-import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
-import { queryTableList, BtnList, defineAsyncComponent, defineComponent, ModalEnum } from '@/common/export/commonTable';
+import { BtnListType } from '@/common/components/btnList/interface';
+import { ApplyType } from '@/common/constants/enumCommon';
+import { getBuyOrSellName, getScfContractStatusName } from '@/common/constants/enumsName';
+import { BtnList, defineAsyncComponent, defineComponent, queryTableList } from '@/common/export/commonTable';
+import { formatTime } from '@/common/methods';
+import { handleDeliveryRelation } from '@/common/setup/deliveryRelation';
 import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
-import { formatTime } from '@/common/methods';
-import { expandIcon } from '@/common/setup/table/clolumn';
-import { queryTradePosition } from '@/services/go/ermcp/order';
+import { getAccoutIdList } from '@/services/bus/account';
 import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
-import { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
-import { findGoodsTradeModeById, getQuoteDayInfoByCode } from '@/services/bus/goods';
-import { handleDeliveryRelation } from '@/common/setup/deliveryRelation';
-import { TradeMode } from '@/common/constants/enumCommon';
-import { BtnListType } from '@/common/components/btnList/interface';
-import { columns } from './setup';
 import { queryTjmdTransferApply } from '@/services/go/Tjmd';
 import { QueryTjmdTransferApplyReq, QueryTjmdTransferApplyRsp } from '@/services/go/Tjmd/interface';
 import Bus from '@/utils/eventBus/index';
-import { ref } from 'vue';
-import { ApplyType } from '@/common/constants/enumCommon';
-import { getBuyOrSellName, getScfContractStatusName } from '@/common/constants/enumsName';
-import { getAccoutIdList } from '@/services/bus/account';
 import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
+import { ref } from 'vue';
+import { columns } from './setup';
 
 export default defineComponent({
     name: 'commodity_contract_bargain',

+ 74 - 0
src/views/order/commodity_contract/components/commodity_contract_commission/components/cancel/index.vue

@@ -0,0 +1,74 @@
+<template>
+  <!-- 现货仓单 现货明细 撤单 -->
+  <div></div>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, ref } from 'vue';
+import Drawer from '@/common/components/drawer/index.vue';
+import { WrOrderDetail } from '@/services/go/wrtrade/interface';
+import { getInTaAccount, getUserId } from '@/services/bus/account';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { wRListingCancelOrder } from '@/services/proto/warehousetrade';
+import { v4 as uuidv4 } from 'uuid';
+import moment from 'moment';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { WRListingCancelOrderReq } from '@/services/proto/warehousetrade/interface';
+import * as Long from 'long';
+import { geLoginID_number } from '@/services/bus/login';
+import { Modal } from 'ant-design-vue';
+import Bus from '@/utils/eventBus/index';
+import { cancelOrderReq } from '@/services/socket/order';
+import { QueryTradeOrderDetailRsp } from '@/services/go/ermcp/order/interface';
+
+export default defineComponent({
+    name: ModalEnum.spot_warrant_pending_order_cancel_order,
+    components: { Drawer },
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryTradeOrderDetailRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const loading = ref<boolean>(false);
+
+        function submit() {
+            const param = {
+                ClientSerialNo: uuidv4(), // string 客户端流水号
+                ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+                ClientType: 4, // uint32 终端类型
+                OperateType: 5, // 操作类型
+                OldOrderId: props.selectedRow.orderid,
+                AccountID: getInTaAccount(), // uint64 资金账号
+                OrderSrc: 1, // uint32 委托来源
+                OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
+                MarketID: props.selectedRow.marketid,
+                GoodsID: props.selectedRow.goodsid,
+            };
+            requestResultLoadingAndInfo(cancelOrderReq, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+                Bus.$emit('spotTrade', true);
+                cancel(true);
+            });
+        }
+
+        Modal.confirm({
+            title: '撤单',
+            content: '是否确认撤单?',
+            onOk: submit,
+            onCancel: cancel,
+        });
+
+        return {
+            visible,
+            cancel,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+</style>;

+ 15 - 3
src/views/order/commodity_contract/components/commodity_contract_commission/index.vue

@@ -15,7 +15,7 @@
       <!-- 额外的展开行 -->
       <template v-if="btnList.length"
                 #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
+        <BtnList :btnList="filterBtnList(btnList, record)"
                  :record="record"
                  class="btn-list-sticky"
                  @click="openComponent" />
@@ -29,8 +29,8 @@
         <a>{{ getOrderStatusName(record.orderstatus) }}</a>
       </template>
 
-      <template #createtime="{ record }">
-        <a>{{ formatTime(record.createtime) }}</a>
+      <template #ordertime="{ text }">
+        <a>{{ formatTime(text) }}</a>
       </template>
     </a-table>
     <component :is="componentId"
@@ -57,11 +57,13 @@ import Bus from '@/utils/eventBus/index';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { queryTradeOrderDetail } from '@/services/go/ermcp/order';
 import { QueryTradeOrderDetailRsp } from '@/services/go/ermcp/order/interface';
+import { BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
     name: enumOrderComponents.commodity_contract_commission,
     components: {
         BtnList,
+        commodity_contract_commission_cancel_order: defineAsyncComponent(() => import('./components/cancel/index.vue')),
     },
     setup() {
         // 表格列表数据
@@ -76,6 +78,15 @@ export default defineComponent({
             tableName: 'table_pcweb_spot_trade_bottom_commodity_contract_commission',
             recordList: getRecordItemTab(),
         };
+        function filterBtnList(list: BtnListType[], record: QueryTradeOrderDetailRsp) {
+            //委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
+            const arr = [3, 7];
+            if (!arr.includes(record.orderstatus)) {
+                return list.filter((e) => e.code !== 'commodity_contract_commission_cancel_order');
+            } else {
+                return list;
+            }
+        }
         return {
             ...handleComposeOrderTable<WrPerformancePlan>(param),
             loading,
@@ -84,6 +95,7 @@ export default defineComponent({
             expandIcon,
             getBuyOrSellTypeName,
             getOrderStatusName,
+            filterBtnList,
         };
     },
 });

+ 16 - 43
src/views/order/commodity_contract/components/commodity_contract_summary/index.vue

@@ -29,11 +29,11 @@
       </template>
       <!-- 持仓金额  -->
       <template #holderprice="{ record }">
-        <a>{{ getHolderprice(record) }}</a>
+        <a>{{ useHolderprice(record) }}</a>
       </template>
       <!-- 持仓盈亏 -->
       <template #profitloss="{ record }">
-        <a>{{ getProfitloss(record) }}</a>
+        <a>{{ useProfitloss(record) }}</a>
       </template>
     </a-table>
     <component :is="componentId"
@@ -45,20 +45,21 @@
 </template>
 
 <script lang="ts">
+import { BtnListType } from '@/common/components/btnList/interface';
+import { TradeMode } from '@/common/constants/enumCommon';
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
-import { queryTableList, BtnList, defineAsyncComponent, defineComponent, ModalEnum } from '@/common/export/commonTable';
+import { BtnList, defineAsyncComponent, defineComponent, ModalEnum, queryTableList } from '@/common/export/commonTable';
+import { formatTime } from '@/common/methods';
+import { handleDeliveryRelation } from '@/common/setup/deliveryRelation';
 import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
-import { formatTime } from '@/common/methods';
-import { expandIcon } from '@/common/setup/table/clolumn';
+import { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
+import { findGoodsTradeModeById, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { useHolderprice, useProfitloss } from '@/services/bus/holdPosition';
 import { queryTradePosition } from '@/services/go/ermcp/order';
 import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
-import { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
-import { findGoodsTradeModeById, getQuoteDayInfoByCode } from '@/services/bus/goods';
-import { handleDeliveryRelation } from '@/common/setup/deliveryRelation';
-import { TradeMode } from '@/common/constants/enumCommon';
-import { BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
     name: enumOrderComponents.commodity_contract_summary,
@@ -92,38 +93,10 @@ export default defineComponent({
         };
         // 现价
         function getLastprice({ goodscode, decimalplace }: QueryTradePositionRsp) {
-            const item = getQuoteDayInfoByCode(goodscode);
-            let result = '';
-            if (item) {
-                const { last, presettle } = item;
-                if (last && ((last as unknown) as string) !== '--') {
-                    result = last.toFixed(decimalplace); // 最新
-                } else if (presettle) {
-                    result = presettle.toFixed(decimalplace); // 昨结
-                }
-            }
-            return result;
-        }
-        // 持仓金额 = 数量 * 现价 * 合约单位
-        function getHolderprice(record: QueryTradePositionRsp) {
-            const price = getLastprice(record);
-            if (price !== '--') {
-                const { decimalplace, agreeunit, curpositionqty } = record;
-                return (+price * curpositionqty * agreeunit).toFixed(decimalplace);
-            } else {
-                return price;
-            }
-        }
-        /// 持仓盈亏 买方向 = (最新价 - 持仓均价) * 买期末头寸 * 合约单位;卖方向 = (持仓均价 - 最新价) * 卖期末头寸 * 合约单位
-        function getProfitloss(record: QueryTradePositionRsp) {
-            const price = getLastprice(record);
-            if (price !== '--') {
-                const { averageprice, decimalplace, agreeunit, curpositionqty } = record;
-                return ((+price - averageprice) * curpositionqty * agreeunit).toFixed(decimalplace);
-            } else {
-                return price;
-            }
+            const lastPrice = getQuoteDayInfoByCodeFindPrice(goodscode);
+            return lastPrice === '--' ? lastPrice : Number(lastPrice).toFixed(decimalplace);
         }
+
         function handleBtnList(record: QueryTradePositionRsp, btnList: BtnListType[]) {
             if (findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi) {
                 return btnList.filter((e) => e.code === 'commodity_contract_summary_deal_closed');
@@ -138,8 +111,8 @@ export default defineComponent({
             formatTime,
             expandIcon,
             getLastprice,
-            getHolderprice,
-            getProfitloss,
+            useHolderprice,
+            useProfitloss,
             handleBtnList,
         };
     },

+ 21 - 3
src/views/order/financing_manager/components/financing_manager_apply_order/index.vue

@@ -10,7 +10,7 @@
              :customRow="Rowclick"
              :expandIcon="expandIcon"
              :expandIconAsCell="false"
-             rowKey="key"
+             rowKey="financeapplyid"
              :data-source="tableList">
       <!-- 额外的展开行 -->
       <template v-if="btnList.length"
@@ -39,7 +39,7 @@
       </template>
       <!-- 费用 -->
       <template #interestsettlevalue="{ record }">
-        <a>{{ getInterestrateModeName(record.interestratemode, record.interestrate) }}</a>
+        <a>{{ getInterestrateModeName(record.interestratemode, record.interestrate, record.enumdicname) }}</a>
       </template>
     </a-table>
     <component :is="componentId"
@@ -72,9 +72,27 @@ export default defineComponent({
     setup() {
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrFinanceBuyApply>();
+        function sortTime<T extends object>(arr: T[], key: keyof T, isUp = true) {
+            const result = arr.sort((a, b) => {
+                const time1 = new Date((a[key] as unknown) as string).getTime();
+                const time2 = new Date((b[key] as unknown) as string).getTime();
+                return isUp ? time1 - time2 : time2 - time1;
+            });
+            return result;
+        }
         // 获取列表数据
         const queryTableAction = () => {
-            queryTable(queryWrFinanceBuyApply);
+            queryTable(queryWrFinanceBuyApply).then((res) => {
+                const arr = res.map((e) => {
+                    return { ...e, key: e.financeapplyid };
+                });
+                const waiting = arr.filter((e) => e.applystatus === 1);
+                const other = arr.filter((e) => e.applystatus !== 1);
+                // 时间 倒序排序
+                const sortWaiting = sortTime<WrFinanceBuyApply>(waiting, 'applydate', false);
+                const sortOther = sortTime<WrFinanceBuyApply>(other, 'applydate', false);
+                tableList.value = [...sortWaiting, ...sortOther];
+            });
         };
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {

+ 42 - 12
src/views/order/funding_information/components/funding_information_funding_summary/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 资金汇总 -->
   <section>
-    <a-table :columns="columns"
+    <a-table :columns="tableColumns"
              class="srcollYTable expandLeftTable"
              :scroll="{ x: '100%', y: '190px' }"
              :pagination="false"
@@ -21,11 +21,26 @@
                  @click="openComponent" />
       </template>
       <template #balance="{record}">
-        <span>{{getCanUseMoney(record)}}</span>
+        <span>{{canUseMoney(record)}}</span>
       </template>
       <template #freezemargin="{record}">
         <span>{{getFreeze(record, true)}}</span>
       </template>
+      <!-- 浮动盈亏 -->
+      <template #closepl="{record}">
+        <span>{{handleProfitloss(record)}}</span>
+      </template>
+      <!-- 风险率 -->
+      <template #accountname="{record}">
+        <span>{{hazardRates(record)}}</span>
+      </template>
+      <!-- 净值 -->
+      <template #currentbalance="{record}">
+        <span>{{netWorth(record)}}</span>
+      </template>
+      <template #tradestatus="{text}">
+        <span>{{getTaacountStatus(text)}}</span>
+      </template>
     </a-table>
     <component :is="componentId"
                v-if="componentId"
@@ -36,19 +51,21 @@
 
 <script lang="ts">
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
-import { queryTableList, BtnList, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
-import { QueryPerformancePlan, queryWrTradeDetail } from '@/services/go/wrtrade';
-import { QueryPerformancePlanReq, WrPerformancePlan } from '@/services/go/wrtrade/interface';
+import { getTaacountStatus } from '@/common/constants/enumsName';
+import { BtnList, defineComponent, queryTableList } from '@/common/export/commonTable';
 import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
-import { getTaAccounts, queryAmountLog } from '@/services/go/TaAccount';
-import { GetTaAccountsReq, QueryAmountLogReq } from '@/services/go/TaAccount/interface';
-import { getSelectedAccountId, getCanUseMoney, getFreeze } from '@/services/bus/account';
+import { getCanUseMoney, getFreeze } from '@/services/bus/account';
 import { geLoginID_number } from '@/services/bus/login';
-import * as Long from 'long';
+import { queryTradePosition } from '@/services/go/ermcp/order';
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
+import { getTaAccounts } from '@/services/go/TaAccount';
+import { GetTaAccountsReq, Taaccount } from '@/services/go/TaAccount/interface';
 import Bus from '@/utils/eventBus/index';
-import { expandIcon } from '@/common/setup/table/clolumn';
+import { ref } from 'vue';
+import { tableColumns, useHazardRates } from './setup';
 
 export default defineComponent({
     name: enumOrderComponents.funding_information_funding_summary,
@@ -57,14 +74,21 @@ export default defineComponent({
     },
     setup() {
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrPerformancePlan>();
+        const { loading, tableList, queryTable } = queryTableList<Taaccount>();
+        // 持仓汇总
+        const holdsList = ref<QueryTradePositionRsp[]>([]);
         // 获取列表数据
         const queryTableAction = () => {
             const param: GetTaAccountsReq = {
                 loginID: Number(geLoginID_number()),
             };
             queryTable(getTaAccounts, param);
+            // 获取头寸
+            queryTradePosition().then((res) => {
+                holdsList.value = res;
+            });
         };
+        const { handleProfitloss, hazardRates, netWorth, canUseMoney } = useHazardRates(holdsList);
         // 资金变化,重新加载数据
         Bus.$on('moneyChangedNtf_UI', () => {
             queryTableAction();
@@ -76,12 +100,18 @@ export default defineComponent({
             recordList: getRecordItemTab(),
         };
         return {
-            ...handleComposeOrderTable<WrPerformancePlan>(param),
+            ...handleComposeOrderTable<Taaccount>(param),
             loading,
             tableList,
             getCanUseMoney,
             getFreeze,
             expandIcon,
+            handleProfitloss,
+            hazardRates,
+            tableColumns,
+            getTaacountStatus,
+            netWorth,
+            canUseMoney,
         };
     },
 });

+ 200 - 0
src/views/order/funding_information/components/funding_information_funding_summary/setup.ts

@@ -0,0 +1,200 @@
+import APP from '@/services';
+import { useHolderprice, useProfitloss } from '@/services/bus/holdPosition';
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
+import { Taaccount } from '@/services/go/TaAccount/interface';
+import { Systemparam } from '@/services/go/useInfo/interface';
+import { Ref } from 'vue';
+
+export const tableColumns = [
+    {
+        key: '0th',
+        dataIndex: 'accountid',
+        title: '资金账号',
+        align: 'center',
+        slots: {
+            customRender: 'accountid',
+        },
+        width: 120,
+    },
+    {
+        key: '1th',
+        dataIndex: 'currentbalance',
+        title: '净值',
+        align: 'center',
+        slots: {
+            customRender: 'currentbalance',
+        },
+        width: 120,
+    },
+    {
+        key: '2th',
+        dataIndex: 'balance',
+        title: '可用资金',
+        align: 'center',
+        slots: {
+            customRender: 'balance',
+        },
+        width: 120,
+    },
+    {
+        key: '3th',
+        dataIndex: 'usedmargin',
+        title: '占用资金',
+        align: 'center',
+        slots: {
+            customRender: 'usedmargin',
+        },
+        width: 120,
+    },
+    {
+        key: '4th',
+        dataIndex: 'freezemargin',
+        title: '冻结资金',
+        align: 'center',
+        slots: {
+            customRender: 'freezemargin',
+        },
+        width: 120,
+    },
+    {
+        key: '5th',
+        dataIndex: 'closepl',
+        title: '浮动盈亏',
+        align: 'center',
+        slots: {
+            customRender: 'closepl',
+        },
+        width: 120,
+    },
+    {
+        key: '51th',
+        dataIndex: 'currentbalance',
+        title: '余额',
+        align: 'center',
+        slots: {
+            customRender: 'currentbalance',
+        },
+        width: 120,
+    },
+    {
+        key: '6th',
+        dataIndex: 'usedmargin',
+        title: '风险率',
+        align: 'center',
+        slots: {
+            customRender: 'accountname',
+        },
+        width: 120,
+    },
+    {
+        key: '7th',
+        dataIndex: 'tradestatus',
+        title: '状态',
+        align: 'center',
+        slots: {
+            customRender: 'tradestatus',
+        },
+        width: 120,
+    },
+];
+
+
+export const useHazardRates = (positions: Ref<QueryTradePositionRsp[]>) => {
+    // 获取报价小数位
+    function getDecimalplace() {
+        return positions.value.length > 0 ? positions.value[0].decimalplace : 2
+    }
+    // 获取系统参数
+    const getSystemParam = (paramcode: string, value: string) => APP.getRef('systemParams').value.find((param: Systemparam) => param.paramcode === paramcode)?.paramvalue === value
+    // 获取当前资金账号对应的头寸
+    function getTaaccountPosition(accountid: number) {
+        return positions.value.filter(e => e.accountid === accountid)
+    }
+    // 汇总资金账号 的 浮动盈亏
+    function handleProfitloss({ accountid }: Taaccount, isDecimalPace = true) {
+        const decimalplace = getDecimalplace()
+        const result = getTaaccountPosition(accountid).reduce((acc: number, current: QueryTradePositionRsp) => {
+            const profitloos = useProfitloss(current)
+            const temp = profitloos === '--' ? 0 : Number(profitloos)
+            return acc + temp
+        }, 0)
+        return isDecimalPace ? result.toFixed(decimalplace) : result
+    }
+    // 计算 市值
+    function handleHoldPrice(accountid: number) {
+        return getTaaccountPosition(accountid).reduce((acc: number, current: QueryTradePositionRsp) => {
+            const price = useHolderprice(current)
+            const temp = price === '--' ? 0 : Number(price)
+            return acc + temp
+        }, 0)
+    }
+    // 风险净值
+    function handleRiskValue(taaccount: Taaccount) {
+        const { accountid, currentbalance, otherfreezemargin, outamountfreeze } = taaccount
+        // 浮动盈亏
+        const profitloss = handleProfitloss(taaccount, false) as number
+        // 市值
+        const price = getSystemParam('087', '1') ? handleHoldPrice(accountid) : 0
+
+        // 风险净值	根据系统参数“087 风险净值是否加上市值 - 0:不加 1:加“
+        // 0. 风险净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
+        // 1. 风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
+        return currentbalance + price + profitloss - otherfreezemargin - outamountfreeze
+    }
+    // 净值期 末余额+市值+浮动盈亏(收益权
+    function netWorth(taaccount: Taaccount) {
+        const { accountid, currentbalance } = taaccount
+        // 浮动盈亏
+        const profitloss = handleProfitloss(taaccount, false) as number
+        // 市值
+        const price = handleHoldPrice(accountid)
+        const decimalplace = getDecimalplace()
+        return (currentbalance + profitloss + price).toFixed(decimalplace)
+    }
+    // 风险率
+    function hazardRates(taaccount: Taaccount) {
+        const { usedmargin, mortgagecredit } = taaccount
+        // 风险净值
+        const riskValue = handleRiskValue(taaccount)
+        const decimalplace = getDecimalplace()
+        //   风险率	根据系统参数“132   风险率计算公式”:
+        // 1. 风险率=占用/风险净值
+        // 2. 风险率=(占用-授信金额)/(风险净值-授信金额)
+        const credit = getSystemParam('132', '1') ? 0 : mortgagecredit
+        let result = 0
+        if (riskValue && (riskValue - credit)) {
+            result = (usedmargin - credit) / (riskValue - credit)
+        }
+        result = result ? result * 100 : 0
+        return result.toFixed(decimalplace) + '%'
+    }
+
+    function canUseMoney(taaccount: Taaccount) {
+        const { currentbalance, usedmargin, freezemargin, freezecharge, otherfreezemargin, outamountfreeze } = taaccount
+
+        // 浮动盈亏
+        const profitloss = handleProfitloss(taaccount, false) as number
+        // 占用+冻结+其它冻结+手续费冻结+出金冻结
+        const freeze = usedmargin + freezemargin + freezecharge + otherfreezemargin + outamountfreeze
+        let result = 0
+        if (profitloss < 0) {
+            // 账户总浮动盈亏为负:= 期末余额+总浮动盈亏-占用-冻结-其它冻结-手续费冻结-出金冻结
+            result = currentbalance + profitloss - freeze
+        } else {
+            // *系统参数”113“(当日浮动盈利是否可用) 0:不可用 1:可用
+            const isUse = getSystemParam('113', '1')
+            if (isUse) {
+                // 账户总浮动盈亏为正 且 113 = 1 :=期末余额+总浮动盈亏-占用-冻结-其它冻结-手续费冻结-出金冻结
+                result = currentbalance + profitloss - freeze
+            } else {
+                // 账户总浮动盈亏为正 且 113 = 0 :=期末余额-占用-冻结-其它冻结-手续费冻结-出金冻结
+                result = currentbalance - freeze
+            }
+        }
+        const decimalplace = getDecimalplace()
+        return result.toFixed(decimalplace)
+    }
+
+    return { handleProfitloss, hazardRates, netWorth, canUseMoney }
+}
+

+ 1 - 1
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/components/cancle/index.vue

@@ -45,7 +45,7 @@ export default defineComponent({
                 ClientType: 4, // uint32 终端类型
                 OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
                 BuyOrSell: props.selectedRow.buyorsell, // uint32 买卖方向
-                WRID: props.selectedRow.wrfactortypeid, // uint64 仓单ID,卖的时候填写
+                WRID: Long.fromString(props.selectedRow.wrfactortypeid), // uint64 仓单ID,卖的时候填写
             };
             requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
                 Bus.$emit('spotTrade', true);

+ 2 - 1
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/components/detail/index.vue

@@ -42,6 +42,7 @@ import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { queryWrGoodsInfo } from '@/services/go/wrtrade';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
+import * as Long from 'long';
 
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
@@ -60,7 +61,7 @@ export default defineComponent({
         const lststep = ref<WrGoodsPerformanceStep[]>();
         const param: QueryWrGoodsInfoReq = {
             haswr: 0,
-            wrfactortypeid: props.selectedRow.wrfactortypeid,
+            wrfactortypeid: Long.fromString(props.selectedRow.wrfactortypeid),
         };
         queryResultLoadingAndInfo(queryWrGoodsInfo, loading, param).then((res) => {
             if (res.length) {

+ 18 - 2
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 仓单预售 挂单 -->
-  <a-table :columns="columns"
+  <a-table :columns="tableColumns"
            class="srcollYTable expandLeftTable"
            :scroll="{ x: '100%', y: '190px' }"
            :pagination="false"
@@ -26,6 +26,14 @@
     <template #wrtradetype="{ record }">
       <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
     </template>
+    <!-- 挂牌方式 -->
+    <template #wrpricetype="{ record }">
+      <span>{{ getWrPriceType(record) }}</span>
+    </template>
+    <!-- 价格/基差 -->
+    <template #futushow="{ record }">
+      <span>{{ showPriceOrMove(record) }}</span>
+    </template>
   </a-table>
   <component :is="componentId"
              v-if="componentId"
@@ -45,6 +53,7 @@ import { getWrOrderTypeName, getOrderStatusName } from '@/common/constants/enums
 import { BtnListType } from '@/common/components/btnList/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import Bus from '@/utils/eventBus';
+import { useOrderWarrant } from '@/views/order/setup';
 
 export default defineComponent({
     name: enumOrderComponents.pre_sale_warehouse_receipt_pending_order,
@@ -52,6 +61,7 @@ export default defineComponent({
         BtnList,
         [ModalEnum.pre_sale_warehouse_receipt_pending_order_cancel_order]: defineAsyncComponent(() => import('./components/cancle/index.vue')),
         detail: defineAsyncComponent(() => import('./components/detail/index.vue')),
+        spot_warrant_pending_order_bargain_order: defineAsyncComponent(() => import('@/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue')),
     },
     setup() {
         // 表格列表数据
@@ -66,14 +76,17 @@ export default defineComponent({
         Bus.$on('blocsTrade', () => {
             queryTableAction();
         });
+        const { tableColumns, getWrPriceType, isShowBarginBtn, showPriceOrMove } = useOrderWarrant(0);
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_pre_sale_pending_order',
             recordList: getRecordItemTab(),
             isDetail: true,
         };
         function filterBtnList(list: BtnListType[], record: WrOrderDetail) {
+            if (!isShowBarginBtn(record)) {
+                list = list.filter((e) => e.code !== 'spot_warrant_pending_order_bargain_order');
+            }
             //委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
             const arr = [3, 7];
             if (!arr.includes(record.wrtradeorderstatus)) {
@@ -90,6 +103,9 @@ export default defineComponent({
             expandIcon,
             getOrderStatusName,
             getWrOrderTypeName,
+            tableColumns,
+            getWrPriceType,
+            showPriceOrMove,
         };
     },
 });

+ 168 - 0
src/views/order/setup.ts

@@ -0,0 +1,168 @@
+import { WrOrderDetail } from "@/services/go/wrtrade/interface";
+
+export const useOrderWarrant = (hasWR: 0 | 1) => {
+    const tableColumns = [
+        {
+            key: '0th',
+            dataIndex: 'tradeprice',
+            title: '挂牌价格',
+            align: 'center',
+            slots: {
+                customRender: 'tradeprice',
+            },
+            width: 120,
+        },
+        {
+            key: '6th',
+            dataIndex: 'wrtradetype',
+            title: '挂牌类型',
+            align: 'center',
+            slots: {
+                customRender: 'wrtradetype',
+            },
+            width: 120,
+        },
+        {
+            key: '7th',
+            dataIndex: 'deliverygoodsname',
+            title: '品种',
+            align: 'center',
+            slots: {
+                customRender: 'deliverygoodsname',
+            },
+            width: 120,
+        },
+        {
+            key: '8th',
+            dataIndex: 'wrtypename',
+            title: '商品',
+            align: 'center',
+            slots: {
+                customRender: 'wrtypename',
+            },
+            width: 250,
+        },
+        {
+            key: '9th',
+            dataIndex: 'warehousename',
+            title: '仓库',
+            align: 'center',
+            slots: {
+                customRender: 'warehousename',
+            },
+            width: 120,
+        },
+        {
+            key: '5th',
+            dataIndex: 'wrpricetype',
+            title: '挂牌方式',
+            align: 'center',
+            slots: {
+                customRender: 'wrpricetype',
+            },
+            width: 250,
+        },
+        {
+            key: '101th',
+            dataIndex: 'goodscode',
+            title: '期货合约',
+            align: 'center',
+            slots: {
+                customRender: 'goodscode',
+            },
+            width: 200,
+        },
+        {
+            key: '10th',
+            dataIndex: 'futushow',
+            title: '价格/基差',
+            align: 'center',
+            slots: {
+                customRender: 'futushow',
+            },
+            width: 200,
+        },
+
+        {
+            key: '1th',
+            dataIndex: 'orderqty',
+            title: '挂牌数量',
+            align: 'center',
+            slots: {
+                customRender: 'orderqty',
+            },
+            width: 120,
+        },
+        {
+            key: '2th',
+            dataIndex: 'tradeqty',
+            title: '成交数量',
+            align: 'center',
+            slots: {
+                customRender: 'tradeqty',
+            },
+            width: 120,
+        },
+        {
+            key: '3th',
+            dataIndex: 'ordertime',
+            title: '挂牌时间',
+            align: 'center',
+            slots: {
+                customRender: 'ordertime',
+            },
+            width: 250,
+        },
+        {
+            key: '4th',
+            dataIndex: 'wrtradeorderstatus',
+            title: '状态',
+            align: 'center',
+            slots: {
+                customRender: 'wrtradeorderstatus',
+            },
+            width: 120,
+        },
+    ];
+    if (!hasWR) { // 无仓单 需要交收月
+        const obj = {
+            key: '42th',
+            dataIndex: 'deliverymonth',
+            title: '交收月',
+            align: 'center',
+            slots: {
+                customRender: 'deliverymonth',
+            },
+            width: 120,
+        }
+        tableColumns.splice(6, 0, obj)
+    }
+    // 挂牌方式
+    function getWrPriceType({ wrpricetype, isspecified, canbargain }: WrOrderDetail) {
+        let result = '--'
+        if (isspecified) {
+            if (canbargain) {
+                result = '贸易圈-可议价'
+            } else {
+                result = '贸易圈'
+            }
+        } else {
+            if (wrpricetype === 1) {
+                result = '一口价'
+            } else {
+                result = '浮动价'
+            }
+        }
+        return result
+    }
+    // 是否显示 议价单 按钮
+    function isShowBarginBtn({ wrpricetype, isspecified, canpart }: WrOrderDetail) {
+        return isspecified && (isspecified === 1) && canpart
+    }
+    // 显示价格 或者基差
+    function showPriceOrMove({ wrpricetype, fixedprice, futupricemove }: WrOrderDetail) {
+        const result = wrpricetype === 1 ? fixedprice : futupricemove
+        return result ? result : '--'
+    }
+    return { tableColumns, getWrPriceType, isShowBarginBtn, showPriceOrMove }
+}

+ 1 - 1
src/views/order/spot_warran/components/spot_warrant_pending_order/components/cancle/index.vue

@@ -45,7 +45,7 @@ export default defineComponent({
                 ClientType: 4, // uint32 终端类型
                 OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
                 BuyOrSell: props.selectedRow.buyorsell, // uint32 买卖方向
-                WRID: props.selectedRow.wrfactortypeid, // uint64 仓单ID,卖的时候填写
+                WRID: Long.fromString(props.selectedRow.wrfactortypeid), // uint64 仓单ID,卖的时候填写
             };
             requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
                 Bus.$emit('spotTrade', true);

+ 2 - 1
src/views/order/spot_warran/components/spot_warrant_pending_order/components/detail/index.vue

@@ -42,6 +42,7 @@ import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { queryWrGoodsInfo } from '@/services/go/wrtrade';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
+import * as Long from 'long';
 
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
@@ -60,7 +61,7 @@ export default defineComponent({
         const lststep = ref<WrGoodsPerformanceStep[]>();
         const param: QueryWrGoodsInfoReq = {
             haswr: 1,
-            wrfactortypeid: props.selectedRow.wrfactortypeid,
+            wrfactortypeid: Long.fromString(props.selectedRow.wrfactortypeid),
         };
         queryResultLoadingAndInfo(queryWrGoodsInfo, loading, param).then((res) => {
             if (res.length) {

+ 19 - 2
src/views/order/spot_warran/components/spot_warrant_pending_order/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 现货仓单 挂单 -->
   <section>
-    <a-table :columns="columns"
+    <a-table :columns="tableColumns"
              class="srcollYTable expandLeftTable"
              :scroll="{ x: '100%', y: '190px' }"
              :pagination="false"
@@ -27,6 +27,14 @@
       <template #wrtradetype="{ record }">
         <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
       </template>
+      <!-- 挂牌方式 -->
+      <template #wrpricetype="{ record }">
+        <span>{{ getWrPriceType(record) }}</span>
+      </template>
+      <!-- 价格/基差 -->
+      <template #futushow="{ record }">
+        <span>{{ showPriceOrMove(record) }}</span>
+      </template>
       <!-- 挂牌价格 -->
     </a-table>
     <component :is="componentId"
@@ -48,6 +56,7 @@ import { getWrOrderTypeName, getOrderStatusName } from '@/common/constants/enums
 import { BtnListType } from '@/common/components/btnList/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import Bus from '@/utils/eventBus';
+import { useOrderWarrant } from '@/views/order/setup';
 
 export default defineComponent({
     name: enumOrderComponents.spot_warrant_pending_order,
@@ -55,6 +64,7 @@ export default defineComponent({
         BtnList,
         [ModalEnum.spot_warrant_pending_order_cancel_order]: defineAsyncComponent(() => import('./components/cancle/index.vue')),
         detail: defineAsyncComponent(() => import('./components/detail/index.vue')),
+        spot_warrant_pending_order_bargain_order: defineAsyncComponent(() => import('@/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue')),
     },
     setup() {
         // 表格列表数据
@@ -69,16 +79,20 @@ export default defineComponent({
         Bus.$on('blocsTrade', () => {
             queryTableAction();
         });
+
+        const { tableColumns, getWrPriceType, isShowBarginBtn, showPriceOrMove } = useOrderWarrant(1);
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_spot_warrant_pending_order',
             recordList: getRecordItemTab(),
             isDetail: true,
         };
         function filterBtnList(list: BtnListType[], record: WrOrderDetail) {
             //委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
             const arr = [3, 7];
+            if (!isShowBarginBtn(record)) {
+                list = list.filter((e) => e.code !== 'spot_warrant_pending_order_bargain_order');
+            }
             if (!arr.includes(record.wrtradeorderstatus)) {
                 return list.filter((e) => e.code !== ModalEnum.spot_warrant_pending_order_cancel_order);
             } else {
@@ -93,6 +107,9 @@ export default defineComponent({
             getWrOrderTypeName,
             filterBtnList,
             expandIcon,
+            tableColumns,
+            getWrPriceType,
+            showPriceOrMove,
         };
     },
 });

+ 61 - 48
swagger-to-ts/swagger.ts

@@ -1,52 +1,65 @@
 export interface Name{
-    accountid	:number;//账号ID
-agreeunit	:number;//合约乘数
-buyorsell	:number;//方向 - number;
-//:买 1:卖
-currencyid	:number;//商品币种id
-currencyname	:string;//币种名称
-decimalplace	:number;//商品价格小数位
-enumdicname	:string;//商品单位名称
-expirecycle	:number;//行权周期(天) - 1:滚动行权时填写
-expiredate	:string;//行权日(yyyyMMdd) - 到期日
-expiretype	:number;//行权日类型 - 1:滚动行权 2:固定日行权
-freezeqty	:number;//冻结数量
-goodscode	:string;//商品代码
-goodsid	:number;//商品ID
-goodsname	:string;//商品名称
-goodunitid	:number;//商品单位id
-holderamount	:number;//持仓金额
-holdercredit	:number;//持仓授信金额
-holderdays	:number;//剩余冻结天数
-holderprice	:number;//持仓价格
-holderqty	:number;//持仓数量
-isconfirmexercise	:number;//是否确认行权- number;
+    accountid	:number;//交易账号(资金账号)
+allfriendsflag	:number;//是否全好友可见 - number;
 //:否 1:是
-ispreexercise	:number;//是否预申报- number;
-//:否 1:是 2:不可行权
-marketid	:number;//市场id
-marketname	:string;//市场名称
-openprice	:number;//建仓价格
-openqty	:number;//建仓数量
-optiontype	:number;//期权类型 - 1:认购(看涨) 2:认沽(看跌)
-preexerciseprice	:number;//预申报价格
-premium	:number;//权利金
-qtydecimalplace	:number;//商品成交量小数位
-refgoodscode	:string;//标的合约代码
-refgoodsid	:number;//标的合约id
-releaseamount	:number;//释放持仓金额
-releaseholdercredit	:number;//释放持仓授信金额
-taname	:string;//资金账号名称
-tradeamount	:number;//成交金额
+amount	:number;//挂牌金额 = 委托数量  固定价或升贴水
+buyorsell	:number;//买卖 - number;
+//:买 1:卖(挂牌类型 买为采购 卖为销售)
+canbargain	:number;//是否可议价 - number;
+//:不可 1:可
+cancelqty	:number;//撤销数量
+canpart	:number;//是否允许部份摘牌 - number;
+//:不允许(要求整单) 1:允许(可以不整单)
+delistminqty	:number;//起摘数量
+deliverygoodscode	:string;//品种代码
+deliverygoodsid	:number;//品种ID
+deliverygoodsname	:string;//品种名称
+deliverymonth	:string;//交收月
+enumdicname	:string;//单位名称
+fixedprice	:number;//固定价格 - [挂牌]
+freezemargin	:number;//冻结保证金(保证金)
+futupricemove	:number;//期货升贴水
+futushow	:string;//期货合约/升贴水
+goodscode	:string;//期货合约
+goodsid	:number;//期货商品id
+goodsname	:string;//商品名称
+haswr	:number;//是否有仓单-卖方 - number;
+//:无仓单 1:有仓单
+isspecified	:number;//是否指定对手 - number;
+//:不指定 1:指定 - [挂牌]
+ladingbillid	:string;//提单ID(2number;
+//8+Unix秒时间戳(1number;
+//位)+xxxxxx)
+marginvalue	:number;//保证金设置值(履约保证金)
+marketid	:number;//市场ID
+matchusername	:string;//对手方名称(当ISSPECIFIED=1时,有值,指定朋友的名称)
+minivalue	:number;//现货商品最小变动值
+optioncompare	:string;//选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+orderqty	:number;//委托数量
+ordertime	:string;//委托时间(挂牌时间)
+performancetemplateid	:number;//履约模板id
+pricemove	:number;//升贴水(浮动价时填写) - [挂牌]
+taname	:string;//交易用户名称(资金账号名称)
 tradedate	:string;//交易日(yyyyMMdd)
-tradeid	:string;//成交单号(1number;
-//1+Unix秒时间戳(1number;
-//位)+2位(MarketServiceID)+xxxx)
-trademode	:number;//交易模式 - 1number;
-//:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 2number;
-//:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价 46:掉期
-tradeproperty	:number;//交易属性
-tradetime	:string;//交易时间
-userid	:number;//用户id
-username	:string;//用户名称
+tradeprice	:number;//成交价格 - [摘牌] (浮动价 ((商品1价格商品1价格系数+升贴水) 商品1重量系数 + 商品2价格商品2价格系数+商品2升贴水) 商品2重量系数 …) 委托单价格系数 + 委托单升贴水)
+tradeqty	:number;//成交数量
+userid	:number;//用户ID
+validtime	:string;//挂牌有效期
+warehouseid	:number;//仓库ID
+warehousename	:string;//仓库名称
+wrfactortypeid	:string;//仓单要素类型ID(212+Unix秒时间戳(1number;
+//位)+xxxxxx)
+wrfactortypename	:string;//仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+wrpricetype	:number;//价格方式 - 1:固定价 2-浮动价 - [挂牌]
+wrstandardcode	:string;//现货商品代码
+wrstandardid	:number;//现货商品ID
+wrstandardname	:string;//商品名称
+wrtradeorderid	:string;//仓单贸易委托单ID(32number;
+//+Unix秒时间戳(1number;
+//位)+xxxxxx)
+wrtradeorderstatus	:number;//委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:部成 8:已成 9:部成部撤 1number;
+//:成交失败 11:委托拒绝 12:经过摘牌(先摘后挂专用) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用) 17:冻结PD成功 18:冻结PD失败 19:冻结能量成功 2number;
+//:冻结能量失败 21:预约已报价 22:过期未付 23:优惠券处理中 24:仓单生成失败 25:首付扣款失败 26:履约失败 27:撤单解冻贷款失败
+wrtradetype	:number;//仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
+wrtypename	:string;//商品
 }

+ 100 - 79
swagger-to-ts/swagger.txt

@@ -1,130 +1,151 @@
 {
     accountid	integer
-账号ID
+交易账号(资金账号)
 
-agreeunit	number
-合约乘数
+allfriendsflag	integer
+是否全好友可见 - 0:否 1:是
+
+amount	number
+挂牌金额 = 委托数量 * 固定价或升贴水
 
 buyorsell	integer
-方向 - 0:买 1:卖
+买卖 - 0:买 1:卖(挂牌类型 买为采购 卖为销售)
+
+canbargain	integer
+是否可议价 - 0:不可 1:可
+
+cancelqty	number
+撤销数量
+
+canpart	integer
+是否允许部份摘牌 - 0:不允许(要求整单) 1:允许(可以不整单)
+
+delistminqty	integer
+起摘数量
 
-currencyid	integer
-商品币种id
+deliverygoodscode	string
+品种代码
 
-currencyname	string
-币种名称
+deliverygoodsid	integer
+品种ID
 
-decimalplace	integer
-商品价格小数位
+deliverygoodsname	string
+品种名称
+
+deliverymonth	string
+交收月
 
 enumdicname	string
-商品单位名称
+单位名称
 
-expirecycle	integer
-行权周期(天) - 1:滚动行权时填写
+fixedprice	number
+固定价格 - [挂牌]
 
-expiredate	string
-行权日(yyyyMMdd) - 到期日
+freezemargin	number
+冻结保证金(保证金)
 
-expiretype	integer
-行权日类型 - 1:滚动行权 2:固定日行权
+futupricemove	number
+期货升贴水
 
-freezeqty	number
-冻结数量
+futushow	string
+期货合约/升贴水
 
 goodscode	string
-商品代码
+期货合约
 
 goodsid	integer
-商品ID
+期货商品id
 
 goodsname	string
 商品名称
 
-goodunitid	integer
-商品单位id
+haswr	integer
+是否有仓单-卖方 - 0:无仓单 1:有仓单
+
+isspecified	integer
+是否指定对手 - 0:不指定 1:指定 - [挂牌]
 
-holderamount	number
-持仓金额
+ladingbillid	string
+提单ID(208+Unix秒时间戳(10位)+xxxxxx)
 
-holdercredit	number
-持仓授信金额
+marginvalue	number
+保证金设置值(履约保证金)
 
-holderdays	integer
-剩余冻结天数
+marketid	integer
+市场ID
 
-holderprice	number
-持仓价格
+matchusername	string
+对手方名称(当ISSPECIFIED=1时,有值,指定朋友的名称)
 
-holderqty	number
-持仓数量
+minivalue	integer
+现货商品最小变动值
 
-isconfirmexercise	integer
-是否确认行权- 0:否 1:是
+optioncompare	string
+选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
 
-ispreexercise	integer
-是否预申报- 0:否 1:是 2:不可行权
+orderqty	number
+委托数量
 
-marketid	integer
-市场id
+ordertime	string
+委托时间(挂牌时间)
 
-marketname	string
-市场名称
+performancetemplateid	integer
+履约模板id
 
-openprice	number
-建仓价格
+pricemove	number
+升贴水(浮动价时填写) - [挂牌]
 
-openqty	number
-建仓数量
+taname	string
+交易用户名称(资金账号名称)
 
-optiontype	integer
-期权类型 - 1:认购(看涨) 2:认沽(看跌)
+tradedate	string
+交易日(yyyyMMdd)
 
-preexerciseprice	number
-预申报价格
+tradeprice	number
+成交价格 - [摘牌] (浮动价 ((商品1价格商品1价格系数+升贴水) 商品1重量系数 + 商品2价格商品2价格系数+商品2升贴水) 商品2重量系数 …)* 委托单价格系数 + 委托单升贴水)
 
-premium	number
-权利金
+tradeqty	number
+成交数量
 
-qtydecimalplace	integer
-商品成交量小数位
+userid	integer
+用户ID
 
-refgoodscode	string
-标的合约代码
+validtime	string
+挂牌有效期
 
-refgoodsid	integer
-标的合约id
+warehouseid	integer
+仓库ID
 
-releaseamount	number
-释放持仓金额
+warehousename	string
+仓库名称
 
-releaseholdercredit	number
-释放持仓授信金额
+wrfactortypeid	string
+仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
 
-taname	string
-资金账号名称
+wrfactortypename	string
+仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
 
-tradeamount	number
-成交金额
+wrpricetype	integer
+价格方式 - 1:固定价 2-浮动价 - [挂牌]
 
-tradedate	string
-交易日(yyyyMMdd)
+wrstandardcode	string
+现货商品代码
 
-tradeid	string
-成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+wrstandardid	integer
+现货商品ID
 
-trademode	integer
-交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价 46:掉期
+wrstandardname	string
+商品名称
 
-tradeproperty	integer
-交易属性
+wrtradeorderid	string
+仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
 
-tradetime	string
-交易时间
+wrtradeorderstatus	integer
+委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:部成 8:已成 9:部成部撤 10:成交失败 11:委托拒绝 12:经过摘牌(先摘后挂专用) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用) 17:冻结PD成功 18:冻结PD失败 19:冻结能量成功 20:冻结能量失败 21:预约已报价 22:过期未付 23:优惠券处理中 24:仓单生成失败 25:首付扣款失败 26:履约失败 27:撤单解冻贷款失败
 
-userid	integer
-用户id
+wrtradetype	integer
+仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
 
-username	string
-用户名称
+wrtypename	string
+商品
 }