@idooel/components 0.0.1-beta.95 → 0.0.1-beta.96
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 +1400 -1380
- package/dist/@idooel/components.umd.js +1400 -1380
- package/package.json +1 -1
- package/packages/button/src/index.vue +11 -0
- package/packages/composite-components/button-group/src/index.vue +9 -4
- package/packages/composite-components/modal-table/src/index.vue +20 -3
- package/packages/models/tree-table-model/src/index.vue +18 -15
- package/packages/table/src/index.vue +0 -3
|
@@ -2,1412 +2,1405 @@ import moment from 'moment';
|
|
|
2
2
|
import { type, net, route, util } from '@idooel/shared';
|
|
3
3
|
import FileUpload from 'vue-upload-component';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
var script$H = {
|
|
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
|
-
}
|
|
5
|
+
const ESCAPE = {
|
|
6
|
+
"n": "\n",
|
|
7
|
+
"f": "\f",
|
|
8
|
+
"r": "\r",
|
|
9
|
+
"t": " ",
|
|
10
|
+
"v": "\v"
|
|
66
11
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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 =
|
|
96
|
-
context || // cached call
|
|
97
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
98
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
99
|
-
// 2.2 with runInNewContext: true
|
|
100
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
101
|
-
context = __VUE_SSR_CONTEXT__;
|
|
102
|
-
}
|
|
103
|
-
// inject component styles
|
|
104
|
-
if (style) {
|
|
105
|
-
style.call(this, createInjectorSSR(context));
|
|
106
|
-
}
|
|
107
|
-
// register component module identifier for async chunk inference
|
|
108
|
-
if (context && context._registeredComponents) {
|
|
109
|
-
context._registeredComponents.add(moduleIdentifier);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
// used by ssr in case component is cached and beforeCreate
|
|
113
|
-
// never gets called
|
|
114
|
-
options._ssrRegister = hook;
|
|
115
|
-
}
|
|
116
|
-
else if (style) {
|
|
117
|
-
hook = shadowMode
|
|
118
|
-
? function (context) {
|
|
119
|
-
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
120
|
-
}
|
|
121
|
-
: function (context) {
|
|
122
|
-
style.call(this, createInjector(context));
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
if (hook) {
|
|
126
|
-
if (options.functional) {
|
|
127
|
-
// register for functional component in vue file
|
|
128
|
-
const originalRender = options.render;
|
|
129
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
130
|
-
hook.call(context);
|
|
131
|
-
return originalRender(h, context);
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
// inject component registration as beforeCreate hook
|
|
136
|
-
const existing = options.beforeCreate;
|
|
137
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return script;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/* script */
|
|
144
|
-
const __vue_script__$H = script$H;
|
|
145
|
-
|
|
146
|
-
/* template */
|
|
147
|
-
var __vue_render__$H = function () {
|
|
148
|
-
var _vm = this;
|
|
149
|
-
var _h = _vm.$createElement;
|
|
150
|
-
var _c = _vm._self._c || _h;
|
|
151
|
-
return _vm.mode == "dropdown"
|
|
152
|
-
? _c(
|
|
153
|
-
"a-dropdown",
|
|
154
|
-
[
|
|
155
|
-
_c(
|
|
156
|
-
"a-menu",
|
|
157
|
-
{
|
|
158
|
-
attrs: { slot: "overlay" },
|
|
159
|
-
on: { click: _vm.handleMenuClick },
|
|
160
|
-
slot: "overlay",
|
|
161
|
-
},
|
|
162
|
-
_vm._l(_vm.dataSource, function (opt) {
|
|
163
|
-
return _c("a-menu-item", { key: opt.value }, [
|
|
164
|
-
_vm._v("\n " + _vm._s(opt.label) + "\n "),
|
|
165
|
-
])
|
|
166
|
-
}),
|
|
167
|
-
1
|
|
168
|
-
),
|
|
169
|
-
_vm._v(" "),
|
|
170
|
-
_c(
|
|
171
|
-
"a-button",
|
|
172
|
-
{ attrs: { type: _vm.type } },
|
|
173
|
-
[
|
|
174
|
-
_vm._t("default"),
|
|
175
|
-
_vm._v(" "),
|
|
176
|
-
_c("a-icon", { attrs: { type: _vm.icon } }),
|
|
177
|
-
],
|
|
178
|
-
2
|
|
179
|
-
),
|
|
180
|
-
],
|
|
181
|
-
1
|
|
182
|
-
)
|
|
183
|
-
: _c(
|
|
184
|
-
"a-button",
|
|
185
|
-
{
|
|
186
|
-
attrs: { type: _vm.type, icon: _vm.icon },
|
|
187
|
-
on: { click: _vm.handleClick },
|
|
188
|
-
},
|
|
189
|
-
[_vm._t("default")],
|
|
190
|
-
2
|
|
191
|
-
)
|
|
12
|
+
const CONSTANTS = {
|
|
13
|
+
"null": data => null,
|
|
14
|
+
"true": data => true,
|
|
15
|
+
"false": data => false,
|
|
16
|
+
"undefined": data => void 0
|
|
192
17
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
18
|
+
const OPERATORS = {
|
|
19
|
+
"+": (data, a, b) => a(data) + b(data),
|
|
20
|
+
"-": (data, a, b) => a(data) - b(data),
|
|
21
|
+
"*": (data, a, b) => a(data) * b(data),
|
|
22
|
+
"/": (data, a, b) => a(data) / b(data),
|
|
23
|
+
"%": (data, a, b) => a(data) % b(data),
|
|
24
|
+
"===": (data, a, b) => a(data) === b(data),
|
|
25
|
+
"!==": (data, a, b) => a(data) !== b(data),
|
|
26
|
+
"==": (data, a, b) => a(data) == b(data),
|
|
27
|
+
"!=": (data, a, b) => a(data) != b(data),
|
|
28
|
+
"<": (data, a, b) => a(data) < b(data),
|
|
29
|
+
">": (data, a, b) => a(data) > b(data),
|
|
30
|
+
"<=": (data, a, b) => a(data) <= b(data),
|
|
31
|
+
">=": (data, a, b) => a(data) >= b(data),
|
|
32
|
+
"&&": (data, a, b) => a(data) && b(data),
|
|
33
|
+
"||": (data, a, b) => a(data) || b(data),
|
|
34
|
+
"!": (data, a) => !a(data)
|
|
35
|
+
};
|
|
36
|
+
function isNumber$1(char) {
|
|
37
|
+
return char >= "0" && char <= "9" && typeof char === "string";
|
|
38
|
+
}
|
|
39
|
+
function isExpOperator(char) {
|
|
40
|
+
return char === "-" || char === "+" || isNumber$1(char);
|
|
41
|
+
}
|
|
42
|
+
function isIdent(char) {
|
|
43
|
+
return char >= "a" && char <= "z" || char >= "A" && char <= "Z" || char === "_" || char === "$";
|
|
44
|
+
}
|
|
45
|
+
class Expression {
|
|
46
|
+
constructor(content) {
|
|
47
|
+
if (!content) throw new Error("invalid expression");
|
|
48
|
+
this.content = content;
|
|
49
|
+
}
|
|
50
|
+
lex() {
|
|
51
|
+
let content = this.content;
|
|
52
|
+
let length = content.length;
|
|
53
|
+
let index = 0;
|
|
54
|
+
let tokens = [];
|
|
55
|
+
while (index < length) {
|
|
56
|
+
let char = content.charAt(index);
|
|
57
|
+
if (char === '"' || char === "'") {
|
|
58
|
+
let start = ++index;
|
|
59
|
+
let escape = false;
|
|
60
|
+
let value = "";
|
|
61
|
+
let token;
|
|
62
|
+
while (index < length) {
|
|
63
|
+
let c = content.charAt(index);
|
|
64
|
+
if (escape) {
|
|
65
|
+
if (c === "u") {
|
|
66
|
+
let hex = content.substring(index + 1, index + 5);
|
|
67
|
+
if (!hex.match(/[\da-f]{4}/i)) {
|
|
68
|
+
throw new Error(`invalid expression: ${content}, invalid unicode escape [\\u${hex}]`);
|
|
69
|
+
}
|
|
70
|
+
index += 4;
|
|
71
|
+
value += String.fromCharCode(parseInt(hex, 16));
|
|
72
|
+
} else {
|
|
73
|
+
let rep = ESCAPE[c];
|
|
74
|
+
value = value + (rep || c);
|
|
75
|
+
}
|
|
76
|
+
escape = false;
|
|
77
|
+
} else if (c === "\\") {
|
|
78
|
+
escape = true;
|
|
79
|
+
} else if (c === char) {
|
|
80
|
+
index++;
|
|
81
|
+
token = {
|
|
82
|
+
index: start,
|
|
83
|
+
constant: true,
|
|
84
|
+
text: char + value + char,
|
|
85
|
+
value
|
|
86
|
+
};
|
|
87
|
+
break;
|
|
88
|
+
} else {
|
|
89
|
+
value += c;
|
|
90
|
+
}
|
|
91
|
+
index++;
|
|
92
|
+
}
|
|
93
|
+
if (!token) {
|
|
94
|
+
throw new Error(`invalid expression: ${content}`);
|
|
95
|
+
} else {
|
|
96
|
+
tokens.push(token);
|
|
97
|
+
}
|
|
98
|
+
} else if (isNumber$1(char) || char === "." && isNumber$1(content.charAt(index + 1))) {
|
|
99
|
+
let start = index;
|
|
100
|
+
let value = "";
|
|
101
|
+
while (index < length) {
|
|
102
|
+
let c = content.charAt(index).toLowerCase();
|
|
103
|
+
if (c === "." || isNumber$1(c)) {
|
|
104
|
+
value += c;
|
|
105
|
+
} else {
|
|
106
|
+
let c2 = content.charAt(index + 1);
|
|
107
|
+
if (c === "e" && isExpOperator(c2)) {
|
|
108
|
+
value += c;
|
|
109
|
+
} else if (isExpOperator(c) && c2 && isNumber$1(c2) && value.charAt(value.length - 1) === "e") {
|
|
110
|
+
value += c;
|
|
111
|
+
} else if (isExpOperator(c) && (!c2 || !isNumber$1(c2)) && value.charAt(value.length - 1) == "e") {
|
|
112
|
+
throw new Error(`invalid expression: ${content}`);
|
|
113
|
+
} else {
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
index++;
|
|
118
|
+
}
|
|
119
|
+
tokens.push({
|
|
120
|
+
index: start,
|
|
121
|
+
constant: true,
|
|
122
|
+
text: value,
|
|
123
|
+
value: Number(value)
|
|
124
|
+
});
|
|
125
|
+
} else if (isIdent(char)) {
|
|
126
|
+
let start = index;
|
|
127
|
+
while (index < length) {
|
|
128
|
+
let c = content.charAt(index);
|
|
129
|
+
if (!(isIdent(c) || isNumber$1(c))) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
index++;
|
|
133
|
+
}
|
|
134
|
+
tokens.push({
|
|
135
|
+
index: start,
|
|
136
|
+
text: content.slice(start, index),
|
|
137
|
+
identifier: true
|
|
138
|
+
});
|
|
139
|
+
} else if ("(){}[].,:?".indexOf(char) >= 0) {
|
|
140
|
+
tokens.push({
|
|
141
|
+
index,
|
|
142
|
+
text: char
|
|
143
|
+
});
|
|
144
|
+
index++;
|
|
145
|
+
} else if (char === " " || char === "\r" || char === " " || char === "\n" || char === "\v" || char === "\xA0") {
|
|
146
|
+
index++;
|
|
147
|
+
} else {
|
|
148
|
+
let char2 = char + content.charAt(index + 1);
|
|
149
|
+
let char3 = char2 + content.charAt(index + 2);
|
|
150
|
+
let op1 = OPERATORS[char];
|
|
151
|
+
let op2 = OPERATORS[char2];
|
|
152
|
+
let op3 = OPERATORS[char3];
|
|
153
|
+
if (op1 || op2 || op3) {
|
|
154
|
+
let text = op3 ? char3 : op2 ? char2 : char;
|
|
155
|
+
tokens.push({
|
|
156
|
+
index,
|
|
157
|
+
text,
|
|
158
|
+
operator: true
|
|
159
|
+
});
|
|
160
|
+
index += text.length;
|
|
161
|
+
} else {
|
|
162
|
+
throw new Error(`invalid expression: ${content}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
263
165
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
},
|
|
275
|
-
modeValue() {
|
|
276
|
-
if (this.mode) return this.mode;
|
|
277
|
-
if (this.format === 'YYYY') return 'year';
|
|
278
|
-
return 'date';
|
|
166
|
+
this.tokens = tokens;
|
|
167
|
+
return tokens;
|
|
168
|
+
}
|
|
169
|
+
parse() {
|
|
170
|
+
let tokens = this.lex();
|
|
171
|
+
let func;
|
|
172
|
+
let token = tokens[0];
|
|
173
|
+
let text = token.text;
|
|
174
|
+
if (tokens.length > 0 && text !== "}" && text !== ")" && text !== "]") {
|
|
175
|
+
func = this.expression();
|
|
279
176
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if (this.modeValue !== 'year') return;
|
|
288
|
-
this.$emit('input', moment(value).format(this.format));
|
|
289
|
-
this.$emit('change', moment(value).format(this.format));
|
|
290
|
-
this.open = false;
|
|
291
|
-
},
|
|
292
|
-
openChange(open) {
|
|
293
|
-
this.open = open;
|
|
177
|
+
return data => func && func(data);
|
|
178
|
+
}
|
|
179
|
+
expect(text) {
|
|
180
|
+
let tokens = this.tokens;
|
|
181
|
+
let token = tokens[0];
|
|
182
|
+
if (!text || text === (token && token.text)) {
|
|
183
|
+
return tokens.shift();
|
|
294
184
|
}
|
|
295
185
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
313
|
-
// this makes source maps inside style tags work properly in Chrome
|
|
314
|
-
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
315
|
-
// http://stackoverflow.com/a/26603875
|
|
316
|
-
code +=
|
|
317
|
-
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
318
|
-
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
319
|
-
' */';
|
|
320
|
-
}
|
|
321
|
-
if (!style.element) {
|
|
322
|
-
style.element = document.createElement('style');
|
|
323
|
-
style.element.type = 'text/css';
|
|
324
|
-
if (css.media)
|
|
325
|
-
style.element.setAttribute('media', css.media);
|
|
326
|
-
if (HEAD === undefined) {
|
|
327
|
-
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
328
|
-
}
|
|
329
|
-
HEAD.appendChild(style.element);
|
|
330
|
-
}
|
|
331
|
-
if ('styleSheet' in style.element) {
|
|
332
|
-
style.styles.push(code);
|
|
333
|
-
style.element.styleSheet.cssText = style.styles
|
|
334
|
-
.filter(Boolean)
|
|
335
|
-
.join('\n');
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
const index = style.ids.size - 1;
|
|
339
|
-
const textNode = document.createTextNode(code);
|
|
340
|
-
const nodes = style.element.childNodes;
|
|
341
|
-
if (nodes[index])
|
|
342
|
-
style.element.removeChild(nodes[index]);
|
|
343
|
-
if (nodes.length)
|
|
344
|
-
style.element.insertBefore(textNode, nodes[index]);
|
|
345
|
-
else
|
|
346
|
-
style.element.appendChild(textNode);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/* script */
|
|
352
|
-
const __vue_script__$G = script$G;
|
|
353
|
-
|
|
354
|
-
/* template */
|
|
355
|
-
var __vue_render__$G = function () {
|
|
356
|
-
var _vm = this;
|
|
357
|
-
var _h = _vm.$createElement;
|
|
358
|
-
var _c = _vm._self._c || _h;
|
|
359
|
-
return _c(
|
|
360
|
-
"div",
|
|
361
|
-
{ staticClass: "ele-date__wrapper" },
|
|
362
|
-
[
|
|
363
|
-
_vm.modeValue == "year"
|
|
364
|
-
? _c("a-date-picker", {
|
|
365
|
-
staticStyle: { width: "100%" },
|
|
366
|
-
attrs: {
|
|
367
|
-
mode: _vm.modeValue,
|
|
368
|
-
open: _vm.open,
|
|
369
|
-
disabled: _vm.disabled,
|
|
370
|
-
value: _vm.value,
|
|
371
|
-
placeholder: _vm.placeholder,
|
|
372
|
-
"show-time": _vm.showTime,
|
|
373
|
-
"show-today": _vm.showToday,
|
|
374
|
-
valueFormat: _vm.innerValueFormat,
|
|
375
|
-
format: _vm.format,
|
|
376
|
-
},
|
|
377
|
-
on: {
|
|
378
|
-
panelChange: _vm.onPanelChange,
|
|
379
|
-
openChange: _vm.openChange,
|
|
380
|
-
change: _vm.onChange,
|
|
381
|
-
},
|
|
382
|
-
})
|
|
383
|
-
: _c("a-date-picker", {
|
|
384
|
-
staticStyle: { width: "100%" },
|
|
385
|
-
attrs: {
|
|
386
|
-
placeholder: _vm.placeholder,
|
|
387
|
-
open: _vm.open,
|
|
388
|
-
disabled: _vm.disabled,
|
|
389
|
-
value: _vm.value,
|
|
390
|
-
"show-time": _vm.showTime,
|
|
391
|
-
"show-today": _vm.showToday,
|
|
392
|
-
valueFormat: _vm.innerValueFormat,
|
|
393
|
-
format: _vm.format,
|
|
394
|
-
},
|
|
395
|
-
on: {
|
|
396
|
-
panelChange: _vm.onPanelChange,
|
|
397
|
-
openChange: _vm.openChange,
|
|
398
|
-
change: _vm.onChange,
|
|
399
|
-
},
|
|
400
|
-
}),
|
|
401
|
-
],
|
|
402
|
-
1
|
|
403
|
-
)
|
|
404
|
-
};
|
|
405
|
-
var __vue_staticRenderFns__$G = [];
|
|
406
|
-
__vue_render__$G._withStripped = true;
|
|
407
|
-
|
|
408
|
-
/* style */
|
|
409
|
-
const __vue_inject_styles__$G = function (inject) {
|
|
410
|
-
if (!inject) return
|
|
411
|
-
inject("data-v-7716ba90_0", { source: ".ele-date__wrapper[data-v-7716ba90] {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/date/src/index.vue","index.vue"],"names":[],"mappings":"AA6GA;EACA,WAAA;AC5GA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-date__wrapper\">\n <a-date-picker \n style=\"width: 100%;\" \n :mode=\"modeValue\"\n v-if=\"modeValue == 'year'\"\n :open=\"open\"\n :disabled=\"disabled\"\n :value=\"value\"\n :placeholder=\"placeholder\"\n :show-time=\"showTime\"\n :show-today=\"showToday\"\n :valueFormat=\"innerValueFormat\"\n @panelChange=\"onPanelChange\"\n @openChange=\"openChange\"\n @change=\"onChange\"\n :format=\"format\">\n </a-date-picker>\n <a-date-picker \n v-else\n style=\"width: 100%;\"\n :placeholder=\"placeholder\"\n :open=\"open\"\n :disabled=\"disabled\"\n :value=\"value\"\n :show-time=\"showTime\"\n :show-today=\"showToday\"\n :valueFormat=\"innerValueFormat\"\n @panelChange=\"onPanelChange\"\n @openChange=\"openChange\"\n @change=\"onChange\"\n :format=\"format\">\n </a-date-picker>\n </div>\n</template>\n\n<script>\nimport moment from 'moment'\nexport default {\n name: 'ele-date',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: [String, Object]\n },\n disabled: {\n type: Boolean,\n default: false\n },\n format: {\n type: String,\n default: 'YYYY/MM/DD'\n },\n mode: {\n type: String\n },\n valueFormat: {\n type: String\n },\n showTime: {\n type: [Boolean, Object],\n default: true\n },\n showToday: {\n type: Boolean,\n default: true\n },\n placeholder: {\n type: String,\n default: '请选择日期'\n }\n },\n data () {\n return {\n open: false\n }\n },\n computed: {\n innerValueFormat () {\n if (this.valueFormat) return this.valueFormat\n return this.format\n },\n modeValue () {\n if (this.mode) return this.mode\n if (this.format === 'YYYY') return 'year'\n return 'date'\n }\n },\n methods: {\n onChange (_, dataString) {\n this.$emit('input', dataString)\n this.$emit('change', dataString)\n },\n onPanelChange (value, mode) {\n if (this.modeValue !== 'year') return\n this.$emit('input', moment(value).format(this.format))\n this.$emit('change', moment(value).format(this.format))\n this.open = false\n },\n openChange (open) {\n this.open = open\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.ele-date__wrapper {\n width: 100%;\n}\n</style>",".ele-date__wrapper {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
412
|
-
|
|
413
|
-
};
|
|
414
|
-
/* scoped */
|
|
415
|
-
const __vue_scope_id__$G = "data-v-7716ba90";
|
|
416
|
-
/* module identifier */
|
|
417
|
-
const __vue_module_identifier__$G = undefined;
|
|
418
|
-
/* functional template */
|
|
419
|
-
const __vue_is_functional_template__$G = false;
|
|
420
|
-
/* style inject SSR */
|
|
421
|
-
|
|
422
|
-
/* style inject shadow dom */
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
const __vue_component__$G = /*#__PURE__*/normalizeComponent(
|
|
427
|
-
{ render: __vue_render__$G, staticRenderFns: __vue_staticRenderFns__$G },
|
|
428
|
-
__vue_inject_styles__$G,
|
|
429
|
-
__vue_script__$G,
|
|
430
|
-
__vue_scope_id__$G,
|
|
431
|
-
__vue_is_functional_template__$G,
|
|
432
|
-
__vue_module_identifier__$G,
|
|
433
|
-
false,
|
|
434
|
-
createInjector,
|
|
435
|
-
undefined,
|
|
436
|
-
undefined
|
|
437
|
-
);
|
|
438
|
-
|
|
439
|
-
__vue_component__$G.install = Vue => Vue.component(__vue_component__$G.name, __vue_component__$G);
|
|
440
|
-
|
|
441
|
-
//
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
//
|
|
445
|
-
|
|
446
|
-
var script$F = {
|
|
447
|
-
name: 'ele-input',
|
|
448
|
-
model: {
|
|
449
|
-
prop: 'value',
|
|
450
|
-
event: 'change'
|
|
451
|
-
},
|
|
452
|
-
props: {
|
|
453
|
-
disabled: {
|
|
454
|
-
type: Boolean,
|
|
455
|
-
default: false
|
|
456
|
-
},
|
|
457
|
-
maxLength: {
|
|
458
|
-
type: Number,
|
|
459
|
-
default: 125
|
|
460
|
-
},
|
|
461
|
-
value: {
|
|
462
|
-
type: String
|
|
186
|
+
consume(text) {
|
|
187
|
+
if (!this.tokens.length) throw new Error(`parse expression error: ${this.content}`);
|
|
188
|
+
let token = this.expect(text);
|
|
189
|
+
if (!token) throw new Error(`parse expression error: ${this.content}`);
|
|
190
|
+
return token;
|
|
191
|
+
}
|
|
192
|
+
expression() {
|
|
193
|
+
return this.ternary();
|
|
194
|
+
}
|
|
195
|
+
ternary() {
|
|
196
|
+
let left = this.logicalOR();
|
|
197
|
+
if (this.expect("?")) {
|
|
198
|
+
let middle = this.expression();
|
|
199
|
+
this.consume(":");
|
|
200
|
+
let right = this.expression();
|
|
201
|
+
return data => left(data) ? middle(data) : right(data);
|
|
463
202
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
203
|
+
return left;
|
|
204
|
+
}
|
|
205
|
+
binary(left, op, right) {
|
|
206
|
+
let fn = OPERATORS[op];
|
|
207
|
+
return data => fn(data, left, right);
|
|
208
|
+
}
|
|
209
|
+
unary() {
|
|
210
|
+
let token;
|
|
211
|
+
if (this.expect("+")) {
|
|
212
|
+
return this.primary();
|
|
213
|
+
} else if (token = this.expect("-")) {
|
|
214
|
+
return this.binary(data => 0, token.text, this.unary());
|
|
215
|
+
} else if (token = this.expect("!")) {
|
|
216
|
+
let fn = OPERATORS[token.text];
|
|
217
|
+
let right = this.unary();
|
|
218
|
+
return data => fn(data, right);
|
|
219
|
+
} else {
|
|
220
|
+
return this.primary();
|
|
469
221
|
}
|
|
470
222
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
/* template */
|
|
477
|
-
var __vue_render__$F = function () {
|
|
478
|
-
var _vm = this;
|
|
479
|
-
var _h = _vm.$createElement;
|
|
480
|
-
var _c = _vm._self._c || _h;
|
|
481
|
-
return _c("a-input", {
|
|
482
|
-
attrs: {
|
|
483
|
-
value: _vm.value,
|
|
484
|
-
disabled: _vm.disabled,
|
|
485
|
-
"max-length": _vm.maxLength,
|
|
486
|
-
},
|
|
487
|
-
on: { change: _vm.onChange },
|
|
488
|
-
})
|
|
489
|
-
};
|
|
490
|
-
var __vue_staticRenderFns__$F = [];
|
|
491
|
-
__vue_render__$F._withStripped = true;
|
|
492
|
-
|
|
493
|
-
/* style */
|
|
494
|
-
const __vue_inject_styles__$F = function (inject) {
|
|
495
|
-
if (!inject) return
|
|
496
|
-
inject("data-v-c04139c8_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", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
497
|
-
|
|
498
|
-
};
|
|
499
|
-
/* scoped */
|
|
500
|
-
const __vue_scope_id__$F = "data-v-c04139c8";
|
|
501
|
-
/* module identifier */
|
|
502
|
-
const __vue_module_identifier__$F = undefined;
|
|
503
|
-
/* functional template */
|
|
504
|
-
const __vue_is_functional_template__$F = false;
|
|
505
|
-
/* style inject SSR */
|
|
506
|
-
|
|
507
|
-
/* style inject shadow dom */
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const __vue_component__$F = /*#__PURE__*/normalizeComponent(
|
|
512
|
-
{ render: __vue_render__$F, staticRenderFns: __vue_staticRenderFns__$F },
|
|
513
|
-
__vue_inject_styles__$F,
|
|
514
|
-
__vue_script__$F,
|
|
515
|
-
__vue_scope_id__$F,
|
|
516
|
-
__vue_is_functional_template__$F,
|
|
517
|
-
__vue_module_identifier__$F,
|
|
518
|
-
false,
|
|
519
|
-
createInjector,
|
|
520
|
-
undefined,
|
|
521
|
-
undefined
|
|
522
|
-
);
|
|
523
|
-
|
|
524
|
-
__vue_component__$F.install = Vue => Vue.component(__vue_component__$F.name, __vue_component__$F);
|
|
525
|
-
|
|
526
|
-
//
|
|
527
|
-
var script$E = {
|
|
528
|
-
name: 'ele-select',
|
|
529
|
-
props: {
|
|
530
|
-
init: {
|
|
531
|
-
type: Boolean,
|
|
532
|
-
default: false
|
|
533
|
-
},
|
|
534
|
-
disabled: {
|
|
535
|
-
type: Boolean,
|
|
536
|
-
default: false
|
|
537
|
-
},
|
|
538
|
-
value: {
|
|
539
|
-
type: [String, Array, Number]
|
|
540
|
-
},
|
|
541
|
-
defaultValue: {
|
|
542
|
-
type: [String, Array, Number]
|
|
543
|
-
},
|
|
544
|
-
dataSource: {
|
|
545
|
-
type: Array,
|
|
546
|
-
default: () => []
|
|
547
|
-
},
|
|
548
|
-
url: {
|
|
549
|
-
type: String,
|
|
550
|
-
default: 'api-basic/workbench/dicttype/enum/selectList'
|
|
551
|
-
},
|
|
552
|
-
code: {
|
|
553
|
-
type: String
|
|
554
|
-
},
|
|
555
|
-
params: {
|
|
556
|
-
type: Object,
|
|
557
|
-
default: () => ({})
|
|
558
|
-
},
|
|
559
|
-
mode: {
|
|
560
|
-
type: String
|
|
561
|
-
},
|
|
562
|
-
multiple: {
|
|
563
|
-
type: Boolean,
|
|
564
|
-
default: false
|
|
223
|
+
logicalOR() {
|
|
224
|
+
let left = this.logicalAND();
|
|
225
|
+
let token;
|
|
226
|
+
while (token = this.expect("||")) {
|
|
227
|
+
left = this.binary(left, token.text, this.logicalAND());
|
|
565
228
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
isInitRequest() {
|
|
574
|
-
if (this.init) {
|
|
575
|
-
return true;
|
|
576
|
-
}
|
|
577
|
-
if (this.code || !type.isEmpty(this.params)) {
|
|
578
|
-
return true;
|
|
579
|
-
}
|
|
580
|
-
return false;
|
|
581
|
-
},
|
|
582
|
-
getMode() {
|
|
583
|
-
if (this.multiple) {
|
|
584
|
-
return 'multiple';
|
|
585
|
-
}
|
|
586
|
-
return this.mode;
|
|
229
|
+
return left;
|
|
230
|
+
}
|
|
231
|
+
logicalAND() {
|
|
232
|
+
let left = this.equality();
|
|
233
|
+
let token;
|
|
234
|
+
while (token = this.expect("&&")) {
|
|
235
|
+
left = this.binary(left, token.text, this.equality());
|
|
587
236
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
237
|
+
return left;
|
|
238
|
+
}
|
|
239
|
+
equality() {
|
|
240
|
+
let left = this.relational();
|
|
241
|
+
let token;
|
|
242
|
+
while (token = this.expect("==") || this.expect("!=") || this.expect("===") || this.expect("!==")) {
|
|
243
|
+
left = this.binary(left, token.text, this.relational());
|
|
595
244
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
this
|
|
619
|
-
|
|
245
|
+
return left;
|
|
246
|
+
}
|
|
247
|
+
relational() {
|
|
248
|
+
let left = this.additive();
|
|
249
|
+
let token;
|
|
250
|
+
while (token = this.expect("<") || this.expect(">") || this.expect("<=") || this.expect(">=")) {
|
|
251
|
+
left = this.binary(left, token.text, this.additive());
|
|
252
|
+
}
|
|
253
|
+
return left;
|
|
254
|
+
}
|
|
255
|
+
additive() {
|
|
256
|
+
let left = this.multiplicative();
|
|
257
|
+
let token;
|
|
258
|
+
while (token = this.expect("+") || this.expect("-")) {
|
|
259
|
+
left = this.binary(left, token.text, this.multiplicative());
|
|
260
|
+
}
|
|
261
|
+
return left;
|
|
262
|
+
}
|
|
263
|
+
multiplicative() {
|
|
264
|
+
let left = this.unary();
|
|
265
|
+
let token;
|
|
266
|
+
while (token = this.expect("*") || this.expect("/") || this.expect("%")) {
|
|
267
|
+
left = this.binary(left, token.text, this.unary());
|
|
268
|
+
}
|
|
269
|
+
return left;
|
|
270
|
+
}
|
|
271
|
+
primary() {
|
|
272
|
+
let token = this.tokens[0];
|
|
273
|
+
let primary;
|
|
274
|
+
if (this.expect("(")) {
|
|
275
|
+
primary = this.expression();
|
|
276
|
+
this.consume(")");
|
|
277
|
+
} else if (this.expect("[")) {
|
|
278
|
+
primary = this.array();
|
|
279
|
+
} else if (this.expect("{")) {
|
|
280
|
+
primary = this.object();
|
|
281
|
+
} else if (token.identifier && token.text in CONSTANTS) {
|
|
282
|
+
primary = CONSTANTS[this.consume().text];
|
|
283
|
+
} else if (token.identifier) {
|
|
284
|
+
primary = this.identifier();
|
|
285
|
+
} else if (token.constant) {
|
|
286
|
+
primary = this.constant();
|
|
287
|
+
} else {
|
|
288
|
+
throw new Error(`parse expression error: ${this.content}`);
|
|
289
|
+
}
|
|
290
|
+
let next;
|
|
291
|
+
let context;
|
|
292
|
+
while (next = this.expect("(") || this.expect("[") || this.expect(".")) {
|
|
293
|
+
if (next.text === "(") {
|
|
294
|
+
primary = this.functionCall(primary, context);
|
|
295
|
+
context = null;
|
|
296
|
+
} else if (next.text === "[") {
|
|
297
|
+
context = primary;
|
|
298
|
+
primary = this.objectIndex(primary);
|
|
299
|
+
} else {
|
|
300
|
+
context = primary;
|
|
301
|
+
primary = this.fieldAccess(primary);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return primary;
|
|
305
|
+
}
|
|
306
|
+
fieldAccess(object) {
|
|
307
|
+
let getter = this.identifier();
|
|
308
|
+
return data => {
|
|
309
|
+
let o = object(data);
|
|
310
|
+
return o && getter(o);
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
objectIndex(object) {
|
|
314
|
+
let indexFn = this.expression();
|
|
315
|
+
this.consume("]");
|
|
316
|
+
return data => {
|
|
317
|
+
let o = object(data);
|
|
318
|
+
let key = indexFn(data) + "";
|
|
319
|
+
return o && o[key];
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
functionCall(func, context) {
|
|
323
|
+
let args = [];
|
|
324
|
+
if (this.tokens[0].text !== ")") {
|
|
325
|
+
do {
|
|
326
|
+
args.push(this.expression());
|
|
327
|
+
} while (this.expect(","));
|
|
620
328
|
}
|
|
329
|
+
this.consume(")");
|
|
330
|
+
return data => {
|
|
331
|
+
let callContext = context && context(data);
|
|
332
|
+
let fn = func(data, callContext);
|
|
333
|
+
return fn && fn.apply(callContext, args.length ? args.map(arg => arg(data)) : null);
|
|
334
|
+
};
|
|
621
335
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var _h = _vm.$createElement;
|
|
631
|
-
var _c = _vm._self._c || _h;
|
|
632
|
-
return _c(
|
|
633
|
-
"a-select",
|
|
634
|
-
{
|
|
635
|
-
staticStyle: { width: "100%" },
|
|
636
|
-
attrs: { disabled: _vm.disabled, mode: _vm.getMode, value: _vm.value },
|
|
637
|
-
on: { change: _vm.onChange },
|
|
638
|
-
},
|
|
639
|
-
_vm._l(_vm.innerDataSource, function (item) {
|
|
640
|
-
return _c(
|
|
641
|
-
"a-select-option",
|
|
642
|
-
{ key: item.value, attrs: { value: item.value } },
|
|
643
|
-
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
644
|
-
)
|
|
645
|
-
}),
|
|
646
|
-
1
|
|
647
|
-
)
|
|
648
|
-
};
|
|
649
|
-
var __vue_staticRenderFns__$E = [];
|
|
650
|
-
__vue_render__$E._withStripped = true;
|
|
651
|
-
|
|
652
|
-
/* style */
|
|
653
|
-
const __vue_inject_styles__$E = function (inject) {
|
|
654
|
-
if (!inject) return
|
|
655
|
-
inject("data-v-dd210296_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
656
|
-
|
|
657
|
-
};
|
|
658
|
-
/* scoped */
|
|
659
|
-
const __vue_scope_id__$E = "data-v-dd210296";
|
|
660
|
-
/* module identifier */
|
|
661
|
-
const __vue_module_identifier__$E = undefined;
|
|
662
|
-
/* functional template */
|
|
663
|
-
const __vue_is_functional_template__$E = false;
|
|
664
|
-
/* style inject SSR */
|
|
665
|
-
|
|
666
|
-
/* style inject shadow dom */
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
const __vue_component__$E = /*#__PURE__*/normalizeComponent(
|
|
671
|
-
{ render: __vue_render__$E, staticRenderFns: __vue_staticRenderFns__$E },
|
|
672
|
-
__vue_inject_styles__$E,
|
|
673
|
-
__vue_script__$E,
|
|
674
|
-
__vue_scope_id__$E,
|
|
675
|
-
__vue_is_functional_template__$E,
|
|
676
|
-
__vue_module_identifier__$E,
|
|
677
|
-
false,
|
|
678
|
-
createInjector,
|
|
679
|
-
undefined,
|
|
680
|
-
undefined
|
|
681
|
-
);
|
|
682
|
-
|
|
683
|
-
__vue_component__$E.install = Vue => Vue.component(__vue_component__$E.name, __vue_component__$E);
|
|
684
|
-
|
|
685
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
686
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
687
|
-
// generators (like Math.random()).
|
|
688
|
-
let getRandomValues;
|
|
689
|
-
const rnds8 = new Uint8Array(16);
|
|
690
|
-
function rng() {
|
|
691
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
692
|
-
if (!getRandomValues) {
|
|
693
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
694
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
695
|
-
|
|
696
|
-
if (!getRandomValues) {
|
|
697
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
336
|
+
array() {
|
|
337
|
+
let elements = [];
|
|
338
|
+
let token = this.tokens[0];
|
|
339
|
+
if (token.text !== "]") {
|
|
340
|
+
do {
|
|
341
|
+
if (this.tokens[0].text === "]") break;
|
|
342
|
+
elements.push(this.expression());
|
|
343
|
+
} while (this.expect(","));
|
|
698
344
|
}
|
|
345
|
+
this.consume("]");
|
|
346
|
+
return data => elements.map(element => element(data));
|
|
699
347
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
if (!validate(uuid)) {
|
|
729
|
-
throw TypeError('Invalid UUID');
|
|
348
|
+
object() {
|
|
349
|
+
let keys = [];
|
|
350
|
+
let values = [];
|
|
351
|
+
let token = this.tokens[0];
|
|
352
|
+
if (token.text !== "}") {
|
|
353
|
+
do {
|
|
354
|
+
token = this.tokens[0];
|
|
355
|
+
if (token.text === "}") break;
|
|
356
|
+
token = this.consume();
|
|
357
|
+
if (token.constant) {
|
|
358
|
+
keys.push(token.value);
|
|
359
|
+
} else if (token.identifier) {
|
|
360
|
+
keys.push(token.text);
|
|
361
|
+
} else {
|
|
362
|
+
throw new Error(`parse expression error: ${this.content}`);
|
|
363
|
+
}
|
|
364
|
+
this.consume(":");
|
|
365
|
+
values.push(this.expression());
|
|
366
|
+
} while (this.expect(","));
|
|
367
|
+
}
|
|
368
|
+
this.consume("}");
|
|
369
|
+
return data => {
|
|
370
|
+
let object = {};
|
|
371
|
+
for (let i = 0, length = values.length; i < length; i++) {
|
|
372
|
+
object[keys[i]] = values[i](data);
|
|
373
|
+
}
|
|
374
|
+
return object;
|
|
375
|
+
};
|
|
730
376
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
function stringToBytes(str) {
|
|
760
|
-
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
761
|
-
|
|
762
|
-
const bytes = [];
|
|
763
|
-
|
|
764
|
-
for (let i = 0; i < str.length; ++i) {
|
|
765
|
-
bytes.push(str.charCodeAt(i));
|
|
377
|
+
identifier() {
|
|
378
|
+
let id = this.consume().text;
|
|
379
|
+
let token = this.tokens[0];
|
|
380
|
+
let token2 = this.tokens[1];
|
|
381
|
+
let token3 = this.tokens[2];
|
|
382
|
+
while (token && token.text === "." && token2 && token2.identifier && token3 && token3.text !== "(") {
|
|
383
|
+
id += this.consume().text + this.consume().text;
|
|
384
|
+
token = this.tokens[0];
|
|
385
|
+
token2 = this.tokens[1];
|
|
386
|
+
token3 = this.tokens[2];
|
|
387
|
+
}
|
|
388
|
+
return data => {
|
|
389
|
+
let elements = id.split(".");
|
|
390
|
+
let key;
|
|
391
|
+
for (let i = 0; elements.length > 1; i++) {
|
|
392
|
+
key = elements.shift();
|
|
393
|
+
data = data[key];
|
|
394
|
+
if (!data) break;
|
|
395
|
+
}
|
|
396
|
+
key = elements.shift();
|
|
397
|
+
return data && data[key];
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
constant() {
|
|
401
|
+
let value = this.consume().value;
|
|
402
|
+
return data => value;
|
|
766
403
|
}
|
|
767
|
-
|
|
768
|
-
return bytes;
|
|
769
404
|
}
|
|
405
|
+
const parse$1 = (expression, props = {}) => {
|
|
406
|
+
if (!expression) throw new Error("expression is required");
|
|
407
|
+
const execParse = new Expression(expression).parse();
|
|
408
|
+
return execParse(props);
|
|
409
|
+
};
|
|
770
410
|
|
|
771
|
-
const
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
411
|
+
const CONTEXT = '__idooel__ele__context__';
|
|
412
|
+
const AREA_NAMES = {
|
|
413
|
+
BUTTON_GROUP: 'BUTTON_GROUP'
|
|
414
|
+
};
|
|
415
|
+
const BUILT_IN_EVENT_NAMES = {
|
|
416
|
+
SUBMIT: 'submit',
|
|
417
|
+
CANCEL: 'cancel',
|
|
418
|
+
INCREASE: 'increase',
|
|
419
|
+
DELETE: 'delete',
|
|
420
|
+
NEXT: 'next',
|
|
421
|
+
PREVIOUS: 'previous',
|
|
422
|
+
// create, edit, view are reserved for table cru in the current version
|
|
423
|
+
CREATE: 'create',
|
|
424
|
+
EDIT: 'edit',
|
|
425
|
+
VIEW: 'view'
|
|
426
|
+
};
|
|
427
|
+
const BUILT_IN_METHODS_NAMES = {
|
|
428
|
+
CLOSE_MODAL: 'closeModal',
|
|
429
|
+
SUBMIT_FORM: 'submitForm',
|
|
430
|
+
//TODO: not use
|
|
431
|
+
REFRESH_TABLE: 'refreshTable',
|
|
432
|
+
CLEAN_EFFECT: 'cleanEffect'
|
|
433
|
+
};
|
|
434
|
+
const BUILT_IN_TRIGGER = {
|
|
435
|
+
// default it's not a trigger
|
|
436
|
+
TEXT: 'text',
|
|
437
|
+
//状态机触发器
|
|
438
|
+
FSM: 'fsm',
|
|
439
|
+
ELE_MODAL_FORM: 'ele-modal-form',
|
|
440
|
+
ELE_MODAL_TABLE: 'ele-modal-table'
|
|
441
|
+
};
|
|
442
|
+
const PAGE_STATUS = {
|
|
443
|
+
CREATE: 'create',
|
|
444
|
+
//TODO implement edit and view
|
|
445
|
+
EDIT: 'edit',
|
|
446
|
+
VIEW: 'view'
|
|
447
|
+
};
|
|
448
|
+
const RESERVE_EVENT_NAMES = {
|
|
449
|
+
//global event
|
|
450
|
+
INIT: 'init',
|
|
451
|
+
WATCH: 'watch',
|
|
452
|
+
//form event
|
|
453
|
+
WATCH_FORM_STATUS: 'watch-form-status',
|
|
454
|
+
INIT_FORM: 'init-form',
|
|
455
|
+
//table event
|
|
456
|
+
SEARCH: 'search',
|
|
457
|
+
TREE_CHANGE: 'tree-change'
|
|
458
|
+
};
|
|
459
|
+
const parseFieldMap = (fieldMap = {}, dataSource = {}) => {
|
|
460
|
+
let ret = {};
|
|
461
|
+
Object.keys(fieldMap).forEach(key => {
|
|
462
|
+
ret[fieldMap[key]] = parse$1(key, dataSource);
|
|
463
|
+
});
|
|
464
|
+
return ret;
|
|
465
|
+
};
|
|
776
466
|
|
|
777
|
-
|
|
778
|
-
|
|
467
|
+
//
|
|
468
|
+
var script$H = {
|
|
469
|
+
name: 'ele-button',
|
|
470
|
+
props: {
|
|
471
|
+
record: {
|
|
472
|
+
type: Object
|
|
473
|
+
},
|
|
474
|
+
eventName: {
|
|
475
|
+
type: String
|
|
476
|
+
},
|
|
477
|
+
mode: {
|
|
478
|
+
type: String
|
|
479
|
+
},
|
|
480
|
+
dataSource: {
|
|
481
|
+
type: Array,
|
|
482
|
+
default: () => []
|
|
483
|
+
},
|
|
484
|
+
type: {
|
|
485
|
+
type: String,
|
|
486
|
+
default: 'default'
|
|
487
|
+
},
|
|
488
|
+
icon: {
|
|
489
|
+
type: String
|
|
779
490
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
491
|
+
},
|
|
492
|
+
inject: {
|
|
493
|
+
[CONTEXT]: {
|
|
494
|
+
default: () => () => ({})
|
|
783
495
|
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
789
|
-
// hashfunc([...namespace, ... value])`
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
let bytes = new Uint8Array(16 + value.length);
|
|
793
|
-
bytes.set(namespace);
|
|
794
|
-
bytes.set(value, namespace.length);
|
|
795
|
-
bytes = hashfunc(bytes);
|
|
796
|
-
bytes[6] = bytes[6] & 0x0f | version;
|
|
797
|
-
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
798
|
-
|
|
799
|
-
if (buf) {
|
|
800
|
-
offset = offset || 0;
|
|
801
|
-
|
|
802
|
-
for (let i = 0; i < 16; ++i) {
|
|
803
|
-
buf[offset + i] = bytes[i];
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
return buf;
|
|
496
|
+
},
|
|
497
|
+
computed: {
|
|
498
|
+
callContext() {
|
|
499
|
+
return this[CONTEXT].call(this);
|
|
807
500
|
}
|
|
501
|
+
},
|
|
502
|
+
methods: {
|
|
503
|
+
handleMenuClick(props) {
|
|
504
|
+
const {
|
|
505
|
+
key
|
|
506
|
+
} = props;
|
|
507
|
+
const currentClickTarget = this.dataSource.find(item => item.value === key);
|
|
508
|
+
const {
|
|
509
|
+
eventName
|
|
510
|
+
} = currentClickTarget;
|
|
511
|
+
eventName && this.$emit(eventName, {
|
|
512
|
+
...currentClickTarget
|
|
513
|
+
});
|
|
514
|
+
},
|
|
515
|
+
handleClick() {
|
|
516
|
+
this.$emit(this.eventName || 'click', {
|
|
517
|
+
...this.record
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
};
|
|
808
522
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
523
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
524
|
+
if (typeof shadowMode !== 'boolean') {
|
|
525
|
+
createInjectorSSR = createInjector;
|
|
526
|
+
createInjector = shadowMode;
|
|
527
|
+
shadowMode = false;
|
|
528
|
+
}
|
|
529
|
+
// Vue.extend constructor export interop.
|
|
530
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
531
|
+
// render functions
|
|
532
|
+
if (template && template.render) {
|
|
533
|
+
options.render = template.render;
|
|
534
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
535
|
+
options._compiled = true;
|
|
536
|
+
// functional template
|
|
537
|
+
if (isFunctionalTemplate) {
|
|
538
|
+
options.functional = true;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
// scopedId
|
|
542
|
+
if (scopeId) {
|
|
543
|
+
options._scopeId = scopeId;
|
|
544
|
+
}
|
|
545
|
+
let hook;
|
|
546
|
+
if (moduleIdentifier) {
|
|
547
|
+
// server build
|
|
548
|
+
hook = function (context) {
|
|
549
|
+
// 2.3 injection
|
|
550
|
+
context =
|
|
551
|
+
context || // cached call
|
|
552
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
553
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
554
|
+
// 2.2 with runInNewContext: true
|
|
555
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
556
|
+
context = __VUE_SSR_CONTEXT__;
|
|
557
|
+
}
|
|
558
|
+
// inject component styles
|
|
559
|
+
if (style) {
|
|
560
|
+
style.call(this, createInjectorSSR(context));
|
|
561
|
+
}
|
|
562
|
+
// register component module identifier for async chunk inference
|
|
563
|
+
if (context && context._registeredComponents) {
|
|
564
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
// used by ssr in case component is cached and beforeCreate
|
|
568
|
+
// never gets called
|
|
569
|
+
options._ssrRegister = hook;
|
|
570
|
+
}
|
|
571
|
+
else if (style) {
|
|
572
|
+
hook = shadowMode
|
|
573
|
+
? function (context) {
|
|
574
|
+
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
575
|
+
}
|
|
576
|
+
: function (context) {
|
|
577
|
+
style.call(this, createInjector(context));
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
if (hook) {
|
|
581
|
+
if (options.functional) {
|
|
582
|
+
// register for functional component in vue file
|
|
583
|
+
const originalRender = options.render;
|
|
584
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
585
|
+
hook.call(context);
|
|
586
|
+
return originalRender(h, context);
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
// inject component registration as beforeCreate hook
|
|
591
|
+
const existing = options.beforeCreate;
|
|
592
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return script;
|
|
821
596
|
}
|
|
822
597
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
randomUUID
|
|
826
|
-
};
|
|
598
|
+
/* script */
|
|
599
|
+
const __vue_script__$H = script$H;
|
|
827
600
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
601
|
+
/* template */
|
|
602
|
+
var __vue_render__$H = function () {
|
|
603
|
+
var _vm = this;
|
|
604
|
+
var _h = _vm.$createElement;
|
|
605
|
+
var _c = _vm._self._c || _h;
|
|
606
|
+
return _vm.mode == "dropdown"
|
|
607
|
+
? _c(
|
|
608
|
+
"a-dropdown",
|
|
609
|
+
[
|
|
610
|
+
_c(
|
|
611
|
+
"a-menu",
|
|
612
|
+
{
|
|
613
|
+
attrs: { slot: "overlay" },
|
|
614
|
+
on: { click: _vm.handleMenuClick },
|
|
615
|
+
slot: "overlay",
|
|
616
|
+
},
|
|
617
|
+
_vm._l(_vm.dataSource, function (opt) {
|
|
618
|
+
return _c("a-menu-item", { key: opt.value }, [
|
|
619
|
+
_vm._v("\n " + _vm._s(opt.label) + "\n "),
|
|
620
|
+
])
|
|
621
|
+
}),
|
|
622
|
+
1
|
|
623
|
+
),
|
|
624
|
+
_vm._v(" "),
|
|
625
|
+
_c(
|
|
626
|
+
"a-button",
|
|
627
|
+
{ attrs: { type: _vm.type } },
|
|
628
|
+
[
|
|
629
|
+
_vm._t("default"),
|
|
630
|
+
_vm._v(" "),
|
|
631
|
+
_c("a-icon", { attrs: { type: _vm.icon } }),
|
|
632
|
+
],
|
|
633
|
+
2
|
|
634
|
+
),
|
|
635
|
+
],
|
|
636
|
+
1
|
|
637
|
+
)
|
|
638
|
+
: _c(
|
|
639
|
+
"a-button",
|
|
640
|
+
{
|
|
641
|
+
attrs: { type: _vm.type, icon: _vm.icon },
|
|
642
|
+
on: { click: _vm.handleClick },
|
|
643
|
+
},
|
|
644
|
+
[_vm._t("default")],
|
|
645
|
+
2
|
|
646
|
+
)
|
|
647
|
+
};
|
|
648
|
+
var __vue_staticRenderFns__$H = [];
|
|
649
|
+
__vue_render__$H._withStripped = true;
|
|
832
650
|
|
|
833
|
-
|
|
834
|
-
const
|
|
651
|
+
/* style */
|
|
652
|
+
const __vue_inject_styles__$H = undefined;
|
|
653
|
+
/* scoped */
|
|
654
|
+
const __vue_scope_id__$H = undefined;
|
|
655
|
+
/* module identifier */
|
|
656
|
+
const __vue_module_identifier__$H = undefined;
|
|
657
|
+
/* functional template */
|
|
658
|
+
const __vue_is_functional_template__$H = false;
|
|
659
|
+
/* style inject */
|
|
660
|
+
|
|
661
|
+
/* style inject SSR */
|
|
662
|
+
|
|
663
|
+
/* style inject shadow dom */
|
|
664
|
+
|
|
835
665
|
|
|
836
|
-
|
|
837
|
-
|
|
666
|
+
|
|
667
|
+
const __vue_component__$H = /*#__PURE__*/normalizeComponent(
|
|
668
|
+
{ render: __vue_render__$H, staticRenderFns: __vue_staticRenderFns__$H },
|
|
669
|
+
__vue_inject_styles__$H,
|
|
670
|
+
__vue_script__$H,
|
|
671
|
+
__vue_scope_id__$H,
|
|
672
|
+
__vue_is_functional_template__$H,
|
|
673
|
+
__vue_module_identifier__$H,
|
|
674
|
+
false,
|
|
675
|
+
undefined,
|
|
676
|
+
undefined,
|
|
677
|
+
undefined
|
|
678
|
+
);
|
|
838
679
|
|
|
839
|
-
|
|
840
|
-
offset = offset || 0;
|
|
680
|
+
__vue_component__$H.install = Vue => Vue.component(__vue_component__$H.name, __vue_component__$H);
|
|
841
681
|
|
|
842
|
-
|
|
843
|
-
|
|
682
|
+
//
|
|
683
|
+
var script$G = {
|
|
684
|
+
name: 'ele-date',
|
|
685
|
+
model: {
|
|
686
|
+
prop: 'value',
|
|
687
|
+
event: 'change'
|
|
688
|
+
},
|
|
689
|
+
props: {
|
|
690
|
+
value: {
|
|
691
|
+
type: [String, Object]
|
|
692
|
+
},
|
|
693
|
+
disabled: {
|
|
694
|
+
type: Boolean,
|
|
695
|
+
default: false
|
|
696
|
+
},
|
|
697
|
+
format: {
|
|
698
|
+
type: String,
|
|
699
|
+
default: 'YYYY/MM/DD'
|
|
700
|
+
},
|
|
701
|
+
mode: {
|
|
702
|
+
type: String
|
|
703
|
+
},
|
|
704
|
+
valueFormat: {
|
|
705
|
+
type: String
|
|
706
|
+
},
|
|
707
|
+
showTime: {
|
|
708
|
+
type: [Boolean, Object],
|
|
709
|
+
default: true
|
|
710
|
+
},
|
|
711
|
+
showToday: {
|
|
712
|
+
type: Boolean,
|
|
713
|
+
default: true
|
|
714
|
+
},
|
|
715
|
+
placeholder: {
|
|
716
|
+
type: String,
|
|
717
|
+
default: '请选择日期'
|
|
844
718
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
return x ^ y ^ z;
|
|
861
|
-
|
|
862
|
-
case 2:
|
|
863
|
-
return x & y ^ x & z ^ y & z;
|
|
864
|
-
|
|
865
|
-
case 3:
|
|
866
|
-
return x ^ y ^ z;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
function ROTL(x, n) {
|
|
871
|
-
return x << n | x >>> 32 - n;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
function sha1(bytes) {
|
|
875
|
-
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
876
|
-
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
877
|
-
|
|
878
|
-
if (typeof bytes === 'string') {
|
|
879
|
-
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
880
|
-
|
|
881
|
-
bytes = [];
|
|
882
|
-
|
|
883
|
-
for (let i = 0; i < msg.length; ++i) {
|
|
884
|
-
bytes.push(msg.charCodeAt(i));
|
|
719
|
+
},
|
|
720
|
+
data() {
|
|
721
|
+
return {
|
|
722
|
+
open: false
|
|
723
|
+
};
|
|
724
|
+
},
|
|
725
|
+
computed: {
|
|
726
|
+
innerValueFormat() {
|
|
727
|
+
if (this.valueFormat) return this.valueFormat;
|
|
728
|
+
return this.format;
|
|
729
|
+
},
|
|
730
|
+
modeValue() {
|
|
731
|
+
if (this.mode) return this.mode;
|
|
732
|
+
if (this.format === 'YYYY') return 'year';
|
|
733
|
+
return 'date';
|
|
885
734
|
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
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];
|
|
735
|
+
},
|
|
736
|
+
methods: {
|
|
737
|
+
onChange(_, dataString) {
|
|
738
|
+
this.$emit('input', dataString);
|
|
739
|
+
this.$emit('change', dataString);
|
|
740
|
+
},
|
|
741
|
+
onPanelChange(value, mode) {
|
|
742
|
+
if (this.modeValue !== 'year') return;
|
|
743
|
+
this.$emit('input', moment(value).format(this.format));
|
|
744
|
+
this.$emit('change', moment(value).format(this.format));
|
|
745
|
+
this.open = false;
|
|
746
|
+
},
|
|
747
|
+
openChange(open) {
|
|
748
|
+
this.open = open;
|
|
901
749
|
}
|
|
902
|
-
|
|
903
|
-
M[i] = arr;
|
|
904
750
|
}
|
|
751
|
+
};
|
|
905
752
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
753
|
+
const isOldIE = typeof navigator !== 'undefined' &&
|
|
754
|
+
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
755
|
+
function createInjector(context) {
|
|
756
|
+
return (id, style) => addStyle(id, style);
|
|
757
|
+
}
|
|
758
|
+
let HEAD;
|
|
759
|
+
const styles = {};
|
|
760
|
+
function addStyle(id, css) {
|
|
761
|
+
const group = isOldIE ? css.media || 'default' : id;
|
|
762
|
+
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
763
|
+
if (!style.ids.has(id)) {
|
|
764
|
+
style.ids.add(id);
|
|
765
|
+
let code = css.source;
|
|
766
|
+
if (css.map) {
|
|
767
|
+
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
768
|
+
// this makes source maps inside style tags work properly in Chrome
|
|
769
|
+
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
770
|
+
// http://stackoverflow.com/a/26603875
|
|
771
|
+
code +=
|
|
772
|
+
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
773
|
+
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
774
|
+
' */';
|
|
775
|
+
}
|
|
776
|
+
if (!style.element) {
|
|
777
|
+
style.element = document.createElement('style');
|
|
778
|
+
style.element.type = 'text/css';
|
|
779
|
+
if (css.media)
|
|
780
|
+
style.element.setAttribute('media', css.media);
|
|
781
|
+
if (HEAD === undefined) {
|
|
782
|
+
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
783
|
+
}
|
|
784
|
+
HEAD.appendChild(style.element);
|
|
785
|
+
}
|
|
786
|
+
if ('styleSheet' in style.element) {
|
|
787
|
+
style.styles.push(code);
|
|
788
|
+
style.element.styleSheet.cssText = style.styles
|
|
789
|
+
.filter(Boolean)
|
|
790
|
+
.join('\n');
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
const index = style.ids.size - 1;
|
|
794
|
+
const textNode = document.createTextNode(code);
|
|
795
|
+
const nodes = style.element.childNodes;
|
|
796
|
+
if (nodes[index])
|
|
797
|
+
style.element.removeChild(nodes[index]);
|
|
798
|
+
if (nodes.length)
|
|
799
|
+
style.element.insertBefore(textNode, nodes[index]);
|
|
800
|
+
else
|
|
801
|
+
style.element.appendChild(textNode);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
912
805
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
806
|
+
/* script */
|
|
807
|
+
const __vue_script__$G = script$G;
|
|
916
808
|
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
809
|
+
/* template */
|
|
810
|
+
var __vue_render__$G = function () {
|
|
811
|
+
var _vm = this;
|
|
812
|
+
var _h = _vm.$createElement;
|
|
813
|
+
var _c = _vm._self._c || _h;
|
|
814
|
+
return _c(
|
|
815
|
+
"div",
|
|
816
|
+
{ staticClass: "ele-date__wrapper" },
|
|
817
|
+
[
|
|
818
|
+
_vm.modeValue == "year"
|
|
819
|
+
? _c("a-date-picker", {
|
|
820
|
+
staticStyle: { width: "100%" },
|
|
821
|
+
attrs: {
|
|
822
|
+
mode: _vm.modeValue,
|
|
823
|
+
open: _vm.open,
|
|
824
|
+
disabled: _vm.disabled,
|
|
825
|
+
value: _vm.value,
|
|
826
|
+
placeholder: _vm.placeholder,
|
|
827
|
+
"show-time": _vm.showTime,
|
|
828
|
+
"show-today": _vm.showToday,
|
|
829
|
+
valueFormat: _vm.innerValueFormat,
|
|
830
|
+
format: _vm.format,
|
|
831
|
+
},
|
|
832
|
+
on: {
|
|
833
|
+
panelChange: _vm.onPanelChange,
|
|
834
|
+
openChange: _vm.openChange,
|
|
835
|
+
change: _vm.onChange,
|
|
836
|
+
},
|
|
837
|
+
})
|
|
838
|
+
: _c("a-date-picker", {
|
|
839
|
+
staticStyle: { width: "100%" },
|
|
840
|
+
attrs: {
|
|
841
|
+
placeholder: _vm.placeholder,
|
|
842
|
+
open: _vm.open,
|
|
843
|
+
disabled: _vm.disabled,
|
|
844
|
+
value: _vm.value,
|
|
845
|
+
"show-time": _vm.showTime,
|
|
846
|
+
"show-today": _vm.showToday,
|
|
847
|
+
valueFormat: _vm.innerValueFormat,
|
|
848
|
+
format: _vm.format,
|
|
849
|
+
},
|
|
850
|
+
on: {
|
|
851
|
+
panelChange: _vm.onPanelChange,
|
|
852
|
+
openChange: _vm.openChange,
|
|
853
|
+
change: _vm.onChange,
|
|
854
|
+
},
|
|
855
|
+
}),
|
|
856
|
+
],
|
|
857
|
+
1
|
|
858
|
+
)
|
|
859
|
+
};
|
|
860
|
+
var __vue_staticRenderFns__$G = [];
|
|
861
|
+
__vue_render__$G._withStripped = true;
|
|
920
862
|
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
let e = H[4];
|
|
863
|
+
/* style */
|
|
864
|
+
const __vue_inject_styles__$G = function (inject) {
|
|
865
|
+
if (!inject) return
|
|
866
|
+
inject("data-v-7716ba90_0", { source: ".ele-date__wrapper[data-v-7716ba90] {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/date/src/index.vue","index.vue"],"names":[],"mappings":"AA6GA;EACA,WAAA;AC5GA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-date__wrapper\">\n <a-date-picker \n style=\"width: 100%;\" \n :mode=\"modeValue\"\n v-if=\"modeValue == 'year'\"\n :open=\"open\"\n :disabled=\"disabled\"\n :value=\"value\"\n :placeholder=\"placeholder\"\n :show-time=\"showTime\"\n :show-today=\"showToday\"\n :valueFormat=\"innerValueFormat\"\n @panelChange=\"onPanelChange\"\n @openChange=\"openChange\"\n @change=\"onChange\"\n :format=\"format\">\n </a-date-picker>\n <a-date-picker \n v-else\n style=\"width: 100%;\"\n :placeholder=\"placeholder\"\n :open=\"open\"\n :disabled=\"disabled\"\n :value=\"value\"\n :show-time=\"showTime\"\n :show-today=\"showToday\"\n :valueFormat=\"innerValueFormat\"\n @panelChange=\"onPanelChange\"\n @openChange=\"openChange\"\n @change=\"onChange\"\n :format=\"format\">\n </a-date-picker>\n </div>\n</template>\n\n<script>\nimport moment from 'moment'\nexport default {\n name: 'ele-date',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: [String, Object]\n },\n disabled: {\n type: Boolean,\n default: false\n },\n format: {\n type: String,\n default: 'YYYY/MM/DD'\n },\n mode: {\n type: String\n },\n valueFormat: {\n type: String\n },\n showTime: {\n type: [Boolean, Object],\n default: true\n },\n showToday: {\n type: Boolean,\n default: true\n },\n placeholder: {\n type: String,\n default: '请选择日期'\n }\n },\n data () {\n return {\n open: false\n }\n },\n computed: {\n innerValueFormat () {\n if (this.valueFormat) return this.valueFormat\n return this.format\n },\n modeValue () {\n if (this.mode) return this.mode\n if (this.format === 'YYYY') return 'year'\n return 'date'\n }\n },\n methods: {\n onChange (_, dataString) {\n this.$emit('input', dataString)\n this.$emit('change', dataString)\n },\n onPanelChange (value, mode) {\n if (this.modeValue !== 'year') return\n this.$emit('input', moment(value).format(this.format))\n this.$emit('change', moment(value).format(this.format))\n this.open = false\n },\n openChange (open) {\n this.open = open\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.ele-date__wrapper {\n width: 100%;\n}\n</style>",".ele-date__wrapper {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
926
867
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
868
|
+
};
|
|
869
|
+
/* scoped */
|
|
870
|
+
const __vue_scope_id__$G = "data-v-7716ba90";
|
|
871
|
+
/* module identifier */
|
|
872
|
+
const __vue_module_identifier__$G = undefined;
|
|
873
|
+
/* functional template */
|
|
874
|
+
const __vue_is_functional_template__$G = false;
|
|
875
|
+
/* style inject SSR */
|
|
876
|
+
|
|
877
|
+
/* style inject shadow dom */
|
|
878
|
+
|
|
936
879
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
880
|
+
|
|
881
|
+
const __vue_component__$G = /*#__PURE__*/normalizeComponent(
|
|
882
|
+
{ render: __vue_render__$G, staticRenderFns: __vue_staticRenderFns__$G },
|
|
883
|
+
__vue_inject_styles__$G,
|
|
884
|
+
__vue_script__$G,
|
|
885
|
+
__vue_scope_id__$G,
|
|
886
|
+
__vue_is_functional_template__$G,
|
|
887
|
+
__vue_module_identifier__$G,
|
|
888
|
+
false,
|
|
889
|
+
createInjector,
|
|
890
|
+
undefined,
|
|
891
|
+
undefined
|
|
892
|
+
);
|
|
943
893
|
|
|
944
|
-
|
|
945
|
-
}
|
|
894
|
+
__vue_component__$G.install = Vue => Vue.component(__vue_component__$G.name, __vue_component__$G);
|
|
946
895
|
|
|
947
|
-
|
|
948
|
-
|
|
896
|
+
//
|
|
897
|
+
//
|
|
898
|
+
//
|
|
899
|
+
//
|
|
949
900
|
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
"/": (data, a, b) => a(data) / b(data),
|
|
968
|
-
"%": (data, a, b) => a(data) % b(data),
|
|
969
|
-
"===": (data, a, b) => a(data) === b(data),
|
|
970
|
-
"!==": (data, a, b) => a(data) !== b(data),
|
|
971
|
-
"==": (data, a, b) => a(data) == b(data),
|
|
972
|
-
"!=": (data, a, b) => a(data) != b(data),
|
|
973
|
-
"<": (data, a, b) => a(data) < b(data),
|
|
974
|
-
">": (data, a, b) => a(data) > b(data),
|
|
975
|
-
"<=": (data, a, b) => a(data) <= b(data),
|
|
976
|
-
">=": (data, a, b) => a(data) >= b(data),
|
|
977
|
-
"&&": (data, a, b) => a(data) && b(data),
|
|
978
|
-
"||": (data, a, b) => a(data) || b(data),
|
|
979
|
-
"!": (data, a) => !a(data)
|
|
980
|
-
};
|
|
981
|
-
function isNumber$1(char) {
|
|
982
|
-
return char >= "0" && char <= "9" && typeof char === "string";
|
|
983
|
-
}
|
|
984
|
-
function isExpOperator(char) {
|
|
985
|
-
return char === "-" || char === "+" || isNumber$1(char);
|
|
986
|
-
}
|
|
987
|
-
function isIdent(char) {
|
|
988
|
-
return char >= "a" && char <= "z" || char >= "A" && char <= "Z" || char === "_" || char === "$";
|
|
989
|
-
}
|
|
990
|
-
class Expression {
|
|
991
|
-
constructor(content) {
|
|
992
|
-
if (!content) throw new Error("invalid expression");
|
|
993
|
-
this.content = content;
|
|
994
|
-
}
|
|
995
|
-
lex() {
|
|
996
|
-
let content = this.content;
|
|
997
|
-
let length = content.length;
|
|
998
|
-
let index = 0;
|
|
999
|
-
let tokens = [];
|
|
1000
|
-
while (index < length) {
|
|
1001
|
-
let char = content.charAt(index);
|
|
1002
|
-
if (char === '"' || char === "'") {
|
|
1003
|
-
let start = ++index;
|
|
1004
|
-
let escape = false;
|
|
1005
|
-
let value = "";
|
|
1006
|
-
let token;
|
|
1007
|
-
while (index < length) {
|
|
1008
|
-
let c = content.charAt(index);
|
|
1009
|
-
if (escape) {
|
|
1010
|
-
if (c === "u") {
|
|
1011
|
-
let hex = content.substring(index + 1, index + 5);
|
|
1012
|
-
if (!hex.match(/[\da-f]{4}/i)) {
|
|
1013
|
-
throw new Error(`invalid expression: ${content}, invalid unicode escape [\\u${hex}]`);
|
|
1014
|
-
}
|
|
1015
|
-
index += 4;
|
|
1016
|
-
value += String.fromCharCode(parseInt(hex, 16));
|
|
1017
|
-
} else {
|
|
1018
|
-
let rep = ESCAPE[c];
|
|
1019
|
-
value = value + (rep || c);
|
|
1020
|
-
}
|
|
1021
|
-
escape = false;
|
|
1022
|
-
} else if (c === "\\") {
|
|
1023
|
-
escape = true;
|
|
1024
|
-
} else if (c === char) {
|
|
1025
|
-
index++;
|
|
1026
|
-
token = {
|
|
1027
|
-
index: start,
|
|
1028
|
-
constant: true,
|
|
1029
|
-
text: char + value + char,
|
|
1030
|
-
value
|
|
1031
|
-
};
|
|
1032
|
-
break;
|
|
1033
|
-
} else {
|
|
1034
|
-
value += c;
|
|
1035
|
-
}
|
|
1036
|
-
index++;
|
|
1037
|
-
}
|
|
1038
|
-
if (!token) {
|
|
1039
|
-
throw new Error(`invalid expression: ${content}`);
|
|
1040
|
-
} else {
|
|
1041
|
-
tokens.push(token);
|
|
1042
|
-
}
|
|
1043
|
-
} else if (isNumber$1(char) || char === "." && isNumber$1(content.charAt(index + 1))) {
|
|
1044
|
-
let start = index;
|
|
1045
|
-
let value = "";
|
|
1046
|
-
while (index < length) {
|
|
1047
|
-
let c = content.charAt(index).toLowerCase();
|
|
1048
|
-
if (c === "." || isNumber$1(c)) {
|
|
1049
|
-
value += c;
|
|
1050
|
-
} else {
|
|
1051
|
-
let c2 = content.charAt(index + 1);
|
|
1052
|
-
if (c === "e" && isExpOperator(c2)) {
|
|
1053
|
-
value += c;
|
|
1054
|
-
} else if (isExpOperator(c) && c2 && isNumber$1(c2) && value.charAt(value.length - 1) === "e") {
|
|
1055
|
-
value += c;
|
|
1056
|
-
} else if (isExpOperator(c) && (!c2 || !isNumber$1(c2)) && value.charAt(value.length - 1) == "e") {
|
|
1057
|
-
throw new Error(`invalid expression: ${content}`);
|
|
1058
|
-
} else {
|
|
1059
|
-
break;
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
index++;
|
|
1063
|
-
}
|
|
1064
|
-
tokens.push({
|
|
1065
|
-
index: start,
|
|
1066
|
-
constant: true,
|
|
1067
|
-
text: value,
|
|
1068
|
-
value: Number(value)
|
|
1069
|
-
});
|
|
1070
|
-
} else if (isIdent(char)) {
|
|
1071
|
-
let start = index;
|
|
1072
|
-
while (index < length) {
|
|
1073
|
-
let c = content.charAt(index);
|
|
1074
|
-
if (!(isIdent(c) || isNumber$1(c))) {
|
|
1075
|
-
break;
|
|
1076
|
-
}
|
|
1077
|
-
index++;
|
|
1078
|
-
}
|
|
1079
|
-
tokens.push({
|
|
1080
|
-
index: start,
|
|
1081
|
-
text: content.slice(start, index),
|
|
1082
|
-
identifier: true
|
|
1083
|
-
});
|
|
1084
|
-
} else if ("(){}[].,:?".indexOf(char) >= 0) {
|
|
1085
|
-
tokens.push({
|
|
1086
|
-
index,
|
|
1087
|
-
text: char
|
|
1088
|
-
});
|
|
1089
|
-
index++;
|
|
1090
|
-
} else if (char === " " || char === "\r" || char === " " || char === "\n" || char === "\v" || char === "\xA0") {
|
|
1091
|
-
index++;
|
|
1092
|
-
} else {
|
|
1093
|
-
let char2 = char + content.charAt(index + 1);
|
|
1094
|
-
let char3 = char2 + content.charAt(index + 2);
|
|
1095
|
-
let op1 = OPERATORS[char];
|
|
1096
|
-
let op2 = OPERATORS[char2];
|
|
1097
|
-
let op3 = OPERATORS[char3];
|
|
1098
|
-
if (op1 || op2 || op3) {
|
|
1099
|
-
let text = op3 ? char3 : op2 ? char2 : char;
|
|
1100
|
-
tokens.push({
|
|
1101
|
-
index,
|
|
1102
|
-
text,
|
|
1103
|
-
operator: true
|
|
1104
|
-
});
|
|
1105
|
-
index += text.length;
|
|
1106
|
-
} else {
|
|
1107
|
-
throw new Error(`invalid expression: ${content}`);
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
this.tokens = tokens;
|
|
1112
|
-
return tokens;
|
|
1113
|
-
}
|
|
1114
|
-
parse() {
|
|
1115
|
-
let tokens = this.lex();
|
|
1116
|
-
let func;
|
|
1117
|
-
let token = tokens[0];
|
|
1118
|
-
let text = token.text;
|
|
1119
|
-
if (tokens.length > 0 && text !== "}" && text !== ")" && text !== "]") {
|
|
1120
|
-
func = this.expression();
|
|
901
|
+
var script$F = {
|
|
902
|
+
name: 'ele-input',
|
|
903
|
+
model: {
|
|
904
|
+
prop: 'value',
|
|
905
|
+
event: 'change'
|
|
906
|
+
},
|
|
907
|
+
props: {
|
|
908
|
+
disabled: {
|
|
909
|
+
type: Boolean,
|
|
910
|
+
default: false
|
|
911
|
+
},
|
|
912
|
+
maxLength: {
|
|
913
|
+
type: Number,
|
|
914
|
+
default: 125
|
|
915
|
+
},
|
|
916
|
+
value: {
|
|
917
|
+
type: String
|
|
1121
918
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
if (!text || text === (token && token.text)) {
|
|
1128
|
-
return tokens.shift();
|
|
919
|
+
},
|
|
920
|
+
methods: {
|
|
921
|
+
onChange(e) {
|
|
922
|
+
this.$emit('change', e.target.value);
|
|
923
|
+
this.$emit('input', e.target.value);
|
|
1129
924
|
}
|
|
1130
925
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
/* script */
|
|
929
|
+
const __vue_script__$F = script$F;
|
|
930
|
+
|
|
931
|
+
/* template */
|
|
932
|
+
var __vue_render__$F = function () {
|
|
933
|
+
var _vm = this;
|
|
934
|
+
var _h = _vm.$createElement;
|
|
935
|
+
var _c = _vm._self._c || _h;
|
|
936
|
+
return _c("a-input", {
|
|
937
|
+
attrs: {
|
|
938
|
+
value: _vm.value,
|
|
939
|
+
disabled: _vm.disabled,
|
|
940
|
+
"max-length": _vm.maxLength,
|
|
941
|
+
},
|
|
942
|
+
on: { change: _vm.onChange },
|
|
943
|
+
})
|
|
944
|
+
};
|
|
945
|
+
var __vue_staticRenderFns__$F = [];
|
|
946
|
+
__vue_render__$F._withStripped = true;
|
|
947
|
+
|
|
948
|
+
/* style */
|
|
949
|
+
const __vue_inject_styles__$F = function (inject) {
|
|
950
|
+
if (!inject) return
|
|
951
|
+
inject("data-v-c04139c8_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", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
952
|
+
|
|
953
|
+
};
|
|
954
|
+
/* scoped */
|
|
955
|
+
const __vue_scope_id__$F = "data-v-c04139c8";
|
|
956
|
+
/* module identifier */
|
|
957
|
+
const __vue_module_identifier__$F = undefined;
|
|
958
|
+
/* functional template */
|
|
959
|
+
const __vue_is_functional_template__$F = false;
|
|
960
|
+
/* style inject SSR */
|
|
961
|
+
|
|
962
|
+
/* style inject shadow dom */
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
const __vue_component__$F = /*#__PURE__*/normalizeComponent(
|
|
967
|
+
{ render: __vue_render__$F, staticRenderFns: __vue_staticRenderFns__$F },
|
|
968
|
+
__vue_inject_styles__$F,
|
|
969
|
+
__vue_script__$F,
|
|
970
|
+
__vue_scope_id__$F,
|
|
971
|
+
__vue_is_functional_template__$F,
|
|
972
|
+
__vue_module_identifier__$F,
|
|
973
|
+
false,
|
|
974
|
+
createInjector,
|
|
975
|
+
undefined,
|
|
976
|
+
undefined
|
|
977
|
+
);
|
|
978
|
+
|
|
979
|
+
__vue_component__$F.install = Vue => Vue.component(__vue_component__$F.name, __vue_component__$F);
|
|
980
|
+
|
|
981
|
+
//
|
|
982
|
+
var script$E = {
|
|
983
|
+
name: 'ele-select',
|
|
984
|
+
props: {
|
|
985
|
+
init: {
|
|
986
|
+
type: Boolean,
|
|
987
|
+
default: false
|
|
988
|
+
},
|
|
989
|
+
disabled: {
|
|
990
|
+
type: Boolean,
|
|
991
|
+
default: false
|
|
992
|
+
},
|
|
993
|
+
value: {
|
|
994
|
+
type: [String, Array, Number]
|
|
995
|
+
},
|
|
996
|
+
defaultValue: {
|
|
997
|
+
type: [String, Array, Number]
|
|
998
|
+
},
|
|
999
|
+
dataSource: {
|
|
1000
|
+
type: Array,
|
|
1001
|
+
default: () => []
|
|
1002
|
+
},
|
|
1003
|
+
url: {
|
|
1004
|
+
type: String,
|
|
1005
|
+
default: 'api-basic/workbench/dicttype/enum/selectList'
|
|
1006
|
+
},
|
|
1007
|
+
code: {
|
|
1008
|
+
type: String
|
|
1009
|
+
},
|
|
1010
|
+
params: {
|
|
1011
|
+
type: Object,
|
|
1012
|
+
default: () => ({})
|
|
1013
|
+
},
|
|
1014
|
+
mode: {
|
|
1015
|
+
type: String
|
|
1016
|
+
},
|
|
1017
|
+
multiple: {
|
|
1018
|
+
type: Boolean,
|
|
1019
|
+
default: false
|
|
1147
1020
|
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1021
|
+
},
|
|
1022
|
+
data() {
|
|
1023
|
+
return {
|
|
1024
|
+
innerDataSource: []
|
|
1025
|
+
};
|
|
1026
|
+
},
|
|
1027
|
+
computed: {
|
|
1028
|
+
isInitRequest() {
|
|
1029
|
+
if (this.init) {
|
|
1030
|
+
return true;
|
|
1031
|
+
}
|
|
1032
|
+
if (this.code || !type.isEmpty(this.params)) {
|
|
1033
|
+
return true;
|
|
1034
|
+
}
|
|
1035
|
+
return false;
|
|
1036
|
+
},
|
|
1037
|
+
getMode() {
|
|
1038
|
+
if (this.multiple) {
|
|
1039
|
+
return 'multiple';
|
|
1040
|
+
}
|
|
1041
|
+
return this.mode;
|
|
1166
1042
|
}
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1043
|
+
},
|
|
1044
|
+
watch: {
|
|
1045
|
+
dataSource: {
|
|
1046
|
+
handler(dataSource) {
|
|
1047
|
+
this.innerDataSource = dataSource;
|
|
1048
|
+
},
|
|
1049
|
+
immediate: true
|
|
1173
1050
|
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1051
|
+
},
|
|
1052
|
+
created() {
|
|
1053
|
+
this.isInitRequest && this.fetchDataSourceByUrl();
|
|
1054
|
+
},
|
|
1055
|
+
methods: {
|
|
1056
|
+
fetchDataSourceByUrl() {
|
|
1057
|
+
net.get(this.url, {
|
|
1058
|
+
code: this.code,
|
|
1059
|
+
...this.params
|
|
1060
|
+
}).then(resp => {
|
|
1061
|
+
const {
|
|
1062
|
+
data
|
|
1063
|
+
} = resp;
|
|
1064
|
+
this.innerDataSource = data.map(item => {
|
|
1065
|
+
return {
|
|
1066
|
+
label: item.name,
|
|
1067
|
+
value: item.code
|
|
1068
|
+
};
|
|
1069
|
+
});
|
|
1070
|
+
});
|
|
1071
|
+
},
|
|
1072
|
+
onChange(value) {
|
|
1073
|
+
this.$emit('change', value);
|
|
1074
|
+
this.$emit('input', value);
|
|
1181
1075
|
}
|
|
1182
|
-
return left;
|
|
1183
1076
|
}
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
/* script */
|
|
1080
|
+
const __vue_script__$E = script$E;
|
|
1081
|
+
|
|
1082
|
+
/* template */
|
|
1083
|
+
var __vue_render__$E = function () {
|
|
1084
|
+
var _vm = this;
|
|
1085
|
+
var _h = _vm.$createElement;
|
|
1086
|
+
var _c = _vm._self._c || _h;
|
|
1087
|
+
return _c(
|
|
1088
|
+
"a-select",
|
|
1089
|
+
{
|
|
1090
|
+
staticStyle: { width: "100%" },
|
|
1091
|
+
attrs: { disabled: _vm.disabled, mode: _vm.getMode, value: _vm.value },
|
|
1092
|
+
on: { change: _vm.onChange },
|
|
1093
|
+
},
|
|
1094
|
+
_vm._l(_vm.innerDataSource, function (item) {
|
|
1095
|
+
return _c(
|
|
1096
|
+
"a-select-option",
|
|
1097
|
+
{ key: item.value, attrs: { value: item.value } },
|
|
1098
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
1099
|
+
)
|
|
1100
|
+
}),
|
|
1101
|
+
1
|
|
1102
|
+
)
|
|
1103
|
+
};
|
|
1104
|
+
var __vue_staticRenderFns__$E = [];
|
|
1105
|
+
__vue_render__$E._withStripped = true;
|
|
1106
|
+
|
|
1107
|
+
/* style */
|
|
1108
|
+
const __vue_inject_styles__$E = function (inject) {
|
|
1109
|
+
if (!inject) return
|
|
1110
|
+
inject("data-v-dd210296_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
1111
|
+
|
|
1112
|
+
};
|
|
1113
|
+
/* scoped */
|
|
1114
|
+
const __vue_scope_id__$E = "data-v-dd210296";
|
|
1115
|
+
/* module identifier */
|
|
1116
|
+
const __vue_module_identifier__$E = undefined;
|
|
1117
|
+
/* functional template */
|
|
1118
|
+
const __vue_is_functional_template__$E = false;
|
|
1119
|
+
/* style inject SSR */
|
|
1120
|
+
|
|
1121
|
+
/* style inject shadow dom */
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
const __vue_component__$E = /*#__PURE__*/normalizeComponent(
|
|
1126
|
+
{ render: __vue_render__$E, staticRenderFns: __vue_staticRenderFns__$E },
|
|
1127
|
+
__vue_inject_styles__$E,
|
|
1128
|
+
__vue_script__$E,
|
|
1129
|
+
__vue_scope_id__$E,
|
|
1130
|
+
__vue_is_functional_template__$E,
|
|
1131
|
+
__vue_module_identifier__$E,
|
|
1132
|
+
false,
|
|
1133
|
+
createInjector,
|
|
1134
|
+
undefined,
|
|
1135
|
+
undefined
|
|
1136
|
+
);
|
|
1137
|
+
|
|
1138
|
+
__vue_component__$E.install = Vue => Vue.component(__vue_component__$E.name, __vue_component__$E);
|
|
1139
|
+
|
|
1140
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
1141
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
1142
|
+
// generators (like Math.random()).
|
|
1143
|
+
let getRandomValues;
|
|
1144
|
+
const rnds8 = new Uint8Array(16);
|
|
1145
|
+
function rng() {
|
|
1146
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
1147
|
+
if (!getRandomValues) {
|
|
1148
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
1149
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
1150
|
+
|
|
1151
|
+
if (!getRandomValues) {
|
|
1152
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
1189
1153
|
}
|
|
1190
|
-
return left;
|
|
1191
1154
|
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1155
|
+
|
|
1156
|
+
return getRandomValues(rnds8);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
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;
|
|
1160
|
+
|
|
1161
|
+
function validate(uuid) {
|
|
1162
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
1167
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
1168
|
+
*/
|
|
1169
|
+
|
|
1170
|
+
const byteToHex = [];
|
|
1171
|
+
|
|
1172
|
+
for (let i = 0; i < 256; ++i) {
|
|
1173
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
function unsafeStringify(arr, offset = 0) {
|
|
1177
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
1178
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
1179
|
+
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]];
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
function parse(uuid) {
|
|
1183
|
+
if (!validate(uuid)) {
|
|
1184
|
+
throw TypeError('Invalid UUID');
|
|
1199
1185
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1186
|
+
|
|
1187
|
+
let v;
|
|
1188
|
+
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
1189
|
+
|
|
1190
|
+
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
1191
|
+
arr[1] = v >>> 16 & 0xff;
|
|
1192
|
+
arr[2] = v >>> 8 & 0xff;
|
|
1193
|
+
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
1194
|
+
|
|
1195
|
+
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
1196
|
+
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
1197
|
+
|
|
1198
|
+
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
1199
|
+
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
1200
|
+
|
|
1201
|
+
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
1202
|
+
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
1203
|
+
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
1204
|
+
|
|
1205
|
+
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
1206
|
+
arr[11] = v / 0x100000000 & 0xff;
|
|
1207
|
+
arr[12] = v >>> 24 & 0xff;
|
|
1208
|
+
arr[13] = v >>> 16 & 0xff;
|
|
1209
|
+
arr[14] = v >>> 8 & 0xff;
|
|
1210
|
+
arr[15] = v & 0xff;
|
|
1211
|
+
return arr;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
function stringToBytes(str) {
|
|
1215
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
1216
|
+
|
|
1217
|
+
const bytes = [];
|
|
1218
|
+
|
|
1219
|
+
for (let i = 0; i < str.length; ++i) {
|
|
1220
|
+
bytes.push(str.charCodeAt(i));
|
|
1207
1221
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1222
|
+
|
|
1223
|
+
return bytes;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
1227
|
+
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
1228
|
+
function v35(name, version, hashfunc) {
|
|
1229
|
+
function generateUUID(value, namespace, buf, offset) {
|
|
1230
|
+
var _namespace;
|
|
1231
|
+
|
|
1232
|
+
if (typeof value === 'string') {
|
|
1233
|
+
value = stringToBytes(value);
|
|
1213
1234
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
let token = this.tokens[0];
|
|
1218
|
-
let primary;
|
|
1219
|
-
if (this.expect("(")) {
|
|
1220
|
-
primary = this.expression();
|
|
1221
|
-
this.consume(")");
|
|
1222
|
-
} else if (this.expect("[")) {
|
|
1223
|
-
primary = this.array();
|
|
1224
|
-
} else if (this.expect("{")) {
|
|
1225
|
-
primary = this.object();
|
|
1226
|
-
} else if (token.identifier && token.text in CONSTANTS) {
|
|
1227
|
-
primary = CONSTANTS[this.consume().text];
|
|
1228
|
-
} else if (token.identifier) {
|
|
1229
|
-
primary = this.identifier();
|
|
1230
|
-
} else if (token.constant) {
|
|
1231
|
-
primary = this.constant();
|
|
1232
|
-
} else {
|
|
1233
|
-
throw new Error(`parse expression error: ${this.content}`);
|
|
1235
|
+
|
|
1236
|
+
if (typeof namespace === 'string') {
|
|
1237
|
+
namespace = parse(namespace);
|
|
1234
1238
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1239
|
+
|
|
1240
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
1241
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
1242
|
+
} // Compute hash of namespace and value, Per 4.3
|
|
1243
|
+
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
1244
|
+
// hashfunc([...namespace, ... value])`
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
let bytes = new Uint8Array(16 + value.length);
|
|
1248
|
+
bytes.set(namespace);
|
|
1249
|
+
bytes.set(value, namespace.length);
|
|
1250
|
+
bytes = hashfunc(bytes);
|
|
1251
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
1252
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
1253
|
+
|
|
1254
|
+
if (buf) {
|
|
1255
|
+
offset = offset || 0;
|
|
1256
|
+
|
|
1257
|
+
for (let i = 0; i < 16; ++i) {
|
|
1258
|
+
buf[offset + i] = bytes[i];
|
|
1247
1259
|
}
|
|
1260
|
+
|
|
1261
|
+
return buf;
|
|
1248
1262
|
}
|
|
1249
|
-
|
|
1263
|
+
|
|
1264
|
+
return unsafeStringify(bytes);
|
|
1265
|
+
} // Function#name is not settable on some platforms (#270)
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
try {
|
|
1269
|
+
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
1270
|
+
} catch (err) {} // For CommonJS default export support
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
generateUUID.DNS = DNS;
|
|
1274
|
+
generateUUID.URL = URL;
|
|
1275
|
+
return generateUUID;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1279
|
+
var native = {
|
|
1280
|
+
randomUUID
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1283
|
+
function v4(options, buf, offset) {
|
|
1284
|
+
if (native.randomUUID && !buf && !options) {
|
|
1285
|
+
return native.randomUUID();
|
|
1250
1286
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1287
|
+
|
|
1288
|
+
options = options || {};
|
|
1289
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
1290
|
+
|
|
1291
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
1292
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
1293
|
+
|
|
1294
|
+
if (buf) {
|
|
1295
|
+
offset = offset || 0;
|
|
1296
|
+
|
|
1297
|
+
for (let i = 0; i < 16; ++i) {
|
|
1298
|
+
buf[offset + i] = rnds[i];
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
return buf;
|
|
1257
1302
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1303
|
+
|
|
1304
|
+
return unsafeStringify(rnds);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
1308
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
1309
|
+
function f(s, x, y, z) {
|
|
1310
|
+
switch (s) {
|
|
1311
|
+
case 0:
|
|
1312
|
+
return x & y ^ ~x & z;
|
|
1313
|
+
|
|
1314
|
+
case 1:
|
|
1315
|
+
return x ^ y ^ z;
|
|
1316
|
+
|
|
1317
|
+
case 2:
|
|
1318
|
+
return x & y ^ x & z ^ y & z;
|
|
1319
|
+
|
|
1320
|
+
case 3:
|
|
1321
|
+
return x ^ y ^ z;
|
|
1266
1322
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
function ROTL(x, n) {
|
|
1326
|
+
return x << n | x >>> 32 - n;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
function sha1(bytes) {
|
|
1330
|
+
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
1331
|
+
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
1332
|
+
|
|
1333
|
+
if (typeof bytes === 'string') {
|
|
1334
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
1335
|
+
|
|
1336
|
+
bytes = [];
|
|
1337
|
+
|
|
1338
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
1339
|
+
bytes.push(msg.charCodeAt(i));
|
|
1273
1340
|
}
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
let fn = func(data, callContext);
|
|
1278
|
-
return fn && fn.apply(callContext, args.length ? args.map(arg => arg(data)) : null);
|
|
1279
|
-
};
|
|
1341
|
+
} else if (!Array.isArray(bytes)) {
|
|
1342
|
+
// Convert Array-like to Array
|
|
1343
|
+
bytes = Array.prototype.slice.call(bytes);
|
|
1280
1344
|
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1345
|
+
|
|
1346
|
+
bytes.push(0x80);
|
|
1347
|
+
const l = bytes.length / 4 + 2;
|
|
1348
|
+
const N = Math.ceil(l / 16);
|
|
1349
|
+
const M = new Array(N);
|
|
1350
|
+
|
|
1351
|
+
for (let i = 0; i < N; ++i) {
|
|
1352
|
+
const arr = new Uint32Array(16);
|
|
1353
|
+
|
|
1354
|
+
for (let j = 0; j < 16; ++j) {
|
|
1355
|
+
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];
|
|
1289
1356
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1357
|
+
|
|
1358
|
+
M[i] = arr;
|
|
1292
1359
|
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
keys.push(token.value);
|
|
1304
|
-
} else if (token.identifier) {
|
|
1305
|
-
keys.push(token.text);
|
|
1306
|
-
} else {
|
|
1307
|
-
throw new Error(`parse expression error: ${this.content}`);
|
|
1308
|
-
}
|
|
1309
|
-
this.consume(":");
|
|
1310
|
-
values.push(this.expression());
|
|
1311
|
-
} while (this.expect(","));
|
|
1360
|
+
|
|
1361
|
+
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
1362
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
1363
|
+
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
1364
|
+
|
|
1365
|
+
for (let i = 0; i < N; ++i) {
|
|
1366
|
+
const W = new Uint32Array(80);
|
|
1367
|
+
|
|
1368
|
+
for (let t = 0; t < 16; ++t) {
|
|
1369
|
+
W[t] = M[i][t];
|
|
1312
1370
|
}
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
for (let i = 0, length = values.length; i < length; i++) {
|
|
1317
|
-
object[keys[i]] = values[i](data);
|
|
1318
|
-
}
|
|
1319
|
-
return object;
|
|
1320
|
-
};
|
|
1321
|
-
}
|
|
1322
|
-
identifier() {
|
|
1323
|
-
let id = this.consume().text;
|
|
1324
|
-
let token = this.tokens[0];
|
|
1325
|
-
let token2 = this.tokens[1];
|
|
1326
|
-
let token3 = this.tokens[2];
|
|
1327
|
-
while (token && token.text === "." && token2 && token2.identifier && token3 && token3.text !== "(") {
|
|
1328
|
-
id += this.consume().text + this.consume().text;
|
|
1329
|
-
token = this.tokens[0];
|
|
1330
|
-
token2 = this.tokens[1];
|
|
1331
|
-
token3 = this.tokens[2];
|
|
1371
|
+
|
|
1372
|
+
for (let t = 16; t < 80; ++t) {
|
|
1373
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
1332
1374
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1375
|
+
|
|
1376
|
+
let a = H[0];
|
|
1377
|
+
let b = H[1];
|
|
1378
|
+
let c = H[2];
|
|
1379
|
+
let d = H[3];
|
|
1380
|
+
let e = H[4];
|
|
1381
|
+
|
|
1382
|
+
for (let t = 0; t < 80; ++t) {
|
|
1383
|
+
const s = Math.floor(t / 20);
|
|
1384
|
+
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
1385
|
+
e = d;
|
|
1386
|
+
d = c;
|
|
1387
|
+
c = ROTL(b, 30) >>> 0;
|
|
1388
|
+
b = a;
|
|
1389
|
+
a = T;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
H[0] = H[0] + a >>> 0;
|
|
1393
|
+
H[1] = H[1] + b >>> 0;
|
|
1394
|
+
H[2] = H[2] + c >>> 0;
|
|
1395
|
+
H[3] = H[3] + d >>> 0;
|
|
1396
|
+
H[4] = H[4] + e >>> 0;
|
|
1348
1397
|
}
|
|
1398
|
+
|
|
1399
|
+
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];
|
|
1349
1400
|
}
|
|
1350
|
-
const parse = (expression, props = {}) => {
|
|
1351
|
-
if (!expression) throw new Error("expression is required");
|
|
1352
|
-
const execParse = new Expression(expression).parse();
|
|
1353
|
-
return execParse(props);
|
|
1354
|
-
};
|
|
1355
1401
|
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1358
|
-
BUTTON_GROUP: 'BUTTON_GROUP'
|
|
1359
|
-
};
|
|
1360
|
-
const BUILT_IN_EVENT_NAMES = {
|
|
1361
|
-
SUBMIT: 'submit',
|
|
1362
|
-
CANCEL: 'cancel',
|
|
1363
|
-
INCREASE: 'increase',
|
|
1364
|
-
DELETE: 'delete',
|
|
1365
|
-
NEXT: 'next',
|
|
1366
|
-
PREVIOUS: 'previous',
|
|
1367
|
-
// create, edit, view are reserved for table cru in the current version
|
|
1368
|
-
CREATE: 'create',
|
|
1369
|
-
EDIT: 'edit',
|
|
1370
|
-
VIEW: 'view'
|
|
1371
|
-
};
|
|
1372
|
-
const BUILT_IN_METHODS_NAMES = {
|
|
1373
|
-
CLOSE_MODAL: 'closeModal',
|
|
1374
|
-
SUBMIT_FORM: 'submitForm',
|
|
1375
|
-
//TODO: not use
|
|
1376
|
-
REFRESH_TABLE: 'refreshTable',
|
|
1377
|
-
CLEAN_EFFECT: 'cleanEffect'
|
|
1378
|
-
};
|
|
1379
|
-
const BUILT_IN_TRIGGER = {
|
|
1380
|
-
// default it's not a trigger
|
|
1381
|
-
TEXT: 'text',
|
|
1382
|
-
//状态机触发器
|
|
1383
|
-
FSM: 'fsm',
|
|
1384
|
-
ELE_MODAL_FORM: 'ele-modal-form',
|
|
1385
|
-
ELE_MODAL_TABLE: 'ele-modal-table'
|
|
1386
|
-
};
|
|
1387
|
-
const PAGE_STATUS = {
|
|
1388
|
-
CREATE: 'create',
|
|
1389
|
-
//TODO implement edit and view
|
|
1390
|
-
EDIT: 'edit',
|
|
1391
|
-
VIEW: 'view'
|
|
1392
|
-
};
|
|
1393
|
-
const RESERVE_EVENT_NAMES = {
|
|
1394
|
-
//global event
|
|
1395
|
-
INIT: 'init',
|
|
1396
|
-
WATCH: 'watch',
|
|
1397
|
-
//form event
|
|
1398
|
-
WATCH_FORM_STATUS: 'watch-form-status',
|
|
1399
|
-
INIT_FORM: 'init-form',
|
|
1400
|
-
//table event
|
|
1401
|
-
SEARCH: 'search',
|
|
1402
|
-
TREE_CHANGE: 'tree-change'
|
|
1403
|
-
};
|
|
1404
|
-
const parseFieldMap = (fieldMap = {}, dataSource = {}) => {
|
|
1405
|
-
let ret = {};
|
|
1406
|
-
Object.keys(fieldMap).forEach(key => {
|
|
1407
|
-
ret[fieldMap[key]] = parse(key, dataSource);
|
|
1408
|
-
});
|
|
1409
|
-
return ret;
|
|
1410
|
-
};
|
|
1402
|
+
const v5 = v35('v5', 0x50, sha1);
|
|
1403
|
+
var uuidv5 = v5;
|
|
1411
1404
|
|
|
1412
1405
|
//
|
|
1413
1406
|
const MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002';
|
|
@@ -1477,7 +1470,7 @@ var script$D = {
|
|
|
1477
1470
|
} else if (type.isBool(show)) {
|
|
1478
1471
|
if (show) return item;
|
|
1479
1472
|
} else if (type.isStr(show)) {
|
|
1480
|
-
const parseRet = parse(show, {
|
|
1473
|
+
const parseRet = parse$1(show, {
|
|
1481
1474
|
...this.record,
|
|
1482
1475
|
_route: route.searchToQueryParams(window.location.search)
|
|
1483
1476
|
});
|
|
@@ -1828,9 +1821,6 @@ var script$C = {
|
|
|
1828
1821
|
},
|
|
1829
1822
|
getScrollHeightByHeight() {
|
|
1830
1823
|
const height = this.height - this.tableHeaderHeight - this.paginationHeight;
|
|
1831
|
-
console.log('this.height', this.height);
|
|
1832
|
-
console.log('height', height);
|
|
1833
|
-
console.log('this.tableTbodyHeight', this.tableTbodyHeight);
|
|
1834
1824
|
if (this.tableTbodyHeight == 0) {
|
|
1835
1825
|
//暂无数据
|
|
1836
1826
|
document.querySelector('.ant-table-body') && (document.querySelector('.ant-table-body').style.height = 'auto');
|
|
@@ -2014,11 +2004,11 @@ __vue_render__$C._withStripped = true;
|
|
|
2014
2004
|
/* style */
|
|
2015
2005
|
const __vue_inject_styles__$C = function (inject) {
|
|
2016
2006
|
if (!inject) return
|
|
2017
|
-
inject("data-v-59d46d0d_0", { source: ".g-table__wrapper[data-v-59d46d0d] {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper[data-v-59d46d0d] .ant-spin-nested-loading {\n height: inherit;\n}\n.g-table__wrapper[data-v-59d46d0d] .ant-spin-nested-loading .ant-table-fixed-header .ant-table-body-inner {\n overflow: hidden;\n}\n.g-table__wrapper[data-v-59d46d0d] .ant-spin-nested-loading .ant-spin-container {\n height: inherit;\n}\n.g-table__wrapper[data-v-59d46d0d] .ant-spin-nested-loading .ant-spin-container .ant-table {\n height: inherit;\n}\n.g-table__wrapper[data-v-59d46d0d] .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-59d46d0d] .ant-table-wrapper .ant-table-header .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n}\n.g-table__wrapper[data-v-59d46d0d] .ant-table-wrapper .ant-table-header tr th {\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-59d46d0d] .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-59d46d0d] .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-59d46d0d] .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-59d46d0d] .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-59d46d0d] .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-59d46d0d] .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-59d46d0d] .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[data-v-59d46d0d] .g-table__row--even {\n background: var(--idooel-row-even-color);\n}\n.g-table__wrapper .g-table__row--odd[data-v-59d46d0d] {\n background: var(--idooel-row-odd-color);\n}\n.g-table__wrapper .g-table__pagination[data-v-59d46d0d] {\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 position: relative;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/table/src/index.vue","index.vue"],"names":[],"mappings":"AA8NA;EA8FA,aAAA;EACA,kBAAA;AC1TA;AD4NA;EACA,eAAA;AC1NA;AD4NA;EACA,gBAAA;AC1NA;AD6NA;EACA,eAAA;AC3NA;AD4NA;EACA,eAAA;AC1NA;ADwOA;EACA,oDAAA;EACA,mBAAA;EACA,wCAAA;ACtOA;ADyOA;EACA,iDAAA;ACvOA;AD0OA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;ACxOA;AD8OA;EACA,+CAAA;EACA,2DAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;AC5OA;ADqPA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;ACnPA;ADoPA;EACA,iEAAA;EACA,gCAAA;EACA,qDAAA;AClPA;ADoPA;EACA,0DAAA;EACA,yBAAA;EACA,8CAAA;AClPA;ADoPA;EACA,0DAAA;EACA,8CAAA;EACA,yBAAA;AClPA;ADsPA;EACA,iEAAA;EACA,qDAAA;EACA,gCAAA;ACpPA;ADyPA;EACA,yDAAA;EACA,wBAAA;EACA,6CAAA;ACvPA;AD6PA;EACA,wCAAA;AC3PA;AD6PA;EACA,uCAAA;AC3PA;AD6PA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,oDAAA;EACA,wCAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,kBAAA;EACA,YAAA;AC3PA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-table__wrapper\" :style=\"{ height: `${height}px` }\">\n <a-table\n :bordered=\"bordered\"\n :class=\"[isNoData && 'g-table__no-data']\"\n :style=\"{ height: noDataAntTableHeight }\"\n :pagination=\"false\"\n :loading=\"loading\"\n :columns=\"innerColumns\"\n :row-selection=\"rowSelection\"\n :row-class-name=\"setRowClassName\"\n :data-source=\"dataSource\"\n :scroll=\"getScroll\">\n <template slot=\"action\" slot-scope=\"record\">\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\n </template>\n </a-table>\n <div class=\"g-table__pagination\">\n <a-pagination\n :show-total=\"all => `共 ${all} 条数据`\"\n show-size-changer \n show-quick-jumper\n :pageSize=\"innerPageSize\"\n :current=\"innerCurrentPage\"\n :pageSizeOptions=\"pageSizeOptions\"\n @change=\"onChangePagination\"\n @showSizeChange=\"onShowSizeChange\"\n :total=\"total\">\n </a-pagination>\n </div>\n </div>\n</template>\n\n<script>\nimport Actions from './action.vue'\nexport default {\n name: 'ele-table',\n components: {\n Actions\n },\n props: {\n // ant table wrapper\n height: {\n type: Number\n },\n width: {\n type: Number\n },\n x: {\n type: Number,\n default: 1200\n },\n y: {\n type: Number,\n default: 200\n },\n scroll: {\n type: Object\n },\n rowSelection: {\n type: Object\n },\n actions: {\n type: Array,\n default: () => []\n },\n total: {\n type: Number,\n default: 0\n },\n loading: {\n type: Boolean,\n default: false\n },\n columns: {\n type: Array,\n default: () => []\n },\n dataSource: {\n type: Array,\n default: () => []\n },\n pageSize: {\n type: Number,\n default: 10\n },\n pageSizeOptions: {\n type: Array,\n default: () => ['10', '20', '30', '40']\n },\n bordered: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n tableHeaderHeight: 0,\n paginationHeight: 0,\n innerPageSize: 10,\n innerCurrentPage: 1,\n tableContentHeight: 0,\n obs: [],\n tableTbodyHeight: 0\n }\n },\n computed: {\n innerColumns () {\n return this.columns.filter(col => !Object.keys(col).includes('multiple'))\n },\n isNoData () {\n return !this.dataSource.length\n },\n noDataAntTableHeight () {\n //TODO\n if (this.dataSource.length) {\n // return 'auto'\n return `${this.height - this.paginationHeight - 16}px` \n }\n return `${this.height - this.paginationHeight - 16}px` \n },\n getScrollHeightByHeight () {\n const height = this.height - this.tableHeaderHeight - this.paginationHeight\n console.log('this.height', this.height)\n console.log('height', height)\n console.log('this.tableTbodyHeight', this.tableTbodyHeight)\n if (this.tableTbodyHeight == 0) {\n //暂无数据\n document.querySelector('.ant-table-body') && (document.querySelector('.ant-table-body').style.height = 'auto')\n } else if (this.tableTbodyHeight !== 0 && height > this.tableTbodyHeight) {\n document.querySelector('.ant-table-content') && (document.querySelector('.ant-table-content').style.height = 'inherit')\n document.querySelector('.ant-table-scroll') && (document.querySelector('.ant-table-scroll').style.height = 'inherit')\n document.querySelector('.ant-table-body') && (document.querySelector('.ant-table-body').style.height = 'inherit')\n if (this.tableTbodyHeight > height) {\n document.querySelector('.ant-table-content').style.height = 'auto'\n document.querySelector('.ant-table-scroll').style.height = 'auto'\n document.querySelector('.ant-table-body').style.height = 'auto'\n }\n return 0\n // 0的时候没有y滚动条\n }\n return this.height - this.tableHeaderHeight - this.paginationHeight\n },\n isFlexColumn () {\n return this.columns.every(col => !col.width)\n },\n getScroll () {\n if (this.scroll) {\n return this.scroll\n } else {\n if (this.height) {\n return { x: this.isFlexColumn ? 0 : this.width > this.x ? 0 : this.x, y: this.getScrollHeightByHeight }\n }\n return { x: this.isFlexColumn ? 0 : this.width > this.x ? 0 : this.x, y: this.y }\n }\n }\n },\n watch: {\n pageSize: {\n handler (pageSize) {\n this.innerPageSize = pageSize\n },\n immediate: true\n }\n },\n methods: {\n onShowSizeChange (current, pageSize) {\n this.innerCurrentPage = current\n this.innerPageSize = pageSize\n this.$emit('change-page', current, pageSize)\n },\n setPaginationHeight () {\n this.$nextTick(() => {\n const { height } = document.querySelector('.g-table__pagination').getBoundingClientRect()\n this.paginationHeight = height\n })\n },\n setTableHeaderHeight () {\n this.$nextTick(() => {\n const el = document.querySelector('.ant-table-header')\n if (!el) return\n const { height } = el.getBoundingClientRect()\n this.tableHeaderHeight = height\n })\n },\n setTableTbodyHeight () {\n const el = document.querySelector('table .ant-table-tbody')\n const ob = new ResizeObserver((entries => {\n if (this.tableHeaderHeight) return\n for (const _ of entries) {\n requestAnimationFrame(() => {\n const { height } = el.getBoundingClientRect()\n this.tableTbodyHeight = height\n this.setTableHeaderHeight()\n })\n }\n }))\n ob.observe(el)\n this.obs.push(ob)\n },\n setRowClassName (record, idx) {\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\n },\n onChangePagination (page, pageSize) {\n this.innerCurrentPage = page\n this.innerPageSize = pageSize\n this.$emit('change-page', page, pageSize)\n }\n },\n mounted() {\n this.setPaginationHeight()\n setTimeout(() => {\n this.setTableTbodyHeight()\n }, 100)\n },\n destroyed () {\n this.obs.forEach(ob => ob.disconnect())\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-table__wrapper {\n ::v-deep .ant-spin-nested-loading {\n height: inherit;\n .ant-table-fixed-header {\n .ant-table-body-inner {\n overflow: hidden;\n }\n }\n .ant-spin-container {\n height: inherit;\n .ant-table {\n height: inherit;\n .ant-table-content {\n // height: inherit;\n // .ant-table-scroll {\n // height: inherit;\n // .ant-table-body {\n // height: inherit;\n // }\n // }\n }\n }\n }\n }\n ::v-deep .ant-table-wrapper {\n .ant-table {\n border-width: calc(var(--idooel-border-width) * 1px);\n border-style: solid;\n border-color: var(--idooel-border-color);\n }\n .ant-table-header {\n .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n }\n tr {\n th {\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 }\n }\n .ant-table-tbody {\n tr {\n 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 }\n }\n .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 .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 .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 .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 .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 }\n .ant-table-fixed-right {\n .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 // border-bottom-width: calc(var(--idooel-border-width) * 1px);\n // border-bottom-style: solid;\n // border-bottom-color: var(--idooel-border-color);\n .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 }\n }\n padding: 16px;\n padding-top: unset;\n ::v-deep .g-table__row--even {\n background: var(--idooel-row-even-color);\n }\n .g-table__row--odd {\n background: var(--idooel-row-odd-color);\n }\n .g-table__pagination {\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 position: relative;\n z-index: 999;\n }\n}\n</style>",".g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading {\n height: inherit;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading .ant-table-fixed-header .ant-table-body-inner {\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading .ant-spin-container {\n height: inherit;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading .ant-spin-container .ant-table {\n height: inherit;\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-header tr th {\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-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-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 .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 ::v-deep .g-table__row--even {\n background: var(--idooel-row-even-color);\n}\n.g-table__wrapper .g-table__row--odd {\n background: var(--idooel-row-odd-color);\n}\n.g-table__wrapper .g-table__pagination {\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 position: relative;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2007
|
+
inject("data-v-74aaea06_0", { source: ".g-table__wrapper[data-v-74aaea06] {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper[data-v-74aaea06] .ant-spin-nested-loading {\n height: inherit;\n}\n.g-table__wrapper[data-v-74aaea06] .ant-spin-nested-loading .ant-table-fixed-header .ant-table-body-inner {\n overflow: hidden;\n}\n.g-table__wrapper[data-v-74aaea06] .ant-spin-nested-loading .ant-spin-container {\n height: inherit;\n}\n.g-table__wrapper[data-v-74aaea06] .ant-spin-nested-loading .ant-spin-container .ant-table {\n height: inherit;\n}\n.g-table__wrapper[data-v-74aaea06] .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-74aaea06] .ant-table-wrapper .ant-table-header .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n}\n.g-table__wrapper[data-v-74aaea06] .ant-table-wrapper .ant-table-header tr th {\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-74aaea06] .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-74aaea06] .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-74aaea06] .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-74aaea06] .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-74aaea06] .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-74aaea06] .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-74aaea06] .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[data-v-74aaea06] .g-table__row--even {\n background: var(--idooel-row-even-color);\n}\n.g-table__wrapper .g-table__row--odd[data-v-74aaea06] {\n background: var(--idooel-row-odd-color);\n}\n.g-table__wrapper .g-table__pagination[data-v-74aaea06] {\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 position: relative;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/table/src/index.vue","index.vue"],"names":[],"mappings":"AA2NA;EA8FA,aAAA;EACA,kBAAA;ACvTA;ADyNA;EACA,eAAA;ACvNA;ADyNA;EACA,gBAAA;ACvNA;AD0NA;EACA,eAAA;ACxNA;ADyNA;EACA,eAAA;ACvNA;ADqOA;EACA,oDAAA;EACA,mBAAA;EACA,wCAAA;ACnOA;ADsOA;EACA,iDAAA;ACpOA;ADuOA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;ACrOA;AD2OA;EACA,+CAAA;EACA,2DAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;ACzOA;ADkPA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;AChPA;ADiPA;EACA,iEAAA;EACA,gCAAA;EACA,qDAAA;AC/OA;ADiPA;EACA,0DAAA;EACA,yBAAA;EACA,8CAAA;AC/OA;ADiPA;EACA,0DAAA;EACA,8CAAA;EACA,yBAAA;AC/OA;ADmPA;EACA,iEAAA;EACA,qDAAA;EACA,gCAAA;ACjPA;ADsPA;EACA,yDAAA;EACA,wBAAA;EACA,6CAAA;ACpPA;AD0PA;EACA,wCAAA;ACxPA;AD0PA;EACA,uCAAA;ACxPA;AD0PA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,oDAAA;EACA,wCAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,kBAAA;EACA,YAAA;ACxPA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-table__wrapper\" :style=\"{ height: `${height}px` }\">\n <a-table\n :bordered=\"bordered\"\n :class=\"[isNoData && 'g-table__no-data']\"\n :style=\"{ height: noDataAntTableHeight }\"\n :pagination=\"false\"\n :loading=\"loading\"\n :columns=\"innerColumns\"\n :row-selection=\"rowSelection\"\n :row-class-name=\"setRowClassName\"\n :data-source=\"dataSource\"\n :scroll=\"getScroll\">\n <template slot=\"action\" slot-scope=\"record\">\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\n </template>\n </a-table>\n <div class=\"g-table__pagination\">\n <a-pagination\n :show-total=\"all => `共 ${all} 条数据`\"\n show-size-changer \n show-quick-jumper\n :pageSize=\"innerPageSize\"\n :current=\"innerCurrentPage\"\n :pageSizeOptions=\"pageSizeOptions\"\n @change=\"onChangePagination\"\n @showSizeChange=\"onShowSizeChange\"\n :total=\"total\">\n </a-pagination>\n </div>\n </div>\n</template>\n\n<script>\nimport Actions from './action.vue'\nexport default {\n name: 'ele-table',\n components: {\n Actions\n },\n props: {\n // ant table wrapper\n height: {\n type: Number\n },\n width: {\n type: Number\n },\n x: {\n type: Number,\n default: 1200\n },\n y: {\n type: Number,\n default: 200\n },\n scroll: {\n type: Object\n },\n rowSelection: {\n type: Object\n },\n actions: {\n type: Array,\n default: () => []\n },\n total: {\n type: Number,\n default: 0\n },\n loading: {\n type: Boolean,\n default: false\n },\n columns: {\n type: Array,\n default: () => []\n },\n dataSource: {\n type: Array,\n default: () => []\n },\n pageSize: {\n type: Number,\n default: 10\n },\n pageSizeOptions: {\n type: Array,\n default: () => ['10', '20', '30', '40']\n },\n bordered: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n tableHeaderHeight: 0,\n paginationHeight: 0,\n innerPageSize: 10,\n innerCurrentPage: 1,\n tableContentHeight: 0,\n obs: [],\n tableTbodyHeight: 0\n }\n },\n computed: {\n innerColumns () {\n return this.columns.filter(col => !Object.keys(col).includes('multiple'))\n },\n isNoData () {\n return !this.dataSource.length\n },\n noDataAntTableHeight () {\n //TODO\n if (this.dataSource.length) {\n // return 'auto'\n return `${this.height - this.paginationHeight - 16}px` \n }\n return `${this.height - this.paginationHeight - 16}px` \n },\n getScrollHeightByHeight () {\n const height = this.height - this.tableHeaderHeight - this.paginationHeight\n if (this.tableTbodyHeight == 0) {\n //暂无数据\n document.querySelector('.ant-table-body') && (document.querySelector('.ant-table-body').style.height = 'auto')\n } else if (this.tableTbodyHeight !== 0 && height > this.tableTbodyHeight) {\n document.querySelector('.ant-table-content') && (document.querySelector('.ant-table-content').style.height = 'inherit')\n document.querySelector('.ant-table-scroll') && (document.querySelector('.ant-table-scroll').style.height = 'inherit')\n document.querySelector('.ant-table-body') && (document.querySelector('.ant-table-body').style.height = 'inherit')\n if (this.tableTbodyHeight > height) {\n document.querySelector('.ant-table-content').style.height = 'auto'\n document.querySelector('.ant-table-scroll').style.height = 'auto'\n document.querySelector('.ant-table-body').style.height = 'auto'\n }\n return 0\n // 0的时候没有y滚动条\n }\n return this.height - this.tableHeaderHeight - this.paginationHeight\n },\n isFlexColumn () {\n return this.columns.every(col => !col.width)\n },\n getScroll () {\n if (this.scroll) {\n return this.scroll\n } else {\n if (this.height) {\n return { x: this.isFlexColumn ? 0 : this.width > this.x ? 0 : this.x, y: this.getScrollHeightByHeight }\n }\n return { x: this.isFlexColumn ? 0 : this.width > this.x ? 0 : this.x, y: this.y }\n }\n }\n },\n watch: {\n pageSize: {\n handler (pageSize) {\n this.innerPageSize = pageSize\n },\n immediate: true\n }\n },\n methods: {\n onShowSizeChange (current, pageSize) {\n this.innerCurrentPage = current\n this.innerPageSize = pageSize\n this.$emit('change-page', current, pageSize)\n },\n setPaginationHeight () {\n this.$nextTick(() => {\n const { height } = document.querySelector('.g-table__pagination').getBoundingClientRect()\n this.paginationHeight = height\n })\n },\n setTableHeaderHeight () {\n this.$nextTick(() => {\n const el = document.querySelector('.ant-table-header')\n if (!el) return\n const { height } = el.getBoundingClientRect()\n this.tableHeaderHeight = height\n })\n },\n setTableTbodyHeight () {\n const el = document.querySelector('table .ant-table-tbody')\n const ob = new ResizeObserver((entries => {\n if (this.tableHeaderHeight) return\n for (const _ of entries) {\n requestAnimationFrame(() => {\n const { height } = el.getBoundingClientRect()\n this.tableTbodyHeight = height\n this.setTableHeaderHeight()\n })\n }\n }))\n ob.observe(el)\n this.obs.push(ob)\n },\n setRowClassName (record, idx) {\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\n },\n onChangePagination (page, pageSize) {\n this.innerCurrentPage = page\n this.innerPageSize = pageSize\n this.$emit('change-page', page, pageSize)\n }\n },\n mounted() {\n this.setPaginationHeight()\n setTimeout(() => {\n this.setTableTbodyHeight()\n }, 100)\n },\n destroyed () {\n this.obs.forEach(ob => ob.disconnect())\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-table__wrapper {\n ::v-deep .ant-spin-nested-loading {\n height: inherit;\n .ant-table-fixed-header {\n .ant-table-body-inner {\n overflow: hidden;\n }\n }\n .ant-spin-container {\n height: inherit;\n .ant-table {\n height: inherit;\n .ant-table-content {\n // height: inherit;\n // .ant-table-scroll {\n // height: inherit;\n // .ant-table-body {\n // height: inherit;\n // }\n // }\n }\n }\n }\n }\n ::v-deep .ant-table-wrapper {\n .ant-table {\n border-width: calc(var(--idooel-border-width) * 1px);\n border-style: solid;\n border-color: var(--idooel-border-color);\n }\n .ant-table-header {\n .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n }\n tr {\n th {\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 }\n }\n .ant-table-tbody {\n tr {\n 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 }\n }\n .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 .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 .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 .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 .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 }\n .ant-table-fixed-right {\n .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 // border-bottom-width: calc(var(--idooel-border-width) * 1px);\n // border-bottom-style: solid;\n // border-bottom-color: var(--idooel-border-color);\n .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 }\n }\n padding: 16px;\n padding-top: unset;\n ::v-deep .g-table__row--even {\n background: var(--idooel-row-even-color);\n }\n .g-table__row--odd {\n background: var(--idooel-row-odd-color);\n }\n .g-table__pagination {\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 position: relative;\n z-index: 999;\n }\n}\n</style>",".g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading {\n height: inherit;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading .ant-table-fixed-header .ant-table-body-inner {\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading .ant-spin-container {\n height: inherit;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading .ant-spin-container .ant-table {\n height: inherit;\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-header tr th {\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-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-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 .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 ::v-deep .g-table__row--even {\n background: var(--idooel-row-even-color);\n}\n.g-table__wrapper .g-table__row--odd {\n background: var(--idooel-row-odd-color);\n}\n.g-table__wrapper .g-table__pagination {\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 position: relative;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2018
2008
|
|
|
2019
2009
|
};
|
|
2020
2010
|
/* scoped */
|
|
2021
|
-
const __vue_scope_id__$C = "data-v-
|
|
2011
|
+
const __vue_scope_id__$C = "data-v-74aaea06";
|
|
2022
2012
|
/* module identifier */
|
|
2023
2013
|
const __vue_module_identifier__$C = undefined;
|
|
2024
2014
|
/* functional template */
|
|
@@ -2288,9 +2278,7 @@ var script$A = {
|
|
|
2288
2278
|
requestTableData: this.requestTableData,
|
|
2289
2279
|
[CONTEXT]: () => {
|
|
2290
2280
|
return {
|
|
2291
|
-
exposed:
|
|
2292
|
-
...this.exposed
|
|
2293
|
-
}
|
|
2281
|
+
exposed: this.exposed
|
|
2294
2282
|
};
|
|
2295
2283
|
}
|
|
2296
2284
|
};
|
|
@@ -2410,6 +2398,7 @@ var script$A = {
|
|
|
2410
2398
|
getCurrentRowData: this.getCurrentRowData,
|
|
2411
2399
|
setCurrentRowData: this.setCurrentRowData,
|
|
2412
2400
|
setCurrentTableSelection: this.setCurrentTableSelection,
|
|
2401
|
+
getCurrentTableSelection: this.getCurrentTableSelection,
|
|
2413
2402
|
cleanCurrentModelEffect: this.cleanCurrentModelEffect,
|
|
2414
2403
|
route: this.$route,
|
|
2415
2404
|
_route: this.$route.query,
|
|
@@ -2421,9 +2410,9 @@ var script$A = {
|
|
|
2421
2410
|
ret[action.eventName] = e => {
|
|
2422
2411
|
this.setCurrentRowData(e.exposed.currentRowData);
|
|
2423
2412
|
const {
|
|
2424
|
-
|
|
2413
|
+
target
|
|
2425
2414
|
} = action;
|
|
2426
|
-
const targetMeta = this.findMetaByKey(
|
|
2415
|
+
const targetMeta = this.findMetaByKey(target);
|
|
2427
2416
|
const {
|
|
2428
2417
|
mode
|
|
2429
2418
|
} = targetMeta;
|
|
@@ -2464,14 +2453,17 @@ var script$A = {
|
|
|
2464
2453
|
} = footerMeta || {};
|
|
2465
2454
|
const eles = type.isFunction(elements) ? elements.call(this) : elements;
|
|
2466
2455
|
const events = eles.reduce((ret, ele) => {
|
|
2467
|
-
ret[ele.eventName] = e => {
|
|
2456
|
+
ret[ele.eventName] = (e = {}) => {
|
|
2468
2457
|
if (ele.eventName === 'cancel') {
|
|
2469
2458
|
this.closeModalTable();
|
|
2470
2459
|
} else {
|
|
2460
|
+
const {
|
|
2461
|
+
exposed = {}
|
|
2462
|
+
} = e;
|
|
2471
2463
|
this.$emit(`${ele.eventName}` || 'click', {
|
|
2472
2464
|
...e,
|
|
2473
2465
|
currentTreeNode: this.currentTreeNodeData,
|
|
2474
|
-
exposed: Object.assign({},
|
|
2466
|
+
exposed: Object.assign({}, exposed || {})
|
|
2475
2467
|
});
|
|
2476
2468
|
}
|
|
2477
2469
|
};
|
|
@@ -2627,9 +2619,6 @@ var script$A = {
|
|
|
2627
2619
|
if (this.showTree) {
|
|
2628
2620
|
this.treeData = await this.requestTreeData();
|
|
2629
2621
|
const [defaultTreeNode = {}] = this.treeData;
|
|
2630
|
-
// const { replaceFields = {} } = this.treeMeta
|
|
2631
|
-
// const mapFields = type.isEmpty(replaceFields) ? this.replaceFields : replaceFields
|
|
2632
|
-
// console.log('replaceFields', this.replaceFields, replaceFields)
|
|
2633
2622
|
this.defaultExpandedKeys = [defaultTreeNode[this.mapFields.key]];
|
|
2634
2623
|
this.defaultSelectedKeys = [defaultTreeNode[this.mapFields.key]];
|
|
2635
2624
|
this.currentTreeNodeData = defaultTreeNode;
|
|
@@ -2689,20 +2678,29 @@ var script$A = {
|
|
|
2689
2678
|
},
|
|
2690
2679
|
onChangeTableSelection(_, selectedRows = []) {
|
|
2691
2680
|
if (this.currentTableMode === 'radio') {
|
|
2692
|
-
this.
|
|
2681
|
+
this.setCurrentTableSelection(selectedRows);
|
|
2693
2682
|
this.$emit('on-change-table-selection', this.currentTableSelection);
|
|
2683
|
+
this.$emit('x:refresh-exposed', {
|
|
2684
|
+
exposed: this.exposed
|
|
2685
|
+
});
|
|
2694
2686
|
} else {
|
|
2695
|
-
this.
|
|
2687
|
+
this.setCurrentTableSelection(selectedRows);
|
|
2696
2688
|
this.$emit('on-change-table-selection', this.currentTableSelection);
|
|
2689
|
+
this.$emit('x:refresh-exposed', {
|
|
2690
|
+
exposed: this.exposed
|
|
2691
|
+
});
|
|
2697
2692
|
}
|
|
2698
2693
|
},
|
|
2699
2694
|
setCurrentTableSelection(props = {}) {
|
|
2700
2695
|
if (this.currentTableMode === 'radio') {
|
|
2701
|
-
this
|
|
2696
|
+
this.$set(this, 'currentTableSelection', type.isObject(props) ? props : {});
|
|
2702
2697
|
} else {
|
|
2703
|
-
this
|
|
2698
|
+
this.$set(this, 'currentTableSelection', type.isArray(props) ? props : []);
|
|
2704
2699
|
}
|
|
2705
2700
|
},
|
|
2701
|
+
getCurrentTableSelection() {
|
|
2702
|
+
return this.currentTableSelection;
|
|
2703
|
+
},
|
|
2706
2704
|
setCurrentRowData(props = {}) {
|
|
2707
2705
|
this.currentRowData = props;
|
|
2708
2706
|
},
|
|
@@ -2750,9 +2748,9 @@ var script$A = {
|
|
|
2750
2748
|
handleClickButtonGroup(props) {
|
|
2751
2749
|
const {
|
|
2752
2750
|
eventName,
|
|
2753
|
-
|
|
2751
|
+
target
|
|
2754
2752
|
} = props;
|
|
2755
|
-
const targetMeta = this.findMetaByKey(
|
|
2753
|
+
const targetMeta = this.findMetaByKey(target);
|
|
2756
2754
|
const {
|
|
2757
2755
|
mode
|
|
2758
2756
|
} = targetMeta;
|
|
@@ -2766,7 +2764,6 @@ var script$A = {
|
|
|
2766
2764
|
},
|
|
2767
2765
|
watchViewPort() {
|
|
2768
2766
|
const modelTableWrapper = this.$refs[this.modelTableWrapper];
|
|
2769
|
-
console.log(modelTableWrapper.getBoundingClientRect());
|
|
2770
2767
|
const {
|
|
2771
2768
|
top
|
|
2772
2769
|
} = modelTableWrapper.getBoundingClientRect();
|
|
@@ -3101,11 +3098,11 @@ __vue_render__$A._withStripped = true;
|
|
|
3101
3098
|
/* style */
|
|
3102
3099
|
const __vue_inject_styles__$A = function (inject) {
|
|
3103
3100
|
if (!inject) return
|
|
3104
|
-
inject("data-v-36f7d994_0", { source: ".ele.model__tree-table[data-v-36f7d994] {\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-36f7d994] {\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-36f7d994] {\n width: 100%;\n min-width: 0;\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--title .model__table-title--bar[data-v-36f7d994] {\n width: 100%;\n height: 8px;\n background: var(--idooel-primary-color);\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n.ele.model__tree-table .model__table--container .model__table--title .model__table-title--text[data-v-36f7d994] {\n text-align: left;\n padding: 16px;\n font-size: 16px;\n font-weight: bold;\n background: #fff;\n border-bottom: 1px solid;\n border-color: var(--idoole-black-016);\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper[data-v-36f7d994] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-36f7d994] {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-top: 16px;\n padding-bottom: 8px;\n padding-right: 16px;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .g-table__wrapper .fsm[data-v-36f7d994] {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/models/tree-table-model/src/index.vue","index.vue"],"names":[],"mappings":"AA+kBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC9kBA;ADglBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC9kBA;ADilBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AC/kBA;ADilBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;AC/kBA;ADilBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;AC/kBA;ADklBA;EACA,gBAAA;AChlBA;ADilBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;AC/kBA;ADklBA;EACA,eAAA;EACA,kCAAA;AChlBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <section class=\"ele model__tree-table\">\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\n <div class=\"model__tree--title\"></div>\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\" :style=\"{height: `${treeWrapperHeight}px`}\">\n <ele-tree\n :tree-data=\"treeData\"\n :defaultExpandedKeys=\"defaultExpandedKeys\"\n :defaultSelectedKeys=\"defaultSelectedKeys\"\n @select=\"selectTreeNode\"\n :replace-fields=\"mapFields\">\n </ele-tree>\n </section>\n </section>\n <section class=\"model__table--container\" :ref=\"modelTableContainerRef\">\n <div class=\"model__table--title\" v-if=\"title\">\n <template v-if=\"titleMode\">\n <div :class=\"[`model__table-title--${titleMode}`]\"></div>\n </template>\n <template v-else>\n <div class=\"model__table-title--text\">{{ title }}</div>\n </template>\n </div>\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\n <div class=\"button-row__area\">\n <ele-button-group class=\"model-table__button-group\" v-on=\"overrideButtonGroupEvent\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" :data-source=\"getButtonGroupElements\"></ele-button-group>\n <slot name=\"tags\"></slot>\n <slot v-if=\"$slots['sub-center']\" name=\"sub-center\"></slot>\n </div>\n <ele-table\n v-on=\"overrideTableEvent\"\n :ref=\"tableRef\"\n :row-selection=\"rowSelection\"\n :loading=\"loading\" \n :columns=\"columns\"\n :total=\"total\"\n :x=\"x\"\n :y=\"y\"\n :bordered=\"setBorder\"\n :height=\"tableHeight\"\n :width=\"tableWidth\"\n :actions=\"actions\"\n :pageSize=\"pageSize\"\n :pageSizeOptions=\"pageSizeOptions\"\n :data-source=\"tableData\"\n @change-page=\"onChangePage\"\n ></ele-table>\n </section>\n </section>\n <ele-modal-form v-model=\"modalFormValue\" v-on=\"overrideModalFormEvent\" :meta=\"modalFormMeta\"></ele-modal-form>\n <ele-modal-fsm v-model=\"showFsmModal\" :contextProp=\"fsmContextProp\" :meta=\"fsmMeta\" @cancel=\"handleCloseFsmModal\"></ele-modal-fsm>\n <ele-modal-table\n :meta=\"modalTableMeta\"\n v-model=\"modalTableValue\"\n v-on=\"overrideModalTableEvent\"\n ></ele-modal-table>\n </section>\n</template>\n\n<script>\nimport { type, net, util } from '@idooel/shared'\nimport { v4 as uuidv4 } from 'uuid'\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, BUILT_IN_TRIGGER, CONTEXT } from '../../../utils'\nexport default {\n name: 'ele-tree-table-model',\n props: {\n title: {\n type: [Object, String]\n },\n overHeight: {\n type: Number,\n default: 0\n },\n treeMeta: {\n type: Object,\n default: () => ({})\n },\n searchMeta: {\n type: Object,\n default: () => ({})\n },\n buttonGroupMeta: {\n typeof: Object,\n default: () => ({})\n },\n tableMeta: {\n type: Object,\n default: () => ({})\n },\n createMeta: {\n type: Object\n },\n editMeta: {\n type: Object\n }\n },\n provide () {\n return {\n requestTreeData: this.requestTreeData,\n requestTableData: this.requestTableData,\n [CONTEXT]: () => {\n return {\n exposed: { ...this.exposed }\n }\n }\n }\n },\n data () {\n return {\n tableHeight: 0,\n tableWidth: 0,\n modalFormMeta: {},\n modalFormValue: false,\n treeData: [],\n tableData: [],\n defaultExpandedKeys: [],\n defaultSelectedKeys: [],\n replaceFields: {\n title: 'title',\n children: 'children',\n key: 'id'\n },\n loading: false,\n total: 0,\n tableQuerys: {},\n resizeObserverModelTableWrapper: null,\n modelTableWrapperHeight: 0,\n currentTreeNodeData: {},\n currentRowData: {},\n treeWrapperHeight: 0,\n currentTableSelection: this.currentTableMode == 'radio' ? {} : [],\n showFsmModal: false,\n fsmMeta: {},\n fsmContextProp: {},\n modalTableValue: false,\n modalTableMeta: {}\n }\n },\n computed: {\n setBorder () {\n return this.tableMeta.bordered === false ? false : true\n },\n rowSelection () {\n if (!this.currentTableMode) return void 0\n return {\n columnTitle: this.currentSelectionColumn.columnTitle,\n fixed: true,\n type: this.currentTableMode,\n onChange: this.onChangeTableSelection\n }\n },\n currentSelectionColumn () {\n const { multiple } = this.tableMeta\n const target = this.columns.find(item => Object.keys(item).includes('multiple'))\n const isGlobalExistMultiple = Object.keys(this.tableMeta).includes('multiple')\n if (target) {\n return target\n } else if (isGlobalExistMultiple) {\n return { multiple }\n }\n return void 0\n },\n x () {\n const { x } = this.tableMeta\n return x\n },\n y () {\n const { y } = this.tableMeta\n return y\n },\n currentTableMode () {\n if (!this.currentSelectionColumn) return void 0\n const { multiple } = this.currentSelectionColumn\n if (type.isBool(multiple)) {\n if (multiple) {\n return 'checkbox'\n } else {\n return 'radio'\n }\n } else {\n return void 0\n }\n },\n modelTableContainerRef () {\n return uuidv4()\n },\n titleMode () {\n if (type.isObject(this.title)) {\n const { mode = '' } = this.title\n return mode\n }\n return void 0\n },\n tableRef () {\n return uuidv4()\n },\n exposed () {\n return {\n showModalForm: this.showModalForm,\n closeModalForm: this.closeModalForm,\n showModalTable: this.showModalTable,\n closeModalTable: this.closeModalTable,\n currentTableSelection: this.currentTableSelection,\n currentTreeNode: this.currentTreeNodeData,\n requestTableData: this.requestTableData,\n querys: this.tableQuerys,\n currentRowData: this.currentRowData,\n getCurrentRowData: this.getCurrentRowData,\n setCurrentRowData: this.setCurrentRowData,\n setCurrentTableSelection: this.setCurrentTableSelection,\n cleanCurrentModelEffect: this.cleanCurrentModelEffect,\n route: this.$route,\n _route: this.$route.query,\n _routeMeta: this.$route.meta\n }\n },\n overrideTableEvent () {\n const events = this.actions.reduce((ret, action) => {\n ret[action.eventName] = (e) => {\n this.setCurrentRowData(e.exposed.currentRowData)\n const { key } = action\n const targetMeta = this.findMetaByKey(key)\n const { mode } = targetMeta\n mode && this.dispatchTrigger({ mode, record: e.exposed.currentRowData, modeMeta: targetMeta })\n this.$emit(action.eventName || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: { ...this.exposed, ...e.exposed } })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.EDIT]: this[BUILT_IN_EVENT_NAMES.EDIT],\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\n }\n },\n overrideModalFormEvent () {\n return {\n ...this.$listeners\n }\n },\n overrideModalTableEvent () {\n const { footerMeta } = this.modalTableMeta\n const { elements = [] } = footerMeta || {}\n const eles = type.isFunction(elements) ? elements.call(this) : elements\n const events = eles.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n if (ele.eventName === 'cancel') {\n this.closeModalTable()\n } else {\n this.$emit(`${ele.eventName}` || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, e.exposed || {}, this.exposed)})\n }\n }\n return ret\n }, {})\n return {\n ...events,\n exposed: this.exposed\n }\n },\n overrideButtonGroupEvent () {\n const events = this.getButtonGroupElements.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n this.$emit(ele.eventName || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, e.exposed || {}, this.exposed)})\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.CREATE]: this[BUILT_IN_EVENT_NAMES.CREATE],\n exposed: this.exposed\n }\n },\n showTree () {\n return !!Object.keys(this.treeMeta).length\n },\n buttonGroup () {\n return uuidv4()\n },\n searchArea () {\n return uuidv4()\n },\n modelTreeWrapper () {\n return uuidv4()\n },\n modelTableWrapper () {\n return uuidv4()\n },\n actions () {\n const { operations } = this.tableMeta\n if (operations) {\n return operations.elements\n } else {\n return []\n }\n },\n pageSize () {\n const { page = {} } = this.tableMeta\n return page.pageSize || 10\n },\n pageSizeOptions () {\n const { page = {} } = this.tableMeta\n return page.pageSizeOptions || ['10', '20', '30', '40']\n },\n columns () {\n const { columns, operations } = this.tableMeta\n if (type.get(columns) === 'array') {\n const columnsOptions = columns.map(item => {\n const { mode = 'text' } = item\n if (item.render) {\n return {\n ...item,\n customRender: (text, record, index) => {\n const { $createElement } = this\n return item.render.call(this, \n { h: $createElement, ctx: this },\n text ? typeof text == 'object' ? text[item.dataIndex] : text : '', \n record, index)\n }\n }\n } else if (mode !== BUILT_IN_TRIGGER.TEXT) {\n const { [`${mode}Meta`]: modeMeta } = item\n return {\n ...item,\n customRender: (text, record, index) => {\n return <span onClick={() => this.dispatchTrigger({ mode, record, modeMeta, index })} class={ mode }>{ text }</span>\n }\n }\n }\n return {\n ...item\n }\n })\n if (operations) {\n return [\n ...columnsOptions,\n {\n title: '操作',\n width: operations.width,\n key: 'action',\n fixed: 'right',\n scopedSlots: { customRender: 'action' }\n }\n ]\n }\n return columnsOptions\n } else {\n console.error('Error: columns is invalid, please check it')\n return []\n }\n },\n getButtonGroupElements () {\n const { elements } = this.buttonGroupMeta\n if (type.get(elements) === 'function') {\n return elements.call(this)\n } else if (type.get(elements) === 'array') {\n return elements\n } else {\n return []\n }\n },\n mapFields () {\n const { replaceFields = {} } = this.treeMeta\n const mapFields = type.isEmpty(replaceFields) ? this.replaceFields : replaceFields\n return mapFields\n }\n },\n async created () {\n if (this.showTree) {\n this.treeData = await this.requestTreeData()\n const [defaultTreeNode = {}] = this.treeData\n // const { replaceFields = {} } = this.treeMeta\n // const mapFields = type.isEmpty(replaceFields) ? this.replaceFields : replaceFields\n // console.log('replaceFields', this.replaceFields, replaceFields)\n this.defaultExpandedKeys = [defaultTreeNode[this.mapFields.key]]\n this.defaultSelectedKeys = [defaultTreeNode[this.mapFields.key]]\n this.currentTreeNodeData = defaultTreeNode\n }\n const { params = {}, fieldMap = {}, overrideInit = false } = this.tableMeta\n const ctx = { ...this.currentTreeNodeData, _route: this.$route.query }\n const initQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx))\n if (overrideInit) {\n this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })\n } else {\n this.tableData = await this.requestTableData(initQuerys)\n }\n },\n methods: {\n dispatchTrigger ({ mode, record = {}, modeMeta = { } }) {\n switch (mode) {\n case BUILT_IN_TRIGGER.FSM:\n this[`${BUILT_IN_TRIGGER.FSM}Trigger`](record, modeMeta = type.isEmpty(modeMeta) ? { \n url: 'api-fsm/workbench/fsm/auditFlow',\n requestType: 'GET',\n fieldMap: {\n modelCode: 'modelCode',\n businessId: 'businessId'\n }\n } : modeMeta)\n break\n case BUILT_IN_TRIGGER.ELE_MODAL_FORM:\n this.modalFormMeta = modeMeta\n this.showModalForm(modeMeta)\n break\n case BUILT_IN_TRIGGER.ELE_MODAL_TABLE:\n this.modalTableMeta = modeMeta\n this.showModalTable(modeMeta)\n break\n default:\n break\n }\n },\n handleCloseFsmModal () {\n this.showFsmModal = false\n },\n [`${BUILT_IN_TRIGGER.FSM}Trigger`] (record, meta) {\n this.fsmMeta = meta\n this.fsmContextProp = record\n this.showFsmModal = true\n },\n onChangeTableSelection (_, selectedRows = []) {\n if (this.currentTableMode === 'radio') {\n this.currentTableSelection = selectedRows[0]\n this.$emit('on-change-table-selection', this.currentTableSelection)\n } else {\n this.currentTableSelection = selectedRows\n this.$emit('on-change-table-selection', this.currentTableSelection)\n }\n },\n setCurrentTableSelection (props = {}) {\n if (this.currentTableMode === 'radio') {\n this.currentTableSelection = type.isObject(props) ? props : {}\n } else {\n this.currentTableSelection = type.isArray(props) ? props : []\n }\n },\n setCurrentRowData (props = {}) {\n this.currentRowData = props\n },\n getCurrentRowData () {\n return this.currentRowData\n },\n cleanCurrentModelEffect () {\n this.setCurrentTableSelection()\n this.setCurrentRowData({})\n },\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\n this.cleanCurrentModelEffect()\n this.requestTableData()\n },\n [BUILT_IN_EVENT_NAMES.EDIT] (props = {}) {\n const { record = {} } = props\n this.currentRowData = record\n this.setCurrentRowData(record)\n this.modalFormMeta = this.editMeta\n this.modalFormValue = true\n },\n [BUILT_IN_EVENT_NAMES.CREATE] () {\n this.modalFormMeta = this.createMeta\n this.modalFormValue = true\n },\n showModalForm (modeMeta = {}) {\n this.modalFormMeta = modeMeta\n this.modalFormValue = true\n },\n showModalTable (modeMeta = {}) {\n this.modalTableMeta = modeMeta\n this.modalTableValue = true\n },\n closeModalForm () {\n this.modalFormValue = false\n },\n closeModalTable () {\n this.modalTableValue = false\n },\n findMetaByKey (key) {\n return this.$attrs[key] || {}\n },\n handleClickButtonGroup (props) {\n const { eventName, key } = props\n const targetMeta = this.findMetaByKey(key)\n const { mode } = targetMeta\n mode && this.dispatchTrigger({ mode, modeMeta: targetMeta })\n this.$emit(eventName || 'click', { currentTreeNode: this.currentTreeNodeData })\n },\n watchViewPort () {\n const modelTableWrapper = this.$refs[this.modelTableWrapper]\n console.log(modelTableWrapper.getBoundingClientRect())\n const { top } = modelTableWrapper.getBoundingClientRect()\n this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`\n },\n async onSearch (props) {\n const { overrideInit = false } = this.tableMeta\n this.tableQuerys = Object.assign(this.tableQuerys, props)\n if (overrideInit) {\n this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })\n } else {\n this.tableData = await this.requestTableData()\n }\n },\n async selectTreeNode (selectedKeys, e) {\n const { fieldMap } = this.tableMeta\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef || {}\n //@deprecated '_' namespace is deprecated, please use 'exposed' instead\n const execFieldMapRet = parseFieldMap(fieldMap, { ...this.currentTreeNodeData, exposed: this.exposed, _route: this.exposed._route })\n const { overrideInit = false } = this.tableMeta\n if (overrideInit) {\n this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })\n } else {\n this.tableData = await this.requestTableData(execFieldMapRet)\n }\n },\n async requestTreeData () {\n const { url, requestType = 'GET', params = {}, fieldMap = {} } = this.treeMeta\n const fieldMapRet = parseFieldMap(fieldMap, { ...this.currentTreeNodeData, _route: this.$route.query })\n const ret = await net[requestType.toLowerCase()](\n url,\n { ...params, ...fieldMapRet }\n ).then(resp => {\n const { data } = resp || {}\n return data\n })\n return ret\n },\n async onChangePage (page, pageSize) {\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\n },\n async requestTableData (props = {}) {\n const { url, requestType = 'GET', page = {} } = this.tableMeta\n const { pageSize = 10 } = page\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\n this.$emit(RESERVE_EVENT_NAMES.WATCH, { ...this.exposed })\n this.loading = true\n const ret = await net[requestType.toLowerCase()](\n url,\n this.tableQuerys\n ).then(resp => {\n const { data = [], count } = resp || {}\n this.total = count\n this.loading = false\n return (data || []).map(item => {\n delete item.children\n return {\n key: uuidv4(),\n ...item\n }\n })\n })\n this.cleanCurrentModelEffect()\n this.tableData = ret\n return ret\n },\n refreshTreeStatus (props = {}) {},\n refreshTableStatus (props = {}) {},\n calculateTableHeight () {\n const currentViewportHeight = window.innerHeight\n const tableRef = this.$refs[this.tableRef]\n const { top: tableToTop, width } = tableRef.$el.getBoundingClientRect()\n this.tableWidth = width\n this.tableHeight = currentViewportHeight - tableToTop - this.overHeight\n },\n calculateTreeHeight () {\n if (!this.showTree) return\n const modelTableContainerRef = this.$refs[this.modelTableContainerRef]\n const { height } = modelTableContainerRef.getBoundingClientRect()\n this.treeWrapperHeight = height\n }\n },\n mounted () {\n this.calculateTableHeight()\n this.$nextTick(() => {\n this.calculateTreeHeight()\n })\n this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\n for (const _ of entries) {\n requestAnimationFrame(() => {\n this.calculateTableHeight()\n })\n }\n })\n this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\n },\n destroyed () {\n this.resizeObserverModelTableWrapper.disconnect()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele {\n &.model__tree-table {\n background: transparent; \n display: flex;\n flex-direction: row;\n width: 100%;\n .model__tree-table--container {\n .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 }\n .model__table--container {\n width: 100%;\n min-width: 0;\n background: #fff;\n .model__table--title {\n .model__table-title--bar {\n width: 100%;\n height: 8px;\n background: var(--idooel-primary-color);\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n }\n .model__table-title--text {\n text-align: left;\n padding: 16px;\n font-size: 16px;\n font-weight: bold;\n background: #fff;\n border-bottom: 1px solid;\n border-color: var(--idoole-black-016);\n }\n }\n .model__table--wrapper {\n background: #fff;\n .button-row__area {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-top: 16px;\n padding-bottom: 8px;\n padding-right: 16px;\n }\n .g-table__wrapper {\n .fsm {\n cursor: pointer;\n color: var(--idooel-primary-color);\n }\n }\n }\n }\n }\n}\n</style>\n",".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--title .model__table-title--bar {\n width: 100%;\n height: 8px;\n background: var(--idooel-primary-color);\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n.ele.model__tree-table .model__table--container .model__table--title .model__table-title--text {\n text-align: left;\n padding: 16px;\n font-size: 16px;\n font-weight: bold;\n background: #fff;\n border-bottom: 1px solid;\n border-color: var(--idoole-black-016);\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-top: 16px;\n padding-bottom: 8px;\n padding-right: 16px;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .g-table__wrapper .fsm {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3101
|
+
inject("data-v-3b9218e2_0", { source: ".ele.model__tree-table[data-v-3b9218e2] {\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-3b9218e2] {\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-3b9218e2] {\n width: 100%;\n min-width: 0;\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--title .model__table-title--bar[data-v-3b9218e2] {\n width: 100%;\n height: 8px;\n background: var(--idooel-primary-color);\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n.ele.model__tree-table .model__table--container .model__table--title .model__table-title--text[data-v-3b9218e2] {\n text-align: left;\n padding: 16px;\n font-size: 16px;\n font-weight: bold;\n background: #fff;\n border-bottom: 1px solid;\n border-color: var(--idoole-black-016);\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper[data-v-3b9218e2] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-3b9218e2] {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-top: 16px;\n padding-bottom: 8px;\n padding-right: 16px;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .g-table__wrapper .fsm[data-v-3b9218e2] {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/models/tree-table-model/src/index.vue","index.vue"],"names":[],"mappings":"AAklBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;ACjlBA;ADmlBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;ACjlBA;ADolBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;ACllBA;ADolBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;ACllBA;ADolBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;ACllBA;ADqlBA;EACA,gBAAA;ACnlBA;ADolBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;ACllBA;ADqlBA;EACA,eAAA;EACA,kCAAA;ACnlBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <section class=\"ele model__tree-table\">\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\n <div class=\"model__tree--title\"></div>\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\" :style=\"{height: `${treeWrapperHeight}px`}\">\n <ele-tree\n :tree-data=\"treeData\"\n :defaultExpandedKeys=\"defaultExpandedKeys\"\n :defaultSelectedKeys=\"defaultSelectedKeys\"\n @select=\"selectTreeNode\"\n :replace-fields=\"mapFields\">\n </ele-tree>\n </section>\n </section>\n <section class=\"model__table--container\" :ref=\"modelTableContainerRef\">\n <div class=\"model__table--title\" v-if=\"title\">\n <template v-if=\"titleMode\">\n <div :class=\"[`model__table-title--${titleMode}`]\"></div>\n </template>\n <template v-else>\n <div class=\"model__table-title--text\">{{ title }}</div>\n </template>\n </div>\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\n <div class=\"button-row__area\">\n <ele-button-group class=\"model-table__button-group\" v-on=\"overrideButtonGroupEvent\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" :data-source=\"getButtonGroupElements\"></ele-button-group>\n <slot name=\"tags\"></slot>\n <slot v-if=\"$slots['sub-center']\" name=\"sub-center\"></slot>\n </div>\n <ele-table\n v-on=\"overrideTableEvent\"\n :ref=\"tableRef\"\n :row-selection=\"rowSelection\"\n :loading=\"loading\" \n :columns=\"columns\"\n :total=\"total\"\n :x=\"x\"\n :y=\"y\"\n :bordered=\"setBorder\"\n :height=\"tableHeight\"\n :width=\"tableWidth\"\n :actions=\"actions\"\n :pageSize=\"pageSize\"\n :pageSizeOptions=\"pageSizeOptions\"\n :data-source=\"tableData\"\n @change-page=\"onChangePage\"\n ></ele-table>\n </section>\n </section>\n <ele-modal-form v-model=\"modalFormValue\" v-on=\"overrideModalFormEvent\" :meta=\"modalFormMeta\"></ele-modal-form>\n <ele-modal-fsm v-model=\"showFsmModal\" :contextProp=\"fsmContextProp\" :meta=\"fsmMeta\" @cancel=\"handleCloseFsmModal\"></ele-modal-fsm>\n <ele-modal-table\n :meta=\"modalTableMeta\"\n v-model=\"modalTableValue\"\n v-on=\"overrideModalTableEvent\"\n ></ele-modal-table>\n </section>\n</template>\n\n<script>\nimport { type, net, util } from '@idooel/shared'\nimport { v4 as uuidv4 } from 'uuid'\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, BUILT_IN_TRIGGER, CONTEXT } from '../../../utils'\nexport default {\n name: 'ele-tree-table-model',\n props: {\n title: {\n type: [Object, String]\n },\n overHeight: {\n type: Number,\n default: 0\n },\n treeMeta: {\n type: Object,\n default: () => ({})\n },\n searchMeta: {\n type: Object,\n default: () => ({})\n },\n buttonGroupMeta: {\n typeof: Object,\n default: () => ({})\n },\n tableMeta: {\n type: Object,\n default: () => ({})\n },\n createMeta: {\n type: Object\n },\n editMeta: {\n type: Object\n }\n },\n provide () {\n return {\n requestTreeData: this.requestTreeData,\n requestTableData: this.requestTableData,\n [CONTEXT]: () => {\n return {\n exposed: this.exposed\n }\n }\n }\n },\n data () {\n return {\n tableHeight: 0,\n tableWidth: 0,\n modalFormMeta: {},\n modalFormValue: false,\n treeData: [],\n tableData: [],\n defaultExpandedKeys: [],\n defaultSelectedKeys: [],\n replaceFields: {\n title: 'title',\n children: 'children',\n key: 'id'\n },\n loading: false,\n total: 0,\n tableQuerys: {},\n resizeObserverModelTableWrapper: null,\n modelTableWrapperHeight: 0,\n currentTreeNodeData: {},\n currentRowData: {},\n treeWrapperHeight: 0,\n currentTableSelection: this.currentTableMode == 'radio' ? {} : [],\n showFsmModal: false,\n fsmMeta: {},\n fsmContextProp: {},\n modalTableValue: false,\n modalTableMeta: {}\n }\n },\n computed: {\n setBorder () {\n return this.tableMeta.bordered === false ? false : true\n },\n rowSelection () {\n if (!this.currentTableMode) return void 0\n return {\n columnTitle: this.currentSelectionColumn.columnTitle,\n fixed: true,\n type: this.currentTableMode,\n onChange: this.onChangeTableSelection\n }\n },\n currentSelectionColumn () {\n const { multiple } = this.tableMeta\n const target = this.columns.find(item => Object.keys(item).includes('multiple'))\n const isGlobalExistMultiple = Object.keys(this.tableMeta).includes('multiple')\n if (target) {\n return target\n } else if (isGlobalExistMultiple) {\n return { multiple }\n }\n return void 0\n },\n x () {\n const { x } = this.tableMeta\n return x\n },\n y () {\n const { y } = this.tableMeta\n return y\n },\n currentTableMode () {\n if (!this.currentSelectionColumn) return void 0\n const { multiple } = this.currentSelectionColumn\n if (type.isBool(multiple)) {\n if (multiple) {\n return 'checkbox'\n } else {\n return 'radio'\n }\n } else {\n return void 0\n }\n },\n modelTableContainerRef () {\n return uuidv4()\n },\n titleMode () {\n if (type.isObject(this.title)) {\n const { mode = '' } = this.title\n return mode\n }\n return void 0\n },\n tableRef () {\n return uuidv4()\n },\n exposed () {\n return {\n showModalForm: this.showModalForm,\n closeModalForm: this.closeModalForm,\n showModalTable: this.showModalTable,\n closeModalTable: this.closeModalTable,\n currentTableSelection: this.currentTableSelection,\n currentTreeNode: this.currentTreeNodeData,\n requestTableData: this.requestTableData,\n querys: this.tableQuerys,\n currentRowData: this.currentRowData,\n getCurrentRowData: this.getCurrentRowData,\n setCurrentRowData: this.setCurrentRowData,\n setCurrentTableSelection: this.setCurrentTableSelection,\n getCurrentTableSelection: this.getCurrentTableSelection,\n cleanCurrentModelEffect: this.cleanCurrentModelEffect,\n route: this.$route,\n _route: this.$route.query,\n _routeMeta: this.$route.meta\n }\n },\n overrideTableEvent () {\n const events = this.actions.reduce((ret, action) => {\n ret[action.eventName] = (e) => {\n this.setCurrentRowData(e.exposed.currentRowData)\n const { target } = action\n const targetMeta = this.findMetaByKey(target)\n const { mode } = targetMeta\n mode && this.dispatchTrigger({ mode, record: e.exposed.currentRowData, modeMeta: targetMeta })\n this.$emit(action.eventName || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: { ...this.exposed, ...e.exposed } })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.EDIT]: this[BUILT_IN_EVENT_NAMES.EDIT],\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\n }\n },\n overrideModalFormEvent () {\n return {\n ...this.$listeners\n }\n },\n overrideModalTableEvent () {\n const { footerMeta } = this.modalTableMeta\n const { elements = [] } = footerMeta || {}\n const eles = type.isFunction(elements) ? elements.call(this) : elements\n const events = eles.reduce((ret, ele) => {\n ret[ele.eventName] = (e = {}) => {\n if (ele.eventName === 'cancel') {\n this.closeModalTable()\n } else {\n const { exposed = {} } = e\n this.$emit(`${ele.eventName}` || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed || {})})\n }\n }\n return ret\n }, {})\n return {\n ...events,\n exposed: this.exposed\n }\n },\n overrideButtonGroupEvent () {\n const events = this.getButtonGroupElements.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n this.$emit(ele.eventName || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, e.exposed || {}, this.exposed)})\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.CREATE]: this[BUILT_IN_EVENT_NAMES.CREATE],\n exposed: this.exposed\n }\n },\n showTree () {\n return !!Object.keys(this.treeMeta).length\n },\n buttonGroup () {\n return uuidv4()\n },\n searchArea () {\n return uuidv4()\n },\n modelTreeWrapper () {\n return uuidv4()\n },\n modelTableWrapper () {\n return uuidv4()\n },\n actions () {\n const { operations } = this.tableMeta\n if (operations) {\n return operations.elements\n } else {\n return []\n }\n },\n pageSize () {\n const { page = {} } = this.tableMeta\n return page.pageSize || 10\n },\n pageSizeOptions () {\n const { page = {} } = this.tableMeta\n return page.pageSizeOptions || ['10', '20', '30', '40']\n },\n columns () {\n const { columns, operations } = this.tableMeta\n if (type.get(columns) === 'array') {\n const columnsOptions = columns.map(item => {\n const { mode = 'text' } = item\n if (item.render) {\n return {\n ...item,\n customRender: (text, record, index) => {\n const { $createElement } = this\n return item.render.call(this, \n { h: $createElement, ctx: this },\n text ? typeof text == 'object' ? text[item.dataIndex] : text : '', \n record, index)\n }\n }\n } else if (mode !== BUILT_IN_TRIGGER.TEXT) {\n const { [`${mode}Meta`]: modeMeta } = item\n return {\n ...item,\n customRender: (text, record, index) => {\n return <span onClick={() => this.dispatchTrigger({ mode, record, modeMeta, index })} class={ mode }>{ text }</span>\n }\n }\n }\n return {\n ...item\n }\n })\n if (operations) {\n return [\n ...columnsOptions,\n {\n title: '操作',\n width: operations.width,\n key: 'action',\n fixed: 'right',\n scopedSlots: { customRender: 'action' }\n }\n ]\n }\n return columnsOptions\n } else {\n console.error('Error: columns is invalid, please check it')\n return []\n }\n },\n getButtonGroupElements () {\n const { elements } = this.buttonGroupMeta\n if (type.get(elements) === 'function') {\n return elements.call(this)\n } else if (type.get(elements) === 'array') {\n return elements\n } else {\n return []\n }\n },\n mapFields () {\n const { replaceFields = {} } = this.treeMeta\n const mapFields = type.isEmpty(replaceFields) ? this.replaceFields : replaceFields\n return mapFields\n }\n },\n async created () {\n if (this.showTree) {\n this.treeData = await this.requestTreeData()\n const [defaultTreeNode = {}] = this.treeData\n this.defaultExpandedKeys = [defaultTreeNode[this.mapFields.key]]\n this.defaultSelectedKeys = [defaultTreeNode[this.mapFields.key]]\n this.currentTreeNodeData = defaultTreeNode\n }\n const { params = {}, fieldMap = {}, overrideInit = false } = this.tableMeta\n const ctx = { ...this.currentTreeNodeData, _route: this.$route.query }\n const initQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx))\n if (overrideInit) {\n this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })\n } else {\n this.tableData = await this.requestTableData(initQuerys)\n }\n },\n methods: {\n dispatchTrigger ({ mode, record = {}, modeMeta = { } }) {\n switch (mode) {\n case BUILT_IN_TRIGGER.FSM:\n this[`${BUILT_IN_TRIGGER.FSM}Trigger`](record, modeMeta = type.isEmpty(modeMeta) ? { \n url: 'api-fsm/workbench/fsm/auditFlow',\n requestType: 'GET',\n fieldMap: {\n modelCode: 'modelCode',\n businessId: 'businessId'\n }\n } : modeMeta)\n break\n case BUILT_IN_TRIGGER.ELE_MODAL_FORM:\n this.modalFormMeta = modeMeta\n this.showModalForm(modeMeta)\n break\n case BUILT_IN_TRIGGER.ELE_MODAL_TABLE:\n this.modalTableMeta = modeMeta\n this.showModalTable(modeMeta)\n break\n default:\n break\n }\n },\n handleCloseFsmModal () {\n this.showFsmModal = false\n },\n [`${BUILT_IN_TRIGGER.FSM}Trigger`] (record, meta) {\n this.fsmMeta = meta\n this.fsmContextProp = record\n this.showFsmModal = true\n },\n onChangeTableSelection (_, selectedRows = []) {\n if (this.currentTableMode === 'radio') {\n this.setCurrentTableSelection(selectedRows)\n this.$emit('on-change-table-selection', this.currentTableSelection)\n this.$emit('x:refresh-exposed', { exposed: this.exposed })\n } else {\n this.setCurrentTableSelection(selectedRows)\n this.$emit('on-change-table-selection', this.currentTableSelection)\n this.$emit('x:refresh-exposed', { exposed: this.exposed })\n }\n },\n setCurrentTableSelection (props = {}) {\n if (this.currentTableMode === 'radio') {\n this.$set(this, 'currentTableSelection', type.isObject(props) ? props : {})\n } else {\n this.$set(this, 'currentTableSelection', type.isArray(props) ? props : [])\n }\n },\n getCurrentTableSelection () {\n return this.currentTableSelection\n },\n setCurrentRowData (props = {}) {\n this.currentRowData = props\n },\n getCurrentRowData () {\n return this.currentRowData\n },\n cleanCurrentModelEffect () {\n this.setCurrentTableSelection()\n this.setCurrentRowData({})\n },\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\n this.cleanCurrentModelEffect()\n this.requestTableData()\n },\n [BUILT_IN_EVENT_NAMES.EDIT] (props = {}) {\n const { record = {} } = props\n this.currentRowData = record\n this.setCurrentRowData(record)\n this.modalFormMeta = this.editMeta\n this.modalFormValue = true\n },\n [BUILT_IN_EVENT_NAMES.CREATE] () {\n this.modalFormMeta = this.createMeta\n this.modalFormValue = true\n },\n showModalForm (modeMeta = {}) {\n this.modalFormMeta = modeMeta\n this.modalFormValue = true\n },\n showModalTable (modeMeta = {}) {\n this.modalTableMeta = modeMeta\n this.modalTableValue = true\n },\n closeModalForm () {\n this.modalFormValue = false\n },\n closeModalTable () {\n this.modalTableValue = false\n },\n findMetaByKey (key) {\n return this.$attrs[key] || {}\n },\n handleClickButtonGroup (props) {\n const { eventName, target } = props\n const targetMeta = this.findMetaByKey(target)\n const { mode } = targetMeta\n mode && this.dispatchTrigger({ mode, modeMeta: targetMeta })\n this.$emit(eventName || 'click', { currentTreeNode: this.currentTreeNodeData })\n },\n watchViewPort () {\n const modelTableWrapper = this.$refs[this.modelTableWrapper]\n const { top } = modelTableWrapper.getBoundingClientRect()\n this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`\n },\n async onSearch (props) {\n const { overrideInit = false } = this.tableMeta\n this.tableQuerys = Object.assign(this.tableQuerys, props)\n if (overrideInit) {\n this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })\n } else {\n this.tableData = await this.requestTableData()\n }\n },\n async selectTreeNode (selectedKeys, e) {\n const { fieldMap } = this.tableMeta\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef || {}\n //@deprecated '_' namespace is deprecated, please use 'exposed' instead\n const execFieldMapRet = parseFieldMap(fieldMap, { ...this.currentTreeNodeData, exposed: this.exposed, _route: this.exposed._route })\n const { overrideInit = false } = this.tableMeta\n if (overrideInit) {\n this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })\n } else {\n this.tableData = await this.requestTableData(execFieldMapRet)\n }\n },\n async requestTreeData () {\n const { url, requestType = 'GET', params = {}, fieldMap = {} } = this.treeMeta\n const fieldMapRet = parseFieldMap(fieldMap, { ...this.currentTreeNodeData, _route: this.$route.query })\n const ret = await net[requestType.toLowerCase()](\n url,\n { ...params, ...fieldMapRet }\n ).then(resp => {\n const { data } = resp || {}\n return data\n })\n return ret\n },\n async onChangePage (page, pageSize) {\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\n },\n async requestTableData (props = {}) {\n const { url, requestType = 'GET', page = {} } = this.tableMeta\n const { pageSize = 10 } = page\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\n this.$emit(RESERVE_EVENT_NAMES.WATCH, { ...this.exposed })\n this.loading = true\n const ret = await net[requestType.toLowerCase()](\n url,\n this.tableQuerys\n ).then(resp => {\n const { data = [], count } = resp || {}\n this.total = count\n this.loading = false\n return (data || []).map(item => {\n delete item.children\n return {\n key: uuidv4(),\n ...item\n }\n })\n })\n this.cleanCurrentModelEffect()\n this.tableData = ret\n return ret\n },\n refreshTreeStatus (props = {}) {},\n refreshTableStatus (props = {}) {},\n calculateTableHeight () {\n const currentViewportHeight = window.innerHeight\n const tableRef = this.$refs[this.tableRef]\n const { top: tableToTop, width } = tableRef.$el.getBoundingClientRect()\n this.tableWidth = width\n this.tableHeight = currentViewportHeight - tableToTop - this.overHeight\n },\n calculateTreeHeight () {\n if (!this.showTree) return\n const modelTableContainerRef = this.$refs[this.modelTableContainerRef]\n const { height } = modelTableContainerRef.getBoundingClientRect()\n this.treeWrapperHeight = height\n }\n },\n mounted () {\n this.calculateTableHeight()\n this.$nextTick(() => {\n this.calculateTreeHeight()\n })\n this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\n for (const _ of entries) {\n requestAnimationFrame(() => {\n this.calculateTableHeight()\n })\n }\n })\n this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\n },\n destroyed () {\n this.resizeObserverModelTableWrapper.disconnect()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele {\n &.model__tree-table {\n background: transparent; \n display: flex;\n flex-direction: row;\n width: 100%;\n .model__tree-table--container {\n .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 }\n .model__table--container {\n width: 100%;\n min-width: 0;\n background: #fff;\n .model__table--title {\n .model__table-title--bar {\n width: 100%;\n height: 8px;\n background: var(--idooel-primary-color);\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n }\n .model__table-title--text {\n text-align: left;\n padding: 16px;\n font-size: 16px;\n font-weight: bold;\n background: #fff;\n border-bottom: 1px solid;\n border-color: var(--idoole-black-016);\n }\n }\n .model__table--wrapper {\n background: #fff;\n .button-row__area {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-top: 16px;\n padding-bottom: 8px;\n padding-right: 16px;\n }\n .g-table__wrapper {\n .fsm {\n cursor: pointer;\n color: var(--idooel-primary-color);\n }\n }\n }\n }\n }\n}\n</style>\n",".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--title .model__table-title--bar {\n width: 100%;\n height: 8px;\n background: var(--idooel-primary-color);\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n.ele.model__tree-table .model__table--container .model__table--title .model__table-title--text {\n text-align: left;\n padding: 16px;\n font-size: 16px;\n font-weight: bold;\n background: #fff;\n border-bottom: 1px solid;\n border-color: var(--idoole-black-016);\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-top: 16px;\n padding-bottom: 8px;\n padding-right: 16px;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .g-table__wrapper .fsm {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3105
3102
|
|
|
3106
3103
|
};
|
|
3107
3104
|
/* scoped */
|
|
3108
|
-
const __vue_scope_id__$A = "data-v-
|
|
3105
|
+
const __vue_scope_id__$A = "data-v-3b9218e2";
|
|
3109
3106
|
/* module identifier */
|
|
3110
3107
|
const __vue_module_identifier__$A = undefined;
|
|
3111
3108
|
/* functional template */
|
|
@@ -3671,7 +3668,7 @@ var script$y = {
|
|
|
3671
3668
|
executeExpression(expression, dataSource = {}) {
|
|
3672
3669
|
if (type.isBool(expression)) return expression;
|
|
3673
3670
|
if (type.isEmpty(expression)) return false;
|
|
3674
|
-
return parse(expression, {
|
|
3671
|
+
return parse$1(expression, {
|
|
3675
3672
|
...this.expressionData,
|
|
3676
3673
|
...this.formModels(),
|
|
3677
3674
|
...dataSource
|
|
@@ -4014,7 +4011,7 @@ var script$x = {
|
|
|
4014
4011
|
executeExpression(expression) {
|
|
4015
4012
|
if (type.isBool(expression)) return expression;
|
|
4016
4013
|
if (type.isEmpty(expression)) return false;
|
|
4017
|
-
return parse(expression, {
|
|
4014
|
+
return parse$1(expression, {
|
|
4018
4015
|
...this.expressionData
|
|
4019
4016
|
});
|
|
4020
4017
|
},
|
|
@@ -4386,7 +4383,7 @@ var script$v = {
|
|
|
4386
4383
|
executeExpression(expression) {
|
|
4387
4384
|
if (type.isBool(expression)) return expression;
|
|
4388
4385
|
if (type.isEmpty(expression)) return false;
|
|
4389
|
-
return parse(expression, {
|
|
4386
|
+
return parse$1(expression, {
|
|
4390
4387
|
...this.getFieldsValue(),
|
|
4391
4388
|
_route: this.$route.query,
|
|
4392
4389
|
_routeMeta: this.$route.meta
|
|
@@ -11794,7 +11791,7 @@ var script$b = {
|
|
|
11794
11791
|
buildDefaultValue(arg) {
|
|
11795
11792
|
if (type.notStr(arg)) return arg;
|
|
11796
11793
|
if (!arg || arg.charAt(0) !== '_') return arg;
|
|
11797
|
-
return parse(arg, {
|
|
11794
|
+
return parse$1(arg, {
|
|
11798
11795
|
_route: this.$route.query
|
|
11799
11796
|
});
|
|
11800
11797
|
},
|
|
@@ -12142,18 +12139,20 @@ var script$a = {
|
|
|
12142
12139
|
},
|
|
12143
12140
|
computed: {
|
|
12144
12141
|
callContext() {
|
|
12145
|
-
return
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12142
|
+
return this[CONTEXT].call(this);
|
|
12143
|
+
},
|
|
12144
|
+
currentExposed() {
|
|
12145
|
+
const exposed = Object.assign({}, this.callContext.exposed || {}, {
|
|
12146
|
+
[AREA_NAMES.BUTTON_GROUP]: {
|
|
12147
|
+
setModalConfirm: this.setModalConfirm
|
|
12150
12148
|
}
|
|
12151
12149
|
});
|
|
12150
|
+
return exposed;
|
|
12152
12151
|
},
|
|
12153
12152
|
contextData() {
|
|
12154
12153
|
return {
|
|
12155
|
-
...this.
|
|
12156
|
-
|
|
12154
|
+
...this.currentContext,
|
|
12155
|
+
exposed: this.currentExposed
|
|
12157
12156
|
};
|
|
12158
12157
|
},
|
|
12159
12158
|
overrideButtonEvent() {
|
|
@@ -12224,7 +12223,8 @@ var script$a = {
|
|
|
12224
12223
|
currentContext() {
|
|
12225
12224
|
return {
|
|
12226
12225
|
_route: this.$route.query,
|
|
12227
|
-
_routeMeta: this.$route.meta
|
|
12226
|
+
_routeMeta: this.$route.meta,
|
|
12227
|
+
...this.callContext
|
|
12228
12228
|
};
|
|
12229
12229
|
}
|
|
12230
12230
|
},
|
|
@@ -12254,7 +12254,7 @@ var script$a = {
|
|
|
12254
12254
|
executeExpression(expression) {
|
|
12255
12255
|
if (type.isBool(expression)) return expression;
|
|
12256
12256
|
if (type.isEmpty(expression)) return true;
|
|
12257
|
-
return parse(expression, {
|
|
12257
|
+
return parse$1(expression, {
|
|
12258
12258
|
...this.currentContext,
|
|
12259
12259
|
...this.contextData
|
|
12260
12260
|
});
|
|
@@ -12333,11 +12333,11 @@ __vue_render__$a._withStripped = true;
|
|
|
12333
12333
|
/* style */
|
|
12334
12334
|
const __vue_inject_styles__$a = function (inject) {
|
|
12335
12335
|
if (!inject) return
|
|
12336
|
-
inject("data-v-
|
|
12336
|
+
inject("data-v-1f716980_0", { source: ".button-group__wrapper[data-v-1f716980] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-1f716980] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-1f716980]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/composite-components/button-group/src/index.vue","index.vue"],"names":[],"mappings":"AA4IA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;AC3IA;AD4IA;EACA,gBAAA;AC1IA;AD2IA;EACA,cAAA;ACzIA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"button-group__wrapper\">\n <template v-for=\"(item, idx) in innerDatasource\" >\n <ele-button\n v-if=\"isBool(item._show) ? item._show : true\"\n :type=\"item.type\"\n :icon=\"item.icon\"\n :mode=\"item.mode\"\n :data-source=\"item.optionList\"\n :event-name=\"item.eventName\"\n :record=\"item\"\n v-on=\"overrideButtonEvent\"\n :key=\"idx\">\n {{ item.label }}\n </ele-button>\n </template>\n <ele-modal-confirm v-model=\"modalConfirmValue\" :contextProp=\"currentContext\" v-on=\"overrideModalConfirmEvent\" v-bind=\"modalConfirmMeta\"></ele-modal-confirm>\n </div>\n</template>\n\n<script>\nimport { type, util } from '@idooel/shared'\nimport { parse } from '@idooel/expression'\nimport { CONTEXT, AREA_NAMES } from '../../../utils'\nexport default {\n name: 'ele-button-group',\n props: {\n dataSource: {\n type: Array,\n default: () => []\n }\n },\n data() {\n return {\n innerDatasource: [],\n modalConfirmValue: false,\n modalConfirmMeta: {}\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n computed: {\n callContext () {\n return this[CONTEXT].call(this)\n },\n currentExposed () {\n const exposed = Object.assign({}, this.callContext.exposed || {}, { [AREA_NAMES.BUTTON_GROUP]: { setModalConfirm: this.setModalConfirm } })\n return exposed\n },\n contextData () {\n return {\n ...this.currentContext,\n exposed: this.currentExposed\n }\n },\n overrideButtonEvent () {\n const events = this.dataSource.reduce((ret, item) => {\n const { mode, optionList = [] } = item\n if (mode == 'dropdown') {\n optionList.forEach(props => {\n ret[props.eventName || 'click'] = (e) => {\n const { modalConfirm } = props\n modalConfirm && (this.modalConfirmMeta = modalConfirm)\n if (this.preventModalConfirm(modalConfirm)) {\n this.$emit(props.eventName || 'click', { ...e, ...props, record: props, ...this.contextData })\n return\n }\n modalConfirm && (this.modalConfirmValue = true)\n this.$emit(props.eventName || 'click', { ...e, ...props, record: props, ...this.contextData })\n }\n })\n }\n ret[item.eventName || 'click'] = (e) => {\n const { modalConfirm } = item\n modalConfirm && (this.modalConfirmMeta = modalConfirm)\n if (this.preventModalConfirm(modalConfirm)) {\n this.$emit(item.eventName || 'click', { ...e, record: item, ...this.contextData })\n return\n }\n modalConfirm && (this.modalConfirmValue = true)\n this.$emit(item.eventName || 'click', { ...e, record: item, ...this.contextData })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n ...this.contextData\n }\n },\n overrideModalConfirmEvent () {\n return {\n ...this.$listeners\n }\n },\n currentContext () {\n return {\n _route: this.$route.query,\n _routeMeta: this.$route.meta,\n ...this.callContext\n }\n }\n },\n watch: {\n dataSource: {\n handler (dataSource) {\n this.innerDatasource = dataSource.map(item => {\n return {\n ...item,\n _show: this.executeExpression(item.show)\n }\n })\n },\n immediate: true\n }\n },\n methods: {\n setModalConfirm (arg = false) {\n this.modalConfirmValue = arg\n },\n preventModalConfirm (modalConfirm = {}) {\n const { show } = modalConfirm\n return !this.executeExpression(show)\n },\n executeExpression (expression) {\n if (type.isBool(expression)) return expression\n if (type.isEmpty(expression)) return true\n return parse(expression, { ...this.currentContext, ...this.contextData })\n },\n isBool (arg) {\n return type.isBool(arg)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n .ant-btn {\n margin-left: 8px;\n &:first-child {\n margin-left: 0;\n }\n }\n}\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 });
|
|
12337
12337
|
|
|
12338
12338
|
};
|
|
12339
12339
|
/* scoped */
|
|
12340
|
-
const __vue_scope_id__$a = "data-v-
|
|
12340
|
+
const __vue_scope_id__$a = "data-v-1f716980";
|
|
12341
12341
|
/* module identifier */
|
|
12342
12342
|
const __vue_module_identifier__$a = undefined;
|
|
12343
12343
|
/* functional template */
|
|
@@ -12536,7 +12536,7 @@ var script$9 = {
|
|
|
12536
12536
|
executeExpression(expression, dataSource = {}) {
|
|
12537
12537
|
if (type.isBool(expression)) return expression;
|
|
12538
12538
|
if (type.isEmpty(expression)) return false;
|
|
12539
|
-
return parse(expression, {
|
|
12539
|
+
return parse$1(expression, {
|
|
12540
12540
|
...this.expressionData,
|
|
12541
12541
|
...this.formModels(),
|
|
12542
12542
|
...dataSource
|
|
@@ -13033,14 +13033,25 @@ var script$6 = {
|
|
|
13033
13033
|
},
|
|
13034
13034
|
data() {
|
|
13035
13035
|
return {
|
|
13036
|
-
currentTableSelection: null
|
|
13036
|
+
currentTableSelection: null,
|
|
13037
|
+
currentExposed: {}
|
|
13037
13038
|
};
|
|
13038
13039
|
},
|
|
13040
|
+
inject: {
|
|
13041
|
+
[CONTEXT]: {
|
|
13042
|
+
default: () => () => ({})
|
|
13043
|
+
}
|
|
13044
|
+
},
|
|
13039
13045
|
computed: {
|
|
13046
|
+
callContext() {
|
|
13047
|
+
return this[CONTEXT].call(this);
|
|
13048
|
+
},
|
|
13040
13049
|
exposed() {
|
|
13041
13050
|
return {
|
|
13042
13051
|
closeModal: this.closeModal,
|
|
13043
|
-
currentTableSelection: this.currentTableSelection
|
|
13052
|
+
currentTableSelection: this.currentTableSelection,
|
|
13053
|
+
...this.callContext,
|
|
13054
|
+
exposed: this.currentExposed
|
|
13044
13055
|
};
|
|
13045
13056
|
},
|
|
13046
13057
|
assignAttrForEvents() {
|
|
@@ -13048,7 +13059,7 @@ var script$6 = {
|
|
|
13048
13059
|
ret[ele.eventName] = e => {
|
|
13049
13060
|
this.$emit(ele.eventName || 'click', {
|
|
13050
13061
|
...e,
|
|
13051
|
-
|
|
13062
|
+
...this.exposed
|
|
13052
13063
|
});
|
|
13053
13064
|
};
|
|
13054
13065
|
return ret;
|
|
@@ -13113,6 +13124,12 @@ var script$6 = {
|
|
|
13113
13124
|
},
|
|
13114
13125
|
onChangeTableSelection(selection) {
|
|
13115
13126
|
this.currentTableSelection = selection;
|
|
13127
|
+
},
|
|
13128
|
+
onAbstractEvent(props = {}) {
|
|
13129
|
+
const {
|
|
13130
|
+
exposed
|
|
13131
|
+
} = props;
|
|
13132
|
+
this.currentExposed = Object.assign({}, exposed);
|
|
13116
13133
|
}
|
|
13117
13134
|
}
|
|
13118
13135
|
};
|
|
@@ -13145,7 +13162,10 @@ var __vue_render__$6 = function () {
|
|
|
13145
13162
|
_vm._b(
|
|
13146
13163
|
{
|
|
13147
13164
|
attrs: { "over-height": 156 },
|
|
13148
|
-
on: {
|
|
13165
|
+
on: {
|
|
13166
|
+
"on-change-table-selection": _vm.onChangeTableSelection,
|
|
13167
|
+
"x:refresh-exposed": _vm.onAbstractEvent,
|
|
13168
|
+
},
|
|
13149
13169
|
scopedSlots: _vm._u(
|
|
13150
13170
|
[
|
|
13151
13171
|
_vm.$slots["sub-center"]
|
|
@@ -13179,11 +13199,11 @@ __vue_render__$6._withStripped = true;
|
|
|
13179
13199
|
/* style */
|
|
13180
13200
|
const __vue_inject_styles__$6 = function (inject) {
|
|
13181
13201
|
if (!inject) return
|
|
13182
|
-
inject("data-v-
|
|
13202
|
+
inject("data-v-7474bc94_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
13183
13203
|
|
|
13184
13204
|
};
|
|
13185
13205
|
/* scoped */
|
|
13186
|
-
const __vue_scope_id__$6 = "data-v-
|
|
13206
|
+
const __vue_scope_id__$6 = "data-v-7474bc94";
|
|
13187
13207
|
/* module identifier */
|
|
13188
13208
|
const __vue_module_identifier__$6 = undefined;
|
|
13189
13209
|
/* functional template */
|