index32.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import { resolveComponent as a, openBlock as _, createBlock as v, withCtx as n, createVNode as o, createTextVNode as b } from "vue";
  2. import { l as g, bv as k, U as C } from "./index2.js";
  3. import { C as h } from "./index25.js";
  4. const y = {
  5. name: "FormPage",
  6. props: {
  7. id: {
  8. type: String,
  9. default: ""
  10. }
  11. },
  12. watch: {
  13. id: {
  14. handler(e) {
  15. this.props.id = e || this.id;
  16. },
  17. immediate: !0
  18. }
  19. },
  20. data() {
  21. return {
  22. props: {
  23. id: ""
  24. },
  25. form: {
  26. name: "",
  27. code: ""
  28. },
  29. rules: {
  30. name: [{ required: !0, message: "请输入表单名称", trigger: "blur" }]
  31. }
  32. };
  33. },
  34. methods: {
  35. footCallback(e) {
  36. e === "cancel" && this.$router.go(-1);
  37. },
  38. handSubmit() {
  39. this.$refs.form.validate().then((e) => {
  40. console.log("success", e);
  41. }).catch((e) => {
  42. console.log(e);
  43. }), this.$refs["group-form"].validate().then((e) => {
  44. console.log("success", e);
  45. }).catch((e) => {
  46. console.log(e);
  47. });
  48. }
  49. },
  50. mounted() {
  51. }
  52. };
  53. function x(e, l, U, B, t, s) {
  54. const m = k, u = a("s-form-item"), f = a("s-form"), c = h, d = a("check-outlined"), i = C, p = a("s-form-layout");
  55. return _(), v(p, {
  56. ref: "formLayout",
  57. title: "基础表单示例",
  58. subTitle: "",
  59. onFooterCallback: s.footCallback
  60. }, {
  61. form: n(() => [
  62. o(c, {
  63. class: "mb-50",
  64. title: "表单列可设置为最多4列"
  65. }, {
  66. default: n(() => [
  67. o(f, {
  68. model: t.form,
  69. rules: t.rules,
  70. ref: "form",
  71. layout: "horizontal",
  72. column: 4
  73. }, {
  74. default: n(() => [
  75. o(u, {
  76. label: "表单名称",
  77. name: "name"
  78. }, {
  79. default: n(() => [
  80. o(m, {
  81. value: t.form.name,
  82. "onUpdate:value": l[0] || (l[0] = (r) => t.form.name = r)
  83. }, null, 8, ["value"])
  84. ]),
  85. _: 1
  86. }),
  87. o(u, {
  88. label: "表单编码",
  89. name: "code"
  90. }, {
  91. default: n(() => [
  92. o(m, {
  93. value: t.form.code,
  94. "onUpdate:value": l[1] || (l[1] = (r) => t.form.code = r)
  95. }, null, 8, ["value"])
  96. ]),
  97. _: 1
  98. }),
  99. o(u, {
  100. label: "表单类型",
  101. name: "code"
  102. }, {
  103. default: n(() => [
  104. o(m, {
  105. value: t.form.code,
  106. "onUpdate:value": l[2] || (l[2] = (r) => t.form.code = r)
  107. }, null, 8, ["value"])
  108. ]),
  109. _: 1
  110. }),
  111. o(u, {
  112. label: "表单状态",
  113. name: "code"
  114. }, {
  115. default: n(() => [
  116. o(m, {
  117. value: t.form.code,
  118. "onUpdate:value": l[3] || (l[3] = (r) => t.form.code = r)
  119. }, null, 8, ["value"])
  120. ]),
  121. _: 1
  122. }),
  123. o(u, {
  124. label: "表单属性",
  125. name: "code"
  126. }, {
  127. default: n(() => [
  128. o(m, {
  129. value: t.form.code,
  130. "onUpdate:value": l[4] || (l[4] = (r) => t.form.code = r)
  131. }, null, 8, ["value"])
  132. ]),
  133. _: 1
  134. })
  135. ]),
  136. _: 1
  137. }, 8, ["model", "rules"])
  138. ]),
  139. _: 1
  140. })
  141. ]),
  142. footer: n(() => [
  143. o(i, {
  144. type: "primary",
  145. onClick: s.handSubmit
  146. }, {
  147. default: n(() => [
  148. o(d),
  149. l[5] || (l[5] = b("提交"))
  150. ]),
  151. _: 1
  152. }, 8, ["onClick"])
  153. ]),
  154. _: 1
  155. }, 8, ["onFooterCallback"]);
  156. }
  157. const N = /* @__PURE__ */ g(y, [["render", x]]);
  158. export {
  159. N as default
  160. };