@idooel/components 0.0.0 → 0.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@idooel/components.esm.js +4551 -0
- package/dist/@idooel/components.umd.js +3305 -547
- package/package.json +45 -41
- package/packages/attachment/index.js +0 -0
- package/packages/attachment/src/index.vue +15 -0
- package/packages/batch-export/index.js +5 -0
- package/packages/batch-export/src/index.vue +15 -0
- package/packages/button/index.js +4 -4
- package/packages/button/src/index.vue +54 -24
- package/packages/checkbox/index.js +5 -0
- package/packages/checkbox/src/index.vue +44 -0
- package/packages/composite-components/button-group/index.js +4 -4
- package/packages/composite-components/button-group/src/index.vue +45 -46
- package/packages/composite-components/search-area/index.js +4 -4
- package/packages/composite-components/search-area/src/index.vue +206 -128
- package/packages/composite-components/search-area/src/label.vue +35 -35
- package/packages/date/index.js +4 -4
- package/packages/date/src/index.vue +39 -39
- package/packages/form/index.js +5 -0
- package/packages/form/src/index.vue +119 -0
- package/packages/form-model/index.js +5 -0
- package/packages/form-model/src/index.vue +139 -0
- package/packages/icon/index.js +5 -0
- package/packages/icon/src/index.vue +32 -0
- package/packages/index.js +73 -49
- package/packages/input/index.js +4 -4
- package/packages/input/src/index.vue +27 -23
- package/packages/input-number/index.js +5 -0
- package/packages/input-number/src/index.vue +24 -0
- package/packages/modal/index.js +5 -0
- package/packages/modal/src/index.vue +129 -0
- package/packages/radio/index.js +5 -0
- package/packages/radio/src/index.vue +48 -0
- package/packages/select/index.js +4 -4
- package/packages/select/src/index.vue +34 -34
- package/packages/select-entity/index.js +5 -0
- package/packages/select-entity/src/index.vue +114 -0
- package/packages/table/index.js +4 -4
- package/packages/table/src/action.vue +131 -44
- package/packages/table/src/index.vue +157 -88
- package/packages/text/index.js +5 -0
- package/packages/text/src/index.vue +15 -0
- package/packages/textarea/index.js +5 -0
- package/packages/textarea/src/index.vue +49 -0
- package/packages/theme/form.scss +24 -0
- package/packages/theme/index.scss +24 -0
- package/packages/theme/variables.scss +56 -0
- package/packages/tpl/index.js +4 -4
- package/packages/tpl/src/index.vue +50 -39
- package/packages/tree/index.js +4 -4
- package/packages/tree/src/TreeNode.vue +29 -29
- package/packages/tree/src/index.vue +101 -96
- package/packages/tree-table-model/index.js +4 -4
- package/packages/tree-table-model/src/index.vue +314 -289
- package/packages/upload/index.js +5 -0
- package/packages/upload/src/index.vue +351 -0
- package/packages/utils/index.js +4 -0
- package/scripts/rollup.config.js +35 -41
- package/scripts/rollup.esm.config.js +12 -0
- package/scripts/rollup.umd.config.js +14 -14
|
@@ -0,0 +1,4551 @@
|
|
|
1
|
+
import { type, route, net } from '@idooel/shared';
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
import FileUpload from 'vue-upload-component';
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
//
|
|
9
|
+
//
|
|
10
|
+
//
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
//
|
|
22
|
+
|
|
23
|
+
var script$n = {
|
|
24
|
+
name: 'ele-button',
|
|
25
|
+
props: {
|
|
26
|
+
record: {
|
|
27
|
+
type: Object
|
|
28
|
+
},
|
|
29
|
+
eventName: {
|
|
30
|
+
type: String
|
|
31
|
+
},
|
|
32
|
+
mode: {
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
35
|
+
dataSource: {
|
|
36
|
+
type: Array,
|
|
37
|
+
default: () => []
|
|
38
|
+
},
|
|
39
|
+
type: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'default'
|
|
42
|
+
},
|
|
43
|
+
icon: {
|
|
44
|
+
type: String
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
handleMenuClick(props) {
|
|
49
|
+
const {
|
|
50
|
+
key
|
|
51
|
+
} = props;
|
|
52
|
+
const currentClickTarget = this.dataSource.find(item => item.value === key);
|
|
53
|
+
const {
|
|
54
|
+
eventName
|
|
55
|
+
} = currentClickTarget;
|
|
56
|
+
eventName && this.$emit(eventName, {
|
|
57
|
+
...currentClickTarget
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
handleClick() {
|
|
61
|
+
this.$emit(this.eventName || 'click', {
|
|
62
|
+
...this.record
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
69
|
+
if (typeof shadowMode !== 'boolean') {
|
|
70
|
+
createInjectorSSR = createInjector;
|
|
71
|
+
createInjector = shadowMode;
|
|
72
|
+
shadowMode = false;
|
|
73
|
+
}
|
|
74
|
+
// Vue.extend constructor export interop.
|
|
75
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
76
|
+
// render functions
|
|
77
|
+
if (template && template.render) {
|
|
78
|
+
options.render = template.render;
|
|
79
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
80
|
+
options._compiled = true;
|
|
81
|
+
// functional template
|
|
82
|
+
if (isFunctionalTemplate) {
|
|
83
|
+
options.functional = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// scopedId
|
|
87
|
+
if (scopeId) {
|
|
88
|
+
options._scopeId = scopeId;
|
|
89
|
+
}
|
|
90
|
+
let hook;
|
|
91
|
+
if (moduleIdentifier) {
|
|
92
|
+
// server build
|
|
93
|
+
hook = function (context) {
|
|
94
|
+
// 2.3 injection
|
|
95
|
+
context = context ||
|
|
96
|
+
// cached call
|
|
97
|
+
this.$vnode && this.$vnode.ssrContext ||
|
|
98
|
+
// stateful
|
|
99
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
|
|
100
|
+
// 2.2 with runInNewContext: true
|
|
101
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
102
|
+
context = __VUE_SSR_CONTEXT__;
|
|
103
|
+
}
|
|
104
|
+
// inject component styles
|
|
105
|
+
if (style) {
|
|
106
|
+
style.call(this, createInjectorSSR(context));
|
|
107
|
+
}
|
|
108
|
+
// register component module identifier for async chunk inference
|
|
109
|
+
if (context && context._registeredComponents) {
|
|
110
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
// used by ssr in case component is cached and beforeCreate
|
|
114
|
+
// never gets called
|
|
115
|
+
options._ssrRegister = hook;
|
|
116
|
+
} else if (style) {
|
|
117
|
+
hook = shadowMode ? function (context) {
|
|
118
|
+
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
119
|
+
} : function (context) {
|
|
120
|
+
style.call(this, createInjector(context));
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (hook) {
|
|
124
|
+
if (options.functional) {
|
|
125
|
+
// register for functional component in vue file
|
|
126
|
+
const originalRender = options.render;
|
|
127
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
128
|
+
hook.call(context);
|
|
129
|
+
return originalRender(h, context);
|
|
130
|
+
};
|
|
131
|
+
} else {
|
|
132
|
+
// inject component registration as beforeCreate hook
|
|
133
|
+
const existing = options.beforeCreate;
|
|
134
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return script;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* script */
|
|
141
|
+
const __vue_script__$n = script$n;
|
|
142
|
+
|
|
143
|
+
/* template */
|
|
144
|
+
var __vue_render__$n = function () {
|
|
145
|
+
var _vm = this;
|
|
146
|
+
var _h = _vm.$createElement;
|
|
147
|
+
var _c = _vm._self._c || _h;
|
|
148
|
+
return _vm.mode == "dropdown"
|
|
149
|
+
? _c(
|
|
150
|
+
"a-dropdown",
|
|
151
|
+
[
|
|
152
|
+
_c(
|
|
153
|
+
"a-menu",
|
|
154
|
+
{
|
|
155
|
+
attrs: { slot: "overlay" },
|
|
156
|
+
on: { click: _vm.handleMenuClick },
|
|
157
|
+
slot: "overlay",
|
|
158
|
+
},
|
|
159
|
+
_vm._l(_vm.dataSource, function (opt) {
|
|
160
|
+
return _c("a-menu-item", { key: opt.value }, [
|
|
161
|
+
_vm._v("\n " + _vm._s(opt.label) + "\n "),
|
|
162
|
+
])
|
|
163
|
+
}),
|
|
164
|
+
1
|
|
165
|
+
),
|
|
166
|
+
_vm._v(" "),
|
|
167
|
+
_c(
|
|
168
|
+
"a-button",
|
|
169
|
+
{ attrs: { type: _vm.type } },
|
|
170
|
+
[
|
|
171
|
+
_vm._t("default"),
|
|
172
|
+
_vm._v(" "),
|
|
173
|
+
_c("a-icon", { attrs: { type: _vm.icon } }),
|
|
174
|
+
],
|
|
175
|
+
2
|
|
176
|
+
),
|
|
177
|
+
],
|
|
178
|
+
1
|
|
179
|
+
)
|
|
180
|
+
: _c(
|
|
181
|
+
"a-button",
|
|
182
|
+
{
|
|
183
|
+
attrs: { type: _vm.type, icon: _vm.icon },
|
|
184
|
+
on: { click: _vm.handleClick },
|
|
185
|
+
},
|
|
186
|
+
[_vm._t("default")],
|
|
187
|
+
2
|
|
188
|
+
)
|
|
189
|
+
};
|
|
190
|
+
var __vue_staticRenderFns__$n = [];
|
|
191
|
+
__vue_render__$n._withStripped = true;
|
|
192
|
+
|
|
193
|
+
/* style */
|
|
194
|
+
const __vue_inject_styles__$n = undefined;
|
|
195
|
+
/* scoped */
|
|
196
|
+
const __vue_scope_id__$n = undefined;
|
|
197
|
+
/* module identifier */
|
|
198
|
+
const __vue_module_identifier__$n = undefined;
|
|
199
|
+
/* functional template */
|
|
200
|
+
const __vue_is_functional_template__$n = false;
|
|
201
|
+
/* style inject */
|
|
202
|
+
|
|
203
|
+
/* style inject SSR */
|
|
204
|
+
|
|
205
|
+
/* style inject shadow dom */
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
const __vue_component__$n = /*#__PURE__*/normalizeComponent(
|
|
210
|
+
{ render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
|
|
211
|
+
__vue_inject_styles__$n,
|
|
212
|
+
__vue_script__$n,
|
|
213
|
+
__vue_scope_id__$n,
|
|
214
|
+
__vue_is_functional_template__$n,
|
|
215
|
+
__vue_module_identifier__$n,
|
|
216
|
+
false,
|
|
217
|
+
undefined,
|
|
218
|
+
undefined,
|
|
219
|
+
undefined
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
__vue_component__$n.install = Vue => Vue.component(__vue_component__$n.name, __vue_component__$n);
|
|
223
|
+
|
|
224
|
+
//
|
|
225
|
+
//
|
|
226
|
+
//
|
|
227
|
+
//
|
|
228
|
+
//
|
|
229
|
+
//
|
|
230
|
+
//
|
|
231
|
+
//
|
|
232
|
+
//
|
|
233
|
+
//
|
|
234
|
+
//
|
|
235
|
+
//
|
|
236
|
+
|
|
237
|
+
var script$m = {
|
|
238
|
+
name: 'ele-date',
|
|
239
|
+
props: {
|
|
240
|
+
value: {
|
|
241
|
+
type: Object
|
|
242
|
+
},
|
|
243
|
+
format: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: 'YYYY/MM/DD'
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
data() {
|
|
249
|
+
return {
|
|
250
|
+
open: false
|
|
251
|
+
};
|
|
252
|
+
},
|
|
253
|
+
methods: {
|
|
254
|
+
onFocus() {
|
|
255
|
+
this.open = true;
|
|
256
|
+
},
|
|
257
|
+
onPanelChange(value, mode) {
|
|
258
|
+
this.$emit('input', value);
|
|
259
|
+
this.open = false;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/* script */
|
|
265
|
+
const __vue_script__$m = script$m;
|
|
266
|
+
|
|
267
|
+
/* template */
|
|
268
|
+
var __vue_render__$m = function () {
|
|
269
|
+
var _vm = this;
|
|
270
|
+
var _h = _vm.$createElement;
|
|
271
|
+
var _c = _vm._self._c || _h;
|
|
272
|
+
return _c("a-date-picker", {
|
|
273
|
+
staticStyle: { width: "100%" },
|
|
274
|
+
attrs: {
|
|
275
|
+
mode: "year",
|
|
276
|
+
open: _vm.open,
|
|
277
|
+
value: _vm.value,
|
|
278
|
+
format: _vm.format,
|
|
279
|
+
},
|
|
280
|
+
on: { focus: _vm.onFocus, panelChange: _vm.onPanelChange },
|
|
281
|
+
})
|
|
282
|
+
};
|
|
283
|
+
var __vue_staticRenderFns__$m = [];
|
|
284
|
+
__vue_render__$m._withStripped = true;
|
|
285
|
+
|
|
286
|
+
/* style */
|
|
287
|
+
const __vue_inject_styles__$m = undefined;
|
|
288
|
+
/* scoped */
|
|
289
|
+
const __vue_scope_id__$m = undefined;
|
|
290
|
+
/* module identifier */
|
|
291
|
+
const __vue_module_identifier__$m = undefined;
|
|
292
|
+
/* functional template */
|
|
293
|
+
const __vue_is_functional_template__$m = false;
|
|
294
|
+
/* style inject */
|
|
295
|
+
|
|
296
|
+
/* style inject SSR */
|
|
297
|
+
|
|
298
|
+
/* style inject shadow dom */
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
const __vue_component__$m = /*#__PURE__*/normalizeComponent(
|
|
303
|
+
{ render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
|
|
304
|
+
__vue_inject_styles__$m,
|
|
305
|
+
__vue_script__$m,
|
|
306
|
+
__vue_scope_id__$m,
|
|
307
|
+
__vue_is_functional_template__$m,
|
|
308
|
+
__vue_module_identifier__$m,
|
|
309
|
+
false,
|
|
310
|
+
undefined,
|
|
311
|
+
undefined,
|
|
312
|
+
undefined
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
__vue_component__$m.install = Vue => Vue.component(__vue_component__$m.name, __vue_component__$m);
|
|
316
|
+
|
|
317
|
+
//
|
|
318
|
+
//
|
|
319
|
+
//
|
|
320
|
+
//
|
|
321
|
+
|
|
322
|
+
var script$l = {
|
|
323
|
+
name: 'ele-input',
|
|
324
|
+
props: {
|
|
325
|
+
maxLength: {
|
|
326
|
+
type: Number,
|
|
327
|
+
default: 125
|
|
328
|
+
},
|
|
329
|
+
value: {
|
|
330
|
+
type: String
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
methods: {
|
|
334
|
+
onChange(e) {
|
|
335
|
+
this.$emit('change', e.target.value);
|
|
336
|
+
this.$emit('input', e.target.value);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
const isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
342
|
+
function createInjector(context) {
|
|
343
|
+
return (id, style) => addStyle(id, style);
|
|
344
|
+
}
|
|
345
|
+
let HEAD;
|
|
346
|
+
const styles = {};
|
|
347
|
+
function addStyle(id, css) {
|
|
348
|
+
const group = isOldIE ? css.media || 'default' : id;
|
|
349
|
+
const style = styles[group] || (styles[group] = {
|
|
350
|
+
ids: new Set(),
|
|
351
|
+
styles: []
|
|
352
|
+
});
|
|
353
|
+
if (!style.ids.has(id)) {
|
|
354
|
+
style.ids.add(id);
|
|
355
|
+
let code = css.source;
|
|
356
|
+
if (css.map) {
|
|
357
|
+
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
358
|
+
// this makes source maps inside style tags work properly in Chrome
|
|
359
|
+
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
360
|
+
// http://stackoverflow.com/a/26603875
|
|
361
|
+
code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';
|
|
362
|
+
}
|
|
363
|
+
if (!style.element) {
|
|
364
|
+
style.element = document.createElement('style');
|
|
365
|
+
style.element.type = 'text/css';
|
|
366
|
+
if (css.media) style.element.setAttribute('media', css.media);
|
|
367
|
+
if (HEAD === undefined) {
|
|
368
|
+
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
369
|
+
}
|
|
370
|
+
HEAD.appendChild(style.element);
|
|
371
|
+
}
|
|
372
|
+
if ('styleSheet' in style.element) {
|
|
373
|
+
style.styles.push(code);
|
|
374
|
+
style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\n');
|
|
375
|
+
} else {
|
|
376
|
+
const index = style.ids.size - 1;
|
|
377
|
+
const textNode = document.createTextNode(code);
|
|
378
|
+
const nodes = style.element.childNodes;
|
|
379
|
+
if (nodes[index]) style.element.removeChild(nodes[index]);
|
|
380
|
+
if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* script */
|
|
386
|
+
const __vue_script__$l = script$l;
|
|
387
|
+
|
|
388
|
+
/* template */
|
|
389
|
+
var __vue_render__$l = function () {
|
|
390
|
+
var _vm = this;
|
|
391
|
+
var _h = _vm.$createElement;
|
|
392
|
+
var _c = _vm._self._c || _h;
|
|
393
|
+
return _c("a-input", {
|
|
394
|
+
attrs: { value: _vm.value, "max-length": _vm.maxLength },
|
|
395
|
+
on: { change: _vm.onChange },
|
|
396
|
+
})
|
|
397
|
+
};
|
|
398
|
+
var __vue_staticRenderFns__$l = [];
|
|
399
|
+
__vue_render__$l._withStripped = true;
|
|
400
|
+
|
|
401
|
+
/* style */
|
|
402
|
+
const __vue_inject_styles__$l = function (inject) {
|
|
403
|
+
if (!inject) return
|
|
404
|
+
inject("data-v-468d0810_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
405
|
+
|
|
406
|
+
};
|
|
407
|
+
/* scoped */
|
|
408
|
+
const __vue_scope_id__$l = "data-v-468d0810";
|
|
409
|
+
/* module identifier */
|
|
410
|
+
const __vue_module_identifier__$l = undefined;
|
|
411
|
+
/* functional template */
|
|
412
|
+
const __vue_is_functional_template__$l = false;
|
|
413
|
+
/* style inject SSR */
|
|
414
|
+
|
|
415
|
+
/* style inject shadow dom */
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
const __vue_component__$l = /*#__PURE__*/normalizeComponent(
|
|
420
|
+
{ render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
|
|
421
|
+
__vue_inject_styles__$l,
|
|
422
|
+
__vue_script__$l,
|
|
423
|
+
__vue_scope_id__$l,
|
|
424
|
+
__vue_is_functional_template__$l,
|
|
425
|
+
__vue_module_identifier__$l,
|
|
426
|
+
false,
|
|
427
|
+
createInjector,
|
|
428
|
+
undefined,
|
|
429
|
+
undefined
|
|
430
|
+
);
|
|
431
|
+
|
|
432
|
+
__vue_component__$l.install = Vue => Vue.component(__vue_component__$l.name, __vue_component__$l);
|
|
433
|
+
|
|
434
|
+
//
|
|
435
|
+
//
|
|
436
|
+
//
|
|
437
|
+
//
|
|
438
|
+
//
|
|
439
|
+
//
|
|
440
|
+
//
|
|
441
|
+
//
|
|
442
|
+
|
|
443
|
+
var script$k = {
|
|
444
|
+
name: 'ele-select',
|
|
445
|
+
props: {
|
|
446
|
+
value: {
|
|
447
|
+
type: [String, Array, Number]
|
|
448
|
+
},
|
|
449
|
+
defaultValue: {
|
|
450
|
+
type: [String, Array, Number]
|
|
451
|
+
},
|
|
452
|
+
dataSource: {
|
|
453
|
+
type: Array,
|
|
454
|
+
default: () => []
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
methods: {
|
|
458
|
+
onChange(value) {
|
|
459
|
+
this.$emit('change', value);
|
|
460
|
+
this.$emit('input', value);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
/* script */
|
|
466
|
+
const __vue_script__$k = script$k;
|
|
467
|
+
|
|
468
|
+
/* template */
|
|
469
|
+
var __vue_render__$k = function () {
|
|
470
|
+
var _vm = this;
|
|
471
|
+
var _h = _vm.$createElement;
|
|
472
|
+
var _c = _vm._self._c || _h;
|
|
473
|
+
return _c(
|
|
474
|
+
"a-select",
|
|
475
|
+
{
|
|
476
|
+
staticStyle: { width: "100%" },
|
|
477
|
+
attrs: { value: _vm.value },
|
|
478
|
+
on: { change: _vm.onChange },
|
|
479
|
+
},
|
|
480
|
+
_vm._l(_vm.dataSource, function (item) {
|
|
481
|
+
return _c(
|
|
482
|
+
"a-select-option",
|
|
483
|
+
{ key: item.value, attrs: { value: item.value } },
|
|
484
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
485
|
+
)
|
|
486
|
+
}),
|
|
487
|
+
1
|
|
488
|
+
)
|
|
489
|
+
};
|
|
490
|
+
var __vue_staticRenderFns__$k = [];
|
|
491
|
+
__vue_render__$k._withStripped = true;
|
|
492
|
+
|
|
493
|
+
/* style */
|
|
494
|
+
const __vue_inject_styles__$k = function (inject) {
|
|
495
|
+
if (!inject) return
|
|
496
|
+
inject("data-v-499435e8_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
497
|
+
|
|
498
|
+
};
|
|
499
|
+
/* scoped */
|
|
500
|
+
const __vue_scope_id__$k = "data-v-499435e8";
|
|
501
|
+
/* module identifier */
|
|
502
|
+
const __vue_module_identifier__$k = undefined;
|
|
503
|
+
/* functional template */
|
|
504
|
+
const __vue_is_functional_template__$k = false;
|
|
505
|
+
/* style inject SSR */
|
|
506
|
+
|
|
507
|
+
/* style inject shadow dom */
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
const __vue_component__$k = /*#__PURE__*/normalizeComponent(
|
|
512
|
+
{ render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
|
|
513
|
+
__vue_inject_styles__$k,
|
|
514
|
+
__vue_script__$k,
|
|
515
|
+
__vue_scope_id__$k,
|
|
516
|
+
__vue_is_functional_template__$k,
|
|
517
|
+
__vue_module_identifier__$k,
|
|
518
|
+
false,
|
|
519
|
+
createInjector,
|
|
520
|
+
undefined,
|
|
521
|
+
undefined
|
|
522
|
+
);
|
|
523
|
+
|
|
524
|
+
__vue_component__$k.install = Vue => Vue.component(__vue_component__$k.name, __vue_component__$k);
|
|
525
|
+
|
|
526
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
527
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
528
|
+
// generators (like Math.random()).
|
|
529
|
+
let getRandomValues;
|
|
530
|
+
const rnds8 = new Uint8Array(16);
|
|
531
|
+
function rng() {
|
|
532
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
533
|
+
if (!getRandomValues) {
|
|
534
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
535
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
536
|
+
if (!getRandomValues) {
|
|
537
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return getRandomValues(rnds8);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
544
|
+
|
|
545
|
+
function validate(uuid) {
|
|
546
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
551
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
552
|
+
*/
|
|
553
|
+
|
|
554
|
+
const byteToHex = [];
|
|
555
|
+
for (let i = 0; i < 256; ++i) {
|
|
556
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
557
|
+
}
|
|
558
|
+
function unsafeStringify(arr, offset = 0) {
|
|
559
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
560
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
561
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
function parse$1(uuid) {
|
|
565
|
+
if (!validate(uuid)) {
|
|
566
|
+
throw TypeError('Invalid UUID');
|
|
567
|
+
}
|
|
568
|
+
let v;
|
|
569
|
+
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
570
|
+
|
|
571
|
+
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
572
|
+
arr[1] = v >>> 16 & 0xff;
|
|
573
|
+
arr[2] = v >>> 8 & 0xff;
|
|
574
|
+
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
575
|
+
|
|
576
|
+
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
577
|
+
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
578
|
+
|
|
579
|
+
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
580
|
+
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
581
|
+
|
|
582
|
+
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
583
|
+
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
584
|
+
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
585
|
+
|
|
586
|
+
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
587
|
+
arr[11] = v / 0x100000000 & 0xff;
|
|
588
|
+
arr[12] = v >>> 24 & 0xff;
|
|
589
|
+
arr[13] = v >>> 16 & 0xff;
|
|
590
|
+
arr[14] = v >>> 8 & 0xff;
|
|
591
|
+
arr[15] = v & 0xff;
|
|
592
|
+
return arr;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function stringToBytes(str) {
|
|
596
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
597
|
+
|
|
598
|
+
const bytes = [];
|
|
599
|
+
for (let i = 0; i < str.length; ++i) {
|
|
600
|
+
bytes.push(str.charCodeAt(i));
|
|
601
|
+
}
|
|
602
|
+
return bytes;
|
|
603
|
+
}
|
|
604
|
+
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
605
|
+
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
606
|
+
function v35(name, version, hashfunc) {
|
|
607
|
+
function generateUUID(value, namespace, buf, offset) {
|
|
608
|
+
var _namespace;
|
|
609
|
+
if (typeof value === 'string') {
|
|
610
|
+
value = stringToBytes(value);
|
|
611
|
+
}
|
|
612
|
+
if (typeof namespace === 'string') {
|
|
613
|
+
namespace = parse$1(namespace);
|
|
614
|
+
}
|
|
615
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
616
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
617
|
+
} // Compute hash of namespace and value, Per 4.3
|
|
618
|
+
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
619
|
+
// hashfunc([...namespace, ... value])`
|
|
620
|
+
|
|
621
|
+
let bytes = new Uint8Array(16 + value.length);
|
|
622
|
+
bytes.set(namespace);
|
|
623
|
+
bytes.set(value, namespace.length);
|
|
624
|
+
bytes = hashfunc(bytes);
|
|
625
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
626
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
627
|
+
if (buf) {
|
|
628
|
+
offset = offset || 0;
|
|
629
|
+
for (let i = 0; i < 16; ++i) {
|
|
630
|
+
buf[offset + i] = bytes[i];
|
|
631
|
+
}
|
|
632
|
+
return buf;
|
|
633
|
+
}
|
|
634
|
+
return unsafeStringify(bytes);
|
|
635
|
+
} // Function#name is not settable on some platforms (#270)
|
|
636
|
+
|
|
637
|
+
try {
|
|
638
|
+
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
639
|
+
} catch (err) {} // For CommonJS default export support
|
|
640
|
+
|
|
641
|
+
generateUUID.DNS = DNS;
|
|
642
|
+
generateUUID.URL = URL;
|
|
643
|
+
return generateUUID;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
647
|
+
var native = {
|
|
648
|
+
randomUUID
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
function v4(options, buf, offset) {
|
|
652
|
+
if (native.randomUUID && !buf && !options) {
|
|
653
|
+
return native.randomUUID();
|
|
654
|
+
}
|
|
655
|
+
options = options || {};
|
|
656
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
657
|
+
|
|
658
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
659
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
660
|
+
|
|
661
|
+
if (buf) {
|
|
662
|
+
offset = offset || 0;
|
|
663
|
+
for (let i = 0; i < 16; ++i) {
|
|
664
|
+
buf[offset + i] = rnds[i];
|
|
665
|
+
}
|
|
666
|
+
return buf;
|
|
667
|
+
}
|
|
668
|
+
return unsafeStringify(rnds);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
672
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
673
|
+
function f(s, x, y, z) {
|
|
674
|
+
switch (s) {
|
|
675
|
+
case 0:
|
|
676
|
+
return x & y ^ ~x & z;
|
|
677
|
+
case 1:
|
|
678
|
+
return x ^ y ^ z;
|
|
679
|
+
case 2:
|
|
680
|
+
return x & y ^ x & z ^ y & z;
|
|
681
|
+
case 3:
|
|
682
|
+
return x ^ y ^ z;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
function ROTL(x, n) {
|
|
686
|
+
return x << n | x >>> 32 - n;
|
|
687
|
+
}
|
|
688
|
+
function sha1(bytes) {
|
|
689
|
+
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
690
|
+
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
691
|
+
if (typeof bytes === 'string') {
|
|
692
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
693
|
+
|
|
694
|
+
bytes = [];
|
|
695
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
696
|
+
bytes.push(msg.charCodeAt(i));
|
|
697
|
+
}
|
|
698
|
+
} else if (!Array.isArray(bytes)) {
|
|
699
|
+
// Convert Array-like to Array
|
|
700
|
+
bytes = Array.prototype.slice.call(bytes);
|
|
701
|
+
}
|
|
702
|
+
bytes.push(0x80);
|
|
703
|
+
const l = bytes.length / 4 + 2;
|
|
704
|
+
const N = Math.ceil(l / 16);
|
|
705
|
+
const M = new Array(N);
|
|
706
|
+
for (let i = 0; i < N; ++i) {
|
|
707
|
+
const arr = new Uint32Array(16);
|
|
708
|
+
for (let j = 0; j < 16; ++j) {
|
|
709
|
+
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
710
|
+
}
|
|
711
|
+
M[i] = arr;
|
|
712
|
+
}
|
|
713
|
+
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
714
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
715
|
+
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
716
|
+
for (let i = 0; i < N; ++i) {
|
|
717
|
+
const W = new Uint32Array(80);
|
|
718
|
+
for (let t = 0; t < 16; ++t) {
|
|
719
|
+
W[t] = M[i][t];
|
|
720
|
+
}
|
|
721
|
+
for (let t = 16; t < 80; ++t) {
|
|
722
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
723
|
+
}
|
|
724
|
+
let a = H[0];
|
|
725
|
+
let b = H[1];
|
|
726
|
+
let c = H[2];
|
|
727
|
+
let d = H[3];
|
|
728
|
+
let e = H[4];
|
|
729
|
+
for (let t = 0; t < 80; ++t) {
|
|
730
|
+
const s = Math.floor(t / 20);
|
|
731
|
+
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
732
|
+
e = d;
|
|
733
|
+
d = c;
|
|
734
|
+
c = ROTL(b, 30) >>> 0;
|
|
735
|
+
b = a;
|
|
736
|
+
a = T;
|
|
737
|
+
}
|
|
738
|
+
H[0] = H[0] + a >>> 0;
|
|
739
|
+
H[1] = H[1] + b >>> 0;
|
|
740
|
+
H[2] = H[2] + c >>> 0;
|
|
741
|
+
H[3] = H[3] + d >>> 0;
|
|
742
|
+
H[4] = H[4] + e >>> 0;
|
|
743
|
+
}
|
|
744
|
+
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
const v5 = v35('v5', 0x50, sha1);
|
|
748
|
+
var uuidv5 = v5;
|
|
749
|
+
|
|
750
|
+
const ESCAPE = {
|
|
751
|
+
"n": "\n",
|
|
752
|
+
"f": "\f",
|
|
753
|
+
"r": "\r",
|
|
754
|
+
"t": " ",
|
|
755
|
+
"v": "\v"
|
|
756
|
+
};
|
|
757
|
+
const CONSTANTS = {
|
|
758
|
+
"null": data => null,
|
|
759
|
+
"true": data => true,
|
|
760
|
+
"false": data => false,
|
|
761
|
+
"undefined": data => void 0
|
|
762
|
+
};
|
|
763
|
+
const OPERATORS = {
|
|
764
|
+
"+": (data, a, b) => a(data) + b(data),
|
|
765
|
+
"-": (data, a, b) => a(data) - b(data),
|
|
766
|
+
"*": (data, a, b) => a(data) * b(data),
|
|
767
|
+
"/": (data, a, b) => a(data) / b(data),
|
|
768
|
+
"%": (data, a, b) => a(data) % b(data),
|
|
769
|
+
"===": (data, a, b) => a(data) === b(data),
|
|
770
|
+
"!==": (data, a, b) => a(data) !== b(data),
|
|
771
|
+
"==": (data, a, b) => a(data) == b(data),
|
|
772
|
+
"!=": (data, a, b) => a(data) != b(data),
|
|
773
|
+
"<": (data, a, b) => a(data) < b(data),
|
|
774
|
+
">": (data, a, b) => a(data) > b(data),
|
|
775
|
+
"<=": (data, a, b) => a(data) <= b(data),
|
|
776
|
+
">=": (data, a, b) => a(data) >= b(data),
|
|
777
|
+
"&&": (data, a, b) => a(data) && b(data),
|
|
778
|
+
"||": (data, a, b) => a(data) || b(data),
|
|
779
|
+
"!": (data, a) => !a(data)
|
|
780
|
+
};
|
|
781
|
+
function isNumber(char) {
|
|
782
|
+
return char >= "0" && char <= "9" && typeof char === "string";
|
|
783
|
+
}
|
|
784
|
+
function isExpOperator(char) {
|
|
785
|
+
return char === "-" || char === "+" || isNumber(char);
|
|
786
|
+
}
|
|
787
|
+
function isIdent(char) {
|
|
788
|
+
return char >= "a" && char <= "z" || char >= "A" && char <= "Z" || char === "_" || char === "$";
|
|
789
|
+
}
|
|
790
|
+
class Expression {
|
|
791
|
+
constructor(content) {
|
|
792
|
+
if (!content) throw new Error("invalid expression");
|
|
793
|
+
this.content = content;
|
|
794
|
+
}
|
|
795
|
+
lex() {
|
|
796
|
+
let content = this.content;
|
|
797
|
+
let length = content.length;
|
|
798
|
+
let index = 0;
|
|
799
|
+
let tokens = [];
|
|
800
|
+
while (index < length) {
|
|
801
|
+
let char = content.charAt(index);
|
|
802
|
+
if (char === '"' || char === "'") {
|
|
803
|
+
let start = ++index;
|
|
804
|
+
let escape = false;
|
|
805
|
+
let value = "";
|
|
806
|
+
let token;
|
|
807
|
+
while (index < length) {
|
|
808
|
+
let c = content.charAt(index);
|
|
809
|
+
if (escape) {
|
|
810
|
+
if (c === "u") {
|
|
811
|
+
let hex = content.substring(index + 1, index + 5);
|
|
812
|
+
if (!hex.match(/[\da-f]{4}/i)) {
|
|
813
|
+
throw new Error(`invalid expression: ${content}, invalid unicode escape [\\u${hex}]`);
|
|
814
|
+
}
|
|
815
|
+
index += 4;
|
|
816
|
+
value += String.fromCharCode(parseInt(hex, 16));
|
|
817
|
+
} else {
|
|
818
|
+
let rep = ESCAPE[c];
|
|
819
|
+
value = value + (rep || c);
|
|
820
|
+
}
|
|
821
|
+
escape = false;
|
|
822
|
+
} else if (c === "\\") {
|
|
823
|
+
escape = true;
|
|
824
|
+
} else if (c === char) {
|
|
825
|
+
index++;
|
|
826
|
+
token = {
|
|
827
|
+
index: start,
|
|
828
|
+
constant: true,
|
|
829
|
+
text: char + value + char,
|
|
830
|
+
value
|
|
831
|
+
};
|
|
832
|
+
break;
|
|
833
|
+
} else {
|
|
834
|
+
value += c;
|
|
835
|
+
}
|
|
836
|
+
index++;
|
|
837
|
+
}
|
|
838
|
+
if (!token) {
|
|
839
|
+
throw new Error(`invalid expression: ${content}`);
|
|
840
|
+
} else {
|
|
841
|
+
tokens.push(token);
|
|
842
|
+
}
|
|
843
|
+
} else if (isNumber(char) || char === "." && isNumber(content.charAt(index + 1))) {
|
|
844
|
+
let start = index;
|
|
845
|
+
let value = "";
|
|
846
|
+
while (index < length) {
|
|
847
|
+
let c = content.charAt(index).toLowerCase();
|
|
848
|
+
if (c === "." || isNumber(c)) {
|
|
849
|
+
value += c;
|
|
850
|
+
} else {
|
|
851
|
+
let c2 = content.charAt(index + 1);
|
|
852
|
+
if (c === "e" && isExpOperator(c2)) {
|
|
853
|
+
value += c;
|
|
854
|
+
} else if (isExpOperator(c) && c2 && isNumber(c2) && value.charAt(value.length - 1) === "e") {
|
|
855
|
+
value += c;
|
|
856
|
+
} else if (isExpOperator(c) && (!c2 || !isNumber(c2)) && value.charAt(value.length - 1) == "e") {
|
|
857
|
+
throw new Error(`invalid expression: ${content}`);
|
|
858
|
+
} else {
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
index++;
|
|
863
|
+
}
|
|
864
|
+
tokens.push({
|
|
865
|
+
index: start,
|
|
866
|
+
constant: true,
|
|
867
|
+
text: value,
|
|
868
|
+
value: Number(value)
|
|
869
|
+
});
|
|
870
|
+
} else if (isIdent(char)) {
|
|
871
|
+
let start = index;
|
|
872
|
+
while (index < length) {
|
|
873
|
+
let c = content.charAt(index);
|
|
874
|
+
if (!(isIdent(c) || isNumber(c))) {
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
index++;
|
|
878
|
+
}
|
|
879
|
+
tokens.push({
|
|
880
|
+
index: start,
|
|
881
|
+
text: content.slice(start, index),
|
|
882
|
+
identifier: true
|
|
883
|
+
});
|
|
884
|
+
} else if ("(){}[].,:?".indexOf(char) >= 0) {
|
|
885
|
+
tokens.push({
|
|
886
|
+
index,
|
|
887
|
+
text: char
|
|
888
|
+
});
|
|
889
|
+
index++;
|
|
890
|
+
} else if (char === " " || char === "\r" || char === " " || char === "\n" || char === "\v" || char === "\xA0") {
|
|
891
|
+
index++;
|
|
892
|
+
} else {
|
|
893
|
+
let char2 = char + content.charAt(index + 1);
|
|
894
|
+
let char3 = char2 + content.charAt(index + 2);
|
|
895
|
+
let op1 = OPERATORS[char];
|
|
896
|
+
let op2 = OPERATORS[char2];
|
|
897
|
+
let op3 = OPERATORS[char3];
|
|
898
|
+
if (op1 || op2 || op3) {
|
|
899
|
+
let text = op3 ? char3 : op2 ? char2 : char;
|
|
900
|
+
tokens.push({
|
|
901
|
+
index,
|
|
902
|
+
text,
|
|
903
|
+
operator: true
|
|
904
|
+
});
|
|
905
|
+
index += text.length;
|
|
906
|
+
} else {
|
|
907
|
+
throw new Error(`invalid expression: ${content}`);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
this.tokens = tokens;
|
|
912
|
+
return tokens;
|
|
913
|
+
}
|
|
914
|
+
parse() {
|
|
915
|
+
let tokens = this.lex();
|
|
916
|
+
let func;
|
|
917
|
+
let token = tokens[0];
|
|
918
|
+
let text = token.text;
|
|
919
|
+
if (tokens.length > 0 && text !== "}" && text !== ")" && text !== "]") {
|
|
920
|
+
func = this.expression();
|
|
921
|
+
}
|
|
922
|
+
return data => func && func(data);
|
|
923
|
+
}
|
|
924
|
+
expect(text) {
|
|
925
|
+
let tokens = this.tokens;
|
|
926
|
+
let token = tokens[0];
|
|
927
|
+
if (!text || text === (token && token.text)) {
|
|
928
|
+
return tokens.shift();
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
consume(text) {
|
|
932
|
+
if (!this.tokens.length) throw new Error(`parse expression error: ${this.content}`);
|
|
933
|
+
let token = this.expect(text);
|
|
934
|
+
if (!token) throw new Error(`parse expression error: ${this.content}`);
|
|
935
|
+
return token;
|
|
936
|
+
}
|
|
937
|
+
expression() {
|
|
938
|
+
return this.ternary();
|
|
939
|
+
}
|
|
940
|
+
ternary() {
|
|
941
|
+
let left = this.logicalOR();
|
|
942
|
+
if (this.expect("?")) {
|
|
943
|
+
let middle = this.expression();
|
|
944
|
+
this.consume(":");
|
|
945
|
+
let right = this.expression();
|
|
946
|
+
return data => left(data) ? middle(data) : right(data);
|
|
947
|
+
}
|
|
948
|
+
return left;
|
|
949
|
+
}
|
|
950
|
+
binary(left, op, right) {
|
|
951
|
+
let fn = OPERATORS[op];
|
|
952
|
+
return data => fn(data, left, right);
|
|
953
|
+
}
|
|
954
|
+
unary() {
|
|
955
|
+
let token;
|
|
956
|
+
if (this.expect("+")) {
|
|
957
|
+
return this.primary();
|
|
958
|
+
} else if (token = this.expect("-")) {
|
|
959
|
+
return this.binary(data => 0, token.text, this.unary());
|
|
960
|
+
} else if (token = this.expect("!")) {
|
|
961
|
+
let fn = OPERATORS[token.text];
|
|
962
|
+
let right = this.unary();
|
|
963
|
+
return data => fn(data, right);
|
|
964
|
+
} else {
|
|
965
|
+
return this.primary();
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
logicalOR() {
|
|
969
|
+
let left = this.logicalAND();
|
|
970
|
+
let token;
|
|
971
|
+
while (token = this.expect("||")) {
|
|
972
|
+
left = this.binary(left, token.text, this.logicalAND());
|
|
973
|
+
}
|
|
974
|
+
return left;
|
|
975
|
+
}
|
|
976
|
+
logicalAND() {
|
|
977
|
+
let left = this.equality();
|
|
978
|
+
let token;
|
|
979
|
+
while (token = this.expect("&&")) {
|
|
980
|
+
left = this.binary(left, token.text, this.equality());
|
|
981
|
+
}
|
|
982
|
+
return left;
|
|
983
|
+
}
|
|
984
|
+
equality() {
|
|
985
|
+
let left = this.relational();
|
|
986
|
+
let token;
|
|
987
|
+
while (token = this.expect("==") || this.expect("!=") || this.expect("===") || this.expect("!==")) {
|
|
988
|
+
left = this.binary(left, token.text, this.relational());
|
|
989
|
+
}
|
|
990
|
+
return left;
|
|
991
|
+
}
|
|
992
|
+
relational() {
|
|
993
|
+
let left = this.additive();
|
|
994
|
+
let token;
|
|
995
|
+
while (token = this.expect("<") || this.expect(">") || this.expect("<=") || this.expect(">=")) {
|
|
996
|
+
left = this.binary(left, token.text, this.additive());
|
|
997
|
+
}
|
|
998
|
+
return left;
|
|
999
|
+
}
|
|
1000
|
+
additive() {
|
|
1001
|
+
let left = this.multiplicative();
|
|
1002
|
+
let token;
|
|
1003
|
+
while (token = this.expect("+") || this.expect("-")) {
|
|
1004
|
+
left = this.binary(left, token.text, this.multiplicative());
|
|
1005
|
+
}
|
|
1006
|
+
return left;
|
|
1007
|
+
}
|
|
1008
|
+
multiplicative() {
|
|
1009
|
+
let left = this.unary();
|
|
1010
|
+
let token;
|
|
1011
|
+
while (token = this.expect("*") || this.expect("/") || this.expect("%")) {
|
|
1012
|
+
left = this.binary(left, token.text, this.unary());
|
|
1013
|
+
}
|
|
1014
|
+
return left;
|
|
1015
|
+
}
|
|
1016
|
+
primary() {
|
|
1017
|
+
let token = this.tokens[0];
|
|
1018
|
+
let primary;
|
|
1019
|
+
if (this.expect("(")) {
|
|
1020
|
+
primary = this.expression();
|
|
1021
|
+
this.consume(")");
|
|
1022
|
+
} else if (this.expect("[")) {
|
|
1023
|
+
primary = this.array();
|
|
1024
|
+
} else if (this.expect("{")) {
|
|
1025
|
+
primary = this.object();
|
|
1026
|
+
} else if (token.identifier && token.text in CONSTANTS) {
|
|
1027
|
+
primary = CONSTANTS[this.consume().text];
|
|
1028
|
+
} else if (token.identifier) {
|
|
1029
|
+
primary = this.identifier();
|
|
1030
|
+
} else if (token.constant) {
|
|
1031
|
+
primary = this.constant();
|
|
1032
|
+
} else {
|
|
1033
|
+
throw new Error(`parse expression error: ${this.content}`);
|
|
1034
|
+
}
|
|
1035
|
+
let next;
|
|
1036
|
+
let context;
|
|
1037
|
+
while (next = this.expect("(") || this.expect("[") || this.expect(".")) {
|
|
1038
|
+
if (next.text === "(") {
|
|
1039
|
+
primary = this.functionCall(primary, context);
|
|
1040
|
+
context = null;
|
|
1041
|
+
} else if (next.text === "[") {
|
|
1042
|
+
context = primary;
|
|
1043
|
+
primary = this.objectIndex(primary);
|
|
1044
|
+
} else {
|
|
1045
|
+
context = primary;
|
|
1046
|
+
primary = this.fieldAccess(primary);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return primary;
|
|
1050
|
+
}
|
|
1051
|
+
fieldAccess(object) {
|
|
1052
|
+
let getter = this.identifier();
|
|
1053
|
+
return data => {
|
|
1054
|
+
let o = object(data);
|
|
1055
|
+
return o && getter(o);
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
objectIndex(object) {
|
|
1059
|
+
let indexFn = this.expression();
|
|
1060
|
+
this.consume("]");
|
|
1061
|
+
return data => {
|
|
1062
|
+
let o = object(data);
|
|
1063
|
+
let key = indexFn(data) + "";
|
|
1064
|
+
return o && o[key];
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
functionCall(func, context) {
|
|
1068
|
+
let args = [];
|
|
1069
|
+
if (this.tokens[0].text !== ")") {
|
|
1070
|
+
do {
|
|
1071
|
+
args.push(this.expression());
|
|
1072
|
+
} while (this.expect(","));
|
|
1073
|
+
}
|
|
1074
|
+
this.consume(")");
|
|
1075
|
+
return data => {
|
|
1076
|
+
let callContext = context && context(data);
|
|
1077
|
+
let fn = func(data, callContext);
|
|
1078
|
+
return fn && fn.apply(callContext, args.length ? args.map(arg => arg(data)) : null);
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
array() {
|
|
1082
|
+
let elements = [];
|
|
1083
|
+
let token = this.tokens[0];
|
|
1084
|
+
if (token.text !== "]") {
|
|
1085
|
+
do {
|
|
1086
|
+
if (this.tokens[0].text === "]") break;
|
|
1087
|
+
elements.push(this.expression());
|
|
1088
|
+
} while (this.expect(","));
|
|
1089
|
+
}
|
|
1090
|
+
this.consume("]");
|
|
1091
|
+
return data => elements.map(element => element(data));
|
|
1092
|
+
}
|
|
1093
|
+
object() {
|
|
1094
|
+
let keys = [];
|
|
1095
|
+
let values = [];
|
|
1096
|
+
let token = this.tokens[0];
|
|
1097
|
+
if (token.text !== "}") {
|
|
1098
|
+
do {
|
|
1099
|
+
token = this.tokens[0];
|
|
1100
|
+
if (token.text === "}") break;
|
|
1101
|
+
token = this.consume();
|
|
1102
|
+
if (token.constant) {
|
|
1103
|
+
keys.push(token.value);
|
|
1104
|
+
} else if (token.identifier) {
|
|
1105
|
+
keys.push(token.text);
|
|
1106
|
+
} else {
|
|
1107
|
+
throw new Error(`parse expression error: ${this.content}`);
|
|
1108
|
+
}
|
|
1109
|
+
this.consume(":");
|
|
1110
|
+
values.push(this.expression());
|
|
1111
|
+
} while (this.expect(","));
|
|
1112
|
+
}
|
|
1113
|
+
this.consume("}");
|
|
1114
|
+
return data => {
|
|
1115
|
+
let object = {};
|
|
1116
|
+
for (let i = 0, length = values.length; i < length; i++) {
|
|
1117
|
+
object[keys[i]] = values[i](data);
|
|
1118
|
+
}
|
|
1119
|
+
return object;
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
identifier() {
|
|
1123
|
+
let id = this.consume().text;
|
|
1124
|
+
let token = this.tokens[0];
|
|
1125
|
+
let token2 = this.tokens[1];
|
|
1126
|
+
let token3 = this.tokens[2];
|
|
1127
|
+
while (token && token.text === "." && token2 && token2.identifier && token3 && token3.text !== "(") {
|
|
1128
|
+
id += this.consume().text + this.consume().text;
|
|
1129
|
+
token = this.tokens[0];
|
|
1130
|
+
token2 = this.tokens[1];
|
|
1131
|
+
token3 = this.tokens[2];
|
|
1132
|
+
}
|
|
1133
|
+
return data => {
|
|
1134
|
+
let elements = id.split(".");
|
|
1135
|
+
let key;
|
|
1136
|
+
for (let i = 0; elements.length > 1; i++) {
|
|
1137
|
+
key = elements.shift();
|
|
1138
|
+
data = data[key];
|
|
1139
|
+
if (!data) break;
|
|
1140
|
+
}
|
|
1141
|
+
key = elements.shift();
|
|
1142
|
+
return data && data[key];
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
constant() {
|
|
1146
|
+
let value = this.consume().value;
|
|
1147
|
+
return data => value;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
const parse = (expression, props = {}) => {
|
|
1151
|
+
if (!expression) throw new Error("expression is required");
|
|
1152
|
+
const execParse = new Expression(expression).parse();
|
|
1153
|
+
return execParse(props);
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
//
|
|
1157
|
+
const MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002';
|
|
1158
|
+
var script$j = {
|
|
1159
|
+
props: {
|
|
1160
|
+
record: {
|
|
1161
|
+
type: Object
|
|
1162
|
+
},
|
|
1163
|
+
dataSource: {
|
|
1164
|
+
type: Array,
|
|
1165
|
+
default: () => []
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
inject: {
|
|
1169
|
+
requestTreeData: {
|
|
1170
|
+
default: void 0
|
|
1171
|
+
},
|
|
1172
|
+
requestTableData: {
|
|
1173
|
+
default: void 0
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
computed: {
|
|
1177
|
+
menuKeyDelimiter() {
|
|
1178
|
+
return uuidv5('_', MENU_KEY_NAMESPACE);
|
|
1179
|
+
},
|
|
1180
|
+
builtInMethods() {
|
|
1181
|
+
return {
|
|
1182
|
+
requestTreeData: this.requestTreeData,
|
|
1183
|
+
requestTableData: this.requestTableData
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
methods: {
|
|
1188
|
+
execOperationExpression(dataSource = []) {
|
|
1189
|
+
const ret = dataSource.map(item => {
|
|
1190
|
+
const {
|
|
1191
|
+
show
|
|
1192
|
+
} = item;
|
|
1193
|
+
if (type.isUndefined(show)) {
|
|
1194
|
+
return item;
|
|
1195
|
+
} else if (type.isBool(show)) {
|
|
1196
|
+
if (show) return item;
|
|
1197
|
+
} else if (type.isStr(show)) {
|
|
1198
|
+
const parseRet = parse(show, {
|
|
1199
|
+
...this.record,
|
|
1200
|
+
_route: route.searchToQueryParams(window.location.search)
|
|
1201
|
+
});
|
|
1202
|
+
if (parseRet) return item;
|
|
1203
|
+
}
|
|
1204
|
+
}).filter(item => item);
|
|
1205
|
+
return ret;
|
|
1206
|
+
},
|
|
1207
|
+
handleClickConfirm(props) {
|
|
1208
|
+
//TODO generate event by special rule
|
|
1209
|
+
const {
|
|
1210
|
+
eventName,
|
|
1211
|
+
value
|
|
1212
|
+
} = props;
|
|
1213
|
+
this.$emit(eventName, {
|
|
1214
|
+
key: value,
|
|
1215
|
+
record: this.record,
|
|
1216
|
+
builtInMethods: this.builtInMethods
|
|
1217
|
+
});
|
|
1218
|
+
},
|
|
1219
|
+
handleDropdownClick(props) {
|
|
1220
|
+
const {
|
|
1221
|
+
key
|
|
1222
|
+
} = props;
|
|
1223
|
+
const [parent, child] = key.split(this.menuKeyDelimiter);
|
|
1224
|
+
if (!parent || !child) {
|
|
1225
|
+
throw new Error('key is required');
|
|
1226
|
+
}
|
|
1227
|
+
const currentDropdown = this.dataSource.find(item => item.key === parent);
|
|
1228
|
+
const currentClickTarget = currentDropdown.optionList.find(item => item.value === child);
|
|
1229
|
+
const {
|
|
1230
|
+
eventName,
|
|
1231
|
+
type
|
|
1232
|
+
} = currentClickTarget;
|
|
1233
|
+
//TODO generate event by special rule
|
|
1234
|
+
if (type === 'confirm') return;
|
|
1235
|
+
this.$emit(eventName, {
|
|
1236
|
+
key: child,
|
|
1237
|
+
record: this.record,
|
|
1238
|
+
builtInMethods: this.builtInMethods
|
|
1239
|
+
});
|
|
1240
|
+
},
|
|
1241
|
+
handleClickText(props) {
|
|
1242
|
+
const {
|
|
1243
|
+
eventName,
|
|
1244
|
+
key
|
|
1245
|
+
} = props;
|
|
1246
|
+
this.$emit(eventName, {
|
|
1247
|
+
key,
|
|
1248
|
+
record: this.record,
|
|
1249
|
+
builtInMethods: this.builtInMethods
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
/* script */
|
|
1256
|
+
const __vue_script__$j = script$j;
|
|
1257
|
+
|
|
1258
|
+
/* template */
|
|
1259
|
+
var __vue_render__$j = function () {
|
|
1260
|
+
var _vm = this;
|
|
1261
|
+
var _h = _vm.$createElement;
|
|
1262
|
+
var _c = _vm._self._c || _h;
|
|
1263
|
+
return _c(
|
|
1264
|
+
"div",
|
|
1265
|
+
{ staticClass: "g-table__action" },
|
|
1266
|
+
_vm._l(_vm.execOperationExpression(_vm.dataSource), function (item, idx) {
|
|
1267
|
+
return _c(
|
|
1268
|
+
"div",
|
|
1269
|
+
{ key: idx, staticClass: "table-action__item" },
|
|
1270
|
+
[
|
|
1271
|
+
item.type == "text"
|
|
1272
|
+
? [
|
|
1273
|
+
_c(
|
|
1274
|
+
"span",
|
|
1275
|
+
{
|
|
1276
|
+
on: {
|
|
1277
|
+
click: function ($event) {
|
|
1278
|
+
return _vm.handleClickText(item)
|
|
1279
|
+
},
|
|
1280
|
+
},
|
|
1281
|
+
},
|
|
1282
|
+
[_vm._v(_vm._s(item.label))]
|
|
1283
|
+
),
|
|
1284
|
+
]
|
|
1285
|
+
: item.type == "dropdown"
|
|
1286
|
+
? [
|
|
1287
|
+
_c(
|
|
1288
|
+
"a-dropdown",
|
|
1289
|
+
[
|
|
1290
|
+
_c(
|
|
1291
|
+
"a-menu",
|
|
1292
|
+
{
|
|
1293
|
+
attrs: { slot: "overlay" },
|
|
1294
|
+
on: { click: _vm.handleDropdownClick },
|
|
1295
|
+
slot: "overlay",
|
|
1296
|
+
},
|
|
1297
|
+
_vm._l(
|
|
1298
|
+
_vm.execOperationExpression(item.optionList),
|
|
1299
|
+
function (opt) {
|
|
1300
|
+
return _c(
|
|
1301
|
+
"a-menu-item",
|
|
1302
|
+
{
|
|
1303
|
+
key:
|
|
1304
|
+
"" +
|
|
1305
|
+
(item.key || "") +
|
|
1306
|
+
_vm.menuKeyDelimiter +
|
|
1307
|
+
(opt.value || ""),
|
|
1308
|
+
},
|
|
1309
|
+
[
|
|
1310
|
+
opt.type == "confirm"
|
|
1311
|
+
? [
|
|
1312
|
+
_c(
|
|
1313
|
+
"a-popconfirm",
|
|
1314
|
+
{
|
|
1315
|
+
attrs: { title: opt.message },
|
|
1316
|
+
on: {
|
|
1317
|
+
confirm: function ($event) {
|
|
1318
|
+
return _vm.handleClickConfirm(opt)
|
|
1319
|
+
},
|
|
1320
|
+
},
|
|
1321
|
+
},
|
|
1322
|
+
[
|
|
1323
|
+
_vm._v(
|
|
1324
|
+
"\n " +
|
|
1325
|
+
_vm._s(opt.label) +
|
|
1326
|
+
"\n "
|
|
1327
|
+
),
|
|
1328
|
+
]
|
|
1329
|
+
),
|
|
1330
|
+
]
|
|
1331
|
+
: [
|
|
1332
|
+
_vm._v(
|
|
1333
|
+
"\n " +
|
|
1334
|
+
_vm._s(opt.label) +
|
|
1335
|
+
"\n "
|
|
1336
|
+
),
|
|
1337
|
+
],
|
|
1338
|
+
],
|
|
1339
|
+
2
|
|
1340
|
+
)
|
|
1341
|
+
}
|
|
1342
|
+
),
|
|
1343
|
+
1
|
|
1344
|
+
),
|
|
1345
|
+
_vm._v(" "),
|
|
1346
|
+
_c("span", [_vm._v(_vm._s(item.label))]),
|
|
1347
|
+
],
|
|
1348
|
+
1
|
|
1349
|
+
),
|
|
1350
|
+
]
|
|
1351
|
+
: _vm._e(),
|
|
1352
|
+
],
|
|
1353
|
+
2
|
|
1354
|
+
)
|
|
1355
|
+
}),
|
|
1356
|
+
0
|
|
1357
|
+
)
|
|
1358
|
+
};
|
|
1359
|
+
var __vue_staticRenderFns__$j = [];
|
|
1360
|
+
__vue_render__$j._withStripped = true;
|
|
1361
|
+
|
|
1362
|
+
/* style */
|
|
1363
|
+
const __vue_inject_styles__$j = function (inject) {
|
|
1364
|
+
if (!inject) return
|
|
1365
|
+
inject("data-v-572820bc_0", { source: ".g-table__action[data-v-572820bc] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-572820bc] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-572820bc]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\table\\src\\action.vue","action.vue"],"names":[],"mappings":"AAsHA;EACA,aAAA;EACA,mBAAA;ACrHA;ADsHA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;ACpHA;ADqHA;EACA,cAAA;ACnHA;;AAEA,qCAAqC","file":"action.vue","sourcesContent":["<template>\r\n <div class=\"g-table__action\">\r\n <div class=\"table-action__item\" v-for=\"(item, idx) in execOperationExpression(dataSource)\" :key=\"idx\">\r\n <template v-if=\"item.type == 'text'\">\r\n <span @click=\"handleClickText(item)\">{{ item.label }}</span>\r\n </template>\r\n <template v-else-if=\"item.type == 'dropdown'\">\r\n <a-dropdown>\r\n <a-menu slot=\"overlay\" @click=\"handleDropdownClick\">\r\n <a-menu-item :key=\"`${item.key || ''}${menuKeyDelimiter}${opt.value || ''}`\" v-for=\"opt in execOperationExpression(item.optionList)\">\r\n <template v-if=\"opt.type == 'confirm'\">\r\n <a-popconfirm :title=\"opt.message\" @confirm=\"handleClickConfirm(opt)\">\r\n {{ opt.label }}\r\n </a-popconfirm>\r\n </template>\r\n <template v-else>\r\n {{ opt.label }}\r\n </template>\r\n </a-menu-item>\r\n </a-menu>\r\n <span>{{ item.label }}</span>\r\n </a-dropdown>\r\n </template>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v5 as uuidv5 } from 'uuid'\r\nimport { type, route } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nconst MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002'\r\nexport default {\r\n props: {\r\n record: {\r\n type: Object\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n inject: {\r\n requestTreeData: {\r\n default: void 0\r\n },\r\n requestTableData: {\r\n default: void 0\r\n }\r\n },\r\n computed: {\r\n menuKeyDelimiter () {\r\n return uuidv5('_', MENU_KEY_NAMESPACE)\r\n },\r\n builtInMethods () {\r\n return { \r\n requestTreeData: this.requestTreeData, \r\n requestTableData: this.requestTableData \r\n }\r\n }\r\n },\r\n methods: {\r\n execOperationExpression (dataSource = []) {\r\n const ret = dataSource.map(item => {\r\n const { show } = item\r\n if (type.isUndefined(show)) {\r\n return item\r\n } else if (type.isBool(show)) {\r\n if (show) return item\r\n } else if (type.isStr(show)) {\r\n const parseRet = parse(show, { \r\n ...this.record, \r\n _route: route.searchToQueryParams(window.location.search) \r\n })\r\n if (parseRet) return item\r\n }\r\n }).filter(item => item)\r\n return ret\r\n },\r\n handleClickConfirm (props) {\r\n //TODO generate event by special rule\r\n const { eventName, value } = props\r\n this.$emit(eventName, { \r\n key: value, \r\n record: this.record,\r\n builtInMethods: this.builtInMethods \r\n })\r\n },\r\n handleDropdownClick (props) {\r\n const { key } = props\r\n const [parent, child] = key.split(this.menuKeyDelimiter)\r\n if (!parent || !child) {\r\n throw new Error('key is required')\r\n }\r\n const currentDropdown = this.dataSource.find(item => item.key === parent)\r\n const currentClickTarget = currentDropdown.optionList.find(item => item.value === child)\r\n const { eventName, type } = currentClickTarget\r\n //TODO generate event by special rule\r\n if (type === 'confirm') return\r\n this.$emit(eventName, { \r\n key: child, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods \r\n })\r\n },\r\n handleClickText (props) {\r\n const { eventName, key } = props\r\n this.$emit(eventName, { \r\n key, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods \r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__action {\r\n display: flex;\r\n flex-direction: row;\r\n .table-action__item {\r\n font-size: 14px;\r\n color: #409EFF;\r\n margin-left: 16px;\r\n cursor: pointer;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
|
|
1366
|
+
|
|
1367
|
+
};
|
|
1368
|
+
/* scoped */
|
|
1369
|
+
const __vue_scope_id__$j = "data-v-572820bc";
|
|
1370
|
+
/* module identifier */
|
|
1371
|
+
const __vue_module_identifier__$j = undefined;
|
|
1372
|
+
/* functional template */
|
|
1373
|
+
const __vue_is_functional_template__$j = false;
|
|
1374
|
+
/* style inject SSR */
|
|
1375
|
+
|
|
1376
|
+
/* style inject shadow dom */
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
const __vue_component__$j = /*#__PURE__*/normalizeComponent(
|
|
1381
|
+
{ render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
|
|
1382
|
+
__vue_inject_styles__$j,
|
|
1383
|
+
__vue_script__$j,
|
|
1384
|
+
__vue_scope_id__$j,
|
|
1385
|
+
__vue_is_functional_template__$j,
|
|
1386
|
+
__vue_module_identifier__$j,
|
|
1387
|
+
false,
|
|
1388
|
+
createInjector,
|
|
1389
|
+
undefined,
|
|
1390
|
+
undefined
|
|
1391
|
+
);
|
|
1392
|
+
|
|
1393
|
+
//
|
|
1394
|
+
var script$i = {
|
|
1395
|
+
name: 'ele-table',
|
|
1396
|
+
components: {
|
|
1397
|
+
Actions: __vue_component__$j
|
|
1398
|
+
},
|
|
1399
|
+
props: {
|
|
1400
|
+
actions: {
|
|
1401
|
+
type: Array,
|
|
1402
|
+
default: () => []
|
|
1403
|
+
},
|
|
1404
|
+
total: {
|
|
1405
|
+
type: Number,
|
|
1406
|
+
default: 0
|
|
1407
|
+
},
|
|
1408
|
+
loading: {
|
|
1409
|
+
type: Boolean,
|
|
1410
|
+
default: false
|
|
1411
|
+
},
|
|
1412
|
+
columns: {
|
|
1413
|
+
type: Array,
|
|
1414
|
+
default: () => []
|
|
1415
|
+
},
|
|
1416
|
+
dataSource: {
|
|
1417
|
+
type: Array,
|
|
1418
|
+
default: () => []
|
|
1419
|
+
},
|
|
1420
|
+
pageSize: {
|
|
1421
|
+
type: Number,
|
|
1422
|
+
default: 10
|
|
1423
|
+
},
|
|
1424
|
+
pageSizeOptions: {
|
|
1425
|
+
type: Array,
|
|
1426
|
+
default: () => ['10', '20', '30', '40']
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
methods: {
|
|
1430
|
+
setRowClassName(record, idx) {
|
|
1431
|
+
return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd';
|
|
1432
|
+
},
|
|
1433
|
+
onChangePagination(page, pagrSize) {
|
|
1434
|
+
this.$emit('change-page', page, pagrSize);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
/* script */
|
|
1440
|
+
const __vue_script__$i = script$i;
|
|
1441
|
+
|
|
1442
|
+
/* template */
|
|
1443
|
+
var __vue_render__$i = function () {
|
|
1444
|
+
var _vm = this;
|
|
1445
|
+
var _h = _vm.$createElement;
|
|
1446
|
+
var _c = _vm._self._c || _h;
|
|
1447
|
+
return _c(
|
|
1448
|
+
"div",
|
|
1449
|
+
{ staticClass: "g-table__wrapper" },
|
|
1450
|
+
[
|
|
1451
|
+
_c("a-table", {
|
|
1452
|
+
attrs: {
|
|
1453
|
+
pagination: false,
|
|
1454
|
+
loading: _vm.loading,
|
|
1455
|
+
columns: _vm.columns,
|
|
1456
|
+
"row-class-name": _vm.setRowClassName,
|
|
1457
|
+
"data-source": _vm.dataSource,
|
|
1458
|
+
scroll: { x: 1500, y: 500 },
|
|
1459
|
+
},
|
|
1460
|
+
scopedSlots: _vm._u([
|
|
1461
|
+
{
|
|
1462
|
+
key: "action",
|
|
1463
|
+
fn: function (record) {
|
|
1464
|
+
return [
|
|
1465
|
+
_c(
|
|
1466
|
+
"Actions",
|
|
1467
|
+
_vm._g(
|
|
1468
|
+
{ attrs: { "data-source": _vm.actions, record: record } },
|
|
1469
|
+
_vm.$listeners
|
|
1470
|
+
)
|
|
1471
|
+
),
|
|
1472
|
+
]
|
|
1473
|
+
},
|
|
1474
|
+
},
|
|
1475
|
+
]),
|
|
1476
|
+
}),
|
|
1477
|
+
_vm._v(" "),
|
|
1478
|
+
_c(
|
|
1479
|
+
"div",
|
|
1480
|
+
{ staticClass: "g-table__pagination" },
|
|
1481
|
+
[
|
|
1482
|
+
_c("a-pagination", {
|
|
1483
|
+
attrs: {
|
|
1484
|
+
"show-total": function (total) {
|
|
1485
|
+
return "共 " + total + " 条数据"
|
|
1486
|
+
},
|
|
1487
|
+
"show-size-changer": "",
|
|
1488
|
+
"show-quick-jumper": "",
|
|
1489
|
+
pageSize: _vm.pageSize,
|
|
1490
|
+
pageSizeOptions: _vm.pageSizeOptions,
|
|
1491
|
+
total: _vm.total,
|
|
1492
|
+
},
|
|
1493
|
+
on: { change: _vm.onChangePagination },
|
|
1494
|
+
}),
|
|
1495
|
+
],
|
|
1496
|
+
1
|
|
1497
|
+
),
|
|
1498
|
+
],
|
|
1499
|
+
1
|
|
1500
|
+
)
|
|
1501
|
+
};
|
|
1502
|
+
var __vue_staticRenderFns__$i = [];
|
|
1503
|
+
__vue_render__$i._withStripped = true;
|
|
1504
|
+
|
|
1505
|
+
/* style */
|
|
1506
|
+
const __vue_inject_styles__$i = function (inject) {
|
|
1507
|
+
if (!inject) return
|
|
1508
|
+
inject("data-v-6f3faf52_0", { source: ".g-table__wrapper[data-v-6f3faf52] {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table {\n border-width: calc(var(--idooel-border-width) * 1px);\n border-style: solid;\n border-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-header .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-tbody tr td {\n border-color: var(--idooel-column-border-color);\n border-width: calc(var(--idooel-column-border-width) * 1px);\n border-style: solid;\n border-top: unset;\n border-left: unset;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-body {\n border-top-width: calc(var(--idooel-border-width) * 1px);\n border-top-style: solid;\n border-top-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left .ant-table-body-inner {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-style: solid;\n border-right-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left .ant-table-fixed {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-color: var(--idooel-border-color);\n border-right-style: solid;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-right {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-right .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-color: var(--idooel-border-color);\n border-bottom-style: solid;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-right .ant-table-fixed {\n border-left-width: calc(var(--idooel-border-width) * 1px);\n border-left-style: solid;\n border-left-color: var(--idooel-border-color);\n}\n.g-table__wrapper .g-table__pagination[data-v-6f3faf52] {\n /* margin-top: 8px; */\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-width: calc(var(--idooel-border-width) * 1px);\n border-color: var(--idooel-border-color);\n border-style: solid;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\table\\src\\index.vue","index.vue"],"names":[],"mappings":"AA4EA;EAgEA,aAAA;EACA,kBAAA;AC1IA;AD2EA;EACA,oDAAA;EACA,mBAAA;EACA,wCAAA;ACzEA;AD4EA;EACA,iDAAA;AC1EA;AD+EA;EACA,+CAAA;EACA,2DAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;AC7EA;ADiFA;EACA,wDAAA;EACA,uBAAA;EACA,4CAAA;AC/EA;ADiFA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;AC/EA;ADgFA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;AC9EA;ADgFA;EACA,0DAAA;EACA,yBAAA;EACA,8CAAA;AC9EA;ADgFA;EACA,0DAAA;EACA,8CAAA;EACA,yBAAA;AC9EA;ADiFA;EAMA,2DAAA;EACA,0BAAA;EACA,+CAAA;ACpFA;AD6EA;EACA,2DAAA;EACA,+CAAA;EACA,0BAAA;AC3EA;ADgFA;EACA,yDAAA;EACA,wBAAA;EACA,6CAAA;AC9EA;ADsFA;EACA,qBAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,oDAAA;EACA,wCAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;ACpFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-table__wrapper\">\r\n <a-table\r\n :pagination=\"false\"\r\n :loading=\"loading\"\r\n :columns=\"columns\"\r\n :row-class-name=\"setRowClassName\"\r\n :data-source=\"dataSource\"\r\n :scroll=\"{ x: 1500, y: 500 }\">\r\n <template slot=\"action\" slot-scope=\"record\">\r\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\r\n </template>\r\n </a-table>\r\n <div class=\"g-table__pagination\">\r\n <a-pagination\r\n :show-total=\"total => `共 ${total} 条数据`\"\r\n show-size-changer \r\n show-quick-jumper\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n @change=\"onChangePagination\" \r\n :total=\"total\">\r\n </a-pagination>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Actions from './action.vue'\r\nexport default {\r\n name: 'ele-table',\r\n components: {\r\n Actions\r\n },\r\n props: {\r\n actions: {\r\n type: Array,\r\n default: () => []\r\n },\r\n total: {\r\n type: Number,\r\n default: 0\r\n },\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n columns: {\r\n type: Array,\r\n default: () => []\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n pageSize: {\r\n type: Number,\r\n default: 10\r\n },\r\n pageSizeOptions: {\r\n type: Array,\r\n default: () => ['10', '20', '30', '40']\r\n }\r\n },\r\n methods: {\r\n setRowClassName (record, idx) {\r\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\r\n },\r\n onChangePagination (page, pagrSize) {\r\n this.$emit('change-page', page, pagrSize)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__wrapper {\r\n ::v-deep .ant-table-wrapper {\r\n .ant-table {\r\n border-width: calc(var(--idooel-border-width) * 1px);\r\n border-style: solid;\r\n border-color: var(--idooel-border-color);\r\n }\r\n .ant-table-header {\r\n .ant-table-fixed {\r\n /* border-bottom: 2px solid #53a8ff !important; */\r\n }\r\n }\r\n .ant-table-tbody {\r\n tr {\r\n td {\r\n border-color: var(--idooel-column-border-color);\r\n border-width: calc(var(--idooel-column-border-width) * 1px);;\r\n border-style: solid;\r\n border-top: unset;\r\n border-left: unset;\r\n }\r\n }\r\n }\r\n .ant-table-body {\r\n border-top-width: calc(var(--idooel-border-width) * 1px);\r\n border-top-style: solid;\r\n border-top-color: var(--idooel-border-color);\r\n }\r\n .ant-table-fixed-left {\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--idooel-border-color);\r\n .ant-table-header {\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--idooel-border-color);\r\n }\r\n .ant-table-body-inner {\r\n border-right-width: calc(var(--idooel-border-width) * 1px);\r\n border-right-style: solid;\r\n border-right-color: var(--idooel-border-color);\r\n }\r\n .ant-table-fixed {\r\n border-right-width: calc(var(--idooel-border-width) * 1px);\r\n border-right-color: var(--idooel-border-color);\r\n border-right-style: solid;\r\n }\r\n }\r\n .ant-table-fixed-right {\r\n .ant-table-header {\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-color: var(--idooel-border-color);\r\n border-bottom-style: solid;\r\n }\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--idooel-border-color);\r\n .ant-table-fixed {\r\n border-left-width: calc(var(--idooel-border-width) * 1px);\r\n border-left-style: solid;\r\n border-left-color: var(--idooel-border-color);\r\n }\r\n }\r\n }\r\n padding: 16px;\r\n padding-top: unset;\r\n .g-table__row--even {}\r\n .g-table__row--odd {}\r\n .g-table__pagination {\r\n /* margin-top: 8px; */\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: end;\r\n border-width: calc(var(--idooel-border-width) * 1px);\r\n border-color: var(--idooel-border-color);\r\n border-style: solid;\r\n border-top: unset;\r\n padding-top: 8px;\r\n padding-bottom: 8px;\r\n }\r\n}\r\n</style>",".g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table {\n border-width: calc(var(--idooel-border-width) * 1px);\n border-style: solid;\n border-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-header .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-tbody tr td {\n border-color: var(--idooel-column-border-color);\n border-width: calc(var(--idooel-column-border-width) * 1px);\n border-style: solid;\n border-top: unset;\n border-left: unset;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-body {\n border-top-width: calc(var(--idooel-border-width) * 1px);\n border-top-style: solid;\n border-top-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left .ant-table-body-inner {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-style: solid;\n border-right-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left .ant-table-fixed {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-color: var(--idooel-border-color);\n border-right-style: solid;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-right {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-right .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-color: var(--idooel-border-color);\n border-bottom-style: solid;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-right .ant-table-fixed {\n border-left-width: calc(var(--idooel-border-width) * 1px);\n border-left-style: solid;\n border-left-color: var(--idooel-border-color);\n}\n.g-table__wrapper .g-table__pagination {\n /* margin-top: 8px; */\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-width: calc(var(--idooel-border-width) * 1px);\n border-color: var(--idooel-border-color);\n border-style: solid;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
1509
|
+
|
|
1510
|
+
};
|
|
1511
|
+
/* scoped */
|
|
1512
|
+
const __vue_scope_id__$i = "data-v-6f3faf52";
|
|
1513
|
+
/* module identifier */
|
|
1514
|
+
const __vue_module_identifier__$i = undefined;
|
|
1515
|
+
/* functional template */
|
|
1516
|
+
const __vue_is_functional_template__$i = false;
|
|
1517
|
+
/* style inject SSR */
|
|
1518
|
+
|
|
1519
|
+
/* style inject shadow dom */
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
const __vue_component__$i = /*#__PURE__*/normalizeComponent(
|
|
1524
|
+
{ render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
|
|
1525
|
+
__vue_inject_styles__$i,
|
|
1526
|
+
__vue_script__$i,
|
|
1527
|
+
__vue_scope_id__$i,
|
|
1528
|
+
__vue_is_functional_template__$i,
|
|
1529
|
+
__vue_module_identifier__$i,
|
|
1530
|
+
false,
|
|
1531
|
+
createInjector,
|
|
1532
|
+
undefined,
|
|
1533
|
+
undefined
|
|
1534
|
+
);
|
|
1535
|
+
|
|
1536
|
+
__vue_component__$i.install = Vue => Vue.component(__vue_component__$i.name, __vue_component__$i);
|
|
1537
|
+
|
|
1538
|
+
//
|
|
1539
|
+
//
|
|
1540
|
+
//
|
|
1541
|
+
//
|
|
1542
|
+
//
|
|
1543
|
+
//
|
|
1544
|
+
//
|
|
1545
|
+
//
|
|
1546
|
+
//
|
|
1547
|
+
//
|
|
1548
|
+
//
|
|
1549
|
+
//
|
|
1550
|
+
//
|
|
1551
|
+
//
|
|
1552
|
+
//
|
|
1553
|
+
//
|
|
1554
|
+
//
|
|
1555
|
+
//
|
|
1556
|
+
//
|
|
1557
|
+
//
|
|
1558
|
+
//
|
|
1559
|
+
//
|
|
1560
|
+
//
|
|
1561
|
+
|
|
1562
|
+
var script$h = {
|
|
1563
|
+
name: 'ele-tree',
|
|
1564
|
+
props: {
|
|
1565
|
+
treeData: {
|
|
1566
|
+
type: Array,
|
|
1567
|
+
default: () => []
|
|
1568
|
+
},
|
|
1569
|
+
replaceFields: {
|
|
1570
|
+
type: Object,
|
|
1571
|
+
default: () => ({
|
|
1572
|
+
title: 'title',
|
|
1573
|
+
key: 'id',
|
|
1574
|
+
children: 'children'
|
|
1575
|
+
})
|
|
1576
|
+
},
|
|
1577
|
+
defaultExpandedKeys: {
|
|
1578
|
+
type: Array
|
|
1579
|
+
},
|
|
1580
|
+
defaultSelectedKeys: {
|
|
1581
|
+
type: Array
|
|
1582
|
+
},
|
|
1583
|
+
showIcon: {
|
|
1584
|
+
type: Boolean,
|
|
1585
|
+
default: true
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
data() {
|
|
1589
|
+
return {};
|
|
1590
|
+
},
|
|
1591
|
+
computed: {
|
|
1592
|
+
innerTreeData() {
|
|
1593
|
+
return this.treeData;
|
|
1594
|
+
// return [
|
|
1595
|
+
// {
|
|
1596
|
+
// title: 'parent 1',
|
|
1597
|
+
// key: 1,
|
|
1598
|
+
// scopedSlots: {
|
|
1599
|
+
// icon: 'custom',
|
|
1600
|
+
// iconName: 'smile-o'
|
|
1601
|
+
// },
|
|
1602
|
+
// children: [
|
|
1603
|
+
// {
|
|
1604
|
+
// title: '2',
|
|
1605
|
+
// key: 2,
|
|
1606
|
+
// scopedSlots: {
|
|
1607
|
+
// icon: 'custom',
|
|
1608
|
+
// iconName: 'frown-o'
|
|
1609
|
+
// }
|
|
1610
|
+
// }
|
|
1611
|
+
// ]
|
|
1612
|
+
// }
|
|
1613
|
+
// ]
|
|
1614
|
+
}
|
|
1615
|
+
},
|
|
1616
|
+
methods: {
|
|
1617
|
+
refreshTreeStatus(props = {}) {},
|
|
1618
|
+
selectTreeNode(selectedKeys, e) {
|
|
1619
|
+
this.$emit('select', selectedKeys, e);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
/* script */
|
|
1625
|
+
const __vue_script__$h = script$h;
|
|
1626
|
+
|
|
1627
|
+
/* template */
|
|
1628
|
+
var __vue_render__$h = function () {
|
|
1629
|
+
var _vm = this;
|
|
1630
|
+
var _h = _vm.$createElement;
|
|
1631
|
+
var _c = _vm._self._c || _h;
|
|
1632
|
+
return _c(
|
|
1633
|
+
"div",
|
|
1634
|
+
{ staticClass: "g-tree__wrapper" },
|
|
1635
|
+
[
|
|
1636
|
+
_vm.innerTreeData.length
|
|
1637
|
+
? _c("a-tree", {
|
|
1638
|
+
attrs: {
|
|
1639
|
+
"tree-data": _vm.innerTreeData,
|
|
1640
|
+
replaceFields: _vm.replaceFields,
|
|
1641
|
+
"default-expanded-keys": _vm.defaultExpandedKeys,
|
|
1642
|
+
"default-selected-keys": _vm.defaultSelectedKeys,
|
|
1643
|
+
blockNode: "",
|
|
1644
|
+
"show-icon": _vm.showIcon,
|
|
1645
|
+
},
|
|
1646
|
+
on: { select: _vm.selectTreeNode },
|
|
1647
|
+
scopedSlots: _vm._u(
|
|
1648
|
+
[
|
|
1649
|
+
{
|
|
1650
|
+
key: "title",
|
|
1651
|
+
fn: function (ref) {
|
|
1652
|
+
var title = ref.title;
|
|
1653
|
+
return [
|
|
1654
|
+
_c(
|
|
1655
|
+
"span",
|
|
1656
|
+
{
|
|
1657
|
+
staticClass: "tree-node__title",
|
|
1658
|
+
attrs: { title: title },
|
|
1659
|
+
},
|
|
1660
|
+
[_vm._v("\n " + _vm._s(title) + "\n ")]
|
|
1661
|
+
),
|
|
1662
|
+
]
|
|
1663
|
+
},
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
key: "custom",
|
|
1667
|
+
fn: function (ref) {
|
|
1668
|
+
var scopedSlots = ref.scopedSlots;
|
|
1669
|
+
return [
|
|
1670
|
+
_c("a-icon", { attrs: { type: scopedSlots.iconName } }),
|
|
1671
|
+
]
|
|
1672
|
+
},
|
|
1673
|
+
},
|
|
1674
|
+
],
|
|
1675
|
+
null,
|
|
1676
|
+
false,
|
|
1677
|
+
729072655
|
|
1678
|
+
),
|
|
1679
|
+
})
|
|
1680
|
+
: _vm._e(),
|
|
1681
|
+
],
|
|
1682
|
+
1
|
|
1683
|
+
)
|
|
1684
|
+
};
|
|
1685
|
+
var __vue_staticRenderFns__$h = [];
|
|
1686
|
+
__vue_render__$h._withStripped = true;
|
|
1687
|
+
|
|
1688
|
+
/* style */
|
|
1689
|
+
const __vue_inject_styles__$h = function (inject) {
|
|
1690
|
+
if (!inject) return
|
|
1691
|
+
inject("data-v-cc99bbf0_0", { source: ".g-tree__wrapper[data-v-cc99bbf0] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-cc99bbf0] .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper[data-v-cc99bbf0] .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tree\\src\\index.vue","index.vue"],"names":[],"mappings":"AAwFA;EACA,gBAAA;ACvFA;ADyFA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;ACvFA;ADyFA;EACA,WAAA;ACvFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-tree__wrapper\">\r\n <a-tree\r\n v-if=\"innerTreeData.length\"\r\n :tree-data=\"innerTreeData\"\r\n @select=\"selectTreeNode\"\r\n :replaceFields=\"replaceFields\"\r\n :default-expanded-keys=\"defaultExpandedKeys\"\r\n :default-selected-keys=\"defaultSelectedKeys\"\r\n blockNode \r\n :show-icon=\"showIcon\">\r\n <template #title=\"{ title }\">\r\n <span :title=\"title\" class=\"tree-node__title\">\r\n {{ title }}\r\n </span>\r\n </template>\r\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\r\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\r\n </template>\r\n </a-tree>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tree',\r\n props: {\r\n treeData: {\r\n type: Array,\r\n default: () => []\r\n },\r\n replaceFields: {\r\n type: Object,\r\n default: () => ({\r\n title: 'title',\r\n key: 'id',\r\n children: 'children'\r\n })\r\n },\r\n defaultExpandedKeys: {\r\n type: Array\r\n },\r\n defaultSelectedKeys: {\r\n type: Array\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n innerTreeData () {\r\n return this.treeData\r\n // return [\r\n // {\r\n // title: 'parent 1',\r\n // key: 1,\r\n // scopedSlots: {\r\n // icon: 'custom',\r\n // iconName: 'smile-o'\r\n // },\r\n // children: [\r\n // {\r\n // title: '2',\r\n // key: 2,\r\n // scopedSlots: {\r\n // icon: 'custom',\r\n // iconName: 'frown-o'\r\n // }\r\n // }\r\n // ]\r\n // }\r\n // ]\r\n }\r\n },\r\n methods: {\r\n refreshTreeStatus (props = {}) {},\r\n selectTreeNode (selectedKeys, e) {\r\n this.$emit('select', selectedKeys, e)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-tree__wrapper {\r\n overflow: hidden;\r\n ::v-deep .ant-tree {\r\n .ant-tree-node-content-wrapper {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n .ant-tree-node-selected {\r\n color: #fff;\r\n }\r\n }\r\n}\r\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
1692
|
+
|
|
1693
|
+
};
|
|
1694
|
+
/* scoped */
|
|
1695
|
+
const __vue_scope_id__$h = "data-v-cc99bbf0";
|
|
1696
|
+
/* module identifier */
|
|
1697
|
+
const __vue_module_identifier__$h = undefined;
|
|
1698
|
+
/* functional template */
|
|
1699
|
+
const __vue_is_functional_template__$h = false;
|
|
1700
|
+
/* style inject SSR */
|
|
1701
|
+
|
|
1702
|
+
/* style inject shadow dom */
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
const __vue_component__$h = /*#__PURE__*/normalizeComponent(
|
|
1707
|
+
{ render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
|
|
1708
|
+
__vue_inject_styles__$h,
|
|
1709
|
+
__vue_script__$h,
|
|
1710
|
+
__vue_scope_id__$h,
|
|
1711
|
+
__vue_is_functional_template__$h,
|
|
1712
|
+
__vue_module_identifier__$h,
|
|
1713
|
+
false,
|
|
1714
|
+
createInjector,
|
|
1715
|
+
undefined,
|
|
1716
|
+
undefined
|
|
1717
|
+
);
|
|
1718
|
+
|
|
1719
|
+
__vue_component__$h.install = Vue => Vue.component(__vue_component__$h.name, __vue_component__$h);
|
|
1720
|
+
|
|
1721
|
+
//
|
|
1722
|
+
//
|
|
1723
|
+
//
|
|
1724
|
+
//
|
|
1725
|
+
//
|
|
1726
|
+
//
|
|
1727
|
+
//
|
|
1728
|
+
|
|
1729
|
+
var script$g = {
|
|
1730
|
+
props: {
|
|
1731
|
+
label: {
|
|
1732
|
+
type: String
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
|
|
1737
|
+
/* script */
|
|
1738
|
+
const __vue_script__$g = script$g;
|
|
1739
|
+
|
|
1740
|
+
/* template */
|
|
1741
|
+
var __vue_render__$g = function () {
|
|
1742
|
+
var _vm = this;
|
|
1743
|
+
var _h = _vm.$createElement;
|
|
1744
|
+
var _c = _vm._self._c || _h;
|
|
1745
|
+
return _c("div", { staticClass: "g-search__label" }, [
|
|
1746
|
+
_c("span", { staticClass: "label__title" }, [_vm._v(_vm._s(_vm.label))]),
|
|
1747
|
+
_vm._v(" "),
|
|
1748
|
+
_c("span", { staticClass: "label__suffix" }, [_vm._v(":")]),
|
|
1749
|
+
])
|
|
1750
|
+
};
|
|
1751
|
+
var __vue_staticRenderFns__$g = [];
|
|
1752
|
+
__vue_render__$g._withStripped = true;
|
|
1753
|
+
|
|
1754
|
+
/* style */
|
|
1755
|
+
const __vue_inject_styles__$g = function (inject) {
|
|
1756
|
+
if (!inject) return
|
|
1757
|
+
inject("data-v-40e71716_0", { source: ".g-search__label[data-v-40e71716] {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title[data-v-40e71716], .g-search__label .label__suffix[data-v-40e71716] {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix[data-v-40e71716] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\label.vue","label.vue"],"names":[],"mappings":"AAkBA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACjBA;ADkBA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;AChBA;ADkBA;EACA,gBAAA;AChBA;;AAEA,oCAAoC","file":"label.vue","sourcesContent":["<template>\r\n <div class=\"g-search__label\">\r\n <span class=\"label__title\">{{ label }}</span>\r\n <span class=\"label__suffix\">:</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n label: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-search__label {\r\n /* width: 69px; */\r\n flex-basis: 69px;\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n .label__title, .label__suffix {\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.88);\r\n white-space: nowrap;\r\n }\r\n .label__suffix {\r\n margin-left: 4px;\r\n }\r\n}\r\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
|
|
1758
|
+
|
|
1759
|
+
};
|
|
1760
|
+
/* scoped */
|
|
1761
|
+
const __vue_scope_id__$g = "data-v-40e71716";
|
|
1762
|
+
/* module identifier */
|
|
1763
|
+
const __vue_module_identifier__$g = undefined;
|
|
1764
|
+
/* functional template */
|
|
1765
|
+
const __vue_is_functional_template__$g = false;
|
|
1766
|
+
/* style inject SSR */
|
|
1767
|
+
|
|
1768
|
+
/* style inject shadow dom */
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
const __vue_component__$g = /*#__PURE__*/normalizeComponent(
|
|
1773
|
+
{ render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
|
|
1774
|
+
__vue_inject_styles__$g,
|
|
1775
|
+
__vue_script__$g,
|
|
1776
|
+
__vue_scope_id__$g,
|
|
1777
|
+
__vue_is_functional_template__$g,
|
|
1778
|
+
__vue_module_identifier__$g,
|
|
1779
|
+
false,
|
|
1780
|
+
createInjector,
|
|
1781
|
+
undefined,
|
|
1782
|
+
undefined
|
|
1783
|
+
);
|
|
1784
|
+
|
|
1785
|
+
//
|
|
1786
|
+
var script$f = {
|
|
1787
|
+
name: 'ele-search-area',
|
|
1788
|
+
components: {
|
|
1789
|
+
EleInput: __vue_component__$l,
|
|
1790
|
+
EleSelect: __vue_component__$k,
|
|
1791
|
+
ELeButton: __vue_component__$n,
|
|
1792
|
+
Label: __vue_component__$g,
|
|
1793
|
+
EleDate: __vue_component__$m
|
|
1794
|
+
},
|
|
1795
|
+
props: {
|
|
1796
|
+
gutter: {
|
|
1797
|
+
type: [Number, Array, Object],
|
|
1798
|
+
default: () => [16, 8]
|
|
1799
|
+
},
|
|
1800
|
+
span: {
|
|
1801
|
+
type: Number,
|
|
1802
|
+
default: 8
|
|
1803
|
+
},
|
|
1804
|
+
dataSource: {
|
|
1805
|
+
type: Array,
|
|
1806
|
+
required: true
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
data() {
|
|
1810
|
+
return {
|
|
1811
|
+
isExpand: false
|
|
1812
|
+
};
|
|
1813
|
+
},
|
|
1814
|
+
computed: {
|
|
1815
|
+
cuttingFormula() {
|
|
1816
|
+
return 24 / this.span - 1;
|
|
1817
|
+
},
|
|
1818
|
+
buildDataSource() {
|
|
1819
|
+
return this.controlDisplayByFormula(this.mapDefaultValueToValue());
|
|
1820
|
+
},
|
|
1821
|
+
innerDataSource() {
|
|
1822
|
+
return [...this.buildDataSource, {
|
|
1823
|
+
type: '_action',
|
|
1824
|
+
_show: true
|
|
1825
|
+
}];
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1828
|
+
created() {},
|
|
1829
|
+
methods: {
|
|
1830
|
+
controlDisplayByFormula(dataSource = []) {
|
|
1831
|
+
if (this.isExpand) {
|
|
1832
|
+
dataSource.forEach(item => {
|
|
1833
|
+
this.$set(item, '_show', true);
|
|
1834
|
+
});
|
|
1835
|
+
} else {
|
|
1836
|
+
dataSource.forEach((item, idx) => {
|
|
1837
|
+
if (idx < this.cuttingFormula) {
|
|
1838
|
+
this.$set(item, '_show', true);
|
|
1839
|
+
} else {
|
|
1840
|
+
this.$set(item, '_show', false);
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
return dataSource;
|
|
1845
|
+
},
|
|
1846
|
+
buildDefaultValue(arg) {
|
|
1847
|
+
if (!arg || arg.charAt(0) !== '_') return arg;
|
|
1848
|
+
return parse(arg, {
|
|
1849
|
+
_route: this.$route.query
|
|
1850
|
+
});
|
|
1851
|
+
},
|
|
1852
|
+
mapDefaultValueToValue() {
|
|
1853
|
+
this.dataSource.forEach(props => {
|
|
1854
|
+
this.$set(props, '_show', this.isExpand);
|
|
1855
|
+
if (props.defaultValue) {
|
|
1856
|
+
this.$set(props, '_value', this.buildDefaultValue(props.defaultValue));
|
|
1857
|
+
}
|
|
1858
|
+
});
|
|
1859
|
+
return this.dataSource;
|
|
1860
|
+
},
|
|
1861
|
+
handleClickExpandCollapse() {
|
|
1862
|
+
this.isExpand = !this.isExpand;
|
|
1863
|
+
},
|
|
1864
|
+
handleClickSearch() {
|
|
1865
|
+
const querys = this.extractValues();
|
|
1866
|
+
this.$emit('search', querys);
|
|
1867
|
+
},
|
|
1868
|
+
extractValues() {
|
|
1869
|
+
let ret = {};
|
|
1870
|
+
this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {
|
|
1871
|
+
switch (item.type) {
|
|
1872
|
+
case 'DatePicker':
|
|
1873
|
+
ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format);
|
|
1874
|
+
break;
|
|
1875
|
+
default:
|
|
1876
|
+
ret[item.name] = item._value;
|
|
1877
|
+
break;
|
|
1878
|
+
}
|
|
1879
|
+
});
|
|
1880
|
+
return ret;
|
|
1881
|
+
},
|
|
1882
|
+
handleClickReset() {
|
|
1883
|
+
this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {
|
|
1884
|
+
const {
|
|
1885
|
+
defaultValue
|
|
1886
|
+
} = item;
|
|
1887
|
+
switch (item.type) {
|
|
1888
|
+
case 'Select':
|
|
1889
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1890
|
+
!defaultValue && this.$set(item, '_value', null);
|
|
1891
|
+
break;
|
|
1892
|
+
case 'DatePicker':
|
|
1893
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1894
|
+
!defaultValue && this.$set(item, '_value', undefined);
|
|
1895
|
+
break;
|
|
1896
|
+
default:
|
|
1897
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1898
|
+
!defaultValue && this.$set(item, '_value', null);
|
|
1899
|
+
break;
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
//TODO defaultValue
|
|
1903
|
+
const querys = this.extractValues();
|
|
1904
|
+
this.$emit('search', querys);
|
|
1905
|
+
},
|
|
1906
|
+
onChangeSelect(value, props) {
|
|
1907
|
+
this.$set(props, '_value', value);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
|
|
1912
|
+
/* script */
|
|
1913
|
+
const __vue_script__$f = script$f;
|
|
1914
|
+
|
|
1915
|
+
/* template */
|
|
1916
|
+
var __vue_render__$f = function () {
|
|
1917
|
+
var _vm = this;
|
|
1918
|
+
var _h = _vm.$createElement;
|
|
1919
|
+
var _c = _vm._self._c || _h;
|
|
1920
|
+
return _c(
|
|
1921
|
+
"div",
|
|
1922
|
+
{ staticClass: "search-area__wrapper" },
|
|
1923
|
+
[
|
|
1924
|
+
_c(
|
|
1925
|
+
"a-row",
|
|
1926
|
+
{ attrs: { gutter: _vm.gutter } },
|
|
1927
|
+
[
|
|
1928
|
+
_vm._l(_vm.innerDataSource, function (item, idx) {
|
|
1929
|
+
return [
|
|
1930
|
+
item._show
|
|
1931
|
+
? _c(
|
|
1932
|
+
"a-col",
|
|
1933
|
+
{ key: idx, attrs: { span: item.span || _vm.span } },
|
|
1934
|
+
[
|
|
1935
|
+
item.type == "_action"
|
|
1936
|
+
? _c(
|
|
1937
|
+
"div",
|
|
1938
|
+
{
|
|
1939
|
+
staticClass:
|
|
1940
|
+
"search-area__item search-area--action",
|
|
1941
|
+
},
|
|
1942
|
+
[
|
|
1943
|
+
_c(
|
|
1944
|
+
"ele-button",
|
|
1945
|
+
{
|
|
1946
|
+
attrs: { icon: "search", type: "primary" },
|
|
1947
|
+
on: { click: _vm.handleClickSearch },
|
|
1948
|
+
},
|
|
1949
|
+
[_vm._v("查询")]
|
|
1950
|
+
),
|
|
1951
|
+
_vm._v(" "),
|
|
1952
|
+
_c(
|
|
1953
|
+
"ele-button",
|
|
1954
|
+
{
|
|
1955
|
+
staticStyle: { "margin-left": "8px" },
|
|
1956
|
+
attrs: { icon: "reload" },
|
|
1957
|
+
on: { click: _vm.handleClickReset },
|
|
1958
|
+
},
|
|
1959
|
+
[_vm._v("重置")]
|
|
1960
|
+
),
|
|
1961
|
+
_vm._v(" "),
|
|
1962
|
+
_c(
|
|
1963
|
+
"div",
|
|
1964
|
+
{
|
|
1965
|
+
staticClass: "expand-collapse",
|
|
1966
|
+
on: { click: _vm.handleClickExpandCollapse },
|
|
1967
|
+
},
|
|
1968
|
+
[
|
|
1969
|
+
_c(
|
|
1970
|
+
"span",
|
|
1971
|
+
{ staticClass: "expand-collapse__text" },
|
|
1972
|
+
[
|
|
1973
|
+
_vm._v(
|
|
1974
|
+
_vm._s(_vm.isExpand ? "收起" : "展开")
|
|
1975
|
+
),
|
|
1976
|
+
]
|
|
1977
|
+
),
|
|
1978
|
+
_vm._v(" "),
|
|
1979
|
+
_c(
|
|
1980
|
+
"span",
|
|
1981
|
+
{ staticClass: "expand-collapse__icon" },
|
|
1982
|
+
[
|
|
1983
|
+
_vm.isExpand
|
|
1984
|
+
? _c("a-icon", {
|
|
1985
|
+
attrs: { type: "up" },
|
|
1986
|
+
})
|
|
1987
|
+
: _c("a-icon", {
|
|
1988
|
+
attrs: { type: "down" },
|
|
1989
|
+
}),
|
|
1990
|
+
],
|
|
1991
|
+
1
|
|
1992
|
+
),
|
|
1993
|
+
]
|
|
1994
|
+
),
|
|
1995
|
+
],
|
|
1996
|
+
1
|
|
1997
|
+
)
|
|
1998
|
+
: _c(
|
|
1999
|
+
"div",
|
|
2000
|
+
{ staticClass: "search-area__item" },
|
|
2001
|
+
[
|
|
2002
|
+
item.type == "Input"
|
|
2003
|
+
? [
|
|
2004
|
+
_c("Label", {
|
|
2005
|
+
attrs: { label: item.label },
|
|
2006
|
+
}),
|
|
2007
|
+
_vm._v(" "),
|
|
2008
|
+
_c("ele-input", {
|
|
2009
|
+
model: {
|
|
2010
|
+
value: item._value,
|
|
2011
|
+
callback: function ($$v) {
|
|
2012
|
+
_vm.$set(item, "_value", $$v);
|
|
2013
|
+
},
|
|
2014
|
+
expression: "item._value",
|
|
2015
|
+
},
|
|
2016
|
+
}),
|
|
2017
|
+
]
|
|
2018
|
+
: item.type == "Select"
|
|
2019
|
+
? [
|
|
2020
|
+
_c("Label", {
|
|
2021
|
+
attrs: { label: item.label },
|
|
2022
|
+
}),
|
|
2023
|
+
_vm._v(" "),
|
|
2024
|
+
_c("ele-select", {
|
|
2025
|
+
attrs: { "data-source": item.optionList },
|
|
2026
|
+
model: {
|
|
2027
|
+
value: item._value,
|
|
2028
|
+
callback: function ($$v) {
|
|
2029
|
+
_vm.$set(item, "_value", $$v);
|
|
2030
|
+
},
|
|
2031
|
+
expression: "item._value",
|
|
2032
|
+
},
|
|
2033
|
+
}),
|
|
2034
|
+
]
|
|
2035
|
+
: item.type == "DatePicker"
|
|
2036
|
+
? [
|
|
2037
|
+
_c("Label", {
|
|
2038
|
+
attrs: { label: item.label },
|
|
2039
|
+
}),
|
|
2040
|
+
_vm._v(" "),
|
|
2041
|
+
_c("ele-date", {
|
|
2042
|
+
attrs: { format: item.format },
|
|
2043
|
+
model: {
|
|
2044
|
+
value: item._value,
|
|
2045
|
+
callback: function ($$v) {
|
|
2046
|
+
_vm.$set(item, "_value", $$v);
|
|
2047
|
+
},
|
|
2048
|
+
expression: "item._value",
|
|
2049
|
+
},
|
|
2050
|
+
}),
|
|
2051
|
+
]
|
|
2052
|
+
: _vm._e(),
|
|
2053
|
+
],
|
|
2054
|
+
2
|
|
2055
|
+
),
|
|
2056
|
+
]
|
|
2057
|
+
)
|
|
2058
|
+
: _vm._e(),
|
|
2059
|
+
]
|
|
2060
|
+
}),
|
|
2061
|
+
],
|
|
2062
|
+
2
|
|
2063
|
+
),
|
|
2064
|
+
],
|
|
2065
|
+
1
|
|
2066
|
+
)
|
|
2067
|
+
};
|
|
2068
|
+
var __vue_staticRenderFns__$f = [];
|
|
2069
|
+
__vue_render__$f._withStripped = true;
|
|
2070
|
+
|
|
2071
|
+
/* style */
|
|
2072
|
+
const __vue_inject_styles__$f = function (inject) {
|
|
2073
|
+
if (!inject) return
|
|
2074
|
+
inject("data-v-5a224358_0", { source: ".search-area__wrapper[data-v-5a224358] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-5a224358] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-5a224358] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action[data-v-5a224358] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-5a224358] {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text[data-v-5a224358] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-5a224358] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyKA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACxKA;AD0KA;EACA,YAAA;ACxKA;AD2KA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACzKA;AD0KA;EACA,oBAAA;ACxKA;AD0KA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACxKA;ADyKA;EACA,eAAA;ACvKA;ADyKA;EACA,eAAA;EACA,gBAAA;ACvKA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <template v-for=\"(item, idx) in innerDataSource\">\r\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n <div class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\r\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\r\n <span class=\"expand-collapse__icon\">\r\n <a-icon v-if=\"isExpand\" type=\"up\" />\r\n <a-icon v-else type=\"down\" />\r\n </span>\r\n </div>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"item.type == 'Input'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"item.type == 'Select'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"item.type == 'DatePicker'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :format=\"item.format\"></ele-date>\r\n </template>\r\n </div>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleInput from '../../../input/src/index.vue'\r\nimport EleSelect from '../../../select/src/index.vue'\r\nimport ELeButton from '../../../button/src/index.vue'\r\nimport EleDate from '../../../date/src/index.vue'\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nimport { parse } from '@idooel/expression'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n EleInput,\r\n EleSelect,\r\n ELeButton,\r\n Label,\r\n EleDate\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n isExpand: false\r\n }\r\n },\r\n computed: {\r\n cuttingFormula () {\r\n return (24 / this.span - 1)\r\n },\r\n buildDataSource () {\r\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\r\n },\r\n innerDataSource () {\r\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\r\n }\r\n },\r\n created() {},\r\n methods: {\r\n controlDisplayByFormula (dataSource = []) {\r\n if (this.isExpand) {\r\n dataSource.forEach(item => {\r\n this.$set(item, '_show', true)\r\n })\r\n } else {\r\n dataSource.forEach((item, idx) => {\r\n if (idx < this.cuttingFormula) {\r\n this.$set(item, '_show', true)\r\n } else {\r\n this.$set(item, '_show', false)\r\n }\r\n })\r\n }\r\n return dataSource\r\n },\r\n buildDefaultValue (arg) {\r\n if (!arg || arg.charAt(0) !== '_') return arg\r\n return parse(arg, {\r\n _route: this.$route.query\r\n })\r\n },\r\n mapDefaultValueToValue () {\r\n this.dataSource.forEach(props => {\r\n this.$set(props, '_show', this.isExpand)\r\n if (props.defaultValue) {\r\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\r\n }\r\n })\r\n return this.dataSource\r\n },\r\n handleClickExpandCollapse () {\r\n this.isExpand = !this.isExpand\r\n },\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n handleClickReset () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n const { defaultValue } = item\r\n switch (item.type) {\r\n case 'Select':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', undefined)\r\n break\r\n default:\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.search-area--action {\r\n justify-content: end;\r\n }\r\n .expand-collapse {\r\n margin-left: 8px;\r\n height: 32px;\r\n padding: 4px 16px;\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n .expand-collapse__text {\r\n font-size: 14px;\r\n }\r\n .expand-collapse__icon {\r\n font-size: 16px;\r\n margin-left: 8px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2075
|
+
|
|
2076
|
+
};
|
|
2077
|
+
/* scoped */
|
|
2078
|
+
const __vue_scope_id__$f = "data-v-5a224358";
|
|
2079
|
+
/* module identifier */
|
|
2080
|
+
const __vue_module_identifier__$f = undefined;
|
|
2081
|
+
/* functional template */
|
|
2082
|
+
const __vue_is_functional_template__$f = false;
|
|
2083
|
+
/* style inject SSR */
|
|
2084
|
+
|
|
2085
|
+
/* style inject shadow dom */
|
|
2086
|
+
|
|
2087
|
+
|
|
2088
|
+
|
|
2089
|
+
const __vue_component__$f = /*#__PURE__*/normalizeComponent(
|
|
2090
|
+
{ render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
|
|
2091
|
+
__vue_inject_styles__$f,
|
|
2092
|
+
__vue_script__$f,
|
|
2093
|
+
__vue_scope_id__$f,
|
|
2094
|
+
__vue_is_functional_template__$f,
|
|
2095
|
+
__vue_module_identifier__$f,
|
|
2096
|
+
false,
|
|
2097
|
+
createInjector,
|
|
2098
|
+
undefined,
|
|
2099
|
+
undefined
|
|
2100
|
+
);
|
|
2101
|
+
|
|
2102
|
+
//
|
|
2103
|
+
var script$e = {
|
|
2104
|
+
name: 'ele-button-group',
|
|
2105
|
+
components: {
|
|
2106
|
+
EleButton: __vue_component__$n
|
|
2107
|
+
},
|
|
2108
|
+
props: {
|
|
2109
|
+
dataSource: {
|
|
2110
|
+
type: Array,
|
|
2111
|
+
default: () => []
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
|
|
2116
|
+
/* script */
|
|
2117
|
+
const __vue_script__$e = script$e;
|
|
2118
|
+
|
|
2119
|
+
/* template */
|
|
2120
|
+
var __vue_render__$e = function () {
|
|
2121
|
+
var _vm = this;
|
|
2122
|
+
var _h = _vm.$createElement;
|
|
2123
|
+
var _c = _vm._self._c || _h;
|
|
2124
|
+
return _c(
|
|
2125
|
+
"div",
|
|
2126
|
+
{ staticClass: "button-group__wrapper" },
|
|
2127
|
+
_vm._l(_vm.dataSource, function (item, idx) {
|
|
2128
|
+
return _c(
|
|
2129
|
+
"ele-button",
|
|
2130
|
+
_vm._g(
|
|
2131
|
+
{
|
|
2132
|
+
key: idx,
|
|
2133
|
+
attrs: {
|
|
2134
|
+
type: item.type,
|
|
2135
|
+
icon: item.icon,
|
|
2136
|
+
mode: item.mode,
|
|
2137
|
+
"data-source": item.optionList,
|
|
2138
|
+
"event-name": item.eventName,
|
|
2139
|
+
record: item,
|
|
2140
|
+
},
|
|
2141
|
+
},
|
|
2142
|
+
_vm.$listeners
|
|
2143
|
+
),
|
|
2144
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
2145
|
+
)
|
|
2146
|
+
}),
|
|
2147
|
+
1
|
|
2148
|
+
)
|
|
2149
|
+
};
|
|
2150
|
+
var __vue_staticRenderFns__$e = [];
|
|
2151
|
+
__vue_render__$e._withStripped = true;
|
|
2152
|
+
|
|
2153
|
+
/* style */
|
|
2154
|
+
const __vue_inject_styles__$e = function (inject) {
|
|
2155
|
+
if (!inject) return
|
|
2156
|
+
inject("data-v-de67e2d2_0", { source: ".button-group__wrapper[data-v-de67e2d2] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-de67e2d2] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-de67e2d2]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\button-group\\src\\index.vue","index.vue"],"names":[],"mappings":"AAkCA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;ACjCA;ADkCA;EACA,gBAAA;AChCA;ADiCA;EACA,cAAA;AC/BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"button-group__wrapper\">\r\n <ele-button \r\n v-for=\"(item, idx) in dataSource\" \r\n :type=\"item.type\"\r\n :icon=\"item.icon\"\r\n :mode=\"item.mode\"\r\n :data-source=\"item.optionList\"\r\n :event-name=\"item.eventName\"\r\n :record=\"item\"\r\n v-on=\"$listeners\"\r\n :key=\"idx\">\r\n {{ item.label }}\r\n </ele-button>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleButton from '../../../button/src/index.vue'\r\nexport default {\r\n name: 'ele-button-group',\r\n components: {\r\n EleButton\r\n },\r\n props: {\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.button-group__wrapper {\r\n display: flex;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n .ant-btn {\r\n margin-left: 8px;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2157
|
+
|
|
2158
|
+
};
|
|
2159
|
+
/* scoped */
|
|
2160
|
+
const __vue_scope_id__$e = "data-v-de67e2d2";
|
|
2161
|
+
/* module identifier */
|
|
2162
|
+
const __vue_module_identifier__$e = undefined;
|
|
2163
|
+
/* functional template */
|
|
2164
|
+
const __vue_is_functional_template__$e = false;
|
|
2165
|
+
/* style inject SSR */
|
|
2166
|
+
|
|
2167
|
+
/* style inject shadow dom */
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
const __vue_component__$e = /*#__PURE__*/normalizeComponent(
|
|
2172
|
+
{ render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
|
|
2173
|
+
__vue_inject_styles__$e,
|
|
2174
|
+
__vue_script__$e,
|
|
2175
|
+
__vue_scope_id__$e,
|
|
2176
|
+
__vue_is_functional_template__$e,
|
|
2177
|
+
__vue_module_identifier__$e,
|
|
2178
|
+
false,
|
|
2179
|
+
createInjector,
|
|
2180
|
+
undefined,
|
|
2181
|
+
undefined
|
|
2182
|
+
);
|
|
2183
|
+
|
|
2184
|
+
//
|
|
2185
|
+
var script$d = {
|
|
2186
|
+
name: 'ele-tree-table-model',
|
|
2187
|
+
components: {
|
|
2188
|
+
EleTree: __vue_component__$h,
|
|
2189
|
+
EleTable: __vue_component__$i,
|
|
2190
|
+
EleSearchArea: __vue_component__$f,
|
|
2191
|
+
EleButtonGroup: __vue_component__$e
|
|
2192
|
+
},
|
|
2193
|
+
props: {
|
|
2194
|
+
treeMeta: {
|
|
2195
|
+
type: Object,
|
|
2196
|
+
default: () => ({})
|
|
2197
|
+
},
|
|
2198
|
+
searchMeta: {
|
|
2199
|
+
type: Object,
|
|
2200
|
+
default: () => ({})
|
|
2201
|
+
},
|
|
2202
|
+
buttonGroupMeta: {
|
|
2203
|
+
typeof: Object,
|
|
2204
|
+
default: () => ({})
|
|
2205
|
+
},
|
|
2206
|
+
tableMeta: {
|
|
2207
|
+
type: Object,
|
|
2208
|
+
default: () => ({})
|
|
2209
|
+
}
|
|
2210
|
+
},
|
|
2211
|
+
provide() {
|
|
2212
|
+
return {
|
|
2213
|
+
requestTreeData: this.requestTreeData,
|
|
2214
|
+
requestTableData: this.requestTableData
|
|
2215
|
+
};
|
|
2216
|
+
},
|
|
2217
|
+
data() {
|
|
2218
|
+
return {
|
|
2219
|
+
treeData: [],
|
|
2220
|
+
tableData: [],
|
|
2221
|
+
defaultExpandedKeys: [],
|
|
2222
|
+
defaultSelectedKeys: [],
|
|
2223
|
+
replaceFields: {
|
|
2224
|
+
title: 'title',
|
|
2225
|
+
children: 'children',
|
|
2226
|
+
key: 'id'
|
|
2227
|
+
},
|
|
2228
|
+
loading: false,
|
|
2229
|
+
total: 0,
|
|
2230
|
+
tableQuerys: {},
|
|
2231
|
+
resizeObserverModelTableWrapper: null,
|
|
2232
|
+
modelTableWrapperHeight: 0,
|
|
2233
|
+
currentTreeNodeData: {}
|
|
2234
|
+
};
|
|
2235
|
+
},
|
|
2236
|
+
computed: {
|
|
2237
|
+
showTree() {
|
|
2238
|
+
return !!Object.keys(this.treeMeta).length;
|
|
2239
|
+
},
|
|
2240
|
+
buttonGroup() {
|
|
2241
|
+
return v4();
|
|
2242
|
+
},
|
|
2243
|
+
searchArea() {
|
|
2244
|
+
return v4();
|
|
2245
|
+
},
|
|
2246
|
+
modelTreeWrapper() {
|
|
2247
|
+
return v4();
|
|
2248
|
+
},
|
|
2249
|
+
modelTableWrapper() {
|
|
2250
|
+
return v4();
|
|
2251
|
+
},
|
|
2252
|
+
actions() {
|
|
2253
|
+
const {
|
|
2254
|
+
operations
|
|
2255
|
+
} = this.tableMeta;
|
|
2256
|
+
return operations.elements;
|
|
2257
|
+
},
|
|
2258
|
+
pageSize() {
|
|
2259
|
+
const {
|
|
2260
|
+
page = {}
|
|
2261
|
+
} = this.tableMeta;
|
|
2262
|
+
return page.pageSize || 10;
|
|
2263
|
+
},
|
|
2264
|
+
pageSizeOptions() {
|
|
2265
|
+
const {
|
|
2266
|
+
page = {}
|
|
2267
|
+
} = this.tableMeta;
|
|
2268
|
+
return page.pageSizeOptions || ['10', '20', '30', '40'];
|
|
2269
|
+
},
|
|
2270
|
+
columns() {
|
|
2271
|
+
const {
|
|
2272
|
+
columns,
|
|
2273
|
+
operations
|
|
2274
|
+
} = this.tableMeta;
|
|
2275
|
+
if (type.get(columns) === 'array') {
|
|
2276
|
+
const columnsOptions = columns.map(item => {
|
|
2277
|
+
if (item.render) {
|
|
2278
|
+
return {
|
|
2279
|
+
title: item.title,
|
|
2280
|
+
dataIndex: item.dataIndex,
|
|
2281
|
+
width: item.width,
|
|
2282
|
+
align: item.align,
|
|
2283
|
+
fixed: item.fixed,
|
|
2284
|
+
customRender: (text, record, index) => {
|
|
2285
|
+
const {
|
|
2286
|
+
$createElement
|
|
2287
|
+
} = this;
|
|
2288
|
+
return item.render.call(this, {
|
|
2289
|
+
h: $createElement,
|
|
2290
|
+
ctx: this
|
|
2291
|
+
}, typeof text == 'string' ? text : text[item.dataIndex], record, index);
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
return {
|
|
2296
|
+
title: item.title,
|
|
2297
|
+
dataIndex: item.dataIndex,
|
|
2298
|
+
width: item.width,
|
|
2299
|
+
align: item.align,
|
|
2300
|
+
fixed: item.fixed
|
|
2301
|
+
};
|
|
2302
|
+
});
|
|
2303
|
+
if (operations) {
|
|
2304
|
+
return [...columnsOptions, {
|
|
2305
|
+
title: '操作',
|
|
2306
|
+
width: operations.width,
|
|
2307
|
+
key: 'action',
|
|
2308
|
+
fixed: 'right',
|
|
2309
|
+
scopedSlots: {
|
|
2310
|
+
customRender: 'action'
|
|
2311
|
+
}
|
|
2312
|
+
}];
|
|
2313
|
+
}
|
|
2314
|
+
return columnsOptions;
|
|
2315
|
+
} else {
|
|
2316
|
+
console.error('Error: columns is invalid, please check it');
|
|
2317
|
+
return [];
|
|
2318
|
+
}
|
|
2319
|
+
},
|
|
2320
|
+
getButtonGroupElements() {
|
|
2321
|
+
const {
|
|
2322
|
+
elements
|
|
2323
|
+
} = this.buttonGroupMeta;
|
|
2324
|
+
if (type.get(elements) === 'function') {
|
|
2325
|
+
return elements.call(this);
|
|
2326
|
+
} else if (type.get(elements) === 'array') {
|
|
2327
|
+
return elements;
|
|
2328
|
+
} else {
|
|
2329
|
+
return [];
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
},
|
|
2333
|
+
async created() {
|
|
2334
|
+
if (this.showTree) {
|
|
2335
|
+
this.treeData = await this.requestTreeData();
|
|
2336
|
+
const [defaultTreeNode = {}] = this.treeData;
|
|
2337
|
+
this.defaultExpandedKeys = [defaultTreeNode[this.replaceFields.key]];
|
|
2338
|
+
this.defaultSelectedKeys = [defaultTreeNode[this.replaceFields.key]];
|
|
2339
|
+
this.currentTreeNodeData = defaultTreeNode;
|
|
2340
|
+
}
|
|
2341
|
+
const {
|
|
2342
|
+
fieldMap
|
|
2343
|
+
} = this.tableMeta;
|
|
2344
|
+
this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, this.currentTreeNodeData));
|
|
2345
|
+
},
|
|
2346
|
+
methods: {
|
|
2347
|
+
handleClickButtonGroup(props) {
|
|
2348
|
+
const {
|
|
2349
|
+
eventName
|
|
2350
|
+
} = props;
|
|
2351
|
+
this.$emit(eventName, {
|
|
2352
|
+
currentTreeNode: this.currentTreeNodeData
|
|
2353
|
+
});
|
|
2354
|
+
},
|
|
2355
|
+
watchViewPort() {
|
|
2356
|
+
const modelTableWrapper = this.$refs[this.modelTableWrapper];
|
|
2357
|
+
console.log(modelTableWrapper.getBoundingClientRect());
|
|
2358
|
+
const {
|
|
2359
|
+
top
|
|
2360
|
+
} = modelTableWrapper.getBoundingClientRect();
|
|
2361
|
+
this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`;
|
|
2362
|
+
},
|
|
2363
|
+
async onSearch(props) {
|
|
2364
|
+
this.tableQuerys = Object.assign(this.tableQuerys, props);
|
|
2365
|
+
this.tableData = await this.requestTableData();
|
|
2366
|
+
},
|
|
2367
|
+
execTableFieldMap(fieldMap = {}, props) {
|
|
2368
|
+
let ret = {};
|
|
2369
|
+
const keys = Object.keys(fieldMap);
|
|
2370
|
+
keys.forEach(key => {
|
|
2371
|
+
const field = fieldMap[key];
|
|
2372
|
+
ret[field] = props[key];
|
|
2373
|
+
});
|
|
2374
|
+
return ret;
|
|
2375
|
+
},
|
|
2376
|
+
async selectTreeNode(selectedKeys, e) {
|
|
2377
|
+
const {
|
|
2378
|
+
fieldMap
|
|
2379
|
+
} = this.tableMeta;
|
|
2380
|
+
this.currentTreeNodeData = e.node.$vnode.data.props.dataRef;
|
|
2381
|
+
const execFieldMapRet = this.execTableFieldMap(fieldMap, e.node.$vnode.data.props.dataRef);
|
|
2382
|
+
this.tableData = await this.requestTableData(execFieldMapRet);
|
|
2383
|
+
},
|
|
2384
|
+
async requestTreeData() {
|
|
2385
|
+
const {
|
|
2386
|
+
url,
|
|
2387
|
+
requestType
|
|
2388
|
+
} = this.treeMeta;
|
|
2389
|
+
const ret = await net.get(url).then(resp => {
|
|
2390
|
+
const {
|
|
2391
|
+
data
|
|
2392
|
+
} = resp || {};
|
|
2393
|
+
return data;
|
|
2394
|
+
});
|
|
2395
|
+
return ret;
|
|
2396
|
+
},
|
|
2397
|
+
async onChangePage(page, pageSize) {
|
|
2398
|
+
this.tableData = await this.requestTableData({
|
|
2399
|
+
currentPage: page,
|
|
2400
|
+
pageSize
|
|
2401
|
+
});
|
|
2402
|
+
},
|
|
2403
|
+
async requestTableData(props = {}) {
|
|
2404
|
+
const {
|
|
2405
|
+
url,
|
|
2406
|
+
requestType,
|
|
2407
|
+
page = {}
|
|
2408
|
+
} = this.tableMeta;
|
|
2409
|
+
const {
|
|
2410
|
+
pageSize = 10
|
|
2411
|
+
} = page;
|
|
2412
|
+
this.tableQuerys = Object.assign(this.tableQuerys, {
|
|
2413
|
+
currentPage: 1,
|
|
2414
|
+
pageSize
|
|
2415
|
+
}, props);
|
|
2416
|
+
const ret = await net.get(url, this.tableQuerys).then(resp => {
|
|
2417
|
+
const {
|
|
2418
|
+
data = [],
|
|
2419
|
+
count
|
|
2420
|
+
} = resp || {};
|
|
2421
|
+
this.total = count;
|
|
2422
|
+
return data.map(item => {
|
|
2423
|
+
return {
|
|
2424
|
+
key: v4(),
|
|
2425
|
+
...item
|
|
2426
|
+
};
|
|
2427
|
+
});
|
|
2428
|
+
});
|
|
2429
|
+
return ret;
|
|
2430
|
+
},
|
|
2431
|
+
refreshTreeStatus(props = {}) {},
|
|
2432
|
+
refreshTableStatus(props = {}) {},
|
|
2433
|
+
getModelTableWrapperHeight() {},
|
|
2434
|
+
setModelTreeWrapperHeight(height) {
|
|
2435
|
+
this.$refs[this.modelTreeWrapper].style.height = height;
|
|
2436
|
+
},
|
|
2437
|
+
setModelTableWrapperHeight() {
|
|
2438
|
+
const {
|
|
2439
|
+
top
|
|
2440
|
+
} = this.$refs[this.modelTableWrapper].getBoundingClientRect();
|
|
2441
|
+
const height = `calc(100vh - ${top}px)`;
|
|
2442
|
+
this.$refs[this.modelTableWrapper].style.height = height;
|
|
2443
|
+
this.setModelTreeWrapperHeight(height);
|
|
2444
|
+
},
|
|
2445
|
+
getSearchAreaHeight() {
|
|
2446
|
+
return this.$refs[this.searchArea].$el.clientHeight;
|
|
2447
|
+
},
|
|
2448
|
+
getButtonGroupHeight() {
|
|
2449
|
+
return this.$refs[this.buttonGroup].$el.clientHeight;
|
|
2450
|
+
}
|
|
2451
|
+
},
|
|
2452
|
+
mounted() {
|
|
2453
|
+
//TODO
|
|
2454
|
+
// this.setModelTableWrapperHeight()
|
|
2455
|
+
// this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {
|
|
2456
|
+
// for (let entry of entries) {
|
|
2457
|
+
// this.modelTableWrapperHeight = entry.contentRect.height
|
|
2458
|
+
// console.log('this.modelTableWrapperHeight:', this.modelTableWrapperHeight)
|
|
2459
|
+
// console.log('getSearchAreaHeight', this.getSearchAreaHeight())
|
|
2460
|
+
// console.log('getButtonGroupHeight', this.getButtonGroupHeight())
|
|
2461
|
+
// const tableHeight = this.modelTableWrapperHeight - this.getSearchAreaHeight() - this.getButtonGroupHeight()
|
|
2462
|
+
// console.log('tableHeight', tableHeight)
|
|
2463
|
+
// }
|
|
2464
|
+
// })
|
|
2465
|
+
// this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])
|
|
2466
|
+
}
|
|
2467
|
+
};
|
|
2468
|
+
|
|
2469
|
+
/* script */
|
|
2470
|
+
const __vue_script__$d = script$d;
|
|
2471
|
+
|
|
2472
|
+
/* template */
|
|
2473
|
+
var __vue_render__$d = function () {
|
|
2474
|
+
var _vm = this;
|
|
2475
|
+
var _h = _vm.$createElement;
|
|
2476
|
+
var _c = _vm._self._c || _h;
|
|
2477
|
+
return _c("section", { staticClass: "ele model__tree-table" }, [
|
|
2478
|
+
_vm.showTree
|
|
2479
|
+
? _c("section", { staticClass: "model__tree-table--container" }, [
|
|
2480
|
+
_c("div", { staticClass: "model__tree--title" }),
|
|
2481
|
+
_vm._v(" "),
|
|
2482
|
+
_c(
|
|
2483
|
+
"section",
|
|
2484
|
+
{ ref: _vm.modelTreeWrapper, staticClass: "model__tree--wrapper" },
|
|
2485
|
+
[
|
|
2486
|
+
_c("ele-tree", {
|
|
2487
|
+
attrs: {
|
|
2488
|
+
"tree-data": _vm.treeData,
|
|
2489
|
+
defaultExpandedKeys: _vm.defaultExpandedKeys,
|
|
2490
|
+
defaultSelectedKeys: _vm.defaultSelectedKeys,
|
|
2491
|
+
"replace-fields":
|
|
2492
|
+
_vm.treeMeta.replaceFields || _vm.replaceFields,
|
|
2493
|
+
},
|
|
2494
|
+
on: { select: _vm.selectTreeNode },
|
|
2495
|
+
}),
|
|
2496
|
+
],
|
|
2497
|
+
1
|
|
2498
|
+
),
|
|
2499
|
+
])
|
|
2500
|
+
: _vm._e(),
|
|
2501
|
+
_vm._v(" "),
|
|
2502
|
+
_c("section", { staticClass: "model__table--container" }, [
|
|
2503
|
+
_c("div", { staticClass: "model__table--title" }),
|
|
2504
|
+
_vm._v(" "),
|
|
2505
|
+
_c(
|
|
2506
|
+
"section",
|
|
2507
|
+
{ ref: _vm.modelTableWrapper, staticClass: "model__table--wrapper" },
|
|
2508
|
+
[
|
|
2509
|
+
_c("ele-search-area", {
|
|
2510
|
+
ref: _vm.searchArea,
|
|
2511
|
+
attrs: { "data-source": _vm.searchMeta.elements },
|
|
2512
|
+
on: { search: _vm.onSearch },
|
|
2513
|
+
}),
|
|
2514
|
+
_vm._v(" "),
|
|
2515
|
+
_c(
|
|
2516
|
+
"ele-button-group",
|
|
2517
|
+
_vm._g(
|
|
2518
|
+
{
|
|
2519
|
+
ref: _vm.buttonGroup,
|
|
2520
|
+
staticStyle: { "margin-top": "16px" },
|
|
2521
|
+
attrs: { "data-source": _vm.getButtonGroupElements },
|
|
2522
|
+
on: { click: _vm.handleClickButtonGroup },
|
|
2523
|
+
},
|
|
2524
|
+
_vm.$listeners
|
|
2525
|
+
)
|
|
2526
|
+
),
|
|
2527
|
+
_vm._v(" "),
|
|
2528
|
+
_c(
|
|
2529
|
+
"ele-table",
|
|
2530
|
+
_vm._g(
|
|
2531
|
+
{
|
|
2532
|
+
staticStyle: { "margin-top": "8px" },
|
|
2533
|
+
attrs: {
|
|
2534
|
+
loading: _vm.loading,
|
|
2535
|
+
columns: _vm.columns,
|
|
2536
|
+
total: _vm.total,
|
|
2537
|
+
actions: _vm.actions,
|
|
2538
|
+
pageSize: _vm.pageSize,
|
|
2539
|
+
pageSizeOptions: _vm.pageSizeOptions,
|
|
2540
|
+
"data-source": _vm.tableData,
|
|
2541
|
+
},
|
|
2542
|
+
on: { "change-page": _vm.onChangePage },
|
|
2543
|
+
},
|
|
2544
|
+
_vm.$listeners
|
|
2545
|
+
)
|
|
2546
|
+
),
|
|
2547
|
+
],
|
|
2548
|
+
1
|
|
2549
|
+
),
|
|
2550
|
+
]),
|
|
2551
|
+
])
|
|
2552
|
+
};
|
|
2553
|
+
var __vue_staticRenderFns__$d = [];
|
|
2554
|
+
__vue_render__$d._withStripped = true;
|
|
2555
|
+
|
|
2556
|
+
/* style */
|
|
2557
|
+
const __vue_inject_styles__$d = function (inject) {
|
|
2558
|
+
if (!inject) return
|
|
2559
|
+
inject("data-v-fe2ee33e_0", { source: ".ele.model__tree-table[data-v-fe2ee33e] {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.ele.model__tree-table .model__tree-table--container .model__tree--wrapper[data-v-fe2ee33e] {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.ele.model__tree-table .model__table--container[data-v-fe2ee33e] {\n width: 100%;\n min-width: 0;\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper[data-v-fe2ee33e] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tree-table-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAgSA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC/RA;ADiSA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC/RA;ADkSA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AChSA;ADiSA;EACA,gBAAA;AC/RA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"ele model__tree-table\">\r\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\r\n <div class=\"model__tree--title\"></div>\r\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\">\r\n <ele-tree \r\n :tree-data=\"treeData\"\r\n :defaultExpandedKeys=\"defaultExpandedKeys\"\r\n :defaultSelectedKeys=\"defaultSelectedKeys\"\r\n @select=\"selectTreeNode\"\r\n :replace-fields=\"treeMeta.replaceFields || replaceFields\">\r\n </ele-tree>\r\n </section>\r\n </section>\r\n <section class=\"model__table--container\">\r\n <div class=\"model__table--title\"></div>\r\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\r\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\r\n <ele-button-group v-on=\"$listeners\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" style=\"margin-top: 16px\" :data-source=\"getButtonGroupElements\"></ele-button-group>\r\n <ele-table\r\n v-on=\"$listeners\"\r\n :loading=\"loading\" \r\n :columns=\"columns\"\r\n :total=\"total\"\r\n :actions=\"actions\"\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n :data-source=\"tableData\"\r\n @change-page=\"onChangePage\" \r\n style=\"margin-top: 8px;\"\r\n ></ele-table>\r\n </section>\r\n </section>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nimport EleTree from '../../tree/src/index.vue'\r\nimport EleTable from '../../table/src/index.vue'\r\nimport EleSearchArea from '../../composite-components/search-area/src/index.vue'\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nimport { type, net } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nexport default {\r\n name: 'ele-tree-table-model',\r\n components: {\r\n EleTree,\r\n EleTable,\r\n EleSearchArea,\r\n EleButtonGroup\r\n },\r\n props: {\r\n treeMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n searchMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n typeof: Object,\r\n default: () => ({})\r\n },\r\n tableMeta: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n provide () {\r\n return {\r\n requestTreeData: this.requestTreeData,\r\n requestTableData: this.requestTableData\r\n }\r\n },\r\n data () {\r\n return {\r\n treeData: [],\r\n tableData: [],\r\n defaultExpandedKeys: [],\r\n defaultSelectedKeys: [],\r\n replaceFields: {\r\n title: 'title',\r\n children: 'children',\r\n key: 'id'\r\n },\r\n loading: false,\r\n total: 0,\r\n tableQuerys: {},\r\n resizeObserverModelTableWrapper: null,\r\n modelTableWrapperHeight: 0,\r\n currentTreeNodeData: {}\r\n }\r\n },\r\n computed: {\r\n showTree () {\r\n return !!Object.keys(this.treeMeta).length\r\n },\r\n buttonGroup () {\r\n return uuidv4()\r\n },\r\n searchArea () {\r\n return uuidv4()\r\n },\r\n modelTreeWrapper () {\r\n return uuidv4()\r\n },\r\n modelTableWrapper () {\r\n return uuidv4()\r\n },\r\n actions () {\r\n const { operations } = this.tableMeta\r\n return operations.elements\r\n },\r\n pageSize () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSize || 10\r\n },\r\n pageSizeOptions () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSizeOptions || ['10', '20', '30', '40']\r\n },\r\n columns () {\r\n const { columns, operations } = this.tableMeta\r\n if (type.get(columns) === 'array') {\r\n const columnsOptions = columns.map(item => {\r\n if (item.render) {\r\n return {\r\n title: item.title,\r\n dataIndex: item.dataIndex,\r\n width: item.width,\r\n align: item.align,\r\n fixed: item.fixed,\r\n customRender: (text, record, index) => {\r\n const { $createElement } = this\r\n return item.render.call(this, { h: $createElement, ctx: this }, typeof text == 'string' ? text : text[item.dataIndex], record, index)\r\n }\r\n }\r\n }\r\n return {\r\n title: item.title,\r\n dataIndex: item.dataIndex,\r\n width: item.width,\r\n align: item.align,\r\n fixed: item.fixed\r\n }\r\n })\r\n if (operations) {\r\n return [\r\n ...columnsOptions,\r\n {\r\n title: '操作',\r\n width: operations.width,\r\n key: 'action',\r\n fixed: 'right',\r\n scopedSlots: { customRender: 'action' }\r\n }\r\n ]\r\n }\r\n return columnsOptions\r\n } else {\r\n console.error('Error: columns is invalid, please check it')\r\n return []\r\n }\r\n },\r\n getButtonGroupElements () {\r\n const { elements } = this.buttonGroupMeta\r\n if (type.get(elements) === 'function') {\r\n return elements.call(this)\r\n } else if (type.get(elements) === 'array') {\r\n return elements\r\n } else {\r\n return []\r\n }\r\n }\r\n },\r\n async created () {\r\n if (this.showTree) {\r\n this.treeData = await this.requestTreeData()\r\n const [defaultTreeNode = {}] = this.treeData\r\n this.defaultExpandedKeys = [defaultTreeNode[this.replaceFields.key]]\r\n this.defaultSelectedKeys = [defaultTreeNode[this.replaceFields.key]]\r\n this.currentTreeNodeData = defaultTreeNode\r\n }\r\n const { fieldMap } = this.tableMeta\r\n this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, this.currentTreeNodeData))\r\n },\r\n methods: {\r\n handleClickButtonGroup (props) {\r\n const { eventName } = props\r\n this.$emit(eventName, { currentTreeNode: this.currentTreeNodeData })\r\n },\r\n watchViewPort () {\r\n const modelTableWrapper = this.$refs[this.modelTableWrapper]\r\n console.log(modelTableWrapper.getBoundingClientRect())\r\n const { top } = modelTableWrapper.getBoundingClientRect()\r\n this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`\r\n },\r\n async onSearch (props) {\r\n this.tableQuerys = Object.assign(this.tableQuerys, props)\r\n this.tableData = await this.requestTableData()\r\n },\r\n execTableFieldMap (fieldMap = {}, props) {\r\n let ret = {}\r\n const keys = Object.keys(fieldMap)\r\n keys.forEach(key => {\r\n const field = fieldMap[key]\r\n ret[field] = props[key]\r\n })\r\n return ret\r\n },\r\n async selectTreeNode (selectedKeys, e) {\r\n const { fieldMap } = this.tableMeta\r\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef\r\n const execFieldMapRet = this.execTableFieldMap(fieldMap, e.node.$vnode.data.props.dataRef)\r\n this.tableData = await this.requestTableData(execFieldMapRet)\r\n },\r\n async requestTreeData () {\r\n const { url, requestType } = this.treeMeta\r\n const ret = await net.get(\r\n url\r\n ).then(resp => {\r\n const { data } = resp || {}\r\n return data\r\n })\r\n return ret\r\n },\r\n async onChangePage (page, pageSize) {\r\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\r\n },\r\n async requestTableData (props = {}) {\r\n const { url, requestType, page = {} } = this.tableMeta\r\n const { pageSize = 10 } = page\r\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\r\n const ret = await net.get(\r\n url,\r\n this.tableQuerys\r\n ).then(resp => {\r\n const { data = [], count } = resp || {}\r\n this.total = count\r\n return data.map(item => {\r\n return {\r\n key: uuidv4(),\r\n ...item\r\n }\r\n })\r\n })\r\n return ret\r\n },\r\n refreshTreeStatus (props = {}) {},\r\n refreshTableStatus (props = {}) {},\r\n getModelTableWrapperHeight () {},\r\n setModelTreeWrapperHeight (height) {\r\n this.$refs[this.modelTreeWrapper].style.height = height\r\n },\r\n setModelTableWrapperHeight () {\r\n const { top } = this.$refs[this.modelTableWrapper].getBoundingClientRect()\r\n const height = `calc(100vh - ${top}px)`\r\n this.$refs[this.modelTableWrapper].style.height = height\r\n this.setModelTreeWrapperHeight(height)\r\n },\r\n getSearchAreaHeight () {\r\n return this.$refs[this.searchArea].$el.clientHeight\r\n },\r\n getButtonGroupHeight () {\r\n return this.$refs[this.buttonGroup].$el.clientHeight\r\n }\r\n },\r\n mounted () {\r\n //TODO\r\n // this.setModelTableWrapperHeight()\r\n // this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\r\n // for (let entry of entries) {\r\n // this.modelTableWrapperHeight = entry.contentRect.height\r\n // console.log('this.modelTableWrapperHeight:', this.modelTableWrapperHeight)\r\n // console.log('getSearchAreaHeight', this.getSearchAreaHeight())\r\n // console.log('getButtonGroupHeight', this.getButtonGroupHeight())\r\n // const tableHeight = this.modelTableWrapperHeight - this.getSearchAreaHeight() - this.getButtonGroupHeight()\r\n // console.log('tableHeight', tableHeight)\r\n // }\r\n // })\r\n // this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele {\r\n &.model__tree-table {\r\n background: transparent; \r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n .model__tree-table--container {\r\n .model__tree--wrapper {\r\n width: 240px;\r\n background: #fff;\r\n flex-shrink: 0;\r\n padding: 16px;\r\n box-sizing: border-box;\r\n margin-right: 16px;\r\n overflow-y: auto;\r\n }\r\n }\r\n .model__table--container {\r\n width: 100%;\r\n min-width: 0;\r\n background: #fff;\r\n .model__table--wrapper {\r\n background: #fff;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".ele.model__tree-table {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.ele.model__tree-table .model__tree-table--container .model__tree--wrapper {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.ele.model__tree-table .model__table--container {\n width: 100%;\n min-width: 0;\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2560
|
+
|
|
2561
|
+
};
|
|
2562
|
+
/* scoped */
|
|
2563
|
+
const __vue_scope_id__$d = "data-v-fe2ee33e";
|
|
2564
|
+
/* module identifier */
|
|
2565
|
+
const __vue_module_identifier__$d = undefined;
|
|
2566
|
+
/* functional template */
|
|
2567
|
+
const __vue_is_functional_template__$d = false;
|
|
2568
|
+
/* style inject SSR */
|
|
2569
|
+
|
|
2570
|
+
/* style inject shadow dom */
|
|
2571
|
+
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
const __vue_component__$d = /*#__PURE__*/normalizeComponent(
|
|
2575
|
+
{ render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
|
|
2576
|
+
__vue_inject_styles__$d,
|
|
2577
|
+
__vue_script__$d,
|
|
2578
|
+
__vue_scope_id__$d,
|
|
2579
|
+
__vue_is_functional_template__$d,
|
|
2580
|
+
__vue_module_identifier__$d,
|
|
2581
|
+
false,
|
|
2582
|
+
createInjector,
|
|
2583
|
+
undefined,
|
|
2584
|
+
undefined
|
|
2585
|
+
);
|
|
2586
|
+
|
|
2587
|
+
//
|
|
2588
|
+
var script$c = {
|
|
2589
|
+
name: 'ele-tpl',
|
|
2590
|
+
props: {
|
|
2591
|
+
modelName: {
|
|
2592
|
+
type: String
|
|
2593
|
+
}
|
|
2594
|
+
},
|
|
2595
|
+
components: {
|
|
2596
|
+
[__vue_component__$d.name]: __vue_component__$d
|
|
2597
|
+
},
|
|
2598
|
+
computed: {
|
|
2599
|
+
modelNameValidator() {
|
|
2600
|
+
const target = models.find(model => model.name === this.modelName);
|
|
2601
|
+
return {
|
|
2602
|
+
existed: !!target,
|
|
2603
|
+
message: !!target ? '' : `Model <span style="color:red;">${this.modelName}</span> not found`
|
|
2604
|
+
};
|
|
2605
|
+
},
|
|
2606
|
+
genModelRef() {
|
|
2607
|
+
return v4();
|
|
2608
|
+
}
|
|
2609
|
+
},
|
|
2610
|
+
methods: {
|
|
2611
|
+
getModel() {
|
|
2612
|
+
return this.$refs[this.genModelRef];
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
/* script */
|
|
2618
|
+
const __vue_script__$c = script$c;
|
|
2619
|
+
|
|
2620
|
+
/* template */
|
|
2621
|
+
var __vue_render__$c = function () {
|
|
2622
|
+
var _vm = this;
|
|
2623
|
+
var _h = _vm.$createElement;
|
|
2624
|
+
var _c = _vm._self._c || _h;
|
|
2625
|
+
return _vm.modelNameValidator.existed
|
|
2626
|
+
? _c(
|
|
2627
|
+
_vm.modelName,
|
|
2628
|
+
_vm._g(
|
|
2629
|
+
_vm._b(
|
|
2630
|
+
{
|
|
2631
|
+
ref: _vm.genModelRef,
|
|
2632
|
+
tag: "component",
|
|
2633
|
+
scopedSlots: _vm._u(
|
|
2634
|
+
[
|
|
2635
|
+
_vm._l(_vm.$scopedSlots, function (idx, name) {
|
|
2636
|
+
return {
|
|
2637
|
+
key: name,
|
|
2638
|
+
fn: function (data) {
|
|
2639
|
+
return [_vm._t(name, null, null, data)]
|
|
2640
|
+
},
|
|
2641
|
+
}
|
|
2642
|
+
}),
|
|
2643
|
+
],
|
|
2644
|
+
null,
|
|
2645
|
+
true
|
|
2646
|
+
),
|
|
2647
|
+
},
|
|
2648
|
+
"component",
|
|
2649
|
+
_vm.$attrs,
|
|
2650
|
+
false
|
|
2651
|
+
),
|
|
2652
|
+
_vm.$listeners
|
|
2653
|
+
)
|
|
2654
|
+
)
|
|
2655
|
+
: _c("div", {
|
|
2656
|
+
domProps: { innerHTML: _vm._s(_vm.modelNameValidator.message) },
|
|
2657
|
+
})
|
|
2658
|
+
};
|
|
2659
|
+
var __vue_staticRenderFns__$c = [];
|
|
2660
|
+
__vue_render__$c._withStripped = true;
|
|
2661
|
+
|
|
2662
|
+
/* style */
|
|
2663
|
+
const __vue_inject_styles__$c = function (inject) {
|
|
2664
|
+
if (!inject) return
|
|
2665
|
+
inject("data-v-7b13873a_0", { source: ".has-error .ele-upload__wrapper .file-uploads label {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-008: rgba(0, 0, 0, 0.88);\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;AACzC;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .file-uploads label {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-008: rgba(0, 0, 0, 0.88);\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2666
|
+
|
|
2667
|
+
};
|
|
2668
|
+
/* scoped */
|
|
2669
|
+
const __vue_scope_id__$c = undefined;
|
|
2670
|
+
/* module identifier */
|
|
2671
|
+
const __vue_module_identifier__$c = undefined;
|
|
2672
|
+
/* functional template */
|
|
2673
|
+
const __vue_is_functional_template__$c = false;
|
|
2674
|
+
/* style inject SSR */
|
|
2675
|
+
|
|
2676
|
+
/* style inject shadow dom */
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
|
|
2680
|
+
const __vue_component__$c = /*#__PURE__*/normalizeComponent(
|
|
2681
|
+
{ render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
|
|
2682
|
+
__vue_inject_styles__$c,
|
|
2683
|
+
__vue_script__$c,
|
|
2684
|
+
__vue_scope_id__$c,
|
|
2685
|
+
__vue_is_functional_template__$c,
|
|
2686
|
+
__vue_module_identifier__$c,
|
|
2687
|
+
false,
|
|
2688
|
+
createInjector,
|
|
2689
|
+
undefined,
|
|
2690
|
+
undefined
|
|
2691
|
+
);
|
|
2692
|
+
|
|
2693
|
+
__vue_component__$c.install = Vue => Vue.component(__vue_component__$c.name, __vue_component__$c);
|
|
2694
|
+
|
|
2695
|
+
//
|
|
2696
|
+
//
|
|
2697
|
+
//
|
|
2698
|
+
//
|
|
2699
|
+
//
|
|
2700
|
+
//
|
|
2701
|
+
//
|
|
2702
|
+
//
|
|
2703
|
+
//
|
|
2704
|
+
//
|
|
2705
|
+
//
|
|
2706
|
+
|
|
2707
|
+
var script$b = {
|
|
2708
|
+
name: 'ele-textarea',
|
|
2709
|
+
props: {
|
|
2710
|
+
maxLength: {
|
|
2711
|
+
type: Number
|
|
2712
|
+
},
|
|
2713
|
+
placeholder: {
|
|
2714
|
+
type: String
|
|
2715
|
+
},
|
|
2716
|
+
allowClear: {
|
|
2717
|
+
type: Boolean,
|
|
2718
|
+
default: false
|
|
2719
|
+
},
|
|
2720
|
+
autosize: {
|
|
2721
|
+
type: [Boolean, Object],
|
|
2722
|
+
default: () => ({
|
|
2723
|
+
minRows: 4,
|
|
2724
|
+
maxRows: 4
|
|
2725
|
+
})
|
|
2726
|
+
},
|
|
2727
|
+
value: {
|
|
2728
|
+
type: String
|
|
2729
|
+
}
|
|
2730
|
+
},
|
|
2731
|
+
methods: {
|
|
2732
|
+
onChange(e) {
|
|
2733
|
+
const value = e.target.value;
|
|
2734
|
+
this.$emit('on-change', value);
|
|
2735
|
+
this.$emit('input', value);
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
};
|
|
2739
|
+
|
|
2740
|
+
/* script */
|
|
2741
|
+
const __vue_script__$b = script$b;
|
|
2742
|
+
|
|
2743
|
+
/* template */
|
|
2744
|
+
var __vue_render__$b = function () {
|
|
2745
|
+
var _vm = this;
|
|
2746
|
+
var _h = _vm.$createElement;
|
|
2747
|
+
var _c = _vm._self._c || _h;
|
|
2748
|
+
return _c("a-textarea", {
|
|
2749
|
+
attrs: {
|
|
2750
|
+
value: _vm.value,
|
|
2751
|
+
"auto-size": _vm.autosize,
|
|
2752
|
+
"max-length": _vm.maxLength,
|
|
2753
|
+
placeholder: _vm.placeholder,
|
|
2754
|
+
"allow-clear": _vm.allowClear,
|
|
2755
|
+
},
|
|
2756
|
+
on: { change: _vm.onChange },
|
|
2757
|
+
})
|
|
2758
|
+
};
|
|
2759
|
+
var __vue_staticRenderFns__$b = [];
|
|
2760
|
+
__vue_render__$b._withStripped = true;
|
|
2761
|
+
|
|
2762
|
+
/* style */
|
|
2763
|
+
const __vue_inject_styles__$b = function (inject) {
|
|
2764
|
+
if (!inject) return
|
|
2765
|
+
inject("data-v-256502c2_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
2766
|
+
|
|
2767
|
+
};
|
|
2768
|
+
/* scoped */
|
|
2769
|
+
const __vue_scope_id__$b = "data-v-256502c2";
|
|
2770
|
+
/* module identifier */
|
|
2771
|
+
const __vue_module_identifier__$b = undefined;
|
|
2772
|
+
/* functional template */
|
|
2773
|
+
const __vue_is_functional_template__$b = false;
|
|
2774
|
+
/* style inject SSR */
|
|
2775
|
+
|
|
2776
|
+
/* style inject shadow dom */
|
|
2777
|
+
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
const __vue_component__$b = /*#__PURE__*/normalizeComponent(
|
|
2781
|
+
{ render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
|
|
2782
|
+
__vue_inject_styles__$b,
|
|
2783
|
+
__vue_script__$b,
|
|
2784
|
+
__vue_scope_id__$b,
|
|
2785
|
+
__vue_is_functional_template__$b,
|
|
2786
|
+
__vue_module_identifier__$b,
|
|
2787
|
+
false,
|
|
2788
|
+
createInjector,
|
|
2789
|
+
undefined,
|
|
2790
|
+
undefined
|
|
2791
|
+
);
|
|
2792
|
+
|
|
2793
|
+
//
|
|
2794
|
+
//
|
|
2795
|
+
//
|
|
2796
|
+
//
|
|
2797
|
+
//
|
|
2798
|
+
//
|
|
2799
|
+
//
|
|
2800
|
+
//
|
|
2801
|
+
//
|
|
2802
|
+
|
|
2803
|
+
var script$a = {
|
|
2804
|
+
name: 'ele-icon',
|
|
2805
|
+
props: {
|
|
2806
|
+
type: {
|
|
2807
|
+
type: String,
|
|
2808
|
+
default: ''
|
|
2809
|
+
},
|
|
2810
|
+
theme: {
|
|
2811
|
+
type: String
|
|
2812
|
+
}
|
|
2813
|
+
},
|
|
2814
|
+
computed: {
|
|
2815
|
+
isAntIcon() {
|
|
2816
|
+
const prefix = this.type.slice(0, 5);
|
|
2817
|
+
if (prefix === 'icon-') {
|
|
2818
|
+
return false;
|
|
2819
|
+
}
|
|
2820
|
+
return true;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
};
|
|
2824
|
+
|
|
2825
|
+
/* script */
|
|
2826
|
+
const __vue_script__$a = script$a;
|
|
2827
|
+
|
|
2828
|
+
/* template */
|
|
2829
|
+
var __vue_render__$a = function () {
|
|
2830
|
+
var _vm = this;
|
|
2831
|
+
var _h = _vm.$createElement;
|
|
2832
|
+
var _c = _vm._self._c || _h;
|
|
2833
|
+
return _vm.isAntIcon
|
|
2834
|
+
? _c("a-icon", { attrs: { type: _vm.type, theme: _vm.theme } })
|
|
2835
|
+
: _c("i", { class: ["iconfont", _vm.type] })
|
|
2836
|
+
};
|
|
2837
|
+
var __vue_staticRenderFns__$a = [];
|
|
2838
|
+
__vue_render__$a._withStripped = true;
|
|
2839
|
+
|
|
2840
|
+
/* style */
|
|
2841
|
+
const __vue_inject_styles__$a = undefined;
|
|
2842
|
+
/* scoped */
|
|
2843
|
+
const __vue_scope_id__$a = undefined;
|
|
2844
|
+
/* module identifier */
|
|
2845
|
+
const __vue_module_identifier__$a = undefined;
|
|
2846
|
+
/* functional template */
|
|
2847
|
+
const __vue_is_functional_template__$a = false;
|
|
2848
|
+
/* style inject */
|
|
2849
|
+
|
|
2850
|
+
/* style inject SSR */
|
|
2851
|
+
|
|
2852
|
+
/* style inject shadow dom */
|
|
2853
|
+
|
|
2854
|
+
|
|
2855
|
+
|
|
2856
|
+
const __vue_component__$a = /*#__PURE__*/normalizeComponent(
|
|
2857
|
+
{ render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
|
|
2858
|
+
__vue_inject_styles__$a,
|
|
2859
|
+
__vue_script__$a,
|
|
2860
|
+
__vue_scope_id__$a,
|
|
2861
|
+
__vue_is_functional_template__$a,
|
|
2862
|
+
__vue_module_identifier__$a,
|
|
2863
|
+
false,
|
|
2864
|
+
undefined,
|
|
2865
|
+
undefined,
|
|
2866
|
+
undefined
|
|
2867
|
+
);
|
|
2868
|
+
|
|
2869
|
+
//
|
|
2870
|
+
var script$9 = {
|
|
2871
|
+
name: 'ele-upload',
|
|
2872
|
+
components: {
|
|
2873
|
+
FileUpload,
|
|
2874
|
+
EleIcon: __vue_component__$a
|
|
2875
|
+
},
|
|
2876
|
+
model: {
|
|
2877
|
+
prop: 'value',
|
|
2878
|
+
event: 'change'
|
|
2879
|
+
},
|
|
2880
|
+
props: {
|
|
2881
|
+
url: {
|
|
2882
|
+
type: String,
|
|
2883
|
+
default: '/zuul/api-file/workbench/file'
|
|
2884
|
+
},
|
|
2885
|
+
size: {
|
|
2886
|
+
type: Number,
|
|
2887
|
+
default: 100
|
|
2888
|
+
},
|
|
2889
|
+
accept: {
|
|
2890
|
+
type: String
|
|
2891
|
+
},
|
|
2892
|
+
maximum: {
|
|
2893
|
+
type: Number,
|
|
2894
|
+
default: 10
|
|
2895
|
+
},
|
|
2896
|
+
multiple: {
|
|
2897
|
+
type: Boolean,
|
|
2898
|
+
default: false
|
|
2899
|
+
},
|
|
2900
|
+
drop: {
|
|
2901
|
+
type: Boolean,
|
|
2902
|
+
default: true
|
|
2903
|
+
},
|
|
2904
|
+
value: {
|
|
2905
|
+
type: [String, Array]
|
|
2906
|
+
},
|
|
2907
|
+
querys: {
|
|
2908
|
+
type: Object,
|
|
2909
|
+
default: () => ({
|
|
2910
|
+
_csrf: 'c81f993f-f044-45bb-b3af-2977d335042d',
|
|
2911
|
+
_t: new Date().valueOf()
|
|
2912
|
+
})
|
|
2913
|
+
},
|
|
2914
|
+
headers: {
|
|
2915
|
+
type: Object,
|
|
2916
|
+
default: () => ({})
|
|
2917
|
+
},
|
|
2918
|
+
byteConversion: {
|
|
2919
|
+
type: Number,
|
|
2920
|
+
default: 1024 * 1024
|
|
2921
|
+
},
|
|
2922
|
+
chunkEnabled: {
|
|
2923
|
+
type: Boolean,
|
|
2924
|
+
default: true
|
|
2925
|
+
}
|
|
2926
|
+
},
|
|
2927
|
+
data() {
|
|
2928
|
+
return {
|
|
2929
|
+
files: [],
|
|
2930
|
+
saveToServerAsyncPageTimer: null
|
|
2931
|
+
};
|
|
2932
|
+
},
|
|
2933
|
+
computed: {
|
|
2934
|
+
getPayloads() {
|
|
2935
|
+
return {
|
|
2936
|
+
override: false
|
|
2937
|
+
};
|
|
2938
|
+
},
|
|
2939
|
+
chunkConfig() {
|
|
2940
|
+
route.toQueryString(this.querys);
|
|
2941
|
+
return {
|
|
2942
|
+
action: `${window.prefixPath}/zuul/api-file/workbench/file/temp/chunk/vue`,
|
|
2943
|
+
headers: {
|
|
2944
|
+
'X-XSRF-TOKEN': localStorage.getItem('token')
|
|
2945
|
+
},
|
|
2946
|
+
minSize: 3 * this.byteConversion,
|
|
2947
|
+
maxActive: 3,
|
|
2948
|
+
maxRetries: 5,
|
|
2949
|
+
startBody: {
|
|
2950
|
+
override: true,
|
|
2951
|
+
path: '/cw'
|
|
2952
|
+
},
|
|
2953
|
+
uploadBody: {
|
|
2954
|
+
override: true,
|
|
2955
|
+
path: '/cw'
|
|
2956
|
+
},
|
|
2957
|
+
finishBody: {
|
|
2958
|
+
override: true,
|
|
2959
|
+
path: '/cw'
|
|
2960
|
+
}
|
|
2961
|
+
};
|
|
2962
|
+
},
|
|
2963
|
+
isFileUploadSuccessed() {
|
|
2964
|
+
return this.files.every(file => file.success);
|
|
2965
|
+
},
|
|
2966
|
+
isShowUploadContainer() {
|
|
2967
|
+
if (this.multiple) {
|
|
2968
|
+
if (this.isFileUploadSuccessed && this.files.length >= this.maximum) {
|
|
2969
|
+
return false;
|
|
2970
|
+
} else {
|
|
2971
|
+
return true;
|
|
2972
|
+
}
|
|
2973
|
+
} else {
|
|
2974
|
+
if (this.isFileUploadSuccessed && this.files.length >= 1) {
|
|
2975
|
+
return false;
|
|
2976
|
+
} else {
|
|
2977
|
+
return true;
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
},
|
|
2981
|
+
getMaximum() {
|
|
2982
|
+
return this.multiple ? this.maximum : 1;
|
|
2983
|
+
},
|
|
2984
|
+
fileSizeLimit() {
|
|
2985
|
+
return this.size * this.byteConversion;
|
|
2986
|
+
},
|
|
2987
|
+
postAction() {
|
|
2988
|
+
const ret = route.toQueryString(this.querys);
|
|
2989
|
+
return `${window.prefixPath}${this.url}?${ret}`;
|
|
2990
|
+
},
|
|
2991
|
+
uploadRef() {
|
|
2992
|
+
return v4();
|
|
2993
|
+
},
|
|
2994
|
+
fileSuffixIcon() {
|
|
2995
|
+
return {
|
|
2996
|
+
'doc': {
|
|
2997
|
+
name: 'icon-doc'
|
|
2998
|
+
}
|
|
2999
|
+
};
|
|
3000
|
+
},
|
|
3001
|
+
fileIds() {
|
|
3002
|
+
const fileIds = this.files.map(file => {
|
|
3003
|
+
return file.response.data.fileID;
|
|
3004
|
+
});
|
|
3005
|
+
return this.multiple ? fileIds : fileIds[0];
|
|
3006
|
+
}
|
|
3007
|
+
},
|
|
3008
|
+
methods: {
|
|
3009
|
+
handleClickDownload(file) {
|
|
3010
|
+
console.log('download file', file);
|
|
3011
|
+
},
|
|
3012
|
+
handleClickDelete(file) {
|
|
3013
|
+
this.$refs[this.uploadRef].remove(file);
|
|
3014
|
+
this.$emit('change', this.fileIds);
|
|
3015
|
+
},
|
|
3016
|
+
onWatchFiles(files) {
|
|
3017
|
+
this.files = files;
|
|
3018
|
+
if (this.isFileUploadSuccessed) {
|
|
3019
|
+
this.$emit('change', this.fileIds);
|
|
3020
|
+
}
|
|
3021
|
+
},
|
|
3022
|
+
async saveToServerAsyncPage(payloads = {}) {
|
|
3023
|
+
net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, {
|
|
3024
|
+
headers: {
|
|
3025
|
+
'Content-Type': 'multipart/form-data'
|
|
3026
|
+
}
|
|
3027
|
+
}).then(resp => {
|
|
3028
|
+
const {
|
|
3029
|
+
data
|
|
3030
|
+
} = resp;
|
|
3031
|
+
if (data !== 'saveToServerAsyncPage') {
|
|
3032
|
+
clearInterval(this.saveToServerAsyncPageTimer);
|
|
3033
|
+
}
|
|
3034
|
+
});
|
|
3035
|
+
// const ret = await net.post({
|
|
3036
|
+
// url: 'zuul/api-file/workbench/file/temp/saveToServerAsyncPage',
|
|
3037
|
+
// method: 'POST',
|
|
3038
|
+
// data: { ...payloads }
|
|
3039
|
+
// }).then(resp => {
|
|
3040
|
+
// const { data: { data, code, message } } = resp
|
|
3041
|
+
// if (code !== '2000') {
|
|
3042
|
+
// this.$Message.error(message)
|
|
3043
|
+
// return
|
|
3044
|
+
// }
|
|
3045
|
+
// if (data !== 'saveToServerAsyncPage') {
|
|
3046
|
+
// clearInterval(timer)
|
|
3047
|
+
// const { fileID, size } = data
|
|
3048
|
+
// this.$emit('on-success', { ...data, fileId: fileID })
|
|
3049
|
+
// this.$Message.success('同步成功')
|
|
3050
|
+
// return { fileId: fileID, size }
|
|
3051
|
+
// }
|
|
3052
|
+
// })
|
|
3053
|
+
// return ret
|
|
3054
|
+
},
|
|
3055
|
+
onWatchInputFiles(newFile, oldFile) {
|
|
3056
|
+
if (newFile && !oldFile) {
|
|
3057
|
+
// add file
|
|
3058
|
+
console.log('add', newFile);
|
|
3059
|
+
}
|
|
3060
|
+
if (newFile && oldFile) {
|
|
3061
|
+
// update file
|
|
3062
|
+
console.log('update', newFile);
|
|
3063
|
+
const {
|
|
3064
|
+
success,
|
|
3065
|
+
active,
|
|
3066
|
+
chunk,
|
|
3067
|
+
response
|
|
3068
|
+
} = newFile;
|
|
3069
|
+
if (chunk && success && !active) {
|
|
3070
|
+
console.log('chunk end');
|
|
3071
|
+
const {
|
|
3072
|
+
data: {
|
|
3073
|
+
file,
|
|
3074
|
+
type
|
|
3075
|
+
}
|
|
3076
|
+
} = response;
|
|
3077
|
+
const payloads = {
|
|
3078
|
+
filePath: file.match(/\/cw(.*)/)[0],
|
|
3079
|
+
asyncID: v4(),
|
|
3080
|
+
isDeleteOrigin: false,
|
|
3081
|
+
toImage: type === 'pdf' ? true : false,
|
|
3082
|
+
unzip: type === 'zip' ? true : false,
|
|
3083
|
+
_csrf: localStorage.getItem('token')
|
|
3084
|
+
};
|
|
3085
|
+
this.saveToServerAsyncPageTimer = setInterval(() => {
|
|
3086
|
+
this.saveToServerAsyncPage(payloads);
|
|
3087
|
+
}, 2000);
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
if (!newFile && oldFile) {
|
|
3091
|
+
// delete file
|
|
3092
|
+
console.log('delete');
|
|
3093
|
+
}
|
|
3094
|
+
if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {
|
|
3095
|
+
if (!this.$refs[this.uploadRef].active) {
|
|
3096
|
+
this.$refs[this.uploadRef].active = true;
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
};
|
|
3102
|
+
|
|
3103
|
+
/* script */
|
|
3104
|
+
const __vue_script__$9 = script$9;
|
|
3105
|
+
|
|
3106
|
+
/* template */
|
|
3107
|
+
var __vue_render__$9 = function () {
|
|
3108
|
+
var _vm = this;
|
|
3109
|
+
var _h = _vm.$createElement;
|
|
3110
|
+
var _c = _vm._self._c || _h;
|
|
3111
|
+
return _c(
|
|
3112
|
+
"div",
|
|
3113
|
+
{ staticClass: "ele-upload__wrapper" },
|
|
3114
|
+
[
|
|
3115
|
+
_c(
|
|
3116
|
+
"FileUpload",
|
|
3117
|
+
{
|
|
3118
|
+
directives: [
|
|
3119
|
+
{
|
|
3120
|
+
name: "show",
|
|
3121
|
+
rawName: "v-show",
|
|
3122
|
+
value: _vm.isShowUploadContainer,
|
|
3123
|
+
expression: "isShowUploadContainer",
|
|
3124
|
+
},
|
|
3125
|
+
],
|
|
3126
|
+
ref: _vm.uploadRef,
|
|
3127
|
+
staticClass: "ele-upload__inner",
|
|
3128
|
+
staticStyle: { width: "100%" },
|
|
3129
|
+
attrs: {
|
|
3130
|
+
drop: _vm.drop,
|
|
3131
|
+
"chunk-enabled": _vm.chunkEnabled,
|
|
3132
|
+
chunk: _vm.chunkConfig,
|
|
3133
|
+
accept: _vm.accept,
|
|
3134
|
+
size: _vm.fileSizeLimit,
|
|
3135
|
+
"post-action": _vm.postAction,
|
|
3136
|
+
multiple: _vm.multiple,
|
|
3137
|
+
maximum: _vm.getMaximum,
|
|
3138
|
+
},
|
|
3139
|
+
on: { "input-file": _vm.onWatchInputFiles, input: _vm.onWatchFiles },
|
|
3140
|
+
model: {
|
|
3141
|
+
value: _vm.files,
|
|
3142
|
+
callback: function ($$v) {
|
|
3143
|
+
_vm.files = $$v;
|
|
3144
|
+
},
|
|
3145
|
+
expression: "files",
|
|
3146
|
+
},
|
|
3147
|
+
},
|
|
3148
|
+
[
|
|
3149
|
+
_c("section", { staticClass: "ele-upload__area" }, [
|
|
3150
|
+
_c(
|
|
3151
|
+
"div",
|
|
3152
|
+
{ staticClass: "ele-upload__area--icon" },
|
|
3153
|
+
[_c("ele-icon", { attrs: { type: "cloud-upload" } })],
|
|
3154
|
+
1
|
|
3155
|
+
),
|
|
3156
|
+
_vm._v(" "),
|
|
3157
|
+
_c("div", { staticClass: "ele-upload__area--text" }, [
|
|
3158
|
+
_c("div", { staticClass: "ele-upload__message" }, [
|
|
3159
|
+
_vm._v("单击或拖动文件到该区域以上传"),
|
|
3160
|
+
]),
|
|
3161
|
+
_vm._v(" "),
|
|
3162
|
+
_c("div", { staticClass: "ele-upload__ext" }, [
|
|
3163
|
+
_vm._v("文件小于" + _vm._s(_vm.size) + "M"),
|
|
3164
|
+
]),
|
|
3165
|
+
]),
|
|
3166
|
+
]),
|
|
3167
|
+
]
|
|
3168
|
+
),
|
|
3169
|
+
_vm._v(" "),
|
|
3170
|
+
_c(
|
|
3171
|
+
"section",
|
|
3172
|
+
{ staticClass: "ele-files__wrapper" },
|
|
3173
|
+
_vm._l(_vm.files, function (file, idx) {
|
|
3174
|
+
return _c("div", { key: idx, staticClass: "ele-file__item" }, [
|
|
3175
|
+
_c(
|
|
3176
|
+
"div",
|
|
3177
|
+
{ staticClass: "ele-file__suffix--icon" },
|
|
3178
|
+
[_c("ele-icon", { attrs: { type: "icon-doc" } })],
|
|
3179
|
+
1
|
|
3180
|
+
),
|
|
3181
|
+
_vm._v(" "),
|
|
3182
|
+
_c("div", { staticClass: "ele-file__name" }, [
|
|
3183
|
+
_c(
|
|
3184
|
+
"div",
|
|
3185
|
+
{
|
|
3186
|
+
staticClass: "ele-file__inner",
|
|
3187
|
+
on: {
|
|
3188
|
+
click: function ($event) {
|
|
3189
|
+
return _vm.handleClickDownload(file)
|
|
3190
|
+
},
|
|
3191
|
+
},
|
|
3192
|
+
},
|
|
3193
|
+
[_vm._v(_vm._s(file.name))]
|
|
3194
|
+
),
|
|
3195
|
+
_vm._v(" "),
|
|
3196
|
+
!file.success
|
|
3197
|
+
? _c(
|
|
3198
|
+
"div",
|
|
3199
|
+
{ staticClass: "ele-uplpad__progress" },
|
|
3200
|
+
[
|
|
3201
|
+
_c("a-progress", {
|
|
3202
|
+
attrs: {
|
|
3203
|
+
strokeWidth: 2,
|
|
3204
|
+
percent: Number(file.progress),
|
|
3205
|
+
size: "small",
|
|
3206
|
+
},
|
|
3207
|
+
}),
|
|
3208
|
+
],
|
|
3209
|
+
1
|
|
3210
|
+
)
|
|
3211
|
+
: _vm._e(),
|
|
3212
|
+
]),
|
|
3213
|
+
_vm._v(" "),
|
|
3214
|
+
file.success || file.error
|
|
3215
|
+
? _c("div", { staticClass: "ele-file__delete" }, [
|
|
3216
|
+
_c("span", { staticClass: "ele-file__size" }, [
|
|
3217
|
+
_vm._v(
|
|
3218
|
+
_vm._s((file.size / _vm.byteConversion).toFixed(2)) + "M"
|
|
3219
|
+
),
|
|
3220
|
+
]),
|
|
3221
|
+
_vm._v(" "),
|
|
3222
|
+
_c(
|
|
3223
|
+
"span",
|
|
3224
|
+
{
|
|
3225
|
+
staticClass: "ele-file__delete--icon",
|
|
3226
|
+
on: {
|
|
3227
|
+
click: function ($event) {
|
|
3228
|
+
return _vm.handleClickDelete(file)
|
|
3229
|
+
},
|
|
3230
|
+
},
|
|
3231
|
+
},
|
|
3232
|
+
[_c("ele-icon", { attrs: { type: "delete" } })],
|
|
3233
|
+
1
|
|
3234
|
+
),
|
|
3235
|
+
])
|
|
3236
|
+
: _vm._e(),
|
|
3237
|
+
])
|
|
3238
|
+
}),
|
|
3239
|
+
0
|
|
3240
|
+
),
|
|
3241
|
+
],
|
|
3242
|
+
1
|
|
3243
|
+
)
|
|
3244
|
+
};
|
|
3245
|
+
var __vue_staticRenderFns__$9 = [];
|
|
3246
|
+
__vue_render__$9._withStripped = true;
|
|
3247
|
+
|
|
3248
|
+
/* style */
|
|
3249
|
+
const __vue_inject_styles__$9 = function (inject) {
|
|
3250
|
+
if (!inject) return
|
|
3251
|
+
inject("data-v-29bc9f58_0", { source: "[data-v-29bc9f58] .file-uploads label {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n[data-v-29bc9f58] .file-uploads label:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n.ele-upload__wrapper[data-v-29bc9f58] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-29bc9f58] {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload[data-v-29bc9f58] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-29bc9f58] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-29bc9f58] {\n font-size: 16px;\n color: var(--idoole-black-008);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext[data-v-29bc9f58] {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item[data-v-29bc9f58] {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name[data-v-29bc9f58] {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner[data-v-29bc9f58] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-29bc9f58] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-29bc9f58] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\upload\\src\\index.vue","index.vue"],"names":[],"mappings":"AAqRA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;EAIA,+CAAA;ACvRA;ADoRA;EACA,0DAAA;AClRA;ADuRA;EACA,WAAA;ACpRA;ADqRA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;ACnRA;ADqRA;EACA,eAAA;EACA,kCAAA;ACnRA;ADsRA;EACA,iBAAA;ACpRA;ADqRA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;ACnRA;ADqRA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;ACnRA;ADwRA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACtRA;ADwRA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;ACtRA;ADuRA;EACA,gBAAA;EACA,uBAAA;ACrRA;ADwRA;EACA,gBAAA;ACtRA;ADuRA;EACA,gBAAA;EACA,eAAA;ACrRA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-upload__wrapper\">\r\n <FileUpload\r\n class=\"ele-upload__inner\"\r\n v-show=\"isShowUploadContainer\"\r\n v-model=\"files\"\r\n :ref=\"uploadRef\"\r\n :drop=\"drop\"\r\n :chunk-enabled=\"chunkEnabled\"\r\n :chunk=\"chunkConfig\"\r\n :accept=\"accept\"\r\n :size=\"fileSizeLimit\"\r\n :post-action=\"postAction\"\r\n :multiple=\"multiple\"\r\n :maximum=\"getMaximum\"\r\n @input-file=\"onWatchInputFiles\"\r\n @input=\"onWatchFiles\"\r\n style=\"width: 100%;\">\r\n <section class=\"ele-upload__area\">\r\n <div class=\"ele-upload__area--icon\">\r\n <ele-icon type=\"cloud-upload\"></ele-icon>\r\n </div>\r\n <div class=\"ele-upload__area--text\">\r\n <div class=\"ele-upload__message\">单击或拖动文件到该区域以上传</div>\r\n <div class=\"ele-upload__ext\">文件小于{{ size }}M</div>\r\n </div>\r\n </section>\r\n </FileUpload>\r\n <section class=\"ele-files__wrapper\">\r\n <div class=\"ele-file__item\" v-for=\"(file, idx) in files\" :key=\"idx\">\r\n <div class=\"ele-file__suffix--icon\">\r\n <ele-icon type=\"icon-doc\"></ele-icon>\r\n </div>\r\n <div class=\"ele-file__name\">\r\n <div class=\"ele-file__inner\" @click=\"handleClickDownload(file)\">{{ file.name }}</div>\r\n <div v-if=\"!file.success\" class=\"ele-uplpad__progress\">\r\n <a-progress :strokeWidth=\"2\" :percent=\"Number(file.progress)\" size=\"small\" />\r\n </div>\r\n </div>\r\n <div class=\"ele-file__delete\" v-if=\"file.success || file.error\">\r\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\r\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\r\n <ele-icon type=\"delete\"></ele-icon>\r\n </span>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport FileUpload from 'vue-upload-component'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { route, net } from '@idooel/shared'\r\nimport EleIcon from '../../icon/src/index.vue'\r\nexport default {\r\n name: 'ele-upload',\r\n components: {\r\n FileUpload,\r\n EleIcon\r\n },\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n url: {\r\n type: String,\r\n default: '/zuul/api-file/workbench/file'\r\n },\r\n size: {\r\n type: Number,\r\n default: 100\r\n },\r\n accept: {\r\n type: String\r\n },\r\n maximum: {\r\n type: Number,\r\n default: 10\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: false\r\n },\r\n drop: {\r\n type: Boolean,\r\n default: true\r\n },\r\n value: {\r\n type: [String, Array]\r\n },\r\n querys: {\r\n type: Object,\r\n default: () => ({\r\n _csrf: 'c81f993f-f044-45bb-b3af-2977d335042d',\r\n _t: new Date().valueOf()\r\n })\r\n },\r\n headers: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n byteConversion: {\r\n type: Number,\r\n default: 1024 * 1024\r\n },\r\n chunkEnabled: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n files: [],\r\n saveToServerAsyncPageTimer: null\r\n }\r\n },\r\n computed: {\r\n getPayloads () {\r\n return {\r\n override: false\r\n }\r\n },\r\n chunkConfig () {\r\n const ret = route.toQueryString(this.querys)\r\n return {\r\n action: `${window.prefixPath}/zuul/api-file/workbench/file/temp/chunk/vue`,\r\n headers: {\r\n 'X-XSRF-TOKEN': localStorage.getItem('token')\r\n },\r\n minSize: 3 * this.byteConversion,\r\n maxActive: 3,\r\n maxRetries: 5,\r\n startBody: {\r\n override: true,\r\n path: '/cw'\r\n },\r\n uploadBody: {\r\n override: true,\r\n path: '/cw'\r\n },\r\n finishBody: {\r\n override: true,\r\n path: '/cw'\r\n }\r\n }\r\n },\r\n isFileUploadSuccessed () {\r\n return this.files.every(file => file.success)\r\n },\r\n isShowUploadContainer () {\r\n if (this.multiple) {\r\n if (this.isFileUploadSuccessed && this.files.length >= this.maximum) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n } else {\r\n if (this.isFileUploadSuccessed && this.files.length >= 1) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n },\r\n getMaximum () {\r\n return this.multiple ? this.maximum : 1\r\n },\r\n fileSizeLimit () {\r\n return this.size * this.byteConversion\r\n },\r\n postAction () {\r\n const ret = route.toQueryString(this.querys)\r\n return `${window.prefixPath}${this.url}?${ret}`\r\n },\r\n uploadRef () {\r\n return uuidv4()\r\n },\r\n fileSuffixIcon () {\r\n return {\r\n 'doc': { name: 'icon-doc' },\r\n }\r\n },\r\n fileIds () {\r\n const fileIds = this.files.map(file => {\r\n return file.response.data.fileID\r\n })\r\n return this.multiple ? fileIds : fileIds[0]\r\n }\r\n },\r\n methods: {\r\n handleClickDownload (file) {\r\n console.log('download file', file)\r\n },\r\n handleClickDelete (file) {\r\n this.$refs[this.uploadRef].remove(file)\r\n this.$emit('change', this.fileIds)\r\n },\r\n onWatchFiles (files) {\r\n this.files = files\r\n if (this.isFileUploadSuccessed) {\r\n this.$emit('change', this.fileIds)\r\n }\r\n },\r\n async saveToServerAsyncPage (payloads = {}) {\r\n net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, { \r\n headers: {\r\n 'Content-Type': 'multipart/form-data'\r\n }\r\n }).then(resp =>{\r\n const { data } = resp\r\n if (data !== 'saveToServerAsyncPage') {\r\n clearInterval(this.saveToServerAsyncPageTimer)\r\n }\r\n })\r\n // const ret = await net.post({\r\n // url: 'zuul/api-file/workbench/file/temp/saveToServerAsyncPage',\r\n // method: 'POST',\r\n // data: { ...payloads }\r\n // }).then(resp => {\r\n // const { data: { data, code, message } } = resp\r\n // if (code !== '2000') {\r\n // this.$Message.error(message)\r\n // return\r\n // }\r\n // if (data !== 'saveToServerAsyncPage') {\r\n // clearInterval(timer)\r\n // const { fileID, size } = data\r\n // this.$emit('on-success', { ...data, fileId: fileID })\r\n // this.$Message.success('同步成功')\r\n // return { fileId: fileID, size }\r\n // }\r\n // })\r\n // return ret\r\n },\r\n onWatchInputFiles (newFile, oldFile) {\r\n if (newFile && !oldFile) {\r\n // add file\r\n console.log('add', newFile)\r\n }\r\n if (newFile && oldFile) {\r\n // update file\r\n console.log('update', newFile)\r\n const { success, active, chunk, response } = newFile\r\n if (chunk && success && !active) {\r\n console.log('chunk end')\r\n const { data: { file, type } } = response\r\n const payloads = {\r\n filePath: file.match(/\\/cw(.*)/)[0],\r\n asyncID: uuidv4(),\r\n isDeleteOrigin: false,\r\n toImage: type === 'pdf' ? true : false,\r\n unzip: type === 'zip' ? true : false,\r\n _csrf: localStorage.getItem('token')\r\n }\r\n this.saveToServerAsyncPageTimer = setInterval(() => {\r\n this.saveToServerAsyncPage(payloads)\r\n }, 2000)\r\n }\r\n }\r\n if (!newFile && oldFile) {\r\n // delete file\r\n console.log('delete')\r\n }\r\n if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {\r\n if (!this.$refs[this.uploadRef].active) {\r\n this.$refs[this.uploadRef].active = true\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .file-uploads {\r\n label {\r\n opacity: 1 !important;\r\n cursor: pointer;\r\n border: 1px dashed var(--idooel-form-title-border-color);\r\n background: var(--idooel-form-upload-bg-color) !important;\r\n &:hover {\r\n border-color: var(--idooel-form-upload-border-hover-color);\r\n }\r\n border-radius: var(--idooel-form-border-radius);\r\n }\r\n}\r\n.ele-upload__wrapper {\r\n width: 100%;\r\n .ele-upload__area {\r\n padding: 16px;\r\n width: 100%;\r\n height: 80px;\r\n display: flex;\r\n flex-direction: row;\r\n .ele-upload__area--icon {\r\n .anticon-cloud-upload {\r\n font-size: 48px;\r\n color: var(--idooel-primary-color);\r\n }\r\n }\r\n .ele-upload__area--text {\r\n margin-left: 16px;\r\n .ele-upload__message {\r\n font-size: 16px;\r\n color: var(--idoole-black-008);\r\n text-align: left;\r\n }\r\n .ele-upload__ext {\r\n text-align: left;\r\n font-size: 14px;\r\n color: var(--idoole-black-06);\r\n }\r\n }\r\n }\r\n .ele-files__wrapper {\r\n .ele-file__item {\r\n width: 100%;\r\n margin-top: 8px;\r\n padding: 8px 12px;\r\n border-radius: var(--idooel-form-border-radius);\r\n background: var(--idooel-form-upload-bg-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n .ele-file__suffix--icon {}\r\n .ele-file__name {\r\n flex: 1;\r\n text-align: left;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n font-size: 14px;\r\n margin-left: 8px;\r\n cursor: pointer;\r\n .ele-file__inner {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n .ele-file__delete {\r\n margin-left: 8px;\r\n .ele-file__delete--icon {\r\n margin-left: 8px;\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>","::v-deep .file-uploads label {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n::v-deep .file-uploads label:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n\n.ele-upload__wrapper {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-008);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3252
|
+
|
|
3253
|
+
};
|
|
3254
|
+
/* scoped */
|
|
3255
|
+
const __vue_scope_id__$9 = "data-v-29bc9f58";
|
|
3256
|
+
/* module identifier */
|
|
3257
|
+
const __vue_module_identifier__$9 = undefined;
|
|
3258
|
+
/* functional template */
|
|
3259
|
+
const __vue_is_functional_template__$9 = false;
|
|
3260
|
+
/* style inject SSR */
|
|
3261
|
+
|
|
3262
|
+
/* style inject shadow dom */
|
|
3263
|
+
|
|
3264
|
+
|
|
3265
|
+
|
|
3266
|
+
const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
|
|
3267
|
+
{ render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
|
|
3268
|
+
__vue_inject_styles__$9,
|
|
3269
|
+
__vue_script__$9,
|
|
3270
|
+
__vue_scope_id__$9,
|
|
3271
|
+
__vue_is_functional_template__$9,
|
|
3272
|
+
__vue_module_identifier__$9,
|
|
3273
|
+
false,
|
|
3274
|
+
createInjector,
|
|
3275
|
+
undefined,
|
|
3276
|
+
undefined
|
|
3277
|
+
);
|
|
3278
|
+
|
|
3279
|
+
//
|
|
3280
|
+
//
|
|
3281
|
+
//
|
|
3282
|
+
//
|
|
3283
|
+
//
|
|
3284
|
+
//
|
|
3285
|
+
//
|
|
3286
|
+
//
|
|
3287
|
+
//
|
|
3288
|
+
//
|
|
3289
|
+
//
|
|
3290
|
+
//
|
|
3291
|
+
//
|
|
3292
|
+
//
|
|
3293
|
+
//
|
|
3294
|
+
//
|
|
3295
|
+
//
|
|
3296
|
+
//
|
|
3297
|
+
|
|
3298
|
+
var script$8 = {
|
|
3299
|
+
name: 'ele-select-entity',
|
|
3300
|
+
props: {
|
|
3301
|
+
value: {
|
|
3302
|
+
type: [Array, Object]
|
|
3303
|
+
},
|
|
3304
|
+
multiple: {
|
|
3305
|
+
type: Boolean,
|
|
3306
|
+
default: true
|
|
3307
|
+
},
|
|
3308
|
+
maxCount: {
|
|
3309
|
+
type: Number,
|
|
3310
|
+
default: 7
|
|
3311
|
+
},
|
|
3312
|
+
disabled: {
|
|
3313
|
+
type: Boolean,
|
|
3314
|
+
default: false
|
|
3315
|
+
},
|
|
3316
|
+
addonAfter: {
|
|
3317
|
+
type: String,
|
|
3318
|
+
default: '选择'
|
|
3319
|
+
}
|
|
3320
|
+
},
|
|
3321
|
+
methods: {
|
|
3322
|
+
getValueList() {
|
|
3323
|
+
if (this.value) {
|
|
3324
|
+
if (this.multiple) {
|
|
3325
|
+
return this.getIsMaxCount() ? this.value.slice(0, this.maxCount) : this.value;
|
|
3326
|
+
}
|
|
3327
|
+
return [this.value];
|
|
3328
|
+
}
|
|
3329
|
+
return [];
|
|
3330
|
+
},
|
|
3331
|
+
getIsMaxCount() {
|
|
3332
|
+
if (this.value && this.multiple) {
|
|
3333
|
+
return this.value.length >= this.maxCount;
|
|
3334
|
+
}
|
|
3335
|
+
return false;
|
|
3336
|
+
},
|
|
3337
|
+
onChange() {
|
|
3338
|
+
if (this.disabled) return;
|
|
3339
|
+
this.$emit('change', this.value);
|
|
3340
|
+
},
|
|
3341
|
+
onClose(e, inx) {
|
|
3342
|
+
e = window.event || e;
|
|
3343
|
+
e.preventDefault();
|
|
3344
|
+
if (!this.multiple) {
|
|
3345
|
+
this.$emit('change', null);
|
|
3346
|
+
return;
|
|
3347
|
+
}
|
|
3348
|
+
this.value.splice(inx, 1);
|
|
3349
|
+
this.$emit('change', this.value);
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
};
|
|
3353
|
+
|
|
3354
|
+
/* script */
|
|
3355
|
+
const __vue_script__$8 = script$8;
|
|
3356
|
+
|
|
3357
|
+
/* template */
|
|
3358
|
+
var __vue_render__$8 = function () {
|
|
3359
|
+
var _vm = this;
|
|
3360
|
+
var _h = _vm.$createElement;
|
|
3361
|
+
var _c = _vm._self._c || _h;
|
|
3362
|
+
return _c(
|
|
3363
|
+
"div",
|
|
3364
|
+
{
|
|
3365
|
+
staticClass: "g-select-entity__wrapper",
|
|
3366
|
+
class: _vm.disabled ? "g-select-entity__disabled" : "",
|
|
3367
|
+
},
|
|
3368
|
+
[
|
|
3369
|
+
_c(
|
|
3370
|
+
"span",
|
|
3371
|
+
{ staticClass: "select-entity__input" },
|
|
3372
|
+
[
|
|
3373
|
+
_vm._l(_vm.getValueList(), function (item, inx) {
|
|
3374
|
+
return _c(
|
|
3375
|
+
"a-tag",
|
|
3376
|
+
{
|
|
3377
|
+
key: item.value,
|
|
3378
|
+
attrs: { closable: !_vm.disabled && !_vm.getIsMaxCount() },
|
|
3379
|
+
on: {
|
|
3380
|
+
close: function ($event) {
|
|
3381
|
+
var i = arguments.length,
|
|
3382
|
+
argsArray = Array(i);
|
|
3383
|
+
while (i--) argsArray[i] = arguments[i];
|
|
3384
|
+
return _vm.onClose.apply(void 0, argsArray.concat([inx]))
|
|
3385
|
+
},
|
|
3386
|
+
},
|
|
3387
|
+
},
|
|
3388
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
3389
|
+
)
|
|
3390
|
+
}),
|
|
3391
|
+
_vm._v(" "),
|
|
3392
|
+
_vm.getIsMaxCount() ? _c("a-tag", [_vm._v("......")]) : _vm._e(),
|
|
3393
|
+
],
|
|
3394
|
+
2
|
|
3395
|
+
),
|
|
3396
|
+
_vm._v(" "),
|
|
3397
|
+
_c(
|
|
3398
|
+
"span",
|
|
3399
|
+
{ staticClass: "select-entity__addon", on: { click: _vm.onChange } },
|
|
3400
|
+
[_vm._v(_vm._s(_vm.addonAfter))]
|
|
3401
|
+
),
|
|
3402
|
+
_vm._v(" "),
|
|
3403
|
+
_vm._t("default"),
|
|
3404
|
+
],
|
|
3405
|
+
2
|
|
3406
|
+
)
|
|
3407
|
+
};
|
|
3408
|
+
var __vue_staticRenderFns__$8 = [];
|
|
3409
|
+
__vue_render__$8._withStripped = true;
|
|
3410
|
+
|
|
3411
|
+
/* style */
|
|
3412
|
+
const __vue_inject_styles__$8 = function (inject) {
|
|
3413
|
+
if (!inject) return
|
|
3414
|
+
inject("data-v-328544bb_0", { source: ".g-select-entity__wrapper[data-v-328544bb] {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper[data-v-328544bb]:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input[data-v-328544bb] {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon[data-v-328544bb] {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n.has-error .g-select-entity__wrapper[data-v-328544bb] {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input[data-v-328544bb] {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\select-entity\\src\\index.vue","index.vue"],"names":[],"mappings":"AA6EA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,6BAAA;EACA,kBAAA;EACA,uDAAA;AC5EA;AD6EA;EACA,yCAAA;AC3EA;AD6EA;EACA,eAAA;EACA,sBAAA;EACA,kBAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;AC3EA;AD6EA;EACA,eAAA;EACA,6BAAA;EACA,wCAAA;EACA,4DAAA;EACA,eAAA;EACA,gBAAA;EACA,mBAAA;AC3EA;AD8EA;EACA,iDAAA;AC3EA;AD6EA;EACA,wCAAA;AC1EA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-select-entity__wrapper\" :class=\"disabled ? 'g-select-entity__disabled' : ''\">\r\n <span class=\"select-entity__input\">\r\n <a-tag\r\n v-for=\"(item, inx) in getValueList()\"\r\n :key=\"item.value\"\r\n :closable=\"!disabled && !getIsMaxCount()\"\r\n @close=\"onClose(...arguments, inx)\"\r\n >\r\n {{ item.label }}\r\n </a-tag>\r\n <a-tag v-if=\"getIsMaxCount()\">......</a-tag>\r\n </span>\r\n <span class=\"select-entity__addon\" @click=\"onChange\">{{ addonAfter }}</span>\r\n <slot></slot>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-select-entity',\r\n props: {\r\n value: {\r\n type: [Array, Object]\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: true\r\n },\r\n maxCount: {\r\n type: Number,\r\n default: 7\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n addonAfter: {\r\n type: String,\r\n default: '选择'\r\n }\r\n },\r\n methods: {\r\n getValueList () {\r\n if (this.value) {\r\n if (this.multiple) {\r\n return this.getIsMaxCount() ? this.value.slice(0, this.maxCount) : this.value\r\n }\r\n return [this.value]\r\n }\r\n return []\r\n },\r\n getIsMaxCount () {\r\n if (this.value && this.multiple) {\r\n return this.value.length >= this.maxCount\r\n }\r\n return false\r\n },\r\n onChange () {\r\n if (this.disabled) return\r\n this.$emit('change', this.value)\r\n },\r\n onClose (e, inx) {\r\n e = window.event || e\r\n e.preventDefault()\r\n if (!this.multiple) {\r\n this.$emit('change', null)\r\n return\r\n }\r\n this.value.splice(inx, 1)\r\n this.$emit('change', this.value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-select-entity__wrapper {\r\n font-size: 14px;\r\n line-height: 30px;\r\n position: relative;\r\n width: 100%;\r\n display: flex;\r\n color: var(--idoole-black-07);\r\n border-radius: 4px;\r\n border: 1px solid var(--idooel-form-title-border-color);\r\n &:hover {\r\n border-color: var(--idooel-primary-color);\r\n }\r\n .select-entity__input {\r\n padding: 0 11px;\r\n background-color: #fff;\r\n border-radius: 4px;\r\n flex-grow: 1;\r\n min-height: 30px;\r\n text-align: left;\r\n }\r\n .select-entity__addon {\r\n padding: 0 11px;\r\n color: var(--idoole-black-07);\r\n background-color: var(--idoole-black-02);\r\n border-left: 1px solid var(--idooel-form-title-border-color);\r\n cursor: pointer;\r\n min-height: 30px;\r\n white-space: nowrap;\r\n }\r\n}\r\n.has-error .g-select-entity__wrapper {\r\n border-color: var(--idooel-form-border-err-color);\r\n}\r\n.g-select-entity__disabled .select-entity__input {\r\n background-color: var(--idoole-black-02);\r\n}\r\n</style>",".g-select-entity__wrapper {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n\n.has-error .g-select-entity__wrapper {\n border-color: var(--idooel-form-border-err-color);\n}\n\n.g-select-entity__disabled .select-entity__input {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3415
|
+
|
|
3416
|
+
};
|
|
3417
|
+
/* scoped */
|
|
3418
|
+
const __vue_scope_id__$8 = "data-v-328544bb";
|
|
3419
|
+
/* module identifier */
|
|
3420
|
+
const __vue_module_identifier__$8 = undefined;
|
|
3421
|
+
/* functional template */
|
|
3422
|
+
const __vue_is_functional_template__$8 = false;
|
|
3423
|
+
/* style inject SSR */
|
|
3424
|
+
|
|
3425
|
+
/* style inject shadow dom */
|
|
3426
|
+
|
|
3427
|
+
|
|
3428
|
+
|
|
3429
|
+
const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
|
|
3430
|
+
{ render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
|
|
3431
|
+
__vue_inject_styles__$8,
|
|
3432
|
+
__vue_script__$8,
|
|
3433
|
+
__vue_scope_id__$8,
|
|
3434
|
+
__vue_is_functional_template__$8,
|
|
3435
|
+
__vue_module_identifier__$8,
|
|
3436
|
+
false,
|
|
3437
|
+
createInjector,
|
|
3438
|
+
undefined,
|
|
3439
|
+
undefined
|
|
3440
|
+
);
|
|
3441
|
+
|
|
3442
|
+
//
|
|
3443
|
+
//
|
|
3444
|
+
//
|
|
3445
|
+
//
|
|
3446
|
+
//
|
|
3447
|
+
//
|
|
3448
|
+
|
|
3449
|
+
var script$7 = {
|
|
3450
|
+
name: 'ele-input-number',
|
|
3451
|
+
props: {
|
|
3452
|
+
precision: {
|
|
3453
|
+
type: Number
|
|
3454
|
+
},
|
|
3455
|
+
value: {
|
|
3456
|
+
type: [Number, String]
|
|
3457
|
+
}
|
|
3458
|
+
},
|
|
3459
|
+
methods: {
|
|
3460
|
+
onChange(value) {
|
|
3461
|
+
this.$emit('change', value);
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
};
|
|
3465
|
+
|
|
3466
|
+
/* script */
|
|
3467
|
+
const __vue_script__$7 = script$7;
|
|
3468
|
+
|
|
3469
|
+
/* template */
|
|
3470
|
+
var __vue_render__$7 = function () {
|
|
3471
|
+
var _vm = this;
|
|
3472
|
+
var _h = _vm.$createElement;
|
|
3473
|
+
var _c = _vm._self._c || _h;
|
|
3474
|
+
return _c(
|
|
3475
|
+
"div",
|
|
3476
|
+
[
|
|
3477
|
+
_c(
|
|
3478
|
+
"a-input-number",
|
|
3479
|
+
_vm._b(
|
|
3480
|
+
{
|
|
3481
|
+
staticStyle: { width: "100%" },
|
|
3482
|
+
attrs: { value: _vm.value, precision: _vm.precision },
|
|
3483
|
+
on: { change: _vm.onChange },
|
|
3484
|
+
},
|
|
3485
|
+
"a-input-number",
|
|
3486
|
+
_vm.$attrs,
|
|
3487
|
+
false
|
|
3488
|
+
)
|
|
3489
|
+
),
|
|
3490
|
+
],
|
|
3491
|
+
1
|
|
3492
|
+
)
|
|
3493
|
+
};
|
|
3494
|
+
var __vue_staticRenderFns__$7 = [];
|
|
3495
|
+
__vue_render__$7._withStripped = true;
|
|
3496
|
+
|
|
3497
|
+
/* style */
|
|
3498
|
+
const __vue_inject_styles__$7 = undefined;
|
|
3499
|
+
/* scoped */
|
|
3500
|
+
const __vue_scope_id__$7 = undefined;
|
|
3501
|
+
/* module identifier */
|
|
3502
|
+
const __vue_module_identifier__$7 = undefined;
|
|
3503
|
+
/* functional template */
|
|
3504
|
+
const __vue_is_functional_template__$7 = false;
|
|
3505
|
+
/* style inject */
|
|
3506
|
+
|
|
3507
|
+
/* style inject SSR */
|
|
3508
|
+
|
|
3509
|
+
/* style inject shadow dom */
|
|
3510
|
+
|
|
3511
|
+
|
|
3512
|
+
|
|
3513
|
+
const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
|
|
3514
|
+
{ render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
|
|
3515
|
+
__vue_inject_styles__$7,
|
|
3516
|
+
__vue_script__$7,
|
|
3517
|
+
__vue_scope_id__$7,
|
|
3518
|
+
__vue_is_functional_template__$7,
|
|
3519
|
+
__vue_module_identifier__$7,
|
|
3520
|
+
false,
|
|
3521
|
+
undefined,
|
|
3522
|
+
undefined,
|
|
3523
|
+
undefined
|
|
3524
|
+
);
|
|
3525
|
+
|
|
3526
|
+
//
|
|
3527
|
+
//
|
|
3528
|
+
//
|
|
3529
|
+
//
|
|
3530
|
+
|
|
3531
|
+
var script$6 = {
|
|
3532
|
+
name: 'ele-checkbox',
|
|
3533
|
+
props: {
|
|
3534
|
+
value: {
|
|
3535
|
+
type: Array
|
|
3536
|
+
},
|
|
3537
|
+
dataSource: {
|
|
3538
|
+
type: Array,
|
|
3539
|
+
default: () => []
|
|
3540
|
+
},
|
|
3541
|
+
disabled: {
|
|
3542
|
+
type: Boolean,
|
|
3543
|
+
default: false
|
|
3544
|
+
}
|
|
3545
|
+
},
|
|
3546
|
+
methods: {
|
|
3547
|
+
onChange(value) {
|
|
3548
|
+
this.$emit('change', value);
|
|
3549
|
+
this.$emit('input', value);
|
|
3550
|
+
}
|
|
3551
|
+
}
|
|
3552
|
+
};
|
|
3553
|
+
|
|
3554
|
+
/* script */
|
|
3555
|
+
const __vue_script__$6 = script$6;
|
|
3556
|
+
|
|
3557
|
+
/* template */
|
|
3558
|
+
var __vue_render__$6 = function () {
|
|
3559
|
+
var _vm = this;
|
|
3560
|
+
var _h = _vm.$createElement;
|
|
3561
|
+
var _c = _vm._self._c || _h;
|
|
3562
|
+
return _c("a-checkbox-group", {
|
|
3563
|
+
attrs: {
|
|
3564
|
+
options: _vm.dataSource,
|
|
3565
|
+
disabled: _vm.disabled,
|
|
3566
|
+
defaultValue: _vm.value,
|
|
3567
|
+
},
|
|
3568
|
+
on: { change: _vm.onChange },
|
|
3569
|
+
})
|
|
3570
|
+
};
|
|
3571
|
+
var __vue_staticRenderFns__$6 = [];
|
|
3572
|
+
__vue_render__$6._withStripped = true;
|
|
3573
|
+
|
|
3574
|
+
/* style */
|
|
3575
|
+
const __vue_inject_styles__$6 = function (inject) {
|
|
3576
|
+
if (!inject) return
|
|
3577
|
+
inject("data-v-63b1b120_0", { source: ".ant-checkbox-group[data-v-63b1b120] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-checkbox-group[data-v-63b1b120] .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group[data-v-63b1b120] .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\checkbox\\src\\index.vue","index.vue"],"names":[],"mappings":"AA6BA;EACA,gBAAA;EACA,iBAAA;AC5BA;ADgCA;EACA,0CAAA;AC7BA;AD+BA;EACA,iDAAA;AC7BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-checkbox-group :options=\"dataSource\" :disabled=\"disabled\" :defaultValue=\"value\" @change=\"onChange\"></a-checkbox-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-checkbox',\r\n props: {\r\n value: {\r\n type: Array\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n onChange (value) {\r\n this.$emit('change', value)\r\n this.$emit('input', value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-checkbox-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-checkbox-group {\r\n ::v-deep .ant-checkbox-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-checkbox-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-checkbox-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3578
|
+
|
|
3579
|
+
};
|
|
3580
|
+
/* scoped */
|
|
3581
|
+
const __vue_scope_id__$6 = "data-v-63b1b120";
|
|
3582
|
+
/* module identifier */
|
|
3583
|
+
const __vue_module_identifier__$6 = undefined;
|
|
3584
|
+
/* functional template */
|
|
3585
|
+
const __vue_is_functional_template__$6 = false;
|
|
3586
|
+
/* style inject SSR */
|
|
3587
|
+
|
|
3588
|
+
/* style inject shadow dom */
|
|
3589
|
+
|
|
3590
|
+
|
|
3591
|
+
|
|
3592
|
+
const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
|
|
3593
|
+
{ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
|
|
3594
|
+
__vue_inject_styles__$6,
|
|
3595
|
+
__vue_script__$6,
|
|
3596
|
+
__vue_scope_id__$6,
|
|
3597
|
+
__vue_is_functional_template__$6,
|
|
3598
|
+
__vue_module_identifier__$6,
|
|
3599
|
+
false,
|
|
3600
|
+
createInjector,
|
|
3601
|
+
undefined,
|
|
3602
|
+
undefined
|
|
3603
|
+
);
|
|
3604
|
+
|
|
3605
|
+
//
|
|
3606
|
+
//
|
|
3607
|
+
//
|
|
3608
|
+
//
|
|
3609
|
+
//
|
|
3610
|
+
//
|
|
3611
|
+
//
|
|
3612
|
+
//
|
|
3613
|
+
|
|
3614
|
+
var script$5 = {
|
|
3615
|
+
name: 'ele-radio',
|
|
3616
|
+
props: {
|
|
3617
|
+
value: {
|
|
3618
|
+
type: [String, Array, Number]
|
|
3619
|
+
},
|
|
3620
|
+
dataSource: {
|
|
3621
|
+
type: Array,
|
|
3622
|
+
default: () => []
|
|
3623
|
+
},
|
|
3624
|
+
disabled: {
|
|
3625
|
+
type: Boolean,
|
|
3626
|
+
default: false
|
|
3627
|
+
}
|
|
3628
|
+
},
|
|
3629
|
+
methods: {
|
|
3630
|
+
onChange(e) {
|
|
3631
|
+
this.$emit('change', e.target.value);
|
|
3632
|
+
this.$emit('input', e.target.value);
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
/* script */
|
|
3638
|
+
const __vue_script__$5 = script$5;
|
|
3639
|
+
|
|
3640
|
+
/* template */
|
|
3641
|
+
var __vue_render__$5 = function () {
|
|
3642
|
+
var _vm = this;
|
|
3643
|
+
var _h = _vm.$createElement;
|
|
3644
|
+
var _c = _vm._self._c || _h;
|
|
3645
|
+
return _c(
|
|
3646
|
+
"a-radio-group",
|
|
3647
|
+
{
|
|
3648
|
+
attrs: { defaultValue: _vm.value, disabled: _vm.disabled },
|
|
3649
|
+
on: { change: _vm.onChange },
|
|
3650
|
+
},
|
|
3651
|
+
_vm._l(_vm.dataSource, function (item) {
|
|
3652
|
+
return _c("a-radio", { key: item.value, attrs: { value: item.value } }, [
|
|
3653
|
+
_vm._v("\n " + _vm._s(item.label) + "\n "),
|
|
3654
|
+
])
|
|
3655
|
+
}),
|
|
3656
|
+
1
|
|
3657
|
+
)
|
|
3658
|
+
};
|
|
3659
|
+
var __vue_staticRenderFns__$5 = [];
|
|
3660
|
+
__vue_render__$5._withStripped = true;
|
|
3661
|
+
|
|
3662
|
+
/* style */
|
|
3663
|
+
const __vue_inject_styles__$5 = function (inject) {
|
|
3664
|
+
if (!inject) return
|
|
3665
|
+
inject("data-v-66c5cdf2_0", { source: ".ant-radio-group[data-v-66c5cdf2] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-66c5cdf2] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-66c5cdf2] .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\radio\\src\\index.vue","index.vue"],"names":[],"mappings":"AAiCA;EACA,gBAAA;EACA,iBAAA;AChCA;ADoCA;EACA,0CAAA;ACjCA;ADmCA;EACA,iDAAA;ACjCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-radio-group :defaultValue=\"value\" @change=\"onChange\" :disabled=\"disabled\">\r\n <a-radio v-for=\"item in dataSource\" :key=\"item.value\" :value=\"item.value\">\r\n {{ item.label }}\r\n </a-radio>\r\n </a-radio-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-radio',\r\n props: {\r\n value: {\r\n type: [String, Array, Number]\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n onChange (e) {\r\n this.$emit('change', e.target.value)\r\n this.$emit('input', e.target.value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-radio-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-radio-group {\r\n ::v-deep .ant-radio-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-radio-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-radio-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-radio-group ::v-deep .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group ::v-deep .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3666
|
+
|
|
3667
|
+
};
|
|
3668
|
+
/* scoped */
|
|
3669
|
+
const __vue_scope_id__$5 = "data-v-66c5cdf2";
|
|
3670
|
+
/* module identifier */
|
|
3671
|
+
const __vue_module_identifier__$5 = undefined;
|
|
3672
|
+
/* functional template */
|
|
3673
|
+
const __vue_is_functional_template__$5 = false;
|
|
3674
|
+
/* style inject SSR */
|
|
3675
|
+
|
|
3676
|
+
/* style inject shadow dom */
|
|
3677
|
+
|
|
3678
|
+
|
|
3679
|
+
|
|
3680
|
+
const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
|
|
3681
|
+
{ render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
|
|
3682
|
+
__vue_inject_styles__$5,
|
|
3683
|
+
__vue_script__$5,
|
|
3684
|
+
__vue_scope_id__$5,
|
|
3685
|
+
__vue_is_functional_template__$5,
|
|
3686
|
+
__vue_module_identifier__$5,
|
|
3687
|
+
false,
|
|
3688
|
+
createInjector,
|
|
3689
|
+
undefined,
|
|
3690
|
+
undefined
|
|
3691
|
+
);
|
|
3692
|
+
|
|
3693
|
+
//
|
|
3694
|
+
var script$4 = {
|
|
3695
|
+
name: 'ele-form',
|
|
3696
|
+
components: {
|
|
3697
|
+
EleSelect: __vue_component__$k,
|
|
3698
|
+
EleInput: __vue_component__$l,
|
|
3699
|
+
EleTextarea: __vue_component__$b,
|
|
3700
|
+
EleUpload: __vue_component__$9,
|
|
3701
|
+
EleSelectEntity: __vue_component__$8,
|
|
3702
|
+
EleInputNumber: __vue_component__$7,
|
|
3703
|
+
EleCheckbox: __vue_component__$6,
|
|
3704
|
+
EleRadio: __vue_component__$5
|
|
3705
|
+
},
|
|
3706
|
+
props: {
|
|
3707
|
+
elements: {
|
|
3708
|
+
type: Array,
|
|
3709
|
+
default: () => []
|
|
3710
|
+
}
|
|
3711
|
+
},
|
|
3712
|
+
data() {
|
|
3713
|
+
return {
|
|
3714
|
+
some: '1',
|
|
3715
|
+
form: this.$form.createForm(this, {
|
|
3716
|
+
name: 'coordinated'
|
|
3717
|
+
})
|
|
3718
|
+
};
|
|
3719
|
+
},
|
|
3720
|
+
methods: {
|
|
3721
|
+
onChangeTextarea(value, props) {
|
|
3722
|
+
this.setFieldsValue({
|
|
3723
|
+
[props.name]: value
|
|
3724
|
+
});
|
|
3725
|
+
},
|
|
3726
|
+
validateFields() {
|
|
3727
|
+
let ret = false;
|
|
3728
|
+
this.form.validateFields((error, values) => {
|
|
3729
|
+
ret = !error;
|
|
3730
|
+
});
|
|
3731
|
+
return ret;
|
|
3732
|
+
},
|
|
3733
|
+
setFieldsValue(props = {}) {
|
|
3734
|
+
this.form.setFieldsValue(props);
|
|
3735
|
+
},
|
|
3736
|
+
getFieldsValue() {
|
|
3737
|
+
return this.form.getFieldsValue();
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
};
|
|
3741
|
+
|
|
3742
|
+
/* script */
|
|
3743
|
+
const __vue_script__$4 = script$4;
|
|
3744
|
+
|
|
3745
|
+
/* template */
|
|
3746
|
+
var __vue_render__$4 = function () {
|
|
3747
|
+
var _vm = this;
|
|
3748
|
+
var _h = _vm.$createElement;
|
|
3749
|
+
var _c = _vm._self._c || _h;
|
|
3750
|
+
return _c(
|
|
3751
|
+
"div",
|
|
3752
|
+
{ staticClass: "ele__form--wrapper" },
|
|
3753
|
+
[
|
|
3754
|
+
_c(
|
|
3755
|
+
"a-form",
|
|
3756
|
+
{
|
|
3757
|
+
staticClass: "ant-advanced-search-form",
|
|
3758
|
+
attrs: { form: _vm.form, layout: "vertical" },
|
|
3759
|
+
},
|
|
3760
|
+
[
|
|
3761
|
+
_c(
|
|
3762
|
+
"a-row",
|
|
3763
|
+
{ attrs: { gutter: 24 } },
|
|
3764
|
+
_vm._l(_vm.elements, function (ele) {
|
|
3765
|
+
return _c(
|
|
3766
|
+
"a-col",
|
|
3767
|
+
{ key: ele.name, attrs: { span: ele.span } },
|
|
3768
|
+
[
|
|
3769
|
+
ele.type == "Input"
|
|
3770
|
+
? [
|
|
3771
|
+
_c(
|
|
3772
|
+
"a-form-item",
|
|
3773
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3774
|
+
[
|
|
3775
|
+
_c("ele-input", {
|
|
3776
|
+
directives: [
|
|
3777
|
+
{
|
|
3778
|
+
name: "decorator",
|
|
3779
|
+
rawName: "v-decorator",
|
|
3780
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3781
|
+
expression:
|
|
3782
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3783
|
+
},
|
|
3784
|
+
],
|
|
3785
|
+
staticStyle: { width: "100%" },
|
|
3786
|
+
attrs: { "max-length": ele.maxLength },
|
|
3787
|
+
}),
|
|
3788
|
+
],
|
|
3789
|
+
1
|
|
3790
|
+
),
|
|
3791
|
+
]
|
|
3792
|
+
: ele.type == "Textarea"
|
|
3793
|
+
? [
|
|
3794
|
+
_c(
|
|
3795
|
+
"a-form-item",
|
|
3796
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3797
|
+
[
|
|
3798
|
+
_c("ele-textarea", {
|
|
3799
|
+
directives: [
|
|
3800
|
+
{
|
|
3801
|
+
name: "decorator",
|
|
3802
|
+
rawName: "v-decorator",
|
|
3803
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3804
|
+
expression:
|
|
3805
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3806
|
+
},
|
|
3807
|
+
],
|
|
3808
|
+
staticStyle: { width: "100%" },
|
|
3809
|
+
attrs: {
|
|
3810
|
+
"max-length": ele.maxLength,
|
|
3811
|
+
autosize: ele.autosize,
|
|
3812
|
+
"allow-clear": ele.allowClear,
|
|
3813
|
+
placeholder: ele.placeholder,
|
|
3814
|
+
},
|
|
3815
|
+
on: {
|
|
3816
|
+
"on-change": function ($event) {
|
|
3817
|
+
return _vm.onChangeTextarea($event, ele)
|
|
3818
|
+
},
|
|
3819
|
+
},
|
|
3820
|
+
}),
|
|
3821
|
+
],
|
|
3822
|
+
1
|
|
3823
|
+
),
|
|
3824
|
+
]
|
|
3825
|
+
: ele.type == "Select"
|
|
3826
|
+
? [
|
|
3827
|
+
_c(
|
|
3828
|
+
"a-form-item",
|
|
3829
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3830
|
+
[
|
|
3831
|
+
_c("ele-select", {
|
|
3832
|
+
directives: [
|
|
3833
|
+
{
|
|
3834
|
+
name: "decorator",
|
|
3835
|
+
rawName: "v-decorator",
|
|
3836
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3837
|
+
expression:
|
|
3838
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3839
|
+
},
|
|
3840
|
+
],
|
|
3841
|
+
staticStyle: { width: "100%" },
|
|
3842
|
+
attrs: { "data-source": ele.optionList },
|
|
3843
|
+
}),
|
|
3844
|
+
],
|
|
3845
|
+
1
|
|
3846
|
+
),
|
|
3847
|
+
]
|
|
3848
|
+
: ele.type == "ele-upload"
|
|
3849
|
+
? [
|
|
3850
|
+
_c(
|
|
3851
|
+
"a-form-item",
|
|
3852
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3853
|
+
[
|
|
3854
|
+
_c("ele-upload", {
|
|
3855
|
+
directives: [
|
|
3856
|
+
{
|
|
3857
|
+
name: "decorator",
|
|
3858
|
+
rawName: "v-decorator",
|
|
3859
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3860
|
+
expression:
|
|
3861
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3862
|
+
},
|
|
3863
|
+
],
|
|
3864
|
+
staticStyle: { width: "100%" },
|
|
3865
|
+
}),
|
|
3866
|
+
],
|
|
3867
|
+
1
|
|
3868
|
+
),
|
|
3869
|
+
]
|
|
3870
|
+
: ele.type == "SelectEntity"
|
|
3871
|
+
? [
|
|
3872
|
+
_c(
|
|
3873
|
+
"a-form-item",
|
|
3874
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3875
|
+
[
|
|
3876
|
+
_c("ele-select-entity", {
|
|
3877
|
+
directives: [
|
|
3878
|
+
{
|
|
3879
|
+
name: "decorator",
|
|
3880
|
+
rawName: "v-decorator",
|
|
3881
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3882
|
+
expression:
|
|
3883
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3884
|
+
},
|
|
3885
|
+
],
|
|
3886
|
+
staticStyle: { width: "100%" },
|
|
3887
|
+
}),
|
|
3888
|
+
],
|
|
3889
|
+
1
|
|
3890
|
+
),
|
|
3891
|
+
]
|
|
3892
|
+
: ele.type == "InputNumber"
|
|
3893
|
+
? [
|
|
3894
|
+
_c(
|
|
3895
|
+
"a-form-item",
|
|
3896
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3897
|
+
[
|
|
3898
|
+
_c(
|
|
3899
|
+
"ele-input-number",
|
|
3900
|
+
_vm._b(
|
|
3901
|
+
{
|
|
3902
|
+
directives: [
|
|
3903
|
+
{
|
|
3904
|
+
name: "decorator",
|
|
3905
|
+
rawName: "v-decorator",
|
|
3906
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3907
|
+
expression:
|
|
3908
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3909
|
+
},
|
|
3910
|
+
],
|
|
3911
|
+
staticStyle: { width: "100%" },
|
|
3912
|
+
attrs: { precision: ele.precision },
|
|
3913
|
+
},
|
|
3914
|
+
"ele-input-number",
|
|
3915
|
+
ele.props,
|
|
3916
|
+
false
|
|
3917
|
+
)
|
|
3918
|
+
),
|
|
3919
|
+
],
|
|
3920
|
+
1
|
|
3921
|
+
),
|
|
3922
|
+
]
|
|
3923
|
+
: ele.type == "Checkbox"
|
|
3924
|
+
? [
|
|
3925
|
+
_c(
|
|
3926
|
+
"a-form-item",
|
|
3927
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3928
|
+
[
|
|
3929
|
+
_c("ele-checkbox", {
|
|
3930
|
+
directives: [
|
|
3931
|
+
{
|
|
3932
|
+
name: "decorator",
|
|
3933
|
+
rawName: "v-decorator",
|
|
3934
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3935
|
+
expression:
|
|
3936
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3937
|
+
},
|
|
3938
|
+
],
|
|
3939
|
+
staticStyle: { width: "100%" },
|
|
3940
|
+
attrs: { "data-source": ele.optionList },
|
|
3941
|
+
}),
|
|
3942
|
+
],
|
|
3943
|
+
1
|
|
3944
|
+
),
|
|
3945
|
+
]
|
|
3946
|
+
: ele.type == "Radio"
|
|
3947
|
+
? [
|
|
3948
|
+
_c(
|
|
3949
|
+
"a-form-item",
|
|
3950
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3951
|
+
[
|
|
3952
|
+
_c("ele-radio", {
|
|
3953
|
+
directives: [
|
|
3954
|
+
{
|
|
3955
|
+
name: "decorator",
|
|
3956
|
+
rawName: "v-decorator",
|
|
3957
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3958
|
+
expression:
|
|
3959
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3960
|
+
},
|
|
3961
|
+
],
|
|
3962
|
+
staticStyle: { width: "100%" },
|
|
3963
|
+
attrs: { "data-source": ele.optionList },
|
|
3964
|
+
}),
|
|
3965
|
+
],
|
|
3966
|
+
1
|
|
3967
|
+
),
|
|
3968
|
+
]
|
|
3969
|
+
: _vm._e(),
|
|
3970
|
+
],
|
|
3971
|
+
2
|
|
3972
|
+
)
|
|
3973
|
+
}),
|
|
3974
|
+
1
|
|
3975
|
+
),
|
|
3976
|
+
],
|
|
3977
|
+
1
|
|
3978
|
+
),
|
|
3979
|
+
],
|
|
3980
|
+
1
|
|
3981
|
+
)
|
|
3982
|
+
};
|
|
3983
|
+
var __vue_staticRenderFns__$4 = [];
|
|
3984
|
+
__vue_render__$4._withStripped = true;
|
|
3985
|
+
|
|
3986
|
+
/* style */
|
|
3987
|
+
const __vue_inject_styles__$4 = function (inject) {
|
|
3988
|
+
if (!inject) return
|
|
3989
|
+
inject("data-v-e06c4e7c_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue","sourcesContent":["\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3990
|
+
|
|
3991
|
+
};
|
|
3992
|
+
/* scoped */
|
|
3993
|
+
const __vue_scope_id__$4 = "data-v-e06c4e7c";
|
|
3994
|
+
/* module identifier */
|
|
3995
|
+
const __vue_module_identifier__$4 = undefined;
|
|
3996
|
+
/* functional template */
|
|
3997
|
+
const __vue_is_functional_template__$4 = false;
|
|
3998
|
+
/* style inject SSR */
|
|
3999
|
+
|
|
4000
|
+
/* style inject shadow dom */
|
|
4001
|
+
|
|
4002
|
+
|
|
4003
|
+
|
|
4004
|
+
const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
|
|
4005
|
+
{ render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
|
|
4006
|
+
__vue_inject_styles__$4,
|
|
4007
|
+
__vue_script__$4,
|
|
4008
|
+
__vue_scope_id__$4,
|
|
4009
|
+
__vue_is_functional_template__$4,
|
|
4010
|
+
__vue_module_identifier__$4,
|
|
4011
|
+
false,
|
|
4012
|
+
createInjector,
|
|
4013
|
+
undefined,
|
|
4014
|
+
undefined
|
|
4015
|
+
);
|
|
4016
|
+
|
|
4017
|
+
__vue_component__$4.install = Vue => Vue.component(__vue_component__$4.name, __vue_component__$4);
|
|
4018
|
+
|
|
4019
|
+
//
|
|
4020
|
+
//
|
|
4021
|
+
//
|
|
4022
|
+
//
|
|
4023
|
+
//
|
|
4024
|
+
//
|
|
4025
|
+
|
|
4026
|
+
var script$3 = {
|
|
4027
|
+
name: 'g-text'
|
|
4028
|
+
};
|
|
4029
|
+
|
|
4030
|
+
/* script */
|
|
4031
|
+
const __vue_script__$3 = script$3;
|
|
4032
|
+
|
|
4033
|
+
/* template */
|
|
4034
|
+
var __vue_render__$3 = function () {
|
|
4035
|
+
var _vm = this;
|
|
4036
|
+
var _h = _vm.$createElement;
|
|
4037
|
+
var _c = _vm._self._c || _h;
|
|
4038
|
+
return _c("div", [_vm._v("\n text\n")])
|
|
4039
|
+
};
|
|
4040
|
+
var __vue_staticRenderFns__$3 = [];
|
|
4041
|
+
__vue_render__$3._withStripped = true;
|
|
4042
|
+
|
|
4043
|
+
/* style */
|
|
4044
|
+
const __vue_inject_styles__$3 = function (inject) {
|
|
4045
|
+
if (!inject) return
|
|
4046
|
+
inject("data-v-d41a0ce6_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
4047
|
+
|
|
4048
|
+
};
|
|
4049
|
+
/* scoped */
|
|
4050
|
+
const __vue_scope_id__$3 = "data-v-d41a0ce6";
|
|
4051
|
+
/* module identifier */
|
|
4052
|
+
const __vue_module_identifier__$3 = undefined;
|
|
4053
|
+
/* functional template */
|
|
4054
|
+
const __vue_is_functional_template__$3 = false;
|
|
4055
|
+
/* style inject SSR */
|
|
4056
|
+
|
|
4057
|
+
/* style inject shadow dom */
|
|
4058
|
+
|
|
4059
|
+
|
|
4060
|
+
|
|
4061
|
+
const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
|
|
4062
|
+
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
|
|
4063
|
+
__vue_inject_styles__$3,
|
|
4064
|
+
__vue_script__$3,
|
|
4065
|
+
__vue_scope_id__$3,
|
|
4066
|
+
__vue_is_functional_template__$3,
|
|
4067
|
+
__vue_module_identifier__$3,
|
|
4068
|
+
false,
|
|
4069
|
+
createInjector,
|
|
4070
|
+
undefined,
|
|
4071
|
+
undefined
|
|
4072
|
+
);
|
|
4073
|
+
|
|
4074
|
+
__vue_component__$3.install = Vue => Vue.component(__vue_component__$3.name, __vue_component__$3);
|
|
4075
|
+
|
|
4076
|
+
__vue_component__$9.install = Vue => Vue.component(__vue_component__$9.name, __vue_component__$9);
|
|
4077
|
+
|
|
4078
|
+
__vue_component__$8.install = Vue => Vue.component(__vue_component__$8.name, __vue_component__$8);
|
|
4079
|
+
|
|
4080
|
+
__vue_component__$a.install = Vue => Vue.component(__vue_component__$a.name, __vue_component__$a);
|
|
4081
|
+
|
|
4082
|
+
__vue_component__$7.install = Vue => Vue.component(__vue_component__$7.name, __vue_component__$7);
|
|
4083
|
+
|
|
4084
|
+
//
|
|
4085
|
+
//
|
|
4086
|
+
//
|
|
4087
|
+
//
|
|
4088
|
+
//
|
|
4089
|
+
//
|
|
4090
|
+
//
|
|
4091
|
+
//
|
|
4092
|
+
//
|
|
4093
|
+
//
|
|
4094
|
+
//
|
|
4095
|
+
//
|
|
4096
|
+
//
|
|
4097
|
+
//
|
|
4098
|
+
//
|
|
4099
|
+
//
|
|
4100
|
+
//
|
|
4101
|
+
//
|
|
4102
|
+
//
|
|
4103
|
+
//
|
|
4104
|
+
//
|
|
4105
|
+
//
|
|
4106
|
+
|
|
4107
|
+
var script$2 = {
|
|
4108
|
+
name: 'ele-modal',
|
|
4109
|
+
props: {
|
|
4110
|
+
value: {
|
|
4111
|
+
type: Boolean,
|
|
4112
|
+
default: false
|
|
4113
|
+
},
|
|
4114
|
+
title: {
|
|
4115
|
+
type: String,
|
|
4116
|
+
default: '标题'
|
|
4117
|
+
},
|
|
4118
|
+
cancelText: {
|
|
4119
|
+
type: String,
|
|
4120
|
+
default: '关闭'
|
|
4121
|
+
},
|
|
4122
|
+
okText: {
|
|
4123
|
+
type: String,
|
|
4124
|
+
default: '确定'
|
|
4125
|
+
},
|
|
4126
|
+
size: {
|
|
4127
|
+
type: String,
|
|
4128
|
+
default: 'small'
|
|
4129
|
+
},
|
|
4130
|
+
map: {
|
|
4131
|
+
type: Object,
|
|
4132
|
+
default() {
|
|
4133
|
+
return {};
|
|
4134
|
+
}
|
|
4135
|
+
},
|
|
4136
|
+
closable: {
|
|
4137
|
+
type: Boolean,
|
|
4138
|
+
default: true
|
|
4139
|
+
},
|
|
4140
|
+
maskClosable: {
|
|
4141
|
+
type: Boolean,
|
|
4142
|
+
default: false
|
|
4143
|
+
},
|
|
4144
|
+
showFooter: {
|
|
4145
|
+
type: Boolean,
|
|
4146
|
+
default: true
|
|
4147
|
+
},
|
|
4148
|
+
footer: {
|
|
4149
|
+
type: Function,
|
|
4150
|
+
default: null
|
|
4151
|
+
},
|
|
4152
|
+
onlyClose: {
|
|
4153
|
+
type: Boolean,
|
|
4154
|
+
default: false
|
|
4155
|
+
}
|
|
4156
|
+
},
|
|
4157
|
+
watch: {
|
|
4158
|
+
value(newVal) {
|
|
4159
|
+
this.$nextTick(() => {
|
|
4160
|
+
this.showModal = newVal;
|
|
4161
|
+
});
|
|
4162
|
+
}
|
|
4163
|
+
},
|
|
4164
|
+
computed: {
|
|
4165
|
+
width() {
|
|
4166
|
+
return this.map[this.size];
|
|
4167
|
+
},
|
|
4168
|
+
maxheight() {
|
|
4169
|
+
return `calc(100vh - ${this.upDownDistance[this.size] * 2 + (this.title ? 55 : 0) + (this.showFooter ? 53 : 0)}px`;
|
|
4170
|
+
}
|
|
4171
|
+
},
|
|
4172
|
+
data() {
|
|
4173
|
+
return {
|
|
4174
|
+
showModal: false
|
|
4175
|
+
};
|
|
4176
|
+
},
|
|
4177
|
+
created() {
|
|
4178
|
+
let defaultMap = {
|
|
4179
|
+
small: 480,
|
|
4180
|
+
middle: 768,
|
|
4181
|
+
big: 1200
|
|
4182
|
+
};
|
|
4183
|
+
this.upDownDistance = {
|
|
4184
|
+
small: 80,
|
|
4185
|
+
middle: 80,
|
|
4186
|
+
big: 40
|
|
4187
|
+
};
|
|
4188
|
+
this.map = Object.assign(this.map, defaultMap);
|
|
4189
|
+
},
|
|
4190
|
+
methods: {
|
|
4191
|
+
openModal() {
|
|
4192
|
+
this.showModal = true;
|
|
4193
|
+
this.removeHidden();
|
|
4194
|
+
},
|
|
4195
|
+
handleCancel() {
|
|
4196
|
+
this.showModal = false;
|
|
4197
|
+
this.removeHidden();
|
|
4198
|
+
console.log('on-cancel');
|
|
4199
|
+
this.$emit('cancel');
|
|
4200
|
+
this.$emit('input', this.showModal);
|
|
4201
|
+
},
|
|
4202
|
+
handleOk() {
|
|
4203
|
+
console.log('on-ok');
|
|
4204
|
+
this.$emit('ok');
|
|
4205
|
+
},
|
|
4206
|
+
removeHidden() {
|
|
4207
|
+
let ishidden = document.body.style.overflow === 'hidden';
|
|
4208
|
+
ishidden && (document.body.style.overflow = 'initial');
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
};
|
|
4212
|
+
|
|
4213
|
+
/* script */
|
|
4214
|
+
const __vue_script__$2 = script$2;
|
|
4215
|
+
|
|
4216
|
+
/* template */
|
|
4217
|
+
var __vue_render__$2 = function () {
|
|
4218
|
+
var _vm = this;
|
|
4219
|
+
var _h = _vm.$createElement;
|
|
4220
|
+
var _c = _vm._self._c || _h;
|
|
4221
|
+
return _c(
|
|
4222
|
+
"a-modal",
|
|
4223
|
+
{
|
|
4224
|
+
attrs: {
|
|
4225
|
+
title: _vm.title,
|
|
4226
|
+
cancelText: _vm.cancelText,
|
|
4227
|
+
okText: _vm.okText,
|
|
4228
|
+
closable: _vm.closable,
|
|
4229
|
+
width: _vm.width,
|
|
4230
|
+
keyboard: false,
|
|
4231
|
+
maskClosable: _vm.maskClosable,
|
|
4232
|
+
dialogStyle: { top: _vm.upDownDistance[_vm.size] + "px" },
|
|
4233
|
+
bodyStyle: { maxHeight: _vm.maxheight, overflowY: "auto" },
|
|
4234
|
+
footer: _vm.showFooter ? undefined : null,
|
|
4235
|
+
},
|
|
4236
|
+
on: { cancel: _vm.handleCancel, ok: _vm.handleOk },
|
|
4237
|
+
model: {
|
|
4238
|
+
value: _vm.showModal,
|
|
4239
|
+
callback: function ($$v) {
|
|
4240
|
+
_vm.showModal = $$v;
|
|
4241
|
+
},
|
|
4242
|
+
expression: "showModal",
|
|
4243
|
+
},
|
|
4244
|
+
},
|
|
4245
|
+
[
|
|
4246
|
+
_vm._t("default"),
|
|
4247
|
+
_vm._v(" "),
|
|
4248
|
+
_c("template", { slot: "footer" }, [_vm._t("footer")], 2),
|
|
4249
|
+
],
|
|
4250
|
+
2
|
|
4251
|
+
)
|
|
4252
|
+
};
|
|
4253
|
+
var __vue_staticRenderFns__$2 = [];
|
|
4254
|
+
__vue_render__$2._withStripped = true;
|
|
4255
|
+
|
|
4256
|
+
/* style */
|
|
4257
|
+
const __vue_inject_styles__$2 = undefined;
|
|
4258
|
+
/* scoped */
|
|
4259
|
+
const __vue_scope_id__$2 = undefined;
|
|
4260
|
+
/* module identifier */
|
|
4261
|
+
const __vue_module_identifier__$2 = undefined;
|
|
4262
|
+
/* functional template */
|
|
4263
|
+
const __vue_is_functional_template__$2 = false;
|
|
4264
|
+
/* style inject */
|
|
4265
|
+
|
|
4266
|
+
/* style inject SSR */
|
|
4267
|
+
|
|
4268
|
+
/* style inject shadow dom */
|
|
4269
|
+
|
|
4270
|
+
|
|
4271
|
+
|
|
4272
|
+
const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
|
|
4273
|
+
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
|
|
4274
|
+
__vue_inject_styles__$2,
|
|
4275
|
+
__vue_script__$2,
|
|
4276
|
+
__vue_scope_id__$2,
|
|
4277
|
+
__vue_is_functional_template__$2,
|
|
4278
|
+
__vue_module_identifier__$2,
|
|
4279
|
+
false,
|
|
4280
|
+
undefined,
|
|
4281
|
+
undefined,
|
|
4282
|
+
undefined
|
|
4283
|
+
);
|
|
4284
|
+
|
|
4285
|
+
__vue_component__$2.install = Vue => Vue.component(__vue_component__$2.name, __vue_component__$2);
|
|
4286
|
+
|
|
4287
|
+
__vue_component__$6.install = Vue => Vue.component(__vue_component__$6.name, __vue_component__$6);
|
|
4288
|
+
|
|
4289
|
+
__vue_component__$5.install = Vue => Vue.component(__vue_component__$5.name, __vue_component__$5);
|
|
4290
|
+
|
|
4291
|
+
//
|
|
4292
|
+
//
|
|
4293
|
+
//
|
|
4294
|
+
//
|
|
4295
|
+
//
|
|
4296
|
+
//
|
|
4297
|
+
|
|
4298
|
+
var script$1 = {
|
|
4299
|
+
name: 'ele-batch-export'
|
|
4300
|
+
};
|
|
4301
|
+
|
|
4302
|
+
/* script */
|
|
4303
|
+
const __vue_script__$1 = script$1;
|
|
4304
|
+
|
|
4305
|
+
/* template */
|
|
4306
|
+
var __vue_render__$1 = function () {
|
|
4307
|
+
var _vm = this;
|
|
4308
|
+
var _h = _vm.$createElement;
|
|
4309
|
+
var _c = _vm._self._c || _h;
|
|
4310
|
+
return _c("div", [_vm._v("\n export\n")])
|
|
4311
|
+
};
|
|
4312
|
+
var __vue_staticRenderFns__$1 = [];
|
|
4313
|
+
__vue_render__$1._withStripped = true;
|
|
4314
|
+
|
|
4315
|
+
/* style */
|
|
4316
|
+
const __vue_inject_styles__$1 = function (inject) {
|
|
4317
|
+
if (!inject) return
|
|
4318
|
+
inject("data-v-4ed65b1c_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
4319
|
+
|
|
4320
|
+
};
|
|
4321
|
+
/* scoped */
|
|
4322
|
+
const __vue_scope_id__$1 = "data-v-4ed65b1c";
|
|
4323
|
+
/* module identifier */
|
|
4324
|
+
const __vue_module_identifier__$1 = undefined;
|
|
4325
|
+
/* functional template */
|
|
4326
|
+
const __vue_is_functional_template__$1 = false;
|
|
4327
|
+
/* style inject SSR */
|
|
4328
|
+
|
|
4329
|
+
/* style inject shadow dom */
|
|
4330
|
+
|
|
4331
|
+
|
|
4332
|
+
|
|
4333
|
+
const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
|
|
4334
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
4335
|
+
__vue_inject_styles__$1,
|
|
4336
|
+
__vue_script__$1,
|
|
4337
|
+
__vue_scope_id__$1,
|
|
4338
|
+
__vue_is_functional_template__$1,
|
|
4339
|
+
__vue_module_identifier__$1,
|
|
4340
|
+
false,
|
|
4341
|
+
createInjector,
|
|
4342
|
+
undefined,
|
|
4343
|
+
undefined
|
|
4344
|
+
);
|
|
4345
|
+
|
|
4346
|
+
__vue_component__$1.install = Vue => Vue.component(__vue_component__$1.name, __vue_component__$1);
|
|
4347
|
+
|
|
4348
|
+
__vue_component__$e.install = Vue => Vue.component(__vue_component__$e.name, __vue_component__$e);
|
|
4349
|
+
|
|
4350
|
+
__vue_component__$f.install = Vue => Vue.component(__vue_component__$f.name, __vue_component__$f);
|
|
4351
|
+
|
|
4352
|
+
__vue_component__$d.install = Vue => Vue.component(__vue_component__$d.name, __vue_component__$d);
|
|
4353
|
+
|
|
4354
|
+
const BUILT_IN_EVENT_NAMES = {
|
|
4355
|
+
SUBMIT: 'submit',
|
|
4356
|
+
CANCEL: 'cancel'
|
|
4357
|
+
};
|
|
4358
|
+
|
|
4359
|
+
//
|
|
4360
|
+
var script = {
|
|
4361
|
+
name: 'ele-form-model',
|
|
4362
|
+
components: {
|
|
4363
|
+
EleButtonGroup: __vue_component__$e
|
|
4364
|
+
},
|
|
4365
|
+
props: {
|
|
4366
|
+
title: {
|
|
4367
|
+
type: String
|
|
4368
|
+
},
|
|
4369
|
+
formMeta: {
|
|
4370
|
+
type: Object
|
|
4371
|
+
},
|
|
4372
|
+
footerMeta: {
|
|
4373
|
+
type: Object
|
|
4374
|
+
}
|
|
4375
|
+
},
|
|
4376
|
+
data() {
|
|
4377
|
+
return {};
|
|
4378
|
+
},
|
|
4379
|
+
computed: {
|
|
4380
|
+
formRef() {
|
|
4381
|
+
return v4();
|
|
4382
|
+
},
|
|
4383
|
+
assignAttrForEvents() {
|
|
4384
|
+
const events = this.footerElements.reduce((ret, ele) => {
|
|
4385
|
+
ret[ele.eventName] = e => {
|
|
4386
|
+
this.$emit(ele.eventName || 'click', {
|
|
4387
|
+
...e,
|
|
4388
|
+
formModel: this.formModels
|
|
4389
|
+
});
|
|
4390
|
+
};
|
|
4391
|
+
return ret;
|
|
4392
|
+
}, {});
|
|
4393
|
+
return {
|
|
4394
|
+
...this.$listeners,
|
|
4395
|
+
...events,
|
|
4396
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],
|
|
4397
|
+
[BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]
|
|
4398
|
+
};
|
|
4399
|
+
},
|
|
4400
|
+
elements() {
|
|
4401
|
+
const {
|
|
4402
|
+
elements
|
|
4403
|
+
} = this.formMeta;
|
|
4404
|
+
return elements;
|
|
4405
|
+
},
|
|
4406
|
+
preRequest() {
|
|
4407
|
+
const {
|
|
4408
|
+
preRequest
|
|
4409
|
+
} = this.formMeta;
|
|
4410
|
+
return preRequest;
|
|
4411
|
+
},
|
|
4412
|
+
infoRequest() {
|
|
4413
|
+
const {
|
|
4414
|
+
infoRequest
|
|
4415
|
+
} = this.formMeta;
|
|
4416
|
+
return infoRequest;
|
|
4417
|
+
},
|
|
4418
|
+
submitRequest() {
|
|
4419
|
+
const {
|
|
4420
|
+
submitRequest
|
|
4421
|
+
} = this.formMeta;
|
|
4422
|
+
return submitRequest;
|
|
4423
|
+
},
|
|
4424
|
+
footerElements() {
|
|
4425
|
+
const {
|
|
4426
|
+
elements
|
|
4427
|
+
} = this.footerMeta;
|
|
4428
|
+
return elements.call(this);
|
|
4429
|
+
},
|
|
4430
|
+
formModels() {
|
|
4431
|
+
return this.$refs[this.formRef].getFieldsValue();
|
|
4432
|
+
}
|
|
4433
|
+
},
|
|
4434
|
+
methods: {
|
|
4435
|
+
async submitRequestTrigger() {},
|
|
4436
|
+
async infoRequestTrigger() {},
|
|
4437
|
+
async preRequestTrigger() {
|
|
4438
|
+
const {
|
|
4439
|
+
url,
|
|
4440
|
+
requestType = 'GET',
|
|
4441
|
+
fieldMap = {}
|
|
4442
|
+
} = this.preRequest;
|
|
4443
|
+
if (!url) return;
|
|
4444
|
+
await net[requestType.toLowerCase()](url, {});
|
|
4445
|
+
},
|
|
4446
|
+
setValueForField(props) {
|
|
4447
|
+
this.$refs[this.formRef].setFieldsValue(props);
|
|
4448
|
+
},
|
|
4449
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT](props) {
|
|
4450
|
+
const status = this.$refs[this.formRef].validateFields();
|
|
4451
|
+
console.log('status', status);
|
|
4452
|
+
if (status) {
|
|
4453
|
+
console.log('status', this.formModels);
|
|
4454
|
+
} else {
|
|
4455
|
+
console.log('error');
|
|
4456
|
+
}
|
|
4457
|
+
},
|
|
4458
|
+
[BUILT_IN_EVENT_NAMES.CANCEL](props) {
|
|
4459
|
+
console.log('inner CANCEL', props);
|
|
4460
|
+
}
|
|
4461
|
+
},
|
|
4462
|
+
async mounted() {
|
|
4463
|
+
await this.preRequestTrigger();
|
|
4464
|
+
await this.infoRequestTrigger();
|
|
4465
|
+
}
|
|
4466
|
+
};
|
|
4467
|
+
|
|
4468
|
+
/* script */
|
|
4469
|
+
const __vue_script__ = script;
|
|
4470
|
+
|
|
4471
|
+
/* template */
|
|
4472
|
+
var __vue_render__ = function () {
|
|
4473
|
+
var _vm = this;
|
|
4474
|
+
var _h = _vm.$createElement;
|
|
4475
|
+
var _c = _vm._self._c || _h;
|
|
4476
|
+
return _c("div", { staticClass: "form__model--wrapper" }, [
|
|
4477
|
+
_c("div", { staticClass: "form-model__title" }, [
|
|
4478
|
+
_vm._v("\n " + _vm._s(_vm.title) + "\n "),
|
|
4479
|
+
]),
|
|
4480
|
+
_vm._v(" "),
|
|
4481
|
+
_c(
|
|
4482
|
+
"div",
|
|
4483
|
+
{ staticClass: "form-model__content" },
|
|
4484
|
+
[_c("ele-form", { ref: _vm.formRef, attrs: { elements: _vm.elements } })],
|
|
4485
|
+
1
|
|
4486
|
+
),
|
|
4487
|
+
_vm._v(" "),
|
|
4488
|
+
_c(
|
|
4489
|
+
"div",
|
|
4490
|
+
{ staticClass: "form-model__footer" },
|
|
4491
|
+
[
|
|
4492
|
+
_c(
|
|
4493
|
+
"ele-button-group",
|
|
4494
|
+
_vm._g(
|
|
4495
|
+
{ attrs: { "data-source": _vm.footerElements } },
|
|
4496
|
+
_vm.assignAttrForEvents
|
|
4497
|
+
)
|
|
4498
|
+
),
|
|
4499
|
+
],
|
|
4500
|
+
1
|
|
4501
|
+
),
|
|
4502
|
+
])
|
|
4503
|
+
};
|
|
4504
|
+
var __vue_staticRenderFns__ = [];
|
|
4505
|
+
__vue_render__._withStripped = true;
|
|
4506
|
+
|
|
4507
|
+
/* style */
|
|
4508
|
+
const __vue_inject_styles__ = function (inject) {
|
|
4509
|
+
if (!inject) return
|
|
4510
|
+
inject("data-v-4815b8c0_0", { source: ".form__model--wrapper[data-v-4815b8c0] {\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n.form__model--wrapper .form-model__title[data-v-4815b8c0] {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n}\n.form__model--wrapper .form-model__content[data-v-4815b8c0] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-4815b8c0] {\n width: 100%;\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\form-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAgHA;EACA,WAAA;EACA,YAAA;EACA,cAAA;AC/GA;ADgHA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8DAAA;AC9GA;ADgHA;EACA,aAAA;AC9GA;ADgHA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;AC9GA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"form__model--wrapper\">\r\n <div class=\"form-model__title\">\r\n {{ title }}\r\n </div>\r\n <div class=\"form-model__content\">\r\n <ele-form :ref=\"formRef\" :elements=\"elements\"></ele-form>\r\n </div>\r\n <div class=\"form-model__footer\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nimport { BUILT_IN_EVENT_NAMES } from '../../utils'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { net } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-form-model',\r\n components: {\r\n EleButtonGroup\r\n },\r\n props: {\r\n title: {\r\n type: String\r\n },\r\n formMeta: {\r\n type: Object\r\n },\r\n footerMeta: {\r\n type: Object\r\n }\r\n },\r\n data() {\r\n return {}\r\n },\r\n computed: {\r\n formRef () {\r\n return uuidv4()\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, formModel: this.formModels })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\r\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]\r\n }\r\n },\r\n elements () {\r\n const { elements } = this.formMeta\r\n return elements\r\n },\r\n preRequest () {\r\n const { preRequest } = this.formMeta\r\n return preRequest\r\n },\r\n infoRequest () {\r\n const { infoRequest } = this.formMeta\r\n return infoRequest\r\n },\r\n submitRequest () {\r\n const { submitRequest } = this.formMeta\r\n return submitRequest\r\n },\r\n footerElements () {\r\n const { elements } = this.footerMeta\r\n return elements.call(this)\r\n },\r\n formModels () {\r\n return this.$refs[this.formRef].getFieldsValue()\r\n }\r\n },\r\n methods: {\r\n async submitRequestTrigger () {},\r\n async infoRequestTrigger () {},\r\n async preRequestTrigger () {\r\n const { url, requestType = 'GET', fieldMap = {} } = this.preRequest\r\n if (!url) return\r\n await net[requestType.toLowerCase()](url, {})\r\n },\r\n setValueForField (props) {\r\n this.$refs[this.formRef].setFieldsValue(props)\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props) {\r\n const status = this.$refs[this.formRef].validateFields()\r\n console.log('status', status)\r\n if (status) {\r\n console.log('status', this.formModels)\r\n } else {\r\n console.log('error')\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.CANCEL] (props) {\r\n console.log('inner CANCEL', props)\r\n }\r\n },\r\n async mounted() {\r\n await this.preRequestTrigger()\r\n await this.infoRequestTrigger()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.form__model--wrapper {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n .form-model__title {\r\n height: 56px;\r\n padding: 0 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n border-bottom: 1px solid var(--idooel-form-title-border-color);\r\n }\r\n .form-model__content {\r\n padding: 16px;\r\n }\r\n .form-model__footer {\r\n width: 100%;\r\n height: 64px;\r\n position: fixed;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n}\r\n</style>",".form__model--wrapper {\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n.form__model--wrapper .form-model__title {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n}\n.form__model--wrapper .form-model__content {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer {\n width: 100%;\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4511
|
+
|
|
4512
|
+
};
|
|
4513
|
+
/* scoped */
|
|
4514
|
+
const __vue_scope_id__ = "data-v-4815b8c0";
|
|
4515
|
+
/* module identifier */
|
|
4516
|
+
const __vue_module_identifier__ = undefined;
|
|
4517
|
+
/* functional template */
|
|
4518
|
+
const __vue_is_functional_template__ = false;
|
|
4519
|
+
/* style inject SSR */
|
|
4520
|
+
|
|
4521
|
+
/* style inject shadow dom */
|
|
4522
|
+
|
|
4523
|
+
|
|
4524
|
+
|
|
4525
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
4526
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
4527
|
+
__vue_inject_styles__,
|
|
4528
|
+
__vue_script__,
|
|
4529
|
+
__vue_scope_id__,
|
|
4530
|
+
__vue_is_functional_template__,
|
|
4531
|
+
__vue_module_identifier__,
|
|
4532
|
+
false,
|
|
4533
|
+
createInjector,
|
|
4534
|
+
undefined,
|
|
4535
|
+
undefined
|
|
4536
|
+
);
|
|
4537
|
+
|
|
4538
|
+
__vue_component__.install = Vue => Vue.component(__vue_component__.name, __vue_component__);
|
|
4539
|
+
|
|
4540
|
+
const compositeComponents = [__vue_component__$e, __vue_component__$f];
|
|
4541
|
+
const models = [__vue_component__$d, __vue_component__];
|
|
4542
|
+
const components = [__vue_component__$n, __vue_component__$m, __vue_component__$l, __vue_component__$k, __vue_component__$i, __vue_component__$h, __vue_component__$c, __vue_component__$4, __vue_component__$3, __vue_component__$9, __vue_component__$8, __vue_component__$a, __vue_component__$7, __vue_component__$2, __vue_component__$6, __vue_component__$5, __vue_component__$1, ...compositeComponents, ...models];
|
|
4543
|
+
const install = Vue => {
|
|
4544
|
+
if (install.installed) return;
|
|
4545
|
+
install.installed = true;
|
|
4546
|
+
components.forEach(component => {
|
|
4547
|
+
Vue.component(component.name, component);
|
|
4548
|
+
});
|
|
4549
|
+
};
|
|
4550
|
+
|
|
4551
|
+
export { __vue_component__$n as EleButton, __vue_component__$m as EleDate, __vue_component__$l as EleInput, __vue_component__$2 as EleModal, __vue_component__$k as EleSelect, __vue_component__$i as EleTable, __vue_component__$c as EleTpl, __vue_component__$h as EleTree, install as default, models };
|