@idooel/components 0.0.2-beta.12 → 0.0.2-beta.13
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/README.md +98 -98
- package/dist/@idooel/components.esm.js +960 -248
- package/dist/@idooel/components.umd.js +963 -251
- package/jsconfig.json +7 -7
- package/package.json +61 -61
- package/packages/alert/index.js +4 -4
- package/packages/alert/src/index.vue +45 -45
- package/packages/batch-export/index.js +4 -4
- package/packages/batch-export/src/index.vue +104 -104
- package/packages/business-components/modal-fsm/index.js +4 -4
- package/packages/business-components/modal-fsm/src/index.vue +163 -163
- package/packages/business-components/modal-import/index.js +4 -4
- package/packages/business-components/modal-import/src/index.vue +139 -139
- package/packages/business-components/modal-timeline/index.js +4 -4
- package/packages/business-components/modal-timeline/src/index.vue +77 -77
- package/packages/business-components/tabs-sub-center/index.js +4 -4
- package/packages/business-components/tabs-sub-center/src/index.vue +116 -116
- package/packages/button/index.js +4 -4
- package/packages/button/src/index.vue +65 -65
- package/packages/checkbox/index.js +4 -4
- package/packages/checkbox/src/index.vue +52 -52
- package/packages/composite-components/button-group/index.js +4 -4
- package/packages/composite-components/button-group/src/index.vue +151 -151
- package/packages/composite-components/form-attachment/src/index.vue +14 -14
- package/packages/composite-components/form-img-crop/index.js +4 -4
- package/packages/composite-components/form-img-crop/src/index.vue +131 -131
- package/packages/composite-components/modal-confirm/index.js +4 -4
- package/packages/composite-components/modal-confirm/src/index.vue +103 -103
- package/packages/composite-components/modal-form/index.js +4 -4
- package/packages/composite-components/modal-form/src/index.vue +230 -230
- package/packages/composite-components/modal-img-crop/index.js +4 -4
- package/packages/composite-components/modal-img-crop/src/index.vue +298 -298
- package/packages/composite-components/modal-table/index.js +4 -4
- package/packages/composite-components/modal-table/src/index.vue +155 -155
- package/packages/composite-components/modal-tree/index.js +4 -4
- package/packages/composite-components/modal-tree/src/index.vue +75 -75
- package/packages/composite-components/search-area/index.js +4 -4
- package/packages/composite-components/search-area/src/index.vue +238 -237
- package/packages/composite-components/search-area/src/label.vue +35 -35
- package/packages/composite-components/select-entity-modal-table/index.js +4 -4
- package/packages/composite-components/select-entity-modal-table/src/index.vue +171 -171
- package/packages/date/index.js +4 -4
- package/packages/date/src/index.vue +112 -112
- package/packages/date-range/index.js +4 -4
- package/packages/date-range/src/index.vue +47 -47
- package/packages/form/index.js +4 -4
- package/packages/form/src/index.vue +319 -319
- package/packages/icon/index.js +4 -4
- package/packages/icon/src/index.vue +31 -31
- package/packages/index.js +156 -153
- package/packages/input/index.js +4 -4
- package/packages/input/src/index.vue +35 -35
- package/packages/input-number/index.js +4 -4
- package/packages/input-number/src/index.vue +23 -23
- package/packages/loading/index.js +4 -4
- package/packages/loading/src/index.vue +36 -36
- package/packages/meta/provider.js +4 -0
- package/packages/modal/index.js +4 -4
- package/packages/modal/src/index.vue +184 -184
- package/packages/models/form-group-model/index.js +4 -4
- package/packages/models/form-group-model/src/index.vue +273 -273
- package/packages/models/form-model/index.js +4 -4
- package/packages/models/form-model/src/index.vue +236 -236
- package/packages/models/step-model/index.js +4 -4
- package/packages/models/step-model/src/index.vue +224 -224
- package/packages/models/tree-table-model/index.js +4 -4
- package/packages/models/tree-table-model/src/index.vue +806 -764
- package/packages/radio/index.js +4 -4
- package/packages/radio/src/index.vue +56 -56
- package/packages/select/index.js +4 -4
- package/packages/select/src/index.vue +105 -105
- package/packages/select-entity/index.js +4 -4
- package/packages/select-entity/src/index.vue +119 -119
- package/packages/table/index.js +4 -4
- package/packages/table/src/action.vue +172 -172
- package/packages/table/src/index.vue +339 -319
- package/packages/tabs/index.js +4 -4
- package/packages/tabs/src/index.vue +55 -55
- package/packages/text/index.js +4 -4
- package/packages/text/src/index.vue +47 -47
- package/packages/text-editor/index.js +4 -4
- package/packages/text-editor/src/index.vue +72 -72
- package/packages/textarea/index.js +4 -4
- package/packages/textarea/src/index.vue +57 -57
- package/packages/theme/form.scss +21 -21
- package/packages/theme/index.scss +43 -43
- package/packages/theme/overrid.scss +7 -7
- package/packages/theme/styleClass.scss +2 -2
- package/packages/theme/variables.scss +55 -55
- package/packages/timeline/index.js +4 -4
- package/packages/timeline/src/index.vue +257 -257
- package/packages/tpl/index.js +4 -4
- package/packages/tpl/src/index.vue +55 -55
- package/packages/tree/index.js +4 -4
- package/packages/tree/src/TreeNode.vue +29 -29
- package/packages/tree/src/index.vue +101 -101
- package/packages/tree-select/index.js +4 -4
- package/packages/tree-select/src/index.vue +142 -142
- package/packages/upload/index.js +4 -4
- package/packages/upload/src/index.vue +996 -996
- package/packages/utils/index.js +66 -62
- package/packages/utils/runtime-context/dataPoolAPI.js +501 -0
- package/packages/utils/runtime-context/globalDataPool.js +279 -0
- package/packages/utils/runtime-context/index.js +76 -0
- package/packages/utils/runtime-context/modelSchema.js +174 -0
- package/scripts/rollup.config.js +42 -42
- package/scripts/rollup.esm.config.js +11 -11
- package/scripts/rollup.umd.config.js +17 -17
- package/vitest.config.js +17 -17
- package/packages/utils/dataPool.js +0 -22
- package/packages/utils/treeTableDataPoolManager.js +0 -85
|
@@ -1,9 +1,765 @@
|
|
|
1
|
+
import { createDataPool } from '@idooel/runtime-context';
|
|
1
2
|
import { parse as parse$1 } from '@idooel/expression';
|
|
2
3
|
import moment from 'moment';
|
|
3
4
|
import { type, net, route, util } from '@idooel/shared';
|
|
4
|
-
import { createDataPool } from '@idooel/runtime-context';
|
|
5
5
|
import FileUpload from 'vue-upload-component';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* 模型字段定义
|
|
9
|
+
* 定义 TreeTable 模型支持的数据字段和类型
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 字段类型定义
|
|
14
|
+
*/
|
|
15
|
+
const FIELD_TYPES = {
|
|
16
|
+
OBJECT: 'object',
|
|
17
|
+
ARRAY: 'array',
|
|
18
|
+
STRING: 'string',
|
|
19
|
+
NUMBER: 'number',
|
|
20
|
+
BOOLEAN: 'boolean'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* TreeTable 模型字段定义
|
|
25
|
+
*/
|
|
26
|
+
const TREE_TABLE_FIELDS = {
|
|
27
|
+
// 当前选中的行数据 - 核心字段
|
|
28
|
+
currentRowData: {
|
|
29
|
+
type: FIELD_TYPES.OBJECT,
|
|
30
|
+
default: {},
|
|
31
|
+
description: '当前表格选中的行数据'
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 共享数据字段定义
|
|
37
|
+
*/
|
|
38
|
+
const SHARED_FIELDS = {
|
|
39
|
+
// Modal Table 父级数据
|
|
40
|
+
parentCurrentRowData: {
|
|
41
|
+
type: FIELD_TYPES.OBJECT,
|
|
42
|
+
default: null,
|
|
43
|
+
description: 'Modal Table 的父级表格当前行数据'
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 获取字段默认值
|
|
49
|
+
* @param {object} schema 字段schema
|
|
50
|
+
* @returns {object} 默认值对象
|
|
51
|
+
*/
|
|
52
|
+
const getFieldDefaults = schema => {
|
|
53
|
+
const defaults = {};
|
|
54
|
+
for (const [fieldName, fieldConfig] of Object.entries(schema)) {
|
|
55
|
+
if (fieldConfig.default !== undefined) {
|
|
56
|
+
defaults[fieldName] = fieldConfig.default;
|
|
57
|
+
} else if (fieldConfig.required) {
|
|
58
|
+
// 必填字段但没有默认值的处理
|
|
59
|
+
switch (fieldConfig.type) {
|
|
60
|
+
case FIELD_TYPES.OBJECT:
|
|
61
|
+
defaults[fieldName] = {};
|
|
62
|
+
break;
|
|
63
|
+
case FIELD_TYPES.ARRAY:
|
|
64
|
+
defaults[fieldName] = [];
|
|
65
|
+
break;
|
|
66
|
+
case FIELD_TYPES.STRING:
|
|
67
|
+
defaults[fieldName] = '';
|
|
68
|
+
break;
|
|
69
|
+
case FIELD_TYPES.NUMBER:
|
|
70
|
+
defaults[fieldName] = 0;
|
|
71
|
+
break;
|
|
72
|
+
case FIELD_TYPES.BOOLEAN:
|
|
73
|
+
defaults[fieldName] = false;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return defaults;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 验证字段值是否符合类型要求
|
|
83
|
+
* @param {*} value 要验证的值
|
|
84
|
+
* @param {string} expectedType 期望的类型
|
|
85
|
+
* @returns {boolean} 是否有效
|
|
86
|
+
*/
|
|
87
|
+
const validateFieldType = (value, expectedType) => {
|
|
88
|
+
if (value === null || value === undefined) {
|
|
89
|
+
return true; // 允许空值
|
|
90
|
+
}
|
|
91
|
+
const actualType = Array.isArray(value) ? FIELD_TYPES.ARRAY : typeof value;
|
|
92
|
+
|
|
93
|
+
// 宽松的类型检查
|
|
94
|
+
switch (expectedType) {
|
|
95
|
+
case FIELD_TYPES.OBJECT:
|
|
96
|
+
return actualType === FIELD_TYPES.OBJECT;
|
|
97
|
+
case FIELD_TYPES.ARRAY:
|
|
98
|
+
return actualType === FIELD_TYPES.ARRAY;
|
|
99
|
+
case FIELD_TYPES.STRING:
|
|
100
|
+
return actualType === FIELD_TYPES.STRING;
|
|
101
|
+
case FIELD_TYPES.NUMBER:
|
|
102
|
+
return actualType === FIELD_TYPES.NUMBER;
|
|
103
|
+
case FIELD_TYPES.BOOLEAN:
|
|
104
|
+
return actualType === FIELD_TYPES.BOOLEAN;
|
|
105
|
+
default:
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 获取模型支持的字段列表
|
|
112
|
+
* @returns {string[]} 字段名列表
|
|
113
|
+
*/
|
|
114
|
+
const getSupportedFields = () => {
|
|
115
|
+
return Object.keys({
|
|
116
|
+
...TREE_TABLE_FIELDS,
|
|
117
|
+
...SHARED_FIELDS
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 全局数据池管理器
|
|
123
|
+
* 挂载到 window.__idooel_data_pool__,提供统一的数据和实例方法管理
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
class BaseModelMethods {
|
|
127
|
+
constructor(instanceId, dataPool) {
|
|
128
|
+
this.instanceId = instanceId;
|
|
129
|
+
this.dataPool = dataPool;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 基础数据操作 - 保留,实际在使用
|
|
133
|
+
setData(key, value) {
|
|
134
|
+
// 验证字段类型(可选)
|
|
135
|
+
const supportedFields = getSupportedFields();
|
|
136
|
+
if (supportedFields.includes(key)) {
|
|
137
|
+
const fieldDef = TREE_TABLE_FIELDS[key];
|
|
138
|
+
if (fieldDef && !validateFieldType(value, fieldDef.type)) {
|
|
139
|
+
console.warn(`Field type mismatch for ${key}: expected ${fieldDef.type}, got ${typeof value}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this.dataPool.manager.setData(this.instanceId, key, value);
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
getData(key, defaultValue = null) {
|
|
146
|
+
return this.dataPool.manager.getData(this.instanceId, key, defaultValue);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// 事件订阅 - 保留,实际在使用
|
|
150
|
+
subscribe(key, callback) {
|
|
151
|
+
return this.dataPool.manager.subscribe({
|
|
152
|
+
instanceId: this.instanceId,
|
|
153
|
+
key
|
|
154
|
+
}, callback);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 数据清理 - 保留,实际在使用
|
|
158
|
+
cleanup() {
|
|
159
|
+
this.dataPool.manager.clearModelData(this.instanceId);
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 获取数据池引用 - 保留,实际在使用
|
|
164
|
+
getDataPool() {
|
|
165
|
+
return this.dataPool;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
class TreeTableModelMethods extends BaseModelMethods {
|
|
169
|
+
constructor(instanceId, dataPool) {
|
|
170
|
+
super(instanceId, dataPool);
|
|
171
|
+
// 初始化 TreeTable 特有的数据结构 - 只保留必要的字段
|
|
172
|
+
this._initTreeTableData();
|
|
173
|
+
}
|
|
174
|
+
_initTreeTableData() {
|
|
175
|
+
// 设置初始元数据
|
|
176
|
+
this.setData('__meta__', {
|
|
177
|
+
type: 'tree-table',
|
|
178
|
+
instanceId: this.instanceId,
|
|
179
|
+
createdAt: Date.now()
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// 使用 schema 初始化数据字段
|
|
183
|
+
const defaults = getFieldDefaults(TREE_TABLE_FIELDS);
|
|
184
|
+
for (const [fieldName, defaultValue] of Object.entries(defaults)) {
|
|
185
|
+
this.setData(fieldName, defaultValue);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// TreeTable 核心方法 - 只保留实际使用的
|
|
190
|
+
setCurrentRowData(data) {
|
|
191
|
+
this.setData('currentRowData', data);
|
|
192
|
+
return this;
|
|
193
|
+
}
|
|
194
|
+
getCurrentRowData() {
|
|
195
|
+
return this.getData('currentRowData', {});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// 共享数据操作(与 modal table 交互)- 保留,实际在使用
|
|
199
|
+
setSharedData(data) {
|
|
200
|
+
if (data && Object.keys(data).length > 0) {
|
|
201
|
+
this.dataPool.manager.setSharedData('modalTable', 'parentCurrentRowData', data);
|
|
202
|
+
}
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
getSharedData() {
|
|
206
|
+
return this.dataPool.manager.getSharedData('modalTable', 'parentCurrentRowData');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// 订阅共享数据变化 - 保留,实际在使用
|
|
210
|
+
subscribeShared(callback) {
|
|
211
|
+
return this.dataPool.manager.subscribe({
|
|
212
|
+
namespace: 'modalTable',
|
|
213
|
+
key: 'parentCurrentRowData'
|
|
214
|
+
}, callback);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
class GlobalDataManager {
|
|
218
|
+
constructor() {
|
|
219
|
+
this.models = new Map();
|
|
220
|
+
this.runtimeContext = createDataPool();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// 注册模型实例 - 保留,实际在使用
|
|
224
|
+
registerModel(modelType, instanceId, methods) {
|
|
225
|
+
if (this.models.has(instanceId)) {
|
|
226
|
+
console.warn(`Model instance ${instanceId} already exists`);
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
this.models.set(instanceId, {
|
|
230
|
+
type: modelType,
|
|
231
|
+
instanceId,
|
|
232
|
+
methods,
|
|
233
|
+
createdAt: Date.now()
|
|
234
|
+
});
|
|
235
|
+
return this;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// 注销模型实例 - 保留,实际在使用
|
|
239
|
+
unregisterModel(instanceId) {
|
|
240
|
+
if (this.models.has(instanceId)) {
|
|
241
|
+
this.clearModelData(instanceId);
|
|
242
|
+
this.models.delete(instanceId);
|
|
243
|
+
}
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// 获取模型实例 - 保留,实际在使用
|
|
248
|
+
getModel(instanceId) {
|
|
249
|
+
const model = this.models.get(instanceId);
|
|
250
|
+
return model ? model.methods : null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// 获取指定类型的所有模型 - 保留,dataPoolAPI 中使用
|
|
254
|
+
getAllModels(modelType = null) {
|
|
255
|
+
const result = {};
|
|
256
|
+
for (const [instanceId, model] of this.models) {
|
|
257
|
+
if (!modelType || model.type === modelType) {
|
|
258
|
+
result[instanceId] = model.methods;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// 设置模型数据 - 保留,实际在使用
|
|
265
|
+
setData(instanceId, key, value) {
|
|
266
|
+
const model = this.models.get(instanceId);
|
|
267
|
+
if (!model) {
|
|
268
|
+
console.error(`Model instance ${instanceId} not found`);
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
this.runtimeContext.set(instanceId, key, value);
|
|
272
|
+
return this;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// 获取模型数据 - 保留,实际在使用
|
|
276
|
+
getData(instanceId, key, defaultValue = null) {
|
|
277
|
+
const model = this.models.get(instanceId);
|
|
278
|
+
if (!model) {
|
|
279
|
+
return defaultValue;
|
|
280
|
+
}
|
|
281
|
+
return this.runtimeContext.get(instanceId, key, defaultValue);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// 设置共享数据 - 保留,实际在使用(modal table 交互)
|
|
285
|
+
setSharedData(namespace, key, value) {
|
|
286
|
+
const prefixedNamespace = `shared.${namespace}`;
|
|
287
|
+
this.runtimeContext.set(prefixedNamespace, key, value);
|
|
288
|
+
return this;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// 获取共享数据 - 保留,实际在使用
|
|
292
|
+
getSharedData(namespace, key, defaultValue = null) {
|
|
293
|
+
const prefixedNamespace = `shared.${namespace}`;
|
|
294
|
+
return this.runtimeContext.get(prefixedNamespace, key, defaultValue);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// 订阅系统 - 保留,实际在使用
|
|
298
|
+
subscribe(filter, callback) {
|
|
299
|
+
return this.runtimeContext.subscribe(filter, callback);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// 清理模型数据 - 保留,实际在使用
|
|
303
|
+
clearModelData(instanceId) {
|
|
304
|
+
const model = this.models.get(instanceId);
|
|
305
|
+
if (model) {
|
|
306
|
+
this.runtimeContext.clear(instanceId);
|
|
307
|
+
}
|
|
308
|
+
return this;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// 模型工厂 - 简化版,只支持 tree-table
|
|
313
|
+
class ModelFactory {
|
|
314
|
+
static createModel(modelType, instanceId, options = {}) {
|
|
315
|
+
if (modelType !== 'tree-table') {
|
|
316
|
+
throw new Error(`Unsupported model type: ${modelType}. Only 'tree-table' is supported.`);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// 注册到全局数据池
|
|
320
|
+
window.__idooel_data_pool__.manager.registerModel(modelType, instanceId, null // 占位符
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
// 创建 TreeTable 模型实例
|
|
324
|
+
const methods = new TreeTableModelMethods(instanceId, window.__idooel_data_pool__);
|
|
325
|
+
|
|
326
|
+
// 更新注册的方法引用
|
|
327
|
+
const model = window.__idooel_data_pool__.manager.models.get(instanceId);
|
|
328
|
+
if (model) {
|
|
329
|
+
model.methods = methods;
|
|
330
|
+
}
|
|
331
|
+
return methods;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// 初始化全局数据池 - 简化版
|
|
336
|
+
function initGlobalDataPool() {
|
|
337
|
+
if (window.__idooel_data_pool__) {
|
|
338
|
+
return window.__idooel_data_pool__;
|
|
339
|
+
}
|
|
340
|
+
const dataPool = {
|
|
341
|
+
// 全局管理接口
|
|
342
|
+
manager: new GlobalDataManager(),
|
|
343
|
+
// 模型工厂
|
|
344
|
+
factory: ModelFactory,
|
|
345
|
+
// 工具方法 - 只保留实际使用的
|
|
346
|
+
utils: {
|
|
347
|
+
// 生成唯一 ID - dataPoolAPI 中使用
|
|
348
|
+
generateId: (prefix = 'model') => `${prefix}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`,
|
|
349
|
+
// 获取时间戳 - dataPoolAPI 中使用
|
|
350
|
+
now: () => Date.now(),
|
|
351
|
+
// 深拷贝 - dataPoolAPI 中使用
|
|
352
|
+
deepClone: obj => JSON.parse(JSON.stringify(obj)),
|
|
353
|
+
// 类型检查 - dataPoolAPI 中使用
|
|
354
|
+
isObject: val => val !== null && typeof val === 'object',
|
|
355
|
+
isEmpty: val => {
|
|
356
|
+
if (val == null) return true;
|
|
357
|
+
if (Array.isArray(val) || typeof val === 'string') return val.length === 0;
|
|
358
|
+
if (typeof val === 'object') return Object.keys(val).length === 0;
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
// 挂载到 window
|
|
365
|
+
window.__idooel_data_pool__ = dataPool;
|
|
366
|
+
return dataPool;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// 初始化
|
|
370
|
+
initGlobalDataPool();
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* 统一的数据池 API 接口
|
|
374
|
+
* 提供简洁易用的数据操作接口,封装全局数据池的复杂性
|
|
375
|
+
*/
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* 数据池 API 类
|
|
379
|
+
*/
|
|
380
|
+
class DataPoolAPI {
|
|
381
|
+
constructor() {
|
|
382
|
+
this.dataPool = window.__idooel_data_pool__;
|
|
383
|
+
if (!this.dataPool) {
|
|
384
|
+
throw new Error('Global data pool not initialized. Please ensure runtime-context/index.js is imported before using this API.');
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ==================== 模型实例管理 ====================
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* 创建树形表格模型实例
|
|
392
|
+
* @param {string} instanceId 实例ID(可选,不提供则自动生成)
|
|
393
|
+
* @param {object} options 初始化选项
|
|
394
|
+
* @returns {object} 模型方法实例
|
|
395
|
+
*/
|
|
396
|
+
createTreeTableModel(instanceId, options = {}) {
|
|
397
|
+
const id = instanceId || this.dataPool.utils.generateId('treeTableModel');
|
|
398
|
+
return this.dataPool.factory.createModel('tree-table', id, options);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* 获取模型实例
|
|
403
|
+
* @param {string} instanceId 实例ID
|
|
404
|
+
* @returns {object|null} 模型方法实例
|
|
405
|
+
*/
|
|
406
|
+
getModel(instanceId) {
|
|
407
|
+
return this.dataPool.manager.getModel(instanceId);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* 获取所有指定类型的模型
|
|
412
|
+
* @param {string} modelType 模型类型
|
|
413
|
+
* @returns {object} 模型实例集合
|
|
414
|
+
*/
|
|
415
|
+
getAllModels(modelType = null) {
|
|
416
|
+
return this.dataPool.manager.getAllModels(modelType);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 销毁模型实例
|
|
421
|
+
* @param {string} instanceId 实例ID
|
|
422
|
+
*/
|
|
423
|
+
destroyModel(instanceId) {
|
|
424
|
+
this.dataPool.manager.unregisterModel(instanceId);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// ==================== 数据操作 ====================
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* 设置模型数据
|
|
431
|
+
* @param {string} instanceId 实例ID
|
|
432
|
+
* @param {string} key 数据键
|
|
433
|
+
* @param {any} value 数据值
|
|
434
|
+
*/
|
|
435
|
+
setModelData(instanceId, key, value) {
|
|
436
|
+
this.dataPool.manager.setData(instanceId, key, value);
|
|
437
|
+
return this;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* 获取模型数据
|
|
442
|
+
* @param {string} instanceId 实例ID
|
|
443
|
+
* @param {string} key 数据键
|
|
444
|
+
* @param {any} defaultValue 默认值
|
|
445
|
+
* @returns {any} 数据值
|
|
446
|
+
*/
|
|
447
|
+
getModelData(instanceId, key, defaultValue = null) {
|
|
448
|
+
return this.dataPool.manager.getData(instanceId, key, defaultValue);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* 批量设置模型数据
|
|
453
|
+
* @param {string} instanceId 实例ID
|
|
454
|
+
* @param {object} data 数据对象
|
|
455
|
+
*/
|
|
456
|
+
setBatchModelData(instanceId, data) {
|
|
457
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
458
|
+
this.setModelData(instanceId, key, value);
|
|
459
|
+
});
|
|
460
|
+
return this;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* 获取模型的所有数据
|
|
465
|
+
* @param {string} instanceId 实例ID
|
|
466
|
+
* @returns {object} 模型数据
|
|
467
|
+
*/
|
|
468
|
+
getAllModelData(instanceId) {
|
|
469
|
+
const model = this.dataPool.manager.getModel(instanceId);
|
|
470
|
+
if (!model) {
|
|
471
|
+
return {};
|
|
472
|
+
}
|
|
473
|
+
const exported = model.export() || {};
|
|
474
|
+
return exported.data || {};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// ==================== 共享数据操作 ====================
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* 设置用户信息
|
|
481
|
+
* @param {object} userInfo 用户信息
|
|
482
|
+
*/
|
|
483
|
+
setUserInfo(userInfo) {
|
|
484
|
+
this.dataPool.manager.setSharedData(SHARED_NAMESPACES.USER, SHARED_KEYS.USER_INFO, userInfo, ACCESS_LEVELS.PROTECTED);
|
|
485
|
+
return this;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* 获取用户信息
|
|
490
|
+
* @returns {object} 用户信息
|
|
491
|
+
*/
|
|
492
|
+
getUserInfo() {
|
|
493
|
+
return this.dataPool.manager.getSharedData(SHARED_NAMESPACES.USER, SHARED_KEYS.USER_INFO, {}, ACCESS_LEVELS.PROTECTED);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* 设置用户权限
|
|
498
|
+
* @param {array} permissions 权限列表
|
|
499
|
+
*/
|
|
500
|
+
setUserPermissions(permissions) {
|
|
501
|
+
this.dataPool.manager.setSharedData(SHARED_NAMESPACES.USER, SHARED_KEYS.USER_PERMISSIONS, permissions, ACCESS_LEVELS.PROTECTED);
|
|
502
|
+
return this;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* 获取用户权限
|
|
507
|
+
* @returns {array} 权限列表
|
|
508
|
+
*/
|
|
509
|
+
getUserPermissions() {
|
|
510
|
+
return this.dataPool.manager.getSharedData(SHARED_NAMESPACES.USER, SHARED_KEYS.USER_PERMISSIONS, [], ACCESS_LEVELS.PROTECTED);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* 设置系统配置
|
|
515
|
+
* @param {object} config 系统配置
|
|
516
|
+
*/
|
|
517
|
+
setSystemConfig(config) {
|
|
518
|
+
this.dataPool.manager.setSharedData(SHARED_NAMESPACES.SYSTEM, SHARED_KEYS.SYSTEM_CONFIG, config, ACCESS_LEVELS.PROTECTED);
|
|
519
|
+
return this;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* 获取系统配置
|
|
524
|
+
* @returns {object} 系统配置
|
|
525
|
+
*/
|
|
526
|
+
getSystemConfig() {
|
|
527
|
+
return this.dataPool.manager.getSharedData(SHARED_NAMESPACES.SYSTEM, SHARED_KEYS.SYSTEM_CONFIG, {}, ACCESS_LEVELS.PROTECTED);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* 设置系统主题
|
|
532
|
+
* @param {object} theme 主题配置
|
|
533
|
+
*/
|
|
534
|
+
setSystemTheme(theme) {
|
|
535
|
+
this.dataPool.manager.setSharedData(SHARED_NAMESPACES.SYSTEM, SHARED_KEYS.SYSTEM_THEME, theme, ACCESS_LEVELS.PUBLIC);
|
|
536
|
+
return this;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* 获取系统主题
|
|
541
|
+
* @returns {object} 主题配置
|
|
542
|
+
*/
|
|
543
|
+
getSystemTheme() {
|
|
544
|
+
return this.dataPool.manager.getSharedData(SHARED_NAMESPACES.SYSTEM, SHARED_KEYS.SYSTEM_THEME, {}, ACCESS_LEVELS.PUBLIC);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* 设置模态框父级数据
|
|
549
|
+
* @param {object} parentData 父级数据
|
|
550
|
+
*/
|
|
551
|
+
setModalParentData(parentData) {
|
|
552
|
+
this.dataPool.manager.setSharedData(SHARED_NAMESPACES.MODAL, SHARED_KEYS.MODAL_PARENT_DATA, parentData, ACCESS_LEVELS.PRIVATE);
|
|
553
|
+
return this;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* 获取模态框父级数据
|
|
558
|
+
* @returns {object} 父级数据
|
|
559
|
+
*/
|
|
560
|
+
getModalParentData() {
|
|
561
|
+
return this.dataPool.manager.getSharedData(SHARED_NAMESPACES.MODAL, SHARED_KEYS.MODAL_PARENT_DATA, null, ACCESS_LEVELS.PRIVATE);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* 设置业务字典
|
|
566
|
+
* @param {object} dictionaries 业务字典
|
|
567
|
+
*/
|
|
568
|
+
setBusinessDictionaries(dictionaries) {
|
|
569
|
+
this.dataPool.manager.setSharedData(SHARED_NAMESPACES.BUSINESS, SHARED_KEYS.BUSINESS_DICTIONARIES, dictionaries, ACCESS_LEVELS.PUBLIC);
|
|
570
|
+
return this;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* 获取业务字典
|
|
575
|
+
* @returns {object} 业务字典
|
|
576
|
+
*/
|
|
577
|
+
getBusinessDictionaries() {
|
|
578
|
+
return this.dataPool.manager.getSharedData(SHARED_NAMESPACES.BUSINESS, SHARED_KEYS.BUSINESS_DICTIONARIES, {}, ACCESS_LEVELS.PUBLIC);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// ==================== 订阅系统 ====================
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* 订阅模型数据变化
|
|
585
|
+
* @param {string} instanceId 实例ID
|
|
586
|
+
* @param {string} key 数据键
|
|
587
|
+
* @param {function} callback 回调函数
|
|
588
|
+
* @returns {function} 取消订阅函数
|
|
589
|
+
*/
|
|
590
|
+
subscribeModelData(instanceId, key, callback) {
|
|
591
|
+
return this.dataPool.manager.subscribe({
|
|
592
|
+
instanceId,
|
|
593
|
+
key
|
|
594
|
+
}, callback);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* 订阅用户信息变化
|
|
599
|
+
* @param {function} callback 回调函数
|
|
600
|
+
* @returns {function} 取消订阅函数
|
|
601
|
+
*/
|
|
602
|
+
subscribeUserInfo(callback) {
|
|
603
|
+
return this.dataPool.manager.subscribe({
|
|
604
|
+
namespace: SHARED_NAMESPACES.USER,
|
|
605
|
+
key: SHARED_KEYS.USER_INFO
|
|
606
|
+
}, callback);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* 订阅系统配置变化
|
|
611
|
+
* @param {function} callback 回调函数
|
|
612
|
+
* @returns {function} 取消订阅函数
|
|
613
|
+
*/
|
|
614
|
+
subscribeSystemConfig(callback) {
|
|
615
|
+
return this.dataPool.manager.subscribe({
|
|
616
|
+
namespace: SHARED_NAMESPACES.SYSTEM,
|
|
617
|
+
key: SHARED_KEYS.SYSTEM_CONFIG
|
|
618
|
+
}, callback);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* 订阅系统主题变化
|
|
623
|
+
* @param {function} callback 回调函数
|
|
624
|
+
* @returns {function} 取消订阅函数
|
|
625
|
+
*/
|
|
626
|
+
subscribeSystemTheme(callback) {
|
|
627
|
+
return this.dataPool.manager.subscribe({
|
|
628
|
+
namespace: SHARED_NAMESPACES.SYSTEM,
|
|
629
|
+
key: SHARED_KEYS.SYSTEM_THEME
|
|
630
|
+
}, callback);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* 订阅模态框父级数据变化
|
|
635
|
+
* @param {function} callback 回调函数
|
|
636
|
+
* @returns {function} 取消订阅函数
|
|
637
|
+
*/
|
|
638
|
+
subscribeModalParentData(callback) {
|
|
639
|
+
return this.dataPool.manager.subscribe({
|
|
640
|
+
namespace: SHARED_NAMESPACES.MODAL,
|
|
641
|
+
key: SHARED_KEYS.MODAL_PARENT_DATA
|
|
642
|
+
}, callback);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// ==================== 工具方法 ====================
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* 导出模型数据
|
|
649
|
+
* @param {string} instanceId 实例ID
|
|
650
|
+
* @returns {object} 导出的数据
|
|
651
|
+
*/
|
|
652
|
+
exportModelData(instanceId) {
|
|
653
|
+
const model = this.dataPool.manager.getModel(instanceId);
|
|
654
|
+
return model ? model.export() : null;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* 导入模型数据
|
|
659
|
+
* @param {string} instanceId 实例ID
|
|
660
|
+
* @param {object} data 要导入的数据
|
|
661
|
+
*/
|
|
662
|
+
importModelData(instanceId, data) {
|
|
663
|
+
this.dataPool.manager.importData(instanceId, data);
|
|
664
|
+
return this;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* 清理模型数据
|
|
669
|
+
* @param {string} instanceId 实例ID
|
|
670
|
+
*/
|
|
671
|
+
clearModelData(instanceId) {
|
|
672
|
+
this.dataPool.manager.clearModelData(instanceId);
|
|
673
|
+
return this;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* 获取调试信息
|
|
678
|
+
* @returns {object} 调试信息
|
|
679
|
+
*/
|
|
680
|
+
getDebugInfo() {
|
|
681
|
+
return this.dataPool.manager.debug();
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* 生成唯一ID
|
|
686
|
+
* @param {string} prefix 前缀
|
|
687
|
+
* @returns {string} 唯一ID
|
|
688
|
+
*/
|
|
689
|
+
generateId(prefix = 'data') {
|
|
690
|
+
return this.dataPool.utils.generateId(prefix);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* 深拷贝对象
|
|
695
|
+
* @param {any} obj 要拷贝的对象
|
|
696
|
+
* @returns {any} 拷贝后的对象
|
|
697
|
+
*/
|
|
698
|
+
deepClone(obj) {
|
|
699
|
+
return this.dataPool.utils.deepClone(obj);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* 检查对象是否为空
|
|
704
|
+
* @param {any} value 要检查的值
|
|
705
|
+
* @returns {boolean} 是否为空
|
|
706
|
+
*/
|
|
707
|
+
isEmpty(value) {
|
|
708
|
+
return this.dataPool.utils.isEmpty(value);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* 检查是否为对象
|
|
713
|
+
* @param {any} value 要检查的值
|
|
714
|
+
* @returns {boolean} 是否为对象
|
|
715
|
+
*/
|
|
716
|
+
isObject(value) {
|
|
717
|
+
return this.dataPool.utils.isObject(value);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* 获取当前时间戳
|
|
722
|
+
* @returns {number} 时间戳
|
|
723
|
+
*/
|
|
724
|
+
now() {
|
|
725
|
+
return this.dataPool.utils.now();
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* 创建数据池 API 实例
|
|
731
|
+
* @returns {DataPoolAPI} API 实例
|
|
732
|
+
*/
|
|
733
|
+
const createDataPoolAPI = () => {
|
|
734
|
+
return new DataPoolAPI();
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* 全局数据池 API 实例 - 延迟初始化
|
|
739
|
+
*/
|
|
740
|
+
let dataPoolAPIInstance = null;
|
|
741
|
+
new Proxy({}, {
|
|
742
|
+
get(target, prop) {
|
|
743
|
+
if (!dataPoolAPIInstance) {
|
|
744
|
+
dataPoolAPIInstance = createDataPoolAPI();
|
|
745
|
+
}
|
|
746
|
+
return dataPoolAPIInstance[prop];
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* 便捷的导出函数,供直接使用 - 延迟初始化
|
|
752
|
+
*/
|
|
753
|
+
const getAPI = () => {
|
|
754
|
+
if (!dataPoolAPIInstance) {
|
|
755
|
+
dataPoolAPIInstance = createDataPoolAPI();
|
|
756
|
+
}
|
|
757
|
+
return dataPoolAPIInstance;
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
// 模型管理
|
|
761
|
+
const createTreeTableModel = (instanceId, options = {}) => getAPI().createTreeTableModel(instanceId, options);
|
|
762
|
+
|
|
7
763
|
const CONTEXT = '__idooel__ele__context__';
|
|
8
764
|
const AREA_NAMES = {
|
|
9
765
|
BUTTON_GROUP: 'BUTTON_GROUP'
|
|
@@ -460,11 +1216,11 @@ __vue_render__$G._withStripped = true;
|
|
|
460
1216
|
/* style */
|
|
461
1217
|
const __vue_inject_styles__$G = function (inject) {
|
|
462
1218
|
if (!inject) return
|
|
463
|
-
inject("data-v-
|
|
1219
|
+
inject("data-v-1d79ddf9_0", { source: ".ele-date__wrapper[data-v-1d79ddf9] {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele-date__wrapper\">\r\n <a-date-picker \r\n style=\"width: 100%;\" \r\n :mode=\"modeValue\"\r\n v-if=\"modeValue == 'year'\"\r\n :open=\"open\"\r\n :disabled=\"disabled\"\r\n :value=\"value\"\r\n :placeholder=\"placeholder\"\r\n :show-time=\"showTime\"\r\n :show-today=\"showToday\"\r\n :valueFormat=\"innerValueFormat\"\r\n @panelChange=\"onPanelChange\"\r\n @openChange=\"openChange\"\r\n @change=\"onChange\"\r\n :format=\"format\">\r\n </a-date-picker>\r\n <a-date-picker \r\n v-else\r\n style=\"width: 100%;\"\r\n :placeholder=\"placeholder\"\r\n :open=\"open\"\r\n :disabled=\"disabled\"\r\n :value=\"value\"\r\n :show-time=\"showTime\"\r\n :show-today=\"showToday\"\r\n :valueFormat=\"innerValueFormat\"\r\n @panelChange=\"onPanelChange\"\r\n @openChange=\"openChange\"\r\n @change=\"onChange\"\r\n :format=\"format\">\r\n </a-date-picker>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport moment from 'moment'\r\nexport default {\r\n name: 'ele-date',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Object]\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n format: {\r\n type: String,\r\n default: 'YYYY/MM/DD'\r\n },\r\n mode: {\r\n type: String\r\n },\r\n valueFormat: {\r\n type: String\r\n },\r\n showTime: {\r\n type: [Boolean, Object],\r\n default: true\r\n },\r\n showToday: {\r\n type: Boolean,\r\n default: true\r\n },\r\n placeholder: {\r\n type: String,\r\n default: '请选择日期'\r\n }\r\n },\r\n data () {\r\n return {\r\n open: false\r\n }\r\n },\r\n computed: {\r\n innerValueFormat () {\r\n if (this.valueFormat) return this.valueFormat\r\n return this.format\r\n },\r\n modeValue () {\r\n if (this.mode) return this.mode\r\n if (this.format === 'YYYY') return 'year'\r\n return 'date'\r\n }\r\n },\r\n methods: {\r\n onChange (_, dataString) {\r\n this.$emit('input', dataString)\r\n this.$emit('change', dataString)\r\n },\r\n onPanelChange (value, mode) {\r\n if (this.modeValue !== 'year') return\r\n this.$emit('input', moment(value).format(this.format))\r\n this.$emit('change', moment(value).format(this.format))\r\n this.open = false\r\n },\r\n openChange (open) {\r\n this.open = open\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ele-date__wrapper {\r\n width: 100%;\r\n}\r\n</style>",".ele-date__wrapper {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
464
1220
|
|
|
465
1221
|
};
|
|
466
1222
|
/* scoped */
|
|
467
|
-
const __vue_scope_id__$G = "data-v-
|
|
1223
|
+
const __vue_scope_id__$G = "data-v-1d79ddf9";
|
|
468
1224
|
/* module identifier */
|
|
469
1225
|
const __vue_module_identifier__$G = undefined;
|
|
470
1226
|
/* functional template */
|
|
@@ -545,11 +1301,11 @@ __vue_render__$F._withStripped = true;
|
|
|
545
1301
|
/* style */
|
|
546
1302
|
const __vue_inject_styles__$F = function (inject) {
|
|
547
1303
|
if (!inject) return
|
|
548
|
-
inject("data-v-
|
|
1304
|
+
inject("data-v-22b90b54_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 });
|
|
549
1305
|
|
|
550
1306
|
};
|
|
551
1307
|
/* scoped */
|
|
552
|
-
const __vue_scope_id__$F = "data-v-
|
|
1308
|
+
const __vue_scope_id__$F = "data-v-22b90b54";
|
|
553
1309
|
/* module identifier */
|
|
554
1310
|
const __vue_module_identifier__$F = undefined;
|
|
555
1311
|
/* functional template */
|
|
@@ -704,11 +1460,11 @@ __vue_render__$E._withStripped = true;
|
|
|
704
1460
|
/* style */
|
|
705
1461
|
const __vue_inject_styles__$E = function (inject) {
|
|
706
1462
|
if (!inject) return
|
|
707
|
-
inject("data-v-
|
|
1463
|
+
inject("data-v-d3a1fb9e_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
708
1464
|
|
|
709
1465
|
};
|
|
710
1466
|
/* scoped */
|
|
711
|
-
const __vue_scope_id__$E = "data-v-
|
|
1467
|
+
const __vue_scope_id__$E = "data-v-d3a1fb9e";
|
|
712
1468
|
/* module identifier */
|
|
713
1469
|
const __vue_module_identifier__$E = undefined;
|
|
714
1470
|
/* functional template */
|
|
@@ -1302,11 +2058,11 @@ __vue_render__$D._withStripped = true;
|
|
|
1302
2058
|
/* style */
|
|
1303
2059
|
const __vue_inject_styles__$D = function (inject) {
|
|
1304
2060
|
if (!inject) return
|
|
1305
|
-
inject("data-v-
|
|
2061
|
+
inject("data-v-526e67ca_0", { source: ".g-table__action[data-v-526e67ca] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-526e67ca] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-526e67ca]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"g-table__action\">\r\n <div class=\"table-action__item\" v-for=\"(item, idx) in execOperationExpression(dataSource)\" :key=\"idx\">\r\n <template v-if=\"item.type == 'text'\">\r\n <span @click=\"handleClickText(item)\">{{ item.label }}</span>\r\n </template>\r\n <template v-else-if=\"item.type == 'confirm'\">\r\n <div>\r\n <a-popconfirm :title=\"item.message\" @confirm=\"handleClickConfirm(item)\">\r\n {{ item.label }}\r\n </a-popconfirm>\r\n </div>\r\n </template>\r\n <template v-else-if=\"item.type == 'dropdown'\">\r\n <a-dropdown>\r\n <a-menu slot=\"overlay\" @click=\"handleDropdownClick\">\r\n <a-menu-item :key=\"`${item.key || ''}${menuKeyDelimiter}${opt.value || ''}`\" v-for=\"opt in execOperationExpression(item.optionList)\">\r\n <template v-if=\"opt.type == 'confirm'\">\r\n <a-popconfirm :title=\"opt.message\" @confirm=\"handleClickConfirm(opt)\">\r\n {{ opt.label }}\r\n </a-popconfirm>\r\n </template>\r\n <template v-else-if=\"opt.type == 'modal-confirm'\">\r\n <div style=\"width: 100%\" @click=\"handleClickModalConfirm(opt)\">{{ opt.label }}</div>\r\n <ele-modal-confirm v-bind=\"opt.modalConfirm\" v-on=\"$listeners\" v-model=\"showModalConfirm\"></ele-modal-confirm>\r\n </template>\r\n <template v-else>\r\n {{ opt.label }}\r\n </template>\r\n </a-menu-item>\r\n </a-menu>\r\n <span>{{ item.label }}</span>\r\n </a-dropdown>\r\n </template>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v5 as uuidv5 } from 'uuid'\r\nimport { type, route } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nimport { CONTEXT } from '../../utils'\r\nconst MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002'\r\nexport default {\r\n props: {\r\n record: {\r\n type: Object\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n inject: {\r\n requestTreeData: {\r\n default: void 0\r\n },\r\n requestTableData: {\r\n default: void 0\r\n }\r\n },\r\n data() {\r\n return {\r\n showModalConfirm: false\r\n }\r\n },\r\n provide () {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n exposed: this.builtInMethods,\r\n ...this.record\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n menuKeyDelimiter () {\r\n return uuidv5('_', MENU_KEY_NAMESPACE)\r\n },\r\n builtInMethods () {\r\n return { \r\n requestTreeData: this.requestTreeData, \r\n requestTableData: this.requestTableData,\r\n closeModalConfirm: this.closeModalConfirm,\r\n showModalConfirm: this.handleClickModalConfirm,\r\n currentRowData: this.record\r\n }\r\n }\r\n },\r\n methods: {\r\n closeModalConfirm () {\r\n this.showModalConfirm = false\r\n },\r\n handleClickModalConfirm () {\r\n this.showModalConfirm = true\r\n },\r\n execOperationExpression (dataSource = []) {\r\n const ret = dataSource.map(item => {\r\n const { show } = item\r\n if (type.isUndefined(show)) {\r\n return item\r\n } else if (type.isBool(show)) {\r\n if (show) return item\r\n } else if (type.isStr(show)) {\r\n const parseRet = parse(show, { \r\n ...this.record, \r\n _route: route.searchToQueryParams(window.location.search) \r\n })\r\n if (parseRet) return item\r\n }\r\n }).filter(item => item)\r\n return ret\r\n },\r\n handleClickConfirm (props) {\r\n //TODO generate event by special rule\r\n const { eventName, value, key } = props\r\n this.$emit(eventName || key, { \r\n key: value || key, \r\n record: this.record,\r\n builtInMethods: this.builtInMethods,\r\n exposed: this.builtInMethods\r\n })\r\n },\r\n handleDropdownClick (props) {\r\n const { key } = props\r\n const [parent, child] = key.split(this.menuKeyDelimiter)\r\n if (!parent || !child) {\r\n throw new Error('key is required')\r\n }\r\n const currentDropdown = this.dataSource.find(item => item.key === parent)\r\n const currentClickTarget = currentDropdown.optionList.find(item => item.value === child)\r\n const { eventName, type, key: currentKey } = currentClickTarget\r\n //TODO generate event by special rule\r\n if (type === 'confirm' || type === 'modal-confirm') return\r\n this.$emit(eventName || currentKey, { \r\n key: child, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods,\r\n exposed: this.builtInMethods\r\n })\r\n },\r\n handleClickText (props) {\r\n const { eventName, key } = props\r\n this.$emit(eventName || key, { \r\n key, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods,\r\n exposed: this.builtInMethods\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__action {\r\n display: flex;\r\n flex-direction: row;\r\n .table-action__item {\r\n font-size: 14px;\r\n color: #409EFF;\r\n margin-left: 16px;\r\n cursor: pointer;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
|
|
1306
2062
|
|
|
1307
2063
|
};
|
|
1308
2064
|
/* scoped */
|
|
1309
|
-
const __vue_scope_id__$D = "data-v-
|
|
2065
|
+
const __vue_scope_id__$D = "data-v-526e67ca";
|
|
1310
2066
|
/* module identifier */
|
|
1311
2067
|
const __vue_module_identifier__$D = undefined;
|
|
1312
2068
|
/* functional template */
|
|
@@ -1606,11 +2362,11 @@ __vue_render__$C._withStripped = true;
|
|
|
1606
2362
|
/* style */
|
|
1607
2363
|
const __vue_inject_styles__$C = function (inject) {
|
|
1608
2364
|
if (!inject) return
|
|
1609
|
-
inject("data-v-0f604f7a_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-0f604f7a] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n /* 确保表体能够正常纵向滚动 */\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper[data-v-0f604f7a] .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-0f604f7a] .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-0f604f7a] .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-0f604f7a] .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-0f604f7a] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-0f604f7a] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-0f604f7a] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-0f604f7a] .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-0f604f7a] .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-0f604f7a] .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-0f604f7a] .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-0f604f7a] .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-0f604f7a] .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-0f604f7a] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-0f604f7a] .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-0f604f7a] {\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/OnlineStudy/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 });
|
|
2365
|
+
inject("data-v-3d0d3edf_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-3d0d3edf] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n}\n.g-table__wrapper[data-v-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] {\n /* 确保表体能够正常纵向滚动 */\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .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-3d0d3edf] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper[data-v-3d0d3edf] {\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper .g-table__pagination[data-v-3d0d3edf] {\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.g-table__wrapper[data-v-3d0d3edf] {\n /* 空数据状态顶部显示 */\n}\n.g-table__wrapper .g-table__no-data[data-v-3d0d3edf] {\n position: relative;\n}\n.g-table__wrapper .g-table__no-data[data-v-3d0d3edf] .ant-table-placeholder {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -40%);\n width: 100%;\n height: 100%;\n text-align: center;\n color: #999;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n overflow: hidden;\n border: unset;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue","C:\\Users\\ZOU\\Code\\OnlineStudy\\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;ADxNA;ACyNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADvNA;AC0NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADxNA;AC2NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADzNA;AC4NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;AD1NA;AC0LA;EAmCA,iBAAA;AD1NA;AC2NA;EACA,cAAA;EACA,aAAA;EACA,gBAAA;ADzNA;AC4NA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AD1NA;AC6NA;EACA,cAAA;EACA,gBAAA;AD3NA;ACiOA;EACA,+CAAA;AD/NA;ACiOA;EACA,0DAAA;AD/NA;ACiOA;EACA,0DAAA;AD/NA;ACkOA;EACA,6CAAA;ADhOA;ACkOA;EACA,wDAAA;ADhOA;ACkOA;EACA,wDAAA;ADhOA;ACoOA;EACA,0CAAA;ADlOA;ACsOA;EACA,cAAA;EACA,yBAAA;EACA,mBAAA;EACA,wBAAA;ADpOA;AC8IA;EAyFA,qBAAA;ADpOA;ACqOA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;ADnOA;ACgIA;EAsGA,cAAA;ADnOA;ACoOA;EACA,kBAAA;ADlOA;ACmOA;EACA,kBAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,WAAA;EACA,eAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,aAAA;ADjOA;;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.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 {\n /* 确保表体能够正常纵向滚动 */\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 {\n /* 分页区域固定在底部,不被挤出视口 */\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.g-table__wrapper {\n /* 空数据状态顶部显示 */\n}\n.g-table__wrapper .g-table__no-data {\n position: relative;\n}\n.g-table__wrapper .g-table__no-data ::v-deep .ant-table-placeholder {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -40%);\n width: 100%;\n height: 100%;\n text-align: center;\n color: #999;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n overflow: hidden;\n border: unset;\n}\n\n/*# sourceMappingURL=index.vue.map */","<template>\r\n <div class=\"g-table__wrapper\" :style=\"wrapperStyle\" :class=\"{ 'g-table--no-scroll-y': !needScrollY }\">\r\n <a-table\r\n :bordered=\"bordered\"\r\n :class=\"[isNoData && 'g-table__no-data']\"\r\n :pagination=\"false\"\r\n :loading=\"loading\"\r\n size=\"middle\"\r\n :columns=\"innerColumns\"\r\n :row-selection=\"rowSelection\"\r\n :row-class-name=\"setRowClassName\"\r\n :data-source=\"dataSource\"\r\n :scroll=\"getScroll\">\r\n <template slot=\"action\" slot-scope=\"record\">\r\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\r\n </template>\r\n </a-table>\r\n <div class=\"g-table__pagination\">\r\n <a-pagination\r\n :show-total=\"all => `共 ${all} 条数据`\"\r\n show-size-changer \r\n show-quick-jumper\r\n :pageSize=\"innerPageSize\"\r\n :current=\"innerCurrentPage\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n @change=\"onChangePagination\"\r\n @showSizeChange=\"onShowSizeChange\"\r\n :total=\"total\">\r\n </a-pagination>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Actions from './action.vue'\r\nexport default {\r\n name: 'ele-table',\r\n components: {\r\n Actions\r\n },\r\n props: {\r\n // ant table wrapper\r\n height: {\r\n type: Number\r\n },\r\n width: {\r\n type: Number\r\n },\r\n x: {\r\n type: Number,\r\n default: 1200\r\n },\r\n y: {\r\n type: Number,\r\n default: 200\r\n },\r\n scroll: {\r\n type: Object\r\n },\r\n rowSelection: {\r\n type: Object\r\n },\r\n actions: {\r\n type: Array,\r\n default: () => []\r\n },\r\n total: {\r\n type: Number,\r\n default: 0\r\n },\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n columns: {\r\n type: Array,\r\n default: () => []\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n pageSize: {\r\n type: Number,\r\n default: 10\r\n },\r\n pageSizeOptions: {\r\n type: Array,\r\n default: () => ['10', '20', '30', '40']\r\n },\r\n bordered: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n tableHeaderHeight: 0,\r\n paginationHeight: 0,\r\n innerPageSize: 10,\r\n innerCurrentPage: 1,\r\n tableContentHeight: 0,\r\n obs: []\r\n }\r\n },\r\n computed: {\r\n wrapperStyle () {\r\n // 外层容器样式:确保分页始终可见,表格充满剩余空间\r\n if (!this.height) return {}\r\n return { height: `${this.height}px` }\r\n },\r\n needScrollY () {\r\n // 判断是否需要 y 轴滚动:基于数据行数与可用高度预估\r\n if (!this.height) return false\r\n \r\n const availableHeight = this.getScrollHeightByHeight\r\n if (availableHeight <= 0) return false\r\n \r\n // 预估每行高度(包含边框),antd 默认约 54px\r\n const estimatedRowHeight = 54\r\n const estimatedTableHeight = this.dataSource.length * estimatedRowHeight\r\n \r\n return estimatedTableHeight > availableHeight\r\n },\r\n innerColumns () {\r\n return this.columns.filter(col => !Object.keys(col).includes('multiple'))\r\n },\r\n isNoData () {\r\n return !this.dataSource.length\r\n },\r\n getScrollHeightByHeight () {\r\n // 始终返回可用的剩余高度,让表格内容不足时也能占满容器\r\n return this.height - this.tableHeaderHeight - this.paginationHeight\r\n },\r\n isFlexColumn () {\r\n return this.columns.every(col => !col.width)\r\n },\r\n getScroll () {\r\n if (this.scroll) {\r\n return this.scroll\r\n } else {\r\n const baseX = this.isFlexColumn ? 0 : (this.width > this.x ? 0 : this.x)\r\n if (this.height) {\r\n // 计算表体可用高度\r\n const availableHeight = this.tableHeaderHeight && this.paginationHeight \r\n ? this.getScrollHeightByHeight \r\n : this.height - 100 // 预估值,给表头和分页留空间\r\n \r\n if (availableHeight > 50) { // 确保有足够的最小高度\r\n console.log('Table scroll config:', { x: baseX, y: availableHeight, height: this.height, headerHeight: this.tableHeaderHeight, paginationHeight: this.paginationHeight })\r\n return { x: baseX, y: availableHeight }\r\n }\r\n }\r\n return { x: baseX }\r\n }\r\n }\r\n },\r\n watch: {\r\n pageSize: {\r\n handler (pageSize) {\r\n this.innerPageSize = pageSize\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n onShowSizeChange (current, pageSize) {\r\n this.innerCurrentPage = current\r\n this.innerPageSize = pageSize\r\n this.$emit('change-page', current, pageSize)\r\n },\r\n setPaginationHeight () {\r\n this.$nextTick(() => {\r\n const { height } = document.querySelector('.g-table__pagination').getBoundingClientRect()\r\n this.paginationHeight = height\r\n })\r\n },\r\n setTableHeaderHeight () {\r\n this.$nextTick(() => {\r\n const el = document.querySelector('.ant-table-header')\r\n if (!el) return\r\n const { height } = el.getBoundingClientRect()\r\n this.tableHeaderHeight = height\r\n })\r\n },\r\n setTableTbodyHeight () {\r\n // 简化:仅需要获取表头高度,不再依赖表体高度的动态监听\r\n this.$nextTick(() => {\r\n this.setTableHeaderHeight()\r\n })\r\n },\r\n setRowClassName (record, idx) {\r\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\r\n },\r\n onChangePagination (page, pageSize) {\r\n this.innerCurrentPage = page\r\n this.innerPageSize = pageSize\r\n this.$emit('change-page', page, pageSize)\r\n }\r\n },\r\n mounted() {\r\n this.$nextTick(() => {\r\n this.setPaginationHeight()\r\n setTimeout(() => {\r\n this.setTableTbodyHeight()\r\n // 再测一次分页高度,确保初次渲染完成后数值准确\r\n this.setPaginationHeight()\r\n }, 200)\r\n })\r\n },\r\n destroyed () {\r\n this.obs.forEach(ob => ob.disconnect())\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__wrapper {\r\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\r\n display: flex;\r\n flex-direction: column;\r\n overflow: hidden;\r\n\r\n /* 表格区域占满剩余空间,启用纵向滚动 */\r\n ::v-deep .ant-table-wrapper {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-spin-nested-loading {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-spin-container {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-table {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n /* 确保表体能够正常纵向滚动 */\r\n ::v-deep .ant-table-content {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n overflow: hidden;\r\n }\r\n\r\n ::v-deep .ant-table-scroll {\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-table-header {\r\n flex: 0 0 auto;\r\n overflow: hidden;\r\n }\r\n ::v-deep .ant-table-fixed {\r\n .ant-table-tbody {\r\n .g-table__row--odd {\r\n &.ant-table-row-hover {\r\n td {\r\n background-color: var(--idooel-row-hover-color);\r\n }\r\n .ant-table-selection-column {\r\n background-color: var(--idooel-row-hover-color) !important;\r\n }\r\n .ant-table-row-cell-break-word {\r\n background-color: var(--idooel-row-hover-color) !important;\r\n }\r\n }\r\n td {\r\n background-color: var(--idooel-row-odd-color);\r\n }\r\n .ant-table-selection-column {\r\n background-color: var(--idooel-row-odd-color) !important;\r\n }\r\n .ant-table-row-cell-break-word {\r\n background-color: var(--idooel-row-odd-color) !important;\r\n }\r\n }\r\n }\r\n .ant-table-thead {\r\n background: rgba(0, 0, 0, 0.03) !important;\r\n }\r\n }\r\n\r\n ::v-deep .ant-table-body {\r\n flex: 1 1 auto;\r\n overflow: auto !important;\r\n /* 确保滚动条稳定,避免列宽抖动 */\r\n scrollbar-gutter: stable;\r\n }\r\n\r\n /* 分页区域固定在底部,不被挤出视口 */\r\n .g-table__pagination {\r\n flex: 0 0 auto;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: end;\r\n border-top: unset;\r\n padding-top: 8px;\r\n padding-bottom: 8px;\r\n background: #fff;\r\n z-index: 999;\r\n }\r\n\r\n /* 空数据状态顶部显示 */\r\n .g-table__no-data {\r\n position: relative;\r\n ::v-deep .ant-table-placeholder {\r\n position: absolute;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -40%);\r\n width: 100%;\r\n height: 100%;\r\n text-align: center;\r\n color: #999;\r\n font-size: 14px;\r\n font-weight: normal;\r\n line-height: 20px;\r\n overflow: hidden;\r\n border: unset;\r\n }\r\n }\r\n}\r\n</style>"]}, media: undefined });
|
|
1610
2366
|
|
|
1611
2367
|
};
|
|
1612
2368
|
/* scoped */
|
|
1613
|
-
const __vue_scope_id__$C = "data-v-
|
|
2369
|
+
const __vue_scope_id__$C = "data-v-3d0d3edf";
|
|
1614
2370
|
/* module identifier */
|
|
1615
2371
|
const __vue_module_identifier__$C = undefined;
|
|
1616
2372
|
/* functional template */
|
|
@@ -1810,11 +2566,11 @@ __vue_render__$B._withStripped = true;
|
|
|
1810
2566
|
/* style */
|
|
1811
2567
|
const __vue_inject_styles__$B = function (inject) {
|
|
1812
2568
|
if (!inject) return
|
|
1813
|
-
inject("data-v-
|
|
2569
|
+
inject("data-v-252ec372_0", { source: ".g-tree__wrapper[data-v-252ec372] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-252ec372] .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-252ec372] .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"g-tree__wrapper\">\r\n <a-tree\r\n v-if=\"innerTreeData.length\"\r\n :tree-data=\"innerTreeData\"\r\n :checkable=\"checkable\"\r\n @select=\"selectTreeNode\"\r\n @check=\"checkTreeNode\"\r\n :replaceFields=\"replaceFields\"\r\n :default-expanded-keys=\"defaultExpandedKeys\"\r\n :default-selected-keys=\"defaultSelectedKeys\"\r\n :show-line=\"showLine\"\r\n blockNode \r\n :show-icon=\"showIcon\">\r\n <a-icon v-if=\"switcherIcon\" slot=\"switcherIcon\" :type=\"switcherIcon\" />\r\n <template #title=\"props\">\r\n <span :title=\"props[replaceFields.title]\" class=\"tree-node__title\">\r\n {{ props[replaceFields.title] }}\r\n </span>\r\n </template>\r\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\r\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\r\n </template>\r\n </a-tree>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tree',\r\n props: {\r\n treeData: {\r\n type: Array,\r\n default: () => []\r\n },\r\n showLine: {\r\n type: Boolean,\r\n default: false\r\n },\r\n switcherIcon: {\r\n type: String\r\n },\r\n checkable: {\r\n type: Boolean,\r\n default: false\r\n },\r\n replaceFields: {\r\n type: Object,\r\n default: () => ({\r\n title: 'title',\r\n key: 'id',\r\n children: 'children'\r\n })\r\n },\r\n defaultExpandedKeys: {\r\n type: Array\r\n },\r\n defaultSelectedKeys: {\r\n type: Array\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n innerTreeData () {\r\n return this.treeData\r\n }\r\n },\r\n methods: {\r\n checkTreeNode (checkedKeys, e) {\r\n const { checkedNodes } = e\r\n const nodeDatas = checkedNodes.map(item => item.data.props.dataRef)\r\n this.$emit('check', checkedKeys, nodeDatas)\r\n },\r\n refreshTreeStatus (props = {}) {},\r\n selectTreeNode (selectedKeys, e) {\r\n this.$emit('select', selectedKeys, e)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-tree__wrapper {\r\n overflow: hidden;\r\n ::v-deep .ant-tree {\r\n .ant-tree-node-content-wrapper {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n .ant-tree-node-selected {\r\n color: #fff;\r\n }\r\n }\r\n}\r\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
1814
2570
|
|
|
1815
2571
|
};
|
|
1816
2572
|
/* scoped */
|
|
1817
|
-
const __vue_scope_id__$B = "data-v-
|
|
2573
|
+
const __vue_scope_id__$B = "data-v-252ec372";
|
|
1818
2574
|
/* module identifier */
|
|
1819
2575
|
const __vue_module_identifier__$B = undefined;
|
|
1820
2576
|
/* functional template */
|
|
@@ -1840,94 +2596,6 @@ __vue_render__$B._withStripped = true;
|
|
|
1840
2596
|
|
|
1841
2597
|
__vue_component__$B.install = Vue => Vue.component(__vue_component__$B.name, __vue_component__$B);
|
|
1842
2598
|
|
|
1843
|
-
// 创建全局数据池实例
|
|
1844
|
-
const globalDataPool = createDataPool();
|
|
1845
|
-
const useGlobalDataPool = () => globalDataPool;
|
|
1846
|
-
|
|
1847
|
-
/**
|
|
1848
|
-
* Tree Table Model 数据池管理器
|
|
1849
|
-
* 封装所有数据池操作,提供统一的接口
|
|
1850
|
-
*/
|
|
1851
|
-
class TreeTableDataPoolManager {
|
|
1852
|
-
constructor(instanceId) {
|
|
1853
|
-
this.instanceId = instanceId;
|
|
1854
|
-
this.dataPool = useGlobalDataPool();
|
|
1855
|
-
this.unsubscribe = null;
|
|
1856
|
-
this.sharedUnsubscribe = null;
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
/**
|
|
1860
|
-
* 设置当前行数据
|
|
1861
|
-
*/
|
|
1862
|
-
setCurrentRowData(data) {
|
|
1863
|
-
this.dataPool.set(this.instanceId, 'currentRowData', data);
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
/**
|
|
1867
|
-
* 获取当前行数据
|
|
1868
|
-
*/
|
|
1869
|
-
getCurrentRowData() {
|
|
1870
|
-
return this.dataPool.get(this.instanceId, 'currentRowData', {});
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
/**
|
|
1874
|
-
* 设置共享数据(给 modal table 使用)
|
|
1875
|
-
*/
|
|
1876
|
-
setSharedData(data) {
|
|
1877
|
-
if (data && Object.keys(data).length > 0) {
|
|
1878
|
-
this.dataPool.set('sharedTreeTableData', 'parentCurrentRowData', data);
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
/**
|
|
1883
|
-
* 获取共享数据(从父组件获取)
|
|
1884
|
-
*/
|
|
1885
|
-
getSharedData() {
|
|
1886
|
-
return this.dataPool.get('sharedTreeTableData', 'parentCurrentRowData');
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
/**
|
|
1890
|
-
* 订阅当前行数据变化
|
|
1891
|
-
*/
|
|
1892
|
-
subscribe(callback) {
|
|
1893
|
-
this.unsubscribe = this.dataPool.subscribe({
|
|
1894
|
-
ns: this.instanceId,
|
|
1895
|
-
key: 'currentRowData'
|
|
1896
|
-
}, callback);
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
/**
|
|
1900
|
-
* 订阅共享数据变化
|
|
1901
|
-
*/
|
|
1902
|
-
subscribeShared(callback) {
|
|
1903
|
-
this.sharedUnsubscribe = this.dataPool.subscribe({
|
|
1904
|
-
ns: 'sharedTreeTableData',
|
|
1905
|
-
key: 'parentCurrentRowData'
|
|
1906
|
-
}, callback);
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
/**
|
|
1910
|
-
* 清理订阅
|
|
1911
|
-
*/
|
|
1912
|
-
cleanup() {
|
|
1913
|
-
if (this.unsubscribe) {
|
|
1914
|
-
this.unsubscribe();
|
|
1915
|
-
this.unsubscribe = null;
|
|
1916
|
-
}
|
|
1917
|
-
if (this.sharedUnsubscribe) {
|
|
1918
|
-
this.sharedUnsubscribe();
|
|
1919
|
-
this.sharedUnsubscribe = null;
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
/**
|
|
1924
|
-
* 获取数据池实例(用于暴露给外部)
|
|
1925
|
-
*/
|
|
1926
|
-
getDataPool() {
|
|
1927
|
-
return this.dataPool;
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
2599
|
//
|
|
1932
2600
|
var script$A = {
|
|
1933
2601
|
name: 'ele-tree-table-model',
|
|
@@ -2095,8 +2763,8 @@ var script$A = {
|
|
|
2095
2763
|
route: this.$route,
|
|
2096
2764
|
_route: this.$route.query,
|
|
2097
2765
|
_routeMeta: this.$route.meta,
|
|
2098
|
-
dataPool: this.
|
|
2099
|
-
dataPoolManager: this.
|
|
2766
|
+
dataPool: this.model ? this.model.getDataPool() : null,
|
|
2767
|
+
dataPoolManager: this.model || null
|
|
2100
2768
|
};
|
|
2101
2769
|
},
|
|
2102
2770
|
overrideTableEvent() {
|
|
@@ -2334,21 +3002,35 @@ var script$A = {
|
|
|
2334
3002
|
}
|
|
2335
3003
|
},
|
|
2336
3004
|
async created() {
|
|
2337
|
-
//
|
|
2338
|
-
|
|
2339
|
-
|
|
3005
|
+
// 确保全局数据池已初始化
|
|
3006
|
+
if (!window.__idooel_data_pool__) {
|
|
3007
|
+
console.error('Global data pool not initialized. Please check if runtime-context/globalDataPool.js is properly imported.');
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
// 初始化数据池管理器(使用新的 runtime-context)
|
|
3012
|
+
try {
|
|
3013
|
+
this.model = createTreeTableModel('treeTableModel');
|
|
3014
|
+
if (!this.model) {
|
|
3015
|
+
throw new Error('Failed to create tree table model');
|
|
3016
|
+
}
|
|
3017
|
+
} catch (error) {
|
|
3018
|
+
console.error('Error creating tree table model:', error);
|
|
3019
|
+
this.model = null;
|
|
3020
|
+
return;
|
|
3021
|
+
}
|
|
2340
3022
|
|
|
2341
3023
|
// 初始化 currentRowData(尝试从共享命名空间获取)
|
|
2342
3024
|
this.initializeCurrentRowData();
|
|
2343
3025
|
|
|
2344
3026
|
// 订阅数据池变化
|
|
2345
|
-
this.
|
|
3027
|
+
this.unsubscribe = this.model.subscribe('currentRowData', event => {
|
|
2346
3028
|
this.currentRowData = event.value || {};
|
|
2347
3029
|
this.$forceUpdate();
|
|
2348
3030
|
});
|
|
2349
3031
|
|
|
2350
3032
|
// 订阅共享数据变化
|
|
2351
|
-
this.
|
|
3033
|
+
this.unsubscribeShared = this.model.subscribeShared(event => {
|
|
2352
3034
|
// 当有新的共享数据时,更新当前组件的 currentRowData
|
|
2353
3035
|
if (event.value && Object.keys(event.value).length > 0) {
|
|
2354
3036
|
this.setCurrentRowData(event.value);
|
|
@@ -2383,8 +3065,13 @@ var script$A = {
|
|
|
2383
3065
|
},
|
|
2384
3066
|
methods: {
|
|
2385
3067
|
initializeCurrentRowData() {
|
|
3068
|
+
if (!this.model) {
|
|
3069
|
+
console.warn('Model not initialized, skipping currentRowData initialization');
|
|
3070
|
+
return;
|
|
3071
|
+
}
|
|
3072
|
+
|
|
2386
3073
|
// 检查是否有来自父组件的共享数据(比如 modal table 场景)
|
|
2387
|
-
const parentData = this.
|
|
3074
|
+
const parentData = this.model.getSharedData();
|
|
2388
3075
|
if (parentData && Object.keys(parentData).length > 0) {
|
|
2389
3076
|
this.setCurrentRowData(parentData);
|
|
2390
3077
|
return;
|
|
@@ -2469,10 +3156,18 @@ var script$A = {
|
|
|
2469
3156
|
},
|
|
2470
3157
|
setCurrentRowData(props = {}) {
|
|
2471
3158
|
this.currentRowData = props;
|
|
2472
|
-
this.
|
|
3159
|
+
if (this.model) {
|
|
3160
|
+
this.model.setCurrentRowData(props);
|
|
3161
|
+
} else {
|
|
3162
|
+
console.warn('Model not initialized, cannot setCurrentRowData in model');
|
|
3163
|
+
}
|
|
2473
3164
|
},
|
|
2474
3165
|
getCurrentRowData() {
|
|
2475
|
-
|
|
3166
|
+
if (this.model) {
|
|
3167
|
+
return this.model.getCurrentRowData();
|
|
3168
|
+
}
|
|
3169
|
+
console.warn('Model not initialized, getCurrentRowData returning local data');
|
|
3170
|
+
return this.currentRowData || {};
|
|
2476
3171
|
},
|
|
2477
3172
|
cleanCurrentModelEffect(clearRowData = true) {
|
|
2478
3173
|
this.setCurrentTableSelection();
|
|
@@ -2508,7 +3203,11 @@ var script$A = {
|
|
|
2508
3203
|
showModalTable(modeMeta = {}, record = null) {
|
|
2509
3204
|
// 获取当前行数据并设置到共享命名空间
|
|
2510
3205
|
const currentRowData = record || this.getCurrentRowData();
|
|
2511
|
-
this.
|
|
3206
|
+
if (this.model) {
|
|
3207
|
+
this.model.setSharedData(currentRowData);
|
|
3208
|
+
} else {
|
|
3209
|
+
console.warn('Model not initialized, cannot setSharedData');
|
|
3210
|
+
}
|
|
2512
3211
|
let targetMeta = modeMeta;
|
|
2513
3212
|
if (type.isStr(modeMeta)) {
|
|
2514
3213
|
targetMeta = this.findMetaByKey(modeMeta);
|
|
@@ -2699,8 +3398,18 @@ var script$A = {
|
|
|
2699
3398
|
},
|
|
2700
3399
|
destroyed() {
|
|
2701
3400
|
this.resizeObserverModelTableWrapper.disconnect();
|
|
2702
|
-
if (this.
|
|
2703
|
-
|
|
3401
|
+
if (this.model) {
|
|
3402
|
+
// 清理订阅
|
|
3403
|
+
if (this.unsubscribe) {
|
|
3404
|
+
this.unsubscribe();
|
|
3405
|
+
}
|
|
3406
|
+
if (this.unsubscribeShared) {
|
|
3407
|
+
this.unsubscribeShared();
|
|
3408
|
+
}
|
|
3409
|
+
// 清理模型数据
|
|
3410
|
+
if (this.model) {
|
|
3411
|
+
this.model.cleanup();
|
|
3412
|
+
}
|
|
2704
3413
|
}
|
|
2705
3414
|
}
|
|
2706
3415
|
};
|
|
@@ -2895,11 +3604,11 @@ __vue_render__$A._withStripped = true;
|
|
|
2895
3604
|
/* style */
|
|
2896
3605
|
const __vue_inject_styles__$A = function (inject) {
|
|
2897
3606
|
if (!inject) return
|
|
2898
|
-
inject("data-v-911a32f4_0", { source: ".ele.model__tree-table[data-v-911a32f4] {\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-911a32f4] {\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-911a32f4] {\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-911a32f4] {\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-911a32f4] {\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-911a32f4] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-911a32f4] {\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-911a32f4] {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/OnlineStudy/base-elearning-frontend-model/packages/components/packages/models/tree-table-model/src/index.vue","index.vue"],"names":[],"mappings":"AA+rBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC9rBA;ADgsBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC9rBA;ADisBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AC/rBA;ADisBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;AC/rBA;ADisBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;AC/rBA;ADksBA;EACA,gBAAA;AChsBA;ADisBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;AC/rBA;ADksBA;EACA,eAAA;EACA,kCAAA;AChsBA;;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 } from '@idooel/shared'\nimport { v4 as uuidv4 } from 'uuid'\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, BUILT_IN_TRIGGER, CONTEXT } from '../../../utils'\nimport { TreeTableDataPoolManager } from '../../../utils/treeTableDataPoolManager'\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 dataPoolManager: null\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.getCurrentRowData(),\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 dataPool: this.dataPoolManager.getDataPool(),\n dataPoolManager: this.dataPoolManager\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 // 初始化数据池管理器\n const instanceId = `treeTableModel_${uuidv4()}`\n this.dataPoolManager = new TreeTableDataPoolManager(instanceId)\n \n // 初始化 currentRowData(尝试从共享命名空间获取)\n this.initializeCurrentRowData()\n \n // 订阅数据池变化\n this.dataPoolManager.subscribe((event) => {\n this.currentRowData = event.value || {}\n this.$forceUpdate()\n })\n \n // 订阅共享数据变化\n this.dataPoolManager.subscribeShared((event) => {\n // 当有新的共享数据时,更新当前组件的 currentRowData\n if (event.value && Object.keys(event.value).length > 0) {\n this.setCurrentRowData(event.value)\n }\n })\n \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 \n const { params = {}, fieldMap = {}, overrideInit = false } = this.tableMeta\n const currentRowData = this.getCurrentRowData()\n const ctx = { \n ...this.currentTreeNodeData, \n _route: this.$route.query, \n currentRowData: currentRowData\n }\n \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 initializeCurrentRowData () {\n // 检查是否有来自父组件的共享数据(比如 modal table 场景)\n const parentData = this.dataPoolManager.getSharedData()\n \n if (parentData && Object.keys(parentData).length > 0) {\n this.setCurrentRowData(parentData)\n return\n }\n \n // 可以根据路由参数、props 或其他来源设置初始的 currentRowData\n const { query } = this.$route\n \n // 示例:如果路由中有特定参数,可以设置为 currentRowData\n if (query.rowId || query.selectedId) {\n // 这里可以根据实际需求从服务端或其他地方获取数据\n // const presetData = { id: query.rowId, /* 其他字段 */ }\n // this.setCurrentRowData(presetData)\n }\n \n // 目前保持空对象,等待用户选择行数据\n },\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 // 将当前行的 record 数据传递给 modal table\n this.showModalTable(modeMeta, record)\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 this.dataPoolManager.setCurrentRowData(props)\n },\n getCurrentRowData () {\n return this.dataPoolManager.getCurrentRowData()\n },\n cleanCurrentModelEffect (clearRowData = true) {\n this.setCurrentTableSelection()\n if (clearRowData) {\n this.setCurrentRowData({})\n }\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.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 = {}, record = null) {\n // 获取当前行数据并设置到共享命名空间\n const currentRowData = record || this.getCurrentRowData()\n this.dataPoolManager.setSharedData(currentRowData)\n \n let targetMeta = modeMeta\n if (type.isStr(modeMeta)) {\n targetMeta = this.findMetaByKey(modeMeta)\n }\n \n // 解析 fieldMap 参数,使用完整的上下文包括 currentRowData\n if (targetMeta && targetMeta.fieldMap) {\n const { fieldMap, params = {} } = targetMeta\n \n const ctx = { \n ...this.currentTreeNodeData, \n _route: this.$route.query, \n ...currentRowData \n }\n const parsedParams = parseFieldMap(fieldMap, ctx)\n \n // 将当前的 currentRowData 传递给 modal table,通过 params\n targetMeta = {\n ...targetMeta,\n params: {\n ...params,\n ...parsedParams\n }\n }\n }\n \n this.modalTableMeta = targetMeta\n this.modalTableValue = true\n },\n closeModalForm () {\n this.modalFormValue = false\n },\n closeModalTable () {\n this.modalTableValue = false\n },\n findMetaByKey (key) {\n return this.$attrs[key] || {}\n },\n handleClickButtonGroup (props) {\n const { eventName, target } = props\n const targetMeta = this.findMetaByKey(target)\n const { mode } = targetMeta\n mode && this.dispatchTrigger({ mode, modeMeta: targetMeta })\n this.$emit(eventName || 'click', { currentTreeNode: this.currentTreeNodeData })\n },\n 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(false) // 不清空 currentRowData,除非明确需要\n this.tableData = ret\n return ret\n },\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 if (this.dataPoolManager) {\n this.dataPoolManager.cleanup()\n }\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 });
|
|
3607
|
+
inject("data-v-0f7afe7a_0", { source: ".ele.model__tree-table[data-v-0f7afe7a] {\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-0f7afe7a] {\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-0f7afe7a] {\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-0f7afe7a] {\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-0f7afe7a] {\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-0f7afe7a] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-0f7afe7a] {\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-0f7afe7a] {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\models\\tree-table-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyuBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;ACxuBA;AD0uBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;ACxuBA;AD2uBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;ACzuBA;AD2uBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;ACzuBA;AD2uBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;ACzuBA;AD4uBA;EACA,gBAAA;AC1uBA;AD2uBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;ACzuBA;AD4uBA;EACA,eAAA;EACA,kCAAA;AC1uBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"ele model__tree-table\">\r\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\r\n <div class=\"model__tree--title\"></div>\r\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\" :style=\"{height: `${treeWrapperHeight}px`}\">\r\n <ele-tree\r\n :tree-data=\"treeData\"\r\n :defaultExpandedKeys=\"defaultExpandedKeys\"\r\n :defaultSelectedKeys=\"defaultSelectedKeys\"\r\n @select=\"selectTreeNode\"\r\n :replace-fields=\"mapFields\">\r\n </ele-tree>\r\n </section>\r\n </section>\r\n <section class=\"model__table--container\" :ref=\"modelTableContainerRef\">\r\n <div class=\"model__table--title\" v-if=\"title\">\r\n <template v-if=\"titleMode\">\r\n <div :class=\"[`model__table-title--${titleMode}`]\"></div>\r\n </template>\r\n <template v-else>\r\n <div class=\"model__table-title--text\">{{ title }}</div>\r\n </template>\r\n </div>\r\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\r\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\r\n <div class=\"button-row__area\">\r\n <ele-button-group class=\"model-table__button-group\" v-on=\"overrideButtonGroupEvent\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" :data-source=\"getButtonGroupElements\"></ele-button-group>\r\n <slot name=\"tags\"></slot>\r\n <slot v-if=\"$slots['sub-center']\" name=\"sub-center\"></slot>\r\n </div>\r\n <ele-table\r\n v-on=\"overrideTableEvent\"\r\n :ref=\"tableRef\"\r\n :row-selection=\"rowSelection\"\r\n :loading=\"loading\" \r\n :columns=\"columns\"\r\n :total=\"total\"\r\n :x=\"x\"\r\n :y=\"y\"\r\n :bordered=\"setBorder\"\r\n :height=\"tableHeight\"\r\n :width=\"tableWidth\"\r\n :actions=\"actions\"\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n :data-source=\"tableData\"\r\n @change-page=\"onChangePage\"\r\n ></ele-table>\r\n </section>\r\n </section>\r\n <ele-modal-form v-model=\"modalFormValue\" v-on=\"overrideModalFormEvent\" :meta=\"modalFormMeta\"></ele-modal-form>\r\n <ele-modal-fsm v-model=\"showFsmModal\" :contextProp=\"fsmContextProp\" :meta=\"fsmMeta\" @cancel=\"handleCloseFsmModal\"></ele-modal-fsm>\r\n <ele-modal-table\r\n :meta=\"modalTableMeta\"\r\n v-model=\"modalTableValue\"\r\n v-on=\"overrideModalTableEvent\"\r\n ></ele-modal-table>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nimport { type, net } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, BUILT_IN_TRIGGER, CONTEXT } from '../../../utils'\r\nimport { createTreeTableModel } from '../../../utils/runtime-context'\r\nexport default {\r\n name: 'ele-tree-table-model',\r\n props: {\r\n title: {\r\n type: [Object, String]\r\n },\r\n overHeight: {\r\n type: Number,\r\n default: 0\r\n },\r\n treeMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n searchMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n typeof: Object,\r\n default: () => ({})\r\n },\r\n tableMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n createMeta: {\r\n type: Object\r\n },\r\n editMeta: {\r\n type: Object\r\n }\r\n },\r\n provide () {\r\n return {\r\n requestTreeData: this.requestTreeData,\r\n requestTableData: this.requestTableData,\r\n [CONTEXT]: () => {\r\n return {\r\n exposed: this.exposed\r\n }\r\n }\r\n }\r\n },\r\n data () {\r\n return {\r\n tableHeight: 0,\r\n tableWidth: 0,\r\n modalFormMeta: {},\r\n modalFormValue: false,\r\n treeData: [],\r\n tableData: [],\r\n defaultExpandedKeys: [],\r\n defaultSelectedKeys: [],\r\n replaceFields: {\r\n title: 'title',\r\n children: 'children',\r\n key: 'id'\r\n },\r\n loading: false,\r\n total: 0,\r\n tableQuerys: {},\r\n resizeObserverModelTableWrapper: null,\r\n modelTableWrapperHeight: 0,\r\n currentTreeNodeData: {},\r\n currentRowData: {},\r\n treeWrapperHeight: 0,\r\n currentTableSelection: this.currentTableMode == 'radio' ? {} : [],\r\n showFsmModal: false,\r\n fsmMeta: {},\r\n fsmContextProp: {},\r\n modalTableValue: false,\r\n modalTableMeta: {},\r\n dataPoolManager: null\r\n }\r\n },\r\n computed: {\r\n setBorder () {\r\n return this.tableMeta.bordered === false ? false : true\r\n },\r\n rowSelection () {\r\n if (!this.currentTableMode) return void 0\r\n return {\r\n columnTitle: this.currentSelectionColumn.columnTitle,\r\n fixed: true,\r\n type: this.currentTableMode,\r\n onChange: this.onChangeTableSelection\r\n }\r\n },\r\n currentSelectionColumn () {\r\n const { multiple } = this.tableMeta\r\n const target = this.columns.find(item => Object.keys(item).includes('multiple'))\r\n const isGlobalExistMultiple = Object.keys(this.tableMeta).includes('multiple')\r\n if (target) {\r\n return target\r\n } else if (isGlobalExistMultiple) {\r\n return { multiple }\r\n }\r\n return void 0\r\n },\r\n x () {\r\n const { x } = this.tableMeta\r\n return x\r\n },\r\n y () {\r\n const { y } = this.tableMeta\r\n return y\r\n },\r\n currentTableMode () {\r\n if (!this.currentSelectionColumn) return void 0\r\n const { multiple } = this.currentSelectionColumn\r\n if (type.isBool(multiple)) {\r\n if (multiple) {\r\n return 'checkbox'\r\n } else {\r\n return 'radio'\r\n }\r\n } else {\r\n return void 0\r\n }\r\n },\r\n modelTableContainerRef () {\r\n return uuidv4()\r\n },\r\n titleMode () {\r\n if (type.isObject(this.title)) {\r\n const { mode = '' } = this.title\r\n return mode\r\n }\r\n return void 0\r\n },\r\n tableRef () {\r\n return uuidv4()\r\n },\r\n exposed () {\r\n return {\r\n showModalForm: this.showModalForm,\r\n closeModalForm: this.closeModalForm,\r\n showModalTable: this.showModalTable,\r\n closeModalTable: this.closeModalTable,\r\n currentTableSelection: this.currentTableSelection,\r\n currentTreeNode: this.currentTreeNodeData,\r\n requestTableData: this.requestTableData,\r\n refreshTreeData: this.refreshTreeData,\r\n querys: this.tableQuerys,\r\n currentRowData: this.getCurrentRowData(),\r\n getCurrentRowData: this.getCurrentRowData,\r\n setCurrentRowData: this.setCurrentRowData,\r\n setCurrentTableSelection: this.setCurrentTableSelection,\r\n getCurrentTableSelection: this.getCurrentTableSelection,\r\n cleanCurrentModelEffect: this.cleanCurrentModelEffect,\r\n route: this.$route,\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n dataPool: this.model ? this.model.getDataPool() : null,\r\n dataPoolManager: this.model || null\r\n }\r\n },\r\n overrideTableEvent () {\r\n const events = this.actions.reduce((ret, action) => {\r\n ret[action.eventName || action.key] = (e) => {\r\n this.setCurrentRowData(e.exposed.currentRowData)\r\n const { target } = action\r\n const targetMeta = this.findMetaByKey(target)\r\n const { mode } = targetMeta\r\n mode && this.dispatchTrigger({ mode, record: e.exposed.currentRowData, modeMeta: targetMeta })\r\n this.$emit(action.eventName || action.key, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: { ...this.exposed, ...e.exposed } })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.EDIT]: this[BUILT_IN_EVENT_NAMES.EDIT],\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\r\n }\r\n },\r\n overrideModalFormEvent () {\r\n const { footerMeta } = this.modalFormMeta\r\n const { elements = [] } = footerMeta || {}\r\n const eles = type.isFunction(elements) ? elements.call(this) : elements\r\n const events = eles.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e = {}) => {\r\n if (ele.eventName === 'cancel') {\r\n this.closeModalForm()\r\n } else {\r\n const { exposed = {} } = e\r\n this.$emit(`${ele.eventName || ele.key}`, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed )})\r\n }\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...events\r\n }\r\n },\r\n overrideModalTableEvent () {\r\n const { footerMeta } = this.modalTableMeta\r\n const { elements = [] } = footerMeta || {}\r\n const eles = type.isFunction(elements) ? elements.call(this) : elements\r\n const events = eles.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e = {}) => {\r\n if (ele.eventName === 'cancel') {\r\n this.closeModalTable()\r\n } else {\r\n const { exposed = {} } = e\r\n this.$emit(`${ele.eventName || ele.key}`, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed )})\r\n }\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...events,\r\n exposed: this.exposed\r\n }\r\n },\r\n overrideButtonGroupEvent () {\r\n const events = this.getButtonGroupElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, e.exposed || {}, this.exposed)})\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.CREATE]: this[BUILT_IN_EVENT_NAMES.CREATE],\r\n exposed: this.exposed\r\n }\r\n },\r\n showTree () {\r\n return !!Object.keys(this.treeMeta).length\r\n },\r\n buttonGroup () {\r\n return uuidv4()\r\n },\r\n searchArea () {\r\n return uuidv4()\r\n },\r\n modelTreeWrapper () {\r\n return uuidv4()\r\n },\r\n modelTableWrapper () {\r\n return uuidv4()\r\n },\r\n actions () {\r\n const { operations } = this.tableMeta\r\n if (operations) {\r\n return operations.elements\r\n } else {\r\n return []\r\n }\r\n },\r\n pageSize () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSize || 10\r\n },\r\n pageSizeOptions () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSizeOptions || ['10', '20', '30', '40']\r\n },\r\n columns () {\r\n const { columns, operations } = this.tableMeta\r\n if (type.get(columns) === 'array') {\r\n const columnsOptions = columns.map(item => {\r\n const { mode = 'text' } = item\r\n if (item.render) {\r\n return {\r\n ...item,\r\n customRender: (text, record, index) => {\r\n const { $createElement } = this\r\n return item.render.call(this, \r\n { h: $createElement, ctx: this },\r\n text ? typeof text == 'object' ? text[item.dataIndex] : text : '', \r\n record, index)\r\n }\r\n }\r\n } else if (mode !== BUILT_IN_TRIGGER.TEXT) {\r\n const { [`${mode}Meta`]: modeMeta } = item\r\n return {\r\n ...item,\r\n customRender: (text, record, index) => {\r\n return <span onClick={() => this.dispatchTrigger({ mode, record, modeMeta, index })} class={ mode }>{ text }</span>\r\n }\r\n }\r\n }\r\n return {\r\n ...item\r\n }\r\n })\r\n if (operations) {\r\n return [\r\n ...columnsOptions,\r\n {\r\n title: '操作',\r\n width: operations.width,\r\n key: 'action',\r\n fixed: 'right',\r\n scopedSlots: { customRender: 'action' }\r\n }\r\n ]\r\n }\r\n return columnsOptions\r\n } else {\r\n console.error('Error: columns is invalid, please check it')\r\n return []\r\n }\r\n },\r\n getButtonGroupElements () {\r\n const { elements } = this.buttonGroupMeta\r\n if (type.get(elements) === 'function') {\r\n return elements.call(this)\r\n } else if (type.get(elements) === 'array') {\r\n return elements\r\n } else {\r\n return []\r\n }\r\n },\r\n mapFields () {\r\n const { replaceFields = {} } = this.treeMeta\r\n const mapFields = type.isEmpty(replaceFields) ? this.replaceFields : replaceFields\r\n return mapFields\r\n }\r\n },\r\n async created () {\r\n // 确保全局数据池已初始化\r\n if (!window.__idooel_data_pool__) {\r\n console.error('Global data pool not initialized. Please check if runtime-context/globalDataPool.js is properly imported.')\r\n return\r\n }\r\n \r\n // 初始化数据池管理器(使用新的 runtime-context)\r\n try {\r\n this.model = createTreeTableModel('treeTableModel')\r\n \r\n if (!this.model) {\r\n throw new Error('Failed to create tree table model')\r\n }\r\n } catch (error) {\r\n console.error('Error creating tree table model:', error)\r\n this.model = null\r\n return\r\n }\r\n \r\n // 初始化 currentRowData(尝试从共享命名空间获取)\r\n this.initializeCurrentRowData()\r\n \r\n // 订阅数据池变化\r\n this.unsubscribe = this.model.subscribe('currentRowData', (event) => {\r\n this.currentRowData = event.value || {}\r\n this.$forceUpdate()\r\n })\r\n \r\n // 订阅共享数据变化\r\n this.unsubscribeShared = this.model.subscribeShared((event) => {\r\n // 当有新的共享数据时,更新当前组件的 currentRowData\r\n if (event.value && Object.keys(event.value).length > 0) {\r\n this.setCurrentRowData(event.value)\r\n }\r\n })\r\n \r\n if (this.showTree) {\r\n this.treeData = await this.requestTreeData()\r\n const [defaultTreeNode = {}] = this.treeData\r\n this.defaultExpandedKeys = [defaultTreeNode[this.mapFields.key]]\r\n this.defaultSelectedKeys = [defaultTreeNode[this.mapFields.key]]\r\n this.currentTreeNodeData = defaultTreeNode\r\n }\r\n \r\n const { params = {}, fieldMap = {}, overrideInit = false } = this.tableMeta\r\n const currentRowData = this.getCurrentRowData()\r\n const ctx = { \r\n ...this.currentTreeNodeData, \r\n _route: this.$route.query, \r\n currentRowData: currentRowData\r\n }\r\n \r\n const initQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx))\r\n if (overrideInit) {\r\n this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })\r\n } else {\r\n this.tableData = await this.requestTableData(initQuerys)\r\n }\r\n },\r\n methods: {\r\n initializeCurrentRowData () {\r\n if (!this.model) {\r\n console.warn('Model not initialized, skipping currentRowData initialization')\r\n return\r\n }\r\n \r\n // 检查是否有来自父组件的共享数据(比如 modal table 场景)\r\n const parentData = this.model.getSharedData()\r\n \r\n if (parentData && Object.keys(parentData).length > 0) {\r\n this.setCurrentRowData(parentData)\r\n return\r\n }\r\n \r\n // 可以根据路由参数、props 或其他来源设置初始的 currentRowData\r\n const { query } = this.$route\r\n \r\n // 示例:如果路由中有特定参数,可以设置为 currentRowData\r\n if (query.rowId || query.selectedId) {\r\n // 这里可以根据实际需求从服务端或其他地方获取数据\r\n // const presetData = { id: query.rowId, /* 其他字段 */ }\r\n // this.setCurrentRowData(presetData)\r\n }\r\n \r\n // 目前保持空对象,等待用户选择行数据\r\n },\r\n async refreshTreeData () {\r\n this.treeData = await this.requestTreeData()\r\n const [defaultTreeNode = {}] = this.treeData\r\n this.defaultExpandedKeys = [defaultTreeNode[this.mapFields.key]]\r\n this.defaultSelectedKeys = [defaultTreeNode[this.mapFields.key]]\r\n this.currentTreeNodeData = defaultTreeNode\r\n },\r\n dispatchTrigger ({ mode, record = {}, modeMeta = { } }) {\r\n switch (mode) {\r\n case BUILT_IN_TRIGGER.FSM:\r\n this[`${BUILT_IN_TRIGGER.FSM}Trigger`](record, modeMeta = type.isEmpty(modeMeta) ? { \r\n url: 'api-fsm/workbench/fsm/auditFlow',\r\n requestType: 'GET',\r\n fieldMap: {\r\n modelCode: 'modelCode',\r\n businessId: 'businessId'\r\n }\r\n } : modeMeta)\r\n break\r\n case BUILT_IN_TRIGGER.ELE_MODAL_FORM:\r\n this.modalFormMeta = modeMeta\r\n this.showModalForm(modeMeta)\r\n break\r\n case BUILT_IN_TRIGGER.ELE_MODAL_TABLE:\r\n this.modalTableMeta = modeMeta\r\n // 将当前行的 record 数据传递给 modal table\r\n this.showModalTable(modeMeta, record)\r\n break\r\n default:\r\n break\r\n }\r\n },\r\n handleCloseFsmModal () {\r\n this.showFsmModal = false\r\n },\r\n [`${BUILT_IN_TRIGGER.FSM}Trigger`] (record, meta) {\r\n this.fsmMeta = meta\r\n this.fsmContextProp = record\r\n this.showFsmModal = true\r\n },\r\n onChangeTableSelection (_, selectedRows = []) {\r\n if (this.currentTableMode === 'radio') {\r\n this.setCurrentTableSelection(selectedRows)\r\n this.$emit('on-change-table-selection', this.currentTableSelection)\r\n this.$emit('x:refresh-exposed', { exposed: this.exposed })\r\n } else {\r\n this.setCurrentTableSelection(selectedRows)\r\n this.$emit('on-change-table-selection', this.currentTableSelection)\r\n this.$emit('x:refresh-exposed', { exposed: this.exposed })\r\n }\r\n },\r\n setCurrentTableSelection (props = {}) {\r\n if (this.currentTableMode === 'radio') {\r\n this.$set(this, 'currentTableSelection', (type.isArray(props) && props.length > 0) ? props[0] : type.isObject(props) ? props : {})\r\n } else {\r\n this.$set(this, 'currentTableSelection', type.isArray(props) ? props : [])\r\n }\r\n },\r\n getCurrentTableSelection () {\r\n return this.currentTableSelection\r\n },\r\n setCurrentRowData (props = {}) {\r\n this.currentRowData = props\r\n if (this.model) {\r\n this.model.setCurrentRowData(props)\r\n } else {\r\n console.warn('Model not initialized, cannot setCurrentRowData in model')\r\n }\r\n },\r\n getCurrentRowData () {\r\n if (this.model) {\r\n return this.model.getCurrentRowData()\r\n }\r\n console.warn('Model not initialized, getCurrentRowData returning local data')\r\n return this.currentRowData || {}\r\n },\r\n cleanCurrentModelEffect (clearRowData = true) {\r\n this.setCurrentTableSelection()\r\n if (clearRowData) {\r\n this.setCurrentRowData({})\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\r\n this.cleanCurrentModelEffect()\r\n this.requestTableData()\r\n },\r\n [BUILT_IN_EVENT_NAMES.EDIT] (props = {}) {\r\n const { record = {} } = props\r\n this.setCurrentRowData(record)\r\n this.modalFormMeta = this.editMeta\r\n this.modalFormValue = true\r\n },\r\n [BUILT_IN_EVENT_NAMES.CREATE] () {\r\n this.modalFormMeta = this.createMeta\r\n this.modalFormValue = true\r\n },\r\n showModalForm (modeMeta = {}) {\r\n if (type.isStr(modeMeta)) {\r\n const targetMeta = this.findMetaByKey(modeMeta)\r\n this.modalFormMeta = targetMeta\r\n } else {\r\n this.modalFormMeta = modeMeta\r\n }\r\n this.modalFormValue = true\r\n },\r\n showModalTable (modeMeta = {}, record = null) {\r\n // 获取当前行数据并设置到共享命名空间\r\n const currentRowData = record || this.getCurrentRowData()\r\n if (this.model) {\r\n this.model.setSharedData(currentRowData)\r\n } else {\r\n console.warn('Model not initialized, cannot setSharedData')\r\n }\r\n \r\n let targetMeta = modeMeta\r\n if (type.isStr(modeMeta)) {\r\n targetMeta = this.findMetaByKey(modeMeta)\r\n }\r\n \r\n // 解析 fieldMap 参数,使用完整的上下文包括 currentRowData\r\n if (targetMeta && targetMeta.fieldMap) {\r\n const { fieldMap, params = {} } = targetMeta\r\n \r\n const ctx = { \r\n ...this.currentTreeNodeData, \r\n _route: this.$route.query, \r\n ...currentRowData \r\n }\r\n const parsedParams = parseFieldMap(fieldMap, ctx)\r\n \r\n // 将当前的 currentRowData 传递给 modal table,通过 params\r\n targetMeta = {\r\n ...targetMeta,\r\n params: {\r\n ...params,\r\n ...parsedParams\r\n }\r\n }\r\n }\r\n \r\n this.modalTableMeta = targetMeta\r\n this.modalTableValue = true\r\n },\r\n closeModalForm () {\r\n this.modalFormValue = false\r\n },\r\n closeModalTable () {\r\n this.modalTableValue = false\r\n },\r\n findMetaByKey (key) {\r\n return this.$attrs[key] || {}\r\n },\r\n handleClickButtonGroup (props) {\r\n const { eventName, target } = props\r\n const targetMeta = this.findMetaByKey(target)\r\n const { mode } = targetMeta\r\n mode && this.dispatchTrigger({ mode, modeMeta: targetMeta })\r\n this.$emit(eventName || 'click', { currentTreeNode: this.currentTreeNodeData })\r\n },\r\n async onSearch (props) {\r\n const { overrideInit = false } = this.tableMeta\r\n this.tableQuerys = Object.assign(this.tableQuerys, props)\r\n if (overrideInit) {\r\n this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })\r\n } else {\r\n this.tableData = await this.requestTableData()\r\n }\r\n },\r\n async selectTreeNode (selectedKeys, e) {\r\n const { fieldMap } = this.tableMeta\r\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef || {}\r\n //@deprecated '_' namespace is deprecated, please use 'exposed' instead\r\n const execFieldMapRet = parseFieldMap(fieldMap, { ...this.currentTreeNodeData, exposed: this.exposed, _route: this.exposed._route })\r\n const { overrideInit = false } = this.tableMeta\r\n if (overrideInit) {\r\n this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })\r\n } else {\r\n this.tableData = await this.requestTableData(execFieldMapRet)\r\n }\r\n },\r\n async requestTreeData () {\r\n const { url, requestType = 'GET', params = {}, fieldMap = {} } = this.treeMeta\r\n const fieldMapRet = parseFieldMap(fieldMap, { ...this.currentTreeNodeData, _route: this.$route.query })\r\n const ret = await net[requestType.toLowerCase()](\r\n url,\r\n { ...params, ...fieldMapRet }\r\n ).then(resp => {\r\n const { data } = resp || {}\r\n return data\r\n })\r\n return ret\r\n },\r\n async onChangePage (page, pageSize) {\r\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\r\n },\r\n async requestTableData (props = {}) {\r\n const { url, requestType = 'GET', page = {} } = this.tableMeta\r\n const { pageSize = 10 } = page\r\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\r\n this.$emit(RESERVE_EVENT_NAMES.WATCH, { ...this.exposed })\r\n this.loading = true\r\n const ret = await net[requestType.toLowerCase()](\r\n url,\r\n this.tableQuerys\r\n ).then(resp => {\r\n const { data = [], count } = resp || {}\r\n this.total = count\r\n this.loading = false\r\n return (data || []).map(item => {\r\n delete item.children\r\n return {\r\n key: uuidv4(),\r\n ...item\r\n }\r\n })\r\n })\r\n this.cleanCurrentModelEffect(false) // 不清空 currentRowData,除非明确需要\r\n this.tableData = ret\r\n return ret\r\n },\r\n calculateTableHeight () {\r\n const currentViewportHeight = window.innerHeight\r\n const tableRef = this.$refs[this.tableRef]\r\n const { top: tableToTop, width } = tableRef.$el.getBoundingClientRect()\r\n this.tableWidth = width\r\n this.tableHeight = currentViewportHeight - tableToTop - this.overHeight\r\n },\r\n calculateTreeHeight () {\r\n if (!this.showTree) return\r\n const modelTableContainerRef = this.$refs[this.modelTableContainerRef]\r\n const { height } = modelTableContainerRef.getBoundingClientRect()\r\n this.treeWrapperHeight = height\r\n }\r\n },\r\n mounted () {\r\n this.calculateTableHeight()\r\n this.$nextTick(() => {\r\n this.calculateTreeHeight()\r\n })\r\n this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\r\n for (const _ of entries) {\r\n requestAnimationFrame(() => {\r\n this.calculateTableHeight()\r\n })\r\n }\r\n })\r\n this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\r\n },\r\n destroyed () {\r\n this.resizeObserverModelTableWrapper.disconnect()\r\n if (this.model) {\r\n // 清理订阅\r\n if (this.unsubscribe) {\r\n this.unsubscribe()\r\n }\r\n if (this.unsubscribeShared) {\r\n this.unsubscribeShared()\r\n }\r\n // 清理模型数据\r\n if (this.model) {\r\n this.model.cleanup()\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele {\r\n &.model__tree-table {\r\n background: transparent; \r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n .model__tree-table--container {\r\n .model__tree--wrapper {\r\n width: 240px;\r\n background: #fff;\r\n flex-shrink: 0;\r\n padding: 16px;\r\n box-sizing: border-box;\r\n margin-right: 16px;\r\n overflow-y: auto;\r\n }\r\n }\r\n .model__table--container {\r\n width: 100%;\r\n min-width: 0;\r\n background: #fff;\r\n .model__table--title {\r\n .model__table-title--bar {\r\n width: 100%;\r\n height: 8px;\r\n background: var(--idooel-primary-color);\r\n border-top-left-radius: 4px;\r\n border-top-right-radius: 4px;\r\n }\r\n .model__table-title--text {\r\n text-align: left;\r\n padding: 16px;\r\n font-size: 16px;\r\n font-weight: bold;\r\n background: #fff;\r\n border-bottom: 1px solid;\r\n border-color: var(--idoole-black-016);\r\n }\r\n }\r\n .model__table--wrapper {\r\n background: #fff;\r\n .button-row__area {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n padding-top: 16px;\r\n padding-bottom: 8px;\r\n padding-right: 16px;\r\n }\r\n .g-table__wrapper {\r\n .fsm {\r\n cursor: pointer;\r\n color: var(--idooel-primary-color);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\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 });
|
|
2899
3608
|
|
|
2900
3609
|
};
|
|
2901
3610
|
/* scoped */
|
|
2902
|
-
const __vue_scope_id__$A = "data-v-
|
|
3611
|
+
const __vue_scope_id__$A = "data-v-0f7afe7a";
|
|
2903
3612
|
/* module identifier */
|
|
2904
3613
|
const __vue_module_identifier__$A = undefined;
|
|
2905
3614
|
/* functional template */
|
|
@@ -3315,11 +4024,11 @@ __vue_render__$z._withStripped = true;
|
|
|
3315
4024
|
/* style */
|
|
3316
4025
|
const __vue_inject_styles__$z = function (inject) {
|
|
3317
4026
|
if (!inject) return
|
|
3318
|
-
inject("data-v-6af2cc0e_0", { source: ".ele.form-group-model__wrapper[data-v-6af2cc0e] {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-6af2cc0e] {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-6af2cc0e]:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title[data-v-6af2cc0e] {\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-6af2cc0e] {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer[data-v-6af2cc0e] {\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/OnlineStudy/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 });
|
|
4027
|
+
inject("data-v-db482174_0", { source: ".ele.form-group-model__wrapper[data-v-db482174] {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-db482174] {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-db482174]:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title[data-v-db482174] {\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-db482174] {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer[data-v-db482174] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele form-group-model__wrapper\">\r\n <template v-for=\"(group, idx) in innerGroupMeta\">\r\n <div \r\n class=\"form-group-model__from\"\r\n v-if=\"!group.isGenTpl\"\r\n :key=\"group.key || idx\">\r\n <div class=\"form-group-model__form--title\">\r\n <div>{{ group.title }}</div>\r\n <div class=\"form-group-model__form--buttons\">\r\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>\r\n </div>\r\n </div>\r\n <div class=\"form-group-model__form--content\">\r\n <ele-form @change=\"onChangeFormStatus($event, group.key || idx)\" :form-name=\"group.key || idx\" :ref=\"group.key || `${formRefBase}__${idx}`\" :elements=\"group.elements\"></ele-form>\r\n </div>\r\n </div>\r\n </template>\r\n <div v-if=\"showFooterMeta\" class=\"form-group-model__form--footer\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, PAGE_STATUS } from '../../../utils'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { type, net } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-form-group-model',\r\n props: {\r\n mode: {\r\n type: String\r\n },\r\n fieldName: {\r\n type: String,\r\n default: 'formGroup'\r\n },\r\n groupMeta: {\r\n type: Function,\r\n default: () => []\r\n },\r\n footerMeta: {\r\n type: Object,\r\n default: () => {}\r\n },\r\n preRequest: {\r\n type: Object,\r\n default: () => {}\r\n },\r\n infoRequest: {\r\n type: Object,\r\n default: () => {}\r\n },\r\n submitRequest: {\r\n type: Object,\r\n default: () => {}\r\n }\r\n },\r\n data () {\r\n return {\r\n increaseCount: 1,\r\n innerGroupMeta: []\r\n }\r\n },\r\n watch: {\r\n readOnlyGroupMeta: {\r\n handler (meta) {\r\n this.innerGroupMeta = meta\r\n },\r\n immediate: true\r\n }\r\n },\r\n computed: {\r\n routeMetaMode () {\r\n return this.$route.meta.mode\r\n },\r\n readOnlyGroupMeta () {\r\n return this.groupMeta.call(this)\r\n },\r\n showFooterMeta () {\r\n return !type.isEmpty(this.footerMeta)\r\n },\r\n formRefBase () {\r\n return uuidv4()\r\n },\r\n footerElements () {\r\n const { elements } = this.footerMeta\r\n return elements.call(this)\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\r\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL],\r\n [BUILT_IN_EVENT_NAMES.INCREASE]: this[BUILT_IN_EVENT_NAMES.INCREASE]\r\n }\r\n },\r\n getFormRefs () {\r\n return this.innerGroupMeta.map((group, idx) => {\r\n if (!group.isGenTpl) {\r\n return this.$refs[group.key || `${this.formRefBase}__${idx}`]\r\n }\r\n return void 0\r\n }).filter(item => !!item).flat()\r\n },\r\n formModels () {\r\n if (this.mode === 'increase') {\r\n //TODO increase mode to return formModels\r\n return this.getFormRefs.map(form => {\r\n return form.getFieldsValue()\r\n })\r\n } else {\r\n return this.getFormRefs.map(form => {\r\n const { $vnode: { data: { ref } } } = form\r\n return {\r\n key: ref,\r\n value: form.getFieldsValue()\r\n }\r\n }).reduce((ret, props) => {\r\n ret[props.key] = props.value\r\n return ret\r\n }, {})\r\n }\r\n }\r\n },\r\n methods: {\r\n execFieldMap (fieldMap = {}, dataSource = {}) {\r\n const ret = parseFieldMap(fieldMap, { _route: this.$route.query, ...dataSource})\r\n return ret\r\n },\r\n onChangeFormStatus (props, key) {\r\n this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, { key, ...props })\r\n },\r\n async infoRequestTrigger () {\r\n if (!this.infoRequest || this.routeMetaMode == PAGE_STATUS.CREATE) return\r\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\r\n if (!url) return\r\n net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\r\n const { data = {} } = resp\r\n if (this.mode === 'increase') {\r\n this.renderIncreaseForm(data)\r\n }\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n })\r\n },\r\n async preRequestTrigger () {\r\n if (!this.preRequest) return\r\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\r\n if (!url) return\r\n net[requestType.toLowerCase()](url, { ...params, ...fieldMap }, { ...headers }).then(resp => {\r\n const { data = {} } = resp\r\n if (this.mode === 'increase') {\r\n this.renderIncreaseForm(data)\r\n }\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n })\r\n },\r\n renderIncreaseForm (data = {}) {\r\n const formGroupValuesLength = data[this.fieldName].length\r\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\r\n const notGenTplPoolLength = this.readOnlyGroupMeta.filter(item => !item.isGenTpl).length\r\n const genNum = formGroupValuesLength - notGenTplPoolLength\r\n new Array(genNum).fill().forEach(() => {\r\n const form = this.genForm(genTplTarget)\r\n this.innerGroupMeta.push(form)\r\n })\r\n const formGroupValues = data[this.fieldName]\r\n this.$nextTick(() => {\r\n this.setFieldsValue(formGroupValues)\r\n })\r\n },\r\n async submitRequestTrigger (props = {}) {\r\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\r\n if (!url) return\r\n const ret = await net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels }), [this.fieldName]: this.formModels }, { headers }).then(resp => {\r\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels, ...resp.data || {} } })\r\n return resp.data\r\n })\r\n return ret\r\n },\r\n setFieldsValue (data = []) {\r\n this.getFormRefs.forEach((form, idx) => {\r\n form.setFieldsValue(data[idx])\r\n form.evalDisabledExpression(data[idx])\r\n })\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\r\n const status = this.getFormRefs.map(form => {\r\n const status = form.validateFields()\r\n return status\r\n }).every(item => item)\r\n if (status) {\r\n return this.submitRequestTrigger(props)\r\n } else {\r\n return false\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\r\n },\r\n genForm (base) {\r\n const { elements, title, buttonGroupMeta } = base\r\n return {\r\n elements: JSON.parse(JSON.stringify(elements)),\r\n buttonGroupMeta,\r\n title: `${title}${this.increaseCount++}`,\r\n _gen: true\r\n }\r\n },\r\n handleClickDelete (props = {}, attr = {}, idx) {\r\n this.innerGroupMeta.splice(idx, 1)\r\n this.$emit(BUILT_IN_EVENT_NAMES.DELETE, { ...props })\r\n },\r\n [BUILT_IN_EVENT_NAMES.INCREASE] (props) {\r\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\r\n const form = this.genForm(genTplTarget)\r\n this.innerGroupMeta.push(form)\r\n }\r\n },\r\n async mounted() {\r\n await this.preRequestTrigger()\r\n await this.infoRequestTrigger()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele {\r\n &.form-group-model__wrapper {\r\n background: unset;\r\n padding-bottom: 80px;\r\n .form-group-model__from {\r\n background: #fff;\r\n margin-top: 16px;\r\n &:first-child {\r\n margin-top: unset;\r\n }\r\n .form-group-model__form--title {\r\n width: 100%;\r\n height: 56px;\r\n padding: 0 16px;\r\n border-bottom: 1px solid;\r\n border-color: var(--idooel-form-title-border-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n }\r\n .form-group-model__form--content {\r\n padding: 16px;\r\n }\r\n }\r\n .form-group-model__form--footer {\r\n width: 100%;\r\n height: 64px;\r\n background: #fff;\r\n position: fixed;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n }\r\n}\r\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 });
|
|
3319
4028
|
|
|
3320
4029
|
};
|
|
3321
4030
|
/* scoped */
|
|
3322
|
-
const __vue_scope_id__$z = "data-v-
|
|
4031
|
+
const __vue_scope_id__$z = "data-v-db482174";
|
|
3323
4032
|
/* module identifier */
|
|
3324
4033
|
const __vue_module_identifier__$z = undefined;
|
|
3325
4034
|
/* functional template */
|
|
@@ -3680,11 +4389,11 @@ __vue_render__$y._withStripped = true;
|
|
|
3680
4389
|
/* style */
|
|
3681
4390
|
const __vue_inject_styles__$y = function (inject) {
|
|
3682
4391
|
if (!inject) return
|
|
3683
|
-
inject("data-v-212f60f0_0", { source: ".form__model--wrapper[data-v-212f60f0] {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title[data-v-212f60f0] {\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-212f60f0] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-212f60f0] {\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/OnlineStudy/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 });
|
|
4392
|
+
inject("data-v-5149ea56_0", { source: ".form__model--wrapper[data-v-5149ea56] {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title[data-v-5149ea56] {\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-5149ea56] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-5149ea56] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"form__model--wrapper\">\r\n <div class=\"form-model__title\" v-if=\"title\">\r\n {{ title }}\r\n </div>\r\n <div class=\"form-model__content\">\r\n <ele-alert style=\"margin-bottom: 16px;\" v-if=\"alertMeta\" v-bind=\"alertMeta\"></ele-alert>\r\n <ele-form :ref=\"formRef\" @change=\"onChangeFormStatus($event)\" :elements=\"elements\" :disabled=\"globalDisabled\"></ele-form>\r\n </div>\r\n <div class=\"form-model__footer\" v-if=\"footerMeta\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { BUILT_IN_EVENT_NAMES, parseFieldMap, RESERVE_EVENT_NAMES, PAGE_STATUS, CONTEXT, BUILT_IN_METHODS_NAMES } from '../../../utils'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { net, type } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nexport default {\r\n name: 'ele-form-model',\r\n props: {\r\n disabled: {\r\n type: [Boolean, String],\r\n default: '_routeMeta.disabled'\r\n },\r\n title: {\r\n type: String\r\n },\r\n formMeta: {\r\n type: Object\r\n },\r\n footerMeta: {\r\n type: Object\r\n }\r\n },\r\n data() {\r\n return {}\r\n },\r\n provide () {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n exposed: this.exposed\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n globalDisabled () {\r\n return this.executeExpression(this.disabled)\r\n },\r\n formRef () {\r\n return uuidv4()\r\n },\r\n exposed () {\r\n return {\r\n setFieldsValue: this.setFieldsValue,\r\n validateFields: this.validateFields,\r\n getFieldsValue: this.getFieldsValue,\r\n executeExpressions: this.executeExpressions,\r\n route: this.$route,\r\n [BUILT_IN_METHODS_NAMES.SUBMIT_FORM]: this.submitRequestTrigger\r\n }\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, formModel: this.formModels(), exposed: this.exposed })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\r\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]\r\n }\r\n },\r\n elements () {\r\n const { elements } = this.formMeta\r\n return elements\r\n },\r\n preRequest () {\r\n const { preRequest = {} } = this.formMeta\r\n return preRequest\r\n },\r\n infoRequest () {\r\n const { infoRequest = {} } = this.formMeta\r\n return infoRequest\r\n },\r\n alertMeta () {\r\n const { alert = {} } = this.formMeta\r\n return type.isEmpty(alert) ? null : alert\r\n },\r\n submitRequest () {\r\n const { submitRequest = {} } = this.formMeta\r\n return submitRequest\r\n },\r\n footerElements () {\r\n const { elements } = this.footerMeta\r\n return elements.call(this)\r\n },\r\n expressionData () {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta\r\n }\r\n },\r\n routeMetaMode () {\r\n return this.$route.meta.mode\r\n }\r\n },\r\n methods: {\r\n collectDefaultValues () {\r\n const ret = this.elements.reduce((ret, props) => {\r\n const { name, defaultValue } = props\r\n if (defaultValue) {\r\n ret[name] = defaultValue\r\n }\r\n return ret\r\n }, {})\r\n return ret\r\n },\r\n onChangeFormStatus (props) {\r\n this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, { ...props })\r\n },\r\n formModels (fieldNames) {\r\n return this.$refs[this.formRef] ? this.$refs[this.formRef].getFieldsValue(fieldNames) : {}\r\n },\r\n executeExpression (expression, dataSource = {}) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return false\r\n return parse(expression, { ...this.expressionData, ...this.formModels(), ...dataSource })\r\n },\r\n execFieldMap (fieldMap = {}, dataSource = {}) {\r\n const ret = parseFieldMap(fieldMap, { ...this.expressionData, ...dataSource})\r\n return ret\r\n },\r\n async submitRequestTrigger (props = {}) {\r\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\r\n const currentUrl = this.executeExpressionForUrl(url)\r\n if (!currentUrl) return\r\n const ret = await net[requestType.toLowerCase()](currentUrl, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels() }), ...this.formModels() }, { headers }).then(resp => {\r\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels(), ...resp.data || {} } })\r\n return resp.data\r\n })\r\n return ret\r\n },\r\n async infoRequestTrigger () {\r\n if (PAGE_STATUS.CREATE == this.routeMetaMode) return\r\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\r\n const currentUrl = this.executeExpressionForUrl(url)\r\n if (!currentUrl) return\r\n net[requestType.toLowerCase()](currentUrl, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\r\n const { data = {} } = resp\r\n this.setFieldsValue(data)\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n })\r\n },\r\n async preRequestTrigger () {\r\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\r\n const currentUrl = this.executeExpressionForUrl(url)\r\n if (!currentUrl) return\r\n const { data } = await net[requestType.toLowerCase()](currentUrl, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers })\r\n this.setFieldsValue(data)\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n },\r\n executeExpressionForUrl (url) {\r\n return type.isApi(url) ? url : this.executeExpression(url)\r\n },\r\n setFieldsValue (props) {\r\n this.$refs[this.formRef].setFieldsValue(props)\r\n },\r\n getFieldsValue (fieldNames) {\r\n return this.$refs[this.formRef].getFieldsValue(fieldNames)\r\n },\r\n executeExpressions () {\r\n return this.$refs[this.formRef].evalShowExpression()\r\n },\r\n validateFields () {\r\n return this.$refs[this.formRef].validateFields()\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\r\n if (this.globalDisabled) return\r\n const status = this.$refs[this.formRef].validateFields()\r\n if (status) {\r\n //TODO fieldMap\r\n return this.submitRequestTrigger(props)\r\n } else {\r\n return false\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\r\n }\r\n },\r\n async mounted() {\r\n this.setFieldsValue(this.collectDefaultValues())\r\n await this.preRequestTrigger()\r\n await this.infoRequestTrigger()\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { exposed: this.exposed })\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.form__model--wrapper {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n background: #fff;\r\n .form-model__title {\r\n height: 56px;\r\n padding: 0 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n border-bottom: 1px solid var(--idooel-form-title-border-color);\r\n }\r\n .form-model__content {\r\n padding: 16px;\r\n }\r\n .form-model__footer {\r\n /* width: 100%; */\r\n height: 64px;\r\n position: fixed;\r\n bottom: 0;\r\n display: flex;\r\n float: right;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n}\r\n</style>",".form__model--wrapper {\n width: 100%;\n height: 100%;\n overflow: auto;\n 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 });
|
|
3684
4393
|
|
|
3685
4394
|
};
|
|
3686
4395
|
/* scoped */
|
|
3687
|
-
const __vue_scope_id__$y = "data-v-
|
|
4396
|
+
const __vue_scope_id__$y = "data-v-5149ea56";
|
|
3688
4397
|
/* module identifier */
|
|
3689
4398
|
const __vue_module_identifier__$y = undefined;
|
|
3690
4399
|
/* functional template */
|
|
@@ -3975,11 +4684,11 @@ __vue_render__$x._withStripped = true;
|
|
|
3975
4684
|
/* style */
|
|
3976
4685
|
const __vue_inject_styles__$x = function (inject) {
|
|
3977
4686
|
if (!inject) return
|
|
3978
|
-
inject("data-v-
|
|
4687
|
+
inject("data-v-3000c68c_0", { source: ".ele-step-model__wrapper[data-v-3000c68c] {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper[data-v-3000c68c] {\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-3000c68c] {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper[data-v-3000c68c] {\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-3000c68c] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele-step-model__wrapper\">\r\n <div class=\"ele-step-model__step--wrapper\">\r\n <a-steps class=\"ele-steps\" :current=\"current\" size=\"small\">\r\n <a-step v-for=\"step in elements\" :title=\"step.title\" :key=\"step.key\" />\r\n </a-steps>\r\n </div>\r\n <div class=\"ele-step-model__content--wrapper\">\r\n <template v-for=\"name in scopedSlotsNames\">\r\n <div :key=\"name\" v-if=\"currentSlotName == name\" :class=\"['ele-step-model__slot', `ele-step-model__slot--${name}`]\">\r\n <slot :name=\"name\"></slot>\r\n </div>\r\n </template>\r\n </div>\r\n <div class=\"ele-step-model__footer--wrapper\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { BUILT_IN_EVENT_NAMES, CONTEXT } from '../../../utils'\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-step-model',\r\n props: {\r\n stepMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n footerMeta: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n data() {\r\n return {\r\n current: 0,\r\n currentSlotComponentRef: null,\r\n innerFooterElements: []\r\n }\r\n },\r\n provide() {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n ...this.expressionData\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n routeMetaDisabled () {\r\n return this.executeExpression(this.$route.meta.disabled)\r\n },\r\n expressionData () {\r\n return {\r\n current: this.current,\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta\r\n }\r\n },\r\n currentSlotName () {\r\n return this.scopedSlotsNames[this.current]\r\n },\r\n footerElements () {\r\n return this.innerFooterElements\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.evalShowExpressionForFooterElements()\r\n this.$emit(ele.eventName || 'click', { ...e, exposed: this.exposedMethods })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.NEXT]: this[BUILT_IN_EVENT_NAMES.NEXT],\r\n [BUILT_IN_EVENT_NAMES.PREVIOUS]: this[BUILT_IN_EVENT_NAMES.PREVIOUS],\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\r\n }\r\n },\r\n activeIndex () {\r\n const { activeIndex } = this.stepMeta\r\n return activeIndex\r\n },\r\n elements () {\r\n const { elements } = this.stepMeta\r\n return elements\r\n },\r\n scopedSlotsNames () {\r\n const slotNames = this.elements.map(item => item.key)\r\n return slotNames\r\n },\r\n exposedMethods () {\r\n return {\r\n slotRef: this.currentSlotComponentRef,\r\n setCurrentStep: this.setCurrentStep,\r\n next: this.nextStep,\r\n prev: this.prevStep,\r\n current: this.current\r\n }\r\n }\r\n },\r\n watch: {\r\n activeIndex: {\r\n handler (idx) {\r\n this.current = idx\r\n },\r\n immediate: true\r\n },\r\n current: {\r\n handler () {\r\n this.$nextTick(() => {\r\n this.currentSlotComponentRef = this.getCurrentSlotComponentRef()\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n created () {\r\n const { elements } = this.footerMeta\r\n this.innerFooterElements = elements.call(this)\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n methods: {\r\n executeExpression (expression) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return false\r\n return parse(expression, { ...this.expressionData })\r\n },\r\n evalShowExpressionForFooterElements () {\r\n this.innerFooterElements = this.innerFooterElements.map(element => {\r\n const { show = true, key, eventName } = element\r\n if(key == BUILT_IN_EVENT_NAMES.SUBMIT || eventName == BUILT_IN_EVENT_NAMES.SUBMIT) {\r\n // built in submit button should according to the route meta disabled\r\n this.$set(element, '_show', this.executeExpression(show, this.expressionData) && !this.routeMetaDisabled)\r\n return element\r\n }\r\n show && this.$set(element, '_show', this.executeExpression(show, this.expressionData))\r\n return element\r\n })\r\n },\r\n getCurrentSlotComponentRef () {\r\n const includeMetaCmp = this.$children.find(child => child.meta)\r\n if (!includeMetaCmp) return null\r\n const { $children: components } = includeMetaCmp\r\n const target = components.find(cmp => cmp.$options._componentTag === 'ele-tpl')\r\n return target.getModel ? target.getModel() : null\r\n },\r\n setCurrentStep (index) {\r\n this.current = index\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n nextStep () {\r\n if (this.current >= this.elements.length - 1) return\r\n this.current ++\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n prevStep () {\r\n if (this.current <= 0) return\r\n this.current --\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n [BUILT_IN_EVENT_NAMES.NEXT] (props) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.NEXT, { ...props, exposed: { ...this.exposedMethods } })\r\n },\r\n [BUILT_IN_EVENT_NAMES.PREVIOUS] (props) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.PREVIOUS, { ...props, exposed: { ...this.exposedMethods } })\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props) {\r\n const currentComponent = this.getCurrentSlotComponentRef() || {}\r\n const hasSubmitMethod = currentComponent.hasOwnProperty(BUILT_IN_EVENT_NAMES.SUBMIT)\r\n hasSubmitMethod && currentComponent[BUILT_IN_EVENT_NAMES.SUBMIT]()\r\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, exposed: { ...this.exposedMethods } })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-step-model__wrapper {\r\n width: 100%;\r\n height: 100vh;\r\n position: relative;\r\n .ele-step-model__step--wrapper {\r\n width: 100%;\r\n height: 64px;\r\n padding: 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n background: #fff;\r\n .ele-steps {\r\n .ant-steps-item {\r\n text-align: left;\r\n }\r\n }\r\n }\r\n .ele-step-model__content--wrapper {\r\n width: 100%;\r\n width: 100%;\r\n margin-top: 16px;\r\n margin-bottom: 16px;\r\n height: calc(100vh - 64px - 64px - 16px - 16px);\r\n overflow: auto;\r\n }\r\n .ele-step-model__footer--wrapper {\r\n width: 100%;\r\n height: 64px;\r\n background: #fff;\r\n position: absolute;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n}\r\n</style>import meta from '@/views/tree-table-page/meta'import meta from '@/views/tree-table-page/meta'\r\n\r\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 });
|
|
3979
4688
|
|
|
3980
4689
|
};
|
|
3981
4690
|
/* scoped */
|
|
3982
|
-
const __vue_scope_id__$x = "data-v-
|
|
4691
|
+
const __vue_scope_id__$x = "data-v-3000c68c";
|
|
3983
4692
|
/* module identifier */
|
|
3984
4693
|
const __vue_module_identifier__$x = undefined;
|
|
3985
4694
|
/* functional template */
|
|
@@ -4084,7 +4793,7 @@ __vue_render__$w._withStripped = true;
|
|
|
4084
4793
|
/* style */
|
|
4085
4794
|
const __vue_inject_styles__$w = function (inject) {
|
|
4086
4795
|
if (!inject) return
|
|
4087
|
-
inject("data-v-
|
|
4796
|
+
inject("data-v-18f3cb29_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 });
|
|
4088
4797
|
|
|
4089
4798
|
};
|
|
4090
4799
|
/* scoped */
|
|
@@ -4865,11 +5574,11 @@ __vue_render__$v._withStripped = true;
|
|
|
4865
5574
|
/* style */
|
|
4866
5575
|
const __vue_inject_styles__$v = function (inject) {
|
|
4867
5576
|
if (!inject) return
|
|
4868
|
-
inject("data-v-5e739fee_0", { source: ".ele__form--wrapper[data-v-5e739fee] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/OnlineStudy/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 });
|
|
5577
|
+
inject("data-v-061511f7_0", { source: ".ele__form--wrapper[data-v-061511f7] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele__form--wrapper\">\r\n <a-form :form=\"form\" layout=\"vertical\" class=\"ant-advanced-search-form\">\r\n <a-row :gutter=\"24\">\r\n <template v-for=\"ele in elements\">\r\n <a-col v-if=\"executeExpression(ele._show)\" :span=\"ele.span\" :key=\"ele.name\">\r\n <template v-if=\"ele.type == 'Input'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-input \r\n @change=\"onChange($event, ele)\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n :max-length=\"ele.maxLength\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-input>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Textarea'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-textarea \r\n @change=\"onChange($event, ele)\"\r\n :max-length=\"ele.maxLength\"\r\n :autosize=\"ele.autosize\"\r\n :disabled=\"executeExpression(ele._disabled)\"\r\n :allow-clear=\"ele.allowClear\"\r\n :placeholder=\"ele.placeholder\"\r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\"\r\n style=\"width:100%;\">\r\n </ele-textarea>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Select'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-select \r\n :data-source=\"ele.optionList\" \r\n :disabled=\"executeExpression(ele._disabled)\"\r\n :multiple=\"ele.multiple\"\r\n :mode=\"ele.mode\"\r\n :code=\"ele.code\"\r\n :init=\"ele.init\"\r\n :url=\"ele.url\"\r\n :params=\"ele.params\" \r\n @change=\"onChange($event, ele)\"\r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-select>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-upload'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-upload v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n :ext=\"ele.ext\"\r\n :multiple=\"ele.multiple\"\r\n :accept=\"ele.accept\"\r\n :extensions=\"ele.extensions\"\r\n :size=\"ele.size\"\r\n :icon=\"ele.icon\"\r\n :url=\"ele.url\"\r\n :message=\"ele.message\" \r\n style=\"width:100%;\">\r\n </ele-upload>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-date-range'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-date-range \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-date-range>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-date'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-date\r\n :format=\"ele.format\"\r\n :mode=\"ele.mode\"\r\n :show-time=\"ele.showTime\"\r\n :show-today=\"ele.showToday\"\r\n :value-format=\"ele.valueFormat\"\r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-date>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'SelectEntity'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-select-entity \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-select-entity>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'InputNumber' || ele.type == 'ele-input-number'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-input-number \r\n @change=\"onChange($event, ele)\" \r\n :precision=\"ele.precision\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n v-bind=\"ele.props\" \r\n style=\"width:100%;\">\r\n </ele-input-number>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Checkbox'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-checkbox \r\n :data-source=\"ele.optionList\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-checkbox>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Radio'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-radio \r\n @change=\"onChange($event, ele)\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n :data-source=\"ele.optionList\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-radio>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-form-img-crop'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-form-img-crop\r\n @change=\"onChange($event, ele)\"\r\n :width=\"ele.width\"\r\n :height=\"ele.height\"\r\n :modal-title=\"ele.modalTitle\"\r\n :cropper-config=\"ele.cropperConfig\"\r\n :uploadFileConfig=\"ele.uploadFileConfig\"\r\n :oper-text=\"ele.operText\"\r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-form-img-crop>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-tree-select'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-tree-select\r\n @change=\"onChange($event, ele)\"\r\n :disabled=\"executeExpression(ele._disabled)\"\r\n v-bind=\"ele.meta\"\r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-tree-select>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-select-entity-modal-table'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-select-entity-modal-table\r\n @change=\"onChange($event, ele)\"\r\n :disabled=\"executeExpression(ele._disabled)\"\r\n v-bind=\"ele.meta\"\r\n v-decorator=\"[ele.name, { rules: rebuildRules(ele.rules) }]\" \r\n style=\"width:100%;\">\r\n </ele-select-entity-modal-table>\r\n </a-form-item>\r\n </template>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </a-form>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nimport { CONTEXT } from '../../utils'\r\nexport default {\r\n name: 'ele-form',\r\n props: {\r\n value: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n disabled: {\r\n type: [Boolean, String],\r\n default: '_routeMeta.disabled'\r\n },\r\n formName: {\r\n type: [Number, String],\r\n default: 'coordinated'\r\n },\r\n elements: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n data () {\r\n return {\r\n formModel: {}\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n computed: {\r\n contextData () {\r\n return this[CONTEXT].call(this)\r\n },\r\n globalDisabled () {\r\n return this.executeExpression(this.disabled)\r\n },\r\n form () {\r\n const ref = this.$form.createForm(this, { name: this.formName })\r\n return ref\r\n },\r\n exposedMethods () {\r\n return {\r\n setFieldsValue: this.setFieldsValue,\r\n getFieldsValue: this.getFieldsValue\r\n }\r\n }\r\n },\r\n created () {\r\n this.setDefaultValues()\r\n },\r\n methods: {\r\n setFormModel (props = {}) {\r\n this.formModel = props\r\n this.dispatchExpression()\r\n },\r\n rebuildRules (rules = []) {\r\n //TODO\r\n rules.map(rule => {\r\n const { validator } = rule\r\n if (validator) {\r\n validator.formModel = this.getFieldsValue()\r\n validator.exposed = this.exposedMethods\r\n }\r\n })\r\n return rules\r\n },\r\n dispatchExpression () {\r\n this.evalDisabledExpression()\r\n this.evalShowExpression()\r\n },\r\n evalDisabledExpression () {\r\n this.elements.forEach(ele => {\r\n if (this.globalDisabled) return this.$set(ele, '_disabled', true)\r\n const { disabled } = ele\r\n const ret = this.executeExpression(disabled)\r\n this.$set(ele, '_disabled', ret)\r\n })\r\n },\r\n evalShowExpression () {\r\n this.elements.forEach(ele => {\r\n const { show = true } = ele\r\n const ret = this.executeExpression(show)\r\n this.$set(ele, '_show', ret)\r\n })\r\n },\r\n executeExpression (expression) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return false\r\n return parse(expression, { ...this.getFieldsValue(), ...this.formModel, _route: this.$route.query, _routeMeta: this.$route.meta })\r\n },\r\n onChange (value, props) {\r\n const { name } = props\r\n this.$set(this.formModel, name, value)\r\n this.dispatchExpression()\r\n this.setFieldsValue({ [name]: value })\r\n this.$emit('change', { value, props, exposed: { ...this.exposedMethods } })\r\n },\r\n collectDefaultValues () {\r\n const ret = this.elements.reduce((ret, props) => {\r\n const { name, defaultValue } = props\r\n if (defaultValue) {\r\n ret[name] = defaultValue\r\n }\r\n return ret\r\n }, {})\r\n return ret\r\n },\r\n //TODO deprecated in the future, need to be implemented in the outer component\r\n setDefaultValues () {\r\n const defaultValues = this.collectDefaultValues()\r\n this.setFormModel(defaultValues)\r\n this.setFieldsValue(defaultValues)\r\n },\r\n validateFields () {\r\n let ret = false\r\n this.form.validateFields((error, values) => {\r\n ret = !error\r\n })\r\n return ret\r\n },\r\n setFieldsValue (props = {}) {\r\n this.$nextTick(() => {\r\n this.form.setFieldsValue(props)\r\n })\r\n },\r\n getFieldsValue (fieldNames) {\r\n return this.form.getFieldsValue(fieldNames)\r\n }\r\n },\r\n mounted() {\r\n this.$emit('x:mounted', { setFormModel: this.setFormModel })\r\n this.dispatchExpression()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele__form--wrapper {\r\n background: #fff;\r\n .ant-form-item {\r\n }\r\n}\r\n</style>",".ele__form--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4869
5578
|
|
|
4870
5579
|
};
|
|
4871
5580
|
/* scoped */
|
|
4872
|
-
const __vue_scope_id__$v = "data-v-
|
|
5581
|
+
const __vue_scope_id__$v = "data-v-061511f7";
|
|
4873
5582
|
/* module identifier */
|
|
4874
5583
|
const __vue_module_identifier__$v = undefined;
|
|
4875
5584
|
/* functional template */
|
|
@@ -4961,11 +5670,11 @@ __vue_render__$u._withStripped = true;
|
|
|
4961
5670
|
/* style */
|
|
4962
5671
|
const __vue_inject_styles__$u = function (inject) {
|
|
4963
5672
|
if (!inject) return
|
|
4964
|
-
inject("data-v-
|
|
5673
|
+
inject("data-v-83e11950_0", { source: ".ele-alert[data-v-83e11950] {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <a-alert\r\n class=\"ele-alert\"\r\n :message=\"message\" \r\n :description=\"description\" \r\n :type=\"type\"\r\n :closable=\"closable\"\r\n :closeText=\"closeText\"\r\n :show-icon=\"showIcon\" />\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-alert',\r\n props: {\r\n type: {\r\n type: String,\r\n default: 'success'\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n },\r\n message: {\r\n type: String,\r\n default: 'Success Tips'\r\n },\r\n description: {\r\n type: String\r\n },\r\n closable: {\r\n type: Boolean,\r\n default: true\r\n },\r\n closeText: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-alert {\r\n text-align: left !important;\r\n}\r\n</style>",".ele-alert {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4965
5674
|
|
|
4966
5675
|
};
|
|
4967
5676
|
/* scoped */
|
|
4968
|
-
const __vue_scope_id__$u = "data-v-
|
|
5677
|
+
const __vue_scope_id__$u = "data-v-83e11950";
|
|
4969
5678
|
/* module identifier */
|
|
4970
5679
|
const __vue_module_identifier__$u = undefined;
|
|
4971
5680
|
/* functional template */
|
|
@@ -5264,8 +5973,8 @@ var script$t = {
|
|
|
5264
5973
|
methods: {
|
|
5265
5974
|
// ==================== 文件管理 ====================
|
|
5266
5975
|
|
|
5267
|
-
/**
|
|
5268
|
-
* 从多个数组中移除文件
|
|
5976
|
+
/**
|
|
5977
|
+
* 从多个数组中移除文件
|
|
5269
5978
|
*/
|
|
5270
5979
|
removeFromArrays(file, arrays, key = 'fileID') {
|
|
5271
5980
|
return arrays.map(arr => arr.filter(item => {
|
|
@@ -5285,14 +5994,14 @@ var script$t = {
|
|
|
5285
5994
|
return true;
|
|
5286
5995
|
}));
|
|
5287
5996
|
},
|
|
5288
|
-
/**
|
|
5289
|
-
* 检查文件是否为新文件
|
|
5997
|
+
/**
|
|
5998
|
+
* 检查文件是否为新文件
|
|
5290
5999
|
*/
|
|
5291
6000
|
isNewFile(newFile, existingFiles, key = 'fileID') {
|
|
5292
6001
|
return newFile[key] && !existingFiles.some(existing => existing[key] === newFile[key]);
|
|
5293
6002
|
},
|
|
5294
|
-
/**
|
|
5295
|
-
* 合并文件数据
|
|
6003
|
+
/**
|
|
6004
|
+
* 合并文件数据
|
|
5296
6005
|
*/
|
|
5297
6006
|
mergeFileData(uploadFile) {
|
|
5298
6007
|
return {
|
|
@@ -5300,8 +6009,8 @@ var script$t = {
|
|
|
5300
6009
|
...uploadFile
|
|
5301
6010
|
};
|
|
5302
6011
|
},
|
|
5303
|
-
/**
|
|
5304
|
-
* 初始化文件列表
|
|
6012
|
+
/**
|
|
6013
|
+
* 初始化文件列表
|
|
5305
6014
|
*/
|
|
5306
6015
|
async initializeFiles() {
|
|
5307
6016
|
if (!this.value) return;
|
|
@@ -5311,8 +6020,8 @@ var script$t = {
|
|
|
5311
6020
|
await this.fetchFileWithFileId();
|
|
5312
6021
|
}
|
|
5313
6022
|
},
|
|
5314
|
-
/**
|
|
5315
|
-
* 获取多文件组
|
|
6023
|
+
/**
|
|
6024
|
+
* 获取多文件组
|
|
5316
6025
|
*/
|
|
5317
6026
|
async fetchFilesWithGroupId() {
|
|
5318
6027
|
try {
|
|
@@ -5331,8 +6040,8 @@ var script$t = {
|
|
|
5331
6040
|
console.log('Keep current files, do not clear due to API error');
|
|
5332
6041
|
}
|
|
5333
6042
|
},
|
|
5334
|
-
/**
|
|
5335
|
-
* 获取单文件
|
|
6043
|
+
/**
|
|
6044
|
+
* 获取单文件
|
|
5336
6045
|
*/
|
|
5337
6046
|
async fetchFileWithFileId() {
|
|
5338
6047
|
try {
|
|
@@ -5344,8 +6053,8 @@ var script$t = {
|
|
|
5344
6053
|
console.log('fetchFileWithFileId error:', error);
|
|
5345
6054
|
}
|
|
5346
6055
|
},
|
|
5347
|
-
/**
|
|
5348
|
-
* 调用服务器删除文件 API
|
|
6056
|
+
/**
|
|
6057
|
+
* 调用服务器删除文件 API
|
|
5349
6058
|
*/
|
|
5350
6059
|
async deleteFiles(ids) {
|
|
5351
6060
|
if (!ids) {
|
|
@@ -5363,8 +6072,8 @@ var script$t = {
|
|
|
5363
6072
|
throw error; // 重新抛出错误,让调用方处理
|
|
5364
6073
|
}
|
|
5365
6074
|
},
|
|
5366
|
-
/**
|
|
5367
|
-
* 处理文件删除
|
|
6075
|
+
/**
|
|
6076
|
+
* 处理文件删除
|
|
5368
6077
|
*/
|
|
5369
6078
|
async handleClickDelete(file) {
|
|
5370
6079
|
const {
|
|
@@ -5405,8 +6114,8 @@ var script$t = {
|
|
|
5405
6114
|
// 触发 change 事件
|
|
5406
6115
|
this.$emit('change', this.fileIds);
|
|
5407
6116
|
},
|
|
5408
|
-
/**
|
|
5409
|
-
* 处理文件下载
|
|
6117
|
+
/**
|
|
6118
|
+
* 处理文件下载
|
|
5410
6119
|
*/
|
|
5411
6120
|
handleClickDownload(file) {
|
|
5412
6121
|
const {
|
|
@@ -5416,8 +6125,8 @@ var script$t = {
|
|
|
5416
6125
|
},
|
|
5417
6126
|
// ==================== 上传处理 ====================
|
|
5418
6127
|
|
|
5419
|
-
/**
|
|
5420
|
-
* 处理文件上传状态变化
|
|
6128
|
+
/**
|
|
6129
|
+
* 处理文件上传状态变化
|
|
5421
6130
|
*/
|
|
5422
6131
|
onWatchFiles(files) {
|
|
5423
6132
|
console.log('onWatchFiles called with files:', files.length);
|
|
@@ -5435,8 +6144,8 @@ var script$t = {
|
|
|
5435
6144
|
this.$emit('on-success', this.fileResponseData);
|
|
5436
6145
|
}
|
|
5437
6146
|
},
|
|
5438
|
-
/**
|
|
5439
|
-
* 处理已上传成功的文件
|
|
6147
|
+
/**
|
|
6148
|
+
* 处理已上传成功的文件
|
|
5440
6149
|
*/
|
|
5441
6150
|
processUploadedFiles(files) {
|
|
5442
6151
|
// 处理所有有响应的文件(包括正在上传和已完成的)
|
|
@@ -5461,8 +6170,8 @@ var script$t = {
|
|
|
5461
6170
|
}
|
|
5462
6171
|
this.logFileStatus();
|
|
5463
6172
|
},
|
|
5464
|
-
/**
|
|
5465
|
-
* 处理多文件模式
|
|
6173
|
+
/**
|
|
6174
|
+
* 处理多文件模式
|
|
5466
6175
|
*/
|
|
5467
6176
|
processMultipleFiles(newBuildedFiles) {
|
|
5468
6177
|
// 获取已存在的文件ID集合
|
|
@@ -5499,8 +6208,8 @@ var script$t = {
|
|
|
5499
6208
|
// 更新现有文件的状态(包括新添加的文件)
|
|
5500
6209
|
this.updateExistingFiles(newBuildedFiles);
|
|
5501
6210
|
},
|
|
5502
|
-
/**
|
|
5503
|
-
* 更新现有文件状态
|
|
6211
|
+
/**
|
|
6212
|
+
* 更新现有文件状态
|
|
5504
6213
|
*/
|
|
5505
6214
|
updateExistingFiles(newBuildedFiles) {
|
|
5506
6215
|
this.buildedFiles = this.buildedFiles.map(existingFile => {
|
|
@@ -5511,8 +6220,8 @@ var script$t = {
|
|
|
5511
6220
|
} : existingFile;
|
|
5512
6221
|
});
|
|
5513
6222
|
},
|
|
5514
|
-
/**
|
|
5515
|
-
* 记录文件状态日志
|
|
6223
|
+
/**
|
|
6224
|
+
* 记录文件状态日志
|
|
5516
6225
|
*/
|
|
5517
6226
|
logFileStatus() {
|
|
5518
6227
|
console.log('Final buildedFiles:', this.buildedFiles.length);
|
|
@@ -5526,10 +6235,10 @@ var script$t = {
|
|
|
5526
6235
|
},
|
|
5527
6236
|
// ==================== 异步处理 ====================
|
|
5528
6237
|
|
|
5529
|
-
/**
|
|
5530
|
-
* 异步保存文件到服务器
|
|
5531
|
-
* @param {FormData} payloads - 上传参数
|
|
5532
|
-
* @param {Object} uploadingFile - 正在上传的文件对象(可选)
|
|
6238
|
+
/**
|
|
6239
|
+
* 异步保存文件到服务器
|
|
6240
|
+
* @param {FormData} payloads - 上传参数
|
|
6241
|
+
* @param {Object} uploadingFile - 正在上传的文件对象(可选)
|
|
5533
6242
|
*/
|
|
5534
6243
|
async saveToServerAsyncPage(payloads = {}, uploadingFile = null) {
|
|
5535
6244
|
try {
|
|
@@ -5616,8 +6325,8 @@ var script$t = {
|
|
|
5616
6325
|
},
|
|
5617
6326
|
// ==================== 文件验证 ====================
|
|
5618
6327
|
|
|
5619
|
-
/**
|
|
5620
|
-
* 验证文件类型
|
|
6328
|
+
/**
|
|
6329
|
+
* 验证文件类型
|
|
5621
6330
|
*/
|
|
5622
6331
|
validateFileType(file) {
|
|
5623
6332
|
if (!file || !file.name) {
|
|
@@ -5638,22 +6347,22 @@ var script$t = {
|
|
|
5638
6347
|
console.log('文件类型验证通过');
|
|
5639
6348
|
return true;
|
|
5640
6349
|
},
|
|
5641
|
-
/**
|
|
5642
|
-
* 获取文件扩展名
|
|
6350
|
+
/**
|
|
6351
|
+
* 获取文件扩展名
|
|
5643
6352
|
*/
|
|
5644
6353
|
getFileExtension(fileName) {
|
|
5645
6354
|
return fileName.toLowerCase().substring(fileName.lastIndexOf('.'));
|
|
5646
6355
|
},
|
|
5647
|
-
/**
|
|
5648
|
-
* 获取允许的扩展名列表
|
|
6356
|
+
/**
|
|
6357
|
+
* 获取允许的扩展名列表
|
|
5649
6358
|
*/
|
|
5650
6359
|
getAllowedExtensions() {
|
|
5651
6360
|
return this.extensions.toLowerCase().split(',').map(ext => ext.trim().startsWith('.') ? ext.trim() : `.${ext.trim()}`);
|
|
5652
6361
|
},
|
|
5653
6362
|
// ==================== 事件处理 ====================
|
|
5654
6363
|
|
|
5655
|
-
/**
|
|
5656
|
-
* 处理文件输入事件
|
|
6364
|
+
/**
|
|
6365
|
+
* 处理文件输入事件
|
|
5657
6366
|
*/
|
|
5658
6367
|
onWatchInputFiles(newFile, oldFile) {
|
|
5659
6368
|
if (newFile && !oldFile) {
|
|
@@ -5667,8 +6376,8 @@ var script$t = {
|
|
|
5667
6376
|
// 激活上传组件
|
|
5668
6377
|
this.activateUploadComponent(newFile, oldFile);
|
|
5669
6378
|
},
|
|
5670
|
-
/**
|
|
5671
|
-
* 生成唯一的随机数
|
|
6379
|
+
/**
|
|
6380
|
+
* 生成唯一的随机数
|
|
5672
6381
|
*/
|
|
5673
6382
|
generateUniqueRandom() {
|
|
5674
6383
|
// 使用 crypto.getRandomValues 生成更安全的随机数
|
|
@@ -5680,8 +6389,8 @@ var script$t = {
|
|
|
5680
6389
|
// 降级方案:使用 Math.random 结合时间戳
|
|
5681
6390
|
return Math.random().toString(36).substr(2, 9) + Date.now().toString(36);
|
|
5682
6391
|
},
|
|
5683
|
-
/**
|
|
5684
|
-
* 处理文件添加
|
|
6392
|
+
/**
|
|
6393
|
+
* 处理文件添加
|
|
5685
6394
|
*/
|
|
5686
6395
|
handleFileAdd(newFile) {
|
|
5687
6396
|
// 为每个文件生成唯一的随机数
|
|
@@ -5701,8 +6410,8 @@ var script$t = {
|
|
|
5701
6410
|
}
|
|
5702
6411
|
console.log('文件类型验证通过,继续上传');
|
|
5703
6412
|
},
|
|
5704
|
-
/**
|
|
5705
|
-
* 处理文件更新
|
|
6413
|
+
/**
|
|
6414
|
+
* 处理文件更新
|
|
5706
6415
|
*/
|
|
5707
6416
|
handleFileUpdate(newFile) {
|
|
5708
6417
|
console.log('update', newFile);
|
|
@@ -5717,14 +6426,14 @@ var script$t = {
|
|
|
5717
6426
|
this.handleChunkComplete(response, newFile);
|
|
5718
6427
|
}
|
|
5719
6428
|
},
|
|
5720
|
-
/**
|
|
5721
|
-
* 处理文件删除
|
|
6429
|
+
/**
|
|
6430
|
+
* 处理文件删除
|
|
5722
6431
|
*/
|
|
5723
6432
|
handleFileDelete() {
|
|
5724
6433
|
console.log('delete');
|
|
5725
6434
|
},
|
|
5726
|
-
/**
|
|
5727
|
-
* 确保 groupId 存在
|
|
6435
|
+
/**
|
|
6436
|
+
* 确保 groupId 存在
|
|
5728
6437
|
*/
|
|
5729
6438
|
ensureGroupId() {
|
|
5730
6439
|
console.log('onWatchInputFiles - multiple:', this.multiple, 'current groupId:', this.groupId);
|
|
@@ -5735,8 +6444,8 @@ var script$t = {
|
|
|
5735
6444
|
console.log('Using existing groupId:', this.groupId);
|
|
5736
6445
|
}
|
|
5737
6446
|
},
|
|
5738
|
-
/**
|
|
5739
|
-
* 移除无效文件
|
|
6447
|
+
/**
|
|
6448
|
+
* 移除无效文件
|
|
5740
6449
|
*/
|
|
5741
6450
|
removeInvalidFile(file) {
|
|
5742
6451
|
console.log('文件类型验证失败,尝试移除文件');
|
|
@@ -5748,10 +6457,10 @@ var script$t = {
|
|
|
5748
6457
|
console.error('无法找到 uploadRef 引用');
|
|
5749
6458
|
}
|
|
5750
6459
|
},
|
|
5751
|
-
/**
|
|
5752
|
-
* 处理分片上传完成
|
|
5753
|
-
* @param {Object} response - 上传响应
|
|
5754
|
-
* @param {Object} uploadingFile - 正在上传的文件对象(可选)
|
|
6460
|
+
/**
|
|
6461
|
+
* 处理分片上传完成
|
|
6462
|
+
* @param {Object} response - 上传响应
|
|
6463
|
+
* @param {Object} uploadingFile - 正在上传的文件对象(可选)
|
|
5755
6464
|
*/
|
|
5756
6465
|
handleChunkComplete(response, uploadingFile = null) {
|
|
5757
6466
|
const {
|
|
@@ -5779,8 +6488,8 @@ var script$t = {
|
|
|
5779
6488
|
this.saveToServerAsyncPage(formData, uploadingFile);
|
|
5780
6489
|
}, CONSTANTS.SAVE_INTERVAL);
|
|
5781
6490
|
},
|
|
5782
|
-
/**
|
|
5783
|
-
* 激活上传组件
|
|
6491
|
+
/**
|
|
6492
|
+
* 激活上传组件
|
|
5784
6493
|
*/
|
|
5785
6494
|
activateUploadComponent(newFile, oldFile) {
|
|
5786
6495
|
if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {
|
|
@@ -5791,8 +6500,8 @@ var script$t = {
|
|
|
5791
6500
|
},
|
|
5792
6501
|
// ==================== 值变化处理 ====================
|
|
5793
6502
|
|
|
5794
|
-
/**
|
|
5795
|
-
* 重置文件状态
|
|
6503
|
+
/**
|
|
6504
|
+
* 重置文件状态
|
|
5796
6505
|
*/
|
|
5797
6506
|
resetFiles() {
|
|
5798
6507
|
this.files = [];
|
|
@@ -5810,8 +6519,8 @@ var script$t = {
|
|
|
5810
6519
|
console.log('Reset groupId to null (single mode)');
|
|
5811
6520
|
}
|
|
5812
6521
|
},
|
|
5813
|
-
/**
|
|
5814
|
-
* 处理多文件模式的值变化
|
|
6522
|
+
/**
|
|
6523
|
+
* 处理多文件模式的值变化
|
|
5815
6524
|
*/
|
|
5816
6525
|
async handleMultipleFileValue(value) {
|
|
5817
6526
|
// multiple - value 就是 groupId
|
|
@@ -5824,8 +6533,8 @@ var script$t = {
|
|
|
5824
6533
|
console.log('GroupId unchanged, skip fetchFilesWithGroupId');
|
|
5825
6534
|
}
|
|
5826
6535
|
},
|
|
5827
|
-
/**
|
|
5828
|
-
* 处理单文件模式的值变化
|
|
6536
|
+
/**
|
|
6537
|
+
* 处理单文件模式的值变化
|
|
5829
6538
|
*/
|
|
5830
6539
|
async handleSingleFileValue() {
|
|
5831
6540
|
await this.fetchFileWithFileId();
|
|
@@ -6063,11 +6772,11 @@ __vue_render__$t._withStripped = true;
|
|
|
6063
6772
|
/* style */
|
|
6064
6773
|
const __vue_inject_styles__$t = function (inject) {
|
|
6065
6774
|
if (!inject) return
|
|
6066
|
-
inject("data-v-a3a0fc50_0", { source: "[data-v-a3a0fc50] .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-a3a0fc50] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n.ele-upload__wrapper[data-v-a3a0fc50] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-a3a0fc50] {\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-a3a0fc50] {\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-a3a0fc50] {\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-a3a0fc50] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-a3a0fc50] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-a3a0fc50] {\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-a3a0fc50] {\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-a3a0fc50] {\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-a3a0fc50] {\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-a3a0fc50] {\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-a3a0fc50] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-a3a0fc50] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-a3a0fc50] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/OnlineStudy/base-elearning-frontend-model/packages/components/packages/upload/src/index.vue","index.vue"],"names":[],"mappings":"AA64BA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;EAIA,+CAAA;AC/4BA;AD44BA;EACA,0DAAA;AC14BA;AD84BA;EACA,WAAA;AC34BA;AD44BA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;AC14BA;AD24BA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,cAAA;ACz4BA;AD04BA;EACA,eAAA;EACA,kCAAA;ACx4BA;AD04BA;EACA,eAAA;EACA,kCAAA;ACx4BA;AD24BA;EACA,iBAAA;ACz4BA;AD04BA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;ACx4BA;AD04BA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;ACx4BA;AD64BA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC34BA;AD44BA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;EACA,YAAA;AC14BA;AD44BA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;AC14BA;AD24BA;EACA,gBAAA;EACA,uBAAA;ACz4BA;AD44BA;EACA,gBAAA;AC14BA;AD24BA;EACA,gBAAA;EACA,eAAA;ACz4BA;;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 })\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 // 筛选条件:有进度信息 且 (未成功 或 成功但还没有fileID的切片上传文件)\n // 这样可以确保切片上传完成但异步保存未完成的文件继续显示,避免闪烁\n return this.files.filter(file => {\n if (file.progress === undefined) return false\n if (!file.success) return true\n \n // 检查文件是否已经有 fileID(可能在 file.fileID 或 file.response.data.fileID)\n const hasFileID = file.fileID || (file.response && file.response.data && file.response.data.fileID)\n \n // 切片上传成功但还没有完成异步保存(没有fileID)的文件继续显示\n // 普通上传成功且已有 fileID 的文件不显示(会在 completedFiles 中显示)\n return file.success && !hasFileID\n })\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 => {\n // 如果 fileID 都存在且相等,则移除\n if (item[key] && file[key] && item[key] === file[key]) {\n return false\n }\n // 如果 id 都存在且相等,则移除\n if (item.id && file.id && item.id === file.id) {\n return false\n }\n // 如果文件名相同,也考虑移除(额外的安全检查)\n if (item.name && file.name && item.name === file.name && item[key] === file[key]) {\n return false\n }\n // 否则保留\n return true\n })\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 * 调用服务器删除文件 API\n */\n async deleteFiles (ids) {\n if (!ids) {\n console.warn('No fileID provided for deletion')\n return\n }\n \n if (type.isArray(ids)) {\n ids = ids.join(',')\n }\n \n try {\n await net.remove(`/api-file/workbench/file?ids=${ids}`)\n console.log('File deleted from server:', ids)\n } catch (error) {\n console.error('Failed to delete file from server:', error)\n throw error // 重新抛出错误,让调用方处理\n }\n },\n \n /**\n * 处理文件删除\n */\n async handleClickDelete(file) {\n const { fileID, name } = file\n console.log('Deleting 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 // 如果有 fileID,调用服务器删除 API\n if (fileID) {\n try {\n await this.deleteFiles(fileID)\n } catch (error) {\n console.error('Failed to delete file from server:', error)\n // 可以选择提示用户或回滚操作\n // 这里仅记录错误,不影响前端显示\n }\n }\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 // 从 files 数组中移除已完成的文件(普通上传),避免重复显示\n if (newBuildedFiles.length > 0 && newBuildedFiles[0].fileID) {\n this.$nextTick(() => {\n this.files = this.files.filter(file => {\n const fileID = file.fileID || (file.response && file.response.data && file.response.data.fileID)\n return fileID !== newBuildedFiles[0].fileID\n })\n console.log('Removed completed file from upload list (single mode)')\n })\n }\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 // 从 files 数组中移除已完成的文件(普通上传),避免重复显示\n this.$nextTick(() => {\n const completedFileIDs = new Set(trulyNewFiles.map(f => f.fileID))\n this.files = this.files.filter(file => {\n const fileID = file.fileID || (file.response && file.response.data && file.response.data.fileID)\n return !completedFileIDs.has(fileID)\n })\n console.log('Removed completed files from upload list')\n })\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 * @param {FormData} payloads - 上传参数\n * @param {Object} uploadingFile - 正在上传的文件对象(可选)\n */\n async saveToServerAsyncPage(payloads = {}, uploadingFile = null) {\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 console.log('Chunk upload async save completed, file data:', data)\n \n const { fileID, groupID, name } = data\n \n // 根据上传模式处理文件信息\n if (this.multiple) {\n // 多文件模式:更新 groupID 并追加文件到列表\n if (groupID) {\n this.groupId = groupID\n console.log('Updated groupId from server:', groupID)\n }\n \n // 检查文件是否已存在,避免重复添加\n const fileExists = this.buildedFiles.some(file => file.fileID === fileID)\n if (!fileExists && fileID) {\n // 将服务器返回的完整文件信息追加到文件列表\n // 添加必要的显示属性\n const fileData = {\n ...data,\n success: true // 标记为上传成功\n }\n \n // 先添加到已完成列表\n this.buildedFiles.push(fileData)\n console.log('File added to list:', name, 'Total files:', this.buildedFiles.length)\n \n // 使用 nextTick 确保视图更新后再移除上传列表中的文件,避免闪烁\n this.$nextTick(() => {\n // 从上传列表中精确移除对应的文件\n if (uploadingFile) {\n // 如果有文件对象引用,直接移除该文件\n this.files = this.files.filter(file => file.id !== uploadingFile.id)\n console.log('Removed uploading file by id:', uploadingFile.id)\n } else {\n // 否则根据文件名移除\n this.files = this.files.filter(file => file.name !== name)\n console.log('Removed uploading file by name:', name)\n }\n })\n \n // 触发 change 事件通知父组件\n this.$emit('change', this.fileIds)\n this.$emit('on-success', this.fileResponseData)\n } else {\n console.log('File already exists or invalid fileID, skip adding')\n }\n } else {\n // 单文件模式:替换文件列表\n if (fileID) {\n const fileData = {\n ...data,\n success: true // 标记为上传成功\n }\n this.buildedFiles = [fileData]\n this.files = [] // 清空上传列表\n console.log('Single file updated:', name)\n \n // 触发 change 事件通知父组件更新 value\n this.$emit('change', fileID)\n this.$emit('on-success', data)\n }\n }\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 generateUniqueRandom() {\n // 使用 crypto.getRandomValues 生成更安全的随机数\n if (window.crypto && window.crypto.getRandomValues) {\n const array = new Uint32Array(1)\n window.crypto.getRandomValues(array)\n return array[0].toString()\n }\n // 降级方案:使用 Math.random 结合时间戳\n return Math.random().toString(36).substr(2, 9) + Date.now().toString(36)\n },\n\n /**\n * 处理文件添加\n */\n handleFileAdd(newFile) {\n // 为每个文件生成唯一的随机数\n const uniqueRandom = this.generateUniqueRandom()\n newFile.postAction = newFile.postAction + '&_t=' + uniqueRandom\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 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, newFile)\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 * @param {Object} response - 上传响应\n * @param {Object} uploadingFile - 正在上传的文件对象(可选)\n */\n handleChunkComplete(response, uploadingFile = null) {\n const { data: { file, type } } = response\n const payloads = {\n filePath: file.match(/\\/cw(.*)/) ? file.match(/\\/cw(.*)/)[0] : void 0,\n asyncID: uuidv4(),\n groupID: this.groupId,\n isDeleteOrigin: false,\n toImage: type === 'pdf',\n unzip: type === 'zip',\n _csrf: localStorage.getItem('token')\n }\n\n const formData = new FormData()\n\n Object.keys(payloads).forEach(key => {\n formData.append(key, payloads[key])\n })\n \n // 将上传文件对象传递给异步保存方法\n this.saveToServerAsyncPageTimer = setInterval(() => {\n this.saveToServerAsyncPage(formData, uploadingFile)\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 });
|
|
6775
|
+
inject("data-v-1b3ec41c_0", { source: "[data-v-1b3ec41c] .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}\n[data-v-1b3ec41c] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n[data-v-1b3ec41c] .ele-upload__inner {\n border-radius: var(--idooel-form-border-radius);\n}\n.ele-upload__wrapper[data-v-1b3ec41c] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-1b3ec41c] {\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-1b3ec41c] {\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-1b3ec41c] {\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-1b3ec41c] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-1b3ec41c] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-1b3ec41c] {\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-1b3ec41c] {\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-1b3ec41c] {\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-1b3ec41c] {\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-1b3ec41c] {\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-1b3ec41c] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-1b3ec41c] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-1b3ec41c] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\upload\\src\\index.vue","index.vue"],"names":[],"mappings":"AA64BA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;AC54BA;AD64BA;EACA,0DAAA;AC34BA;ADq4BA;EAQA,+CAAA;AC14BA;AD44BA;EACA,WAAA;ACz4BA;AD04BA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;ACx4BA;ADy4BA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,cAAA;ACv4BA;ADw4BA;EACA,eAAA;EACA,kCAAA;ACt4BA;ADw4BA;EACA,eAAA;EACA,kCAAA;ACt4BA;ADy4BA;EACA,iBAAA;ACv4BA;ADw4BA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;ACt4BA;ADw4BA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;ACt4BA;AD24BA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACz4BA;AD04BA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;EACA,YAAA;ACx4BA;AD04BA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;ACx4BA;ADy4BA;EACA,gBAAA;EACA,uBAAA;ACv4BA;AD04BA;EACA,gBAAA;ACx4BA;ADy4BA;EACA,gBAAA;EACA,eAAA;ACv4BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-upload__wrapper\">\r\n <FileUpload\r\n class=\"ele-upload__inner\"\r\n v-show=\"isShowUploadContainer\"\r\n v-model=\"files\"\r\n :ref=\"uploadRef\"\r\n :drop=\"drop\"\r\n :chunk-enabled=\"chunkEnabled\"\r\n :chunk=\"chunkConfig\"\r\n :accept=\"accept\"\r\n :size=\"fileSizeLimit\"\r\n :post-action=\"postAction\"\r\n :multiple=\"multiple\"\r\n :headers=\"headers\"\r\n :maximum=\"getMaximum\"\r\n :data=\"uploadParams\"\r\n @input-file=\"onWatchInputFiles\"\r\n @input=\"onWatchFiles\"\r\n style=\"width: 100%;\">\r\n <section class=\"ele-upload__area\">\r\n <div class=\"ele-upload__area--icon\">\r\n <template v-if=\"iconIsZhWrod\">\r\n {{ icon }}\r\n </template>\r\n <template v-else>\r\n <ele-icon :type=\"icon\"></ele-icon>\r\n </template>\r\n </div>\r\n <div class=\"ele-upload__area--text\">\r\n <div class=\"ele-upload__message\" v-if=\"message\" v-html=\"message\"></div>\r\n <div class=\"ele-upload__message\" v-else>单击或拖动文件到该区域以上传</div>\r\n <div class=\"ele-upload__ext\" v-if=\"ext\" v-html=\"ext\"></div>\r\n <div class=\"ele-upload__ext\" v-else>文件小于{{ size }}M</div>\r\n </div>\r\n </section>\r\n </FileUpload>\r\n <section class=\"ele-files__wrapper\">\r\n <!-- 显示正在上传的文件(有进度条) -->\r\n <div class=\"ele-file__item\" v-for=\"(file, idx) in uploadingFiles\" :key=\"`uploading-${idx}`\">\r\n <div class=\"ele-file__suffix--icon\">\r\n <ele-icon :type=\"fileSuffixIcon[file.suffix] ? fileSuffixIcon[file.suffix].name : 'icon-file'\"></ele-icon>\r\n </div>\r\n <div class=\"ele-file__name\">\r\n <div class=\"ele-file__inner\">{{ file.name }}</div>\r\n <div v-if=\"file.progress !== undefined\" class=\"ele-uplpad__progress\">\r\n <a-progress :strokeWidth=\"2\" :percent=\"Number(file.progress)\" size=\"small\" />\r\n </div>\r\n </div>\r\n <div class=\"ele-file__delete\" v-if=\"file.success || file.error\">\r\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\r\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\r\n <ele-icon type=\"delete\"></ele-icon>\r\n </span>\r\n </div>\r\n </div>\r\n \r\n <!-- 显示已上传完成的文件 -->\r\n <div class=\"ele-file__item\" v-for=\"(file, idx) in completedFiles\" :key=\"`completed-${idx}`\">\r\n <div class=\"ele-file__suffix--icon\">\r\n <ele-icon :type=\"fileSuffixIcon[file.suffix] ? fileSuffixIcon[file.suffix].name : 'icon-file'\"></ele-icon>\r\n </div>\r\n <div class=\"ele-file__name\">\r\n <div class=\"ele-file__inner\" @click=\"handleClickDownload(file)\">{{ file.name }}</div>\r\n </div>\r\n <div class=\"ele-file__delete\">\r\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\r\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\r\n <ele-icon type=\"delete\"></ele-icon>\r\n </span>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport FileUpload from 'vue-upload-component'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { route, net, type } from '@idooel/shared'\r\n\r\n// 常量定义\r\nconst CONSTANTS = {\r\n DEFAULT_URL: 'zuul/api-file/workbench/file',\r\n DEFAULT_ICON: '上传',\r\n DEFAULT_SIZE: 100,\r\n DEFAULT_MESSAGE: '单击或拖动文件到该区域以上传',\r\n DEFAULT_MAXIMUM: 20,\r\n BYTE_CONVERSION: 1024 * 1024,\r\n CHUNK_MIN_SIZE: 3 * 1024 * 1024,\r\n CHUNK_MAX_ACTIVE: 3,\r\n CHUNK_MAX_RETRIES: 5,\r\n SAVE_INTERVAL: 2000\r\n}\r\n\r\n// 文件后缀图标映射\r\nconst FILE_SUFFIX_ICONS = {\r\n 'doc': { name: 'icon-doc' },\r\n 'html': { name: 'icon-html' },\r\n 'mp4': { name: 'icon-mp' },\r\n 'pdf': { name: 'icon-pdf' },\r\n 'ppt': { name: 'icon-ppt' },\r\n 'psd': { name: 'icon-psd' },\r\n 'rtf': { name: 'icon-rtf' },\r\n 'txt': { name: 'icon-txt' },\r\n 'vis': { name: 'icon-vis' },\r\n 'xls': { name: 'icon-xls' },\r\n 'xml': { name: 'icon-xml' },\r\n 'zip': { name: 'icon-zip' },\r\n 'jpg': { name: 'icon-img' },\r\n 'mp3': { name: 'icon-mp1' }\r\n}\r\n\r\nexport default {\r\n name: 'ele-upload',\r\n components: {\r\n FileUpload\r\n },\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n url: {\r\n type: String,\r\n default: CONSTANTS.DEFAULT_URL\r\n },\r\n icon: {\r\n type: String,\r\n default: CONSTANTS.DEFAULT_ICON\r\n },\r\n size: {\r\n type: Number,\r\n default: CONSTANTS.DEFAULT_SIZE\r\n },\r\n message: {\r\n type: String,\r\n default: CONSTANTS.DEFAULT_MESSAGE\r\n },\r\n ext: {\r\n type: String\r\n },\r\n extensions: {\r\n type: String\r\n },\r\n accept: {\r\n type: String\r\n },\r\n maximum: {\r\n type: Number,\r\n default: CONSTANTS.DEFAULT_MAXIMUM\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: false\r\n },\r\n drop: {\r\n type: Boolean,\r\n default: true\r\n },\r\n value: {\r\n type: [String, Array]\r\n },\r\n querys: {\r\n type: Object,\r\n default: () => ({\r\n _csrf: localStorage.getItem('token')\r\n })\r\n },\r\n headers: {\r\n type: Object,\r\n default: () => ({\r\n 'X-XSRF-TOKEN': localStorage.getItem('token')\r\n })\r\n },\r\n byteConversion: {\r\n type: Number,\r\n default: CONSTANTS.BYTE_CONVERSION\r\n },\r\n chunkEnabled: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n // 文件状态管理\r\n files: [], // vue-upload-component 管理的文件\r\n buildedFiles: [], // 已构建完成的文件列表\r\n \r\n // 上传状态管理\r\n saveToServerAsyncPageTimer: null,\r\n uploadRefId: null,\r\n // 多选且外部无值时,预先生成 groupId,确保首次上传参数完整\r\n groupId: (this.multiple && !this.value) ? uuidv4() : null\r\n }\r\n },\r\n created() {\r\n // 多文件模式下,如果没有外部 groupId,则生成一个\r\n if (this.multiple && !this.value) {\r\n this.groupId = uuidv4()\r\n console.log('Created with new groupId:', this.groupId)\r\n }\r\n },\r\n watch: {\r\n value: {\r\n async handler(value) {\r\n if (type.isEmpty(value)) {\r\n this.resetFiles()\r\n } else if (this.multiple) {\r\n this.handleMultipleFileValue(value)\r\n } else {\r\n this.handleSingleFileValue()\r\n }\r\n },\r\n immediate: true\r\n }\r\n },\r\n computed: {\r\n // ==================== 基础配置 ====================\r\n prefixPath() {\r\n return window.prefixPath\r\n },\r\n \r\n uploadRef() {\r\n if (!this.uploadRefId) {\r\n this.uploadRefId = `uploadRef_${uuidv4()}`\r\n }\r\n return this.uploadRefId\r\n },\r\n \r\n iconIsZhWord() {\r\n return type.isZhWord(this.icon)\r\n },\r\n \r\n // ==================== 上传配置 ====================\r\n uploadParams() {\r\n return this.multiple ? { groupID: this.groupId } : {}\r\n },\r\n \r\n fileSizeLimit() {\r\n return this.size * this.byteConversion\r\n },\r\n \r\n postAction() {\r\n const queryString = route.toQueryString(this.querys)\r\n return `${this.prefixPath}${this.url}?${queryString}`\r\n },\r\n \r\n chunkConfig() {\r\n return {\r\n action: `${this.prefixPath}zuul/api-file/workbench/file/temp/chunk/vue`,\r\n headers: { ...this.headers },\r\n minSize: CONSTANTS.CHUNK_MIN_SIZE,\r\n maxActive: CONSTANTS.CHUNK_MAX_ACTIVE,\r\n maxRetries: CONSTANTS.CHUNK_MAX_RETRIES,\r\n startBody: { override: true, path: '/cw' },\r\n uploadBody: { override: true, path: '/cw' },\r\n finishBody: { override: true, path: '/cw' }\r\n }\r\n },\r\n \r\n getMaximum() {\r\n return this.multiple ? this.maximum : 1\r\n },\r\n \r\n // ==================== 文件状态 ====================\r\n uploadingFiles() {\r\n // 筛选条件:有进度信息 且 (未成功 或 成功但还没有fileID的切片上传文件)\r\n // 这样可以确保切片上传完成但异步保存未完成的文件继续显示,避免闪烁\r\n return this.files.filter(file => {\r\n if (file.progress === undefined) return false\r\n if (!file.success) return true\r\n \r\n // 检查文件是否已经有 fileID(可能在 file.fileID 或 file.response.data.fileID)\r\n const hasFileID = file.fileID || (file.response && file.response.data && file.response.data.fileID)\r\n \r\n // 切片上传成功但还没有完成异步保存(没有fileID)的文件继续显示\r\n // 普通上传成功且已有 fileID 的文件不显示(会在 completedFiles 中显示)\r\n return file.success && !hasFileID\r\n })\r\n },\r\n \r\n completedFiles() {\r\n return this.buildedFiles.filter(file => file.fileID)\r\n },\r\n \r\n totalFiles() {\r\n return this.uploadingFiles.length + this.completedFiles.length\r\n },\r\n \r\n isFileUploadSuccessed() {\r\n const currentUploadingFiles = this.files.filter(file => file.response !== undefined)\r\n if (currentUploadingFiles.length === 0) {\r\n return this.buildedFiles.length > 0\r\n }\r\n return currentUploadingFiles.every(file => file.success)\r\n },\r\n \r\n isShowUploadContainer() {\r\n const maxFiles = this.multiple ? this.maximum : 1\r\n return this.totalFiles < maxFiles\r\n },\r\n \r\n // ==================== 文件信息 ====================\r\n fileSuffixIcon() {\r\n return FILE_SUFFIX_ICONS\r\n },\r\n \r\n fileIds() {\r\n if (this.multiple) {\r\n return this.groupId\r\n } else {\r\n const fileIds = this.buildedFiles.map(file => file.fileID)\r\n return fileIds[0]\r\n }\r\n },\r\n \r\n fileResponseData() {\r\n return this.multiple ? this.buildedFiles : this.buildedFiles[0]\r\n }\r\n },\r\n methods: {\r\n // ==================== 文件管理 ====================\r\n \r\n /**\r\n * 从多个数组中移除文件\r\n */\r\n removeFromArrays(file, arrays, key = 'fileID') {\r\n return arrays.map(arr => \r\n arr.filter(item => {\r\n // 如果 fileID 都存在且相等,则移除\r\n if (item[key] && file[key] && item[key] === file[key]) {\r\n return false\r\n }\r\n // 如果 id 都存在且相等,则移除\r\n if (item.id && file.id && item.id === file.id) {\r\n return false\r\n }\r\n // 如果文件名相同,也考虑移除(额外的安全检查)\r\n if (item.name && file.name && item.name === file.name && item[key] === file[key]) {\r\n return false\r\n }\r\n // 否则保留\r\n return true\r\n })\r\n )\r\n },\r\n \r\n /**\r\n * 检查文件是否为新文件\r\n */\r\n isNewFile(newFile, existingFiles, key = 'fileID') {\r\n return newFile[key] && !existingFiles.some(existing => existing[key] === newFile[key])\r\n },\r\n \r\n /**\r\n * 合并文件数据\r\n */\r\n mergeFileData(uploadFile) {\r\n return {\r\n ...uploadFile.response.data,\r\n ...uploadFile\r\n }\r\n },\r\n \r\n /**\r\n * 初始化文件列表\r\n */\r\n async initializeFiles() {\r\n if (!this.value) return\r\n \r\n if (this.multiple) {\r\n await this.fetchFilesWithGroupId()\r\n } else {\r\n await this.fetchFileWithFileId()\r\n }\r\n },\r\n \r\n /**\r\n * 获取多文件组\r\n */\r\n async fetchFilesWithGroupId() {\r\n try {\r\n const response = await net.get(`/api-file/workbench/file/group/${this.value}`)\r\n const data = response.data || []\r\n \r\n // 只有在没有现有文件时才设置初始文件列表\r\n if (this.buildedFiles.length === 0) {\r\n this.buildedFiles = data\r\n console.log('Initial files loaded:', this.buildedFiles.length)\r\n } else {\r\n console.log('Keep existing files, skip initial load')\r\n }\r\n } catch (error) {\r\n console.log('fetchFilesWithGroupId error:', error)\r\n console.log('Keep current files, do not clear due to API error')\r\n }\r\n },\r\n \r\n /**\r\n * 获取单文件\r\n */\r\n async fetchFileWithFileId() {\r\n try {\r\n const response = await net.get(`/api-file/file/${this.value}`)\r\n const data = response.data\r\n this.buildedFiles = [data]\r\n this.files = [data]\r\n } catch (error) {\r\n console.log('fetchFileWithFileId error:', error)\r\n }\r\n },\r\n\r\n /**\r\n * 调用服务器删除文件 API\r\n */\r\n async deleteFiles (ids) {\r\n if (!ids) {\r\n console.warn('No fileID provided for deletion')\r\n return\r\n }\r\n \r\n if (type.isArray(ids)) {\r\n ids = ids.join(',')\r\n }\r\n \r\n try {\r\n await net.remove(`/api-file/workbench/file?ids=${ids}`)\r\n console.log('File deleted from server:', ids)\r\n } catch (error) {\r\n console.error('Failed to delete file from server:', error)\r\n throw error // 重新抛出错误,让调用方处理\r\n }\r\n },\r\n \r\n /**\r\n * 处理文件删除\r\n */\r\n async handleClickDelete(file) {\r\n const { fileID, name } = file\r\n console.log('Deleting file:', { name, fileID })\r\n \r\n // 先从上传组件中移除文件\r\n if (this.$refs[this.uploadRef]) {\r\n this.$refs[this.uploadRef].remove(file)\r\n }\r\n \r\n // 从所有数组中移除文件\r\n [this.files, this.buildedFiles] = this.removeFromArrays(file, [this.files, this.buildedFiles])\r\n \r\n console.log('After deletion - files:', this.files.length, 'buildedFiles:', this.buildedFiles.length)\r\n \r\n // 如果有 fileID,调用服务器删除 API\r\n if (fileID) {\r\n try {\r\n await this.deleteFiles(fileID)\r\n } catch (error) {\r\n console.error('Failed to delete file from server:', error)\r\n // 可以选择提示用户或回滚操作\r\n // 这里仅记录错误,不影响前端显示\r\n }\r\n }\r\n \r\n // 多文件模式下,如果删除最后一个文件,重置 groupId\r\n if (this.multiple && this.buildedFiles.length === 0) {\r\n this.groupId = null\r\n console.log('Reset groupId after deleting last file')\r\n }\r\n \r\n // 触发 change 事件\r\n this.$emit('change', this.fileIds)\r\n },\r\n \r\n /**\r\n * 处理文件下载\r\n */\r\n handleClickDownload(file) {\r\n const { fileID: fileId } = file\r\n window.open(`/api-file/workbench/file/stream/${fileId}?origin=true`)\r\n },\r\n // ==================== 上传处理 ====================\r\n \r\n /**\r\n * 处理文件上传状态变化\r\n */\r\n onWatchFiles(files) {\r\n console.log('onWatchFiles called with files:', files.length)\r\n console.log('Current buildedFiles:', this.buildedFiles.length)\r\n \r\n // 更新文件状态\r\n this.files = files\r\n \r\n // 处理已上传成功的文件\r\n this.processUploadedFiles(files)\r\n \r\n // 检查上传是否完成\r\n if (this.isFileUploadSuccessed) {\r\n this.$emit('change', this.fileIds)\r\n this.$emit('on-success', this.fileResponseData)\r\n }\r\n },\r\n \r\n /**\r\n * 处理已上传成功的文件\r\n */\r\n processUploadedFiles(files) {\r\n // 处理所有有响应的文件(包括正在上传和已完成的)\r\n const uploadedFiles = files.filter(file => file.response)\r\n const newBuildedFiles = uploadedFiles.map(file => this.mergeFileData(file))\r\n \r\n if (this.multiple) {\r\n this.processMultipleFiles(newBuildedFiles)\r\n } else {\r\n // 单文件模式:只保留最新的文件\r\n this.buildedFiles = newBuildedFiles\r\n \r\n // 从 files 数组中移除已完成的文件(普通上传),避免重复显示\r\n if (newBuildedFiles.length > 0 && newBuildedFiles[0].fileID) {\r\n this.$nextTick(() => {\r\n this.files = this.files.filter(file => {\r\n const fileID = file.fileID || (file.response && file.response.data && file.response.data.fileID)\r\n return fileID !== newBuildedFiles[0].fileID\r\n })\r\n console.log('Removed completed file from upload list (single mode)')\r\n })\r\n }\r\n }\r\n \r\n this.logFileStatus()\r\n },\r\n \r\n /**\r\n * 处理多文件模式\r\n */\r\n processMultipleFiles(newBuildedFiles) {\r\n // 获取已存在的文件ID集合\r\n const existingFileIds = new Set(this.buildedFiles.map(f => f.fileID).filter(id => id))\r\n \r\n // 过滤出真正的新文件\r\n const trulyNewFiles = newBuildedFiles.filter(newFile => \r\n this.isNewFile(newFile, this.buildedFiles)\r\n )\r\n \r\n console.log('Existing fileIDs:', Array.from(existingFileIds))\r\n console.log('New uploaded files:', newBuildedFiles.map(f => ({ name: f.name, fileID: f.fileID })))\r\n console.log('Truly new files:', trulyNewFiles.map(f => ({ name: f.name, fileID: f.fileID })))\r\n \r\n // 将新文件追加到现有文件列表\r\n if (trulyNewFiles.length > 0) {\r\n this.buildedFiles = [...this.buildedFiles, ...trulyNewFiles]\r\n console.log('Added new files, total buildedFiles:', this.buildedFiles.length)\r\n \r\n // 从 files 数组中移除已完成的文件(普通上传),避免重复显示\r\n this.$nextTick(() => {\r\n const completedFileIDs = new Set(trulyNewFiles.map(f => f.fileID))\r\n this.files = this.files.filter(file => {\r\n const fileID = file.fileID || (file.response && file.response.data && file.response.data.fileID)\r\n return !completedFileIDs.has(fileID)\r\n })\r\n console.log('Removed completed files from upload list')\r\n })\r\n }\r\n \r\n // 更新现有文件的状态(包括新添加的文件)\r\n this.updateExistingFiles(newBuildedFiles)\r\n },\r\n \r\n /**\r\n * 更新现有文件状态\r\n */\r\n updateExistingFiles(newBuildedFiles) {\r\n this.buildedFiles = this.buildedFiles.map(existingFile => {\r\n const updatedFile = newBuildedFiles.find(newFile => newFile.fileID === existingFile.fileID)\r\n return updatedFile ? { ...existingFile, ...updatedFile } : existingFile\r\n })\r\n },\r\n \r\n /**\r\n * 记录文件状态日志\r\n */\r\n logFileStatus() {\r\n console.log('Final buildedFiles:', this.buildedFiles.length)\r\n console.log('buildedFiles details:', this.buildedFiles.map(f => ({ name: f.name, fileID: f.fileID, success: f.success })))\r\n console.log('Uploading files:', this.uploadingFiles.length)\r\n console.log('Completed files:', this.completedFiles.length)\r\n },\r\n // ==================== 异步处理 ====================\r\n \r\n /**\r\n * 异步保存文件到服务器\r\n * @param {FormData} payloads - 上传参数\r\n * @param {Object} uploadingFile - 正在上传的文件对象(可选)\r\n */\r\n async saveToServerAsyncPage(payloads = {}, uploadingFile = null) {\r\n try {\r\n const response = await net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, { \r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'\r\n }\r\n })\r\n \r\n const { data } = response\r\n if (data !== 'saveToServerAsyncPage') {\r\n clearInterval(this.saveToServerAsyncPageTimer)\r\n console.log('Chunk upload async save completed, file data:', data)\r\n \r\n const { fileID, groupID, name } = data\r\n \r\n // 根据上传模式处理文件信息\r\n if (this.multiple) {\r\n // 多文件模式:更新 groupID 并追加文件到列表\r\n if (groupID) {\r\n this.groupId = groupID\r\n console.log('Updated groupId from server:', groupID)\r\n }\r\n \r\n // 检查文件是否已存在,避免重复添加\r\n const fileExists = this.buildedFiles.some(file => file.fileID === fileID)\r\n if (!fileExists && fileID) {\r\n // 将服务器返回的完整文件信息追加到文件列表\r\n // 添加必要的显示属性\r\n const fileData = {\r\n ...data,\r\n success: true // 标记为上传成功\r\n }\r\n \r\n // 先添加到已完成列表\r\n this.buildedFiles.push(fileData)\r\n console.log('File added to list:', name, 'Total files:', this.buildedFiles.length)\r\n \r\n // 使用 nextTick 确保视图更新后再移除上传列表中的文件,避免闪烁\r\n this.$nextTick(() => {\r\n // 从上传列表中精确移除对应的文件\r\n if (uploadingFile) {\r\n // 如果有文件对象引用,直接移除该文件\r\n this.files = this.files.filter(file => file.id !== uploadingFile.id)\r\n console.log('Removed uploading file by id:', uploadingFile.id)\r\n } else {\r\n // 否则根据文件名移除\r\n this.files = this.files.filter(file => file.name !== name)\r\n console.log('Removed uploading file by name:', name)\r\n }\r\n })\r\n \r\n // 触发 change 事件通知父组件\r\n this.$emit('change', this.fileIds)\r\n this.$emit('on-success', this.fileResponseData)\r\n } else {\r\n console.log('File already exists or invalid fileID, skip adding')\r\n }\r\n } else {\r\n // 单文件模式:替换文件列表\r\n if (fileID) {\r\n const fileData = {\r\n ...data,\r\n success: true // 标记为上传成功\r\n }\r\n this.buildedFiles = [fileData]\r\n this.files = [] // 清空上传列表\r\n console.log('Single file updated:', name)\r\n \r\n // 触发 change 事件通知父组件更新 value\r\n this.$emit('change', fileID)\r\n this.$emit('on-success', data)\r\n }\r\n }\r\n }\r\n } catch (error) {\r\n console.error('saveToServerAsyncPage error:', error)\r\n clearInterval(this.saveToServerAsyncPageTimer)\r\n }\r\n },\r\n \r\n // ==================== 文件验证 ====================\r\n \r\n /**\r\n * 验证文件类型\r\n */\r\n validateFileType(file) {\r\n if (!file || !file.name) {\r\n console.log('文件或文件名不存在')\r\n return false\r\n }\r\n \r\n const fileExt = this.getFileExtension(file.name)\r\n console.log('文件扩展名:', fileExt)\r\n \r\n if (this.extensions) {\r\n const allowedExts = this.getAllowedExtensions()\r\n console.log('允许的扩展名:', allowedExts)\r\n \r\n if (!allowedExts.includes(fileExt)) {\r\n console.log('扩展名不在允许列表中')\r\n this.$message.error(`不支持的文件类型 \"${fileExt}\",请上传 ${this.extensions} 格式的文件`)\r\n return false\r\n }\r\n }\r\n \r\n console.log('文件类型验证通过')\r\n return true\r\n },\r\n \r\n /**\r\n * 获取文件扩展名\r\n */\r\n getFileExtension(fileName) {\r\n return fileName.toLowerCase().substring(fileName.lastIndexOf('.'))\r\n },\r\n \r\n /**\r\n * 获取允许的扩展名列表\r\n */\r\n getAllowedExtensions() {\r\n return this.extensions.toLowerCase()\r\n .split(',')\r\n .map(ext => ext.trim().startsWith('.') ? ext.trim() : `.${ext.trim()}`)\r\n },\r\n // ==================== 事件处理 ====================\r\n \r\n /**\r\n * 处理文件输入事件\r\n */\r\n onWatchInputFiles(newFile, oldFile) {\r\n if (newFile && !oldFile) {\r\n this.handleFileAdd(newFile)\r\n } else if (newFile && oldFile) {\r\n this.handleFileUpdate(newFile)\r\n } else if (!newFile && oldFile) {\r\n this.handleFileDelete()\r\n }\r\n \r\n // 激活上传组件\r\n this.activateUploadComponent(newFile, oldFile)\r\n },\r\n \r\n /**\r\n * 生成唯一的随机数\r\n */\r\n generateUniqueRandom() {\r\n // 使用 crypto.getRandomValues 生成更安全的随机数\r\n if (window.crypto && window.crypto.getRandomValues) {\r\n const array = new Uint32Array(1)\r\n window.crypto.getRandomValues(array)\r\n return array[0].toString()\r\n }\r\n // 降级方案:使用 Math.random 结合时间戳\r\n return Math.random().toString(36).substr(2, 9) + Date.now().toString(36)\r\n },\r\n\r\n /**\r\n * 处理文件添加\r\n */\r\n handleFileAdd(newFile) {\r\n // 为每个文件生成唯一的随机数\r\n const uniqueRandom = this.generateUniqueRandom()\r\n newFile.postAction = newFile.postAction + '&_t=' + uniqueRandom\r\n console.log('add file:', newFile)\r\n console.log('extensions:', this.extensions)\r\n console.log('accept:', this.accept)\r\n \r\n // 生成或使用 groupId\r\n this.ensureGroupId()\r\n \r\n // 验证文件类型\r\n if (!this.validateFileType(newFile)) {\r\n this.removeInvalidFile(newFile)\r\n return\r\n }\r\n console.log('文件类型验证通过,继续上传')\r\n },\r\n \r\n /**\r\n * 处理文件更新\r\n */\r\n handleFileUpdate(newFile) {\r\n console.log('update', newFile)\r\n const { success, active, chunk, response } = newFile\r\n \r\n if (chunk && success && !active) {\r\n console.log('chunk end')\r\n this.handleChunkComplete(response, newFile)\r\n }\r\n },\r\n \r\n /**\r\n * 处理文件删除\r\n */\r\n handleFileDelete() {\r\n console.log('delete')\r\n },\r\n \r\n /**\r\n * 确保 groupId 存在\r\n */\r\n ensureGroupId() {\r\n console.log('onWatchInputFiles - multiple:', this.multiple, 'current groupId:', this.groupId)\r\n \r\n if (this.multiple && !this.groupId) {\r\n this.groupId = uuidv4()\r\n console.log('Generated new groupId:', this.groupId)\r\n } else if (this.multiple && this.groupId) {\r\n console.log('Using existing groupId:', this.groupId)\r\n }\r\n },\r\n \r\n /**\r\n * 移除无效文件\r\n */\r\n removeInvalidFile(file) {\r\n console.log('文件类型验证失败,尝试移除文件')\r\n console.log('uploadRef:', this.uploadRef)\r\n console.log('$refs:', this.$refs)\r\n \r\n if (this.$refs[this.uploadRef]) {\r\n this.$refs[this.uploadRef].remove(file)\r\n } else {\r\n console.error('无法找到 uploadRef 引用')\r\n }\r\n },\r\n \r\n /**\r\n * 处理分片上传完成\r\n * @param {Object} response - 上传响应\r\n * @param {Object} uploadingFile - 正在上传的文件对象(可选)\r\n */\r\n handleChunkComplete(response, uploadingFile = null) {\r\n const { data: { file, type } } = response\r\n const payloads = {\r\n filePath: file.match(/\\/cw(.*)/) ? file.match(/\\/cw(.*)/)[0] : void 0,\r\n asyncID: uuidv4(),\r\n groupID: this.groupId,\r\n isDeleteOrigin: false,\r\n toImage: type === 'pdf',\r\n unzip: type === 'zip',\r\n _csrf: localStorage.getItem('token')\r\n }\r\n\r\n const formData = new FormData()\r\n\r\n Object.keys(payloads).forEach(key => {\r\n formData.append(key, payloads[key])\r\n })\r\n \r\n // 将上传文件对象传递给异步保存方法\r\n this.saveToServerAsyncPageTimer = setInterval(() => {\r\n this.saveToServerAsyncPage(formData, uploadingFile)\r\n }, CONSTANTS.SAVE_INTERVAL)\r\n },\r\n \r\n /**\r\n * 激活上传组件\r\n */\r\n activateUploadComponent(newFile, oldFile) {\r\n if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {\r\n if (!this.$refs[this.uploadRef].active) {\r\n this.$refs[this.uploadRef].active = true\r\n }\r\n }\r\n },\r\n \r\n // ==================== 值变化处理 ====================\r\n \r\n /**\r\n * 重置文件状态\r\n */\r\n resetFiles() {\r\n this.files = []\r\n this.buildedFiles = []\r\n // 多选模式下保留或生成 groupId,避免首次上传为空\r\n if (this.multiple) {\r\n if (!this.groupId) {\r\n this.groupId = uuidv4()\r\n console.log('Generated groupId in resetFiles:', this.groupId)\r\n } else {\r\n console.log('Preserve existing groupId in resetFiles:', this.groupId)\r\n }\r\n } else {\r\n this.groupId = null\r\n console.log('Reset groupId to null (single mode)')\r\n }\r\n },\r\n \r\n /**\r\n * 处理多文件模式的值变化\r\n */\r\n async handleMultipleFileValue(value) {\r\n // multiple - value 就是 groupId\r\n // 只有当 groupId 发生变化时才重新获取文件列表(初始化回显)\r\n if (this.groupId !== value) {\r\n this.groupId = value\r\n console.log('Set groupId from external value:', this.groupId)\r\n await this.fetchFilesWithGroupId()\r\n } else {\r\n console.log('GroupId unchanged, skip fetchFilesWithGroupId')\r\n }\r\n },\r\n \r\n /**\r\n * 处理单文件模式的值变化\r\n */\r\n async handleSingleFileValue() {\r\n await this.fetchFileWithFileId()\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .ele-upload__inner {\r\n opacity: 1 !important;\r\n cursor: pointer;\r\n border: 1px dashed var(--idooel-form-title-border-color);\r\n background: var(--idooel-form-upload-bg-color) !important;\r\n &:hover {\r\n border-color: var(--idooel-form-upload-border-hover-color);\r\n }\r\n border-radius: var(--idooel-form-border-radius);\r\n}\r\n.ele-upload__wrapper {\r\n width: 100%;\r\n .ele-upload__area {\r\n padding: 16px;\r\n width: 100%;\r\n height: 80px;\r\n display: flex;\r\n flex-direction: row;\r\n .ele-upload__area--icon {\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n font-size: 16x;\r\n .anticon-cloud-upload {\r\n font-size: 48px;\r\n color: var(--idooel-primary-color);\r\n }\r\n .anticon {\r\n font-size: 48px;\r\n color: var(--idooel-primary-color);\r\n }\r\n }\r\n .ele-upload__area--text {\r\n margin-left: 16px;\r\n .ele-upload__message {\r\n font-size: 16px;\r\n color: var(--idoole-black-088);\r\n text-align: left;\r\n }\r\n .ele-upload__ext {\r\n text-align: left;\r\n font-size: 14px;\r\n color: var(--idoole-black-06);\r\n }\r\n }\r\n }\r\n .ele-files__wrapper {\r\n .ele-file__item {\r\n width: 100%;\r\n margin-top: 8px;\r\n padding: 8px 12px;\r\n border-radius: var(--idooel-form-border-radius);\r\n background: var(--idooel-form-upload-bg-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n .ele-file__suffix--icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 24px;\r\n height: 24px;\r\n }\r\n .ele-file__name {\r\n flex: 1;\r\n text-align: left;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n font-size: 14px;\r\n margin-left: 8px;\r\n cursor: pointer;\r\n .ele-file__inner {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n .ele-file__delete {\r\n margin-left: 8px;\r\n .ele-file__delete--icon {\r\n margin-left: 8px;\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>","::v-deep .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}\n::v-deep .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n::v-deep .ele-upload__inner {\n border-radius: var(--idooel-form-border-radius);\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 });
|
|
6067
6776
|
|
|
6068
6777
|
};
|
|
6069
6778
|
/* scoped */
|
|
6070
|
-
const __vue_scope_id__$t = "data-v-
|
|
6779
|
+
const __vue_scope_id__$t = "data-v-1b3ec41c";
|
|
6071
6780
|
/* module identifier */
|
|
6072
6781
|
const __vue_module_identifier__$t = undefined;
|
|
6073
6782
|
/* functional template */
|
|
@@ -6218,11 +6927,11 @@ __vue_render__$s._withStripped = true;
|
|
|
6218
6927
|
/* style */
|
|
6219
6928
|
const __vue_inject_styles__$s = function (inject) {
|
|
6220
6929
|
if (!inject) return
|
|
6221
|
-
inject("data-v-
|
|
6930
|
+
inject("data-v-d83730f2_0", { source: ".g-select-entity__wrapper[data-v-d83730f2] {\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-d83730f2]:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input[data-v-d83730f2] {\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-d83730f2] {\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-d83730f2] {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input[data-v-d83730f2] {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"g-select-entity__wrapper\" :class=\"disabled ? 'g-select-entity__disabled' : ''\">\r\n <span class=\"select-entity__input\">\r\n <a-tag\r\n v-for=\"(item, inx) in getValueList\"\r\n :key=\"item.value\"\r\n :closable=\"!disabled && !getIsMaxCount\"\r\n @close=\"onClose(...arguments, inx, item)\"\r\n >\r\n {{ item.label }}\r\n </a-tag>\r\n <a-tag v-if=\"getIsMaxCount\">......</a-tag>\r\n </span>\r\n <span class=\"select-entity__addon\" @click=\"onChange\">{{ addonAfter }}</span>\r\n <slot></slot>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-select-entity',\r\n props: {\r\n value: {\r\n type: [Array, Object]\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: true\r\n },\r\n maxCount: {\r\n type: Number,\r\n default: 7\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n addonAfter: {\r\n type: String,\r\n default: '选择'\r\n }\r\n },\r\n computed: {\r\n getValueList () {\r\n if (this.value) {\r\n if (this.multiple) {\r\n return this.getIsMaxCount ? this.value.slice(0, this.maxCount) : this.value\r\n }\r\n return type.isArray(this.value) ? this.value : [this.value]\r\n }\r\n return []\r\n },\r\n getIsMaxCount () {\r\n if (this.value && this.multiple) {\r\n return this.value.length >= this.maxCount\r\n }\r\n return false\r\n }\r\n },\r\n methods: {\r\n onChange () {\r\n if (this.disabled) return\r\n this.$emit('change', this.value)\r\n this.$emit('evoke')\r\n },\r\n onClose (e, inx, props) {\r\n e = window.event || e\r\n e.preventDefault()\r\n if (!this.multiple) {\r\n this.$emit('close', props)\r\n this.$emit('change', null)\r\n return\r\n }\r\n this.value.splice(inx, 1)\r\n this.$emit('close', props)\r\n this.$emit('change', this.value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-select-entity__wrapper {\r\n font-size: 14px;\r\n line-height: 30px;\r\n position: relative;\r\n width: 100%;\r\n display: flex;\r\n color: var(--idoole-black-07);\r\n border-radius: 4px;\r\n border: 1px solid var(--idooel-form-title-border-color);\r\n &:hover {\r\n border-color: var(--idooel-primary-color);\r\n }\r\n .select-entity__input {\r\n padding: 0 11px;\r\n background-color: #fff;\r\n border-radius: 4px;\r\n flex-grow: 1;\r\n min-height: 30px;\r\n text-align: left;\r\n }\r\n .select-entity__addon {\r\n padding: 0 11px;\r\n color: var(--idoole-black-07);\r\n background-color: var(--idoole-black-02);\r\n border-left: 1px solid var(--idooel-form-title-border-color);\r\n cursor: pointer;\r\n min-height: 30px;\r\n white-space: nowrap;\r\n }\r\n}\r\n.has-error .g-select-entity__wrapper {\r\n border-color: var(--idooel-form-border-err-color);\r\n}\r\n.g-select-entity__disabled .select-entity__input {\r\n background-color: var(--idoole-black-02);\r\n}\r\n</style>",".g-select-entity__wrapper {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n\n.has-error .g-select-entity__wrapper {\n border-color: var(--idooel-form-border-err-color);\n}\n\n.g-select-entity__disabled .select-entity__input {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6222
6931
|
|
|
6223
6932
|
};
|
|
6224
6933
|
/* scoped */
|
|
6225
|
-
const __vue_scope_id__$s = "data-v-
|
|
6934
|
+
const __vue_scope_id__$s = "data-v-d83730f2";
|
|
6226
6935
|
/* module identifier */
|
|
6227
6936
|
const __vue_module_identifier__$s = undefined;
|
|
6228
6937
|
/* functional template */
|
|
@@ -6639,11 +7348,11 @@ __vue_render__$p._withStripped = true;
|
|
|
6639
7348
|
/* style */
|
|
6640
7349
|
const __vue_inject_styles__$p = function (inject) {
|
|
6641
7350
|
if (!inject) return
|
|
6642
|
-
inject("data-v-
|
|
7351
|
+
inject("data-v-2872c57a_0", { source: ".ele-modal__footer[data-v-2872c57a] {\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-2872c57a] {\n flex: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <a-modal\r\n :title=\"title\"\r\n :cancelText=\"cancelText\"\r\n :okText=\"okText\"\r\n :closable=\"closable\"\r\n v-model:visible=\"showModal\"\r\n :width=\"width\"\r\n :keyboard=\"false\"\r\n :maskClosable=\"maskClosable\"\r\n :dialogStyle=\"{ top: `${upDownDistance[size]}px` }\"\r\n :bodyStyle=\"{ maxHeight: maxheight, overflowY: 'auto' }\"\r\n :footer=\"showFooter ? undefined : null\"\r\n @cancel=\"handleCancel\"\r\n @ok=\"handleOk\"\r\n >\r\n <slot v-if=\"showModal\"></slot>\r\n <template slot=\"footer\" v-if=\"!showDefaultFooter\">\r\n <div class=\"ele-modal__footer\">\r\n <slot name=\"footer-text\"></slot>\r\n <div class=\"footer-btn__wrapper\">\r\n <ele-button\r\n v-for=\"btn in buttonGroupMeta.elements\"\r\n :type=\"btn.type\"\r\n v-on=\"assignAttrEvents\"\r\n :event-name=\"btn.eventName\"\r\n :key=\"btn.key\">\r\n {{ btn.label }}\r\n </ele-button>\r\n </div>\r\n </div>\r\n </template>\r\n </a-modal>\r\n</template>\r\n<script>\r\nimport { CONTEXT } from '../../utils'\r\nexport default {\r\n name: 'ele-modal',\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: '标题'\r\n },\r\n cancelText: {\r\n type: String,\r\n default: '关闭'\r\n },\r\n okText: {\r\n type: String,\r\n default: '确定'\r\n },\r\n size: {\r\n type: String,\r\n default: 'middle'\r\n },\r\n map: {\r\n type: Object,\r\n default () {\r\n return {}\r\n }\r\n },\r\n closable: {\r\n type: Boolean,\r\n default: true\r\n },\r\n maskClosable: {\r\n type: Boolean,\r\n default: false\r\n },\r\n showFooter: {\r\n type: Boolean,\r\n default: true\r\n },\r\n footer: {\r\n type: Function,\r\n default: null\r\n },\r\n onlyClose: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n // 是否展示组件默认底部按钮\r\n showDefaultFooter: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.$nextTick(() => {\r\n this.showModal = value\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n computed: {\r\n assignAttrEvents () {\r\n const events = this.buttons.reduce((ret, btn) => {\r\n ret[btn.eventName] = (e) => {\r\n this.$emit(btn.eventName || 'click', { ...e, ...this[CONTEXT]() })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events\r\n }\r\n },\r\n buttons () {\r\n const { elements = [] } = this.buttonGroupMeta\r\n return elements\r\n },\r\n width () {\r\n return this.map[this.size]\r\n },\r\n maxheight () {\r\n return `calc(100vh - ${this.upDownDistance[this.size] * 2 + (this.title ? 55 : 0) + (this.showFooter ? 53 : 0) }px`\r\n }\r\n },\r\n data () {\r\n return {\r\n showModal: false\r\n }\r\n },\r\n created () {\r\n let defaultMap = {\r\n small: 480,\r\n middle: 768,\r\n big: 1200\r\n }\r\n this.upDownDistance = {\r\n small: 80,\r\n middle: 80,\r\n big: 40\r\n }\r\n this.map = Object.assign(this.map, defaultMap)\r\n },\r\n methods: {\r\n openModal () {\r\n this.showModal = true\r\n this.removeHidden()\r\n },\r\n handleCancel () {\r\n this.showModal = false\r\n this.$emit('input', this.showModal)\r\n this.$emit('change', this.showModal)\r\n this.removeHidden()\r\n this.$emit('cancel')\r\n },\r\n handleOk () {\r\n this.$emit('ok')\r\n },\r\n removeHidden () {\r\n let ishidden = document.body.style.overflow === 'hidden'\r\n ishidden && (document.body.style.overflow = 'initial')\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ele-modal__footer {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n .footer-btn__wrapper {\r\n flex: 1;\r\n }\r\n}\r\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 });
|
|
6643
7352
|
|
|
6644
7353
|
};
|
|
6645
7354
|
/* scoped */
|
|
6646
|
-
const __vue_scope_id__$p = "data-v-
|
|
7355
|
+
const __vue_scope_id__$p = "data-v-2872c57a";
|
|
6647
7356
|
/* module identifier */
|
|
6648
7357
|
const __vue_module_identifier__$p = undefined;
|
|
6649
7358
|
/* functional template */
|
|
@@ -6729,11 +7438,11 @@ __vue_render__$o._withStripped = true;
|
|
|
6729
7438
|
/* style */
|
|
6730
7439
|
const __vue_inject_styles__$o = function (inject) {
|
|
6731
7440
|
if (!inject) return
|
|
6732
|
-
inject("data-v-
|
|
7441
|
+
inject("data-v-087ae2a9_0", { source: ".ant-checkbox-group[data-v-087ae2a9] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-checkbox-group[data-v-087ae2a9] .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group[data-v-087ae2a9] .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <a-checkbox-group\r\n :value=\"value\"\r\n :options=\"dataSource\" \r\n :disabled=\"disabled\" \r\n @change=\"onChange\">\r\n </a-checkbox-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-checkbox',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: Array\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n onChange (value) {\r\n this.$emit('change', value)\r\n this.$emit('input', value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-checkbox-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-checkbox-group {\r\n ::v-deep .ant-checkbox-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-checkbox-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-checkbox-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6733
7442
|
|
|
6734
7443
|
};
|
|
6735
7444
|
/* scoped */
|
|
6736
|
-
const __vue_scope_id__$o = "data-v-
|
|
7445
|
+
const __vue_scope_id__$o = "data-v-087ae2a9";
|
|
6737
7446
|
/* module identifier */
|
|
6738
7447
|
const __vue_module_identifier__$o = undefined;
|
|
6739
7448
|
/* functional template */
|
|
@@ -6828,11 +7537,11 @@ __vue_render__$n._withStripped = true;
|
|
|
6828
7537
|
/* style */
|
|
6829
7538
|
const __vue_inject_styles__$n = function (inject) {
|
|
6830
7539
|
if (!inject) return
|
|
6831
|
-
inject("data-v-
|
|
7540
|
+
inject("data-v-3e01936f_0", { source: ".ant-radio-group[data-v-3e01936f] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-3e01936f] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-3e01936f] .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <a-radio-group :value=\"value\" @change=\"onChange\" :disabled=\"disabled\">\r\n <a-radio v-for=\"item in dataSource\" :key=\"item.value\" :value=\"item.value\">\r\n {{ item.label }}\r\n </a-radio>\r\n </a-radio-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-radio',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Array, Number]\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n watch: {\r\n value (val) {\r\n console.log('valvalval', val)\r\n }\r\n },\r\n methods: {\r\n onChange (e) {\r\n this.$emit('change', e.target.value)\r\n this.$emit('input', e.target.value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-radio-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-radio-group {\r\n ::v-deep .ant-radio-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-radio-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-radio-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-radio-group ::v-deep .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group ::v-deep .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6832
7541
|
|
|
6833
7542
|
};
|
|
6834
7543
|
/* scoped */
|
|
6835
|
-
const __vue_scope_id__$n = "data-v-
|
|
7544
|
+
const __vue_scope_id__$n = "data-v-3e01936f";
|
|
6836
7545
|
/* module identifier */
|
|
6837
7546
|
const __vue_module_identifier__$n = undefined;
|
|
6838
7547
|
/* functional template */
|
|
@@ -6992,12 +7701,12 @@ __vue_render__$m._withStripped = true;
|
|
|
6992
7701
|
/* style */
|
|
6993
7702
|
const __vue_inject_styles__$m = function (inject) {
|
|
6994
7703
|
if (!inject) return
|
|
6995
|
-
inject("data-v-
|
|
6996
|
-
,inject("data-v-
|
|
7704
|
+
inject("data-v-5cdc3f9f_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 })
|
|
7705
|
+
,inject("data-v-5cdc3f9f_1", { source: ".ele-batch-export__content[data-v-5cdc3f9f] {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container[data-v-5cdc3f9f] {\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-5cdc3f9f] {\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-5cdc3f9f] {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn[data-v-5cdc3f9f] {\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-5cdc3f9f] {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message[data-v-5cdc3f9f] {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <ele-modal \r\n v-model=\"innerValue\" \r\n v-on=\"$listeners\"\r\n :buttonGroupMeta=\"buttonGroupMeta\" \r\n title=\"批量导出\">\r\n <div class=\"ele-batch-export__content\">\r\n <div class=\"ele-batch-export__container\">\r\n <ele-icon class=\"ele-batch-export__icon\" type=\"download\"></ele-icon>\r\n <div class=\"ele-batch-export__handle\">\r\n <div class=\"ele-batch-export__btn\" @click=\"handleClick\">导出任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>\r\n <div class=\"ele-batch-export__btn--hint\">批处理任务的准备工作会在后台运行</div>\r\n </div>\r\n </div>\r\n <div class=\"ele-batch-export__message\">\r\n 您可以请点击上方按钮查看任务进度或关闭弹框\r\n </div>\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-batch-export',\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n elements: [\r\n {\r\n label: '关闭',\r\n key: 'close',\r\n type: 'primary',\r\n eventName: 'handleClose'\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n innerValue: false\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.$nextTick(() => {\r\n this.innerValue = value\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n handleClick () {\r\n this.$emit('on-batch-export')\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-batch-export__content {\r\n height: 106px;\r\n .ele-batch-export__container {\r\n border-width: 1px;\r\n border-style: dashed;\r\n height: 80px;\r\n border-color: var(--idooel-link-06);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: 0 16px;\r\n .ele-batch-export__icon {\r\n font-size: 48px;\r\n color: var(--idooel-link-06);\r\n }\r\n .ele-batch-export__handle {\r\n margin-left: 16px;\r\n .ele-batch-export__btn {\r\n color: var(--idooel-link-06);\r\n font-size: 16px;\r\n cursor: pointer;\r\n }\r\n .ele-batch-export__btn--hint {\r\n color: var(--idooel-link-03);\r\n font-size: 14px;\r\n }\r\n }\r\n }\r\n .ele-batch-export__message {\r\n color: var(--idooel-link-06);\r\n font-size: 14px;\r\n }\r\n}\r\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 });
|
|
6997
7706
|
|
|
6998
7707
|
};
|
|
6999
7708
|
/* scoped */
|
|
7000
|
-
const __vue_scope_id__$m = "data-v-
|
|
7709
|
+
const __vue_scope_id__$m = "data-v-5cdc3f9f";
|
|
7001
7710
|
/* module identifier */
|
|
7002
7711
|
const __vue_module_identifier__$m = undefined;
|
|
7003
7712
|
/* functional template */
|
|
@@ -7090,11 +7799,11 @@ __vue_render__$l._withStripped = true;
|
|
|
7090
7799
|
/* style */
|
|
7091
7800
|
const __vue_inject_styles__$l = function (inject) {
|
|
7092
7801
|
if (!inject) return
|
|
7093
|
-
inject("data-v-
|
|
7802
|
+
inject("data-v-28d8d270_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
7094
7803
|
|
|
7095
7804
|
};
|
|
7096
7805
|
/* scoped */
|
|
7097
|
-
const __vue_scope_id__$l = "data-v-
|
|
7806
|
+
const __vue_scope_id__$l = "data-v-28d8d270";
|
|
7098
7807
|
/* module identifier */
|
|
7099
7808
|
const __vue_module_identifier__$l = undefined;
|
|
7100
7809
|
/* functional template */
|
|
@@ -7311,12 +8020,12 @@ __vue_render__$k._withStripped = true;
|
|
|
7311
8020
|
/* style */
|
|
7312
8021
|
const __vue_inject_styles__$k = function (inject) {
|
|
7313
8022
|
if (!inject) return
|
|
7314
|
-
inject("data-v-
|
|
7315
|
-
,inject("data-v-37f84a14_1", { source: ".ele-timeline__wrapper[data-v-37f84a14] {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item[data-v-37f84a14] {\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-37f84a14] {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left[data-v-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14]::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-37f84a14]::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-37f84a14]::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-37f84a14]::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper[data-v-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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-37f84a14] {\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/OnlineStudy/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 });
|
|
8023
|
+
inject("data-v-717789a6_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 })
|
|
8024
|
+
,inject("data-v-717789a6_1", { source: ".ele-timeline__wrapper[data-v-717789a6] {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item[data-v-717789a6] {\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-717789a6] {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left[data-v-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6]::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-717789a6]::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-717789a6]::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-717789a6]::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper[data-v-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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-717789a6] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele-timeline__wrapper\">\r\n <div class=\"ele-timeline__item\" v-for=\"item in innerDataSource\" :key=\"item.key\">\r\n <div class=\"ele-timeline__left\">\r\n <div class=\"titleline-left__date\">{{ item.date }}</div>\r\n </div>\r\n <div class=\"ele-timeline__middle\">\r\n <div class=\"ele-timeline__circle\"></div>\r\n <div class=\"ele-timeline__traline\"></div>\r\n </div>\r\n <div class=\"ele-timeline__right\">\r\n <slot v-if=\"$scopedSlots.right\" name=\"right\" :data=\"item\"></slot>\r\n <template v-else>\r\n <div class=\"timeline-right__title\">\r\n <span class=\"title\">{{ item.title }}</span>\r\n <span :class=\"['title-info', item.state == 1 && 'success', item.state == 2 && 'warning', item.state == 3 && 'error']\">{{ item.stateName }}</span>\r\n </div>\r\n <div class=\"timeline-right__oper\">\r\n 由\r\n <span class=\"oper-name\">{{ item.userName }}</span>\r\n 操作\r\n </div>\r\n <div class=\"timeline-right__subtitle\" v-for=\"label in item.labelList\" :key=\"label.value\">\r\n <div class=\"right-subtitle__field\">{{ label.label }}:</div>\r\n <div class=\"right-subtitle__content\">{{ label.value }}</div>\r\n </div>\r\n </template>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { net, type } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { CONTEXT, parseFieldMap } from '../../utils'\r\nexport default {\r\n name: 'ele-timeline',\r\n props: {\r\n url: {\r\n type: String\r\n },\r\n params: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n requestType: {\r\n type: String,\r\n default: 'GET'\r\n },\r\n fieldMap: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n params: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => ([\r\n // {\r\n // date: '2023/05/09 03:34:56',\r\n // title: 123,\r\n // state: 1,\r\n // stateName: '成功',\r\n // userName: 'Name',\r\n // labelList: [\r\n // {\r\n // label: 'label',\r\n // value: 'value'\r\n // }\r\n // ],\r\n // action: '结班',\r\n // opinion: '意见'\r\n // }\r\n ])\r\n }\r\n },\r\n data () {\r\n return {\r\n innerDataSource: []\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n computed: {\r\n expressionData () {\r\n return {\r\n _route: this.$route.query,\r\n ...this[CONTEXT]()\r\n }\r\n }\r\n },\r\n async created() {\r\n if (this.url) {\r\n this.innerDataSource = await this.requestData()\r\n } else if (!type.isEmpty(this.dataSource)) {\r\n this.innerDataSource = this.dataSource\r\n } else {\r\n console.warn('ele-timeline: 请传入数据源')\r\n }\r\n },\r\n methods: {\r\n async requestData () {\r\n const ret = await net[this.requestType.toLowerCase()](\r\n this.url,\r\n { ...this.params, ...parseFieldMap(this.fieldMap, this.expressionData) }\r\n ).then(resp => {\r\n const { data } = resp || {}\r\n return data.map(item => {\r\n return {\r\n key: uuidv4(),\r\n ...item\r\n }\r\n })\r\n })\r\n return ret\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-timeline__wrapper {\r\n width: 100%;\r\n height: 100%;\r\n .ele-timeline__item {\r\n display: flex;\r\n flex-direction: row;\r\n &:last-child {\r\n .ele-timeline__middle {\r\n .ele-timeline__traline {\r\n display: none;\r\n }\r\n }\r\n }\r\n .ele-timeline__left {\r\n flex: 1;\r\n padding-right: 12px;\r\n padding-top: 16px;\r\n padding-bottom: 16px;\r\n text-align: right;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: end;\r\n .titleline-left__date {\r\n width: 100px;\r\n font-size: 14px;\r\n color: var(--idoole-black-064);\r\n }\r\n }\r\n .ele-timeline__middle {\r\n width: 10px;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n transform: translate(0, 20px);\r\n .ele-timeline__circle {\r\n width: 100%;\r\n height: 10px;\r\n border-radius: 50%;\r\n border-width: 2px;\r\n border-style: solid;\r\n border-color: var(--idooel-primary-color);\r\n }\r\n .ele-timeline__traline {\r\n width: 1px;\r\n height: calc(100% - 10px);\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: var(--idoole-black-016);\r\n }\r\n }\r\n .ele-timeline__right {\r\n text-align: left;\r\n flex: 2;\r\n padding-left: 12px;\r\n padding-top: 16px;\r\n padding-bottom: 16px;\r\n .timeline-right__title {\r\n line-height: 22px;\r\n display: flex;\r\n flex-direction: row;\r\n .title {\r\n color: var(--idoole-black-088);\r\n font-size: 14px;\r\n font-weight: bold;\r\n }\r\n .title-info {\r\n font-size: 14px;\r\n color: var(--idoole-black-064);\r\n margin-left: 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &::before {\r\n content: '';\r\n display: inline-block;\r\n width: 6px;\r\n height: 6px;\r\n border-radius: 50%;\r\n margin-right: 8px;\r\n }\r\n &.success {\r\n &::before {\r\n background: var(--idoole-success-06);\r\n }\r\n }\r\n &.warning {\r\n &::before {\r\n background: var(--idoole-warning-06);\r\n }\r\n }\r\n &.error {\r\n &::before {\r\n background: var(--idoole-error-06);\r\n }\r\n }\r\n }\r\n }\r\n .timeline-right__oper {\r\n line-height: 22px;\r\n margin-top: 8px;\r\n margin-left: 12px;\r\n .oper-name {\r\n color: var(--idoole-black-088);\r\n font-size: 14px;\r\n font-weight: bold;\r\n }\r\n }\r\n .timeline-right__subtitle {\r\n margin-left: 12px;\r\n display: flex;\r\n flex-direction: row;\r\n line-height: 22px;\r\n margin-top: 4px;\r\n .right-subtitle__field {\r\n flex-shrink: 0;\r\n font-size: 14px;\r\n color: var(--idoole-black-064);\r\n }\r\n .right-subtitle__content {\r\n font-size: 14px;\r\n color: var(--idoole-black-088);\r\n font-weight: bold;\r\n margin-left: 4px;\r\n }\r\n }\r\n }\r\n }\r\n}\r\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 });
|
|
7316
8025
|
|
|
7317
8026
|
};
|
|
7318
8027
|
/* scoped */
|
|
7319
|
-
const __vue_scope_id__$k = "data-v-
|
|
8028
|
+
const __vue_scope_id__$k = "data-v-717789a6";
|
|
7320
8029
|
/* module identifier */
|
|
7321
8030
|
const __vue_module_identifier__$k = undefined;
|
|
7322
8031
|
/* functional template */
|
|
@@ -7394,11 +8103,11 @@ __vue_render__$j._withStripped = true;
|
|
|
7394
8103
|
/* style */
|
|
7395
8104
|
const __vue_inject_styles__$j = function (inject) {
|
|
7396
8105
|
if (!inject) return
|
|
7397
|
-
inject("data-v-
|
|
8106
|
+
inject("data-v-45452493_0", { source: ".ele-text__wrapper[data-v-45452493] {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-text__wrapper.default .anticon[data-v-45452493], .ele-text__wrapper.default .message[data-v-45452493] {\n color: var(--idoole-black-064);\n}\n.ele-text__wrapper .anticon[data-v-45452493] {\n font-size: 16px;\n}\n.ele-text__wrapper .message[data-v-45452493] {\n font-size: 14px;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div :class=\"['ele-text__wrapper', type]\">\r\n <ele-icon theme=\"filled\" :type=\"icon\"></ele-icon>\r\n <span class=\"message\">{{ message }}</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-text',\r\n props: {\r\n type: {\r\n String,\r\n // default success error warning info\r\n default: 'default'\r\n },\r\n message: {\r\n type: String\r\n }\r\n },\r\n computed: {\r\n icon() {\r\n return 'info-circle'\r\n }\r\n },\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n//\r\n.ele-text__wrapper {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.default {\r\n .anticon, .message {\r\n color: var(--idoole-black-064);\r\n }\r\n }\r\n .anticon {\r\n font-size: 16px;\r\n }\r\n .message {\r\n font-size: 14px;\r\n margin-left: 4px;\r\n }\r\n}\r\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 });
|
|
7398
8107
|
|
|
7399
8108
|
};
|
|
7400
8109
|
/* scoped */
|
|
7401
|
-
const __vue_scope_id__$j = "data-v-
|
|
8110
|
+
const __vue_scope_id__$j = "data-v-45452493";
|
|
7402
8111
|
/* module identifier */
|
|
7403
8112
|
const __vue_module_identifier__$j = undefined;
|
|
7404
8113
|
/* functional template */
|
|
@@ -7535,11 +8244,11 @@ __vue_render__$i._withStripped = true;
|
|
|
7535
8244
|
/* style */
|
|
7536
8245
|
const __vue_inject_styles__$i = function (inject) {
|
|
7537
8246
|
if (!inject) return
|
|
7538
|
-
inject("data-v-
|
|
8247
|
+
inject("data-v-9485b23c_0", { source: "[data-v-9485b23c] .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div>\r\n <a-tabs :default-active-key=\"activeKey\" :tabBarGutter=\"tabBarGutter\" :tabBarStyle=\"tabBarStyle\" @change=\"changeHandle\">\r\n <a-tab-pane v-for=\"(item, index) in tabsList\" :key=\"index\" :tab=\"item.tabName\" :disabled=\"item.disabled\">\r\n <template #tab>\r\n <component v-if=\"item.renderHeader\" :is=\"item.renderHeader\" ></component>\r\n <span v-else>{{ item.tabName }}</span>\r\n </template>\r\n <component :is=\"item.content\"></component>\r\n </a-tab-pane>\r\n </a-tabs>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tabs',\r\n components: {},\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n activeKey: {\r\n type: Number,\r\n default: 0\r\n },\r\n tabsList: {\r\n type: Array,\r\n default () {\r\n return []\r\n }\r\n },\r\n tabBarStyle: {\r\n type: Object,\r\n default () {\r\n return {}\r\n }\r\n },\r\n tabBarGutter: {\r\n type: Number\r\n }\r\n },\r\n methods: {\r\n changeHandle (key) {\r\n this.$emit('changeActiveKey', key)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .ant-tabs-nav-scroll {\r\n float: left !important;\r\n}\r\n</style>","::v-deep .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7539
8248
|
|
|
7540
8249
|
};
|
|
7541
8250
|
/* scoped */
|
|
7542
|
-
const __vue_scope_id__$i = "data-v-
|
|
8251
|
+
const __vue_scope_id__$i = "data-v-9485b23c";
|
|
7543
8252
|
/* module identifier */
|
|
7544
8253
|
const __vue_module_identifier__$i = undefined;
|
|
7545
8254
|
/* functional template */
|
|
@@ -11560,11 +12269,11 @@ __vue_render__$h._withStripped = true;
|
|
|
11560
12269
|
/* style */
|
|
11561
12270
|
const __vue_inject_styles__$h = function (inject) {
|
|
11562
12271
|
if (!inject) return
|
|
11563
|
-
inject("data-v-32a219d1_0", { source: "[data-v-32a219d1] .ant-modal-body {\n padding: 16px;\n}\n[data-v-32a219d1] .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper[data-v-32a219d1] {\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-32a219d1] {\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-32a219d1] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-32a219d1] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-32a219d1] .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-32a219d1] .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-32a219d1] .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-32a219d1] {\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-32a219d1] {\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-32a219d1] {\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-32a219d1] {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span[data-v-32a219d1] {\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-32a219d1] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item[data-v-32a219d1] {\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-32a219d1] {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error[data-v-32a219d1] {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2[data-v-32a219d1] {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon[data-v-32a219d1] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/OnlineStudy/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 });
|
|
12272
|
+
inject("data-v-3676b54c_0", { source: "[data-v-3676b54c] .ant-modal-body {\n padding: 16px;\n}\n[data-v-3676b54c] .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper[data-v-3676b54c] {\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-3676b54c] {\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-3676b54c] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-3676b54c] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-3676b54c] .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-3676b54c] .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-3676b54c] .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-3676b54c] {\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-3676b54c] {\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-3676b54c] {\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-3676b54c] {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span[data-v-3676b54c] {\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-3676b54c] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item[data-v-3676b54c] {\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-3676b54c] {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error[data-v-3676b54c] {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2[data-v-3676b54c] {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon[data-v-3676b54c] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div>\r\n <ele-modal\r\n :ref=\"getEleModal\"\r\n :title=\"title\"\r\n :cancelText=\"cancelText\"\r\n :maskClosable=\"maskClosable\"\r\n v-on=\"$listeners\"\r\n :size=\"size\"\r\n :value=\"value\"\r\n @ok=\"handleOk\"\r\n @cancel=\"handleCancel\"\r\n :showDefaultFooter=\"true\"\r\n >\r\n <div class=\"ele-imgCrop__wrapper\">\r\n <div class=\"ele-imgCrop__left ele-imgCrop__item\">\r\n <div class=\"ele-imgCrop__noImg\">\r\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>\r\n <template v-else>\r\n <img :ref=\"leftImage\" class=\"img-crop-left__image\" :src=\"imageUrl\" alt=\"\">\r\n </template>\r\n </div>\r\n <div class=\"margin-t-8\">\r\n <span v-if=\"imgtips\" class=\"ele-imgCrop__font1 ele-imgCrop__tips\" :class=\"isFail? 'ele-imgCrop__error' : ''\">{{ imgtips }}</span>\r\n <template v-else>\r\n <span class=\"ele-imgCrop__font1\">{{ fileName }}</span>\r\n <a-icon v-if=\"fileId || fileName\" @click=\"handleClickDeleteFile\" type=\"close\" style=\"cursor: pointer;float: right; line-height: 24px;\"/>\r\n </template>\r\n </div>\r\n </div>\r\n <div class=\"ele-imgCrop__right ele-imgCrop__item\">\r\n <span v-if=\"!fileId\" class=\"ele-imgCrop__font2\">左侧上传图片后可预览</span>\r\n <template v-else>\r\n <img class=\"img-crop-right__image\" :src=\"previewBase\" alt=\"\">\r\n </template>\r\n </div>\r\n </div>\r\n </ele-modal>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport Cropper from 'cropperjs'\r\nimport { util, net } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-modal-img-crop',\r\n model: {\r\n event: 'input',\r\n prop: 'value'\r\n },\r\n props: {\r\n title: {\r\n type: String,\r\n default: '图像裁剪'\r\n },\r\n uploadFileConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n size: 10,\r\n accept: '*',\r\n byteConversion: 1024 * 1024\r\n }\r\n }\r\n },\r\n imageId: {\r\n type: String\r\n },\r\n maskClosable: {\r\n type: Boolean,\r\n default () {\r\n return false\r\n }\r\n },\r\n size: {\r\n type: String,\r\n default () {\r\n return 'big'\r\n }\r\n },\r\n value: {\r\n type: Boolean,\r\n default () {\r\n return false\r\n }\r\n },\r\n cropperConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n aspectRatio: 16 / 9\r\n }\r\n }\r\n }\r\n },\r\n data () {\r\n return {\r\n haveImg: false,\r\n imgtips: null,\r\n isFail: false,\r\n cancelText: '取消',\r\n fileName: null,\r\n fileId: null,\r\n previewBase: null,\r\n cropper: null\r\n }\r\n },\r\n computed: {\r\n leftImage () {\r\n return uuidv4()\r\n },\r\n imageUrl () {\r\n return `/api-file/workbench/file/stream/${this.fileId}?origin=true`\r\n },\r\n getEleModal () {\r\n return uuidv4()\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.fileId = this.imageId\r\n if (value && this.fileId) {\r\n setTimeout(() => {\r\n this.initCropper()\r\n })\r\n }\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n handleCancel () {\r\n this.$emit('input', false)\r\n this.$emit('change', this.fileId)\r\n },\r\n handleClickDeleteFile () {\r\n this.fileId = null\r\n this.fileName = null\r\n this.cropper && this.cropper.destroy()\r\n },\r\n blobToFile(blob, fileName = 'file.png') {\r\n return new File([blob], fileName, {\r\n type: blob.type,\r\n lastModified: Date.now()\r\n })\r\n },\r\n handleOk () {\r\n this.cropper && this.cropper.getCroppedCanvas().toBlob(async (blob) => {\r\n await this.uploadFile(this.blobToFile(blob, this.fileName))\r\n this.$emit('input', false)\r\n this.$emit('change', this.fileId)\r\n })\r\n },\r\n async uploadFile (file) {\r\n const formData = new FormData()\r\n formData.append('serviceCode', 'cover-image')\r\n formData.append('_t', Math.random())\r\n formData.append('file', file)\r\n await net.post(\r\n 'zuul/api-file/workbench/file' + '?_csrf=' + localStorage.getItem('token'),\r\n formData\r\n ).then((resp) => {\r\n const { data: { fileID } } = resp\r\n this.fileId = fileID\r\n })\r\n },\r\n initCropper () {\r\n let previewReady = false\r\n this.cropper = new Cropper(this.$refs[this.leftImage], {\r\n aspectRatio: this.cropperConfig.aspectRatio,\r\n ready: () => {\r\n previewReady = true\r\n },\r\n crop: util.debounce(() => {\r\n if (!previewReady) {\r\n return\r\n }\r\n this.previewBase = this.cropper.getCroppedCanvas().toDataURL()\r\n }, 200)\r\n })\r\n },\r\n onUploadFileSuccess (props) {\r\n const { response: { data: { fileID } }, name } = props\r\n this.fileId = fileID\r\n this.fileName = name\r\n this.$nextTick(() => {\r\n this.initCropper()\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .ant-modal-body {\r\n padding: 16px;\r\n}\r\n::v-deep .ant-modal-header {\r\n padding: 16px;\r\n}\r\n.ele-imgCrop__wrapper {\r\n display: flex;\r\n gap: 16px;\r\n justify-content: center;\r\n margin-bottom: 30px;\r\n .ele-imgCrop__left {\r\n .ele-imgCrop__noImg {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n .img-crop-left__image {\r\n width: 100%;\r\n height: 100%;\r\n }\r\n .ele-img-crop__upload {\r\n width: 100%;\r\n height: 100%;\r\n ::v-deep .ele-upload__inner {\r\n height: 100%;\r\n border: unset;\r\n background: transparent !important;\r\n .ele-upload__area {\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n align-items: center;\r\n justify-content: center;\r\n .ele-upload__area--text {\r\n margin-top: 16px;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n }\r\n }\r\n }\r\n }\r\n .ele-imgCrop__font1 {\r\n color: var(--idoole-black-088);\r\n font-size: 16px;\r\n line-height: 24px !important;\r\n }\r\n .ele-imgCrop__font2 {\r\n color: var(--idoole-black-06);\r\n font-size: 14px;\r\n line-height: 22px; \r\n }\r\n }\r\n .ele-imgCrop__update {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n opacity: 0;\r\n cursor: pointer;\r\n }\r\n }\r\n .ele-imgCrop__right {\r\n position: relative;\r\n span {\r\n position: absolute;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -50%);\r\n }\r\n .img-crop-right__image {\r\n width: 100%;\r\n height: 100%;\r\n }\r\n }\r\n .ele-imgCrop__item {\r\n width: 480px;\r\n height: 300px;\r\n border-radius: 2px;\r\n border: 1px dashed var(--idooel-form-title-border-color);\r\n background: var(--idooel-form-upload-bg-color);\r\n }\r\n}\r\n.ele-imgCrop__tips {\r\n float: left;\r\n width: 80%;\r\n}\r\n.ele-imgCrop__error {\r\n color: var(--idooel-form-border-err-color) !important;\r\n}\r\n.ele-imgCrop__error2 {\r\n color: var(--idooel-img-crop-err-color) !important;\r\n}\r\n.ele-imgCrop__icon {\r\n font-size: 48px;\r\n color: var(--idooel-link-06);\r\n}\r\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 });
|
|
11564
12273
|
|
|
11565
12274
|
};
|
|
11566
12275
|
/* scoped */
|
|
11567
|
-
const __vue_scope_id__$h = "data-v-
|
|
12276
|
+
const __vue_scope_id__$h = "data-v-3676b54c";
|
|
11568
12277
|
/* module identifier */
|
|
11569
12278
|
const __vue_module_identifier__$h = undefined;
|
|
11570
12279
|
/* functional template */
|
|
@@ -11669,11 +12378,11 @@ __vue_render__$g._withStripped = true;
|
|
|
11669
12378
|
/* style */
|
|
11670
12379
|
const __vue_inject_styles__$g = function (inject) {
|
|
11671
12380
|
if (!inject) return
|
|
11672
|
-
inject("data-v-
|
|
12381
|
+
inject("data-v-05b001f6_0", { source: ".ele-editor__bottom[data-v-05b001f6] {\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-05b001f6] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele-editor__wrapper\" :style=\"{width: editorWidth, height: editorHeight}\">\r\n <Vueditor :ref=\"getVueditor\" :style=\"{width: editorWidth, height: editorHeight}\"></Vueditor>\r\n <div class=\"ele-editor__bottom\">\r\n <span>{{ innerContent.length }}字</span>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v4 as uuidv4 } from 'uuid'\r\nexport default {\r\n name: 'ele-text-editor',\r\n props: {\r\n editorWidth: {\r\n type: String\r\n },\r\n editorHeight: {\r\n type: String\r\n },\r\n maxLength: {\r\n type: Number,\r\n default () {\r\n return 10\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n editorConfig: {},\r\n textEditorRef: null\r\n }\r\n },\r\n computed: {\r\n innerContent () {\r\n let content = this.textEditorRef ? this.textEditorRef.getContent() : ''\r\n if (this.textEditorRef && content.length > this.maxLength) {\r\n content = content.substring(0, this.maxLength)\r\n this.$nextTick(() => {\r\n this.textEditorRef.setContent(content)\r\n })\r\n }\r\n this.$emit('input', content)\r\n return content\r\n },\r\n getVueditor () {\r\n return uuidv4()\r\n }\r\n },\r\n watch: {},\r\n methods: {},\r\n mounted () {\r\n this.textEditorRef = this.$refs[this.getVueditor]\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-editor__bottom {\r\n height: 40px;\r\n padding: 8px 20px 8px 8px;\r\n border: 1px solid var(--idooel-form-title-border-color);\r\n border-top: 0px;\r\n span {\r\n color: var(--idoole-black-088);\r\n text-align: right;\r\n font-size: 12px;\r\n line-height: 20px;\r\n width: 100%;\r\n display: inline-block;\r\n }\r\n}\r\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 });
|
|
11673
12382
|
|
|
11674
12383
|
};
|
|
11675
12384
|
/* scoped */
|
|
11676
|
-
const __vue_scope_id__$g = "data-v-
|
|
12385
|
+
const __vue_scope_id__$g = "data-v-05b001f6";
|
|
11677
12386
|
/* module identifier */
|
|
11678
12387
|
const __vue_module_identifier__$g = undefined;
|
|
11679
12388
|
/* functional template */
|
|
@@ -11779,11 +12488,11 @@ __vue_render__$f._withStripped = true;
|
|
|
11779
12488
|
/* style */
|
|
11780
12489
|
const __vue_inject_styles__$f = function (inject) {
|
|
11781
12490
|
if (!inject) return
|
|
11782
|
-
inject("data-v-
|
|
12491
|
+
inject("data-v-468787f7_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 });
|
|
11783
12492
|
|
|
11784
12493
|
};
|
|
11785
12494
|
/* scoped */
|
|
11786
|
-
const __vue_scope_id__$f = "data-v-
|
|
12495
|
+
const __vue_scope_id__$f = "data-v-468787f7";
|
|
11787
12496
|
/* module identifier */
|
|
11788
12497
|
const __vue_module_identifier__$f = undefined;
|
|
11789
12498
|
/* functional template */
|
|
@@ -11842,11 +12551,11 @@ __vue_render__$e._withStripped = true;
|
|
|
11842
12551
|
/* style */
|
|
11843
12552
|
const __vue_inject_styles__$e = function (inject) {
|
|
11844
12553
|
if (!inject) return
|
|
11845
|
-
inject("data-v-
|
|
12554
|
+
inject("data-v-3750a094_0", { source: ".g-loading[data-v-3750a094] {\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-3750a094 infinite 0.75s linear;\n}\n@keyframes rotate-data-v-3750a094 {\n0% {\n transform: rotate(0);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div v-if=\"loading\" class=\"g-loading\">\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-loading',\r\n props: {\r\n loading: {\r\n type: Boolean,\r\n default: true\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-loading {\r\n width: 16px;\r\n height: 16px;\r\n border: 1px solid #409EFF;\r\n border-top-color: transparent;\r\n border-left-color: transparent;\r\n border-radius: 100%;\r\n animation: rotate infinite 0.75s linear;\r\n}\r\n@keyframes rotate {\r\n 0% {\r\n transform: rotate(0);\r\n }\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}\r\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 });
|
|
11846
12555
|
|
|
11847
12556
|
};
|
|
11848
12557
|
/* scoped */
|
|
11849
|
-
const __vue_scope_id__$e = "data-v-
|
|
12558
|
+
const __vue_scope_id__$e = "data-v-3750a094";
|
|
11850
12559
|
/* module identifier */
|
|
11851
12560
|
const __vue_module_identifier__$e = undefined;
|
|
11852
12561
|
/* functional template */
|
|
@@ -12041,11 +12750,11 @@ __vue_render__$d._withStripped = true;
|
|
|
12041
12750
|
/* style */
|
|
12042
12751
|
const __vue_inject_styles__$d = function (inject) {
|
|
12043
12752
|
if (!inject) return
|
|
12044
|
-
inject("data-v-
|
|
12753
|
+
inject("data-v-8b1c2320_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
12045
12754
|
|
|
12046
12755
|
};
|
|
12047
12756
|
/* scoped */
|
|
12048
|
-
const __vue_scope_id__$d = "data-v-
|
|
12757
|
+
const __vue_scope_id__$d = "data-v-8b1c2320";
|
|
12049
12758
|
/* module identifier */
|
|
12050
12759
|
const __vue_module_identifier__$d = undefined;
|
|
12051
12760
|
/* functional template */
|
|
@@ -12107,11 +12816,11 @@ __vue_render__$c._withStripped = true;
|
|
|
12107
12816
|
/* style */
|
|
12108
12817
|
const __vue_inject_styles__$c = function (inject) {
|
|
12109
12818
|
if (!inject) return
|
|
12110
|
-
inject("data-v-
|
|
12819
|
+
inject("data-v-45e85742_0", { source: ".g-search__label[data-v-45e85742] {\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-45e85742], .g-search__label .label__suffix[data-v-45e85742] {\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-45e85742] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"g-search__label\">\r\n <span class=\"label__title\">{{ label }}</span>\r\n <span class=\"label__suffix\">:</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n label: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-search__label {\r\n /* width: 69px; */\r\n flex-basis: 69px;\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n .label__title, .label__suffix {\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.88);\r\n white-space: nowrap;\r\n }\r\n .label__suffix {\r\n margin-left: 4px;\r\n }\r\n}\r\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
|
|
12111
12820
|
|
|
12112
12821
|
};
|
|
12113
12822
|
/* scoped */
|
|
12114
|
-
const __vue_scope_id__$c = "data-v-
|
|
12823
|
+
const __vue_scope_id__$c = "data-v-45e85742";
|
|
12115
12824
|
/* module identifier */
|
|
12116
12825
|
const __vue_module_identifier__$c = undefined;
|
|
12117
12826
|
/* functional template */
|
|
@@ -12196,6 +12905,7 @@ var script$b = {
|
|
|
12196
12905
|
return dataSource;
|
|
12197
12906
|
},
|
|
12198
12907
|
buildDefaultValue(arg) {
|
|
12908
|
+
if (type.isFunction(arg)) return arg.call(this);
|
|
12199
12909
|
if (type.notStr(arg)) return arg;
|
|
12200
12910
|
if (!arg || arg.charAt(0) !== '_') return arg;
|
|
12201
12911
|
return parse$1(arg, {
|
|
@@ -12498,11 +13208,11 @@ __vue_render__$b._withStripped = true;
|
|
|
12498
13208
|
/* style */
|
|
12499
13209
|
const __vue_inject_styles__$b = function (inject) {
|
|
12500
13210
|
if (!inject) return
|
|
12501
|
-
inject("data-v-76332be9_0", { source: ".search-area__wrapper[data-v-76332be9] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-76332be9] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-76332be9] {\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-76332be9] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-76332be9] {\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-76332be9] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-76332be9] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/OnlineStudy/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\" :init=\"item.init\" :mode=\"item.mode\" :code=\"item.code\" :params=\"item.params\" :url=\"item.url\" :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 });
|
|
13211
|
+
inject("data-v-77b7e5ba_0", { source: ".search-area__wrapper[data-v-77b7e5ba] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-77b7e5ba] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-77b7e5ba] {\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-77b7e5ba] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-77b7e5ba] {\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-77b7e5ba] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-77b7e5ba] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyMA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACxMA;AD0MA;EACA,YAAA;ACxMA;AD2MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACzMA;AD0MA;EACA,oBAAA;ACxMA;AD0MA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACxMA;ADyMA;EACA,eAAA;ACvMA;ADyMA;EACA,eAAA;EACA,gBAAA;ACvMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <template v-for=\"(item, idx) in innerDataSource\">\r\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n <div v-if=\"innerDataSource.length > cuttingFormula + 1\" class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\r\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\r\n <span class=\"expand-collapse__icon\">\r\n <a-icon v-if=\"isExpand\" type=\"up\" />\r\n <a-icon v-else type=\"down\" />\r\n </span>\r\n </div>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"(item.type == 'ele-input') || (item.type == 'Input')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"(item.type == 'ele-select') || (item.type == 'Select')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :init=\"item.init\" :mode=\"item.mode\" :code=\"item.code\" :params=\"item.params\" :url=\"item.url\" :multiple=\"item.multiple\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"(item.type == 'ele-date') || (item.type == 'DatePicker')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :placeholder=\"item.placeholder\" :format=\"item.format\"></ele-date>\r\n </template>\r\n <template v-else-if=\"item.type == 'ele-date-range'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date-range v-model=\"item._value\" :format=\"item.format\" :show-time=\"item.showTime\"></ele-date-range>\r\n </template>\r\n </div>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n Label\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n isExpand: false\r\n }\r\n },\r\n computed: {\r\n cuttingFormula () {\r\n return (24 / this.span - 1)\r\n },\r\n buildDataSource () {\r\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\r\n },\r\n innerDataSource () {\r\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\r\n }\r\n },\r\n created() {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n methods: {\r\n controlDisplayByFormula (dataSource = []) {\r\n if (this.isExpand) {\r\n dataSource.forEach(item => {\r\n this.$set(item, '_show', true)\r\n })\r\n } else {\r\n dataSource.forEach((item, idx) => {\r\n if (idx < this.cuttingFormula) {\r\n this.$set(item, '_show', true)\r\n } else {\r\n this.$set(item, '_show', false)\r\n }\r\n })\r\n }\r\n return dataSource\r\n },\r\n buildDefaultValue (arg) {\r\n if (type.isFunction(arg)) return arg.call(this)\r\n if (type.notStr(arg)) return arg\r\n if (!arg || arg.charAt(0) !== '_') return arg\r\n return parse(arg, {\r\n _route: this.$route.query\r\n })\r\n },\r\n mapDefaultValueToValue () {\r\n this.dataSource.forEach(props => {\r\n this.$set(props, '_show', this.isExpand)\r\n if (props.defaultValue) {\r\n if (type.isFunction(props.defaultValue)) {\r\n const ret = props.defaultValue.call(this)\r\n this.$set(props, '_value', this.buildDefaultValue(ret))\r\n } else {\r\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\r\n }\r\n }\r\n })\r\n return this.dataSource\r\n },\r\n handleClickExpandCollapse () {\r\n this.isExpand = !this.isExpand\r\n },\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n buildMapto (mapTo = [], dataSource) {\r\n const [ startField, endField ] = mapTo\r\n const [ startValue, endValue ] = dataSource || [null, null]\r\n return {\r\n [startField]: startValue,\r\n [endField]: endValue\r\n }\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n case 'ele-date-range':\r\n if (item.mapTo) {\r\n Object.assign(ret, this.buildMapto(item.mapTo, item._value))\r\n } else {\r\n ret[item.name] = (item._value || []).join(',')\r\n }\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n cleanValues () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n const { defaultValue } = item\r\n switch (item.type) {\r\n case 'Select':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', undefined)\r\n break\r\n case 'ele-date-range':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', [])\r\n break\r\n default:\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n },\r\n handleClickReset () {\r\n this.cleanValues()\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n },\r\n destroyed () {\r\n this.cleanValues()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.search-area--action {\r\n justify-content: end;\r\n }\r\n .expand-collapse {\r\n margin-left: 8px;\r\n height: 32px;\r\n padding: 4px 16px;\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n .expand-collapse__text {\r\n font-size: 14px;\r\n }\r\n .expand-collapse__icon {\r\n font-size: 16px;\r\n margin-left: 8px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12502
13212
|
|
|
12503
13213
|
};
|
|
12504
13214
|
/* scoped */
|
|
12505
|
-
const __vue_scope_id__$b = "data-v-
|
|
13215
|
+
const __vue_scope_id__$b = "data-v-77b7e5ba";
|
|
12506
13216
|
/* module identifier */
|
|
12507
13217
|
const __vue_module_identifier__$b = undefined;
|
|
12508
13218
|
/* functional template */
|
|
@@ -12745,11 +13455,11 @@ __vue_render__$a._withStripped = true;
|
|
|
12745
13455
|
/* style */
|
|
12746
13456
|
const __vue_inject_styles__$a = function (inject) {
|
|
12747
13457
|
if (!inject) return
|
|
12748
|
-
inject("data-v-
|
|
13458
|
+
inject("data-v-6e62914a_0", { source: ".button-group__wrapper[data-v-6e62914a] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-6e62914a] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-6e62914a]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"button-group__wrapper\">\r\n <template v-for=\"(item, idx) in innerDatasource\" >\r\n <ele-button\r\n v-if=\"isBool(item._show) ? item._show : true\"\r\n :type=\"item.type\"\r\n :icon=\"item.icon\"\r\n :mode=\"item.mode\"\r\n :data-source=\"item.optionList\"\r\n :event-name=\"item.eventName\"\r\n :record=\"item\"\r\n v-on=\"overrideButtonEvent\"\r\n :key=\"idx\">\r\n {{ item.label }}\r\n </ele-button>\r\n </template>\r\n <ele-modal-confirm v-model=\"modalConfirmValue\" :contextProp=\"currentContext\" v-on=\"overrideModalConfirmEvent\" v-bind=\"modalConfirmMeta\"></ele-modal-confirm>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { type, util } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nimport { CONTEXT, AREA_NAMES } from '../../../utils'\r\nexport default {\r\n name: 'ele-button-group',\r\n props: {\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n data() {\r\n return {\r\n innerDatasource: [],\r\n modalConfirmValue: false,\r\n modalConfirmMeta: {}\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n computed: {\r\n callContext () {\r\n return this[CONTEXT].call(this)\r\n },\r\n currentExposed () {\r\n const exposed = Object.assign({}, this.callContext.exposed || {}, { [AREA_NAMES.BUTTON_GROUP]: { setModalConfirm: this.setModalConfirm } })\r\n return exposed\r\n },\r\n contextData () {\r\n return {\r\n ...this.currentContext,\r\n exposed: this.currentExposed\r\n }\r\n },\r\n overrideButtonEvent () {\r\n const events = this.dataSource.reduce((ret, item) => {\r\n const { mode, optionList = [] } = item\r\n if (mode == 'dropdown') {\r\n optionList.forEach(props => {\r\n ret[props.eventName || 'click'] = (e) => {\r\n const { modalConfirm } = props\r\n modalConfirm && (this.modalConfirmMeta = modalConfirm)\r\n if (this.preventModalConfirm(modalConfirm)) {\r\n this.$emit(props.eventName || 'click', { ...e, ...props, record: props, ...this.contextData })\r\n return\r\n }\r\n modalConfirm && (this.modalConfirmValue = true)\r\n this.$emit(props.eventName || 'click', { ...e, ...props, record: props, ...this.contextData })\r\n }\r\n })\r\n }\r\n ret[item.eventName || 'click'] = (e) => {\r\n const { modalConfirm } = item\r\n modalConfirm && (this.modalConfirmMeta = modalConfirm)\r\n if (this.preventModalConfirm(modalConfirm)) {\r\n this.$emit(item.eventName || 'click', { ...e, record: item, ...this.contextData })\r\n return\r\n }\r\n modalConfirm && (this.modalConfirmValue = true)\r\n this.$emit(item.eventName || 'click', { ...e, record: item, ...this.contextData })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n ...this.contextData\r\n }\r\n },\r\n overrideModalConfirmEvent () {\r\n return {\r\n ...this.$listeners\r\n }\r\n },\r\n currentContext () {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n ...this.callContext\r\n }\r\n }\r\n },\r\n watch: {\r\n dataSource: {\r\n handler (dataSource) {\r\n this.innerDatasource = dataSource.map(item => {\r\n return {\r\n ...item,\r\n _show: this.executeExpression(item.show)\r\n }\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n setModalConfirm (arg = false) {\r\n this.modalConfirmValue = arg\r\n },\r\n preventModalConfirm (modalConfirm = {}) {\r\n const { show } = modalConfirm\r\n return !this.executeExpression(show)\r\n },\r\n executeExpression (expression) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return true\r\n return parse(expression, { ...this.currentContext, ...this.contextData })\r\n },\r\n isBool (arg) {\r\n return type.isBool(arg)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.button-group__wrapper {\r\n display: flex;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n .ant-btn {\r\n margin-left: 8px;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12749
13459
|
|
|
12750
13460
|
};
|
|
12751
13461
|
/* scoped */
|
|
12752
|
-
const __vue_scope_id__$a = "data-v-
|
|
13462
|
+
const __vue_scope_id__$a = "data-v-6e62914a";
|
|
12753
13463
|
/* module identifier */
|
|
12754
13464
|
const __vue_module_identifier__$a = undefined;
|
|
12755
13465
|
/* functional template */
|
|
@@ -12963,6 +13673,7 @@ var script$9 = {
|
|
|
12963
13673
|
_route: this.$route.query,
|
|
12964
13674
|
exposed: exposed,
|
|
12965
13675
|
...exposed,
|
|
13676
|
+
currentRowData: exposed.getCurrentRowData(),
|
|
12966
13677
|
...dataSource
|
|
12967
13678
|
});
|
|
12968
13679
|
return ret;
|
|
@@ -13260,11 +13971,11 @@ __vue_render__$8._withStripped = true;
|
|
|
13260
13971
|
/* style */
|
|
13261
13972
|
const __vue_inject_styles__$8 = function (inject) {
|
|
13262
13973
|
if (!inject) return
|
|
13263
|
-
inject("data-v-
|
|
13974
|
+
inject("data-v-59b22738_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
13264
13975
|
|
|
13265
13976
|
};
|
|
13266
13977
|
/* scoped */
|
|
13267
|
-
const __vue_scope_id__$8 = "data-v-
|
|
13978
|
+
const __vue_scope_id__$8 = "data-v-59b22738";
|
|
13268
13979
|
/* module identifier */
|
|
13269
13980
|
const __vue_module_identifier__$8 = undefined;
|
|
13270
13981
|
/* functional template */
|
|
@@ -13424,12 +14135,12 @@ __vue_render__$7._withStripped = true;
|
|
|
13424
14135
|
/* style */
|
|
13425
14136
|
const __vue_inject_styles__$7 = function (inject) {
|
|
13426
14137
|
if (!inject) return
|
|
13427
|
-
inject("data-v-
|
|
13428
|
-
,inject("data-v-
|
|
14138
|
+
inject("data-v-11e1b8a0_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 })
|
|
14139
|
+
,inject("data-v-11e1b8a0_1", { source: ".ele-modal-confirm__content[data-v-11e1b8a0] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <ele-modal :title=\"title\" :value=\"value\" :size=\"size\" @cancel=\"onCancel\" v-on=\"overrideEvents\" :buttonGroupMeta=\"buttonGroupMeta\">\r\n <ele-alert v-if=\"alert\" v-bind=\"alert\"></ele-alert>\r\n <div v-if=\"contentText\" class=\"ele-modal-confirm__content\">\r\n {{ contentText }}\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport { CONTEXT } from '../../../utils'\r\nexport default {\r\n name: 'ele-modal-confirm',\r\n model: {\r\n event: 'change',\r\n prop: 'value'\r\n },\r\n props: {\r\n title: {\r\n type: String\r\n },\r\n size: {\r\n type: String,\r\n default: 'small'\r\n },\r\n alert: {\r\n type: [Object, Boolean],\r\n default: () => ({\r\n type: 'warning',\r\n message: '确定要删除吗?',\r\n description: '删除后将无法恢复',\r\n closable: false\r\n })\r\n },\r\n contentText: {\r\n type: String\r\n },\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object\r\n },\r\n //!deprecated\r\n contextProp: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n currentContext () {\r\n const { exposed: exposedData = {} } = this[CONTEXT]()\r\n const exposed = Object.assign({}, exposedData, { closeModalConfirm: this.closeModalConfirm })\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n ...this[CONTEXT](),\r\n exposed\r\n }\r\n },\r\n overrideEvents () {\r\n if (!this.buttonGroupMeta) return {}\r\n const { elements = [] } = this.buttonGroupMeta\r\n const events = elements.reduce((ret, ele) =>{\r\n ret[ele.eventName || 'click'] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, ...this.currentContext })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...events\r\n }\r\n }\r\n },\r\n methods: {\r\n closeModalConfirm () {\r\n this.$emit('change', false)\r\n },\r\n onCancel () {\r\n this.$emit('change', false)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-modal-confirm__content {\r\n margin-top: 8px;\r\n color: var(--idoole-black-088);\r\n font-size: 14px;\r\n line-height: 22px;\r\n}\r\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 });
|
|
13429
14140
|
|
|
13430
14141
|
};
|
|
13431
14142
|
/* scoped */
|
|
13432
|
-
const __vue_scope_id__$7 = "data-v-
|
|
14143
|
+
const __vue_scope_id__$7 = "data-v-11e1b8a0";
|
|
13433
14144
|
/* module identifier */
|
|
13434
14145
|
const __vue_module_identifier__$7 = undefined;
|
|
13435
14146
|
/* functional template */
|
|
@@ -13672,11 +14383,11 @@ __vue_render__$6._withStripped = true;
|
|
|
13672
14383
|
/* style */
|
|
13673
14384
|
const __vue_inject_styles__$6 = function (inject) {
|
|
13674
14385
|
if (!inject) return
|
|
13675
|
-
inject("data-v-
|
|
14386
|
+
inject("data-v-3d3d1b6e_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
13676
14387
|
|
|
13677
14388
|
};
|
|
13678
14389
|
/* scoped */
|
|
13679
|
-
const __vue_scope_id__$6 = "data-v-
|
|
14390
|
+
const __vue_scope_id__$6 = "data-v-3d3d1b6e";
|
|
13680
14391
|
/* module identifier */
|
|
13681
14392
|
const __vue_module_identifier__$6 = undefined;
|
|
13682
14393
|
/* functional template */
|
|
@@ -13871,11 +14582,11 @@ __vue_render__$5._withStripped = true;
|
|
|
13871
14582
|
/* style */
|
|
13872
14583
|
const __vue_inject_styles__$5 = function (inject) {
|
|
13873
14584
|
if (!inject) return
|
|
13874
|
-
inject("data-v-
|
|
14585
|
+
inject("data-v-cc928cfe_0", { source: ".ele__img--form .form__img--wrapper[data-v-cc928cfe] {\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-cc928cfe] {\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-cc928cfe] {\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-cc928cfe] {\n font-size: 40px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon__text--oper[data-v-cc928cfe] {\n font-size: 16px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"ele__img--form\">\r\n <div class=\"form__img--wrapper\" \r\n @click=\"handleClick\" \r\n :style=\"style\">\r\n <div class=\"form__img--preivew\" v-if=\"value\">\r\n <img style=\"width:100%;height:100%\" :src=\"imageUrl\" alt=\"\" srcset=\"\">\r\n </div>\r\n <div class=\"form__icon--wrapper\">\r\n <ele-icon class=\"icon--oper\" type=\"icon-camera\"></ele-icon>\r\n <span class=\"icon__text--oper\">{{ operText }}</span>\r\n </div>\r\n </div>\r\n <ele-modal-img-crop \r\n v-model=\"showModalImgCropValue\"\r\n :uploadFileConfig=\"uploadFileConfig\"\r\n @change=\"onChangeModalCropImg\"\r\n :cropperConfig=\"cropperConfig\"\r\n :imageId=\"value\"\r\n :title=\"modalTitle\">\r\n </ele-modal-img-crop>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-form-img-crop',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Number]\r\n },\r\n modalTitle: {\r\n type: String\r\n },\r\n operText: {\r\n type: String,\r\n default: '更改头像'\r\n },\r\n width: {\r\n type: [Number, String],\r\n default: 200\r\n },\r\n height: {\r\n type: [Number, String],\r\n default: 200\r\n },\r\n cropperConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n aspectRatio: 16 / 9\r\n }\r\n }\r\n },\r\n uploadFileConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n size: 10,\r\n accept: '*',\r\n byteConversion: 1024 * 1024\r\n }\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n showModalImgCropValue: false\r\n }\r\n },\r\n computed: {\r\n style () {\r\n return {\r\n width: this.width + 'px',\r\n height: this.height + 'px'\r\n }\r\n },\r\n imageUrl () {\r\n return `/api-file/workbench/file/stream/${this.value}?origin=true`\r\n }\r\n },\r\n methods: {\r\n handleClick () {\r\n this.showModalImgCropValue = true\r\n },\r\n onChangeModalCropImg (fileId) {\r\n console.log('fileId', fileId)\r\n this.$emit('change', fileId)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele__img--form {\r\n .form__img--wrapper {\r\n cursor: pointer;\r\n border-radius: 4px;\r\n background: #000;\r\n opacity: 0.3;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n .form__img--preivew {\r\n position: absolute;\r\n color: red;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 4px;\r\n }\r\n .form__icon--wrapper {\r\n position: absolute;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n color: #fff;\r\n .icon--oper {\r\n font-size: 40px;\r\n }\r\n .icon__text--oper {\r\n font-size: 16px;\r\n }\r\n }\r\n }\r\n}\r\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 });
|
|
13875
14586
|
|
|
13876
14587
|
};
|
|
13877
14588
|
/* scoped */
|
|
13878
|
-
const __vue_scope_id__$5 = "data-v-
|
|
14589
|
+
const __vue_scope_id__$5 = "data-v-cc928cfe";
|
|
13879
14590
|
/* module identifier */
|
|
13880
14591
|
const __vue_module_identifier__$5 = undefined;
|
|
13881
14592
|
/* functional template */
|
|
@@ -14308,12 +15019,12 @@ __vue_render__$3._withStripped = true;
|
|
|
14308
15019
|
/* style */
|
|
14309
15020
|
const __vue_inject_styles__$3 = function (inject) {
|
|
14310
15021
|
if (!inject) return
|
|
14311
|
-
inject("data-v-
|
|
14312
|
-
,inject("data-v-
|
|
15022
|
+
inject("data-v-5d09c280_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 })
|
|
15023
|
+
,inject("data-v-5d09c280_1", { source: ".import-download__link[data-v-5d09c280] {\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-5d09c280] {\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-5d09c280] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right[data-v-5d09c280] {\n margin-left: 16px;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__title[data-v-5d09c280] {\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-5d09c280] {\n font-size: 14px;\n color: var(--idooel-link-03);\n}\n.ele-modal-import__hint .import-footer__hint--text[data-v-5d09c280] {\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":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <ele-modal :value=\"innerValue\" :buttonGroupMeta=\"buttonGroupMeta\" @cancel=\"onCancel\" @handleClose=\"handleClose\" title=\"导入\">\r\n <div class=\"ele-modal-import__upload\" v-if=\"isFileEmpty\">\r\n <div class=\"import-download__link\" @click=\"handleClickDownloadTpl\">点击此链接下载导入模板</div>\r\n <ele-upload v-model=\"file\" @on-success=\"uploadFileSuccess\"></ele-upload>\r\n </div>\r\n <div v-else class=\"ele-modal-import__hint\">\r\n <div class=\"import-hint__content\">\r\n <div class=\"import-hint__left\">\r\n <ele-icon></ele-icon>\r\n </div>\r\n <div class=\"import-hint__right\">\r\n <div class=\"hint-right__title\" @click=\"handleClickJump\">文件上传成功,任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>\r\n <div class=\"hint-right__sub-title\">批处理任务的准备工作会在后台运行</div>\r\n </div>\r\n </div>\r\n <div class=\"import-footer__hint--text\">\r\n 您可以请点击上方按钮查看任务进度或关闭弹框\r\n </div>\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-modal-import',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n data() {\r\n return {\r\n innerValue: false,\r\n file: [],\r\n buttonGroupMeta: {\r\n elements: [\r\n {\r\n label: '关闭',\r\n key: 'close',\r\n type: 'default',\r\n eventName: 'handleClose'\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n computed: {\r\n isFileEmpty () {\r\n return type.isEmpty(this.file)\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.innerValue = value\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n emitEvent (props = {}) {\r\n this.$emit('on-actions', { ...props })\r\n },\r\n onCancel () {\r\n this.innerValue = false\r\n this.$emit('change', false)\r\n },\r\n handleClickJump () {\r\n this.emitEvent({ action: 'jump' })\r\n },\r\n uploadFileSuccess (props) {\r\n this.emitEvent({ action: 'uploaded', file: props })\r\n },\r\n handleClickDownloadTpl () {\r\n this.emitEvent({ action: 'download' })\r\n },\r\n cleanFile () {\r\n this.file = []\r\n },\r\n handleClose () {\r\n this.cleanFile()\r\n this.innerValue = false\r\n this.$emit('change', false)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.import-download__link {\r\n color: var(--idooel-link-06);\r\n font-size: 14px;\r\n cursor: pointer;\r\n line-height: 22px;\r\n}\r\n.ele-modal-import__hint {\r\n .import-hint__content {\r\n padding: 16px;\r\n border-radius: 2px;\r\n height: 82px;\r\n border: 1px dashed var(--idooel-link-06);\r\n background: var(--idoole-black-02);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n .import-hint__left {\r\n .anticon-upload {\r\n font-size: 48px;\r\n color: var(--idooel-link-06);\r\n }\r\n }\r\n .import-hint__right {\r\n margin-left: 16px;\r\n .hint-right__title {\r\n font-size: 16px;\r\n color: var(--idooel-link-06);\r\n cursor: pointer;\r\n }\r\n .hint-right__sub-title {\r\n font-size: 14px;\r\n color: var(--idooel-link-03);\r\n }\r\n }\r\n }\r\n .import-footer__hint--text {\r\n font-size: 14px;\r\n color: var(--idooel-link-06);\r\n line-height: 22px;\r\n }\r\n}\r\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 });
|
|
14313
15024
|
|
|
14314
15025
|
};
|
|
14315
15026
|
/* scoped */
|
|
14316
|
-
const __vue_scope_id__$3 = "data-v-
|
|
15027
|
+
const __vue_scope_id__$3 = "data-v-5d09c280";
|
|
14317
15028
|
/* module identifier */
|
|
14318
15029
|
const __vue_module_identifier__$3 = undefined;
|
|
14319
15030
|
/* functional template */
|
|
@@ -14454,11 +15165,11 @@ __vue_render__$2._withStripped = true;
|
|
|
14454
15165
|
/* style */
|
|
14455
15166
|
const __vue_inject_styles__$2 = function (inject) {
|
|
14456
15167
|
if (!inject) return
|
|
14457
|
-
inject("data-v-
|
|
15168
|
+
inject("data-v-1f132055_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
14458
15169
|
|
|
14459
15170
|
};
|
|
14460
15171
|
/* scoped */
|
|
14461
|
-
const __vue_scope_id__$2 = "data-v-
|
|
15172
|
+
const __vue_scope_id__$2 = "data-v-1f132055";
|
|
14462
15173
|
/* module identifier */
|
|
14463
15174
|
const __vue_module_identifier__$2 = undefined;
|
|
14464
15175
|
/* functional template */
|
|
@@ -14667,12 +15378,12 @@ __vue_render__$1._withStripped = true;
|
|
|
14667
15378
|
/* style */
|
|
14668
15379
|
const __vue_inject_styles__$1 = function (inject) {
|
|
14669
15380
|
if (!inject) return
|
|
14670
|
-
inject("data-v-
|
|
14671
|
-
,inject("data-v-
|
|
15381
|
+
inject("data-v-1c7f4c3c_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 })
|
|
15382
|
+
,inject("data-v-1c7f4c3c_1", { source: ".ele-modal-fsm__display[data-v-1c7f4c3c] {\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-1c7f4c3c], .ele-modal-fsm__display .fms-display__action[data-v-1c7f4c3c] {\n font-weight: bold;\n color: var(--idoole-black-088);\n}\n.ele-modal-fsm__display .fms-display__name[data-v-1c7f4c3c]::before, .ele-modal-fsm__display .fms-display__action[data-v-1c7f4c3c]::before {\n content: \"\";\n margin-left: 4px;\n}\n.ele-modal-fsm__display .fms-display__name[data-v-1c7f4c3c]::after, .ele-modal-fsm__display .fms-display__action[data-v-1c7f4c3c]::after {\n content: \"\";\n margin-right: 4px;\n}\n.ele-modal-fsm__display .title-info[data-v-1c7f4c3c] {\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-1c7f4c3c]::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-1c7f4c3c]::before {\n background: var(--idoole-success-06);\n}\n.ele-modal-fsm__display .title-info.warning[data-v-1c7f4c3c]::before {\n background: var(--idoole-warning-06);\n}\n.ele-modal-fsm__display .title-info.error[data-v-1c7f4c3c]::before {\n background: var(--idoole-error-06);\n}\n.ele-modal-fsm__opinion-wrapper[data-v-1c7f4c3c] {\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-1c7f4c3c] {\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-1c7f4c3c] {\n color: var(--idoole-black-088);\n font-weight: bold;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <ele-modal v-on=\"$listeners\" :value=\"value\" :title=\"meta.title || title\" @cancel=\"handleCancel\" :buttonGroupMeta=\"buttonGroupMeta\">\r\n <slot name=\"alert\"></slot>\r\n <ele-timeline v-bind=\"meta\">\r\n <template #right=\"{ data: item }\">\r\n <div class=\"ele-modal-fsm__display\">\r\n <span>由</span>\r\n <span class=\"fms-display__name\">{{ item.userName || '管理员' }}</span>\r\n <span>执行了</span>\r\n <span class=\"fms-display__action\">{{ item.action || '结班' }}</span>\r\n <span>操作</span>\r\n <span :class=\"['title-info', item.state == 1 && 'success', item.state == 2 && 'warning', item.state == 3 && 'error']\">{{ item.stateName }}</span>\r\n </div>\r\n <div class=\"ele-modal-fsm__opinion-wrapper\">\r\n <div class=\"fsm-opinion__label\">意见:</div>\r\n <div class=\"fsm-opinion__value\">{{ item.opinion }}</div>\r\n </div>\r\n </template>\r\n </ele-timeline>\r\n <template v-if=\"showTextSlot\" #footer-text>\r\n <ele-text v-bind=\"textAttrs\"></ele-text>\r\n </template>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport { CONTEXT } from '../../../utils'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-modal-fsm',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: '状态变更记录'\r\n },\r\n meta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n elements: [\r\n {\r\n label: '关闭',\r\n key: 'cancel',\r\n type: 'default',\r\n eventName: 'cancel'\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n contextProp: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n provide() {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n ...this.contextProp\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n showTextSlot () {\r\n return !type.isEmpty(this.textAttrs)\r\n },\r\n textAttrs() {\r\n const { text = {} } = this.buttonGroupMeta\r\n return text\r\n }\r\n },\r\n methods: {\r\n handleCancel () {\r\n this.$emit('change', false)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-modal-fsm__display {\r\n display: flex;\r\n flex-direction: row;\r\n font-size: 14px;\r\n line-height: 22px;\r\n .fms-display__name, .fms-display__action {\r\n font-weight: bold;\r\n color: var(--idoole-black-088);\r\n &::before {\r\n content: '';\r\n margin-left: 4px;\r\n }\r\n &::after {\r\n content: '';\r\n margin-right: 4px;\r\n }\r\n }\r\n .title-info {\r\n font-size: 14px;\r\n color: var(--idoole-black-064);\r\n margin-left: 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &::before {\r\n content: '';\r\n display: inline-block;\r\n width: 6px;\r\n height: 6px;\r\n border-radius: 50%;\r\n margin-right: 8px;\r\n }\r\n &.success {\r\n &::before {\r\n background: var(--idoole-success-06);\r\n }\r\n }\r\n &.warning {\r\n &::before {\r\n background: var(--idoole-warning-06);\r\n }\r\n }\r\n &.error {\r\n &::before {\r\n background: var(--idoole-error-06);\r\n }\r\n }\r\n }\r\n}\r\n.ele-modal-fsm__opinion-wrapper {\r\n margin-top: 4px;\r\n line-height: 22px;\r\n font-size: 14px;\r\n display: flex;\r\n flex-direction: row;\r\n .fsm-opinion__label {\r\n width: 42px;\r\n flex-shrink: 0;\r\n color: var(--idoole-black-064);\r\n }\r\n .fsm-opinion__value {\r\n color: var(--idoole-black-088);\r\n font-weight: bold;\r\n }\r\n}\r\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 });
|
|
14672
15383
|
|
|
14673
15384
|
};
|
|
14674
15385
|
/* scoped */
|
|
14675
|
-
const __vue_scope_id__$1 = "data-v-
|
|
15386
|
+
const __vue_scope_id__$1 = "data-v-1c7f4c3c";
|
|
14676
15387
|
/* module identifier */
|
|
14677
15388
|
const __vue_module_identifier__$1 = undefined;
|
|
14678
15389
|
/* functional template */
|
|
@@ -14830,11 +15541,11 @@ __vue_render__._withStripped = true;
|
|
|
14830
15541
|
/* style */
|
|
14831
15542
|
const __vue_inject_styles__ = function (inject) {
|
|
14832
15543
|
if (!inject) return
|
|
14833
|
-
inject("data-v-
|
|
15544
|
+
inject("data-v-936fe67a_0", { source: ".g-form__tabs[data-v-936fe67a] {\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-936fe67a] {\n display: flex;\n flex-direction: row;\n}\n.g-form__tabs .g-form__wrapper.disabled .g-form__item[data-v-936fe67a] {\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-936fe67a] {\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-936fe67a] {\n display: flex;\n}\n.g-form__tabs .g-form__wrapper .g-form__item[data-v-936fe67a]: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-936fe67a] {\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-936fe67a] {\n border-left: 1px solid #409eff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\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>\r\n <div class=\"g-form__tabs\">\r\n <div :class=\"['g-form__wrapper', disabled && 'disabled']\">\r\n <div :class=\"['g-form__item', !disabled && (innerActiveKey == props.key) && 'actived']\" @click=\"handleTabClick(props)\" v-for=\"props in dataSource\" :key=\"props.key\">\r\n <div>{{ props.title }}</div>\r\n <div v-if=\"isSuffix\" class=\"suffix\">\r\n <template v-if=\"props.loading\">\r\n <ele-loading style=\"margin-left:4px;\" :loading=\"props.loading\"></ele-loading>\r\n </template>\r\n <div v-else>({{ props.suffix }}人)</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tabs-sub-center',\r\n props: {\r\n activeKey: {\r\n type: [String, Number]\r\n },\r\n isSuffix: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n dataSource: {\r\n type: Array\r\n }\r\n },\r\n data () {\r\n return {\r\n innerActiveKey: 1\r\n }\r\n },\r\n watch: {\r\n activeKey: {\r\n handler (key) {\r\n this.innerActiveKey = key\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n setLoadingByKey (key, status = true) {\r\n const target = this.dataSource.find(item => item.key == key)\r\n this.$set(target, 'loading', status)\r\n },\r\n setTitleByKey (key, title) {\r\n const target = this.dataSource.find(item => item.key == key)\r\n this.$set(target, 'title', title)\r\n },\r\n setSuffixByKey (key, suffix) {\r\n const target = this.dataSource.find(item => item.key == key)\r\n this.$set(target, 'suffix', suffix)\r\n },\r\n handleTabClick (props) {\r\n if (this.disabled) return\r\n const { key } = props\r\n this.innerActiveKey = key\r\n this.$emit('on-click', props)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-form__tabs {\r\n width: 100%;\r\n background: #fff;\r\n display: flex;\r\n flex-direction: row;\r\n height: 32px;\r\n .g-form__wrapper {\r\n display: flex;\r\n flex-direction: row;\r\n &.disabled {\r\n .g-form__item {\r\n cursor: not-allowed;\r\n border-color: rgba(0, 0, 0, 0.16);\r\n background: rgba(0, 0, 0, 0.04);\r\n color: rgba(0, 0, 0, 0.24);\r\n }\r\n }\r\n .g-form__item {\r\n padding: 0px 16px;\r\n cursor: pointer;\r\n font-size: 14px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n border: 1px solid rgba(0, 0, 0, 0.16);\r\n color: rgba(0, 0, 0, 0.64);\r\n border-right: unset;\r\n & .suffix {\r\n display: flex;\r\n }\r\n &:last-child {\r\n border-right: 1px solid rgba(0, 0, 0, 0.16);\r\n }\r\n &.actived {\r\n border-color:#409eff;\r\n color: #409eff;\r\n font-size: 14px;\r\n &+.g-form__item {\r\n border-left: 1px solid #409eff;\r\n }\r\n }\r\n }\r\n }\r\n}\r\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 });
|
|
14834
15545
|
|
|
14835
15546
|
};
|
|
14836
15547
|
/* scoped */
|
|
14837
|
-
const __vue_scope_id__ = "data-v-
|
|
15548
|
+
const __vue_scope_id__ = "data-v-936fe67a";
|
|
14838
15549
|
/* module identifier */
|
|
14839
15550
|
const __vue_module_identifier__ = undefined;
|
|
14840
15551
|
/* functional template */
|
|
@@ -14868,6 +15579,7 @@ __vue_component__$z.install = Vue => Vue.component(__vue_component__$z.name, __v
|
|
|
14868
15579
|
|
|
14869
15580
|
__vue_component__$x.install = Vue => Vue.component(__vue_component__$x.name, __vue_component__$x);
|
|
14870
15581
|
|
|
15582
|
+
// 初始化全局数据池(必须在其他组件之前)
|
|
14871
15583
|
const compositeComponents = [__vue_component__$a, __vue_component__$b, __vue_component__$9, __vue_component__$8, __vue_component__$h, __vue_component__$7, __vue_component__$6, __vue_component__$5, __vue_component__$4];
|
|
14872
15584
|
const businessComponents = [__vue_component__$3, __vue_component__$2, __vue_component__$1, __vue_component__];
|
|
14873
15585
|
const models = [__vue_component__$A, __vue_component__$y, __vue_component__$z, __vue_component__$x];
|