<template>
  <div>
    <!-- <base-input
      label="现有资金"
      placeholder="现有资金"
      v-model="form.NowCapital"
    ></base-input> -->
    <base-input
      label="总资金"
      placeholder="总资金"
      v-model="form.NowCapital"
    ></base-input>
    <base-input
      label="冻结金额"
      placeholder="冻结金额"
      v-model="form.FrozenProfit"
    ></base-input>
    <base-input
      label="下单金额比（%）"
      placeholder="下单金额比（%）"
      v-model="form.TradeAmountRatio"
    ></base-input>
    <p class="form-label">下单金额：{{ total }}</p>

    <base-checkbox inline v-model="form.IsEnabledLimit">
      是否启用限价单
    </base-checkbox>
  </div>
</template>
<script>
export default {
  model: { prop: "form", event: "formChange" },
  props: {
    form: {
      type: Object,
      default: () => {}
    }
  },
  watch: {
    form() {
      this.$emit("formChange", this.form);
    }
  },
  data() {
    return {};
  },
  computed: {
    total() {
      return (
        ((this.form.NowCapital - this.form.FrozenProfit) *
          this.form.TradeAmountRatio) /
        100
      );
    }
  }
};
</script>
