huangbin 4 년 전
부모
커밋
ea34a0087f
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      src/views/market/spot_trade/spot_trade_order_transaction/components/listing/setup.ts

+ 6 - 2
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/setup.ts

@@ -1,3 +1,5 @@
+import { validateCommon } from "@/common/setup/validate";
+import { RuleObject } from "ant-design-vue/lib/form/interface";
 import { reactive, ref, UnwrapRef } from "vue";
 import { FormState } from "./interface";
 
@@ -9,6 +11,9 @@ export function handleForm() {
         FixedPrice: 0,
         PriceMove: 0
     })
+    const v_price = async (rule: RuleObject, value: number) => {
+        return validateCommon(value, '请输入挂牌价格');
+    };
     const rules = {
         accountid: [{ required: true, message: '请选择交易账户' }],
         OrderQty: [
@@ -16,8 +21,7 @@ export function handleForm() {
             { message: '挂牌数量不能小于0', min: 1, type: 'number' }
         ],
         FixedPrice: [
-            { required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number' },
-            { message: '挂牌价格不能小于0', min: 1, type: 'number' }
+            { required: true, trigger: 'blur', type: 'number', validator: v_price },
         ],
 
     }