Blame view

ant-design-vue-jeecg/src/views/system/modules/SysCheckRuleTestModal.vue 1.35 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<template>
  <a-modal
    title="功能测试"
    :width="800"
    :visible="visible"
    @ok="visible=false"
    @cancel="visible=false"
  >
    <a-form :form="form">
      <a-form-item label="功能测试">
        <a-input placeholder="请输入" v-decorator="['test', validatorRules.test]" @change="e=>testValue=e.target.value"/>
      </a-form-item>
    </a-form>
    <a-row type="flex" :gutter="8">
      <a-col v-for="(str,index) of testValue" :key="index">
        <a-row>
          <a-col>
            <a-input :value="str" style="text-align: center;width: 40px;"/>
          </a-col>
肖超群 authored
20
          <a-col style="text-align: center;">{{ index + 1 }}</a-col>
肖超群 authored
21
22
23
24
25
26
27
28
        </a-row>
      </a-col>
    </a-row>

  </a-modal>
</template>

<script>
肖超群 authored
29
import {validateCheckRule} from '@/utils/util'
肖超群 authored
30
肖超群 authored
31
32
33
34
35
36
37
38
39
40
41
42
43
export default {
  name: 'SysCheckRuleTestModal',
  data() {
    return {
      title: '操作',
      visible: false,
      ruleCode: '',
      testValue: '',
      form: this.$form.createForm(this),
      validatorRules: {
        test: {
          rules: [{validator: (rule, value, callback) => validateCheckRule(this.ruleCode, value, callback)}]
        }
肖超群 authored
44
45
      },
    }
肖超群 authored
46
47
48
49
50
51
52
53
  },
  methods: {
    open(ruleCode) {
      this.ruleCode = ruleCode
      this.form.resetFields()
      this.testValue = ''
      this.visible = true
    },
肖超群 authored
54
  }
肖超群 authored
55
}
肖超群 authored
56
57
58
</script>

<style lang="less" scoped></style>