ocpview-plus 0.0.1
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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/efviewplus.min.esm.js +99954 -0
- package/dist/efviewplus.min.js +142 -0
- package/dist/locale/lang.js +1 -0
- package/dist/locale/zh-CN.js +1 -0
- package/dist/locale/zh-TW.js +1 -0
- package/dist/locale/zh-UG.js +1 -0
- package/dist/style.css +9 -0
- package/dist/styles/efviewplus.css +1 -0
- package/package.json +144 -0
- package/src/components/base/controlbase.vue +191 -0
- package/src/components/base/controlbox.vue +102 -0
- package/src/components/base/index.js +3 -0
- package/src/components/base/load.js +20 -0
- package/src/components/base/probase.js +220 -0
- package/src/components/base/size.js +78 -0
- package/src/components/billbox/billbox.vue +68 -0
- package/src/components/billbox/index.js +2 -0
- package/src/components/cascaderbox/cascaderbox.vue +184 -0
- package/src/components/cascaderbox/index.js +2 -0
- package/src/components/checkbox/checkbox.vue +76 -0
- package/src/components/checkbox/checkgroupbox.vue +104 -0
- package/src/components/checkbox/index.js +3 -0
- package/src/components/colorbox/colorbox.vue +44 -0
- package/src/components/colorbox/index.js +2 -0
- package/src/components/combobox/combobox.vue +220 -0
- package/src/components/combobox/index.js +2 -0
- package/src/components/conditionbox/conditionbase.vue +195 -0
- package/src/components/conditionbox/conditionbox.vue +63 -0
- package/src/components/conditionbox/conditionfilterbox.vue +477 -0
- package/src/components/conditionbox/conditionselectorbox.vue +237 -0
- package/src/components/conditionbox/index.js +5 -0
- package/src/components/conditionbox/queryconditionbox.vue +26 -0
- package/src/components/conditionbox/queryconditionboxbase.vue +124 -0
- package/src/components/conditionbox/searchconditionbox.vue +114 -0
- package/src/components/conditionbox/searchgrid.vue +391 -0
- package/src/components/datebox/datebox.vue +129 -0
- package/src/components/datebox/daterangebox.vue +155 -0
- package/src/components/datebox/index.js +3 -0
- package/src/components/form/baseform.vue +677 -0
- package/src/components/form/detailsbox.vue +487 -0
- package/src/components/form/formbox.vue +29 -0
- package/src/components/form/formcardbox.vue +268 -0
- package/src/components/form/formcardgroupbox.vue +252 -0
- package/src/components/form/formcompro.js +19 -0
- package/src/components/form/formdetail.vue +129 -0
- package/src/components/form/formdetailtwo.vue +302 -0
- package/src/components/form/index.js +8 -0
- package/src/components/form/toolanchor.js +46 -0
- package/src/components/form/workform.vue +168 -0
- package/src/components/grid/basegrid.vue +1061 -0
- package/src/components/grid/editgrid.vue +51 -0
- package/src/components/grid/editgridbase.vue +947 -0
- package/src/components/grid/editgridcard.vue +193 -0
- package/src/components/grid/expandrow.vue +137 -0
- package/src/components/grid/index.js +6 -0
- package/src/components/grid/viewgrid.vue +122 -0
- package/src/components/grid/viewgridbase.vue +1284 -0
- package/src/components/icon/common-icon.vue +53 -0
- package/src/components/icon/eicon.vue +29 -0
- package/src/components/icon/icons.vue +42 -0
- package/src/components/icon/index.js +2 -0
- package/src/components/label/index.js +3 -0
- package/src/components/label/showtext.vue +95 -0
- package/src/components/load/loadcartoon.vue +228 -0
- package/src/components/map/index.js +2 -0
- package/src/components/map/mapbox.vue +348 -0
- package/src/components/masterplate/appendix.vue +586 -0
- package/src/components/masterplate/approval.vue +803 -0
- package/src/components/masterplate/base.vue +985 -0
- package/src/components/masterplate/billasyncimport.vue +614 -0
- package/src/components/masterplate/billconditionbox.vue +224 -0
- package/src/components/masterplate/billconditionsbox.vue +427 -0
- package/src/components/masterplate/billdetailform.vue +990 -0
- package/src/components/masterplate/billimport.vue +263 -0
- package/src/components/masterplate/billquerygrid.vue +316 -0
- package/src/components/masterplate/billsinglegrid.vue +234 -0
- package/src/components/masterplate/birtreport.vue +185 -0
- package/src/components/masterplate/detailbtntoolbar.vue +311 -0
- package/src/components/masterplate/detailsbox.vue +386 -0
- package/src/components/masterplate/editgridcard.vue +222 -0
- package/src/components/masterplate/editgridcard2.vue +109 -0
- package/src/components/masterplate/formcard.vue +106 -0
- package/src/components/masterplate/formcardgroupbox.vue +168 -0
- package/src/components/masterplate/formdetailtwo.vue +356 -0
- package/src/components/masterplate/gridcolset.vue +227 -0
- package/src/components/masterplate/index.js +23 -0
- package/src/components/masterplate/layouttemplate.vue +33 -0
- package/src/components/masterplate/leftlistrightdetails.vue +474 -0
- package/src/components/masterplate/leftlistrightlist.vue +465 -0
- package/src/components/masterplate/lefttreerightdetails.vue +619 -0
- package/src/components/masterplate/levelreport.vue +510 -0
- package/src/components/masterplate/listbtntoolbar.vue +257 -0
- package/src/components/masterplate/listdetails.vue +769 -0
- package/src/components/masterplate/operlog.vue +272 -0
- package/src/components/masterplate/options.vue +110 -0
- package/src/components/masterplate/page.vue +102 -0
- package/src/components/masterplate/promptmessage.vue +74 -0
- package/src/components/masterplate/querybar.vue +490 -0
- package/src/components/masterplate/report.vue +357 -0
- package/src/components/masterplate/rowbtntoolbar.vue +126 -0
- package/src/components/masterplate/simpletree.vue +129 -0
- package/src/components/masterplate/simpleviewgrid.vue +144 -0
- package/src/components/mychart/bar/bar.vue +202 -0
- package/src/components/mychart/basechart.vue +190 -0
- package/src/components/mychart/complexmychart/barline.vue +154 -0
- package/src/components/mychart/gauge/gauge.vue +83 -0
- package/src/components/mychart/index.js +9 -0
- package/src/components/mychart/line/line.vue +202 -0
- package/src/components/mychart/liquidfill/liquidfill.vue +109 -0
- package/src/components/mychart/pie/pie.vue +96 -0
- package/src/components/mychart/radar/radar.vue +122 -0
- package/src/components/mychart/scatter/scatter.vue +76 -0
- package/src/components/numberbox/append.js +11 -0
- package/src/components/numberbox/index.js +3 -0
- package/src/components/numberbox/numberbox.vue +303 -0
- package/src/components/numberbox/numberrangebox.vue +423 -0
- package/src/components/picturebox/filebox.vue +365 -0
- package/src/components/picturebox/index.js +3 -0
- package/src/components/picturebox/picturebox.vue +541 -0
- package/src/components/picturebox/uploadbox.vue +164 -0
- package/src/components/poptagbox/index.js +2 -0
- package/src/components/poptagbox/poptagbox.vue +389 -0
- package/src/components/poptextbox/index.js +2 -0
- package/src/components/poptextbox/poptextbox.vue +601 -0
- package/src/components/radiobox/index.js +2 -0
- package/src/components/radiobox/radiogroupbox.vue +76 -0
- package/src/components/richtextbox/editor.vue +150 -0
- package/src/components/richtextbox/index.js +2 -0
- package/src/components/richtextbox/richtextbox.vue +448 -0
- package/src/components/textbox/index.js +2 -0
- package/src/components/textbox/textbox.vue +98 -0
- package/src/components/timebox/index.js +2 -0
- package/src/components/timebox/timebox.vue +76 -0
- package/src/components/toolbar/ebutton.vue +169 -0
- package/src/components/toolbar/index.js +3 -0
- package/src/components/toolbar/toolbar.vue +446 -0
- package/src/components/tree/basetree.vue +725 -0
- package/src/components/tree/index.js +3 -0
- package/src/components/tree/treedata.vue +51 -0
- package/src/components/tree/treedatabase.vue +189 -0
- package/src/components/upload/billimport.vue +233 -0
- package/src/components/upload/index.js +2 -0
- package/src/components/videobox/index.js +2 -0
- package/src/components/videobox/uploadbox.vue +148 -0
- package/src/components/videobox/videobox.vue +503 -0
- package/src/components/wrichtextbox/editor.vue +219 -0
- package/src/components/wrichtextbox/index.js +2 -0
- package/src/components/wrichtextbox/wrichtextbox.vue +63 -0
- package/src/index.js +215 -0
- package/src/locale/format.js +51 -0
- package/src/locale/index.js +63 -0
- package/src/locale/lang/zh-CN.js +123 -0
- package/src/locale/lang/zh-TW.js +114 -0
- package/src/locale/lang/zh-UG.js +115 -0
- package/src/locale/lang.js +15 -0
- package/src/method/case/case.js +1180 -0
- package/src/method/config/queryconfig.js +24 -0
- package/src/method/const/const.js +815 -0
- package/src/method/index.js +8 -0
- package/src/static/excel/exportexcel.js +627 -0
- package/src/static/iview/coustom.js +463 -0
- package/src/store/index.js +19 -0
- package/src/store/modules/app.js +53 -0
- package/src/styles/README.md +3 -0
- package/src/styles/common.less +75 -0
- package/src/styles/components/anchor.less +74 -0
- package/src/styles/components/approval.less +136 -0
- package/src/styles/components/button.less +208 -0
- package/src/styles/components/card.less +51 -0
- package/src/styles/components/content.less +38 -0
- package/src/styles/components/font.less +314 -0
- package/src/styles/components/form.less +72 -0
- package/src/styles/components/iconfont/fonts/iconfont.less +1376 -0
- package/src/styles/components/iconfont/fonts/iconfont.svg +699 -0
- package/src/styles/components/iconfont/fonts/iconfont.ttf +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff2 +0 -0
- package/src/styles/components/index.less +16 -0
- package/src/styles/components/input.less +290 -0
- package/src/styles/components/modal.less +203 -0
- package/src/styles/components/page.less +340 -0
- package/src/styles/components/select.less +361 -0
- package/src/styles/components/steps.less +367 -0
- package/src/styles/components/table.less +544 -0
- package/src/styles/components/tabs.less +249 -0
- package/src/styles/components/upload.less +83 -0
- package/src/styles/custom.less +67 -0
- package/src/styles/index.less +6 -0
- package/src/styles/pack.less +6 -0
- package/src/utils/EfuMessenger.js +155 -0
- package/src/utils/assist.js +353 -0
- package/src/utils/index.js +1 -0
- package/src/utils/random_str.js +10 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="padding-left:10px;padding-right:10px">
|
|
3
|
+
<Tree v-if="hackReset" :data="data" :render="renderContent" class="demo-tree-render"></Tree>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import { resolveComponent } from 'vue';
|
|
8
|
+
export default {
|
|
9
|
+
name:'conditionfilterbox',
|
|
10
|
+
props:{
|
|
11
|
+
config: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default () {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
dictData: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default:null
|
|
20
|
+
}
|
|
21
|
+
} ,
|
|
22
|
+
data () {
|
|
23
|
+
return {
|
|
24
|
+
hackReset:true,
|
|
25
|
+
myConfig:{
|
|
26
|
+
dbtype:'oracle',
|
|
27
|
+
rootName:'',
|
|
28
|
+
selector:[],
|
|
29
|
+
items:[]
|
|
30
|
+
},
|
|
31
|
+
root:{
|
|
32
|
+
title: '',
|
|
33
|
+
isConnector:false,
|
|
34
|
+
expand: true,
|
|
35
|
+
selectorClass:1,
|
|
36
|
+
render:this.renderRootContent
|
|
37
|
+
},
|
|
38
|
+
data: [],
|
|
39
|
+
selectorConfig:{}
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
created () {
|
|
43
|
+
this.init();
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
init () {
|
|
47
|
+
this.myConfig = Object.assign({}, this.myConfig, this.config);
|
|
48
|
+
if (this.dictData) {
|
|
49
|
+
this.myConfig.items.forEach(el => {
|
|
50
|
+
if (el.dictkey) {
|
|
51
|
+
if (el.data === undefined) {
|
|
52
|
+
let dictkey = el.dictkey;
|
|
53
|
+
if (el.customDictkey) {
|
|
54
|
+
dictkey = el.customDictkey;
|
|
55
|
+
}
|
|
56
|
+
if (this.dictData[dictkey]) {
|
|
57
|
+
el.data = this.dictData[dictkey];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (this.myConfig.selector && this.myConfig.selector.length > 0) {
|
|
64
|
+
this.myConfig.selector.forEach(el => {
|
|
65
|
+
if (!this.selectorConfig[el.code]) {
|
|
66
|
+
this.selectorConfig[el.code] = {};
|
|
67
|
+
this.selectorConfig[el.code].items = [];
|
|
68
|
+
}
|
|
69
|
+
this.myConfig.items.forEach(el2 => {
|
|
70
|
+
if (el.code === el2.selector) {
|
|
71
|
+
this.selectorConfig[el.code].items.push(el2);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
this.myConfig.selector = [];
|
|
77
|
+
let obj = {};
|
|
78
|
+
obj.code = '1';
|
|
79
|
+
obj.name = '筛选条件';
|
|
80
|
+
if (this.myConfig.rootName){
|
|
81
|
+
obj.name = this.myConfig.rootName;
|
|
82
|
+
}
|
|
83
|
+
this.myConfig.selector.push(obj);
|
|
84
|
+
this.selectorConfig[obj.code] = {};
|
|
85
|
+
this.selectorConfig[obj.code].items = [];
|
|
86
|
+
this.myConfig.items.forEach(el2 => {
|
|
87
|
+
el2.selector = obj.code;
|
|
88
|
+
this.selectorConfig[obj.code].items.push(el2);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
this.initData();
|
|
92
|
+
},
|
|
93
|
+
initData() {
|
|
94
|
+
this.hackReset = false;
|
|
95
|
+
this.data = [];
|
|
96
|
+
let root = {};
|
|
97
|
+
if (this.myConfig.selector.length === 1) {
|
|
98
|
+
root.title = this.myConfig.selector[0].name;
|
|
99
|
+
root.isConnector =false;
|
|
100
|
+
root.expand =true;
|
|
101
|
+
root.selector = this.myConfig.selector[0].code;
|
|
102
|
+
root.selectorClass = 1;
|
|
103
|
+
root.render = this.renderRootStaticContent;
|
|
104
|
+
root.children = [];
|
|
105
|
+
let obj = {
|
|
106
|
+
title:'连接关系',
|
|
107
|
+
operflag:true,
|
|
108
|
+
selectorClass:2,
|
|
109
|
+
selector:this.myConfig.selector[0].code,
|
|
110
|
+
isConnector:true,
|
|
111
|
+
expand: true,
|
|
112
|
+
form:{'connector':'$and'},
|
|
113
|
+
render:this.renderContent,
|
|
114
|
+
children:[
|
|
115
|
+
{
|
|
116
|
+
title:'条件',
|
|
117
|
+
operflag:true,
|
|
118
|
+
isConnector:false,
|
|
119
|
+
expand: true,
|
|
120
|
+
selector:this.myConfig.selector[0].code,
|
|
121
|
+
selectorClass:3,
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
root.children.push(obj);
|
|
126
|
+
}
|
|
127
|
+
if (this.myConfig.selector.length > 1) {
|
|
128
|
+
if (this.myConfig.rootName) {
|
|
129
|
+
root.title = this.myConfig.rootName;
|
|
130
|
+
} else {
|
|
131
|
+
root.title = '筛选条件';
|
|
132
|
+
}
|
|
133
|
+
root.expand =true;
|
|
134
|
+
root.children = [];
|
|
135
|
+
root.render = this.renderRootStaticContent;
|
|
136
|
+
root.children.push({
|
|
137
|
+
title: '连接关系',
|
|
138
|
+
isConnector:true,
|
|
139
|
+
expand: true,
|
|
140
|
+
operflag:false,
|
|
141
|
+
selector:'-',
|
|
142
|
+
selectorClass:1,
|
|
143
|
+
form:{'connector':'$and'},
|
|
144
|
+
render:this.renderContent
|
|
145
|
+
});
|
|
146
|
+
root.children[0].children = [];
|
|
147
|
+
this.myConfig.selector.forEach(el => {
|
|
148
|
+
let obj = {};
|
|
149
|
+
obj.title = el.name,
|
|
150
|
+
obj.expand = true;
|
|
151
|
+
obj.selectorClass = 2;
|
|
152
|
+
obj.selector = el.code;
|
|
153
|
+
obj.operflag = false;
|
|
154
|
+
obj.render=this.renderRootStaticContent;
|
|
155
|
+
obj.children = [];
|
|
156
|
+
let temp = {
|
|
157
|
+
title:'连接关系',
|
|
158
|
+
operflag:true,
|
|
159
|
+
selectorClass:3,
|
|
160
|
+
selector:el.code,
|
|
161
|
+
isConnector:true,
|
|
162
|
+
expand: true,
|
|
163
|
+
form:{'connector':'$and'},
|
|
164
|
+
render:this.renderContent,
|
|
165
|
+
children:[
|
|
166
|
+
{
|
|
167
|
+
title:'条件',
|
|
168
|
+
operflag:true,
|
|
169
|
+
isConnector:false,
|
|
170
|
+
expand: true,
|
|
171
|
+
selector:el.code,
|
|
172
|
+
selectorClass:4,
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
};
|
|
176
|
+
obj.children.push(temp);
|
|
177
|
+
root.children[0].children.push(obj);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
this.data.push(root);
|
|
181
|
+
this.$nextTick(() =>{
|
|
182
|
+
this.hackReset = true;
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
// eslint-disable-next-line no-unused-vars
|
|
187
|
+
renderRootContent (h, {root, node, data }) {
|
|
188
|
+
let buttonConfig = Object.assign({}, this.buttonProps, {icon: 'ios-add',type: 'primary'});
|
|
189
|
+
buttonConfig.style = { width: '64px'};
|
|
190
|
+
buttonConfig.onClick = () => { this.append(data); };
|
|
191
|
+
return h('div', {
|
|
192
|
+
style: {
|
|
193
|
+
display: 'block',
|
|
194
|
+
width: '100%',
|
|
195
|
+
'line-height':'34px'
|
|
196
|
+
}
|
|
197
|
+
}, [h('span',data.title),
|
|
198
|
+
h('span', {
|
|
199
|
+
style: {
|
|
200
|
+
display: 'inline-block',
|
|
201
|
+
float: 'right',
|
|
202
|
+
marginRight: '32px'
|
|
203
|
+
}
|
|
204
|
+
}, [
|
|
205
|
+
h(resolveComponent('Button'), buttonConfig)
|
|
206
|
+
])
|
|
207
|
+
]);
|
|
208
|
+
},
|
|
209
|
+
renderContent (h, { root, node, data }) {
|
|
210
|
+
return h('div',{
|
|
211
|
+
style: {
|
|
212
|
+
display: 'block',
|
|
213
|
+
width: '100%',
|
|
214
|
+
'line-height':'34px'
|
|
215
|
+
}
|
|
216
|
+
}, [h('span', {
|
|
217
|
+
style: {
|
|
218
|
+
'vertical-align':'middle'
|
|
219
|
+
}
|
|
220
|
+
},data.title),
|
|
221
|
+
h('span',{
|
|
222
|
+
style: {
|
|
223
|
+
display: 'inline-block',
|
|
224
|
+
float: 'right',
|
|
225
|
+
width:'90%',
|
|
226
|
+
marginRight: '32px'
|
|
227
|
+
}},[h(resolveComponent('ConditionSelectorBox'),{
|
|
228
|
+
isConnector:data.isConnector,
|
|
229
|
+
operflag:data.operflag,
|
|
230
|
+
config:this.selectorConfig[data.selector],
|
|
231
|
+
setOperData:this.setOperData,
|
|
232
|
+
valueData:data.form,
|
|
233
|
+
onDoAction:(val) =>{
|
|
234
|
+
if (val.name === 'doAdd') {
|
|
235
|
+
this.append(data);
|
|
236
|
+
}
|
|
237
|
+
if (val.name === 'doDel') {
|
|
238
|
+
this.remove(root, node, data);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
onClick:(form) => {
|
|
242
|
+
if (!data.form) {
|
|
243
|
+
data.form = {};
|
|
244
|
+
}
|
|
245
|
+
Object.assign(data.form, form);
|
|
246
|
+
}
|
|
247
|
+
})])]);
|
|
248
|
+
},
|
|
249
|
+
// eslint-disable-next-line no-unused-vars
|
|
250
|
+
renderRootStaticContent (h, { root, node, data }) {
|
|
251
|
+
return h('span',{
|
|
252
|
+
style: {
|
|
253
|
+
display: 'inline-block',
|
|
254
|
+
width: '100%',
|
|
255
|
+
'line-height':'34px'
|
|
256
|
+
}
|
|
257
|
+
}, [h('span', data.title)]);
|
|
258
|
+
},
|
|
259
|
+
append (data) {
|
|
260
|
+
const children = data.children || [];
|
|
261
|
+
let nextClass = Number(data.selectorClass) + 1;
|
|
262
|
+
let isConnector = !data.isConnector;
|
|
263
|
+
let title ='条件';
|
|
264
|
+
if (isConnector) {
|
|
265
|
+
title = '连接关系';
|
|
266
|
+
let flag = false;
|
|
267
|
+
for (let i=0; i<children.length; i++) {
|
|
268
|
+
if (children[i].isConnector) {
|
|
269
|
+
flag = true;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (flag) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
let obj = {
|
|
278
|
+
title:title,
|
|
279
|
+
operflag:true,
|
|
280
|
+
selectorClass:nextClass,
|
|
281
|
+
selector:data.selector,
|
|
282
|
+
isConnector:isConnector,
|
|
283
|
+
expand: true
|
|
284
|
+
};
|
|
285
|
+
if (isConnector) {
|
|
286
|
+
obj.form = {'connector':'$and'};
|
|
287
|
+
}
|
|
288
|
+
children.push(obj);
|
|
289
|
+
Object.assign(data,{'children':children});
|
|
290
|
+
},
|
|
291
|
+
setOperData (el, tempData) {
|
|
292
|
+
if (this.myConfig.setOperData) {
|
|
293
|
+
return this.myConfig.setOperData(el, tempData);
|
|
294
|
+
} else {
|
|
295
|
+
return tempData;
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
remove (root, node, data) {
|
|
299
|
+
const parentKey = root.find(el => el === node).parent;
|
|
300
|
+
const parent = root.find(el => el.nodeKey === parentKey).node;
|
|
301
|
+
const index = parent.children.indexOf(data);
|
|
302
|
+
parent.children.splice(index, 1);
|
|
303
|
+
},
|
|
304
|
+
getQuerySearchParam () {
|
|
305
|
+
let para = {};
|
|
306
|
+
if (this.myConfig.selector.length === 1){
|
|
307
|
+
if (this.data[0].children === undefined) {
|
|
308
|
+
return para;
|
|
309
|
+
} else {
|
|
310
|
+
this.creatSearchParam(this.data[0],para,1);
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
if (this.data[0].children[0].children === undefined) {
|
|
314
|
+
return para;
|
|
315
|
+
} else {
|
|
316
|
+
this.creatSearchParam(this.data[0].children[0],para,2);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
let temp = [];
|
|
320
|
+
this.myConfig.selector.forEach(el=> {
|
|
321
|
+
if (para[el.code]) {
|
|
322
|
+
temp.push(para[el.code]);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
if (temp.length === 0) {
|
|
326
|
+
return {};
|
|
327
|
+
} else if (temp.length === 1) {
|
|
328
|
+
return this.$Method.copy(temp[0]);
|
|
329
|
+
} else {
|
|
330
|
+
let obj = {};
|
|
331
|
+
obj[this.data[0].children[0].form.connector] = temp;
|
|
332
|
+
return obj;
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
getQuerySearchParamToString () {
|
|
336
|
+
let obj = this.getQuerySearchParam();
|
|
337
|
+
let str = '';
|
|
338
|
+
str = this.setParaSring(obj,str);
|
|
339
|
+
return str;
|
|
340
|
+
},
|
|
341
|
+
setParaSring(obj,str) {
|
|
342
|
+
if (obj.constructor === Array) {
|
|
343
|
+
let temp = '';
|
|
344
|
+
if (str === '$and') {
|
|
345
|
+
str = ' and ';
|
|
346
|
+
} else if (str === '$or') {
|
|
347
|
+
str = ' or ';
|
|
348
|
+
}
|
|
349
|
+
obj.forEach(el => {
|
|
350
|
+
temp = temp + this.setParaSring(el) + ' ' +str + ' ';
|
|
351
|
+
});
|
|
352
|
+
if (temp) {
|
|
353
|
+
temp = temp.substring(0, temp.length - 5);
|
|
354
|
+
}
|
|
355
|
+
return temp;
|
|
356
|
+
} else {
|
|
357
|
+
for (let pro in obj) {
|
|
358
|
+
let value = this.$Method.copy(obj[pro]);
|
|
359
|
+
if (value.constructor === Array){
|
|
360
|
+
return '( ' + this.setParaSring(value,pro) + ' )';
|
|
361
|
+
} else {
|
|
362
|
+
return this.getCommomParamString(pro,value);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
getCommomParamString (pro,obj) {
|
|
368
|
+
let str = pro ;
|
|
369
|
+
for(let temp in obj) {
|
|
370
|
+
if (temp === '==') {
|
|
371
|
+
str =str + ' = ';
|
|
372
|
+
} else {
|
|
373
|
+
str =str +' ' + temp + ' ';
|
|
374
|
+
}
|
|
375
|
+
let v = obj[temp];
|
|
376
|
+
let index = this.myConfig.items.findIndex(el => el.name === pro);
|
|
377
|
+
if (index > -1) {
|
|
378
|
+
if (this.myConfig.dbtype === 'oracle') {
|
|
379
|
+
if (this.myConfig.items[index].type === 'DateBox') {
|
|
380
|
+
let format = 'yyyy-MM-dd';
|
|
381
|
+
if (this.myConfig.items[index].vtype === 'date') {
|
|
382
|
+
format = 'yyyy-MM-dd';
|
|
383
|
+
} else if (this.myConfig.items[index].vtype === 'datetime') {
|
|
384
|
+
format = 'yyyy-MM-dd hh:mm:ss';
|
|
385
|
+
} else if (this.myConfig.items[index].vtype ==='month') {
|
|
386
|
+
format = 'yyyy-MM';
|
|
387
|
+
}
|
|
388
|
+
if (this.myConfig.items[index].format) {
|
|
389
|
+
format = this.myConfig.items[index].format;
|
|
390
|
+
}
|
|
391
|
+
v = 'to_date(\'' + v + '\',\'' +format +'\')';
|
|
392
|
+
} else {
|
|
393
|
+
v = '\'' + v + '\'';
|
|
394
|
+
}
|
|
395
|
+
} else {
|
|
396
|
+
v = '\'' + v + '\'';
|
|
397
|
+
}
|
|
398
|
+
str = str + v;
|
|
399
|
+
return str;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return '';
|
|
403
|
+
},
|
|
404
|
+
getCommomParam (obj) {
|
|
405
|
+
let param = {};
|
|
406
|
+
if (obj.oper === 'LIKE') {
|
|
407
|
+
param[obj.field] = {};
|
|
408
|
+
param[obj.field][obj.oper] = '%' + obj.value + '%';
|
|
409
|
+
} else {
|
|
410
|
+
param[obj.field] = {};
|
|
411
|
+
if (obj.value.value !== undefined) {
|
|
412
|
+
param[obj.field][obj.oper] = obj.value.value;
|
|
413
|
+
} else {
|
|
414
|
+
param[obj.field][obj.oper] = obj.value;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return param;
|
|
418
|
+
},
|
|
419
|
+
creatSearchParam(data,obj,flag) {
|
|
420
|
+
data.children.forEach(el => {
|
|
421
|
+
if (el.children && el.children.length > 0) {
|
|
422
|
+
let temp = null;
|
|
423
|
+
if (flag === 2) {
|
|
424
|
+
temp = el.children[0];
|
|
425
|
+
} else {
|
|
426
|
+
temp = el;
|
|
427
|
+
}
|
|
428
|
+
obj[el.selector] = {};
|
|
429
|
+
obj[el.selector][temp.form.connector] = [];
|
|
430
|
+
this.creatSearchParamCommon(temp.children,obj[el.selector][temp.form.connector]);
|
|
431
|
+
if (obj[el.selector][temp.form.connector].length === 0) {
|
|
432
|
+
delete obj[el.selector];
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
},
|
|
437
|
+
creatSearchParamCommon(data,obj) {
|
|
438
|
+
if (data && data.length > 0) {
|
|
439
|
+
for (let i=0;i<data.length;i++) {
|
|
440
|
+
let temp = {};
|
|
441
|
+
if (data[i].isConnector) {
|
|
442
|
+
temp[data.form.connector] = [];
|
|
443
|
+
this.creatSearchParamCommon(data[i].children,temp[data[i].form.connector]);
|
|
444
|
+
if (temp[data.form.connector].length > 0) {
|
|
445
|
+
obj.push(temp);
|
|
446
|
+
}
|
|
447
|
+
} else {
|
|
448
|
+
if (data[i].form && data[i].form.value) {
|
|
449
|
+
if (data[i].children && data[i].children.length > 0) {
|
|
450
|
+
let temp = {};
|
|
451
|
+
temp[data[i].children[0].form.connector] = [];
|
|
452
|
+
this.creatSearchParamCommon(data[i].children[0].children,temp[data[i].children[0].form.connector]);
|
|
453
|
+
if (temp[data[i].children[0].form.connector].length > 0) {
|
|
454
|
+
temp[data[i].children[0].form.connector].push(this.getCommomParam(data[i].form));
|
|
455
|
+
obj.push(temp);
|
|
456
|
+
} else {
|
|
457
|
+
obj.push(this.getCommomParam(data[i].form));
|
|
458
|
+
}
|
|
459
|
+
} else {
|
|
460
|
+
obj.push(this.getCommomParam(data[i].form));
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
clearData() {
|
|
468
|
+
this.initData();
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
</script>
|
|
473
|
+
<style>
|
|
474
|
+
.demo-tree-render .ivu-tree-title{
|
|
475
|
+
width: 98%;
|
|
476
|
+
}
|
|
477
|
+
</style>
|