import { resolveComponent as s, openBlock as p, createBlock as _, withCtx as r, createVNode as o, createTextVNode as v } from "vue";
import { l as b, bv as g, U as k } from "./index2.js";
const C = {
  name: "FormPage",
  props: {
    id: {
      type: String,
      default: ""
    }
  },
  watch: {
    id: {
      handler(l) {
        this.props.id = l || this.id;
      },
      immediate: !0
    }
  },
  data() {
    return {
      props: {
        id: ""
      },
      form: {
        name: "",
        code: ""
      },
      rules: {
        name: [{ required: !0, message: "请输入表单名称", trigger: "blur" }]
      },
      steps: ["步骤一", "步骤二", "步骤三"]
    };
  },
  methods: {
    footCallback(l) {
      l === "cancel" && this.$router.go(-1);
    },
    handSubmit() {
      this.$refs.form.validate().then((l) => {
        console.log("success", l);
      }).catch((l) => {
        console.log(l);
      }), this.$refs["group-form"].validate().then((l) => {
        console.log("success", l);
      }).catch((l) => {
        console.log(l);
      });
    }
  },
  mounted() {
  }
};
function h(l, t, y, U, e, a) {
  const u = g, m = s("s-form-item"), f = s("s-form"), c = s("check-outlined"), d = k, i = s("s-form-layout");
  return p(), _(i, {
    ref: "formLayout",
    title: "步骤表单示例",
    subTitle: "",
    onFooterCallback: a.footCallback,
    steps: e.steps
  }, {
    form: r(() => [
      o(f, {
        model: e.form,
        rules: e.rules,
        ref: "form",
        layout: "horizontal",
        column: 4
      }, {
        default: r(() => [
          o(m, {
            label: "表单名称",
            name: "name"
          }, {
            default: r(() => [
              o(u, {
                value: e.form.name,
                "onUpdate:value": t[0] || (t[0] = (n) => e.form.name = n)
              }, null, 8, ["value"])
            ]),
            _: 1
          }),
          o(m, {
            label: "表单编码",
            name: "code"
          }, {
            default: r(() => [
              o(u, {
                value: e.form.code,
                "onUpdate:value": t[1] || (t[1] = (n) => e.form.code = n)
              }, null, 8, ["value"])
            ]),
            _: 1
          }),
          o(m, {
            label: "表单类型",
            name: "code"
          }, {
            default: r(() => [
              o(u, {
                value: e.form.code,
                "onUpdate:value": t[2] || (t[2] = (n) => e.form.code = n)
              }, null, 8, ["value"])
            ]),
            _: 1
          }),
          o(m, {
            label: "表单状态",
            name: "code"
          }, {
            default: r(() => [
              o(u, {
                value: e.form.code,
                "onUpdate:value": t[3] || (t[3] = (n) => e.form.code = n)
              }, null, 8, ["value"])
            ]),
            _: 1
          }),
          o(m, {
            label: "表单属性",
            name: "code"
          }, {
            default: r(() => [
              o(u, {
                value: e.form.code,
                "onUpdate:value": t[4] || (t[4] = (n) => e.form.code = n)
              }, null, 8, ["value"])
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["model", "rules"])
    ]),
    footer: r(() => [
      o(d, {
        type: "primary",
        onClick: a.handSubmit
      }, {
        default: r(() => [
          o(c),
          t[5] || (t[5] = v("提交"))
        ]),
        _: 1
      }, 8, ["onClick"])
    ]),
    _: 1
  }, 8, ["onFooterCallback", "steps"]);
}
const F = /* @__PURE__ */ b(C, [["render", h]]);
export {
  F as default
};
