sequenceMain.js 3.6 KB

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