CheckRuleTestModal.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <BasicModal v-bind="$attrs" :okButtonProps="okButtonProps" @register="registerModal" destroyOnClose>
  3. <BasicForm @register="registerForm" />
  4. <div style="display: flex; flex-flow: row wrap">
  5. <div style="padding: 0 4px" v-for="(str, index) of realTestValue" :key="index">
  6. <a-row>
  7. <a-col style="text-align: center">
  8. <a-input :value="str" style="text-align: center; width: 40px" />
  9. </a-col>
  10. <a-col style="text-align: center">{{ index + 1 }}</a-col>
  11. </a-row>
  12. </div>
  13. </div>
  14. </BasicModal>
  15. </template>
  16. <script lang="ts" setup>
  17. import { BasicModal, useModalInner } from '/@/components/Modal';
  18. import { BasicForm, useForm } from '/@/components/Form/index';
  19. import { checkRuleInput } from '/@/views/system/checkRule/check.rule.data';
  20. import { ref } from 'vue';
  21. let realTestValue = ref('');
  22. const okButtonProps = {
  23. style: { display: 'none' },
  24. };
  25. const [registerForm, { resetFields, setFieldsValue, validate, getFieldsValue }] = useForm({
  26. schemas: checkRuleInput,
  27. showActionButtonGroup: false,
  28. labelCol: {
  29. span: 24,
  30. },
  31. wrapperCol: {
  32. span: 24,
  33. },
  34. });
  35. //表单赋值
  36. const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
  37. //重置表单
  38. await resetFields();
  39. realTestValue.value = '';
  40. setModalProps({
  41. confirmLoading: false,
  42. cancelText: '关闭',
  43. title: '功能测试',
  44. width: '1000px',
  45. });
  46. await setFieldsValue({
  47. ruleCode: data.ruleCode,
  48. testValue: realTestValue,
  49. });
  50. });
  51. </script>
  52. <style scoped></style>