@ditari/bsui 1.0.50 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/dic/DicReplace.cjs.js +1 -1
- package/dist/cjs/components/index.cjs.js +1 -1
- package/dist/cjs/components/layout/Show.vue.cjs.js +1 -1
- package/dist/cjs/components/select/Select.vue.cjs.js +1 -1
- package/dist/cjs/components/table/Table.cjs.js +1 -1
- package/dist/cjs/components/table/Table.d.ts +4 -0
- package/dist/cjs/components/table/index.d.ts +4 -0
- package/dist/cjs/components/table/interface/table.d.ts +1 -0
- package/dist/cjs/hooks/http/index.cjs.js +1 -1
- package/dist/esm/components/dic/DicReplace.esm.js +14 -13
- package/dist/esm/components/index.esm.js +40 -36
- package/dist/esm/components/layout/Show.vue.esm.js +22 -22
- package/dist/esm/components/select/Select.vue.esm.js +21 -22
- package/dist/esm/components/table/Table.d.ts +4 -0
- package/dist/esm/components/table/Table.esm.js +52 -49
- package/dist/esm/components/table/index.d.ts +4 -0
- package/dist/esm/components/table/interface/table.d.ts +1 -0
- package/dist/esm/hooks/http/index.esm.js +1 -1
- package/package.json +1 -1
- package/src/components/components.ts +1 -1
- package/src/components/dic/DicReplace.tsx +10 -8
- package/src/components/index.ts +14 -0
- package/src/components/layout/Main.vue +1 -4
- package/src/components/layout/Show.vue +1 -2
- package/src/components/select/Select.vue +11 -7
- package/src/components/table/Table.tsx +6 -1
- package/src/components/table/interface/table.ts +2 -0
- package/src/hooks/http/index.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../store/modules/DataDictionary.cjs.js"),l=e.defineComponent({name:"DicReplace",props:{name:{type:String,default:""},value:{type:String,default:""}},setup(n){const{list:o}=u.useDataDicStore(),t=e.inject("workerInstance");console.log(t);const s=e.ref(!0),r=e.ref("");return t.onerror=()=>{s.value=!1},t.onmessage=a=>{r.value=a.data},e.watchEffect(()=>{const a=n.value,c=n.name;t.postMessage({list:JSON.stringify(o),name:c,value:a})}),()=>e.createVNode(e.Fragment,null,[r.value])}});exports.default=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("pinia"),D=require("pinia-plugin-persistedstate"),q=require("./dic/replace.worker.cjs.js"),f=require("./select/dic.worker.cjs.js"),m=require("./components.cjs.js"),x=require("../directive/trim.cjs.js"),$=require("./table/index.cjs.js"),v=require("./select/index.cjs.js"),w=require("./desensitize/index.cjs.js"),I=require("./dic/index.cjs.js"),S=require("./modal/index.cjs.js"),b=require("./form/index.cjs.js"),c=require("./grid/index.cjs.js"),i=require("./layout/index.cjs.js"),o=m;let n=null,r=null;const a=function(e,u){Object.keys(o).forEach(l=>{const s=o[l];s.install&&e.use(s)});const t=d.createPinia();t.use(D.createPersistedState({storage:sessionStorage})),e.use(t),e.directive("trim",x.default),e.provide("menuIcon",u.menuIcon||{}),n||(n=new q.default,e.provide("workerInstance",n)),r||(r=new f.default,e.provide("workerInstance",r))},k={install:a};exports.DTable=$.DTable;exports.DSelect=v.DSelect;exports.DDesensitize=w.DDesensitize;exports.DicReplace=I.DDicReplace;exports.DModal=S.DModal;exports.DForm=b.default;exports.DGrid=c.DGrid;exports.DGridItem=c.DGridItem;exports.DList=i.DList;exports.DMain=i.DMain;exports.DNavTabs=i.DNavTabs;exports.DShow=i.DShow;exports.default=k;exports.install=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),c=require("@vueuse/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),c=require("@vueuse/core"),T=require("@ant-design/icons-vue"),k=require("../../store/modules/NavTab.cjs.js"),x=require("../../store/modules/Settings.cjs.js"),B=require("pinia"),N={class:"ditari-show-layout"},q={key:0,class:"ditari-show-footer"},V={name:"DShowLayout"},$=e.defineComponent({...V,props:{close:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(i,{expose:u}){const o=i,s=l.useRouter(),n=l.useRoute(),d=e.useSlots(),r=k.useNavTabsStore(),p=x.useSettingsStore(),a=e.inject("showConfig"),f=()=>a?e.h(e.resolveComponent(a.backBtn)):e.h(T.LeftOutlined),{refresh:h}=B.storeToRefs(p),g=e.computed(()=>o.loading),m={padding:`10px 10px ${d.footer?"70px":"10px"} 10px`},S=()=>{o.close&&r.deleteTabs(n.path),s.go(-1)},_=()=>{h.value=!0,r.deleteTabs(n.path),s.go(-1)},{y:v}=c.useWindowScroll(),w=c.useScrollLock(document.body);e.watch(()=>o.loading,t=>{w.value=t});const b=200;return u({closePage:_}),(t,R)=>{const y=e.resolveComponent("a-page-header"),C=e.resolveComponent("a-spin");return e.openBlock(),e.createElementBlock("div",N,[e.createVNode(C,{tip:"正在处理...",spinning:e.unref(g),delay:b,size:"large"},{default:e.withCtx(()=>[e.createVNode(y,{class:e.normalizeClass(["ditari-page-header",{active:e.unref(v)>0}]),ghost:!1,onBack:S},{backIcon:e.withCtx(()=>[e.createVNode(f)]),title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$route.meta.title),1)]),subTitle:e.withCtx(()=>[e.renderSlot(t.$slots,"subTitle")]),extra:e.withCtx(()=>[e.renderSlot(t.$slots,"extra")]),_:3},8,["class"]),e.createElementVNode("div",{class:"ditari-show-content",style:m},[e.renderSlot(t.$slots,"default")]),t.$slots.footer?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("",!0)]),_:3},8,["spinning"])])}}});exports.default=$;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../../store/modules/DataDictionary.cjs.js"),k=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../../store/modules/DataDictionary.cjs.js"),k={name:"DSelect"},B=e.defineComponent({...k,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change","select"],setup(r,{emit:c}){const l=r,{getDicByKey:v,list:h}=y.useDataDicStore(),{modelValue:s,data:p,onSearch:S,onSelect:g,onChange:m}=C();function C(){let d=!0,t=[];const o=e.ref(t),n=e.ref(l.value),i=e.inject("workerInstance");i.onerror=()=>{d=!1,t=v(l.name)},i.onmessage=a=>{o.value=[...a.data]},e.watch(()=>l.include,()=>{f(n.value)}),e.watch(()=>l.value,a=>{n.value=a}),f(n.value);const w=a=>{d?f(a):o.value=t.filter(u=>u.value.toLowerCase().indexOf(a.toLowerCase())!==-1||u.label.toLowerCase().includes(a.toLowerCase())).splice(0,10)};function f(a){i.postMessage({list:JSON.stringify(h[l.name]),keywords:a,include:JSON.stringify(l.include??[])})}const b=a=>{c("update:value",a),_()},D=()=>{c("update:value",n.value),c("change",n.value)};function _(){const u=v(l.name).find(L=>L.value===n.value);c("select",u)}return{data:o,modelValue:n,onSearch:w,onSelect:b,onChange:D}}return(d,t)=>{const o=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(o,{value:e.unref(s),"onUpdate:value":t[0]||(t[0]=n=>e.isRef(s)?s.value=n:null),"allow-clear":"","show-search":"","filter-option":!1,options:e.unref(p),placeholder:r.placeholder,disabled:r.disabled,onSelect:e.unref(g),onSearch:e.unref(S),onChange:e.unref(m)},null,8,["value","options","placeholder","disabled","onSelect","onSearch","onChange"])}}});exports.default=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
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;
|
|
@@ -33,6 +33,8 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
33
33
|
type: PropType<string[] | undefined>;
|
|
34
34
|
default: () => never[];
|
|
35
35
|
};
|
|
36
|
+
defaultExpandAllRows: PropType<boolean | undefined>;
|
|
37
|
+
default: () => boolean;
|
|
36
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<{
|
|
37
39
|
data: {
|
|
38
40
|
type: PropType<any>;
|
|
@@ -63,6 +65,8 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
63
65
|
type: PropType<string[] | undefined>;
|
|
64
66
|
default: () => never[];
|
|
65
67
|
};
|
|
68
|
+
defaultExpandAllRows: PropType<boolean | undefined>;
|
|
69
|
+
default: () => boolean;
|
|
66
70
|
}>> & {
|
|
67
71
|
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
68
72
|
}, {
|
|
@@ -28,6 +28,8 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
28
28
|
type: import("vue").PropType<string[] | undefined>;
|
|
29
29
|
default: () => never[];
|
|
30
30
|
};
|
|
31
|
+
defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
|
|
32
|
+
default: () => boolean;
|
|
31
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<{
|
|
32
34
|
data: {
|
|
33
35
|
type: import("vue").PropType<any>;
|
|
@@ -58,6 +60,8 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
58
60
|
type: import("vue").PropType<string[] | undefined>;
|
|
59
61
|
default: () => never[];
|
|
60
62
|
};
|
|
63
|
+
defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
|
|
64
|
+
default: () => boolean;
|
|
61
65
|
}>> & {
|
|
62
66
|
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
63
67
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),S=require("vue-request"),m=require("../../utils/get.cjs.js"),K=(i,a={})=>{a.pagination||(a.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"});const{dataKey:l,pagination:{currentKey:r,pageSizeKey:c}}=a,t=a.params||o.ref({}),{total:s,pageSize:g,current:v,loading:d,data:p,run:n}=S.usePagination(i,{manual:!0,pagination:a.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(e,u)=>{a.onSuccess&&a.onSuccess(e,u)},onError:(e,u)=>{console.log(u,e)}}),y=o.computed(()=>({total:s.value,current:v.value,pageSize:g.value}));return{data:o.computed(()=>m.get(p.value,l||"data",[])),pagination:y,loading:d,run:n,onPageChange:e=>{t.value[r]=e.page,t.value[c]=e.size,n(t.value||{})},onQuery:e=>{t.value={...t.value,...e},t.value[r]=1,n(t.value||{})}}};exports.useRequestList=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),S=require("vue-request"),m=require("../../utils/get.cjs.js"),K=(i,a={})=>{a.pagination||(a.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"});const{dataKey:l,pagination:{currentKey:r,pageSizeKey:c}}=a,t=a.params||o.ref({}),{total:s,pageSize:g,current:v,loading:d,data:p,run:n}=S.usePagination(i,{manual:!0,pagination:a.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(e,u)=>{a.onSuccess&&a.onSuccess(e,u)},onError:(e,u)=>{console.log(u,e)}}),y=o.computed(()=>({total:s.value,current:v.value,pageSize:g.value}));return{data:o.computed(()=>m.get(p.value,l||"data",[])||[]),pagination:y,loading:d,run:n,onPageChange:e=>{t.value[r]=e.page,t.value[c]=e.size,n(t.value||{})},onQuery:e=>{t.value={...t.value,...e},t.value[r]=1,n(t.value||{})}}};exports.useRequestList=K;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import p from "
|
|
3
|
-
|
|
4
|
-
const S = /* @__PURE__ */ c({
|
|
1
|
+
import { defineComponent as l, inject as u, ref as o, watchEffect as i, createVNode as f, Fragment as m } from "vue";
|
|
2
|
+
import { useDataDicStore as p } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
+
const v = /* @__PURE__ */ l({
|
|
5
4
|
name: "DicReplace",
|
|
6
5
|
props: {
|
|
7
6
|
// 字典名称
|
|
@@ -17,22 +16,24 @@ const S = /* @__PURE__ */ c({
|
|
|
17
16
|
},
|
|
18
17
|
setup(a) {
|
|
19
18
|
const {
|
|
20
|
-
list:
|
|
21
|
-
} =
|
|
19
|
+
list: r
|
|
20
|
+
} = p(), e = u("workerInstance");
|
|
21
|
+
console.log(e);
|
|
22
|
+
const s = o(!0), n = o("");
|
|
22
23
|
return e.onerror = () => {
|
|
23
24
|
s.value = !1;
|
|
24
25
|
}, e.onmessage = (t) => {
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
const t = a.value,
|
|
26
|
+
n.value = t.data;
|
|
27
|
+
}, i(() => {
|
|
28
|
+
const t = a.value, c = a.name;
|
|
28
29
|
e.postMessage({
|
|
29
|
-
list: JSON.stringify(
|
|
30
|
-
name:
|
|
30
|
+
list: JSON.stringify(r),
|
|
31
|
+
name: c,
|
|
31
32
|
value: t
|
|
32
33
|
});
|
|
33
|
-
}), () =>
|
|
34
|
+
}), () => f(m, null, [n.value]);
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
v as default
|
|
38
39
|
};
|
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
import { createPinia as
|
|
2
|
-
import { createPersistedState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { createPinia as c } from "pinia";
|
|
2
|
+
import { createPersistedState as a } from "pinia-plugin-persistedstate";
|
|
3
|
+
import f from "./dic/replace.worker.esm.js";
|
|
4
|
+
import l from "./select/dic.worker.esm.js";
|
|
5
|
+
import * as p from "./components.esm.js";
|
|
6
|
+
import D from "../directive/trim.esm.js";
|
|
7
|
+
import { DTable as b } from "./table/index.esm.js";
|
|
8
|
+
import { DSelect as g } from "./select/index.esm.js";
|
|
9
|
+
import { DDesensitize as G } from "./desensitize/index.esm.js";
|
|
10
|
+
import { DDicReplace as P } from "./dic/index.esm.js";
|
|
11
|
+
import { DModal as j } from "./modal/index.esm.js";
|
|
12
|
+
import { default as z } from "./form/index.esm.js";
|
|
13
|
+
import { DGrid as F, DGridItem as L } from "./grid/index.esm.js";
|
|
14
|
+
import { DList as O, DMain as $, DNavTabs as q, DShow as A } from "./layout/index.esm.js";
|
|
15
|
+
const n = p;
|
|
16
|
+
let r = null, o = null;
|
|
17
|
+
const d = function(e, s) {
|
|
18
|
+
Object.keys(n).forEach((m) => {
|
|
19
|
+
const i = n[m];
|
|
20
|
+
i.install && e.use(i);
|
|
17
21
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
const t = c();
|
|
23
|
+
t.use(
|
|
24
|
+
a({
|
|
21
25
|
storage: sessionStorage
|
|
22
26
|
})
|
|
23
|
-
), e.use(
|
|
24
|
-
},
|
|
25
|
-
install:
|
|
27
|
+
), e.use(t), e.directive("trim", D), e.provide("menuIcon", s.menuIcon || {}), r || (r = new f(), e.provide("workerInstance", r)), o || (o = new l(), e.provide("workerInstance", o));
|
|
28
|
+
}, W = {
|
|
29
|
+
install: d
|
|
26
30
|
};
|
|
27
31
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
G as DDesensitize,
|
|
33
|
+
z as DForm,
|
|
34
|
+
F as DGrid,
|
|
35
|
+
L as DGridItem,
|
|
36
|
+
O as DList,
|
|
37
|
+
$ as DMain,
|
|
38
|
+
j as DModal,
|
|
39
|
+
q as DNavTabs,
|
|
40
|
+
g as DSelect,
|
|
41
|
+
A as DShow,
|
|
42
|
+
b as DTable,
|
|
43
|
+
P as DicReplace,
|
|
44
|
+
W as default,
|
|
45
|
+
d as install
|
|
42
46
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, useSlots as N, inject as R, computed as V, watch as z, resolveComponent as a, openBlock as d, createElementBlock as p, createVNode as r, unref as u, withCtx as o, normalizeClass as D, createTextVNode as E, toDisplayString as j, renderSlot as t, createElementVNode as I, createCommentVNode as O, h as f } from "vue";
|
|
2
2
|
import { useRouter as P, useRoute as W } from "vue-router";
|
|
3
3
|
import { useWindowScroll as q, useScrollLock as A } from "@vueuse/core";
|
|
4
4
|
import { LeftOutlined as F } from "@ant-design/icons-vue";
|
|
@@ -10,49 +10,49 @@ const K = { class: "ditari-show-layout" }, M = {
|
|
|
10
10
|
class: "ditari-show-footer"
|
|
11
11
|
}, Q = {
|
|
12
12
|
name: "DShowLayout"
|
|
13
|
-
}, ne = /* @__PURE__ */
|
|
13
|
+
}, ne = /* @__PURE__ */ L({
|
|
14
14
|
...Q,
|
|
15
15
|
props: {
|
|
16
16
|
close: { type: Boolean, default: !1 },
|
|
17
17
|
loading: { type: Boolean, default: !1 }
|
|
18
18
|
},
|
|
19
19
|
setup(m, { expose: g }) {
|
|
20
|
-
const s = m, n = P(),
|
|
20
|
+
const s = m, n = P(), l = W(), h = N(), i = G(), _ = H(), c = R("showConfig"), y = () => c ? f(a(c.backBtn)) : f(F), { refresh: S } = J(_), b = V(() => s.loading), w = {
|
|
21
21
|
padding: `10px 10px ${h.footer ? "70px" : "10px"} 10px`
|
|
22
|
-
}, w = () => {
|
|
23
|
-
s.close && c.deleteTabs(i.path), n.go(-1);
|
|
24
22
|
}, v = () => {
|
|
25
|
-
|
|
26
|
-
},
|
|
23
|
+
s.close && i.deleteTabs(l.path), n.go(-1);
|
|
24
|
+
}, T = () => {
|
|
25
|
+
S.value = !0, i.deleteTabs(l.path), n.go(-1);
|
|
26
|
+
}, { y: k } = q(), C = A(document.body);
|
|
27
27
|
z(
|
|
28
28
|
() => s.loading,
|
|
29
29
|
(e) => {
|
|
30
|
-
|
|
30
|
+
C.value = e;
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
const
|
|
33
|
+
const $ = 200;
|
|
34
34
|
return g({
|
|
35
|
-
closePage:
|
|
35
|
+
closePage: T
|
|
36
36
|
}), (e, U) => {
|
|
37
|
-
const
|
|
37
|
+
const B = a("a-page-header"), x = a("a-spin");
|
|
38
38
|
return d(), p("div", K, [
|
|
39
|
-
|
|
39
|
+
r(x, {
|
|
40
40
|
tip: "正在处理...",
|
|
41
|
-
spinning: u(
|
|
42
|
-
delay:
|
|
41
|
+
spinning: u(b),
|
|
42
|
+
delay: $,
|
|
43
43
|
size: "large"
|
|
44
44
|
}, {
|
|
45
45
|
default: o(() => [
|
|
46
|
-
|
|
47
|
-
class: D(["ditari-page-header", { active: u(
|
|
46
|
+
r(B, {
|
|
47
|
+
class: D(["ditari-page-header", { active: u(k) > 0 }]),
|
|
48
48
|
ghost: !1,
|
|
49
|
-
onBack:
|
|
49
|
+
onBack: v
|
|
50
50
|
}, {
|
|
51
51
|
backIcon: o(() => [
|
|
52
|
-
|
|
52
|
+
r(y)
|
|
53
53
|
]),
|
|
54
54
|
title: o(() => [
|
|
55
|
-
E(
|
|
55
|
+
E(j(e.$route.meta.title), 1)
|
|
56
56
|
]),
|
|
57
57
|
subTitle: o(() => [
|
|
58
58
|
t(e.$slots, "subTitle")
|
|
@@ -62,15 +62,15 @@ const K = { class: "ditari-show-layout" }, M = {
|
|
|
62
62
|
]),
|
|
63
63
|
_: 3
|
|
64
64
|
}, 8, ["class"]),
|
|
65
|
-
|
|
65
|
+
I("div", {
|
|
66
66
|
class: "ditari-show-content",
|
|
67
|
-
style:
|
|
67
|
+
style: w
|
|
68
68
|
}, [
|
|
69
69
|
t(e.$slots, "default")
|
|
70
70
|
]),
|
|
71
71
|
e.$slots.footer ? (d(), p("div", M, [
|
|
72
72
|
t(e.$slots, "footer")
|
|
73
|
-
])) :
|
|
73
|
+
])) : O("", !0)
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
76
|
}, 8, ["spinning"])
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { defineComponent as x, ref as v, watch as h, resolveComponent as
|
|
2
|
-
import { useDataDicStore as
|
|
3
|
-
|
|
4
|
-
const H = {
|
|
1
|
+
import { defineComponent as x, ref as v, inject as y, watch as h, resolveComponent as O, openBlock as V, createBlock as I, unref as o, isRef as J } from "vue";
|
|
2
|
+
import { useDataDicStore as N } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
+
const j = {
|
|
5
4
|
name: "DSelect"
|
|
6
|
-
},
|
|
7
|
-
...
|
|
5
|
+
}, M = /* @__PURE__ */ x({
|
|
6
|
+
...j,
|
|
8
7
|
props: {
|
|
9
8
|
value: { default: null },
|
|
10
9
|
name: { default: "" },
|
|
@@ -14,14 +13,14 @@ const H = {
|
|
|
14
13
|
},
|
|
15
14
|
emits: ["update:value", "change", "select"],
|
|
16
15
|
setup(u, { emit: c }) {
|
|
17
|
-
const l = u, { getDicByKey: p, list: S } =
|
|
16
|
+
const l = u, { getDicByKey: p, list: S } = N(), { modelValue: r, data: m, onSearch: g, onSelect: C, onChange: w } = L();
|
|
18
17
|
function L() {
|
|
19
18
|
let d = !0, n = [];
|
|
20
|
-
const
|
|
19
|
+
const t = v(n), a = v(l.value), i = y("workerInstance");
|
|
21
20
|
i.onerror = () => {
|
|
22
21
|
d = !1, n = p(l.name);
|
|
23
22
|
}, i.onmessage = (e) => {
|
|
24
|
-
|
|
23
|
+
t.value = [...e.data];
|
|
25
24
|
}, h(
|
|
26
25
|
() => l.include,
|
|
27
26
|
() => {
|
|
@@ -34,7 +33,7 @@ const H = {
|
|
|
34
33
|
}
|
|
35
34
|
), f(a.value);
|
|
36
35
|
const b = (e) => {
|
|
37
|
-
d ? f(e) :
|
|
36
|
+
d ? f(e) : t.value = n.filter((s) => s.value.toLowerCase().indexOf(e.toLowerCase()) !== -1 || s.label.toLowerCase().includes(e.toLowerCase())).splice(0, 10);
|
|
38
37
|
};
|
|
39
38
|
function f(e) {
|
|
40
39
|
i.postMessage({
|
|
@@ -49,11 +48,11 @@ const H = {
|
|
|
49
48
|
c("update:value", a.value), c("change", a.value);
|
|
50
49
|
};
|
|
51
50
|
function k() {
|
|
52
|
-
const
|
|
53
|
-
c("select",
|
|
51
|
+
const s = p(l.name).find((B) => B.value === a.value);
|
|
52
|
+
c("select", s);
|
|
54
53
|
}
|
|
55
54
|
return {
|
|
56
|
-
data:
|
|
55
|
+
data: t,
|
|
57
56
|
modelValue: a,
|
|
58
57
|
onSearch: b,
|
|
59
58
|
onSelect: D,
|
|
@@ -61,23 +60,23 @@ const H = {
|
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
return (d, n) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
value:
|
|
67
|
-
"onUpdate:value": n[0] || (n[0] = (a) =>
|
|
63
|
+
const t = O("a-select");
|
|
64
|
+
return V(), I(t, {
|
|
65
|
+
value: o(r),
|
|
66
|
+
"onUpdate:value": n[0] || (n[0] = (a) => J(r) ? r.value = a : null),
|
|
68
67
|
"allow-clear": "",
|
|
69
68
|
"show-search": "",
|
|
70
69
|
"filter-option": !1,
|
|
71
|
-
options:
|
|
70
|
+
options: o(m),
|
|
72
71
|
placeholder: u.placeholder,
|
|
73
72
|
disabled: u.disabled,
|
|
74
|
-
onSelect:
|
|
75
|
-
onSearch:
|
|
76
|
-
onChange:
|
|
73
|
+
onSelect: o(C),
|
|
74
|
+
onSearch: o(g),
|
|
75
|
+
onChange: o(w)
|
|
77
76
|
}, null, 8, ["value", "options", "placeholder", "disabled", "onSelect", "onSearch", "onChange"]);
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
79
|
});
|
|
81
80
|
export {
|
|
82
|
-
|
|
81
|
+
M as default
|
|
83
82
|
};
|
|
@@ -33,6 +33,8 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
33
33
|
type: PropType<string[] | undefined>;
|
|
34
34
|
default: () => never[];
|
|
35
35
|
};
|
|
36
|
+
defaultExpandAllRows: PropType<boolean | undefined>;
|
|
37
|
+
default: () => boolean;
|
|
36
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<{
|
|
37
39
|
data: {
|
|
38
40
|
type: PropType<any>;
|
|
@@ -63,6 +65,8 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
63
65
|
type: PropType<string[] | undefined>;
|
|
64
66
|
default: () => never[];
|
|
65
67
|
};
|
|
68
|
+
defaultExpandAllRows: PropType<boolean | undefined>;
|
|
69
|
+
default: () => boolean;
|
|
66
70
|
}>> & {
|
|
67
71
|
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
68
72
|
}, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as X, ref as r, computed as
|
|
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
2
|
import { Table as Z, Space as ee, Pagination as te } from "ant-design-vue";
|
|
3
|
-
import { useEleHeight as
|
|
4
|
-
import { prefixName as
|
|
5
|
-
const
|
|
3
|
+
import { useEleHeight as E } from "../../utils/html.esm.js";
|
|
4
|
+
import { prefixName as ae } from "../theme/index.esm.js";
|
|
5
|
+
const ne = () => ({
|
|
6
6
|
data: {
|
|
7
7
|
type: Object,
|
|
8
8
|
required: !0
|
|
@@ -31,7 +31,9 @@ const ae = () => ({
|
|
|
31
31
|
expandedRowKeys: {
|
|
32
32
|
type: Object,
|
|
33
33
|
default: () => []
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
defaultExpandAllRows: Boolean,
|
|
36
|
+
default: () => !0
|
|
35
37
|
}), b = {
|
|
36
38
|
defaultPageSize: 20,
|
|
37
39
|
hideOnSinglePage: !1,
|
|
@@ -40,51 +42,51 @@ const ae = () => ({
|
|
|
40
42
|
showQuickJumper: !0,
|
|
41
43
|
showLessItems: !0,
|
|
42
44
|
showTotal: (t) => `总共 ${t} 条`
|
|
43
|
-
},
|
|
45
|
+
}, K = `${ae}-pagination`, ce = /* @__PURE__ */ X({
|
|
44
46
|
name: "DTable",
|
|
45
|
-
props:
|
|
47
|
+
props: ne(),
|
|
46
48
|
// emits: { "update:keys": (keys: []) => void }
|
|
47
49
|
// TODO 需要做调整
|
|
48
50
|
emits: ["update:keys"],
|
|
49
51
|
setup: function(t, {
|
|
50
|
-
emit:
|
|
52
|
+
emit: R,
|
|
51
53
|
slots: s
|
|
52
54
|
}) {
|
|
53
|
-
const
|
|
55
|
+
const a = r(t.keys || []), B = S(() => t.data), O = S(() => {
|
|
54
56
|
var e;
|
|
55
57
|
return ((e = t.config) == null ? void 0 : e.columns) ?? [];
|
|
56
|
-
}), v =
|
|
58
|
+
}), v = S(() => {
|
|
57
59
|
var e;
|
|
58
60
|
return ((e = t.config) == null ? void 0 : e.pagination) ?? {};
|
|
59
|
-
}),
|
|
61
|
+
}), C = r(t.expandedRowKeys);
|
|
60
62
|
k(() => {
|
|
61
63
|
const {
|
|
62
64
|
expandedRowKeys: e
|
|
63
65
|
} = t;
|
|
64
|
-
|
|
66
|
+
C.value = e;
|
|
65
67
|
});
|
|
66
68
|
const {
|
|
67
69
|
tableRef: H,
|
|
68
70
|
tableRootRef: j,
|
|
69
|
-
tableHeight:
|
|
70
|
-
onPageChange:
|
|
71
|
-
onRowClassName:
|
|
72
|
-
} =
|
|
73
|
-
function
|
|
71
|
+
tableHeight: A,
|
|
72
|
+
onPageChange: D,
|
|
73
|
+
onRowClassName: U
|
|
74
|
+
} = $();
|
|
75
|
+
function $() {
|
|
74
76
|
const {
|
|
75
77
|
rowClassName: e,
|
|
76
78
|
keepSelected: o,
|
|
77
79
|
onPageChange: l
|
|
78
|
-
} = t.config, m = t.config.selection ?? "N", d = r(), i = r(null),
|
|
80
|
+
} = t.config, m = t.config.selection ?? "N", d = r(), i = r(null), n = r(), u = r(null), g = (c) => {
|
|
79
81
|
var h, T;
|
|
80
82
|
try {
|
|
81
|
-
const p = (h = i == null ? void 0 : i.value) == null ? void 0 : h.$el, V =
|
|
83
|
+
const p = (h = i == null ? void 0 : i.value) == null ? void 0 : h.$el, V = E(p.getElementsByClassName("ant-table-header")[0]);
|
|
82
84
|
let P = 0;
|
|
83
85
|
if (t.config.pagination) {
|
|
84
|
-
const W = (T = d.value) == null ? void 0 : T.getElementsByClassName(
|
|
85
|
-
P =
|
|
86
|
+
const W = (T = d.value) == null ? void 0 : T.getElementsByClassName(K)[0];
|
|
87
|
+
P = E(W) ?? 0;
|
|
86
88
|
}
|
|
87
|
-
|
|
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];
|
|
88
90
|
} catch (p) {
|
|
89
91
|
console.warn(p);
|
|
90
92
|
}
|
|
@@ -98,17 +100,17 @@ const ae = () => ({
|
|
|
98
100
|
}), {
|
|
99
101
|
tableRef: i,
|
|
100
102
|
tableRootRef: d,
|
|
101
|
-
tableHeight:
|
|
103
|
+
tableHeight: n,
|
|
102
104
|
onPageChange: (c, h) => {
|
|
103
105
|
l && l({
|
|
104
106
|
page: c,
|
|
105
107
|
size: h
|
|
106
|
-
}), u.value.scrollTop = 0, (m === "S" || !o) && (
|
|
108
|
+
}), u.value.scrollTop = 0, (m === "S" || !o) && (a.value = [], R("update:keys", a.value));
|
|
107
109
|
},
|
|
108
110
|
onRowClassName: (c, h) => e ? e(c, h) : void 0
|
|
109
111
|
};
|
|
110
112
|
}
|
|
111
|
-
const
|
|
113
|
+
const q = F();
|
|
112
114
|
function F() {
|
|
113
115
|
const {
|
|
114
116
|
rowKey: e,
|
|
@@ -117,22 +119,22 @@ const ae = () => ({
|
|
|
117
119
|
}
|
|
118
120
|
} = t;
|
|
119
121
|
let l = t.config.selection ?? "N";
|
|
120
|
-
const m = (
|
|
121
|
-
l === "S" ? (
|
|
122
|
-
}, d = (
|
|
123
|
-
const
|
|
124
|
-
|
|
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);
|
|
125
127
|
};
|
|
126
|
-
G(() => t.keys, (
|
|
127
|
-
|
|
128
|
+
G(() => t.keys, (n) => {
|
|
129
|
+
a.value = n;
|
|
128
130
|
});
|
|
129
131
|
const i = r(void 0);
|
|
130
132
|
return k(() => {
|
|
131
133
|
const {
|
|
132
|
-
selection:
|
|
134
|
+
selection: n
|
|
133
135
|
} = t.config;
|
|
134
|
-
l =
|
|
135
|
-
selectedRowKeys:
|
|
136
|
+
l = n, l !== "N" ? i.value = {
|
|
137
|
+
selectedRowKeys: a,
|
|
136
138
|
onSelect: m,
|
|
137
139
|
onSelectAll: d,
|
|
138
140
|
fixed: !0,
|
|
@@ -152,13 +154,13 @@ const ae = () => ({
|
|
|
152
154
|
click: m,
|
|
153
155
|
dbClick: d,
|
|
154
156
|
selection: i,
|
|
155
|
-
getCheckboxProps:
|
|
157
|
+
getCheckboxProps: n
|
|
156
158
|
}
|
|
157
159
|
} = t, u = e[l], g = () => {
|
|
158
|
-
const
|
|
159
|
-
if (i === "N" ||
|
|
160
|
+
const w = n === void 0 ? !1 : n(e).disabled;
|
|
161
|
+
if (i === "N" || w)
|
|
160
162
|
return;
|
|
161
|
-
|
|
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);
|
|
162
164
|
};
|
|
163
165
|
return {
|
|
164
166
|
onClick: () => {
|
|
@@ -184,7 +186,7 @@ const ae = () => ({
|
|
|
184
186
|
}
|
|
185
187
|
const x = (e) => {
|
|
186
188
|
e.stopPropagation();
|
|
187
|
-
}, I =
|
|
189
|
+
}, I = S(() => {
|
|
188
190
|
const {
|
|
189
191
|
selection: e
|
|
190
192
|
} = t.config;
|
|
@@ -203,22 +205,23 @@ const ae = () => ({
|
|
|
203
205
|
ref: H,
|
|
204
206
|
"row-key": t.rowKey,
|
|
205
207
|
bordered: t.config.bordered,
|
|
206
|
-
columns:
|
|
207
|
-
dataSource:
|
|
208
|
+
columns: O.value,
|
|
209
|
+
dataSource: B.value,
|
|
208
210
|
loading: t.loading,
|
|
209
211
|
size: ((e = t.config) == null ? void 0 : e.size) ?? "small",
|
|
210
212
|
scroll: {
|
|
211
213
|
scrollToFirstRowOnChange: !0,
|
|
212
214
|
x: "100%",
|
|
213
|
-
y:
|
|
215
|
+
y: A.value + "px"
|
|
214
216
|
},
|
|
215
|
-
expandedRowKeys:
|
|
216
|
-
"onUpdate:expandedRowKeys": (o) =>
|
|
217
|
+
expandedRowKeys: C.value,
|
|
218
|
+
"onUpdate:expandedRowKeys": (o) => C.value = o,
|
|
217
219
|
expandRowByClick: I.value,
|
|
220
|
+
defaultExpandAllRows: t.defaultExpandAllRows,
|
|
218
221
|
pagination: !1,
|
|
219
222
|
customRow: J,
|
|
220
|
-
rowSelection:
|
|
221
|
-
rowClassName:
|
|
223
|
+
rowSelection: q.value,
|
|
224
|
+
rowClassName: U
|
|
222
225
|
}, {
|
|
223
226
|
bodyCell: ({
|
|
224
227
|
column: o,
|
|
@@ -236,7 +239,7 @@ const ae = () => ({
|
|
|
236
239
|
// 总结栏插槽
|
|
237
240
|
summary: L
|
|
238
241
|
}), M(f(te, {
|
|
239
|
-
class: [
|
|
242
|
+
class: [K],
|
|
240
243
|
current: v.value.current,
|
|
241
244
|
"onUpdate:current": (o) => v.value.current = o,
|
|
242
245
|
pageSize: v.value.pageSize,
|
|
@@ -250,7 +253,7 @@ const ae = () => ({
|
|
|
250
253
|
"page-size-options": b.pageSizeOptions,
|
|
251
254
|
"show-total": b.showTotal,
|
|
252
255
|
total: v.value.total,
|
|
253
|
-
onChange:
|
|
256
|
+
onChange: D
|
|
254
257
|
}, null), [[Y, t.config.pagination]])]);
|
|
255
258
|
};
|
|
256
259
|
}
|
|
@@ -28,6 +28,8 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
28
28
|
type: import("vue").PropType<string[] | undefined>;
|
|
29
29
|
default: () => never[];
|
|
30
30
|
};
|
|
31
|
+
defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
|
|
32
|
+
default: () => boolean;
|
|
31
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<{
|
|
32
34
|
data: {
|
|
33
35
|
type: import("vue").PropType<any>;
|
|
@@ -58,6 +60,8 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
58
60
|
type: import("vue").PropType<string[] | undefined>;
|
|
59
61
|
default: () => never[];
|
|
60
62
|
};
|
|
63
|
+
defaultExpandAllRows: import("vue").PropType<boolean | undefined>;
|
|
64
|
+
default: () => boolean;
|
|
61
65
|
}>> & {
|
|
62
66
|
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
63
67
|
}, {
|
package/package.json
CHANGED
|
@@ -5,4 +5,4 @@ export { DGrid, DGridItem } from "./grid";
|
|
|
5
5
|
export { default as DSelect } from "./select";
|
|
6
6
|
export { default as DDesensitize } from "./desensitize";
|
|
7
7
|
export { default as DicReplace } from "./dic";
|
|
8
|
-
export { default as DModal } from "./modal";
|
|
8
|
+
export { default as DModal } from "./modal";
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* 根据字典名字及对应的value替换成中文或者人能看懂的文字
|
|
4
4
|
* @author 余春林
|
|
5
5
|
*/
|
|
6
|
-
import { defineComponent, ref, watchEffect } from "vue";
|
|
6
|
+
import { defineComponent, ref, watchEffect, inject } from "vue";
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
8
|
// @ts-ignore
|
|
9
|
-
import DicWorker from "./replace.worker?worker&inline";
|
|
9
|
+
// import DicWorker from "./replace.worker?worker&inline";
|
|
10
10
|
import { useDataDicStore } from "../../store/modules/DataDictionary";
|
|
11
11
|
|
|
12
12
|
export default defineComponent({
|
|
@@ -25,28 +25,30 @@ export default defineComponent({
|
|
|
25
25
|
},
|
|
26
26
|
setup(props) {
|
|
27
27
|
const { list } = useDataDicStore();
|
|
28
|
-
|
|
28
|
+
const workerInstance: any = inject("workerInstance");
|
|
29
|
+
console.log(workerInstance);
|
|
29
30
|
const workerStatus = ref(true);
|
|
30
31
|
const dicValueTxt = ref<any>("");
|
|
31
|
-
|
|
32
|
+
// if (!workerInstance) {
|
|
33
|
+
// workerInstance = new DicWorker();
|
|
34
|
+
// }
|
|
32
35
|
/**
|
|
33
36
|
* web worker 启动失败
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
workerInstance.onerror = () => {
|
|
36
39
|
workerStatus.value = false;
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
39
42
|
* 监听web worker发送的数据
|
|
40
43
|
* @param e
|
|
41
44
|
*/
|
|
42
|
-
|
|
43
|
-
// 赋值给下拉选择数据变量
|
|
45
|
+
workerInstance.onmessage = (e: any) => {
|
|
44
46
|
dicValueTxt.value = e.data;
|
|
45
47
|
};
|
|
46
48
|
watchEffect(() => {
|
|
47
49
|
const value = props.value;
|
|
48
50
|
const name = props.name;
|
|
49
|
-
|
|
51
|
+
workerInstance.postMessage({ list: JSON.stringify(list), name, value });
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
return () => <>{dicValueTxt.value}</>;
|
package/src/components/index.ts
CHANGED
|
@@ -2,6 +2,9 @@ import type { App } from "vue";
|
|
|
2
2
|
import { createPinia } from "pinia";
|
|
3
3
|
import { createPersistedState } from "pinia-plugin-persistedstate";
|
|
4
4
|
|
|
5
|
+
import ReplaceWorker from "./dic/replace.worker?worker&inline";
|
|
6
|
+
import DicWorker from "./select/dic.worker?worker&inline";
|
|
7
|
+
|
|
5
8
|
import * as components from "./components";
|
|
6
9
|
export * from "./components";
|
|
7
10
|
|
|
@@ -16,6 +19,9 @@ export interface Options {
|
|
|
16
19
|
prop?: string;
|
|
17
20
|
}
|
|
18
21
|
const c: any = components;
|
|
22
|
+
let replaceWorkerInstance: any = null;
|
|
23
|
+
let dicWorkerInstance: any = null;
|
|
24
|
+
|
|
19
25
|
export const install = function (app: App, opts: Options) {
|
|
20
26
|
Object.keys(c).forEach((key) => {
|
|
21
27
|
const component = c[key];
|
|
@@ -34,6 +40,14 @@ export const install = function (app: App, opts: Options) {
|
|
|
34
40
|
app.use(pinia);
|
|
35
41
|
app.directive("trim", vTrim);
|
|
36
42
|
app.provide("menuIcon", opts.menuIcon || {});
|
|
43
|
+
if (!replaceWorkerInstance) {
|
|
44
|
+
replaceWorkerInstance = new ReplaceWorker();
|
|
45
|
+
app.provide("workerInstance", replaceWorkerInstance);
|
|
46
|
+
}
|
|
47
|
+
if (!dicWorkerInstance) {
|
|
48
|
+
dicWorkerInstance = new DicWorker();
|
|
49
|
+
app.provide("workerInstance", dicWorkerInstance);
|
|
50
|
+
}
|
|
37
51
|
};
|
|
38
52
|
|
|
39
53
|
export default {
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* 入口文件
|
|
4
4
|
*/
|
|
5
5
|
import { computed, provide } from "vue";
|
|
6
|
-
import {
|
|
7
|
-
MenuFoldOutlined,
|
|
8
|
-
MenuUnfoldOutlined,
|
|
9
|
-
} from "@ant-design/icons-vue";
|
|
6
|
+
import { MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons-vue";
|
|
10
7
|
import { useKeepAliveStore, useSettingsStore } from "../../store";
|
|
11
8
|
|
|
12
9
|
//标签页组件
|
|
@@ -33,8 +33,7 @@ const settingsStore = useSettingsStore();
|
|
|
33
33
|
const showConfig = inject("showConfig") as any;
|
|
34
34
|
|
|
35
35
|
const btnRender = () => {
|
|
36
|
-
|
|
37
|
-
if (showConfig.backBtn === "LeftOutlined") {
|
|
36
|
+
if (!showConfig) {
|
|
38
37
|
return h(LeftOutlined);
|
|
39
38
|
} else {
|
|
40
39
|
return h(resolveComponent(showConfig.backBtn));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, watch } from "vue";
|
|
2
|
+
import { inject, ref, watch } from "vue";
|
|
3
3
|
import { useDataDicStore } from "../../store/modules/DataDictionary";
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import DicWorker from "./dic.worker?worker&inline";
|
|
6
|
+
// import DicWorker from "./dic.worker?worker&inline";
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
9
|
value: any;
|
|
@@ -38,12 +38,16 @@ function useSelect() {
|
|
|
38
38
|
const data = ref(dicData);
|
|
39
39
|
// 取值
|
|
40
40
|
const modelValue = ref(props.value);
|
|
41
|
-
//
|
|
42
|
-
const
|
|
41
|
+
// 获取worker
|
|
42
|
+
const workerInstance: any = inject("workerInstance");
|
|
43
|
+
// if (!workerInstance) {
|
|
44
|
+
// console.log("一次");
|
|
45
|
+
// workerInstance = new DicWorker();
|
|
46
|
+
// }
|
|
43
47
|
/**
|
|
44
48
|
* web worker 启动失败
|
|
45
49
|
*/
|
|
46
|
-
|
|
50
|
+
workerInstance.onerror = () => {
|
|
47
51
|
workerStatus = false;
|
|
48
52
|
// 启动失败使用store
|
|
49
53
|
dicData = getDicByKey(props.name);
|
|
@@ -52,7 +56,7 @@ function useSelect() {
|
|
|
52
56
|
* 监听web worker发送的数据
|
|
53
57
|
* @param e
|
|
54
58
|
*/
|
|
55
|
-
|
|
59
|
+
workerInstance.onmessage = (e: any) => {
|
|
56
60
|
// 赋值给下拉选择数据变量
|
|
57
61
|
data.value = [...e.data];
|
|
58
62
|
};
|
|
@@ -94,7 +98,7 @@ function useSelect() {
|
|
|
94
98
|
|
|
95
99
|
// 发送搜索到webworker
|
|
96
100
|
function sendWorkerSearch(keywords: string) {
|
|
97
|
-
|
|
101
|
+
workerInstance.postMessage({
|
|
98
102
|
list: JSON.stringify(list[props.name]),
|
|
99
103
|
keywords: keywords,
|
|
100
104
|
include: JSON.stringify(props.include ?? [])
|
|
@@ -47,7 +47,11 @@ const tableProps = () => {
|
|
|
47
47
|
expandedRowKeys: {
|
|
48
48
|
type: Object as PropType<TableProps["expandedRowKeys"]>,
|
|
49
49
|
default: () => []
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
|
+
defaultExpandAllRows: Boolean as PropType<
|
|
52
|
+
TableProps["defaultExpandAllRows"]
|
|
53
|
+
>,
|
|
54
|
+
default: () => true
|
|
51
55
|
};
|
|
52
56
|
};
|
|
53
57
|
|
|
@@ -396,6 +400,7 @@ const DXTable = defineComponent({
|
|
|
396
400
|
}}
|
|
397
401
|
v-model:expandedRowKeys={expandedKeys.value}
|
|
398
402
|
expandRowByClick={expandRowByClick.value}
|
|
403
|
+
defaultExpandAllRows={props.defaultExpandAllRows}
|
|
399
404
|
pagination={false}
|
|
400
405
|
customRow={customRow}
|
|
401
406
|
rowSelection={rowSelection.value}
|
package/src/hooks/http/index.ts
CHANGED
|
@@ -65,8 +65,8 @@ const useRequestList = (service: any, options: Options = {}) => {
|
|
|
65
65
|
/**
|
|
66
66
|
* 列表查询数据
|
|
67
67
|
*/
|
|
68
|
-
const data = computed<any>(
|
|
69
|
-
get((listData as any).value, dataKey || "data", [])
|
|
68
|
+
const data = computed<any>(
|
|
69
|
+
() => get((listData as any).value, dataKey || "data", []) || []
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
/**
|