代码少年 2021-09-07 16:38
浏览 882
已结题

ant Design vue 中formmodel中model是个数组对象怎么进行验证!


<div v-for="(data,i) in dataSource" > <!-- v-if="linkName == '商务标负责人审批意见'"-->

          <span>项目名称:{{data.projectName}}</span>
        <a-form-model ref="form" :model="tenderPersonnels[i][0]" slot="detail">
          <table class="ant-table-fixed" style="width: 100%;">
            <thead class="ant-table-thead">
              <tr>
                <th width="10%">专业名称及项目职责</th>
                <th width="10%">姓 名</th>
                <th width="10%">职称</th>
                <th width="10%">总分配比例</th>
                <th width="10%">可分配金额(元)</th>
                <th width="10%">个人分配比例</th>
                <th width="10%">分配金额</th>
                <th width="10%">备注</th>
              </tr>
            </thead>
           <tbody ><!-- class="ant-table-tbody"-->
              <tr v-for="(person,j) in tenderPersonnels[i]">
                <td>
                  <a-form-model-item>
                    <span>{{person.professionalType}}</span>
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item>
                    <span>{{person.userName}}</span>
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item>
                    <span>{{person.occupationName}}</span>
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item>
                    <span>{{person.allRatio}}%</span>
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item>
                    <span>{{person.allMoney}}</span>
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item prop="personalRatio" :rules="[{ required: true, message: '请输入个人分配比例!!'}]">
                    <a-input @blur="getPersonalMoney($event,i,j)" v-model="person.personalRatio" />
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item  prop="personalAllotMoney">
                    <a-input v-model="person.personalAllotMoney" suffix="元"/>
                  </a-form-model-item>
                </td>
                <td>
                  <a-form-model-item>
                    <span>{{person.remark}}</span>
                  </a-form-model-item>
                </td>
              </tr>
            </tbody>
          </table>
        </a-form-model>
      </div>

这里的formmodel中model 是tenderPersonnels[i][0] 但是0是动态的,我不知道vue这么写对不对,还有救吗?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 9月15日
    • 创建了问题 9月7日

    悬赏问题

    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计