@ditari/bsui 1.0.66 → 1.0.68

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
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),R=require("ant-design-vue"),T=require("../../utils/html.cjs.js"),M=require("../theme/index.cjs.js"),Q=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})},expandedRowKeys:{type:Object,default:()=>[]},defaultExpandAllRows:Boolean,default:()=>!0}),b={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:a=>`总共 ${a} 条`},P=`${M.prefixName}-pagination`,I=t.defineComponent({name:"DTable",props:Q(),emits:["update:keys"],setup:function(a,{emit:p,slots:d}){const n=t.ref(a.keys||[]),E=t.computed(()=>a.data),z=t.computed(()=>{var e;return((e=a.config)==null?void 0:e.columns)??[]}),m=t.computed(()=>{var e;return((e=a.config)==null?void 0:e.pagination)??{}}),S=t.ref(a.expandedRowKeys);t.watchEffect(()=>{const{expandedRowKeys:e}=a;S.value=e});const{tableRef:K,tableRootRef:O,tableHeight:B,onPageChange:V,onRowClassName:H}=j();function j(){const{rowClassName:e,keepSelected:l,onPageChange:i}=a.config,f=a.config.selection??"N",r=t.ref(),u=t.ref(null),o=t.ref(),c=t.ref(null),g=s=>{var h,x;try{const y=(h=u==null?void 0:u.value)==null?void 0:h.$el,$=T.useEleHeight(y.getElementsByClassName("ant-table-header")[0]);let N=0;if(a.config.pagination){const J=(x=r.value)==null?void 0:x.getElementsByClassName(P)[0];N=T.useEleHeight(J)??0}o.value=s-($+N),y.getElementsByClassName("ant-table-body")[0].style.height=o.value+"px",c.value=y.getElementsByClassName("ant-table-body")[0]}catch(y){console.warn(y)}};return t.watchEffect(()=>{a.height!==0&&t.nextTick(()=>{setTimeout(()=>{g(a.height)},10)})}),{tableRef:u,tableRootRef:r,tableHeight:o,onPageChange:(s,h)=>{i&&i({page:s,size:h}),c.value.scrollTop=0,(f==="S"||!l)&&(n.value=[],p("update:keys",n.value))},onRowClassName:(s,h)=>e?e(s,h):void 0}}const q=D();function D(){const{rowKey:e,config:{getCheckboxProps:l}}=a;let i=a.config.selection??"N";const f=(o,c)=>{i==="S"?(n.value=[],n.value=c?[o[e]]:[]):n.value=c?n.value.concat(o[e]):n.value.filter(g=>g!==o[e]),p("update:keys",n.value)},r=(o,c,g)=>{const v=g.map(w=>w[e]);n.value=o?n.value.concat(v):n.value.filter(w=>!v.includes(w)),p("update:keys",n.value)};t.watch(()=>a.keys,o=>{n.value=o});const u=t.ref(void 0);return t.watchEffect(()=>{const{selection:o}=a.config;i=o,i!=="N"?u.value={selectedRowKeys:n,onSelect:f,onSelectAll:r,fixed:!0,columnTitle:i==="S"?"选择":null,columnWidth:i==="S"?60:40,getCheckboxProps:l}:u.value=void 0}),u}const A=F();function F(){return e=>{let l;const{rowKey:i,config:{click:f,dbClick:r,selection:u,getCheckboxProps:o}}=a,c=e[i],g=()=>{const v=o===void 0?!1:o(e).disabled;if(u==="N"||v)return;n.value.some(s=>s===c)?n.value=n.value.filter(s=>s!==c):(u==="S"&&(n.value=[]),n.value.push(c)),p("update:keys",n.value)};return{onClick:()=>{clearTimeout(l),l=setTimeout(()=>{g(),f&&f(e)},200)},onDblclick:()=>{clearTimeout(l),r&&r(e)}}}}const C=e=>{e.stopPropagation()},U=t.computed(()=>{const{selection:e}=a.config;return e==="N"}),k={};d.expandedRowRender&&(k.expandedRowRender=e=>t.createVNode(t.Fragment,null,[d.expandedRowRender&&d.expandedRowRender(e)]));const _=()=>t.createVNode(t.Fragment,null,[d.summary&&d.summary()]);return()=>{var e;return t.createVNode("div",{ref:O,style:{height:"100%"}},[t.createVNode(R.Table,{ref:K,"row-key":a.rowKey,bordered:a.config.bordered,columns:z.value,dataSource:E.value,loading:a.loading,size:((e=a.config)==null?void 0:e.size)??"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:B.value+"px"},expandedRowKeys:S.value,"onUpdate:expandedRowKeys":l=>S.value=l,expandRowByClick:U.value,defaultExpandAllRows:a.defaultExpandAllRows,pagination:!1,customRow:A,rowSelection:q.value,rowClassName:H},{bodyCell:({column:l,record:i})=>{if(l.slot==="action")return t.createVNode("div",{onClick:C,onDblclick:C},[t.createVNode(R.Space,null,{default:()=>[d.action&&d.action(i)]})])},...k,summary:_}),t.withDirectives(t.createVNode(R.Pagination,{class:[P],current:m.value.current,"onUpdate:current":l=>m.value.current=l,pageSize:m.value.pageSize,"onUpdate:pageSize":l=>m.value.pageSize=l,disabled:a.loading,"show-size-changer":!0,size:"default","hide-on-single-page":b.hideOnSinglePage,"show-quick-jumper":b.showQuickJumper,"default-page-size":b.defaultPageSize,"page-size-options":b.pageSizeOptions,"show-total":b.showTotal,total:m.value.total,onChange:V},null),[[t.vShow,a.config.pagination]])])}}});exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),x=require("ant-design-vue"),_=require("../../utils/html.cjs.js"),I=require("../theme/index.cjs.js");function L(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!n.isVNode(t)}const W=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})},expandedRowKeys:{type:Object,default:()=>[]},defaultExpandAllRows:Boolean,default:()=>!0}),b={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:t=>`总共 ${t} 条`},E=`${I.prefixName}-pagination`,X=n.defineComponent({name:"DTable",props:W(),emits:["update:keys"],setup:function(t,{emit:p,slots:g}){const l=n.ref(t.keys||[]),z=n.computed(()=>t.data),O=n.computed(()=>{var e,a;return(a=(e=t.config)===null||e===void 0?void 0:e.columns)!==null&&a!==void 0?a:[]}),m=n.computed(()=>{var e,a;return(a=(e=t.config)===null||e===void 0?void 0:e.pagination)!==null&&a!==void 0?a:{}}),R=n.ref(t.expandedRowKeys);n.watchEffect(()=>{const{expandedRowKeys:e}=t;R.value=e});const{tableRef:j,tableRootRef:K,tableHeight:B,onPageChange:V,onRowClassName:H}=q();function q(){var e;const{rowClassName:a,keepSelected:c,onPageChange:o}=t.config,s=(e=t.config.selection)!==null&&e!==void 0?e:"N",f=n.ref(),u=n.ref(null),i=n.ref(),d=n.ref(null),v=y=>{var h,C,k;try{const w=(h=u==null?void 0:u.value)===null||h===void 0?void 0:h.$el,M=_.useEleHeight(w.getElementsByClassName("ant-table-header")[0]);let P=0;if(t.config.pagination){const Q=(C=f.value)===null||C===void 0?void 0:C.getElementsByClassName(E)[0];P=(k=_.useEleHeight(Q))!==null&&k!==void 0?k:0}i.value=y-(M+P),w.getElementsByClassName("ant-table-body")[0].style.height=i.value+"px",d.value=w.getElementsByClassName("ant-table-body")[0]}catch(w){console.warn(w)}};return n.watchEffect(()=>{t.height!==0&&n.nextTick(()=>{setTimeout(()=>{v(t.height)},10)})}),{tableRef:u,tableRootRef:f,tableHeight:i,onPageChange:(y,h)=>{o&&o({page:y,size:h}),d.value.scrollTop=0,(s==="S"||!c)&&(l.value=[],p("update:keys",l.value))},onRowClassName:(y,h)=>a?a(y,h):void 0}}const D=A();function A(){var e;const{rowKey:a,config:{getCheckboxProps:c}}=t;let o=(e=t.config.selection)!==null&&e!==void 0?e:"N";const s=(i,d)=>{o==="S"?(l.value=[],l.value=d?[i[a]]:[]):l.value=d?l.value.concat(i[a]):l.value.filter(v=>v!==i[a]),p("update:keys",l.value)},f=(i,d,v)=>{const S=v.map(r=>r[a]);l.value=i?l.value.concat(S):l.value.filter(r=>!S.includes(r)),p("update:keys",l.value)};n.watch(()=>t.keys,i=>{l.value=i});const u=n.ref(void 0);return n.watchEffect(()=>{const{selection:i}=t.config;o=i,o!=="N"?u.value={selectedRowKeys:l,onSelect:s,onSelectAll:f,fixed:!0,columnTitle:o==="S"?"选择":null,columnWidth:o==="S"?60:40,getCheckboxProps:c}:u.value=void 0}),u}const F=U();function U(){return e=>{let a;const{rowKey:c,config:{click:o,dbClick:s,selection:f,getCheckboxProps:u}}=t,i=e[c],d=()=>{const v=u===void 0?!1:u(e).disabled;if(f==="N"||v)return;l.value.some(r=>r===i)?l.value=l.value.filter(r=>r!==i):(f==="S"&&(l.value=[]),l.value.push(i)),p("update:keys",l.value)};return{onClick:()=>{clearTimeout(a),a=setTimeout(()=>{d(),o&&o(e)},200)},onDblclick:()=>{clearTimeout(a),s&&s(e)}}}}const N=e=>{e.stopPropagation()},$=n.computed(()=>{const{selection:e}=t.config;return e==="N"}),T={};g.expandedRowRender&&(T.expandedRowRender=e=>n.createVNode(n.Fragment,null,[g.expandedRowRender&&g.expandedRowRender(e)]));const J=()=>n.createVNode(n.Fragment,null,[g.summary&&g.summary()]);return()=>{let e;var a,c;return n.createVNode("div",{ref:K,style:{height:"100%"}},[n.createVNode(x.Table,{ref:j,"row-key":t.rowKey,bordered:t.config.bordered,columns:O.value,dataSource:z.value,loading:t.loading,size:(c=(a=t.config)===null||a===void 0?void 0:a.size)!==null&&c!==void 0?c:"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:B.value+"px"},expandedRowKeys:R.value,"onUpdate:expandedRowKeys":o=>R.value=o,expandRowByClick:$.value,defaultExpandAllRows:t.defaultExpandAllRows,pagination:!1,customRow:F,rowSelection:D.value,rowClassName:H},L(e=Object.assign(Object.assign({bodyCell:({column:o,record:s})=>{if(o.slot==="action")return n.createVNode("div",{onClick:N,onDblclick:N},[n.createVNode(x.Space,null,{default:()=>[g.action&&g.action(s)]})])}},T),{summary:J}))?e:{default:()=>[e]}),n.withDirectives(n.createVNode(x.Pagination,{class:[E],current:m.value.current,"onUpdate:current":o=>m.value.current=o,pageSize:m.value.pageSize,"onUpdate:pageSize":o=>m.value.pageSize=o,disabled:t.loading,"show-size-changer":!0,size:"default","hide-on-single-page":b.hideOnSinglePage,"show-quick-jumper":b.showQuickJumper,"default-page-size":b.defaultPageSize,"page-size-options":b.pageSizeOptions,"show-total":b.showTotal,total:m.value.total,onChange:V},null),[[n.vShow,t.config.pagination]])])}}});exports.default=X;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),q=require("vue-request"),f=require("../../utils/get.cjs.js"),z=(i,e={})=>{e.pagination||(e.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"}),e.manual===void 0&&(e.manual=!0);const{dataKey:o,pagination:{currentKey:r,pageSizeKey:c}}=e,a=e.params||n.ref({}),{total:s,pageSize:g,current:v,loading:d,data:m,run:u}=q.usePagination(i,{manual:!0,pagination:e.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(t,l)=>{e.onSuccess&&e.onSuccess(t,l)},onError:(t,l)=>{console.log(l,t)}}),y=n.computed(()=>({total:s.value,current:v.value,pageSize:g.value})),S=n.computed(()=>f.get(m.value,o||"data",[])||[]),p=t=>{a.value[r]=t.page,a.value[c]=t.size,u(a.value||{})},K=t=>{a.value={...a.value,...t},a.value[r]=1,u(a.value||{})};return n.onMounted(()=>{e.manual&&u(a.value)}),{data:S,pagination:y,loading:d,run:u,onPageChange:p,onQuery:K}};exports.useRequestList=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),f=require("vue-request"),q=require("../../utils/get.cjs.js"),z=(c,e={})=>{e.pagination||(e.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"}),e.manual===void 0&&(e.manual=!0);const{dataKey:o,pagination:{currentKey:r,pageSizeKey:s}}=e,a=e.params||n.ref({}),{total:g,pageSize:v,current:d,loading:i,data:m,run:u}=f.usePagination(c,{manual:!0,pagination:e.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(t,l)=>{e.onSuccess&&e.onSuccess(t,l)},onError:(t,l)=>{console.warn(l,t),i.value=!1}}),y=n.computed(()=>({total:g.value,current:d.value,pageSize:v.value})),S=n.computed(()=>q.get(m.value,o||"data",[])||[]),p=t=>{a.value[r]=t.page,a.value[s]=t.size,u(a.value||{})},K=t=>{a.value={...a.value,...t},a.value[r]=1,u(a.value||{})};return n.onMounted(()=>{e.manual&&u(a.value)}),{data:S,pagination:y,loading:i,run:u,onPageChange:p,onQuery:K}};exports.useRequestList=z;
@@ -1 +1 @@
1
- .ditari-bsui-grid{position:relative;display:grid}.ditari-bsui-grid .ditari-bsui-grid--item{border:1px solid #4e4e4e;margin-left:-1px;margin-top:-1px}.ditari-bsui-grid-form .ant-form-item{margin-bottom:0;height:100%}.ditari-bsui-grid-form .ant-form-item .ant-form-item-label{border-right:1px solid #4e4e4e}.ditari-bsui-grid-form .ant-form-item .ant-input,.ditari-bsui-grid-form .ant-form-item .ant-select-selector,.ditari-bsui-grid-form .ant-form-item .ant-input-number{border:0;border-radius:0}.ditari-bsui-grid-form .ant-form-item .ant-input:focus,.ditari-bsui-grid-form .ant-form-item .ant-select-selector:focus,.ditari-bsui-grid-form .ant-form-item .ant-input-number:focus{box-shadow:0 0 0 2px #1890ff}.ditari-bsui-grid-form .ant-form-item .ant-input .ant-input-number-input,.ditari-bsui-grid-form .ant-form-item .ant-select-selector .ant-input-number-input,.ditari-bsui-grid-form .ant-form-item .ant-input-number .ant-input-number-input{border:0;border-radius:0}.ditari-bsui-grid-form .ant-form-item .ant-input .ant-input-number-input:focus,.ditari-bsui-grid-form .ant-form-item .ant-select-selector .ant-input-number-input:focus,.ditari-bsui-grid-form .ant-form-item .ant-input-number .ant-input-number-input:focus{box-shadow:0 0 0 2px #1890ff}.ditari-bsui-grid-form .ant-form-item .ant-input[disabled]{color:#525252}.ditari-bsui-grid-form .ant-form-item-has-error .ant-form-item-explain{display:block}.ditari-bsui-grid-form .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{box-shadow:0 0 0 2px #1890ff}.ditari-bsui-grid-form .ant-form-item-has-error :not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus{box-shadow:0 0 0px 2px red;border-radius:0}.ditari-bsui-grid-form .ant-form-item-has-error :not(.ant-input-disabled):not(.ant-input-borderless).ant-input{box-shadow:0 0 0px 2px #ff4d4f}.ditari-menu{height:calc(100vh - 240px - 0);overflow:scroll}.ditari-menu::-webkit-scrollbar{width:0 !important;display:none}.ditari-layout-sider{background-color:#162157}.ditari-layout-sider .ant-menu-dark{background-color:#162157}.ditari-layout-sider .ant-menu-dark .ant-menu-inline.ant-menu-sub{background-color:#101847}.ditari-bsui-breadcrumb .ant-breadcrumb-separator{display:none}.ditari-bsui-breadcrumb .breadcrumb{display:flex}.ditari-bsui-breadcrumb .breadcrumb .breadcrumb-item{color:#333}.ditari-bsui-breadcrumb .breadcrumb .breadcrumb-item:first-child .breadcrumb-link{border-radius:6px 0 0 6px;clip-path:polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%)}.ditari-bsui-breadcrumb .breadcrumb .breadcrumb-item:last-child:not(:first-child) .breadcrumb-link{border-radius:0 6px 6px 0;clip-path:polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%)}.ditari-bsui-breadcrumb .breadcrumb-link{display:block;padding:4px 12px;background:#f0f2f5;clip-path:polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%)}.ditari-bsui-breadcrumb a.breadcrumb-link{color:#2589ff}.breadcrumb-enter-active{transition:all .25s}.breadcrumb-enter-from,.breadcrumb-leave-active{opacity:0;transform:translateX(30px) skewX(-50deg)}.ditari-list-layout{padding:20px;height:100%}.ditari-list-layout .wrapper{display:flex;flex-direction:column}.ditari-list-layout .ditari-list-table{flex:1}.ditari-list-layout .ditari-list-table .ant-card-body{display:flex;flex-direction:column;height:100%}.ditari-list-layout .ditari-list-form .ant-card-body{padding-bottom:0}.ditari-list-layout .wrapper{height:100%}.ditari-ant-back-top{right:4px;bottom:120px}.ditari-layout{height:100%}.ditari-layout .ditari-layout-sider{position:fixed;left:0;top:0;bottom:0;z-index:1}.ditari-layout .ditari-top-layout{position:fixed;left:200px;right:0;z-index:210}.ditari-layout .ditari-layout-content{margin-left:200px;margin-top:84px}.fade-enter-active,.fade-leave-active{transition:opacity .1s ease}.fade-enter-from,.fade-leave-to{opacity:0}.main-enter-active{transition:.2s}.main-leave-active{transition:.15s}.main-enter-from{opacity:0;margin-left:-20px}.main-leave-to{opacity:0;margin-left:20px}.ditari-layout-header{display:flex;justify-content:space-between;align-items:center;padding:0 15px;height:42px;border-bottom:1px solid #f0f2f5;background-color:#fff}.ditari-layout-header .ditari-layout-header-left{display:flex;justify-content:center}.ditari-layout-header .ditari-layout-header-left .ditari-side-collapsed{margin-right:20px;cursor:pointer;width:42px;line-height:30px;text-align:center;transition-duration:.2s}.ditari-layout-header .ditari-layout-header-left .ditari-side-collapsed:hover{background-color:#f0f2f5;border-radius:4px}.ditari-layout-header .ditari-layout-header-left .ditari-side-collapsed .icon{transition-duration:.2s}.ditari-user-menu{display:flex;align-items:center;height:100%}.ditari-user-menu .ditari-operation-items{margin-left:10px;height:100%}.ditari-user-menu .ditari-operation-items .ant-dropdown-link{display:flex;align-items:center;justify-content:center;height:100%}.collapsed-animation{transform:rotate(-180deg)}.ditari-bsui-nav{display:flex;background:linear-gradient(270deg, #019cfe 0%, #0165fe 100%)}.ditari-bsui-nav .ant-tabs-nav{margin:0}.ditari-bsui-nav .ant-tabs-content-holder{display:none}.ditari-bsui-nav .ant-tabs-nav-list{padding-right:30px}.ditari-bsui-nav .ant-tabs-tab{position:relative;margin-left:0 !important;border:0 !important;transition:none !important;border-radius:10px 10px 0 0 !important;color:#fff}.ditari-bsui-nav .ant-tabs-tab:first-child .tab-dividers::before,.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active{background-color:#fff}.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active .tab-item{color:#0065b3}.ditari-bsui-nav .ant-tabs-tab:not(.ant-tabs-tab-active){background:rgba(0,0,0,0)}.ditari-bsui-nav .ant-tabs-tab:hover:not(.ant-tabs-tab-active){background:#065de1}.ditari-bsui-nav .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-tab:hover:not(.ant-tabs-tab-active)+.ant-tabs-tab .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-tab .ant-tabs-tab-btn{display:flex;align-items:center}.ditari-bsui-nav .ant-tabs-tab .tab-close{padding:4px;margin-left:10px;display:flex;align-items:center;justify-content:center;border-radius:50%}.ditari-bsui-nav .ant-tabs-tab .tab-close:hover{background-color:#63aeff;color:#fff}.ditari-bsui-nav .ant-tabs-tab .tab-close .anticon{margin:0}.ditari-bsui-nav .ant-tabs-tab-active+.ant-tabs-tab .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-nav-wrap{padding:4px 8px 0}.ditari-bsui-nav .ant-tabs-nav::before{border-bottom-width:0}.ditari-bsui-nav .ant-tabs-tab::before,.ditari-bsui-nav .ant-tabs-tab::after{position:absolute;bottom:0;content:"";width:20px;height:20px;border-radius:100%;box-shadow:0 0 0 40px rgba(0,0,0,0)}.ditari-bsui-nav .ant-tabs-tab::before{left:-20px;clip-path:inset(50% -10px 0 50%)}.ditari-bsui-nav .ant-tabs-tab::after{right:-20px;clip-path:inset(50% 50% 0 -10px)}.ditari-bsui-nav .ant-tabs-tab:hover::before,.ditari-bsui-nav .ant-tabs-tab:hover::after{box-shadow:0 0 0 30px #065de1}.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active::before,.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active::after{z-index:10;box-shadow:0 0 0 30px #fff}.ditari-bsui-nav .tab-dividers{position:absolute;z-index:0;height:14px;top:50%;left:0;margin-top:-7px}.ditari-bsui-nav .tab-dividers::before{content:"";display:block;position:absolute;top:0;left:1px;bottom:0;width:1px;opacity:1;background-color:#fff;transition:opacity .2s ease,background-color .3s}.ditari-show-layout{position:relative}.ditari-show-layout .ant-card{margin-bottom:10px}.ditari-show-layout .ant-card .ant-card-head{padding:10px 24px}.ditari-show-layout .ant-card .ant-card-head .ant-card-head-title{padding:0}.ditari-show-layout .ant-card:last-child{margin-bottom:0}.ditari-show-layout .ditari-page-header{position:sticky;top:84px;z-index:10;padding:4px 24px;transition:all .3s}.ditari-show-layout .ditari-page-header.active{box-shadow:7px 12px 20px 0 #e0e0e0}.ditari-show-layout .ditari-show-footer{position:fixed;right:0;bottom:0;left:200px;z-index:10;padding:10px;background:#fff;box-shadow:4px -2px 5px 3px #e0e0e0}.ditari-fuck-top-layout{position:fixed;left:200px;right:0;z-index:210;display:flex;background:linear-gradient(270deg, #019cfe 0%, #0165fe 100%)}.ditari-fuck-top-layout .ditari-bsui-nav{flex:1;min-width:0}.ditari-fuck-top-layout .ditari-side-collapsed{display:flex;align-items:center;justify-content:center;width:42px;cursor:pointer;color:#fff}.ditari-bsui-pagination{margin-top:24px;text-align:center}.ant-table.ant-table-bordered>.ant-table-container{border-bottom:1px solid #f0f0f0}.ditari-bsui-desensitize .value{padding:0 4px}.ditari-bsui-modal .ant-modal-body{padding:0}.ditari-bsui-modal .ditari-bsui-modal-content{max-height:200px;overflow-y:scroll}.ditari-bsui-modal .ditari-bsui-modal-content::-webkit-scrollbar{width:0 !important;display:none}.ant-table.ant-table-bordered>.ant-table-container{border-bottom:1px solid #f0f0f0}@media screen and (min-width: 320px){.modal{font-size:12px}}@media screen and (min-width: 640px){.modal{font-size:14px}}@media screen and (min-width: 1024px){.modal{font-size:16px}}@media screen and (min-width: 1440px){.modal{font-size:18px}}@media screen and (max-width: 640px){.modal-sm{width:100%;height:100%;min-width:240px;min-height:160px}}@media screen and (min-width: 640px)and (max-width: 1024px){.modal-md{margin:100px auto;max-width:600px;max-height:480px}}@media screen and (min-width: 1024px)and (max-width: 1440px){.modal-lg{margin:100px auto;max-width:800px;max-height:600px}}@media screen and (min-width: 1440px){.modal-xl{margin:100px auto}}html,body,#app{height:100%;background:#f0f2f5}html::-webkit-scrollbar,body::-webkit-scrollbar,#app::-webkit-scrollbar{width:0 !important;display:none}
1
+ .ditari-bsui-grid{position:relative;display:grid}.ditari-bsui-grid .ditari-bsui-grid--item{border:1px solid #4e4e4e;margin-left:-1px;margin-top:-1px}.ditari-bsui-grid-form .ant-form-item{margin-bottom:0;height:100%}.ditari-bsui-grid-form .ant-form-item .ant-form-item-label{border-right:1px solid #4e4e4e}.ditari-bsui-grid-form .ant-form-item .ant-input,.ditari-bsui-grid-form .ant-form-item .ant-select-selector,.ditari-bsui-grid-form .ant-form-item .ant-input-number{border:0;border-radius:0}.ditari-bsui-grid-form .ant-form-item .ant-input:focus,.ditari-bsui-grid-form .ant-form-item .ant-select-selector:focus,.ditari-bsui-grid-form .ant-form-item .ant-input-number:focus{box-shadow:0 0 0 2px #1890ff}.ditari-bsui-grid-form .ant-form-item .ant-input .ant-input-number-input,.ditari-bsui-grid-form .ant-form-item .ant-select-selector .ant-input-number-input,.ditari-bsui-grid-form .ant-form-item .ant-input-number .ant-input-number-input{border:0;border-radius:0}.ditari-bsui-grid-form .ant-form-item .ant-input .ant-input-number-input:focus,.ditari-bsui-grid-form .ant-form-item .ant-select-selector .ant-input-number-input:focus,.ditari-bsui-grid-form .ant-form-item .ant-input-number .ant-input-number-input:focus{box-shadow:0 0 0 2px #1890ff}.ditari-bsui-grid-form .ant-form-item .ant-input[disabled]{color:#525252}.ditari-bsui-grid-form .ant-form-item-has-error .ant-form-item-explain{display:block}.ditari-bsui-grid-form .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{box-shadow:0 0 0 2px #1890ff}.ditari-bsui-grid-form .ant-form-item-has-error :not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus{box-shadow:0 0 0px 2px red;border-radius:0}.ditari-bsui-grid-form .ant-form-item-has-error :not(.ant-input-disabled):not(.ant-input-borderless).ant-input{box-shadow:0 0 0px 2px #ff4d4f}.ditari-menu{height:calc(100vh - 240px - 0px);overflow:scroll}.ditari-menu::-webkit-scrollbar{width:0 !important;display:none}.ditari-layout-sider{background-color:#162157}.ditari-layout-sider .ant-menu-dark{background-color:#162157}.ditari-layout-sider .ant-menu-dark .ant-menu-inline.ant-menu-sub{background-color:#101847}.ditari-bsui-breadcrumb .ant-breadcrumb-separator{display:none}.ditari-bsui-breadcrumb .breadcrumb{display:flex}.ditari-bsui-breadcrumb .breadcrumb .breadcrumb-item{color:#333}.ditari-bsui-breadcrumb .breadcrumb .breadcrumb-item:first-child .breadcrumb-link{border-radius:6px 0 0 6px;clip-path:polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%)}.ditari-bsui-breadcrumb .breadcrumb .breadcrumb-item:last-child:not(:first-child) .breadcrumb-link{border-radius:0 6px 6px 0;clip-path:polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%)}.ditari-bsui-breadcrumb .breadcrumb-link{display:block;padding:4px 12px;background:#f0f2f5;clip-path:polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%)}.ditari-bsui-breadcrumb a.breadcrumb-link{color:#2589ff}.breadcrumb-enter-active{transition:all .25s}.breadcrumb-enter-from,.breadcrumb-leave-active{opacity:0;transform:translateX(30px) skewX(-50deg)}.ditari-list-layout{padding:20px;height:100%}.ditari-list-layout .wrapper{display:flex;flex-direction:column}.ditari-list-layout .ditari-list-table{flex:1}.ditari-list-layout .ditari-list-table .ant-card-body{display:flex;flex-direction:column;height:100%}.ditari-list-layout .ditari-list-form .ant-card-body{padding-bottom:0}.ditari-list-layout .wrapper{height:100%}.ditari-ant-back-top{right:4px;bottom:120px}.ditari-layout{height:100%}.ditari-layout .ditari-layout-sider{position:fixed;left:0;top:0;bottom:0;z-index:1}.ditari-layout .ditari-top-layout{position:fixed;left:200px;right:0;z-index:210}.ditari-layout .ditari-layout-content{margin-left:200px;margin-top:84px}.fade-enter-active,.fade-leave-active{transition:opacity .1s ease}.fade-enter-from,.fade-leave-to{opacity:0}.main-enter-active{transition:.2s}.main-leave-active{transition:.15s}.main-enter-from{opacity:0;margin-left:-20px}.main-leave-to{opacity:0;margin-left:20px}.ditari-layout-header{display:flex;justify-content:space-between;align-items:center;padding:0 15px;height:42px;border-bottom:1px solid #f0f2f5;background-color:#fff}.ditari-layout-header .ditari-layout-header-left{display:flex;justify-content:center}.ditari-layout-header .ditari-layout-header-left .ditari-side-collapsed{margin-right:20px;cursor:pointer;width:42px;line-height:30px;text-align:center;transition-duration:.2s}.ditari-layout-header .ditari-layout-header-left .ditari-side-collapsed:hover{background-color:#f0f2f5;border-radius:4px}.ditari-layout-header .ditari-layout-header-left .ditari-side-collapsed .icon{transition-duration:.2s}.ditari-user-menu{display:flex;align-items:center;height:100%}.ditari-user-menu .ditari-operation-items{margin-left:10px;height:100%}.ditari-user-menu .ditari-operation-items .ant-dropdown-link{display:flex;align-items:center;justify-content:center;height:100%}.collapsed-animation{transform:rotate(-180deg)}.ditari-bsui-nav{display:flex;background:linear-gradient(270deg, #019cfe 0%, #0165fe 100%)}.ditari-bsui-nav .ant-tabs-nav{margin:0}.ditari-bsui-nav .ant-tabs-content-holder{display:none}.ditari-bsui-nav .ant-tabs-nav-list{padding-right:30px}.ditari-bsui-nav .ant-tabs-tab{position:relative;margin-left:0 !important;border:0 !important;transition:none !important;border-radius:10px 10px 0 0 !important;color:#fff}.ditari-bsui-nav .ant-tabs-tab:first-child .tab-dividers::before,.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active{background-color:#fff}.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active .tab-item{color:#0065b3}.ditari-bsui-nav .ant-tabs-tab:not(.ant-tabs-tab-active){background:rgba(0,0,0,0)}.ditari-bsui-nav .ant-tabs-tab:hover:not(.ant-tabs-tab-active){background:#065de1}.ditari-bsui-nav .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-tab:hover:not(.ant-tabs-tab-active)+.ant-tabs-tab .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-tab .ant-tabs-tab-btn{display:flex;align-items:center}.ditari-bsui-nav .ant-tabs-tab .tab-close{padding:4px;margin-left:10px;display:flex;align-items:center;justify-content:center;border-radius:50%}.ditari-bsui-nav .ant-tabs-tab .tab-close:hover{background-color:#63aeff;color:#fff}.ditari-bsui-nav .ant-tabs-tab .tab-close .anticon{margin:0}.ditari-bsui-nav .ant-tabs-tab-active+.ant-tabs-tab .tab-dividers::before{opacity:0}.ditari-bsui-nav .ant-tabs-nav-wrap{padding:4px 8px 0}.ditari-bsui-nav .ant-tabs-nav::before{border-bottom-width:0}.ditari-bsui-nav .ant-tabs-tab::before,.ditari-bsui-nav .ant-tabs-tab::after{position:absolute;bottom:0;content:"";width:20px;height:20px;border-radius:100%;box-shadow:0 0 0 40px rgba(0,0,0,0)}.ditari-bsui-nav .ant-tabs-tab::before{left:-20px;clip-path:inset(50% -10px 0 50%)}.ditari-bsui-nav .ant-tabs-tab::after{right:-20px;clip-path:inset(50% 50% 0 -10px)}.ditari-bsui-nav .ant-tabs-tab:hover::before,.ditari-bsui-nav .ant-tabs-tab:hover::after{box-shadow:0 0 0 30px #065de1}.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active::before,.ditari-bsui-nav .ant-tabs-tab.ant-tabs-tab-active::after{z-index:10;box-shadow:0 0 0 30px #fff}.ditari-bsui-nav .tab-dividers{position:absolute;z-index:0;height:14px;top:50%;left:0;margin-top:-7px}.ditari-bsui-nav .tab-dividers::before{content:"";display:block;position:absolute;top:0;left:1px;bottom:0;width:1px;opacity:1;background-color:#fff;transition:opacity .2s ease,background-color .3s}.ditari-show-layout{position:relative}.ditari-show-layout .ant-card{margin-bottom:10px}.ditari-show-layout .ant-card .ant-card-head{padding:10px 24px}.ditari-show-layout .ant-card .ant-card-head .ant-card-head-title{padding:0}.ditari-show-layout .ant-card:last-child{margin-bottom:0}.ditari-show-layout .ditari-page-header{position:sticky;top:84px;z-index:10;padding:4px 24px;transition:all .3s}.ditari-show-layout .ditari-page-header.active{box-shadow:7px 12px 20px 0 #e0e0e0}.ditari-show-layout .ditari-show-footer{position:fixed;right:0;bottom:0;left:200px;z-index:10;padding:10px;background:#fff;box-shadow:4px -2px 5px 3px #e0e0e0}.ditari-fuck-top-layout{position:fixed;left:200px;right:0;z-index:210;display:flex;background:linear-gradient(270deg, #019cfe 0%, #0165fe 100%)}.ditari-fuck-top-layout .ditari-bsui-nav{flex:1;min-width:0}.ditari-fuck-top-layout .ditari-side-collapsed{display:flex;align-items:center;justify-content:center;width:42px;cursor:pointer;color:#fff}.ditari-bsui-pagination{margin-top:24px;text-align:center}.ant-table.ant-table-bordered>.ant-table-container{border-bottom:1px solid #f0f0f0}.ditari-bsui-desensitize .value{padding:0 4px}.ditari-bsui-modal .ant-modal-body{padding:0}.ditari-bsui-modal .ditari-bsui-modal-content{max-height:200px;overflow-y:scroll}.ditari-bsui-modal .ditari-bsui-modal-content::-webkit-scrollbar{width:0 !important;display:none}.ant-table.ant-table-bordered>.ant-table-container{border-bottom:1px solid #f0f0f0}@media screen and (min-width: 320px){.modal{font-size:12px}}@media screen and (min-width: 640px){.modal{font-size:14px}}@media screen and (min-width: 1024px){.modal{font-size:16px}}@media screen and (min-width: 1440px){.modal{font-size:18px}}@media screen and (max-width: 640px){.modal-sm{width:100%;height:100%;min-width:240px;min-height:160px}}@media screen and (min-width: 640px)and (max-width: 1024px){.modal-md{margin:100px auto;max-width:600px;max-height:480px}}@media screen and (min-width: 1024px)and (max-width: 1440px){.modal-lg{margin:100px auto;max-width:800px;max-height:600px}}@media screen and (min-width: 1440px){.modal-xl{margin:100px auto}}html,body,#app{height:100%;background:#f0f2f5}html::-webkit-scrollbar,body::-webkit-scrollbar,#app::-webkit-scrollbar{width:0 !important;display:none}
@@ -1 +1 @@
1
- .ditari-menu{height:calc(100vh - 240px - 0);overflow:scroll}.ditari-menu::-webkit-scrollbar{width:0 !important;display:none}.ditari-layout-sider{background-color:#162157}.ditari-layout-sider .ant-menu-dark{background-color:#162157}.ditari-layout-sider .ant-menu-dark .ant-menu-inline.ant-menu-sub{background-color:#101847}
1
+ .ditari-menu{height:calc(100vh - 240px - 0px);overflow:scroll}.ditari-menu::-webkit-scrollbar{width:0 !important;display:none}.ditari-layout-sider{background-color:#162157}.ditari-layout-sider .ant-menu-dark{background-color:#162157}.ditari-layout-sider .ant-menu-dark .ant-menu-inline.ant-menu-sub{background-color:#101847}
@@ -1,8 +1,11 @@
1
- import { defineComponent as X, ref as r, computed as S, watchEffect as k, nextTick as _, watch as G, createVNode as f, withDirectives as M, vShow as Y, Fragment as z } from "vue";
2
- import { Table as Z, Space as ee, Pagination as te } from "ant-design-vue";
1
+ import { defineComponent as G, ref as m, computed as C, watchEffect as T, nextTick as M, watch as Y, createVNode as h, withDirectives as Z, vShow as ee, isVNode as te, Fragment as O } from "vue";
2
+ import { Table as ne, Space as ae, Pagination as le } from "ant-design-vue";
3
3
  import { useEleHeight as E } from "../../utils/html.esm.js";
4
- import { prefixName as ae } from "../theme/index.esm.js";
5
- const ne = () => ({
4
+ import { prefixName as oe } from "../theme/index.esm.js";
5
+ function ie(t) {
6
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
7
+ }
8
+ const ue = () => ({
6
9
  data: {
7
10
  type: Object,
8
11
  required: !0
@@ -34,7 +37,7 @@ const ne = () => ({
34
37
  },
35
38
  defaultExpandAllRows: Boolean,
36
39
  default: () => !0
37
- }), b = {
40
+ }), p = {
38
41
  defaultPageSize: 20,
39
42
  hideOnSinglePage: !1,
40
43
  pageSizeOptions: ["10", "20", "30", "40"],
@@ -42,135 +45,136 @@ const ne = () => ({
42
45
  showQuickJumper: !0,
43
46
  showLessItems: !0,
44
47
  showTotal: (t) => `总共 ${t} 条`
45
- }, K = `${ae}-pagination`, ce = /* @__PURE__ */ X({
48
+ }, K = `${oe}-pagination`, ge = /* @__PURE__ */ G({
46
49
  name: "DTable",
47
- props: ne(),
50
+ props: ue(),
48
51
  // emits: { "update:keys": (keys: []) => void }
49
52
  // TODO 需要做调整
50
53
  emits: ["update:keys"],
51
54
  setup: function(t, {
52
55
  emit: R,
53
- slots: s
56
+ slots: r
54
57
  }) {
55
- const a = r(t.keys || []), B = S(() => t.data), O = S(() => {
56
- var e;
57
- return ((e = t.config) == null ? void 0 : e.columns) ?? [];
58
- }), v = S(() => {
59
- var e;
60
- return ((e = t.config) == null ? void 0 : e.pagination) ?? {};
61
- }), C = r(t.expandedRowKeys);
62
- k(() => {
58
+ const a = m(t.keys || []), j = C(() => t.data), B = C(() => {
59
+ var e, n;
60
+ return (n = (e = t.config) === null || e === void 0 ? void 0 : e.columns) !== null && n !== void 0 ? n : [];
61
+ }), y = C(() => {
62
+ var e, n;
63
+ return (n = (e = t.config) === null || e === void 0 ? void 0 : e.pagination) !== null && n !== void 0 ? n : {};
64
+ }), k = m(t.expandedRowKeys);
65
+ T(() => {
63
66
  const {
64
67
  expandedRowKeys: e
65
68
  } = t;
66
- C.value = e;
69
+ k.value = e;
67
70
  });
68
71
  const {
69
72
  tableRef: H,
70
- tableRootRef: j,
71
- tableHeight: A,
72
- onPageChange: D,
73
- onRowClassName: U
74
- } = $();
75
- function $() {
73
+ tableRootRef: A,
74
+ tableHeight: D,
75
+ onPageChange: U,
76
+ onRowClassName: $
77
+ } = q();
78
+ function q() {
79
+ var e;
76
80
  const {
77
- rowClassName: e,
78
- keepSelected: o,
81
+ rowClassName: n,
82
+ keepSelected: u,
79
83
  onPageChange: l
80
- } = t.config, m = t.config.selection ?? "N", d = r(), i = r(null), n = r(), u = r(null), g = (c) => {
81
- var h, T;
84
+ } = t.config, c = (e = t.config.selection) !== null && e !== void 0 ? e : "N", g = m(), i = m(null), o = m(), s = m(null), f = (w) => {
85
+ var v, x, N;
82
86
  try {
83
- const p = (h = i == null ? void 0 : i.value) == null ? void 0 : h.$el, V = E(p.getElementsByClassName("ant-table-header")[0]);
84
- let P = 0;
87
+ const b = (v = i == null ? void 0 : i.value) === null || v === void 0 ? void 0 : v.$el, W = E(b.getElementsByClassName("ant-table-header")[0]);
88
+ let _ = 0;
85
89
  if (t.config.pagination) {
86
- const W = (T = d.value) == null ? void 0 : T.getElementsByClassName(K)[0];
87
- P = E(W) ?? 0;
90
+ const X = (x = g.value) === null || x === void 0 ? void 0 : x.getElementsByClassName(K)[0];
91
+ _ = (N = E(X)) !== null && N !== void 0 ? N : 0;
88
92
  }
89
- n.value = c - (V + P), p.getElementsByClassName("ant-table-body")[0].style.height = n.value + "px", u.value = p.getElementsByClassName("ant-table-body")[0];
90
- } catch (p) {
91
- console.warn(p);
93
+ o.value = w - (W + _), b.getElementsByClassName("ant-table-body")[0].style.height = o.value + "px", s.value = b.getElementsByClassName("ant-table-body")[0];
94
+ } catch (b) {
95
+ console.warn(b);
92
96
  }
93
97
  };
94
- return k(() => {
95
- t.height !== 0 && _(() => {
98
+ return T(() => {
99
+ t.height !== 0 && M(() => {
96
100
  setTimeout(() => {
97
- g(t.height);
101
+ f(t.height);
98
102
  }, 10);
99
103
  });
100
104
  }), {
101
105
  tableRef: i,
102
- tableRootRef: d,
103
- tableHeight: n,
104
- onPageChange: (c, h) => {
106
+ tableRootRef: g,
107
+ tableHeight: o,
108
+ onPageChange: (w, v) => {
105
109
  l && l({
106
- page: c,
107
- size: h
108
- }), u.value.scrollTop = 0, (m === "S" || !o) && (a.value = [], R("update:keys", a.value));
110
+ page: w,
111
+ size: v
112
+ }), s.value.scrollTop = 0, (c === "S" || !u) && (a.value = [], R("update:keys", a.value));
109
113
  },
110
- onRowClassName: (c, h) => e ? e(c, h) : void 0
114
+ onRowClassName: (w, v) => n ? n(w, v) : void 0
111
115
  };
112
116
  }
113
- const q = F();
114
- function F() {
117
+ const F = J();
118
+ function J() {
119
+ var e;
115
120
  const {
116
- rowKey: e,
121
+ rowKey: n,
117
122
  config: {
118
- getCheckboxProps: o
123
+ getCheckboxProps: u
119
124
  }
120
125
  } = t;
121
- let l = t.config.selection ?? "N";
122
- const m = (n, u) => {
123
- l === "S" ? (a.value = [], a.value = u ? [n[e]] : []) : a.value = u ? a.value.concat(n[e]) : a.value.filter((g) => g !== n[e]), R("update:keys", a.value);
124
- }, d = (n, u, g) => {
125
- const w = g.map((y) => y[e]);
126
- a.value = n ? a.value.concat(w) : a.value.filter((y) => !w.includes(y)), R("update:keys", a.value);
126
+ let l = (e = t.config.selection) !== null && e !== void 0 ? e : "N";
127
+ const c = (o, s) => {
128
+ l === "S" ? (a.value = [], a.value = s ? [o[n]] : []) : a.value = s ? a.value.concat(o[n]) : a.value.filter((f) => f !== o[n]), R("update:keys", a.value);
129
+ }, g = (o, s, f) => {
130
+ const S = f.map((d) => d[n]);
131
+ a.value = o ? a.value.concat(S) : a.value.filter((d) => !S.includes(d)), R("update:keys", a.value);
127
132
  };
128
- G(() => t.keys, (n) => {
129
- a.value = n;
133
+ Y(() => t.keys, (o) => {
134
+ a.value = o;
130
135
  });
131
- const i = r(void 0);
132
- return k(() => {
136
+ const i = m(void 0);
137
+ return T(() => {
133
138
  const {
134
- selection: n
139
+ selection: o
135
140
  } = t.config;
136
- l = n, l !== "N" ? i.value = {
141
+ l = o, l !== "N" ? i.value = {
137
142
  selectedRowKeys: a,
138
- onSelect: m,
139
- onSelectAll: d,
143
+ onSelect: c,
144
+ onSelectAll: g,
140
145
  fixed: !0,
141
146
  columnTitle: l === "S" ? "选择" : null,
142
147
  columnWidth: l === "S" ? 60 : 40,
143
- getCheckboxProps: o
148
+ getCheckboxProps: u
144
149
  } : i.value = void 0;
145
150
  }), i;
146
151
  }
147
- const J = Q();
148
- function Q() {
152
+ const Q = V();
153
+ function V() {
149
154
  return (e) => {
150
- let o;
155
+ let n;
151
156
  const {
152
- rowKey: l,
157
+ rowKey: u,
153
158
  config: {
154
- click: m,
155
- dbClick: d,
156
- selection: i,
157
- getCheckboxProps: n
159
+ click: l,
160
+ dbClick: c,
161
+ selection: g,
162
+ getCheckboxProps: i
158
163
  }
159
- } = t, u = e[l], g = () => {
160
- const w = n === void 0 ? !1 : n(e).disabled;
161
- if (i === "N" || w)
164
+ } = t, o = e[u], s = () => {
165
+ const f = i === void 0 ? !1 : i(e).disabled;
166
+ if (g === "N" || f)
162
167
  return;
163
- a.value.some((c) => c === u) ? a.value = a.value.filter((c) => c !== u) : (i === "S" && (a.value = []), a.value.push(u)), R("update:keys", a.value);
168
+ a.value.some((d) => d === o) ? a.value = a.value.filter((d) => d !== o) : (g === "S" && (a.value = []), a.value.push(o)), R("update:keys", a.value);
164
169
  };
165
170
  return {
166
171
  onClick: () => {
167
- clearTimeout(o), o = setTimeout(() => {
168
- g(), m && m(e);
172
+ clearTimeout(n), n = setTimeout(() => {
173
+ s(), l && l(e);
169
174
  }, 200);
170
175
  },
171
- // 点击行
172
176
  onDblclick: () => {
173
- clearTimeout(o), d && d(e);
177
+ clearTimeout(n), c && c(e);
174
178
  }
175
179
  // onContextmenu: (event) => {
176
180
  // //TODO
@@ -184,80 +188,83 @@ const ne = () => ({
184
188
  };
185
189
  };
186
190
  }
187
- const x = (e) => {
191
+ const P = (e) => {
188
192
  e.stopPropagation();
189
- }, I = S(() => {
193
+ }, I = C(() => {
190
194
  const {
191
195
  selection: e
192
196
  } = t.config;
193
197
  return e === "N";
194
- }), N = {};
195
- s.expandedRowRender && (N.expandedRowRender = (e) => f(z, null, [s.expandedRowRender && s.expandedRowRender(e)]));
196
- const L = () => f(z, null, [s.summary && s.summary()]);
198
+ }), z = {};
199
+ r.expandedRowRender && (z.expandedRowRender = (e) => h(O, null, [r.expandedRowRender && r.expandedRowRender(e)]));
200
+ const L = () => h(O, null, [r.summary && r.summary()]);
197
201
  return () => {
198
- var e;
199
- return f("div", {
200
- ref: j,
202
+ let e;
203
+ var n, u;
204
+ return h("div", {
205
+ ref: A,
201
206
  style: {
202
207
  height: "100%"
203
208
  }
204
- }, [f(Z, {
209
+ }, [h(ne, {
205
210
  ref: H,
206
211
  "row-key": t.rowKey,
207
212
  bordered: t.config.bordered,
208
- columns: O.value,
209
- dataSource: B.value,
213
+ columns: B.value,
214
+ dataSource: j.value,
210
215
  loading: t.loading,
211
- size: ((e = t.config) == null ? void 0 : e.size) ?? "small",
216
+ size: (u = (n = t.config) === null || n === void 0 ? void 0 : n.size) !== null && u !== void 0 ? u : "small",
212
217
  scroll: {
213
218
  scrollToFirstRowOnChange: !0,
214
219
  x: "100%",
215
- y: A.value + "px"
220
+ y: D.value + "px"
216
221
  },
217
- expandedRowKeys: C.value,
218
- "onUpdate:expandedRowKeys": (o) => C.value = o,
222
+ expandedRowKeys: k.value,
223
+ "onUpdate:expandedRowKeys": (l) => k.value = l,
219
224
  expandRowByClick: I.value,
220
225
  defaultExpandAllRows: t.defaultExpandAllRows,
221
226
  pagination: !1,
222
- customRow: J,
223
- rowSelection: q.value,
224
- rowClassName: U
225
- }, {
227
+ customRow: Q,
228
+ rowSelection: F.value,
229
+ rowClassName: $
230
+ }, ie(e = Object.assign(Object.assign({
226
231
  bodyCell: ({
227
- column: o,
228
- record: l
232
+ column: l,
233
+ record: c
229
234
  }) => {
230
- if (o.slot === "action")
231
- return f("div", {
232
- onClick: x,
233
- onDblclick: x
234
- }, [f(ee, null, {
235
- default: () => [s.action && s.action(l)]
235
+ if (l.slot === "action")
236
+ return h("div", {
237
+ onClick: P,
238
+ onDblclick: P
239
+ }, [h(ae, null, {
240
+ default: () => [r.action && r.action(c)]
236
241
  })]);
237
- },
238
- ...N,
242
+ }
243
+ }, z), {
239
244
  // 总结栏插槽
240
245
  summary: L
241
- }), M(f(te, {
246
+ })) ? e : {
247
+ default: () => [e]
248
+ }), Z(h(le, {
242
249
  class: [K],
243
- current: v.value.current,
244
- "onUpdate:current": (o) => v.value.current = o,
245
- pageSize: v.value.pageSize,
246
- "onUpdate:pageSize": (o) => v.value.pageSize = o,
250
+ current: y.value.current,
251
+ "onUpdate:current": (l) => y.value.current = l,
252
+ pageSize: y.value.pageSize,
253
+ "onUpdate:pageSize": (l) => y.value.pageSize = l,
247
254
  disabled: t.loading,
248
255
  "show-size-changer": !0,
249
256
  size: "default",
250
- "hide-on-single-page": b.hideOnSinglePage,
251
- "show-quick-jumper": b.showQuickJumper,
252
- "default-page-size": b.defaultPageSize,
253
- "page-size-options": b.pageSizeOptions,
254
- "show-total": b.showTotal,
255
- total: v.value.total,
256
- onChange: D
257
- }, null), [[Y, t.config.pagination]])]);
257
+ "hide-on-single-page": p.hideOnSinglePage,
258
+ "show-quick-jumper": p.showQuickJumper,
259
+ "default-page-size": p.defaultPageSize,
260
+ "page-size-options": p.pageSizeOptions,
261
+ "show-total": p.showTotal,
262
+ total: y.value.total,
263
+ onChange: U
264
+ }, null), [[ee, t.config.pagination]])]);
258
265
  };
259
266
  }
260
267
  });
261
268
  export {
262
- ce as default
269
+ ge as default
263
270
  };
@@ -1,23 +1,23 @@
1
- import { ref as S, computed as r, onMounted as z } from "vue";
1
+ import { ref as S, computed as o, onMounted as z } from "vue";
2
2
  import { usePagination as D } from "vue-request";
3
3
  import { get as P } from "../../utils/get.esm.js";
4
- const C = (o, a = {}) => {
4
+ const x = (i, a = {}) => {
5
5
  a.pagination || (a.pagination = {
6
6
  currentKey: "page",
7
7
  pageSizeKey: "limit",
8
8
  totalKey: "data.total"
9
9
  }), a.manual === void 0 && (a.manual = !0);
10
10
  const {
11
- dataKey: i,
12
- pagination: { currentKey: l, pageSizeKey: c }
11
+ dataKey: c,
12
+ pagination: { currentKey: l, pageSizeKey: g }
13
13
  } = a, e = a.params || S({}), {
14
- total: g,
15
- pageSize: m,
16
- current: s,
17
- loading: v,
14
+ total: s,
15
+ pageSize: v,
16
+ current: m,
17
+ loading: r,
18
18
  data: d,
19
19
  run: n
20
- } = D(o, {
20
+ } = D(i, {
21
21
  manual: !0,
22
22
  pagination: a.pagination,
23
23
  loadingDelay: 400,
@@ -26,30 +26,30 @@ const C = (o, a = {}) => {
26
26
  a.onSuccess && a.onSuccess(t, u);
27
27
  },
28
28
  onError: (t, u) => {
29
- console.log(u, t);
29
+ console.warn(u, t), r.value = !1;
30
30
  }
31
- }), p = r(() => ({
32
- total: g.value,
33
- current: s.value,
34
- pageSize: m.value
35
- })), y = r(
36
- () => P(d.value, i || "data", []) || []
37
- ), f = (t) => {
38
- e.value[l] = t.page, e.value[c] = t.size, n(e.value || {});
31
+ }), p = o(() => ({
32
+ total: s.value,
33
+ current: m.value,
34
+ pageSize: v.value
35
+ })), f = o(
36
+ () => P(d.value, c || "data", []) || []
37
+ ), y = (t) => {
38
+ e.value[l] = t.page, e.value[g] = t.size, n(e.value || {});
39
39
  }, K = (t) => {
40
40
  e.value = { ...e.value, ...t }, e.value[l] = 1, n(e.value || {});
41
41
  };
42
42
  return z(() => {
43
43
  a.manual && n(e.value);
44
44
  }), {
45
- data: y,
45
+ data: f,
46
46
  pagination: p,
47
- loading: v,
47
+ loading: r,
48
48
  run: n,
49
- onPageChange: f,
49
+ onPageChange: y,
50
50
  onQuery: K
51
51
  };
52
52
  };
53
53
  export {
54
- C as useRequestList
54
+ x as useRequestList
55
55
  };
@@ -5,7 +5,7 @@ $bg-color: #f0f2f5;
5
5
  //左侧logo高度
6
6
  $logo-height: 240px !default;
7
7
  // 左侧菜单底部图片
8
- $footer-slogan: 0!default;
8
+ $footer-slogan: 0px!default;
9
9
  /******======网格变量======******/
10
10
  //网格边框颜色
11
11
  $grid-border-color: #4e4e4e !default;
@@ -64,4 +64,4 @@ $bread-txt-color: #333;
64
64
 
65
65
  /******======FUCK MAIN======******/
66
66
  // 菜单收缩颜色
67
- $fuck-main-collapsed-color: #fff!default;
67
+ $fuck-main-collapsed-color: #fff!default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditari/bsui",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "files": [
5
5
  "dist/**",
6
6
  "src"
@@ -11,22 +11,22 @@
11
11
  },
12
12
  "main": "dist/cjs/components/index.cjs.js",
13
13
  "module": "dist/esm/components/index.esm.js",
14
- "types": "dist/**/*.d.ts",
14
+ "typings": "dist/**/*.d.ts",
15
15
  "exports": {
16
16
  ".": {
17
17
  "require": "./dist/cjs/components/index.cjs.js",
18
18
  "import": "./dist/esm/components/index.esm.js",
19
- "types": "./dist/esm/components/index.d.ts"
19
+ "typings": "./dist/esm/components/index.d.ts"
20
20
  },
21
21
  "./store": {
22
22
  "require": "./dist/cjs/store/index.cjs.js",
23
23
  "import": "./dist/esm/store/index.esm.js",
24
- "types": "./dist/esm/store/index.d.ts"
24
+ "typings": "./dist/esm/store/index.d.ts"
25
25
  },
26
26
  "./hooks": {
27
27
  "require": "./dist/cjs/hooks/index.cjs.js",
28
28
  "import": "./dist/esm/hooks/index.esm.js",
29
- "types": "./dist/esm/hooks/index.d.ts"
29
+ "typings": "./dist/esm/hooks/index.d.ts"
30
30
  },
31
31
  "./css/*": "./dist/css/*",
32
32
  "./theme/*": "./dist/style/*"
@@ -8,8 +8,6 @@ import { useKeepAliveStore, useSettingsStore } from "../../store";
8
8
 
9
9
  //标签页组件
10
10
  import DNavTabs from "./NavTabs.vue";
11
- //面包屑组件
12
- import DBreadcrumb from "./Breadcrumb.vue";
13
11
  // 菜单组件
14
12
  import Menu from "../menu/Menu";
15
13
 
@@ -12,7 +12,6 @@ import DNavTabs from "./NavTabs.vue";
12
12
  import DBreadcrumb from "./Breadcrumb.vue";
13
13
  // 菜单组件
14
14
  import Menu from "../menu/Menu";
15
- import CollapsedMenu from "../menu/CollapsedMenu.vue";
16
15
 
17
16
  interface Props {
18
17
  showConfig?: ShowConfig;
@@ -59,7 +58,6 @@ export default {
59
58
  </div>
60
59
  <div class="ditari-menu">
61
60
  <Menu />
62
-
63
61
  </div>
64
62
  </div>
65
63
  </a-layout-sider>
@@ -0,0 +1,338 @@
1
+ import { computed, defineComponent, nextTick, ref, watch, watchEffect } from "vue";
2
+ import { Pagination, Space, Table } from "ant-design-vue";
3
+ import { useEleHeight } from "../../utils/html";
4
+ import { prefixName } from "../theme";
5
+ /**
6
+ * 表格组件 基于TSX封装ATable
7
+ */
8
+ const tableProps = () => {
9
+ return {
10
+ data: {
11
+ type: Object,
12
+ required: true
13
+ },
14
+ height: {
15
+ type: Number,
16
+ default: 300
17
+ },
18
+ keys: Array,
19
+ rowKey: {
20
+ type: String,
21
+ default: "id"
22
+ },
23
+ loading: {
24
+ type: Boolean,
25
+ default: false
26
+ },
27
+ pagination: {
28
+ type: Object,
29
+ default: () => ({})
30
+ },
31
+ config: {
32
+ type: Object,
33
+ default: () => ({})
34
+ },
35
+ expandedRowKeys: {
36
+ type: Object,
37
+ default: () => []
38
+ },
39
+ defaultExpandAllRows: Boolean,
40
+ default: () => true
41
+ };
42
+ };
43
+ // 使用有问题
44
+ // const tableEmits = defineEmits<{
45
+ // "update:keys": (keys: []) => void;
46
+ // }>();
47
+ // interface MyEvents {
48
+ // [key: string]: (...args: any[]) => void;
49
+ // "update:keys": (keys: []) => void;
50
+ // }
51
+ //分页默认配置
52
+ const paginationConfig = {
53
+ defaultPageSize: 20,
54
+ hideOnSinglePage: false,
55
+ pageSizeOptions: ["10", "20", "30", "40"],
56
+ responsive: true,
57
+ showQuickJumper: true,
58
+ showLessItems: true,
59
+ showTotal: (total) => {
60
+ return `总共 ${total} 条`;
61
+ }
62
+ };
63
+ //分页class名称
64
+ const basePageClassName = `${prefixName}-pagination`;
65
+ const configDefault = {
66
+ selection: "N",
67
+ bordered: true
68
+ };
69
+ /**
70
+ * 表格组件定义
71
+ */
72
+ const DXTable = defineComponent({
73
+ name: "DTable",
74
+ props: tableProps(),
75
+ // emits: { "update:keys": (keys: []) => void }
76
+ // TODO 需要做调整
77
+ emits: ["update:keys"],
78
+ setup: function (props, { emit, slots }) {
79
+ // 保存选中的唯一id
80
+ const selectedRowKeys = ref(props.keys || []);
81
+ // 数据源
82
+ const dataSource = computed(() => props.data);
83
+ // 表格列
84
+ const columns = computed(() => { var _a, _b; return (_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.columns) !== null && _b !== void 0 ? _b : []; });
85
+ const paginationState = computed(() => { var _a, _b; return (_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.pagination) !== null && _b !== void 0 ? _b : {}; });
86
+ // 展开行
87
+ const expandedKeys = ref(props.expandedRowKeys);
88
+ watchEffect(() => {
89
+ const { expandedRowKeys } = props;
90
+ expandedKeys.value = expandedRowKeys;
91
+ });
92
+ // 初始化表格
93
+ const { tableRef, tableRootRef, tableHeight, onPageChange, onRowClassName } = useTable();
94
+ function useTable() {
95
+ var _a;
96
+ const { rowClassName, keepSelected, onPageChange: onChange } = props.config;
97
+ const selection = (_a = props.config.selection) !== null && _a !== void 0 ? _a : "N";
98
+ // 表格根div
99
+ const tableRootRef = ref();
100
+ // 表格组件对象
101
+ const tableRef = ref(null);
102
+ // 表格计算出来的高度
103
+ const tableHeight = ref();
104
+ // 表格body对象
105
+ const antTableBodyRef = ref(null);
106
+ // 计算高度
107
+ const playHeight = (height) => {
108
+ var _a, _b, _c;
109
+ try {
110
+ const tableEl = (_a = tableRef === null || tableRef === void 0 ? void 0 : tableRef.value) === null || _a === void 0 ? void 0 : _a.$el;
111
+ const headerHeight = useEleHeight(tableEl.getElementsByClassName("ant-table-header")[0]);
112
+ // 获取分页组件高度
113
+ let paginationHeight = 0;
114
+ if (props.config.pagination) {
115
+ const paginationEl = (_b = tableRootRef.value) === null || _b === void 0 ? void 0 : _b.getElementsByClassName(basePageClassName)[0];
116
+ paginationHeight = (_c = useEleHeight(paginationEl)) !== null && _c !== void 0 ? _c : 0;
117
+ }
118
+ tableHeight.value = height - (headerHeight + paginationHeight);
119
+ // 设置body高度
120
+ tableEl.getElementsByClassName("ant-table-body")[0].style.height =
121
+ tableHeight.value + "px";
122
+ // 表格body对象 用于切换页码后滚动条置顶
123
+ antTableBodyRef.value =
124
+ tableEl.getElementsByClassName("ant-table-body")[0];
125
+ }
126
+ catch (e) {
127
+ console.warn(e);
128
+ }
129
+ };
130
+ //监听传入的height的变化 默认组件创建的时候会执行一次
131
+ watchEffect(() => {
132
+ if (props.height !== 0) {
133
+ nextTick(() => {
134
+ // 必须在组件挂载成功后 执行计算高度 否则无法正确获取元素的高度
135
+ setTimeout(() => {
136
+ // 如果表格头 有多行的清空下,获取到的头部高度不对,需要延迟执行获取高度方法
137
+ playHeight(props.height);
138
+ }, 10);
139
+ });
140
+ }
141
+ });
142
+ // 监听分页组件
143
+ const onPageChange = (page, size) => {
144
+ onChange ? onChange({ page, size }) : null;
145
+ // 切换分页的时候,表体滚动到顶部
146
+ antTableBodyRef.value.scrollTop = 0;
147
+ // 如果当前为单选或未开启分页保留数据选中的数据都会被清除
148
+ // 清空历史选中数据
149
+ if (selection === "S" || !keepSelected) {
150
+ selectedRowKeys.value = [];
151
+ emit("update:keys", selectedRowKeys.value);
152
+ }
153
+ };
154
+ //自定义样式
155
+ const onRowClassName = (record, index) => {
156
+ return rowClassName ? rowClassName(record, index) : undefined;
157
+ };
158
+ return {
159
+ tableRef,
160
+ tableRootRef,
161
+ tableHeight,
162
+ onPageChange,
163
+ onRowClassName
164
+ };
165
+ }
166
+ //表格选中配置
167
+ const rowSelection = useRowSelection();
168
+ function useRowSelection() {
169
+ var _a;
170
+ const { rowKey, config: { getCheckboxProps } } = props;
171
+ let localSelection = (_a = props.config.selection) !== null && _a !== void 0 ? _a : "N";
172
+ //if (selection === "N") return undefined;
173
+ const onSelect = (record, selected) => {
174
+ if (localSelection === "S") {
175
+ selectedRowKeys.value = [];
176
+ selectedRowKeys.value = selected ? [record[rowKey]] : [];
177
+ }
178
+ else {
179
+ selectedRowKeys.value = selected
180
+ ? selectedRowKeys.value.concat(record[rowKey])
181
+ : selectedRowKeys.value.filter((key) => key !== record[rowKey]);
182
+ }
183
+ emit("update:keys", selectedRowKeys.value);
184
+ };
185
+ const onSelectAll = (selected, selectedRows, changeRows) => {
186
+ const _ids = changeRows.map((record) => record[rowKey]);
187
+ selectedRowKeys.value = selected
188
+ ? selectedRowKeys.value.concat(_ids)
189
+ : selectedRowKeys.value.filter((key) => !_ids.includes(key));
190
+ emit("update:keys", selectedRowKeys.value);
191
+ };
192
+ // 监听父组件手动改变keys 重新赋值给 表格选中变量selectedRowKeys
193
+ // 否则父组件 改变keys后当前selectedRowKeys还是原来的值
194
+ watch(() => props.keys, (val) => {
195
+ selectedRowKeys.value = val;
196
+ });
197
+ const rowSelection = ref(undefined);
198
+ watchEffect(() => {
199
+ const { selection } = props.config;
200
+ localSelection = selection;
201
+ if (localSelection !== "N") {
202
+ rowSelection.value = {
203
+ selectedRowKeys,
204
+ onSelect,
205
+ onSelectAll,
206
+ fixed: true,
207
+ columnTitle: localSelection === "S" ? "选择" : null,
208
+ columnWidth: localSelection === "S" ? 60 : 40,
209
+ getCheckboxProps: getCheckboxProps
210
+ };
211
+ }
212
+ else {
213
+ rowSelection.value = undefined;
214
+ }
215
+ });
216
+ // return {
217
+ // selectedRowKeys,
218
+ // onSelect,
219
+ // onSelectAll,
220
+ // fixed: true,
221
+ // columnTitle: localSelection === "S" ? "选择" : null,
222
+ // columnWidth: localSelection === "S" ? 60 : 40,
223
+ // getCheckboxProps: getCheckboxProps
224
+ // };
225
+ return rowSelection;
226
+ }
227
+ const customRow = useCustomRow();
228
+ //表格行配置
229
+ function useCustomRow() {
230
+ return (record) => {
231
+ // 用于存储 在某个事件内双击两次 则取消单击事件业务
232
+ let clickTimeout = undefined;
233
+ const { rowKey, config: { click, dbClick, selection, getCheckboxProps } } = props;
234
+ // 当前点击行的唯一ID,通过rowKey从record中取值
235
+ const id = record[rowKey];
236
+ /**
237
+ * 处理单击事件业务
238
+ * @param record 当前点击行数据
239
+ */
240
+ const onClick = () => {
241
+ // 获取getCheckboxProps方法,如果不等于undefined,则执行方法获取disabled的值
242
+ // 否则checkEnable为false
243
+ const checkEnable = getCheckboxProps === undefined
244
+ ? false
245
+ : getCheckboxProps(record).disabled;
246
+ if (selection === "N" || checkEnable) {
247
+ // 1. 未开启复选框 则不处理数据选中操作
248
+ // 2. 如果当前点击的行 包含在禁用的数据项目里面 则不进行选中操作
249
+ // 3. checkEnable 用来判断复选框属性的值,如果当前的数据满足getCheckboxProps这个
250
+ // 方法返回的disabled为true就不执行
251
+ // 复选框选中的操作
252
+ return;
253
+ }
254
+ const haveState = selectedRowKeys.value.some((key) => key === id);
255
+ if (haveState) {
256
+ //如果 当前点击行的ID 已存在 那么直接过滤掉当前的id
257
+ selectedRowKeys.value = selectedRowKeys.value.filter((key) => key !== id);
258
+ }
259
+ else {
260
+ if (selection === "S") {
261
+ //单选的时候 清空选中的数据 再赋值新的ID
262
+ selectedRowKeys.value = [];
263
+ selectedRowKeys.value.push(id);
264
+ }
265
+ else {
266
+ //多选直接追加ID
267
+ selectedRowKeys.value.push(id);
268
+ }
269
+ }
270
+ emit("update:keys", selectedRowKeys.value);
271
+ };
272
+ return {
273
+ onClick: () => {
274
+ clearTimeout(clickTimeout);
275
+ clickTimeout = setTimeout(() => {
276
+ // 处理单击事件业务
277
+ onClick();
278
+ // 回传数据 自定义单击后的业务
279
+ click ? click(record) : undefined;
280
+ }, 200);
281
+ },
282
+ onDblclick: () => {
283
+ clearTimeout(clickTimeout);
284
+ // 回传数据 自定义单击后的业务
285
+ dbClick ? dbClick(record) : undefined;
286
+ }
287
+ // onContextmenu: (event) => {
288
+ // //TODO
289
+ // },
290
+ // onMouseenter: (event) => {
291
+ // //TODO
292
+ // }, // 鼠标移入行
293
+ // onMouseleave: (event) => {
294
+ // //TODO
295
+ // }
296
+ };
297
+ };
298
+ }
299
+ const actionStop = (event) => {
300
+ event.stopPropagation();
301
+ };
302
+ const expandRowByClick = computed(() => {
303
+ const { selection } = props.config;
304
+ return selection === "N";
305
+ });
306
+ const tableSlots = {};
307
+ if (slots.expandedRowRender) {
308
+ tableSlots.expandedRowRender = (record) => {
309
+ return (<>{slots.expandedRowRender && slots.expandedRowRender(record)}</>);
310
+ };
311
+ }
312
+ const summary = () => {
313
+ return <>{slots.summary && slots.summary()}</>;
314
+ };
315
+ return () => {
316
+ var _a, _b;
317
+ return (<div ref={tableRootRef} style={{ height: "100%" }}>
318
+ <Table ref={tableRef} row-key={props.rowKey} bordered={props.config.bordered} columns={columns.value} dataSource={dataSource.value} loading={props.loading} size={(_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : "small"} scroll={{
319
+ scrollToFirstRowOnChange: true,
320
+ x: "100%",
321
+ y: tableHeight.value + "px"
322
+ }} v-model:expandedRowKeys={expandedKeys.value} expandRowByClick={expandRowByClick.value} defaultExpandAllRows={props.defaultExpandAllRows} pagination={false} customRow={customRow} rowSelection={rowSelection.value} rowClassName={onRowClassName}>
323
+ {Object.assign(Object.assign({ bodyCell: ({ column, record }) => {
324
+ if (column.slot === "action") {
325
+ return (<div onClick={actionStop} onDblclick={actionStop}>
326
+ <Space>{slots.action && slots.action(record)}</Space>
327
+ </div>);
328
+ }
329
+ } }, tableSlots), {
330
+ // 总结栏插槽
331
+ summary: summary })}
332
+ </Table>
333
+ <Pagination v-show={props.config.pagination} class={[basePageClassName]} v-model:current={paginationState.value.current} v-model:pageSize={paginationState.value.pageSize} disabled={props.loading} show-size-changer size={"default"} hide-on-single-page={paginationConfig.hideOnSinglePage} show-quick-jumper={paginationConfig.showQuickJumper} default-page-size={paginationConfig.defaultPageSize} page-size-options={paginationConfig.pageSizeOptions} show-total={paginationConfig.showTotal} total={paginationState.value.total} onChange={onPageChange}/>
334
+ </div>);
335
+ };
336
+ }
337
+ });
338
+ export default DXTable;
@@ -0,0 +1,4 @@
1
+ import { withInstall } from "../../utils/index";
2
+ import Table from "./Table";
3
+ export const DTable = withInstall(Table);
4
+ export default DTable;
@@ -5,7 +5,7 @@ $bg-color: #f0f2f5;
5
5
  //左侧logo高度
6
6
  $logo-height: 240px !default;
7
7
  // 左侧菜单底部图片
8
- $footer-slogan: 0!default;
8
+ $footer-slogan: 0px!default;
9
9
  /******======网格变量======******/
10
10
  //网格边框颜色
11
11
  $grid-border-color: #4e4e4e !default;
@@ -64,4 +64,4 @@ $bread-txt-color: #333;
64
64
 
65
65
  /******======FUCK MAIN======******/
66
66
  // 菜单收缩颜色
67
- $fuck-main-collapsed-color: #fff!default;
67
+ $fuck-main-collapsed-color: #fff!default;
@@ -56,7 +56,8 @@ const useRequestList = (service: any, options: Options = {}) => {
56
56
  },
57
57
  onError: (error: Error, params: any) => {
58
58
  //错误处理
59
- console.log(params, error);
59
+ console.warn(params, error);
60
+ loading.value = false;
60
61
  }
61
62
  });
62
63
 
@@ -1,80 +0,0 @@
1
- import { PropType } from "vue";
2
- import type { Key, Config } from "./interface/table";
3
- /**
4
- * 表格组件定义
5
- */
6
- declare const DXTable: import("vue").DefineComponent<{
7
- data: {
8
- type: PropType<any>;
9
- required: boolean;
10
- };
11
- height: {
12
- type: PropType<number>;
13
- default: number;
14
- };
15
- keys: PropType<Key[] | undefined>;
16
- rowKey: {
17
- type: PropType<string>;
18
- default: string;
19
- };
20
- loading: {
21
- type: PropType<false | undefined>;
22
- default: boolean;
23
- };
24
- pagination: {
25
- type: PropType<any>;
26
- default: () => {};
27
- };
28
- config: {
29
- type: PropType<Config>;
30
- default: () => {};
31
- };
32
- expandedRowKeys: {
33
- type: PropType<string[] | undefined>;
34
- default: () => never[];
35
- };
36
- defaultExpandAllRows: PropType<boolean | undefined>;
37
- default: () => boolean;
38
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
- data: {
40
- type: PropType<any>;
41
- required: boolean;
42
- };
43
- height: {
44
- type: PropType<number>;
45
- default: number;
46
- };
47
- keys: PropType<Key[] | undefined>;
48
- rowKey: {
49
- type: PropType<string>;
50
- default: string;
51
- };
52
- loading: {
53
- type: PropType<false | undefined>;
54
- default: boolean;
55
- };
56
- pagination: {
57
- type: PropType<any>;
58
- default: () => {};
59
- };
60
- config: {
61
- type: PropType<Config>;
62
- default: () => {};
63
- };
64
- expandedRowKeys: {
65
- type: PropType<string[] | undefined>;
66
- default: () => never[];
67
- };
68
- defaultExpandAllRows: PropType<boolean | undefined>;
69
- default: () => boolean;
70
- }>> & {
71
- "onUpdate:keys"?: ((...args: any[]) => any) | undefined;
72
- }, {
73
- height: number;
74
- loading: false | undefined;
75
- rowKey: string;
76
- pagination: any;
77
- config: Config;
78
- expandedRowKeys: string[] | undefined;
79
- }>;
80
- export default DXTable;
@@ -1,75 +0,0 @@
1
- export declare const DTable: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{
2
- data: {
3
- type: import("vue").PropType<any>;
4
- required: boolean;
5
- };
6
- height: {
7
- type: import("vue").PropType<number>;
8
- default: number;
9
- };
10
- keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
11
- rowKey: {
12
- type: import("vue").PropType<string>;
13
- default: string;
14
- };
15
- loading: {
16
- type: import("vue").PropType<false | undefined>;
17
- default: boolean;
18
- };
19
- pagination: {
20
- type: import("vue").PropType<any>;
21
- default: () => {};
22
- };
23
- config: {
24
- type: import("vue").PropType<import("./interface/table").Config>;
25
- default: () => {};
26
- };
27
- expandedRowKeys: {
28
- type: import("vue").PropType<string[] | undefined>;
29
- default: () => never[];
30
- };
31
- defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
32
- default: () => boolean;
33
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
- data: {
35
- type: import("vue").PropType<any>;
36
- required: boolean;
37
- };
38
- height: {
39
- type: import("vue").PropType<number>;
40
- default: number;
41
- };
42
- keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
43
- rowKey: {
44
- type: import("vue").PropType<string>;
45
- default: string;
46
- };
47
- loading: {
48
- type: import("vue").PropType<false | undefined>;
49
- default: boolean;
50
- };
51
- pagination: {
52
- type: import("vue").PropType<any>;
53
- default: () => {};
54
- };
55
- config: {
56
- type: import("vue").PropType<import("./interface/table").Config>;
57
- default: () => {};
58
- };
59
- expandedRowKeys: {
60
- type: import("vue").PropType<string[] | undefined>;
61
- default: () => never[];
62
- };
63
- defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
64
- default: () => boolean;
65
- }>> & {
66
- "onUpdate:keys"?: ((...args: any[]) => any) | undefined;
67
- }, {
68
- height: number;
69
- loading: false | undefined;
70
- rowKey: string;
71
- pagination: any;
72
- config: import("./interface/table").Config;
73
- expandedRowKeys: string[] | undefined;
74
- }>>;
75
- export default DTable;
@@ -1,80 +0,0 @@
1
- import { PropType } from "vue";
2
- import type { Key, Config } from "./interface/table";
3
- /**
4
- * 表格组件定义
5
- */
6
- declare const DXTable: import("vue").DefineComponent<{
7
- data: {
8
- type: PropType<any>;
9
- required: boolean;
10
- };
11
- height: {
12
- type: PropType<number>;
13
- default: number;
14
- };
15
- keys: PropType<Key[] | undefined>;
16
- rowKey: {
17
- type: PropType<string>;
18
- default: string;
19
- };
20
- loading: {
21
- type: PropType<false | undefined>;
22
- default: boolean;
23
- };
24
- pagination: {
25
- type: PropType<any>;
26
- default: () => {};
27
- };
28
- config: {
29
- type: PropType<Config>;
30
- default: () => {};
31
- };
32
- expandedRowKeys: {
33
- type: PropType<string[] | undefined>;
34
- default: () => never[];
35
- };
36
- defaultExpandAllRows: PropType<boolean | undefined>;
37
- default: () => boolean;
38
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
- data: {
40
- type: PropType<any>;
41
- required: boolean;
42
- };
43
- height: {
44
- type: PropType<number>;
45
- default: number;
46
- };
47
- keys: PropType<Key[] | undefined>;
48
- rowKey: {
49
- type: PropType<string>;
50
- default: string;
51
- };
52
- loading: {
53
- type: PropType<false | undefined>;
54
- default: boolean;
55
- };
56
- pagination: {
57
- type: PropType<any>;
58
- default: () => {};
59
- };
60
- config: {
61
- type: PropType<Config>;
62
- default: () => {};
63
- };
64
- expandedRowKeys: {
65
- type: PropType<string[] | undefined>;
66
- default: () => never[];
67
- };
68
- defaultExpandAllRows: PropType<boolean | undefined>;
69
- default: () => boolean;
70
- }>> & {
71
- "onUpdate:keys"?: ((...args: any[]) => any) | undefined;
72
- }, {
73
- height: number;
74
- loading: false | undefined;
75
- rowKey: string;
76
- pagination: any;
77
- config: Config;
78
- expandedRowKeys: string[] | undefined;
79
- }>;
80
- export default DXTable;
@@ -1,75 +0,0 @@
1
- export declare const DTable: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{
2
- data: {
3
- type: import("vue").PropType<any>;
4
- required: boolean;
5
- };
6
- height: {
7
- type: import("vue").PropType<number>;
8
- default: number;
9
- };
10
- keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
11
- rowKey: {
12
- type: import("vue").PropType<string>;
13
- default: string;
14
- };
15
- loading: {
16
- type: import("vue").PropType<false | undefined>;
17
- default: boolean;
18
- };
19
- pagination: {
20
- type: import("vue").PropType<any>;
21
- default: () => {};
22
- };
23
- config: {
24
- type: import("vue").PropType<import("./interface/table").Config>;
25
- default: () => {};
26
- };
27
- expandedRowKeys: {
28
- type: import("vue").PropType<string[] | undefined>;
29
- default: () => never[];
30
- };
31
- defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
32
- default: () => boolean;
33
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
- data: {
35
- type: import("vue").PropType<any>;
36
- required: boolean;
37
- };
38
- height: {
39
- type: import("vue").PropType<number>;
40
- default: number;
41
- };
42
- keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
43
- rowKey: {
44
- type: import("vue").PropType<string>;
45
- default: string;
46
- };
47
- loading: {
48
- type: import("vue").PropType<false | undefined>;
49
- default: boolean;
50
- };
51
- pagination: {
52
- type: import("vue").PropType<any>;
53
- default: () => {};
54
- };
55
- config: {
56
- type: import("vue").PropType<import("./interface/table").Config>;
57
- default: () => {};
58
- };
59
- expandedRowKeys: {
60
- type: import("vue").PropType<string[] | undefined>;
61
- default: () => never[];
62
- };
63
- defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
64
- default: () => boolean;
65
- }>> & {
66
- "onUpdate:keys"?: ((...args: any[]) => any) | undefined;
67
- }, {
68
- height: number;
69
- loading: false | undefined;
70
- rowKey: string;
71
- pagination: any;
72
- config: import("./interface/table").Config;
73
- expandedRowKeys: string[] | undefined;
74
- }>>;
75
- export default DTable;