UNPKG

snowy-designer

Version:

基于Epic-Designer-Pro版本的设计器,可视化开发页面表单

143 lines (142 loc) 4.96 kB
import { defineComponent as D, ref as v, createBlock as x, openBlock as u, unref as o, withCtx as t, createElementVNode as n, createVNode as l, createTextVNode as d, createElementBlock as U, withDirectives as B, Fragment as b, renderList as E, vShow as N } from "vue"; /* empty css */ import "radix-vue"; import "clsx"; import "tailwind-merge"; import "lucide-vue-next"; import "../../../ui-kit/base-ui/src/shadch-ui/button/index.js"; import "@vueuse/core"; import "../../../ui-kit/base-ui/src/shadch-ui/toast/index.js"; import $ from "../../../ui-kit/base-ui/src/components/empty/empty.vue.js"; import "../../../hooks/src/store/index.js"; import "lodash"; import "../../../utils/src/manager/pluginManager.js"; import "monaco-editor"; import "../../../utils/src/request/index.js"; import "vuedraggable"; import { Drawer as j, Button as m, Card as S, Divider as _, Space as A } from "ant-design-vue"; import F from "./actionEdit.vue.js"; import L from "./conditionEdit.vue.js"; const O = { class: "epic-drawer-container h-full" }, R = { class: "flex h-full flex-col" }, T = { class: "px-16px" }, q = { class: "px-16px mt-2 flex-1 overflow-auto" }, z = ["onClick"], G = { class: "epic-modal-footer" }, se = /* @__PURE__ */ D({ __name: "drawer", emits: ["ok"], setup(H, { expose: w, emit: k }) { const V = k, a = v(!1), i = v([]); function y(s = []) { i.value = s, a.value = !0; } function C() { i.value.push({ actions: [], condition: { conditions: [], operator: "and" } }); } function g(s) { i.value.splice(s, 1); } function c() { a.value = !1; } function h() { V("ok", i.value), c(); } return w({ showDrawer: y }), (s, e) => (u(), x(o(j), { open: a.value, "onUpdate:open": e[0] || (e[0] = (r) => a.value = r), class: "epic-drawer-form-logic", width: "650px", title: "逻辑规则" }, { default: t(() => [ n("div", O, [ n("div", R, [ n("div", T, [ l(o(m), { class: "flex w-full items-center justify-center", type: "primary", onClick: C }, { icon: t(() => e[1] || (e[1] = [ n("span", { class: "icon--epic icon--epic--add-rounded mr-1" }, null, -1) ])), default: t(() => [ e[2] || (e[2] = d(" 添加逻辑规则 ")) ]), _: 1 }) ]), n("div", q, [ (u(!0), U(b, null, E(i.value, (r, f) => (u(), x(o(S), { key: f, class: "mt-2", "body-style": { padding: "16px" } }, { default: t(() => [ n("div", { class: "top-8px right-8px w-24px h-24px text-16px absolute flex rotate-45 cursor-pointer items-center justify-center rounded-full hover:bg-gray-100", onClick: (p) => g(f) }, e[3] || (e[3] = [ n("span", { class: "icon--epic icon--epic--add-rounded" }, null, -1) ]), 8, z), l(o(_), null, { default: t(() => e[4] || (e[4] = [ d("当满足以下条件时") ])), _: 1 }), l(L, { modelValue: r.condition, "onUpdate:modelValue": (p) => r.condition = p }, null, 8, ["modelValue", "onUpdate:modelValue"]), l(o(_), null, { default: t(() => e[5] || (e[5] = [ d("则执行") ])), _: 1 }), l(F, { modelValue: r.actions, "onUpdate:modelValue": (p) => r.actions = p }, null, 8, ["modelValue", "onUpdate:modelValue"]) ]), _: 2 }, 1024))), 128)), B(l(o($), { description: "暂无逻辑规则" }, null, 512), [ [N, !i.value.length] ]) ]) ]) ]), n("div", G, [ l(o(A), { align: "end" }, { default: t(() => [ l(o(m), { onClick: c }, { default: t(() => e[6] || (e[6] = [ d(" 关闭 ") ])), _: 1 }), l(o(m), { type: "primary", onClick: h }, { default: t(() => e[7] || (e[7] = [ d(" 确定 ") ])), _: 1 }) ]), _: 1 }) ]) ]), _: 1 }, 8, ["open"])); } }); export { se as default };