cnhis-design-vue 3.1.41-beta.39 → 3.1.41-beta.40
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/es/components/base-search/index.d.ts +8 -1
- package/es/components/base-search/src/index.vue.d.ts +8 -1
- package/es/components/base-search/src/index.vue.js +1 -1
- package/es/components/classification/index.d.ts +13 -31
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +1 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +1 -0
- package/es/components/classification/src/components/set-classification/index.vue.js +1 -1
- package/es/components/classification/src/index.vue.d.ts +13 -31
- package/es/components/classification/src/index.vue.js +1 -1
- package/es/components/quick-search/index.d.ts +1 -0
- package/es/components/quick-search/src/index.vue.d.ts +1 -0
- package/es/components/quick-search/src/index.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/enums.d.ts +0 -8
- package/es/components/table-filter/src/components/render-widget/enums.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/tool/transformData.d.ts +0 -37
- package/es/components/table-filter/src/tool/transformData.js +1 -1
- package/es/components/table-filter/src/types/enums.d.ts +1 -0
- package/es/components/table-filter/src/types/enums.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -55,6 +55,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
55
55
|
placeholder: string | undefined;
|
|
56
56
|
advanceColWidth: string;
|
|
57
57
|
}[];
|
|
58
|
+
transformParams: (paramsList: any) => {};
|
|
58
59
|
baseLeft: any;
|
|
59
60
|
quickSearchLi: any;
|
|
60
61
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -86,6 +87,12 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
86
87
|
classificationWidth: import("vue").Ref<number>;
|
|
87
88
|
quickSearchWidth: import("vue").Ref<number>;
|
|
88
89
|
diffWidth: import("vue").Ref<number>;
|
|
90
|
+
curConObj: import("vue").Ref<{
|
|
91
|
+
field_key: string;
|
|
92
|
+
con: string;
|
|
93
|
+
value: any;
|
|
94
|
+
unit: string | null;
|
|
95
|
+
}[]>;
|
|
89
96
|
showResetFilterBtn: import("vue").Ref<boolean>;
|
|
90
97
|
resizeFlag: import("vue").Ref<boolean>;
|
|
91
98
|
outSearchFieldList: import("vue").Ref<{
|
|
@@ -214,7 +221,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
214
221
|
outFilterChange: (config?: {}) => void;
|
|
215
222
|
getConObjParams: () => any;
|
|
216
223
|
getConObj: (arr: any) => any;
|
|
217
|
-
onFilterSearch: (obj: import("..").ISearchParamsType[], isOutFilter?: boolean, config?: {}) => void;
|
|
224
|
+
onFilterSearch: (obj: import("..").ISearchParamsType[], transResult: object, isOutFilter?: boolean, config?: {}) => void;
|
|
218
225
|
handleReset: () => void;
|
|
219
226
|
resetFunc: (arr: import("..").ISearchType[]) => void;
|
|
220
227
|
vResize: {
|
|
@@ -56,6 +56,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
56
|
placeholder: string | undefined;
|
|
57
57
|
advanceColWidth: string;
|
|
58
58
|
}[];
|
|
59
|
+
transformParams: (paramsList: any) => {};
|
|
59
60
|
baseLeft: any;
|
|
60
61
|
quickSearchLi: any;
|
|
61
62
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -87,6 +88,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
88
|
classificationWidth: import("vue").Ref<number>;
|
|
88
89
|
quickSearchWidth: import("vue").Ref<number>;
|
|
89
90
|
diffWidth: import("vue").Ref<number>;
|
|
91
|
+
curConObj: import("vue").Ref<{
|
|
92
|
+
field_key: string;
|
|
93
|
+
con: string;
|
|
94
|
+
value: any;
|
|
95
|
+
unit: string | null;
|
|
96
|
+
}[]>;
|
|
90
97
|
showResetFilterBtn: import("vue").Ref<boolean>;
|
|
91
98
|
resizeFlag: import("vue").Ref<boolean>;
|
|
92
99
|
outSearchFieldList: import("vue").Ref<{
|
|
@@ -215,7 +222,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
215
222
|
outFilterChange: (config?: {}) => void;
|
|
216
223
|
getConObjParams: () => any;
|
|
217
224
|
getConObj: (arr: any) => any;
|
|
218
|
-
onFilterSearch: (obj: ISearchParamsType[], isOutFilter?: boolean, config?: {}) => void;
|
|
225
|
+
onFilterSearch: (obj: ISearchParamsType[], transResult: object, isOutFilter?: boolean, config?: {}) => void;
|
|
219
226
|
handleReset: () => void;
|
|
220
227
|
resetFunc: (arr: ISearchType[]) => void;
|
|
221
228
|
vResize: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as l,watch as i,openBlock as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as l,watch as i,openBlock as a,createElementBlock as r,createElementVNode as n,withDirectives as u,createCommentVNode as s,renderSlot as o,unref as c,createVNode as f,withCtx as d,createTextVNode as m,toDisplayString as v,Fragment as h,renderList as p}from"vue";import b from"xe-utils";import"moment";import g from"./directive/resize.js";import y from"../../table-filter/src/components/render-widget/index.vue.js";import x from"../../table-filter/src/hooks/useMixins.js";import k from"../../table-filter/src/hooks/useAdvanced.js";import S from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as C,NIcon as j}from"naive-ui";import{Search as _}from"@vicons/ionicons5";import{cloneDeep as q}from"lodash-es";import F from"../../../_virtual/plugin-vue_export-helper.js";const R={class:"base-search-block"},O={class:"base-container"},I={class:"base-ul"},Q=n("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),V={key:1,class:"baseli"},A={key:2,class:"baseli"},L=n("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var W=F(e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0})},searchFieldList:{type:Array,default:()=>[]},classificationIndex:{type:Number},qqConObjCount:{type:Number,default:0}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{emit:F}){const W=e,{outQuickSearchFn:w}=x(),{isRender:z,getRenderSearchConObj:N,isExistDefValByRenderWidget:D,resetRenderWidgetValue:E}=S(),{transformData:P,transformParams:U}=k(),$=t(null),B=t(null),M=t(0),T=t(0),G=t(0),H=t(0),J=t([]),K=t(!1),X=t(!1),Y=t([]),Z=l((()=>{var e;return e="hideQuickSearch",0==W.showSettings[e]}));function ee(e){var t;if(X.value)return;let l=$.value;if(!l)return;X.value=!0,M.value=l.clientWidth,T.value=2===W.classificationIndex?160:0,G.value=(null==(t=B.value)?void 0:t.clientWidth)||0;let i=T.value+G.value,a=M.value-i;H.value=a,e.type&&"resize"===e.type&&function(){if(Y.value.length>0)return;X.value=!1}()}function te(){b.debounce(ee({type:"resize"}),300)}function le(){F("foldQuickSearch",!0)}function ie(e={}){const t=ae()||[];!function(e,t,l=!1,i={}){let a=[];Y.value.length>0&&(a=q(Y.value));F("onFilterSearch",e,t,l,a,i)}(t,U(t),!0,e)}function ae(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let l=0;l<e.length;l++){let i=e[l];const a=N(i);a&&t.push(a)}return t.filter((e=>e.value))}(Y.value)}function re(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{E(e)})),w.handlerInitSearchItem(e)}(Y.value),F("handleReset",{targetType:"outQuickSearchReset"})}return i((()=>W.searchFieldList),(e=>{e&&e.length>0&&function(e={}){Y.value=[];let t=q(P(W.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));Y.value=t,w.handlerInitSearchItem(Y.value),Y.value.some((e=>z(e)?D(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),i((()=>W.qqConObjCount),(e=>{const t=J.value.length||0;K.value=t+Number(e)>0}),{immediate:!0}),i((()=>Y),(()=>{J.value=ae()||[];const e=U(J.value);K.value=J.value.length+Number(W.qqConObjCount)>0,F("getFilterParam",J.value,e)}),{immediate:!0,deep:!0}),(t,l)=>(a(),r("div",R,[n("div",O,[u((a(),r("div",{class:"bease-left",ref_key:"baseLeft",ref:$},[n("ul",I,[s(" 筛选分类插槽内容 "),o(t.$slots,"classification"),c(Z)?(a(),r("li",{key:0,class:"baseli",ref_key:"quickSearchLi",ref:B},[f(c(C),{class:"search-default",type:"default",onClick:le},{default:d((()=>[Q,m(" 筛选 "+v(e.qqConObjCount?`(${e.qqConObjCount})`:""),1)])),_:1})],512)):s("v-if",!0),s(" start--筛选外显--start "),(a(!0),r(h,null,p(Y.value,(e=>(a(),r(h,null,[e.isRender?(a(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[f(y,{style:{margin:"0 8px 8px 0"},cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,onOutFilterChange:ie},null,8,["cfg","modelValue","onUpdate:modelValue"])])):s("v-if",!0)],64)))),256)),s(" end--筛选外显--end "),s(" 查询按钮 "),Y.value&&Y.value.length>0?(a(),r("li",V,[f(c(C),{type:"primary",onClick:ie,style:{margin:"0 8px 8px 0"}},{default:d((()=>[f(c(j),{component:c(_),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),m(" 查询 ")])),_:1})])):s("v-if",!0),s(" 重置按钮 "),K.value?(a(),r("li",A,[f(c(C),{onClick:re,style:{margin:"0 8px 8px 0"}},{default:d((()=>[L,m(" 重置 ")])),_:1})])):s("v-if",!0)])])),[[c(g),te]])])]))}}),[["__file","index.vue"]]);export{W as default};
|
|
@@ -14,7 +14,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
14
14
|
};
|
|
15
15
|
conditionSid: {
|
|
16
16
|
type: import("vue").PropType<string[]>;
|
|
17
|
-
default: () =>
|
|
17
|
+
default: () => string[];
|
|
18
18
|
};
|
|
19
19
|
curClassificationIndex: {
|
|
20
20
|
type: NumberConstructor;
|
|
@@ -45,7 +45,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
45
45
|
};
|
|
46
46
|
}, {
|
|
47
47
|
handleGetConfigApi: (params: any, key: string, config: {} | undefined, filterApiConfigVal: any) => Promise<any>;
|
|
48
|
+
transformClassifyChild: (conObjList: any) => {};
|
|
48
49
|
attrs: any;
|
|
50
|
+
$message: import("naive-ui").MessageApi;
|
|
49
51
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
50
52
|
tableId: {
|
|
51
53
|
type: StringConstructor;
|
|
@@ -61,7 +63,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
61
63
|
};
|
|
62
64
|
conditionSid: {
|
|
63
65
|
type: import("vue").PropType<string[]>;
|
|
64
|
-
default: () =>
|
|
66
|
+
default: () => string[];
|
|
65
67
|
};
|
|
66
68
|
curClassificationIndex: {
|
|
67
69
|
type: NumberConstructor;
|
|
@@ -103,14 +105,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
103
105
|
name: string;
|
|
104
106
|
sid?: string | undefined;
|
|
105
107
|
children: {
|
|
106
|
-
classifyId: string;
|
|
107
108
|
displayCategory: string;
|
|
108
109
|
isDefault: boolean;
|
|
109
110
|
isEdit: boolean;
|
|
110
|
-
isPublic: string;
|
|
111
111
|
isShow: boolean;
|
|
112
112
|
name: string;
|
|
113
113
|
sid: string;
|
|
114
|
+
isPublic?: string | undefined;
|
|
115
|
+
classifyId?: string | undefined;
|
|
114
116
|
conObj?: any;
|
|
115
117
|
digital?: number | undefined;
|
|
116
118
|
checked?: boolean | undefined;
|
|
@@ -126,14 +128,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
126
128
|
selected?: boolean | undefined;
|
|
127
129
|
}[]>;
|
|
128
130
|
conditionLists: import("vue").Ref<{
|
|
129
|
-
classifyId: string;
|
|
130
131
|
displayCategory: string;
|
|
131
132
|
isDefault: boolean;
|
|
132
133
|
isEdit: boolean;
|
|
133
|
-
isPublic: string;
|
|
134
134
|
isShow: boolean;
|
|
135
135
|
name: string;
|
|
136
136
|
sid: string;
|
|
137
|
+
isPublic?: string | undefined;
|
|
138
|
+
classifyId?: string | undefined;
|
|
137
139
|
conObj?: any;
|
|
138
140
|
digital?: number | undefined;
|
|
139
141
|
checked?: boolean | undefined;
|
|
@@ -145,14 +147,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
145
147
|
from?: string | undefined;
|
|
146
148
|
}[]>;
|
|
147
149
|
originConditionList: import("vue").Ref<{
|
|
148
|
-
classifyId: string;
|
|
149
150
|
displayCategory: string;
|
|
150
151
|
isDefault: boolean;
|
|
151
152
|
isEdit: boolean;
|
|
152
|
-
isPublic: string;
|
|
153
153
|
isShow: boolean;
|
|
154
154
|
name: string;
|
|
155
155
|
sid: string;
|
|
156
|
+
isPublic?: string | undefined;
|
|
157
|
+
classifyId?: string | undefined;
|
|
156
158
|
conObj?: any;
|
|
157
159
|
digital?: number | undefined;
|
|
158
160
|
checked?: boolean | undefined;
|
|
@@ -164,27 +166,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
164
166
|
from?: string | undefined;
|
|
165
167
|
}[]>;
|
|
166
168
|
classificationIndex: import("vue").Ref<number>;
|
|
167
|
-
curTableId: import("vue").Ref<string>;
|
|
168
169
|
allObj: any;
|
|
169
|
-
searchConditionList: import("vue").Ref<{
|
|
170
|
-
classifyId: string;
|
|
171
|
-
displayCategory: string;
|
|
172
|
-
isDefault: boolean;
|
|
173
|
-
isEdit: boolean;
|
|
174
|
-
isPublic: string;
|
|
175
|
-
isShow: boolean;
|
|
176
|
-
name: string;
|
|
177
|
-
sid: string;
|
|
178
|
-
conObj?: any;
|
|
179
|
-
digital?: number | undefined;
|
|
180
|
-
checked?: boolean | undefined;
|
|
181
|
-
id?: string | undefined;
|
|
182
|
-
isCommon?: boolean | undefined;
|
|
183
|
-
selected?: boolean | undefined;
|
|
184
|
-
sqlExpression?: string | undefined;
|
|
185
|
-
createdByName?: string | undefined;
|
|
186
|
-
from?: string | undefined;
|
|
187
|
-
}[]>;
|
|
188
170
|
displayCategoryLists: import("vue").Ref<string[]>;
|
|
189
171
|
settingId: import("vue").Ref<string>;
|
|
190
172
|
classifyModal: import("vue").Ref<boolean>;
|
|
@@ -210,9 +192,8 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
210
192
|
handleSettingShow: () => void;
|
|
211
193
|
setClassifyModal: (val: boolean) => void;
|
|
212
194
|
toggleSelect: (flag?: boolean | undefined) => void;
|
|
213
|
-
|
|
195
|
+
initTableCondiTionList: (options?: any) => import("naive-ui").MessageReactive | undefined;
|
|
214
196
|
setOpenStatus: (value: boolean) => void;
|
|
215
|
-
handlePlatTree: (list: import("..").ITreeDataType[], res: import("..").IClassifyListType[]) => void;
|
|
216
197
|
tableCondiTionPromise: (options?: any) => Promise<void>;
|
|
217
198
|
changeWidth: ({ distance }: any) => void;
|
|
218
199
|
saveWidth: () => void;
|
|
@@ -784,6 +765,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
784
765
|
SELECT: string;
|
|
785
766
|
DATE: string;
|
|
786
767
|
DATE_TIME: string;
|
|
768
|
+
CHECKBOX_GROUP: string;
|
|
787
769
|
};
|
|
788
770
|
WidgetValEnums: {
|
|
789
771
|
CUSTOM: string;
|
|
@@ -965,7 +947,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
965
947
|
};
|
|
966
948
|
conditionSid: {
|
|
967
949
|
type: import("vue").PropType<string[]>;
|
|
968
|
-
default: () =>
|
|
950
|
+
default: () => string[];
|
|
969
951
|
};
|
|
970
952
|
curClassificationIndex: {
|
|
971
953
|
type: NumberConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as i,useAttrs as t,computed as n,watch as o,openBlock as a,createElementBlock as l,createVNode as s,mergeProps as r,unref as c,withCtx as d,createTextVNode as f}from"vue";import{useMessage as u,NButton as p}from"naive-ui";import v from"../table-modal/index.vue.js";import g from"../search-filter/index.vue.js";import C from"../../../../table-filter/src/hooks/useMixins.js";import y from"../../../../../_virtual/plugin-vue_export-helper.js";const m={class:"search"};var b=y(e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},conditionList:{type:Array,default:()=>[]},settingId:String,filterApiConfig:{type:Object,default:()=>({})},classifyModal:{type:Boolean,default:!1}},emits:["CondiTionListInit","saveGetTableCondiTionList","setClassifyModal"],setup(e,{emit:y}){const b=e,h=u(),{handleGetConfigApi:A}=C();let L=i(b.conditionList),I=i(),T=i(!1),S=i({}),_=i([]),j=i(!1);const O=i(null),x=t();async function F(e){try{let i=Object.assign(e,{id:b.settingId,tableId:x.tableId});await A(i,"requestSaveTableCondiTionSetting",{},b.filterApiConfig)&&(y("CondiTionListInit"),H(!1))}catch(e){console.log(e)}}function k(){H(!1),L.value.forEach((e=>{e.checked=!1}))}function w(){T.value=!0}function G(e,i){T.value=!0,S.value=Object.assign(e,{from:"edit"})}function M(e,i){T.value=!0,S.value=Object.assign(e,{from:"copy"})}async function q(e){try{if(Object.assign(e,{tableId:x.tableId,conditionList:JSON.stringify(L.value)}),j.value=!0,!await A(e,"requestSaveTableCondiTion",{},b.filterApiConfig))return;O&&O.value.cancelSaveAdd(),y("saveGetTableCondiTionList"),T.value=!1}catch(e){console.log(e)}finally{j.value=!1}}function R(){T.value=!1,S.value={}}function D(e,i){L.value=e,I.value=i}async function E(e,i){if(e)try{let i={id:e.sid};if(!await A(i,"requestDeleteTableCondiTion",{},b.filterApiConfig))return;h.success("删除成功"),y("saveGetTableCondiTionList",{type:"delete",item:e})}catch(e){console.log(e)}else h.info("请选择行")}function H(e){y("setClassifyModal",e)}async function K(){try{let e={id:b.settingId,tableId:x.tableId,type:"SEARCH_CATEGORY"};await A(e,"requestResetDefaultSetting",{},b.filterApiConfig)&&(y("CondiTionListInit"),H(!1))}catch(e){console.log(e)}}let N=n((()=>b.classifyModal));return o((()=>x.searchKey),(()=>{x.selectKeys=[x.searchKey||"all"]})),o((()=>b.searchFieldList),(e=>{e&&e.length>0&&(_.value=e.filter((e=>"operatorColumn"!==e.columnName)))}),{immediate:!0,deep:!0}),o((()=>T),(e=>{e||(S.value={})})),(i,t)=>(a(),l("div",m,[s(v,r({dataSource:c(L),visibleIn:c(N)},i.$attrs,{onHandleOk:F,onClose:k,onChangeData:D,onResetPopconfirm:K,edit:G,copy:M,delItem:E,type:"search",filterApiConfig:e.filterApiConfig}),{add:d((()=>[s(c(p),{type:"info",onClick:w},{default:d((()=>[f("新增")])),_:1})])),_:1},16,["dataSource","visibleIn","filterApiConfig"]),s(g,r({ref_key:"searchFilter",ref:O},i.$attrs,{visible:c(T),loading:c(j),conditionList:c(L),actionList_prop:c(S),searchFieldList:c(_),isInSearch:!0,isCnHis:!0,showCompareField:!0,filterApiConfig:e.filterApiConfig,onSaveAdd:q,onCancelSaveAdd:R}),null,16,["visible","loading","conditionList","actionList_prop","searchFieldList","filterApiConfig"])]))}}),[["__file","index.vue"]]);export{b as default};
|
|
1
|
+
import{defineComponent as e,ref as i,useAttrs as t,computed as n,watch as o,openBlock as a,createElementBlock as l,createVNode as s,mergeProps as r,unref as c,withCtx as d,createTextVNode as f}from"vue";import{useMessage as u,NButton as p}from"naive-ui";import v from"../table-modal/index.vue.js";import g from"../search-filter/index.vue.js";import C from"../../../../table-filter/src/hooks/useMixins.js";import y from"../../../../../_virtual/plugin-vue_export-helper.js";const m={class:"search"};var b=y(e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},conditionList:{type:Array,default:()=>[]},settingId:String,filterApiConfig:{type:Object,default:()=>({})},classifyModal:{type:Boolean,default:!1}},emits:["CondiTionListInit","saveGetTableCondiTionList","setClassifyModal"],setup(e,{emit:y}){const b=e,h=u(),{handleGetConfigApi:A}=C();let L=i(b.conditionList),I=i(),T=i(!1),S=i({}),_=i([]),j=i(!1);const O=i(null),x=t();async function F(e){try{let i=Object.assign(e,{id:b.settingId,tableId:x.tableId});await A(i,"requestSaveTableCondiTionSetting",{},b.filterApiConfig)&&(y("CondiTionListInit"),H(!1))}catch(e){console.log(e)}}function k(){H(!1),L.value.forEach((e=>{e.checked=!1}))}function w(){T.value=!0}function G(e,i){T.value=!0,S.value=Object.assign(e,{from:"edit"})}function M(e,i){T.value=!0,S.value=Object.assign(e,{from:"copy"})}async function q(e){try{if(Object.assign(e,{tableId:x.tableId,conditionList:JSON.stringify(L.value)}),j.value=!0,!await A(e,"requestSaveTableCondiTion",{},b.filterApiConfig))return;O&&O.value.cancelSaveAdd(),y("saveGetTableCondiTionList"),T.value=!1}catch(e){console.log(e)}finally{j.value=!1}}function R(){T.value=!1,S.value={}}function D(e,i){L.value=e,I.value=i}async function E(e,i){if(e)try{let i={id:e.sid};if(!await A(i,"requestDeleteTableCondiTion",{},b.filterApiConfig))return;h.success("删除成功"),y("saveGetTableCondiTionList",{type:"delete",item:e})}catch(e){console.log(e)}else h.info("请选择行")}function H(e){y("setClassifyModal",e)}async function K(){try{let e={id:b.settingId,tableId:x.tableId,type:"SEARCH_CATEGORY"};await A(e,"requestResetDefaultSetting",{},b.filterApiConfig)&&(y("CondiTionListInit"),H(!1))}catch(e){console.log(e)}}let N=n((()=>b.classifyModal));return o((()=>x.searchKey),(()=>{x.selectKeys=[x.searchKey||"all"]})),o((()=>b.searchFieldList),(e=>{e&&e.length>0&&(_.value=e.filter((e=>"operatorColumn"!==e.columnName)))}),{immediate:!0,deep:!0}),o((()=>b.conditionList),(e=>{L.value=e}),{immediate:!0,deep:!0}),o((()=>T),(e=>{e||(S.value={})})),(i,t)=>(a(),l("div",m,[s(v,r({dataSource:c(L),visibleIn:c(N)},i.$attrs,{onHandleOk:F,onClose:k,onChangeData:D,onResetPopconfirm:K,edit:G,copy:M,delItem:E,type:"search",filterApiConfig:e.filterApiConfig}),{add:d((()=>[s(c(p),{type:"info",onClick:w},{default:d((()=>[f("新增")])),_:1})])),_:1},16,["dataSource","visibleIn","filterApiConfig"]),s(g,r({ref_key:"searchFilter",ref:O},i.$attrs,{visible:c(T),loading:c(j),conditionList:c(L),actionList_prop:c(S),searchFieldList:c(_),isInSearch:!0,isCnHis:!0,showCompareField:!0,filterApiConfig:e.filterApiConfig,onSaveAdd:q,onCancelSaveAdd:R}),null,16,["visible","loading","conditionList","actionList_prop","searchFieldList","filterApiConfig"])]))}}),[["__file","index.vue"]]);export{b as default};
|
|
@@ -15,7 +15,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
};
|
|
16
16
|
conditionSid: {
|
|
17
17
|
type: PropType<string[]>;
|
|
18
|
-
default: () =>
|
|
18
|
+
default: () => string[];
|
|
19
19
|
};
|
|
20
20
|
curClassificationIndex: {
|
|
21
21
|
type: NumberConstructor;
|
|
@@ -46,7 +46,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
46
|
};
|
|
47
47
|
}, {
|
|
48
48
|
handleGetConfigApi: (params: any, key: string, config: {} | undefined, filterApiConfigVal: any) => Promise<any>;
|
|
49
|
+
transformClassifyChild: (conObjList: any) => {};
|
|
49
50
|
attrs: any;
|
|
51
|
+
$message: import("naive-ui").MessageApi;
|
|
50
52
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
51
53
|
tableId: {
|
|
52
54
|
type: StringConstructor;
|
|
@@ -62,7 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
64
|
};
|
|
63
65
|
conditionSid: {
|
|
64
66
|
type: PropType<string[]>;
|
|
65
|
-
default: () =>
|
|
67
|
+
default: () => string[];
|
|
66
68
|
};
|
|
67
69
|
curClassificationIndex: {
|
|
68
70
|
type: NumberConstructor;
|
|
@@ -104,14 +106,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
104
106
|
name: string;
|
|
105
107
|
sid?: string | undefined;
|
|
106
108
|
children: {
|
|
107
|
-
classifyId: string;
|
|
108
109
|
displayCategory: string;
|
|
109
110
|
isDefault: boolean;
|
|
110
111
|
isEdit: boolean;
|
|
111
|
-
isPublic: string;
|
|
112
112
|
isShow: boolean;
|
|
113
113
|
name: string;
|
|
114
114
|
sid: string;
|
|
115
|
+
isPublic?: string | undefined;
|
|
116
|
+
classifyId?: string | undefined;
|
|
115
117
|
conObj?: any;
|
|
116
118
|
digital?: number | undefined;
|
|
117
119
|
checked?: boolean | undefined;
|
|
@@ -127,14 +129,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
127
129
|
selected?: boolean | undefined;
|
|
128
130
|
}[]>;
|
|
129
131
|
conditionLists: import("vue").Ref<{
|
|
130
|
-
classifyId: string;
|
|
131
132
|
displayCategory: string;
|
|
132
133
|
isDefault: boolean;
|
|
133
134
|
isEdit: boolean;
|
|
134
|
-
isPublic: string;
|
|
135
135
|
isShow: boolean;
|
|
136
136
|
name: string;
|
|
137
137
|
sid: string;
|
|
138
|
+
isPublic?: string | undefined;
|
|
139
|
+
classifyId?: string | undefined;
|
|
138
140
|
conObj?: any;
|
|
139
141
|
digital?: number | undefined;
|
|
140
142
|
checked?: boolean | undefined;
|
|
@@ -146,14 +148,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
146
148
|
from?: string | undefined;
|
|
147
149
|
}[]>;
|
|
148
150
|
originConditionList: import("vue").Ref<{
|
|
149
|
-
classifyId: string;
|
|
150
151
|
displayCategory: string;
|
|
151
152
|
isDefault: boolean;
|
|
152
153
|
isEdit: boolean;
|
|
153
|
-
isPublic: string;
|
|
154
154
|
isShow: boolean;
|
|
155
155
|
name: string;
|
|
156
156
|
sid: string;
|
|
157
|
+
isPublic?: string | undefined;
|
|
158
|
+
classifyId?: string | undefined;
|
|
157
159
|
conObj?: any;
|
|
158
160
|
digital?: number | undefined;
|
|
159
161
|
checked?: boolean | undefined;
|
|
@@ -165,27 +167,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
165
167
|
from?: string | undefined;
|
|
166
168
|
}[]>;
|
|
167
169
|
classificationIndex: import("vue").Ref<number>;
|
|
168
|
-
curTableId: import("vue").Ref<string>;
|
|
169
170
|
allObj: any;
|
|
170
|
-
searchConditionList: import("vue").Ref<{
|
|
171
|
-
classifyId: string;
|
|
172
|
-
displayCategory: string;
|
|
173
|
-
isDefault: boolean;
|
|
174
|
-
isEdit: boolean;
|
|
175
|
-
isPublic: string;
|
|
176
|
-
isShow: boolean;
|
|
177
|
-
name: string;
|
|
178
|
-
sid: string;
|
|
179
|
-
conObj?: any;
|
|
180
|
-
digital?: number | undefined;
|
|
181
|
-
checked?: boolean | undefined;
|
|
182
|
-
id?: string | undefined;
|
|
183
|
-
isCommon?: boolean | undefined;
|
|
184
|
-
selected?: boolean | undefined;
|
|
185
|
-
sqlExpression?: string | undefined;
|
|
186
|
-
createdByName?: string | undefined;
|
|
187
|
-
from?: string | undefined;
|
|
188
|
-
}[]>;
|
|
189
171
|
displayCategoryLists: import("vue").Ref<string[]>;
|
|
190
172
|
settingId: import("vue").Ref<string>;
|
|
191
173
|
classifyModal: import("vue").Ref<boolean>;
|
|
@@ -211,9 +193,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
211
193
|
handleSettingShow: () => void;
|
|
212
194
|
setClassifyModal: (val: boolean) => void;
|
|
213
195
|
toggleSelect: (flag?: boolean) => void;
|
|
214
|
-
|
|
196
|
+
initTableCondiTionList: (options?: any) => import("naive-ui").MessageReactive | undefined;
|
|
215
197
|
setOpenStatus: (value: boolean) => void;
|
|
216
|
-
handlePlatTree: (list: ITreeDataType[], res: IClassifyListType[]) => void;
|
|
217
198
|
tableCondiTionPromise: (options?: any) => Promise<void>;
|
|
218
199
|
changeWidth: ({ distance }: any) => void;
|
|
219
200
|
saveWidth: () => void;
|
|
@@ -785,6 +766,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
785
766
|
SELECT: string;
|
|
786
767
|
DATE: string;
|
|
787
768
|
DATE_TIME: string;
|
|
769
|
+
CHECKBOX_GROUP: string;
|
|
788
770
|
};
|
|
789
771
|
WidgetValEnums: {
|
|
790
772
|
CUSTOM: string;
|
|
@@ -966,7 +948,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
966
948
|
};
|
|
967
949
|
conditionSid: {
|
|
968
950
|
type: PropType<string[]>;
|
|
969
|
-
default: () =>
|
|
951
|
+
default: () => string[];
|
|
970
952
|
};
|
|
971
953
|
curClassificationIndex: {
|
|
972
954
|
type: NumberConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as i,ref as n,provide as l,computed as t,onActivated as a,onBeforeMount as o,onMounted as s,nextTick as d,watch as c,openBlock as r,createElementBlock as h,normalizeClass as u,unref as f,normalizeStyle as p,withDirectives as g,createVNode as m,createTextVNode as v,toDisplayString as C,createCommentVNode as y,createElementVNode as k,Fragment as S,renderList as b,createBlock as x,withCtx as _}from"vue";import{NIcon as O,NTooltip as w}from"naive-ui";import{Repeat as I,SettingsOutline as L,ChevronDown as z,ChevronForward as j,Checkmark as B,Close as N,ChevronUp as P}from"@vicons/ionicons5";import M from"./components/set-classification/index.vue.js";import A from"./directive/flexibleResize.js";import{root_isShowResetButton as E}from"./const/index.js";import J from"../../table-filter/src/hooks/useMixins.js";import T from"../../../_virtual/plugin-vue_export-helper.js";const R={key:0,class:"header"},F={class:"tree"},W=["onClick"],q=["onClick"],G=["onClick"],Q={class:"child-item-name"},$={key:1,class:"tree-type-footer"},D={class:"selected-num"},V=k("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),H={key:0,class:"tile-type classify-1"},K={key:0,class:"header"},U={class:"right-setting"},X=["onClick"],Y={class:"parent ellips"},Z={class:"children"},ee=["onClick"],ie={key:1,class:"selected-list"},ne={class:"selected-num"},le=k("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),te={class:"name"},ae={class:"name"},oe={key:0,class:"main-wrapper"},se=["onClick"],de={class:"tree-footer"},ce=["onClick"],re=["onClick"],he={key:0,class:"select-type-footer"},ue={class:"selected-num"},fe=k("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1);var pe=T(e({__name:"index",props:{tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},conditionMap:{type:Object,default:()=>{}},conditionSid:{type:Array,default:()=>[]},curClassificationIndex:{type:Number,default:0},curClassificationWidth:{type:Number},hideConditionChangeBtn:{type:Number,default:0},hideConditionChangeSetting:{type:Number,default:0},hideClearConditionChange:{type:Number,default:1},isShowResetButton:{type:Boolean,default:!0},filterApiConfig:{type:Object,default:()=>({})}},emits:["changeSearch","setClassificationIndex","getQuickSearchListObj"],setup(e,{emit:T}){const pe=e,{handleGetConfigApi:ge}=J(),me=i(),ve=n(null);let Ce=n(150),ye=n(!1),ke=n([]),Se=n([]),be=n([]),xe=n(2),_e=n(""),Oe=n({name:"全部数据",sid:"all_data"}),we=n([]),Ie=n([]),Le=n(""),ze=n(!1),je=n("全部数据");l(E,n(pe.isShowResetButton));let Be=t((()=>0===xe.value?{marginRight:"8px"}:2===xe.value?{display:"inline-block"}:{})),Ne=t((()=>{let e=Se.value.filter((e=>-1!==pe.conditionSid.indexOf(e.sid)));if(-1!==pe.conditionSid.indexOf("all_data"))return"全部数据";{let i=[];return e.map((e=>{i.push(e.name)})),i.join(",")}})),Pe=t((()=>function(e){let i=0===e.digital?"(0)":e.digital?`(${e.digital})`:"";const{name:n,isPublic:l}=e;return Ue(n,l)+i}));function Me(e){e.open?e.open=!1:e.open=!0}function Ae(e,i,n){je.value=e.name;let l=function(e){let i=[];return ke.value.forEach((n=>{n.children?n.children.forEach((n=>{-1!==e.indexOf(n.sid)?(n.selected=!0,i.push(n)):n.selected=!1})):-1!==e.indexOf(n.sid)?(n.selected=!0,i.push(n)):n.selected=!1})),i}(function(e,i,n){let l=JSON.parse(JSON.stringify(i));l="all_data"===e||-1!==l.indexOf(e)?["all_data"]:[e];return l}(e.sid,pe.conditionSid));Fe(!1),T("changeSearch",Boolean("all_data"===e.sid),e,n,l)}function Ee(){let e="";if(2===xe.value)e=0;else{let i=xe.value;e=++i}Ce.value=150,Je(e)}async function Je(e,i){let n={tableId:pe.tableId,setting:JSON.stringify({classificationIndex:e,classificationWidth:i})};try{await ge(n,"requestSaveListPersonaSetting",{},pe.filterApiConfig)&&T("setClassificationIndex",e)}catch(e){console.log(e)}}function Te(){ze.value=!0,Fe(!1)}function Re(e){ze.value=e}function Fe(e){ye.value=void 0===e?!ye.value:e}function We(e){var i;if((void 0!==e&&"delete"===e.type&&-1!==pe.conditionSid.indexOf(e.item.sid)&&T("changeSearch",!0,{name:"全部数据",sid:"all_data",selected:!0}),pe.tableId)&&Object.keys(pe.conditionMap).length>0){ke.value=[];let{displayCategoryList:e=[],conditionList:n=[]}=pe.conditionMap;be.value=JSON.parse(JSON.stringify(n)),Ie.value=e||[],Se.value=JSON.parse(JSON.stringify(n));const l={name:"全部数据",sid:"all_data"};Se.value.unshift(l);let t=[];0===e.length&&(e=["未分类"]),e.forEach((e=>{let i={name:e,children:[]};n.forEach((n=>{(n.displayCategory===e||!n.displayCategory&&"未分类"===e&&"all_data"!==n.sid)&&(-1!==pe.conditionSid.indexOf(n.sid)&&(n.selected=!0,i.open=!0),n.isShow&&i.children.push(n))})),i.children.length>0&&t.push(i)})),t.unshift({name:"全部数据",sid:"all_data"}),ke.value=t,0===xe.value&&(i=!0,ke.value.forEach((e=>{e.children&&e.children.length&&(e.open=i)})))}}async function qe(e){try{await We(e)}catch(e){console.log(e)}}function Ge({distance:e}){const i=Ce.value+e;Ce.value=Math.min(Math.max(i,50),650)}function Qe(){Je(xe.value,Ce.value)}async function $e(){await Ke(pe.tableId),Ve()}async function De(e){await Ke(pe.tableId),He()}function Ve(e){He(e).then((e=>{}))}function He(e,i={}){if(!pe.tableId)return new Promise((e=>e(!1)));let n=Object.keys(i).length>0?i:pe.conditionMap;return new Promise(((i,l)=>{var t,a,o,s,d,c;if(Object.keys(n).length>0){we.value=n.conditionList||[],Ie.value=n.displayCategoryList||[];let l={conditionList:we.value,displayCategoryList:Ie.value};T("getQuickSearchListObj",l),Le.value=n.settingId;const r=we.value.find((e=>e.isDefault))||{name:"全部数据",sid:"all_data"};(null==(a=null==(t=me.tableOptions)?void 0:t.filterCondition)?void 0:a.displayCategory)&&e&&i({name:null==(s=null==(o=me.tableOptions)?void 0:o.filterCondition)?void 0:s.name,sid:null==(c=null==(d=me.tableOptions)?void 0:d.filterCondition)?void 0:c.displayCategory}),i(r)}else i({})}))}async function Ke(e){try{if(!e)return new Promise((e=>e(!1)));let i={tableId:e},n=await ge(i,"requestTableCondiTionList",{},pe.filterApiConfig);return Promise.resolve(n)}catch(e){return Promise.resolve(!1)}}function Ue(e,i){return e&&"1"===i?e.replace(/\(公共\)$/,""):e}return a((()=>{qe({})})),o((()=>{qe({})})),s((()=>{document.addEventListener("click",(e=>{d((()=>{let i=e.composedPath&&e.composedPath();ve&&i.includes(ve.value)||Fe(!1)}))}))})),c((()=>pe.tableId),(e=>{e&&(Ve(!0),_e.value!==e&&(_e.value=e))}),{immediate:!0,deep:!0}),c((()=>pe.curClassificationIndex),(e=>{void 0!==e&&(xe.value=e)}),{immediate:!0,deep:!0}),c((()=>pe.curClassificationWidth),(e=>{e&&(Ce.value=Number(e)||150)}),{immediate:!0}),(i,n)=>(r(),h("div",{class:u(["classification-block","classificationIndex-"+f(xe)]),style:p(f(Be))},[0===f(xe)?g((r(),h("div",{key:0,class:"tree-type classify-0",style:p({width:f(Ce)+"px",paddingBottom:1!=e.hideClearConditionChange?"80px":0,position:"relative"})},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(r(),h("div",R,[1!=e.hideConditionChangeBtn?(r(),h("span",{key:0,class:"header-1",onClick:Ee},[m(f(O),{component:f(I),size:"16"},null,8,["component"]),v(" "+C("切换"))])):y("v-if",!0),1!=e.hideConditionChangeSetting?(r(),h("span",{key:1,class:"header-1",onClick:Te},[m(f(O),{component:f(L),size:"16"},null,8,["component"]),v(" "+C("设置"))])):y("v-if",!0)])):y("v-if",!0),k("ul",F,[(r(!0),h(S,null,b(f(ke),((i,n)=>(r(),h(S,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(r(),h("li",{key:n,class:u(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(r(),h(S,{key:1},[k("span",{class:u(["parent",{open:i.open}]),onClick:e=>Me(i)},[k("span",null,C(i.name),1),m(f(O),{component:i.open?f(z):f(j)},null,8,["component"])],10,q),i.open?(r(!0),h(S,{key:0},b(i.children.filter((e=>e.isShow)),((e,n)=>(r(),h("div",{class:"children",key:n},[e.isShow?(r(),x(f(w),{key:0,trigger:"hover",placement:"right"},{trigger:_((()=>[k("span",{class:u(["child-item",{selected:e.selected}]),onClick:n=>Ae(e,0,i)},[k("span",Q,C(e.name||Ue(e.isPublic)),1),e.selected?(r(),x(f(O),{key:0,component:f(B),size:"20"},null,8,["component"])):y("v-if",!0)],10,G)])),default:_((()=>[k("span",null,C(f(Pe)(e)),1)])),_:2},1024)):y("v-if",!0)])))),128)):y("v-if",!0)],64)):(r(),h("span",{key:0,class:u(["child-item header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},C(i.name),11,W))],2)):y("v-if",!0)],64)))),256))]),1!=e.hideClearConditionChange?(r(),h("div",$,[k("div",D,"已选择"+C(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),k("div",{class:"selected-item-del",onClick:n[0]||(n[0]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[V,v(" 清空筛选 ")])])):y("v-if",!0)],4)),[[f(A),{mode:"VR",onMove:Ge,onEnd:Qe}]]):y("v-if",!0),1===f(xe)?(r(),h(S,{key:1},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting||1!=e.hideConditionChangeSetting||f(be).filter((e=>e.isShow)).length>0?(r(),h("div",H,[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(r(),h("div",K,[k("span",{class:u(["all-data",{selected:-1!==e.conditionSid.indexOf("all_data")}]),onClick:n[1]||(n[1]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[v(" 全部数据 "),f(Oe).digital||0===f(Oe).digital?(r(),h(S,{key:0},[v(" ("+C(f(Oe).digital||0)+") ",1)],64)):y("v-if",!0)],2),k("div",U,[1!=e.hideConditionChangeBtn?(r(),h("span",{key:0,class:"setting-1",onClick:Ee,style:{"margin-right":"30px"}},[m(f(O),{component:f(I),size:"16"},null,8,["component"]),v(" "+C("切换"))])):y("v-if",!0),1!=e.hideConditionChangeSetting?(r(),h("span",{key:1,class:"setting-1",onClick:Te},[m(f(O),{component:f(L),size:"16"},null,8,["component"]),v(" "+C("设置"))])):y("v-if",!0)])])):y("v-if",!0),k("ul",{class:"tile",style:p({borderBottom:1!=e.hideClearConditionChange?"1px solid #d5d5d5":0})},[(r(!0),h(S,null,b(f(ke).slice(1),((e,i)=>(r(),h(S,null,[e.children&&e.children.length>0?(r(),h("li",{class:"tile-item",key:i},[e.children&&0!==e.children.length?(r(),h(S,{key:1},[k("span",Y,C(e.name),1),k("div",Z,[(r(!0),h(S,null,b(e.children,((i,n)=>(r(),h(S,null,[i.isShow?(r(),h("span",{key:n,class:u(["child-item",{selected:i.selected}]),onClick:n=>Ae(i,0,e)},C(i.name||Ue(i.isPublic)),11,ee)):y("v-if",!0)],64)))),256))])],64)):(r(),h("span",{key:0,class:u(["child-item",{selected:e.selected}]),style:{"padding-left":"17px"},onClick:i=>Ae(e)},C(e.name)+" "+C(e.digital),11,X))])):y("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(r(),h("div",ie,[k("div",ne,"已选择"+C(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),(r(!0),h(S,null,b(f(ke).slice(1),((e,i)=>(r(),h(S,null,[e.children&&0!==e.children.length?(r(!0),h(S,{key:1},b(e.children,((i,n)=>(r(),h(S,null,[i.selected?(r(),h("div",{class:"selected-item",key:i.sid},[v(C(i.name)+" ",1),m(f(O),{component:f(N),onClick:n=>Ae(i,0,e)},null,8,["component","onClick"])])):y("v-if",!0)],64)))),256)):(r(),h("div",{class:"selected-item",key:e.sid},[v(C(e.name)+" ",1),m(f(O),{component:f(N),onClick:i=>Ae(e)},null,8,["component","onClick"])]))],64)))),256)),k("div",{class:"selected-item-del",onClick:n[2]||(n[2]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[le,v(" 清空筛选 ")])])):y("v-if",!0)])):y("v-if",!0)],64)):y("v-if",!0),2===f(xe)?(r(),h("div",{key:2,class:"select-type classify-2",ref_key:"selectType",ref:ve},[k("span",{class:"title",onClick:n[3]||(n[3]=()=>Fe())},[m(f(w),{trigger:"hover",placement:"top"},{trigger:_((()=>[k("span",te,C(f(Ne)),1)])),default:_((()=>[k("span",ae,C(f(Ne)),1)])),_:1}),m(f(O),{component:f(ye)?f(P):f(z)},null,8,["component"])]),f(ye)?(r(),h("div",oe,[k("ul",{class:"tree",style:p({padding:1!=e.hideClearConditionChange?"40px 0":"40px 0 0"})},[(r(!0),h(S,null,b(f(ke),((i,n)=>(r(),h(S,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(r(),h("li",{key:n,class:u(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(r(),h(S,{key:1},[0!==i.children.filter((e=>e.isShow)).length?(r(),h("span",{key:0,class:u(["parent",{open:i.open}]),onClick:e=>Me(i)},[v(C(i.name)+C(i.digital||0===i.digital?"("+i.digital+")":"")+" ",1),m(f(O),{component:i.open?f(z):f(j)},null,8,["component"])],10,ce)):y("v-if",!0),i.open?(r(!0),h(S,{key:1},b(i.children.filter((e=>e.isShow)),((e,n)=>(r(),h("div",{class:"children",key:n},[e.isShow?(r(),x(f(w),{key:0,placement:"right",trigger:"hover","z-index":1e4},{trigger:_((()=>[k("span",{class:u(["child-item",{selected:e.selected}]),onClick:n=>Ae(e,0,i)},[k("span",null,C(e.name||Ue(null==e?void 0:e.isPublic)),1),e.selected?(r(),x(f(O),{key:0,component:f(B),size:"20"},null,8,["component"])):y("v-if",!0)],10,re)])),default:_((()=>[k("span",null,C(f(Pe)(e)),1)])),_:2},1024)):y("v-if",!0)])))),128)):y("v-if",!0)],64)):(r(),h(S,{key:0},[k("span",{class:u(["child-item child-header header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},C(i.name),11,se),k("div",de,[1!=e.hideConditionChangeBtn?(r(),h("span",{key:0,class:"tree-footer-icon",onClick:Ee},[m(f(O),{component:f(I),size:"16"},null,8,["component"]),v(" "+C("切换"))])):y("v-if",!0),1!=e.hideConditionChangeSetting?(r(),h("span",{key:1,class:"tree-footer-icon",onClick:Te},[m(f(O),{component:f(L),size:"16"},null,8,["component"]),v(" "+C("设置"))])):y("v-if",!0)])],64))],2)):y("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(r(),h("div",he,[k("div",ue,"已选择"+C(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),k("div",{class:"selected-item-del",onClick:n[4]||(n[4]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[fe,v(" 清空筛选 ")])])):y("v-if",!0)])):y("v-if",!0)],512)):y("v-if",!0),y(" 弹出弹窗 "),m(M,{ref:"search",searchFieldList:e.searchFieldList,conditionList:f(we),displayCategoryList:f(Ie),settingId:f(Le),tableId:e.tableId,classifyModal:f(ze),filterApiConfig:e.filterApiConfig,onSaveGetTableCondiTionList:De,onCondiTionListInit:$e,onSetClassifyModal:Re},null,8,["searchFieldList","conditionList","displayCategoryList","settingId","tableId","classifyModal","filterApiConfig"])],6))}}),[["__file","index.vue"]]);export{pe as default};
|
|
1
|
+
import{defineComponent as e,useAttrs as i,ref as n,provide as l,computed as t,onMounted as a,nextTick as o,watch as s,openBlock as d,createElementBlock as c,normalizeClass as r,unref as h,normalizeStyle as u,withDirectives as f,createVNode as p,createTextVNode as g,toDisplayString as m,createCommentVNode as v,createElementVNode as C,Fragment as y,renderList as k,createBlock as S,withCtx as b}from"vue";import{useMessage as x,NIcon as O,NTooltip as _}from"naive-ui";import{Repeat as w,SettingsOutline as I,ChevronDown as L,ChevronForward as N,Checkmark as z,Close as j,ChevronUp as B}from"@vicons/ionicons5";import M from"./components/set-classification/index.vue.js";import P from"./directive/flexibleResize.js";import{root_isShowResetButton as J}from"./const/index.js";import A from"../../table-filter/src/hooks/useMixins.js";import E from"../../table-filter/src/hooks/useAdvanced.js";import T from"../../../_virtual/plugin-vue_export-helper.js";const R={key:0,class:"header"},F={class:"tree"},W=["onClick"],q=["onClick"],G=["onClick"],Q={class:"child-item-name"},$={key:1,class:"tree-type-footer"},D={class:"selected-num"},V=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),H={key:0,class:"tile-type classify-1"},K={key:0,class:"header"},U={class:"right-setting"},X=["onClick"],Y={class:"parent ellips"},Z={class:"children"},ee=["onClick"],ie={key:1,class:"selected-list"},ne={class:"selected-num"},le=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),te={class:"name"},ae={class:"name"},oe={key:0,class:"main-wrapper"},se=["onClick"],de={class:"tree-footer"},ce=["onClick"],re=["onClick"],he={key:0,class:"select-type-footer"},ue={class:"selected-num"},fe=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1);var pe=T(e({__name:"index",props:{tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},conditionMap:{type:Object,default:()=>{}},conditionSid:{type:Array,default:()=>["all_data"]},curClassificationIndex:{type:Number,default:0},curClassificationWidth:{type:Number},hideConditionChangeBtn:{type:Number,default:0},hideConditionChangeSetting:{type:Number,default:0},hideClearConditionChange:{type:Number,default:1},isShowResetButton:{type:Boolean,default:!0},filterApiConfig:{type:Object,default:()=>({})}},emits:["changeSearch","setClassificationIndex","getQuickSearchListObj"],setup(e,{emit:T}){const pe=e,{handleGetConfigApi:ge}=A(),{transformClassifyChild:me}=E(),ve=i(),Ce=x(),ye=n(null);let ke=n(150),Se=n(!1),be=n([]),xe=n([]),Oe=n([]),_e=n(2),we=n({name:"全部数据",sid:"all_data"}),Ie=n([]),Le=n(""),Ne=n(!1),ze=n("全部数据");l(J,n(pe.isShowResetButton));let je=t((()=>0===_e.value?{marginRight:"8px"}:2===_e.value?{display:"inline-block"}:{})),Be=t((()=>{let e=xe.value.filter((e=>-1!==pe.conditionSid.indexOf(e.sid)));if(-1!==pe.conditionSid.indexOf("all_data"))return"全部数据";{let i=[];return e.map((e=>{i.push(e.name)})),i.join(",")}})),Me=t((()=>function(e){let i=0===e.digital?"(0)":e.digital?`(${e.digital})`:"";const{name:n,isPublic:l}=e;return Ke(n,l)+i}));function Pe(e){e.open?e.open=!1:e.open=!0}function Je(e,i,n){ze.value=e.name;let l=function(e){let i=[];return be.value.forEach((n=>{n.children?n.children.forEach((n=>{-1!==e.indexOf(n.sid)?(n.selected=!0,i.push(n)):n.selected=!1})):-1!==e.indexOf(n.sid)?(n.selected=!0,i.push(n)):n.selected=!1})),i}(function(e,i,n){let l=JSON.parse(JSON.stringify(i));l="all_data"===e||-1!==l.indexOf(e)?["all_data"]:[e];return l}(e.sid,pe.conditionSid));Fe(!1);const t=me(null==e?void 0:e.conObj);T("changeSearch",Boolean("all_data"===e.sid),e,t,n,l)}function Ae(){let e="";if(2===_e.value)e=0;else{let i=_e.value;e=++i}ke.value=150,Ee(e)}async function Ee(e,i){let n={tableId:pe.tableId,setting:JSON.stringify({classificationIndex:e,classificationWidth:i})};try{await ge(n,"requestSaveListPersonaSetting",{},pe.filterApiConfig)&&T("setClassificationIndex",e)}catch(e){console.log(e)}}function Te(){Ne.value=!0,Fe(!1)}function Re(e){Ne.value=e}function Fe(e){Se.value=void 0===e?!Se.value:e}function We(e){const i={name:"全部数据",sid:"all_data"};if(!pe.tableId)return Ce.warning("请传入tableId");if(Object.keys(pe.conditionMap).length>0){be.value=[];let{displayCategoryList:e=[],conditionList:l=[]}=pe.conditionMap;Ie.value=JSON.parse(JSON.stringify(e))||[],Oe.value=JSON.parse(JSON.stringify(l)),xe.value=JSON.parse(JSON.stringify([i,...l]));let t=[];0===Ie.value.length&&(Ie.value=["未分类"]),Ie.value.forEach((e=>{let i={name:e,children:[]};xe.value.forEach((n=>{(n.displayCategory===e||!n.displayCategory&&"未分类"===e&&"all_data"!==n.sid)&&(-1!==pe.conditionSid.indexOf(n.sid)&&(n.selected=!0,i.open=!0),n.isShow&&i.children.push(n))})),i.children.length>0&&t.push(i)})),t.unshift({name:"全部数据",sid:"all_data"}),be.value=t,0===_e.value&&(n=!0,be.value.forEach((e=>{e.children&&e.children.length&&(e.open=n)})))}var n}function qe({distance:e}){const i=ke.value+e;ke.value=Math.min(Math.max(i,50),650)}function Ge(){Ee(_e.value,ke.value)}async function Qe(){await He(pe.tableId),De()}async function $e(e){await He(pe.tableId),Ve()}function De(e){Ve(e).then((e=>{}))}function Ve(e,i={}){if(!pe.tableId)return new Promise((e=>e(!1)));let n=Object.keys(i).length>0?i:JSON.parse(JSON.stringify(pe.conditionMap));return new Promise(((i,l)=>{var t,a,o,s,d,c;if(Object.keys(n).length>0){Oe.value=n.conditionList||[],Ie.value=n.displayCategoryList||[];let l={conditionList:Oe.value,displayCategoryList:Ie.value};T("getQuickSearchListObj",l),Le.value=n.settingId;const r=Oe.value.find((e=>e.isDefault))||{name:"全部数据",sid:"all_data"};(null==(a=null==(t=ve.tableOptions)?void 0:t.filterCondition)?void 0:a.displayCategory)&&e&&i({name:null==(s=null==(o=ve.tableOptions)?void 0:o.filterCondition)?void 0:s.name,sid:null==(c=null==(d=ve.tableOptions)?void 0:d.filterCondition)?void 0:c.displayCategory}),i(r)}else i({})}))}async function He(e){try{if(!e)return new Promise((e=>e(!1)));let i={tableId:e},n=await ge(i,"requestTableCondiTionList",{},pe.filterApiConfig);return Promise.resolve(n)}catch(e){return Promise.resolve(!1)}}function Ke(e,i){return e&&"1"===i?e.replace(/\(公共\)$/,""):e}return a((()=>{document.addEventListener("click",(e=>{o((()=>{let i=e.composedPath&&e.composedPath();ye&&i.includes(ye.value)||Fe(!1)}))}))})),s((()=>pe.tableId),(e=>{e&&De(!0)}),{immediate:!0,deep:!0}),s((()=>pe.curClassificationIndex),(e=>{void 0!==e&&(_e.value=e)}),{immediate:!0,deep:!0}),s((()=>pe.curClassificationWidth),(e=>{e&&(ke.value=Number(e)||150)}),{immediate:!0}),s((()=>pe.conditionMap),(e=>{!async function(e){try{await We()}catch(e){console.log(e)}}()}),{immediate:!0,deep:!0}),(i,n)=>(d(),c("div",{class:r(["classification-block","classificationIndex-"+h(_e)]),style:u(h(je))},[0===h(_e)?f((d(),c("div",{key:0,class:"tree-type classify-0",style:u({width:h(ke)+"px",paddingBottom:1!=e.hideClearConditionChange?"80px":0,position:"relative"})},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(d(),c("div",R,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"header-1",onClick:Ae},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),g(" "+m("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"header-1",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),g(" "+m("设置"))])):v("v-if",!0)])):v("v-if",!0),C("ul",F,[(d(!0),c(y,null,k(h(be),((i,n)=>(d(),c(y,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(d(),c("li",{key:n,class:r(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(d(),c(y,{key:1},[C("span",{class:r(["parent",{open:i.open}]),onClick:e=>Pe(i)},[C("span",null,m(i.name),1),p(h(O),{component:i.open?h(L):h(N)},null,8,["component"])],10,q),i.open?(d(!0),c(y,{key:0},k(i.children.filter((e=>e.isShow)),((e,n)=>(d(),c("div",{class:"children",key:n},[e.isShow?(d(),S(h(_),{key:0,trigger:"hover",placement:"right"},{trigger:b((()=>[C("span",{class:r(["child-item",{selected:e.selected}]),onClick:n=>Je(e,0,i)},[C("span",Q,m(e.name||Ke(e.isPublic)),1),e.selected?(d(),S(h(O),{key:0,component:h(z),size:"20"},null,8,["component"])):v("v-if",!0)],10,G)])),default:b((()=>[C("span",null,m(h(Me)(e)),1)])),_:2},1024)):v("v-if",!0)])))),128)):v("v-if",!0)],64)):(d(),c("span",{key:0,class:r(["child-item header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Je(i)},m(i.name),11,W))],2)):v("v-if",!0)],64)))),256))]),1!=e.hideClearConditionChange?(d(),c("div",$,[C("div",D,"已选择"+m(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),C("div",{class:"selected-item-del",onClick:n[0]||(n[0]=e=>Je({sid:"all_data",name:"全部数据",digital:h(we).digital}))},[V,g(" 清空筛选 ")])])):v("v-if",!0)],4)),[[h(P),{mode:"VR",onMove:qe,onEnd:Ge}]]):v("v-if",!0),1===h(_e)?(d(),c(y,{key:1},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting||1!=e.hideConditionChangeSetting||h(Oe).filter((e=>e.isShow)).length>0?(d(),c("div",H,[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(d(),c("div",K,[C("span",{class:r(["all-data",{selected:-1!==e.conditionSid.indexOf("all_data")}]),onClick:n[1]||(n[1]=e=>Je({sid:"all_data",name:"全部数据",digital:h(we).digital}))},[g(" 全部数据 "),h(we).digital||0===h(we).digital?(d(),c(y,{key:0},[g(" ("+m(h(we).digital||0)+") ",1)],64)):v("v-if",!0)],2),C("div",U,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"setting-1",onClick:Ae,style:{"margin-right":"30px"}},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),g(" "+m("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"setting-1",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),g(" "+m("设置"))])):v("v-if",!0)])])):v("v-if",!0),C("ul",{class:"tile",style:u({borderBottom:1!=e.hideClearConditionChange?"1px solid #d5d5d5":0})},[(d(!0),c(y,null,k(h(be).slice(1),((e,i)=>(d(),c(y,null,[e.children&&e.children.length>0?(d(),c("li",{class:"tile-item",key:i},[e.children&&0!==e.children.length?(d(),c(y,{key:1},[C("span",Y,m(e.name),1),C("div",Z,[(d(!0),c(y,null,k(e.children,((i,n)=>(d(),c(y,null,[i.isShow?(d(),c("span",{key:n,class:r(["child-item",{selected:i.selected}]),onClick:n=>Je(i,0,e)},m(i.name||Ke(i.isPublic)),11,ee)):v("v-if",!0)],64)))),256))])],64)):(d(),c("span",{key:0,class:r(["child-item",{selected:e.selected}]),style:{"padding-left":"17px"},onClick:i=>Je(e)},m(e.name)+" "+m(e.digital),11,X))])):v("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(d(),c("div",ie,[C("div",ne,"已选择"+m(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),(d(!0),c(y,null,k(h(be).slice(1),((e,i)=>(d(),c(y,null,[e.children&&0!==e.children.length?(d(!0),c(y,{key:1},k(e.children,((i,n)=>(d(),c(y,null,[i.selected?(d(),c("div",{class:"selected-item",key:i.sid},[g(m(i.name)+" ",1),p(h(O),{component:h(j),onClick:n=>Je(i,0,e)},null,8,["component","onClick"])])):v("v-if",!0)],64)))),256)):(d(),c("div",{class:"selected-item",key:e.sid},[g(m(e.name)+" ",1),p(h(O),{component:h(j),onClick:i=>Je(e)},null,8,["component","onClick"])]))],64)))),256)),C("div",{class:"selected-item-del",onClick:n[2]||(n[2]=e=>Je({sid:"all_data",name:"全部数据",digital:h(we).digital}))},[le,g(" 清空筛选 ")])])):v("v-if",!0)])):v("v-if",!0)],64)):v("v-if",!0),2===h(_e)?(d(),c("div",{key:2,class:"select-type classify-2",ref_key:"selectType",ref:ye},[C("span",{class:"title",onClick:n[3]||(n[3]=()=>Fe())},[p(h(_),{trigger:"hover",placement:"top"},{trigger:b((()=>[C("span",te,m(h(Be)),1)])),default:b((()=>[C("span",ae,m(h(Be)),1)])),_:1}),p(h(O),{component:h(Se)?h(B):h(L)},null,8,["component"])]),h(Se)?(d(),c("div",oe,[C("ul",{class:"tree",style:u({padding:1!=e.hideClearConditionChange?"40px 0":"40px 0 0"})},[(d(!0),c(y,null,k(h(be),((i,n)=>(d(),c(y,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(d(),c("li",{key:n,class:r(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(d(),c(y,{key:1},[0!==i.children.filter((e=>e.isShow)).length?(d(),c("span",{key:0,class:r(["parent",{open:i.open}]),onClick:e=>Pe(i)},[g(m(i.name)+m(i.digital||0===i.digital?"("+i.digital+")":"")+" ",1),p(h(O),{component:i.open?h(L):h(N)},null,8,["component"])],10,ce)):v("v-if",!0),i.open?(d(!0),c(y,{key:1},k(i.children.filter((e=>e.isShow)),((e,n)=>(d(),c("div",{class:"children",key:n},[e.isShow?(d(),S(h(_),{key:0,placement:"right",trigger:"hover","z-index":1e4},{trigger:b((()=>[C("span",{class:r(["child-item",{selected:e.selected}]),onClick:n=>Je(e,0,i)},[C("span",null,m(e.name||Ke(null==e?void 0:e.isPublic)),1),e.selected?(d(),S(h(O),{key:0,component:h(z),size:"20"},null,8,["component"])):v("v-if",!0)],10,re)])),default:b((()=>[C("span",null,m(h(Me)(e)),1)])),_:2},1024)):v("v-if",!0)])))),128)):v("v-if",!0)],64)):(d(),c(y,{key:0},[C("span",{class:r(["child-item child-header header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Je(i)},m(i.name),11,se),C("div",de,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"tree-footer-icon",onClick:Ae},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),g(" "+m("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"tree-footer-icon",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),g(" "+m("设置"))])):v("v-if",!0)])],64))],2)):v("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(d(),c("div",he,[C("div",ue,"已选择"+m(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),C("div",{class:"selected-item-del",onClick:n[4]||(n[4]=e=>Je({sid:"all_data",name:"全部数据",digital:h(we).digital}))},[fe,g(" 清空筛选 ")])])):v("v-if",!0)])):v("v-if",!0)],512)):v("v-if",!0),v(" 弹出弹窗 "),p(M,{ref:"search",searchFieldList:e.searchFieldList,conditionList:h(Oe),displayCategoryList:h(Ie),settingId:h(Le),tableId:e.tableId,classifyModal:h(Ne),filterApiConfig:e.filterApiConfig,onSaveGetTableCondiTionList:$e,onCondiTionListInit:Qe,onSetClassifyModal:Re},null,8,["searchFieldList","conditionList","displayCategoryList","settingId","tableId","classifyModal","filterApiConfig"])],6))}}),[["__file","index.vue"]]);export{pe as default};
|
|
@@ -63,6 +63,7 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
63
63
|
advanceColWidth: string;
|
|
64
64
|
}[];
|
|
65
65
|
getCacheDef: (item: import("..").ISearchType, cacheList: string[]) => string | string[];
|
|
66
|
+
transformParams: (paramsList: any) => {};
|
|
66
67
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
67
68
|
searchFieldList: {
|
|
68
69
|
type: import("vue").PropType<import("..").IApiServerType[]>;
|
|
@@ -65,6 +65,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
65
|
advanceColWidth: string;
|
|
66
66
|
}[];
|
|
67
67
|
getCacheDef: (item: ISearchType, cacheList: string[]) => string | string[];
|
|
68
|
+
transformParams: (paramsList: any) => {};
|
|
68
69
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
69
70
|
searchFieldList: {
|
|
70
71
|
type: PropType<IApiServerType[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as a,watch as t,onMounted as i,openBlock as n,createElementBlock as o,createElementVNode as s,Fragment as r,renderList as u,unref as c,normalizeClass as d,createCommentVNode as v,toDisplayString as f,createBlock as m,createVNode as p,withCtx as h,createTextVNode as g,withDirectives as k,vShow as b,isRef as y}from"vue";import{useMessage as C,NModal as S,NCard as _,NIcon as x,NButton as q,NForm as A,NFormItem as w,NInput as F}from"naive-ui";import{CloseOutline as j,AddOutline as I}from"@vicons/ionicons5";import R from"../../table-filter/src/hooks/useMixins.js";import V from"../../table-filter/src/hooks/useRenderWidget.js";import D from"../../table-filter/src/hooks/useAdvanced.js";import E from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as L}from"lodash-es";import U from"../../../_virtual/plugin-vue_export-helper.js";const z={class:"quick-search-block quick-search-table"},B={class:"quick-row"},T={class:"quick-item-title"},N={class:"quick-item-col"},O={class:"svg-wrap"},P={class:"flex_right"},Q={class:"class-filter-content"},W={class:"quickSearch-content"},M=s("span",{class:"label"},"父类名称:",-1),G=["onDblclick","onClick"],J={key:0,class:"s-content"};var H=U(e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:U,emit:H}){const K=e,X={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},Y=C(),{handleGetConfigApi:Z,outQuickSearchFn:$}=R(),{getDefValByRenderWidget:ee,getRenderSearchConObj:le,resetRenderWidgetValue:ae,isRender:te}=V(),{transformData:ie,getCacheDef:ne}=D(),
|
|
1
|
+
import{defineComponent as e,ref as l,computed as a,watch as t,onMounted as i,openBlock as n,createElementBlock as o,createElementVNode as s,Fragment as r,renderList as u,unref as c,normalizeClass as d,createCommentVNode as v,toDisplayString as f,createBlock as m,createVNode as p,withCtx as h,createTextVNode as g,withDirectives as k,vShow as b,isRef as y}from"vue";import{useMessage as C,NModal as S,NCard as _,NIcon as x,NButton as q,NForm as A,NFormItem as w,NInput as F}from"naive-ui";import{CloseOutline as j,AddOutline as I}from"@vicons/ionicons5";import R from"../../table-filter/src/hooks/useMixins.js";import V from"../../table-filter/src/hooks/useRenderWidget.js";import D from"../../table-filter/src/hooks/useAdvanced.js";import E from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as L}from"lodash-es";import U from"../../../_virtual/plugin-vue_export-helper.js";const z={class:"quick-search-block quick-search-table"},B={class:"quick-row"},T={class:"quick-item-title"},N={class:"quick-item-col"},O={class:"svg-wrap"},P={class:"flex_right"},Q={class:"class-filter-content"},W={class:"quickSearch-content"},M=s("span",{class:"label"},"父类名称:",-1),G=["onDblclick","onClick"],J={key:0,class:"s-content"};var H=U(e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:U,emit:H}){const K=e,X={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},Y=C(),{handleGetConfigApi:Z,outQuickSearchFn:$}=R(),{getDefValByRenderWidget:ee,getRenderSearchConObj:le,resetRenderWidgetValue:ae,isRender:te}=V(),{transformData:ie,getCacheDef:ne,transformParams:oe}=D(),se=l(null),re=l({classname:""});let ue=l(!1),ce=l([]),de=l([]),ve=l(!1),fe=l(""),me=a((()=>!!de.value.length&&de.value.some((e=>e.isAdd)))),pe=a((()=>(e,l="name")=>e.alias||e[l]));function he(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let a=0;a<e.length;a++){let t=e[a];const i=le(t);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ce.value)||[]}function ge(){var e;null==(e=se.value)||e.validate((e=>{var l;if(e)return;let a=he();a.length||(a=[]);let t=null==(l=de.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await Z(e,"requestSaveTableCondiTion",{},K.filterApiConfig))return;ue.value=!1,null==(l=se.value)||l.restoreValidation(),re.value.classname="",de.value=[],Se()}catch(e){console.log(e)}}({tableId:K.tableId||"",setting:JSON.stringify({displayCategory:t,name:re.value.classname,conObj:a}),conditionList:"[]"})}))}function ke(e){var l;const a=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{a&&a.focus()})),ve.value=!0}function be(){ve.value=!1,fe.value&&(de.value.forEach((e=>e.selected=!1)),de.value.push({disabled:!0,value:fe.value,selected:!0,isAdd:!0}),fe.value="")}function ye(e,l){!function(e,l){de.value.splice(e,1)}(e)}function Ce(){ue.value=!1}function Se(){_e(ce.value),H("clearQuickSearchConfig")}function _e(e){Array.isArray(e)&&(e.forEach((e=>{ae(e)})),$.handlerInitSearchItem(ce.value))}return t((()=>K.searchFieldList),(e=>{e&&e.length>0&&function(){let e=L(ie(K.searchFieldList)).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ce.value=e||[],$.handlerInitSearchItem(ce.value)}()}),{immediate:!0,deep:!0}),t((()=>ce),(()=>{const e=he()||[],l=oe(e);H("getFilterParam",e,l)}),{deep:!0}),i((()=>{const e=K.quickSearchConfig;if(e&&e.length>0)return l=e,void ce.value.forEach(((e,a)=>{var t;if(te(e)){const a=l.find((l=>l.field_key===e.columnName));a&&(null==(t=a.value)?void 0:t.length)>0&&(e.value=ne(e,a.value))}}));var l;_e(ce.value)})),U({openSaveToCalss:function(){let e=he();e&&(e.length>0?ue.value=!0:Y.warning("请设置搜索条件"))},clearData:Se,onFilterSearch:function(){let e=he()||[];const l=oe(e);return H("onFilterSearch",e,l,!1),ce.value}}),(e,l)=>(n(),o("div",null,[s("div",z,[(n(!0),o(r,null,u(c(ce),(e=>(n(),o("div",{class:d(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[s("div",B,[v(" title "),s("div",T,[s("span",null,f(c(pe)(e,"title"))+" ",1)]),v(" content "),s("div",N,[v(" 直接渲染组件 "),e.isRender?(n(),m(E,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l},null,8,["cfg","modelValue","onUpdate:modelValue"])):v("v-if",!0)])])],2)))),128))]),v(" 保存到分类的弹窗 "),p(c(S),{show:c(ue),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:ge,onNegativeClick:Ce,class:"classification-modal-block"},{default:h((()=>[p(c(_),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":h((()=>[s("div",O,[p(c(x),{component:c(j),size:"24",onClick:Ce},null,8,["component"])])])),footer:h((()=>[s("div",P,[p(c(q),{onClick:Ce},{default:h((()=>[g("取消")])),_:1}),p(c(q),{type:"info",onClick:ge},{default:h((()=>[g("确认")])),_:1})])])),default:h((()=>[s("div",Q,[p(c(A),{ref_key:"formRef",ref:se,"label-placement":"left",rules:X,model:re.value},{default:h((()=>[p(c(w),{label:"筛选集名称",path:"classname"},{default:h((()=>[p(c(F),{value:re.value.classname,"onUpdate:value":l[0]||(l[0]=e=>re.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),s("div",W,[M,(n(!0),o(r,null,u(c(de),((e,l)=>(n(),o("div",{class:d(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:a=>function(e,l){e.disabled&&(de.value.forEach(((e,a)=>{a!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(n(),o("div",J,[s("span",null,f(e.value),1)])):(n(),m(c(F),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),p(c(x),{component:c(j),class:"anticon-close",size:"20",onClick:e=>ye(l)},null,8,["component","onClick"])],42,G)))),128)),c(me)?v("v-if",!0):(n(),o(r,{key:0},[k(p(c(q),{dashed:"",icon:"plus",class:"ant-btn",onClick:ke},{default:h((()=>[p(c(x),{component:c(I),size:"20"},null,8,["component"]),g("添加分类 ")])),_:1},512),[[b,!c(ve)]]),k(p(c(F),{style:{width:"100px"},class:"edit-tag",value:c(fe),"onUpdate:value":l[1]||(l[1]=e=>y(fe)?fe.value=e:fe=e),valueModifiers:{trim:!0},onBlur:be,maxLength:10},null,8,["value"]),[[b,c(ve)]])],64))])])])),_:1})])),_:1},8,["show"])]))}}),[["__file","index.vue"]]);export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as l,openBlock as a,createElementBlock as t,unref as u,createBlock as
|
|
1
|
+
import{defineComponent as e,computed as l,openBlock as a,createElementBlock as t,unref as u,createBlock as o,isRef as r,createCommentVNode as p,Fragment as n,createVNode as v}from"vue";import{NInputNumber as i,NInput as m,NSelect as s,NDatePicker as f}from"naive-ui";import{WidgetTypeEnums as d,WidgetValEnums as y,WidgetOptionEnums as g}from"../../types/enums.js";import{generateDefOptionsInApi as T}from"../../tool/generateDefOptions.js";import c from"../../../../../_virtual/plugin-vue_export-helper.js";const C={class:"value-cfg_wrapper"};var U=c(e({__name:"ValueCfg",props:{paramCfg:{type:Object,default:null},modelValue:{type:[String,Number,Array],default:null},presetVal:{type:String,default:null}},emits:["update:modelValue","update:presetVal"],setup(e,{emit:c}){const U=e,E=l({set(e){c("update:modelValue",e)},get:()=>U.modelValue}),V=l({set(e){c("update:presetVal",e)},get:()=>U.presetVal}),_=l((()=>{var e;return null==(e=U.paramCfg)?void 0:e.type})),b=l((()=>{var e;return null==(e=U.paramCfg)?void 0:e.optionSetting})),M=l((()=>{var e;return null==(e=U.paramCfg)?void 0:e.mappingConfig})),x=l((()=>{const e=T(_.value,M.value).slice(0);return _.value!==d.DATE&&_.value!==d.DATE_TIME||e.unshift({label:"自定义输入",value:y.CUSTOM}),e}));return(e,l)=>(a(),t("div",C,[u(_)===u(d).INPUT_NUMBER?(a(),o(u(i),{key:0,class:"form-item",value:u(E),"onUpdate:value":l[0]||(l[0]=e=>r(E)?E.value=e:null)},null,8,["value"])):p("v-if",!0),u(_)===u(d).INPUT?(a(),o(u(m),{key:1,value:u(E),"onUpdate:value":l[1]||(l[1]=e=>r(E)?E.value=e:null),maxlength:"255",clearable:""},null,8,["value"])):p("v-if",!0),u(_)===u(d).SELECT?(a(),o(u(s),{key:2,style:{width:"120px"},class:"form-item",value:u(E),"onUpdate:value":l[2]||(l[2]=e=>r(E)?E.value=e:null),to:"body",filterable:"",options:u(x),multiple:u(b)===u(g).MULTIPLE,maxTagCount:1},null,8,["value","options","multiple"])):p("v-if",!0),u(_)===u(d).DATE||u(_)===u(d).DATE_TIME?(a(),t(n,{key:3},[v(u(s),{style:{width:"120px"},class:"form-item",to:"body",value:u(V),"onUpdate:value":l[3]||(l[3]=e=>r(V)?V.value=e:null),options:u(x)},null,8,["value","options"]),u(V)===u(y).CUSTOM?(a(),o(u(f),{key:0,class:"form-item",type:u(_).toLowerCase(),format:"yyyy-MM-dd HH:mm:ss","formatted-value":u(E),"onUpdate:formatted-value":l[4]||(l[4]=e=>r(E)?E.value=e:null),to:"body"},null,8,["type","formatted-value"])):p("v-if",!0)],64)):p("v-if",!0)]))}}),[["__file","ValueCfg.vue"]]);export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as a,reactive as
|
|
1
|
+
import{defineComponent as e,useAttrs as a,reactive as t,ref as l,toRef as i,openBlock as o,createElementBlock as n,createVNode as s,unref as d,withCtx as r,createElementVNode as p,createCommentVNode as c,Fragment as u,renderList as y,normalizeClass as m,toDisplayString as v,createBlock as f,withDirectives as g,createTextVNode as C,vShow as h}from"vue";import{useMessage as k,NSpin as b,NInput as A,NIcon as L,NButton as _,NSelect as w,NTooltip as U}from"naive-ui";import{CloseOutline as N,AddOutline as x,AddCircleSharp as V}from"@vicons/ionicons5";import D from"./ValueCfg.vue.js";import{DataTypeEnums as B,ConditionEnums as I}from"../../types/enums.js";import{useDisplayCategory as j}from"./hooks/useDisplayCategory.js";import{useFilterConditions as S}from"./hooks/useFilterConditions.js";import{conditionOptions as F}from"./helpers/options.js";import z from"../../../../../_virtual/plugin-vue_export-helper.js";const O={class:"searchConditionByApi_wrapper"},P={class:"class-filter-content"},q={key:0,class:"item-name"},E=p("span",{class:"label"},"筛选分类名称:",-1),R={key:1,class:"quickSearch-content"},J=p("span",{class:"label"},"父类名称:",-1),K=["onDblclick","onClick"],M={key:0,class:"s-content"},Q={key:2,class:"item-name"},G=p("span",{class:"label"}," 过滤条件: ",-1),H=p("span",null,"添加",-1),T={class:"select-item-list"},W={class:"index-span"},X=["onClick"];var Y=z(e({__name:"index",props:{actionList_prop:{type:Object,default:()=>({})},conditionList:{type:Array,default:()=>[]},tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},showItemName:{type:Boolean,default:!0},hideAddBtn:{type:Boolean,default:!1}},emits:["saveAdd","cancelSaveAdd"],setup(e,{expose:z,emit:Y}){const Z=e,$=k(),ee=a(),ae=t({className:"",displayCategory:"",filterConditions:[]}),te=l(!1),{State:le,isEnableAddDisplayCategory:ie,editDisplayCategory:oe,handleDisplayCategorySelect:ne,handleDisplayCategoryRemove:se,handleDisplayCategoryAdd:de,handlerBlur:re,initDisplayCategories:pe}=j(i(ae,"displayCategory"),{conditionList:Z.conditionList},$),{State:ce,paramOptions:ue,addFilterCondition:ye,delFilterCondition:me,updateKey:ve,updateCondition:fe,getParamCfg:ge,initFilterConditions:Ce,getRawFilterConditions:he}=S(i(ae,"filterConditions"),Z.searchFieldList,B.API);function ke(){ae.className="",ae.displayCategory="",ae.filterConditions=[]}async function be(){var e;try{if(ke(),te.value=!0,pe(ee.displayCategoryList,Z.actionList_prop.displayCategory||"custom"),Z.actionList_prop){ae.className=Z.actionList_prop.name,await Ce(Z.tableId,null!=(e=Z.actionList_prop.conObj)?e:[]);ae.filterConditions.length<1&&ue.value&&ue.value.length>0&&ye()}}finally{te.value=!1}}return be(),z({handleInitConditions:be,saveAdd:function(){new Promise((e=>{ae.className||!Z.showItemName?0!==ae.filterConditions.length?ae.filterConditions.some((({key:e,condition:a,value:t,presetVal:l})=>!e||!a||a===I.EQUAL&&!t&&!l))?$.warning("请补充完整条件内容"):e(!0):$.warning("请至少添加一个条件"):$.warning("请输入分类名称")})).then((()=>{let e;var a;"edit"===Z.actionList_prop.from&&(a=Z.actionList_prop.displayCategory,e=null==Z?void 0:Z.conditionList.find((e=>e.displayCategory===a)));const t={displayCategory:ae.displayCategory,name:ae.className||"",conObj:he()},l={id:e?e.sid:"",tableId:Z.tableId,setting:JSON.stringify(t)};Y("saveAdd",l,!1)}))},cancelSaveAdd:function(){ke(),Y("cancelSaveAdd")},addAction:ye,checkActionList:function(){return ae.filterConditions.every((e=>!e.field_key))}}),(a,t)=>(o(),n("div",O,[s(d(b),{show:te.value},{default:r((()=>[p("div",P,[e.showItemName?(o(),n("div",q,[E,s(d(A),{value:ae.className,"onUpdate:value":t[0]||(t[0]=e=>ae.className=e),placeholder:"请输入分类名称",style:{width:"250px"},maxlength:"10"},null,8,["value"])])):c("v-if",!0),e.showItemName?(o(),n("div",R,[J,(o(!0),n(u,null,y(d(le).displayCategories,((e,a)=>(o(),n("div",{class:m(["edit-tag",{"edit-tag-select":e.value===ae.displayCategory&&e.disabled}]),key:a,onDblclick:a=>d(oe)(a,e),onClick:a=>function(e){ne(e)}(e)},[e.disabled?(o(),n("div",M,[p("span",null,v(e.value),1)])):(o(),f(d(A),{key:1,style:{width:"100px"},disabled:e.disabled,onBlur:()=>e.disabled=!0,value:e.value,"onUpdate:value":a=>e.value=a,maxlength:10},null,8,["disabled","onBlur","value","onUpdate:value"])),s(d(L),{component:d(N),class:"anticon-close",size:"20",onClick:t=>d(se)(a,e)},null,8,["component","onClick"])],42,K)))),128)),d(ie)?(o(),n(u,{key:0},[g(s(d(_),{class:"ant-btn",icon:"plus",dashed:"",onClick:d(de)},{default:r((()=>[s(d(L),{component:d(x),size:"20"},null,8,["component"]),C(" "+v("添加父类"))])),_:1},8,["onClick"]),[[h,!d(le).showAdd]]),g(s(d(A),{class:"edit-tag",value:d(le).addDisplayCategory,"onUpdate:value":t[1]||(t[1]=e=>d(le).addDisplayCategory=e),valueModifiers:{trim:!0},style:{width:"100px"},onBlur:d(re),maxLength:10},null,8,["value","onBlur"]),[[h,d(le).showAdd]])],64)):c("v-if",!0)])):c("v-if",!0),e.hideAddBtn?c("v-if",!0):(o(),n("div",Q,[G,p("span",{class:"addAction",onClick:t[2]||(t[2]=(...e)=>d(ye)&&d(ye)(...e)),style:{cursor:"pointer"}},[s(d(L),{component:d(V),class:"blue",size:"18"},null,8,["component"]),H])])),p("ul",T,[(o(!0),n(u,null,y(ae.filterConditions,((e,a)=>(o(),n("li",{key:a},[p("span",W,v(a+1)+" ",1),c(" 选择 field_key "),s(d(w),{class:"form-item",placeholder:"请选择",value:e.key,to:"body",filterable:"",options:d(ue),"onUpdate:value":e=>d(ve)(a,e)},null,8,["value","options","onUpdate:value"]),c(" 选择 关系 "),e.key?(o(),f(d(w),{key:0,class:"form-item",placeholder:"请选择",value:e.condition,to:"body",filterable:"",options:d(F),"onUpdate:value":e=>d(fe)(a,e)},null,8,["value","options","onUpdate:value"])):c("v-if",!0),c(" 自定义 "),e.key&&e.condition&&e.condition!==d(I).NULL?(o(),f(D,{key:1,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a,presetVal:e.presetVal,"onUpdate:presetVal":a=>e.presetVal=a,"param-cfg":d(ge)(e.key)},null,8,["modelValue","onUpdate:modelValue","presetVal","onUpdate:presetVal","param-cfg"])):c("v-if",!0),s(d(U),{title:"删除",trigger:"hover"},{trigger:r((()=>[p("i",{onClick:e=>d(me)(a),class:"iconfont-table-filter delete-item-icon icon-table-filter-menzhenyishengzhananniuqingchu"},null,8,X)])),default:r((()=>[C(" 删除 ")])),_:2},1024)])))),128))])])])),_:1},8,["show"])]))}}),[["__file","index.vue"]]);export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const T={
|
|
1
|
+
const T={CUSTOM:"CUSTOM",NOW:"NOW",TODAY:"TODAY",TODAY_START:"TODAY_START",TODAY_END:"TODAY_END",TOMORROW:"TOMORROW",TOMORROW_START:"TOMORROW_START",TOMORROW_END:"TOMORROW_END",YESTERDAY:"YESTERDAY",YESTERDAY_START:"YESTERDAY_START",YESTERDAY_END:"YESTERDAY_END",WEEK_START:"THIS_WEEK_START",WEEK_END:"THIS_WEEK_END",MONTH_START:"THIS_MONTH_START",MONTH_END:"THIS_MONTH_END"};export{T as DatePresetValEnums};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,h as t}from"vue";import{WidgetTypeEnums as i}from"
|
|
1
|
+
import{defineComponent as e,h as t}from"vue";import{WidgetTypeEnums as i}from"../../types/enums.js";import{WidgetCfgMaps as r,formatItemData as a}from"./widgetCfgMaps.js";import l from"moment";import s from"../../../../../_virtual/plugin-vue_export-helper.js";const n=[i.DATE,i.DATE_TIME,i.CHECKBOX_GROUP];var o=s(e({props:{cfg:{type:Object,required:!0},modelValue:{type:[Array,String,Number]}},emits:["update:modelValue","outFilterChange"],computed:{valueCp(){const{widgetType:e}=this.cfg;return[i.DATE,i.DATE_TIME].includes(e)?this.cfg.value?l(this.cfg.value).valueOf():null:this.cfg.value}},data:()=>({initialProps:{}}),methods:{search(){this.$emit("outFilterChange")},getEleWidth(e){const{widgetType:t}=e;if(!n.includes(t))return`${e.advanceColWidth||200}px`},initComponentProps(e){const{widgetType:t,alias:i,title:a,placeholder:l,widgetCfg:s}=e,{props:n,handlerProps:o}=r.get(t);let p={...n};o&&(p=o(p,{...s,title:i||a})),l&&(p.placeholder=l),this.initialProps=p,p.value&&(this.valueCp=p.value)},generateWidget(e){const{widgetType:i}=e,{defValueUnit:a}=e.widgetCfg||{};if(!r.has(i))return null;const{value:l}=e,{component:s,style:n,eventsBySearch:o=[]}=r.get(i),p={...this.initialProps,value:l},u=o.reduce(((e,t)=>{const{name:i,handler:r}=t;let a=this.search;return r&&(a=e=>{r(e,this.search,p)}),{...e,[`on${i}`]:a}}),{});return t(s,{...n,...p,style:{width:this.getEleWidth(e)},value:this.valueCp,"onUpdate:value":e=>this.handleUpdate(e,i,a),...u})},handleUpdate(e,t,i){const r=a(e,t);this.$emit("update:modelValue",r)}},created(){this.initComponentProps(this.cfg)},render(){return this.generateWidget(this.cfg)}}),[["__file","index.vue"]]);export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetTypeEnums as e
|
|
1
|
+
import{WidgetTypeEnums as e}from"../../types/enums.js";import{DatePresetValEnums as l}from"./enums.js";import{NInputNumber as t,NInput as a,NDatePicker as o}from"naive-ui";import r from"./components/CheckboxGroup.vue.js";import p from"./components/Select.vue.js";import s from"moment";import{presetValToTimestamp as n}from"./helpers/presetValToTimestamp.js";const m=e=>null==e?null:e,u=new Map([[e.INPUT_NUMBER,{component:t,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&(console.log("点击keyup>>>>>",l),l())}}],handlerProps:(e,{title:l}={})=>({...e,placeholder:`输入${l}`}),setDefaultValue:m}],[e.INPUT,{component:a,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l}={})=>({...e,placeholder:`搜索${l}`}),setDefaultValue:m}],[e.SELECT,{component:p,props:{clearable:!0,options:[],filterable:!0,multiple:!1},eventsBySearch:[{name:"change",handler(e,l,t){const{multiple:a}=t;a&&l()}}],handlerProps(e,{valueList:l,multiple:t,title:a}={}){const o={...e,placeholder:`请选择${a}`};return Array.isArray(l)&&(o.options=l.map((({value:e,label:l})=>({value:e,label:l})))),t&&(o.multiple=!0),o},setDefaultValue:m}],[e.DATE,{component:o,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps:(e,{title:l}={})=>({...e,placeholder:`请选择${l}`}),setDefaultValue:(e,t)=>t&&t!==l.CUSTOM?n(t,"YYYY-MM-DD HH:mm:ss"):e}],[e.DATE_TIME,{component:o,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps:(e,{title:l}={})=>({...e,placeholder:`请选择${l}`}),setDefaultValue:(e,t)=>t&&t!==l.CUSTOM?n(t,"YYYY-MM-DD HH:mm:ss"):e}],[e.CHECKBOX_GROUP,{component:r,props:{},style:{"line-height":"32px"},handlerProps(e,{valueList:l,multiple:t}={}){const a={...e,multiple:t};return Array.isArray(l)&&(a.options=l.map((({value:e,label:l})=>({value:e,label:l})))),a},setDefaultValue:m}]]),i=(l,t)=>!l||t!==e.DATE&&t!==e.DATE_TIME?l:s(l).format("YYYY-MM-DD HH:mm:ss");export{u as WidgetCfgMaps,i as formatItemData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetOptionEnums as
|
|
1
|
+
import{WidgetOptionEnums as e,WidgetTypeEnums as t}from"../types/enums.js";import{presetValToTimestamp as i}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as l}from"../components/render-widget/enums.js";const n={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function o(){return{transformData:function(i){return i.map((i=>{var l,o;const{optionInfo:a={list:[]},type:r,defaultValue:u,optionType:s,filterExplicit:d}=i,p={},c={title:(f=i).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?n[f.optionType]:"",placeholder:f.remark,advanceColWidth:String(f.width)};var f;let m,v,T=r;d?(m=r===t.SELECT&&s===e.MULTIPLE?null==u?void 0:u.valueList:null==(l=null==u?void 0:u.valueList)?void 0:l[0],v=null==u?void 0:u.unit):r===t.SELECT&&(null==a?void 0:a.list)&&(null==a?void 0:a.list.length)<10&&(T="CHECKBOX_GROUP");const g={isRender:!0,widgetType:T,valueList:null==(o=null==a?void 0:a.list)?void 0:o.map((({name:e,value:t})=>({value:t,label:e}))),defaultValue:m,defValueUnit:v,multiple:s===e.MULTIPLE};return{...c,fieldType:i.dataType,columnName:i.name,settingObj:p,setting:JSON.stringify(p),widgetCfg:g}}))},getCacheDef:function(e,i){const{widgetType:l,widgetCfg:n}=e;return l===t.SELECT&&n.multiple?i:i[0]},transformClassifyChild:function(e){const t={};return e&&e.length>0&&e.forEach((e=>{const n=e.field_key,o=e.value&&e.value.length>1?e.value:e.value.toString();if(t[n]=o,e.unit&&e.unit!==l.CUSTOM){const l=i(e.unit,"YYYY-MM-DD HH:mm:ss");t[n]=l}})),t},transformParams:function(e){const t={};return e&&e.length>0&&e.forEach((e=>{const i=e.field_key,l=e.value&&e.value.length>1?e.value:e.value.toString();t[i]=l})),t}}}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetCfgMaps as e}from"../components/render-widget/widgetCfgMaps.js";import{
|
|
1
|
+
import{WidgetCfgMaps as e}from"../components/render-widget/widgetCfgMaps.js";import{DatePresetValEnums as n}from"../components/render-widget/enums.js";import{WidgetTypeEnums as t}from"../types/enums.js";const r=[t.CHECKBOX_GROUP];function i(){function i(e){var n;return null==(n=e.widgetCfg)?void 0:n.isRender}function u(n){const{widgetType:t,defaultValue:r,defValueUnit:i}=n.widgetCfg||{},u=e.get(t);let l;if(u){const{setDefaultValue:e}=u;e&&(l=e(r,i))}return l}return{isRender:i,getDefValByRenderWidget:u,initRenderWidgetCfg:function(e){const n=i(e);if(!n)return n;const{widgetType:t}=e.widgetCfg||{};return e._frontId="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})),e.isRender=n,e.widgetType=t,e.con="EQ",r.includes(t)&&(e._isBlock=!0),e.value=u(e),n},getRenderSearchConObj:function(e){if(!i(e))return null;const{columnName:r,con:u,value:l,widgetType:o}=e;let d=null;[t.DATE,t.DATE_TIME].includes(o)&&(d=n.CUSTOM);const s=Array.isArray(l)?l:l?[l]:[];return{field_key:r,con:u,value:s.length>0?s:null,unit:d}},getDefValByRenderConObj:function(e,n){if(!i(n))return null;const{widgetType:r,multiple:u}=n.widgetCfg||{},{value:l}=e;return r!==t.SELECT&&r!==t.CHECKBOX_GROUP||!u?Array.isArray(l)?l[0]:l:Array.isArray(l)?l:l?[l]:[]},isExistDefValByRenderWidget:function(e){const{defaultValue:n,defValueUnit:t}=e.widgetCfg||{};return!(!n&&!t)},resetRenderWidgetValue:function(e){const n=i(e);return n?(e.value=null,n):n}}}export{i as default};
|
|
@@ -25,26 +25,6 @@ export declare const transformDataToFront: (dataType: string, rawData?: any[]) =
|
|
|
25
25
|
};
|
|
26
26
|
remark: any;
|
|
27
27
|
_rawData: any;
|
|
28
|
-
}[] | {
|
|
29
|
-
dataType: string;
|
|
30
|
-
fieldType: any;
|
|
31
|
-
title: any;
|
|
32
|
-
customTitle: any;
|
|
33
|
-
optionSetting: any;
|
|
34
|
-
openAdvancedFilter: any;
|
|
35
|
-
filterOutDisplay: any;
|
|
36
|
-
filterOutRequired: any;
|
|
37
|
-
width: any;
|
|
38
|
-
defValCfg: {
|
|
39
|
-
value: any;
|
|
40
|
-
presetVal: any;
|
|
41
|
-
};
|
|
42
|
-
mappingConfig: {
|
|
43
|
-
mappingMethod: null;
|
|
44
|
-
mapping: any;
|
|
45
|
-
};
|
|
46
|
-
remark: any;
|
|
47
|
-
_rawData: any;
|
|
48
28
|
}[];
|
|
49
29
|
export declare const transformDataToEnd: (data: IFilterConditionType[]) => ({
|
|
50
30
|
name: string | undefined;
|
|
@@ -66,23 +46,6 @@ export declare const transformDataToEnd: (data: IFilterConditionType[]) => ({
|
|
|
66
46
|
list: any;
|
|
67
47
|
};
|
|
68
48
|
remark: string | undefined;
|
|
69
|
-
} | {
|
|
70
|
-
name: string | undefined;
|
|
71
|
-
title: string;
|
|
72
|
-
customTitle: string;
|
|
73
|
-
type: string | undefined;
|
|
74
|
-
dataType: string | undefined;
|
|
75
|
-
isShowSearch: boolean;
|
|
76
|
-
filterExplicit: boolean;
|
|
77
|
-
explicitRequired: boolean;
|
|
78
|
-
width: string | undefined;
|
|
79
|
-
optionType: string | undefined;
|
|
80
|
-
defaultValue: {
|
|
81
|
-
valueList: any[];
|
|
82
|
-
unit: any;
|
|
83
|
-
};
|
|
84
|
-
optionInfo: any;
|
|
85
|
-
remark: string | undefined;
|
|
86
49
|
} | null)[];
|
|
87
50
|
export declare const transformConditions: (rawConditions: any, params: any[]) => any;
|
|
88
51
|
export declare const transformRawConditions: (conditions: any[]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DataTypeEnums as l,WidgetTypeEnums as e,WidgetOptionEnums as t
|
|
1
|
+
import{DataTypeEnums as l,WidgetTypeEnums as e,WidgetOptionEnums as t}from"../types/enums.js";const i=l=>null==l||null==l,a=(i,a=[])=>i===l.API?a.map((l=>{var a,n,u,p,o,r,d,v,y,m,s;const f=null!=(n=null==(a=l.optionInfo)?void 0:a.list)?n:[];return{dataType:i,p_name:l.name,p_type:l.dataType,title:l.title,customTitle:l.customTitle,type:l.type,optionSetting:l.optionType,openAdvancedFilter:l.isShowSearch,filterOutDisplay:l.filterExplicit,filterOutRequired:l.explicitRequired,width:l.width,defValCfg:{value:l.type===e.SELECT&&l.optionType===t.MULTIPLE?null!=(p=null==(u=l.defaultValue)?void 0:u.valueList)?p:[]:null!=(d=null==(r=null==(o=l.defaultValue)?void 0:o.valueList)?void 0:r[0])?d:null,presetVal:l.type===e.SELECT&&l.optionType===t.MULTIPLE?(null==(v=l.defaultValue)?void 0:v.unit)?[null==(y=l.defaultValue)?void 0:y.unit]:[]:null!=(s=null==(m=l.defaultValue)?void 0:m.unit)?s:null},mappingConfig:{mappingMethod:null,mapping:f.map((({name:l,value:e})=>({label:l,value:e})))},remark:l.remark,_rawData:l}})):[],n=e=>e.map((e=>{var t;const{title:i,customTitle:a,openAdvancedFilter:n,filterOutDisplay:u,filterOutRequired:p,width:o,optionSetting:r,defValCfg:d,mappingConfig:v,remark:y,_rawData:m}=e,{value:s,presetVal:f}=d,{mapping:c}=v;if(e.dataType===l.API){const{p_name:l,p_type:d,type:v}=e;return{...m,name:l,title:i,customTitle:a,type:v,dataType:d,isShowSearch:n,filterExplicit:u,explicitRequired:p,width:o,optionType:r,defaultValue:{valueList:Array.isArray(s)?s:s?[s]:[],unit:Array.isArray(f)?f[0]:f},optionInfo:{manualMapping:null==(t=null==m?void 0:m.optionInfo)?void 0:t.manualMapping,list:c.map((({label:l,value:e})=>({name:l,value:e})))},remark:y}}return null})).filter((l=>!!l)),u=(l,i)=>l.map((l=>{var a,n;const u=((l,e)=>e.find((e=>e.p_name===l)))(l.field_key,i);let p=l.value;p&&!Array.isArray(p)&&(p=[p]);const o=(null==u?void 0:u.type)===e.SELECT&&(null==u?void 0:u.optionSetting)===t.MULTIPLE?null!=p?p:[]:null!=(a=null==p?void 0:p[0])?a:null;return{key:l.field_key,condition:l.con,value:o,presetVal:null!=(n=l.unit)?n:null}})),p=l=>l.map((l=>({field_key:l.key,con:l.condition,value:Array.isArray(l.value)?l.value:l.value?[l.value]:[],unit:l.presetVal})));export{i as isNil,u as transformConditions,n as transformDataToEnd,a as transformDataToFront,p as transformRawConditions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const T={TEXT:"TEXT",NUMBER:"NUMBER",DATE:"DATE",DATE_TIME:"DATETIME",TIME:"TIME",BOOLEAN:"BOOLEAN"},E={SQL:"SQL",API:"API"},A={MANUAL:"manual",DICT:"dict"},_={INPUT_NUMBER:"NUMBER",INPUT:"TEXT",SELECT:"SELECT",DATE:"DATE",DATE_TIME:"DATETIME"},R={RADIO:"SELECT_SINGLE",MULTIPLE:"SELECT_MULTIPLE",ALL:"DATETIME_WHOLE",SELECT_TIME:"DATETIME_SELECT",PAST_TIME:"DATETIME_PAST",FUTURE_TIME:"DATETIME_FUTURE"},S={CUSTOM:"CUSTOM",FIRST_VAL:"FIRST",NOW:"NOW",TODAY:"TODAY",TODAY_START:"TODAY_START",TODAY_END:"TODAY_END",TOMORROW:"TOMORROW",TOMORROW_START:"TOMORROW_START",TOMORROW_END:"TOMORROW_END",YESTERDAY:"YESTERDAY",YESTERDAY_START:"YESTERDAY_START",YESTERDAY_END:"YESTERDAY_END",THIS_WEEK:"THIS_WEEK",WEEK_START:"THIS_WEEK_START",WEEK_END:"THIS_WEEK_END",NEXT_WEEK:"NEXT_WEEK",LAST_WEEK:"LAST_WEEK",THIS_MONTH:"THIS_MONTH",MONTH_START:"THIS_MONTH_START",MONTH_END:"THIS_MONTH_END",NEXT_MONTH:"NEXT_MONTH",LAST_MONTH:"LAST_MONTH",THIS_QUARTER:"THIS_QUARTER",NEXT_QUARTER:"NEXT_QUARTER",LAST_QUARTER:"LAST_QUARTER",THIS_YEAR:"THIS_YEAR",NEXT_YEAR:"NEXT_YEAR",LAST_YEAR:"LAST_YEAR"},O={NULL:"NULL",EQUAL:"EQ"};export{O as ConditionEnums,E as DataTypeEnums,T as FieldTypeEnums,A as MappingMethodEnums,R as WidgetOptionEnums,_ as WidgetTypeEnums,S as WidgetValEnums};
|
|
1
|
+
const T={TEXT:"TEXT",NUMBER:"NUMBER",DATE:"DATE",DATE_TIME:"DATETIME",TIME:"TIME",BOOLEAN:"BOOLEAN"},E={SQL:"SQL",API:"API"},A={MANUAL:"manual",DICT:"dict"},_={INPUT_NUMBER:"NUMBER",INPUT:"TEXT",SELECT:"SELECT",DATE:"DATE",DATE_TIME:"DATETIME",CHECKBOX_GROUP:"CHECKBOX_GROUP"},R={RADIO:"SELECT_SINGLE",MULTIPLE:"SELECT_MULTIPLE",ALL:"DATETIME_WHOLE",SELECT_TIME:"DATETIME_SELECT",PAST_TIME:"DATETIME_PAST",FUTURE_TIME:"DATETIME_FUTURE"},S={CUSTOM:"CUSTOM",FIRST_VAL:"FIRST",NOW:"NOW",TODAY:"TODAY",TODAY_START:"TODAY_START",TODAY_END:"TODAY_END",TOMORROW:"TOMORROW",TOMORROW_START:"TOMORROW_START",TOMORROW_END:"TOMORROW_END",YESTERDAY:"YESTERDAY",YESTERDAY_START:"YESTERDAY_START",YESTERDAY_END:"YESTERDAY_END",THIS_WEEK:"THIS_WEEK",WEEK_START:"THIS_WEEK_START",WEEK_END:"THIS_WEEK_END",NEXT_WEEK:"NEXT_WEEK",LAST_WEEK:"LAST_WEEK",THIS_MONTH:"THIS_MONTH",MONTH_START:"THIS_MONTH_START",MONTH_END:"THIS_MONTH_END",NEXT_MONTH:"NEXT_MONTH",LAST_MONTH:"LAST_MONTH",THIS_QUARTER:"THIS_QUARTER",NEXT_QUARTER:"NEXT_QUARTER",LAST_QUARTER:"LAST_QUARTER",THIS_YEAR:"THIS_YEAR",NEXT_YEAR:"NEXT_YEAR",LAST_YEAR:"LAST_YEAR"},O={NULL:"NULL",EQUAL:"EQ"};export{O as ConditionEnums,E as DataTypeEnums,T as FieldTypeEnums,A as MappingMethodEnums,R as WidgetOptionEnums,_ as WidgetTypeEnums,S as WidgetValEnums};
|
|
@@ -127,14 +127,14 @@ export declare type ILabelItemListType = {
|
|
|
127
127
|
typeName: string;
|
|
128
128
|
};
|
|
129
129
|
export declare type IClassifyListType = {
|
|
130
|
-
classifyId: string;
|
|
131
130
|
displayCategory: string;
|
|
132
131
|
isDefault: boolean;
|
|
133
132
|
isEdit: boolean;
|
|
134
|
-
isPublic: string;
|
|
135
133
|
isShow: boolean;
|
|
136
134
|
name: string;
|
|
137
135
|
sid: string;
|
|
136
|
+
isPublic?: string;
|
|
137
|
+
classifyId?: string;
|
|
138
138
|
conObj?: any;
|
|
139
139
|
digital?: number;
|
|
140
140
|
checked?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.41-beta.
|
|
3
|
+
"version": "3.1.41-beta.40",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "3a173f73d3f4ea4d684f65694843d3b6c0b400f3"
|
|
65
65
|
}
|