@qy_better_lib/pc 0.1.12 → 0.1.14
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-i18n"),require("@qy_better_lib/core"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","vue-i18n","@qy_better_lib/core","element-plus"],e):(g=typeof globalThis<"u"?globalThis:g||self,e(g["@qy_better_lib/pc"]={},g.Vue,g.vueI18n,g.core,g.elementPlus))})(this,function(g,e,A,O,S){"use strict";const V=e.defineComponent({name:"TextButton",__name:"index",props:{type:{type:String,default:"primary",validator:t=>["default","primary","success","warning","info","danger"].includes(t)},icon:String,disabled:Boolean},emits:["click"],setup(t,{emit:n}){const o=t,i=n;function c(d){o.disabled||i("click",d)}return(d,C)=>{const _=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-button",[`text-button-${t.type}`,t.disabled&&"is-disabled"]])},[o.icon?(e.openBlock(),e.createBlock(_,{key:0,class:"text-button-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon)))]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"text-button-inner",onClick:e.withModifiers(c,["prevent","stop"])},[e.renderSlot(d.$slots,"default")])],2)}}});V.install=t=>{t.component("TextButton",V)};var L=(t=>(t[t.PICTURE=1]="PICTURE",t[t.PDF=2]="PDF",t[t.OTHER=3]="OTHER",t))(L||{});function I(t){var a,k;const n=e.getCurrentInstance(),o=n==null?void 0:n.props,i={rowKey:"Id","element-loading-text":"加载中…","element-loading-background":"rgba(0, 0, 0, 0.2)",highlightCurrentRow:!0,stripe:!0,border:!1,height:"100%"},c={headerAlign:void 0,align:void 0,prop:void 0,label:void 0,init:!0,width:void 0,showOverflowTooltip:!1,sortable:void 0,fixed:void 0},d=e.computed(()=>({...i,...Object.keys(o.options).length>0?o.options:{}})),C=e.reactive({count:0,rows:[]}),_=e.reactive({pageIndex:(a=o==null?void 0:o.paging)!=null&&a.pageIndex?e.toRef(o.paging,"pageIndex"):1,pageSize:(k=o==null?void 0:o.paging)!=null&&k.pageSize?e.toRef(o.paging,"pageSize"):10}),m=e.computed(()=>{var p,s;return((p=o==null?void 0:o.paging)==null?void 0:p.pageIndex)>0&&((s=o==null?void 0:o.paging)==null?void 0:s.pageSize)>0}),h=e.reactive({show:!1,filePathList:[],index:0}),r=e.reactive({showColumn:[],hiddenColumn:[]}),w=e.computed(()=>!r.showColumn||r.showColumn.length===0?[{prop:"default-prop",init:!0,label:""}]:r.showColumn.map(s=>(t&&s.langue&&(s.label=t(s.langue)),{...c,...s}))),x=e.computed(()=>{var p,s,f,y,T,$;return(((f=(s=n==null?void 0:(p=n.slots)["tool-left"])==null?void 0:s.call(p))==null?void 0:f.length)||0)>0||((($=(T=n==null?void 0:(y=n.slots)["tool-right"])==null?void 0:T.call(y))==null?void 0:$.length)||0)>0}),b=e.computed(()=>w.value.some(p=>p.fileType&&p.fileType==L.PICTURE));return{defColSetting:c,selectionOptions:C,tableAttribute:d,pagination:_,hasPagination:m,imageViewer:h,columnConfig:r,colSettingList:w,showToolPanel:x,hasImageViewer:b}}function U(){return{options:{type:Object,default:()=>({})},tableData:{type:Array,default:[]},tableColums:{type:Array,default:()=>[]},tableLoading:Boolean,selectionCol:{type:Boolean,default:()=>!0},indexCol:{type:Boolean,default:()=>!0},isSetColumn:{type:Boolean,default:()=>!1},paging:{type:Object},total:Number,sizeList:{type:Array,default:()=>[15,20,30,50,100]}}}const j=e.defineComponent({__name:"valueCol",props:{row:{type:Object,default:()=>{}},colCfg:{type:Object,default:()=>{}}},setup(t){const n=t,o=e.computed(()=>{const{row:i,colCfg:c}=n;return i[c.prop]});return(i,c)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(o.value!=null?o.value:"--"),1))}}),H={class:"set-column-list-wrap"},q={class:"fixed-wrap"},X=e.defineComponent({__name:"colVisible",setup(t){const n=e.inject("table-extend"),o=e.ref(!0),i=e.ref(!1),c=e.computed(()=>n&&n.columnConfig.showColumn.map(h=>h.prop)||[]),d=e.computed(()=>(n==null?void 0:n.tableColums.value)||[]);function C(h){h?n&&(n.columnConfig.showColumn=d.value):n&&(n.columnConfig.showColumn=[])}function _(h){if(n){n.columnConfig.showColumn=d.value.filter(w=>h.includes(w.prop));const r=h.length;o.value=r===d.value.length,i.value=r>0&&r<d.value.length}}function m(h,r){r.fixed===h?r.fixed=void 0:r.fixed=h}return(h,r)=>{const w=e.resolveComponent("Setting"),x=e.resolveComponent("el-icon"),b=e.resolveComponent("el-checkbox"),a=e.resolveComponent("Upload"),k=e.resolveComponent("el-divider"),p=e.resolveComponent("el-checkbox-group"),s=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(s,{placement:"bottom",title:"列显示设置",width:220},{reference:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(w)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(b,{indeterminate:i.value,modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=f=>o.value=f),onChange:C},{default:e.withCtx(()=>r[2]||(r[2]=[e.createTextVNode("全选 ")])),_:1},8,["indeterminate","modelValue"]),e.createVNode(p,{class:"set-column-check-group",modelValue:c.value,"onUpdate:modelValue":r[1]||(r[1]=f=>c.value=f),onChange:_},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,f=>(e.openBlock(),e.createElementBlock("div",{class:"group-item",key:f.prop},[e.createVNode(b,{class:"set-column-check",label:f.prop},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["label"]),e.createElementVNode("div",q,[e.createVNode(x,{class:e.normalizeClass(["fixed-icon",f.fixed==="left"&&"active"]),title:"固定到左边",onClick:y=>m("left",f)},{default:e.withCtx(()=>[e.createVNode(a)]),_:2},1032,["class","onClick"]),e.createVNode(k,{direction:"vertical"}),e.createVNode(x,{class:e.normalizeClass(["fixed-icon",f.fixed==="right"&&"active"]),title:"固定到右边",onClick:y=>m("right",f)},{default:e.withCtx(()=>[e.createVNode(a)]),_:2},1032,["class","onClick"])])]))),128))]),_:1},8,["modelValue"])])]),_:1})}}}),F={class:"table-extend",ref:"table-extend"},Y={class:"tool-panel"},W={class:"left-panel"},K={class:"right-panel"},G={class:"default-tool"},J=["innerHTML"],E=e.defineComponent({__name:"index",props:{...U()},emits:["tableSort","handleSelectionChange","currentChange","pageSizeChange","rowClick","rowDblClick"],setup(t,{expose:n,emit:o}){const i=t,c=o,{t:d}=A.useI18n(),{selectionOptions:C,tableAttribute:_,pagination:m,hasPagination:h,columnConfig:r,colSettingList:w}=I(d);e.provide("table-extend",{tableProps:i,tableColums:e.toRef(i,"tableColums"),columnConfig:r});const x=e.ref(),b=e.ref(null),a=e.ref(!1),k=e.ref();e.watch(()=>i.tableColums,()=>{r.showColumn=i.tableColums}),e.watch(()=>m.pageIndex,l=>{if(l&&l>0){if(a.value){a.value=!1;return}c("currentChange",l),b.value.setScrollTop(0)}}),e.watch(()=>m.pageSize,l=>{l&&l>0&&(a.value=!0,m.pageIndex=1,c("pageSizeChange",l),b.value.setScrollTop(0))}),e.onMounted(()=>{var B;const l=((B=x.value)==null?void 0:B.offsetHeight)||0;k.value=l,e.nextTick(()=>{i.tableColums&&i.tableColums.length>0&&(r.showColumn=i.tableColums)})}),n({clearSelection:T,toggleRowSelection:$,table:b});function p(l){c("tableSort",{sortName:l.prop,sortType:l.order==="descending"?"desc":l.order==="ascending"?"asc":""})}function s(l){C.rows=l,C.count=l&&l.length,c("handleSelectionChange",l)}function f(l){c("rowClick",l)}function y(l){c("rowDblClick",l)}function T(){var l;(l=b.value)==null||l.clearSelection()}function $(l){var B;(B=b.value)==null||B.toggleRowSelection(l)}return(l,B)=>{const z=e.resolveComponent("el-table-column"),le=e.resolveComponent("el-empty"),ie=e.resolveComponent("el-table"),ae=e.resolveComponent("el-pagination"),re=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("div",Y,[e.createElementVNode("div",W,[e.renderSlot(l.$slots,"tool-left")]),e.createElementVNode("div",K,[e.renderSlot(l.$slots,"tool-right"),e.createElementVNode("div",G,[l.isSetColumn?(e.openBlock(),e.createBlock(X,{key:0})):e.createCommentVNode("",!0)])])]),e.withDirectives((e.openBlock(),e.createBlock(ie,e.mergeProps({ref_key:"tableRef",ref:b},e.unref(_),{data:l.tableData,"max-height":k.value,onSortChange:p,onSelectionChange:s,onRowClick:f,onRowDblclick:y}),{empty:e.withCtx(()=>[e.createVNode(le,{"image-size":60})]),default:e.withCtx(()=>[l.selectionCol?(e.openBlock(),e.createBlock(z,{key:0,type:"selection",width:"48",fixed:"left"})):e.createCommentVNode("",!0),l.indexCol?(e.openBlock(),e.createBlock(z,{key:1,type:"index",width:"58",fixed:"left"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),u=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u.prop},[u.isHtml?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,ref_for:!0},u),{default:e.withCtx(D=>[e.createElementVNode("div",{innerHTML:u.prop&&D.row[u.prop]},null,8,J)]),_:2},1040)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u.init?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,ref_for:!0},u),{default:e.withCtx(D=>[e.renderSlot(l.$slots,`col_${u.prop}`,{data:D.row},()=>[e.createVNode(j,e.mergeProps({ref_for:!0},{row:D.row,colCfg:u}),null,16)])]),header:e.withCtx(()=>[e.renderSlot(l.$slots,`header_${u.prop}`,{data:u},()=>[e.createTextVNode(e.toDisplayString(u.label),1)])]),_:2},1040)):e.createCommentVNode("",!0)],64))],64))),128)),e.renderSlot(l.$slots,"operatColumn")]),_:3},16,["data","max-height"])),[[re,l.tableLoading]]),e.unref(h)&&(l.tableData.length||0)>e.unref(m).pageSize?(e.openBlock(),e.createBlock(ae,{key:0,background:"","current-page":e.unref(m).pageIndex,"onUpdate:currentPage":B[0]||(B[0]=u=>e.unref(m).pageIndex=u),"page-size":e.unref(m).pageSize,"onUpdate:pageSize":B[1]||(B[1]=u=>e.unref(m).pageSize=u),"page-sizes":l.sizeList,layout:"total, sizes, prev, pager, next, jumper",total:l.total},null,8,["current-page","page-size","page-sizes","total"])):e.createCommentVNode("",!0)],512)}}});E.install=t=>{t.component("TableExtend",E)};const Q={class:"contextmenu-wrap"},Z={class:"contextmenu-items"},v=["onClick"],N=e.defineComponent({__name:"index",props:{visible:{type:Boolean,default:()=>!1},position:{type:Object,default:()=>{}},options:{type:Array,default:[],required:!0}},emits:["menuClick","update:visible"],setup(t,{expose:n,emit:o}){const i=t,c=o;n({hide:x,show:r});const d=e.ref(!1),C=e.ref(null),_=e.reactive({left:0,top:0});e.watch(()=>i.visible,a=>{a&&(d.value=!0,e.nextTick(()=>{w(i.position)}))},{immediate:!0}),e.onMounted(()=>{var a;(a=C.value)==null||a.addEventListener("contextmenu",r)}),e.onBeforeUnmount(()=>{m()});function m(){var a;(a=C.value)==null||a.removeEventListener("contextmenu",r)}function h(a){c("menuClick",a),x()}async function r(a){a.preventDefault(),d.value=!0,await e.nextTick();const{pageX:k,pageY:p}=a;w({x:k,y:p})}function w(a){const{clientWidth:k,clientHeight:p}=C.value;!k||!p||(_.top=`${b("Y",a.y||0,p)}px`,_.left=`${b("X",a.x||0,k)}px`)}function x(){m(),d.value=!1,e.nextTick(()=>{c("update:visible",!1)})}function b(a,k,p){const s=a==="X"?window.innerWidth:window.innerHeight,f=a==="X"?window.scrollX:window.scrollY;let y=k-f;return y+p>s&&(y=Math.max(0,y-p)),y+f}return(a,k)=>{const p=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:"contextmenu",style:e.normalizeStyle({top:_.top,left:_.left}),ref_key:"contextMenuRef",ref:C},[e.createElementVNode("div",Q,[e.createElementVNode("ul",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.key},[(s==null?void 0:s.type)=="divider"?(e.openBlock(),e.createBlock(p,{key:0})):(e.openBlock(),e.createElementBlock("li",{key:1,class:"contextmenu-item",onClick:f=>h(s)},[e.renderSlot(a.$slots,"items",{data:{item:s,options:t.options}},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])],8,v))],64))),128))])])],4)),[[e.unref(O.ClickOutside),x]]):e.createCommentVNode("",!0)])}}});N.install=t=>{t.component("ContextMenu",N)};function ee(t,n,o=!0,i=""){switch(n){case"toast":R(o?"success":"error",t||(o?"执行成功":"执行失败"));break;case"dialog":P(t||(o?"执行成功":"执行失败"),()=>{},{title:i||"提示",type:o?"success":"error","show-cancel-button":!1});break;case"notif":M(o?"success":"error",i||"消息提示",t);break}}function te(t,n,o){const i={beforeClose:(c,d,C)=>{c==="confirm"?setTimeout(()=>{C()},0):C()},...o};S.ElMessageBox.confirm(`此操作将${t}, 是否继续?`,"提示",i).then(async()=>{n&&n()}).catch(()=>{})}function P(t,n,o){return new Promise((i,c)=>{const d={beforeClose:(C,_,m)=>{C==="confirm"?setTimeout(()=>{m()},0):m()},...o};S.ElMessageBox.confirm(`${t}`,"Tip",d).then(()=>{i(n&&n())}).catch(()=>{i(!1)})})}function R(t,n="",o=!1,i=3e3){S.ElMessage({showClose:!0,message:n,type:t,duration:i,dangerouslyUseHTMLString:o})}function M(t,n="",o="",i=!0,c="bottom-right",d=3e3){S.ElNotification({title:n,message:o,type:t,dangerouslyUseHTMLString:i,duration:d,showClose:!0,position:c})}const oe=[V,E,N];function ne(t){oe.forEach(n=>{t.use(n)})}g.confirmBox=te,g.confirmBoxAsync=P,g.contextMenu=N,g.install=ne,g.messageAlert=R,g.messageBox=ee,g.notification=M,g.tableExtend=E,g.textButton=V,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(g,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-i18n"),require("@qy_better_lib/core"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","vue-i18n","@qy_better_lib/core","element-plus"],e):(g=typeof globalThis<"u"?globalThis:g||self,e(g["@qy_better_lib/pc"]={},g.Vue,g.vueI18n,g.core,g.elementPlus))})(this,function(g,e,A,O,S){"use strict";const V=e.defineComponent({name:"TextButton",__name:"index",props:{type:{type:String,default:"primary",validator:t=>["default","primary","success","warning","info","danger"].includes(t)},icon:String,disabled:Boolean},emits:["click"],setup(t,{emit:n}){const o=t,i=n;function c(p){o.disabled||i("click",p)}return(p,C)=>{const b=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-button",[`text-button-${t.type}`,t.disabled&&"is-disabled"]])},[o.icon?(e.openBlock(),e.createBlock(b,{key:0,class:"text-button-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon)))]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"text-button-inner",onClick:e.withModifiers(c,["prevent","stop"])},[e.renderSlot(p.$slots,"default")])],2)}}});V.install=t=>{t.component("TextButton",V)};var P=(t=>(t[t.PICTURE=1]="PICTURE",t[t.PDF=2]="PDF",t[t.OTHER=3]="OTHER",t))(P||{});function I(t){var a,u;const n=e.getCurrentInstance(),o=n==null?void 0:n.props,i={rowKey:"Id","element-loading-text":"加载中…","element-loading-background":"rgba(0, 0, 0, 0.2)",highlightCurrentRow:!0,stripe:!0,border:!1,height:"100%"},c={headerAlign:void 0,align:void 0,prop:void 0,label:void 0,init:!0,width:void 0,showOverflowTooltip:!1,sortable:void 0,fixed:void 0},p=e.computed(()=>({...i,...Object.keys(o.options).length>0?o.options:{}})),C=e.reactive({count:0,rows:[]}),b=e.reactive({pageIndex:(a=o==null?void 0:o.paging)!=null&&a.pageIndex?e.toRef(o.paging,"pageIndex"):1,pageSize:(u=o==null?void 0:o.paging)!=null&&u.pageSize?e.toRef(o.paging,"pageSize"):10}),m=e.computed(()=>{var s,d;return((s=o==null?void 0:o.paging)==null?void 0:s.pageIndex)>0&&((d=o==null?void 0:o.paging)==null?void 0:d.pageSize)>0}),h=e.reactive({show:!1,filePathList:[],index:0}),r=e.reactive({showColumn:[],hiddenColumn:[]}),_=e.computed(()=>!r.showColumn||r.showColumn.length===0?[{prop:"default-prop",init:!0,label:""}]:r.showColumn.map(d=>(t&&d.langue&&(d.label=t(d.langue)),{...c,...d}))),w=e.computed(()=>{var s,d,f,x,T,$;debugger;return(((f=(d=n==null?void 0:(s=n.slots)["tool-left"])==null?void 0:d.call(s))==null?void 0:f.length)||0)>0||((($=(T=n==null?void 0:(x=n.slots)["tool-right"])==null?void 0:T.call(x))==null?void 0:$.length)||0)>0}),y=e.computed(()=>_.value.some(s=>s.fileType&&s.fileType==P.PICTURE));return{defColSetting:c,selectionOptions:C,tableAttribute:p,pagination:b,hasPagination:m,imageViewer:h,columnConfig:r,colSettingList:_,showToolPanel:w,hasImageViewer:y}}function U(){return{options:{type:Object,default:()=>({})},tableData:{type:Array,default:[]},tableColums:{type:Array,default:()=>[]},tableLoading:Boolean,selectionCol:{type:Boolean,default:()=>!0},indexCol:{type:Boolean,default:()=>!0},isSetColumn:{type:Boolean,default:()=>!1},paging:{type:Object},total:Number,sizeList:{type:Array,default:()=>[15,20,30,50,100]}}}const j=e.defineComponent({__name:"valueCol",props:{row:{type:Object,default:()=>{}},colCfg:{type:Object,default:()=>{}}},setup(t){const n=t,o=e.computed(()=>{const{row:i,colCfg:c}=n;return i[c.prop]});return(i,c)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(o.value!=null?o.value:"--"),1))}}),H={class:"set-column-list-wrap"},q={class:"fixed-wrap"},X=e.defineComponent({__name:"colVisible",setup(t){const n=e.inject("table-extend"),o=e.ref(!0),i=e.ref(!1),c=e.computed(()=>n&&n.columnConfig.showColumn.map(h=>h.prop)||[]),p=e.computed(()=>(n==null?void 0:n.tableColums.value)||[]);function C(h){h?n&&(n.columnConfig.showColumn=p.value):n&&(n.columnConfig.showColumn=[])}function b(h){if(n){n.columnConfig.showColumn=p.value.filter(_=>h.includes(_.prop));const r=h.length;o.value=r===p.value.length,i.value=r>0&&r<p.value.length}}function m(h,r){r.fixed===h?r.fixed=void 0:r.fixed=h}return(h,r)=>{const _=e.resolveComponent("Setting"),w=e.resolveComponent("el-icon"),y=e.resolveComponent("el-checkbox"),a=e.resolveComponent("Upload"),u=e.resolveComponent("el-divider"),s=e.resolveComponent("el-checkbox-group"),d=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(d,{placement:"bottom",title:"列显示设置",width:220},{reference:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(_)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(y,{indeterminate:i.value,modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=f=>o.value=f),onChange:C},{default:e.withCtx(()=>r[2]||(r[2]=[e.createTextVNode("全选 ")])),_:1},8,["indeterminate","modelValue"]),e.createVNode(s,{class:"set-column-check-group",modelValue:c.value,"onUpdate:modelValue":r[1]||(r[1]=f=>c.value=f),onChange:b},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,f=>(e.openBlock(),e.createElementBlock("div",{class:"group-item",key:f.prop},[e.createVNode(y,{class:"set-column-check",label:f.prop},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["label"]),e.createElementVNode("div",q,[e.createVNode(w,{class:e.normalizeClass(["fixed-icon",f.fixed==="left"&&"active"]),title:"固定到左边",onClick:x=>m("left",f)},{default:e.withCtx(()=>[e.createVNode(a)]),_:2},1032,["class","onClick"]),e.createVNode(u,{direction:"vertical"}),e.createVNode(w,{class:e.normalizeClass(["fixed-icon",f.fixed==="right"&&"active"]),title:"固定到右边",onClick:x=>m("right",f)},{default:e.withCtx(()=>[e.createVNode(a)]),_:2},1032,["class","onClick"])])]))),128))]),_:1},8,["modelValue"])])]),_:1})}}}),F={key:0,class:"tool-panel"},Y={class:"left-panel"},W={class:"right-panel"},K={class:"default-tool"},G=["innerHTML"],E=e.defineComponent({__name:"index",props:{...U()},emits:["tableSort","handleSelectionChange","currentChange","pageSizeChange","rowClick","rowDblClick"],setup(t,{expose:n,emit:o}){const i=t,c=o,{t:p}=A.useI18n(),{selectionOptions:C,tableAttribute:b,pagination:m,hasPagination:h,columnConfig:r,colSettingList:_,showToolPanel:w}=I(p);e.provide("table-extend",{tableProps:i,tableColums:e.toRef(i,"tableColums"),columnConfig:r});const y=e.ref(),a=e.ref(null),u=e.ref(!1),s=e.ref(),d=e.computed(()=>{const l=i.tableData.length>(i.total||0)?i.tableData.length:i.total||0;return h.value&&l>m.pageSize});e.watch(()=>i.tableColums,()=>{r.showColumn=i.tableColums}),e.watch(()=>m.pageIndex,l=>{if(l&&l>0){if(u.value){u.value=!1;return}c("currentChange",l),a.value.setScrollTop(0)}}),e.watch(()=>m.pageSize,l=>{l&&l>0&&(u.value=!0,m.pageIndex=1,c("pageSizeChange",l),a.value.setScrollTop(0))}),e.onMounted(()=>{e.nextTick(()=>{var B;const l=((B=y.value)==null?void 0:B.offsetHeight)||0;console.log("wrap_offset_height",l),s.value=l,i.tableColums&&i.tableColums.length>0&&(r.showColumn=i.tableColums)})}),n({clearSelection:ne,toggleRowSelection:le,table:a});function f(l){c("tableSort",{sortName:l.prop,sortType:l.order==="descending"?"desc":l.order==="ascending"?"asc":""})}function x(l){C.rows=l,C.count=l&&l.length,c("handleSelectionChange",l)}function T(l){c("rowClick",l)}function $(l){c("rowDblClick",l)}function ne(){var l;(l=a.value)==null||l.clearSelection()}function le(l){var B;(B=a.value)==null||B.toggleRowSelection(l)}return(l,B)=>{const z=e.resolveComponent("el-table-column"),ie=e.resolveComponent("el-empty"),ae=e.resolveComponent("el-table"),re=e.resolveComponent("el-pagination"),ce=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:"table-extend",ref_key:"tableExtendRef",ref:y},[e.unref(w)?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("div",Y,[e.renderSlot(l.$slots,"tool-left")]),e.createElementVNode("div",W,[e.renderSlot(l.$slots,"tool-right"),e.createElementVNode("div",K,[l.isSetColumn?(e.openBlock(),e.createBlock(X,{key:0})):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(ae,e.mergeProps({ref_key:"tableRef",ref:a},e.unref(b),{data:l.tableData,"max-height":s.value,onSortChange:f,onSelectionChange:x,onRowClick:T,onRowDblclick:$}),{empty:e.withCtx(()=>[e.createVNode(ie,{"image-size":60})]),default:e.withCtx(()=>[l.selectionCol?(e.openBlock(),e.createBlock(z,{key:0,type:"selection",width:"48",fixed:"left"})):e.createCommentVNode("",!0),l.indexCol?(e.openBlock(),e.createBlock(z,{key:1,type:"index",width:"58",fixed:"left"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(_),k=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k.prop},[k.isHtml?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,ref_for:!0},k),{default:e.withCtx(D=>[e.createElementVNode("div",{innerHTML:k.prop&&D.row[k.prop]},null,8,G)]),_:2},1040)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.init?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,ref_for:!0},k),{default:e.withCtx(D=>[e.renderSlot(l.$slots,`col_${k.prop}`,{data:D.row},()=>[e.createVNode(j,e.mergeProps({ref_for:!0},{row:D.row,colCfg:k}),null,16)])]),header:e.withCtx(()=>[e.renderSlot(l.$slots,`header_${k.prop}`,{data:k},()=>[e.createTextVNode(e.toDisplayString(k.label),1)])]),_:2},1040)):e.createCommentVNode("",!0)],64))],64))),128)),e.renderSlot(l.$slots,"operatColumn")]),_:3},16,["data","max-height"])),[[ce,l.tableLoading]]),d.value?(e.openBlock(),e.createBlock(re,{key:1,background:"","current-page":e.unref(m).pageIndex,"onUpdate:currentPage":B[0]||(B[0]=k=>e.unref(m).pageIndex=k),"page-size":e.unref(m).pageSize,"onUpdate:pageSize":B[1]||(B[1]=k=>e.unref(m).pageSize=k),"page-sizes":l.sizeList,layout:"total, sizes, prev, pager, next, jumper",total:l.total},null,8,["current-page","page-size","page-sizes","total"])):e.createCommentVNode("",!0)],512)}}});E.install=t=>{t.component("TableExtend",E)};const J={class:"contextmenu-wrap"},Q={class:"contextmenu-items"},Z=["onClick"],N=e.defineComponent({__name:"index",props:{visible:{type:Boolean,default:()=>!1},position:{type:Object,default:()=>{}},options:{type:Array,default:[],required:!0}},emits:["menuClick","update:visible"],setup(t,{expose:n,emit:o}){const i=t,c=o;n({hide:w,show:r});const p=e.ref(!1),C=e.ref(null),b=e.reactive({left:0,top:0});e.watch(()=>i.visible,a=>{a&&(p.value=!0,e.nextTick(()=>{_(i.position)}))},{immediate:!0}),e.onMounted(()=>{var a;(a=C.value)==null||a.addEventListener("contextmenu",r)}),e.onBeforeUnmount(()=>{m()});function m(){var a;(a=C.value)==null||a.removeEventListener("contextmenu",r)}function h(a){c("menuClick",a),w()}async function r(a){a.preventDefault(),p.value=!0,await e.nextTick();const{pageX:u,pageY:s}=a;_({x:u,y:s})}function _(a){const{clientWidth:u,clientHeight:s}=C.value;!u||!s||(b.top=`${y("Y",a.y||0,s)}px`,b.left=`${y("X",a.x||0,u)}px`)}function w(){m(),p.value=!1,e.nextTick(()=>{c("update:visible",!1)})}function y(a,u,s){const d=a==="X"?window.innerWidth:window.innerHeight,f=a==="X"?window.scrollX:window.scrollY;let x=u-f;return x+s>d&&(x=Math.max(0,x-s)),x+f}return(a,u)=>{const s=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:"contextmenu",style:e.normalizeStyle({top:b.top,left:b.left}),ref_key:"contextMenuRef",ref:C},[e.createElementVNode("div",J,[e.createElementVNode("ul",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.key},[(d==null?void 0:d.type)=="divider"?(e.openBlock(),e.createBlock(s,{key:0})):(e.openBlock(),e.createElementBlock("li",{key:1,class:"contextmenu-item",onClick:f=>h(d)},[e.renderSlot(a.$slots,"items",{data:{item:d,options:t.options}},()=>[e.createTextVNode(e.toDisplayString(d.label),1)])],8,Z))],64))),128))])])],4)),[[e.unref(O.ClickOutside),w]]):e.createCommentVNode("",!0)])}}});N.install=t=>{t.component("ContextMenu",N)};function v(t,n,o=!0,i=""){switch(n){case"toast":L(o?"success":"error",t||(o?"执行成功":"执行失败"));break;case"dialog":R(t||(o?"执行成功":"执行失败"),()=>{},{title:i||"提示",type:o?"success":"error","show-cancel-button":!1});break;case"notif":M(o?"success":"error",i||"消息提示",t);break}}function ee(t,n,o){const i={beforeClose:(c,p,C)=>{c==="confirm"?setTimeout(()=>{C()},0):C()},...o};S.ElMessageBox.confirm(`此操作将${t}, 是否继续?`,"提示",i).then(async()=>{n&&n()}).catch(()=>{})}function R(t,n,o){return new Promise((i,c)=>{const p={beforeClose:(C,b,m)=>{C==="confirm"?setTimeout(()=>{m()},0):m()},...o};S.ElMessageBox.confirm(`${t}`,"Tip",p).then(()=>{i(n&&n())}).catch(()=>{i(!1)})})}function L(t,n="",o=!1,i=3e3){S.ElMessage({showClose:!0,message:n,type:t,duration:i,dangerouslyUseHTMLString:o})}function M(t,n="",o="",i=!0,c="bottom-right",p=3e3){S.ElNotification({title:n,message:o,type:t,dangerouslyUseHTMLString:i,duration:p,showClose:!0,position:c})}const te=[V,E,N];function oe(t){te.forEach(n=>{t.use(n)})}g.confirmBox=ee,g.confirmBoxAsync=R,g.contextMenu=N,g.install=oe,g.messageAlert=L,g.messageBox=v,g.notification=M,g.tableExtend=E,g.textButton=V,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
1
|
+
import { defineComponent as J, provide as K, toRef as Q, ref as m, computed as W, watch as k, onMounted as X, nextTick as Y, resolveComponent as b, resolveDirective as Z, openBlock as o, createElementBlock as u, unref as r, createElementVNode as C, renderSlot as d, createBlock as i, createCommentVNode as p, withDirectives as ee, mergeProps as _, withCtx as g, createVNode as x, Fragment as w, renderList as te, createTextVNode as oe, toDisplayString as le } from "vue";
|
|
2
|
+
import { useI18n as ne } from "vue-i18n";
|
|
3
|
+
import ae from "../useTable.js";
|
|
4
|
+
import re from "../props.js";
|
|
5
|
+
import ie from "./valueCol.vue.js";
|
|
6
|
+
import se from "./colVisible.vue.js";
|
|
7
|
+
const ce = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "tool-panel"
|
|
10
|
+
}, pe = { class: "left-panel" }, ue = { class: "right-panel" }, de = { class: "default-tool" }, ge = ["innerHTML"], Se = /* @__PURE__ */ J({
|
|
11
11
|
__name: "index",
|
|
12
|
-
props: { ...
|
|
12
|
+
props: { ...re() },
|
|
13
13
|
emits: [
|
|
14
14
|
"tableSort",
|
|
15
15
|
"handleSelectionChange",
|
|
@@ -18,28 +18,32 @@ const re = {
|
|
|
18
18
|
"rowClick",
|
|
19
19
|
"rowDblClick"
|
|
20
20
|
],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
21
|
+
setup(R, { expose: T, emit: $ }) {
|
|
22
|
+
const l = R, s = $, { t: I } = ne(), {
|
|
23
23
|
selectionOptions: y,
|
|
24
|
-
tableAttribute:
|
|
25
|
-
pagination:
|
|
26
|
-
hasPagination:
|
|
24
|
+
tableAttribute: L,
|
|
25
|
+
pagination: a,
|
|
26
|
+
hasPagination: P,
|
|
27
27
|
columnConfig: S,
|
|
28
|
-
colSettingList: N
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
colSettingList: N,
|
|
29
|
+
showToolPanel: E
|
|
30
|
+
} = ae(I);
|
|
31
|
+
K("table-extend", {
|
|
32
|
+
tableProps: l,
|
|
33
|
+
tableColums: Q(l, "tableColums"),
|
|
33
34
|
columnConfig: S
|
|
34
35
|
});
|
|
35
|
-
const
|
|
36
|
+
const z = m(), c = m(null), v = m(!1), D = m(), H = W(() => {
|
|
37
|
+
const e = l.tableData.length > (l.total || 0) ? l.tableData.length : l.total || 0;
|
|
38
|
+
return P.value && e > a.pageSize;
|
|
39
|
+
});
|
|
36
40
|
k(
|
|
37
|
-
() =>
|
|
41
|
+
() => l.tableColums,
|
|
38
42
|
() => {
|
|
39
|
-
S.showColumn =
|
|
43
|
+
S.showColumn = l.tableColums;
|
|
40
44
|
}
|
|
41
45
|
), k(
|
|
42
|
-
() =>
|
|
46
|
+
() => a.pageIndex,
|
|
43
47
|
(e) => {
|
|
44
48
|
if (e && e > 0) {
|
|
45
49
|
if (v.value) {
|
|
@@ -50,71 +54,75 @@ const re = {
|
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
), k(
|
|
53
|
-
() =>
|
|
57
|
+
() => a.pageSize,
|
|
54
58
|
(e) => {
|
|
55
|
-
e && e > 0 && (v.value = !0,
|
|
59
|
+
e && e > 0 && (v.value = !0, a.pageIndex = 1, s("pageSizeChange", e), c.value.setScrollTop(0));
|
|
56
60
|
}
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
), X(() => {
|
|
62
|
+
Y(() => {
|
|
63
|
+
var n;
|
|
64
|
+
const e = ((n = z.value) == null ? void 0 : n.offsetHeight) || 0;
|
|
65
|
+
console.log("wrap_offset_height", e), D.value = e, l.tableColums && l.tableColums.length > 0 && (S.showColumn = l.tableColums);
|
|
62
66
|
});
|
|
63
|
-
}),
|
|
64
|
-
clearSelection:
|
|
65
|
-
toggleRowSelection:
|
|
67
|
+
}), T({
|
|
68
|
+
clearSelection: j,
|
|
69
|
+
toggleRowSelection: A,
|
|
66
70
|
table: c
|
|
67
71
|
});
|
|
68
|
-
function
|
|
72
|
+
function V(e) {
|
|
69
73
|
s("tableSort", {
|
|
70
74
|
sortName: e.prop,
|
|
71
75
|
sortType: e.order === "descending" ? "desc" : e.order === "ascending" ? "asc" : ""
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
|
-
function
|
|
78
|
+
function B(e) {
|
|
75
79
|
y.rows = e, y.count = e && e.length, s("handleSelectionChange", e);
|
|
76
80
|
}
|
|
77
|
-
function
|
|
81
|
+
function M(e) {
|
|
78
82
|
s("rowClick", e);
|
|
79
83
|
}
|
|
80
|
-
function
|
|
84
|
+
function U(e) {
|
|
81
85
|
s("rowDblClick", e);
|
|
82
86
|
}
|
|
83
|
-
function
|
|
87
|
+
function j() {
|
|
84
88
|
var e;
|
|
85
89
|
(e = c.value) == null || e.clearSelection();
|
|
86
90
|
}
|
|
87
|
-
function
|
|
88
|
-
var
|
|
89
|
-
(
|
|
91
|
+
function A(e) {
|
|
92
|
+
var n;
|
|
93
|
+
(n = c.value) == null || n.toggleRowSelection(e);
|
|
90
94
|
}
|
|
91
|
-
return (e,
|
|
92
|
-
const f =
|
|
93
|
-
return o(),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
return (e, n) => {
|
|
96
|
+
const f = b("el-table-column"), F = b("el-empty"), O = b("el-table"), q = b("el-pagination"), G = Z("loading");
|
|
97
|
+
return o(), u("div", {
|
|
98
|
+
class: "table-extend",
|
|
99
|
+
ref_key: "tableExtendRef",
|
|
100
|
+
ref: z
|
|
101
|
+
}, [
|
|
102
|
+
r(E) ? (o(), u("div", ce, [
|
|
103
|
+
C("div", pe, [
|
|
104
|
+
d(e.$slots, "tool-left")
|
|
97
105
|
]),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
e.isSetColumn ? (o(), i(
|
|
106
|
+
C("div", ue, [
|
|
107
|
+
d(e.$slots, "tool-right"),
|
|
108
|
+
C("div", de, [
|
|
109
|
+
e.isSetColumn ? (o(), i(se, { key: 0 })) : p("", !0)
|
|
102
110
|
])
|
|
103
111
|
])
|
|
104
|
-
]),
|
|
105
|
-
|
|
112
|
+
])) : p("", !0),
|
|
113
|
+
ee((o(), i(O, _({
|
|
106
114
|
ref_key: "tableRef",
|
|
107
115
|
ref: c
|
|
108
|
-
},
|
|
116
|
+
}, r(L), {
|
|
109
117
|
data: e.tableData,
|
|
110
|
-
"max-height":
|
|
111
|
-
onSortChange:
|
|
112
|
-
onSelectionChange:
|
|
113
|
-
onRowClick:
|
|
114
|
-
onRowDblclick:
|
|
118
|
+
"max-height": D.value,
|
|
119
|
+
onSortChange: V,
|
|
120
|
+
onSelectionChange: B,
|
|
121
|
+
onRowClick: M,
|
|
122
|
+
onRowDblclick: U
|
|
115
123
|
}), {
|
|
116
124
|
empty: g(() => [
|
|
117
|
-
|
|
125
|
+
x(F, { "image-size": 60 })
|
|
118
126
|
]),
|
|
119
127
|
default: g(() => [
|
|
120
128
|
e.selectionCol ? (o(), i(f, {
|
|
@@ -122,68 +130,68 @@ const re = {
|
|
|
122
130
|
type: "selection",
|
|
123
131
|
width: "48",
|
|
124
132
|
fixed: "left"
|
|
125
|
-
})) :
|
|
133
|
+
})) : p("", !0),
|
|
126
134
|
e.indexCol ? (o(), i(f, {
|
|
127
135
|
key: 1,
|
|
128
136
|
type: "index",
|
|
129
137
|
width: "58",
|
|
130
138
|
fixed: "left"
|
|
131
|
-
})) :
|
|
132
|
-
(o(!0),
|
|
139
|
+
})) : p("", !0),
|
|
140
|
+
(o(!0), u(w, null, te(r(N), (t) => (o(), u(w, {
|
|
133
141
|
key: t.prop
|
|
134
142
|
}, [
|
|
135
143
|
t.isHtml ? (o(), i(f, _({
|
|
136
144
|
key: 0,
|
|
137
145
|
ref_for: !0
|
|
138
146
|
}, t), {
|
|
139
|
-
default: g((
|
|
140
|
-
|
|
141
|
-
innerHTML: t.prop &&
|
|
142
|
-
}, null, 8,
|
|
147
|
+
default: g((h) => [
|
|
148
|
+
C("div", {
|
|
149
|
+
innerHTML: t.prop && h.row[t.prop]
|
|
150
|
+
}, null, 8, ge)
|
|
143
151
|
]),
|
|
144
152
|
_: 2
|
|
145
|
-
}, 1040)) : (o(),
|
|
153
|
+
}, 1040)) : (o(), u(w, { key: 1 }, [
|
|
146
154
|
t.init ? (o(), i(f, _({
|
|
147
155
|
key: 0,
|
|
148
156
|
ref_for: !0
|
|
149
157
|
}, t), {
|
|
150
|
-
default: g((
|
|
151
|
-
|
|
152
|
-
data:
|
|
158
|
+
default: g((h) => [
|
|
159
|
+
d(e.$slots, `col_${t.prop}`, {
|
|
160
|
+
data: h.row
|
|
153
161
|
}, () => [
|
|
154
|
-
|
|
162
|
+
x(ie, _({ ref_for: !0 }, { row: h.row, colCfg: t }), null, 16)
|
|
155
163
|
])
|
|
156
164
|
]),
|
|
157
165
|
header: g(() => [
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
d(e.$slots, `header_${t.prop}`, { data: t }, () => [
|
|
167
|
+
oe(le(t.label), 1)
|
|
160
168
|
])
|
|
161
169
|
]),
|
|
162
170
|
_: 2
|
|
163
|
-
}, 1040)) :
|
|
171
|
+
}, 1040)) : p("", !0)
|
|
164
172
|
], 64))
|
|
165
173
|
], 64))), 128)),
|
|
166
|
-
|
|
174
|
+
d(e.$slots, "operatColumn")
|
|
167
175
|
]),
|
|
168
176
|
_: 3
|
|
169
177
|
}, 16, ["data", "max-height"])), [
|
|
170
|
-
[
|
|
178
|
+
[G, e.tableLoading]
|
|
171
179
|
]),
|
|
172
|
-
|
|
173
|
-
key:
|
|
180
|
+
H.value ? (o(), i(q, {
|
|
181
|
+
key: 1,
|
|
174
182
|
background: "",
|
|
175
|
-
"current-page": a
|
|
176
|
-
"onUpdate:currentPage":
|
|
177
|
-
"page-size": a
|
|
178
|
-
"onUpdate:pageSize":
|
|
183
|
+
"current-page": r(a).pageIndex,
|
|
184
|
+
"onUpdate:currentPage": n[0] || (n[0] = (t) => r(a).pageIndex = t),
|
|
185
|
+
"page-size": r(a).pageSize,
|
|
186
|
+
"onUpdate:pageSize": n[1] || (n[1] = (t) => r(a).pageSize = t),
|
|
179
187
|
"page-sizes": e.sizeList,
|
|
180
188
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
181
189
|
total: e.total
|
|
182
|
-
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) :
|
|
190
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : p("", !0)
|
|
183
191
|
], 512);
|
|
184
192
|
};
|
|
185
193
|
}
|
|
186
194
|
});
|
|
187
195
|
export {
|
|
188
|
-
|
|
196
|
+
Se as default
|
|
189
197
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getCurrentInstance as L, computed as i, reactive as
|
|
1
|
+
import { getCurrentInstance as L, computed as i, reactive as g, toRef as m } from "vue";
|
|
2
2
|
import { FileType as P } from "./type.js";
|
|
3
|
-
function O(
|
|
4
|
-
var
|
|
3
|
+
function O(a) {
|
|
4
|
+
var s, r;
|
|
5
5
|
const n = L(), e = n == null ? void 0 : n.props, w = {
|
|
6
6
|
rowKey: "Id",
|
|
7
7
|
"element-loading-text": "加载中…",
|
|
@@ -23,35 +23,36 @@ function O(g) {
|
|
|
23
23
|
}, b = i(() => ({
|
|
24
24
|
...w,
|
|
25
25
|
...Object.keys(e.options).length > 0 ? e.options : {}
|
|
26
|
-
})), C =
|
|
26
|
+
})), C = g({
|
|
27
27
|
count: 0,
|
|
28
28
|
rows: []
|
|
29
|
-
}), x =
|
|
30
|
-
pageIndex: (
|
|
29
|
+
}), x = g({
|
|
30
|
+
pageIndex: (s = e == null ? void 0 : e.paging) != null && s.pageIndex ? m(e.paging, "pageIndex") : 1,
|
|
31
31
|
pageSize: (r = e == null ? void 0 : e.paging) != null && r.pageSize ? m(e.paging, "pageSize") : 10
|
|
32
32
|
}), T = i(() => {
|
|
33
33
|
var o, t;
|
|
34
34
|
return ((o = e == null ? void 0 : e.paging) == null ? void 0 : o.pageIndex) > 0 && ((t = e == null ? void 0 : e.paging) == null ? void 0 : t.pageSize) > 0;
|
|
35
|
-
}), S =
|
|
35
|
+
}), S = g({
|
|
36
36
|
/**是否显示 */
|
|
37
37
|
show: !1,
|
|
38
38
|
/**图片路径 */
|
|
39
39
|
filePathList: [],
|
|
40
40
|
/**显示图片的索引 */
|
|
41
41
|
index: 0
|
|
42
|
-
}), l =
|
|
42
|
+
}), l = g({
|
|
43
43
|
showColumn: [],
|
|
44
44
|
hiddenColumn: []
|
|
45
|
-
}),
|
|
45
|
+
}), u = i(() => !l.showColumn || l.showColumn.length === 0 ? [
|
|
46
46
|
{
|
|
47
47
|
prop: "default-prop",
|
|
48
48
|
init: !0,
|
|
49
49
|
label: ""
|
|
50
50
|
}
|
|
51
|
-
] : l.showColumn.map((t) => (
|
|
51
|
+
] : l.showColumn.map((t) => (a && t.langue && (t.label = a(t.langue)), { ...d, ...t }))), y = i(() => {
|
|
52
52
|
var o, t, f, h, p, c;
|
|
53
|
+
debugger;
|
|
53
54
|
return (((f = (t = n == null ? void 0 : (o = n.slots)["tool-left"]) == null ? void 0 : t.call(o)) == null ? void 0 : f.length) || 0) > 0 || (((c = (p = n == null ? void 0 : (h = n.slots)["tool-right"]) == null ? void 0 : p.call(h)) == null ? void 0 : c.length) || 0) > 0;
|
|
54
|
-
}), z = i(() =>
|
|
55
|
+
}), z = i(() => u.value.some(
|
|
55
56
|
(o) => o.fileType && o.fileType == P.PICTURE
|
|
56
57
|
));
|
|
57
58
|
return {
|
|
@@ -62,7 +63,7 @@ function O(g) {
|
|
|
62
63
|
hasPagination: T,
|
|
63
64
|
imageViewer: S,
|
|
64
65
|
columnConfig: l,
|
|
65
|
-
colSettingList:
|
|
66
|
+
colSettingList: u,
|
|
66
67
|
showToolPanel: y,
|
|
67
68
|
hasImageViewer: z
|
|
68
69
|
};
|