kso-sel-org 1.0.5 → 1.0.6

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.
@@ -0,0 +1,17 @@
1
+ export declare const load: () => {
2
+ dialog: any;
3
+ columns: any;
4
+ queryCondis: any;
5
+ pagination: any;
6
+ tableData: any;
7
+ load_dialog_config: () => Promise<void>;
8
+ page_current_change: () => void;
9
+ sort_change: ({ prop, order }: {
10
+ prop: any;
11
+ order: any;
12
+ }) => void;
13
+ load_table_data: (pageNum?: number) => void;
14
+ sort_header_cell_class: ({ column }: {
15
+ column: any;
16
+ }) => string;
17
+ };
@@ -0,0 +1,2 @@
1
+ import kuDialog from './components/dialog.vue';
2
+ export { kuDialog as kuDialog };
@@ -0,0 +1,28 @@
1
+ export declare const load: () => {
2
+ load_grid_config: () => Promise<void>;
3
+ load_table_data: (pageNum?: number) => void;
4
+ filter_change: (filters: any) => void;
5
+ sort_header_cell_class: ({ column }: {
6
+ column: any;
7
+ }) => string;
8
+ sort_change: ({ prop, order }: {
9
+ prop: any;
10
+ order: any;
11
+ }) => void;
12
+ page_size_change: () => void;
13
+ page_current_change: () => void;
14
+ clearRowFilter: () => void;
15
+ lstabRef: any;
16
+ cfgLoading: any;
17
+ queryCondis: any;
18
+ columns: any;
19
+ loading: any;
20
+ lstab: any;
21
+ headFuncOper: any;
22
+ rowFuncOper: any;
23
+ headFuncOperBatch: any;
24
+ rowFuncOperBatch: any;
25
+ quickFilter: any;
26
+ pagination: any;
27
+ tableData: any;
28
+ };
@@ -0,0 +1,5 @@
1
+ export declare const method: () => {
2
+ calColWidth: (width: number, num: string, minNum: string) => string | number;
3
+ debounce: (fn: any, time: any) => (...argu: any[]) => void;
4
+ openLsTabSetting: () => void;
5
+ };
@@ -0,0 +1 @@
1
+ export { default as kuMenuAuthor } from './src/index.vue';
@@ -0,0 +1 @@
1
+ export { default as kuOperAuthor } from './src/index.vue';
@@ -0,0 +1 @@
1
+ export { default as kuRoleAssign } from './src/index.vue';
@@ -0,0 +1 @@
1
+ export { default as kuRoleAuthor } from './src/index.vue';
@@ -0,0 +1,3 @@
1
+ export { default as kuAreaSelector } from './src/area-selector/index.vue';
2
+ export { default as kuOrgSelector } from './src/org-selector/index.vue';
3
+ export { default as kuUserSelector } from './src/user-selector/index.vue';
@@ -0,0 +1,132 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ /** 默认选中code值 */
3
+ modelValue: string;
4
+ /** 根机构ID(根机构ID,如果不设置,则返回所有机构树,传入则只显示该机构下的所有单位树) */
5
+ rootOrgId?: string | undefined;
6
+ /** 单位类型(如果不设置,则返回所有单位类型,否则传值(01:隶属局单位,02:直属局单位,03:总署单位))*/
7
+ orgType?: string | undefined;
8
+ /** 文本框显示内容 */
9
+ inputText?: string | undefined;
10
+ /** 返回内容处理 */
11
+ returnValue?: string | undefined;
12
+ /** 是否只读 */
13
+ readonly?: boolean | undefined;
14
+ /** 是否清除 */
15
+ isClear?: boolean | undefined;
16
+ /** 是否禁用 */
17
+ disabled?: boolean | undefined;
18
+ /** 按钮文本内容 */
19
+ buttonText?: string | undefined;
20
+ /** 开启复选 */
21
+ multiple?: boolean | undefined;
22
+ /** 事件绑定 */
23
+ bindEvent?: boolean | undefined;
24
+ /** 根据传进来的code查对应的name,覆盖inputText值 */
25
+ defaultText?: boolean | undefined;
26
+ /** 扩展查询参数 */
27
+ reqParams?: object | undefined;
28
+ }>, {
29
+ modelValue: string;
30
+ rootOrgId: string;
31
+ orgType: string;
32
+ inputText: string;
33
+ returnValue: string;
34
+ readonly: boolean;
35
+ isClear: boolean;
36
+ disabled: boolean;
37
+ buttonText: string;
38
+ multiple: boolean;
39
+ bindEvent: boolean;
40
+ defaultText: boolean;
41
+ reqParams: undefined;
42
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
+ onSelect: (...args: any[]) => void;
44
+ "update:modelValue": (...args: any[]) => void;
45
+ onCancel: (...args: any[]) => void;
46
+ onClear: (...args: any[]) => void;
47
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
48
+ /** 默认选中code值 */
49
+ modelValue: string;
50
+ /** 根机构ID(根机构ID,如果不设置,则返回所有机构树,传入则只显示该机构下的所有单位树) */
51
+ rootOrgId?: string | undefined;
52
+ /** 单位类型(如果不设置,则返回所有单位类型,否则传值(01:隶属局单位,02:直属局单位,03:总署单位))*/
53
+ orgType?: string | undefined;
54
+ /** 文本框显示内容 */
55
+ inputText?: string | undefined;
56
+ /** 返回内容处理 */
57
+ returnValue?: string | undefined;
58
+ /** 是否只读 */
59
+ readonly?: boolean | undefined;
60
+ /** 是否清除 */
61
+ isClear?: boolean | undefined;
62
+ /** 是否禁用 */
63
+ disabled?: boolean | undefined;
64
+ /** 按钮文本内容 */
65
+ buttonText?: string | undefined;
66
+ /** 开启复选 */
67
+ multiple?: boolean | undefined;
68
+ /** 事件绑定 */
69
+ bindEvent?: boolean | undefined;
70
+ /** 根据传进来的code查对应的name,覆盖inputText值 */
71
+ defaultText?: boolean | undefined;
72
+ /** 扩展查询参数 */
73
+ reqParams?: object | undefined;
74
+ }>, {
75
+ modelValue: string;
76
+ rootOrgId: string;
77
+ orgType: string;
78
+ inputText: string;
79
+ returnValue: string;
80
+ readonly: boolean;
81
+ isClear: boolean;
82
+ disabled: boolean;
83
+ buttonText: string;
84
+ multiple: boolean;
85
+ bindEvent: boolean;
86
+ defaultText: boolean;
87
+ reqParams: undefined;
88
+ }>>> & {
89
+ onOnSelect?: ((...args: any[]) => any) | undefined;
90
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
91
+ onOnCancel?: ((...args: any[]) => any) | undefined;
92
+ onOnClear?: ((...args: any[]) => any) | undefined;
93
+ }, {
94
+ modelValue: string;
95
+ multiple: boolean;
96
+ readonly: boolean;
97
+ disabled: boolean;
98
+ bindEvent: boolean;
99
+ inputText: string;
100
+ returnValue: string;
101
+ isClear: boolean;
102
+ buttonText: string;
103
+ defaultText: boolean;
104
+ reqParams: object;
105
+ rootOrgId: string;
106
+ orgType: string;
107
+ }, {}>, {
108
+ func?(_: {}): any;
109
+ }>;
110
+ export default _default;
111
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
112
+ type __VLS_TypePropsToRuntimeProps<T> = {
113
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
114
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
115
+ } : {
116
+ type: import('vue').PropType<T[K]>;
117
+ required: true;
118
+ };
119
+ };
120
+ type __VLS_WithDefaults<P, D> = {
121
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
122
+ default: D[K];
123
+ }> : P[K];
124
+ };
125
+ type __VLS_Prettify<T> = {
126
+ [K in keyof T]: T[K];
127
+ } & {};
128
+ type __VLS_WithTemplateSlots<T, S> = T & {
129
+ new (): {
130
+ $slots: S;
131
+ };
132
+ };
@@ -0,0 +1,2 @@
1
+ import ksoSelOrg from './components/Selector/src/org-selector/index.vue';
2
+ export default ksoSelOrg;
package/dist/index.umd.js CHANGED
@@ -1 +1,2 @@
1
- (function(e,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("vue")):typeof define=="function"&&define.amd?define(["vue"],m):(e=typeof globalThis<"u"?globalThis:e||self,e["kso-sel-org"]=m(e.Vue))})(this,function(e){"use strict";const m=u=>(e.pushScopeId("data-v-e2b739c9"),u=u(),e.popScopeId(),u),O={class:"org-selector"},j={class:"org-list-box"},D={class:"left-tree-box"},A={class:"search-box"},L=m(()=>e.createElementVNode("label",null,"单位列表",-1)),q={class:"tree-content-box"},R={class:"right-selected-list"},K=m(()=>e.createElementVNode("span",null,"已选单位",-1)),P={class:"tree-content-box"},F=["title"],M={class:"org-name"},U={class:"selector-footer"},z=e.defineComponent({__name:"index",props:{modelValue:{default:""},rootOrgId:{default:""},orgType:{default:""},inputText:{default:""},returnValue:{default:""},readonly:{type:Boolean,default:!0},isClear:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},buttonText:{default:"选择"},multiple:{type:Boolean,default:!0},bindEvent:{type:Boolean,default:!0},defaultText:{type:Boolean,default:!1},reqParams:{default:void 0}},emits:["onCancel","onSelect","update:modelValue","onClear"],setup(u,{emit:p}){const a=u;let V=e.useAttrs();const y=e.inject("req"),{warningMsgBox:$}=e.inject("msgBox"),G={children:"childrenList",label:"orgName"},s=e.ref(null);let c=e.ref(""),b=e.ref(!1),h=e.ref(!1),C=e.ref(!1),N=e.ref(""),g=e.ref(""),f=e.ref([]),k=e.ref([]),_=e.ref([]);e.watch(()=>a.modelValue,()=>{a.defaultText&&!C.value&&T()}),e.watch(()=>a.inputText,t=>{c.value=t});function E(){if(a.modelValue?_.value=a.modelValue.split(","):_.value=[],h.value=!0,b.value&&s.value){s.value.setCheckedKeys(_.value),f.value=s.value.getCheckedNodes();return}J()}function H(){a.bindEvent&&E()}function J(){let t={pid:a.rootOrgId,orgType:a.orgType};a.reqParams&&(t=Object.assign(t,a.reqParams)),y.post({url:getKsoRoot("/sys/org/list-by-condition"),params:t}).then(({data:l})=>{let o=Q(l);o&&o.length>0&&o.forEach(n=>{n.expanded=!0}),k.value=o,s.value.setCheckedKeys(_.value),b.value=!0})}function T(){if(!a.modelValue)return;C.value=!0;let t={ids:a.modelValue};y.post({url:getKsoRoot("/sys/org/find-by-ids"),params:t}).then(({data:l})=>{if(l&&l.length>0){let o=[];l.forEach(n=>{o.push(n.orgName)}),c.value=o.join(",")}})}function Q(t){return t.forEach(l=>{l.name=l.orgName,_.value.length>0&&_.value.includes(l.id)&&f.value.push(l);let o=[];t.forEach(n=>{n.pid==l.id&&o.push(n)}),l.childrenList=o}),t=t.filter(l=>l.pid==""),t}function W(t,{node:l,data:o}){o.expanded&&(l.expanded=!0);let n="tree-file-node-icon";l.childNodes&&l.childNodes.length>0&&(n="tree-folder-node-icon");let r=[];if(!a.multiple){let i="";o.id===N.value&&(i=o.id),r.push(t(e.resolveComponent("el-radio"),{modelValue:i,label:o.id,size:"large"}))}return r.push(t("i",{class:n,style:{marginRight:"5px"}})),r.push(t("span",{attrs:{title:o.name}},o.name)),t("span",{class:"node-text-box"},r)}function X(t,l){return t?l.name.indexOf(t)!==-1||l.id.indexOf(t)!==-1:!0}function Y(){s.value.filter(g.value),g.value||Z(k.value[0].id,!1)}function Z(t,l){var o=s.value.store.nodesMap;for(let n in o)t===n?o[n].expanded=!0:o[n].expanded=l}function v(t){a.multiple||(s.value.setCheckedNodes([t]),N.value=t.id),f.value=s.value.getCheckedNodes()}function ee(t,l){f.value.splice(l,1),N.value="",s.value.setCheckedNodes(f.value)}function B(){f.value=[],N.value="",s.value&&s.value.setCheckedNodes(f.value)}function w(){h.value=!1,p("onCancel","")}function te(){if(f.value.length==0)return $("请选择数据"),!1;let t=le(f.value);oe(t),h.value=!1,p("onSelect",t)}function le(t){let l=[];return t.forEach(o=>{let n={id:o.id,orgName:o.orgName,orgType:o.orgType,sname:o.sname,fname:o.fname,regId:o.regId,regName:o.regName,cityId:o.cityId,cityName:o.cityName};l.push(n)}),l}function oe(t){let l={};Object.keys(t[0]).forEach(n=>{l[n]=[]}),t.forEach(n=>{var r;for(let i in n)(r=l[i])==null||r.push(n[i])}),c.value=l.orgName.join(","),p("update:modelValue",l.id.join(","));let o=a.returnValue.split("|");o&&o.length>0&&o.forEach(n=>{let r=n.split(":");if(r&&r.length>1){let i=l[r[1]],x=i?i.join(","):"";V.sync[r[0]]=x}})}function S(){if(c.value="",p("update:modelValue",""),a.returnValue){let t=a.returnValue.split("|");t&&t.length>0&&t.forEach(l=>{let o=l.split(":");o&&o.length>1&&(V.sync[o[0]]="")})}B(),p("onClear","")}return e.onMounted(()=>{a.defaultText&&!C.value?T():c.value=a.inputText,a.multiple||(N.value=a.modelValue)}),(t,l)=>{const o=e.resolveComponent("CircleClose"),n=e.resolveComponent("el-icon"),r=e.resolveComponent("el-button"),i=e.resolveComponent("el-input"),x=e.resolveComponent("el-tree"),ne=e.resolveComponent("CircleCloseFilled"),ae=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",O,[t.$slots.func?(e.openBlock(),e.createElementBlock("div",{key:0,class:"slot-box",onClick:H},[e.renderSlot(t.$slots,"func",{},void 0,!0)])):(e.openBlock(),e.createBlock(i,{key:1,modelValue:e.unref(c),"onUpdate:modelValue":l[0]||(l[0]=d=>e.isRef(c)?c.value=d:c=d),disabled:t.disabled,readonly:t.readonly,clearable:"",onClear:S,placeholder:""},{append:e.withCtx(()=>[e.unref(c)&&t.isClear&&t.readonly?(e.openBlock(),e.createBlock(n,{key:0,onClickCapture:S},{default:e.withCtx(()=>[e.createVNode(o)]),_:1})):e.createCommentVNode("",!0),e.createVNode(r,{type:"primary",disabled:t.disabled,onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.buttonText),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled","readonly"])),e.createVNode(ae,{title:"单位选择",modelValue:e.unref(h),"onUpdate:modelValue":l[2]||(l[2]=d=>e.isRef(h)?h.value=d:h=d),onClose:w,width:1e3},{default:e.withCtx(()=>[e.createElementVNode("div",j,[e.createElementVNode("div",D,[e.createElementVNode("div",A,[L,e.createVNode(i,{modelValue:e.unref(g),"onUpdate:modelValue":l[1]||(l[1]=d=>e.isRef(g)?g.value=d:g=d),"suffix-icon":"Search",onInput:Y,placeholder:"请输入单位名称查询"},null,8,["modelValue"])]),e.createElementVNode("div",q,[e.createVNode(x,{data:e.unref(k),ref_key:"orgTree",ref:s,"node-key":"id",props:G,"expand-on-click-node":!1,"show-checkbox":t.multiple,"check-strictly":!0,"highlight-current":!0,accordion:!0,"check-on-click-node":!0,"filter-node-method":X,indent:26,onCheck:v,"render-content":W,"icon-class":"el-icon-arrow-right"},null,8,["data","show-checkbox"])])]),e.createElementVNode("div",R,[e.createElementVNode("div",{class:"selected-box"},[K,e.createElementVNode("div",{title:"删除全部"},[e.createElementVNode("i",{onClick:B,class:"delete-btn"})])]),e.createElementVNode("div",null,[e.createElementVNode("div",P,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(d,I)=>(e.openBlock(),e.createElementBlock("li",{key:I+"s",title:d.orgName+"("+d.id+")"},[e.createElementVNode("span",M,e.toDisplayString(d.orgName)+"("+e.toDisplayString(d.id)+") ",1),e.createVNode(n,{onClick:ie=>ee(d,I),color:"#909399",size:"16"},{default:e.withCtx(()=>[e.createVNode(ne)]),_:2},1032,["onClick"])],8,F))),128))])])])])]),e.createElementVNode("div",U,[e.createVNode(r,{onClick:w},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(r,{type:"primary",onClick:te},{default:e.withCtx(()=>[e.createTextVNode("确认")]),_:1})])]),_:1},8,["modelValue"])])}}}),re="";return((u,p)=>{const a=u.__vccOpts||u;for(const[V,y]of p)a[V]=y;return a})(z,[["__scopeId","data-v-e2b739c9"]])});
1
+ (function(e,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("vue")):typeof define=="function"&&define.amd?define(["vue"],b):(e=typeof globalThis<"u"?globalThis:e||self,e["kso-sel-org"]=b(e.Vue))})(this,function(e){"use strict";var b=document.createElement("style");b.textContent=`.org-list-box[data-v-e2b739c9]{padding:10px;display:flex;justify-content:space-between;box-sizing:border-box}.org-list-box .left-tree-box[data-v-e2b739c9]{border:1px solid #ebeef5;width:50%;overflow:hidden}.org-list-box .left-tree-box .search-box[data-v-e2b739c9]{height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;display:flex;align-items:center}.org-list-box .left-tree-box .search-box label[data-v-e2b739c9]{color:#303133;font-weight:700}.org-list-box .left-tree-box .search-box[data-v-e2b739c9] .el-input{width:calc(100% - 100px);margin-left:10px}.org-list-box .right-selected-list[data-v-e2b739c9]{border:1px solid #ebeef5;width:48%}.org-list-box .right-selected-list .selected-box[data-v-e2b739c9]{height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.org-list-box .right-selected-list .selected-box span[data-v-e2b739c9]{color:#303133;font-weight:700}.org-list-box .right-selected-list .selected-box .delete-btn[data-v-e2b739c9]{display:inline-block;width:17px;height:17px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADkSURBVDiN7ZOxccJAEEXfwiX2EFCCSnAHhkoM+V4NtKAZRCw6kVwCHUAHDixImPsOPJ5BMrKsGYd+4d79d/+CNTqc3SvBojv/wqB+LIrl7Sxc3FuBBPM+AYBg3s2EBNVPoTs8dTNBZmuTMmCD2V7wOmQxeEZamVme4GAAF/dFgkpm69l2ux+SvMe4MqmcwPKhKOrJyK/cpVfSuKuJsQRoYiwbd42W/EmTf8l3DGqkE4BSOhjUfXdD38Htks12uxzIRzcZQ6uJwebs/jIUktTa9E9JCEeu1zekTJD96nmzI9PpEeADOClObZiMikMAAAAASUVORK5CYII=) no-repeat;block-size:100% 100%}.org-list-box .right-selected-list[data-v-e2b739c9] .el-icon svg{width:1.5em;height:1.5em}.org-list-box .tree-content-box[data-v-e2b739c9]{height:420px;padding:5px 15px;box-sizing:border-box;overflow:auto}.org-list-box ul li[data-v-e2b739c9]{width:100%;line-height:40px;display:flex;align-items:center;justify-content:space-between;border:solid 1px #d7dde4;border-radius:4px;margin-bottom:8px;padding:0 20px;box-sizing:border-box}.org-list-box ul .org-name[data-v-e2b739c9]{width:92%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.org-list-box ul[data-v-e2b739c9] .el-icon{cursor:pointer}.org-list-box .org-del .img-box[data-v-e2b739c9]{margin:7px 0 0;cursor:pointer}.org-list-box .flow-modal-title[data-v-e2b739c9]{height:40px;background:#2b5fda;width:100%;text-indent:1em;color:#fff;line-height:40px}.selector-footer[data-v-e2b739c9]{padding:10px;display:flex;justify-content:flex-end;border-top:solid 1px #dcdfe6}[data-v-e2b739c9] .tree-folder-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAIvSURBVFiF7ZaxaxRBFMZ/73JFhBQWlhIDXmGRIoKFxR1OYboIFloKu7cBAyLEykpIYSFYi4W32QQFiwTyDwhOsaJgm+KKNFpdYRkkYJJncZO7SW7vdu+SgMH74Ir5bt77vn3v7czCGP87JG+DSfQtytIZajb5Q80+ll8ApdztZysOcIMJ7h4tykME7iCkI8sqFaAKgDA5vAEhtaGEo+qbWAPEGfCQ34JzRvEKKHOmobN2UbZ92sSaADBBagOJAcyaRhy0n9ZGg6s2TAXmKPHdrOqDY6wQIASoV16l2uFzMNCAeae3T1CTwIZJ9Hlh2zno2wLT0PsI7z1qG5gFQHllEp3hB09tXXrOEjeshQY2swIm1mWEDYQpR63zk5vAQ2DPmVhimi3zRqeychTFsQqYFS1zjdcoyx3ykBd2UV661aaJtYWwBVwBFrjEZ5PoPRtKy3uAKsJ1AFuX9UEGOhUwK1pmmo+e+D7wyBMHwEaSItSAHUfdQvlqGlrxskbAmvsNRLcFV1kAjiZ8F2He1uVDVpANpYlQQ/jmqBlKjDSYXQPCZY9/ZkOxgwJtKC1+M+/Fd9t5SIwSovmDmP0WKPt5gQD2ieyaVe3lI0mh2L1xMY5ik2iCtk+1rPf+NPsvRgWGhvIl/1vrHA3YujSARpG9/2gLhMjEeqez9q7azv1/Ekq173/tnJUsumtA2fP6Vs36fHKJgj4SlX4iPVB3oeG34IBPQLNQgtOh6bTGGAOAv4Uio5lixzLEAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-e2b739c9] .tree-file-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAJxSURBVFiF7Za/a1NRFMc/5zWFCh07ZBBF6NDBoUOhFjpchw5iCwpdHARfWiEigotTl4CjiyBSi315gRa6VByiOEjoFYQ6dHToUBBbh/wBoS0YehzeTWh+vDRJ0xahXwiEc8893+89P+598D/DLOmQWdKh08TwuibP6iz97NHPnsnq7LkKMIGmUdaAAWAAZc0Emj4XASarCwiLCImqUUggLJqsLnQaT9omzmiC67xCee5MZeCJ+78ITpDwmt+8sBkp90yAyWiCa6wBlVqXAN+mZB1cP0AIDLr1dXZ50I6IEwWYtzrIFfKAqZIrd+ycfK/xC3QS4csxEZYDZuxTKXUtwISaRMkDY85URLhtfdmO8R9B2QCSzrSFMGN9KcZxxDahWdZhF6xCvo0wEUcOYH3ZRpgAKj5jKBtmWYfj9jTNgFnWm3h8rZ5E+AHcb3WSmv2hJoGPKLecqcgRU3Zeftb7NmTA1XKzSq4U2GeqXXIA60uRfaZQCs6URNg0gU7W+9ZkwHXzCtEFE2GX/nZHqh5uev4eMx0CDyvTUyPA3WRvai4YwKakeZmyOo1wFwDls03Jpxg/rTEoZeCZnZN34EpgQh3BYxyPVYQcsNPyZFl9CeRR0ihpIG8CzbTaA+wg5PBYxWPchDoCcU0YaojyCBozYN7rVTx+1WcKpcwRN+xj+VMnNsqAkLO++PVcnT9GfYw2kEcECfoY7TRc5wKU+GlotdYrAXZOtoBvTcgLbu1sBQBwwDRKQPQolVACDrnXTajGWrYB98DMu9+p0PUnWa9wKeDCBZzYhCbQ8EIFINGVfFZoXgLlA9GM9wolF/MSl2jAP+MZ1PXRPKaQAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-e2b739c9] .el-input{height:32px}[data-v-e2b739c9] .node-text-box{display:flex;align-items:center}[data-v-e2b739c9] .node-text-box .el-radio{margin-right:5px}[data-v-e2b739c9] .node-text-box .el-radio .el-radio__label{display:none}[data-v-e2b739c9] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f0f5ff}[data-v-e2b739c9] .el-input__icon{color:#a8abb2}[data-v-e2b739c9] .el-input-group__append{position:relative}[data-v-e2b739c9] .el-input-group__append .el-icon{position:absolute;left:-24px;top:9px;z-index:2;cursor:pointer}[data-v-e2b739c9]::-webkit-scrollbar{width:5px}[data-v-e2b739c9]::-webkit-scrollbar-thumb{border-radius:3px;background:#b7c7dd}[data-v-e2b739c9]::-webkit-scrollbar-track{border-radius:3px;background:#ededed}
2
+ `,document.head.appendChild(b);const N=f=>(e.pushScopeId("data-v-e2b739c9"),f=f(),e.popScopeId(),f),v={class:"org-selector"},R={class:"org-list-box"},Z={class:"left-tree-box"},D={class:"search-box"},K=N(()=>e.createElementVNode("label",null,"单位列表",-1)),F={class:"tree-content-box"},z={class:"right-selected-list"},O=N(()=>e.createElementVNode("span",null,"已选单位",-1)),Q={class:"tree-content-box"},U=["title"],P={class:"org-name"},j={class:"selector-footer"},Y=e.defineComponent({__name:"index",props:{modelValue:{default:""},rootOrgId:{default:""},orgType:{default:""},inputText:{default:""},returnValue:{default:""},readonly:{type:Boolean,default:!0},isClear:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},buttonText:{default:"选择"},multiple:{type:Boolean,default:!0},bindEvent:{type:Boolean,default:!0},defaultText:{type:Boolean,default:!1},reqParams:{default:void 0}},emits:["onCancel","onSelect","update:modelValue","onClear"],setup(f,{emit:u}){const n=f;let m=e.useAttrs();const C=e.inject("req"),{warningMsgBox:q}=e.inject("msgBox"),G={children:"childrenList",label:"orgName"},d=e.ref(null);let c=e.ref(""),V=e.ref(!1),g=e.ref(!1),k=e.ref(!1),x=e.ref(""),h=e.ref(""),p=e.ref([]),y=e.ref([]),A=e.ref([]);e.watch(()=>n.modelValue,()=>{n.defaultText&&!k.value&&_()}),e.watch(()=>n.inputText,t=>{c.value=t});function E(){if(n.modelValue?A.value=n.modelValue.split(","):A.value=[],g.value=!0,V.value&&d.value){d.value.setCheckedKeys(A.value),p.value=d.value.getCheckedNodes();return}J()}function M(){n.bindEvent&&E()}function J(){let t={pid:n.rootOrgId,orgType:n.orgType};n.reqParams&&(t=Object.assign(t,n.reqParams)),C.post({url:getKsoRoot("/sys/org/list-by-condition"),params:t}).then(({data:o})=>{let l=X(o);l&&l.length>0&&l.forEach(a=>{a.expanded=!0}),y.value=l,d.value.setCheckedKeys(A.value),V.value=!0})}function _(){if(!n.modelValue)return;k.value=!0;let t={ids:n.modelValue};C.post({url:getKsoRoot("/sys/org/find-by-ids"),params:t}).then(({data:o})=>{if(o&&o.length>0){let l=[];o.forEach(a=>{l.push(a.orgName)}),c.value=l.join(",")}})}function X(t){return t.forEach(o=>{o.name=o.orgName,A.value.length>0&&A.value.includes(o.id)&&p.value.push(o);let l=[];t.forEach(a=>{a.pid==o.id&&l.push(a)}),o.childrenList=l}),t=t.filter(o=>o.pid==""),t}function L(t,{node:o,data:l}){l.expanded&&(o.expanded=!0);let a="tree-file-node-icon";o.childNodes&&o.childNodes.length>0&&(a="tree-folder-node-icon");let r=[];if(!n.multiple){let s="";l.id===x.value&&(s=l.id),r.push(t(e.resolveComponent("el-radio"),{modelValue:s,label:l.id,size:"large"}))}return r.push(t("i",{class:a,style:{marginRight:"5px"}})),r.push(t("span",{attrs:{title:l.name}},l.name)),t("span",{class:"node-text-box"},r)}function W(t,o){return t?o.name.indexOf(t)!==-1||o.id.indexOf(t)!==-1:!0}function H(){d.value.filter(h.value),h.value||$(y.value[0].id,!1)}function $(t,o){var l=d.value.store.nodesMap;for(let a in l)t===a?l[a].expanded=!0:l[a].expanded=o}function ee(t){n.multiple||(d.value.setCheckedNodes([t]),x.value=t.id),p.value=d.value.getCheckedNodes()}function te(t,o){p.value.splice(o,1),x.value="",d.value.setCheckedNodes(p.value)}function B(){p.value=[],x.value="",d.value&&d.value.setCheckedNodes(p.value)}function I(){g.value=!1,u("onCancel","")}function oe(){if(p.value.length==0)return q("请选择数据"),!1;let t=le(p.value);ae(t),g.value=!1,u("onSelect",t)}function le(t){let o=[];return t.forEach(l=>{let a={id:l.id,orgName:l.orgName,orgType:l.orgType,sname:l.sname,fname:l.fname,regId:l.regId,regName:l.regName,cityId:l.cityId,cityName:l.cityName};o.push(a)}),o}function ae(t){let o={};Object.keys(t[0]).forEach(a=>{o[a]=[]}),t.forEach(a=>{var r;for(let s in a)(r=o[s])==null||r.push(a[s])}),c.value=o.orgName.join(","),u("update:modelValue",o.id.join(","));let l=n.returnValue.split("|");l&&l.length>0&&l.forEach(a=>{let r=a.split(":");if(r&&r.length>1){let s=o[r[1]],w=s?s.join(","):"";m.sync[r[0]]=w}})}function S(){if(c.value="",u("update:modelValue",""),n.returnValue){let t=n.returnValue.split("|");t&&t.length>0&&t.forEach(o=>{let l=o.split(":");l&&l.length>1&&(m.sync[l[0]]="")})}B(),u("onClear","")}return e.onMounted(()=>{n.defaultText&&!k.value?_():c.value=n.inputText,n.multiple||(x.value=n.modelValue)}),(t,o)=>{const l=e.resolveComponent("CircleClose"),a=e.resolveComponent("el-icon"),r=e.resolveComponent("el-button"),s=e.resolveComponent("el-input"),w=e.resolveComponent("el-tree"),ne=e.resolveComponent("CircleCloseFilled"),re=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",v,[t.$slots.func?(e.openBlock(),e.createElementBlock("div",{key:0,class:"slot-box",onClick:M},[e.renderSlot(t.$slots,"func",{},void 0,!0)])):(e.openBlock(),e.createBlock(s,{key:1,modelValue:e.unref(c),"onUpdate:modelValue":o[0]||(o[0]=i=>e.isRef(c)?c.value=i:c=i),disabled:t.disabled,readonly:t.readonly,clearable:"",onClear:S,placeholder:""},{append:e.withCtx(()=>[e.unref(c)&&t.isClear&&t.readonly?(e.openBlock(),e.createBlock(a,{key:0,onClickCapture:S},{default:e.withCtx(()=>[e.createVNode(l)]),_:1})):e.createCommentVNode("",!0),e.createVNode(r,{type:"primary",disabled:t.disabled,onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.buttonText),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled","readonly"])),e.createVNode(re,{title:"单位选择",modelValue:e.unref(g),"onUpdate:modelValue":o[2]||(o[2]=i=>e.isRef(g)?g.value=i:g=i),onClose:I,width:1e3},{default:e.withCtx(()=>[e.createElementVNode("div",R,[e.createElementVNode("div",Z,[e.createElementVNode("div",D,[K,e.createVNode(s,{modelValue:e.unref(h),"onUpdate:modelValue":o[1]||(o[1]=i=>e.isRef(h)?h.value=i:h=i),"suffix-icon":"Search",onInput:H,placeholder:"请输入单位名称查询"},null,8,["modelValue"])]),e.createElementVNode("div",F,[e.createVNode(w,{data:e.unref(y),ref_key:"orgTree",ref:d,"node-key":"id",props:G,"expand-on-click-node":!1,"show-checkbox":t.multiple,"check-strictly":!0,"highlight-current":!0,accordion:!0,"check-on-click-node":!0,"filter-node-method":W,indent:26,onCheck:ee,"render-content":L,"icon-class":"el-icon-arrow-right"},null,8,["data","show-checkbox"])])]),e.createElementVNode("div",z,[e.createElementVNode("div",{class:"selected-box"},[O,e.createElementVNode("div",{title:"删除全部"},[e.createElementVNode("i",{onClick:B,class:"delete-btn"})])]),e.createElementVNode("div",null,[e.createElementVNode("div",Q,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),(i,T)=>(e.openBlock(),e.createElementBlock("li",{key:T+"s",title:i.orgName+"("+i.id+")"},[e.createElementVNode("span",P,e.toDisplayString(i.orgName)+"("+e.toDisplayString(i.id)+") ",1),e.createVNode(a,{onClick:ce=>te(i,T),color:"#909399",size:"16"},{default:e.withCtx(()=>[e.createVNode(ne)]),_:2},1032,["onClick"])],8,U))),128))])])])])]),e.createElementVNode("div",j,[e.createVNode(r,{onClick:I},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(r,{type:"primary",onClick:oe},{default:e.withCtx(()=>[e.createTextVNode("确认")]),_:1})])]),_:1},8,["modelValue"])])}}}),ie="";return((f,u)=>{const n=f.__vccOpts||f;for(const[m,C]of u)n[m]=C;return n})(Y,[["__scopeId","data-v-e2b739c9"]])});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kso-sel-org",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "机构选择",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -19,7 +19,7 @@
19
19
  "element-plus": "^2.3.8",
20
20
  "element-resize-detector": "^1.2.4",
21
21
  "kso-dic": "^1.0.0",
22
- "kso-sel-org": "^1.0.4",
22
+ "kso-sel-org": "^1.0.5",
23
23
  "kso-sel-reg": "^1.0.1",
24
24
  "less": "^4.1.3",
25
25
  "less-loader": "^11.1.3",
@@ -35,10 +35,13 @@
35
35
  "devDependencies": {
36
36
  "@types/node": "^20.3.3",
37
37
  "@vitejs/plugin-vue": "^4.1.0",
38
+ "css-loader": "^6.8.1",
38
39
  "sass": "^1.69.5",
39
40
  "typescript": "^5.0.2",
40
41
  "vite": "^4.3.9",
41
42
  "vite-plugin-eslint": "^1.8.1",
43
+ "vue-loader": "^17.3.1",
44
+ "vue-style-loader": "^4.1.3",
42
45
  "vue-tsc": "^1.4.2"
43
46
  },
44
47
  "keywords": [
File without changes