@duxweb/dvha-pro 1.0.37 → 1.0.39
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/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/tree/treeFilter.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +3 -1
- package/dist/esm/components/layout/table.js +75 -71
- package/dist/esm/components/tree/treeFilter.js +105 -88
- package/dist/esm/theme/uno.css.js +3 -1
- package/dist/types/components/layout/table.d.ts +6 -0
- package/dist/types/components/table/tablePage.d.ts +6 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("@duxweb/dvha-core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("@duxweb/dvha-core"),W=require("@vueuse/core"),a=require("naive-ui"),J=require("../../hooks/action.cjs");require("@overlastic/vue");require("clsx");require("vue-echarts");require("vue3-ace-editor");require("ace-builds/src-noconflict/mode-vue");require("ace-builds/src-noconflict/mode-javascript");require("ace-builds/src-noconflict/mode-html");require("ace-builds/src-noconflict/mode-json");require("ace-builds/src-noconflict/mode-json5");require("ace-builds/src-noconflict/theme-tomorrow_night");require("ace-builds/src-noconflict/theme-tomorrow");require("ace-builds/src-noconflict/ext-searchbox");require("ace-builds/src-noconflict/ext-language_tools");require("ace-builds/src-noconflict/mode-snippets");require("vue-cropper");const M=require("../modal/modalPage.cjs");require("jinrishici");require("lodash-es");require("vue-draggable-plus");const _=require("./filter.cjs"),$=require("./filterLayout.cjs");require("@vee-validate/i18n");require("colorizr");require("echarts");require("highlight.js/lib/core");require("highlight.js/lib/languages/bash");require("highlight.js/lib/languages/css");require("highlight.js/lib/languages/go");require("highlight.js/lib/languages/java");require("highlight.js/lib/languages/javascript");require("highlight.js/lib/languages/json");require("highlight.js/lib/languages/markdown");require("highlight.js/lib/languages/php");require("highlight.js/lib/languages/python");require("highlight.js/lib/languages/shell");require("highlight.js/lib/languages/sql");require("highlight.js/lib/languages/typescript");require("highlight.js/lib/languages/xml");require("@ant-design/colors");require("@unocss/preset-icons/browser");require("@unocss/preset-typography");require("unocss/preset-wind4");require("@vee-validate/i18n/dist/locale/en.json");require("@vee-validate/i18n/dist/locale/zh_CN.json");require("vee-validate");require("vue-router");require("vue-command-palette");require("@duxweb/dvha-naiveui");const K=require("../../pages/page.cjs");require("../../pages/page404.cjs");const q=require("../drawer/drawerPage.cjs"),G=require("./tools.cjs");require("short-unique-id");require("aieditor");require("mime");require("@iconify-json/tabler/icons.json");require("../posterEditor/elements/index.cjs");require("fabric");require("dayjs");require("@tanstack/vue-query");const H=require("../../hooks/table.cjs");require("pinia");function Q(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const X=e.defineComponent({name:"DuxTableLayout",props:{path:{type:String,required:!0},filter:{type:Object},filterSchema:{type:Array},filterNumber:{type:Number,default:1},sorter:{type:Object},columns:{type:Array},pagination:{type:[Boolean,Object],default:!0},tabs:{type:Array},actions:{type:Array,default:()=>[]},tools:{type:Object},sideLeftTitle:{type:String,default:""},sideRightTitle:{type:String,default:""},hookTableProps:{type:Object}},setup(t,{slots:o}){const b=e.toRef(t,"filter",{}),w=e.toRef(t,"sorter",{}),y=e.toRef(t,"columns",[]),{t:l}=f.useI18n(),{renderAction:V}=J.useAction(),h=H.useTable({...t.hookTableProps,path:t.path,filters:b.value,sorters:w.value,columns:y,pagination:t.pagination}),{columns:N,tablePagination:x,table:S,onUpdateColumnSelected:T,onUpdateChecked:R,columnSelected:k,autoRefetch:C,autoCountdown:p,onAutoRefetch:j,isExporting:L,isExportingRows:P,isImporting:D,onExport:z,onExportRows:O,onImport:B}=h,U=e.computed(()=>N.value.filter(r=>"title"in r&&"key"in r).map(r=>({label:r.title,value:r.key}))),{width:u}=W.useWindowSize(),A=e.computed(()=>N.value.reduce((i,d)=>i+(Number(d?.width)||Number(d?.minWidth)||110),0)),n=e.reactive({show:!1}),c=e.reactive({show:!1}),s=e.reactive({show:!1}),g=e.computed(()=>(t.filterSchema||[]).map(r=>{const{label:i,...d}=r;return{tag:_.DuxTableFilter,attrs:{label:i},children:d}})),{render:E}=f.useJsonSchema({data:e.computed(()=>g.value?.slice(t.filterNumber))}),{render:F}=f.useJsonSchema({data:e.computed(()=>g.value?.slice(0,t.filterNumber))}),m=e.computed(()=>({import:!1,export:!0,refresh:!0,...t.tools})),v=f.useTabStore(),I=v.tabs.find(r=>r.path===v.current);return()=>e.createVNode(K.DuxPage,{actions:t.actions,scrollbar:!1},{sideLeft:()=>o?.sideLeft&&u.value>=1024?o?.sideLeft?.():void 0,sideRight:()=>o?.sideRight&&u.value>=1024?o?.sideRight?.():void 0,default:()=>e.createVNode("div",{class:"flex flex-col gap-2 h-full relative"},[e.createVNode("div",{class:"flex gap-2 justify-between flex-col lg:flex-row"},[t.tabs&&e.createVNode("div",{class:"flex flex-none"},[e.createVNode(a.NTabs,{type:"segment",size:"small",style:{"--n-tab-padding":"4px 10px"},"default-value":t.tabs?.[0]?.value,value:b.value?.tab,onUpdateValue:r=>{b.value.tab=r}},{default:()=>[t.tabs?.map(r=>e.createVNode(a.NTab,{name:r.value,tab:r.label},null))]})]),e.createVNode("div",{class:["overflow-hidden flex-1 flex gap-2"]},[o?.sideLeft&&u.value<1024&&e.createVNode(a.NButton,{class:"flex-none",secondary:!0,onClick:()=>{c.show=!c.show}},{icon:()=>e.createVNode("div",{class:"i-tabler:layout-sidebar-inactive size-4"},null)}),e.createVNode("div",{class:["flex-1 flex flex-col lg:flex-row gap-2 flex-wrap",t.tabs?"justify-end":"justify-start"]},[!t.tabs&&!t.filterSchema?.length&&e.createVNode("div",{class:"flex flex-none items-center text-base font-medium"},[I?.label]),e.h(F)]),o?.sideRight&&u.value<1024&&e.createVNode(a.NButton,{class:"flex-none",secondary:!0,onClick:()=>{s.show=!s.show}},{icon:()=>e.createVNode("div",{class:"i-tabler:layout-sidebar-right-inactive size-4"},null)})]),e.createVNode("div",{class:"flex gap-2 justify-between lg:justify-end"},[e.createVNode("div",{class:"flex gap-2 items-center"},[g.value.length>t.filterNumber&&e.createVNode(a.NButton,{iconPlacement:"right",onClick:()=>{n.show=!n.show}},{default:()=>l("components.button.filter"),icon:()=>e.createVNode("div",{class:["i-tabler:chevrons-down size-4 transition-all"]},null)}),o?.tools?.(),e.createVNode(a.NPopselect,{options:U.value,value:k.value,onUpdateValue:r=>{T(r)},multiple:!0,placement:"bottom-start",trigger:"click"},{default:()=>[e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,"icon-placement":"right"},{icon:()=>e.createVNode("div",{class:"i-tabler:columns size-4"},null)}),default:()=>l("components.list.columnSetting")})]}),m.value.export&&e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,loading:L.value,onClick:z},{icon:()=>e.createVNode("div",{class:"i-tabler:database-export size-4"},null)}),default:()=>l("components.button.export")}),m.value.import&&e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,loading:D.value,onClick:B},{icon:()=>e.createVNode("div",{class:"i-tabler:database-import size-4"},null)}),default:()=>l("components.button.import")}),m.value.refresh&&e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,onClick:j},{icon:()=>C.value?e.createVNode(a.NProgress,{class:"size-4",type:"circle",percentage:p.value*10,strokeWidth:20,color:"rgba(var(--ui-color-primary))"},{default:()=>[e.createVNode("span",{class:"text-8px"},[p.value])]}):e.createVNode("div",{class:"i-tabler:refresh size-4"},null)}),default:()=>l("components.button.autoRefresh")})]),e.createVNode("div",{class:"flex gap-2 justify-end"},[o.actions?.(),t.actions?.length>0&&V({type:u.value<1024?"dropdown":"button",items:t.actions})])])]),o?.header?.(),e.createVNode("div",{class:"flex-1 min-h-0"},[o?.default?.({...h,width:A.value})]),e.createVNode("div",{class:"flex justify-between"},[e.createVNode("div",null,[o?.bottom?.()]),e.createVNode("div",null,[t.pagination&&e.createVNode(a.NPagination,e.mergeProps(x.value,{simple:u.value<768}),{prefix:()=>e.createVNode("div",null,[l("components.list.total",{total:h.total.value||0})])})])]),e.createVNode(G.DuxTableTools,{number:S.value.checkedRowKeys?.length||0||0,group:[[{icon:"i-tabler:x",onClick:()=>{R?.([])}}],[{label:l("components.button.export"),icon:"i-tabler:file-export",loading:P.value,onClick:O},{label:l("components.button.delete"),type:"error",icon:"i-tabler:trash"}]]},null),e.createVNode(a.NModal,{draggable:!0,class:"bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur min-w-110",show:n.show,onUpdateShow:r=>n.show=r},{default:({draggableClass:r})=>{let i;return e.createVNode(M.default,{title:l("components.button.filter"),handle:r,onClose:()=>n.show=!1},{default:()=>[e.createVNode($.DuxFilterLayout,{showLabel:!0,labelPlacement:"top"},Q(i=e.h(E))?i:{default:()=>[i]})]})}}),e.createVNode(a.NDrawer,{show:c.show,onUpdateShow:r=>c.show=r,autoFocus:!1,placement:"left"},{default:()=>[e.createVNode(q.DuxDrawerPage,{title:t.sideLeftTitle||l("components.button.sideLeft"),onClose:()=>c.show=!1,scrollbar:!1},{default:()=>[o?.sideLeft?.()]})]}),e.createVNode(a.NDrawer,{show:s.show,onUpdateShow:r=>s.show=r,autoFocus:!1,placement:"right"},{default:()=>[e.createVNode(q.DuxDrawerPage,{title:t.sideRightTitle||l("components.button.sideRight"),onClose:()=>s.show=!1,scrollbar:!1},{default:()=>[o?.sideRight?.()]})]})])})}});exports.DuxTableLayout=X;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("@duxweb/dvha-core"),_=require("@vueuse/core"),z=require("clsx"),s=require("naive-ui"),X=require("../card/card.cjs"),Y=t.defineComponent({name:"DuxTreeFilter",props:{title:String,path:String,sortPath:String,params:Object,menus:Array,numField:String,iconField:String,treeOptions:Object,value:Array,defaultValue:Array,onUpdateValue:Function,draggable:Boolean,bordered:{type:Boolean,default:!1}},extends:s.NTree,setup(a,{emit:D,slots:b}){const N=_.useVModel(a,"value",D,{passive:!1,defaultValue:a.defaultValue}),O=t.toRef(a,"params",{}),C=t.toRef(a,"path",""),T=t.toRef(a,"sortPath",""),S=t.ref(),w=t.ref(0),F=t.ref(0),i=t.ref([]),y=t.ref(),{t:K}=g.useI18n(),{options:U,loading:q,expanded:A}=g.useTree({path:C.value,params:O.value,...a.treeOptions});t.watch(U,e=>{i.value=e},{immediate:!0,deep:!0});const x=t.ref(!1),I=t.computed(()=>a.menus?.map(e=>({label:e.label,key:e.value,icon:e?.icon?()=>t.createVNode("div",{class:e?.icon},null):void 0,onSelect:e.onSelect}))||[]),E=e=>{const l=a.menus?.find(n=>n.value===e);l&&l.onSelect(S.value),x.value=!1},j=g.useCustomMutation({path:T.value,method:"POST"}),V=(e,l)=>{for(const n of e)if(n.children){for(const r of n.children)if(r.id===l)return n;const d=V(n.children,l);if(d)return d}},B=({node:e,dragNode:l,dropPosition:n})=>{const d=V(i.value,l.id),r=!d,p=[...i.value];if(r){const o=i.value.findIndex(k=>k.id===l.id);o>=0&&p.splice(o,1)}else{const o=d?.children?.indexOf(l)||0;d?.children?.splice(o,1)}let h=V(p,e.id),m,c=h?.children||p,u=0;switch(n){case"before":u=c.findIndex(o=>o.id===e.id),u>0&&(m=c[u-1].id);break;case"inside":h=e,c=h.children=h.children||[],u=c.length;break;case"after":u=c.findIndex(o=>o.id===e.id)+1,m=e.id;break}c.splice(u,0,l),i.value=p,j.mutate({payload:{parent_id:h?.id,before_id:m,id:l.id}})},f=t.ref([]),v=t.ref(!1);t.watch(A,e=>{f?.value?.length>0||(v.value=e.length>0,f.value=e)},{immediate:!0});const P=e=>{const l=[],n=d=>{d.forEach(r=>{r.children&&r.children.length>0&&(l.push(r.key||r.id),n(r.children))})};return n(e),l},M=()=>{v.value?(f.value=[],v.value=!1):(f.value=P(i.value),v.value=!0)},R=t.computed(()=>{const{title:e,path:l,sortPath:n,params:d,menus:r,numField:p,iconField:h,treeOptions:m,value:c,defaultValue:u,onUpdateValue:o,bordered:k,...L}=a;return L});return()=>t.createVNode(X.DuxCard,{class:"h-full",contentClass:"flex flex-col",bordered:a.bordered},{default:()=>[a?.title&&t.createVNode("div",{class:"px-2 py-3 pb-1 text-base font-bold"},[a.title]),t.createVNode("div",{class:"p-2 flex gap-2 items-center"},[t.createVNode(s.NButton,{onClick:M},{icon:()=>t.createVNode("div",{class:v.value?"i-tabler:fold-up":"i-tabler:fold-down"},null)}),t.createVNode("div",{class:"flex-1"},[b.header?b.header():t.createVNode(s.NInput,{value:y.value,"onUpdate:value":e=>y.value=e,placeholder:K("common.keyword")},null)]),b.tools?.()]),t.createVNode(s.NScrollbar,{class:"flex-1 min-h-0",xScrollable:!0},{default:()=>[t.createVNode("div",{class:"p-2"},[t.createVNode(s.NSpin,{show:q.value,class:"h-full"},{default:()=>[t.createVNode(s.NTree,t.mergeProps(R.value,{data:i.value||[],expandedKeys:f.value,onUpdateExpandedKeys:e=>{f.value=e;const l=P(i.value);v.value=l.length>0&&l.every(n=>e.includes(n))},blockLine:!0,selectedKeys:N.value,onUpdateSelectedKeys:e=>{N.value=e,a?.onUpdateValue?.(e)},onDrop:B,pattern:y.value,renderPrefix:a?.numField||a?.iconField?({option:e})=>t.createVNode(t.Fragment,null,[a.iconField&&e[a.iconField]&&t.createVNode("div",{class:z(e[a.iconField]||"","size-4")},null),a.numField&&t.createVNode("div",{class:"rounded-full bg-primary px-2 text-xs text-white"},[e[a.numField]||0])]):void 0,nodeProps:({option:e})=>({onContextmenu:l=>{S.value=e,x.value=!0,w.value=l.clientX,F.value=l.clientY,l.preventDefault()}})}),null)]})])]}),t.createVNode(s.NDropdown,{trigger:"manual",placement:"bottom-start",show:x.value,options:I.value,x:w.value,y:F.value,width:100,onSelect:E,onClickoutside:()=>{x.value=!1}},null)]})}});exports.DuxTreeFilter=Y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=`/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-border-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-to-opacity:100%;--un-fill-opacity:100%;--un-outline-style:solid;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
@@ -951,6 +951,8 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
951
951
|
.i-tabler\\:eye-off{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M10.585 10.587a2 2 0 0 0 2.829 2.828'/%3E%3Cpath d='M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
952
952
|
.i-tabler\\:file-export{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M11.5 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v5m-5 6h7m-3-3l3 3l-3 3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
953
953
|
.i-tabler\\:file-upload{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2m-5-10v6'/%3E%3Cpath d='M9.5 13.5L12 11l2.5 2.5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
954
|
+
.i-tabler\\:fold-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 11v8l3-3m-6 0l3 3M9 7h1m4 0h1m4 0h1M4 7h1'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
955
|
+
.i-tabler\\:fold-up{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 13V5L9 8m6 0l-3-3M9 17h1m4 0h1m4 0h1M4 17h1'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
954
956
|
.i-tabler\\:folder{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
955
957
|
.i-tabler\\:forms{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3m7-14h7a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-7M5 7H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h1m12-5h.01M13 12h.01'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
956
958
|
.i-tabler\\:grid-4x4{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 6h18M3 12h18M3 18h18M6 3v18m6-18v18m6-18v18'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useWindowSize as
|
|
4
|
-
import { NTabs as
|
|
5
|
-
import { useAction as
|
|
1
|
+
import { defineComponent as H, toRef as v, computed as s, reactive as w, createVNode as e, h as C, mergeProps as Q, isVNode as X } from "vue";
|
|
2
|
+
import { useI18n as Y, useJsonSchema as N, useTabStore as Z } from "@duxweb/dvha-core";
|
|
3
|
+
import { useWindowSize as $ } from "@vueuse/core";
|
|
4
|
+
import { NTabs as ee, NTab as te, NButton as r, NPopselect as oe, NTooltip as p, NProgress as le, NPagination as ie, NModal as ae, NDrawer as R } from "naive-ui";
|
|
5
|
+
import { useAction as re } from "../../hooks/action.js";
|
|
6
6
|
import "@overlastic/vue";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "vue-echarts";
|
|
@@ -18,12 +18,12 @@ import "ace-builds/src-noconflict/ext-searchbox";
|
|
|
18
18
|
import "ace-builds/src-noconflict/ext-language_tools";
|
|
19
19
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
20
20
|
import "vue-cropper";
|
|
21
|
-
import
|
|
21
|
+
import ne from "../modal/modalPage.js";
|
|
22
22
|
import "jinrishici";
|
|
23
23
|
import "lodash-es";
|
|
24
24
|
import "vue-draggable-plus";
|
|
25
|
-
import { DuxTableFilter as
|
|
26
|
-
import { DuxFilterLayout as
|
|
25
|
+
import { DuxTableFilter as se } from "./filter.js";
|
|
26
|
+
import { DuxFilterLayout as ue } from "./filterLayout.js";
|
|
27
27
|
import "@vee-validate/i18n";
|
|
28
28
|
import "colorizr";
|
|
29
29
|
import "echarts";
|
|
@@ -51,10 +51,10 @@ import "vee-validate";
|
|
|
51
51
|
import "vue-router";
|
|
52
52
|
import "vue-command-palette";
|
|
53
53
|
import "@duxweb/dvha-naiveui";
|
|
54
|
-
import { DuxPage as
|
|
54
|
+
import { DuxPage as ce } from "../../pages/page.js";
|
|
55
55
|
import "../../pages/page404.js";
|
|
56
56
|
import { DuxDrawerPage as S } from "../drawer/drawerPage.js";
|
|
57
|
-
import { DuxTableTools as
|
|
57
|
+
import { DuxTableTools as me } from "./tools.js";
|
|
58
58
|
import "short-unique-id";
|
|
59
59
|
import "aieditor";
|
|
60
60
|
import "mime";
|
|
@@ -63,12 +63,12 @@ import "../posterEditor/elements/index.js";
|
|
|
63
63
|
import "fabric";
|
|
64
64
|
import "dayjs";
|
|
65
65
|
import "@tanstack/vue-query";
|
|
66
|
-
import { useTable as
|
|
66
|
+
import { useTable as de } from "../../hooks/table.js";
|
|
67
67
|
import "pinia";
|
|
68
|
-
function
|
|
69
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
68
|
+
function pe(t) {
|
|
69
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !X(t);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const Tt = /* @__PURE__ */ H({
|
|
72
72
|
name: "DuxTableLayout",
|
|
73
73
|
props: {
|
|
74
74
|
path: {
|
|
@@ -85,6 +85,9 @@ const St = /* @__PURE__ */ G({
|
|
|
85
85
|
type: Number,
|
|
86
86
|
default: 1
|
|
87
87
|
},
|
|
88
|
+
sorter: {
|
|
89
|
+
type: Object
|
|
90
|
+
},
|
|
88
91
|
columns: {
|
|
89
92
|
type: Array
|
|
90
93
|
},
|
|
@@ -117,42 +120,43 @@ const St = /* @__PURE__ */ G({
|
|
|
117
120
|
setup(t, {
|
|
118
121
|
slots: l
|
|
119
122
|
}) {
|
|
120
|
-
const f =
|
|
123
|
+
const f = v(t, "filter", {}), T = v(t, "sorter", {}), j = v(t, "columns", []), {
|
|
121
124
|
t: i
|
|
122
|
-
} =
|
|
123
|
-
renderAction:
|
|
124
|
-
} =
|
|
125
|
+
} = Y(), {
|
|
126
|
+
renderAction: L
|
|
127
|
+
} = re(), b = de({
|
|
128
|
+
...t.hookTableProps,
|
|
125
129
|
path: t.path,
|
|
126
130
|
filters: f.value,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
sorters: T.value,
|
|
132
|
+
columns: j,
|
|
133
|
+
pagination: t.pagination
|
|
130
134
|
}), {
|
|
131
|
-
columns:
|
|
132
|
-
tablePagination:
|
|
133
|
-
table:
|
|
134
|
-
onUpdateColumnSelected:
|
|
135
|
-
onUpdateChecked:
|
|
135
|
+
columns: x,
|
|
136
|
+
tablePagination: P,
|
|
137
|
+
table: z,
|
|
138
|
+
onUpdateColumnSelected: D,
|
|
139
|
+
onUpdateChecked: O,
|
|
136
140
|
columnSelected: A,
|
|
137
|
-
autoRefetch:
|
|
138
|
-
autoCountdown:
|
|
139
|
-
onAutoRefetch:
|
|
140
|
-
isExporting:
|
|
141
|
-
isExportingRows:
|
|
142
|
-
isImporting:
|
|
143
|
-
onExport:
|
|
144
|
-
onExportRows:
|
|
145
|
-
onImport:
|
|
146
|
-
} = b,
|
|
141
|
+
autoRefetch: U,
|
|
142
|
+
autoCountdown: y,
|
|
143
|
+
onAutoRefetch: E,
|
|
144
|
+
isExporting: F,
|
|
145
|
+
isExportingRows: I,
|
|
146
|
+
isImporting: V,
|
|
147
|
+
onExport: W,
|
|
148
|
+
onExportRows: B,
|
|
149
|
+
onImport: M
|
|
150
|
+
} = b, _ = s(() => x.value.filter((o) => "title" in o && "key" in o).map((o) => ({
|
|
147
151
|
label: o.title,
|
|
148
152
|
value: o.key
|
|
149
153
|
}))), {
|
|
150
154
|
width: n
|
|
151
|
-
} =
|
|
155
|
+
} = $(), q = s(() => x.value.reduce((a, d) => a + (Number(d?.width) || Number(d?.minWidth) || 110), 0)), u = w({
|
|
152
156
|
show: !1
|
|
153
|
-
}), c =
|
|
157
|
+
}), c = w({
|
|
154
158
|
show: !1
|
|
155
|
-
}), m =
|
|
159
|
+
}), m = w({
|
|
156
160
|
show: !1
|
|
157
161
|
}), h = s(() => (t.filterSchema || []).map((o) => {
|
|
158
162
|
const {
|
|
@@ -160,18 +164,18 @@ const St = /* @__PURE__ */ G({
|
|
|
160
164
|
...d
|
|
161
165
|
} = o;
|
|
162
166
|
return {
|
|
163
|
-
tag:
|
|
167
|
+
tag: se,
|
|
164
168
|
attrs: {
|
|
165
169
|
label: a
|
|
166
170
|
},
|
|
167
171
|
children: d
|
|
168
172
|
};
|
|
169
173
|
})), {
|
|
170
|
-
render:
|
|
174
|
+
render: J
|
|
171
175
|
} = N({
|
|
172
176
|
data: s(() => h.value?.slice(t.filterNumber))
|
|
173
177
|
}), {
|
|
174
|
-
render:
|
|
178
|
+
render: K
|
|
175
179
|
} = N({
|
|
176
180
|
data: s(() => h.value?.slice(0, t.filterNumber))
|
|
177
181
|
}), g = s(() => ({
|
|
@@ -179,8 +183,8 @@ const St = /* @__PURE__ */ G({
|
|
|
179
183
|
export: !0,
|
|
180
184
|
refresh: !0,
|
|
181
185
|
...t.tools
|
|
182
|
-
})),
|
|
183
|
-
return () => e(
|
|
186
|
+
})), k = Z(), G = k.tabs.find((o) => o.path === k.current);
|
|
187
|
+
return () => e(ce, {
|
|
184
188
|
actions: t.actions,
|
|
185
189
|
scrollbar: !1
|
|
186
190
|
}, {
|
|
@@ -192,7 +196,7 @@ const St = /* @__PURE__ */ G({
|
|
|
192
196
|
class: "flex gap-2 justify-between flex-col lg:flex-row"
|
|
193
197
|
}, [t.tabs && e("div", {
|
|
194
198
|
class: "flex flex-none"
|
|
195
|
-
}, [e(
|
|
199
|
+
}, [e(ee, {
|
|
196
200
|
type: "segment",
|
|
197
201
|
size: "small",
|
|
198
202
|
style: {
|
|
@@ -204,7 +208,7 @@ const St = /* @__PURE__ */ G({
|
|
|
204
208
|
f.value.tab = o;
|
|
205
209
|
}
|
|
206
210
|
}, {
|
|
207
|
-
default: () => [t.tabs?.map((o) => e(
|
|
211
|
+
default: () => [t.tabs?.map((o) => e(te, {
|
|
208
212
|
name: o.value,
|
|
209
213
|
tab: o.label
|
|
210
214
|
}, null))]
|
|
@@ -224,7 +228,7 @@ const St = /* @__PURE__ */ G({
|
|
|
224
228
|
class: ["flex-1 flex flex-col lg:flex-row gap-2 flex-wrap", t.tabs ? "justify-end" : "justify-start"]
|
|
225
229
|
}, [!t.tabs && !t.filterSchema?.length && e("div", {
|
|
226
230
|
class: "flex flex-none items-center text-base font-medium"
|
|
227
|
-
}, [
|
|
231
|
+
}, [G?.label]), C(K)]), l?.sideRight && n.value < 1024 && e(r, {
|
|
228
232
|
class: "flex-none",
|
|
229
233
|
secondary: !0,
|
|
230
234
|
onClick: () => {
|
|
@@ -248,11 +252,11 @@ const St = /* @__PURE__ */ G({
|
|
|
248
252
|
icon: () => e("div", {
|
|
249
253
|
class: ["i-tabler:chevrons-down size-4 transition-all"]
|
|
250
254
|
}, null)
|
|
251
|
-
}), l?.tools?.(), e(
|
|
252
|
-
options:
|
|
255
|
+
}), l?.tools?.(), e(oe, {
|
|
256
|
+
options: _.value,
|
|
253
257
|
value: A.value,
|
|
254
258
|
onUpdateValue: (o) => {
|
|
255
|
-
|
|
259
|
+
D(o);
|
|
256
260
|
},
|
|
257
261
|
multiple: !0,
|
|
258
262
|
placement: "bottom-start",
|
|
@@ -272,8 +276,8 @@ const St = /* @__PURE__ */ G({
|
|
|
272
276
|
}), g.value.export && e(p, null, {
|
|
273
277
|
trigger: () => e(r, {
|
|
274
278
|
secondary: !0,
|
|
275
|
-
loading:
|
|
276
|
-
onClick:
|
|
279
|
+
loading: F.value,
|
|
280
|
+
onClick: W
|
|
277
281
|
}, {
|
|
278
282
|
icon: () => e("div", {
|
|
279
283
|
class: "i-tabler:database-export size-4"
|
|
@@ -283,8 +287,8 @@ const St = /* @__PURE__ */ G({
|
|
|
283
287
|
}), g.value.import && e(p, null, {
|
|
284
288
|
trigger: () => e(r, {
|
|
285
289
|
secondary: !0,
|
|
286
|
-
loading:
|
|
287
|
-
onClick:
|
|
290
|
+
loading: V.value,
|
|
291
|
+
onClick: M
|
|
288
292
|
}, {
|
|
289
293
|
icon: () => e("div", {
|
|
290
294
|
class: "i-tabler:database-import size-4"
|
|
@@ -294,18 +298,18 @@ const St = /* @__PURE__ */ G({
|
|
|
294
298
|
}), g.value.refresh && e(p, null, {
|
|
295
299
|
trigger: () => e(r, {
|
|
296
300
|
secondary: !0,
|
|
297
|
-
onClick:
|
|
301
|
+
onClick: E
|
|
298
302
|
}, {
|
|
299
|
-
icon: () =>
|
|
303
|
+
icon: () => U.value ? e(le, {
|
|
300
304
|
class: "size-4",
|
|
301
305
|
type: "circle",
|
|
302
|
-
percentage:
|
|
306
|
+
percentage: y.value * 10,
|
|
303
307
|
strokeWidth: 20,
|
|
304
308
|
color: "rgba(var(--ui-color-primary))"
|
|
305
309
|
}, {
|
|
306
310
|
default: () => [e("span", {
|
|
307
311
|
class: "text-8px"
|
|
308
|
-
}, [
|
|
312
|
+
}, [y.value])]
|
|
309
313
|
}) : e("div", {
|
|
310
314
|
class: "i-tabler:refresh size-4"
|
|
311
315
|
}, null)
|
|
@@ -313,40 +317,40 @@ const St = /* @__PURE__ */ G({
|
|
|
313
317
|
default: () => i("components.button.autoRefresh")
|
|
314
318
|
})]), e("div", {
|
|
315
319
|
class: "flex gap-2 justify-end"
|
|
316
|
-
}, [l.actions?.(), t.actions?.length > 0 &&
|
|
320
|
+
}, [l.actions?.(), t.actions?.length > 0 && L({
|
|
317
321
|
type: n.value < 1024 ? "dropdown" : "button",
|
|
318
322
|
items: t.actions
|
|
319
323
|
})])])]), l?.header?.(), e("div", {
|
|
320
324
|
class: "flex-1 min-h-0"
|
|
321
325
|
}, [l?.default?.({
|
|
322
326
|
...b,
|
|
323
|
-
width:
|
|
327
|
+
width: q.value
|
|
324
328
|
})]), e("div", {
|
|
325
329
|
class: "flex justify-between"
|
|
326
|
-
}, [e("div", null, [l?.bottom?.()]), e("div", null, [t.pagination && e(
|
|
330
|
+
}, [e("div", null, [l?.bottom?.()]), e("div", null, [t.pagination && e(ie, Q(P.value, {
|
|
327
331
|
simple: n.value < 768
|
|
328
332
|
}), {
|
|
329
333
|
prefix: () => e("div", null, [i("components.list.total", {
|
|
330
334
|
total: b.total.value || 0
|
|
331
335
|
})])
|
|
332
|
-
})])]), e(
|
|
333
|
-
number:
|
|
336
|
+
})])]), e(me, {
|
|
337
|
+
number: z.value.checkedRowKeys?.length || 0 || 0,
|
|
334
338
|
group: [[{
|
|
335
339
|
icon: "i-tabler:x",
|
|
336
340
|
onClick: () => {
|
|
337
|
-
|
|
341
|
+
O?.([]);
|
|
338
342
|
}
|
|
339
343
|
}], [{
|
|
340
344
|
label: i("components.button.export"),
|
|
341
345
|
icon: "i-tabler:file-export",
|
|
342
|
-
loading:
|
|
343
|
-
onClick:
|
|
346
|
+
loading: I.value,
|
|
347
|
+
onClick: B
|
|
344
348
|
}, {
|
|
345
349
|
label: i("components.button.delete"),
|
|
346
350
|
type: "error",
|
|
347
351
|
icon: "i-tabler:trash"
|
|
348
352
|
}]]
|
|
349
|
-
}, null), e(
|
|
353
|
+
}, null), e(ae, {
|
|
350
354
|
draggable: !0,
|
|
351
355
|
class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur min-w-110",
|
|
352
356
|
show: u.show,
|
|
@@ -356,15 +360,15 @@ const St = /* @__PURE__ */ G({
|
|
|
356
360
|
draggableClass: o
|
|
357
361
|
}) => {
|
|
358
362
|
let a;
|
|
359
|
-
return e(
|
|
363
|
+
return e(ne, {
|
|
360
364
|
title: i("components.button.filter"),
|
|
361
365
|
handle: o,
|
|
362
366
|
onClose: () => u.show = !1
|
|
363
367
|
}, {
|
|
364
|
-
default: () => [e(
|
|
368
|
+
default: () => [e(ue, {
|
|
365
369
|
showLabel: !0,
|
|
366
370
|
labelPlacement: "top"
|
|
367
|
-
},
|
|
371
|
+
}, pe(a = C(J)) ? a : {
|
|
368
372
|
default: () => [a]
|
|
369
373
|
})]
|
|
370
374
|
});
|
|
@@ -400,5 +404,5 @@ const St = /* @__PURE__ */ G({
|
|
|
400
404
|
}
|
|
401
405
|
});
|
|
402
406
|
export {
|
|
403
|
-
|
|
407
|
+
Tt as DuxTableLayout
|
|
404
408
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useVModel as
|
|
4
|
-
import
|
|
5
|
-
import { NTree as
|
|
6
|
-
import { DuxCard as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as q, toRef as S, ref as u, watch as V, computed as C, createVNode as n, mergeProps as G, Fragment as H } from "vue";
|
|
2
|
+
import { useI18n as J, useTree as Q, useCustomMutation as W } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as Z } from "@vueuse/core";
|
|
4
|
+
import $ from "clsx";
|
|
5
|
+
import { NTree as K, NButton as ee, NInput as le, NScrollbar as te, NSpin as ne, NDropdown as ae } from "naive-ui";
|
|
6
|
+
import { DuxCard as ie } from "../card/card.js";
|
|
7
|
+
const fe = /* @__PURE__ */ q({
|
|
8
8
|
name: "DuxTreeFilter",
|
|
9
9
|
props: {
|
|
10
10
|
title: String,
|
|
@@ -24,111 +24,120 @@ const re = /* @__PURE__ */ R({
|
|
|
24
24
|
default: !1
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
extends:
|
|
27
|
+
extends: K,
|
|
28
28
|
setup(t, {
|
|
29
|
-
emit:
|
|
30
|
-
slots:
|
|
29
|
+
emit: T,
|
|
30
|
+
slots: b
|
|
31
31
|
}) {
|
|
32
|
-
const
|
|
32
|
+
const w = Z(t, "value", T, {
|
|
33
33
|
passive: !1,
|
|
34
34
|
defaultValue: t.defaultValue
|
|
35
|
-
}),
|
|
36
|
-
t:
|
|
37
|
-
} =
|
|
38
|
-
options:
|
|
39
|
-
loading:
|
|
35
|
+
}), U = S(t, "params", {}), A = S(t, "path", ""), I = S(t, "sortPath", ""), F = u(), P = u(0), k = u(0), r = u([]), y = u(), {
|
|
36
|
+
t: N
|
|
37
|
+
} = J(), {
|
|
38
|
+
options: E,
|
|
39
|
+
loading: B,
|
|
40
40
|
expanded: j
|
|
41
|
-
} =
|
|
42
|
-
path:
|
|
43
|
-
params:
|
|
41
|
+
} = Q({
|
|
42
|
+
path: A.value,
|
|
43
|
+
params: U.value,
|
|
44
44
|
...t.treeOptions
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
V(E, (e) => {
|
|
47
|
+
r.value = e;
|
|
48
48
|
}, {
|
|
49
49
|
immediate: !0,
|
|
50
50
|
deep: !0
|
|
51
51
|
});
|
|
52
|
-
const
|
|
52
|
+
const p = u(!1), L = C(() => t.menus?.map((e) => ({
|
|
53
53
|
label: e.label,
|
|
54
54
|
key: e.value,
|
|
55
55
|
icon: e?.icon ? () => n("div", {
|
|
56
56
|
class: e?.icon
|
|
57
57
|
}, null) : void 0,
|
|
58
58
|
onSelect: e.onSelect
|
|
59
|
-
})) || []),
|
|
59
|
+
})) || []), M = (e) => {
|
|
60
60
|
const l = t.menus?.find((a) => a.value === e);
|
|
61
|
-
l && l.onSelect(
|
|
62
|
-
},
|
|
61
|
+
l && l.onSelect(F.value), p.value = !1;
|
|
62
|
+
}, _ = W({
|
|
63
63
|
path: I.value,
|
|
64
64
|
method: "POST"
|
|
65
|
-
}),
|
|
65
|
+
}), g = (e, l) => {
|
|
66
66
|
for (const a of e)
|
|
67
67
|
if (a.children) {
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
68
|
+
for (const i of a.children)
|
|
69
|
+
if (i.id === l)
|
|
70
70
|
return a;
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
71
|
+
const o = g(a.children, l);
|
|
72
|
+
if (o)
|
|
73
|
+
return o;
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, z = ({
|
|
76
76
|
node: e,
|
|
77
77
|
dragNode: l,
|
|
78
78
|
dropPosition: a
|
|
79
79
|
}) => {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
|
|
80
|
+
const o = g(r.value, l.id), i = !o, m = [...r.value];
|
|
81
|
+
if (i) {
|
|
82
|
+
const d = r.value.findIndex((O) => O.id === l.id);
|
|
83
|
+
d >= 0 && m.splice(d, 1);
|
|
84
84
|
} else {
|
|
85
|
-
const
|
|
86
|
-
|
|
85
|
+
const d = o?.children?.indexOf(l) || 0;
|
|
86
|
+
o?.children?.splice(d, 1);
|
|
87
87
|
}
|
|
88
|
-
let
|
|
88
|
+
let h = g(m, e.id), x, s = h?.children || m, c = 0;
|
|
89
89
|
switch (a) {
|
|
90
90
|
case "before":
|
|
91
|
-
|
|
91
|
+
c = s.findIndex((d) => d.id === e.id), c > 0 && (x = s[c - 1].id);
|
|
92
92
|
break;
|
|
93
93
|
case "inside":
|
|
94
|
-
|
|
94
|
+
h = e, s = h.children = h.children || [], c = s.length;
|
|
95
95
|
break;
|
|
96
96
|
case "after":
|
|
97
|
-
|
|
97
|
+
c = s.findIndex((d) => d.id === e.id) + 1, x = e.id;
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
s.splice(c, 0, l), r.value = m, _.mutate({
|
|
101
101
|
payload: {
|
|
102
|
-
parent_id:
|
|
103
|
-
before_id:
|
|
102
|
+
parent_id: h?.id,
|
|
103
|
+
before_id: x,
|
|
104
104
|
id: l.id
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
}, f = u([]), v = u(!1);
|
|
108
|
+
V(j, (e) => {
|
|
109
|
+
f?.value?.length > 0 || (v.value = e.length > 0, f.value = e);
|
|
110
110
|
}, {
|
|
111
111
|
immediate: !0
|
|
112
112
|
});
|
|
113
|
-
const
|
|
113
|
+
const D = (e) => {
|
|
114
|
+
const l = [], a = (o) => {
|
|
115
|
+
o.forEach((i) => {
|
|
116
|
+
i.children && i.children.length > 0 && (l.push(i.key || i.id), a(i.children));
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
return a(e), l;
|
|
120
|
+
}, R = () => {
|
|
121
|
+
v.value ? (f.value = [], v.value = !1) : (f.value = D(r.value), v.value = !0);
|
|
122
|
+
}, X = C(() => {
|
|
114
123
|
const {
|
|
115
124
|
title: e,
|
|
116
125
|
path: l,
|
|
117
126
|
sortPath: a,
|
|
118
|
-
params:
|
|
119
|
-
menus:
|
|
120
|
-
numField:
|
|
121
|
-
iconField:
|
|
122
|
-
treeOptions:
|
|
123
|
-
value:
|
|
124
|
-
defaultValue:
|
|
125
|
-
onUpdateValue:
|
|
126
|
-
bordered:
|
|
127
|
-
...
|
|
127
|
+
params: o,
|
|
128
|
+
menus: i,
|
|
129
|
+
numField: m,
|
|
130
|
+
iconField: h,
|
|
131
|
+
treeOptions: x,
|
|
132
|
+
value: s,
|
|
133
|
+
defaultValue: c,
|
|
134
|
+
onUpdateValue: d,
|
|
135
|
+
bordered: O,
|
|
136
|
+
...Y
|
|
128
137
|
} = t;
|
|
129
|
-
return
|
|
138
|
+
return Y;
|
|
130
139
|
});
|
|
131
|
-
return () => n(
|
|
140
|
+
return () => n(ie, {
|
|
132
141
|
class: "h-full",
|
|
133
142
|
contentClass: "flex flex-col",
|
|
134
143
|
bordered: t.bordered
|
|
@@ -137,39 +146,47 @@ const re = /* @__PURE__ */ R({
|
|
|
137
146
|
class: "px-2 py-3 pb-1 text-base font-bold"
|
|
138
147
|
}, [t.title]), n("div", {
|
|
139
148
|
class: "p-2 flex gap-2 items-center"
|
|
140
|
-
}, [n(
|
|
149
|
+
}, [n(ee, {
|
|
150
|
+
onClick: R
|
|
151
|
+
}, {
|
|
152
|
+
icon: () => n("div", {
|
|
153
|
+
class: v.value ? "i-tabler:fold-up" : "i-tabler:fold-down"
|
|
154
|
+
}, null)
|
|
155
|
+
}), n("div", {
|
|
141
156
|
class: "flex-1"
|
|
142
|
-
}, [
|
|
143
|
-
value:
|
|
144
|
-
"onUpdate:value": (e) =>
|
|
145
|
-
placeholder:
|
|
146
|
-
}, null)]),
|
|
157
|
+
}, [b.header ? b.header() : n(le, {
|
|
158
|
+
value: y.value,
|
|
159
|
+
"onUpdate:value": (e) => y.value = e,
|
|
160
|
+
placeholder: N("common.keyword")
|
|
161
|
+
}, null)]), b.tools?.()]), n(te, {
|
|
147
162
|
class: "flex-1 min-h-0",
|
|
148
163
|
xScrollable: !0
|
|
149
164
|
}, {
|
|
150
165
|
default: () => [n("div", {
|
|
151
166
|
class: "p-2"
|
|
152
|
-
}, [n(
|
|
153
|
-
show:
|
|
167
|
+
}, [n(ne, {
|
|
168
|
+
show: B.value,
|
|
154
169
|
class: "h-full"
|
|
155
170
|
}, {
|
|
156
|
-
default: () => [n(
|
|
157
|
-
data:
|
|
158
|
-
expandedKeys:
|
|
171
|
+
default: () => [n(K, G(X.value, {
|
|
172
|
+
data: r.value || [],
|
|
173
|
+
expandedKeys: f.value,
|
|
159
174
|
onUpdateExpandedKeys: (e) => {
|
|
160
|
-
|
|
175
|
+
f.value = e;
|
|
176
|
+
const l = D(r.value);
|
|
177
|
+
v.value = l.length > 0 && l.every((a) => e.includes(a));
|
|
161
178
|
},
|
|
162
179
|
blockLine: !0,
|
|
163
|
-
selectedKeys:
|
|
180
|
+
selectedKeys: w.value,
|
|
164
181
|
onUpdateSelectedKeys: (e) => {
|
|
165
|
-
|
|
182
|
+
w.value = e, t?.onUpdateValue?.(e);
|
|
166
183
|
},
|
|
167
|
-
onDrop:
|
|
168
|
-
pattern:
|
|
184
|
+
onDrop: z,
|
|
185
|
+
pattern: y.value,
|
|
169
186
|
renderPrefix: t?.numField || t?.iconField ? ({
|
|
170
187
|
option: e
|
|
171
|
-
}) => n(
|
|
172
|
-
class:
|
|
188
|
+
}) => n(H, null, [t.iconField && e[t.iconField] && n("div", {
|
|
189
|
+
class: $(e[t.iconField] || "", "size-4")
|
|
173
190
|
}, null), t.numField && n("div", {
|
|
174
191
|
class: "rounded-full bg-primary px-2 text-xs text-white"
|
|
175
192
|
}, [e[t.numField] || 0])]) : void 0,
|
|
@@ -177,27 +194,27 @@ const re = /* @__PURE__ */ R({
|
|
|
177
194
|
option: e
|
|
178
195
|
}) => ({
|
|
179
196
|
onContextmenu: (l) => {
|
|
180
|
-
|
|
197
|
+
F.value = e, p.value = !0, P.value = l.clientX, k.value = l.clientY, l.preventDefault();
|
|
181
198
|
}
|
|
182
199
|
})
|
|
183
200
|
}), null)]
|
|
184
201
|
})])]
|
|
185
|
-
}), n(
|
|
202
|
+
}), n(ae, {
|
|
186
203
|
trigger: "manual",
|
|
187
204
|
placement: "bottom-start",
|
|
188
|
-
show:
|
|
189
|
-
options:
|
|
190
|
-
x:
|
|
191
|
-
y:
|
|
205
|
+
show: p.value,
|
|
206
|
+
options: L.value,
|
|
207
|
+
x: P.value,
|
|
208
|
+
y: k.value,
|
|
192
209
|
width: 100,
|
|
193
|
-
onSelect:
|
|
210
|
+
onSelect: M,
|
|
194
211
|
onClickoutside: () => {
|
|
195
|
-
|
|
212
|
+
p.value = !1;
|
|
196
213
|
}
|
|
197
214
|
}, null)]
|
|
198
215
|
});
|
|
199
216
|
}
|
|
200
217
|
});
|
|
201
218
|
export {
|
|
202
|
-
|
|
219
|
+
fe as DuxTreeFilter
|
|
203
220
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const r = `/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-text-opacity:100%;--un-bg-opacity:100%;--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-border-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-to-opacity:100%;--un-fill-opacity:100%;--un-outline-style:solid;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
@@ -951,6 +951,8 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
951
951
|
.i-tabler\\:eye-off{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M10.585 10.587a2 2 0 0 0 2.829 2.828'/%3E%3Cpath d='M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
952
952
|
.i-tabler\\:file-export{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M11.5 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v5m-5 6h7m-3-3l3 3l-3 3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
953
953
|
.i-tabler\\:file-upload{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2m-5-10v6'/%3E%3Cpath d='M9.5 13.5L12 11l2.5 2.5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
954
|
+
.i-tabler\\:fold-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 11v8l3-3m-6 0l3 3M9 7h1m4 0h1m4 0h1M4 7h1'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
955
|
+
.i-tabler\\:fold-up{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 13V5L9 8m6 0l-3-3M9 17h1m4 0h1m4 0h1M4 17h1'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
954
956
|
.i-tabler\\:folder{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
955
957
|
.i-tabler\\:forms{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3m7-14h7a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-7M5 7H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h1m12-5h.01M13 12h.01'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
956
958
|
.i-tabler\\:grid-4x4{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 6h18M3 12h18M3 18h18M6 3v18m6-18v18m6-18v18'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
@@ -25,6 +25,9 @@ export declare const DuxTableLayout: import("vue").DefineComponent<import("vue")
|
|
|
25
25
|
type: NumberConstructor;
|
|
26
26
|
default: number;
|
|
27
27
|
};
|
|
28
|
+
sorter: {
|
|
29
|
+
type: PropType<Record<string, any>>;
|
|
30
|
+
};
|
|
28
31
|
columns: {
|
|
29
32
|
type: PropType<TableColumn[]>;
|
|
30
33
|
};
|
|
@@ -71,6 +74,9 @@ export declare const DuxTableLayout: import("vue").DefineComponent<import("vue")
|
|
|
71
74
|
type: NumberConstructor;
|
|
72
75
|
default: number;
|
|
73
76
|
};
|
|
77
|
+
sorter: {
|
|
78
|
+
type: PropType<Record<string, any>>;
|
|
79
|
+
};
|
|
74
80
|
columns: {
|
|
75
81
|
type: PropType<TableColumn[]>;
|
|
76
82
|
};
|
|
@@ -20,6 +20,9 @@ export declare const DuxTablePage: import("vue").DefineComponent<import("vue").E
|
|
|
20
20
|
type: NumberConstructor;
|
|
21
21
|
default: number;
|
|
22
22
|
};
|
|
23
|
+
sorter: {
|
|
24
|
+
type: PropType<Record<string, any>>;
|
|
25
|
+
};
|
|
23
26
|
columns: {
|
|
24
27
|
type: PropType<import("@duxweb/dvha-naiveui").TableColumn[]>;
|
|
25
28
|
};
|
|
@@ -66,6 +69,9 @@ export declare const DuxTablePage: import("vue").DefineComponent<import("vue").E
|
|
|
66
69
|
type: NumberConstructor;
|
|
67
70
|
default: number;
|
|
68
71
|
};
|
|
72
|
+
sorter: {
|
|
73
|
+
type: PropType<Record<string, any>>;
|
|
74
|
+
};
|
|
69
75
|
columns: {
|
|
70
76
|
type: PropType<import("@duxweb/dvha-naiveui").TableColumn[]>;
|
|
71
77
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duxweb/dvha-pro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.39",
|
|
5
5
|
"author": "DuxWeb",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ant-design/colors": "^7.2.1",
|
|
36
|
-
"@duxweb/dvha-core": "^1.0.
|
|
37
|
-
"@duxweb/dvha-naiveui": "^1.0.
|
|
36
|
+
"@duxweb/dvha-core": "^1.0.39",
|
|
37
|
+
"@duxweb/dvha-naiveui": "^1.0.39",
|
|
38
38
|
"@iconify-json/tabler": "^1.2.18",
|
|
39
39
|
"@overlastic/vue": "^0.8.1",
|
|
40
40
|
"@tanstack/vue-query": "^5.80.7",
|