c-admin-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +232 -0
- package/dist/c-admin-kit.css +1 -0
- package/dist/c-admin-kit.js +2482 -0
- package/dist/c-admin-kit.umd.cjs +10 -0
- package/dist/components/AsyncButton/index.vue.d.ts +48 -0
- package/dist/components/CollapsibleContainer/index.vue.d.ts +73 -0
- package/dist/components/CustomDrawer/index.vue.d.ts +149 -0
- package/dist/components/ImagePreview/index.vue.d.ts +34 -0
- package/dist/components/SearchBox/index.vue.d.ts +122 -0
- package/dist/components/SelectWithAll/index.vue.d.ts +169 -0
- package/dist/components/SelectWithPage/index.vue.d.ts +78 -0
- package/dist/components/SimpleTable/index.vue.d.ts +337 -0
- package/dist/components/SimpleTable/useTableColumnConfig.d.ts +5 -0
- package/dist/components/diff/index.vue.d.ts +33 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/composables/index.d.ts +6 -0
- package/dist/composables/useConfirmAction.d.ts +5 -0
- package/dist/composables/useConfirmSubmit.d.ts +5 -0
- package/dist/composables/useDialog.d.ts +5 -0
- package/dist/composables/useDownload.d.ts +5 -0
- package/dist/composables/useForm.d.ts +5 -0
- package/dist/composables/useListPage.d.ts +5 -0
- package/dist/index.d.ts +9 -0
- package/dist/types.d.ts +282 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/scroll-to.d.ts +7 -0
- package/dist/utils/searchFieldFactory.d.ts +34 -0
- package/dist/utils/treeManager.d.ts +64 -0
- package/dist/utils/validate.d.ts +30 -0
- package/package.json +86 -0
- package/src/components/AsyncButton/index.vue +58 -0
- package/src/components/CollapsibleContainer/index.vue +240 -0
- package/src/components/CustomDrawer/index.vue +167 -0
- package/src/components/ImagePreview/index.vue +88 -0
- package/src/components/SearchBox/index.vue +582 -0
- package/src/components/SelectWithAll/index.vue +281 -0
- package/src/components/SelectWithPage/index.vue +204 -0
- package/src/components/SimpleTable/index.vue +781 -0
- package/src/components/SimpleTable/useTableColumnConfig.ts +139 -0
- package/src/components/diff/index.vue +265 -0
- package/src/components/index.ts +35 -0
- package/src/composables/index.ts +6 -0
- package/src/composables/useConfirmAction.ts +62 -0
- package/src/composables/useConfirmSubmit.ts +68 -0
- package/src/composables/useDialog.ts +48 -0
- package/src/composables/useDownload.ts +83 -0
- package/src/composables/useForm.ts +114 -0
- package/src/composables/useListPage.ts +243 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +44 -0
- package/src/types.ts +344 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/scroll-to.ts +60 -0
- package/src/utils/searchFieldFactory.ts +302 -0
- package/src/utils/treeManager.ts +218 -0
- package/src/utils/validate.ts +64 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
(function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@element-plus/icons-vue"),require("sortablejs"),require("dayjs"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","@element-plus/icons-vue","sortablejs","dayjs","element-plus"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_.CAdminKit={},_.Vue,_.ElementPlusIconsVue,_.Sortable,_.dayjs,_.ElementPlus))})(this,(function(_,e,Q,Te,ie,K){"use strict";const ce=e.defineComponent({name:"CAsyncButton",__name:"index",props:{onClick:{type:Function,default:null},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(t){const r=t,a=e.ref(!1),n=e.computed(()=>r.loading||a.value),i=e.computed(()=>r.disabled||n.value);async function c(l){if(!r.onClick||i.value)return;const f=r.onClick(l);if(f&&typeof f.then=="function"){a.value=!0;try{await f}finally{a.value=!1}}}return(l,f)=>{const u=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(u,e.mergeProps(l.$attrs,{loading:n.value,disabled:i.value,onClick:c}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["loading","disabled"])}}}),Be={class:"empty-text"},de="__SELECT_ALL__",Ee=e.defineComponent({name:"CSelectWithAll",__name:"index",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},showSelectAll:{type:Boolean,default:!0},selectAllLabel:{type:String,default:"全选"},placeholder:{type:String,default:"请选择"},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},remote:{type:Boolean,default:!1},remoteMethod:{type:Function,default:null},remoteSearchKey:{type:String,default:"keyword"},remoteParams:{type:Object,default:()=>({})},debounceDelay:{type:Number,default:300},loadingText:{type:String,default:"加载中..."},emptyText:{type:String,default:"暂无数据"},searchOnOpen:{type:Boolean,default:!1},initialSearchKeyword:{type:String,default:""},dataKey:{type:String,default:"data"}},emits:["update:modelValue","change","remote-search"],setup(t,{emit:r}){const a=t,n=r,i=e.ref([...a.modelValue]),c=e.ref([]),l=e.ref(!1);let f=null;const u=e.computed(()=>a.remote?c.value:a.options),w=e.computed(()=>u.value.filter(d=>!d.disabled).map(d=>d[a.valueKey])),y=e.computed(()=>w.value.length===0?!1:w.value.every(d=>i.value.includes(d))),b=e.computed(()=>{const d=i.value.filter(p=>w.value.includes(p)).length;return d>0&&d<w.value.length}),E=d=>{d?i.value=[...new Set([...w.value])]:i.value=[],n("update:modelValue",i.value),n("change",i.value)},M=d=>{const p=d.filter(m=>m!==de);i.value=p,n("update:modelValue",p),n("change",p)},o=(d="")=>{f&&clearTimeout(f),f=setTimeout(async()=>{if(a.remoteMethod){l.value=!0;try{const p={...a.remoteParams,[a.remoteSearchKey]:d||""},m=await a.remoteMethod(p);let x=[];m&&m.code===200?x=m[a.dataKey]||m.data||[]:Array.isArray(m)&&(x=m),c.value=Array.isArray(x)?x:[],n("remote-search",{query:d,result:c.value})}catch(p){console.error("CSelectWithAll 远程搜索失败:",p),c.value=[]}finally{l.value=!1}}},a.debounceDelay)},s=d=>{d&&a.remote&&a.searchOnOpen&&o(a.initialSearchKeyword)};return e.watch(()=>a.modelValue,d=>{i.value=[...d||[]]},{deep:!0}),e.onMounted(()=>{a.remote&&a.searchOnOpen&&o()}),e.onBeforeUnmount(()=>{f&&clearTimeout(f)}),(d,p)=>{const m=e.resolveComponent("el-checkbox"),x=e.resolveComponent("el-option"),N=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(N,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=T=>i.value=T)},d.$attrs,{multiple:"","collapse-tags":"","collapse-tags-tooltip":"",filterable:"",placeholder:t.placeholder,remote:t.remote,"remote-method":t.remote?o:void 0,loading:l.value,"loading-text":t.loadingText,onChange:M,onVisibleChange:s}),{empty:e.withCtx(()=>[e.createElementVNode("div",Be,e.toDisplayString(t.emptyText),1)]),default:e.withCtx(()=>[t.showSelectAll?(e.openBlock(),e.createBlock(x,{key:0,value:de,label:t.selectAllLabel,class:"select-all-option"},{default:e.withCtx(()=>[e.createVNode(m,{"model-value":y.value,indeterminate:b.value,onChange:E,onClick:p[0]||(p[0]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.selectAllLabel),1)]),_:1},8,["model-value","indeterminate"])]),_:1},8,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,T=>(e.openBlock(),e.createBlock(x,{key:T[t.valueKey],label:T[t.labelKey],value:T[t.valueKey],disabled:T.disabled},null,8,["label","value","disabled"]))),128))]),_:1},16,["modelValue","placeholder","remote","remote-method","loading","loading-text"])}}}),G=(t,r)=>{const a=t.__vccOpts||t;for(const[n,i]of r)a[n]=i;return a},pe=G(Ee,[["__scopeId","data-v-904634e0"]]),Ne={class:"remote-select-wrapper"},Ve={class:"loading-text"},ue=G(e.defineComponent({name:"CSelectWithPage",__name:"index",props:{modelValue:{type:[String,Number],default:""},placeholder:{type:String,default:"请输入关键词搜索"},labelKey:{type:String,default:"keyword"},valueKey:{type:String,default:"id"},fetchApi:{type:Function,required:!0},initialOptions:{type:Array,default:()=>[]},debounceDelay:{type:Number,default:300}},emits:["update:modelValue","selectItem","clear"],setup(t,{emit:r}){const a=t,n=r,i=e.ref(a.modelValue),c=e.ref([...a.initialOptions]),l=e.ref(!1),f=e.ref("");let u=null;const w=e.ref(null),y=async(o="")=>{if(!(l.value||!a.fetchApi)){l.value=!0;try{const s=await a.fetchApi({keyword:o.trim(),pageNum:1,pageSize:2e3}),d=((s==null?void 0:s.rows)||(s==null?void 0:s.data)||[]).slice(0,1e3);if(c.value=Array.isArray(d)?d:[],i.value){const p=c.value.find(m=>m[a.valueKey]===i.value);p&&(w.value=p)}}catch(s){console.error("CSelectWithPage 加载数据失败:",s),c.value=[]}finally{l.value=!1}}},b=o=>{if(u&&clearTimeout(u),f.value=o,!o.trim()){c.value=[...a.initialOptions];return}u=setTimeout(()=>{y(o)},a.debounceDelay)},E=()=>{f.value="",c.value=[...a.initialOptions],w.value=null,i.value="",n("update:modelValue",""),n("selectItem",null),n("clear")},M=o=>{const s=c.value.find(d=>d[a.valueKey]===o);w.value=s||null,n("update:modelValue",o||""),n("selectItem",w.value)};return e.watch(()=>a.modelValue,async o=>{o!==i.value&&(i.value=o,o&&!c.value.some(s=>s[a.valueKey]===o)&&await y(""),w.value=c.value.find(s=>s[a.valueKey]===o)||null)},{immediate:!0}),e.watch(i,o=>{o!==a.modelValue&&n("update:modelValue",o||"")}),e.onBeforeUnmount(()=>{u&&clearTimeout(u)}),(o,s)=>{const d=e.resolveComponent("el-option"),p=e.resolveComponent("el-icon"),m=e.resolveComponent("el-select");return e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(m,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=x=>i.value=x),filterable:"",remote:"","remote-method":b,loading:l.value,placeholder:t.placeholder,clearable:""},o.$attrs,{onClear:E,onChange:M}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,x=>(e.openBlock(),e.createBlock(d,{key:x[t.valueKey],label:x[t.labelKey],value:x[t.valueKey]},null,8,["label","value"]))),128)),l.value?(e.openBlock(),e.createBlock(d,{key:0,disabled:"",value:""},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.createVNode(p,{class:"is-loading"},{default:e.withCtx(()=>[e.createVNode(e.unref(Q.Loading))]),_:1}),s[1]||(s[1]=e.createTextVNode(" 加载中... ",-1))])]),_:1})):e.createCommentVNode("",!0),!l.value&&c.value.length===0&&f.value?(e.openBlock(),e.createBlock(d,{key:1,disabled:"",value:""},{default:e.withCtx(()=>[...s[2]||(s[2]=[e.createElementVNode("div",{class:"no-data-text"},"暂无数据",-1)])]),_:1})):e.createCommentVNode("",!0),!l.value&&c.value.length===0&&!f.value?(e.openBlock(),e.createBlock(d,{key:2,disabled:"",value:""},{default:e.withCtx(()=>[...s[3]||(s[3]=[e.createElementVNode("div",{class:"no-data-text"},"请输入关键词进行搜索",-1)])]),_:1})):e.createCommentVNode("",!0)]),_:1},16,["modelValue","loading","placeholder"])])}}}),[["__scopeId","data-v-dea4bdcf"]]),Ae={class:"search-box"},De={class:"button-group"},fe=G(e.defineComponent({name:"CSearchBox",__name:"index",props:{fields:{type:Array,default:()=>[]},searchText:{type:String,default:"查询"},resetText:{type:String,default:"重置"},exportText:{type:String,default:"导出"},showExport:{type:Boolean,default:!1},initialValues:{type:Object,default:()=>({})},fieldsPerRow:{type:Number,default:4},labelWidth:{type:String,default:"80px"},defaultExpanded:{type:Boolean,default:!1}},emits:["search","reset","export","field-change"],setup(t,{expose:r,emit:a}){e.useCssVars(h=>({v7dbee7c4:t.labelWidth}));const n=t,i=a,c=e.ref(!1),l=e.ref(n.defaultExpanded),f=e.reactive({}),u=h=>h.visible===void 0?!0:typeof h.visible=="function"?h.visible(s.value):e.unref(h.visible),w=e.computed(()=>n.fields.filter(h=>u(h))),y=e.computed(()=>Math.floor(24/n.fieldsPerRow)),b=e.computed(()=>2*n.fieldsPerRow),E=e.computed(()=>w.value.length>b.value),M=e.computed(()=>l.value||!E.value?w.value:w.value.slice(0,b.value)),o=()=>{const h={};return n.fields.forEach(g=>{if(n.initialValues[g.prop]!==void 0)h[g.prop]=n.initialValues[g.prop];else switch(g.type){case"select":h[g.prop]=g.multiple?[]:"";break;case"daterange":h[g.prop]=[];break;case"number":h[g.prop]=g.defaultValue??null;break;default:h[g.prop]=g.defaultValue??""}}),h},s=e.ref(o()),d=async(h,g)=>{if(!h.relation)return;const{getOptions:L}=h.relation;if(g===void 0||g===""||g===null){f[h.prop]=h.defaultOptions||[];return}try{let V=[];if(typeof L=="function"){const W=L(g,s.value);V=W instanceof Promise?await W:W}else typeof L=="object"&&L[g]&&(V=L[g]);f[h.prop]=V||[]}catch(V){console.error(`加载字段 ${h.prop} 选项失败:`,V),f[h.prop]=[]}},p=()=>{n.fields.forEach(h=>{if(h.relation){const{dependOn:g}=h.relation,L=s.value[g];d(h,L)}})},m=h=>({...{clearable:h.clearable!==!1,placeholder:h.placeholder||`请${h.type==="input"||h.type==="number"?"输入":"选择"}${h.label}`},...h.props}),x=h=>h.relation?f[h.prop]||h.defaultOptions||[]:h.options||[],N=(h,g)=>{n.fields.filter(V=>V.relation&&V.relation.dependOn===h).forEach(V=>{V.multiple?s.value[V.prop]=[]:s.value[V.prop]="",d(V,g)}),i("field-change",{prop:h,value:g,form:{...s.value}})},T=()=>{l.value=!l.value},v=h=>{const g={};return n.fields.forEach(L=>{if(!u(L))return;const V=h[L.prop];if(L.dateRange){if(Array.isArray(V)&&V.length===2&&V[0]&&V[1]){const{startField:W,endField:Z,format:k}=L.dateRange;typeof k=="function"?(g[W]=k(V[0]),g[Z]=k(V[1])):(g[W]=V[0],g[Z]=V[1])}}else if(L.returnAllIds){const{fileIds:W}=L;if(V){const B=Array.isArray(V)?V:[V];W==null||W.forEach((F,j)=>{const z=B[j];z&&(g[F]=z)})}const Z=Array.isArray(V)?V:[V],k=Z[Z.length-1];k&&(g.currentKey=k,g[L.prop]=k)}else if(V!==""&&V!==null&&V!==void 0){if(Array.isArray(V)&&V.length===0)return;g[L.prop]=V}}),g},$=()=>{c.value=!0;const h=v(s.value);i("search",h),setTimeout(()=>{c.value=!1},300)},H=()=>{s.value=o(),p();const h=v(s.value);i("reset",h)},q=()=>{const h=v(s.value);i("export",h)};e.watch(()=>n.fields,(h,g)=>{(!g||h.length!==g.length?!0:h.some((V,W)=>{const Z=g[W];if(!Z)return!0;const{options:k,...B}=V,{options:F,...j}=Z;return JSON.stringify(B)!==JSON.stringify(j)}))&&(s.value=o()),p()},{deep:!0}),e.watch(()=>n.initialValues,h=>{Object.keys(h||{}).forEach(g=>{g in s.value&&(s.value[g]=h[g])}),p()},{deep:!0});const ae=h=>{if(h.key==="Enter"){const g=h.target;if(!g)return;const L=g.tagName==="INPUT"||g.tagName==="TEXTAREA",V=g.closest(".el-popper")||g.closest(".el-select-dropdown");L&&!V&&$()}};return e.onMounted(()=>{p()}),r({search:$,reset:H,export:q,getParams:()=>v(s.value),getAllParams:()=>({...s.value}),setValues:h=>{Object.keys(h||{}).forEach(g=>{g in s.value&&(s.value[g]=h[g])}),p()},toggleExpand:()=>{E.value&&T()}}),(h,g)=>{const L=e.resolveComponent("el-option"),V=e.resolveComponent("el-radio"),W=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-form-item"),k=e.resolveComponent("el-col"),B=e.resolveComponent("el-row"),F=e.resolveComponent("el-button"),j=e.resolveComponent("el-icon"),z=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(z,{model:s.value,"label-width":t.labelWidth,class:"search-form",onKeyup:ae},{default:e.withCtx(()=>[e.createVNode(B,{gutter:16,class:"search-fields"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,D=>{var ne,re,se,le;return e.openBlock(),e.createBlock(k,{key:D.prop,xs:24,sm:((ne=D.props)==null?void 0:ne.span)||12,md:((re=D.props)==null?void 0:re.span)||y.value,lg:((se=D.props)==null?void 0:se.span)||y.value,xl:((le=D.props)==null?void 0:le.span)||y.value,class:"field-col"},{default:e.withCtx(()=>[e.createVNode(Z,{label:D.label,prop:D.prop,class:e.normalizeClass({"is-required":D.required})},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(D.component||D.type),e.mergeProps({modelValue:s.value[D.prop],"onUpdate:modelValue":Y=>s.value[D.prop]=Y},{ref_for:!0},m(D),{style:{width:"100%"},onChange:Y=>N(D.prop,Y),onKeydown:e.withKeys(Y=>D.component==="el-input"?$:null,["enter"])}),{default:e.withCtx(()=>[D.component==="el-select"||D.type==="select"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(x(D),Y=>(e.openBlock(),e.createBlock(L,{key:Y.value,label:Y.label,value:Y.value},null,8,["label","value"]))),128)):D.component==="el-radio-group"||D.type==="radio"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(x(D),Y=>(e.openBlock(),e.createBlock(V,{key:Y.value,label:Y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y.label),1)]),_:2},1032,["label"]))),128)):D.component==="el-checkbox-group"||D.type==="checkbox"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(x(D),Y=>(e.openBlock(),e.createBlock(W,{key:Y.value,label:Y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y.label),1)]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:2},1040,["modelValue","onUpdate:modelValue","onChange","onKeydown"])),D.type==="slot"?e.renderSlot(h.$slots,D.slotName,{value:s.value[D.prop],onChange:Y=>s.value[D.prop]=Y},void 0,!0,0):e.createCommentVNode("",!0)]),_:2},1032,["label","prop","class"])]),_:2},1032,["sm","md","lg","xl"])}),128))]),_:3}),e.createVNode(B,{class:"action-row"},{default:e.withCtx(()=>[e.createVNode(k,{span:24,class:"action-col"},{default:e.withCtx(()=>[e.createElementVNode("div",De,[e.createVNode(F,{type:"primary",loading:c.value,onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.searchText),1)]),_:1},8,["loading"]),e.createVNode(F,{onClick:H},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.resetText),1)]),_:1}),t.showExport?(e.openBlock(),e.createBlock(F,{key:0,type:"success",onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.exportText),1)]),_:1})):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(F,{key:1,type:"text",class:"toggle-btn",onClick:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value?"收起":"展开")+" ",1),e.createVNode(j,{class:"toggle-icon"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createBlock(e.unref(Q.ArrowUp),{key:0})):(e.openBlock(),e.createBlock(e.unref(Q.ArrowDown),{key:1}))]),_:1})]),_:1})):e.createCommentVNode("",!0)])]),_:1})]),_:1})]),_:3},8,["model","label-width"])])}}}),[["__scopeId","data-v-760b27aa"]]),Me={class:"collapsible-container"},ve={class:"left-content"},$e={class:"right-panel"},Fe={class:"right-content"},me=G(e.defineComponent({name:"CCollapsibleContainer",__name:"index",props:{defaultCollapsed:{type:Boolean,default:!1},defaultWidth:{type:Number,default:240},minWidth:{type:Number,default:200},maxWidth:{type:Number,default:600},height:{type:String,default:"calc(100vh - 84px)"}},emits:["collapse-change","width-change"],setup(t,{expose:r,emit:a}){e.useCssVars(E=>({v5dad642c:u.value,v1c2deffa:t.height,v72e9676c:w.value}));const n=t,i=a,c=e.ref(n.defaultCollapsed),l=e.ref(n.defaultWidth),f=e.ref(!1),u=e.computed(()=>c.value?"48px 1fr":`${l.value}px 1fr`),w=e.computed(()=>c.value?"48px":`${l.value}px`),y=()=>{c.value=!c.value,i("collapse-change",c.value)},b=E=>{E.preventDefault(),f.value=!0;const M=E.clientX,o=l.value;let s=null,d=null;const p=()=>{d!==null&&(l.value=d,i("width-change",d),d=null),s=null},m=N=>{const T=N.clientX-M,v=o+T;d=Math.max(n.minWidth,Math.min(n.maxWidth,v)),s===null&&(s=requestAnimationFrame(p))},x=()=>{f.value=!1,s!==null&&cancelAnimationFrame(s),d!==null&&(l.value=d,i("width-change",d)),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",x),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",m),document.addEventListener("mouseup",x)};return r({toggleCollapse:y,isCollapsed:c,leftPanelWidth:l}),(E,M)=>{const o=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",{class:e.normalizeClass(["left-panel",{collapsed:c.value,resizing:f.value}])},[e.createElementVNode("div",{class:"toggle-btn",onClick:y},[e.createVNode(o,null,{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createBlock(e.unref(Q.Expand),{key:0})):(e.openBlock(),e.createBlock(e.unref(Q.Fold),{key:1}))]),_:1})]),e.withDirectives(e.createElementVNode("div",ve,[e.renderSlot(E.$slots,"left",{},void 0,!0)],512),[[e.vShow,!c.value]]),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"resize-handle",onMousedown:b},null,32))],2),e.createElementVNode("div",$e,[e.createElementVNode("div",Fe,[e.renderSlot(E.$slots,"right",{},void 0,!0)])])])}}}),[["__scopeId","data-v-d7447c42"]]),Oe={class:"drawer-footer"},he=G(e.defineComponent({name:"CCustomDrawer",__name:"index",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:""},size:{type:[String,Number],default:"30%"},direction:{type:String,default:"rtl",validator:t=>["rtl","ltr","ttb","btt"].includes(t)},showFooter:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},confirmLoading:{type:Boolean,default:!1},beforeClose:{type:Function,default:null},onClose:{type:Function,default:null},onConfirm:{type:Function,default:null},onCancel:{type:Function,default:null}},emits:["update:modelValue","close","confirm","cancel"],setup(t,{expose:r,emit:a}){const n=t,i=a,c=e.computed({get:()=>n.modelValue,set:y=>i("update:modelValue",y)}),l=y=>{n.beforeClose?n.beforeClose(y):y()},f=()=>{n.onClose&&n.onClose(),i("close")},u=()=>{n.onConfirm&&n.onConfirm(),i("confirm")},w=()=>{c.value=!1,n.onCancel&&n.onCancel(),i("cancel")};return r({open:()=>{c.value=!0},close:()=>{c.value=!1}}),(y,b)=>{const E=e.resolveComponent("el-button"),M=e.resolveComponent("el-drawer");return e.openBlock(),e.createBlock(M,{modelValue:c.value,"onUpdate:modelValue":b[0]||(b[0]=o=>c.value=o),title:t.title,size:t.size,direction:t.direction,"before-close":l,"close-on-click-modal":t.closeOnClickModal,"close-on-press-escape":t.closeOnPressEscape,"destroy-on-close":t.destroyOnClose,onClosed:f,class:e.normalizeClass({"drawer-with-footer":t.showFooter})},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["drawer-content",{"has-footer":t.showFooter}])},[e.renderSlot(y.$slots,"default",{},void 0,!0)],2)]),_:2},[t.showFooter?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",Oe,[e.createVNode(E,{onClick:w,size:"default"},{default:e.withCtx(()=>[...b[1]||(b[1]=[e.createTextVNode(" 取消 ",-1)])]),_:1}),e.createVNode(E,{type:"primary",loading:t.confirmLoading,onClick:u,size:"default"},{default:e.withCtx(()=>[...b[2]||(b[2]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"])])]),key:"0"}:void 0]),1032,["modelValue","title","size","direction","close-on-click-modal","close-on-press-escape","destroy-on-close","class"])}}}),[["__scopeId","data-v-4f318c2b"]]);function Pe(t,r){const a=e.computed(()=>(t.columns||[]).map((o,s)=>({...o,_key:o.prop||o.slot||o.type||o.label||`col_${s}`}))),n=e.computed(()=>a.value.filter(o=>o.type!=="selection"&&o.type!=="drag"&&o.label)),i=e.ref([]),c=e.ref([]),l=e.ref(null),f=e.ref(!1),u=e.computed(()=>t.tableKey?a.value.filter(o=>n.value.some(d=>d._key===o._key)?i.value.includes(o._key):!0):a.value),w=()=>`c_table_hide_cols_${t.tableKey}`;return{computedColumns:u,settingColumns:n,visibleColKeys:i,tempVisibleColKeys:c,popoverRef:l,savingColumns:f,initTableConfig:async()=>{if(i.value=n.value.map(o=>o._key),!!t.tableKey)try{let o=[];if(typeof t.getColumnConfigApi=="function"){const s=await t.getColumnConfigApi({tableKey:t.tableKey});o=(s==null?void 0:s.data)||s||[]}else{const s=localStorage.getItem(w());s&&(o=JSON.parse(s))}Array.isArray(o)&&o.length>0&&(i.value=n.value.filter(s=>!o.includes(s._key)).map(s=>s._key))}catch(o){console.warn("CSimpleTable: 获取表格隐藏列配置失败",o)}},handlePopoverShow:()=>{c.value=[...i.value]},handleCancelSettings:()=>{l.value&&l.value.hide()},handleConfirmSettings:async()=>{if(f.value=!0,t.tableKey){const o=n.value.filter(s=>!c.value.includes(s._key)).map(s=>s._key);try{typeof t.saveColumnConfigApi=="function"?await t.saveColumnConfigApi({tableKey:t.tableKey,hideFields:o}):localStorage.setItem(w(),JSON.stringify(o)),i.value=[...c.value],r&&e.nextTick(()=>{r()}),l.value&&l.value.hide()}catch(s){console.error("CSimpleTable: 保存表格隐藏列配置失败",s)}finally{f.value=!1}}else i.value=[...c.value],f.value=!1,l.value&&l.value.hide()}}}const Le={key:0,class:"table-header"},Re={class:"header-left"},ze={class:"header-right"},Ke={class:"column-setting-list"},Ie={style:{"text-align":"right","margin-top":"10px"}},He={class:"drag-handle",style:{cursor:"move"}},Ye={key:2},je={key:3},We={key:1,class:"table-pagination"},ge=G(e.defineComponent({name:"CSimpleTable",__name:"index",props:{scrollY:{type:[Number,String],default:""},autoHeight:{type:Boolean,default:!1},bottomOffset:{type:Number,default:20},minHeight:{type:Number,default:300},api:{type:Function,required:!1},columns:{type:Array,required:!0,default:()=>[]},emptyCellText:{type:String,default:"-"},showPagination:{type:Boolean,default:!0},pageSizes:{type:Array,default:()=>[10,20,50,100]},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!1},dataKey:{type:String,default:"data"},totalKey:{type:String,default:"total"},immediate:{type:Boolean,default:!0},initialPage:{type:Number,default:1},initialPageSize:{type:Number,default:10},params:{type:Object,default:()=>({})},border:{type:Boolean,default:!0},dataHandler:{type:Function,default:null},selectable:{type:Function,default:null},dragSort:{type:Boolean,default:!1},dragOptions:{type:Object,default:()=>({})},rowKey:{type:String,default:"id"},keepSelection:{type:Boolean,default:!0},defaultStatusMap:{type:Object,default:()=>({1:{text:"停用",type:"danger"},0:{text:"启用",type:"success"}})},tableKey:{type:String,default:""},getColumnConfigApi:{type:Function,default:null},saveColumnConfigApi:{type:Function,default:null}},emits:["selection-change","refresh","error","drag-sort","drag-start","drag-end"],setup(t,{expose:r,emit:a}){const n=t,i=a,c=e.ref(null),l=e.ref([]),f=e.ref(!1),u=e.ref(n.initialPage),w=e.ref(n.initialPageSize),y=e.ref(0),b=e.ref({});let E=null;const M=e.ref(null),o=e.ref(null);let s=null,d=null;const p=e.computed(()=>n.autoHeight?o.value:n.scrollY||null),m=()=>{if(!n.autoHeight||!M.value)return;const S=M.value.getBoundingClientRect(),A=window.innerHeight,O=S.top;let P=n.bottomOffset;n.showPagination&&(P+=60);const R=M.value.querySelector(".table-header");R&&(P+=R.offsetHeight);const I=A-O-P,J=Math.max(n.minHeight,I);(o.value===null||Math.abs(o.value-J)>2)&&(o.value=J)},x=(S,A)=>{if(!(!S||!A))return A in S?S[A]:A.split(".").reduce((O,P)=>O!=null?O[P]:void 0,S)},N=(S,A)=>{const O=x(S,A.prop);return O==null||O===""?A.emptyText||n.emptyCellText:String(O)},v=((S,A=150)=>{let O=null;const P=function(...R){O&&clearTimeout(O),O=setTimeout(()=>{S.apply(this,R)},A)};return P.cancel=()=>{O&&(clearTimeout(O),O=null)},P})(m,150),{computedColumns:$,settingColumns:H,tempVisibleColKeys:q,popoverRef:ae,savingColumns:h,initTableConfig:g,handlePopoverShow:L,handleCancelSettings:V,handleConfirmSettings:W}=Pe(n,m),Z=(S,A)=>{var P;return((P=(A||n.defaultStatusMap)[S])==null?void 0:P.type)||"info"},k=(S,A)=>{var P;return((P=(A||n.defaultStatusMap)[S])==null?void 0:P.text)||S},B=async(S={})=>{var A,O;if(n.api){f.value=!0;try{const P={pageNum:u.value,pageSize:w.value,...b.value,...n.params,...S};n.showPagination||(delete P.pageNum,delete P.pageSize);const R=await n.api(P);let I=null;R&&R.code===200?Array.isArray(R.data)?I={data:R.data}:R.data?I=R.data:I=R:Array.isArray(R)?I={data:R}:R!=null&&R.rows?I={data:R.rows,total:R.total}:I=R,I&&(l.value=I[n.dataKey]||((A=I.data)==null?void 0:A[n.dataKey])||I.rows||[],n.dataHandler&&(l.value=n.dataHandler(l.value)),y.value=I[n.totalKey]||((O=I.data)==null?void 0:O[n.totalKey])||I.total||0)}catch(P){console.error("CSimpleTable fetchData error:",P),l.value=[],y.value=0,i("error",P)}finally{f.value=!1,e.nextTick(()=>{m(),n.dragSort&&F()})}}},F=()=>{var P;if(!c.value)return;E&&E.destroy();const S=(P=c.value.$el)==null?void 0:P.querySelector(".el-table__body-wrapper tbody");if(!S)return;const O={...{animation:150,handle:".drag-handle",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",forceFallback:!0,onStart:R=>{i("drag-start",{oldIndex:R.oldIndex,element:R.item})},onEnd:R=>{const{oldIndex:I,newIndex:J}=R;if(I===void 0||J===void 0||I===J){i("drag-end",{oldIndex:I,newIndex:J,changed:!1});return}const X=l.value.splice(I,1)[0];l.value.splice(J,0,X),i("drag-sort",{oldIndex:I,newIndex:J,movedItem:X,data:l.value}),i("drag-end",{oldIndex:I,newIndex:J,changed:!0,movedItem:X})}},...n.dragOptions};E=Te.create(S,O)},j=()=>{B(),i("refresh")},z=()=>{u.value=n.initialPage,b.value={},B()},D=(S={})=>{u.value=n.initialPage,b.value={...S},B()},ne=S=>{u.value=S,B()},re=S=>{w.value=S,u.value=n.initialPage,B()},se=S=>{i("selection-change",S)},le=()=>{c.value&&c.value.clearSelection()},Y=(S,A)=>{c.value&&c.value.toggleRowSelection(S,A)},_t=()=>{c.value&&c.value.toggleAllSelection()},Tt=()=>c.value?c.value.getSelectionRows():[],Bt=(S=[])=>{!c.value||!Array.isArray(S)||(le(),e.nextTick(()=>{l.value.forEach(A=>{var O;S.includes(A[n.rowKey])&&((O=c.value)==null||O.toggleRowSelection(A,!0))})}))};e.watch(()=>n.params,S=>{u.value=n.initialPage,b.value={...S},B()},{deep:!0}),e.watch(()=>n.dragSort,S=>{S?e.nextTick(()=>{F()}):E&&(E.destroy(),E=null)}),e.watch(()=>n.autoHeight,S=>{S?(Se(),e.nextTick(m)):_e()});const Se=()=>{var A,O,P;if(!n.autoHeight)return;window.addEventListener("resize",v),s||(s=new ResizeObserver(v)),(A=M.value)!=null&&A.parentElement&&s.observe(M.value.parentElement);const S=(O=M.value)==null?void 0:O.previousElementSibling;S&&s.observe(S),d||(d=new MutationObserver(()=>{e.nextTick(v)})),(P=M.value)!=null&&P.parentElement&&d.observe(M.value.parentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})},_e=()=>{window.removeEventListener("resize",v),s&&s.disconnect(),d&&d.disconnect()};return r({refresh:j,reset:z,search:D,fetchData:B,clearSelection:le,toggleRowSelection:Y,toggleAllSelection:_t,getSelectionRows:Tt,setSelectionByKeys:Bt,tableData:l,tableRef:c,recalculateHeight:m}),e.onMounted(()=>{n.immediate&&B(),g(),e.nextTick(()=>{m()}),n.autoHeight&&Se()}),e.onUnmounted(()=>{_e(),v.cancel(),E&&(E.destroy(),E=null)}),(S,A)=>{const O=e.resolveComponent("el-icon"),P=e.resolveComponent("el-button"),R=e.resolveComponent("el-checkbox"),I=e.resolveComponent("el-checkbox-group"),J=e.resolveComponent("el-popover"),X=e.resolveComponent("el-table-column"),Et=e.resolveComponent("el-tag"),Nt=e.resolveComponent("el-table"),Vt=e.resolveComponent("el-pagination"),At=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:"c-simple-table",ref_key:"tableContainerRef",ref:M},[S.$slots.headerLeft||S.$slots.headerRight||t.tableKey?(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("div",Re,[e.renderSlot(S.$slots,"headerLeft",{},void 0,!0)]),e.createElementVNode("div",ze,[e.renderSlot(S.$slots,"headerRight",{},void 0,!0),t.tableKey?(e.openBlock(),e.createBlock(J,{key:0,ref_key:"popoverRef",ref:ae,placement:"bottom-end",title:"自定义列",width:200,trigger:"click",onShow:e.unref(L)},{reference:e.withCtx(()=>[e.createVNode(P,{size:"small"},{default:e.withCtx(()=>[e.createVNode(O,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Q.Setting))]),_:1}),A[3]||(A[3]=e.createTextVNode(" 自定义列 ",-1))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Ke,[e.createVNode(I,{modelValue:e.unref(q),"onUpdate:modelValue":A[0]||(A[0]=C=>e.isRef(q)?q.value=C:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(H),C=>(e.openBlock(),e.createElementBlock("div",{key:C._key,class:"column-setting-item"},[e.createVNode(R,{value:C._key,label:C._key},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["value","label"])]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",Ie,[e.createVNode(P,{size:"small",onClick:e.unref(V)},{default:e.withCtx(()=>[...A[4]||(A[4]=[e.createTextVNode("取消",-1)])]),_:1},8,["onClick"]),e.createVNode(P,{size:"small",type:"primary",loading:e.unref(h),onClick:e.unref(W)},{default:e.withCtx(()=>[...A[5]||(A[5]=[e.createTextVNode("确定",-1)])]),_:1},8,["loading","onClick"])])]),_:1},8,["onShow"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(Nt,e.mergeProps({ref_key:"tableRef",ref:c,data:l.value,border:t.border,style:{width:"100%"},"row-key":t.rowKey},S.$attrs,{onSelectionChange:se,"max-height":p.value,height:t.autoHeight?p.value:t.scrollY}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref($),(C,Dt)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C._key||Dt},[C.type==="drag"?(e.openBlock(),e.createBlock(X,{key:0,width:C.width||55,align:C.align||"center",fixed:C.fixed},{header:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(C.label||"排序"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",He,[e.createVNode(O,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Q.Rank))]),_:1})])]),_:2},1032,["width","align","fixed"])):C.type==="selection"?(e.openBlock(),e.createBlock(X,{key:1,selectable:t.selectable,"reserve-selection":t.keepSelection,type:"selection",width:C.width||55,align:C.align||"center"},null,8,["selectable","reserve-selection","width","align"])):C.type==="index"?(e.openBlock(),e.createBlock(X,{key:2,type:"index",label:C.label||"序号",width:C.width||60,align:C.align||"center"},null,8,["label","width","align"])):C.type==="status"?(e.openBlock(),e.createBlock(X,{key:3,prop:C.prop,label:C.label||"状态",width:C.width||100,align:C.align||"center",fixed:C.fixed,sortable:C.sortable},{default:e.withCtx(U=>[C.slot?e.renderSlot(S.$slots,C.slot,e.mergeProps({ref_for:!0},U),void 0,!0,0):(e.openBlock(),e.createBlock(Et,{key:1,type:Z(x(U.row,C.prop),C.statusMap),effect:C.effect||"light",size:C.size||"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k(x(U.row,C.prop),C.statusMap)),1)]),_:2},1032,["type","effect","size"]))]),_:2},1032,["prop","label","width","align","fixed","sortable"])):(e.openBlock(),e.createBlock(X,{key:4,prop:C.prop,label:C.label,width:C.width,"min-width":C.minWidth,align:C.align||"left",fixed:C.fixed,sortable:C.sortable,"show-overflow-tooltip":C.showOverflowTooltip!==!1},e.createSlots({default:e.withCtx(U=>[C.slot?e.renderSlot(S.$slots,C.slot,e.mergeProps({ref_for:!0},U),void 0,!0,0):C.render?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.render(U.row,U.column,U.$index)),{key:1})):C.formatter?(e.openBlock(),e.createElementBlock("span",Ye,e.toDisplayString(C.formatter(U.row,U.column,x(U.row,C.prop),U.$index)),1)):(e.openBlock(),e.createElementBlock("span",je,e.toDisplayString(N(U.row,C)),1))]),_:2},[C.headerSlot?{name:"header",fn:e.withCtx(U=>[e.renderSlot(S.$slots,C.headerSlot,e.mergeProps({ref_for:!0},U),void 0,!0)]),key:"0"}:void 0]),1032,["prop","label","width","min-width","align","fixed","sortable","show-overflow-tooltip"]))],64))),128)),e.renderSlot(S.$slots,"default",{},void 0,!0)]),_:3},16,["data","border","row-key","max-height","height"])),[[At,f.value]]),t.showPagination?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(Vt,{"current-page":u.value,"onUpdate:currentPage":A[1]||(A[1]=C=>u.value=C),"page-size":w.value,"onUpdate:pageSize":A[2]||(A[2]=C=>w.value=C),"page-sizes":t.pageSizes,total:y.value,layout:t.layout,background:t.background,onSizeChange:re,onCurrentChange:ne},null,8,["current-page","page-size","page-sizes","total","layout","background"])])):e.createCommentVNode("",!0)],512)}}}),[["__scopeId","data-v-c7177925"]]),Ue={class:"c-diff-container"},qe=["title","innerHTML"],ye=G(e.defineComponent({name:"CDiff",__name:"index",props:{oldText:{type:String,default:""},newText:{type:String,default:""},similarityThreshold:{type:Number,default:.6}},setup(t){const r=t,a=e.ref(!1),n=e.ref([]),i=o=>String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),c=(o,s)=>{const d=Array(o.length+1).fill(null).map(()=>Array(s.length+1).fill(0));for(let p=0;p<=o.length;p++)d[p][0]=p;for(let p=0;p<=s.length;p++)d[0][p]=p;for(let p=1;p<=o.length;p++)for(let m=1;m<=s.length;m++)d[p][m]=o[p-1]===s[m-1]?d[p-1][m-1]:1+Math.min(d[p-1][m],d[p][m-1],d[p-1][m-1]);return d[o.length][s.length]},l=(o,s)=>{if(!o&&!s)return 1;if(!o||!s)return 0;const d=o.length>s.length?o:s;return(d.length-c(o,s))/d.length},f=(o,s)=>{const d=Array.from(o),p=Array.from(s);if(d.length*p.length>1e6)return[...o?[{type:"removed",value:o}]:[],...s?[{type:"added",value:s}]:[]];const m=Array(d.length+1).fill(null).map(()=>new Int32Array(p.length+1));for(let $=0;$<=d.length;$++)for(let H=0;H<=p.length;H++)$===0?m[$][H]=H:H===0?m[$][H]=$:d[$-1]===p[H-1]?m[$][H]=m[$-1][H-1]:m[$][H]=1+Math.min(m[$-1][H],m[$][H-1],m[$-1][H-1]);const x=[];let N=d.length,T=p.length;for(;N>0||T>0;)N>0&&T>0&&d[N-1]===p[T-1]?(x.push({type:"unchanged",value:d[N-1]}),N--,T--):N>0&&(T===0||m[N][T]===m[N-1][T]+1)?(x.push({type:"removed",value:d[N-1]}),N--):(x.push({type:"added",value:p[T-1]}),T--);const v=[];for(const $ of x.reverse())v.length&&v[v.length-1].type===$.type?v[v.length-1].value+=$.value:v.push({...$});return v},u=o=>o?o.split(/\r?\n/):[],w=(o,s)=>{const d=u(o),p=u(s),m=[];let x=0,N=0;for(;x<d.length||N<p.length;){if(x>=d.length){m.push({type:"added",value:p[N++]+`
|
|
2
|
+
`});continue}if(N>=p.length){m.push({type:"removed",value:d[x++]+`
|
|
3
|
+
`});continue}const T=d[x],v=p[N],$=T.trim(),H=v.trim(),q=l($,H),ae=Math.min(T.length,v.length)/Math.max(T.length,v.length||1),h=x+1<d.length?l(d[x+1].trim(),H):0,g=N+1<p.length?l($,p[N+1].trim()):0,L=Math.max(q,h,g);q>=r.similarityThreshold&&q===L&&ae>.5?(T===v?m.push({type:"unchanged",value:T+`
|
|
4
|
+
`}):(m.push(...f(T,v)),m.push({type:"unchanged",value:`
|
|
5
|
+
`})),x++,N++):h>q&&h>=r.similarityThreshold?(m.push({type:"removed",value:T+`
|
|
6
|
+
`}),x++):g>q&&g>=r.similarityThreshold?(m.push({type:"added",value:v+`
|
|
7
|
+
`}),N++):q<.3?(m.push({type:"removed",value:T+`
|
|
8
|
+
`}),m.push({type:"added",value:v+`
|
|
9
|
+
`}),x++,N++):(m.push(...f(T,v)),m.push({type:"unchanged",value:`
|
|
10
|
+
`}),x++,N++)}return m};let y=!1;const b=async()=>{if(a.value=!0,y=!1,await e.nextTick(),await new Promise(o=>setTimeout(o,10)),!y)try{n.value=w(r.oldText,r.newText)}catch(o){console.error("CDiff compute error:",o),n.value=[{type:"unchanged",value:"Diff 计算出错"}]}finally{y||(a.value=!1)}};e.watch(()=>[r.oldText,r.newText],()=>{y=!0,b()},{immediate:!0});const E=o=>({"diff-removed":o.type==="removed","diff-added":o.type==="added"}),M=o=>o.type==="removed"?"已删除":o.type==="added"?"已添加":"";return(o,s)=>{const d=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(p,m)=>(e.openBlock(),e.createElementBlock("span",{key:m,class:e.normalizeClass(E(p)),title:M(p),innerHTML:i(p.value)},null,10,qe))),128))])),[[d,a.value]])}}}),[["__scopeId","data-v-29510e70"]]),Ze={class:"image-slot"},be=G(e.defineComponent({name:"CImagePreview",__name:"index",props:{src:{type:[String,Array],default:""},width:{type:[Number,String],default:"60px"},height:{type:[Number,String],default:"60px"}},setup(t){const r=t,a=e.computed(()=>r.src?Array.isArray(r.src)?r.src.map(l=>String(l).trim()).filter(Boolean):String(r.src).split(",").map(l=>l.trim()).filter(Boolean):[]),n=e.computed(()=>a.value[0]||""),i=e.computed(()=>typeof r.width=="string"?r.width:`${r.width}px`),c=e.computed(()=>typeof r.height=="string"?r.height:`${r.height}px`);return(l,f)=>{const u=e.resolveComponent("el-icon"),w=e.resolveComponent("el-image");return e.openBlock(),e.createBlock(w,e.mergeProps({src:n.value,fit:"cover",style:`width:${i.value};height:${c.value};`,"preview-src-list":a.value,"preview-teleported":""},l.$attrs),{error:e.withCtx(()=>[e.createElementVNode("div",Ze,[e.createVNode(u,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Q.PictureFilled))]),_:1})])]),_:1},16,["src","style","preview-src-list"])}}}),[["__scopeId","data-v-cd23dea8"]]),Ce=[ce,pe,ue,fe,me,he,ge,ye,be];function Je(t={}){const{apiList:r,apiChangeState:a,apiDelete:n,apiBatchDelete:i,apiExport:c,addPath:l,editPath:f,navigate:u,exportFileName:w="数据导出",stateKey:y="state",idKey:b="id",activeValue:E=1,inactiveValue:M=0,statusMap:o={0:"启用",1:"停用"},deleteConfirmText:s="确定要删除该数据吗?删除后将无法恢复!",deleteSuccessText:d="删除成功",deleteErrorText:p="删除失败",openDialog:m}=t,x=e.ref(null),N=e.ref({}),T=k=>{typeof u=="function"?u(k):console.warn("useListPage: 未提供 navigate 函数,如需路由跳转请在 options 中传入 navigate: (loc) => router.push(loc)")};return{tableRef:x,searchParams:N,handleSearch:k=>{var B,F;N.value=k||{},(F=(B=x.value)==null?void 0:B.search)==null||F.call(B,N.value)},handleReset:()=>{var k,B;N.value={},(B=(k=x.value)==null?void 0:k.reset)==null||B.call(k)},changeState:async(k,B)=>{var F,j;if(!a){console.warn("useListPage: 未提供 apiChangeState 接口");return}try{const D=k[y]===E?M:E,ne=o[D]||"更新";await K.ElMessageBox.confirm(`确定要${ne}该数据吗?`,"提示",{type:"warning"}),await a({[b]:k[b],[y]:D}),K.ElMessage.success(`${ne}成功`),(j=(F=x.value)==null?void 0:F.refresh)==null||j.call(F),B==null||B(k)}catch(z){z!=="cancel"&&z!=="close"&&K.ElMessage.error("操作失败")}},handleDelete:async(k,B)=>{var F,j;if(!n){console.warn("useListPage: 未提供 apiDelete 接口");return}try{await K.ElMessageBox.confirm(s,"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"error",distinguishCancelAndClose:!0}),await n({[b]:k[b]}),K.ElMessage.success(d),(j=(F=x.value)==null?void 0:F.refresh)==null||j.call(F),B==null||B(k)}catch(z){z!=="cancel"&&z!=="close"&&K.ElMessage.error(p)}},handleBatchDelete:async(k,B)=>{var F,j;if(!n){console.warn("useListPage: 未提供 apiDelete 接口");return}if(!k||k.length===0){K.ElMessage.warning("请选择要删除的数据");return}try{await K.ElMessageBox.confirm(`确定要删除选中的 ${k.length} 条数据吗?删除后将无法恢复!`,"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"error",distinguishCancelAndClose:!0});const z=k.map(D=>D[b]);i?await i({ids:z}):n.batch?await n.batch({ids:z}):await Promise.all(z.map(D=>n({[b]:D}))),K.ElMessage.success(`成功删除 ${k.length} 条数据`),(j=(F=x.value)==null?void 0:F.refresh)==null||j.call(F),B==null||B(k)}catch(z){z!=="cancel"&&z!=="close"&&K.ElMessage.error("删除失败")}},handleDialog:k=>{typeof m=="function"&&m(k)},exportExcel:async()=>{if(!c){console.warn("useListPage: 未提供 apiExport 接口");return}try{const k=await c(N.value),B=(k==null?void 0:k.data)||k,F=B instanceof Blob?B:new Blob([B],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),j=window.URL.createObjectURL(F),z=document.createElement("a");z.href=j,z.download=`${w}_${Date.now()}.xlsx`,document.body.appendChild(z),z.click(),document.body.removeChild(z),window.URL.revokeObjectURL(j),K.ElMessage.success("导出成功")}catch{K.ElMessage.error("导出失败")}},handleAdd:(k={})=>{if(!l){console.warn("useListPage: 未提供 addPath");return}T({path:l,query:k})},handleEdit:(k,B={})=>{if(!f){console.warn("useListPage: 未提供 editPath");return}T({path:f,query:{id:k[b],...B}})},handleView:(k,B,F={})=>{if(!B){console.warn("useListPage: 未提供 detailPath");return}T({path:B,query:{id:k[b],...F}})},refresh:()=>{var k,B;(B=(k=x.value)==null?void 0:k.refresh)==null||B.call(k)},apiList:r}}function Xe(t={}){const{initFormData:r={},rules:a={},onSuccess:n,onError:i,transform:c}=t,l=e.ref(null),f=()=>typeof r=="function"?r():r,u=e.reactive({...f()}),w=e.ref(!1),y=async(p,m="操作成功",x,N=!1)=>{if(!(!l.value&&!N))try{if(!N&&!await b()){K.ElMessage.warning("请检查表单填写是否正确");return}w.value=!0;const T=x||c,v=T?T(u):u,$=await p(v);return m&&K.ElMessage.success(m),n==null||n($),$}catch(T){throw console.error("useForm submit error:",T),i==null||i(T),T}finally{w.value=!1}},b=async()=>{if(!l.value)return!1;try{return await l.value.validate(),!0}catch{return!1}};return{formRef:l,formData:u,loading:w,rules:a,submit:y,validate:b,validateField:(p,m)=>{l.value&&l.value.validateField(p,m)},reset:()=>{var p;(p=l.value)==null||p.resetFields()},clearValidate:p=>{var m;(m=l.value)==null||m.clearValidate(p)},setFormData:p=>{Object.assign(u,p)},resetFormData:()=>{Object.keys(u).forEach(p=>{delete u[p]}),Object.assign(u,f())}}}function Qe(t,r={}){const{onSuccess:a,onError:n,confirmTitle:i="提示",confirmButtonText:c="确认",cancelButtonText:l="取消",confirmType:f="warning"}=r,u=e.ref(!1);return{execute:async y=>{try{u.value=!0;const b={...y,confirm:0},E=await t(b);if(E&&E.code===200&&E.msg){await K.ElMessageBox.confirm(E.msg,i,{confirmButtonText:c,cancelButtonText:l,type:f});const M={...y,confirm:1},o=await t(M);return a==null||a(o),o}else return a==null||a(E),E}catch(b){throw n==null||n(b),b}finally{u.value=!1}},loading:u}}function Ge(t,r,a={}){const{title:n="提示",message:i="确定要执行此操作吗?",confirmButtonText:c="确定",cancelButtonText:l="取消",type:f="warning",successMessage:u="操作成功",cancelMessage:w="已取消操作",errorMessage:y="操作失败",showCancelMessage:b=!0,messageBoxOptions:E={}}=a;return async(...o)=>{try{await K.ElMessageBox.confirm(i,n,{confirmButtonText:c,cancelButtonText:l,type:f,...E});const s=await t(...o);return u&&K.ElMessage({type:"success",message:u}),r&&r(s),s}catch(s){throw s==="cancel"||s==="close"?b&&K.ElMessage({type:"info",message:w}):(console.error("Confirm submit error:",s),K.ElMessage({type:"error",message:y})),s}}}const et=(t,r={})=>{const{filename:a="导出数据",fileExtension:n="xlsx",mimeType:i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",timeout:c=6e4,loadingMessage:l="正在导出,请稍候...",successMessage:f="导出成功!"}=r,u=e.ref(!1);return{download:async(y={})=>{var b,E,M;u.value=!0;try{l&&K.ElMessage.info(l);const o=await t(y,{responseType:"blob",timeout:c});let s=`${a}_${ie().format("YYYYMMDDHHmmss")}.${n}`;const d=((b=o==null?void 0:o.headers)==null?void 0:b["content-disposition"])||((E=o==null?void 0:o.headers)==null?void 0:E["Content-Disposition"]);if(d){const T=d.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);T&&T[1]&&(s=decodeURIComponent(T[1].replace(/['"]/g,"").trim()))}const p=(o==null?void 0:o.data)||o,m=p instanceof Blob?p:new Blob([p],{type:i}),x=URL.createObjectURL(m),N=document.createElement("a");N.href=x,N.download=s,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(x),f&&K.ElMessage.success(f)}catch(o){if(((M=o==null?void 0:o.response)==null?void 0:M.data)instanceof Blob){const s=new FileReader;s.onload=d=>{try{const p=JSON.parse(d.target.result).message;K.ElMessage.error(`导出失败:${p}`)}catch{K.ElMessage.error("导出失败:服务器返回异常")}},s.readAsText(o.response.data)}else K.ElMessage.error((o==null?void 0:o.message)||"导出失败:网络异常或接口错误");console.error("useDownload error:",o)}finally{u.value=!1}},downloading:u}};function tt(t={}){const{width:r="50%",title:a="Dialog",beforeClose:n}=t,i=e.ref(!1),c=e.ref(a),l=e.reactive({});return{visible:i,dialogTitle:c,dialogData:l,width:r,open:(y={},b)=>{b&&(c.value=b),Object.assign(l,y),i.value=!0},close:()=>{i.value=!1,setTimeout(()=>{Object.keys(l).forEach(y=>{delete l[y]})},300)},handleClose:y=>{n?n(y):y()}}}const oe={DATE:"YYYY-MM-DD",DATETIME:"YYYY-MM-DD HH:mm:ss",TIME:"HH:mm:ss",MONTH:"YYYY-MM",YEAR:"YYYY",DATE_CN:"YYYY年MM月DD日",DATETIME_CN:"YYYY年MM月DD日 HH:mm:ss"},ee=(t,r={})=>{const{...a}=r;return{...t,...a}},te={dateRange(t={}){const{prop:r="updateTime",label:a="更新时间",startField:n="updateStartTime",endField:i="updateEndTime",format:c=oe.DATETIME,props:l={}}=t,f={prop:r,label:a,component:"el-date-picker",dateRange:{startField:n,endField:i,format:u=>u?ie(u).format(c):""},props:{type:"datetimerange",rangeSeparator:"至",startPlaceholder:"开始日期",endPlaceholder:"结束日期",valueFormat:oe.DATETIME,clearable:!0,defaultTime:[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)],...l}};return ee(f,t)},input(t={}){const{prop:r,label:a,placeholder:n,maxlength:i,props:c={}}=t;if(!r||!a)return console.error("input 字段配置缺少必填参数 prop 或 label:",t),null;const l={label:a,prop:r,component:"el-input",props:{placeholder:n||`请输入${a}`,clearable:!0,maxlength:i,showWordLimit:!!i,...c}};return ee(l,t)},select(t={}){const{prop:r,label:a,options:n=[],multiple:i=!1,props:c={}}=t;if(!r||!a)return console.error("select 字段配置缺少必填参数 prop 或 label:",t),null;const l={label:a,prop:r,component:"el-select",options:n,props:{placeholder:`请选择${a}`,clearable:!0,multiple:i,collapseTags:i,collapseTagsTooltip:i,filterable:!0,...c}};return ee(l,t)},cascadeSelect(t={}){const{prop:r,label:a,dependOn:n,getOptions:i,defaultOptions:c=[],multiple:l=!1,props:f={}}=t;if(!r||!a||!n||!i)return console.error("cascadeSelect 配置不完整:",t),null;const u={label:a,prop:r,component:"el-select",options:[],relation:{dependOn:n,getOptions:i},defaultOptions:c,props:{placeholder:`请选择${a}`,clearable:!0,multiple:l,collapseTags:l,collapseTagsTooltip:l,...f}};return ee(u,t)},cascader(t={}){const{prop:r,label:a,options:n=[],labelKey:i="name",valueKey:c="id",checkStrictly:l=!0,returnAllIds:f=!0,props:u={}}=t;if(!r||!a)return console.error("cascader 字段配置缺少必填参数 prop 或 label:",t),null;const w={label:a,prop:r,component:"el-cascader",returnAllIds:f,props:{options:n,placeholder:`请选择${a}`,clearable:!0,props:{label:i,value:c,children:"children",checkStrictly:l},...u}};return ee(w,t)},number(t={}){const{prop:r,label:a,min:n,max:i,step:c=1,props:l={}}=t;if(!r||!a)return console.error("number 字段配置缺少必填参数 prop 或 label:",t),null;const f={label:a,prop:r,component:"el-input-number",props:{placeholder:`请输入${a}`,min:n,max:i,step:c,controlsPosition:"right",style:{width:"100%"},...l}};return ee(f,t)},date(t={}){const{prop:r,label:a,format:n=oe.DATE,props:i={}}=t;if(!r||!a)return console.error("date 字段配置缺少必填参数 prop 或 label:",t),null;const c={prop:r,label:a,component:"el-date-picker",props:{type:"date",placeholder:`请选择${a}`,valueFormat:n,clearable:!0,...i}};return ee(c,t)},switch(t={}){const{prop:r,label:a,activeValue:n=1,inactiveValue:i=0,props:c={}}=t;if(!r||!a)return console.error("switch 字段配置缺少必填参数 prop 或 label:",t),null;const l={label:a,prop:r,component:"el-switch",props:{activeValue:n,inactiveValue:i,...c}};return ee(l,t)}},nt={updateTimeRange(t={}){return te.dateRange({...t})},createTimeRange(t={}){return te.dateRange(Object.assign({prop:"createTime",label:"创建时间"},t))},status(t,r={}){return te.select(Object.assign({prop:"state",label:"状态"},r,{options:t}))},keyword(t={}){return te.input(Object.assign({prop:"keyword",label:"关键词"},t))},name(t={}){return te.input(Object.assign({prop:"name",label:"名称"},t))},category(t,r={}){return te.cascader(Object.assign({prop:"categoryId",label:"目录"},r,{options:t}))}};function at(t,r){const a=t.replace(/\//g,"\\/").replace(/\*\*/g,".*").replace(/\*/g,"[^\\/]*");return new RegExp(`^${a}$`).test(r)}function lt(t){return t==null||t===""||t===void 0||t==="undefined"}function ot(t){return!t||typeof t!="string"?!1:t.indexOf("http://")!==-1||t.indexOf("https://")!==-1}function rt(t){return/^(https?:|mailto:|tel:)/.test(t)}function st(t){return/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t)}function it(t){return/^(([^<>()[\]\\.,;:\s@"]+(\.[[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}function ct(t){return/^1[3-9]\d{9}$/.test(t)}function dt(t){return typeof t=="string"||t instanceof String}function pt(t){return Array.isArray(t)}function ut(t,r,a,n){return t/=n/2,t<1?a/2*t*t+r:(t--,-a/2*(t*(t-2)-1)+r)}const ft=(function(){return typeof window>"u"?t=>0:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}})();function mt(t){typeof document>"u"||(document.documentElement.scrollTop=t,document.body.parentNode&&(document.body.parentNode.scrollTop=t),document.body.scrollTop=t)}function ht(){var t;return typeof document>"u"?0:document.documentElement.scrollTop||((t=document.body.parentNode)==null?void 0:t.scrollTop)||document.body.scrollTop||0}function gt(t,r=500,a){const n=ht(),i=t-n,c=20;let l=0;const f=function(){l+=c;const u=ut(l,n,i,r);mt(u),l<r?ft(f):typeof a=="function"&&a()};f()}function we(t=[],r,a="children"){for(const n of t){if(r(n))return n;const i=n[a];if(i&&i.length>0){const c=we(i,r,a);if(c)return c}}return null}function yt(t=[],r,a="id",n="children"){const i=(c,l,f=[])=>{for(const u of c){const w=[...f,u[a]];if(u[a]===l)return w;const y=u[n];if(y&&y.length>0){const b=i(y,l,w);if(b.length>0)return b}}return[]};return i(t,r)}function bt(t=[],r,a="children",n="id"){const i=typeof r=="function"?r:l=>l[n]===r,c=(l,f=[])=>{for(const u of l){const w=[...f,u];if(i(u))return w;const y=u[a];if(y&&y.length>0){const b=c(y,w);if(b.length>0)return b}}return[]};return c(t)}function ke(t=[],r="children"){const a=[],n=i=>{i.forEach(c=>{a.push(c);const l=c[r];l&&l.length>0&&n(l)})};return n(t),a}const Ct=ke;function wt(t=[],r={}){const{id:a="id",pid:n="parentId",children:i="children",rootPid:c=[0,"0",null,void 0,""]}=r,l=new Map,f=[];return t.forEach(u=>{l.set(u[a],{...u,[i]:[]})}),t.forEach(u=>{const w=l.get(u[a]),y=u[n];if(c.includes(y)||!l.has(y))f.push(w);else{const b=l.get(y);b&&b[i].push(w)}}),f}function kt(t=[],r,a="children"){const n=i=>i.map(c=>{const l={...c},f=l[a];if(f&&f.length>0){const w=n(f);l[a]=w.length>0?w:void 0}const u=l[a];return r(l)||u&&u.length>0?l:null}).filter(Boolean);return n(t)}function xe(t=[],r,a="children"){return t.map(n=>{const i=r(n),c=n[a];return c&&c.length>0&&(i[a]=xe(c,r,a)),i})}function xt(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}const St={install:t=>{Ce.forEach(r=>{if(r.name){t.component(r.name,r);const a=xt(r.name);a!==r.name&&t.component(a,r)}})}};_.CAsyncButton=ce,_.CCollapsibleContainer=me,_.CCustomDrawer=he,_.CDiff=ye,_.CImagePreview=be,_.CSearchBox=fe,_.CSelectWithAll=pe,_.CSelectWithPage=ue,_.CSimpleTable=ge,_.CommonSearchFields=nt,_.DATE_FORMAT=oe,_.SearchFieldFactory=te,_.components=Ce,_.default=St,_.filterTree=kt,_.findNodePath=yt,_.findParentNodes=bt,_.findTreeNode=we,_.flattenTree=ke,_.isArray=pt,_.isEmpty=lt,_.isExternal=rt,_.isHttp=ot,_.isPathMatch=at,_.isString=dt,_.listToTree=wt,_.mapTree=xe,_.scrollTo=gt,_.treeToList=Ct,_.useConfirmAction=Qe,_.useConfirmSubmit=Ge,_.useDialog=tt,_.useDownload=et,_.useForm=Xe,_.useListPage=Je,_.validEmail=it,_.validPhone=ct,_.validURL=st,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare var __VLS_10: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_10) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
/** 接收一个可能是异步的点击处理函数,返回 Promise 时自动开启 loading */
|
|
8
|
+
onClick: {
|
|
9
|
+
type: PropType<(event: MouseEvent) => any>;
|
|
10
|
+
default: null;
|
|
11
|
+
};
|
|
12
|
+
/** 手动强制 loading,优先级最高 */
|
|
13
|
+
loading: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
disabled: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
22
|
+
/** 接收一个可能是异步的点击处理函数,返回 Promise 时自动开启 loading */
|
|
23
|
+
onClick: {
|
|
24
|
+
type: PropType<(event: MouseEvent) => any>;
|
|
25
|
+
default: null;
|
|
26
|
+
};
|
|
27
|
+
/** 手动强制 loading,优先级最高 */
|
|
28
|
+
loading: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
disabled: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
onClick: (event: MouseEvent) => any;
|
|
38
|
+
loading: boolean;
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare var __VLS_17: {}, __VLS_19: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
left?: (props: typeof __VLS_17) => any;
|
|
4
|
+
} & {
|
|
5
|
+
right?: (props: typeof __VLS_19) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
defaultCollapsed: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
defaultWidth: {
|
|
13
|
+
type: NumberConstructor;
|
|
14
|
+
default: number;
|
|
15
|
+
};
|
|
16
|
+
minWidth: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
maxWidth: {
|
|
21
|
+
type: NumberConstructor;
|
|
22
|
+
default: number;
|
|
23
|
+
};
|
|
24
|
+
height: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>, {
|
|
29
|
+
toggleCollapse: () => void;
|
|
30
|
+
isCollapsed: import('vue').Ref<boolean, boolean>;
|
|
31
|
+
leftPanelWidth: import('vue').Ref<number, number>;
|
|
32
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
33
|
+
"collapse-change": (collapsed: boolean) => any;
|
|
34
|
+
"width-change": (width: number) => any;
|
|
35
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
36
|
+
defaultCollapsed: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
defaultWidth: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
minWidth: {
|
|
45
|
+
type: NumberConstructor;
|
|
46
|
+
default: number;
|
|
47
|
+
};
|
|
48
|
+
maxWidth: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
52
|
+
height: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{
|
|
57
|
+
"onCollapse-change"?: ((collapsed: boolean) => any) | undefined;
|
|
58
|
+
"onWidth-change"?: ((width: number) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
minWidth: number;
|
|
61
|
+
defaultCollapsed: boolean;
|
|
62
|
+
defaultWidth: number;
|
|
63
|
+
maxWidth: number;
|
|
64
|
+
height: string;
|
|
65
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
67
|
+
declare const _default: typeof __VLS_export;
|
|
68
|
+
export default _default;
|
|
69
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
70
|
+
new (): {
|
|
71
|
+
$slots: S;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare var __VLS_10: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_10) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
title: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
size: {
|
|
16
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
direction: {
|
|
20
|
+
type: PropType<"rtl" | "ltr" | "ttb" | "btt">;
|
|
21
|
+
default: string;
|
|
22
|
+
validator: (val: string) => boolean;
|
|
23
|
+
};
|
|
24
|
+
showFooter: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
closeOnClickModal: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
closeOnPressEscape: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
destroyOnClose: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
confirmLoading: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
beforeClose: {
|
|
45
|
+
type: PropType<((done: () => void) => void) | null>;
|
|
46
|
+
default: null;
|
|
47
|
+
};
|
|
48
|
+
onClose: {
|
|
49
|
+
type: PropType<(() => void) | null>;
|
|
50
|
+
default: null;
|
|
51
|
+
};
|
|
52
|
+
onConfirm: {
|
|
53
|
+
type: PropType<(() => void) | null>;
|
|
54
|
+
default: null;
|
|
55
|
+
};
|
|
56
|
+
onCancel: {
|
|
57
|
+
type: PropType<(() => void) | null>;
|
|
58
|
+
default: null;
|
|
59
|
+
};
|
|
60
|
+
}>, {
|
|
61
|
+
open: () => void;
|
|
62
|
+
close: () => void;
|
|
63
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
64
|
+
"update:modelValue": (value: boolean) => any;
|
|
65
|
+
cancel: () => any;
|
|
66
|
+
close: () => any;
|
|
67
|
+
confirm: () => any;
|
|
68
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
69
|
+
modelValue: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
title: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
size: {
|
|
78
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
direction: {
|
|
82
|
+
type: PropType<"rtl" | "ltr" | "ttb" | "btt">;
|
|
83
|
+
default: string;
|
|
84
|
+
validator: (val: string) => boolean;
|
|
85
|
+
};
|
|
86
|
+
showFooter: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
closeOnClickModal: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
94
|
+
closeOnPressEscape: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
destroyOnClose: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
102
|
+
confirmLoading: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
106
|
+
beforeClose: {
|
|
107
|
+
type: PropType<((done: () => void) => void) | null>;
|
|
108
|
+
default: null;
|
|
109
|
+
};
|
|
110
|
+
onClose: {
|
|
111
|
+
type: PropType<(() => void) | null>;
|
|
112
|
+
default: null;
|
|
113
|
+
};
|
|
114
|
+
onConfirm: {
|
|
115
|
+
type: PropType<(() => void) | null>;
|
|
116
|
+
default: null;
|
|
117
|
+
};
|
|
118
|
+
onCancel: {
|
|
119
|
+
type: PropType<(() => void) | null>;
|
|
120
|
+
default: null;
|
|
121
|
+
};
|
|
122
|
+
}>> & Readonly<{
|
|
123
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
124
|
+
onCancel?: (() => any) | undefined;
|
|
125
|
+
onClose?: (() => any) | undefined;
|
|
126
|
+
onConfirm?: (() => any) | undefined;
|
|
127
|
+
}>, {
|
|
128
|
+
size: string | number;
|
|
129
|
+
modelValue: boolean;
|
|
130
|
+
title: string;
|
|
131
|
+
direction: "rtl" | "ltr" | "ttb" | "btt";
|
|
132
|
+
showFooter: boolean;
|
|
133
|
+
closeOnClickModal: boolean;
|
|
134
|
+
closeOnPressEscape: boolean;
|
|
135
|
+
destroyOnClose: boolean;
|
|
136
|
+
confirmLoading: boolean;
|
|
137
|
+
beforeClose: ((done: () => void) => void) | null;
|
|
138
|
+
onClose: (() => void) | null;
|
|
139
|
+
onConfirm: (() => void) | null;
|
|
140
|
+
onCancel: (() => void) | null;
|
|
141
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
142
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
143
|
+
declare const _default: typeof __VLS_export;
|
|
144
|
+
export default _default;
|
|
145
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
146
|
+
new (): {
|
|
147
|
+
$slots: S;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
src: {
|
|
4
|
+
type: PropType<string | string[]>;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
width: {
|
|
8
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
height: {
|
|
12
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
16
|
+
src: {
|
|
17
|
+
type: PropType<string | string[]>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
width: {
|
|
21
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
height: {
|
|
25
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>> & Readonly<{}>, {
|
|
29
|
+
width: string | number;
|
|
30
|
+
height: string | number;
|
|
31
|
+
src: string | string[];
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { AnyRecord, SearchField } from '../../types';
|
|
3
|
+
declare var __VLS_54: string | undefined, __VLS_55: {
|
|
4
|
+
value: any;
|
|
5
|
+
onChange: (val: any) => any;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
[K in NonNullable<typeof __VLS_54>]?: (props: typeof __VLS_55) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
11
|
+
fields: {
|
|
12
|
+
type: PropType<SearchField[]>;
|
|
13
|
+
default: () => never[];
|
|
14
|
+
};
|
|
15
|
+
searchText: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
resetText: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
exportText: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
showExport: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
initialValues: {
|
|
32
|
+
type: PropType<AnyRecord>;
|
|
33
|
+
default: () => {};
|
|
34
|
+
};
|
|
35
|
+
fieldsPerRow: {
|
|
36
|
+
type: NumberConstructor;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
labelWidth: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
defaultExpanded: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
}>, {
|
|
48
|
+
search: () => void;
|
|
49
|
+
reset: () => void;
|
|
50
|
+
export: () => void;
|
|
51
|
+
getParams: () => AnyRecord;
|
|
52
|
+
getAllParams: () => {
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
};
|
|
55
|
+
setValues: (values: AnyRecord) => void;
|
|
56
|
+
toggleExpand: () => void;
|
|
57
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
58
|
+
search: (...args: any[]) => void;
|
|
59
|
+
reset: (...args: any[]) => void;
|
|
60
|
+
export: (...args: any[]) => void;
|
|
61
|
+
"field-change": (...args: any[]) => void;
|
|
62
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
63
|
+
fields: {
|
|
64
|
+
type: PropType<SearchField[]>;
|
|
65
|
+
default: () => never[];
|
|
66
|
+
};
|
|
67
|
+
searchText: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
71
|
+
resetText: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
exportText: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
showExport: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
initialValues: {
|
|
84
|
+
type: PropType<AnyRecord>;
|
|
85
|
+
default: () => {};
|
|
86
|
+
};
|
|
87
|
+
fieldsPerRow: {
|
|
88
|
+
type: NumberConstructor;
|
|
89
|
+
default: number;
|
|
90
|
+
};
|
|
91
|
+
labelWidth: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
defaultExpanded: {
|
|
96
|
+
type: BooleanConstructor;
|
|
97
|
+
default: boolean;
|
|
98
|
+
};
|
|
99
|
+
}>> & Readonly<{
|
|
100
|
+
onSearch?: ((...args: any[]) => any) | undefined;
|
|
101
|
+
onReset?: ((...args: any[]) => any) | undefined;
|
|
102
|
+
onExport?: ((...args: any[]) => any) | undefined;
|
|
103
|
+
"onField-change"?: ((...args: any[]) => any) | undefined;
|
|
104
|
+
}>, {
|
|
105
|
+
fields: SearchField[];
|
|
106
|
+
searchText: string;
|
|
107
|
+
resetText: string;
|
|
108
|
+
exportText: string;
|
|
109
|
+
showExport: boolean;
|
|
110
|
+
initialValues: AnyRecord;
|
|
111
|
+
fieldsPerRow: number;
|
|
112
|
+
labelWidth: string;
|
|
113
|
+
defaultExpanded: boolean;
|
|
114
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
115
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
116
|
+
declare const _default: typeof __VLS_export;
|
|
117
|
+
export default _default;
|
|
118
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
119
|
+
new (): {
|
|
120
|
+
$slots: S;
|
|
121
|
+
};
|
|
122
|
+
};
|