index6.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import { resolveComponent as u, openBlock as _, createBlock as b, withCtx as n, createVNode as o, createTextVNode as v } from "vue";
  2. import { l as g, bv as C, U as h } from "./index2.js";
  3. import { C as k } 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. tabs: [
  33. {
  34. name: "第一页",
  35. value: 1
  36. },
  37. {
  38. name: "第二页",
  39. value: 2
  40. },
  41. {
  42. name: "第三页",
  43. value: 3
  44. }
  45. ]
  46. };
  47. },
  48. methods: {
  49. tabsChange(e) {
  50. console.log(e);
  51. },
  52. footCallback(e) {
  53. e === "cancel" && this.$router.go(-1);
  54. },
  55. handSubmit() {
  56. this.$refs.form.validate().then((e) => {
  57. console.log("success", e);
  58. }).catch((e) => {
  59. console.log(e);
  60. }), this.$refs["group-form"].validate().then((e) => {
  61. console.log("success", e);
  62. }).catch((e) => {
  63. console.log(e);
  64. });
  65. }
  66. },
  67. mounted() {
  68. }
  69. };
  70. function x(e, t, U, T, l, s) {
  71. const r = C, m = u("s-form-item"), f = u("s-form"), c = k, d = u("check-outlined"), i = h, p = u("s-form-layout");
  72. return _(), b(p, {
  73. ref: "formLayout",
  74. title: "选项卡表单示例",
  75. subTitle: "",
  76. onFooterCallback: s.footCallback,
  77. tabs: l.tabs,
  78. tabKey: { label: "name", value: "value" },
  79. onTabsChange: s.tabsChange
  80. }, {
  81. form: n(() => [
  82. o(c, {
  83. class: "mb-50",
  84. title: "表单列可设置为最多4列"
  85. }, {
  86. default: n(() => [
  87. o(f, {
  88. model: l.form,
  89. rules: l.rules,
  90. ref: "form",
  91. layout: "horizontal",
  92. column: 4
  93. }, {
  94. default: n(() => [
  95. o(m, {
  96. label: "表单名称",
  97. name: "name"
  98. }, {
  99. default: n(() => [
  100. o(r, {
  101. value: l.form.name,
  102. "onUpdate:value": t[0] || (t[0] = (a) => l.form.name = a)
  103. }, null, 8, ["value"])
  104. ]),
  105. _: 1
  106. }),
  107. o(m, {
  108. label: "表单编码",
  109. name: "code"
  110. }, {
  111. default: n(() => [
  112. o(r, {
  113. value: l.form.code,
  114. "onUpdate:value": t[1] || (t[1] = (a) => l.form.code = a)
  115. }, null, 8, ["value"])
  116. ]),
  117. _: 1
  118. }),
  119. o(m, {
  120. label: "表单类型",
  121. name: "code"
  122. }, {
  123. default: n(() => [
  124. o(r, {
  125. value: l.form.code,
  126. "onUpdate:value": t[2] || (t[2] = (a) => l.form.code = a)
  127. }, null, 8, ["value"])
  128. ]),
  129. _: 1
  130. }),
  131. o(m, {
  132. label: "表单状态",
  133. name: "code"
  134. }, {
  135. default: n(() => [
  136. o(r, {
  137. value: l.form.code,
  138. "onUpdate:value": t[3] || (t[3] = (a) => l.form.code = a)
  139. }, null, 8, ["value"])
  140. ]),
  141. _: 1
  142. }),
  143. o(m, {
  144. label: "表单属性",
  145. name: "code"
  146. }, {
  147. default: n(() => [
  148. o(r, {
  149. value: l.form.code,
  150. "onUpdate:value": t[4] || (t[4] = (a) => l.form.code = a)
  151. }, null, 8, ["value"])
  152. ]),
  153. _: 1
  154. })
  155. ]),
  156. _: 1
  157. }, 8, ["model", "rules"])
  158. ]),
  159. _: 1
  160. })
  161. ]),
  162. footer: n(() => [
  163. o(i, {
  164. type: "primary",
  165. onClick: s.handSubmit
  166. }, {
  167. default: n(() => [
  168. o(d),
  169. t[5] || (t[5] = v("提交"))
  170. ]),
  171. _: 1
  172. }, 8, ["onClick"])
  173. ]),
  174. _: 1
  175. }, 8, ["onFooterCallback", "tabs", "onTabsChange"]);
  176. }
  177. const w = /* @__PURE__ */ g(y, [["render", x]]);
  178. export {
  179. w as default
  180. };