77e5f0923c6cb04bed9368cff50ba3e451a6c61b.svn-base 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <a-modal
  3. title="功能测试"
  4. :width="800"
  5. :visible="visible"
  6. @ok="visible=false"
  7. @cancel="visible=false"
  8. >
  9. <a-form :form="form">
  10. <a-form-item label="功能测试">
  11. <a-input placeholder="请输入" v-decorator="['test', validatorRules.test]" @change="e=>testValue=e.target.value"/>
  12. </a-form-item>
  13. </a-form>
  14. <a-row type="flex" :gutter="8">
  15. <a-col v-for="(str,index) of testValue" :key="index">
  16. <a-row>
  17. <a-col>
  18. <a-input :value="str" style="text-align: center;width: 40px;"/>
  19. </a-col>
  20. <a-col style="text-align: center;">{{index+1}}</a-col>
  21. </a-row>
  22. </a-col>
  23. </a-row>
  24. </a-modal>
  25. </template>
  26. <script>
  27. import { validateCheckRule } from '@/utils/util'
  28. export default {
  29. name: 'SysCheckRuleTestModal',
  30. data() {
  31. return {
  32. title: '操作',
  33. visible: false,
  34. ruleCode: '',
  35. testValue: '',
  36. form: this.$form.createForm(this),
  37. validatorRules: {
  38. test: {
  39. rules: [{ validator: (rule, value, callback) => validateCheckRule(this.ruleCode, value, callback) }]
  40. }
  41. },
  42. }
  43. },
  44. methods: {
  45. open(ruleCode) {
  46. this.ruleCode = ruleCode
  47. this.form.resetFields()
  48. this.testValue = ''
  49. this.visible = true
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="less" scoped></style>