UNPKG

cc-ui-vue3

Version:

This template should help get you started developing with Vue 3 in Vite.

305 lines (302 loc) 9.18 kB
import { defineComponent as b, ref as v, resolveComponent as u, createElementBlock as f, openBlock as i, createElementVNode as e, createVNode as n, withCtx as x, createTextVNode as r, Fragment as I, renderList as k, toDisplayString as h, normalizeClass as S, createBlock as D, resolveDynamicComponent as U } from "vue"; import { CcText as N } from "./cc-ui-vue3.es.js"; const T = { class: "flex flex-col" }, j = { class: "max-w-500px" }, V = "http://api-test.ynlctech.com", E = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJidUlkIjozMjIsInVpZCI6NDU5MzUsImlzU3VwZXIiOjAsImVudGl0eU5hbWUiOiIiLCJ1dHlwZSI6NCwidGVuYW50SWQiOjEwMjYsImlzcyI6IlNKQUNPIiwiZW50aXR5SWQiOjE3NDg1OCwibW9kdWxlSWQiOjE0LCJleHAiOjE3NTU4MjUxNzh9.NypcyYl1PqLmtVAMMMEGozEcXDV9dN3atmR5fAdsZHM", w = /* @__PURE__ */ b({ __name: "CcSystemSwitchDoc", setup(p) { const d = [ { name: "currentId", remark: "当前系统 ID", type: "number", default: "-" }, { name: "jumpType", remark: "跳转方式", type: "location | open", default: "location" }, { name: "token", remark: "token", type: "string", default: "-" }, { name: "userInfo", remark: "用户信息", type: "UserInfo", default: "-" }, { name: "baseUrl", remark: "接口地址", type: "string", default: "-" } ], c = [ { name: "openDialog", remark: "打开弹窗", type: "(moduleList?: ModuleItem[]) => void" } ], l = { buId: 322, loginType: "2" }, o = v(null), m = () => { var s; (s = o.value) == null || s.openDialog(); }; return (s, t) => { const g = u("el-button"), C = u("CcSystemSwitch"), a = u("el-table-column"), _ = u("el-table"); return i(), f("div", T, [ t[1] || (t[1] = e("h1", { class: "mb-2rem text-2.2rem fw-600" }, " CcSystemSwitch 系统切换菜单组件 ", -1)), t[2] || (t[2] = e("div", { class: "m-y-1rem" }, "显示系统切换菜单", -1)), t[3] || (t[3] = e("h2", { class: "mt-2.25rem mb-1.25rem pb-0.3rem text-1.65rem fw-600" }, " 基础用法 ", -1)), e("div", j, [ n(g, { onClick: m }, { default: x(() => t[0] || (t[0] = [ r("点击查看组件", -1) ])), _: 1, __: [0] }), n(C, { ref_key: "refSystemSwitch", ref: o, jumpType: "window", token: E, baseUrl: V, userInfo: l, currentId: "15" }, null, 512) ]), t[4] || (t[4] = e("p", null, [ r(" 在"), e("code", null, "openDialog"), r("传递系统列表数据,或者传递"), e("code", null, "token"), r("、"), e("code", null, "userInfo"), r("、"), e("code", null, "baseUrl"), r("数据 ") ], -1)), t[5] || (t[5] = e("pre", { class: "bg-[#f5f7fa] p-24px" }, [ e("code", null, ` <CcSystemSwitch ref="refSystemSwitch" jumpType="window" :token="token" :baseUrl="baseUrl" :userInfo="userInfo" currentId="14" ></CcSystemSwitch> const onShow = () => { refSystemSwitch.value?.openDialog(); }; `) ], -1)), t[6] || (t[6] = e("h3", { class: "mt-1.5rem text-1.35rem fw-600" }, "Attributes", -1)), n(_, { key: "attributes", data: d, style: { width: "100%" } }, { default: x(() => [ n(a, { prop: "name", label: "属性名", width: "230" }), n(a, { prop: "remark", label: "说明", width: "230" }), n(a, { prop: "type", label: "类型", width: "230" }), n(a, { prop: "default", label: "Default", "min-width": "230" }) ]), _: 1 }), t[7] || (t[7] = e("h3", { class: "mt-1.5rem text-1.35rem fw-600" }, "Exposes", -1)), n(_, { key: "exposes", data: c, style: { width: "100%" } }, { default: x(() => [ n(a, { prop: "name", label: "方法名", width: "230" }), n(a, { prop: "remark", label: "说明", width: "230" }), n(a, { prop: "type", label: "Type", "min-width": "230" }) ]), _: 1 }), t[8] || (t[8] = e("h3", { class: "mt-1.5rem text-1.35rem fw-600" }, "Type Declarations", -1)), t[9] || (t[9] = e("pre", { class: "bg-[#f5f7fa] p-24px" }, [ e("code", null, ` interface ModuleItem { moduleId: number; moduleName: string; moduleIcon: string; systemUrl: string; [key: string]: any; } interface UserInfo { buId: string | number; loginType: string; [key: string]: any; } `) ], -1)) ]); }; } }); w.install = (p) => { p.component(w.__name, w); }; const M = { class: "flex flex-col" }, O = { class: "max-w-500px" }, y = /* @__PURE__ */ b({ __name: "CcTextDoc", setup(p) { const d = [ { name: "text", remark: "显示的文本", type: "string", default: '""' }, { name: "textClass", remark: "文本样式", type: "string", default: '""' } ]; return (c, l) => { const o = u("el-table-column"), m = u("el-table"); return i(), f("div", M, [ l[0] || (l[0] = e("h1", { class: "mb-2rem text-2.2rem fw-600" }, "CcTextDoc 文本", -1)), l[1] || (l[1] = e("div", { class: "m-y-1rem" }, "溢出文本自动隐藏,hover时悬浮显示全部内容", -1)), l[2] || (l[2] = e("h2", { class: "mt-2.25rem mb-1.25rem pb-0.3rem text-1.65rem fw-600" }, " 基础用法 ", -1)), l[3] || (l[3] = e("p", null, [ r("由"), e("code", null, " text "), r("属性来传递显示的文本。") ], -1)), e("div", O, [ n(N, { textClass: "text-1.2rem c-[#333]", text: "这是一段很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的文字" }) ]), l[4] || (l[4] = e("pre", { class: "bg-[#f5f7fa] p-24px" }, [ e("code", null, ` <CcText text="text" textClass="text-1.2rem c-[#333]" /> `) ], -1)), l[5] || (l[5] = e("h3", { class: "mt-1.5rem text-1.35rem fw-600" }, "Attributes", -1)), n(m, { data: d, style: { width: "100%" } }, { default: x(() => [ n(o, { prop: "name", label: "属性名", width: "230" }), n(o, { prop: "remark", label: "说明", width: "230" }), n(o, { prop: "type", label: "类型", width: "230" }), n(o, { prop: "default", label: "Default", width: "230" }) ]), _: 1 }) ]); }; } }); y.install = (p) => { p.component(y.__name, y); }; const z = { class: "cc-ui-page flex overflow-hidden h-100vh" }, J = { class: "p-x-32px p-y-48px overflow-y-auto overflow-x-hidden min-w-226px" }, W = { class: "group-[&:not(:first-child)]:pt-24px pb-8px fw-700 text-1rem lh-24px" }, $ = ["onClick"], A = { class: "flex-1 py-48px px-32px overflow-y-auto overflow-x-hidden" }, Z = /* @__PURE__ */ b({ __name: "HomeView", setup(p) { const d = [ { name: "业务组件", children: [ { name: "系统切换组件", component: w } ] }, { name: "基础组件", children: [ { name: "文本", component: y } ] } ], c = v(d[0].children[0]); return (l, o) => (i(), f("div", z, [ e("div", J, [ (i(), f(I, null, k(d, (m) => e("div", { key: m.name, class: "group" }, [ e("div", W, h(m.name), 1), (i(!0), f(I, null, k(m.children, (s) => (i(), f("div", { key: s.name, class: S([ "px-16px py-10px c-[#606266] text-13px fw-500 lh-20px cursor-pointer hover:c-[#79bbff] rounded-8px", c.value.name === s.name ? "c-[#409EFF]! bg-[#edf6ff]! text-0.9rem!" : "" ]), onClick: (t) => c.value = s }, h(s.name), 11, $))), 128)) ])), 64)) ]), e("div", A, [ (i(), D(U(c.value.component))) ]) ])); } }); export { Z as default };