@idooel/components 0.0.2-beta.4 → 0.0.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@idooel/components.esm.js +1449 -663
- package/dist/@idooel/components.umd.js +1449 -663
- package/package.json +10 -2
- package/packages/upload/src/index.vue +537 -205
- package/vitest.config.js +17 -0
|
@@ -2,411 +2,853 @@ 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
|
-
|
|
5
|
+
var __defProp$2 = Object.defineProperty;
|
|
6
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value
|
|
11
|
+
}) : obj[key] = value;
|
|
12
|
+
var __publicField$2 = (obj, key, value) => {
|
|
13
|
+
__defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
14
|
+
return value;
|
|
11
15
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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";
|
|
16
|
+
class LexerError extends Error {
|
|
17
|
+
constructor(message, index, line, column) {
|
|
18
|
+
super(message);
|
|
19
|
+
__publicField$2(this, "index");
|
|
20
|
+
__publicField$2(this, "line");
|
|
21
|
+
__publicField$2(this, "column");
|
|
22
|
+
this.name = "LexerError";
|
|
23
|
+
this.index = index;
|
|
24
|
+
this.line = line;
|
|
25
|
+
this.column = column;
|
|
26
|
+
}
|
|
38
27
|
}
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
class ParseError extends Error {
|
|
29
|
+
constructor(message, index, line, column) {
|
|
30
|
+
super(message);
|
|
31
|
+
__publicField$2(this, "index");
|
|
32
|
+
__publicField$2(this, "line");
|
|
33
|
+
__publicField$2(this, "column");
|
|
34
|
+
this.name = "ParseError";
|
|
35
|
+
this.index = index;
|
|
36
|
+
this.line = line;
|
|
37
|
+
this.column = column;
|
|
38
|
+
}
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
class EvalError extends Error {
|
|
41
|
+
constructor(message) {
|
|
42
|
+
super(message);
|
|
43
|
+
this.name = "EvalError";
|
|
44
|
+
}
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
46
|
+
var TokenKind = /* @__PURE__ */(TokenKind2 => {
|
|
47
|
+
TokenKind2["Identifier"] = "Identifier";
|
|
48
|
+
TokenKind2["Number"] = "Number";
|
|
49
|
+
TokenKind2["String"] = "String";
|
|
50
|
+
TokenKind2["Punctuator"] = "Punctuator";
|
|
51
|
+
TokenKind2["Operator"] = "Operator";
|
|
52
|
+
TokenKind2["EOF"] = "EOF";
|
|
53
|
+
return TokenKind2;
|
|
54
|
+
})(TokenKind || {});
|
|
55
|
+
const PUNCTUATORS = /* @__PURE__ */new Set(["(", ")", "{", "}", "[", "]", ".", ",", ":", "?"]);
|
|
56
|
+
const MULTI_OPERATORS = ["?.", "??", "===", "!==", "==", "!=", "<=", ">=", "&&", "||"];
|
|
57
|
+
const SINGLE_OPERATORS = /* @__PURE__ */new Set(["+", "-", "*", "/", "%", "<", ">", "!"]);
|
|
58
|
+
function isDigit(ch) {
|
|
59
|
+
return ch >= "0" && ch <= "9";
|
|
60
|
+
}
|
|
61
|
+
function isIdentStart(ch) {
|
|
62
|
+
return ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z" || ch === "_" || ch === "$";
|
|
63
|
+
}
|
|
64
|
+
function isIdentPart(ch) {
|
|
65
|
+
return isIdentStart(ch) || isDigit(ch);
|
|
66
|
+
}
|
|
67
|
+
function lex(input) {
|
|
68
|
+
if (!input && input !== "") throw new LexerError("invalid input", 0, 1, 1);
|
|
69
|
+
const tokens = [];
|
|
70
|
+
let index = 0;
|
|
71
|
+
let line = 1;
|
|
72
|
+
let column = 1;
|
|
73
|
+
function current() {
|
|
74
|
+
return input.charAt(index);
|
|
75
|
+
}
|
|
76
|
+
function advance(n = 1) {
|
|
77
|
+
for (let i = 0; i < n; i++) {
|
|
78
|
+
const ch = input.charAt(index++);
|
|
79
|
+
if (ch === "\n") {
|
|
80
|
+
line++;
|
|
81
|
+
column = 1;
|
|
82
|
+
} else {
|
|
83
|
+
column++;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function make(kind, text, value, startIndex, startLine, startColumn) {
|
|
88
|
+
return {
|
|
89
|
+
kind,
|
|
90
|
+
text,
|
|
91
|
+
value,
|
|
92
|
+
index: startIndex ?? index,
|
|
93
|
+
line: startLine ?? line,
|
|
94
|
+
column: startColumn ?? column
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
while (index < input.length) {
|
|
98
|
+
const ch = current();
|
|
99
|
+
if (ch === " " || ch === " " || ch === "\r" || ch === "\n" || ch === "\v" || ch === "\xA0") {
|
|
100
|
+
advance();
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (ch === "'" || ch === '"') {
|
|
104
|
+
const quote = ch;
|
|
105
|
+
const startIndex = index;
|
|
106
|
+
const startLine = line;
|
|
107
|
+
const startColumn = column;
|
|
108
|
+
advance();
|
|
109
|
+
let value = "";
|
|
110
|
+
let escaped = false;
|
|
111
|
+
while (index < input.length) {
|
|
112
|
+
const c = current();
|
|
113
|
+
if (escaped) {
|
|
114
|
+
if (c === "u") {
|
|
115
|
+
const hex = input.substring(index + 1, index + 5);
|
|
116
|
+
if (!/^[\da-f]{4}$/i.test(hex)) {
|
|
117
|
+
throw new LexerError(`invalid unicode escape \\u${hex}`, index, line, column);
|
|
75
118
|
}
|
|
76
|
-
|
|
77
|
-
|
|
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;
|
|
119
|
+
value += String.fromCharCode(parseInt(hex, 16));
|
|
120
|
+
advance(5);
|
|
88
121
|
} else {
|
|
89
|
-
|
|
122
|
+
const ESCAPE = {
|
|
123
|
+
n: "\n",
|
|
124
|
+
f: "\f",
|
|
125
|
+
r: "\r",
|
|
126
|
+
t: " ",
|
|
127
|
+
v: "\v"
|
|
128
|
+
};
|
|
129
|
+
value += ESCAPE[c] ?? c;
|
|
130
|
+
advance();
|
|
90
131
|
}
|
|
91
|
-
|
|
132
|
+
escaped = false;
|
|
133
|
+
continue;
|
|
92
134
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
135
|
+
if (c === "\\") {
|
|
136
|
+
escaped = true;
|
|
137
|
+
advance();
|
|
138
|
+
continue;
|
|
97
139
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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++;
|
|
140
|
+
if (c === quote) {
|
|
141
|
+
advance();
|
|
142
|
+
tokens.push(make("String" /* String */, input.slice(startIndex, index), value, startIndex, startLine, startColumn));
|
|
143
|
+
value = "";
|
|
144
|
+
break;
|
|
118
145
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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++;
|
|
146
|
+
value += c;
|
|
147
|
+
advance();
|
|
148
|
+
}
|
|
149
|
+
if (value !== "") {
|
|
150
|
+
const last = tokens[tokens.length - 1];
|
|
151
|
+
if (!last || last.index !== startIndex) {
|
|
152
|
+
throw new LexerError("unterminated string", startIndex, startLine, startColumn);
|
|
133
153
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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;
|
|
154
|
+
}
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (isDigit(ch) || ch === "." && isDigit(input.charAt(index + 1))) {
|
|
158
|
+
const startIndex = index;
|
|
159
|
+
const startLine = line;
|
|
160
|
+
const startColumn = column;
|
|
161
|
+
let text = "";
|
|
162
|
+
while (index < input.length) {
|
|
163
|
+
let c = input.charAt(index).toLowerCase();
|
|
164
|
+
if (c === "." || isDigit(c)) {
|
|
165
|
+
text += c;
|
|
161
166
|
} else {
|
|
162
|
-
|
|
167
|
+
const c2 = input.charAt(index + 1);
|
|
168
|
+
if (c === "e" && (c2 === "+" || c2 === "-" || isDigit(c2))) {
|
|
169
|
+
text += c;
|
|
170
|
+
} else if ((c === "+" || c === "-") && isDigit(c2) && text.charAt(text.length - 1) === "e") {
|
|
171
|
+
text += c;
|
|
172
|
+
} else if ((c === "+" || c === "-") && (!c2 || !isDigit(c2)) && text.charAt(text.length - 1) === "e") {
|
|
173
|
+
throw new LexerError("dangling exponent", index, line, column);
|
|
174
|
+
} else {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
163
177
|
}
|
|
178
|
+
advance();
|
|
179
|
+
}
|
|
180
|
+
tokens.push(make("Number" /* Number */, text, Number(text), startIndex, startLine, startColumn));
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (isIdentStart(ch)) {
|
|
184
|
+
const startIndex = index;
|
|
185
|
+
const startLine = line;
|
|
186
|
+
const startColumn = column;
|
|
187
|
+
advance();
|
|
188
|
+
while (index < input.length && isIdentPart(current())) advance();
|
|
189
|
+
const text = input.slice(startIndex, index);
|
|
190
|
+
tokens.push(make("Identifier" /* Identifier */, text, void 0, startIndex, startLine, startColumn));
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const three = input.substring(index, index + 3);
|
|
194
|
+
const two = input.substring(index, index + 2);
|
|
195
|
+
const one = input.substring(index, index + 1);
|
|
196
|
+
const multi = MULTI_OPERATORS.find(op => input.startsWith(op, index));
|
|
197
|
+
if (multi) {
|
|
198
|
+
tokens.push(make("Operator" /* Operator */, multi, void 0, index, line, column));
|
|
199
|
+
advance(multi.length);
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (PUNCTUATORS.has(one)) {
|
|
203
|
+
tokens.push(make("Punctuator" /* Punctuator */, one, void 0, index, line, column));
|
|
204
|
+
advance();
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (SINGLE_OPERATORS.has(one)) {
|
|
208
|
+
tokens.push(make("Operator" /* Operator */, one, void 0, index, line, column));
|
|
209
|
+
advance();
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
throw new LexerError(`invalid token '${three || two || one}'`, index, line, column);
|
|
213
|
+
}
|
|
214
|
+
tokens.push({
|
|
215
|
+
kind: "EOF" /* EOF */,
|
|
216
|
+
text: "<eof>",
|
|
217
|
+
index,
|
|
218
|
+
line,
|
|
219
|
+
column
|
|
220
|
+
});
|
|
221
|
+
return {
|
|
222
|
+
tokens
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
var __defProp$1 = Object.defineProperty;
|
|
226
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
configurable: true,
|
|
229
|
+
writable: true,
|
|
230
|
+
value
|
|
231
|
+
}) : obj[key] = value;
|
|
232
|
+
var __publicField$1 = (obj, key, value) => {
|
|
233
|
+
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
234
|
+
return value;
|
|
235
|
+
};
|
|
236
|
+
class LRUCache {
|
|
237
|
+
constructor(maxSize = 100) {
|
|
238
|
+
__publicField$1(this, "cache", /* @__PURE__ */new Map());
|
|
239
|
+
__publicField$1(this, "maxSize");
|
|
240
|
+
this.maxSize = maxSize;
|
|
241
|
+
}
|
|
242
|
+
get(key) {
|
|
243
|
+
const value = this.cache.get(key);
|
|
244
|
+
if (value !== void 0) {
|
|
245
|
+
this.cache.delete(key);
|
|
246
|
+
this.cache.set(key, value);
|
|
247
|
+
}
|
|
248
|
+
return value;
|
|
249
|
+
}
|
|
250
|
+
set(key, value) {
|
|
251
|
+
if (this.cache.has(key)) {
|
|
252
|
+
this.cache.delete(key);
|
|
253
|
+
}
|
|
254
|
+
if (this.cache.size >= this.maxSize) {
|
|
255
|
+
const firstKey = this.cache.keys().next().value;
|
|
256
|
+
if (firstKey !== void 0) {
|
|
257
|
+
this.cache.delete(firstKey);
|
|
164
258
|
}
|
|
165
259
|
}
|
|
260
|
+
this.cache.set(key, value);
|
|
261
|
+
}
|
|
262
|
+
clear() {
|
|
263
|
+
this.cache.clear();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const astCache = new LRUCache(100);
|
|
267
|
+
function parseToAst(input) {
|
|
268
|
+
const cached = astCache.get(input);
|
|
269
|
+
if (cached !== void 0) {
|
|
270
|
+
return cached;
|
|
271
|
+
}
|
|
272
|
+
const {
|
|
273
|
+
tokens
|
|
274
|
+
} = lex(input);
|
|
275
|
+
const state = new Parser(tokens, input);
|
|
276
|
+
const result = state.parse();
|
|
277
|
+
astCache.set(input, result);
|
|
278
|
+
return result;
|
|
279
|
+
}
|
|
280
|
+
class Parser {
|
|
281
|
+
constructor(tokens, input) {
|
|
282
|
+
__publicField$1(this, "tokens");
|
|
283
|
+
__publicField$1(this, "input");
|
|
284
|
+
__publicField$1(this, "i", 0);
|
|
166
285
|
this.tokens = tokens;
|
|
167
|
-
|
|
286
|
+
this.input = input;
|
|
168
287
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
288
|
+
current() {
|
|
289
|
+
return this.tokens[this.i];
|
|
290
|
+
}
|
|
291
|
+
next() {
|
|
292
|
+
return this.tokens[this.i + 1];
|
|
293
|
+
}
|
|
294
|
+
eat() {
|
|
295
|
+
return this.tokens[this.i++];
|
|
296
|
+
}
|
|
297
|
+
matchText(text) {
|
|
298
|
+
return this.current()?.text === text;
|
|
178
299
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return
|
|
300
|
+
expectText(text) {
|
|
301
|
+
const t = this.current();
|
|
302
|
+
if (!text || t?.text === text) {
|
|
303
|
+
this.i++;
|
|
304
|
+
return t;
|
|
184
305
|
}
|
|
306
|
+
return void 0;
|
|
185
307
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
308
|
+
consumeText(text) {
|
|
309
|
+
const t = this.expectText(text);
|
|
310
|
+
if (!t) this.error(this.current(), `unexpected token, expect '${text ?? "<any>"}'`);
|
|
311
|
+
return t;
|
|
312
|
+
}
|
|
313
|
+
error(t, message) {
|
|
314
|
+
throw new ParseError(`${message} at ${t.line}:${t.column}`, t.index, t.line, t.column);
|
|
315
|
+
}
|
|
316
|
+
parse() {
|
|
317
|
+
const t = this.current();
|
|
318
|
+
if (t && t.kind !== TokenKind.EOF && t.text !== "}" && t.text !== ")" && t.text !== "]") {
|
|
319
|
+
const expr = this.expression();
|
|
320
|
+
return expr;
|
|
321
|
+
}
|
|
322
|
+
return void 0;
|
|
191
323
|
}
|
|
192
324
|
expression() {
|
|
193
325
|
return this.ternary();
|
|
194
326
|
}
|
|
195
327
|
ternary() {
|
|
196
|
-
|
|
197
|
-
if (this.
|
|
198
|
-
|
|
199
|
-
this.
|
|
200
|
-
|
|
201
|
-
|
|
328
|
+
const test = this.nullish();
|
|
329
|
+
if (this.expectText("?")) {
|
|
330
|
+
const consequent = this.expression();
|
|
331
|
+
this.consumeText(":");
|
|
332
|
+
const alternate = this.expression();
|
|
333
|
+
const node = {
|
|
334
|
+
type: "ConditionalExpression",
|
|
335
|
+
test,
|
|
336
|
+
consequent,
|
|
337
|
+
alternate
|
|
338
|
+
};
|
|
339
|
+
return node;
|
|
202
340
|
}
|
|
203
|
-
return
|
|
341
|
+
return test;
|
|
204
342
|
}
|
|
205
|
-
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
343
|
+
nullish() {
|
|
344
|
+
let left = this.logicalOR();
|
|
345
|
+
while (this.expectText("??")) {
|
|
346
|
+
if (isLogicalAndOr(left)) {
|
|
347
|
+
this.error(this.current(), "Cannot mix ?? with && or || without parentheses");
|
|
348
|
+
}
|
|
349
|
+
const rightStart = this.current();
|
|
350
|
+
const right = this.logicalOR();
|
|
351
|
+
if (isLogicalAndOr(right)) {
|
|
352
|
+
this.error(rightStart, "Cannot mix ?? with && or || without parentheses");
|
|
353
|
+
}
|
|
354
|
+
const node = {
|
|
355
|
+
type: "LogicalExpression",
|
|
356
|
+
operator: "??",
|
|
357
|
+
left,
|
|
358
|
+
right
|
|
359
|
+
};
|
|
360
|
+
left = node;
|
|
221
361
|
}
|
|
362
|
+
return left;
|
|
222
363
|
}
|
|
223
364
|
logicalOR() {
|
|
224
365
|
let left = this.logicalAND();
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
366
|
+
while (this.expectText("||")) {
|
|
367
|
+
const right = this.logicalAND();
|
|
368
|
+
const node = {
|
|
369
|
+
type: "LogicalExpression",
|
|
370
|
+
operator: "||",
|
|
371
|
+
left,
|
|
372
|
+
right
|
|
373
|
+
};
|
|
374
|
+
left = node;
|
|
228
375
|
}
|
|
229
376
|
return left;
|
|
230
377
|
}
|
|
231
378
|
logicalAND() {
|
|
232
379
|
let left = this.equality();
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
380
|
+
while (this.expectText("&&")) {
|
|
381
|
+
const right = this.equality();
|
|
382
|
+
const node = {
|
|
383
|
+
type: "LogicalExpression",
|
|
384
|
+
operator: "&&",
|
|
385
|
+
left,
|
|
386
|
+
right
|
|
387
|
+
};
|
|
388
|
+
left = node;
|
|
236
389
|
}
|
|
237
390
|
return left;
|
|
238
391
|
}
|
|
239
392
|
equality() {
|
|
240
393
|
let left = this.relational();
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
394
|
+
while (true) {
|
|
395
|
+
if (this.expectText("===")) {
|
|
396
|
+
left = this.binary(left, "===", this.relational());
|
|
397
|
+
} else if (this.expectText("!==")) {
|
|
398
|
+
left = this.binary(left, "!==", this.relational());
|
|
399
|
+
} else if (this.expectText("==")) {
|
|
400
|
+
left = this.binary(left, "==", this.relational());
|
|
401
|
+
} else if (this.expectText("!=")) {
|
|
402
|
+
left = this.binary(left, "!=", this.relational());
|
|
403
|
+
} else break;
|
|
244
404
|
}
|
|
245
405
|
return left;
|
|
246
406
|
}
|
|
247
407
|
relational() {
|
|
248
408
|
let left = this.additive();
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
409
|
+
while (true) {
|
|
410
|
+
if (this.expectText("<=")) {
|
|
411
|
+
left = this.binary(left, "<=", this.additive());
|
|
412
|
+
} else if (this.expectText(">=")) {
|
|
413
|
+
left = this.binary(left, ">=", this.additive());
|
|
414
|
+
} else if (this.expectText("<")) {
|
|
415
|
+
left = this.binary(left, "<", this.additive());
|
|
416
|
+
} else if (this.expectText(">")) {
|
|
417
|
+
left = this.binary(left, ">", this.additive());
|
|
418
|
+
} else break;
|
|
252
419
|
}
|
|
253
420
|
return left;
|
|
254
421
|
}
|
|
255
422
|
additive() {
|
|
256
423
|
let left = this.multiplicative();
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
424
|
+
while (true) {
|
|
425
|
+
if (this.expectText("+")) {
|
|
426
|
+
left = this.binary(left, "+", this.multiplicative());
|
|
427
|
+
} else if (this.expectText("-")) {
|
|
428
|
+
left = this.binary(left, "-", this.multiplicative());
|
|
429
|
+
} else break;
|
|
260
430
|
}
|
|
261
431
|
return left;
|
|
262
432
|
}
|
|
263
433
|
multiplicative() {
|
|
264
434
|
let left = this.unary();
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
435
|
+
while (true) {
|
|
436
|
+
if (this.expectText("*")) {
|
|
437
|
+
left = this.binary(left, "*", this.unary());
|
|
438
|
+
} else if (this.expectText("/")) {
|
|
439
|
+
left = this.binary(left, "/", this.unary());
|
|
440
|
+
} else if (this.expectText("%")) {
|
|
441
|
+
left = this.binary(left, "%", this.unary());
|
|
442
|
+
} else break;
|
|
268
443
|
}
|
|
269
444
|
return left;
|
|
270
445
|
}
|
|
446
|
+
unary() {
|
|
447
|
+
if (this.expectText("+")) {
|
|
448
|
+
return this.primary();
|
|
449
|
+
}
|
|
450
|
+
if (this.expectText("-")) {
|
|
451
|
+
const arg = this.unary();
|
|
452
|
+
const node = {
|
|
453
|
+
type: "UnaryExpression",
|
|
454
|
+
operator: "-",
|
|
455
|
+
argument: arg
|
|
456
|
+
};
|
|
457
|
+
return node;
|
|
458
|
+
}
|
|
459
|
+
if (this.expectText("!")) {
|
|
460
|
+
const arg = this.unary();
|
|
461
|
+
const node = {
|
|
462
|
+
type: "UnaryExpression",
|
|
463
|
+
operator: "!",
|
|
464
|
+
argument: arg
|
|
465
|
+
};
|
|
466
|
+
return node;
|
|
467
|
+
}
|
|
468
|
+
return this.primary();
|
|
469
|
+
}
|
|
271
470
|
primary() {
|
|
272
|
-
|
|
273
|
-
let
|
|
274
|
-
if (this.
|
|
275
|
-
|
|
276
|
-
this.
|
|
277
|
-
} else if (this.
|
|
278
|
-
|
|
279
|
-
} else if (this.
|
|
280
|
-
|
|
281
|
-
} else if (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
471
|
+
const t = this.current();
|
|
472
|
+
let expr;
|
|
473
|
+
if (this.expectText("(")) {
|
|
474
|
+
expr = this.expression();
|
|
475
|
+
this.consumeText(")");
|
|
476
|
+
} else if (this.expectText("[")) {
|
|
477
|
+
expr = this.array();
|
|
478
|
+
} else if (this.expectText("{")) {
|
|
479
|
+
expr = this.object();
|
|
480
|
+
} else if (t.kind === TokenKind.Identifier && (t.text === "true" || t.text === "false" || t.text === "null" || t.text === "undefined")) {
|
|
481
|
+
const tok = this.eat();
|
|
482
|
+
const map = {
|
|
483
|
+
true: true,
|
|
484
|
+
false: false,
|
|
485
|
+
null: null,
|
|
486
|
+
undefined: void 0
|
|
487
|
+
};
|
|
488
|
+
const node = {
|
|
489
|
+
type: "Literal",
|
|
490
|
+
value: map[tok.text]
|
|
491
|
+
};
|
|
492
|
+
expr = node;
|
|
493
|
+
} else if (t.kind === TokenKind.Identifier) {
|
|
494
|
+
expr = this.identifier();
|
|
495
|
+
} else if (t.kind === TokenKind.Number || t.kind === TokenKind.String) {
|
|
496
|
+
const tok = this.eat();
|
|
497
|
+
const node = {
|
|
498
|
+
type: "Literal",
|
|
499
|
+
value: tok.kind === TokenKind.Number ? Number(tok.text) : String(tok.value)
|
|
500
|
+
};
|
|
501
|
+
expr = node;
|
|
287
502
|
} else {
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
503
|
+
this.error(t, "unexpected token in primary");
|
|
504
|
+
}
|
|
505
|
+
while (true) {
|
|
506
|
+
if (this.expectText("(")) {
|
|
507
|
+
const args = [];
|
|
508
|
+
if (!this.matchText(")")) {
|
|
509
|
+
do {
|
|
510
|
+
args.push(this.expression());
|
|
511
|
+
} while (this.expectText(","));
|
|
512
|
+
}
|
|
513
|
+
this.consumeText(")");
|
|
514
|
+
const call = {
|
|
515
|
+
type: "CallExpression",
|
|
516
|
+
callee: expr,
|
|
517
|
+
arguments: args,
|
|
518
|
+
optional: false
|
|
519
|
+
};
|
|
520
|
+
expr = call;
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
if (this.expectText("?.(")) ;
|
|
524
|
+
if (this.expectText(".")) {
|
|
525
|
+
const id = this.consumeIdentifier();
|
|
526
|
+
const prop = {
|
|
527
|
+
type: "Identifier",
|
|
528
|
+
name: id
|
|
529
|
+
};
|
|
530
|
+
const mem = {
|
|
531
|
+
type: "MemberExpression",
|
|
532
|
+
object: expr,
|
|
533
|
+
property: prop,
|
|
534
|
+
computed: false,
|
|
535
|
+
optional: false
|
|
536
|
+
};
|
|
537
|
+
expr = mem;
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
if (this.expectText("[")) {
|
|
541
|
+
const prop = this.expression();
|
|
542
|
+
this.consumeText("]");
|
|
543
|
+
const mem = {
|
|
544
|
+
type: "MemberExpression",
|
|
545
|
+
object: expr,
|
|
546
|
+
property: prop,
|
|
547
|
+
computed: true,
|
|
548
|
+
optional: false
|
|
549
|
+
};
|
|
550
|
+
expr = mem;
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
if (this.matchText("?.")) {
|
|
554
|
+
this.eat();
|
|
555
|
+
if (this.expectText("(")) {
|
|
556
|
+
const args = [];
|
|
557
|
+
if (!this.matchText(")")) {
|
|
558
|
+
do {
|
|
559
|
+
args.push(this.expression());
|
|
560
|
+
} while (this.expectText(","));
|
|
561
|
+
}
|
|
562
|
+
this.consumeText(")");
|
|
563
|
+
const call = {
|
|
564
|
+
type: "CallExpression",
|
|
565
|
+
callee: expr,
|
|
566
|
+
arguments: args,
|
|
567
|
+
optional: true
|
|
568
|
+
};
|
|
569
|
+
expr = call;
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
if (this.expectText("[")) {
|
|
573
|
+
const prop2 = this.expression();
|
|
574
|
+
this.consumeText("]");
|
|
575
|
+
const mem2 = {
|
|
576
|
+
type: "MemberExpression",
|
|
577
|
+
object: expr,
|
|
578
|
+
property: prop2,
|
|
579
|
+
computed: true,
|
|
580
|
+
optional: true
|
|
581
|
+
};
|
|
582
|
+
expr = mem2;
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
const id = this.consumeIdentifier();
|
|
586
|
+
const prop = {
|
|
587
|
+
type: "Identifier",
|
|
588
|
+
name: id
|
|
589
|
+
};
|
|
590
|
+
const mem = {
|
|
591
|
+
type: "MemberExpression",
|
|
592
|
+
object: expr,
|
|
593
|
+
property: prop,
|
|
594
|
+
computed: false,
|
|
595
|
+
optional: true
|
|
596
|
+
};
|
|
597
|
+
expr = mem;
|
|
598
|
+
continue;
|
|
302
599
|
}
|
|
600
|
+
break;
|
|
303
601
|
}
|
|
304
|
-
return
|
|
602
|
+
return expr;
|
|
305
603
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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];
|
|
604
|
+
identifier() {
|
|
605
|
+
const name = this.consumeIdentifier();
|
|
606
|
+
const node = {
|
|
607
|
+
type: "Identifier",
|
|
608
|
+
name
|
|
320
609
|
};
|
|
610
|
+
return node;
|
|
321
611
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
if (
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
} while (this.expect(","));
|
|
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
|
-
};
|
|
612
|
+
consumeIdentifier() {
|
|
613
|
+
const t = this.current();
|
|
614
|
+
if (t.kind !== TokenKind.Identifier) this.error(t, "identifier expected");
|
|
615
|
+
this.eat();
|
|
616
|
+
return t.text;
|
|
335
617
|
}
|
|
336
618
|
array() {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
if (token.text !== "]") {
|
|
619
|
+
const elements = [];
|
|
620
|
+
if (!this.matchText("]")) {
|
|
340
621
|
do {
|
|
341
|
-
if (this.
|
|
622
|
+
if (this.matchText("]")) break;
|
|
342
623
|
elements.push(this.expression());
|
|
343
|
-
} while (this.
|
|
624
|
+
} while (this.expectText(","));
|
|
344
625
|
}
|
|
345
|
-
this.
|
|
346
|
-
return
|
|
626
|
+
this.consumeText("]");
|
|
627
|
+
return {
|
|
628
|
+
type: "ArrayExpression",
|
|
629
|
+
elements
|
|
630
|
+
};
|
|
347
631
|
}
|
|
348
632
|
object() {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
let token = this.tokens[0];
|
|
352
|
-
if (token.text !== "}") {
|
|
633
|
+
const properties = [];
|
|
634
|
+
if (!this.matchText("}")) {
|
|
353
635
|
do {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
values.push(this.expression());
|
|
366
|
-
} while (this.expect(","));
|
|
636
|
+
if (this.matchText("}")) break;
|
|
637
|
+
const keyTok = this.eat();
|
|
638
|
+
let key;
|
|
639
|
+
if (keyTok.kind === TokenKind.String) key = String(keyTok.value);else if (keyTok.kind === TokenKind.Identifier) key = keyTok.text;else this.error(keyTok, "invalid object key");
|
|
640
|
+
this.consumeText(":");
|
|
641
|
+
const value = this.expression();
|
|
642
|
+
properties.push({
|
|
643
|
+
key,
|
|
644
|
+
value
|
|
645
|
+
});
|
|
646
|
+
} while (this.expectText(","));
|
|
367
647
|
}
|
|
368
|
-
this.
|
|
369
|
-
return
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
object[keys[i]] = values[i](data);
|
|
373
|
-
}
|
|
374
|
-
return object;
|
|
648
|
+
this.consumeText("}");
|
|
649
|
+
return {
|
|
650
|
+
type: "ObjectExpression",
|
|
651
|
+
properties
|
|
375
652
|
};
|
|
376
653
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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];
|
|
654
|
+
binary(left, op, right) {
|
|
655
|
+
return {
|
|
656
|
+
type: "BinaryExpression",
|
|
657
|
+
operator: op,
|
|
658
|
+
left,
|
|
659
|
+
right
|
|
398
660
|
};
|
|
399
661
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
662
|
+
}
|
|
663
|
+
function isLogicalAndOr(node) {
|
|
664
|
+
return node.type === "LogicalExpression" && (node.operator === "&&" || node.operator === "||");
|
|
665
|
+
}
|
|
666
|
+
const DENY_KEYS = /* @__PURE__ */new Set(["__proto__", "prototype", "constructor"]);
|
|
667
|
+
let evalOptions = {};
|
|
668
|
+
let currentDepth = 0;
|
|
669
|
+
function evaluate(ast, scope, options) {
|
|
670
|
+
if (!ast) return void 0;
|
|
671
|
+
evalOptions = options || {};
|
|
672
|
+
currentDepth = 0;
|
|
673
|
+
return exec(ast, scope);
|
|
674
|
+
}
|
|
675
|
+
function exec(node, scope) {
|
|
676
|
+
const maxDepth = evalOptions.maxDepth || 100;
|
|
677
|
+
if (++currentDepth > maxDepth) {
|
|
678
|
+
currentDepth--;
|
|
679
|
+
if (evalOptions.strict) {
|
|
680
|
+
throw new EvalError(`Maximum recursion depth (${maxDepth}) exceeded`);
|
|
681
|
+
}
|
|
682
|
+
return void 0;
|
|
403
683
|
}
|
|
684
|
+
try {
|
|
685
|
+
switch (node.type) {
|
|
686
|
+
case "Literal":
|
|
687
|
+
return node.value;
|
|
688
|
+
case "Identifier":
|
|
689
|
+
return readIdentifier(node, scope);
|
|
690
|
+
case "MemberExpression":
|
|
691
|
+
return readMember(node, scope);
|
|
692
|
+
case "CallExpression":
|
|
693
|
+
return callExpression(node, scope);
|
|
694
|
+
case "UnaryExpression":
|
|
695
|
+
return unaryExpression(node, scope);
|
|
696
|
+
case "BinaryExpression":
|
|
697
|
+
return binaryExpression(node, scope);
|
|
698
|
+
case "LogicalExpression":
|
|
699
|
+
return logicalExpression(node, scope);
|
|
700
|
+
case "ConditionalExpression":
|
|
701
|
+
return conditionalExpression(node, scope);
|
|
702
|
+
case "ArrayExpression":
|
|
703
|
+
return arrayExpression(node, scope);
|
|
704
|
+
case "ObjectExpression":
|
|
705
|
+
return objectExpression(node, scope);
|
|
706
|
+
default:
|
|
707
|
+
return void 0;
|
|
708
|
+
}
|
|
709
|
+
} finally {
|
|
710
|
+
currentDepth--;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
function readIdentifier(node, scope) {
|
|
714
|
+
if (!scope) return void 0;
|
|
715
|
+
return scope[node.name];
|
|
716
|
+
}
|
|
717
|
+
function readMember(node, scope) {
|
|
718
|
+
const object = exec(node.object, scope);
|
|
719
|
+
if (object == null) {
|
|
720
|
+
return void 0;
|
|
721
|
+
}
|
|
722
|
+
const key = node.computed ? String(exec(node.property, scope)) : node.property.name;
|
|
723
|
+
if (DENY_KEYS.has(key)) {
|
|
724
|
+
if (evalOptions.strict) {
|
|
725
|
+
throw new EvalError(`Access to property "${key}" is not allowed`);
|
|
726
|
+
}
|
|
727
|
+
return void 0;
|
|
728
|
+
}
|
|
729
|
+
try {
|
|
730
|
+
return object[key];
|
|
731
|
+
} catch (err) {
|
|
732
|
+
if (evalOptions.strict) {
|
|
733
|
+
throw new EvalError(`Failed to access property "${key}": ${err}`);
|
|
734
|
+
}
|
|
735
|
+
return void 0;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
function callExpression(node, scope) {
|
|
739
|
+
let fn;
|
|
740
|
+
let thisArg = void 0;
|
|
741
|
+
const calleeNode = node.callee;
|
|
742
|
+
if (calleeNode.type === "MemberExpression") {
|
|
743
|
+
const mem = calleeNode;
|
|
744
|
+
thisArg = exec(mem.object, scope);
|
|
745
|
+
if (thisArg == null) return void 0;
|
|
746
|
+
const key = mem.computed ? String(exec(mem.property, scope)) : mem.property.name;
|
|
747
|
+
if (DENY_KEYS.has(key)) {
|
|
748
|
+
if (evalOptions.strict) {
|
|
749
|
+
throw new EvalError(`Call to method "${key}" is not allowed`);
|
|
750
|
+
}
|
|
751
|
+
return void 0;
|
|
752
|
+
}
|
|
753
|
+
fn = thisArg[key];
|
|
754
|
+
} else {
|
|
755
|
+
fn = exec(node.callee, scope);
|
|
756
|
+
}
|
|
757
|
+
if (fn == null) return void 0;
|
|
758
|
+
if (typeof fn !== "function") {
|
|
759
|
+
if (evalOptions.strict) {
|
|
760
|
+
throw new EvalError(`Cannot call non-function value`);
|
|
761
|
+
}
|
|
762
|
+
return void 0;
|
|
763
|
+
}
|
|
764
|
+
const args = node.arguments.map(a => exec(a, scope));
|
|
765
|
+
try {
|
|
766
|
+
return fn.apply(thisArg, args);
|
|
767
|
+
} catch (err) {
|
|
768
|
+
if (evalOptions.strict) {
|
|
769
|
+
throw new EvalError(`Function call failed: ${err}`);
|
|
770
|
+
}
|
|
771
|
+
return void 0;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
function unaryExpression(node, scope) {
|
|
775
|
+
const v = exec(node.argument, scope);
|
|
776
|
+
switch (node.operator) {
|
|
777
|
+
case "-":
|
|
778
|
+
return 0 - Number(v);
|
|
779
|
+
case "!":
|
|
780
|
+
return !v;
|
|
781
|
+
case "+":
|
|
782
|
+
return v;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
function binaryExpression(node, scope) {
|
|
786
|
+
const a = exec(node.left, scope);
|
|
787
|
+
const b = exec(node.right, scope);
|
|
788
|
+
switch (node.operator) {
|
|
789
|
+
case "+":
|
|
790
|
+
return a + b;
|
|
791
|
+
case "-":
|
|
792
|
+
return a - b;
|
|
793
|
+
case "*":
|
|
794
|
+
return a * b;
|
|
795
|
+
case "/":
|
|
796
|
+
return a / b;
|
|
797
|
+
case "%":
|
|
798
|
+
return a % b;
|
|
799
|
+
case "==":
|
|
800
|
+
return a == b;
|
|
801
|
+
case "!=":
|
|
802
|
+
return a != b;
|
|
803
|
+
case "===":
|
|
804
|
+
return a === b;
|
|
805
|
+
case "!==":
|
|
806
|
+
return a !== b;
|
|
807
|
+
case "<":
|
|
808
|
+
return a < b;
|
|
809
|
+
case ">":
|
|
810
|
+
return a > b;
|
|
811
|
+
case "<=":
|
|
812
|
+
return a <= b;
|
|
813
|
+
case ">=":
|
|
814
|
+
return a >= b;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
function logicalExpression(node, scope) {
|
|
818
|
+
if (node.operator === "&&") {
|
|
819
|
+
const left2 = exec(node.left, scope);
|
|
820
|
+
return left2 ? exec(node.right, scope) : left2;
|
|
821
|
+
}
|
|
822
|
+
if (node.operator === "||") {
|
|
823
|
+
const left2 = exec(node.left, scope);
|
|
824
|
+
return left2 ? left2 : exec(node.right, scope);
|
|
825
|
+
}
|
|
826
|
+
const left = exec(node.left, scope);
|
|
827
|
+
return left ?? exec(node.right, scope);
|
|
828
|
+
}
|
|
829
|
+
function conditionalExpression(node, scope) {
|
|
830
|
+
const test = exec(node.test, scope);
|
|
831
|
+
return test ? exec(node.consequent, scope) : exec(node.alternate, scope);
|
|
832
|
+
}
|
|
833
|
+
function arrayExpression(node, scope) {
|
|
834
|
+
return node.elements.map(e => exec(e, scope));
|
|
835
|
+
}
|
|
836
|
+
function objectExpression(node, scope) {
|
|
837
|
+
const out = {};
|
|
838
|
+
for (const p of node.properties) {
|
|
839
|
+
if (DENY_KEYS.has(p.key)) continue;
|
|
840
|
+
out[p.key] = exec(p.value, scope);
|
|
841
|
+
}
|
|
842
|
+
return out;
|
|
404
843
|
}
|
|
405
|
-
|
|
844
|
+
function compile(expression, options) {
|
|
406
845
|
if (!expression) throw new Error("expression is required");
|
|
407
|
-
const
|
|
408
|
-
return
|
|
409
|
-
}
|
|
846
|
+
const ast = parseToAst(expression);
|
|
847
|
+
return scope => evaluate(ast, scope, options);
|
|
848
|
+
}
|
|
849
|
+
function parse$1(expression, scope = {}, options) {
|
|
850
|
+
return compile(expression, options)(scope);
|
|
851
|
+
}
|
|
410
852
|
|
|
411
853
|
const CONTEXT = '__idooel__ele__context__';
|
|
412
854
|
const AREA_NAMES = {
|
|
@@ -864,11 +1306,11 @@ __vue_render__$G._withStripped = true;
|
|
|
864
1306
|
/* style */
|
|
865
1307
|
const __vue_inject_styles__$G = function (inject) {
|
|
866
1308
|
if (!inject) return
|
|
867
|
-
inject("data-v-
|
|
1309
|
+
inject("data-v-44a90c94_0", { source: ".ele-date__wrapper[data-v-44a90c94] {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/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 });
|
|
868
1310
|
|
|
869
1311
|
};
|
|
870
1312
|
/* scoped */
|
|
871
|
-
const __vue_scope_id__$G = "data-v-
|
|
1313
|
+
const __vue_scope_id__$G = "data-v-44a90c94";
|
|
872
1314
|
/* module identifier */
|
|
873
1315
|
const __vue_module_identifier__$G = undefined;
|
|
874
1316
|
/* functional template */
|
|
@@ -949,11 +1391,11 @@ __vue_render__$F._withStripped = true;
|
|
|
949
1391
|
/* style */
|
|
950
1392
|
const __vue_inject_styles__$F = function (inject) {
|
|
951
1393
|
if (!inject) return
|
|
952
|
-
inject("data-v-
|
|
1394
|
+
inject("data-v-4647f894_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 });
|
|
953
1395
|
|
|
954
1396
|
};
|
|
955
1397
|
/* scoped */
|
|
956
|
-
const __vue_scope_id__$F = "data-v-
|
|
1398
|
+
const __vue_scope_id__$F = "data-v-4647f894";
|
|
957
1399
|
/* module identifier */
|
|
958
1400
|
const __vue_module_identifier__$F = undefined;
|
|
959
1401
|
/* functional template */
|
|
@@ -1108,11 +1550,11 @@ __vue_render__$E._withStripped = true;
|
|
|
1108
1550
|
/* style */
|
|
1109
1551
|
const __vue_inject_styles__$E = function (inject) {
|
|
1110
1552
|
if (!inject) return
|
|
1111
|
-
inject("data-v-
|
|
1553
|
+
inject("data-v-71044f4a_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
1112
1554
|
|
|
1113
1555
|
};
|
|
1114
1556
|
/* scoped */
|
|
1115
|
-
const __vue_scope_id__$E = "data-v-
|
|
1557
|
+
const __vue_scope_id__$E = "data-v-71044f4a";
|
|
1116
1558
|
/* module identifier */
|
|
1117
1559
|
const __vue_module_identifier__$E = undefined;
|
|
1118
1560
|
/* functional template */
|
|
@@ -1706,11 +2148,11 @@ __vue_render__$D._withStripped = true;
|
|
|
1706
2148
|
/* style */
|
|
1707
2149
|
const __vue_inject_styles__$D = function (inject) {
|
|
1708
2150
|
if (!inject) return
|
|
1709
|
-
inject("data-v-
|
|
2151
|
+
inject("data-v-6c8442ae_0", { source: ".g-table__action[data-v-6c8442ae] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-6c8442ae] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-6c8442ae]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/table/src/action.vue","action.vue"],"names":[],"mappings":"AA+JA;EACA,aAAA;EACA,mBAAA;AC9JA;AD+JA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;AC7JA;AD8JA;EACA,cAAA;AC5JA;;AAEA,qCAAqC","file":"action.vue","sourcesContent":["<template>\n <div class=\"g-table__action\">\n <div class=\"table-action__item\" v-for=\"(item, idx) in execOperationExpression(dataSource)\" :key=\"idx\">\n <template v-if=\"item.type == 'text'\">\n <span @click=\"handleClickText(item)\">{{ item.label }}</span>\n </template>\n <template v-else-if=\"item.type == 'confirm'\">\n <div>\n <a-popconfirm :title=\"item.message\" @confirm=\"handleClickConfirm(item)\">\n {{ item.label }}\n </a-popconfirm>\n </div>\n </template>\n <template v-else-if=\"item.type == 'dropdown'\">\n <a-dropdown>\n <a-menu slot=\"overlay\" @click=\"handleDropdownClick\">\n <a-menu-item :key=\"`${item.key || ''}${menuKeyDelimiter}${opt.value || ''}`\" v-for=\"opt in execOperationExpression(item.optionList)\">\n <template v-if=\"opt.type == 'confirm'\">\n <a-popconfirm :title=\"opt.message\" @confirm=\"handleClickConfirm(opt)\">\n {{ opt.label }}\n </a-popconfirm>\n </template>\n <template v-else-if=\"opt.type == 'modal-confirm'\">\n <div style=\"width: 100%\" @click=\"handleClickModalConfirm(opt)\">{{ opt.label }}</div>\n <ele-modal-confirm v-bind=\"opt.modalConfirm\" v-on=\"$listeners\" v-model=\"showModalConfirm\"></ele-modal-confirm>\n </template>\n <template v-else>\n {{ opt.label }}\n </template>\n </a-menu-item>\n </a-menu>\n <span>{{ item.label }}</span>\n </a-dropdown>\n </template>\n </div>\n </div>\n</template>\n\n<script>\nimport { v5 as uuidv5 } from 'uuid'\nimport { type, route } from '@idooel/shared'\nimport { parse } from '@idooel/expression'\nimport { CONTEXT } from '../../utils'\nconst MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002'\nexport default {\n props: {\n record: {\n type: Object\n },\n dataSource: {\n type: Array,\n default: () => []\n }\n },\n inject: {\n requestTreeData: {\n default: void 0\n },\n requestTableData: {\n default: void 0\n }\n },\n data() {\n return {\n showModalConfirm: false\n }\n },\n provide () {\n return {\n [CONTEXT]: () => {\n return {\n _route: this.$route.query,\n _routeMeta: this.$route.meta,\n exposed: this.builtInMethods,\n ...this.record\n }\n }\n }\n },\n computed: {\n menuKeyDelimiter () {\n return uuidv5('_', MENU_KEY_NAMESPACE)\n },\n builtInMethods () {\n return { \n requestTreeData: this.requestTreeData, \n requestTableData: this.requestTableData,\n closeModalConfirm: this.closeModalConfirm,\n showModalConfirm: this.handleClickModalConfirm,\n currentRowData: this.record\n }\n }\n },\n methods: {\n closeModalConfirm () {\n this.showModalConfirm = false\n },\n handleClickModalConfirm () {\n this.showModalConfirm = true\n },\n execOperationExpression (dataSource = []) {\n const ret = dataSource.map(item => {\n const { show } = item\n if (type.isUndefined(show)) {\n return item\n } else if (type.isBool(show)) {\n if (show) return item\n } else if (type.isStr(show)) {\n const parseRet = parse(show, { \n ...this.record, \n _route: route.searchToQueryParams(window.location.search) \n })\n if (parseRet) return item\n }\n }).filter(item => item)\n return ret\n },\n handleClickConfirm (props) {\n //TODO generate event by special rule\n const { eventName, value, key } = props\n this.$emit(eventName || key, { \n key: value || key, \n record: this.record,\n builtInMethods: this.builtInMethods,\n exposed: this.builtInMethods\n })\n },\n handleDropdownClick (props) {\n const { key } = props\n const [parent, child] = key.split(this.menuKeyDelimiter)\n if (!parent || !child) {\n throw new Error('key is required')\n }\n const currentDropdown = this.dataSource.find(item => item.key === parent)\n const currentClickTarget = currentDropdown.optionList.find(item => item.value === child)\n const { eventName, type, key: currentKey } = currentClickTarget\n //TODO generate event by special rule\n if (type === 'confirm' || type === 'modal-confirm') return\n this.$emit(eventName || currentKey, { \n key: child, \n record: this.record, \n builtInMethods: this.builtInMethods,\n exposed: this.builtInMethods\n })\n },\n handleClickText (props) {\n const { eventName, key } = props\n this.$emit(eventName || key, { \n key, \n record: this.record, \n builtInMethods: this.builtInMethods,\n exposed: this.builtInMethods\n })\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-table__action {\n display: flex;\n flex-direction: row;\n .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n &:first-child {\n margin-left: 0;\n }\n }\n}\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
|
|
1710
2152
|
|
|
1711
2153
|
};
|
|
1712
2154
|
/* scoped */
|
|
1713
|
-
const __vue_scope_id__$D = "data-v-
|
|
2155
|
+
const __vue_scope_id__$D = "data-v-6c8442ae";
|
|
1714
2156
|
/* module identifier */
|
|
1715
2157
|
const __vue_module_identifier__$D = undefined;
|
|
1716
2158
|
/* functional template */
|
|
@@ -2010,11 +2452,11 @@ __vue_render__$C._withStripped = true;
|
|
|
2010
2452
|
/* style */
|
|
2011
2453
|
const __vue_inject_styles__$C = function (inject) {
|
|
2012
2454
|
if (!inject) return
|
|
2013
|
-
inject("data-v-3f1790f0_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-3f1790f0] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n /* 确保表体能够正常纵向滚动 */\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover td {\n background-color: var(--idooel-row-hover-color);\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-tbody .g-table__row--odd td {\n background-color: var(--idooel-row-odd-color);\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-3f1790f0] .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper .g-table__pagination[data-v-3f1790f0] {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue","/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/table/src/index.vue"],"names":[],"mappings":"AAAA,gBAAgB;ACyNhB;EACA,8BAAA;EACA,aAAA;EACA,sBAAA;EACA,gBAAA;EAEA,sBAAA;EA6BA,iBAAA;EAsDA,qBAAA;ADzSA;ACuNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADrNA;ACwNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADtNA;ACyNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADvNA;AC0NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADxNA;AC4NA;EACA,cAAA;EACA,aAAA;EACA,gBAAA;AD1NA;AC6NA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AD3NA;AC8NA;EACA,cAAA;EACA,gBAAA;AD5NA;ACkOA;EACA,+CAAA;ADhOA;ACkOA;EACA,0DAAA;ADhOA;ACkOA;EACA,0DAAA;ADhOA;ACmOA;EACA,6CAAA;ADjOA;ACmOA;EACA,wDAAA;ADjOA;ACmOA;EACA,wDAAA;ADjOA;ACqOA;EACA,0CAAA;ADnOA;ACuOA;EACA,cAAA;EACA,yBAAA;EACA,mBAAA;EACA,wBAAA;ADrOA;ACyOA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;ADvOA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["@charset \"UTF-8\";\n.g-table__wrapper {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n /* 确保表体能够正常纵向滚动 */\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover td {\n background-color: var(--idooel-row-hover-color);\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd td {\n background-color: var(--idooel-row-odd-color);\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper .g-table__pagination {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */","<template>\n <div class=\"g-table__wrapper\" :style=\"wrapperStyle\" :class=\"{ 'g-table--no-scroll-y': !needScrollY }\">\n <a-table\n :bordered=\"bordered\"\n :class=\"[isNoData && 'g-table__no-data']\"\n :pagination=\"false\"\n :loading=\"loading\"\n size=\"middle\"\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 }\n },\n computed: {\n wrapperStyle () {\n // 外层容器样式:确保分页始终可见,表格充满剩余空间\n if (!this.height) return {}\n return { height: `${this.height}px` }\n },\n needScrollY () {\n // 判断是否需要 y 轴滚动:基于数据行数与可用高度预估\n if (!this.height) return false\n \n const availableHeight = this.getScrollHeightByHeight\n if (availableHeight <= 0) return false\n \n // 预估每行高度(包含边框),antd 默认约 54px\n const estimatedRowHeight = 54\n const estimatedTableHeight = this.dataSource.length * estimatedRowHeight\n \n return estimatedTableHeight > availableHeight\n },\n innerColumns () {\n return this.columns.filter(col => !Object.keys(col).includes('multiple'))\n },\n isNoData () {\n return !this.dataSource.length\n },\n getScrollHeightByHeight () {\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 const baseX = this.isFlexColumn ? 0 : (this.width > this.x ? 0 : this.x)\n if (this.height) {\n // 计算表体可用高度\n const availableHeight = this.tableHeaderHeight && this.paginationHeight \n ? this.getScrollHeightByHeight \n : this.height - 100 // 预估值,给表头和分页留空间\n \n if (availableHeight > 50) { // 确保有足够的最小高度\n console.log('Table scroll config:', { x: baseX, y: availableHeight, height: this.height, headerHeight: this.tableHeaderHeight, paginationHeight: this.paginationHeight })\n return { x: baseX, y: availableHeight }\n }\n }\n return { x: baseX }\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 // 简化:仅需要获取表头高度,不再依赖表体高度的动态监听\n this.$nextTick(() => {\n this.setTableHeaderHeight()\n })\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.$nextTick(() => {\n this.setPaginationHeight()\n setTimeout(() => {\n this.setTableTbodyHeight()\n // 再测一次分页高度,确保初次渲染完成后数值准确\n this.setPaginationHeight()\n }, 200)\n })\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 /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n /* 表格区域占满剩余空间,启用纵向滚动 */\n ::v-deep .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n /* 确保表体能够正常纵向滚动 */\n ::v-deep .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n }\n\n ::v-deep .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n }\n ::v-deep .ant-table-fixed {\n .ant-table-tbody {\n .g-table__row--odd {\n &.ant-table-row-hover {\n td {\n background-color: var(--idooel-row-hover-color);\n }\n .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n }\n .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n }\n }\n td {\n background-color: var(--idooel-row-odd-color);\n }\n .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n }\n .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n }\n }\n }\n .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n }\n }\n\n ::v-deep .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n }\n\n /* 分页区域固定在底部,不被挤出视口 */\n .g-table__pagination {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n }\n}\n</style>"]}, media: undefined });
|
|
2455
|
+
inject("data-v-3102b9ae_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-3102b9ae] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n /* 确保表体能够正常纵向滚动 */\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover td {\n background-color: var(--idooel-row-hover-color);\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-tbody .g-table__row--odd td {\n background-color: var(--idooel-row-odd-color);\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-3102b9ae] .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper .g-table__pagination[data-v-3102b9ae] {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue","/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/table/src/index.vue"],"names":[],"mappings":"AAAA,gBAAgB;ACyNhB;EACA,8BAAA;EACA,aAAA;EACA,sBAAA;EACA,gBAAA;EAEA,sBAAA;EA6BA,iBAAA;EAsDA,qBAAA;ADzSA;ACuNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADrNA;ACwNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADtNA;ACyNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADvNA;AC0NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADxNA;AC4NA;EACA,cAAA;EACA,aAAA;EACA,gBAAA;AD1NA;AC6NA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AD3NA;AC8NA;EACA,cAAA;EACA,gBAAA;AD5NA;ACkOA;EACA,+CAAA;ADhOA;ACkOA;EACA,0DAAA;ADhOA;ACkOA;EACA,0DAAA;ADhOA;ACmOA;EACA,6CAAA;ADjOA;ACmOA;EACA,wDAAA;ADjOA;ACmOA;EACA,wDAAA;ADjOA;ACqOA;EACA,0CAAA;ADnOA;ACuOA;EACA,cAAA;EACA,yBAAA;EACA,mBAAA;EACA,wBAAA;ADrOA;ACyOA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;ADvOA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["@charset \"UTF-8\";\n.g-table__wrapper {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n /* 确保表体能够正常纵向滚动 */\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover td {\n background-color: var(--idooel-row-hover-color);\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd td {\n background-color: var(--idooel-row-odd-color);\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper .g-table__pagination {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n}\n\n/*# sourceMappingURL=index.vue.map */","<template>\n <div class=\"g-table__wrapper\" :style=\"wrapperStyle\" :class=\"{ 'g-table--no-scroll-y': !needScrollY }\">\n <a-table\n :bordered=\"bordered\"\n :class=\"[isNoData && 'g-table__no-data']\"\n :pagination=\"false\"\n :loading=\"loading\"\n size=\"middle\"\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 }\n },\n computed: {\n wrapperStyle () {\n // 外层容器样式:确保分页始终可见,表格充满剩余空间\n if (!this.height) return {}\n return { height: `${this.height}px` }\n },\n needScrollY () {\n // 判断是否需要 y 轴滚动:基于数据行数与可用高度预估\n if (!this.height) return false\n \n const availableHeight = this.getScrollHeightByHeight\n if (availableHeight <= 0) return false\n \n // 预估每行高度(包含边框),antd 默认约 54px\n const estimatedRowHeight = 54\n const estimatedTableHeight = this.dataSource.length * estimatedRowHeight\n \n return estimatedTableHeight > availableHeight\n },\n innerColumns () {\n return this.columns.filter(col => !Object.keys(col).includes('multiple'))\n },\n isNoData () {\n return !this.dataSource.length\n },\n getScrollHeightByHeight () {\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 const baseX = this.isFlexColumn ? 0 : (this.width > this.x ? 0 : this.x)\n if (this.height) {\n // 计算表体可用高度\n const availableHeight = this.tableHeaderHeight && this.paginationHeight \n ? this.getScrollHeightByHeight \n : this.height - 100 // 预估值,给表头和分页留空间\n \n if (availableHeight > 50) { // 确保有足够的最小高度\n console.log('Table scroll config:', { x: baseX, y: availableHeight, height: this.height, headerHeight: this.tableHeaderHeight, paginationHeight: this.paginationHeight })\n return { x: baseX, y: availableHeight }\n }\n }\n return { x: baseX }\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 // 简化:仅需要获取表头高度,不再依赖表体高度的动态监听\n this.$nextTick(() => {\n this.setTableHeaderHeight()\n })\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.$nextTick(() => {\n this.setPaginationHeight()\n setTimeout(() => {\n this.setTableTbodyHeight()\n // 再测一次分页高度,确保初次渲染完成后数值准确\n this.setPaginationHeight()\n }, 200)\n })\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 /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n /* 表格区域占满剩余空间,启用纵向滚动 */\n ::v-deep .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n /* 确保表体能够正常纵向滚动 */\n ::v-deep .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n }\n\n ::v-deep .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n ::v-deep .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n }\n ::v-deep .ant-table-fixed {\n .ant-table-tbody {\n .g-table__row--odd {\n &.ant-table-row-hover {\n td {\n background-color: var(--idooel-row-hover-color);\n }\n .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n }\n .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n }\n }\n td {\n background-color: var(--idooel-row-odd-color);\n }\n .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n }\n .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n }\n }\n }\n .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n }\n }\n\n ::v-deep .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n }\n\n /* 分页区域固定在底部,不被挤出视口 */\n .g-table__pagination {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n }\n}\n</style>"]}, media: undefined });
|
|
2014
2456
|
|
|
2015
2457
|
};
|
|
2016
2458
|
/* scoped */
|
|
2017
|
-
const __vue_scope_id__$C = "data-v-
|
|
2459
|
+
const __vue_scope_id__$C = "data-v-3102b9ae";
|
|
2018
2460
|
/* module identifier */
|
|
2019
2461
|
const __vue_module_identifier__$C = undefined;
|
|
2020
2462
|
/* functional template */
|
|
@@ -2214,11 +2656,11 @@ __vue_render__$B._withStripped = true;
|
|
|
2214
2656
|
/* style */
|
|
2215
2657
|
const __vue_inject_styles__$B = function (inject) {
|
|
2216
2658
|
if (!inject) return
|
|
2217
|
-
inject("data-v-
|
|
2659
|
+
inject("data-v-b2ee4e34_0", { source: ".g-tree__wrapper[data-v-b2ee4e34] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-b2ee4e34] .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper[data-v-b2ee4e34] .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/tree/src/index.vue","index.vue"],"names":[],"mappings":"AAwFA;EACA,gBAAA;ACvFA;ADyFA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;ACvFA;ADyFA;EACA,WAAA;ACvFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-tree__wrapper\">\n <a-tree\n v-if=\"innerTreeData.length\"\n :tree-data=\"innerTreeData\"\n :checkable=\"checkable\"\n @select=\"selectTreeNode\"\n @check=\"checkTreeNode\"\n :replaceFields=\"replaceFields\"\n :default-expanded-keys=\"defaultExpandedKeys\"\n :default-selected-keys=\"defaultSelectedKeys\"\n :show-line=\"showLine\"\n blockNode \n :show-icon=\"showIcon\">\n <a-icon v-if=\"switcherIcon\" slot=\"switcherIcon\" :type=\"switcherIcon\" />\n <template #title=\"props\">\n <span :title=\"props[replaceFields.title]\" class=\"tree-node__title\">\n {{ props[replaceFields.title] }}\n </span>\n </template>\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\n </template>\n </a-tree>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-tree',\n props: {\n treeData: {\n type: Array,\n default: () => []\n },\n showLine: {\n type: Boolean,\n default: false\n },\n switcherIcon: {\n type: String\n },\n checkable: {\n type: Boolean,\n default: false\n },\n replaceFields: {\n type: Object,\n default: () => ({\n title: 'title',\n key: 'id',\n children: 'children'\n })\n },\n defaultExpandedKeys: {\n type: Array\n },\n defaultSelectedKeys: {\n type: Array\n },\n showIcon: {\n type: Boolean,\n default: true\n }\n },\n data () {\n return {}\n },\n computed: {\n innerTreeData () {\n return this.treeData\n }\n },\n methods: {\n checkTreeNode (checkedKeys, e) {\n const { checkedNodes } = e\n const nodeDatas = checkedNodes.map(item => item.data.props.dataRef)\n this.$emit('check', checkedKeys, nodeDatas)\n },\n refreshTreeStatus (props = {}) {},\n selectTreeNode (selectedKeys, e) {\n this.$emit('select', selectedKeys, e)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-tree__wrapper {\n overflow: hidden;\n ::v-deep .ant-tree {\n .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n .ant-tree-node-selected {\n color: #fff;\n }\n }\n}\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2218
2660
|
|
|
2219
2661
|
};
|
|
2220
2662
|
/* scoped */
|
|
2221
|
-
const __vue_scope_id__$B = "data-v-
|
|
2663
|
+
const __vue_scope_id__$B = "data-v-b2ee4e34";
|
|
2222
2664
|
/* module identifier */
|
|
2223
2665
|
const __vue_module_identifier__$B = undefined;
|
|
2224
2666
|
/* functional template */
|
|
@@ -3148,11 +3590,11 @@ __vue_render__$A._withStripped = true;
|
|
|
3148
3590
|
/* style */
|
|
3149
3591
|
const __vue_inject_styles__$A = function (inject) {
|
|
3150
3592
|
if (!inject) return
|
|
3151
|
-
inject("data-v-34cddd52_0", { source: ".ele.model__tree-table[data-v-34cddd52] {\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-34cddd52] {\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-34cddd52] {\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-34cddd52] {\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-34cddd52] {\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-34cddd52] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-34cddd52] {\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-34cddd52] {\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":"AAonBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;ACnnBA;ADqnBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;ACnnBA;ADsnBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;ACpnBA;ADsnBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;ACpnBA;ADsnBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;ACpnBA;ADunBA;EACA,gBAAA;ACrnBA;ADsnBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;ACpnBA;ADunBA;EACA,eAAA;EACA,kCAAA;ACrnBA;;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 refreshTreeData: this.refreshTreeData,\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 || action.key] = (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 || action.key, { ...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 const { footerMeta } = this.modalFormMeta\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.closeModalForm()\n } else {\n const { exposed = {} } = e\n this.$emit(`${ele.eventName || ele.key}`, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed )})\n }\n }\n return ret\n }, {})\n return {\n ...events\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 || ele.key}`, { ...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 async refreshTreeData () {\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 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.isArray(props) && props.length > 0) ? props[0] : 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 if (type.isStr(modeMeta)) {\n const targetMeta = this.findMetaByKey(modeMeta)\n this.modalFormMeta = targetMeta\n } else {\n this.modalFormMeta = modeMeta\n }\n this.modalFormValue = true\n },\n showModalTable (modeMeta = {}) {\n console.log('showModalTable', modeMeta)\n if (type.isStr(modeMeta)) {\n const targetMeta = this.findMetaByKey(modeMeta)\n this.modalTableMeta = targetMeta\n } else {\n this.modalTableMeta = modeMeta\n }\n this.modalTableValue = true\n },\n closeModalForm () {\n this.modalFormValue = false\n },\n closeModalTable () {\n console.log('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 });
|
|
3593
|
+
inject("data-v-12a036f8_0", { source: ".ele.model__tree-table[data-v-12a036f8] {\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-12a036f8] {\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-12a036f8] {\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-12a036f8] {\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-12a036f8] {\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-12a036f8] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-12a036f8] {\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-12a036f8] {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/models/tree-table-model/src/index.vue","index.vue"],"names":[],"mappings":"AAonBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;ACnnBA;ADqnBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;ACnnBA;ADsnBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;ACpnBA;ADsnBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;ACpnBA;ADsnBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;ACpnBA;ADunBA;EACA,gBAAA;ACrnBA;ADsnBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;ACpnBA;ADunBA;EACA,eAAA;EACA,kCAAA;ACrnBA;;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 refreshTreeData: this.refreshTreeData,\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 || action.key] = (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 || action.key, { ...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 const { footerMeta } = this.modalFormMeta\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.closeModalForm()\n } else {\n const { exposed = {} } = e\n this.$emit(`${ele.eventName || ele.key}`, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed )})\n }\n }\n return ret\n }, {})\n return {\n ...events\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 || ele.key}`, { ...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 async refreshTreeData () {\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 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.isArray(props) && props.length > 0) ? props[0] : 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 if (type.isStr(modeMeta)) {\n const targetMeta = this.findMetaByKey(modeMeta)\n this.modalFormMeta = targetMeta\n } else {\n this.modalFormMeta = modeMeta\n }\n this.modalFormValue = true\n },\n showModalTable (modeMeta = {}) {\n console.log('showModalTable', modeMeta)\n if (type.isStr(modeMeta)) {\n const targetMeta = this.findMetaByKey(modeMeta)\n this.modalTableMeta = targetMeta\n } else {\n this.modalTableMeta = modeMeta\n }\n this.modalTableValue = true\n },\n closeModalForm () {\n this.modalFormValue = false\n },\n closeModalTable () {\n console.log('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 });
|
|
3152
3594
|
|
|
3153
3595
|
};
|
|
3154
3596
|
/* scoped */
|
|
3155
|
-
const __vue_scope_id__$A = "data-v-
|
|
3597
|
+
const __vue_scope_id__$A = "data-v-12a036f8";
|
|
3156
3598
|
/* module identifier */
|
|
3157
3599
|
const __vue_module_identifier__$A = undefined;
|
|
3158
3600
|
/* functional template */
|
|
@@ -3568,11 +4010,11 @@ __vue_render__$z._withStripped = true;
|
|
|
3568
4010
|
/* style */
|
|
3569
4011
|
const __vue_inject_styles__$z = function (inject) {
|
|
3570
4012
|
if (!inject) return
|
|
3571
|
-
inject("data-v-770e5c93_0", { source: ".ele.form-group-model__wrapper[data-v-770e5c93] {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-770e5c93] {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-770e5c93]:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title[data-v-770e5c93] {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--content[data-v-770e5c93] {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer[data-v-770e5c93] {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/models/form-group-model/src/index.vue","index.vue"],"names":[],"mappings":"AA4OA;EACA,iBAAA;EACA,oBAAA;AC3OA;AD4OA;EACA,gBAAA;EACA,gBAAA;AC1OA;AD2OA;EACA,iBAAA;ACzOA;AD2OA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,wBAAA;EACA,mDAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACzOA;AD2OA;EACA,aAAA;ACzOA;AD4OA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;AC1OA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele form-group-model__wrapper\">\n <template v-for=\"(group, idx) in innerGroupMeta\">\n <div \n class=\"form-group-model__from\"\n v-if=\"!group.isGenTpl\"\n :key=\"group.key || idx\">\n <div class=\"form-group-model__form--title\">\n <div>{{ group.title }}</div>\n <div class=\"form-group-model__form--buttons\">\n <ele-button-group v-if=\"group.buttonGroupMeta\" v-on=\"assignAttrForEvents\" @delete=\"handleClickDelete($event, group, idx)\" :data-source=\"group.buttonGroupMeta.elements.call(this)\"></ele-button-group>\n </div>\n </div>\n <div class=\"form-group-model__form--content\">\n <ele-form @change=\"onChangeFormStatus($event, group.key || idx)\" :form-name=\"group.key || idx\" :ref=\"group.key || `${formRefBase}__${idx}`\" :elements=\"group.elements\"></ele-form>\n </div>\n </div>\n </template>\n <div v-if=\"showFooterMeta\" class=\"form-group-model__form--footer\">\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\n </div>\n </div>\n</template>\n\n<script>\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, PAGE_STATUS } from '../../../utils'\nimport { v4 as uuidv4 } from 'uuid'\nimport { type, net } from '@idooel/shared'\nexport default {\n name: 'ele-form-group-model',\n props: {\n mode: {\n type: String\n },\n fieldName: {\n type: String,\n default: 'formGroup'\n },\n groupMeta: {\n type: Function,\n default: () => []\n },\n footerMeta: {\n type: Object,\n default: () => {}\n },\n preRequest: {\n type: Object,\n default: () => {}\n },\n infoRequest: {\n type: Object,\n default: () => {}\n },\n submitRequest: {\n type: Object,\n default: () => {}\n }\n },\n data () {\n return {\n increaseCount: 1,\n innerGroupMeta: []\n }\n },\n watch: {\n readOnlyGroupMeta: {\n handler (meta) {\n this.innerGroupMeta = meta\n },\n immediate: true\n }\n },\n computed: {\n routeMetaMode () {\n return this.$route.meta.mode\n },\n readOnlyGroupMeta () {\n return this.groupMeta.call(this)\n },\n showFooterMeta () {\n return !type.isEmpty(this.footerMeta)\n },\n formRefBase () {\n return uuidv4()\n },\n footerElements () {\n const { elements } = this.footerMeta\n return elements.call(this)\n },\n assignAttrForEvents () {\n const events = this.footerElements.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n this.$emit(ele.eventName || 'click', { ...e })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL],\n [BUILT_IN_EVENT_NAMES.INCREASE]: this[BUILT_IN_EVENT_NAMES.INCREASE]\n }\n },\n getFormRefs () {\n return this.innerGroupMeta.map((group, idx) => {\n if (!group.isGenTpl) {\n return this.$refs[group.key || `${this.formRefBase}__${idx}`]\n }\n return void 0\n }).filter(item => !!item).flat()\n },\n formModels () {\n if (this.mode === 'increase') {\n //TODO increase mode to return formModels\n return this.getFormRefs.map(form => {\n return form.getFieldsValue()\n })\n } else {\n return this.getFormRefs.map(form => {\n const { $vnode: { data: { ref } } } = form\n return {\n key: ref,\n value: form.getFieldsValue()\n }\n }).reduce((ret, props) => {\n ret[props.key] = props.value\n return ret\n }, {})\n }\n }\n },\n methods: {\n execFieldMap (fieldMap = {}, dataSource = {}) {\n const ret = parseFieldMap(fieldMap, { _route: this.$route.query, ...dataSource})\n return ret\n },\n onChangeFormStatus (props, key) {\n this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, { key, ...props })\n },\n async infoRequestTrigger () {\n if (!this.infoRequest || this.routeMetaMode == PAGE_STATUS.CREATE) return\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\n if (!url) return\n net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\n const { data = {} } = resp\n if (this.mode === 'increase') {\n this.renderIncreaseForm(data)\n }\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\n })\n },\n async preRequestTrigger () {\n if (!this.preRequest) return\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\n if (!url) return\n net[requestType.toLowerCase()](url, { ...params, ...fieldMap }, { ...headers }).then(resp => {\n const { data = {} } = resp\n if (this.mode === 'increase') {\n this.renderIncreaseForm(data)\n }\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\n })\n },\n renderIncreaseForm (data = {}) {\n const formGroupValuesLength = data[this.fieldName].length\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\n const notGenTplPoolLength = this.readOnlyGroupMeta.filter(item => !item.isGenTpl).length\n const genNum = formGroupValuesLength - notGenTplPoolLength\n new Array(genNum).fill().forEach(() => {\n const form = this.genForm(genTplTarget)\n this.innerGroupMeta.push(form)\n })\n const formGroupValues = data[this.fieldName]\n this.$nextTick(() => {\n this.setFieldsValue(formGroupValues)\n })\n },\n async submitRequestTrigger (props = {}) {\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\n if (!url) return\n const ret = await net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels }), [this.fieldName]: this.formModels }, { headers }).then(resp => {\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels, ...resp.data || {} } })\n return resp.data\n })\n return ret\n },\n setFieldsValue (data = []) {\n this.getFormRefs.forEach((form, idx) => {\n form.setFieldsValue(data[idx])\n form.evalDisabledExpression(data[idx])\n })\n },\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\n const status = this.getFormRefs.map(form => {\n const status = form.validateFields()\n return status\n }).every(item => item)\n if (status) {\n return this.submitRequestTrigger(props)\n } else {\n return false\n }\n },\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\n },\n genForm (base) {\n const { elements, title, buttonGroupMeta } = base\n return {\n elements: JSON.parse(JSON.stringify(elements)),\n buttonGroupMeta,\n title: `${title}${this.increaseCount++}`,\n _gen: true\n }\n },\n handleClickDelete (props = {}, attr = {}, idx) {\n this.innerGroupMeta.splice(idx, 1)\n this.$emit(BUILT_IN_EVENT_NAMES.DELETE, { ...props })\n },\n [BUILT_IN_EVENT_NAMES.INCREASE] (props) {\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\n const form = this.genForm(genTplTarget)\n this.innerGroupMeta.push(form)\n }\n },\n async mounted() {\n await this.preRequestTrigger()\n await this.infoRequestTrigger()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele {\n &.form-group-model__wrapper {\n background: unset;\n padding-bottom: 80px;\n .form-group-model__from {\n background: #fff;\n margin-top: 16px;\n &:first-child {\n margin-top: unset;\n }\n .form-group-model__form--title {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n }\n .form-group-model__form--content {\n padding: 16px;\n }\n }\n .form-group-model__form--footer {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n }\n }\n}\n</style>",".ele.form-group-model__wrapper {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--content {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4013
|
+
inject("data-v-ae2eaf8e_0", { source: ".ele.form-group-model__wrapper[data-v-ae2eaf8e] {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-ae2eaf8e] {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-ae2eaf8e]:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title[data-v-ae2eaf8e] {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--content[data-v-ae2eaf8e] {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer[data-v-ae2eaf8e] {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/models/form-group-model/src/index.vue","index.vue"],"names":[],"mappings":"AA4OA;EACA,iBAAA;EACA,oBAAA;AC3OA;AD4OA;EACA,gBAAA;EACA,gBAAA;AC1OA;AD2OA;EACA,iBAAA;ACzOA;AD2OA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,wBAAA;EACA,mDAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACzOA;AD2OA;EACA,aAAA;ACzOA;AD4OA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;AC1OA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele form-group-model__wrapper\">\n <template v-for=\"(group, idx) in innerGroupMeta\">\n <div \n class=\"form-group-model__from\"\n v-if=\"!group.isGenTpl\"\n :key=\"group.key || idx\">\n <div class=\"form-group-model__form--title\">\n <div>{{ group.title }}</div>\n <div class=\"form-group-model__form--buttons\">\n <ele-button-group v-if=\"group.buttonGroupMeta\" v-on=\"assignAttrForEvents\" @delete=\"handleClickDelete($event, group, idx)\" :data-source=\"group.buttonGroupMeta.elements.call(this)\"></ele-button-group>\n </div>\n </div>\n <div class=\"form-group-model__form--content\">\n <ele-form @change=\"onChangeFormStatus($event, group.key || idx)\" :form-name=\"group.key || idx\" :ref=\"group.key || `${formRefBase}__${idx}`\" :elements=\"group.elements\"></ele-form>\n </div>\n </div>\n </template>\n <div v-if=\"showFooterMeta\" class=\"form-group-model__form--footer\">\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\n </div>\n </div>\n</template>\n\n<script>\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, PAGE_STATUS } from '../../../utils'\nimport { v4 as uuidv4 } from 'uuid'\nimport { type, net } from '@idooel/shared'\nexport default {\n name: 'ele-form-group-model',\n props: {\n mode: {\n type: String\n },\n fieldName: {\n type: String,\n default: 'formGroup'\n },\n groupMeta: {\n type: Function,\n default: () => []\n },\n footerMeta: {\n type: Object,\n default: () => {}\n },\n preRequest: {\n type: Object,\n default: () => {}\n },\n infoRequest: {\n type: Object,\n default: () => {}\n },\n submitRequest: {\n type: Object,\n default: () => {}\n }\n },\n data () {\n return {\n increaseCount: 1,\n innerGroupMeta: []\n }\n },\n watch: {\n readOnlyGroupMeta: {\n handler (meta) {\n this.innerGroupMeta = meta\n },\n immediate: true\n }\n },\n computed: {\n routeMetaMode () {\n return this.$route.meta.mode\n },\n readOnlyGroupMeta () {\n return this.groupMeta.call(this)\n },\n showFooterMeta () {\n return !type.isEmpty(this.footerMeta)\n },\n formRefBase () {\n return uuidv4()\n },\n footerElements () {\n const { elements } = this.footerMeta\n return elements.call(this)\n },\n assignAttrForEvents () {\n const events = this.footerElements.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n this.$emit(ele.eventName || 'click', { ...e })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL],\n [BUILT_IN_EVENT_NAMES.INCREASE]: this[BUILT_IN_EVENT_NAMES.INCREASE]\n }\n },\n getFormRefs () {\n return this.innerGroupMeta.map((group, idx) => {\n if (!group.isGenTpl) {\n return this.$refs[group.key || `${this.formRefBase}__${idx}`]\n }\n return void 0\n }).filter(item => !!item).flat()\n },\n formModels () {\n if (this.mode === 'increase') {\n //TODO increase mode to return formModels\n return this.getFormRefs.map(form => {\n return form.getFieldsValue()\n })\n } else {\n return this.getFormRefs.map(form => {\n const { $vnode: { data: { ref } } } = form\n return {\n key: ref,\n value: form.getFieldsValue()\n }\n }).reduce((ret, props) => {\n ret[props.key] = props.value\n return ret\n }, {})\n }\n }\n },\n methods: {\n execFieldMap (fieldMap = {}, dataSource = {}) {\n const ret = parseFieldMap(fieldMap, { _route: this.$route.query, ...dataSource})\n return ret\n },\n onChangeFormStatus (props, key) {\n this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, { key, ...props })\n },\n async infoRequestTrigger () {\n if (!this.infoRequest || this.routeMetaMode == PAGE_STATUS.CREATE) return\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\n if (!url) return\n net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\n const { data = {} } = resp\n if (this.mode === 'increase') {\n this.renderIncreaseForm(data)\n }\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\n })\n },\n async preRequestTrigger () {\n if (!this.preRequest) return\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\n if (!url) return\n net[requestType.toLowerCase()](url, { ...params, ...fieldMap }, { ...headers }).then(resp => {\n const { data = {} } = resp\n if (this.mode === 'increase') {\n this.renderIncreaseForm(data)\n }\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\n })\n },\n renderIncreaseForm (data = {}) {\n const formGroupValuesLength = data[this.fieldName].length\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\n const notGenTplPoolLength = this.readOnlyGroupMeta.filter(item => !item.isGenTpl).length\n const genNum = formGroupValuesLength - notGenTplPoolLength\n new Array(genNum).fill().forEach(() => {\n const form = this.genForm(genTplTarget)\n this.innerGroupMeta.push(form)\n })\n const formGroupValues = data[this.fieldName]\n this.$nextTick(() => {\n this.setFieldsValue(formGroupValues)\n })\n },\n async submitRequestTrigger (props = {}) {\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\n if (!url) return\n const ret = await net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels }), [this.fieldName]: this.formModels }, { headers }).then(resp => {\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels, ...resp.data || {} } })\n return resp.data\n })\n return ret\n },\n setFieldsValue (data = []) {\n this.getFormRefs.forEach((form, idx) => {\n form.setFieldsValue(data[idx])\n form.evalDisabledExpression(data[idx])\n })\n },\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\n const status = this.getFormRefs.map(form => {\n const status = form.validateFields()\n return status\n }).every(item => item)\n if (status) {\n return this.submitRequestTrigger(props)\n } else {\n return false\n }\n },\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\n },\n genForm (base) {\n const { elements, title, buttonGroupMeta } = base\n return {\n elements: JSON.parse(JSON.stringify(elements)),\n buttonGroupMeta,\n title: `${title}${this.increaseCount++}`,\n _gen: true\n }\n },\n handleClickDelete (props = {}, attr = {}, idx) {\n this.innerGroupMeta.splice(idx, 1)\n this.$emit(BUILT_IN_EVENT_NAMES.DELETE, { ...props })\n },\n [BUILT_IN_EVENT_NAMES.INCREASE] (props) {\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\n const form = this.genForm(genTplTarget)\n this.innerGroupMeta.push(form)\n }\n },\n async mounted() {\n await this.preRequestTrigger()\n await this.infoRequestTrigger()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele {\n &.form-group-model__wrapper {\n background: unset;\n padding-bottom: 80px;\n .form-group-model__from {\n background: #fff;\n margin-top: 16px;\n &:first-child {\n margin-top: unset;\n }\n .form-group-model__form--title {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n }\n .form-group-model__form--content {\n padding: 16px;\n }\n }\n .form-group-model__form--footer {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n }\n }\n}\n</style>",".ele.form-group-model__wrapper {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--content {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3572
4014
|
|
|
3573
4015
|
};
|
|
3574
4016
|
/* scoped */
|
|
3575
|
-
const __vue_scope_id__$z = "data-v-
|
|
4017
|
+
const __vue_scope_id__$z = "data-v-ae2eaf8e";
|
|
3576
4018
|
/* module identifier */
|
|
3577
4019
|
const __vue_module_identifier__$z = undefined;
|
|
3578
4020
|
/* functional template */
|
|
@@ -3933,11 +4375,11 @@ __vue_render__$y._withStripped = true;
|
|
|
3933
4375
|
/* style */
|
|
3934
4376
|
const __vue_inject_styles__$y = function (inject) {
|
|
3935
4377
|
if (!inject) return
|
|
3936
|
-
inject("data-v-
|
|
4378
|
+
inject("data-v-457539e5_0", { source: ".form__model--wrapper[data-v-457539e5] {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title[data-v-457539e5] {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n}\n.form__model--wrapper .form-model__content[data-v-457539e5] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-457539e5] {\n /* width: 100%; */\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n float: right;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/models/form-model/src/index.vue","index.vue"],"names":[],"mappings":"AAgNA;EACA,WAAA;EACA,YAAA;EACA,cAAA;EACA,gBAAA;AC/MA;ADgNA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8DAAA;AC9MA;ADgNA;EACA,aAAA;AC9MA;ADgNA;EACA,iBAAA;EACA,YAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,YAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;AC9MA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"form__model--wrapper\">\n <div class=\"form-model__title\" v-if=\"title\">\n {{ title }}\n </div>\n <div class=\"form-model__content\">\n <ele-alert style=\"margin-bottom: 16px;\" v-if=\"alertMeta\" v-bind=\"alertMeta\"></ele-alert>\n <ele-form :ref=\"formRef\" @change=\"onChangeFormStatus($event)\" :elements=\"elements\" :disabled=\"globalDisabled\"></ele-form>\n </div>\n <div class=\"form-model__footer\" v-if=\"footerMeta\">\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\n </div>\n </div>\n</template>\n\n<script>\nimport { BUILT_IN_EVENT_NAMES, parseFieldMap, RESERVE_EVENT_NAMES, PAGE_STATUS, CONTEXT, BUILT_IN_METHODS_NAMES } from '../../../utils'\nimport { v4 as uuidv4 } from 'uuid'\nimport { net, type } from '@idooel/shared'\nimport { parse } from '@idooel/expression'\nexport default {\n name: 'ele-form-model',\n props: {\n disabled: {\n type: [Boolean, String],\n default: '_routeMeta.disabled'\n },\n title: {\n type: String\n },\n formMeta: {\n type: Object\n },\n footerMeta: {\n type: Object\n }\n },\n data() {\n return {}\n },\n provide () {\n return {\n [CONTEXT]: () => {\n return {\n exposed: this.exposed\n }\n }\n }\n },\n computed: {\n globalDisabled () {\n return this.executeExpression(this.disabled)\n },\n formRef () {\n return uuidv4()\n },\n exposed () {\n return {\n setFieldsValue: this.setFieldsValue,\n validateFields: this.validateFields,\n getFieldsValue: this.getFieldsValue,\n executeExpressions: this.executeExpressions,\n route: this.$route,\n [BUILT_IN_METHODS_NAMES.SUBMIT_FORM]: this.submitRequestTrigger\n }\n },\n assignAttrForEvents () {\n const events = this.footerElements.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n this.$emit(ele.eventName || 'click', { ...e, formModel: this.formModels(), exposed: this.exposed })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]\n }\n },\n elements () {\n const { elements } = this.formMeta\n return elements\n },\n preRequest () {\n const { preRequest = {} } = this.formMeta\n return preRequest\n },\n infoRequest () {\n const { infoRequest = {} } = this.formMeta\n return infoRequest\n },\n alertMeta () {\n const { alert = {} } = this.formMeta\n return type.isEmpty(alert) ? null : alert\n },\n submitRequest () {\n const { submitRequest = {} } = this.formMeta\n return submitRequest\n },\n footerElements () {\n const { elements } = this.footerMeta\n return elements.call(this)\n },\n expressionData () {\n return {\n _route: this.$route.query,\n _routeMeta: this.$route.meta\n }\n },\n routeMetaMode () {\n return this.$route.meta.mode\n }\n },\n methods: {\n collectDefaultValues () {\n const ret = this.elements.reduce((ret, props) => {\n const { name, defaultValue } = props\n if (defaultValue) {\n ret[name] = defaultValue\n }\n return ret\n }, {})\n return ret\n },\n onChangeFormStatus (props) {\n this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, { ...props })\n },\n formModels (fieldNames) {\n return this.$refs[this.formRef] ? this.$refs[this.formRef].getFieldsValue(fieldNames) : {}\n },\n executeExpression (expression, dataSource = {}) {\n if (type.isBool(expression)) return expression\n if (type.isEmpty(expression)) return false\n return parse(expression, { ...this.expressionData, ...this.formModels(), ...dataSource })\n },\n execFieldMap (fieldMap = {}, dataSource = {}) {\n const ret = parseFieldMap(fieldMap, { ...this.expressionData, ...dataSource})\n return ret\n },\n async submitRequestTrigger (props = {}) {\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\n const currentUrl = this.executeExpressionForUrl(url)\n if (!currentUrl) return\n const ret = await net[requestType.toLowerCase()](currentUrl, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels() }), ...this.formModels() }, { headers }).then(resp => {\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels(), ...resp.data || {} } })\n return resp.data\n })\n return ret\n },\n async infoRequestTrigger () {\n if (PAGE_STATUS.CREATE == this.routeMetaMode) return\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\n const currentUrl = this.executeExpressionForUrl(url)\n if (!currentUrl) return\n net[requestType.toLowerCase()](currentUrl, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\n const { data = {} } = resp\n this.setFieldsValue(data)\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\n })\n },\n async preRequestTrigger () {\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\n const currentUrl = this.executeExpressionForUrl(url)\n if (!currentUrl) return\n const { data } = await net[requestType.toLowerCase()](currentUrl, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers })\n this.setFieldsValue(data)\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\n },\n executeExpressionForUrl (url) {\n return type.isApi(url) ? url : this.executeExpression(url)\n },\n setFieldsValue (props) {\n this.$refs[this.formRef].setFieldsValue(props)\n },\n getFieldsValue (fieldNames) {\n return this.$refs[this.formRef].getFieldsValue(fieldNames)\n },\n executeExpressions () {\n return this.$refs[this.formRef].evalShowExpression()\n },\n validateFields () {\n return this.$refs[this.formRef].validateFields()\n },\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\n if (this.globalDisabled) return\n const status = this.$refs[this.formRef].validateFields()\n if (status) {\n //TODO fieldMap\n return this.submitRequestTrigger(props)\n } else {\n return false\n }\n },\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\n }\n },\n async mounted() {\n this.setFieldsValue(this.collectDefaultValues())\n await this.preRequestTrigger()\n await this.infoRequestTrigger()\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { exposed: this.exposed })\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.form__model--wrapper {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n .form-model__title {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n }\n .form-model__content {\n padding: 16px;\n }\n .form-model__footer {\n /* width: 100%; */\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n float: right;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n }\n}\n</style>",".form__model--wrapper {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n}\n.form__model--wrapper .form-model__content {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer {\n /* width: 100%; */\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n float: right;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3937
4379
|
|
|
3938
4380
|
};
|
|
3939
4381
|
/* scoped */
|
|
3940
|
-
const __vue_scope_id__$y = "data-v-
|
|
4382
|
+
const __vue_scope_id__$y = "data-v-457539e5";
|
|
3941
4383
|
/* module identifier */
|
|
3942
4384
|
const __vue_module_identifier__$y = undefined;
|
|
3943
4385
|
/* functional template */
|
|
@@ -4228,11 +4670,11 @@ __vue_render__$x._withStripped = true;
|
|
|
4228
4670
|
/* style */
|
|
4229
4671
|
const __vue_inject_styles__$x = function (inject) {
|
|
4230
4672
|
if (!inject) return
|
|
4231
|
-
inject("data-v-
|
|
4673
|
+
inject("data-v-f1ff737c_0", { source: ".ele-step-model__wrapper[data-v-f1ff737c] {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper[data-v-f1ff737c] {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper .ele-steps .ant-steps-item[data-v-f1ff737c] {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper[data-v-f1ff737c] {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n}\n.ele-step-model__wrapper .ele-step-model__footer--wrapper[data-v-f1ff737c] {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/models/step-model/src/index.vue","index.vue"],"names":[],"mappings":"AAwLA;EACA,WAAA;EACA,aAAA;EACA,kBAAA;ACvLA;ADwLA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;ACtLA;ADwLA;EACA,gBAAA;ACtLA;AD0LA;EACA,WAAA;EACA,WAAA;EACA,gBAAA;EACA,mBAAA;EACA,+CAAA;EACA,cAAA;ACxLA;AD0LA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;ACxLA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-step-model__wrapper\">\n <div class=\"ele-step-model__step--wrapper\">\n <a-steps class=\"ele-steps\" :current=\"current\" size=\"small\">\n <a-step v-for=\"step in elements\" :title=\"step.title\" :key=\"step.key\" />\n </a-steps>\n </div>\n <div class=\"ele-step-model__content--wrapper\">\n <template v-for=\"name in scopedSlotsNames\">\n <div :key=\"name\" v-if=\"currentSlotName == name\" :class=\"['ele-step-model__slot', `ele-step-model__slot--${name}`]\">\n <slot :name=\"name\"></slot>\n </div>\n </template>\n </div>\n <div class=\"ele-step-model__footer--wrapper\">\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\n </div>\n </div>\n</template>\n\n<script>\nimport { BUILT_IN_EVENT_NAMES, CONTEXT } from '../../../utils'\nimport { parse } from '@idooel/expression'\nimport { type } from '@idooel/shared'\nexport default {\n name: 'ele-step-model',\n props: {\n stepMeta: {\n type: Object,\n default: () => ({})\n },\n footerMeta: {\n type: Object,\n default: () => ({})\n }\n },\n data() {\n return {\n current: 0,\n currentSlotComponentRef: null,\n innerFooterElements: []\n }\n },\n provide() {\n return {\n [CONTEXT]: () => {\n return {\n ...this.expressionData\n }\n }\n }\n },\n computed: {\n routeMetaDisabled () {\n return this.executeExpression(this.$route.meta.disabled)\n },\n expressionData () {\n return {\n current: this.current,\n _route: this.$route.query,\n _routeMeta: this.$route.meta\n }\n },\n currentSlotName () {\n return this.scopedSlotsNames[this.current]\n },\n footerElements () {\n return this.innerFooterElements\n },\n assignAttrForEvents () {\n const events = this.footerElements.reduce((ret, ele) => {\n ret[ele.eventName] = (e) => {\n this.evalShowExpressionForFooterElements()\n this.$emit(ele.eventName || 'click', { ...e, exposed: this.exposedMethods })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events,\n [BUILT_IN_EVENT_NAMES.NEXT]: this[BUILT_IN_EVENT_NAMES.NEXT],\n [BUILT_IN_EVENT_NAMES.PREVIOUS]: this[BUILT_IN_EVENT_NAMES.PREVIOUS],\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\n }\n },\n activeIndex () {\n const { activeIndex } = this.stepMeta\n return activeIndex\n },\n elements () {\n const { elements } = this.stepMeta\n return elements\n },\n scopedSlotsNames () {\n const slotNames = this.elements.map(item => item.key)\n return slotNames\n },\n exposedMethods () {\n return {\n slotRef: this.currentSlotComponentRef,\n setCurrentStep: this.setCurrentStep,\n next: this.nextStep,\n prev: this.prevStep,\n current: this.current\n }\n }\n },\n watch: {\n activeIndex: {\n handler (idx) {\n this.current = idx\n },\n immediate: true\n },\n current: {\n handler () {\n this.$nextTick(() => {\n this.currentSlotComponentRef = this.getCurrentSlotComponentRef()\n })\n },\n immediate: true\n }\n },\n created () {\n const { elements } = this.footerMeta\n this.innerFooterElements = elements.call(this)\n this.evalShowExpressionForFooterElements()\n },\n methods: {\n executeExpression (expression) {\n if (type.isBool(expression)) return expression\n if (type.isEmpty(expression)) return false\n return parse(expression, { ...this.expressionData })\n },\n evalShowExpressionForFooterElements () {\n this.innerFooterElements = this.innerFooterElements.map(element => {\n const { show = true, key, eventName } = element\n if(key == BUILT_IN_EVENT_NAMES.SUBMIT || eventName == BUILT_IN_EVENT_NAMES.SUBMIT) {\n // built in submit button should according to the route meta disabled\n this.$set(element, '_show', this.executeExpression(show, this.expressionData) && !this.routeMetaDisabled)\n return element\n }\n show && this.$set(element, '_show', this.executeExpression(show, this.expressionData))\n return element\n })\n },\n getCurrentSlotComponentRef () {\n const includeMetaCmp = this.$children.find(child => child.meta)\n if (!includeMetaCmp) return null\n const { $children: components } = includeMetaCmp\n const target = components.find(cmp => cmp.$options._componentTag === 'ele-tpl')\n return target.getModel ? target.getModel() : null\n },\n setCurrentStep (index) {\n this.current = index\n this.evalShowExpressionForFooterElements()\n },\n nextStep () {\n if (this.current >= this.elements.length - 1) return\n this.current ++\n this.evalShowExpressionForFooterElements()\n },\n prevStep () {\n if (this.current <= 0) return\n this.current --\n this.evalShowExpressionForFooterElements()\n },\n [BUILT_IN_EVENT_NAMES.NEXT] (props) {\n this.$emit(BUILT_IN_EVENT_NAMES.NEXT, { ...props, exposed: { ...this.exposedMethods } })\n },\n [BUILT_IN_EVENT_NAMES.PREVIOUS] (props) {\n this.$emit(BUILT_IN_EVENT_NAMES.PREVIOUS, { ...props, exposed: { ...this.exposedMethods } })\n },\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props) {\n const currentComponent = this.getCurrentSlotComponentRef() || {}\n const hasSubmitMethod = currentComponent.hasOwnProperty(BUILT_IN_EVENT_NAMES.SUBMIT)\n hasSubmitMethod && currentComponent[BUILT_IN_EVENT_NAMES.SUBMIT]()\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, exposed: { ...this.exposedMethods } })\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele-step-model__wrapper {\n width: 100%;\n height: 100vh;\n position: relative;\n .ele-step-model__step--wrapper {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n .ele-steps {\n .ant-steps-item {\n text-align: left;\n }\n }\n }\n .ele-step-model__content--wrapper {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n }\n .ele-step-model__footer--wrapper {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n }\n}\n</style>import meta from '@/views/tree-table-page/meta'import meta from '@/views/tree-table-page/meta'\n\n",".ele-step-model__wrapper {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper .ele-steps .ant-steps-item {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n}\n.ele-step-model__wrapper .ele-step-model__footer--wrapper {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4232
4674
|
|
|
4233
4675
|
};
|
|
4234
4676
|
/* scoped */
|
|
4235
|
-
const __vue_scope_id__$x = "data-v-
|
|
4677
|
+
const __vue_scope_id__$x = "data-v-f1ff737c";
|
|
4236
4678
|
/* module identifier */
|
|
4237
4679
|
const __vue_module_identifier__$x = undefined;
|
|
4238
4680
|
/* functional template */
|
|
@@ -4337,7 +4779,7 @@ __vue_render__$w._withStripped = true;
|
|
|
4337
4779
|
/* style */
|
|
4338
4780
|
const __vue_inject_styles__$w = function (inject) {
|
|
4339
4781
|
if (!inject) return
|
|
4340
|
-
inject("data-v-
|
|
4782
|
+
inject("data-v-c854eaaa_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4341
4783
|
|
|
4342
4784
|
};
|
|
4343
4785
|
/* scoped */
|
|
@@ -5118,11 +5560,11 @@ __vue_render__$v._withStripped = true;
|
|
|
5118
5560
|
/* style */
|
|
5119
5561
|
const __vue_inject_styles__$v = function (inject) {
|
|
5120
5562
|
if (!inject) return
|
|
5121
|
-
inject("data-v-5bd17709_0", { source: ".ele__form--wrapper[data-v-5bd17709] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/form/src/index.vue","index.vue"],"names":[],"mappings":"AA0TA;EACA,gBAAA;ACzTA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele__form--wrapper\">\n <a-form :form=\"form\" layout=\"vertical\" class=\"ant-advanced-search-form\">\n <a-row :gutter=\"24\">\n <template v-for=\"ele in elements\">\n <a-col v-if=\"executeExpression(ele._show)\" :span=\"ele.span\" :key=\"ele.name\">\n <template v-if=\"ele.type == 'Input'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-input \n @change=\"onChange($event, ele)\" \n :disabled=\"executeExpression(ele._disabled)\" \n :max-length=\"ele.maxLength\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-input>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Textarea'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-textarea \n @change=\"onChange($event, ele)\"\n :max-length=\"ele.maxLength\"\n :autosize=\"ele.autosize\"\n :disabled=\"executeExpression(ele._disabled)\"\n :allow-clear=\"ele.allowClear\"\n :placeholder=\"ele.placeholder\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\"\n style=\"width:100%;\">\n </ele-textarea>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Select'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-select \n :data-source=\"ele.optionList\" \n :disabled=\"executeExpression(ele._disabled)\"\n :multiple=\"ele.multiple\"\n :mode=\"ele.mode\"\n :code=\"ele.code\"\n :init=\"ele.init\"\n :url=\"ele.url\"\n :params=\"ele.params\" \n @change=\"onChange($event, ele)\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-select>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-upload'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-upload v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n :ext=\"ele.ext\"\n :multiple=\"ele.multiple\"\n :accept=\"ele.accept\"\n :extensions=\"ele.extensions\"\n :size=\"ele.size\"\n :icon=\"ele.icon\"\n :url=\"ele.url\"\n :message=\"ele.message\" \n style=\"width:100%;\">\n </ele-upload>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-date-range'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-date-range \n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-date-range>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-date'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-date\n :format=\"ele.format\"\n :mode=\"ele.mode\"\n :show-time=\"ele.showTime\"\n :show-today=\"ele.showToday\"\n :value-format=\"ele.valueFormat\"\n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-date>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'SelectEntity'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-select-entity \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-select-entity>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'InputNumber' || ele.type == 'ele-input-number'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-input-number \n @change=\"onChange($event, ele)\" \n :precision=\"ele.precision\" \n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n v-bind=\"ele.props\" \n style=\"width:100%;\">\n </ele-input-number>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Checkbox'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-checkbox \n :data-source=\"ele.optionList\" \n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-checkbox>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Radio'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-radio \n @change=\"onChange($event, ele)\" \n :disabled=\"executeExpression(ele._disabled)\" \n :data-source=\"ele.optionList\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-radio>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-form-img-crop'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-form-img-crop\n @change=\"onChange($event, ele)\"\n :width=\"ele.width\"\n :height=\"ele.height\"\n :modal-title=\"ele.modalTitle\"\n :cropper-config=\"ele.cropperConfig\"\n :uploadFileConfig=\"ele.uploadFileConfig\"\n :oper-text=\"ele.operText\"\n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-form-img-crop>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-tree-select'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-tree-select\n @change=\"onChange($event, ele)\"\n :disabled=\"executeExpression(ele._disabled)\"\n v-bind=\"ele.meta\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-tree-select>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-select-entity-modal-table'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-select-entity-modal-table\n @change=\"onChange($event, ele)\"\n :disabled=\"executeExpression(ele._disabled)\"\n v-bind=\"ele.meta\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-select-entity-modal-table>\n </a-form-item>\n </template>\n </a-col>\n </template>\n </a-row>\n </a-form>\n </div>\n</template>\n\n<script>\nimport { parse } from '@idooel/expression'\nimport { type } from '@idooel/shared'\nimport { CONTEXT } from '../../utils'\nexport default {\n name: 'ele-form',\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n disabled: {\n type: [Boolean, String],\n default: '_routeMeta.disabled'\n },\n formName: {\n type: [Number, String],\n default: 'coordinated'\n },\n elements: {\n type: Array,\n default: () => []\n }\n },\n data () {\n return {\n formModel: {}\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n computed: {\n contextData () {\n return this[CONTEXT].call(this)\n },\n globalDisabled () {\n return this.executeExpression(this.disabled)\n },\n form () {\n const ref = this.$form.createForm(this, { name: this.formName })\n return ref\n },\n exposedMethods () {\n return {\n setFieldsValue: this.setFieldsValue,\n getFieldsValue: this.getFieldsValue\n }\n }\n },\n created () {\n this.setDefaultValues()\n },\n methods: {\n setFormModel (props = {}) {\n this.formModel = props\n this.dispatchExpression()\n },\n rebuildRules (rules = []) {\n //TODO\n rules.map(rule => {\n const { validator } = rule\n if (validator) {\n validator.formModel = this.getFieldsValue()\n validator.exposed = this.exposedMethods\n }\n })\n return rules\n },\n dispatchExpression () {\n this.evalDisabledExpression()\n this.evalShowExpression()\n },\n evalDisabledExpression () {\n this.elements.forEach(ele => {\n if (this.globalDisabled) return this.$set(ele, '_disabled', true)\n const { disabled } = ele\n const ret = this.executeExpression(disabled)\n this.$set(ele, '_disabled', ret)\n })\n },\n evalShowExpression () {\n this.elements.forEach(ele => {\n const { show = true } = ele\n const ret = this.executeExpression(show)\n this.$set(ele, '_show', ret)\n })\n },\n executeExpression (expression) {\n if (type.isBool(expression)) return expression\n if (type.isEmpty(expression)) return false\n return parse(expression, { ...this.getFieldsValue(), ...this.formModel, _route: this.$route.query, _routeMeta: this.$route.meta })\n },\n onChange (value, props) {\n const { name } = props\n this.$set(this.formModel, name, value)\n this.dispatchExpression()\n this.setFieldsValue({ [name]: value })\n this.$emit('change', { value, props, exposed: { ...this.exposedMethods } })\n },\n collectDefaultValues () {\n const ret = this.elements.reduce((ret, props) => {\n const { name, defaultValue } = props\n if (defaultValue) {\n ret[name] = defaultValue\n }\n return ret\n }, {})\n return ret\n },\n //TODO deprecated in the future, need to be implemented in the outer component\n setDefaultValues () {\n const defaultValues = this.collectDefaultValues()\n this.setFormModel(defaultValues)\n this.setFieldsValue(defaultValues)\n },\n validateFields () {\n let ret = false\n this.form.validateFields((error, values) => {\n ret = !error\n })\n return ret\n },\n setFieldsValue (props = {}) {\n this.$nextTick(() => {\n this.form.setFieldsValue(props)\n })\n },\n getFieldsValue (fieldNames) {\n return this.form.getFieldsValue(fieldNames)\n }\n },\n mounted() {\n this.$emit('x:mounted', { setFormModel: this.setFormModel })\n this.dispatchExpression()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele__form--wrapper {\n background: #fff;\n .ant-form-item {\n }\n}\n</style>",".ele__form--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5563
|
+
inject("data-v-2938fbba_0", { source: ".ele__form--wrapper[data-v-2938fbba] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/form/src/index.vue","index.vue"],"names":[],"mappings":"AA0TA;EACA,gBAAA;ACzTA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele__form--wrapper\">\n <a-form :form=\"form\" layout=\"vertical\" class=\"ant-advanced-search-form\">\n <a-row :gutter=\"24\">\n <template v-for=\"ele in elements\">\n <a-col v-if=\"executeExpression(ele._show)\" :span=\"ele.span\" :key=\"ele.name\">\n <template v-if=\"ele.type == 'Input'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-input \n @change=\"onChange($event, ele)\" \n :disabled=\"executeExpression(ele._disabled)\" \n :max-length=\"ele.maxLength\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-input>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Textarea'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-textarea \n @change=\"onChange($event, ele)\"\n :max-length=\"ele.maxLength\"\n :autosize=\"ele.autosize\"\n :disabled=\"executeExpression(ele._disabled)\"\n :allow-clear=\"ele.allowClear\"\n :placeholder=\"ele.placeholder\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\"\n style=\"width:100%;\">\n </ele-textarea>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Select'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-select \n :data-source=\"ele.optionList\" \n :disabled=\"executeExpression(ele._disabled)\"\n :multiple=\"ele.multiple\"\n :mode=\"ele.mode\"\n :code=\"ele.code\"\n :init=\"ele.init\"\n :url=\"ele.url\"\n :params=\"ele.params\" \n @change=\"onChange($event, ele)\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-select>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-upload'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-upload v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n :ext=\"ele.ext\"\n :multiple=\"ele.multiple\"\n :accept=\"ele.accept\"\n :extensions=\"ele.extensions\"\n :size=\"ele.size\"\n :icon=\"ele.icon\"\n :url=\"ele.url\"\n :message=\"ele.message\" \n style=\"width:100%;\">\n </ele-upload>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-date-range'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-date-range \n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-date-range>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-date'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-date\n :format=\"ele.format\"\n :mode=\"ele.mode\"\n :show-time=\"ele.showTime\"\n :show-today=\"ele.showToday\"\n :value-format=\"ele.valueFormat\"\n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-date>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'SelectEntity'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-select-entity \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-select-entity>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'InputNumber' || ele.type == 'ele-input-number'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-input-number \n @change=\"onChange($event, ele)\" \n :precision=\"ele.precision\" \n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n v-bind=\"ele.props\" \n style=\"width:100%;\">\n </ele-input-number>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Checkbox'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-checkbox \n :data-source=\"ele.optionList\" \n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-checkbox>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'Radio'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-radio \n @change=\"onChange($event, ele)\" \n :disabled=\"executeExpression(ele._disabled)\" \n :data-source=\"ele.optionList\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-radio>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-form-img-crop'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-form-img-crop\n @change=\"onChange($event, ele)\"\n :width=\"ele.width\"\n :height=\"ele.height\"\n :modal-title=\"ele.modalTitle\"\n :cropper-config=\"ele.cropperConfig\"\n :uploadFileConfig=\"ele.uploadFileConfig\"\n :oper-text=\"ele.operText\"\n :disabled=\"executeExpression(ele._disabled)\" \n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-form-img-crop>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-tree-select'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-tree-select\n @change=\"onChange($event, ele)\"\n :disabled=\"executeExpression(ele._disabled)\"\n v-bind=\"ele.meta\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-tree-select>\n </a-form-item>\n </template>\n <template v-else-if=\"ele.type == 'ele-select-entity-modal-table'\">\n <a-form-item :label=\"`${ele.label}:`\">\n <ele-select-entity-modal-table\n @change=\"onChange($event, ele)\"\n :disabled=\"executeExpression(ele._disabled)\"\n v-bind=\"ele.meta\"\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \n style=\"width:100%;\">\n </ele-select-entity-modal-table>\n </a-form-item>\n </template>\n </a-col>\n </template>\n </a-row>\n </a-form>\n </div>\n</template>\n\n<script>\nimport { parse } from '@idooel/expression'\nimport { type } from '@idooel/shared'\nimport { CONTEXT } from '../../utils'\nexport default {\n name: 'ele-form',\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n disabled: {\n type: [Boolean, String],\n default: '_routeMeta.disabled'\n },\n formName: {\n type: [Number, String],\n default: 'coordinated'\n },\n elements: {\n type: Array,\n default: () => []\n }\n },\n data () {\n return {\n formModel: {}\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n computed: {\n contextData () {\n return this[CONTEXT].call(this)\n },\n globalDisabled () {\n return this.executeExpression(this.disabled)\n },\n form () {\n const ref = this.$form.createForm(this, { name: this.formName })\n return ref\n },\n exposedMethods () {\n return {\n setFieldsValue: this.setFieldsValue,\n getFieldsValue: this.getFieldsValue\n }\n }\n },\n created () {\n this.setDefaultValues()\n },\n methods: {\n setFormModel (props = {}) {\n this.formModel = props\n this.dispatchExpression()\n },\n rebuildRules (rules = []) {\n //TODO\n rules.map(rule => {\n const { validator } = rule\n if (validator) {\n validator.formModel = this.getFieldsValue()\n validator.exposed = this.exposedMethods\n }\n })\n return rules\n },\n dispatchExpression () {\n this.evalDisabledExpression()\n this.evalShowExpression()\n },\n evalDisabledExpression () {\n this.elements.forEach(ele => {\n if (this.globalDisabled) return this.$set(ele, '_disabled', true)\n const { disabled } = ele\n const ret = this.executeExpression(disabled)\n this.$set(ele, '_disabled', ret)\n })\n },\n evalShowExpression () {\n this.elements.forEach(ele => {\n const { show = true } = ele\n const ret = this.executeExpression(show)\n this.$set(ele, '_show', ret)\n })\n },\n executeExpression (expression) {\n if (type.isBool(expression)) return expression\n if (type.isEmpty(expression)) return false\n return parse(expression, { ...this.getFieldsValue(), ...this.formModel, _route: this.$route.query, _routeMeta: this.$route.meta })\n },\n onChange (value, props) {\n const { name } = props\n this.$set(this.formModel, name, value)\n this.dispatchExpression()\n this.setFieldsValue({ [name]: value })\n this.$emit('change', { value, props, exposed: { ...this.exposedMethods } })\n },\n collectDefaultValues () {\n const ret = this.elements.reduce((ret, props) => {\n const { name, defaultValue } = props\n if (defaultValue) {\n ret[name] = defaultValue\n }\n return ret\n }, {})\n return ret\n },\n //TODO deprecated in the future, need to be implemented in the outer component\n setDefaultValues () {\n const defaultValues = this.collectDefaultValues()\n this.setFormModel(defaultValues)\n this.setFieldsValue(defaultValues)\n },\n validateFields () {\n let ret = false\n this.form.validateFields((error, values) => {\n ret = !error\n })\n return ret\n },\n setFieldsValue (props = {}) {\n this.$nextTick(() => {\n this.form.setFieldsValue(props)\n })\n },\n getFieldsValue (fieldNames) {\n return this.form.getFieldsValue(fieldNames)\n }\n },\n mounted() {\n this.$emit('x:mounted', { setFormModel: this.setFormModel })\n this.dispatchExpression()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele__form--wrapper {\n background: #fff;\n .ant-form-item {\n }\n}\n</style>",".ele__form--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5122
5564
|
|
|
5123
5565
|
};
|
|
5124
5566
|
/* scoped */
|
|
5125
|
-
const __vue_scope_id__$v = "data-v-
|
|
5567
|
+
const __vue_scope_id__$v = "data-v-2938fbba";
|
|
5126
5568
|
/* module identifier */
|
|
5127
5569
|
const __vue_module_identifier__$v = undefined;
|
|
5128
5570
|
/* functional template */
|
|
@@ -5214,11 +5656,11 @@ __vue_render__$u._withStripped = true;
|
|
|
5214
5656
|
/* style */
|
|
5215
5657
|
const __vue_inject_styles__$u = function (inject) {
|
|
5216
5658
|
if (!inject) return
|
|
5217
|
-
inject("data-v-
|
|
5659
|
+
inject("data-v-10c9d5a8_0", { source: ".ele-alert[data-v-10c9d5a8] {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/alert/src/index.vue","index.vue"],"names":[],"mappings":"AA0CA;EACA,2BAAA;ACzCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <a-alert\n class=\"ele-alert\"\n :message=\"message\" \n :description=\"description\" \n :type=\"type\"\n :closable=\"closable\"\n :closeText=\"closeText\"\n :show-icon=\"showIcon\" />\n</template>\n\n<script>\nexport default {\n name: 'ele-alert',\n props: {\n type: {\n type: String,\n default: 'success'\n },\n showIcon: {\n type: Boolean,\n default: true\n },\n message: {\n type: String,\n default: 'Success Tips'\n },\n description: {\n type: String\n },\n closable: {\n type: Boolean,\n default: true\n },\n closeText: {\n type: String\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele-alert {\n text-align: left !important;\n}\n</style>",".ele-alert {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5218
5660
|
|
|
5219
5661
|
};
|
|
5220
5662
|
/* scoped */
|
|
5221
|
-
const __vue_scope_id__$u = "data-v-
|
|
5663
|
+
const __vue_scope_id__$u = "data-v-10c9d5a8";
|
|
5222
5664
|
/* module identifier */
|
|
5223
5665
|
const __vue_module_identifier__$u = undefined;
|
|
5224
5666
|
/* functional template */
|
|
@@ -5245,7 +5687,66 @@ __vue_render__$u._withStripped = true;
|
|
|
5245
5687
|
__vue_component__$u.install = Vue => Vue.component(__vue_component__$u.name, __vue_component__$u);
|
|
5246
5688
|
|
|
5247
5689
|
//
|
|
5248
|
-
|
|
5690
|
+
|
|
5691
|
+
// 常量定义
|
|
5692
|
+
const CONSTANTS = {
|
|
5693
|
+
DEFAULT_URL: 'zuul/api-file/workbench/file',
|
|
5694
|
+
DEFAULT_ICON: '上传',
|
|
5695
|
+
DEFAULT_SIZE: 100,
|
|
5696
|
+
DEFAULT_MESSAGE: '单击或拖动文件到该区域以上传',
|
|
5697
|
+
DEFAULT_MAXIMUM: 20,
|
|
5698
|
+
BYTE_CONVERSION: 1024 * 1024,
|
|
5699
|
+
CHUNK_MIN_SIZE: 3 * 1024 * 1024,
|
|
5700
|
+
CHUNK_MAX_ACTIVE: 3,
|
|
5701
|
+
CHUNK_MAX_RETRIES: 5,
|
|
5702
|
+
SAVE_INTERVAL: 2000
|
|
5703
|
+
};
|
|
5704
|
+
|
|
5705
|
+
// 文件后缀图标映射
|
|
5706
|
+
const FILE_SUFFIX_ICONS = {
|
|
5707
|
+
'doc': {
|
|
5708
|
+
name: 'icon-doc'
|
|
5709
|
+
},
|
|
5710
|
+
'html': {
|
|
5711
|
+
name: 'icon-html'
|
|
5712
|
+
},
|
|
5713
|
+
'mp4': {
|
|
5714
|
+
name: 'icon-mp'
|
|
5715
|
+
},
|
|
5716
|
+
'pdf': {
|
|
5717
|
+
name: 'icon-pdf'
|
|
5718
|
+
},
|
|
5719
|
+
'ppt': {
|
|
5720
|
+
name: 'icon-ppt'
|
|
5721
|
+
},
|
|
5722
|
+
'psd': {
|
|
5723
|
+
name: 'icon-psd'
|
|
5724
|
+
},
|
|
5725
|
+
'rtf': {
|
|
5726
|
+
name: 'icon-rtf'
|
|
5727
|
+
},
|
|
5728
|
+
'txt': {
|
|
5729
|
+
name: 'icon-txt'
|
|
5730
|
+
},
|
|
5731
|
+
'vis': {
|
|
5732
|
+
name: 'icon-vis'
|
|
5733
|
+
},
|
|
5734
|
+
'xls': {
|
|
5735
|
+
name: 'icon-xls'
|
|
5736
|
+
},
|
|
5737
|
+
'xml': {
|
|
5738
|
+
name: 'icon-xml'
|
|
5739
|
+
},
|
|
5740
|
+
'zip': {
|
|
5741
|
+
name: 'icon-zip'
|
|
5742
|
+
},
|
|
5743
|
+
'jpg': {
|
|
5744
|
+
name: 'icon-img'
|
|
5745
|
+
},
|
|
5746
|
+
'mp3': {
|
|
5747
|
+
name: 'icon-mp1'
|
|
5748
|
+
}
|
|
5749
|
+
};
|
|
5249
5750
|
var script$t = {
|
|
5250
5751
|
name: 'ele-upload',
|
|
5251
5752
|
components: {
|
|
@@ -5258,20 +5759,19 @@ var script$t = {
|
|
|
5258
5759
|
props: {
|
|
5259
5760
|
url: {
|
|
5260
5761
|
type: String,
|
|
5261
|
-
|
|
5262
|
-
default: `zuul/api-file/workbench/file`
|
|
5762
|
+
default: CONSTANTS.DEFAULT_URL
|
|
5263
5763
|
},
|
|
5264
5764
|
icon: {
|
|
5265
5765
|
type: String,
|
|
5266
|
-
default:
|
|
5766
|
+
default: CONSTANTS.DEFAULT_ICON
|
|
5267
5767
|
},
|
|
5268
5768
|
size: {
|
|
5269
5769
|
type: Number,
|
|
5270
|
-
default:
|
|
5770
|
+
default: CONSTANTS.DEFAULT_SIZE
|
|
5271
5771
|
},
|
|
5272
5772
|
message: {
|
|
5273
5773
|
type: String,
|
|
5274
|
-
default:
|
|
5774
|
+
default: CONSTANTS.DEFAULT_MESSAGE
|
|
5275
5775
|
},
|
|
5276
5776
|
ext: {
|
|
5277
5777
|
type: String
|
|
@@ -5284,7 +5784,7 @@ var script$t = {
|
|
|
5284
5784
|
},
|
|
5285
5785
|
maximum: {
|
|
5286
5786
|
type: Number,
|
|
5287
|
-
default:
|
|
5787
|
+
default: CONSTANTS.DEFAULT_MAXIMUM
|
|
5288
5788
|
},
|
|
5289
5789
|
multiple: {
|
|
5290
5790
|
type: Boolean,
|
|
@@ -5312,7 +5812,7 @@ var script$t = {
|
|
|
5312
5812
|
},
|
|
5313
5813
|
byteConversion: {
|
|
5314
5814
|
type: Number,
|
|
5315
|
-
default:
|
|
5815
|
+
default: CONSTANTS.BYTE_CONVERSION
|
|
5316
5816
|
},
|
|
5317
5817
|
chunkEnabled: {
|
|
5318
5818
|
type: Boolean,
|
|
@@ -5321,37 +5821,66 @@ var script$t = {
|
|
|
5321
5821
|
},
|
|
5322
5822
|
data() {
|
|
5323
5823
|
return {
|
|
5824
|
+
// 文件状态管理
|
|
5324
5825
|
files: [],
|
|
5826
|
+
// vue-upload-component 管理的文件
|
|
5325
5827
|
buildedFiles: [],
|
|
5828
|
+
// 已构建完成的文件列表
|
|
5829
|
+
|
|
5830
|
+
// 上传状态管理
|
|
5326
5831
|
saveToServerAsyncPageTimer: null,
|
|
5327
|
-
uploadRefId: null
|
|
5832
|
+
uploadRefId: null,
|
|
5833
|
+
// 多选且外部无值时,预先生成 groupId,确保首次上传参数完整
|
|
5834
|
+
groupId: this.multiple && !this.value ? v4() : null
|
|
5328
5835
|
};
|
|
5329
5836
|
},
|
|
5837
|
+
created() {
|
|
5838
|
+
// 多文件模式下,如果没有外部 groupId,则生成一个
|
|
5839
|
+
if (this.multiple && !this.value) {
|
|
5840
|
+
this.groupId = v4();
|
|
5841
|
+
console.log('Created with new groupId:', this.groupId);
|
|
5842
|
+
}
|
|
5843
|
+
},
|
|
5330
5844
|
watch: {
|
|
5331
5845
|
value: {
|
|
5332
5846
|
async handler(value) {
|
|
5333
|
-
if (type.
|
|
5334
|
-
this.
|
|
5335
|
-
|
|
5847
|
+
if (type.isEmpty(value)) {
|
|
5848
|
+
this.resetFiles();
|
|
5849
|
+
} else if (this.multiple) {
|
|
5850
|
+
this.handleMultipleFileValue(value);
|
|
5336
5851
|
} else {
|
|
5337
|
-
|
|
5338
|
-
this.fetchFileWithFileId();
|
|
5852
|
+
this.handleSingleFileValue();
|
|
5339
5853
|
}
|
|
5340
5854
|
},
|
|
5341
5855
|
immediate: true
|
|
5342
5856
|
}
|
|
5343
5857
|
},
|
|
5344
5858
|
computed: {
|
|
5859
|
+
// ==================== 基础配置 ====================
|
|
5345
5860
|
prefixPath() {
|
|
5346
5861
|
return window.prefixPath;
|
|
5347
5862
|
},
|
|
5348
|
-
|
|
5863
|
+
uploadRef() {
|
|
5864
|
+
if (!this.uploadRefId) {
|
|
5865
|
+
this.uploadRefId = `uploadRef_${v4()}`;
|
|
5866
|
+
}
|
|
5867
|
+
return this.uploadRefId;
|
|
5868
|
+
},
|
|
5869
|
+
iconIsZhWord() {
|
|
5349
5870
|
return type.isZhWord(this.icon);
|
|
5350
5871
|
},
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5872
|
+
// ==================== 上传配置 ====================
|
|
5873
|
+
uploadParams() {
|
|
5874
|
+
return this.multiple ? {
|
|
5875
|
+
groupID: this.groupId
|
|
5876
|
+
} : {};
|
|
5877
|
+
},
|
|
5878
|
+
fileSizeLimit() {
|
|
5879
|
+
return this.size * this.byteConversion;
|
|
5880
|
+
},
|
|
5881
|
+
postAction() {
|
|
5882
|
+
const queryString = route.toQueryString(this.querys);
|
|
5883
|
+
return `${this.prefixPath}${this.url}?${queryString}`;
|
|
5355
5884
|
},
|
|
5356
5885
|
chunkConfig() {
|
|
5357
5886
|
return {
|
|
@@ -5359,9 +5888,9 @@ var script$t = {
|
|
|
5359
5888
|
headers: {
|
|
5360
5889
|
...this.headers
|
|
5361
5890
|
},
|
|
5362
|
-
minSize:
|
|
5363
|
-
maxActive:
|
|
5364
|
-
maxRetries:
|
|
5891
|
+
minSize: CONSTANTS.CHUNK_MIN_SIZE,
|
|
5892
|
+
maxActive: CONSTANTS.CHUNK_MAX_ACTIVE,
|
|
5893
|
+
maxRetries: CONSTANTS.CHUNK_MAX_RETRIES,
|
|
5365
5894
|
startBody: {
|
|
5366
5895
|
override: true,
|
|
5367
5896
|
path: '/cw'
|
|
@@ -5376,185 +5905,279 @@ var script$t = {
|
|
|
5376
5905
|
}
|
|
5377
5906
|
};
|
|
5378
5907
|
},
|
|
5379
|
-
isFileUploadSuccessed() {
|
|
5380
|
-
return this.files.every(file => file.success);
|
|
5381
|
-
},
|
|
5382
|
-
isShowUploadContainer() {
|
|
5383
|
-
if (this.multiple) {
|
|
5384
|
-
if (this.isFileUploadSuccessed && this.buildedFiles.length >= this.maximum) {
|
|
5385
|
-
return false;
|
|
5386
|
-
} else {
|
|
5387
|
-
return true;
|
|
5388
|
-
}
|
|
5389
|
-
} else {
|
|
5390
|
-
const [file = {}] = this.buildedFiles;
|
|
5391
|
-
if (this.buildedFiles.length < 1) {
|
|
5392
|
-
return true;
|
|
5393
|
-
}
|
|
5394
|
-
if (this.isFileUploadSuccessed && this.buildedFiles.length >= 1 || !file.response) {
|
|
5395
|
-
return false;
|
|
5396
|
-
} else {
|
|
5397
|
-
return true;
|
|
5398
|
-
}
|
|
5399
|
-
}
|
|
5400
|
-
},
|
|
5401
5908
|
getMaximum() {
|
|
5402
5909
|
return this.multiple ? this.maximum : 1;
|
|
5403
5910
|
},
|
|
5404
|
-
|
|
5405
|
-
|
|
5911
|
+
// ==================== 文件状态 ====================
|
|
5912
|
+
uploadingFiles() {
|
|
5913
|
+
return this.files.filter(file => file.progress !== undefined && !file.success);
|
|
5406
5914
|
},
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
return `${this.prefixPath}${this.url}?${ret}`;
|
|
5915
|
+
completedFiles() {
|
|
5916
|
+
return this.buildedFiles.filter(file => file.fileID);
|
|
5410
5917
|
},
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5918
|
+
totalFiles() {
|
|
5919
|
+
return this.uploadingFiles.length + this.completedFiles.length;
|
|
5920
|
+
},
|
|
5921
|
+
isFileUploadSuccessed() {
|
|
5922
|
+
const currentUploadingFiles = this.files.filter(file => file.response !== undefined);
|
|
5923
|
+
if (currentUploadingFiles.length === 0) {
|
|
5924
|
+
return this.buildedFiles.length > 0;
|
|
5414
5925
|
}
|
|
5415
|
-
return
|
|
5926
|
+
return currentUploadingFiles.every(file => file.success);
|
|
5927
|
+
},
|
|
5928
|
+
isShowUploadContainer() {
|
|
5929
|
+
const maxFiles = this.multiple ? this.maximum : 1;
|
|
5930
|
+
return this.totalFiles < maxFiles;
|
|
5416
5931
|
},
|
|
5932
|
+
// ==================== 文件信息 ====================
|
|
5417
5933
|
fileSuffixIcon() {
|
|
5418
|
-
return
|
|
5419
|
-
'doc': {
|
|
5420
|
-
name: 'icon-doc'
|
|
5421
|
-
},
|
|
5422
|
-
'html': {
|
|
5423
|
-
name: 'icon-html'
|
|
5424
|
-
},
|
|
5425
|
-
'mp4': {
|
|
5426
|
-
name: 'icon-mp'
|
|
5427
|
-
},
|
|
5428
|
-
'pdf': {
|
|
5429
|
-
name: 'icon-pdf'
|
|
5430
|
-
},
|
|
5431
|
-
'ppt': {
|
|
5432
|
-
name: 'icon-ppt'
|
|
5433
|
-
},
|
|
5434
|
-
'psd': {
|
|
5435
|
-
name: 'icon-psd'
|
|
5436
|
-
},
|
|
5437
|
-
'rtf': {
|
|
5438
|
-
name: 'icon-rtf'
|
|
5439
|
-
},
|
|
5440
|
-
'txt': {
|
|
5441
|
-
name: 'icon-txt'
|
|
5442
|
-
},
|
|
5443
|
-
'vis': {
|
|
5444
|
-
name: 'icon-vis'
|
|
5445
|
-
},
|
|
5446
|
-
'xls': {
|
|
5447
|
-
name: 'icon-xls'
|
|
5448
|
-
},
|
|
5449
|
-
'xml': {
|
|
5450
|
-
name: 'icon-xml'
|
|
5451
|
-
},
|
|
5452
|
-
'zip': {
|
|
5453
|
-
name: 'icon-zip'
|
|
5454
|
-
},
|
|
5455
|
-
'jpg': {
|
|
5456
|
-
name: 'icon-img'
|
|
5457
|
-
},
|
|
5458
|
-
'mp3': {
|
|
5459
|
-
name: 'icon-mp1'
|
|
5460
|
-
}
|
|
5461
|
-
};
|
|
5934
|
+
return FILE_SUFFIX_ICONS;
|
|
5462
5935
|
},
|
|
5463
5936
|
fileIds() {
|
|
5464
|
-
|
|
5465
|
-
return
|
|
5466
|
-
}
|
|
5467
|
-
|
|
5937
|
+
if (this.multiple) {
|
|
5938
|
+
return this.groupId;
|
|
5939
|
+
} else {
|
|
5940
|
+
const fileIds = this.buildedFiles.map(file => file.fileID);
|
|
5941
|
+
return fileIds[0];
|
|
5942
|
+
}
|
|
5468
5943
|
},
|
|
5469
5944
|
fileResponseData() {
|
|
5470
5945
|
return this.multiple ? this.buildedFiles : this.buildedFiles[0];
|
|
5471
5946
|
}
|
|
5472
5947
|
},
|
|
5473
5948
|
methods: {
|
|
5474
|
-
|
|
5949
|
+
// ==================== 文件管理 ====================
|
|
5950
|
+
|
|
5951
|
+
/**
|
|
5952
|
+
* 从多个数组中移除文件
|
|
5953
|
+
*/
|
|
5954
|
+
removeFromArrays(file, arrays, key = 'fileID') {
|
|
5955
|
+
return arrays.map(arr => arr.filter(item => item[key] !== file[key] && item.id !== file.id));
|
|
5956
|
+
},
|
|
5957
|
+
/**
|
|
5958
|
+
* 检查文件是否为新文件
|
|
5959
|
+
*/
|
|
5960
|
+
isNewFile(newFile, existingFiles, key = 'fileID') {
|
|
5961
|
+
return newFile[key] && !existingFiles.some(existing => existing[key] === newFile[key]);
|
|
5962
|
+
},
|
|
5963
|
+
/**
|
|
5964
|
+
* 合并文件数据
|
|
5965
|
+
*/
|
|
5966
|
+
mergeFileData(uploadFile) {
|
|
5967
|
+
return {
|
|
5968
|
+
...uploadFile.response.data,
|
|
5969
|
+
...uploadFile
|
|
5970
|
+
};
|
|
5971
|
+
},
|
|
5972
|
+
/**
|
|
5973
|
+
* 初始化文件列表
|
|
5974
|
+
*/
|
|
5975
|
+
async initializeFiles() {
|
|
5475
5976
|
if (!this.value) return;
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5977
|
+
if (this.multiple) {
|
|
5978
|
+
await this.fetchFilesWithGroupId();
|
|
5979
|
+
} else {
|
|
5980
|
+
await this.fetchFileWithFileId();
|
|
5981
|
+
}
|
|
5982
|
+
},
|
|
5983
|
+
/**
|
|
5984
|
+
* 获取多文件组
|
|
5985
|
+
*/
|
|
5986
|
+
async fetchFilesWithGroupId() {
|
|
5987
|
+
try {
|
|
5988
|
+
const response = await net.get(`/api-file/workbench/file/group/${this.value}`);
|
|
5989
|
+
const data = response.data || [];
|
|
5990
|
+
|
|
5991
|
+
// 只有在没有现有文件时才设置初始文件列表
|
|
5992
|
+
if (this.buildedFiles.length === 0) {
|
|
5993
|
+
this.buildedFiles = data;
|
|
5994
|
+
console.log('Initial files loaded:', this.buildedFiles.length);
|
|
5995
|
+
} else {
|
|
5996
|
+
console.log('Keep existing files, skip initial load');
|
|
5997
|
+
}
|
|
5998
|
+
} catch (error) {
|
|
5999
|
+
console.log('fetchFilesWithGroupId error:', error);
|
|
6000
|
+
console.log('Keep current files, do not clear due to API error');
|
|
6001
|
+
}
|
|
6002
|
+
},
|
|
6003
|
+
/**
|
|
6004
|
+
* 获取单文件
|
|
6005
|
+
*/
|
|
6006
|
+
async fetchFileWithFileId() {
|
|
6007
|
+
try {
|
|
6008
|
+
const response = await net.get(`/api-file/file/${this.value}`);
|
|
6009
|
+
const data = response.data;
|
|
5480
6010
|
this.buildedFiles = [data];
|
|
5481
6011
|
this.files = [data];
|
|
6012
|
+
} catch (error) {
|
|
6013
|
+
console.log('fetchFileWithFileId error:', error);
|
|
6014
|
+
}
|
|
6015
|
+
},
|
|
6016
|
+
/**
|
|
6017
|
+
* 处理文件删除
|
|
6018
|
+
*/
|
|
6019
|
+
handleClickDelete(file) {
|
|
6020
|
+
const {
|
|
6021
|
+
fileID
|
|
6022
|
+
} = file;
|
|
6023
|
+
console.log('Deleting file:', {
|
|
6024
|
+
name: file.name,
|
|
6025
|
+
fileID
|
|
5482
6026
|
});
|
|
6027
|
+
|
|
6028
|
+
// 从上传组件中移除文件
|
|
6029
|
+
if (this.$refs[this.uploadRef]) {
|
|
6030
|
+
this.$refs[this.uploadRef].remove(file);
|
|
6031
|
+
}
|
|
6032
|
+
|
|
6033
|
+
// 从所有数组中移除文件
|
|
6034
|
+
[this.files, this.buildedFiles] = this.removeFromArrays(file, [this.files, this.buildedFiles]);
|
|
6035
|
+
console.log('After deletion - files:', this.files.length, 'buildedFiles:', this.buildedFiles.length);
|
|
6036
|
+
|
|
6037
|
+
// 多文件模式下,如果删除最后一个文件,重置 groupId
|
|
6038
|
+
if (this.multiple && this.buildedFiles.length === 0) {
|
|
6039
|
+
this.groupId = null;
|
|
6040
|
+
console.log('Reset groupId after deleting last file');
|
|
6041
|
+
}
|
|
6042
|
+
|
|
6043
|
+
// 触发 change 事件
|
|
6044
|
+
this.$emit('change', this.fileIds);
|
|
5483
6045
|
},
|
|
6046
|
+
/**
|
|
6047
|
+
* 处理文件下载
|
|
6048
|
+
*/
|
|
5484
6049
|
handleClickDownload(file) {
|
|
5485
6050
|
const {
|
|
5486
6051
|
fileID: fileId
|
|
5487
6052
|
} = file;
|
|
5488
6053
|
window.open(`/api-file/workbench/file/stream/${fileId}?origin=true`);
|
|
5489
6054
|
},
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
this.files = this.files.filter(file => file.fileID !== fileID);
|
|
5496
|
-
this.buildedFiles = this.buildedFiles.filter(file => file.fileID !== fileID);
|
|
5497
|
-
this.$emit('change', this.fileIds);
|
|
5498
|
-
},
|
|
6055
|
+
// ==================== 上传处理 ====================
|
|
6056
|
+
|
|
6057
|
+
/**
|
|
6058
|
+
* 处理文件上传状态变化
|
|
6059
|
+
*/
|
|
5499
6060
|
onWatchFiles(files) {
|
|
6061
|
+
console.log('onWatchFiles called with files:', files.length);
|
|
6062
|
+
console.log('Current buildedFiles:', this.buildedFiles.length);
|
|
6063
|
+
|
|
6064
|
+
// 更新文件状态
|
|
5500
6065
|
this.files = files;
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
});
|
|
6066
|
+
|
|
6067
|
+
// 处理已上传成功的文件
|
|
6068
|
+
this.processUploadedFiles(files);
|
|
6069
|
+
|
|
6070
|
+
// 检查上传是否完成
|
|
5507
6071
|
if (this.isFileUploadSuccessed) {
|
|
5508
6072
|
this.$emit('change', this.fileIds);
|
|
5509
6073
|
this.$emit('on-success', this.fileResponseData);
|
|
5510
6074
|
}
|
|
5511
6075
|
},
|
|
6076
|
+
/**
|
|
6077
|
+
* 处理已上传成功的文件
|
|
6078
|
+
*/
|
|
6079
|
+
processUploadedFiles(files) {
|
|
6080
|
+
// 处理所有有响应的文件(包括正在上传和已完成的)
|
|
6081
|
+
const uploadedFiles = files.filter(file => file.response);
|
|
6082
|
+
const newBuildedFiles = uploadedFiles.map(file => this.mergeFileData(file));
|
|
6083
|
+
if (this.multiple) {
|
|
6084
|
+
this.processMultipleFiles(newBuildedFiles);
|
|
6085
|
+
} else {
|
|
6086
|
+
// 单文件模式:只保留最新的文件
|
|
6087
|
+
this.buildedFiles = newBuildedFiles;
|
|
6088
|
+
}
|
|
6089
|
+
this.logFileStatus();
|
|
6090
|
+
},
|
|
6091
|
+
/**
|
|
6092
|
+
* 处理多文件模式
|
|
6093
|
+
*/
|
|
6094
|
+
processMultipleFiles(newBuildedFiles) {
|
|
6095
|
+
// 获取已存在的文件ID集合
|
|
6096
|
+
const existingFileIds = new Set(this.buildedFiles.map(f => f.fileID).filter(id => id));
|
|
6097
|
+
|
|
6098
|
+
// 过滤出真正的新文件
|
|
6099
|
+
const trulyNewFiles = newBuildedFiles.filter(newFile => this.isNewFile(newFile, this.buildedFiles));
|
|
6100
|
+
console.log('Existing fileIDs:', Array.from(existingFileIds));
|
|
6101
|
+
console.log('New uploaded files:', newBuildedFiles.map(f => ({
|
|
6102
|
+
name: f.name,
|
|
6103
|
+
fileID: f.fileID
|
|
6104
|
+
})));
|
|
6105
|
+
console.log('Truly new files:', trulyNewFiles.map(f => ({
|
|
6106
|
+
name: f.name,
|
|
6107
|
+
fileID: f.fileID
|
|
6108
|
+
})));
|
|
6109
|
+
|
|
6110
|
+
// 将新文件追加到现有文件列表
|
|
6111
|
+
if (trulyNewFiles.length > 0) {
|
|
6112
|
+
this.buildedFiles = [...this.buildedFiles, ...trulyNewFiles];
|
|
6113
|
+
console.log('Added new files, total buildedFiles:', this.buildedFiles.length);
|
|
6114
|
+
}
|
|
6115
|
+
|
|
6116
|
+
// 更新现有文件的状态(包括新添加的文件)
|
|
6117
|
+
this.updateExistingFiles(newBuildedFiles);
|
|
6118
|
+
},
|
|
6119
|
+
/**
|
|
6120
|
+
* 更新现有文件状态
|
|
6121
|
+
*/
|
|
6122
|
+
updateExistingFiles(newBuildedFiles) {
|
|
6123
|
+
this.buildedFiles = this.buildedFiles.map(existingFile => {
|
|
6124
|
+
const updatedFile = newBuildedFiles.find(newFile => newFile.fileID === existingFile.fileID);
|
|
6125
|
+
return updatedFile ? {
|
|
6126
|
+
...existingFile,
|
|
6127
|
+
...updatedFile
|
|
6128
|
+
} : existingFile;
|
|
6129
|
+
});
|
|
6130
|
+
},
|
|
6131
|
+
/**
|
|
6132
|
+
* 记录文件状态日志
|
|
6133
|
+
*/
|
|
6134
|
+
logFileStatus() {
|
|
6135
|
+
console.log('Final buildedFiles:', this.buildedFiles.length);
|
|
6136
|
+
console.log('buildedFiles details:', this.buildedFiles.map(f => ({
|
|
6137
|
+
name: f.name,
|
|
6138
|
+
fileID: f.fileID,
|
|
6139
|
+
success: f.success
|
|
6140
|
+
})));
|
|
6141
|
+
console.log('Uploading files:', this.uploadingFiles.length);
|
|
6142
|
+
console.log('Completed files:', this.completedFiles.length);
|
|
6143
|
+
},
|
|
6144
|
+
// ==================== 异步处理 ====================
|
|
6145
|
+
|
|
6146
|
+
/**
|
|
6147
|
+
* 异步保存文件到服务器
|
|
6148
|
+
*/
|
|
5512
6149
|
async saveToServerAsyncPage(payloads = {}) {
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
6150
|
+
try {
|
|
6151
|
+
const response = await net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, {
|
|
6152
|
+
headers: {
|
|
6153
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
|
6154
|
+
}
|
|
6155
|
+
});
|
|
5518
6156
|
const {
|
|
5519
6157
|
data
|
|
5520
|
-
} =
|
|
6158
|
+
} = response;
|
|
5521
6159
|
if (data !== 'saveToServerAsyncPage') {
|
|
5522
6160
|
clearInterval(this.saveToServerAsyncPageTimer);
|
|
5523
6161
|
}
|
|
5524
|
-
})
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
// }
|
|
5535
|
-
// if (data !== 'saveToServerAsyncPage') {
|
|
5536
|
-
// clearInterval(timer)
|
|
5537
|
-
// const { fileID, size } = data
|
|
5538
|
-
// this.$emit('on-success', { ...data, fileId: fileID })
|
|
5539
|
-
// this.$Message.success('同步成功')
|
|
5540
|
-
// return { fileId: fileID, size }
|
|
5541
|
-
// }
|
|
5542
|
-
// })
|
|
5543
|
-
// return ret
|
|
5544
|
-
},
|
|
5545
|
-
// 验证文件类型
|
|
6162
|
+
} catch (error) {
|
|
6163
|
+
console.error('saveToServerAsyncPage error:', error);
|
|
6164
|
+
clearInterval(this.saveToServerAsyncPageTimer);
|
|
6165
|
+
}
|
|
6166
|
+
},
|
|
6167
|
+
// ==================== 文件验证 ====================
|
|
6168
|
+
|
|
6169
|
+
/**
|
|
6170
|
+
* 验证文件类型
|
|
6171
|
+
*/
|
|
5546
6172
|
validateFileType(file) {
|
|
5547
6173
|
if (!file || !file.name) {
|
|
5548
6174
|
console.log('文件或文件名不存在');
|
|
5549
6175
|
return false;
|
|
5550
6176
|
}
|
|
5551
|
-
const
|
|
5552
|
-
const fileExt = fileName.substring(fileName.lastIndexOf('.'));
|
|
6177
|
+
const fileExt = this.getFileExtension(file.name);
|
|
5553
6178
|
console.log('文件扩展名:', fileExt);
|
|
5554
|
-
|
|
5555
|
-
// 只检查 extensions,accept 由 vue-upload-component 处理
|
|
5556
6179
|
if (this.extensions) {
|
|
5557
|
-
const allowedExts = this.
|
|
6180
|
+
const allowedExts = this.getAllowedExtensions();
|
|
5558
6181
|
console.log('允许的扩展名:', allowedExts);
|
|
5559
6182
|
if (!allowedExts.includes(fileExt)) {
|
|
5560
6183
|
console.log('扩展名不在允许列表中');
|
|
@@ -5565,68 +6188,172 @@ var script$t = {
|
|
|
5565
6188
|
console.log('文件类型验证通过');
|
|
5566
6189
|
return true;
|
|
5567
6190
|
},
|
|
6191
|
+
/**
|
|
6192
|
+
* 获取文件扩展名
|
|
6193
|
+
*/
|
|
6194
|
+
getFileExtension(fileName) {
|
|
6195
|
+
return fileName.toLowerCase().substring(fileName.lastIndexOf('.'));
|
|
6196
|
+
},
|
|
6197
|
+
/**
|
|
6198
|
+
* 获取允许的扩展名列表
|
|
6199
|
+
*/
|
|
6200
|
+
getAllowedExtensions() {
|
|
6201
|
+
return this.extensions.toLowerCase().split(',').map(ext => ext.trim().startsWith('.') ? ext.trim() : `.${ext.trim()}`);
|
|
6202
|
+
},
|
|
6203
|
+
// ==================== 事件处理 ====================
|
|
6204
|
+
|
|
6205
|
+
/**
|
|
6206
|
+
* 处理文件输入事件
|
|
6207
|
+
*/
|
|
5568
6208
|
onWatchInputFiles(newFile, oldFile) {
|
|
5569
6209
|
if (newFile && !oldFile) {
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
// 验证文件类型
|
|
5576
|
-
if (!this.validateFileType(newFile)) {
|
|
5577
|
-
// 如果验证失败,移除文件
|
|
5578
|
-
console.log('文件类型验证失败,尝试移除文件');
|
|
5579
|
-
console.log('uploadRef:', this.uploadRef);
|
|
5580
|
-
console.log('$refs:', this.$refs);
|
|
5581
|
-
if (this.$refs[this.uploadRef]) {
|
|
5582
|
-
this.$refs[this.uploadRef].remove(newFile);
|
|
5583
|
-
} else {
|
|
5584
|
-
console.error('无法找到 uploadRef 引用');
|
|
5585
|
-
}
|
|
5586
|
-
return;
|
|
5587
|
-
}
|
|
5588
|
-
console.log('文件类型验证通过,继续上传');
|
|
5589
|
-
// 不要在这里 return,让文件继续走原有的上传逻辑
|
|
6210
|
+
this.handleFileAdd(newFile);
|
|
6211
|
+
} else if (newFile && oldFile) {
|
|
6212
|
+
this.handleFileUpdate(newFile);
|
|
6213
|
+
} else if (!newFile && oldFile) {
|
|
6214
|
+
this.handleFileDelete();
|
|
5590
6215
|
}
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
asyncID: v4(),
|
|
5611
|
-
isDeleteOrigin: false,
|
|
5612
|
-
toImage: type === 'pdf' ? true : false,
|
|
5613
|
-
unzip: type === 'zip' ? true : false,
|
|
5614
|
-
_csrf: localStorage.getItem('token')
|
|
5615
|
-
};
|
|
5616
|
-
this.saveToServerAsyncPageTimer = setInterval(() => {
|
|
5617
|
-
this.saveToServerAsyncPage(payloads);
|
|
5618
|
-
}, 2000);
|
|
5619
|
-
}
|
|
6216
|
+
|
|
6217
|
+
// 激活上传组件
|
|
6218
|
+
this.activateUploadComponent(newFile, oldFile);
|
|
6219
|
+
},
|
|
6220
|
+
/**
|
|
6221
|
+
* 处理文件添加
|
|
6222
|
+
*/
|
|
6223
|
+
handleFileAdd(newFile) {
|
|
6224
|
+
console.log('add file:', newFile);
|
|
6225
|
+
console.log('extensions:', this.extensions);
|
|
6226
|
+
console.log('accept:', this.accept);
|
|
6227
|
+
|
|
6228
|
+
// 生成或使用 groupId
|
|
6229
|
+
this.ensureGroupId();
|
|
6230
|
+
|
|
6231
|
+
// 验证文件类型
|
|
6232
|
+
if (!this.validateFileType(newFile)) {
|
|
6233
|
+
this.removeInvalidFile(newFile);
|
|
6234
|
+
return;
|
|
5620
6235
|
}
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
6236
|
+
console.log('文件类型验证通过,继续上传');
|
|
6237
|
+
},
|
|
6238
|
+
/**
|
|
6239
|
+
* 处理文件更新
|
|
6240
|
+
*/
|
|
6241
|
+
handleFileUpdate(newFile) {
|
|
6242
|
+
console.log('update', newFile);
|
|
6243
|
+
const {
|
|
6244
|
+
success,
|
|
6245
|
+
active,
|
|
6246
|
+
chunk,
|
|
6247
|
+
response
|
|
6248
|
+
} = newFile;
|
|
6249
|
+
if (chunk && success && !active) {
|
|
6250
|
+
console.log('chunk end');
|
|
6251
|
+
this.handleChunkComplete(response);
|
|
6252
|
+
}
|
|
6253
|
+
},
|
|
6254
|
+
/**
|
|
6255
|
+
* 处理文件删除
|
|
6256
|
+
*/
|
|
6257
|
+
handleFileDelete() {
|
|
6258
|
+
console.log('delete');
|
|
6259
|
+
},
|
|
6260
|
+
/**
|
|
6261
|
+
* 确保 groupId 存在
|
|
6262
|
+
*/
|
|
6263
|
+
ensureGroupId() {
|
|
6264
|
+
console.log('onWatchInputFiles - multiple:', this.multiple, 'current groupId:', this.groupId);
|
|
6265
|
+
if (this.multiple && !this.groupId) {
|
|
6266
|
+
this.groupId = v4();
|
|
6267
|
+
console.log('Generated new groupId:', this.groupId);
|
|
6268
|
+
} else if (this.multiple && this.groupId) {
|
|
6269
|
+
console.log('Using existing groupId:', this.groupId);
|
|
5624
6270
|
}
|
|
6271
|
+
},
|
|
6272
|
+
/**
|
|
6273
|
+
* 移除无效文件
|
|
6274
|
+
*/
|
|
6275
|
+
removeInvalidFile(file) {
|
|
6276
|
+
console.log('文件类型验证失败,尝试移除文件');
|
|
6277
|
+
console.log('uploadRef:', this.uploadRef);
|
|
6278
|
+
console.log('$refs:', this.$refs);
|
|
6279
|
+
if (this.$refs[this.uploadRef]) {
|
|
6280
|
+
this.$refs[this.uploadRef].remove(file);
|
|
6281
|
+
} else {
|
|
6282
|
+
console.error('无法找到 uploadRef 引用');
|
|
6283
|
+
}
|
|
6284
|
+
},
|
|
6285
|
+
/**
|
|
6286
|
+
* 处理分片上传完成
|
|
6287
|
+
*/
|
|
6288
|
+
handleChunkComplete(response) {
|
|
6289
|
+
const {
|
|
6290
|
+
data: {
|
|
6291
|
+
file,
|
|
6292
|
+
type
|
|
6293
|
+
}
|
|
6294
|
+
} = response;
|
|
6295
|
+
const payloads = {
|
|
6296
|
+
filePath: file.match(/\/cw(.*)/) ? file.match(/\/cw(.*)/)[0] : void 0,
|
|
6297
|
+
asyncID: v4(),
|
|
6298
|
+
isDeleteOrigin: false,
|
|
6299
|
+
toImage: type === 'pdf',
|
|
6300
|
+
unzip: type === 'zip',
|
|
6301
|
+
_csrf: localStorage.getItem('token')
|
|
6302
|
+
};
|
|
6303
|
+
this.saveToServerAsyncPageTimer = setInterval(() => {
|
|
6304
|
+
this.saveToServerAsyncPage(payloads);
|
|
6305
|
+
}, CONSTANTS.SAVE_INTERVAL);
|
|
6306
|
+
},
|
|
6307
|
+
/**
|
|
6308
|
+
* 激活上传组件
|
|
6309
|
+
*/
|
|
6310
|
+
activateUploadComponent(newFile, oldFile) {
|
|
5625
6311
|
if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {
|
|
5626
6312
|
if (!this.$refs[this.uploadRef].active) {
|
|
5627
6313
|
this.$refs[this.uploadRef].active = true;
|
|
5628
6314
|
}
|
|
5629
6315
|
}
|
|
6316
|
+
},
|
|
6317
|
+
// ==================== 值变化处理 ====================
|
|
6318
|
+
|
|
6319
|
+
/**
|
|
6320
|
+
* 重置文件状态
|
|
6321
|
+
*/
|
|
6322
|
+
resetFiles() {
|
|
6323
|
+
this.files = [];
|
|
6324
|
+
this.buildedFiles = [];
|
|
6325
|
+
// 多选模式下保留或生成 groupId,避免首次上传为空
|
|
6326
|
+
if (this.multiple) {
|
|
6327
|
+
if (!this.groupId) {
|
|
6328
|
+
this.groupId = v4();
|
|
6329
|
+
console.log('Generated groupId in resetFiles:', this.groupId);
|
|
6330
|
+
} else {
|
|
6331
|
+
console.log('Preserve existing groupId in resetFiles:', this.groupId);
|
|
6332
|
+
}
|
|
6333
|
+
} else {
|
|
6334
|
+
this.groupId = null;
|
|
6335
|
+
console.log('Reset groupId to null (single mode)');
|
|
6336
|
+
}
|
|
6337
|
+
},
|
|
6338
|
+
/**
|
|
6339
|
+
* 处理多文件模式的值变化
|
|
6340
|
+
*/
|
|
6341
|
+
async handleMultipleFileValue(value) {
|
|
6342
|
+
// multiple - value 就是 groupId
|
|
6343
|
+
// 只有当 groupId 发生变化时才重新获取文件列表(初始化回显)
|
|
6344
|
+
if (this.groupId !== value) {
|
|
6345
|
+
this.groupId = value;
|
|
6346
|
+
console.log('Set groupId from external value:', this.groupId);
|
|
6347
|
+
await this.fetchFilesWithGroupId();
|
|
6348
|
+
} else {
|
|
6349
|
+
console.log('GroupId unchanged, skip fetchFilesWithGroupId');
|
|
6350
|
+
}
|
|
6351
|
+
},
|
|
6352
|
+
/**
|
|
6353
|
+
* 处理单文件模式的值变化
|
|
6354
|
+
*/
|
|
6355
|
+
async handleSingleFileValue() {
|
|
6356
|
+
await this.fetchFileWithFileId();
|
|
5630
6357
|
}
|
|
5631
6358
|
}
|
|
5632
6359
|
};
|
|
@@ -5667,6 +6394,7 @@ var __vue_render__$t = function () {
|
|
|
5667
6394
|
multiple: _vm.multiple,
|
|
5668
6395
|
headers: _vm.headers,
|
|
5669
6396
|
maximum: _vm.getMaximum,
|
|
6397
|
+
data: _vm.uploadParams,
|
|
5670
6398
|
},
|
|
5671
6399
|
on: { "input-file": _vm.onWatchInputFiles, input: _vm.onWatchFiles },
|
|
5672
6400
|
model: {
|
|
@@ -5716,57 +6444,114 @@ var __vue_render__$t = function () {
|
|
|
5716
6444
|
_c(
|
|
5717
6445
|
"section",
|
|
5718
6446
|
{ staticClass: "ele-files__wrapper" },
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
_c(
|
|
6447
|
+
[
|
|
6448
|
+
_vm._l(_vm.uploadingFiles, function (file, idx) {
|
|
6449
|
+
return _c(
|
|
5722
6450
|
"div",
|
|
5723
|
-
{ staticClass: "ele-
|
|
6451
|
+
{ key: "uploading-" + idx, staticClass: "ele-file__item" },
|
|
5724
6452
|
[
|
|
5725
|
-
_c(
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
6453
|
+
_c(
|
|
6454
|
+
"div",
|
|
6455
|
+
{ staticClass: "ele-file__suffix--icon" },
|
|
6456
|
+
[
|
|
6457
|
+
_c("ele-icon", {
|
|
6458
|
+
attrs: {
|
|
6459
|
+
type: _vm.fileSuffixIcon[file.suffix]
|
|
6460
|
+
? _vm.fileSuffixIcon[file.suffix].name
|
|
6461
|
+
: "icon-file",
|
|
6462
|
+
},
|
|
6463
|
+
}),
|
|
6464
|
+
],
|
|
6465
|
+
1
|
|
6466
|
+
),
|
|
6467
|
+
_vm._v(" "),
|
|
6468
|
+
_c("div", { staticClass: "ele-file__name" }, [
|
|
6469
|
+
_c("div", { staticClass: "ele-file__inner" }, [
|
|
6470
|
+
_vm._v(_vm._s(file.name)),
|
|
6471
|
+
]),
|
|
6472
|
+
_vm._v(" "),
|
|
6473
|
+
file.progress !== undefined
|
|
6474
|
+
? _c(
|
|
6475
|
+
"div",
|
|
6476
|
+
{ staticClass: "ele-uplpad__progress" },
|
|
6477
|
+
[
|
|
6478
|
+
_c("a-progress", {
|
|
6479
|
+
attrs: {
|
|
6480
|
+
strokeWidth: 2,
|
|
6481
|
+
percent: Number(file.progress),
|
|
6482
|
+
size: "small",
|
|
6483
|
+
},
|
|
6484
|
+
}),
|
|
6485
|
+
],
|
|
6486
|
+
1
|
|
6487
|
+
)
|
|
6488
|
+
: _vm._e(),
|
|
6489
|
+
]),
|
|
6490
|
+
_vm._v(" "),
|
|
6491
|
+
file.success || file.error
|
|
6492
|
+
? _c("div", { staticClass: "ele-file__delete" }, [
|
|
6493
|
+
_c("span", { staticClass: "ele-file__size" }, [
|
|
6494
|
+
_vm._v(
|
|
6495
|
+
_vm._s((file.size / _vm.byteConversion).toFixed(2)) +
|
|
6496
|
+
"M"
|
|
6497
|
+
),
|
|
6498
|
+
]),
|
|
6499
|
+
_vm._v(" "),
|
|
6500
|
+
_c(
|
|
6501
|
+
"span",
|
|
6502
|
+
{
|
|
6503
|
+
staticClass: "ele-file__delete--icon",
|
|
6504
|
+
on: {
|
|
6505
|
+
click: function ($event) {
|
|
6506
|
+
return _vm.handleClickDelete(file)
|
|
6507
|
+
},
|
|
6508
|
+
},
|
|
6509
|
+
},
|
|
6510
|
+
[_c("ele-icon", { attrs: { type: "delete" } })],
|
|
6511
|
+
1
|
|
6512
|
+
),
|
|
6513
|
+
])
|
|
6514
|
+
: _vm._e(),
|
|
6515
|
+
]
|
|
6516
|
+
)
|
|
6517
|
+
}),
|
|
6518
|
+
_vm._v(" "),
|
|
6519
|
+
_vm._l(_vm.completedFiles, function (file, idx) {
|
|
6520
|
+
return _c(
|
|
6521
|
+
"div",
|
|
6522
|
+
{ key: "completed-" + idx, staticClass: "ele-file__item" },
|
|
6523
|
+
[
|
|
6524
|
+
_c(
|
|
6525
|
+
"div",
|
|
6526
|
+
{ staticClass: "ele-file__suffix--icon" },
|
|
6527
|
+
[
|
|
6528
|
+
_c("ele-icon", {
|
|
6529
|
+
attrs: {
|
|
6530
|
+
type: _vm.fileSuffixIcon[file.suffix]
|
|
6531
|
+
? _vm.fileSuffixIcon[file.suffix].name
|
|
6532
|
+
: "icon-file",
|
|
6533
|
+
},
|
|
6534
|
+
}),
|
|
6535
|
+
],
|
|
6536
|
+
1
|
|
6537
|
+
),
|
|
6538
|
+
_vm._v(" "),
|
|
6539
|
+
_c("div", { staticClass: "ele-file__name" }, [
|
|
6540
|
+
_c(
|
|
5752
6541
|
"div",
|
|
5753
|
-
{
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
percent: Number(file.progress),
|
|
5759
|
-
size: "small",
|
|
6542
|
+
{
|
|
6543
|
+
staticClass: "ele-file__inner",
|
|
6544
|
+
on: {
|
|
6545
|
+
click: function ($event) {
|
|
6546
|
+
return _vm.handleClickDownload(file)
|
|
5760
6547
|
},
|
|
5761
|
-
}
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
)
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
file.success || file.error || !file.response
|
|
5769
|
-
? _c("div", { staticClass: "ele-file__delete" }, [
|
|
6548
|
+
},
|
|
6549
|
+
},
|
|
6550
|
+
[_vm._v(_vm._s(file.name))]
|
|
6551
|
+
),
|
|
6552
|
+
]),
|
|
6553
|
+
_vm._v(" "),
|
|
6554
|
+
_c("div", { staticClass: "ele-file__delete" }, [
|
|
5770
6555
|
_c("span", { staticClass: "ele-file__size" }, [
|
|
5771
6556
|
_vm._v(
|
|
5772
6557
|
_vm._s((file.size / _vm.byteConversion).toFixed(2)) + "M"
|
|
@@ -5786,11 +6571,12 @@ var __vue_render__$t = function () {
|
|
|
5786
6571
|
[_c("ele-icon", { attrs: { type: "delete" } })],
|
|
5787
6572
|
1
|
|
5788
6573
|
),
|
|
5789
|
-
])
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
6574
|
+
]),
|
|
6575
|
+
]
|
|
6576
|
+
)
|
|
6577
|
+
}),
|
|
6578
|
+
],
|
|
6579
|
+
2
|
|
5794
6580
|
),
|
|
5795
6581
|
],
|
|
5796
6582
|
1
|
|
@@ -5802,11 +6588,11 @@ __vue_render__$t._withStripped = true;
|
|
|
5802
6588
|
/* style */
|
|
5803
6589
|
const __vue_inject_styles__$t = function (inject) {
|
|
5804
6590
|
if (!inject) return
|
|
5805
|
-
inject("data-v-b00d3688_0", { source: "[data-v-b00d3688] .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n[data-v-b00d3688] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n.ele-upload__wrapper[data-v-b00d3688] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-b00d3688] {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon[data-v-b00d3688] {\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n font-size: 16x;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload[data-v-b00d3688] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon[data-v-b00d3688] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-b00d3688] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-b00d3688] {\n font-size: 16px;\n color: var(--idoole-black-088);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext[data-v-b00d3688] {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item[data-v-b00d3688] {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name[data-v-b00d3688] {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner[data-v-b00d3688] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-b00d3688] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-b00d3688] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/upload/src/index.vue","index.vue"],"names":[],"mappings":"AA6ZA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;EAIA,+CAAA;AC/ZA;AD4ZA;EACA,0DAAA;AC1ZA;AD8ZA;EACA,WAAA;AC3ZA;AD4ZA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;AC1ZA;AD2ZA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,cAAA;ACzZA;AD0ZA;EACA,eAAA;EACA,kCAAA;ACxZA;AD0ZA;EACA,eAAA;EACA,kCAAA;ACxZA;AD2ZA;EACA,iBAAA;ACzZA;AD0ZA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;ACxZA;AD0ZA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;ACxZA;AD6ZA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC3ZA;AD6ZA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;AC3ZA;AD4ZA;EACA,gBAAA;EACA,uBAAA;AC1ZA;AD6ZA;EACA,gBAAA;AC3ZA;AD4ZA;EACA,gBAAA;EACA,eAAA;AC1ZA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-upload__wrapper\">\n <FileUpload\n class=\"ele-upload__inner\"\n v-show=\"isShowUploadContainer\"\n v-model=\"files\"\n :ref=\"uploadRef\"\n :drop=\"drop\"\n :chunk-enabled=\"chunkEnabled\"\n :chunk=\"chunkConfig\"\n :accept=\"accept\"\n :size=\"fileSizeLimit\"\n :post-action=\"postAction\"\n :multiple=\"multiple\"\n :headers=\"headers\"\n :maximum=\"getMaximum\"\n @input-file=\"onWatchInputFiles\"\n @input=\"onWatchFiles\"\n style=\"width: 100%;\">\n <section class=\"ele-upload__area\">\n <div class=\"ele-upload__area--icon\">\n <template v-if=\"iconIsZhWrod\">\n {{ icon }}\n </template>\n <template v-else>\n <ele-icon :type=\"icon\"></ele-icon>\n </template>\n </div>\n <div class=\"ele-upload__area--text\">\n <div class=\"ele-upload__message\" v-if=\"message\" v-html=\"message\"></div>\n <div class=\"ele-upload__message\" v-else>单击或拖动文件到该区域以上传</div>\n <div class=\"ele-upload__ext\" v-if=\"ext\" v-html=\"ext\"></div>\n <div class=\"ele-upload__ext\" v-else>文件小于{{ size }}M</div>\n </div>\n </section>\n </FileUpload>\n <section class=\"ele-files__wrapper\">\n <div class=\"ele-file__item\" v-for=\"(file, idx) in buildedFiles\" :key=\"idx\">\n <div class=\"ele-file__suffix--icon\">\n <ele-icon :type=\"fileSuffixIcon[file.suffix] ? fileSuffixIcon[file.suffix].name : 'icon-file'\"></ele-icon>\n </div>\n <div class=\"ele-file__name\">\n <div class=\"ele-file__inner\" @click=\"handleClickDownload(file)\">{{ file.name }}</div>\n <div v-if=\"(!file.success && file.progress)\" class=\"ele-uplpad__progress\">\n <a-progress :strokeWidth=\"2\" :percent=\"Number(file.progress)\" size=\"small\" />\n </div>\n </div>\n <div class=\"ele-file__delete\" v-if=\"file.success || file.error || !file.response\">\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\n <ele-icon type=\"delete\"></ele-icon>\n </span>\n </div>\n </div>\n </section>\n </div>\n</template>\n\n<script>\nimport FileUpload from 'vue-upload-component'\nimport { v4 as uuidv4 } from 'uuid'\nimport { route, net, type } from '@idooel/shared'\n// import { message } from 'ant-design-vue'\nexport default {\n name: 'ele-upload',\n components: {\n FileUpload\n },\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n url: {\n type: String,\n //TODO\n default: `zuul/api-file/workbench/file`\n },\n icon: {\n type: String,\n default: '上传'\n },\n size: {\n type: Number,\n default: 100\n },\n message: {\n type: String,\n default: '单击或拖动文件到该区域以上传'\n },\n ext: {\n type: String\n },\n extensions: {\n type: String\n },\n accept: {\n type: String\n },\n maximum: {\n type: Number,\n default: 10\n },\n multiple: {\n type: Boolean,\n default: false\n },\n drop: {\n type: Boolean,\n default: true\n },\n value: {\n type: [String, Array]\n },\n querys: {\n type: Object,\n default: () => ({\n _csrf: localStorage.getItem('token'),\n _t: new Date().valueOf()\n })\n },\n headers: {\n type: Object,\n default: () => ({\n 'X-XSRF-TOKEN': localStorage.getItem('token')\n })\n },\n byteConversion: {\n type: Number,\n default: 1024 * 1024\n },\n chunkEnabled: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n files: [],\n buildedFiles: [],\n saveToServerAsyncPageTimer: null,\n uploadRefId: null\n }\n },\n watch: {\n value: {\n async handler (value) {\n if (type.isArray(value)) {\n // multiple\n } else if (type.isEmpty(value)) {\n this.files = []\n this.buildedFiles = []\n } else {\n // single\n this.fetchFileWithFileId()\n }\n },\n immediate: true\n }\n },\n computed: {\n prefixPath () {\n return window.prefixPath\n },\n iconIsZhWrod () {\n return type.isZhWord(this.icon)\n },\n getPayloads () {\n return {\n override: false\n }\n },\n chunkConfig () {\n return {\n action: `${this.prefixPath}zuul/api-file/workbench/file/temp/chunk/vue`,\n headers: {\n ...this.headers\n },\n minSize: 3 * this.byteConversion,\n maxActive: 3,\n maxRetries: 5,\n startBody: {\n override: true,\n path: '/cw'\n },\n uploadBody: {\n override: true,\n path: '/cw'\n },\n finishBody: {\n override: true,\n path: '/cw'\n }\n }\n },\n isFileUploadSuccessed () {\n return this.files.every(file => file.success)\n },\n isShowUploadContainer () {\n if (this.multiple) {\n if (this.isFileUploadSuccessed && this.buildedFiles.length >= this.maximum) {\n return false\n } else {\n return true\n }\n } else {\n const [file = {}] = this.buildedFiles\n if (this.buildedFiles.length < 1) {\n return true\n }\n if ((this.isFileUploadSuccessed && this.buildedFiles.length >= 1) || !file.response) {\n return false\n } else {\n return true\n }\n }\n },\n getMaximum () {\n return this.multiple ? this.maximum : 1\n },\n fileSizeLimit () {\n return this.size * this.byteConversion\n },\n postAction () {\n const ret = route.toQueryString(this.querys)\n return `${this.prefixPath}${this.url}?${ret}`\n },\n uploadRef () {\n if (!this.uploadRefId) {\n this.uploadRefId = `uploadRef_${uuidv4()}`\n }\n return this.uploadRefId\n },\n fileSuffixIcon () {\n return {\n 'doc': { name: 'icon-doc' },\n 'html': { name: 'icon-html' },\n 'mp4': { name: 'icon-mp' },\n 'pdf': { name: 'icon-pdf' },\n 'ppt': { name: 'icon-ppt' },\n 'psd': { name: 'icon-psd' },\n 'rtf': { name: 'icon-rtf' },\n 'txt': { name: 'icon-txt' },\n 'vis': { name: 'icon-vis' },\n 'xls': { name: 'icon-xls' },\n 'xml': { name: 'icon-xml' },\n 'zip': { name: 'icon-zip' },\n 'jpg': { name: 'icon-img' },\n 'mp3': { name: 'icon-mp1' },\n }\n },\n fileIds () {\n const fileIds = this.buildedFiles.map(file => {\n return file.fileID\n })\n return this.multiple ? fileIds : fileIds[0]\n },\n fileResponseData () {\n return this.multiple ? this.buildedFiles : this.buildedFiles[0]\n }\n },\n methods: {\n async fetchFileWithFileId () {\n if (!this.value) return\n await net.get(\n `/api-file/file/${this.value}`\n ).then(resp => {\n const { data } = resp\n this.buildedFiles = [data]\n this.files = [data]\n })\n },\n handleClickDownload (file) {\n const { fileID: fileId } = file\n window.open(`/api-file/workbench/file/stream/${fileId}?origin=true`)\n },\n handleClickDelete (file) {\n this.$refs[this.uploadRef].remove(file)\n const { fileID } = file\n this.files = this.files.filter(file => file.fileID !== fileID)\n this.buildedFiles = this.buildedFiles.filter(file => file.fileID !== fileID)\n this.$emit('change', this.fileIds)\n },\n onWatchFiles (files) {\n this.files = files\n this.buildedFiles = this.files.map(file => {\n return {\n ...file.response.data,\n ...file\n }\n })\n if (this.isFileUploadSuccessed) {\n this.$emit('change', this.fileIds)\n this.$emit('on-success', this.fileResponseData)\n }\n },\n async saveToServerAsyncPage (payloads = {}) {\n net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, { \n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'\n }\n }).then(resp =>{\n const { data } = resp\n if (data !== 'saveToServerAsyncPage') {\n clearInterval(this.saveToServerAsyncPageTimer)\n }\n })\n // const ret = await net.post({\n // url: 'zuul/api-file/workbench/file/temp/saveToServerAsyncPage',\n // method: 'POST',\n // data: { ...payloads }\n // }).then(resp => {\n // const { data: { data, code, message } } = resp\n // if (code !== '2000') {\n // this.$Message.error(message)\n // return\n // }\n // if (data !== 'saveToServerAsyncPage') {\n // clearInterval(timer)\n // const { fileID, size } = data\n // this.$emit('on-success', { ...data, fileId: fileID })\n // this.$Message.success('同步成功')\n // return { fileId: fileID, size }\n // }\n // })\n // return ret\n },\n // 验证文件类型\n validateFileType(file) {\n if (!file || !file.name) {\n console.log('文件或文件名不存在')\n return false\n }\n \n const fileName = file.name.toLowerCase()\n const fileExt = fileName.substring(fileName.lastIndexOf('.'))\n console.log('文件扩展名:', fileExt)\n \n // 只检查 extensions,accept 由 vue-upload-component 处理\n if (this.extensions) {\n const allowedExts = this.extensions.toLowerCase()\n .split(',')\n .map(ext => ext.trim().startsWith('.') ? ext.trim() : `.${ext.trim()}`)\n console.log('允许的扩展名:', allowedExts)\n \n if (!allowedExts.includes(fileExt)) {\n console.log('扩展名不在允许列表中')\n this.$message.error(`不支持的文件类型 \"${fileExt}\",请上传 ${this.extensions} 格式的文件`)\n return false\n }\n }\n \n console.log('文件类型验证通过')\n return true\n },\n onWatchInputFiles (newFile, oldFile) {\n if (newFile && !oldFile) {\n // add file\n console.log('add file:', newFile)\n console.log('extensions:', this.extensions)\n console.log('accept:', this.accept)\n \n // 验证文件类型\n if (!this.validateFileType(newFile)) {\n // 如果验证失败,移除文件\n console.log('文件类型验证失败,尝试移除文件')\n console.log('uploadRef:', this.uploadRef)\n console.log('$refs:', this.$refs)\n if (this.$refs[this.uploadRef]) {\n this.$refs[this.uploadRef].remove(newFile)\n } else {\n console.error('无法找到 uploadRef 引用')\n }\n return\n }\n console.log('文件类型验证通过,继续上传')\n // 不要在这里 return,让文件继续走原有的上传逻辑\n }\n if (newFile && oldFile) {\n // update file\n console.log('update', newFile)\n const { success, active, chunk, response } = newFile\n if (chunk && success && !active) {\n console.log('chunk end')\n const { data: { file, type } } = response\n const payloads = {\n filePath: file.match(/\\/cw(.*)/) ? file.match(/\\/cw(.*)/)[0] : void 0,\n asyncID: uuidv4(),\n isDeleteOrigin: false,\n toImage: type === 'pdf' ? true : false,\n unzip: type === 'zip' ? true : false,\n _csrf: localStorage.getItem('token')\n }\n this.saveToServerAsyncPageTimer = setInterval(() => {\n this.saveToServerAsyncPage(payloads)\n }, 2000)\n }\n }\n if (!newFile && oldFile) {\n // delete file\n console.log('delete')\n }\n if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {\n if (!this.$refs[this.uploadRef].active) {\n this.$refs[this.uploadRef].active = true\n }\n }\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n::v-deep .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n &:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n }\n border-radius: var(--idooel-form-border-radius);\n}\n.ele-upload__wrapper {\n width: 100%;\n .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n .ele-upload__area--icon {\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n font-size: 16x;\n .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n }\n .anticon {\n font-size: 48px;\n color: var(--idooel-primary-color);\n }\n }\n .ele-upload__area--text {\n margin-left: 16px;\n .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-088);\n text-align: left;\n }\n .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n }\n }\n }\n .ele-files__wrapper {\n .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n .ele-file__suffix--icon {}\n .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n .ele-file__delete {\n margin-left: 8px;\n .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n }\n }\n }\n }\n}\n</style>","::v-deep .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n::v-deep .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n\n.ele-upload__wrapper {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon {\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n font-size: 16x;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-088);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6591
|
+
inject("data-v-48a2255a_0", { source: "[data-v-48a2255a] .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n[data-v-48a2255a] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n.ele-upload__wrapper[data-v-48a2255a] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-48a2255a] {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon[data-v-48a2255a] {\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n font-size: 16x;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload[data-v-48a2255a] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon[data-v-48a2255a] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-48a2255a] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-48a2255a] {\n font-size: 16px;\n color: var(--idoole-black-088);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext[data-v-48a2255a] {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item[data-v-48a2255a] {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__suffix--icon[data-v-48a2255a] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name[data-v-48a2255a] {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner[data-v-48a2255a] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-48a2255a] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-48a2255a] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/upload/src/index.vue","index.vue"],"names":[],"mappings":"AAmuBA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;EAIA,+CAAA;ACruBA;ADkuBA;EACA,0DAAA;AChuBA;ADouBA;EACA,WAAA;ACjuBA;ADkuBA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;AChuBA;ADiuBA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,cAAA;AC/tBA;ADguBA;EACA,eAAA;EACA,kCAAA;AC9tBA;ADguBA;EACA,eAAA;EACA,kCAAA;AC9tBA;ADiuBA;EACA,iBAAA;AC/tBA;ADguBA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;AC9tBA;ADguBA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;AC9tBA;ADmuBA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACjuBA;ADkuBA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;EACA,YAAA;AChuBA;ADkuBA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;AChuBA;ADiuBA;EACA,gBAAA;EACA,uBAAA;AC/tBA;ADkuBA;EACA,gBAAA;AChuBA;ADiuBA;EACA,gBAAA;EACA,eAAA;AC/tBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-upload__wrapper\">\n <FileUpload\n class=\"ele-upload__inner\"\n v-show=\"isShowUploadContainer\"\n v-model=\"files\"\n :ref=\"uploadRef\"\n :drop=\"drop\"\n :chunk-enabled=\"chunkEnabled\"\n :chunk=\"chunkConfig\"\n :accept=\"accept\"\n :size=\"fileSizeLimit\"\n :post-action=\"postAction\"\n :multiple=\"multiple\"\n :headers=\"headers\"\n :maximum=\"getMaximum\"\n :data=\"uploadParams\"\n @input-file=\"onWatchInputFiles\"\n @input=\"onWatchFiles\"\n style=\"width: 100%;\">\n <section class=\"ele-upload__area\">\n <div class=\"ele-upload__area--icon\">\n <template v-if=\"iconIsZhWrod\">\n {{ icon }}\n </template>\n <template v-else>\n <ele-icon :type=\"icon\"></ele-icon>\n </template>\n </div>\n <div class=\"ele-upload__area--text\">\n <div class=\"ele-upload__message\" v-if=\"message\" v-html=\"message\"></div>\n <div class=\"ele-upload__message\" v-else>单击或拖动文件到该区域以上传</div>\n <div class=\"ele-upload__ext\" v-if=\"ext\" v-html=\"ext\"></div>\n <div class=\"ele-upload__ext\" v-else>文件小于{{ size }}M</div>\n </div>\n </section>\n </FileUpload>\n <section class=\"ele-files__wrapper\">\n <!-- 显示正在上传的文件(有进度条) -->\n <div class=\"ele-file__item\" v-for=\"(file, idx) in uploadingFiles\" :key=\"`uploading-${idx}`\">\n <div class=\"ele-file__suffix--icon\">\n <ele-icon :type=\"fileSuffixIcon[file.suffix] ? fileSuffixIcon[file.suffix].name : 'icon-file'\"></ele-icon>\n </div>\n <div class=\"ele-file__name\">\n <div class=\"ele-file__inner\">{{ file.name }}</div>\n <div v-if=\"file.progress !== undefined\" class=\"ele-uplpad__progress\">\n <a-progress :strokeWidth=\"2\" :percent=\"Number(file.progress)\" size=\"small\" />\n </div>\n </div>\n <div class=\"ele-file__delete\" v-if=\"file.success || file.error\">\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\n <ele-icon type=\"delete\"></ele-icon>\n </span>\n </div>\n </div>\n \n <!-- 显示已上传完成的文件 -->\n <div class=\"ele-file__item\" v-for=\"(file, idx) in completedFiles\" :key=\"`completed-${idx}`\">\n <div class=\"ele-file__suffix--icon\">\n <ele-icon :type=\"fileSuffixIcon[file.suffix] ? fileSuffixIcon[file.suffix].name : 'icon-file'\"></ele-icon>\n </div>\n <div class=\"ele-file__name\">\n <div class=\"ele-file__inner\" @click=\"handleClickDownload(file)\">{{ file.name }}</div>\n </div>\n <div class=\"ele-file__delete\">\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\n <ele-icon type=\"delete\"></ele-icon>\n </span>\n </div>\n </div>\n </section>\n </div>\n</template>\n\n<script>\nimport FileUpload from 'vue-upload-component'\nimport { v4 as uuidv4 } from 'uuid'\nimport { route, net, type } from '@idooel/shared'\n\n// 常量定义\nconst CONSTANTS = {\n DEFAULT_URL: 'zuul/api-file/workbench/file',\n DEFAULT_ICON: '上传',\n DEFAULT_SIZE: 100,\n DEFAULT_MESSAGE: '单击或拖动文件到该区域以上传',\n DEFAULT_MAXIMUM: 20,\n BYTE_CONVERSION: 1024 * 1024,\n CHUNK_MIN_SIZE: 3 * 1024 * 1024,\n CHUNK_MAX_ACTIVE: 3,\n CHUNK_MAX_RETRIES: 5,\n SAVE_INTERVAL: 2000\n}\n\n// 文件后缀图标映射\nconst FILE_SUFFIX_ICONS = {\n 'doc': { name: 'icon-doc' },\n 'html': { name: 'icon-html' },\n 'mp4': { name: 'icon-mp' },\n 'pdf': { name: 'icon-pdf' },\n 'ppt': { name: 'icon-ppt' },\n 'psd': { name: 'icon-psd' },\n 'rtf': { name: 'icon-rtf' },\n 'txt': { name: 'icon-txt' },\n 'vis': { name: 'icon-vis' },\n 'xls': { name: 'icon-xls' },\n 'xml': { name: 'icon-xml' },\n 'zip': { name: 'icon-zip' },\n 'jpg': { name: 'icon-img' },\n 'mp3': { name: 'icon-mp1' }\n}\n\nexport default {\n name: 'ele-upload',\n components: {\n FileUpload\n },\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n url: {\n type: String,\n default: CONSTANTS.DEFAULT_URL\n },\n icon: {\n type: String,\n default: CONSTANTS.DEFAULT_ICON\n },\n size: {\n type: Number,\n default: CONSTANTS.DEFAULT_SIZE\n },\n message: {\n type: String,\n default: CONSTANTS.DEFAULT_MESSAGE\n },\n ext: {\n type: String\n },\n extensions: {\n type: String\n },\n accept: {\n type: String\n },\n maximum: {\n type: Number,\n default: CONSTANTS.DEFAULT_MAXIMUM\n },\n multiple: {\n type: Boolean,\n default: false\n },\n drop: {\n type: Boolean,\n default: true\n },\n value: {\n type: [String, Array]\n },\n querys: {\n type: Object,\n default: () => ({\n _csrf: localStorage.getItem('token'),\n _t: new Date().valueOf()\n })\n },\n headers: {\n type: Object,\n default: () => ({\n 'X-XSRF-TOKEN': localStorage.getItem('token')\n })\n },\n byteConversion: {\n type: Number,\n default: CONSTANTS.BYTE_CONVERSION\n },\n chunkEnabled: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n // 文件状态管理\n files: [], // vue-upload-component 管理的文件\n buildedFiles: [], // 已构建完成的文件列表\n \n // 上传状态管理\n saveToServerAsyncPageTimer: null,\n uploadRefId: null,\n // 多选且外部无值时,预先生成 groupId,确保首次上传参数完整\n groupId: (this.multiple && !this.value) ? uuidv4() : null\n }\n },\n created() {\n // 多文件模式下,如果没有外部 groupId,则生成一个\n if (this.multiple && !this.value) {\n this.groupId = uuidv4()\n console.log('Created with new groupId:', this.groupId)\n }\n },\n watch: {\n value: {\n async handler(value) {\n if (type.isEmpty(value)) {\n this.resetFiles()\n } else if (this.multiple) {\n this.handleMultipleFileValue(value)\n } else {\n this.handleSingleFileValue()\n }\n },\n immediate: true\n }\n },\n computed: {\n // ==================== 基础配置 ====================\n prefixPath() {\n return window.prefixPath\n },\n \n uploadRef() {\n if (!this.uploadRefId) {\n this.uploadRefId = `uploadRef_${uuidv4()}`\n }\n return this.uploadRefId\n },\n \n iconIsZhWord() {\n return type.isZhWord(this.icon)\n },\n \n // ==================== 上传配置 ====================\n uploadParams() {\n return this.multiple ? { groupID: this.groupId } : {}\n },\n \n fileSizeLimit() {\n return this.size * this.byteConversion\n },\n \n postAction() {\n const queryString = route.toQueryString(this.querys)\n return `${this.prefixPath}${this.url}?${queryString}`\n },\n \n chunkConfig() {\n return {\n action: `${this.prefixPath}zuul/api-file/workbench/file/temp/chunk/vue`,\n headers: { ...this.headers },\n minSize: CONSTANTS.CHUNK_MIN_SIZE,\n maxActive: CONSTANTS.CHUNK_MAX_ACTIVE,\n maxRetries: CONSTANTS.CHUNK_MAX_RETRIES,\n startBody: { override: true, path: '/cw' },\n uploadBody: { override: true, path: '/cw' },\n finishBody: { override: true, path: '/cw' }\n }\n },\n \n getMaximum() {\n return this.multiple ? this.maximum : 1\n },\n \n // ==================== 文件状态 ====================\n uploadingFiles() {\n return this.files.filter(file => file.progress !== undefined && !file.success)\n },\n \n completedFiles() {\n return this.buildedFiles.filter(file => file.fileID)\n },\n \n totalFiles() {\n return this.uploadingFiles.length + this.completedFiles.length\n },\n \n isFileUploadSuccessed() {\n const currentUploadingFiles = this.files.filter(file => file.response !== undefined)\n if (currentUploadingFiles.length === 0) {\n return this.buildedFiles.length > 0\n }\n return currentUploadingFiles.every(file => file.success)\n },\n \n isShowUploadContainer() {\n const maxFiles = this.multiple ? this.maximum : 1\n return this.totalFiles < maxFiles\n },\n \n // ==================== 文件信息 ====================\n fileSuffixIcon() {\n return FILE_SUFFIX_ICONS\n },\n \n fileIds() {\n if (this.multiple) {\n return this.groupId\n } else {\n const fileIds = this.buildedFiles.map(file => file.fileID)\n return fileIds[0]\n }\n },\n \n fileResponseData() {\n return this.multiple ? this.buildedFiles : this.buildedFiles[0]\n }\n },\n methods: {\n // ==================== 文件管理 ====================\n \n /**\n * 从多个数组中移除文件\n */\n removeFromArrays(file, arrays, key = 'fileID') {\n return arrays.map(arr => \n arr.filter(item => item[key] !== file[key] && item.id !== file.id)\n )\n },\n \n /**\n * 检查文件是否为新文件\n */\n isNewFile(newFile, existingFiles, key = 'fileID') {\n return newFile[key] && !existingFiles.some(existing => existing[key] === newFile[key])\n },\n \n /**\n * 合并文件数据\n */\n mergeFileData(uploadFile) {\n return {\n ...uploadFile.response.data,\n ...uploadFile\n }\n },\n \n /**\n * 初始化文件列表\n */\n async initializeFiles() {\n if (!this.value) return\n \n if (this.multiple) {\n await this.fetchFilesWithGroupId()\n } else {\n await this.fetchFileWithFileId()\n }\n },\n \n /**\n * 获取多文件组\n */\n async fetchFilesWithGroupId() {\n try {\n const response = await net.get(`/api-file/workbench/file/group/${this.value}`)\n const data = response.data || []\n \n // 只有在没有现有文件时才设置初始文件列表\n if (this.buildedFiles.length === 0) {\n this.buildedFiles = data\n console.log('Initial files loaded:', this.buildedFiles.length)\n } else {\n console.log('Keep existing files, skip initial load')\n }\n } catch (error) {\n console.log('fetchFilesWithGroupId error:', error)\n console.log('Keep current files, do not clear due to API error')\n }\n },\n \n /**\n * 获取单文件\n */\n async fetchFileWithFileId() {\n try {\n const response = await net.get(`/api-file/file/${this.value}`)\n const data = response.data\n this.buildedFiles = [data]\n this.files = [data]\n } catch (error) {\n console.log('fetchFileWithFileId error:', error)\n }\n },\n \n /**\n * 处理文件删除\n */\n handleClickDelete(file) {\n const { fileID } = file\n console.log('Deleting file:', { name: file.name, fileID })\n \n // 从上传组件中移除文件\n if (this.$refs[this.uploadRef]) {\n this.$refs[this.uploadRef].remove(file)\n }\n \n // 从所有数组中移除文件\n [this.files, this.buildedFiles] = this.removeFromArrays(file, [this.files, this.buildedFiles])\n \n console.log('After deletion - files:', this.files.length, 'buildedFiles:', this.buildedFiles.length)\n \n // 多文件模式下,如果删除最后一个文件,重置 groupId\n if (this.multiple && this.buildedFiles.length === 0) {\n this.groupId = null\n console.log('Reset groupId after deleting last file')\n }\n \n // 触发 change 事件\n this.$emit('change', this.fileIds)\n },\n \n /**\n * 处理文件下载\n */\n handleClickDownload(file) {\n const { fileID: fileId } = file\n window.open(`/api-file/workbench/file/stream/${fileId}?origin=true`)\n },\n // ==================== 上传处理 ====================\n \n /**\n * 处理文件上传状态变化\n */\n onWatchFiles(files) {\n console.log('onWatchFiles called with files:', files.length)\n console.log('Current buildedFiles:', this.buildedFiles.length)\n \n // 更新文件状态\n this.files = files\n \n // 处理已上传成功的文件\n this.processUploadedFiles(files)\n \n // 检查上传是否完成\n if (this.isFileUploadSuccessed) {\n this.$emit('change', this.fileIds)\n this.$emit('on-success', this.fileResponseData)\n }\n },\n \n /**\n * 处理已上传成功的文件\n */\n processUploadedFiles(files) {\n // 处理所有有响应的文件(包括正在上传和已完成的)\n const uploadedFiles = files.filter(file => file.response)\n const newBuildedFiles = uploadedFiles.map(file => this.mergeFileData(file))\n \n if (this.multiple) {\n this.processMultipleFiles(newBuildedFiles)\n } else {\n // 单文件模式:只保留最新的文件\n this.buildedFiles = newBuildedFiles\n }\n \n this.logFileStatus()\n },\n \n /**\n * 处理多文件模式\n */\n processMultipleFiles(newBuildedFiles) {\n // 获取已存在的文件ID集合\n const existingFileIds = new Set(this.buildedFiles.map(f => f.fileID).filter(id => id))\n \n // 过滤出真正的新文件\n const trulyNewFiles = newBuildedFiles.filter(newFile => \n this.isNewFile(newFile, this.buildedFiles)\n )\n \n console.log('Existing fileIDs:', Array.from(existingFileIds))\n console.log('New uploaded files:', newBuildedFiles.map(f => ({ name: f.name, fileID: f.fileID })))\n console.log('Truly new files:', trulyNewFiles.map(f => ({ name: f.name, fileID: f.fileID })))\n \n // 将新文件追加到现有文件列表\n if (trulyNewFiles.length > 0) {\n this.buildedFiles = [...this.buildedFiles, ...trulyNewFiles]\n console.log('Added new files, total buildedFiles:', this.buildedFiles.length)\n }\n \n // 更新现有文件的状态(包括新添加的文件)\n this.updateExistingFiles(newBuildedFiles)\n },\n \n /**\n * 更新现有文件状态\n */\n updateExistingFiles(newBuildedFiles) {\n this.buildedFiles = this.buildedFiles.map(existingFile => {\n const updatedFile = newBuildedFiles.find(newFile => newFile.fileID === existingFile.fileID)\n return updatedFile ? { ...existingFile, ...updatedFile } : existingFile\n })\n },\n \n /**\n * 记录文件状态日志\n */\n logFileStatus() {\n console.log('Final buildedFiles:', this.buildedFiles.length)\n console.log('buildedFiles details:', this.buildedFiles.map(f => ({ name: f.name, fileID: f.fileID, success: f.success })))\n console.log('Uploading files:', this.uploadingFiles.length)\n console.log('Completed files:', this.completedFiles.length)\n },\n // ==================== 异步处理 ====================\n \n /**\n * 异步保存文件到服务器\n */\n async saveToServerAsyncPage(payloads = {}) {\n try {\n const response = await net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, { \n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'\n }\n })\n \n const { data } = response\n if (data !== 'saveToServerAsyncPage') {\n clearInterval(this.saveToServerAsyncPageTimer)\n }\n } catch (error) {\n console.error('saveToServerAsyncPage error:', error)\n clearInterval(this.saveToServerAsyncPageTimer)\n }\n },\n \n // ==================== 文件验证 ====================\n \n /**\n * 验证文件类型\n */\n validateFileType(file) {\n if (!file || !file.name) {\n console.log('文件或文件名不存在')\n return false\n }\n \n const fileExt = this.getFileExtension(file.name)\n console.log('文件扩展名:', fileExt)\n \n if (this.extensions) {\n const allowedExts = this.getAllowedExtensions()\n console.log('允许的扩展名:', allowedExts)\n \n if (!allowedExts.includes(fileExt)) {\n console.log('扩展名不在允许列表中')\n this.$message.error(`不支持的文件类型 \"${fileExt}\",请上传 ${this.extensions} 格式的文件`)\n return false\n }\n }\n \n console.log('文件类型验证通过')\n return true\n },\n \n /**\n * 获取文件扩展名\n */\n getFileExtension(fileName) {\n return fileName.toLowerCase().substring(fileName.lastIndexOf('.'))\n },\n \n /**\n * 获取允许的扩展名列表\n */\n getAllowedExtensions() {\n return this.extensions.toLowerCase()\n .split(',')\n .map(ext => ext.trim().startsWith('.') ? ext.trim() : `.${ext.trim()}`)\n },\n // ==================== 事件处理 ====================\n \n /**\n * 处理文件输入事件\n */\n onWatchInputFiles(newFile, oldFile) {\n if (newFile && !oldFile) {\n this.handleFileAdd(newFile)\n } else if (newFile && oldFile) {\n this.handleFileUpdate(newFile)\n } else if (!newFile && oldFile) {\n this.handleFileDelete()\n }\n \n // 激活上传组件\n this.activateUploadComponent(newFile, oldFile)\n },\n \n /**\n * 处理文件添加\n */\n handleFileAdd(newFile) {\n console.log('add file:', newFile)\n console.log('extensions:', this.extensions)\n console.log('accept:', this.accept)\n \n // 生成或使用 groupId\n this.ensureGroupId()\n \n // 验证文件类型\n if (!this.validateFileType(newFile)) {\n this.removeInvalidFile(newFile)\n return\n }\n \n console.log('文件类型验证通过,继续上传')\n },\n \n /**\n * 处理文件更新\n */\n handleFileUpdate(newFile) {\n console.log('update', newFile)\n const { success, active, chunk, response } = newFile\n \n if (chunk && success && !active) {\n console.log('chunk end')\n this.handleChunkComplete(response)\n }\n },\n \n /**\n * 处理文件删除\n */\n handleFileDelete() {\n console.log('delete')\n },\n \n /**\n * 确保 groupId 存在\n */\n ensureGroupId() {\n console.log('onWatchInputFiles - multiple:', this.multiple, 'current groupId:', this.groupId)\n \n if (this.multiple && !this.groupId) {\n this.groupId = uuidv4()\n console.log('Generated new groupId:', this.groupId)\n } else if (this.multiple && this.groupId) {\n console.log('Using existing groupId:', this.groupId)\n }\n },\n \n /**\n * 移除无效文件\n */\n removeInvalidFile(file) {\n console.log('文件类型验证失败,尝试移除文件')\n console.log('uploadRef:', this.uploadRef)\n console.log('$refs:', this.$refs)\n \n if (this.$refs[this.uploadRef]) {\n this.$refs[this.uploadRef].remove(file)\n } else {\n console.error('无法找到 uploadRef 引用')\n }\n },\n \n /**\n * 处理分片上传完成\n */\n handleChunkComplete(response) {\n const { data: { file, type } } = response\n const payloads = {\n filePath: file.match(/\\/cw(.*)/) ? file.match(/\\/cw(.*)/)[0] : void 0,\n asyncID: uuidv4(),\n isDeleteOrigin: false,\n toImage: type === 'pdf',\n unzip: type === 'zip',\n _csrf: localStorage.getItem('token')\n }\n \n this.saveToServerAsyncPageTimer = setInterval(() => {\n this.saveToServerAsyncPage(payloads)\n }, CONSTANTS.SAVE_INTERVAL)\n },\n \n /**\n * 激活上传组件\n */\n activateUploadComponent(newFile, oldFile) {\n if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {\n if (!this.$refs[this.uploadRef].active) {\n this.$refs[this.uploadRef].active = true\n }\n }\n },\n \n // ==================== 值变化处理 ====================\n \n /**\n * 重置文件状态\n */\n resetFiles() {\n this.files = []\n this.buildedFiles = []\n // 多选模式下保留或生成 groupId,避免首次上传为空\n if (this.multiple) {\n if (!this.groupId) {\n this.groupId = uuidv4()\n console.log('Generated groupId in resetFiles:', this.groupId)\n } else {\n console.log('Preserve existing groupId in resetFiles:', this.groupId)\n }\n } else {\n this.groupId = null\n console.log('Reset groupId to null (single mode)')\n }\n },\n \n /**\n * 处理多文件模式的值变化\n */\n async handleMultipleFileValue(value) {\n // multiple - value 就是 groupId\n // 只有当 groupId 发生变化时才重新获取文件列表(初始化回显)\n if (this.groupId !== value) {\n this.groupId = value\n console.log('Set groupId from external value:', this.groupId)\n await this.fetchFilesWithGroupId()\n } else {\n console.log('GroupId unchanged, skip fetchFilesWithGroupId')\n }\n },\n \n /**\n * 处理单文件模式的值变化\n */\n async handleSingleFileValue() {\n await this.fetchFileWithFileId()\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n::v-deep .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n &:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n }\n border-radius: var(--idooel-form-border-radius);\n}\n.ele-upload__wrapper {\n width: 100%;\n .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n .ele-upload__area--icon {\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n font-size: 16x;\n .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n }\n .anticon {\n font-size: 48px;\n color: var(--idooel-primary-color);\n }\n }\n .ele-upload__area--text {\n margin-left: 16px;\n .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-088);\n text-align: left;\n }\n .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n }\n }\n }\n .ele-files__wrapper {\n .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n .ele-file__suffix--icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n }\n .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n .ele-file__delete {\n margin-left: 8px;\n .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n }\n }\n }\n }\n}\n</style>","::v-deep .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n::v-deep .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n\n.ele-upload__wrapper {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon {\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n font-size: 16x;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-088);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__suffix--icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5806
6592
|
|
|
5807
6593
|
};
|
|
5808
6594
|
/* scoped */
|
|
5809
|
-
const __vue_scope_id__$t = "data-v-
|
|
6595
|
+
const __vue_scope_id__$t = "data-v-48a2255a";
|
|
5810
6596
|
/* module identifier */
|
|
5811
6597
|
const __vue_module_identifier__$t = undefined;
|
|
5812
6598
|
/* functional template */
|
|
@@ -5957,11 +6743,11 @@ __vue_render__$s._withStripped = true;
|
|
|
5957
6743
|
/* style */
|
|
5958
6744
|
const __vue_inject_styles__$s = function (inject) {
|
|
5959
6745
|
if (!inject) return
|
|
5960
|
-
inject("data-v-
|
|
6746
|
+
inject("data-v-6190e15d_0", { source: ".g-select-entity__wrapper[data-v-6190e15d] {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper[data-v-6190e15d]:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input[data-v-6190e15d] {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon[data-v-6190e15d] {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n.has-error .g-select-entity__wrapper[data-v-6190e15d] {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input[data-v-6190e15d] {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/select-entity/src/index.vue","index.vue"],"names":[],"mappings":"AAmFA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,6BAAA;EACA,kBAAA;EACA,uDAAA;AClFA;ADmFA;EACA,yCAAA;ACjFA;ADmFA;EACA,eAAA;EACA,sBAAA;EACA,kBAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;ACjFA;ADmFA;EACA,eAAA;EACA,6BAAA;EACA,wCAAA;EACA,4DAAA;EACA,eAAA;EACA,gBAAA;EACA,mBAAA;ACjFA;ADoFA;EACA,iDAAA;ACjFA;ADmFA;EACA,wCAAA;AChFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-select-entity__wrapper\" :class=\"disabled ? 'g-select-entity__disabled' : ''\">\n <span class=\"select-entity__input\">\n <a-tag\n v-for=\"(item, inx) in getValueList\"\n :key=\"item.value\"\n :closable=\"!disabled && !getIsMaxCount\"\n @close=\"onClose(...arguments, inx, item)\"\n >\n {{ item.label }}\n </a-tag>\n <a-tag v-if=\"getIsMaxCount\">......</a-tag>\n </span>\n <span class=\"select-entity__addon\" @click=\"onChange\">{{ addonAfter }}</span>\n <slot></slot>\n </div>\n</template>\n\n<script>\nimport { type } from '@idooel/shared'\nexport default {\n name: 'ele-select-entity',\n props: {\n value: {\n type: [Array, Object]\n },\n multiple: {\n type: Boolean,\n default: true\n },\n maxCount: {\n type: Number,\n default: 7\n },\n disabled: {\n type: Boolean,\n default: false\n },\n addonAfter: {\n type: String,\n default: '选择'\n }\n },\n computed: {\n getValueList () {\n if (this.value) {\n if (this.multiple) {\n return this.getIsMaxCount ? this.value.slice(0, this.maxCount) : this.value\n }\n return type.isArray(this.value) ? this.value : [this.value]\n }\n return []\n },\n getIsMaxCount () {\n if (this.value && this.multiple) {\n return this.value.length >= this.maxCount\n }\n return false\n }\n },\n methods: {\n onChange () {\n if (this.disabled) return\n this.$emit('change', this.value)\n this.$emit('evoke')\n },\n onClose (e, inx, props) {\n e = window.event || e\n e.preventDefault()\n if (!this.multiple) {\n this.$emit('close', props)\n this.$emit('change', null)\n return\n }\n this.value.splice(inx, 1)\n this.$emit('close', props)\n this.$emit('change', this.value)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-select-entity__wrapper {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n &:hover {\n border-color: var(--idooel-primary-color);\n }\n .select-entity__input {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n }\n .select-entity__addon {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n }\n}\n.has-error .g-select-entity__wrapper {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input {\n background-color: var(--idoole-black-02);\n}\n</style>",".g-select-entity__wrapper {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n\n.has-error .g-select-entity__wrapper {\n border-color: var(--idooel-form-border-err-color);\n}\n\n.g-select-entity__disabled .select-entity__input {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5961
6747
|
|
|
5962
6748
|
};
|
|
5963
6749
|
/* scoped */
|
|
5964
|
-
const __vue_scope_id__$s = "data-v-
|
|
6750
|
+
const __vue_scope_id__$s = "data-v-6190e15d";
|
|
5965
6751
|
/* module identifier */
|
|
5966
6752
|
const __vue_module_identifier__$s = undefined;
|
|
5967
6753
|
/* functional template */
|
|
@@ -6378,11 +7164,11 @@ __vue_render__$p._withStripped = true;
|
|
|
6378
7164
|
/* style */
|
|
6379
7165
|
const __vue_inject_styles__$p = function (inject) {
|
|
6380
7166
|
if (!inject) return
|
|
6381
|
-
inject("data-v-
|
|
7167
|
+
inject("data-v-ad127a48_0", { source: ".ele-modal__footer[data-v-ad127a48] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.ele-modal__footer .footer-btn__wrapper[data-v-ad127a48] {\n flex: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/modal/src/index.vue","index.vue"],"names":[],"mappings":"AA+KA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;EACA,mBAAA;AC9KA;AD+KA;EACA,OAAA;AC7KA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <a-modal\n :title=\"title\"\n :cancelText=\"cancelText\"\n :okText=\"okText\"\n :closable=\"closable\"\n v-model:visible=\"showModal\"\n :width=\"width\"\n :keyboard=\"false\"\n :maskClosable=\"maskClosable\"\n :dialogStyle=\"{ top: `${upDownDistance[size]}px` }\"\n :bodyStyle=\"{ maxHeight: maxheight, overflowY: 'auto' }\"\n :footer=\"showFooter ? undefined : null\"\n @cancel=\"handleCancel\"\n @ok=\"handleOk\"\n >\n <slot v-if=\"showModal\"></slot>\n <template slot=\"footer\" v-if=\"!showDefaultFooter\">\n <div class=\"ele-modal__footer\">\n <slot name=\"footer-text\"></slot>\n <div class=\"footer-btn__wrapper\">\n <ele-button\n v-for=\"btn in buttonGroupMeta.elements\"\n :type=\"btn.type\"\n v-on=\"assignAttrEvents\"\n :event-name=\"btn.eventName\"\n :key=\"btn.key\">\n {{ btn.label }}\n </ele-button>\n </div>\n </div>\n </template>\n </a-modal>\n</template>\n<script>\nimport { CONTEXT } from '../../utils'\nexport default {\n name: 'ele-modal',\n props: {\n value: {\n type: Boolean,\n default: false\n },\n title: {\n type: String,\n default: '标题'\n },\n cancelText: {\n type: String,\n default: '关闭'\n },\n okText: {\n type: String,\n default: '确定'\n },\n size: {\n type: String,\n default: 'middle'\n },\n map: {\n type: Object,\n default () {\n return {}\n }\n },\n closable: {\n type: Boolean,\n default: true\n },\n maskClosable: {\n type: Boolean,\n default: false\n },\n showFooter: {\n type: Boolean,\n default: true\n },\n footer: {\n type: Function,\n default: null\n },\n onlyClose: {\n type: Boolean,\n default: false\n },\n buttonGroupMeta: {\n type: Object,\n default: () => ({})\n },\n // 是否展示组件默认底部按钮\n showDefaultFooter: {\n type: Boolean,\n default: false\n }\n },\n watch: {\n value: {\n handler (value) {\n this.$nextTick(() => {\n this.showModal = value\n })\n },\n immediate: true\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n computed: {\n assignAttrEvents () {\n const events = this.buttons.reduce((ret, btn) => {\n ret[btn.eventName] = (e) => {\n this.$emit(btn.eventName || 'click', { ...e, ...this[CONTEXT]() })\n }\n return ret\n }, {})\n return {\n ...this.$listeners,\n ...events\n }\n },\n buttons () {\n const { elements = [] } = this.buttonGroupMeta\n return elements\n },\n width () {\n return this.map[this.size]\n },\n maxheight () {\n return `calc(100vh - ${this.upDownDistance[this.size] * 2 + (this.title ? 55 : 0) + (this.showFooter ? 53 : 0) }px`\n }\n },\n data () {\n return {\n showModal: false\n }\n },\n created () {\n let defaultMap = {\n small: 480,\n middle: 768,\n big: 1200\n }\n this.upDownDistance = {\n small: 80,\n middle: 80,\n big: 40\n }\n this.map = Object.assign(this.map, defaultMap)\n },\n methods: {\n openModal () {\n this.showModal = true\n this.removeHidden()\n },\n handleCancel () {\n this.showModal = false\n this.$emit('input', this.showModal)\n this.$emit('change', this.showModal)\n this.removeHidden()\n this.$emit('cancel')\n },\n handleOk () {\n this.$emit('ok')\n },\n removeHidden () {\n let ishidden = document.body.style.overflow === 'hidden'\n ishidden && (document.body.style.overflow = 'initial')\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.ele-modal__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n .footer-btn__wrapper {\n flex: 1;\n }\n}\n</style>",".ele-modal__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.ele-modal__footer .footer-btn__wrapper {\n flex: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6382
7168
|
|
|
6383
7169
|
};
|
|
6384
7170
|
/* scoped */
|
|
6385
|
-
const __vue_scope_id__$p = "data-v-
|
|
7171
|
+
const __vue_scope_id__$p = "data-v-ad127a48";
|
|
6386
7172
|
/* module identifier */
|
|
6387
7173
|
const __vue_module_identifier__$p = undefined;
|
|
6388
7174
|
/* functional template */
|
|
@@ -6468,11 +7254,11 @@ __vue_render__$o._withStripped = true;
|
|
|
6468
7254
|
/* style */
|
|
6469
7255
|
const __vue_inject_styles__$o = function (inject) {
|
|
6470
7256
|
if (!inject) return
|
|
6471
|
-
inject("data-v-
|
|
7257
|
+
inject("data-v-3f065c54_0", { source: ".ant-checkbox-group[data-v-3f065c54] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-checkbox-group[data-v-3f065c54] .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group[data-v-3f065c54] .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/checkbox/src/index.vue","index.vue"],"names":[],"mappings":"AAsCA;EACA,gBAAA;EACA,iBAAA;ACrCA;ADyCA;EACA,0CAAA;ACtCA;ADwCA;EACA,iDAAA;ACtCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <a-checkbox-group\n :value=\"value\"\n :options=\"dataSource\" \n :disabled=\"disabled\" \n @change=\"onChange\">\n </a-checkbox-group>\n</template>\n\n<script>\nexport default {\n name: 'ele-checkbox',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: Array\n },\n dataSource: {\n type: Array,\n default: () => []\n },\n disabled: {\n type: Boolean,\n default: false\n }\n },\n methods: {\n onChange (value) {\n this.$emit('change', value)\n this.$emit('input', value)\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.ant-checkbox-group {\n text-align: left;\n line-height: 32px;\n}\n.has-error {\n .ant-checkbox-group {\n ::v-deep .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n }\n ::v-deep .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n }\n }\n}\n</style>",".ant-checkbox-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6472
7258
|
|
|
6473
7259
|
};
|
|
6474
7260
|
/* scoped */
|
|
6475
|
-
const __vue_scope_id__$o = "data-v-
|
|
7261
|
+
const __vue_scope_id__$o = "data-v-3f065c54";
|
|
6476
7262
|
/* module identifier */
|
|
6477
7263
|
const __vue_module_identifier__$o = undefined;
|
|
6478
7264
|
/* functional template */
|
|
@@ -6567,11 +7353,11 @@ __vue_render__$n._withStripped = true;
|
|
|
6567
7353
|
/* style */
|
|
6568
7354
|
const __vue_inject_styles__$n = function (inject) {
|
|
6569
7355
|
if (!inject) return
|
|
6570
|
-
inject("data-v-
|
|
7356
|
+
inject("data-v-220ae5a8_0", { source: ".ant-radio-group[data-v-220ae5a8] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-220ae5a8] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-220ae5a8] .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/radio/src/index.vue","index.vue"],"names":[],"mappings":"AA0CA;EACA,gBAAA;EACA,iBAAA;ACzCA;AD6CA;EACA,0CAAA;AC1CA;AD4CA;EACA,iDAAA;AC1CA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <a-radio-group :value=\"value\" @change=\"onChange\" :disabled=\"disabled\">\n <a-radio v-for=\"item in dataSource\" :key=\"item.value\" :value=\"item.value\">\n {{ item.label }}\n </a-radio>\n </a-radio-group>\n</template>\n\n<script>\nexport default {\n name: 'ele-radio',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: [String, Array, Number]\n },\n dataSource: {\n type: Array,\n default: () => []\n },\n disabled: {\n type: Boolean,\n default: false\n }\n },\n watch: {\n value (val) {\n console.log('valvalval', val)\n }\n },\n methods: {\n onChange (e) {\n this.$emit('change', e.target.value)\n this.$emit('input', e.target.value)\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.ant-radio-group {\n text-align: left;\n line-height: 32px;\n}\n.has-error {\n .ant-radio-group {\n ::v-deep .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n }\n ::v-deep .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n }\n }\n}\n</style>",".ant-radio-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-radio-group ::v-deep .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group ::v-deep .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6571
7357
|
|
|
6572
7358
|
};
|
|
6573
7359
|
/* scoped */
|
|
6574
|
-
const __vue_scope_id__$n = "data-v-
|
|
7360
|
+
const __vue_scope_id__$n = "data-v-220ae5a8";
|
|
6575
7361
|
/* module identifier */
|
|
6576
7362
|
const __vue_module_identifier__$n = undefined;
|
|
6577
7363
|
/* functional template */
|
|
@@ -6731,12 +7517,12 @@ __vue_render__$m._withStripped = true;
|
|
|
6731
7517
|
/* style */
|
|
6732
7518
|
const __vue_inject_styles__$m = function (inject) {
|
|
6733
7519
|
if (!inject) return
|
|
6734
|
-
inject("data-v-
|
|
6735
|
-
,inject("data-v-
|
|
7520
|
+
inject("data-v-7f1302a0_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
7521
|
+
,inject("data-v-7f1302a0_1", { source: ".ele-batch-export__content[data-v-7f1302a0] {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container[data-v-7f1302a0] {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__icon[data-v-7f1302a0] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle[data-v-7f1302a0] {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn[data-v-7f1302a0] {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn--hint[data-v-7f1302a0] {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message[data-v-7f1302a0] {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/batch-export/src/index.vue","index.vue"],"names":[],"mappings":"AAuEA;EACA,aAAA;ACtEA;ADuEA;EACA,iBAAA;EACA,oBAAA;EACA,YAAA;EACA,mCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,eAAA;ACrEA;ADsEA;EACA,eAAA;EACA,4BAAA;ACpEA;ADsEA;EACA,iBAAA;ACpEA;ADqEA;EACA,4BAAA;EACA,eAAA;EACA,eAAA;ACnEA;ADqEA;EACA,4BAAA;EACA,eAAA;ACnEA;ADuEA;EACA,4BAAA;EACA,eAAA;ACrEA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <ele-modal \n v-model=\"innerValue\" \n v-on=\"$listeners\"\n :buttonGroupMeta=\"buttonGroupMeta\" \n title=\"批量导出\">\n <div class=\"ele-batch-export__content\">\n <div class=\"ele-batch-export__container\">\n <ele-icon class=\"ele-batch-export__icon\" type=\"download\"></ele-icon>\n <div class=\"ele-batch-export__handle\">\n <div class=\"ele-batch-export__btn\" @click=\"handleClick\">导出任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>\n <div class=\"ele-batch-export__btn--hint\">批处理任务的准备工作会在后台运行</div>\n </div>\n </div>\n <div class=\"ele-batch-export__message\">\n 您可以请点击上方按钮查看任务进度或关闭弹框\n </div>\n </div>\n </ele-modal>\n</template>\n\n<script>\nexport default {\n name: 'ele-batch-export',\n props: {\n value: {\n type: Boolean,\n default: false\n },\n buttonGroupMeta: {\n type: Object,\n default: () => {\n return {\n elements: [\n {\n label: '关闭',\n key: 'close',\n type: 'primary',\n eventName: 'handleClose'\n }\n ]\n }\n }\n }\n },\n data() {\n return {\n innerValue: false\n }\n },\n watch: {\n value: {\n handler (value) {\n this.$nextTick(() => {\n this.innerValue = value\n })\n },\n immediate: true\n }\n },\n methods: {\n handleClick () {\n this.$emit('on-batch-export')\n }\n }\n}\n</script>\n<style lang=\"scss\">\n@import '../../theme/index';\n</style>\n<style lang=\"scss\" scoped>\n.ele-batch-export__content {\n height: 106px;\n .ele-batch-export__container {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n .ele-batch-export__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n }\n .ele-batch-export__handle {\n margin-left: 16px;\n .ele-batch-export__btn {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n }\n .ele-batch-export__btn--hint {\n color: var(--idooel-link-03);\n font-size: 14px;\n }\n }\n }\n .ele-batch-export__message {\n color: var(--idooel-link-06);\n font-size: 14px;\n }\n}\n</style>",".ele-batch-export__content {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn--hint {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6736
7522
|
|
|
6737
7523
|
};
|
|
6738
7524
|
/* scoped */
|
|
6739
|
-
const __vue_scope_id__$m = "data-v-
|
|
7525
|
+
const __vue_scope_id__$m = "data-v-7f1302a0";
|
|
6740
7526
|
/* module identifier */
|
|
6741
7527
|
const __vue_module_identifier__$m = undefined;
|
|
6742
7528
|
/* functional template */
|
|
@@ -6829,11 +7615,11 @@ __vue_render__$l._withStripped = true;
|
|
|
6829
7615
|
/* style */
|
|
6830
7616
|
const __vue_inject_styles__$l = function (inject) {
|
|
6831
7617
|
if (!inject) return
|
|
6832
|
-
inject("data-v-
|
|
7618
|
+
inject("data-v-aa0ec508_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
6833
7619
|
|
|
6834
7620
|
};
|
|
6835
7621
|
/* scoped */
|
|
6836
|
-
const __vue_scope_id__$l = "data-v-
|
|
7622
|
+
const __vue_scope_id__$l = "data-v-aa0ec508";
|
|
6837
7623
|
/* module identifier */
|
|
6838
7624
|
const __vue_module_identifier__$l = undefined;
|
|
6839
7625
|
/* functional template */
|
|
@@ -7050,12 +7836,12 @@ __vue_render__$k._withStripped = true;
|
|
|
7050
7836
|
/* style */
|
|
7051
7837
|
const __vue_inject_styles__$k = function (inject) {
|
|
7052
7838
|
if (!inject) return
|
|
7053
|
-
inject("data-v-
|
|
7054
|
-
,inject("data-v-bfb18322_1", { source: ".ele-timeline__wrapper[data-v-bfb18322] {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item[data-v-bfb18322] {\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item:last-child .ele-timeline__middle .ele-timeline__traline[data-v-bfb18322] {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left[data-v-bfb18322] {\n flex: 1;\n padding-right: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n text-align: right;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left .titleline-left__date[data-v-bfb18322] {\n width: 100px;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle[data-v-bfb18322] {\n width: 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translate(0, 20px);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__circle[data-v-bfb18322] {\n width: 100%;\n height: 10px;\n border-radius: 50%;\n border-width: 2px;\n border-style: solid;\n border-color: var(--idooel-primary-color);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__traline[data-v-bfb18322] {\n width: 1px;\n height: calc(100% - 10px);\n border-width: 1px;\n border-style: solid;\n border-color: var(--idoole-black-016);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right[data-v-bfb18322] {\n text-align: left;\n flex: 2;\n padding-left: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title[data-v-bfb18322] {\n line-height: 22px;\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title[data-v-bfb18322] {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info[data-v-bfb18322] {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info[data-v-bfb18322]::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.success[data-v-bfb18322]::before {\n background: var(--idoole-success-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.warning[data-v-bfb18322]::before {\n background: var(--idoole-warning-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.error[data-v-bfb18322]::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper[data-v-bfb18322] {\n line-height: 22px;\n margin-top: 8px;\n margin-left: 12px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper .oper-name[data-v-bfb18322] {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle[data-v-bfb18322] {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n line-height: 22px;\n margin-top: 4px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__field[data-v-bfb18322] {\n flex-shrink: 0;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__content[data-v-bfb18322] {\n font-size: 14px;\n color: var(--idoole-black-088);\n font-weight: bold;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/timeline/src/index.vue","index.vue"],"names":[],"mappings":"AAiIA;EACA,WAAA;EACA,YAAA;AChIA;ADiIA;EACA,aAAA;EACA,mBAAA;AC/HA;ADkIA;EACA,aAAA;AChIA;ADoIA;EACA,OAAA;EACA,mBAAA;EACA,iBAAA;EACA,oBAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;AClIA;ADmIA;EACA,YAAA;EACA,eAAA;EACA,8BAAA;ACjIA;ADoIA;EACA,WAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,6BAAA;AClIA;ADmIA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,iBAAA;EACA,mBAAA;EACA,yCAAA;ACjIA;ADmIA;EACA,UAAA;EACA,yBAAA;EACA,iBAAA;EACA,mBAAA;EACA,qCAAA;ACjIA;ADoIA;EACA,gBAAA;EACA,OAAA;EACA,kBAAA;EACA,iBAAA;EACA,oBAAA;AClIA;ADmIA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;ACjIA;ADkIA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;AChIA;ADkIA;EACA,eAAA;EACA,8BAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AChIA;ADiIA;EACA,WAAA;EACA,qBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,iBAAA;AC/HA;ADkIA;EACA,oCAAA;AChIA;ADoIA;EACA,oCAAA;AClIA;ADsIA;EACA,kCAAA;ACpIA;ADyIA;EACA,iBAAA;EACA,eAAA;EACA,iBAAA;ACvIA;ADwIA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;ACtIA;ADyIA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ACvIA;ADwIA;EACA,cAAA;EACA,eAAA;EACA,8BAAA;ACtIA;ADwIA;EACA,eAAA;EACA,8BAAA;EACA,iBAAA;EACA,gBAAA;ACtIA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-timeline__wrapper\">\n <div class=\"ele-timeline__item\" v-for=\"item in innerDataSource\" :key=\"item.key\">\n <div class=\"ele-timeline__left\">\n <div class=\"titleline-left__date\">{{ item.date }}</div>\n </div>\n <div class=\"ele-timeline__middle\">\n <div class=\"ele-timeline__circle\"></div>\n <div class=\"ele-timeline__traline\"></div>\n </div>\n <div class=\"ele-timeline__right\">\n <slot v-if=\"$scopedSlots.right\" name=\"right\" :data=\"item\"></slot>\n <template v-else>\n <div class=\"timeline-right__title\">\n <span class=\"title\">{{ item.title }}</span>\n <span :class=\"['title-info', item.state == 1 && 'success', item.state == 2 && 'warning', item.state == 3 && 'error']\">{{ item.stateName }}</span>\n </div>\n <div class=\"timeline-right__oper\">\n 由\n <span class=\"oper-name\">{{ item.userName }}</span>\n 操作\n </div>\n <div class=\"timeline-right__subtitle\" v-for=\"label in item.labelList\" :key=\"label.value\">\n <div class=\"right-subtitle__field\">{{ label.label }}:</div>\n <div class=\"right-subtitle__content\">{{ label.value }}</div>\n </div>\n </template>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { net, type } from '@idooel/shared'\nimport { v4 as uuidv4 } from 'uuid'\nimport { CONTEXT, parseFieldMap } from '../../utils'\nexport default {\n name: 'ele-timeline',\n props: {\n url: {\n type: String\n },\n params: {\n type: Object,\n default: () => ({})\n },\n requestType: {\n type: String,\n default: 'GET'\n },\n fieldMap: {\n type: Object,\n default: () => ({})\n },\n params: {\n type: Object,\n default: () => ({})\n },\n dataSource: {\n type: Array,\n default: () => ([\n // {\n // date: '2023/05/09 03:34:56',\n // title: 123,\n // state: 1,\n // stateName: '成功',\n // userName: 'Name',\n // labelList: [\n // {\n // label: 'label',\n // value: 'value'\n // }\n // ],\n // action: '结班',\n // opinion: '意见'\n // }\n ])\n }\n },\n data () {\n return {\n innerDataSource: []\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n computed: {\n expressionData () {\n return {\n _route: this.$route.query,\n ...this[CONTEXT]()\n }\n }\n },\n async created() {\n if (this.url) {\n this.innerDataSource = await this.requestData()\n } else if (!type.isEmpty(this.dataSource)) {\n this.innerDataSource = this.dataSource\n } else {\n console.warn('ele-timeline: 请传入数据源')\n }\n },\n methods: {\n async requestData () {\n const ret = await net[this.requestType.toLowerCase()](\n this.url,\n { ...this.params, ...parseFieldMap(this.fieldMap, this.expressionData) }\n ).then(resp => {\n const { data } = resp || {}\n return data.map(item => {\n return {\n key: uuidv4(),\n ...item\n }\n })\n })\n return ret\n }\n }\n}\n</script>\n<style lang=\"scss\">\n@import '../../theme/index';\n</style>\n<style lang=\"scss\" scoped>\n.ele-timeline__wrapper {\n width: 100%;\n height: 100%;\n .ele-timeline__item {\n display: flex;\n flex-direction: row;\n &:last-child {\n .ele-timeline__middle {\n .ele-timeline__traline {\n display: none;\n }\n }\n }\n .ele-timeline__left {\n flex: 1;\n padding-right: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n text-align: right;\n display: flex;\n flex-direction: row;\n justify-content: end;\n .titleline-left__date {\n width: 100px;\n font-size: 14px;\n color: var(--idoole-black-064);\n }\n }\n .ele-timeline__middle {\n width: 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translate(0, 20px);\n .ele-timeline__circle {\n width: 100%;\n height: 10px;\n border-radius: 50%;\n border-width: 2px;\n border-style: solid;\n border-color: var(--idooel-primary-color);\n }\n .ele-timeline__traline {\n width: 1px;\n height: calc(100% - 10px);\n border-width: 1px;\n border-style: solid;\n border-color: var(--idoole-black-016);\n }\n }\n .ele-timeline__right {\n text-align: left;\n flex: 2;\n padding-left: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n .timeline-right__title {\n line-height: 22px;\n display: flex;\n flex-direction: row;\n .title {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n }\n .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n &::before {\n content: '';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n }\n &.success {\n &::before {\n background: var(--idoole-success-06);\n }\n }\n &.warning {\n &::before {\n background: var(--idoole-warning-06);\n }\n }\n &.error {\n &::before {\n background: var(--idoole-error-06);\n }\n }\n }\n }\n .timeline-right__oper {\n line-height: 22px;\n margin-top: 8px;\n margin-left: 12px;\n .oper-name {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n }\n }\n .timeline-right__subtitle {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n line-height: 22px;\n margin-top: 4px;\n .right-subtitle__field {\n flex-shrink: 0;\n font-size: 14px;\n color: var(--idoole-black-064);\n }\n .right-subtitle__content {\n font-size: 14px;\n color: var(--idoole-black-088);\n font-weight: bold;\n margin-left: 4px;\n }\n }\n }\n }\n}\n</style>",".ele-timeline__wrapper {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item {\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item:last-child .ele-timeline__middle .ele-timeline__traline {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left {\n flex: 1;\n padding-right: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n text-align: right;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left .titleline-left__date {\n width: 100px;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle {\n width: 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translate(0, 20px);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__circle {\n width: 100%;\n height: 10px;\n border-radius: 50%;\n border-width: 2px;\n border-style: solid;\n border-color: var(--idooel-primary-color);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__traline {\n width: 1px;\n height: calc(100% - 10px);\n border-width: 1px;\n border-style: solid;\n border-color: var(--idoole-black-016);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right {\n text-align: left;\n flex: 2;\n padding-left: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title {\n line-height: 22px;\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.success::before {\n background: var(--idoole-success-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.warning::before {\n background: var(--idoole-warning-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.error::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper {\n line-height: 22px;\n margin-top: 8px;\n margin-left: 12px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper .oper-name {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n line-height: 22px;\n margin-top: 4px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__field {\n flex-shrink: 0;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__content {\n font-size: 14px;\n color: var(--idoole-black-088);\n font-weight: bold;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7839
|
+
inject("data-v-47de7b09_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
7840
|
+
,inject("data-v-47de7b09_1", { source: ".ele-timeline__wrapper[data-v-47de7b09] {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item[data-v-47de7b09] {\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item:last-child .ele-timeline__middle .ele-timeline__traline[data-v-47de7b09] {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left[data-v-47de7b09] {\n flex: 1;\n padding-right: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n text-align: right;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left .titleline-left__date[data-v-47de7b09] {\n width: 100px;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle[data-v-47de7b09] {\n width: 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translate(0, 20px);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__circle[data-v-47de7b09] {\n width: 100%;\n height: 10px;\n border-radius: 50%;\n border-width: 2px;\n border-style: solid;\n border-color: var(--idooel-primary-color);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__traline[data-v-47de7b09] {\n width: 1px;\n height: calc(100% - 10px);\n border-width: 1px;\n border-style: solid;\n border-color: var(--idoole-black-016);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right[data-v-47de7b09] {\n text-align: left;\n flex: 2;\n padding-left: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title[data-v-47de7b09] {\n line-height: 22px;\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title[data-v-47de7b09] {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info[data-v-47de7b09] {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info[data-v-47de7b09]::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.success[data-v-47de7b09]::before {\n background: var(--idoole-success-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.warning[data-v-47de7b09]::before {\n background: var(--idoole-warning-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.error[data-v-47de7b09]::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper[data-v-47de7b09] {\n line-height: 22px;\n margin-top: 8px;\n margin-left: 12px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper .oper-name[data-v-47de7b09] {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle[data-v-47de7b09] {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n line-height: 22px;\n margin-top: 4px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__field[data-v-47de7b09] {\n flex-shrink: 0;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__content[data-v-47de7b09] {\n font-size: 14px;\n color: var(--idoole-black-088);\n font-weight: bold;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/timeline/src/index.vue","index.vue"],"names":[],"mappings":"AAiIA;EACA,WAAA;EACA,YAAA;AChIA;ADiIA;EACA,aAAA;EACA,mBAAA;AC/HA;ADkIA;EACA,aAAA;AChIA;ADoIA;EACA,OAAA;EACA,mBAAA;EACA,iBAAA;EACA,oBAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;AClIA;ADmIA;EACA,YAAA;EACA,eAAA;EACA,8BAAA;ACjIA;ADoIA;EACA,WAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,6BAAA;AClIA;ADmIA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,iBAAA;EACA,mBAAA;EACA,yCAAA;ACjIA;ADmIA;EACA,UAAA;EACA,yBAAA;EACA,iBAAA;EACA,mBAAA;EACA,qCAAA;ACjIA;ADoIA;EACA,gBAAA;EACA,OAAA;EACA,kBAAA;EACA,iBAAA;EACA,oBAAA;AClIA;ADmIA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;ACjIA;ADkIA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;AChIA;ADkIA;EACA,eAAA;EACA,8BAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AChIA;ADiIA;EACA,WAAA;EACA,qBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,iBAAA;AC/HA;ADkIA;EACA,oCAAA;AChIA;ADoIA;EACA,oCAAA;AClIA;ADsIA;EACA,kCAAA;ACpIA;ADyIA;EACA,iBAAA;EACA,eAAA;EACA,iBAAA;ACvIA;ADwIA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;ACtIA;ADyIA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ACvIA;ADwIA;EACA,cAAA;EACA,eAAA;EACA,8BAAA;ACtIA;ADwIA;EACA,eAAA;EACA,8BAAA;EACA,iBAAA;EACA,gBAAA;ACtIA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-timeline__wrapper\">\n <div class=\"ele-timeline__item\" v-for=\"item in innerDataSource\" :key=\"item.key\">\n <div class=\"ele-timeline__left\">\n <div class=\"titleline-left__date\">{{ item.date }}</div>\n </div>\n <div class=\"ele-timeline__middle\">\n <div class=\"ele-timeline__circle\"></div>\n <div class=\"ele-timeline__traline\"></div>\n </div>\n <div class=\"ele-timeline__right\">\n <slot v-if=\"$scopedSlots.right\" name=\"right\" :data=\"item\"></slot>\n <template v-else>\n <div class=\"timeline-right__title\">\n <span class=\"title\">{{ item.title }}</span>\n <span :class=\"['title-info', item.state == 1 && 'success', item.state == 2 && 'warning', item.state == 3 && 'error']\">{{ item.stateName }}</span>\n </div>\n <div class=\"timeline-right__oper\">\n 由\n <span class=\"oper-name\">{{ item.userName }}</span>\n 操作\n </div>\n <div class=\"timeline-right__subtitle\" v-for=\"label in item.labelList\" :key=\"label.value\">\n <div class=\"right-subtitle__field\">{{ label.label }}:</div>\n <div class=\"right-subtitle__content\">{{ label.value }}</div>\n </div>\n </template>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { net, type } from '@idooel/shared'\nimport { v4 as uuidv4 } from 'uuid'\nimport { CONTEXT, parseFieldMap } from '../../utils'\nexport default {\n name: 'ele-timeline',\n props: {\n url: {\n type: String\n },\n params: {\n type: Object,\n default: () => ({})\n },\n requestType: {\n type: String,\n default: 'GET'\n },\n fieldMap: {\n type: Object,\n default: () => ({})\n },\n params: {\n type: Object,\n default: () => ({})\n },\n dataSource: {\n type: Array,\n default: () => ([\n // {\n // date: '2023/05/09 03:34:56',\n // title: 123,\n // state: 1,\n // stateName: '成功',\n // userName: 'Name',\n // labelList: [\n // {\n // label: 'label',\n // value: 'value'\n // }\n // ],\n // action: '结班',\n // opinion: '意见'\n // }\n ])\n }\n },\n data () {\n return {\n innerDataSource: []\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n computed: {\n expressionData () {\n return {\n _route: this.$route.query,\n ...this[CONTEXT]()\n }\n }\n },\n async created() {\n if (this.url) {\n this.innerDataSource = await this.requestData()\n } else if (!type.isEmpty(this.dataSource)) {\n this.innerDataSource = this.dataSource\n } else {\n console.warn('ele-timeline: 请传入数据源')\n }\n },\n methods: {\n async requestData () {\n const ret = await net[this.requestType.toLowerCase()](\n this.url,\n { ...this.params, ...parseFieldMap(this.fieldMap, this.expressionData) }\n ).then(resp => {\n const { data } = resp || {}\n return data.map(item => {\n return {\n key: uuidv4(),\n ...item\n }\n })\n })\n return ret\n }\n }\n}\n</script>\n<style lang=\"scss\">\n@import '../../theme/index';\n</style>\n<style lang=\"scss\" scoped>\n.ele-timeline__wrapper {\n width: 100%;\n height: 100%;\n .ele-timeline__item {\n display: flex;\n flex-direction: row;\n &:last-child {\n .ele-timeline__middle {\n .ele-timeline__traline {\n display: none;\n }\n }\n }\n .ele-timeline__left {\n flex: 1;\n padding-right: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n text-align: right;\n display: flex;\n flex-direction: row;\n justify-content: end;\n .titleline-left__date {\n width: 100px;\n font-size: 14px;\n color: var(--idoole-black-064);\n }\n }\n .ele-timeline__middle {\n width: 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translate(0, 20px);\n .ele-timeline__circle {\n width: 100%;\n height: 10px;\n border-radius: 50%;\n border-width: 2px;\n border-style: solid;\n border-color: var(--idooel-primary-color);\n }\n .ele-timeline__traline {\n width: 1px;\n height: calc(100% - 10px);\n border-width: 1px;\n border-style: solid;\n border-color: var(--idoole-black-016);\n }\n }\n .ele-timeline__right {\n text-align: left;\n flex: 2;\n padding-left: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n .timeline-right__title {\n line-height: 22px;\n display: flex;\n flex-direction: row;\n .title {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n }\n .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n &::before {\n content: '';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n }\n &.success {\n &::before {\n background: var(--idoole-success-06);\n }\n }\n &.warning {\n &::before {\n background: var(--idoole-warning-06);\n }\n }\n &.error {\n &::before {\n background: var(--idoole-error-06);\n }\n }\n }\n }\n .timeline-right__oper {\n line-height: 22px;\n margin-top: 8px;\n margin-left: 12px;\n .oper-name {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n }\n }\n .timeline-right__subtitle {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n line-height: 22px;\n margin-top: 4px;\n .right-subtitle__field {\n flex-shrink: 0;\n font-size: 14px;\n color: var(--idoole-black-064);\n }\n .right-subtitle__content {\n font-size: 14px;\n color: var(--idoole-black-088);\n font-weight: bold;\n margin-left: 4px;\n }\n }\n }\n }\n}\n</style>",".ele-timeline__wrapper {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item {\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item:last-child .ele-timeline__middle .ele-timeline__traline {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left {\n flex: 1;\n padding-right: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n text-align: right;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left .titleline-left__date {\n width: 100px;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle {\n width: 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translate(0, 20px);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__circle {\n width: 100%;\n height: 10px;\n border-radius: 50%;\n border-width: 2px;\n border-style: solid;\n border-color: var(--idooel-primary-color);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__middle .ele-timeline__traline {\n width: 1px;\n height: calc(100% - 10px);\n border-width: 1px;\n border-style: solid;\n border-color: var(--idoole-black-016);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right {\n text-align: left;\n flex: 2;\n padding-left: 12px;\n padding-top: 16px;\n padding-bottom: 16px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title {\n line-height: 22px;\n display: flex;\n flex-direction: row;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.success::before {\n background: var(--idoole-success-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.warning::before {\n background: var(--idoole-warning-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__title .title-info.error::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper {\n line-height: 22px;\n margin-top: 8px;\n margin-left: 12px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper .oper-name {\n color: var(--idoole-black-088);\n font-size: 14px;\n font-weight: bold;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n line-height: 22px;\n margin-top: 4px;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__field {\n flex-shrink: 0;\n font-size: 14px;\n color: var(--idoole-black-064);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__subtitle .right-subtitle__content {\n font-size: 14px;\n color: var(--idoole-black-088);\n font-weight: bold;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7055
7841
|
|
|
7056
7842
|
};
|
|
7057
7843
|
/* scoped */
|
|
7058
|
-
const __vue_scope_id__$k = "data-v-
|
|
7844
|
+
const __vue_scope_id__$k = "data-v-47de7b09";
|
|
7059
7845
|
/* module identifier */
|
|
7060
7846
|
const __vue_module_identifier__$k = undefined;
|
|
7061
7847
|
/* functional template */
|
|
@@ -7133,11 +7919,11 @@ __vue_render__$j._withStripped = true;
|
|
|
7133
7919
|
/* style */
|
|
7134
7920
|
const __vue_inject_styles__$j = function (inject) {
|
|
7135
7921
|
if (!inject) return
|
|
7136
|
-
inject("data-v-
|
|
7922
|
+
inject("data-v-91c24dc6_0", { source: ".ele-text__wrapper[data-v-91c24dc6] {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-text__wrapper.default .anticon[data-v-91c24dc6], .ele-text__wrapper.default .message[data-v-91c24dc6] {\n color: var(--idoole-black-064);\n}\n.ele-text__wrapper .anticon[data-v-91c24dc6] {\n font-size: 16px;\n}\n.ele-text__wrapper .message[data-v-91c24dc6] {\n font-size: 14px;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/text/src/index.vue","index.vue"],"names":[],"mappings":"AA8BA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC7BA;AD+BA;EACA,8BAAA;AC7BA;ADgCA;EACA,eAAA;AC9BA;ADgCA;EACA,eAAA;EACA,gBAAA;AC9BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div :class=\"['ele-text__wrapper', type]\">\n <ele-icon theme=\"filled\" :type=\"icon\"></ele-icon>\n <span class=\"message\">{{ message }}</span>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-text',\n props: {\n type: {\n String,\n // default success error warning info\n default: 'default'\n },\n message: {\n type: String\n }\n },\n computed: {\n icon() {\n return 'info-circle'\n }\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n//\n.ele-text__wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n &.default {\n .anticon, .message {\n color: var(--idoole-black-064);\n }\n }\n .anticon {\n font-size: 16px;\n }\n .message {\n font-size: 14px;\n margin-left: 4px;\n }\n}\n</style>",".ele-text__wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-text__wrapper.default .anticon, .ele-text__wrapper.default .message {\n color: var(--idoole-black-064);\n}\n.ele-text__wrapper .anticon {\n font-size: 16px;\n}\n.ele-text__wrapper .message {\n font-size: 14px;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7137
7923
|
|
|
7138
7924
|
};
|
|
7139
7925
|
/* scoped */
|
|
7140
|
-
const __vue_scope_id__$j = "data-v-
|
|
7926
|
+
const __vue_scope_id__$j = "data-v-91c24dc6";
|
|
7141
7927
|
/* module identifier */
|
|
7142
7928
|
const __vue_module_identifier__$j = undefined;
|
|
7143
7929
|
/* functional template */
|
|
@@ -7274,11 +8060,11 @@ __vue_render__$i._withStripped = true;
|
|
|
7274
8060
|
/* style */
|
|
7275
8061
|
const __vue_inject_styles__$i = function (inject) {
|
|
7276
8062
|
if (!inject) return
|
|
7277
|
-
inject("data-v-
|
|
8063
|
+
inject("data-v-38220614_0", { source: "[data-v-38220614] .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/tabs/src/index.vue","index.vue"],"names":[],"mappings":"AAoDA;EACA,sBAAA;ACnDA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div>\n <a-tabs :default-active-key=\"activeKey\" :tabBarGutter=\"tabBarGutter\" :tabBarStyle=\"tabBarStyle\" @change=\"changeHandle\">\n <a-tab-pane v-for=\"(item, index) in tabsList\" :key=\"index\" :tab=\"item.tabName\" :disabled=\"item.disabled\">\n <template #tab>\n <component v-if=\"item.renderHeader\" :is=\"item.renderHeader\" ></component>\n <span v-else>{{ item.tabName }}</span>\n </template>\n <component :is=\"item.content\"></component>\n </a-tab-pane>\n </a-tabs>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-tabs',\n components: {},\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n activeKey: {\n type: Number,\n default: 0\n },\n tabsList: {\n type: Array,\n default () {\n return []\n }\n },\n tabBarStyle: {\n type: Object,\n default () {\n return {}\n }\n },\n tabBarGutter: {\n type: Number\n }\n },\n methods: {\n changeHandle (key) {\n this.$emit('changeActiveKey', key)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n::v-deep .ant-tabs-nav-scroll {\n float: left !important;\n}\n</style>","::v-deep .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7278
8064
|
|
|
7279
8065
|
};
|
|
7280
8066
|
/* scoped */
|
|
7281
|
-
const __vue_scope_id__$i = "data-v-
|
|
8067
|
+
const __vue_scope_id__$i = "data-v-38220614";
|
|
7282
8068
|
/* module identifier */
|
|
7283
8069
|
const __vue_module_identifier__$i = undefined;
|
|
7284
8070
|
/* functional template */
|
|
@@ -11299,11 +12085,11 @@ __vue_render__$h._withStripped = true;
|
|
|
11299
12085
|
/* style */
|
|
11300
12086
|
const __vue_inject_styles__$h = function (inject) {
|
|
11301
12087
|
if (!inject) return
|
|
11302
|
-
inject("data-v-600a1f56_0", { source: "[data-v-600a1f56] .ant-modal-body {\n padding: 16px;\n}\n[data-v-600a1f56] .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper[data-v-600a1f56] {\n display: flex;\n gap: 16px;\n justify-content: center;\n margin-bottom: 30px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg[data-v-600a1f56] {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .img-crop-left__image[data-v-600a1f56] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-600a1f56] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-600a1f56] .ele-upload__inner {\n height: 100%;\n border: unset;\n background: transparent !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-600a1f56] .ele-upload__inner .ele-upload__area {\n display: flex;\n flex-direction: column;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-600a1f56] .ele-upload__inner .ele-upload__area .ele-upload__area--text {\n margin-top: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font1[data-v-600a1f56] {\n color: var(--idoole-black-088);\n font-size: 16px;\n line-height: 24px !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font2[data-v-600a1f56] {\n color: var(--idoole-black-06);\n font-size: 14px;\n line-height: 22px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__update[data-v-600a1f56] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right[data-v-600a1f56] {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span[data-v-600a1f56] {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right .img-crop-right__image[data-v-600a1f56] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item[data-v-600a1f56] {\n width: 480px;\n height: 300px;\n border-radius: 2px;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color);\n}\n.ele-imgCrop__tips[data-v-600a1f56] {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error[data-v-600a1f56] {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2[data-v-600a1f56] {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon[data-v-600a1f56] {\n font-size: 48px;\n color: var(--idooel-link-06);\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/modal-img-crop/src/index.vue","index.vue"],"names":[],"mappings":"AAoMA;EACA,aAAA;ACnMA;ADqMA;EACA,aAAA;AClMA;ADoMA;EACA,aAAA;EACA,SAAA;EACA,uBAAA;EACA,mBAAA;ACjMA;ADmMA;EACA,aAAA;EACA,sBAAA;EACA,uBAAA;EACA,mBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;ACjMA;ADkMA;EACA,WAAA;EACA,YAAA;AChMA;ADkMA;EACA,WAAA;EACA,YAAA;AChMA;ADiMA;EACA,YAAA;EACA,aAAA;EACA,kCAAA;AC/LA;ADgMA;EACA,aAAA;EACA,sBAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;AC9LA;AD+LA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;AC7LA;ADkMA;EACA,8BAAA;EACA,eAAA;EACA,4BAAA;AChMA;ADkMA;EACA,6BAAA;EACA,eAAA;EACA,iBAAA;AChMA;ADmMA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,eAAA;ACjMA;ADoMA;EACA,kBAAA;AClMA;ADmMA;EACA,kBAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;ACjMA;ADmMA;EACA,WAAA;EACA,YAAA;ACjMA;ADoMA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,wDAAA;EACA,8CAAA;AClMA;ADqMA;EACA,WAAA;EACA,UAAA;AClMA;ADoMA;EACA,qDAAA;ACjMA;ADmMA;EACA,kDAAA;AChMA;ADkMA;EACA,eAAA;EACA,4BAAA;AC/LA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div>\n <ele-modal\n :ref=\"getEleModal\"\n :title=\"title\"\n :cancelText=\"cancelText\"\n :maskClosable=\"maskClosable\"\n v-on=\"$listeners\"\n :size=\"size\"\n :value=\"value\"\n @ok=\"handleOk\"\n @cancel=\"handleCancel\"\n :showDefaultFooter=\"true\"\n >\n <div class=\"ele-imgCrop__wrapper\">\n <div class=\"ele-imgCrop__left ele-imgCrop__item\">\n <div class=\"ele-imgCrop__noImg\">\n <ele-upload v-if=\"!fileId\" v-bind=\"uploadFileConfig\" class=\"ele-img-crop__upload\" @on-success=\"onUploadFileSuccess\" icon=\"inbox\" url=\"api/zuul/api-file/workbench/file\"></ele-upload>\n <template v-else>\n <img :ref=\"leftImage\" class=\"img-crop-left__image\" :src=\"imageUrl\" alt=\"\">\n </template>\n </div>\n <div class=\"margin-t-8\">\n <span v-if=\"imgtips\" class=\"ele-imgCrop__font1 ele-imgCrop__tips\" :class=\"isFail? 'ele-imgCrop__error' : ''\">{{ imgtips }}</span>\n <template v-else>\n <span class=\"ele-imgCrop__font1\">{{ fileName }}</span>\n <a-icon v-if=\"fileId || fileName\" @click=\"handleClickDeleteFile\" type=\"close\" style=\"cursor: pointer;float: right; line-height: 24px;\"/>\n </template>\n </div>\n </div>\n <div class=\"ele-imgCrop__right ele-imgCrop__item\">\n <span v-if=\"!fileId\" class=\"ele-imgCrop__font2\">左侧上传图片后可预览</span>\n <template v-else>\n <img class=\"img-crop-right__image\" :src=\"previewBase\" alt=\"\">\n </template>\n </div>\n </div>\n </ele-modal>\n </div>\n</template>\n\n<script>\nimport { v4 as uuidv4 } from 'uuid'\nimport Cropper from 'cropperjs'\nimport { util, net } from '@idooel/shared'\nexport default {\n name: 'ele-modal-img-crop',\n model: {\n event: 'input',\n prop: 'value'\n },\n props: {\n title: {\n type: String,\n default: '图像裁剪'\n },\n uploadFileConfig: {\n type: Object,\n default: () => {\n return {\n size: 10,\n accept: '*',\n byteConversion: 1024 * 1024\n }\n }\n },\n imageId: {\n type: String\n },\n maskClosable: {\n type: Boolean,\n default () {\n return false\n }\n },\n size: {\n type: String,\n default () {\n return 'big'\n }\n },\n value: {\n type: Boolean,\n default () {\n return false\n }\n },\n cropperConfig: {\n type: Object,\n default: () => {\n return {\n aspectRatio: 16 / 9\n }\n }\n }\n },\n data () {\n return {\n haveImg: false,\n imgtips: null,\n isFail: false,\n cancelText: '取消',\n fileName: null,\n fileId: null,\n previewBase: null,\n cropper: null\n }\n },\n computed: {\n leftImage () {\n return uuidv4()\n },\n imageUrl () {\n return `/api-file/workbench/file/stream/${this.fileId}?origin=true`\n },\n getEleModal () {\n return uuidv4()\n }\n },\n watch: {\n value: {\n handler (value) {\n this.fileId = this.imageId\n if (value && this.fileId) {\n setTimeout(() => {\n this.initCropper()\n })\n }\n },\n immediate: true\n }\n },\n methods: {\n handleCancel () {\n this.$emit('input', false)\n this.$emit('change', this.fileId)\n },\n handleClickDeleteFile () {\n this.fileId = null\n this.fileName = null\n this.cropper && this.cropper.destroy()\n },\n blobToFile(blob, fileName = 'file.png') {\n return new File([blob], fileName, {\n type: blob.type,\n lastModified: Date.now()\n })\n },\n handleOk () {\n this.cropper && this.cropper.getCroppedCanvas().toBlob(async (blob) => {\n await this.uploadFile(this.blobToFile(blob, this.fileName))\n this.$emit('input', false)\n this.$emit('change', this.fileId)\n })\n },\n async uploadFile (file) {\n const formData = new FormData()\n formData.append('serviceCode', 'cover-image')\n formData.append('_t', Math.random())\n formData.append('file', file)\n await net.post(\n 'zuul/api-file/workbench/file' + '?_csrf=' + localStorage.getItem('token'),\n formData\n ).then((resp) => {\n const { data: { fileID } } = resp\n this.fileId = fileID\n })\n },\n initCropper () {\n let previewReady = false\n this.cropper = new Cropper(this.$refs[this.leftImage], {\n aspectRatio: this.cropperConfig.aspectRatio,\n ready: () => {\n previewReady = true\n },\n crop: util.debounce(() => {\n if (!previewReady) {\n return\n }\n this.previewBase = this.cropper.getCroppedCanvas().toDataURL()\n }, 200)\n })\n },\n onUploadFileSuccess (props) {\n const { response: { data: { fileID } }, name } = props\n this.fileId = fileID\n this.fileName = name\n this.$nextTick(() => {\n this.initCropper()\n })\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n::v-deep .ant-modal-body {\n padding: 16px;\n}\n::v-deep .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper {\n display: flex;\n gap: 16px;\n justify-content: center;\n margin-bottom: 30px;\n .ele-imgCrop__left {\n .ele-imgCrop__noImg {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n .img-crop-left__image {\n width: 100%;\n height: 100%;\n }\n .ele-img-crop__upload {\n width: 100%;\n height: 100%;\n ::v-deep .ele-upload__inner {\n height: 100%;\n border: unset;\n background: transparent !important;\n .ele-upload__area {\n display: flex;\n flex-direction: column;\n height: 100%;\n align-items: center;\n justify-content: center;\n .ele-upload__area--text {\n margin-top: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n }\n }\n .ele-imgCrop__font1 {\n color: var(--idoole-black-088);\n font-size: 16px;\n line-height: 24px !important;\n }\n .ele-imgCrop__font2 {\n color: var(--idoole-black-06);\n font-size: 14px;\n line-height: 22px; \n }\n }\n .ele-imgCrop__update {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n }\n }\n .ele-imgCrop__right {\n position: relative;\n span {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n .img-crop-right__image {\n width: 100%;\n height: 100%;\n }\n }\n .ele-imgCrop__item {\n width: 480px;\n height: 300px;\n border-radius: 2px;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color);\n }\n}\n.ele-imgCrop__tips {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2 {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n</style>","::v-deep .ant-modal-body {\n padding: 16px;\n}\n\n::v-deep .ant-modal-header {\n padding: 16px;\n}\n\n.ele-imgCrop__wrapper {\n display: flex;\n gap: 16px;\n justify-content: center;\n margin-bottom: 30px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .img-crop-left__image {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload ::v-deep .ele-upload__inner {\n height: 100%;\n border: unset;\n background: transparent !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload ::v-deep .ele-upload__inner .ele-upload__area {\n display: flex;\n flex-direction: column;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload ::v-deep .ele-upload__inner .ele-upload__area .ele-upload__area--text {\n margin-top: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font1 {\n color: var(--idoole-black-088);\n font-size: 16px;\n line-height: 24px !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font2 {\n color: var(--idoole-black-06);\n font-size: 14px;\n line-height: 22px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__update {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right .img-crop-right__image {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item {\n width: 480px;\n height: 300px;\n border-radius: 2px;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color);\n}\n\n.ele-imgCrop__tips {\n float: left;\n width: 80%;\n}\n\n.ele-imgCrop__error {\n color: var(--idooel-form-border-err-color) !important;\n}\n\n.ele-imgCrop__error2 {\n color: var(--idooel-img-crop-err-color) !important;\n}\n\n.ele-imgCrop__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12088
|
+
inject("data-v-2de930fc_0", { source: "[data-v-2de930fc] .ant-modal-body {\n padding: 16px;\n}\n[data-v-2de930fc] .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper[data-v-2de930fc] {\n display: flex;\n gap: 16px;\n justify-content: center;\n margin-bottom: 30px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg[data-v-2de930fc] {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .img-crop-left__image[data-v-2de930fc] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-2de930fc] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-2de930fc] .ele-upload__inner {\n height: 100%;\n border: unset;\n background: transparent !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-2de930fc] .ele-upload__inner .ele-upload__area {\n display: flex;\n flex-direction: column;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-2de930fc] .ele-upload__inner .ele-upload__area .ele-upload__area--text {\n margin-top: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font1[data-v-2de930fc] {\n color: var(--idoole-black-088);\n font-size: 16px;\n line-height: 24px !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font2[data-v-2de930fc] {\n color: var(--idoole-black-06);\n font-size: 14px;\n line-height: 22px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__update[data-v-2de930fc] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right[data-v-2de930fc] {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span[data-v-2de930fc] {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right .img-crop-right__image[data-v-2de930fc] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item[data-v-2de930fc] {\n width: 480px;\n height: 300px;\n border-radius: 2px;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color);\n}\n.ele-imgCrop__tips[data-v-2de930fc] {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error[data-v-2de930fc] {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2[data-v-2de930fc] {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon[data-v-2de930fc] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/composite-components/modal-img-crop/src/index.vue","index.vue"],"names":[],"mappings":"AAoMA;EACA,aAAA;ACnMA;ADqMA;EACA,aAAA;AClMA;ADoMA;EACA,aAAA;EACA,SAAA;EACA,uBAAA;EACA,mBAAA;ACjMA;ADmMA;EACA,aAAA;EACA,sBAAA;EACA,uBAAA;EACA,mBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;ACjMA;ADkMA;EACA,WAAA;EACA,YAAA;AChMA;ADkMA;EACA,WAAA;EACA,YAAA;AChMA;ADiMA;EACA,YAAA;EACA,aAAA;EACA,kCAAA;AC/LA;ADgMA;EACA,aAAA;EACA,sBAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;AC9LA;AD+LA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;AC7LA;ADkMA;EACA,8BAAA;EACA,eAAA;EACA,4BAAA;AChMA;ADkMA;EACA,6BAAA;EACA,eAAA;EACA,iBAAA;AChMA;ADmMA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,eAAA;ACjMA;ADoMA;EACA,kBAAA;AClMA;ADmMA;EACA,kBAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;ACjMA;ADmMA;EACA,WAAA;EACA,YAAA;ACjMA;ADoMA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,wDAAA;EACA,8CAAA;AClMA;ADqMA;EACA,WAAA;EACA,UAAA;AClMA;ADoMA;EACA,qDAAA;ACjMA;ADmMA;EACA,kDAAA;AChMA;ADkMA;EACA,eAAA;EACA,4BAAA;AC/LA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div>\n <ele-modal\n :ref=\"getEleModal\"\n :title=\"title\"\n :cancelText=\"cancelText\"\n :maskClosable=\"maskClosable\"\n v-on=\"$listeners\"\n :size=\"size\"\n :value=\"value\"\n @ok=\"handleOk\"\n @cancel=\"handleCancel\"\n :showDefaultFooter=\"true\"\n >\n <div class=\"ele-imgCrop__wrapper\">\n <div class=\"ele-imgCrop__left ele-imgCrop__item\">\n <div class=\"ele-imgCrop__noImg\">\n <ele-upload v-if=\"!fileId\" v-bind=\"uploadFileConfig\" class=\"ele-img-crop__upload\" @on-success=\"onUploadFileSuccess\" icon=\"inbox\" url=\"api/zuul/api-file/workbench/file\"></ele-upload>\n <template v-else>\n <img :ref=\"leftImage\" class=\"img-crop-left__image\" :src=\"imageUrl\" alt=\"\">\n </template>\n </div>\n <div class=\"margin-t-8\">\n <span v-if=\"imgtips\" class=\"ele-imgCrop__font1 ele-imgCrop__tips\" :class=\"isFail? 'ele-imgCrop__error' : ''\">{{ imgtips }}</span>\n <template v-else>\n <span class=\"ele-imgCrop__font1\">{{ fileName }}</span>\n <a-icon v-if=\"fileId || fileName\" @click=\"handleClickDeleteFile\" type=\"close\" style=\"cursor: pointer;float: right; line-height: 24px;\"/>\n </template>\n </div>\n </div>\n <div class=\"ele-imgCrop__right ele-imgCrop__item\">\n <span v-if=\"!fileId\" class=\"ele-imgCrop__font2\">左侧上传图片后可预览</span>\n <template v-else>\n <img class=\"img-crop-right__image\" :src=\"previewBase\" alt=\"\">\n </template>\n </div>\n </div>\n </ele-modal>\n </div>\n</template>\n\n<script>\nimport { v4 as uuidv4 } from 'uuid'\nimport Cropper from 'cropperjs'\nimport { util, net } from '@idooel/shared'\nexport default {\n name: 'ele-modal-img-crop',\n model: {\n event: 'input',\n prop: 'value'\n },\n props: {\n title: {\n type: String,\n default: '图像裁剪'\n },\n uploadFileConfig: {\n type: Object,\n default: () => {\n return {\n size: 10,\n accept: '*',\n byteConversion: 1024 * 1024\n }\n }\n },\n imageId: {\n type: String\n },\n maskClosable: {\n type: Boolean,\n default () {\n return false\n }\n },\n size: {\n type: String,\n default () {\n return 'big'\n }\n },\n value: {\n type: Boolean,\n default () {\n return false\n }\n },\n cropperConfig: {\n type: Object,\n default: () => {\n return {\n aspectRatio: 16 / 9\n }\n }\n }\n },\n data () {\n return {\n haveImg: false,\n imgtips: null,\n isFail: false,\n cancelText: '取消',\n fileName: null,\n fileId: null,\n previewBase: null,\n cropper: null\n }\n },\n computed: {\n leftImage () {\n return uuidv4()\n },\n imageUrl () {\n return `/api-file/workbench/file/stream/${this.fileId}?origin=true`\n },\n getEleModal () {\n return uuidv4()\n }\n },\n watch: {\n value: {\n handler (value) {\n this.fileId = this.imageId\n if (value && this.fileId) {\n setTimeout(() => {\n this.initCropper()\n })\n }\n },\n immediate: true\n }\n },\n methods: {\n handleCancel () {\n this.$emit('input', false)\n this.$emit('change', this.fileId)\n },\n handleClickDeleteFile () {\n this.fileId = null\n this.fileName = null\n this.cropper && this.cropper.destroy()\n },\n blobToFile(blob, fileName = 'file.png') {\n return new File([blob], fileName, {\n type: blob.type,\n lastModified: Date.now()\n })\n },\n handleOk () {\n this.cropper && this.cropper.getCroppedCanvas().toBlob(async (blob) => {\n await this.uploadFile(this.blobToFile(blob, this.fileName))\n this.$emit('input', false)\n this.$emit('change', this.fileId)\n })\n },\n async uploadFile (file) {\n const formData = new FormData()\n formData.append('serviceCode', 'cover-image')\n formData.append('_t', Math.random())\n formData.append('file', file)\n await net.post(\n 'zuul/api-file/workbench/file' + '?_csrf=' + localStorage.getItem('token'),\n formData\n ).then((resp) => {\n const { data: { fileID } } = resp\n this.fileId = fileID\n })\n },\n initCropper () {\n let previewReady = false\n this.cropper = new Cropper(this.$refs[this.leftImage], {\n aspectRatio: this.cropperConfig.aspectRatio,\n ready: () => {\n previewReady = true\n },\n crop: util.debounce(() => {\n if (!previewReady) {\n return\n }\n this.previewBase = this.cropper.getCroppedCanvas().toDataURL()\n }, 200)\n })\n },\n onUploadFileSuccess (props) {\n const { response: { data: { fileID } }, name } = props\n this.fileId = fileID\n this.fileName = name\n this.$nextTick(() => {\n this.initCropper()\n })\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n::v-deep .ant-modal-body {\n padding: 16px;\n}\n::v-deep .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper {\n display: flex;\n gap: 16px;\n justify-content: center;\n margin-bottom: 30px;\n .ele-imgCrop__left {\n .ele-imgCrop__noImg {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n .img-crop-left__image {\n width: 100%;\n height: 100%;\n }\n .ele-img-crop__upload {\n width: 100%;\n height: 100%;\n ::v-deep .ele-upload__inner {\n height: 100%;\n border: unset;\n background: transparent !important;\n .ele-upload__area {\n display: flex;\n flex-direction: column;\n height: 100%;\n align-items: center;\n justify-content: center;\n .ele-upload__area--text {\n margin-top: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n }\n }\n .ele-imgCrop__font1 {\n color: var(--idoole-black-088);\n font-size: 16px;\n line-height: 24px !important;\n }\n .ele-imgCrop__font2 {\n color: var(--idoole-black-06);\n font-size: 14px;\n line-height: 22px; \n }\n }\n .ele-imgCrop__update {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n }\n }\n .ele-imgCrop__right {\n position: relative;\n span {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n .img-crop-right__image {\n width: 100%;\n height: 100%;\n }\n }\n .ele-imgCrop__item {\n width: 480px;\n height: 300px;\n border-radius: 2px;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color);\n }\n}\n.ele-imgCrop__tips {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2 {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n</style>","::v-deep .ant-modal-body {\n padding: 16px;\n}\n\n::v-deep .ant-modal-header {\n padding: 16px;\n}\n\n.ele-imgCrop__wrapper {\n display: flex;\n gap: 16px;\n justify-content: center;\n margin-bottom: 30px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .img-crop-left__image {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload ::v-deep .ele-upload__inner {\n height: 100%;\n border: unset;\n background: transparent !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload ::v-deep .ele-upload__inner .ele-upload__area {\n display: flex;\n flex-direction: column;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload ::v-deep .ele-upload__inner .ele-upload__area .ele-upload__area--text {\n margin-top: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font1 {\n color: var(--idoole-black-088);\n font-size: 16px;\n line-height: 24px !important;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-imgCrop__font2 {\n color: var(--idoole-black-06);\n font-size: 14px;\n line-height: 22px;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__update {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right .img-crop-right__image {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item {\n width: 480px;\n height: 300px;\n border-radius: 2px;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color);\n}\n\n.ele-imgCrop__tips {\n float: left;\n width: 80%;\n}\n\n.ele-imgCrop__error {\n color: var(--idooel-form-border-err-color) !important;\n}\n\n.ele-imgCrop__error2 {\n color: var(--idooel-img-crop-err-color) !important;\n}\n\n.ele-imgCrop__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
11303
12089
|
|
|
11304
12090
|
};
|
|
11305
12091
|
/* scoped */
|
|
11306
|
-
const __vue_scope_id__$h = "data-v-
|
|
12092
|
+
const __vue_scope_id__$h = "data-v-2de930fc";
|
|
11307
12093
|
/* module identifier */
|
|
11308
12094
|
const __vue_module_identifier__$h = undefined;
|
|
11309
12095
|
/* functional template */
|
|
@@ -11408,11 +12194,11 @@ __vue_render__$g._withStripped = true;
|
|
|
11408
12194
|
/* style */
|
|
11409
12195
|
const __vue_inject_styles__$g = function (inject) {
|
|
11410
12196
|
if (!inject) return
|
|
11411
|
-
inject("data-v-
|
|
12197
|
+
inject("data-v-745cb3c6_0", { source: ".ele-editor__bottom[data-v-745cb3c6] {\n height: 40px;\n padding: 8px 20px 8px 8px;\n border: 1px solid var(--idooel-form-title-border-color);\n border-top: 0px;\n}\n.ele-editor__bottom span[data-v-745cb3c6] {\n color: var(--idoole-black-088);\n text-align: right;\n font-size: 12px;\n line-height: 20px;\n width: 100%;\n display: inline-block;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/text-editor/src/index.vue","index.vue"],"names":[],"mappings":"AA0DA;EACA,YAAA;EACA,yBAAA;EACA,uDAAA;EACA,eAAA;ACzDA;AD0DA;EACA,8BAAA;EACA,iBAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;EACA,qBAAA;ACxDA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele-editor__wrapper\" :style=\"{width: editorWidth, height: editorHeight}\">\n <Vueditor :ref=\"getVueditor\" :style=\"{width: editorWidth, height: editorHeight}\"></Vueditor>\n <div class=\"ele-editor__bottom\">\n <span>{{ innerContent.length }}字</span>\n </div>\n </div>\n</template>\n\n<script>\nimport { v4 as uuidv4 } from 'uuid'\nexport default {\n name: 'ele-text-editor',\n props: {\n editorWidth: {\n type: String\n },\n editorHeight: {\n type: String\n },\n maxLength: {\n type: Number,\n default () {\n return 10\n }\n }\n },\n data() {\n return {\n editorConfig: {},\n textEditorRef: null\n }\n },\n computed: {\n innerContent () {\n let content = this.textEditorRef ? this.textEditorRef.getContent() : ''\n if (this.textEditorRef && content.length > this.maxLength) {\n content = content.substring(0, this.maxLength)\n this.$nextTick(() => {\n this.textEditorRef.setContent(content)\n })\n }\n this.$emit('input', content)\n return content\n },\n getVueditor () {\n return uuidv4()\n }\n },\n watch: {},\n methods: {},\n mounted () {\n this.textEditorRef = this.$refs[this.getVueditor]\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele-editor__bottom {\n height: 40px;\n padding: 8px 20px 8px 8px;\n border: 1px solid var(--idooel-form-title-border-color);\n border-top: 0px;\n span {\n color: var(--idoole-black-088);\n text-align: right;\n font-size: 12px;\n line-height: 20px;\n width: 100%;\n display: inline-block;\n }\n}\n</style>",".ele-editor__bottom {\n height: 40px;\n padding: 8px 20px 8px 8px;\n border: 1px solid var(--idooel-form-title-border-color);\n border-top: 0px;\n}\n.ele-editor__bottom span {\n color: var(--idoole-black-088);\n text-align: right;\n font-size: 12px;\n line-height: 20px;\n width: 100%;\n display: inline-block;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
11412
12198
|
|
|
11413
12199
|
};
|
|
11414
12200
|
/* scoped */
|
|
11415
|
-
const __vue_scope_id__$g = "data-v-
|
|
12201
|
+
const __vue_scope_id__$g = "data-v-745cb3c6";
|
|
11416
12202
|
/* module identifier */
|
|
11417
12203
|
const __vue_module_identifier__$g = undefined;
|
|
11418
12204
|
/* functional template */
|
|
@@ -11518,11 +12304,11 @@ __vue_render__$f._withStripped = true;
|
|
|
11518
12304
|
/* style */
|
|
11519
12305
|
const __vue_inject_styles__$f = function (inject) {
|
|
11520
12306
|
if (!inject) return
|
|
11521
|
-
inject("data-v-
|
|
12307
|
+
inject("data-v-ee02b67e_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
11522
12308
|
|
|
11523
12309
|
};
|
|
11524
12310
|
/* scoped */
|
|
11525
|
-
const __vue_scope_id__$f = "data-v-
|
|
12311
|
+
const __vue_scope_id__$f = "data-v-ee02b67e";
|
|
11526
12312
|
/* module identifier */
|
|
11527
12313
|
const __vue_module_identifier__$f = undefined;
|
|
11528
12314
|
/* functional template */
|
|
@@ -11581,11 +12367,11 @@ __vue_render__$e._withStripped = true;
|
|
|
11581
12367
|
/* style */
|
|
11582
12368
|
const __vue_inject_styles__$e = function (inject) {
|
|
11583
12369
|
if (!inject) return
|
|
11584
|
-
inject("data-v-
|
|
12370
|
+
inject("data-v-4ebdc869_0", { source: ".g-loading[data-v-4ebdc869] {\n width: 16px;\n height: 16px;\n border: 1px solid #409EFF;\n border-top-color: transparent;\n border-left-color: transparent;\n border-radius: 100%;\n animation: rotate-data-v-4ebdc869 infinite 0.75s linear;\n}\n@keyframes rotate-data-v-4ebdc869 {\n0% {\n transform: rotate(0);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/loading/src/index.vue","index.vue"],"names":[],"mappings":"AAmBA;EACA,WAAA;EACA,YAAA;EACA,yBAAA;EACA,6BAAA;EACA,8BAAA;EACA,mBAAA;EACA,uDAAA;AClBA;ADoBA;AACA;IACA,oBAAA;ACjBE;ADmBF;IACA,yBAAA;ACjBE;AACF;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div v-if=\"loading\" class=\"g-loading\">\n\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-loading',\n props: {\n loading: {\n type: Boolean,\n default: true\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-loading {\n width: 16px;\n height: 16px;\n border: 1px solid #409EFF;\n border-top-color: transparent;\n border-left-color: transparent;\n border-radius: 100%;\n animation: rotate infinite 0.75s linear;\n}\n@keyframes rotate {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n</style>",".g-loading {\n width: 16px;\n height: 16px;\n border: 1px solid #409EFF;\n border-top-color: transparent;\n border-left-color: transparent;\n border-radius: 100%;\n animation: rotate infinite 0.75s linear;\n}\n\n@keyframes rotate {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
11585
12371
|
|
|
11586
12372
|
};
|
|
11587
12373
|
/* scoped */
|
|
11588
|
-
const __vue_scope_id__$e = "data-v-
|
|
12374
|
+
const __vue_scope_id__$e = "data-v-4ebdc869";
|
|
11589
12375
|
/* module identifier */
|
|
11590
12376
|
const __vue_module_identifier__$e = undefined;
|
|
11591
12377
|
/* functional template */
|
|
@@ -11780,11 +12566,11 @@ __vue_render__$d._withStripped = true;
|
|
|
11780
12566
|
/* style */
|
|
11781
12567
|
const __vue_inject_styles__$d = function (inject) {
|
|
11782
12568
|
if (!inject) return
|
|
11783
|
-
inject("data-v-
|
|
12569
|
+
inject("data-v-57f6ed82_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
11784
12570
|
|
|
11785
12571
|
};
|
|
11786
12572
|
/* scoped */
|
|
11787
|
-
const __vue_scope_id__$d = "data-v-
|
|
12573
|
+
const __vue_scope_id__$d = "data-v-57f6ed82";
|
|
11788
12574
|
/* module identifier */
|
|
11789
12575
|
const __vue_module_identifier__$d = undefined;
|
|
11790
12576
|
/* functional template */
|
|
@@ -11846,11 +12632,11 @@ __vue_render__$c._withStripped = true;
|
|
|
11846
12632
|
/* style */
|
|
11847
12633
|
const __vue_inject_styles__$c = function (inject) {
|
|
11848
12634
|
if (!inject) return
|
|
11849
|
-
inject("data-v-
|
|
12635
|
+
inject("data-v-5329a54e_0", { source: ".g-search__label[data-v-5329a54e] {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title[data-v-5329a54e], .g-search__label .label__suffix[data-v-5329a54e] {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix[data-v-5329a54e] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/composite-components/search-area/src/label.vue","label.vue"],"names":[],"mappings":"AAkBA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACjBA;ADkBA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;AChBA;ADkBA;EACA,gBAAA;AChBA;;AAEA,oCAAoC","file":"label.vue","sourcesContent":["<template>\n <div class=\"g-search__label\">\n <span class=\"label__title\">{{ label }}</span>\n <span class=\"label__suffix\">:</span>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n label: {\n type: String\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n .label__title, .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n }\n .label__suffix {\n margin-left: 4px;\n }\n}\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
|
|
11850
12636
|
|
|
11851
12637
|
};
|
|
11852
12638
|
/* scoped */
|
|
11853
|
-
const __vue_scope_id__$c = "data-v-
|
|
12639
|
+
const __vue_scope_id__$c = "data-v-5329a54e";
|
|
11854
12640
|
/* module identifier */
|
|
11855
12641
|
const __vue_module_identifier__$c = undefined;
|
|
11856
12642
|
/* functional template */
|
|
@@ -12232,11 +13018,11 @@ __vue_render__$b._withStripped = true;
|
|
|
12232
13018
|
/* style */
|
|
12233
13019
|
const __vue_inject_styles__$b = function (inject) {
|
|
12234
13020
|
if (!inject) return
|
|
12235
|
-
inject("data-v-c447c0e0_0", { source: ".search-area__wrapper[data-v-c447c0e0] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-c447c0e0] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-c447c0e0] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action[data-v-c447c0e0] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-c447c0e0] {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text[data-v-c447c0e0] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-c447c0e0] {\n font-size: 16px;\n margin-left: 8px;\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/search-area/src/index.vue","index.vue"],"names":[],"mappings":"AAwMA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACvMA;ADyMA;EACA,YAAA;ACvMA;AD0MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACxMA;ADyMA;EACA,oBAAA;ACvMA;ADyMA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACvMA;ADwMA;EACA,eAAA;ACtMA;ADwMA;EACA,eAAA;EACA,gBAAA;ACtMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"search-area__wrapper\">\n <a-row :gutter=\"gutter\">\n <template v-for=\"(item, idx) in innerDataSource\">\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\n <div v-if=\"innerDataSource.length > cuttingFormula + 1\" class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\n <span class=\"expand-collapse__icon\">\n <a-icon v-if=\"isExpand\" type=\"up\" />\n <a-icon v-else type=\"down\" />\n </span>\n </div>\n </div>\n <div v-else class=\"search-area__item\">\n <template v-if=\"(item.type == 'ele-input') || (item.type == 'Input')\">\n <Label :label=\"item.label\"></Label>\n <ele-input v-model=\"item._value\"></ele-input>\n </template>\n <template v-else-if=\"(item.type == 'ele-select') || (item.type == 'Select')\">\n <Label :label=\"item.label\"></Label>\n <ele-select v-model=\"item._value\" :multiple=\"item.multiple\" :data-source=\"item.optionList\"></ele-select>\n </template>\n <template v-else-if=\"(item.type == 'ele-date') || (item.type == 'DatePicker')\">\n <Label :label=\"item.label\"></Label>\n <ele-date v-model=\"item._value\" :placeholder=\"item.placeholder\" :format=\"item.format\"></ele-date>\n </template>\n <template v-else-if=\"item.type == 'ele-date-range'\">\n <Label :label=\"item.label\"></Label>\n <ele-date-range v-model=\"item._value\" :format=\"item.format\" :show-time=\"item.showTime\"></ele-date-range>\n </template>\n </div>\n </a-col>\n </template>\n </a-row>\n </div>\n</template>\n\n<script>\nimport Label from './label.vue'\nimport moment from 'moment'\nimport { parse } from '@idooel/expression'\nimport { type } from '@idooel/shared'\nexport default {\n name: 'ele-search-area',\n components: {\n Label\n },\n props: {\n gutter: {\n type: [Number, Array, Object],\n default: () => ([\n 16, 8\n ])\n },\n span: {\n type: Number,\n default: 8\n },\n dataSource: {\n type: Array,\n required: true\n }\n },\n data() {\n return {\n isExpand: false\n }\n },\n computed: {\n cuttingFormula () {\n return (24 / this.span - 1)\n },\n buildDataSource () {\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\n },\n innerDataSource () {\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\n }\n },\n created() {\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n methods: {\n controlDisplayByFormula (dataSource = []) {\n if (this.isExpand) {\n dataSource.forEach(item => {\n this.$set(item, '_show', true)\n })\n } else {\n dataSource.forEach((item, idx) => {\n if (idx < this.cuttingFormula) {\n this.$set(item, '_show', true)\n } else {\n this.$set(item, '_show', false)\n }\n })\n }\n return dataSource\n },\n buildDefaultValue (arg) {\n if (type.notStr(arg)) return arg\n if (!arg || arg.charAt(0) !== '_') return arg\n return parse(arg, {\n _route: this.$route.query\n })\n },\n mapDefaultValueToValue () {\n this.dataSource.forEach(props => {\n this.$set(props, '_show', this.isExpand)\n if (props.defaultValue) {\n if (type.isFunction(props.defaultValue)) {\n const ret = props.defaultValue.call(this)\n this.$set(props, '_value', this.buildDefaultValue(ret))\n } else {\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\n }\n }\n })\n return this.dataSource\n },\n handleClickExpandCollapse () {\n this.isExpand = !this.isExpand\n },\n handleClickSearch () {\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n buildMapto (mapTo = [], dataSource) {\n const [ startField, endField ] = mapTo\n const [ startValue, endValue ] = dataSource || [null, null]\n return {\n [startField]: startValue,\n [endField]: endValue\n }\n },\n extractValues () {\n let ret = {}\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\n switch (item.type) {\n case 'DatePicker':\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\n break\n case 'ele-date-range':\n if (item.mapTo) {\n Object.assign(ret, this.buildMapto(item.mapTo, item._value))\n } else {\n ret[item.name] = (item._value || []).join(',')\n }\n break\n default:\n ret[item.name] = item._value\n break\n }\n })\n return ret\n },\n cleanValues () {\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\n const { defaultValue } = item\n switch (item.type) {\n case 'Select':\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', null)\n break\n case 'DatePicker':\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', undefined)\n break\n case 'ele-date-range':\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', [])\n break\n default:\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', null)\n break\n }\n })\n },\n handleClickReset () {\n this.cleanValues()\n //TODO defaultValue\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n onChangeSelect (value, props) {\n this.$set(props, '_value', value)\n }\n },\n destroyed () {\n this.cleanValues()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n ::v-deep .ant-col {\n &:last-child {\n float: right;\n }\n }\n .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n &.search-area--action {\n justify-content: end;\n }\n .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n .expand-collapse__text {\n font-size: 14px;\n }\n .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n }\n }\n }\n}\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
13021
|
+
inject("data-v-292ddb2a_0", { source: ".search-area__wrapper[data-v-292ddb2a] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-292ddb2a] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-292ddb2a] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action[data-v-292ddb2a] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-292ddb2a] {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text[data-v-292ddb2a] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-292ddb2a] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/composite-components/search-area/src/index.vue","index.vue"],"names":[],"mappings":"AAwMA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACvMA;ADyMA;EACA,YAAA;ACvMA;AD0MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACxMA;ADyMA;EACA,oBAAA;ACvMA;ADyMA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACvMA;ADwMA;EACA,eAAA;ACtMA;ADwMA;EACA,eAAA;EACA,gBAAA;ACtMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"search-area__wrapper\">\n <a-row :gutter=\"gutter\">\n <template v-for=\"(item, idx) in innerDataSource\">\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\n <div v-if=\"innerDataSource.length > cuttingFormula + 1\" class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\n <span class=\"expand-collapse__icon\">\n <a-icon v-if=\"isExpand\" type=\"up\" />\n <a-icon v-else type=\"down\" />\n </span>\n </div>\n </div>\n <div v-else class=\"search-area__item\">\n <template v-if=\"(item.type == 'ele-input') || (item.type == 'Input')\">\n <Label :label=\"item.label\"></Label>\n <ele-input v-model=\"item._value\"></ele-input>\n </template>\n <template v-else-if=\"(item.type == 'ele-select') || (item.type == 'Select')\">\n <Label :label=\"item.label\"></Label>\n <ele-select v-model=\"item._value\" :multiple=\"item.multiple\" :data-source=\"item.optionList\"></ele-select>\n </template>\n <template v-else-if=\"(item.type == 'ele-date') || (item.type == 'DatePicker')\">\n <Label :label=\"item.label\"></Label>\n <ele-date v-model=\"item._value\" :placeholder=\"item.placeholder\" :format=\"item.format\"></ele-date>\n </template>\n <template v-else-if=\"item.type == 'ele-date-range'\">\n <Label :label=\"item.label\"></Label>\n <ele-date-range v-model=\"item._value\" :format=\"item.format\" :show-time=\"item.showTime\"></ele-date-range>\n </template>\n </div>\n </a-col>\n </template>\n </a-row>\n </div>\n</template>\n\n<script>\nimport Label from './label.vue'\nimport moment from 'moment'\nimport { parse } from '@idooel/expression'\nimport { type } from '@idooel/shared'\nexport default {\n name: 'ele-search-area',\n components: {\n Label\n },\n props: {\n gutter: {\n type: [Number, Array, Object],\n default: () => ([\n 16, 8\n ])\n },\n span: {\n type: Number,\n default: 8\n },\n dataSource: {\n type: Array,\n required: true\n }\n },\n data() {\n return {\n isExpand: false\n }\n },\n computed: {\n cuttingFormula () {\n return (24 / this.span - 1)\n },\n buildDataSource () {\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\n },\n innerDataSource () {\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\n }\n },\n created() {\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n methods: {\n controlDisplayByFormula (dataSource = []) {\n if (this.isExpand) {\n dataSource.forEach(item => {\n this.$set(item, '_show', true)\n })\n } else {\n dataSource.forEach((item, idx) => {\n if (idx < this.cuttingFormula) {\n this.$set(item, '_show', true)\n } else {\n this.$set(item, '_show', false)\n }\n })\n }\n return dataSource\n },\n buildDefaultValue (arg) {\n if (type.notStr(arg)) return arg\n if (!arg || arg.charAt(0) !== '_') return arg\n return parse(arg, {\n _route: this.$route.query\n })\n },\n mapDefaultValueToValue () {\n this.dataSource.forEach(props => {\n this.$set(props, '_show', this.isExpand)\n if (props.defaultValue) {\n if (type.isFunction(props.defaultValue)) {\n const ret = props.defaultValue.call(this)\n this.$set(props, '_value', this.buildDefaultValue(ret))\n } else {\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\n }\n }\n })\n return this.dataSource\n },\n handleClickExpandCollapse () {\n this.isExpand = !this.isExpand\n },\n handleClickSearch () {\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n buildMapto (mapTo = [], dataSource) {\n const [ startField, endField ] = mapTo\n const [ startValue, endValue ] = dataSource || [null, null]\n return {\n [startField]: startValue,\n [endField]: endValue\n }\n },\n extractValues () {\n let ret = {}\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\n switch (item.type) {\n case 'DatePicker':\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\n break\n case 'ele-date-range':\n if (item.mapTo) {\n Object.assign(ret, this.buildMapto(item.mapTo, item._value))\n } else {\n ret[item.name] = (item._value || []).join(',')\n }\n break\n default:\n ret[item.name] = item._value\n break\n }\n })\n return ret\n },\n cleanValues () {\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\n const { defaultValue } = item\n switch (item.type) {\n case 'Select':\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', null)\n break\n case 'DatePicker':\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', undefined)\n break\n case 'ele-date-range':\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', [])\n break\n default:\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\n !defaultValue && this.$set(item, '_value', null)\n break\n }\n })\n },\n handleClickReset () {\n this.cleanValues()\n //TODO defaultValue\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n onChangeSelect (value, props) {\n this.$set(props, '_value', value)\n }\n },\n destroyed () {\n this.cleanValues()\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n ::v-deep .ant-col {\n &:last-child {\n float: right;\n }\n }\n .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n &.search-area--action {\n justify-content: end;\n }\n .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n .expand-collapse__text {\n font-size: 14px;\n }\n .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n }\n }\n }\n}\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12236
13022
|
|
|
12237
13023
|
};
|
|
12238
13024
|
/* scoped */
|
|
12239
|
-
const __vue_scope_id__$b = "data-v-
|
|
13025
|
+
const __vue_scope_id__$b = "data-v-292ddb2a";
|
|
12240
13026
|
/* module identifier */
|
|
12241
13027
|
const __vue_module_identifier__$b = undefined;
|
|
12242
13028
|
/* functional template */
|
|
@@ -12479,11 +13265,11 @@ __vue_render__$a._withStripped = true;
|
|
|
12479
13265
|
/* style */
|
|
12480
13266
|
const __vue_inject_styles__$a = function (inject) {
|
|
12481
13267
|
if (!inject) return
|
|
12482
|
-
inject("data-v-
|
|
13268
|
+
inject("data-v-76a191a6_0", { source: ".button-group__wrapper[data-v-76a191a6] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-76a191a6] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-76a191a6]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/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 });
|
|
12483
13269
|
|
|
12484
13270
|
};
|
|
12485
13271
|
/* scoped */
|
|
12486
|
-
const __vue_scope_id__$a = "data-v-
|
|
13272
|
+
const __vue_scope_id__$a = "data-v-76a191a6";
|
|
12487
13273
|
/* module identifier */
|
|
12488
13274
|
const __vue_module_identifier__$a = undefined;
|
|
12489
13275
|
/* functional template */
|
|
@@ -12994,11 +13780,11 @@ __vue_render__$8._withStripped = true;
|
|
|
12994
13780
|
/* style */
|
|
12995
13781
|
const __vue_inject_styles__$8 = function (inject) {
|
|
12996
13782
|
if (!inject) return
|
|
12997
|
-
inject("data-v-
|
|
13783
|
+
inject("data-v-3cfa8e37_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
12998
13784
|
|
|
12999
13785
|
};
|
|
13000
13786
|
/* scoped */
|
|
13001
|
-
const __vue_scope_id__$8 = "data-v-
|
|
13787
|
+
const __vue_scope_id__$8 = "data-v-3cfa8e37";
|
|
13002
13788
|
/* module identifier */
|
|
13003
13789
|
const __vue_module_identifier__$8 = undefined;
|
|
13004
13790
|
/* functional template */
|
|
@@ -13158,12 +13944,12 @@ __vue_render__$7._withStripped = true;
|
|
|
13158
13944
|
/* style */
|
|
13159
13945
|
const __vue_inject_styles__$7 = function (inject) {
|
|
13160
13946
|
if (!inject) return
|
|
13161
|
-
inject("data-v-
|
|
13162
|
-
,inject("data-v-
|
|
13947
|
+
inject("data-v-4ea524be_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
13948
|
+
,inject("data-v-4ea524be_1", { source: ".ele-modal-confirm__content[data-v-4ea524be] {\n margin-top: 8px;\n color: var(--idoole-black-088);\n font-size: 14px;\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/composite-components/modal-confirm/src/index.vue","index.vue"],"names":[],"mappings":"AAiGA;EACA,eAAA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;AChGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <ele-modal :title=\"title\" :value=\"value\" :size=\"size\" @cancel=\"onCancel\" v-on=\"overrideEvents\" :buttonGroupMeta=\"buttonGroupMeta\">\n <ele-alert v-if=\"alert\" v-bind=\"alert\"></ele-alert>\n <div v-if=\"contentText\" class=\"ele-modal-confirm__content\">\n {{ contentText }}\n </div>\n </ele-modal>\n</template>\n\n<script>\nimport { CONTEXT } from '../../../utils'\nexport default {\n name: 'ele-modal-confirm',\n model: {\n event: 'change',\n prop: 'value'\n },\n props: {\n title: {\n type: String\n },\n size: {\n type: String,\n default: 'small'\n },\n alert: {\n type: [Object, Boolean],\n default: () => ({\n type: 'warning',\n message: '确定要删除吗?',\n description: '删除后将无法恢复',\n closable: false\n })\n },\n contentText: {\n type: String\n },\n value: {\n type: Boolean,\n default: false\n },\n buttonGroupMeta: {\n type: Object\n },\n //!deprecated\n contextProp: {\n type: Object,\n default: () => ({})\n }\n },\n inject: {\n [CONTEXT]: {\n default: () => (() => ({}))\n }\n },\n data () {\n return {}\n },\n computed: {\n currentContext () {\n const { exposed: exposedData = {} } = this[CONTEXT]()\n const exposed = Object.assign({}, exposedData, { closeModalConfirm: this.closeModalConfirm })\n return {\n _route: this.$route.query,\n _routeMeta: this.$route.meta,\n ...this[CONTEXT](),\n exposed\n }\n },\n overrideEvents () {\n if (!this.buttonGroupMeta) return {}\n const { elements = [] } = this.buttonGroupMeta\n const events = elements.reduce((ret, ele) =>{\n ret[ele.eventName || 'click'] = (e) => {\n this.$emit(ele.eventName || 'click', { ...e, ...this.currentContext })\n }\n return ret\n }, {})\n return {\n ...events\n }\n }\n },\n methods: {\n closeModalConfirm () {\n this.$emit('change', false)\n },\n onCancel () {\n this.$emit('change', false)\n }\n }\n}\n</script>\n<style lang=\"scss\">\n@import '../../../theme/index';\n</style>\n<style lang=\"scss\" scoped>\n.ele-modal-confirm__content {\n margin-top: 8px;\n color: var(--idoole-black-088);\n font-size: 14px;\n line-height: 22px;\n}\n</style>",".ele-modal-confirm__content {\n margin-top: 8px;\n color: var(--idoole-black-088);\n font-size: 14px;\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
13163
13949
|
|
|
13164
13950
|
};
|
|
13165
13951
|
/* scoped */
|
|
13166
|
-
const __vue_scope_id__$7 = "data-v-
|
|
13952
|
+
const __vue_scope_id__$7 = "data-v-4ea524be";
|
|
13167
13953
|
/* module identifier */
|
|
13168
13954
|
const __vue_module_identifier__$7 = undefined;
|
|
13169
13955
|
/* functional template */
|
|
@@ -13406,11 +14192,11 @@ __vue_render__$6._withStripped = true;
|
|
|
13406
14192
|
/* style */
|
|
13407
14193
|
const __vue_inject_styles__$6 = function (inject) {
|
|
13408
14194
|
if (!inject) return
|
|
13409
|
-
inject("data-v-
|
|
14195
|
+
inject("data-v-721fe305_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
13410
14196
|
|
|
13411
14197
|
};
|
|
13412
14198
|
/* scoped */
|
|
13413
|
-
const __vue_scope_id__$6 = "data-v-
|
|
14199
|
+
const __vue_scope_id__$6 = "data-v-721fe305";
|
|
13414
14200
|
/* module identifier */
|
|
13415
14201
|
const __vue_module_identifier__$6 = undefined;
|
|
13416
14202
|
/* functional template */
|
|
@@ -13605,11 +14391,11 @@ __vue_render__$5._withStripped = true;
|
|
|
13605
14391
|
/* style */
|
|
13606
14392
|
const __vue_inject_styles__$5 = function (inject) {
|
|
13607
14393
|
if (!inject) return
|
|
13608
|
-
inject("data-v-
|
|
14394
|
+
inject("data-v-5636b7e0_0", { source: ".ele__img--form .form__img--wrapper[data-v-5636b7e0] {\n cursor: pointer;\n border-radius: 4px;\n background: #000;\n opacity: 0.3;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n position: relative;\n}\n.ele__img--form .form__img--wrapper .form__img--preivew[data-v-5636b7e0] {\n position: absolute;\n color: red;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper[data-v-5636b7e0] {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n color: #fff;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon--oper[data-v-5636b7e0] {\n font-size: 40px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon__text--oper[data-v-5636b7e0] {\n font-size: 16px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/composite-components/form-img-crop/src/index.vue","index.vue"],"names":[],"mappings":"AAmGA;EACA,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,kBAAA;AClGA;ADmGA;EACA,kBAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;ACjGA;ADmGA;EACA,kBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,WAAA;ACjGA;ADkGA;EACA,eAAA;AChGA;ADkGA;EACA,eAAA;AChGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"ele__img--form\">\n <div class=\"form__img--wrapper\" \n @click=\"handleClick\" \n :style=\"style\">\n <div class=\"form__img--preivew\" v-if=\"value\">\n <img style=\"width:100%;height:100%\" :src=\"imageUrl\" alt=\"\" srcset=\"\">\n </div>\n <div class=\"form__icon--wrapper\">\n <ele-icon class=\"icon--oper\" type=\"icon-camera\"></ele-icon>\n <span class=\"icon__text--oper\">{{ operText }}</span>\n </div>\n </div>\n <ele-modal-img-crop \n v-model=\"showModalImgCropValue\"\n :uploadFileConfig=\"uploadFileConfig\"\n @change=\"onChangeModalCropImg\"\n :cropperConfig=\"cropperConfig\"\n :imageId=\"value\"\n :title=\"modalTitle\">\n </ele-modal-img-crop>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-form-img-crop',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: [String, Number]\n },\n modalTitle: {\n type: String\n },\n operText: {\n type: String,\n default: '更改头像'\n },\n width: {\n type: [Number, String],\n default: 200\n },\n height: {\n type: [Number, String],\n default: 200\n },\n cropperConfig: {\n type: Object,\n default: () => {\n return {\n aspectRatio: 16 / 9\n }\n }\n },\n uploadFileConfig: {\n type: Object,\n default: () => {\n return {\n size: 10,\n accept: '*',\n byteConversion: 1024 * 1024\n }\n }\n }\n },\n data() {\n return {\n showModalImgCropValue: false\n }\n },\n computed: {\n style () {\n return {\n width: this.width + 'px',\n height: this.height + 'px'\n }\n },\n imageUrl () {\n return `/api-file/workbench/file/stream/${this.value}?origin=true`\n }\n },\n methods: {\n handleClick () {\n this.showModalImgCropValue = true\n },\n onChangeModalCropImg (fileId) {\n console.log('fileId', fileId)\n this.$emit('change', fileId)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.ele__img--form {\n .form__img--wrapper {\n cursor: pointer;\n border-radius: 4px;\n background: #000;\n opacity: 0.3;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n position: relative;\n .form__img--preivew {\n position: absolute;\n color: red;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n }\n .form__icon--wrapper {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n color: #fff;\n .icon--oper {\n font-size: 40px;\n }\n .icon__text--oper {\n font-size: 16px;\n }\n }\n }\n}\n</style>",".ele__img--form .form__img--wrapper {\n cursor: pointer;\n border-radius: 4px;\n background: #000;\n opacity: 0.3;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n position: relative;\n}\n.ele__img--form .form__img--wrapper .form__img--preivew {\n position: absolute;\n color: red;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n color: #fff;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon--oper {\n font-size: 40px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon__text--oper {\n font-size: 16px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
13609
14395
|
|
|
13610
14396
|
};
|
|
13611
14397
|
/* scoped */
|
|
13612
|
-
const __vue_scope_id__$5 = "data-v-
|
|
14398
|
+
const __vue_scope_id__$5 = "data-v-5636b7e0";
|
|
13613
14399
|
/* module identifier */
|
|
13614
14400
|
const __vue_module_identifier__$5 = undefined;
|
|
13615
14401
|
/* functional template */
|
|
@@ -14042,12 +14828,12 @@ __vue_render__$3._withStripped = true;
|
|
|
14042
14828
|
/* style */
|
|
14043
14829
|
const __vue_inject_styles__$3 = function (inject) {
|
|
14044
14830
|
if (!inject) return
|
|
14045
|
-
inject("data-v-
|
|
14046
|
-
,inject("data-v-
|
|
14831
|
+
inject("data-v-8f6b9582_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
14832
|
+
,inject("data-v-8f6b9582_1", { source: ".import-download__link[data-v-8f6b9582] {\n color: var(--idooel-link-06);\n font-size: 14px;\n cursor: pointer;\n line-height: 22px;\n}\n.ele-modal-import__hint .import-hint__content[data-v-8f6b9582] {\n padding: 16px;\n border-radius: 2px;\n height: 82px;\n border: 1px dashed var(--idooel-link-06);\n background: var(--idoole-black-02);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__left .anticon-upload[data-v-8f6b9582] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right[data-v-8f6b9582] {\n margin-left: 16px;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__title[data-v-8f6b9582] {\n font-size: 16px;\n color: var(--idooel-link-06);\n cursor: pointer;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__sub-title[data-v-8f6b9582] {\n font-size: 14px;\n color: var(--idooel-link-03);\n}\n.ele-modal-import__hint .import-footer__hint--text[data-v-8f6b9582] {\n font-size: 14px;\n color: var(--idooel-link-06);\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/business-components/modal-import/src/index.vue","index.vue"],"names":[],"mappings":"AAkGA;EACA,4BAAA;EACA,eAAA;EACA,eAAA;EACA,iBAAA;ACjGA;ADoGA;EACA,aAAA;EACA,kBAAA;EACA,YAAA;EACA,wCAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACjGA;ADmGA;EACA,eAAA;EACA,4BAAA;ACjGA;ADoGA;EACA,iBAAA;AClGA;ADmGA;EACA,eAAA;EACA,4BAAA;EACA,eAAA;ACjGA;ADmGA;EACA,eAAA;EACA,4BAAA;ACjGA;ADqGA;EACA,eAAA;EACA,4BAAA;EACA,iBAAA;ACnGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <ele-modal :value=\"innerValue\" :buttonGroupMeta=\"buttonGroupMeta\" @cancel=\"onCancel\" @handleClose=\"handleClose\" title=\"导入\">\n <div class=\"ele-modal-import__upload\" v-if=\"isFileEmpty\">\n <div class=\"import-download__link\" @click=\"handleClickDownloadTpl\">点击此链接下载导入模板</div>\n <ele-upload v-model=\"file\" @on-success=\"uploadFileSuccess\"></ele-upload>\n </div>\n <div v-else class=\"ele-modal-import__hint\">\n <div class=\"import-hint__content\">\n <div class=\"import-hint__left\">\n <ele-icon></ele-icon>\n </div>\n <div class=\"import-hint__right\">\n <div class=\"hint-right__title\" @click=\"handleClickJump\">文件上传成功,任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>\n <div class=\"hint-right__sub-title\">批处理任务的准备工作会在后台运行</div>\n </div>\n </div>\n <div class=\"import-footer__hint--text\">\n 您可以请点击上方按钮查看任务进度或关闭弹框\n </div>\n </div>\n </ele-modal>\n</template>\n\n<script>\nimport { type } from '@idooel/shared'\nexport default {\n name: 'ele-modal-import',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: Boolean,\n default: false\n }\n },\n data() {\n return {\n innerValue: false,\n file: [],\n buttonGroupMeta: {\n elements: [\n {\n label: '关闭',\n key: 'close',\n type: 'default',\n eventName: 'handleClose'\n }\n ]\n }\n }\n },\n computed: {\n isFileEmpty () {\n return type.isEmpty(this.file)\n }\n },\n watch: {\n value: {\n handler (value) {\n this.innerValue = value\n },\n immediate: true\n }\n },\n methods: {\n emitEvent (props = {}) {\n this.$emit('on-actions', { ...props })\n },\n onCancel () {\n this.innerValue = false\n this.$emit('change', false)\n },\n handleClickJump () {\n this.emitEvent({ action: 'jump' })\n },\n uploadFileSuccess (props) {\n this.emitEvent({ action: 'uploaded', file: props })\n },\n handleClickDownloadTpl () {\n this.emitEvent({ action: 'download' })\n },\n cleanFile () {\n this.file = []\n },\n handleClose () {\n this.cleanFile()\n this.innerValue = false\n this.$emit('change', false)\n }\n }\n}\n</script>\n<style lang=\"scss\">\n@import '../../../theme/index';\n</style>\n<style lang=\"scss\" scoped>\n.import-download__link {\n color: var(--idooel-link-06);\n font-size: 14px;\n cursor: pointer;\n line-height: 22px;\n}\n.ele-modal-import__hint {\n .import-hint__content {\n padding: 16px;\n border-radius: 2px;\n height: 82px;\n border: 1px dashed var(--idooel-link-06);\n background: var(--idoole-black-02);\n display: flex;\n flex-direction: row;\n align-items: center;\n .import-hint__left {\n .anticon-upload {\n font-size: 48px;\n color: var(--idooel-link-06);\n }\n }\n .import-hint__right {\n margin-left: 16px;\n .hint-right__title {\n font-size: 16px;\n color: var(--idooel-link-06);\n cursor: pointer;\n }\n .hint-right__sub-title {\n font-size: 14px;\n color: var(--idooel-link-03);\n }\n }\n }\n .import-footer__hint--text {\n font-size: 14px;\n color: var(--idooel-link-06);\n line-height: 22px;\n }\n}\n</style>",".import-download__link {\n color: var(--idooel-link-06);\n font-size: 14px;\n cursor: pointer;\n line-height: 22px;\n}\n\n.ele-modal-import__hint .import-hint__content {\n padding: 16px;\n border-radius: 2px;\n height: 82px;\n border: 1px dashed var(--idooel-link-06);\n background: var(--idoole-black-02);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__left .anticon-upload {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right {\n margin-left: 16px;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__title {\n font-size: 16px;\n color: var(--idooel-link-06);\n cursor: pointer;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__sub-title {\n font-size: 14px;\n color: var(--idooel-link-03);\n}\n.ele-modal-import__hint .import-footer__hint--text {\n font-size: 14px;\n color: var(--idooel-link-06);\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
14047
14833
|
|
|
14048
14834
|
};
|
|
14049
14835
|
/* scoped */
|
|
14050
|
-
const __vue_scope_id__$3 = "data-v-
|
|
14836
|
+
const __vue_scope_id__$3 = "data-v-8f6b9582";
|
|
14051
14837
|
/* module identifier */
|
|
14052
14838
|
const __vue_module_identifier__$3 = undefined;
|
|
14053
14839
|
/* functional template */
|
|
@@ -14188,11 +14974,11 @@ __vue_render__$2._withStripped = true;
|
|
|
14188
14974
|
/* style */
|
|
14189
14975
|
const __vue_inject_styles__$2 = function (inject) {
|
|
14190
14976
|
if (!inject) return
|
|
14191
|
-
inject("data-v-
|
|
14977
|
+
inject("data-v-cea1871c_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
14192
14978
|
|
|
14193
14979
|
};
|
|
14194
14980
|
/* scoped */
|
|
14195
|
-
const __vue_scope_id__$2 = "data-v-
|
|
14981
|
+
const __vue_scope_id__$2 = "data-v-cea1871c";
|
|
14196
14982
|
/* module identifier */
|
|
14197
14983
|
const __vue_module_identifier__$2 = undefined;
|
|
14198
14984
|
/* functional template */
|
|
@@ -14401,12 +15187,12 @@ __vue_render__$1._withStripped = true;
|
|
|
14401
15187
|
/* style */
|
|
14402
15188
|
const __vue_inject_styles__$1 = function (inject) {
|
|
14403
15189
|
if (!inject) return
|
|
14404
|
-
inject("data-v-
|
|
14405
|
-
,inject("data-v-
|
|
15190
|
+
inject("data-v-7cbdf7aa_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
15191
|
+
,inject("data-v-7cbdf7aa_1", { source: ".ele-modal-fsm__display[data-v-7cbdf7aa] {\n display: flex;\n flex-direction: row;\n font-size: 14px;\n line-height: 22px;\n}\n.ele-modal-fsm__display .fms-display__name[data-v-7cbdf7aa], .ele-modal-fsm__display .fms-display__action[data-v-7cbdf7aa] {\n font-weight: bold;\n color: var(--idoole-black-088);\n}\n.ele-modal-fsm__display .fms-display__name[data-v-7cbdf7aa]::before, .ele-modal-fsm__display .fms-display__action[data-v-7cbdf7aa]::before {\n content: \"\";\n margin-left: 4px;\n}\n.ele-modal-fsm__display .fms-display__name[data-v-7cbdf7aa]::after, .ele-modal-fsm__display .fms-display__action[data-v-7cbdf7aa]::after {\n content: \"\";\n margin-right: 4px;\n}\n.ele-modal-fsm__display .title-info[data-v-7cbdf7aa] {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-modal-fsm__display .title-info[data-v-7cbdf7aa]::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-modal-fsm__display .title-info.success[data-v-7cbdf7aa]::before {\n background: var(--idoole-success-06);\n}\n.ele-modal-fsm__display .title-info.warning[data-v-7cbdf7aa]::before {\n background: var(--idoole-warning-06);\n}\n.ele-modal-fsm__display .title-info.error[data-v-7cbdf7aa]::before {\n background: var(--idoole-error-06);\n}\n.ele-modal-fsm__opinion-wrapper[data-v-7cbdf7aa] {\n margin-top: 4px;\n line-height: 22px;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__label[data-v-7cbdf7aa] {\n width: 42px;\n flex-shrink: 0;\n color: var(--idoole-black-064);\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__value[data-v-7cbdf7aa] {\n color: var(--idoole-black-088);\n font-weight: bold;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/business-components/modal-fsm/src/index.vue","index.vue"],"names":[],"mappings":"AAkGA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;ACjGA;ADkGA;EACA,iBAAA;EACA,8BAAA;AChGA;ADiGA;EACA,WAAA;EACA,gBAAA;AC/FA;ADiGA;EACA,WAAA;EACA,iBAAA;AC/FA;ADkGA;EACA,eAAA;EACA,8BAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AChGA;ADiGA;EACA,WAAA;EACA,qBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,iBAAA;AC/FA;ADkGA;EACA,oCAAA;AChGA;ADoGA;EACA,oCAAA;AClGA;ADsGA;EACA,kCAAA;ACpGA;ADyGA;EACA,eAAA;EACA,iBAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;ACtGA;ADuGA;EACA,WAAA;EACA,cAAA;EACA,8BAAA;ACrGA;ADuGA;EACA,8BAAA;EACA,iBAAA;ACrGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <ele-modal v-on=\"$listeners\" :value=\"value\" :title=\"meta.title || title\" @cancel=\"handleCancel\" :buttonGroupMeta=\"buttonGroupMeta\">\n <slot name=\"alert\"></slot>\n <ele-timeline v-bind=\"meta\">\n <template #right=\"{ data: item }\">\n <div class=\"ele-modal-fsm__display\">\n <span>由</span>\n <span class=\"fms-display__name\">{{ item.userName || '管理员' }}</span>\n <span>执行了</span>\n <span class=\"fms-display__action\">{{ item.action || '结班' }}</span>\n <span>操作</span>\n <span :class=\"['title-info', item.state == 1 && 'success', item.state == 2 && 'warning', item.state == 3 && 'error']\">{{ item.stateName }}</span>\n </div>\n <div class=\"ele-modal-fsm__opinion-wrapper\">\n <div class=\"fsm-opinion__label\">意见:</div>\n <div class=\"fsm-opinion__value\">{{ item.opinion }}</div>\n </div>\n </template>\n </ele-timeline>\n <template v-if=\"showTextSlot\" #footer-text>\n <ele-text v-bind=\"textAttrs\"></ele-text>\n </template>\n </ele-modal>\n</template>\n\n<script>\nimport { CONTEXT } from '../../../utils'\nimport { type } from '@idooel/shared'\nexport default {\n name: 'ele-modal-fsm',\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: Boolean,\n default: false\n },\n title: {\n type: String,\n default: '状态变更记录'\n },\n meta: {\n type: Object,\n default: () => ({})\n },\n buttonGroupMeta: {\n type: Object,\n default: () => {\n return {\n elements: [\n {\n label: '关闭',\n key: 'cancel',\n type: 'default',\n eventName: 'cancel'\n }\n ]\n }\n }\n },\n contextProp: {\n type: Object,\n default: () => ({})\n }\n },\n provide() {\n return {\n [CONTEXT]: () => {\n return {\n _route: this.$route.query,\n _routeMeta: this.$route.meta,\n ...this.contextProp\n }\n }\n }\n },\n computed: {\n showTextSlot () {\n return !type.isEmpty(this.textAttrs)\n },\n textAttrs() {\n const { text = {} } = this.buttonGroupMeta\n return text\n }\n },\n methods: {\n handleCancel () {\n this.$emit('change', false)\n }\n }\n}\n</script>\n<style lang=\"scss\">\n@import '../../../theme/index';\n</style>\n<style lang=\"scss\" scoped>\n.ele-modal-fsm__display {\n display: flex;\n flex-direction: row;\n font-size: 14px;\n line-height: 22px;\n .fms-display__name, .fms-display__action {\n font-weight: bold;\n color: var(--idoole-black-088);\n &::before {\n content: '';\n margin-left: 4px;\n }\n &::after {\n content: '';\n margin-right: 4px;\n }\n }\n .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n &::before {\n content: '';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n }\n &.success {\n &::before {\n background: var(--idoole-success-06);\n }\n }\n &.warning {\n &::before {\n background: var(--idoole-warning-06);\n }\n }\n &.error {\n &::before {\n background: var(--idoole-error-06);\n }\n }\n }\n}\n.ele-modal-fsm__opinion-wrapper {\n margin-top: 4px;\n line-height: 22px;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n .fsm-opinion__label {\n width: 42px;\n flex-shrink: 0;\n color: var(--idoole-black-064);\n }\n .fsm-opinion__value {\n color: var(--idoole-black-088);\n font-weight: bold;\n }\n}\n</style>",".ele-modal-fsm__display {\n display: flex;\n flex-direction: row;\n font-size: 14px;\n line-height: 22px;\n}\n.ele-modal-fsm__display .fms-display__name, .ele-modal-fsm__display .fms-display__action {\n font-weight: bold;\n color: var(--idoole-black-088);\n}\n.ele-modal-fsm__display .fms-display__name::before, .ele-modal-fsm__display .fms-display__action::before {\n content: \"\";\n margin-left: 4px;\n}\n.ele-modal-fsm__display .fms-display__name::after, .ele-modal-fsm__display .fms-display__action::after {\n content: \"\";\n margin-right: 4px;\n}\n.ele-modal-fsm__display .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-modal-fsm__display .title-info::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-modal-fsm__display .title-info.success::before {\n background: var(--idoole-success-06);\n}\n.ele-modal-fsm__display .title-info.warning::before {\n background: var(--idoole-warning-06);\n}\n.ele-modal-fsm__display .title-info.error::before {\n background: var(--idoole-error-06);\n}\n\n.ele-modal-fsm__opinion-wrapper {\n margin-top: 4px;\n line-height: 22px;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__label {\n width: 42px;\n flex-shrink: 0;\n color: var(--idoole-black-064);\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__value {\n color: var(--idoole-black-088);\n font-weight: bold;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
14406
15192
|
|
|
14407
15193
|
};
|
|
14408
15194
|
/* scoped */
|
|
14409
|
-
const __vue_scope_id__$1 = "data-v-
|
|
15195
|
+
const __vue_scope_id__$1 = "data-v-7cbdf7aa";
|
|
14410
15196
|
/* module identifier */
|
|
14411
15197
|
const __vue_module_identifier__$1 = undefined;
|
|
14412
15198
|
/* functional template */
|
|
@@ -14564,11 +15350,11 @@ __vue_render__._withStripped = true;
|
|
|
14564
15350
|
/* style */
|
|
14565
15351
|
const __vue_inject_styles__ = function (inject) {
|
|
14566
15352
|
if (!inject) return
|
|
14567
|
-
inject("data-v-
|
|
15353
|
+
inject("data-v-0b7bf033_0", { source: ".g-form__tabs[data-v-0b7bf033] {\n width: 100%;\n background: #fff;\n display: flex;\n flex-direction: row;\n height: 32px;\n}\n.g-form__tabs .g-form__wrapper[data-v-0b7bf033] {\n display: flex;\n flex-direction: row;\n}\n.g-form__tabs .g-form__wrapper.disabled .g-form__item[data-v-0b7bf033] {\n cursor: not-allowed;\n border-color: rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.24);\n}\n.g-form__tabs .g-form__wrapper .g-form__item[data-v-0b7bf033] {\n padding: 0px 16px;\n cursor: pointer;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgba(0, 0, 0, 0.16);\n color: rgba(0, 0, 0, 0.64);\n border-right: unset;\n}\n.g-form__tabs .g-form__wrapper .g-form__item .suffix[data-v-0b7bf033] {\n display: flex;\n}\n.g-form__tabs .g-form__wrapper .g-form__item[data-v-0b7bf033]:last-child {\n border-right: 1px solid rgba(0, 0, 0, 0.16);\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived[data-v-0b7bf033] {\n border-color: #409eff;\n color: #409eff;\n font-size: 14px;\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived + .g-form__item[data-v-0b7bf033] {\n border-left: 1px solid #409eff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/GanJiao/base-elearning-frontend-model/packages/components/packages/business-components/tabs-sub-center/src/index.vue","index.vue"],"names":[],"mappings":"AAwEA;EACA,WAAA;EACA,gBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;ACvEA;ADwEA;EACA,aAAA;EACA,mBAAA;ACtEA;ADwEA;EACA,mBAAA;EACA,iCAAA;EACA,+BAAA;EACA,0BAAA;ACtEA;ADyEA;EACA,iBAAA;EACA,eAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,qCAAA;EACA,0BAAA;EACA,mBAAA;ACvEA;ADwEA;EACA,aAAA;ACtEA;ADwEA;EACA,2CAAA;ACtEA;ADwEA;EACA,qBAAA;EACA,cAAA;EACA,eAAA;ACtEA;ADuEA;EACA,8BAAA;ACrEA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-form__tabs\">\n <div :class=\"['g-form__wrapper', disabled && 'disabled']\">\n <div :class=\"['g-form__item', !disabled && (innerActiveKey == props.key) && 'actived']\" @click=\"handleTabClick(props)\" v-for=\"props in dataSource\" :key=\"props.key\">\n <div>{{ props.title }}</div>\n <div v-if=\"isSuffix\" class=\"suffix\">\n <template v-if=\"props.loading\">\n <ele-loading style=\"margin-left:4px;\" :loading=\"props.loading\"></ele-loading>\n </template>\n <div v-else>({{ props.suffix }}人)</div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-tabs-sub-center',\n props: {\n activeKey: {\n type: [String, Number]\n },\n isSuffix: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n dataSource: {\n type: Array\n }\n },\n data () {\n return {\n innerActiveKey: 1\n }\n },\n watch: {\n activeKey: {\n handler (key) {\n this.innerActiveKey = key\n },\n immediate: true\n }\n },\n methods: {\n setLoadingByKey (key, status = true) {\n const target = this.dataSource.find(item => item.key == key)\n this.$set(target, 'loading', status)\n },\n setTitleByKey (key, title) {\n const target = this.dataSource.find(item => item.key == key)\n this.$set(target, 'title', title)\n },\n setSuffixByKey (key, suffix) {\n const target = this.dataSource.find(item => item.key == key)\n this.$set(target, 'suffix', suffix)\n },\n handleTabClick (props) {\n if (this.disabled) return\n const { key } = props\n this.innerActiveKey = key\n this.$emit('on-click', props)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-form__tabs {\n width: 100%;\n background: #fff;\n display: flex;\n flex-direction: row;\n height: 32px;\n .g-form__wrapper {\n display: flex;\n flex-direction: row;\n &.disabled {\n .g-form__item {\n cursor: not-allowed;\n border-color: rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.24);\n }\n }\n .g-form__item {\n padding: 0px 16px;\n cursor: pointer;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgba(0, 0, 0, 0.16);\n color: rgba(0, 0, 0, 0.64);\n border-right: unset;\n & .suffix {\n display: flex;\n }\n &:last-child {\n border-right: 1px solid rgba(0, 0, 0, 0.16);\n }\n &.actived {\n border-color:#409eff;\n color: #409eff;\n font-size: 14px;\n &+.g-form__item {\n border-left: 1px solid #409eff;\n }\n }\n }\n }\n}\n</style>",".g-form__tabs {\n width: 100%;\n background: #fff;\n display: flex;\n flex-direction: row;\n height: 32px;\n}\n.g-form__tabs .g-form__wrapper {\n display: flex;\n flex-direction: row;\n}\n.g-form__tabs .g-form__wrapper.disabled .g-form__item {\n cursor: not-allowed;\n border-color: rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.24);\n}\n.g-form__tabs .g-form__wrapper .g-form__item {\n padding: 0px 16px;\n cursor: pointer;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgba(0, 0, 0, 0.16);\n color: rgba(0, 0, 0, 0.64);\n border-right: unset;\n}\n.g-form__tabs .g-form__wrapper .g-form__item .suffix {\n display: flex;\n}\n.g-form__tabs .g-form__wrapper .g-form__item:last-child {\n border-right: 1px solid rgba(0, 0, 0, 0.16);\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived {\n border-color: #409eff;\n color: #409eff;\n font-size: 14px;\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived + .g-form__item {\n border-left: 1px solid #409eff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
14568
15354
|
|
|
14569
15355
|
};
|
|
14570
15356
|
/* scoped */
|
|
14571
|
-
const __vue_scope_id__ = "data-v-
|
|
15357
|
+
const __vue_scope_id__ = "data-v-0b7bf033";
|
|
14572
15358
|
/* module identifier */
|
|
14573
15359
|
const __vue_module_identifier__ = undefined;
|
|
14574
15360
|
/* functional template */
|