@idooel/components 0.0.2-beta.23 → 0.0.2-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@idooel/components.esm.js +1022 -610
- package/dist/@idooel/components.umd.js +1052 -639
- package/package.json +4 -1
- package/packages/form/src/index.vue +30 -7
- package/packages/index.js +4 -1
- package/packages/models/tree-table-model/src/index.vue +14 -1
- package/packages/pagination/index.js +5 -0
- package/packages/pagination/src/index.vue +372 -0
- package/packages/select/src/index.vue +11 -3
- package/packages/table/src/index.vue +21 -1
- package/vitest.config.js +17 -17
- package/packages/models/tree-table-model/README.md +0 -0
- package/packages/utils/README.md +0 -172
|
@@ -822,7 +822,7 @@
|
|
|
822
822
|
};
|
|
823
823
|
|
|
824
824
|
//
|
|
825
|
-
var script$
|
|
825
|
+
var script$I = {
|
|
826
826
|
name: 'ele-button',
|
|
827
827
|
props: {
|
|
828
828
|
record: {
|
|
@@ -954,10 +954,10 @@
|
|
|
954
954
|
}
|
|
955
955
|
|
|
956
956
|
/* script */
|
|
957
|
-
const __vue_script__$
|
|
957
|
+
const __vue_script__$I = script$I;
|
|
958
958
|
|
|
959
959
|
/* template */
|
|
960
|
-
var __vue_render__$
|
|
960
|
+
var __vue_render__$I = function () {
|
|
961
961
|
var _vm = this;
|
|
962
962
|
var _h = _vm.$createElement;
|
|
963
963
|
var _c = _vm._self._c || _h;
|
|
@@ -1003,17 +1003,17 @@
|
|
|
1003
1003
|
2
|
|
1004
1004
|
)
|
|
1005
1005
|
};
|
|
1006
|
-
var __vue_staticRenderFns__$
|
|
1007
|
-
__vue_render__$
|
|
1006
|
+
var __vue_staticRenderFns__$I = [];
|
|
1007
|
+
__vue_render__$I._withStripped = true;
|
|
1008
1008
|
|
|
1009
1009
|
/* style */
|
|
1010
|
-
const __vue_inject_styles__$
|
|
1010
|
+
const __vue_inject_styles__$I = undefined;
|
|
1011
1011
|
/* scoped */
|
|
1012
|
-
const __vue_scope_id__$
|
|
1012
|
+
const __vue_scope_id__$I = undefined;
|
|
1013
1013
|
/* module identifier */
|
|
1014
|
-
const __vue_module_identifier__$
|
|
1014
|
+
const __vue_module_identifier__$I = undefined;
|
|
1015
1015
|
/* functional template */
|
|
1016
|
-
const __vue_is_functional_template__$
|
|
1016
|
+
const __vue_is_functional_template__$I = false;
|
|
1017
1017
|
/* style inject */
|
|
1018
1018
|
|
|
1019
1019
|
/* style inject SSR */
|
|
@@ -1022,23 +1022,23 @@
|
|
|
1022
1022
|
|
|
1023
1023
|
|
|
1024
1024
|
|
|
1025
|
-
const __vue_component__$
|
|
1026
|
-
{ render: __vue_render__$
|
|
1027
|
-
__vue_inject_styles__$
|
|
1028
|
-
__vue_script__$
|
|
1029
|
-
__vue_scope_id__$
|
|
1030
|
-
__vue_is_functional_template__$
|
|
1031
|
-
__vue_module_identifier__$
|
|
1025
|
+
const __vue_component__$I = /*#__PURE__*/normalizeComponent(
|
|
1026
|
+
{ render: __vue_render__$I, staticRenderFns: __vue_staticRenderFns__$I },
|
|
1027
|
+
__vue_inject_styles__$I,
|
|
1028
|
+
__vue_script__$I,
|
|
1029
|
+
__vue_scope_id__$I,
|
|
1030
|
+
__vue_is_functional_template__$I,
|
|
1031
|
+
__vue_module_identifier__$I,
|
|
1032
1032
|
false,
|
|
1033
1033
|
undefined,
|
|
1034
1034
|
undefined,
|
|
1035
1035
|
undefined
|
|
1036
1036
|
);
|
|
1037
1037
|
|
|
1038
|
-
__vue_component__$
|
|
1038
|
+
__vue_component__$I.install = Vue => Vue.component(__vue_component__$I.name, __vue_component__$I);
|
|
1039
1039
|
|
|
1040
1040
|
//
|
|
1041
|
-
var script$
|
|
1041
|
+
var script$H = {
|
|
1042
1042
|
name: 'ele-date',
|
|
1043
1043
|
model: {
|
|
1044
1044
|
prop: 'value',
|
|
@@ -1162,10 +1162,10 @@
|
|
|
1162
1162
|
}
|
|
1163
1163
|
|
|
1164
1164
|
/* script */
|
|
1165
|
-
const __vue_script__$
|
|
1165
|
+
const __vue_script__$H = script$H;
|
|
1166
1166
|
|
|
1167
1167
|
/* template */
|
|
1168
|
-
var __vue_render__$
|
|
1168
|
+
var __vue_render__$H = function () {
|
|
1169
1169
|
var _vm = this;
|
|
1170
1170
|
var _h = _vm.$createElement;
|
|
1171
1171
|
var _c = _vm._self._c || _h;
|
|
@@ -1215,48 +1215,48 @@
|
|
|
1215
1215
|
1
|
|
1216
1216
|
)
|
|
1217
1217
|
};
|
|
1218
|
-
var __vue_staticRenderFns__$
|
|
1219
|
-
__vue_render__$
|
|
1218
|
+
var __vue_staticRenderFns__$H = [];
|
|
1219
|
+
__vue_render__$H._withStripped = true;
|
|
1220
1220
|
|
|
1221
1221
|
/* style */
|
|
1222
|
-
const __vue_inject_styles__$
|
|
1222
|
+
const __vue_inject_styles__$H = function (inject) {
|
|
1223
1223
|
if (!inject) return
|
|
1224
|
-
inject("data-v-
|
|
1224
|
+
inject("data-v-5a73e4f9_0", { source: ".ele-date__wrapper[data-v-5a73e4f9] {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
1225
1225
|
|
|
1226
1226
|
};
|
|
1227
1227
|
/* scoped */
|
|
1228
|
-
const __vue_scope_id__$
|
|
1228
|
+
const __vue_scope_id__$H = "data-v-5a73e4f9";
|
|
1229
1229
|
/* module identifier */
|
|
1230
|
-
const __vue_module_identifier__$
|
|
1230
|
+
const __vue_module_identifier__$H = undefined;
|
|
1231
1231
|
/* functional template */
|
|
1232
|
-
const __vue_is_functional_template__$
|
|
1232
|
+
const __vue_is_functional_template__$H = false;
|
|
1233
1233
|
/* style inject SSR */
|
|
1234
1234
|
|
|
1235
1235
|
/* style inject shadow dom */
|
|
1236
1236
|
|
|
1237
1237
|
|
|
1238
1238
|
|
|
1239
|
-
const __vue_component__$
|
|
1240
|
-
{ render: __vue_render__$
|
|
1241
|
-
__vue_inject_styles__$
|
|
1242
|
-
__vue_script__$
|
|
1243
|
-
__vue_scope_id__$
|
|
1244
|
-
__vue_is_functional_template__$
|
|
1245
|
-
__vue_module_identifier__$
|
|
1239
|
+
const __vue_component__$H = /*#__PURE__*/normalizeComponent(
|
|
1240
|
+
{ render: __vue_render__$H, staticRenderFns: __vue_staticRenderFns__$H },
|
|
1241
|
+
__vue_inject_styles__$H,
|
|
1242
|
+
__vue_script__$H,
|
|
1243
|
+
__vue_scope_id__$H,
|
|
1244
|
+
__vue_is_functional_template__$H,
|
|
1245
|
+
__vue_module_identifier__$H,
|
|
1246
1246
|
false,
|
|
1247
1247
|
createInjector,
|
|
1248
1248
|
undefined,
|
|
1249
1249
|
undefined
|
|
1250
1250
|
);
|
|
1251
1251
|
|
|
1252
|
-
__vue_component__$
|
|
1252
|
+
__vue_component__$H.install = Vue => Vue.component(__vue_component__$H.name, __vue_component__$H);
|
|
1253
1253
|
|
|
1254
1254
|
//
|
|
1255
1255
|
//
|
|
1256
1256
|
//
|
|
1257
1257
|
//
|
|
1258
1258
|
|
|
1259
|
-
var script$
|
|
1259
|
+
var script$G = {
|
|
1260
1260
|
name: 'ele-input',
|
|
1261
1261
|
model: {
|
|
1262
1262
|
prop: 'value',
|
|
@@ -1284,10 +1284,10 @@
|
|
|
1284
1284
|
};
|
|
1285
1285
|
|
|
1286
1286
|
/* script */
|
|
1287
|
-
const __vue_script__$
|
|
1287
|
+
const __vue_script__$G = script$G;
|
|
1288
1288
|
|
|
1289
1289
|
/* template */
|
|
1290
|
-
var __vue_render__$
|
|
1290
|
+
var __vue_render__$G = function () {
|
|
1291
1291
|
var _vm = this;
|
|
1292
1292
|
var _h = _vm.$createElement;
|
|
1293
1293
|
var _c = _vm._self._c || _h;
|
|
@@ -1300,44 +1300,44 @@
|
|
|
1300
1300
|
on: { change: _vm.onChange },
|
|
1301
1301
|
})
|
|
1302
1302
|
};
|
|
1303
|
-
var __vue_staticRenderFns__$
|
|
1304
|
-
__vue_render__$
|
|
1303
|
+
var __vue_staticRenderFns__$G = [];
|
|
1304
|
+
__vue_render__$G._withStripped = true;
|
|
1305
1305
|
|
|
1306
1306
|
/* style */
|
|
1307
|
-
const __vue_inject_styles__$
|
|
1307
|
+
const __vue_inject_styles__$G = function (inject) {
|
|
1308
1308
|
if (!inject) return
|
|
1309
|
-
inject("data-v-
|
|
1309
|
+
inject("data-v-b8defd54_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 });
|
|
1310
1310
|
|
|
1311
1311
|
};
|
|
1312
1312
|
/* scoped */
|
|
1313
|
-
const __vue_scope_id__$
|
|
1313
|
+
const __vue_scope_id__$G = "data-v-b8defd54";
|
|
1314
1314
|
/* module identifier */
|
|
1315
|
-
const __vue_module_identifier__$
|
|
1315
|
+
const __vue_module_identifier__$G = undefined;
|
|
1316
1316
|
/* functional template */
|
|
1317
|
-
const __vue_is_functional_template__$
|
|
1317
|
+
const __vue_is_functional_template__$G = false;
|
|
1318
1318
|
/* style inject SSR */
|
|
1319
1319
|
|
|
1320
1320
|
/* style inject shadow dom */
|
|
1321
1321
|
|
|
1322
1322
|
|
|
1323
1323
|
|
|
1324
|
-
const __vue_component__$
|
|
1325
|
-
{ render: __vue_render__$
|
|
1326
|
-
__vue_inject_styles__$
|
|
1327
|
-
__vue_script__$
|
|
1328
|
-
__vue_scope_id__$
|
|
1329
|
-
__vue_is_functional_template__$
|
|
1330
|
-
__vue_module_identifier__$
|
|
1324
|
+
const __vue_component__$G = /*#__PURE__*/normalizeComponent(
|
|
1325
|
+
{ render: __vue_render__$G, staticRenderFns: __vue_staticRenderFns__$G },
|
|
1326
|
+
__vue_inject_styles__$G,
|
|
1327
|
+
__vue_script__$G,
|
|
1328
|
+
__vue_scope_id__$G,
|
|
1329
|
+
__vue_is_functional_template__$G,
|
|
1330
|
+
__vue_module_identifier__$G,
|
|
1331
1331
|
false,
|
|
1332
1332
|
createInjector,
|
|
1333
1333
|
undefined,
|
|
1334
1334
|
undefined
|
|
1335
1335
|
);
|
|
1336
1336
|
|
|
1337
|
-
__vue_component__$
|
|
1337
|
+
__vue_component__$G.install = Vue => Vue.component(__vue_component__$G.name, __vue_component__$G);
|
|
1338
1338
|
|
|
1339
1339
|
//
|
|
1340
|
-
var script$
|
|
1340
|
+
var script$F = {
|
|
1341
1341
|
name: 'ele-select',
|
|
1342
1342
|
props: {
|
|
1343
1343
|
init: {
|
|
@@ -1411,6 +1411,9 @@
|
|
|
1411
1411
|
this.isInitRequest && this.fetchDataSourceByUrl();
|
|
1412
1412
|
},
|
|
1413
1413
|
methods: {
|
|
1414
|
+
isUndefined(arg) {
|
|
1415
|
+
return shared.type.isUndefined(arg);
|
|
1416
|
+
},
|
|
1414
1417
|
fetchDataSourceByUrl() {
|
|
1415
1418
|
shared.net.get(this.url, {
|
|
1416
1419
|
code: this.code,
|
|
@@ -1435,10 +1438,10 @@
|
|
|
1435
1438
|
};
|
|
1436
1439
|
|
|
1437
1440
|
/* script */
|
|
1438
|
-
const __vue_script__$
|
|
1441
|
+
const __vue_script__$F = script$F;
|
|
1439
1442
|
|
|
1440
1443
|
/* template */
|
|
1441
|
-
var __vue_render__$
|
|
1444
|
+
var __vue_render__$F = function () {
|
|
1442
1445
|
var _vm = this;
|
|
1443
1446
|
var _h = _vm.$createElement;
|
|
1444
1447
|
var _c = _vm._self._c || _h;
|
|
@@ -1449,51 +1452,65 @@
|
|
|
1449
1452
|
attrs: { disabled: _vm.disabled, mode: _vm.getMode, value: _vm.value },
|
|
1450
1453
|
on: { change: _vm.onChange },
|
|
1451
1454
|
},
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1455
|
+
[
|
|
1456
|
+
_vm._l(_vm.innerDataSource, function (item) {
|
|
1457
|
+
return [
|
|
1458
|
+
item._show
|
|
1459
|
+
? _c(
|
|
1460
|
+
"a-select-option",
|
|
1461
|
+
{ key: item.value, attrs: { value: item.value } },
|
|
1462
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
1463
|
+
)
|
|
1464
|
+
: _vm._e(),
|
|
1465
|
+
_vm._v(" "),
|
|
1466
|
+
_vm.isUndefined(item._show)
|
|
1467
|
+
? _c(
|
|
1468
|
+
"a-select-option",
|
|
1469
|
+
{ key: item.value, attrs: { value: item.value } },
|
|
1470
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
1471
|
+
)
|
|
1472
|
+
: _vm._e(),
|
|
1473
|
+
]
|
|
1474
|
+
}),
|
|
1475
|
+
],
|
|
1476
|
+
2
|
|
1460
1477
|
)
|
|
1461
1478
|
};
|
|
1462
|
-
var __vue_staticRenderFns__$
|
|
1463
|
-
__vue_render__$
|
|
1479
|
+
var __vue_staticRenderFns__$F = [];
|
|
1480
|
+
__vue_render__$F._withStripped = true;
|
|
1464
1481
|
|
|
1465
1482
|
/* style */
|
|
1466
|
-
const __vue_inject_styles__$
|
|
1483
|
+
const __vue_inject_styles__$F = function (inject) {
|
|
1467
1484
|
if (!inject) return
|
|
1468
|
-
inject("data-v-
|
|
1485
|
+
inject("data-v-6f915ce5_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
1469
1486
|
|
|
1470
1487
|
};
|
|
1471
1488
|
/* scoped */
|
|
1472
|
-
const __vue_scope_id__$
|
|
1489
|
+
const __vue_scope_id__$F = "data-v-6f915ce5";
|
|
1473
1490
|
/* module identifier */
|
|
1474
|
-
const __vue_module_identifier__$
|
|
1491
|
+
const __vue_module_identifier__$F = undefined;
|
|
1475
1492
|
/* functional template */
|
|
1476
|
-
const __vue_is_functional_template__$
|
|
1493
|
+
const __vue_is_functional_template__$F = false;
|
|
1477
1494
|
/* style inject SSR */
|
|
1478
1495
|
|
|
1479
1496
|
/* style inject shadow dom */
|
|
1480
1497
|
|
|
1481
1498
|
|
|
1482
1499
|
|
|
1483
|
-
const __vue_component__$
|
|
1484
|
-
{ render: __vue_render__$
|
|
1485
|
-
__vue_inject_styles__$
|
|
1486
|
-
__vue_script__$
|
|
1487
|
-
__vue_scope_id__$
|
|
1488
|
-
__vue_is_functional_template__$
|
|
1489
|
-
__vue_module_identifier__$
|
|
1500
|
+
const __vue_component__$F = /*#__PURE__*/normalizeComponent(
|
|
1501
|
+
{ render: __vue_render__$F, staticRenderFns: __vue_staticRenderFns__$F },
|
|
1502
|
+
__vue_inject_styles__$F,
|
|
1503
|
+
__vue_script__$F,
|
|
1504
|
+
__vue_scope_id__$F,
|
|
1505
|
+
__vue_is_functional_template__$F,
|
|
1506
|
+
__vue_module_identifier__$F,
|
|
1490
1507
|
false,
|
|
1491
1508
|
createInjector,
|
|
1492
1509
|
undefined,
|
|
1493
1510
|
undefined
|
|
1494
1511
|
);
|
|
1495
1512
|
|
|
1496
|
-
__vue_component__$
|
|
1513
|
+
__vue_component__$F.install = Vue => Vue.component(__vue_component__$F.name, __vue_component__$F);
|
|
1497
1514
|
|
|
1498
1515
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
1499
1516
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -1762,7 +1779,7 @@
|
|
|
1762
1779
|
|
|
1763
1780
|
//
|
|
1764
1781
|
const MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002';
|
|
1765
|
-
var script$
|
|
1782
|
+
var script$E = {
|
|
1766
1783
|
props: {
|
|
1767
1784
|
record: {
|
|
1768
1785
|
type: Object
|
|
@@ -1895,10 +1912,10 @@
|
|
|
1895
1912
|
};
|
|
1896
1913
|
|
|
1897
1914
|
/* script */
|
|
1898
|
-
const __vue_script__$
|
|
1915
|
+
const __vue_script__$E = script$E;
|
|
1899
1916
|
|
|
1900
1917
|
/* template */
|
|
1901
|
-
var __vue_render__$
|
|
1918
|
+
var __vue_render__$E = function () {
|
|
1902
1919
|
var _vm = this;
|
|
1903
1920
|
var _h = _vm.$createElement;
|
|
1904
1921
|
var _c = _vm._self._c || _h;
|
|
@@ -2061,34 +2078,34 @@
|
|
|
2061
2078
|
0
|
|
2062
2079
|
)
|
|
2063
2080
|
};
|
|
2064
|
-
var __vue_staticRenderFns__$
|
|
2065
|
-
__vue_render__$
|
|
2081
|
+
var __vue_staticRenderFns__$E = [];
|
|
2082
|
+
__vue_render__$E._withStripped = true;
|
|
2066
2083
|
|
|
2067
2084
|
/* style */
|
|
2068
|
-
const __vue_inject_styles__$
|
|
2085
|
+
const __vue_inject_styles__$E = function (inject) {
|
|
2069
2086
|
if (!inject) return
|
|
2070
|
-
inject("data-v-
|
|
2087
|
+
inject("data-v-609961c0_0", { source: ".g-table__action[data-v-609961c0] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-609961c0] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-609961c0]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\table\\src\\action.vue","action.vue"],"names":[],"mappings":"AAmKA;EACA,aAAA;EACA,mBAAA;AClKA;ADmKA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;ACjKA;ADkKA;EACA,cAAA;AChKA;;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 keepAliveRefresh: {\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 keepAliveRefresh: this.keepAliveRefresh,\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 });
|
|
2071
2088
|
|
|
2072
2089
|
};
|
|
2073
2090
|
/* scoped */
|
|
2074
|
-
const __vue_scope_id__$
|
|
2091
|
+
const __vue_scope_id__$E = "data-v-609961c0";
|
|
2075
2092
|
/* module identifier */
|
|
2076
|
-
const __vue_module_identifier__$
|
|
2093
|
+
const __vue_module_identifier__$E = undefined;
|
|
2077
2094
|
/* functional template */
|
|
2078
|
-
const __vue_is_functional_template__$
|
|
2095
|
+
const __vue_is_functional_template__$E = false;
|
|
2079
2096
|
/* style inject SSR */
|
|
2080
2097
|
|
|
2081
2098
|
/* style inject shadow dom */
|
|
2082
2099
|
|
|
2083
2100
|
|
|
2084
2101
|
|
|
2085
|
-
const __vue_component__$
|
|
2086
|
-
{ render: __vue_render__$
|
|
2087
|
-
__vue_inject_styles__$
|
|
2088
|
-
__vue_script__$
|
|
2089
|
-
__vue_scope_id__$
|
|
2090
|
-
__vue_is_functional_template__$
|
|
2091
|
-
__vue_module_identifier__$
|
|
2102
|
+
const __vue_component__$E = /*#__PURE__*/normalizeComponent(
|
|
2103
|
+
{ render: __vue_render__$E, staticRenderFns: __vue_staticRenderFns__$E },
|
|
2104
|
+
__vue_inject_styles__$E,
|
|
2105
|
+
__vue_script__$E,
|
|
2106
|
+
__vue_scope_id__$E,
|
|
2107
|
+
__vue_is_functional_template__$E,
|
|
2108
|
+
__vue_module_identifier__$E,
|
|
2092
2109
|
false,
|
|
2093
2110
|
createInjector,
|
|
2094
2111
|
undefined,
|
|
@@ -2096,12 +2113,19 @@
|
|
|
2096
2113
|
);
|
|
2097
2114
|
|
|
2098
2115
|
//
|
|
2099
|
-
var script$
|
|
2116
|
+
var script$D = {
|
|
2100
2117
|
name: 'ele-table',
|
|
2101
2118
|
components: {
|
|
2102
|
-
Actions: __vue_component__$
|
|
2119
|
+
Actions: __vue_component__$E
|
|
2103
2120
|
},
|
|
2104
2121
|
props: {
|
|
2122
|
+
mode: {
|
|
2123
|
+
type: String,
|
|
2124
|
+
default: 'default',
|
|
2125
|
+
validator: value => {
|
|
2126
|
+
return ['default', 'next-cursor'].includes(value);
|
|
2127
|
+
}
|
|
2128
|
+
},
|
|
2105
2129
|
// ant table wrapper
|
|
2106
2130
|
height: {
|
|
2107
2131
|
type: Number
|
|
@@ -2144,7 +2168,7 @@
|
|
|
2144
2168
|
default: () => []
|
|
2145
2169
|
},
|
|
2146
2170
|
pageSize: {
|
|
2147
|
-
type: Number,
|
|
2171
|
+
type: [Number, String],
|
|
2148
2172
|
default: 10
|
|
2149
2173
|
},
|
|
2150
2174
|
pageSizeOptions: {
|
|
@@ -2238,6 +2262,8 @@
|
|
|
2238
2262
|
},
|
|
2239
2263
|
methods: {
|
|
2240
2264
|
onShowSizeChange(current, pageSize) {
|
|
2265
|
+
console.log('onShowSizeChangecurrent', current);
|
|
2266
|
+
console.log(' onShowSizeChangepageSize', pageSize);
|
|
2241
2267
|
this.innerCurrentPage = current;
|
|
2242
2268
|
this.innerPageSize = pageSize;
|
|
2243
2269
|
this.$emit('change-page', current, pageSize);
|
|
@@ -2270,6 +2296,7 @@
|
|
|
2270
2296
|
return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd';
|
|
2271
2297
|
},
|
|
2272
2298
|
onChangePagination(page, pageSize) {
|
|
2299
|
+
console.log('page', page);
|
|
2273
2300
|
this.innerCurrentPage = page;
|
|
2274
2301
|
this.innerPageSize = pageSize;
|
|
2275
2302
|
this.$emit('change-page', page, pageSize);
|
|
@@ -2291,10 +2318,10 @@
|
|
|
2291
2318
|
};
|
|
2292
2319
|
|
|
2293
2320
|
/* script */
|
|
2294
|
-
const __vue_script__$
|
|
2321
|
+
const __vue_script__$D = script$D;
|
|
2295
2322
|
|
|
2296
2323
|
/* template */
|
|
2297
|
-
var __vue_render__$
|
|
2324
|
+
var __vue_render__$D = function () {
|
|
2298
2325
|
var _vm = this;
|
|
2299
2326
|
var _h = _vm.$createElement;
|
|
2300
2327
|
var _c = _vm._self._c || _h;
|
|
@@ -2341,23 +2368,36 @@
|
|
|
2341
2368
|
"div",
|
|
2342
2369
|
{ staticClass: "g-table__pagination" },
|
|
2343
2370
|
[
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2371
|
+
_vm.mode === "default"
|
|
2372
|
+
? _c("a-pagination", {
|
|
2373
|
+
attrs: {
|
|
2374
|
+
"show-total": function (all) {
|
|
2375
|
+
return "共 " + all + " 条数据"
|
|
2376
|
+
},
|
|
2377
|
+
"show-size-changer": "",
|
|
2378
|
+
"show-quick-jumper": "",
|
|
2379
|
+
pageSize: _vm.innerPageSize,
|
|
2380
|
+
current: _vm.innerCurrentPage,
|
|
2381
|
+
pageSizeOptions: _vm.pageSizeOptions,
|
|
2382
|
+
total: _vm.total,
|
|
2383
|
+
},
|
|
2384
|
+
on: {
|
|
2385
|
+
change: _vm.onChangePagination,
|
|
2386
|
+
showSizeChange: _vm.onShowSizeChange,
|
|
2387
|
+
},
|
|
2388
|
+
})
|
|
2389
|
+
: _c("ele-pagination", {
|
|
2390
|
+
attrs: {
|
|
2391
|
+
pageSize: _vm.innerPageSize,
|
|
2392
|
+
current: _vm.innerCurrentPage,
|
|
2393
|
+
pageSizeOptions: _vm.pageSizeOptions,
|
|
2394
|
+
total: _vm.total,
|
|
2395
|
+
},
|
|
2396
|
+
on: {
|
|
2397
|
+
change: _vm.onChangePagination,
|
|
2398
|
+
showSizeChange: _vm.onShowSizeChange,
|
|
2399
|
+
},
|
|
2400
|
+
}),
|
|
2361
2401
|
],
|
|
2362
2402
|
1
|
|
2363
2403
|
),
|
|
@@ -2365,41 +2405,41 @@
|
|
|
2365
2405
|
1
|
|
2366
2406
|
)
|
|
2367
2407
|
};
|
|
2368
|
-
var __vue_staticRenderFns__$
|
|
2369
|
-
__vue_render__$
|
|
2408
|
+
var __vue_staticRenderFns__$D = [];
|
|
2409
|
+
__vue_render__$D._withStripped = true;
|
|
2370
2410
|
|
|
2371
2411
|
/* style */
|
|
2372
|
-
const __vue_inject_styles__$
|
|
2412
|
+
const __vue_inject_styles__$D = function (inject) {
|
|
2373
2413
|
if (!inject) return
|
|
2374
|
-
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 });
|
|
2414
|
+
inject("data-v-5681c4f1_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-5681c4f1] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n}\n.g-table__wrapper[data-v-5681c4f1] .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-5681c4f1] .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-5681c4f1] .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-5681c4f1] .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-5681c4f1] {\n /* 确保表体能够正常纵向滚动 */\n}\n.g-table__wrapper[data-v-5681c4f1] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-5681c4f1] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-5681c4f1] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-5681c4f1] .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-5681c4f1] .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-5681c4f1] .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-5681c4f1] .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-5681c4f1] .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-5681c4f1] .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-5681c4f1] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-5681c4f1] .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper[data-v-5681c4f1] {\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper .g-table__pagination[data-v-5681c4f1] {\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-5681c4f1] {\n /* 空数据状态顶部显示 */\n}\n.g-table__wrapper .g-table__no-data[data-v-5681c4f1] {\n position: relative;\n}\n.g-table__wrapper .g-table__no-data[data-v-5681c4f1] .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","E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\table\\src\\index.vue"],"names":[],"mappings":"AAAA,gBAAgB;AC6OhB;EACA,8BAAA;EACA,aAAA;EACA,sBAAA;EACA,gBAAA;EAEA,sBAAA;AD5OA;AC6OA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;AD3OA;AC8OA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;AD5OA;AC+OA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;AD7OA;ACgPA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;AD9OA;AC8MA;EAmCA,iBAAA;AD9OA;AC+OA;EACA,cAAA;EACA,aAAA;EACA,gBAAA;AD7OA;ACgPA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AD9OA;ACiPA;EACA,cAAA;EACA,gBAAA;AD/OA;ACqPA;EACA,+CAAA;ADnPA;ACqPA;EACA,0DAAA;ADnPA;ACqPA;EACA,0DAAA;ADnPA;ACsPA;EACA,6CAAA;ADpPA;ACsPA;EACA,wDAAA;ADpPA;ACsPA;EACA,wDAAA;ADpPA;ACwPA;EACA,0CAAA;ADtPA;AC0PA;EACA,cAAA;EACA,yBAAA;EACA,mBAAA;EACA,wBAAA;ADxPA;ACkKA;EAyFA,qBAAA;ADxPA;ACyPA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;ADvPA;ACoJA;EAsGA,cAAA;ADvPA;ACwPA;EACA,kBAAA;ADtPA;ACuPA;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;ADrPA;;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 v-if=\"mode === 'default'\"\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 <ele-pagination\r\n v-else\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 ></ele-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 mode: {\r\n type: String,\r\n default: 'default',\r\n validator: (value) => {\r\n return ['default', 'next-cursor'].includes(value)\r\n }\r\n },\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, String],\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 console.log('onShowSizeChangecurrent', current)\r\n console.log(' onShowSizeChangepageSize', 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 console.log('page', page)\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 });
|
|
2375
2415
|
|
|
2376
2416
|
};
|
|
2377
2417
|
/* scoped */
|
|
2378
|
-
const __vue_scope_id__$
|
|
2418
|
+
const __vue_scope_id__$D = "data-v-5681c4f1";
|
|
2379
2419
|
/* module identifier */
|
|
2380
|
-
const __vue_module_identifier__$
|
|
2420
|
+
const __vue_module_identifier__$D = undefined;
|
|
2381
2421
|
/* functional template */
|
|
2382
|
-
const __vue_is_functional_template__$
|
|
2422
|
+
const __vue_is_functional_template__$D = false;
|
|
2383
2423
|
/* style inject SSR */
|
|
2384
2424
|
|
|
2385
2425
|
/* style inject shadow dom */
|
|
2386
2426
|
|
|
2387
2427
|
|
|
2388
2428
|
|
|
2389
|
-
const __vue_component__$
|
|
2390
|
-
{ render: __vue_render__$
|
|
2391
|
-
__vue_inject_styles__$
|
|
2392
|
-
__vue_script__$
|
|
2393
|
-
__vue_scope_id__$
|
|
2394
|
-
__vue_is_functional_template__$
|
|
2395
|
-
__vue_module_identifier__$
|
|
2429
|
+
const __vue_component__$D = /*#__PURE__*/normalizeComponent(
|
|
2430
|
+
{ render: __vue_render__$D, staticRenderFns: __vue_staticRenderFns__$D },
|
|
2431
|
+
__vue_inject_styles__$D,
|
|
2432
|
+
__vue_script__$D,
|
|
2433
|
+
__vue_scope_id__$D,
|
|
2434
|
+
__vue_is_functional_template__$D,
|
|
2435
|
+
__vue_module_identifier__$D,
|
|
2396
2436
|
false,
|
|
2397
2437
|
createInjector,
|
|
2398
2438
|
undefined,
|
|
2399
2439
|
undefined
|
|
2400
2440
|
);
|
|
2401
2441
|
|
|
2402
|
-
__vue_component__$
|
|
2442
|
+
__vue_component__$D.install = Vue => Vue.component(__vue_component__$D.name, __vue_component__$D);
|
|
2403
2443
|
|
|
2404
2444
|
//
|
|
2405
2445
|
//
|
|
@@ -2429,7 +2469,7 @@
|
|
|
2429
2469
|
//
|
|
2430
2470
|
//
|
|
2431
2471
|
|
|
2432
|
-
var script$
|
|
2472
|
+
var script$C = {
|
|
2433
2473
|
name: 'ele-tree',
|
|
2434
2474
|
props: {
|
|
2435
2475
|
treeData: {
|
|
@@ -2490,10 +2530,10 @@
|
|
|
2490
2530
|
};
|
|
2491
2531
|
|
|
2492
2532
|
/* script */
|
|
2493
|
-
const __vue_script__$
|
|
2533
|
+
const __vue_script__$C = script$C;
|
|
2494
2534
|
|
|
2495
2535
|
/* template */
|
|
2496
|
-
var __vue_render__$
|
|
2536
|
+
var __vue_render__$C = function () {
|
|
2497
2537
|
var _vm = this;
|
|
2498
2538
|
var _h = _vm.$createElement;
|
|
2499
2539
|
var _c = _vm._self._c || _h;
|
|
@@ -2569,44 +2609,44 @@
|
|
|
2569
2609
|
1
|
|
2570
2610
|
)
|
|
2571
2611
|
};
|
|
2572
|
-
var __vue_staticRenderFns__$
|
|
2573
|
-
__vue_render__$
|
|
2612
|
+
var __vue_staticRenderFns__$C = [];
|
|
2613
|
+
__vue_render__$C._withStripped = true;
|
|
2574
2614
|
|
|
2575
2615
|
/* style */
|
|
2576
|
-
const __vue_inject_styles__$
|
|
2616
|
+
const __vue_inject_styles__$C = function (inject) {
|
|
2577
2617
|
if (!inject) return
|
|
2578
|
-
inject("data-v-
|
|
2618
|
+
inject("data-v-5aaaca72_0", { source: ".g-tree__wrapper[data-v-5aaaca72] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-5aaaca72] .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-5aaaca72] .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
2579
2619
|
|
|
2580
2620
|
};
|
|
2581
2621
|
/* scoped */
|
|
2582
|
-
const __vue_scope_id__$
|
|
2622
|
+
const __vue_scope_id__$C = "data-v-5aaaca72";
|
|
2583
2623
|
/* module identifier */
|
|
2584
|
-
const __vue_module_identifier__$
|
|
2624
|
+
const __vue_module_identifier__$C = undefined;
|
|
2585
2625
|
/* functional template */
|
|
2586
|
-
const __vue_is_functional_template__$
|
|
2626
|
+
const __vue_is_functional_template__$C = false;
|
|
2587
2627
|
/* style inject SSR */
|
|
2588
2628
|
|
|
2589
2629
|
/* style inject shadow dom */
|
|
2590
2630
|
|
|
2591
2631
|
|
|
2592
2632
|
|
|
2593
|
-
const __vue_component__$
|
|
2594
|
-
{ render: __vue_render__$
|
|
2595
|
-
__vue_inject_styles__$
|
|
2596
|
-
__vue_script__$
|
|
2597
|
-
__vue_scope_id__$
|
|
2598
|
-
__vue_is_functional_template__$
|
|
2599
|
-
__vue_module_identifier__$
|
|
2633
|
+
const __vue_component__$C = /*#__PURE__*/normalizeComponent(
|
|
2634
|
+
{ render: __vue_render__$C, staticRenderFns: __vue_staticRenderFns__$C },
|
|
2635
|
+
__vue_inject_styles__$C,
|
|
2636
|
+
__vue_script__$C,
|
|
2637
|
+
__vue_scope_id__$C,
|
|
2638
|
+
__vue_is_functional_template__$C,
|
|
2639
|
+
__vue_module_identifier__$C,
|
|
2600
2640
|
false,
|
|
2601
2641
|
createInjector,
|
|
2602
2642
|
undefined,
|
|
2603
2643
|
undefined
|
|
2604
2644
|
);
|
|
2605
2645
|
|
|
2606
|
-
__vue_component__$
|
|
2646
|
+
__vue_component__$C.install = Vue => Vue.component(__vue_component__$C.name, __vue_component__$C);
|
|
2607
2647
|
|
|
2608
2648
|
//
|
|
2609
|
-
var script$
|
|
2649
|
+
var script$B = {
|
|
2610
2650
|
name: 'ele-tree-table-model',
|
|
2611
2651
|
props: {
|
|
2612
2652
|
title: {
|
|
@@ -2920,6 +2960,12 @@
|
|
|
2920
2960
|
} = this.tableMeta;
|
|
2921
2961
|
return page.pageSize || 10;
|
|
2922
2962
|
},
|
|
2963
|
+
mode() {
|
|
2964
|
+
const {
|
|
2965
|
+
page = {}
|
|
2966
|
+
} = this.tableMeta;
|
|
2967
|
+
return page.mode;
|
|
2968
|
+
},
|
|
2923
2969
|
pageSizeOptions() {
|
|
2924
2970
|
const {
|
|
2925
2971
|
page = {}
|
|
@@ -3073,6 +3119,17 @@
|
|
|
3073
3119
|
} else {
|
|
3074
3120
|
this.tableData = await this.requestTableData(initQuerys);
|
|
3075
3121
|
}
|
|
3122
|
+
} else {
|
|
3123
|
+
const {
|
|
3124
|
+
params = {},
|
|
3125
|
+
fieldMap = {}
|
|
3126
|
+
} = this.tableMeta;
|
|
3127
|
+
const currentRowData = this.getCurrentRowData();
|
|
3128
|
+
const ctx = {
|
|
3129
|
+
_route: this.$route.query,
|
|
3130
|
+
currentRowData: currentRowData
|
|
3131
|
+
};
|
|
3132
|
+
this.tableQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx));
|
|
3076
3133
|
}
|
|
3077
3134
|
},
|
|
3078
3135
|
methods: {
|
|
@@ -3351,7 +3408,7 @@
|
|
|
3351
3408
|
} = this.tableMeta;
|
|
3352
3409
|
this.tableQuerys = Object.assign(this.tableQuerys, {
|
|
3353
3410
|
currentPage: this.tableQuerys.currentPage || 1,
|
|
3354
|
-
pageSize: this.tableQuerys.pageSize || 10
|
|
3411
|
+
pageSize: this.tableQuerys.pageSize || page.pageSize || 10
|
|
3355
3412
|
}, props);
|
|
3356
3413
|
this.$emit(RESERVE_EVENT_NAMES.WATCH, {
|
|
3357
3414
|
...this.exposed
|
|
@@ -3453,10 +3510,10 @@
|
|
|
3453
3510
|
};
|
|
3454
3511
|
|
|
3455
3512
|
/* script */
|
|
3456
|
-
const __vue_script__$
|
|
3513
|
+
const __vue_script__$B = script$B;
|
|
3457
3514
|
|
|
3458
3515
|
/* template */
|
|
3459
|
-
var __vue_render__$
|
|
3516
|
+
var __vue_render__$B = function () {
|
|
3460
3517
|
var _vm = this;
|
|
3461
3518
|
var _h = _vm.$createElement;
|
|
3462
3519
|
var _c = _vm._self._c || _h;
|
|
@@ -3575,6 +3632,7 @@
|
|
|
3575
3632
|
pageSize: _vm.pageSize,
|
|
3576
3633
|
pageSizeOptions: _vm.pageSizeOptions,
|
|
3577
3634
|
"data-source": _vm.tableData,
|
|
3635
|
+
mode: _vm.mode,
|
|
3578
3636
|
},
|
|
3579
3637
|
on: { "change-page": _vm.onChangePage },
|
|
3580
3638
|
},
|
|
@@ -3636,34 +3694,34 @@
|
|
|
3636
3694
|
1
|
|
3637
3695
|
)
|
|
3638
3696
|
};
|
|
3639
|
-
var __vue_staticRenderFns__$
|
|
3640
|
-
__vue_render__$
|
|
3697
|
+
var __vue_staticRenderFns__$B = [];
|
|
3698
|
+
__vue_render__$B._withStripped = true;
|
|
3641
3699
|
|
|
3642
3700
|
/* style */
|
|
3643
|
-
const __vue_inject_styles__$
|
|
3701
|
+
const __vue_inject_styles__$B = function (inject) {
|
|
3644
3702
|
if (!inject) return
|
|
3645
|
-
inject("data-v-46075027_0", { source: ".ele.model__tree-table[data-v-46075027] {\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-46075027] {\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-46075027] {\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-46075027] {\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-46075027] {\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-46075027] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-46075027] {\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-46075027] {\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":"AAiwBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AChwBA;ADkwBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AChwBA;ADmwBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;ACjwBA;ADmwBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;ACjwBA;ADmwBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;ACjwBA;ADowBA;EACA,gBAAA;AClwBA;ADmwBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;ACjwBA;ADowBA;EACA,eAAA;EACA,kCAAA;AClwBA;;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 keepAliveRefresh: this.keepAliveRefresh,\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 keepAliveRefresh: this.keepAliveRefresh,\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 // onSearch会初始化请求表格数据,所以不需要在这里请求表格数据\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 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 },\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 const { initSearch = false } = props\r\n if (this.showTree && initSearch) return\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 this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: this.tableQuerys.currentPage || 1, pageSize: this.tableQuerys.pageSize || 10 }, 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 async keepAliveRefresh () {\r\n // 重新计算表格高度(应对窗口大小变化)\r\n this.$nextTick(() => {\r\n this.calculateTableHeight()\r\n if (this.showTree) {\r\n this.calculateTreeHeight()\r\n }\r\n })\r\n // 刷新列表数据\r\n const { overrideInit = false } = this.tableMeta\r\n if (overrideInit) {\r\n // 如果使用自定义初始化模式,触发 INIT 事件\r\n this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })\r\n } else {\r\n // 使用当前查询参数刷新表格数据\r\n await this.requestTableData(this.tableQuerys)\r\n }\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 async activated () {\r\n await this.keepAliveRefresh()\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 });
|
|
3703
|
+
inject("data-v-95429590_0", { source: ".ele.model__tree-table[data-v-95429590] {\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-95429590] {\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-95429590] {\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-95429590] {\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-95429590] {\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-95429590] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-95429590] {\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-95429590] {\n cursor: pointer;\n color: var(--idooel-primary-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\models\\tree-table-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AA8wBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC7wBA;AD+wBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC7wBA;ADgxBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AC9wBA;ADgxBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;AC9wBA;ADgxBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;AC9wBA;ADixBA;EACA,gBAAA;AC/wBA;ADgxBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;AC9wBA;ADixBA;EACA,eAAA;EACA,kCAAA;AC/wBA;;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 :mode=\"mode\"\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 keepAliveRefresh: this.keepAliveRefresh,\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 keepAliveRefresh: this.keepAliveRefresh,\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 mode () {\r\n const { page = {} } = this.tableMeta\r\n return page.mode\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 // onSearch会初始化请求表格数据,所以不需要在这里请求表格数据\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 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 } else {\r\n const { params = {}, fieldMap = {} } = this.tableMeta\r\n const currentRowData = this.getCurrentRowData()\r\n const ctx = { \r\n _route: this.$route.query, \r\n currentRowData: currentRowData\r\n }\r\n this.tableQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx))\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 const { initSearch = false } = props\r\n if (this.showTree && initSearch) return\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 this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: this.tableQuerys.currentPage || 1, pageSize: this.tableQuerys.pageSize || page.pageSize || 10 }, 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 async keepAliveRefresh () {\r\n // 重新计算表格高度(应对窗口大小变化)\r\n this.$nextTick(() => {\r\n this.calculateTableHeight()\r\n if (this.showTree) {\r\n this.calculateTreeHeight()\r\n }\r\n })\r\n // 刷新列表数据\r\n const { overrideInit = false } = this.tableMeta\r\n if (overrideInit) {\r\n // 如果使用自定义初始化模式,触发 INIT 事件\r\n this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })\r\n } else {\r\n // 使用当前查询参数刷新表格数据\r\n await this.requestTableData(this.tableQuerys)\r\n }\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 async activated () {\r\n await this.keepAliveRefresh()\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 });
|
|
3646
3704
|
|
|
3647
3705
|
};
|
|
3648
3706
|
/* scoped */
|
|
3649
|
-
const __vue_scope_id__$
|
|
3707
|
+
const __vue_scope_id__$B = "data-v-95429590";
|
|
3650
3708
|
/* module identifier */
|
|
3651
|
-
const __vue_module_identifier__$
|
|
3709
|
+
const __vue_module_identifier__$B = undefined;
|
|
3652
3710
|
/* functional template */
|
|
3653
|
-
const __vue_is_functional_template__$
|
|
3711
|
+
const __vue_is_functional_template__$B = false;
|
|
3654
3712
|
/* style inject SSR */
|
|
3655
3713
|
|
|
3656
3714
|
/* style inject shadow dom */
|
|
3657
3715
|
|
|
3658
3716
|
|
|
3659
3717
|
|
|
3660
|
-
const __vue_component__$
|
|
3661
|
-
{ render: __vue_render__$
|
|
3662
|
-
__vue_inject_styles__$
|
|
3663
|
-
__vue_script__$
|
|
3664
|
-
__vue_scope_id__$
|
|
3665
|
-
__vue_is_functional_template__$
|
|
3666
|
-
__vue_module_identifier__$
|
|
3718
|
+
const __vue_component__$B = /*#__PURE__*/normalizeComponent(
|
|
3719
|
+
{ render: __vue_render__$B, staticRenderFns: __vue_staticRenderFns__$B },
|
|
3720
|
+
__vue_inject_styles__$B,
|
|
3721
|
+
__vue_script__$B,
|
|
3722
|
+
__vue_scope_id__$B,
|
|
3723
|
+
__vue_is_functional_template__$B,
|
|
3724
|
+
__vue_module_identifier__$B,
|
|
3667
3725
|
false,
|
|
3668
3726
|
createInjector,
|
|
3669
3727
|
undefined,
|
|
@@ -3671,7 +3729,7 @@
|
|
|
3671
3729
|
);
|
|
3672
3730
|
|
|
3673
3731
|
//
|
|
3674
|
-
var script$
|
|
3732
|
+
var script$A = {
|
|
3675
3733
|
name: 'ele-form-group-model',
|
|
3676
3734
|
props: {
|
|
3677
3735
|
mode: {
|
|
@@ -3951,10 +4009,10 @@
|
|
|
3951
4009
|
};
|
|
3952
4010
|
|
|
3953
4011
|
/* script */
|
|
3954
|
-
const __vue_script__$
|
|
4012
|
+
const __vue_script__$A = script$A;
|
|
3955
4013
|
|
|
3956
4014
|
/* template */
|
|
3957
|
-
var __vue_render__$
|
|
4015
|
+
var __vue_render__$A = function () {
|
|
3958
4016
|
var _vm = this;
|
|
3959
4017
|
var _h = _vm.$createElement;
|
|
3960
4018
|
var _c = _vm._self._c || _h;
|
|
@@ -4056,34 +4114,34 @@
|
|
|
4056
4114
|
2
|
|
4057
4115
|
)
|
|
4058
4116
|
};
|
|
4059
|
-
var __vue_staticRenderFns__$
|
|
4060
|
-
__vue_render__$
|
|
4117
|
+
var __vue_staticRenderFns__$A = [];
|
|
4118
|
+
__vue_render__$A._withStripped = true;
|
|
4061
4119
|
|
|
4062
4120
|
/* style */
|
|
4063
|
-
const __vue_inject_styles__$
|
|
4121
|
+
const __vue_inject_styles__$A = function (inject) {
|
|
4064
4122
|
if (!inject) return
|
|
4065
|
-
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 });
|
|
4123
|
+
inject("data-v-b64cef74_0", { source: ".ele.form-group-model__wrapper[data-v-b64cef74] {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-b64cef74] {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-b64cef74]:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title[data-v-b64cef74] {\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-b64cef74] {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer[data-v-b64cef74] {\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":["E:\\code\\OnlineStudy-Base\\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 });
|
|
4066
4124
|
|
|
4067
4125
|
};
|
|
4068
4126
|
/* scoped */
|
|
4069
|
-
const __vue_scope_id__$
|
|
4127
|
+
const __vue_scope_id__$A = "data-v-b64cef74";
|
|
4070
4128
|
/* module identifier */
|
|
4071
|
-
const __vue_module_identifier__$
|
|
4129
|
+
const __vue_module_identifier__$A = undefined;
|
|
4072
4130
|
/* functional template */
|
|
4073
|
-
const __vue_is_functional_template__$
|
|
4131
|
+
const __vue_is_functional_template__$A = false;
|
|
4074
4132
|
/* style inject SSR */
|
|
4075
4133
|
|
|
4076
4134
|
/* style inject shadow dom */
|
|
4077
4135
|
|
|
4078
4136
|
|
|
4079
4137
|
|
|
4080
|
-
const __vue_component__$
|
|
4081
|
-
{ render: __vue_render__$
|
|
4082
|
-
__vue_inject_styles__$
|
|
4083
|
-
__vue_script__$
|
|
4084
|
-
__vue_scope_id__$
|
|
4085
|
-
__vue_is_functional_template__$
|
|
4086
|
-
__vue_module_identifier__$
|
|
4138
|
+
const __vue_component__$A = /*#__PURE__*/normalizeComponent(
|
|
4139
|
+
{ render: __vue_render__$A, staticRenderFns: __vue_staticRenderFns__$A },
|
|
4140
|
+
__vue_inject_styles__$A,
|
|
4141
|
+
__vue_script__$A,
|
|
4142
|
+
__vue_scope_id__$A,
|
|
4143
|
+
__vue_is_functional_template__$A,
|
|
4144
|
+
__vue_module_identifier__$A,
|
|
4087
4145
|
false,
|
|
4088
4146
|
createInjector,
|
|
4089
4147
|
undefined,
|
|
@@ -4091,7 +4149,7 @@
|
|
|
4091
4149
|
);
|
|
4092
4150
|
|
|
4093
4151
|
//
|
|
4094
|
-
var script$
|
|
4152
|
+
var script$z = {
|
|
4095
4153
|
name: 'ele-form-model',
|
|
4096
4154
|
props: {
|
|
4097
4155
|
disabled: {
|
|
@@ -4360,10 +4418,10 @@
|
|
|
4360
4418
|
};
|
|
4361
4419
|
|
|
4362
4420
|
/* script */
|
|
4363
|
-
const __vue_script__$
|
|
4421
|
+
const __vue_script__$z = script$z;
|
|
4364
4422
|
|
|
4365
4423
|
/* template */
|
|
4366
|
-
var __vue_render__$
|
|
4424
|
+
var __vue_render__$z = function () {
|
|
4367
4425
|
var _vm = this;
|
|
4368
4426
|
var _h = _vm.$createElement;
|
|
4369
4427
|
var _c = _vm._self._c || _h;
|
|
@@ -4421,34 +4479,34 @@
|
|
|
4421
4479
|
: _vm._e(),
|
|
4422
4480
|
])
|
|
4423
4481
|
};
|
|
4424
|
-
var __vue_staticRenderFns__$
|
|
4425
|
-
__vue_render__$
|
|
4482
|
+
var __vue_staticRenderFns__$z = [];
|
|
4483
|
+
__vue_render__$z._withStripped = true;
|
|
4426
4484
|
|
|
4427
4485
|
/* style */
|
|
4428
|
-
const __vue_inject_styles__$
|
|
4486
|
+
const __vue_inject_styles__$z = function (inject) {
|
|
4429
4487
|
if (!inject) return
|
|
4430
|
-
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 });
|
|
4488
|
+
inject("data-v-1aa83856_0", { source: ".form__model--wrapper[data-v-1aa83856] {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title[data-v-1aa83856] {\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-1aa83856] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-1aa83856] {\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":["E:\\code\\OnlineStudy-Base\\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 });
|
|
4431
4489
|
|
|
4432
4490
|
};
|
|
4433
4491
|
/* scoped */
|
|
4434
|
-
const __vue_scope_id__$
|
|
4492
|
+
const __vue_scope_id__$z = "data-v-1aa83856";
|
|
4435
4493
|
/* module identifier */
|
|
4436
|
-
const __vue_module_identifier__$
|
|
4494
|
+
const __vue_module_identifier__$z = undefined;
|
|
4437
4495
|
/* functional template */
|
|
4438
|
-
const __vue_is_functional_template__$
|
|
4496
|
+
const __vue_is_functional_template__$z = false;
|
|
4439
4497
|
/* style inject SSR */
|
|
4440
4498
|
|
|
4441
4499
|
/* style inject shadow dom */
|
|
4442
4500
|
|
|
4443
4501
|
|
|
4444
4502
|
|
|
4445
|
-
const __vue_component__$
|
|
4446
|
-
{ render: __vue_render__$
|
|
4447
|
-
__vue_inject_styles__$
|
|
4448
|
-
__vue_script__$
|
|
4449
|
-
__vue_scope_id__$
|
|
4450
|
-
__vue_is_functional_template__$
|
|
4451
|
-
__vue_module_identifier__$
|
|
4503
|
+
const __vue_component__$z = /*#__PURE__*/normalizeComponent(
|
|
4504
|
+
{ render: __vue_render__$z, staticRenderFns: __vue_staticRenderFns__$z },
|
|
4505
|
+
__vue_inject_styles__$z,
|
|
4506
|
+
__vue_script__$z,
|
|
4507
|
+
__vue_scope_id__$z,
|
|
4508
|
+
__vue_is_functional_template__$z,
|
|
4509
|
+
__vue_module_identifier__$z,
|
|
4452
4510
|
false,
|
|
4453
4511
|
createInjector,
|
|
4454
4512
|
undefined,
|
|
@@ -4456,7 +4514,7 @@
|
|
|
4456
4514
|
);
|
|
4457
4515
|
|
|
4458
4516
|
//
|
|
4459
|
-
var script$
|
|
4517
|
+
var script$y = {
|
|
4460
4518
|
name: 'ele-step-model',
|
|
4461
4519
|
props: {
|
|
4462
4520
|
stepMeta: {
|
|
@@ -4647,10 +4705,10 @@
|
|
|
4647
4705
|
};
|
|
4648
4706
|
|
|
4649
4707
|
/* script */
|
|
4650
|
-
const __vue_script__$
|
|
4708
|
+
const __vue_script__$y = script$y;
|
|
4651
4709
|
|
|
4652
4710
|
/* template */
|
|
4653
|
-
var __vue_render__$
|
|
4711
|
+
var __vue_render__$y = function () {
|
|
4654
4712
|
var _vm = this;
|
|
4655
4713
|
var _h = _vm.$createElement;
|
|
4656
4714
|
var _c = _vm._self._c || _h;
|
|
@@ -4716,34 +4774,34 @@
|
|
|
4716
4774
|
),
|
|
4717
4775
|
])
|
|
4718
4776
|
};
|
|
4719
|
-
var __vue_staticRenderFns__$
|
|
4720
|
-
__vue_render__$
|
|
4777
|
+
var __vue_staticRenderFns__$y = [];
|
|
4778
|
+
__vue_render__$y._withStripped = true;
|
|
4721
4779
|
|
|
4722
4780
|
/* style */
|
|
4723
|
-
const __vue_inject_styles__$
|
|
4781
|
+
const __vue_inject_styles__$y = function (inject) {
|
|
4724
4782
|
if (!inject) return
|
|
4725
|
-
inject("data-v-
|
|
4783
|
+
inject("data-v-6312b5ba_0", { source: ".ele-step-model__wrapper[data-v-6312b5ba] {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper[data-v-6312b5ba] {\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-6312b5ba] {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper[data-v-6312b5ba] {\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-6312b5ba] {\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":["E:\\code\\OnlineStudy-Base\\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 });
|
|
4726
4784
|
|
|
4727
4785
|
};
|
|
4728
4786
|
/* scoped */
|
|
4729
|
-
const __vue_scope_id__$
|
|
4787
|
+
const __vue_scope_id__$y = "data-v-6312b5ba";
|
|
4730
4788
|
/* module identifier */
|
|
4731
|
-
const __vue_module_identifier__$
|
|
4789
|
+
const __vue_module_identifier__$y = undefined;
|
|
4732
4790
|
/* functional template */
|
|
4733
|
-
const __vue_is_functional_template__$
|
|
4791
|
+
const __vue_is_functional_template__$y = false;
|
|
4734
4792
|
/* style inject SSR */
|
|
4735
4793
|
|
|
4736
4794
|
/* style inject shadow dom */
|
|
4737
4795
|
|
|
4738
4796
|
|
|
4739
4797
|
|
|
4740
|
-
const __vue_component__$
|
|
4741
|
-
{ render: __vue_render__$
|
|
4742
|
-
__vue_inject_styles__$
|
|
4743
|
-
__vue_script__$
|
|
4744
|
-
__vue_scope_id__$
|
|
4745
|
-
__vue_is_functional_template__$
|
|
4746
|
-
__vue_module_identifier__$
|
|
4798
|
+
const __vue_component__$y = /*#__PURE__*/normalizeComponent(
|
|
4799
|
+
{ render: __vue_render__$y, staticRenderFns: __vue_staticRenderFns__$y },
|
|
4800
|
+
__vue_inject_styles__$y,
|
|
4801
|
+
__vue_script__$y,
|
|
4802
|
+
__vue_scope_id__$y,
|
|
4803
|
+
__vue_is_functional_template__$y,
|
|
4804
|
+
__vue_module_identifier__$y,
|
|
4747
4805
|
false,
|
|
4748
4806
|
createInjector,
|
|
4749
4807
|
undefined,
|
|
@@ -4751,7 +4809,7 @@
|
|
|
4751
4809
|
);
|
|
4752
4810
|
|
|
4753
4811
|
//
|
|
4754
|
-
var script$
|
|
4812
|
+
var script$x = {
|
|
4755
4813
|
name: 'ele-tpl',
|
|
4756
4814
|
props: {
|
|
4757
4815
|
modelName: {
|
|
@@ -4759,10 +4817,10 @@
|
|
|
4759
4817
|
}
|
|
4760
4818
|
},
|
|
4761
4819
|
components: {
|
|
4820
|
+
[__vue_component__$B.name]: __vue_component__$B,
|
|
4762
4821
|
[__vue_component__$A.name]: __vue_component__$A,
|
|
4763
|
-
[__vue_component__$
|
|
4764
|
-
[__vue_component__$
|
|
4765
|
-
[__vue_component__$y.name]: __vue_component__$y
|
|
4822
|
+
[__vue_component__$y.name]: __vue_component__$y,
|
|
4823
|
+
[__vue_component__$z.name]: __vue_component__$z
|
|
4766
4824
|
},
|
|
4767
4825
|
computed: {
|
|
4768
4826
|
modelNameValidator() {
|
|
@@ -4784,10 +4842,10 @@
|
|
|
4784
4842
|
};
|
|
4785
4843
|
|
|
4786
4844
|
/* script */
|
|
4787
|
-
const __vue_script__$
|
|
4845
|
+
const __vue_script__$x = script$x;
|
|
4788
4846
|
|
|
4789
4847
|
/* template */
|
|
4790
|
-
var __vue_render__$
|
|
4848
|
+
var __vue_render__$x = function () {
|
|
4791
4849
|
var _vm = this;
|
|
4792
4850
|
var _h = _vm.$createElement;
|
|
4793
4851
|
var _c = _vm._self._c || _h;
|
|
@@ -4825,44 +4883,44 @@
|
|
|
4825
4883
|
domProps: { innerHTML: _vm._s(_vm.modelNameValidator.message) },
|
|
4826
4884
|
})
|
|
4827
4885
|
};
|
|
4828
|
-
var __vue_staticRenderFns__$
|
|
4829
|
-
__vue_render__$
|
|
4886
|
+
var __vue_staticRenderFns__$x = [];
|
|
4887
|
+
__vue_render__$x._withStripped = true;
|
|
4830
4888
|
|
|
4831
4889
|
/* style */
|
|
4832
|
-
const __vue_inject_styles__$
|
|
4890
|
+
const __vue_inject_styles__$x = function (inject) {
|
|
4833
4891
|
if (!inject) return
|
|
4834
|
-
inject("data-v-
|
|
4892
|
+
inject("data-v-7b0fd229_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 });
|
|
4835
4893
|
|
|
4836
4894
|
};
|
|
4837
4895
|
/* scoped */
|
|
4838
|
-
const __vue_scope_id__$
|
|
4896
|
+
const __vue_scope_id__$x = undefined;
|
|
4839
4897
|
/* module identifier */
|
|
4840
|
-
const __vue_module_identifier__$
|
|
4898
|
+
const __vue_module_identifier__$x = undefined;
|
|
4841
4899
|
/* functional template */
|
|
4842
|
-
const __vue_is_functional_template__$
|
|
4900
|
+
const __vue_is_functional_template__$x = false;
|
|
4843
4901
|
/* style inject SSR */
|
|
4844
4902
|
|
|
4845
4903
|
/* style inject shadow dom */
|
|
4846
4904
|
|
|
4847
4905
|
|
|
4848
4906
|
|
|
4849
|
-
const __vue_component__$
|
|
4850
|
-
{ render: __vue_render__$
|
|
4851
|
-
__vue_inject_styles__$
|
|
4852
|
-
__vue_script__$
|
|
4853
|
-
__vue_scope_id__$
|
|
4854
|
-
__vue_is_functional_template__$
|
|
4855
|
-
__vue_module_identifier__$
|
|
4907
|
+
const __vue_component__$x = /*#__PURE__*/normalizeComponent(
|
|
4908
|
+
{ render: __vue_render__$x, staticRenderFns: __vue_staticRenderFns__$x },
|
|
4909
|
+
__vue_inject_styles__$x,
|
|
4910
|
+
__vue_script__$x,
|
|
4911
|
+
__vue_scope_id__$x,
|
|
4912
|
+
__vue_is_functional_template__$x,
|
|
4913
|
+
__vue_module_identifier__$x,
|
|
4856
4914
|
false,
|
|
4857
4915
|
createInjector,
|
|
4858
4916
|
undefined,
|
|
4859
4917
|
undefined
|
|
4860
4918
|
);
|
|
4861
4919
|
|
|
4862
|
-
__vue_component__$
|
|
4920
|
+
__vue_component__$x.install = Vue => Vue.component(__vue_component__$x.name, __vue_component__$x);
|
|
4863
4921
|
|
|
4864
4922
|
//
|
|
4865
|
-
var script$
|
|
4923
|
+
var script$w = {
|
|
4866
4924
|
name: 'ele-form',
|
|
4867
4925
|
props: {
|
|
4868
4926
|
value: {
|
|
@@ -4901,7 +4959,8 @@
|
|
|
4901
4959
|
},
|
|
4902
4960
|
form() {
|
|
4903
4961
|
const ref = this.$form.createForm(this, {
|
|
4904
|
-
name: this.formName
|
|
4962
|
+
name: this.formName,
|
|
4963
|
+
onFieldsChange: this.onFieldsChange
|
|
4905
4964
|
});
|
|
4906
4965
|
return ref;
|
|
4907
4966
|
},
|
|
@@ -4916,6 +4975,39 @@
|
|
|
4916
4975
|
this.setDefaultValues();
|
|
4917
4976
|
},
|
|
4918
4977
|
methods: {
|
|
4978
|
+
onFieldsChange() {
|
|
4979
|
+
this.executeOptionListExpression();
|
|
4980
|
+
},
|
|
4981
|
+
executeOptionListExpression() {
|
|
4982
|
+
this.elements.forEach(ele => {
|
|
4983
|
+
if (ele.optionList) {
|
|
4984
|
+
const optionList = this.evalOptionListExpression(ele.optionList);
|
|
4985
|
+
this.$set(ele, 'optionList', optionList);
|
|
4986
|
+
}
|
|
4987
|
+
});
|
|
4988
|
+
},
|
|
4989
|
+
evalOptionListExpression(optionList = []) {
|
|
4990
|
+
const executeExpression = expression$1 => {
|
|
4991
|
+
if (shared.type.isBool(expression$1)) return expression$1;
|
|
4992
|
+
if (shared.type.isEmpty(expression$1)) return true;
|
|
4993
|
+
const ret = expression.parse(expression$1, {
|
|
4994
|
+
...this.formModel,
|
|
4995
|
+
...this.getFieldsValue(),
|
|
4996
|
+
_route: this.$route.query,
|
|
4997
|
+
_routeMeta: this.$route.meta
|
|
4998
|
+
});
|
|
4999
|
+
return ret;
|
|
5000
|
+
};
|
|
5001
|
+
return optionList.map(item => {
|
|
5002
|
+
const {
|
|
5003
|
+
show
|
|
5004
|
+
} = item;
|
|
5005
|
+
return {
|
|
5006
|
+
...item,
|
|
5007
|
+
_show: executeExpression(show)
|
|
5008
|
+
};
|
|
5009
|
+
});
|
|
5010
|
+
},
|
|
4919
5011
|
setFormModel(props = {}) {
|
|
4920
5012
|
this.formModel = props;
|
|
4921
5013
|
this.dispatchExpression();
|
|
@@ -5027,10 +5119,10 @@
|
|
|
5027
5119
|
};
|
|
5028
5120
|
|
|
5029
5121
|
/* script */
|
|
5030
|
-
const __vue_script__$
|
|
5122
|
+
const __vue_script__$w = script$w;
|
|
5031
5123
|
|
|
5032
5124
|
/* template */
|
|
5033
|
-
var __vue_render__$
|
|
5125
|
+
var __vue_render__$w = function () {
|
|
5034
5126
|
var _vm = this;
|
|
5035
5127
|
var _h = _vm.$createElement;
|
|
5036
5128
|
var _c = _vm._self._c || _h;
|
|
@@ -5056,7 +5148,7 @@
|
|
|
5056
5148
|
"a-col",
|
|
5057
5149
|
{ key: ele.name, attrs: { span: ele.span } },
|
|
5058
5150
|
[
|
|
5059
|
-
ele.type == "Input"
|
|
5151
|
+
ele.type == "ele-input" || ele.type == "Input"
|
|
5060
5152
|
? [
|
|
5061
5153
|
_c(
|
|
5062
5154
|
"a-form-item",
|
|
@@ -5096,7 +5188,8 @@
|
|
|
5096
5188
|
1
|
|
5097
5189
|
),
|
|
5098
5190
|
]
|
|
5099
|
-
: ele.type == "
|
|
5191
|
+
: ele.type == "ele-textarea" ||
|
|
5192
|
+
ele.type == "Textarea"
|
|
5100
5193
|
? [
|
|
5101
5194
|
_c(
|
|
5102
5195
|
"a-form-item",
|
|
@@ -5139,7 +5232,7 @@
|
|
|
5139
5232
|
1
|
|
5140
5233
|
),
|
|
5141
5234
|
]
|
|
5142
|
-
: ele.type == "Select"
|
|
5235
|
+
: ele.type == "ele-select" || ele.type == "Select"
|
|
5143
5236
|
? [
|
|
5144
5237
|
_c(
|
|
5145
5238
|
"a-form-item",
|
|
@@ -5297,7 +5390,8 @@
|
|
|
5297
5390
|
1
|
|
5298
5391
|
),
|
|
5299
5392
|
]
|
|
5300
|
-
: ele.type == "
|
|
5393
|
+
: ele.type == "ele-select-entity" ||
|
|
5394
|
+
ele.type == "SelectEntity"
|
|
5301
5395
|
? [
|
|
5302
5396
|
_c(
|
|
5303
5397
|
"a-form-item",
|
|
@@ -5375,7 +5469,8 @@
|
|
|
5375
5469
|
1
|
|
5376
5470
|
),
|
|
5377
5471
|
]
|
|
5378
|
-
: ele.type == "Checkbox"
|
|
5472
|
+
: ele.type == "ele-Checkbox" ||
|
|
5473
|
+
ele.type == "Checkbox"
|
|
5379
5474
|
? [
|
|
5380
5475
|
_c(
|
|
5381
5476
|
"a-form-item",
|
|
@@ -5410,7 +5505,7 @@
|
|
|
5410
5505
|
1
|
|
5411
5506
|
),
|
|
5412
5507
|
]
|
|
5413
|
-
: ele.type == "Radio"
|
|
5508
|
+
: ele.type == "ele-radio" || ele.type == "Radio"
|
|
5414
5509
|
? [
|
|
5415
5510
|
_c(
|
|
5416
5511
|
"a-form-item",
|
|
@@ -5606,41 +5701,41 @@
|
|
|
5606
5701
|
1
|
|
5607
5702
|
)
|
|
5608
5703
|
};
|
|
5609
|
-
var __vue_staticRenderFns__$
|
|
5610
|
-
__vue_render__$
|
|
5704
|
+
var __vue_staticRenderFns__$w = [];
|
|
5705
|
+
__vue_render__$w._withStripped = true;
|
|
5611
5706
|
|
|
5612
5707
|
/* style */
|
|
5613
|
-
const __vue_inject_styles__$
|
|
5708
|
+
const __vue_inject_styles__$w = function (inject) {
|
|
5614
5709
|
if (!inject) return
|
|
5615
|
-
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 });
|
|
5710
|
+
inject("data-v-6c735b44_0", { source: ".ele__form--wrapper[data-v-6c735b44] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\form\\src\\index.vue","index.vue"],"names":[],"mappings":"AAiVA;EACA,gBAAA;AChVA;;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 == 'ele-input' || 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 == 'ele-textarea' || 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 == 'ele-select' || 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 == 'ele-select-entity' || 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 == 'ele-Checkbox' || 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 == 'ele-radio' || 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, onFieldsChange: this.onFieldsChange })\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 onFieldsChange () {\r\n this.executeOptionListExpression()\r\n },\r\n executeOptionListExpression () {\r\n this.elements.forEach(ele => {\r\n if (ele.optionList) {\r\n const optionList = this.evalOptionListExpression(ele.optionList)\r\n this.$set(ele, 'optionList', optionList)\r\n }\r\n })\r\n },\r\n evalOptionListExpression (optionList = []) {\r\n const executeExpression = (expression) => {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return true\r\n const ret = parse(expression, { ...this.formModel, ...this.getFieldsValue(), _route: this.$route.query, _routeMeta: this.$route.meta })\r\n return ret\r\n }\r\n return optionList.map(item => {\r\n const { show } = item\r\n return { ...item, _show: executeExpression(show) }\r\n })\r\n },\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 });
|
|
5616
5711
|
|
|
5617
5712
|
};
|
|
5618
5713
|
/* scoped */
|
|
5619
|
-
const __vue_scope_id__$
|
|
5714
|
+
const __vue_scope_id__$w = "data-v-6c735b44";
|
|
5620
5715
|
/* module identifier */
|
|
5621
|
-
const __vue_module_identifier__$
|
|
5716
|
+
const __vue_module_identifier__$w = undefined;
|
|
5622
5717
|
/* functional template */
|
|
5623
|
-
const __vue_is_functional_template__$
|
|
5718
|
+
const __vue_is_functional_template__$w = false;
|
|
5624
5719
|
/* style inject SSR */
|
|
5625
5720
|
|
|
5626
5721
|
/* style inject shadow dom */
|
|
5627
5722
|
|
|
5628
5723
|
|
|
5629
5724
|
|
|
5630
|
-
const __vue_component__$
|
|
5631
|
-
{ render: __vue_render__$
|
|
5632
|
-
__vue_inject_styles__$
|
|
5633
|
-
__vue_script__$
|
|
5634
|
-
__vue_scope_id__$
|
|
5635
|
-
__vue_is_functional_template__$
|
|
5636
|
-
__vue_module_identifier__$
|
|
5725
|
+
const __vue_component__$w = /*#__PURE__*/normalizeComponent(
|
|
5726
|
+
{ render: __vue_render__$w, staticRenderFns: __vue_staticRenderFns__$w },
|
|
5727
|
+
__vue_inject_styles__$w,
|
|
5728
|
+
__vue_script__$w,
|
|
5729
|
+
__vue_scope_id__$w,
|
|
5730
|
+
__vue_is_functional_template__$w,
|
|
5731
|
+
__vue_module_identifier__$w,
|
|
5637
5732
|
false,
|
|
5638
5733
|
createInjector,
|
|
5639
5734
|
undefined,
|
|
5640
5735
|
undefined
|
|
5641
5736
|
);
|
|
5642
5737
|
|
|
5643
|
-
__vue_component__$
|
|
5738
|
+
__vue_component__$w.install = Vue => Vue.component(__vue_component__$w.name, __vue_component__$w);
|
|
5644
5739
|
|
|
5645
5740
|
//
|
|
5646
5741
|
//
|
|
@@ -5654,7 +5749,7 @@
|
|
|
5654
5749
|
//
|
|
5655
5750
|
//
|
|
5656
5751
|
|
|
5657
|
-
var script$
|
|
5752
|
+
var script$v = {
|
|
5658
5753
|
name: 'ele-alert',
|
|
5659
5754
|
props: {
|
|
5660
5755
|
type: {
|
|
@@ -5683,10 +5778,10 @@
|
|
|
5683
5778
|
};
|
|
5684
5779
|
|
|
5685
5780
|
/* script */
|
|
5686
|
-
const __vue_script__$
|
|
5781
|
+
const __vue_script__$v = script$v;
|
|
5687
5782
|
|
|
5688
5783
|
/* template */
|
|
5689
|
-
var __vue_render__$
|
|
5784
|
+
var __vue_render__$v = function () {
|
|
5690
5785
|
var _vm = this;
|
|
5691
5786
|
var _h = _vm.$createElement;
|
|
5692
5787
|
var _c = _vm._self._c || _h;
|
|
@@ -5702,41 +5797,41 @@
|
|
|
5702
5797
|
},
|
|
5703
5798
|
})
|
|
5704
5799
|
};
|
|
5705
|
-
var __vue_staticRenderFns__$
|
|
5706
|
-
__vue_render__$
|
|
5800
|
+
var __vue_staticRenderFns__$v = [];
|
|
5801
|
+
__vue_render__$v._withStripped = true;
|
|
5707
5802
|
|
|
5708
5803
|
/* style */
|
|
5709
|
-
const __vue_inject_styles__$
|
|
5804
|
+
const __vue_inject_styles__$v = function (inject) {
|
|
5710
5805
|
if (!inject) return
|
|
5711
|
-
inject("data-v-
|
|
5806
|
+
inject("data-v-00c1ba58_0", { source: ".ele-alert[data-v-00c1ba58] {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
5712
5807
|
|
|
5713
5808
|
};
|
|
5714
5809
|
/* scoped */
|
|
5715
|
-
const __vue_scope_id__$
|
|
5810
|
+
const __vue_scope_id__$v = "data-v-00c1ba58";
|
|
5716
5811
|
/* module identifier */
|
|
5717
|
-
const __vue_module_identifier__$
|
|
5812
|
+
const __vue_module_identifier__$v = undefined;
|
|
5718
5813
|
/* functional template */
|
|
5719
|
-
const __vue_is_functional_template__$
|
|
5814
|
+
const __vue_is_functional_template__$v = false;
|
|
5720
5815
|
/* style inject SSR */
|
|
5721
5816
|
|
|
5722
5817
|
/* style inject shadow dom */
|
|
5723
5818
|
|
|
5724
5819
|
|
|
5725
5820
|
|
|
5726
|
-
const __vue_component__$
|
|
5727
|
-
{ render: __vue_render__$
|
|
5728
|
-
__vue_inject_styles__$
|
|
5729
|
-
__vue_script__$
|
|
5730
|
-
__vue_scope_id__$
|
|
5731
|
-
__vue_is_functional_template__$
|
|
5732
|
-
__vue_module_identifier__$
|
|
5821
|
+
const __vue_component__$v = /*#__PURE__*/normalizeComponent(
|
|
5822
|
+
{ render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v },
|
|
5823
|
+
__vue_inject_styles__$v,
|
|
5824
|
+
__vue_script__$v,
|
|
5825
|
+
__vue_scope_id__$v,
|
|
5826
|
+
__vue_is_functional_template__$v,
|
|
5827
|
+
__vue_module_identifier__$v,
|
|
5733
5828
|
false,
|
|
5734
5829
|
createInjector,
|
|
5735
5830
|
undefined,
|
|
5736
5831
|
undefined
|
|
5737
5832
|
);
|
|
5738
5833
|
|
|
5739
|
-
__vue_component__$
|
|
5834
|
+
__vue_component__$v.install = Vue => Vue.component(__vue_component__$v.name, __vue_component__$v);
|
|
5740
5835
|
|
|
5741
5836
|
//
|
|
5742
5837
|
|
|
@@ -5799,7 +5894,7 @@
|
|
|
5799
5894
|
name: 'icon-mp1'
|
|
5800
5895
|
}
|
|
5801
5896
|
};
|
|
5802
|
-
var script$
|
|
5897
|
+
var script$u = {
|
|
5803
5898
|
name: 'ele-upload',
|
|
5804
5899
|
components: {
|
|
5805
5900
|
FileUpload: FileUpload__default["default"]
|
|
@@ -6583,10 +6678,10 @@
|
|
|
6583
6678
|
};
|
|
6584
6679
|
|
|
6585
6680
|
/* script */
|
|
6586
|
-
const __vue_script__$
|
|
6681
|
+
const __vue_script__$u = script$u;
|
|
6587
6682
|
|
|
6588
6683
|
/* template */
|
|
6589
|
-
var __vue_render__$
|
|
6684
|
+
var __vue_render__$u = function () {
|
|
6590
6685
|
var _vm = this;
|
|
6591
6686
|
var _h = _vm.$createElement;
|
|
6592
6687
|
var _c = _vm._self._c || _h;
|
|
@@ -6806,44 +6901,44 @@
|
|
|
6806
6901
|
1
|
|
6807
6902
|
)
|
|
6808
6903
|
};
|
|
6809
|
-
var __vue_staticRenderFns__$
|
|
6810
|
-
__vue_render__$
|
|
6904
|
+
var __vue_staticRenderFns__$u = [];
|
|
6905
|
+
__vue_render__$u._withStripped = true;
|
|
6811
6906
|
|
|
6812
6907
|
/* style */
|
|
6813
|
-
const __vue_inject_styles__$
|
|
6908
|
+
const __vue_inject_styles__$u = function (inject) {
|
|
6814
6909
|
if (!inject) return
|
|
6815
|
-
inject("data-v-3db5c928_0", { source: "[data-v-3db5c928] .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-3db5c928] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n[data-v-3db5c928] .ele-upload__inner {\n border-radius: var(--idooel-form-border-radius);\n}\n.ele-upload__wrapper[data-v-3db5c928] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-3db5c928] {\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-3db5c928] {\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-3db5c928] {\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-3db5c928] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-3db5c928] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-3db5c928] {\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-3db5c928] {\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-3db5c928] {\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-3db5c928] {\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-3db5c928] {\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-3db5c928] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-3db5c928] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-3db5c928] {\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":"AA+4BA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;AC94BA;AD+4BA;EACA,0DAAA;AC74BA;ADu4BA;EAQA,+CAAA;AC54BA;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>\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 //TODO\r\n iconIsZhWrod: false\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 });
|
|
6910
|
+
inject("data-v-3909f46c_0", { source: "[data-v-3909f46c] .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-3909f46c] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n[data-v-3909f46c] .ele-upload__inner {\n border-radius: var(--idooel-form-border-radius);\n}\n.ele-upload__wrapper[data-v-3909f46c] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-3909f46c] {\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-3909f46c] {\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-3909f46c] {\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-3909f46c] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-3909f46c] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-3909f46c] {\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-3909f46c] {\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-3909f46c] {\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-3909f46c] {\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-3909f46c] {\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-3909f46c] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-3909f46c] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-3909f46c] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\upload\\src\\index.vue","index.vue"],"names":[],"mappings":"AA+4BA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;AC94BA;AD+4BA;EACA,0DAAA;AC74BA;ADu4BA;EAQA,+CAAA;AC54BA;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>\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 //TODO\r\n iconIsZhWrod: false\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 });
|
|
6816
6911
|
|
|
6817
6912
|
};
|
|
6818
6913
|
/* scoped */
|
|
6819
|
-
const __vue_scope_id__$
|
|
6914
|
+
const __vue_scope_id__$u = "data-v-3909f46c";
|
|
6820
6915
|
/* module identifier */
|
|
6821
|
-
const __vue_module_identifier__$
|
|
6916
|
+
const __vue_module_identifier__$u = undefined;
|
|
6822
6917
|
/* functional template */
|
|
6823
|
-
const __vue_is_functional_template__$
|
|
6918
|
+
const __vue_is_functional_template__$u = false;
|
|
6824
6919
|
/* style inject SSR */
|
|
6825
6920
|
|
|
6826
6921
|
/* style inject shadow dom */
|
|
6827
6922
|
|
|
6828
6923
|
|
|
6829
6924
|
|
|
6830
|
-
const __vue_component__$
|
|
6831
|
-
{ render: __vue_render__$
|
|
6832
|
-
__vue_inject_styles__$
|
|
6833
|
-
__vue_script__$
|
|
6834
|
-
__vue_scope_id__$
|
|
6835
|
-
__vue_is_functional_template__$
|
|
6836
|
-
__vue_module_identifier__$
|
|
6925
|
+
const __vue_component__$u = /*#__PURE__*/normalizeComponent(
|
|
6926
|
+
{ render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u },
|
|
6927
|
+
__vue_inject_styles__$u,
|
|
6928
|
+
__vue_script__$u,
|
|
6929
|
+
__vue_scope_id__$u,
|
|
6930
|
+
__vue_is_functional_template__$u,
|
|
6931
|
+
__vue_module_identifier__$u,
|
|
6837
6932
|
false,
|
|
6838
6933
|
createInjector,
|
|
6839
6934
|
undefined,
|
|
6840
6935
|
undefined
|
|
6841
6936
|
);
|
|
6842
6937
|
|
|
6843
|
-
__vue_component__$
|
|
6938
|
+
__vue_component__$u.install = Vue => Vue.component(__vue_component__$u.name, __vue_component__$u);
|
|
6844
6939
|
|
|
6845
6940
|
//
|
|
6846
|
-
var script$
|
|
6941
|
+
var script$t = {
|
|
6847
6942
|
name: 'ele-select-entity',
|
|
6848
6943
|
props: {
|
|
6849
6944
|
value: {
|
|
@@ -6905,10 +7000,10 @@
|
|
|
6905
7000
|
};
|
|
6906
7001
|
|
|
6907
7002
|
/* script */
|
|
6908
|
-
const __vue_script__$
|
|
7003
|
+
const __vue_script__$t = script$t;
|
|
6909
7004
|
|
|
6910
7005
|
/* template */
|
|
6911
|
-
var __vue_render__$
|
|
7006
|
+
var __vue_render__$t = function () {
|
|
6912
7007
|
var _vm = this;
|
|
6913
7008
|
var _h = _vm.$createElement;
|
|
6914
7009
|
var _c = _vm._self._c || _h;
|
|
@@ -6961,41 +7056,41 @@
|
|
|
6961
7056
|
2
|
|
6962
7057
|
)
|
|
6963
7058
|
};
|
|
6964
|
-
var __vue_staticRenderFns__$
|
|
6965
|
-
__vue_render__$
|
|
7059
|
+
var __vue_staticRenderFns__$t = [];
|
|
7060
|
+
__vue_render__$t._withStripped = true;
|
|
6966
7061
|
|
|
6967
7062
|
/* style */
|
|
6968
|
-
const __vue_inject_styles__$
|
|
7063
|
+
const __vue_inject_styles__$t = function (inject) {
|
|
6969
7064
|
if (!inject) return
|
|
6970
|
-
inject("data-v-
|
|
7065
|
+
inject("data-v-331e6e87_0", { source: ".g-select-entity__wrapper[data-v-331e6e87] {\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-331e6e87]:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input[data-v-331e6e87] {\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-331e6e87] {\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-331e6e87] {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input[data-v-331e6e87] {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
6971
7066
|
|
|
6972
7067
|
};
|
|
6973
7068
|
/* scoped */
|
|
6974
|
-
const __vue_scope_id__$
|
|
7069
|
+
const __vue_scope_id__$t = "data-v-331e6e87";
|
|
6975
7070
|
/* module identifier */
|
|
6976
|
-
const __vue_module_identifier__$
|
|
7071
|
+
const __vue_module_identifier__$t = undefined;
|
|
6977
7072
|
/* functional template */
|
|
6978
|
-
const __vue_is_functional_template__$
|
|
7073
|
+
const __vue_is_functional_template__$t = false;
|
|
6979
7074
|
/* style inject SSR */
|
|
6980
7075
|
|
|
6981
7076
|
/* style inject shadow dom */
|
|
6982
7077
|
|
|
6983
7078
|
|
|
6984
7079
|
|
|
6985
|
-
const __vue_component__$
|
|
6986
|
-
{ render: __vue_render__$
|
|
6987
|
-
__vue_inject_styles__$
|
|
6988
|
-
__vue_script__$
|
|
6989
|
-
__vue_scope_id__$
|
|
6990
|
-
__vue_is_functional_template__$
|
|
6991
|
-
__vue_module_identifier__$
|
|
7080
|
+
const __vue_component__$t = /*#__PURE__*/normalizeComponent(
|
|
7081
|
+
{ render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t },
|
|
7082
|
+
__vue_inject_styles__$t,
|
|
7083
|
+
__vue_script__$t,
|
|
7084
|
+
__vue_scope_id__$t,
|
|
7085
|
+
__vue_is_functional_template__$t,
|
|
7086
|
+
__vue_module_identifier__$t,
|
|
6992
7087
|
false,
|
|
6993
7088
|
createInjector,
|
|
6994
7089
|
undefined,
|
|
6995
7090
|
undefined
|
|
6996
7091
|
);
|
|
6997
7092
|
|
|
6998
|
-
__vue_component__$
|
|
7093
|
+
__vue_component__$t.install = Vue => Vue.component(__vue_component__$t.name, __vue_component__$t);
|
|
6999
7094
|
|
|
7000
7095
|
//
|
|
7001
7096
|
//
|
|
@@ -7007,7 +7102,7 @@
|
|
|
7007
7102
|
//
|
|
7008
7103
|
//
|
|
7009
7104
|
|
|
7010
|
-
var script$
|
|
7105
|
+
var script$s = {
|
|
7011
7106
|
name: 'ele-icon',
|
|
7012
7107
|
props: {
|
|
7013
7108
|
type: {
|
|
@@ -7030,10 +7125,10 @@
|
|
|
7030
7125
|
};
|
|
7031
7126
|
|
|
7032
7127
|
/* script */
|
|
7033
|
-
const __vue_script__$
|
|
7128
|
+
const __vue_script__$s = script$s;
|
|
7034
7129
|
|
|
7035
7130
|
/* template */
|
|
7036
|
-
var __vue_render__$
|
|
7131
|
+
var __vue_render__$s = function () {
|
|
7037
7132
|
var _vm = this;
|
|
7038
7133
|
var _h = _vm.$createElement;
|
|
7039
7134
|
var _c = _vm._self._c || _h;
|
|
@@ -7041,17 +7136,17 @@
|
|
|
7041
7136
|
? _c("a-icon", { attrs: { type: _vm.type, theme: _vm.theme } })
|
|
7042
7137
|
: _c("i", { class: ["iconfont", _vm.type] })
|
|
7043
7138
|
};
|
|
7044
|
-
var __vue_staticRenderFns__$
|
|
7045
|
-
__vue_render__$
|
|
7139
|
+
var __vue_staticRenderFns__$s = [];
|
|
7140
|
+
__vue_render__$s._withStripped = true;
|
|
7046
7141
|
|
|
7047
7142
|
/* style */
|
|
7048
|
-
const __vue_inject_styles__$
|
|
7143
|
+
const __vue_inject_styles__$s = undefined;
|
|
7049
7144
|
/* scoped */
|
|
7050
|
-
const __vue_scope_id__$
|
|
7145
|
+
const __vue_scope_id__$s = undefined;
|
|
7051
7146
|
/* module identifier */
|
|
7052
|
-
const __vue_module_identifier__$
|
|
7147
|
+
const __vue_module_identifier__$s = undefined;
|
|
7053
7148
|
/* functional template */
|
|
7054
|
-
const __vue_is_functional_template__$
|
|
7149
|
+
const __vue_is_functional_template__$s = false;
|
|
7055
7150
|
/* style inject */
|
|
7056
7151
|
|
|
7057
7152
|
/* style inject SSR */
|
|
@@ -7060,20 +7155,20 @@
|
|
|
7060
7155
|
|
|
7061
7156
|
|
|
7062
7157
|
|
|
7063
|
-
const __vue_component__$
|
|
7064
|
-
{ render: __vue_render__$
|
|
7065
|
-
__vue_inject_styles__$
|
|
7066
|
-
__vue_script__$
|
|
7067
|
-
__vue_scope_id__$
|
|
7068
|
-
__vue_is_functional_template__$
|
|
7069
|
-
__vue_module_identifier__$
|
|
7158
|
+
const __vue_component__$s = /*#__PURE__*/normalizeComponent(
|
|
7159
|
+
{ render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s },
|
|
7160
|
+
__vue_inject_styles__$s,
|
|
7161
|
+
__vue_script__$s,
|
|
7162
|
+
__vue_scope_id__$s,
|
|
7163
|
+
__vue_is_functional_template__$s,
|
|
7164
|
+
__vue_module_identifier__$s,
|
|
7070
7165
|
false,
|
|
7071
7166
|
undefined,
|
|
7072
7167
|
undefined,
|
|
7073
7168
|
undefined
|
|
7074
7169
|
);
|
|
7075
7170
|
|
|
7076
|
-
__vue_component__$
|
|
7171
|
+
__vue_component__$s.install = Vue => Vue.component(__vue_component__$s.name, __vue_component__$s);
|
|
7077
7172
|
|
|
7078
7173
|
//
|
|
7079
7174
|
//
|
|
@@ -7082,7 +7177,7 @@
|
|
|
7082
7177
|
//
|
|
7083
7178
|
//
|
|
7084
7179
|
|
|
7085
|
-
var script$
|
|
7180
|
+
var script$r = {
|
|
7086
7181
|
name: 'ele-input-number',
|
|
7087
7182
|
props: {
|
|
7088
7183
|
precision: {
|
|
@@ -7100,10 +7195,10 @@
|
|
|
7100
7195
|
};
|
|
7101
7196
|
|
|
7102
7197
|
/* script */
|
|
7103
|
-
const __vue_script__$
|
|
7198
|
+
const __vue_script__$r = script$r;
|
|
7104
7199
|
|
|
7105
7200
|
/* template */
|
|
7106
|
-
var __vue_render__$
|
|
7201
|
+
var __vue_render__$r = function () {
|
|
7107
7202
|
var _vm = this;
|
|
7108
7203
|
var _h = _vm.$createElement;
|
|
7109
7204
|
var _c = _vm._self._c || _h;
|
|
@@ -7127,17 +7222,17 @@
|
|
|
7127
7222
|
1
|
|
7128
7223
|
)
|
|
7129
7224
|
};
|
|
7130
|
-
var __vue_staticRenderFns__$
|
|
7131
|
-
__vue_render__$
|
|
7225
|
+
var __vue_staticRenderFns__$r = [];
|
|
7226
|
+
__vue_render__$r._withStripped = true;
|
|
7132
7227
|
|
|
7133
7228
|
/* style */
|
|
7134
|
-
const __vue_inject_styles__$
|
|
7229
|
+
const __vue_inject_styles__$r = undefined;
|
|
7135
7230
|
/* scoped */
|
|
7136
|
-
const __vue_scope_id__$
|
|
7231
|
+
const __vue_scope_id__$r = undefined;
|
|
7137
7232
|
/* module identifier */
|
|
7138
|
-
const __vue_module_identifier__$
|
|
7233
|
+
const __vue_module_identifier__$r = undefined;
|
|
7139
7234
|
/* functional template */
|
|
7140
|
-
const __vue_is_functional_template__$
|
|
7235
|
+
const __vue_is_functional_template__$r = false;
|
|
7141
7236
|
/* style inject */
|
|
7142
7237
|
|
|
7143
7238
|
/* style inject SSR */
|
|
@@ -7146,23 +7241,23 @@
|
|
|
7146
7241
|
|
|
7147
7242
|
|
|
7148
7243
|
|
|
7149
|
-
const __vue_component__$
|
|
7150
|
-
{ render: __vue_render__$
|
|
7151
|
-
__vue_inject_styles__$
|
|
7152
|
-
__vue_script__$
|
|
7153
|
-
__vue_scope_id__$
|
|
7154
|
-
__vue_is_functional_template__$
|
|
7155
|
-
__vue_module_identifier__$
|
|
7244
|
+
const __vue_component__$r = /*#__PURE__*/normalizeComponent(
|
|
7245
|
+
{ render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r },
|
|
7246
|
+
__vue_inject_styles__$r,
|
|
7247
|
+
__vue_script__$r,
|
|
7248
|
+
__vue_scope_id__$r,
|
|
7249
|
+
__vue_is_functional_template__$r,
|
|
7250
|
+
__vue_module_identifier__$r,
|
|
7156
7251
|
false,
|
|
7157
7252
|
undefined,
|
|
7158
7253
|
undefined,
|
|
7159
7254
|
undefined
|
|
7160
7255
|
);
|
|
7161
7256
|
|
|
7162
|
-
__vue_component__$
|
|
7257
|
+
__vue_component__$r.install = Vue => Vue.component(__vue_component__$r.name, __vue_component__$r);
|
|
7163
7258
|
|
|
7164
7259
|
//
|
|
7165
|
-
var script$
|
|
7260
|
+
var script$q = {
|
|
7166
7261
|
name: 'ele-modal',
|
|
7167
7262
|
props: {
|
|
7168
7263
|
value: {
|
|
@@ -7306,10 +7401,10 @@
|
|
|
7306
7401
|
};
|
|
7307
7402
|
|
|
7308
7403
|
/* script */
|
|
7309
|
-
const __vue_script__$
|
|
7404
|
+
const __vue_script__$q = script$q;
|
|
7310
7405
|
|
|
7311
7406
|
/* template */
|
|
7312
|
-
var __vue_render__$
|
|
7407
|
+
var __vue_render__$q = function () {
|
|
7313
7408
|
var _vm = this;
|
|
7314
7409
|
var _h = _vm.$createElement;
|
|
7315
7410
|
var _c = _vm._self._c || _h;
|
|
@@ -7382,41 +7477,41 @@
|
|
|
7382
7477
|
2
|
|
7383
7478
|
)
|
|
7384
7479
|
};
|
|
7385
|
-
var __vue_staticRenderFns__$
|
|
7386
|
-
__vue_render__$
|
|
7480
|
+
var __vue_staticRenderFns__$q = [];
|
|
7481
|
+
__vue_render__$q._withStripped = true;
|
|
7387
7482
|
|
|
7388
7483
|
/* style */
|
|
7389
|
-
const __vue_inject_styles__$
|
|
7484
|
+
const __vue_inject_styles__$q = function (inject) {
|
|
7390
7485
|
if (!inject) return
|
|
7391
|
-
inject("data-v-
|
|
7486
|
+
inject("data-v-a2a3937a_0", { source: ".ele-modal__footer[data-v-a2a3937a] {\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-a2a3937a] {\n flex: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
7392
7487
|
|
|
7393
7488
|
};
|
|
7394
7489
|
/* scoped */
|
|
7395
|
-
const __vue_scope_id__$
|
|
7490
|
+
const __vue_scope_id__$q = "data-v-a2a3937a";
|
|
7396
7491
|
/* module identifier */
|
|
7397
|
-
const __vue_module_identifier__$
|
|
7492
|
+
const __vue_module_identifier__$q = undefined;
|
|
7398
7493
|
/* functional template */
|
|
7399
|
-
const __vue_is_functional_template__$
|
|
7494
|
+
const __vue_is_functional_template__$q = false;
|
|
7400
7495
|
/* style inject SSR */
|
|
7401
7496
|
|
|
7402
7497
|
/* style inject shadow dom */
|
|
7403
7498
|
|
|
7404
7499
|
|
|
7405
7500
|
|
|
7406
|
-
const __vue_component__$
|
|
7407
|
-
{ render: __vue_render__$
|
|
7408
|
-
__vue_inject_styles__$
|
|
7409
|
-
__vue_script__$
|
|
7410
|
-
__vue_scope_id__$
|
|
7411
|
-
__vue_is_functional_template__$
|
|
7412
|
-
__vue_module_identifier__$
|
|
7501
|
+
const __vue_component__$q = /*#__PURE__*/normalizeComponent(
|
|
7502
|
+
{ render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q },
|
|
7503
|
+
__vue_inject_styles__$q,
|
|
7504
|
+
__vue_script__$q,
|
|
7505
|
+
__vue_scope_id__$q,
|
|
7506
|
+
__vue_is_functional_template__$q,
|
|
7507
|
+
__vue_module_identifier__$q,
|
|
7413
7508
|
false,
|
|
7414
7509
|
createInjector,
|
|
7415
7510
|
undefined,
|
|
7416
7511
|
undefined
|
|
7417
7512
|
);
|
|
7418
7513
|
|
|
7419
|
-
__vue_component__$
|
|
7514
|
+
__vue_component__$q.install = Vue => Vue.component(__vue_component__$q.name, __vue_component__$q);
|
|
7420
7515
|
|
|
7421
7516
|
//
|
|
7422
7517
|
//
|
|
@@ -7428,7 +7523,7 @@
|
|
|
7428
7523
|
//
|
|
7429
7524
|
//
|
|
7430
7525
|
|
|
7431
|
-
var script$
|
|
7526
|
+
var script$p = {
|
|
7432
7527
|
name: 'ele-checkbox',
|
|
7433
7528
|
model: {
|
|
7434
7529
|
prop: 'value',
|
|
@@ -7456,10 +7551,10 @@
|
|
|
7456
7551
|
};
|
|
7457
7552
|
|
|
7458
7553
|
/* script */
|
|
7459
|
-
const __vue_script__$
|
|
7554
|
+
const __vue_script__$p = script$p;
|
|
7460
7555
|
|
|
7461
7556
|
/* template */
|
|
7462
|
-
var __vue_render__$
|
|
7557
|
+
var __vue_render__$p = function () {
|
|
7463
7558
|
var _vm = this;
|
|
7464
7559
|
var _h = _vm.$createElement;
|
|
7465
7560
|
var _c = _vm._self._c || _h;
|
|
@@ -7472,41 +7567,41 @@
|
|
|
7472
7567
|
on: { change: _vm.onChange },
|
|
7473
7568
|
})
|
|
7474
7569
|
};
|
|
7475
|
-
var __vue_staticRenderFns__$
|
|
7476
|
-
__vue_render__$
|
|
7570
|
+
var __vue_staticRenderFns__$p = [];
|
|
7571
|
+
__vue_render__$p._withStripped = true;
|
|
7477
7572
|
|
|
7478
7573
|
/* style */
|
|
7479
|
-
const __vue_inject_styles__$
|
|
7574
|
+
const __vue_inject_styles__$p = function (inject) {
|
|
7480
7575
|
if (!inject) return
|
|
7481
|
-
inject("data-v-
|
|
7576
|
+
inject("data-v-fc5aacae_0", { source: ".ant-checkbox-group[data-v-fc5aacae] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-checkbox-group[data-v-fc5aacae] .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group[data-v-fc5aacae] .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
7482
7577
|
|
|
7483
7578
|
};
|
|
7484
7579
|
/* scoped */
|
|
7485
|
-
const __vue_scope_id__$
|
|
7580
|
+
const __vue_scope_id__$p = "data-v-fc5aacae";
|
|
7486
7581
|
/* module identifier */
|
|
7487
|
-
const __vue_module_identifier__$
|
|
7582
|
+
const __vue_module_identifier__$p = undefined;
|
|
7488
7583
|
/* functional template */
|
|
7489
|
-
const __vue_is_functional_template__$
|
|
7584
|
+
const __vue_is_functional_template__$p = false;
|
|
7490
7585
|
/* style inject SSR */
|
|
7491
7586
|
|
|
7492
7587
|
/* style inject shadow dom */
|
|
7493
7588
|
|
|
7494
7589
|
|
|
7495
7590
|
|
|
7496
|
-
const __vue_component__$
|
|
7497
|
-
{ render: __vue_render__$
|
|
7498
|
-
__vue_inject_styles__$
|
|
7499
|
-
__vue_script__$
|
|
7500
|
-
__vue_scope_id__$
|
|
7501
|
-
__vue_is_functional_template__$
|
|
7502
|
-
__vue_module_identifier__$
|
|
7591
|
+
const __vue_component__$p = /*#__PURE__*/normalizeComponent(
|
|
7592
|
+
{ render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p },
|
|
7593
|
+
__vue_inject_styles__$p,
|
|
7594
|
+
__vue_script__$p,
|
|
7595
|
+
__vue_scope_id__$p,
|
|
7596
|
+
__vue_is_functional_template__$p,
|
|
7597
|
+
__vue_module_identifier__$p,
|
|
7503
7598
|
false,
|
|
7504
7599
|
createInjector,
|
|
7505
7600
|
undefined,
|
|
7506
7601
|
undefined
|
|
7507
7602
|
);
|
|
7508
7603
|
|
|
7509
|
-
__vue_component__$
|
|
7604
|
+
__vue_component__$p.install = Vue => Vue.component(__vue_component__$p.name, __vue_component__$p);
|
|
7510
7605
|
|
|
7511
7606
|
//
|
|
7512
7607
|
//
|
|
@@ -7517,7 +7612,7 @@
|
|
|
7517
7612
|
//
|
|
7518
7613
|
//
|
|
7519
7614
|
|
|
7520
|
-
var script$
|
|
7615
|
+
var script$o = {
|
|
7521
7616
|
name: 'ele-radio',
|
|
7522
7617
|
model: {
|
|
7523
7618
|
prop: 'value',
|
|
@@ -7550,10 +7645,10 @@
|
|
|
7550
7645
|
};
|
|
7551
7646
|
|
|
7552
7647
|
/* script */
|
|
7553
|
-
const __vue_script__$
|
|
7648
|
+
const __vue_script__$o = script$o;
|
|
7554
7649
|
|
|
7555
7650
|
/* template */
|
|
7556
|
-
var __vue_render__$
|
|
7651
|
+
var __vue_render__$o = function () {
|
|
7557
7652
|
var _vm = this;
|
|
7558
7653
|
var _h = _vm.$createElement;
|
|
7559
7654
|
var _c = _vm._self._c || _h;
|
|
@@ -7571,41 +7666,41 @@
|
|
|
7571
7666
|
1
|
|
7572
7667
|
)
|
|
7573
7668
|
};
|
|
7574
|
-
var __vue_staticRenderFns__$
|
|
7575
|
-
__vue_render__$
|
|
7669
|
+
var __vue_staticRenderFns__$o = [];
|
|
7670
|
+
__vue_render__$o._withStripped = true;
|
|
7576
7671
|
|
|
7577
7672
|
/* style */
|
|
7578
|
-
const __vue_inject_styles__$
|
|
7673
|
+
const __vue_inject_styles__$o = function (inject) {
|
|
7579
7674
|
if (!inject) return
|
|
7580
|
-
inject("data-v-
|
|
7675
|
+
inject("data-v-743a2c6f_0", { source: ".ant-radio-group[data-v-743a2c6f] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-743a2c6f] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-743a2c6f] .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
7581
7676
|
|
|
7582
7677
|
};
|
|
7583
7678
|
/* scoped */
|
|
7584
|
-
const __vue_scope_id__$
|
|
7679
|
+
const __vue_scope_id__$o = "data-v-743a2c6f";
|
|
7585
7680
|
/* module identifier */
|
|
7586
|
-
const __vue_module_identifier__$
|
|
7681
|
+
const __vue_module_identifier__$o = undefined;
|
|
7587
7682
|
/* functional template */
|
|
7588
|
-
const __vue_is_functional_template__$
|
|
7683
|
+
const __vue_is_functional_template__$o = false;
|
|
7589
7684
|
/* style inject SSR */
|
|
7590
7685
|
|
|
7591
7686
|
/* style inject shadow dom */
|
|
7592
7687
|
|
|
7593
7688
|
|
|
7594
7689
|
|
|
7595
|
-
const __vue_component__$
|
|
7596
|
-
{ render: __vue_render__$
|
|
7597
|
-
__vue_inject_styles__$
|
|
7598
|
-
__vue_script__$
|
|
7599
|
-
__vue_scope_id__$
|
|
7600
|
-
__vue_is_functional_template__$
|
|
7601
|
-
__vue_module_identifier__$
|
|
7690
|
+
const __vue_component__$o = /*#__PURE__*/normalizeComponent(
|
|
7691
|
+
{ render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o },
|
|
7692
|
+
__vue_inject_styles__$o,
|
|
7693
|
+
__vue_script__$o,
|
|
7694
|
+
__vue_scope_id__$o,
|
|
7695
|
+
__vue_is_functional_template__$o,
|
|
7696
|
+
__vue_module_identifier__$o,
|
|
7602
7697
|
false,
|
|
7603
7698
|
createInjector,
|
|
7604
7699
|
undefined,
|
|
7605
7700
|
undefined
|
|
7606
7701
|
);
|
|
7607
7702
|
|
|
7608
|
-
__vue_component__$
|
|
7703
|
+
__vue_component__$o.install = Vue => Vue.component(__vue_component__$o.name, __vue_component__$o);
|
|
7609
7704
|
|
|
7610
7705
|
//
|
|
7611
7706
|
//
|
|
@@ -7629,7 +7724,7 @@
|
|
|
7629
7724
|
//
|
|
7630
7725
|
//
|
|
7631
7726
|
|
|
7632
|
-
var script$
|
|
7727
|
+
var script$n = {
|
|
7633
7728
|
name: 'ele-batch-export',
|
|
7634
7729
|
props: {
|
|
7635
7730
|
value: {
|
|
@@ -7673,10 +7768,10 @@
|
|
|
7673
7768
|
};
|
|
7674
7769
|
|
|
7675
7770
|
/* script */
|
|
7676
|
-
const __vue_script__$
|
|
7771
|
+
const __vue_script__$n = script$n;
|
|
7677
7772
|
|
|
7678
7773
|
/* template */
|
|
7679
|
-
var __vue_render__$
|
|
7774
|
+
var __vue_render__$n = function () {
|
|
7680
7775
|
var _vm = this;
|
|
7681
7776
|
var _h = _vm.$createElement;
|
|
7682
7777
|
var _c = _vm._self._c || _h;
|
|
@@ -7735,42 +7830,42 @@
|
|
|
7735
7830
|
]
|
|
7736
7831
|
)
|
|
7737
7832
|
};
|
|
7738
|
-
var __vue_staticRenderFns__$
|
|
7739
|
-
__vue_render__$
|
|
7833
|
+
var __vue_staticRenderFns__$n = [];
|
|
7834
|
+
__vue_render__$n._withStripped = true;
|
|
7740
7835
|
|
|
7741
7836
|
/* style */
|
|
7742
|
-
const __vue_inject_styles__$
|
|
7837
|
+
const __vue_inject_styles__$n = function (inject) {
|
|
7743
7838
|
if (!inject) return
|
|
7744
|
-
inject("data-v-
|
|
7745
|
-
,inject("data-v-
|
|
7839
|
+
inject("data-v-2ed2589f_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
7840
|
+
,inject("data-v-2ed2589f_1", { source: ".ele-batch-export__content[data-v-2ed2589f] {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container[data-v-2ed2589f] {\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-2ed2589f] {\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-2ed2589f] {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn[data-v-2ed2589f] {\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-2ed2589f] {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message[data-v-2ed2589f] {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
7746
7841
|
|
|
7747
7842
|
};
|
|
7748
7843
|
/* scoped */
|
|
7749
|
-
const __vue_scope_id__$
|
|
7844
|
+
const __vue_scope_id__$n = "data-v-2ed2589f";
|
|
7750
7845
|
/* module identifier */
|
|
7751
|
-
const __vue_module_identifier__$
|
|
7846
|
+
const __vue_module_identifier__$n = undefined;
|
|
7752
7847
|
/* functional template */
|
|
7753
|
-
const __vue_is_functional_template__$
|
|
7848
|
+
const __vue_is_functional_template__$n = false;
|
|
7754
7849
|
/* style inject SSR */
|
|
7755
7850
|
|
|
7756
7851
|
/* style inject shadow dom */
|
|
7757
7852
|
|
|
7758
7853
|
|
|
7759
7854
|
|
|
7760
|
-
const __vue_component__$
|
|
7761
|
-
{ render: __vue_render__$
|
|
7762
|
-
__vue_inject_styles__$
|
|
7763
|
-
__vue_script__$
|
|
7764
|
-
__vue_scope_id__$
|
|
7765
|
-
__vue_is_functional_template__$
|
|
7766
|
-
__vue_module_identifier__$
|
|
7855
|
+
const __vue_component__$n = /*#__PURE__*/normalizeComponent(
|
|
7856
|
+
{ render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
|
|
7857
|
+
__vue_inject_styles__$n,
|
|
7858
|
+
__vue_script__$n,
|
|
7859
|
+
__vue_scope_id__$n,
|
|
7860
|
+
__vue_is_functional_template__$n,
|
|
7861
|
+
__vue_module_identifier__$n,
|
|
7767
7862
|
false,
|
|
7768
7863
|
createInjector,
|
|
7769
7864
|
undefined,
|
|
7770
7865
|
undefined
|
|
7771
7866
|
);
|
|
7772
7867
|
|
|
7773
|
-
__vue_component__$
|
|
7868
|
+
__vue_component__$n.install = Vue => Vue.component(__vue_component__$n.name, __vue_component__$n);
|
|
7774
7869
|
|
|
7775
7870
|
//
|
|
7776
7871
|
//
|
|
@@ -7784,7 +7879,7 @@
|
|
|
7784
7879
|
//
|
|
7785
7880
|
//
|
|
7786
7881
|
|
|
7787
|
-
var script$
|
|
7882
|
+
var script$m = {
|
|
7788
7883
|
name: 'ele-date-range',
|
|
7789
7884
|
model: {
|
|
7790
7885
|
prop: 'value',
|
|
@@ -7815,10 +7910,10 @@
|
|
|
7815
7910
|
};
|
|
7816
7911
|
|
|
7817
7912
|
/* script */
|
|
7818
|
-
const __vue_script__$
|
|
7913
|
+
const __vue_script__$m = script$m;
|
|
7819
7914
|
|
|
7820
7915
|
/* template */
|
|
7821
|
-
var __vue_render__$
|
|
7916
|
+
var __vue_render__$m = function () {
|
|
7822
7917
|
var _vm = this;
|
|
7823
7918
|
var _h = _vm.$createElement;
|
|
7824
7919
|
var _c = _vm._self._c || _h;
|
|
@@ -7833,44 +7928,44 @@
|
|
|
7833
7928
|
on: { change: _vm.onChange },
|
|
7834
7929
|
})
|
|
7835
7930
|
};
|
|
7836
|
-
var __vue_staticRenderFns__$
|
|
7837
|
-
__vue_render__$
|
|
7931
|
+
var __vue_staticRenderFns__$m = [];
|
|
7932
|
+
__vue_render__$m._withStripped = true;
|
|
7838
7933
|
|
|
7839
7934
|
/* style */
|
|
7840
|
-
const __vue_inject_styles__$
|
|
7935
|
+
const __vue_inject_styles__$m = function (inject) {
|
|
7841
7936
|
if (!inject) return
|
|
7842
|
-
inject("data-v-
|
|
7937
|
+
inject("data-v-586a9dc8_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
7843
7938
|
|
|
7844
7939
|
};
|
|
7845
7940
|
/* scoped */
|
|
7846
|
-
const __vue_scope_id__$
|
|
7941
|
+
const __vue_scope_id__$m = "data-v-586a9dc8";
|
|
7847
7942
|
/* module identifier */
|
|
7848
|
-
const __vue_module_identifier__$
|
|
7943
|
+
const __vue_module_identifier__$m = undefined;
|
|
7849
7944
|
/* functional template */
|
|
7850
|
-
const __vue_is_functional_template__$
|
|
7945
|
+
const __vue_is_functional_template__$m = false;
|
|
7851
7946
|
/* style inject SSR */
|
|
7852
7947
|
|
|
7853
7948
|
/* style inject shadow dom */
|
|
7854
7949
|
|
|
7855
7950
|
|
|
7856
7951
|
|
|
7857
|
-
const __vue_component__$
|
|
7858
|
-
{ render: __vue_render__$
|
|
7859
|
-
__vue_inject_styles__$
|
|
7860
|
-
__vue_script__$
|
|
7861
|
-
__vue_scope_id__$
|
|
7862
|
-
__vue_is_functional_template__$
|
|
7863
|
-
__vue_module_identifier__$
|
|
7952
|
+
const __vue_component__$m = /*#__PURE__*/normalizeComponent(
|
|
7953
|
+
{ render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
|
|
7954
|
+
__vue_inject_styles__$m,
|
|
7955
|
+
__vue_script__$m,
|
|
7956
|
+
__vue_scope_id__$m,
|
|
7957
|
+
__vue_is_functional_template__$m,
|
|
7958
|
+
__vue_module_identifier__$m,
|
|
7864
7959
|
false,
|
|
7865
7960
|
createInjector,
|
|
7866
7961
|
undefined,
|
|
7867
7962
|
undefined
|
|
7868
7963
|
);
|
|
7869
7964
|
|
|
7870
|
-
__vue_component__$
|
|
7965
|
+
__vue_component__$m.install = Vue => Vue.component(__vue_component__$m.name, __vue_component__$m);
|
|
7871
7966
|
|
|
7872
7967
|
//
|
|
7873
|
-
var script$
|
|
7968
|
+
var script$l = {
|
|
7874
7969
|
name: 'ele-timeline',
|
|
7875
7970
|
props: {
|
|
7876
7971
|
url: {
|
|
@@ -7962,10 +8057,10 @@
|
|
|
7962
8057
|
};
|
|
7963
8058
|
|
|
7964
8059
|
/* script */
|
|
7965
|
-
const __vue_script__$
|
|
8060
|
+
const __vue_script__$l = script$l;
|
|
7966
8061
|
|
|
7967
8062
|
/* template */
|
|
7968
|
-
var __vue_render__$
|
|
8063
|
+
var __vue_render__$l = function () {
|
|
7969
8064
|
var _vm = this;
|
|
7970
8065
|
var _h = _vm.$createElement;
|
|
7971
8066
|
var _c = _vm._self._c || _h;
|
|
@@ -8043,7 +8138,7 @@
|
|
|
8043
8138
|
0
|
|
8044
8139
|
)
|
|
8045
8140
|
};
|
|
8046
|
-
var __vue_staticRenderFns__$
|
|
8141
|
+
var __vue_staticRenderFns__$l = [
|
|
8047
8142
|
function () {
|
|
8048
8143
|
var _vm = this;
|
|
8049
8144
|
var _h = _vm.$createElement;
|
|
@@ -8055,41 +8150,41 @@
|
|
|
8055
8150
|
])
|
|
8056
8151
|
},
|
|
8057
8152
|
];
|
|
8058
|
-
__vue_render__$
|
|
8153
|
+
__vue_render__$l._withStripped = true;
|
|
8059
8154
|
|
|
8060
8155
|
/* style */
|
|
8061
|
-
const __vue_inject_styles__$
|
|
8156
|
+
const __vue_inject_styles__$l = function (inject) {
|
|
8062
8157
|
if (!inject) return
|
|
8063
|
-
inject("data-v-
|
|
8064
|
-
,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 });
|
|
8158
|
+
inject("data-v-aa25fba6_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 })
|
|
8159
|
+
,inject("data-v-aa25fba6_1", { source: ".ele-timeline__wrapper[data-v-aa25fba6] {\n width: 100%;\n height: 100%;\n}\n.ele-timeline__wrapper .ele-timeline__item[data-v-aa25fba6] {\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-aa25fba6] {\n display: none;\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__left[data-v-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6]::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-aa25fba6]::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-aa25fba6]::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-aa25fba6]::before {\n background: var(--idoole-error-06);\n}\n.ele-timeline__wrapper .ele-timeline__item .ele-timeline__right .timeline-right__oper[data-v-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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-aa25fba6] {\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":["E:\\code\\OnlineStudy-Base\\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 });
|
|
8065
8160
|
|
|
8066
8161
|
};
|
|
8067
8162
|
/* scoped */
|
|
8068
|
-
const __vue_scope_id__$
|
|
8163
|
+
const __vue_scope_id__$l = "data-v-aa25fba6";
|
|
8069
8164
|
/* module identifier */
|
|
8070
|
-
const __vue_module_identifier__$
|
|
8165
|
+
const __vue_module_identifier__$l = undefined;
|
|
8071
8166
|
/* functional template */
|
|
8072
|
-
const __vue_is_functional_template__$
|
|
8167
|
+
const __vue_is_functional_template__$l = false;
|
|
8073
8168
|
/* style inject SSR */
|
|
8074
8169
|
|
|
8075
8170
|
/* style inject shadow dom */
|
|
8076
8171
|
|
|
8077
8172
|
|
|
8078
8173
|
|
|
8079
|
-
const __vue_component__$
|
|
8080
|
-
{ render: __vue_render__$
|
|
8081
|
-
__vue_inject_styles__$
|
|
8082
|
-
__vue_script__$
|
|
8083
|
-
__vue_scope_id__$
|
|
8084
|
-
__vue_is_functional_template__$
|
|
8085
|
-
__vue_module_identifier__$
|
|
8174
|
+
const __vue_component__$l = /*#__PURE__*/normalizeComponent(
|
|
8175
|
+
{ render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
|
|
8176
|
+
__vue_inject_styles__$l,
|
|
8177
|
+
__vue_script__$l,
|
|
8178
|
+
__vue_scope_id__$l,
|
|
8179
|
+
__vue_is_functional_template__$l,
|
|
8180
|
+
__vue_module_identifier__$l,
|
|
8086
8181
|
false,
|
|
8087
8182
|
createInjector,
|
|
8088
8183
|
undefined,
|
|
8089
8184
|
undefined
|
|
8090
8185
|
);
|
|
8091
8186
|
|
|
8092
|
-
__vue_component__$
|
|
8187
|
+
__vue_component__$l.install = Vue => Vue.component(__vue_component__$l.name, __vue_component__$l);
|
|
8093
8188
|
|
|
8094
8189
|
//
|
|
8095
8190
|
//
|
|
@@ -8099,7 +8194,7 @@
|
|
|
8099
8194
|
//
|
|
8100
8195
|
//
|
|
8101
8196
|
|
|
8102
|
-
var script$
|
|
8197
|
+
var script$k = {
|
|
8103
8198
|
name: 'ele-text',
|
|
8104
8199
|
props: {
|
|
8105
8200
|
type: {
|
|
@@ -8119,10 +8214,10 @@
|
|
|
8119
8214
|
};
|
|
8120
8215
|
|
|
8121
8216
|
/* script */
|
|
8122
|
-
const __vue_script__$
|
|
8217
|
+
const __vue_script__$k = script$k;
|
|
8123
8218
|
|
|
8124
8219
|
/* template */
|
|
8125
|
-
var __vue_render__$
|
|
8220
|
+
var __vue_render__$k = function () {
|
|
8126
8221
|
var _vm = this;
|
|
8127
8222
|
var _h = _vm.$createElement;
|
|
8128
8223
|
var _c = _vm._self._c || _h;
|
|
@@ -8137,41 +8232,41 @@
|
|
|
8137
8232
|
1
|
|
8138
8233
|
)
|
|
8139
8234
|
};
|
|
8140
|
-
var __vue_staticRenderFns__$
|
|
8141
|
-
__vue_render__$
|
|
8235
|
+
var __vue_staticRenderFns__$k = [];
|
|
8236
|
+
__vue_render__$k._withStripped = true;
|
|
8142
8237
|
|
|
8143
8238
|
/* style */
|
|
8144
|
-
const __vue_inject_styles__$
|
|
8239
|
+
const __vue_inject_styles__$k = function (inject) {
|
|
8145
8240
|
if (!inject) return
|
|
8146
|
-
inject("data-v-
|
|
8241
|
+
inject("data-v-241d84da_0", { source: ".ele-text__wrapper[data-v-241d84da] {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-text__wrapper.default .anticon[data-v-241d84da], .ele-text__wrapper.default .message[data-v-241d84da] {\n color: var(--idoole-black-064);\n}\n.ele-text__wrapper .anticon[data-v-241d84da] {\n font-size: 16px;\n}\n.ele-text__wrapper .message[data-v-241d84da] {\n font-size: 14px;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
8147
8242
|
|
|
8148
8243
|
};
|
|
8149
8244
|
/* scoped */
|
|
8150
|
-
const __vue_scope_id__$
|
|
8245
|
+
const __vue_scope_id__$k = "data-v-241d84da";
|
|
8151
8246
|
/* module identifier */
|
|
8152
|
-
const __vue_module_identifier__$
|
|
8247
|
+
const __vue_module_identifier__$k = undefined;
|
|
8153
8248
|
/* functional template */
|
|
8154
|
-
const __vue_is_functional_template__$
|
|
8249
|
+
const __vue_is_functional_template__$k = false;
|
|
8155
8250
|
/* style inject SSR */
|
|
8156
8251
|
|
|
8157
8252
|
/* style inject shadow dom */
|
|
8158
8253
|
|
|
8159
8254
|
|
|
8160
8255
|
|
|
8161
|
-
const __vue_component__$
|
|
8162
|
-
{ render: __vue_render__$
|
|
8163
|
-
__vue_inject_styles__$
|
|
8164
|
-
__vue_script__$
|
|
8165
|
-
__vue_scope_id__$
|
|
8166
|
-
__vue_is_functional_template__$
|
|
8167
|
-
__vue_module_identifier__$
|
|
8256
|
+
const __vue_component__$k = /*#__PURE__*/normalizeComponent(
|
|
8257
|
+
{ render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
|
|
8258
|
+
__vue_inject_styles__$k,
|
|
8259
|
+
__vue_script__$k,
|
|
8260
|
+
__vue_scope_id__$k,
|
|
8261
|
+
__vue_is_functional_template__$k,
|
|
8262
|
+
__vue_module_identifier__$k,
|
|
8168
8263
|
false,
|
|
8169
8264
|
createInjector,
|
|
8170
8265
|
undefined,
|
|
8171
8266
|
undefined
|
|
8172
8267
|
);
|
|
8173
8268
|
|
|
8174
|
-
__vue_component__$
|
|
8269
|
+
__vue_component__$k.install = Vue => Vue.component(__vue_component__$k.name, __vue_component__$k);
|
|
8175
8270
|
|
|
8176
8271
|
//
|
|
8177
8272
|
//
|
|
@@ -8188,7 +8283,7 @@
|
|
|
8188
8283
|
//
|
|
8189
8284
|
//
|
|
8190
8285
|
|
|
8191
|
-
var script$
|
|
8286
|
+
var script$j = {
|
|
8192
8287
|
name: 'ele-tabs',
|
|
8193
8288
|
components: {},
|
|
8194
8289
|
model: {
|
|
@@ -8224,10 +8319,10 @@
|
|
|
8224
8319
|
};
|
|
8225
8320
|
|
|
8226
8321
|
/* script */
|
|
8227
|
-
const __vue_script__$
|
|
8322
|
+
const __vue_script__$j = script$j;
|
|
8228
8323
|
|
|
8229
8324
|
/* template */
|
|
8230
|
-
var __vue_render__$
|
|
8325
|
+
var __vue_render__$j = function () {
|
|
8231
8326
|
var _vm = this;
|
|
8232
8327
|
var _h = _vm.$createElement;
|
|
8233
8328
|
var _c = _vm._self._c || _h;
|
|
@@ -8278,41 +8373,41 @@
|
|
|
8278
8373
|
1
|
|
8279
8374
|
)
|
|
8280
8375
|
};
|
|
8281
|
-
var __vue_staticRenderFns__$
|
|
8282
|
-
__vue_render__$
|
|
8376
|
+
var __vue_staticRenderFns__$j = [];
|
|
8377
|
+
__vue_render__$j._withStripped = true;
|
|
8283
8378
|
|
|
8284
8379
|
/* style */
|
|
8285
|
-
const __vue_inject_styles__$
|
|
8380
|
+
const __vue_inject_styles__$j = function (inject) {
|
|
8286
8381
|
if (!inject) return
|
|
8287
|
-
inject("data-v-
|
|
8382
|
+
inject("data-v-592dffe2_0", { source: "[data-v-592dffe2] .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
8288
8383
|
|
|
8289
8384
|
};
|
|
8290
8385
|
/* scoped */
|
|
8291
|
-
const __vue_scope_id__$
|
|
8386
|
+
const __vue_scope_id__$j = "data-v-592dffe2";
|
|
8292
8387
|
/* module identifier */
|
|
8293
|
-
const __vue_module_identifier__$
|
|
8388
|
+
const __vue_module_identifier__$j = undefined;
|
|
8294
8389
|
/* functional template */
|
|
8295
|
-
const __vue_is_functional_template__$
|
|
8390
|
+
const __vue_is_functional_template__$j = false;
|
|
8296
8391
|
/* style inject SSR */
|
|
8297
8392
|
|
|
8298
8393
|
/* style inject shadow dom */
|
|
8299
8394
|
|
|
8300
8395
|
|
|
8301
8396
|
|
|
8302
|
-
const __vue_component__$
|
|
8303
|
-
{ render: __vue_render__$
|
|
8304
|
-
__vue_inject_styles__$
|
|
8305
|
-
__vue_script__$
|
|
8306
|
-
__vue_scope_id__$
|
|
8307
|
-
__vue_is_functional_template__$
|
|
8308
|
-
__vue_module_identifier__$
|
|
8397
|
+
const __vue_component__$j = /*#__PURE__*/normalizeComponent(
|
|
8398
|
+
{ render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
|
|
8399
|
+
__vue_inject_styles__$j,
|
|
8400
|
+
__vue_script__$j,
|
|
8401
|
+
__vue_scope_id__$j,
|
|
8402
|
+
__vue_is_functional_template__$j,
|
|
8403
|
+
__vue_module_identifier__$j,
|
|
8309
8404
|
false,
|
|
8310
8405
|
createInjector,
|
|
8311
8406
|
undefined,
|
|
8312
8407
|
undefined
|
|
8313
8408
|
);
|
|
8314
8409
|
|
|
8315
|
-
__vue_component__$
|
|
8410
|
+
__vue_component__$j.install = Vue => Vue.component(__vue_component__$j.name, __vue_component__$j);
|
|
8316
8411
|
|
|
8317
8412
|
/*!
|
|
8318
8413
|
* Cropper.js v1.4.1
|
|
@@ -12024,7 +12119,7 @@
|
|
|
12024
12119
|
assign(Cropper.prototype, render, preview, events, handlers, change, methods);
|
|
12025
12120
|
|
|
12026
12121
|
//
|
|
12027
|
-
var script$
|
|
12122
|
+
var script$i = {
|
|
12028
12123
|
name: 'ele-modal-img-crop',
|
|
12029
12124
|
model: {
|
|
12030
12125
|
event: 'input',
|
|
@@ -12182,10 +12277,10 @@
|
|
|
12182
12277
|
};
|
|
12183
12278
|
|
|
12184
12279
|
/* script */
|
|
12185
|
-
const __vue_script__$
|
|
12280
|
+
const __vue_script__$i = script$i;
|
|
12186
12281
|
|
|
12187
12282
|
/* template */
|
|
12188
|
-
var __vue_render__$
|
|
12283
|
+
var __vue_render__$i = function () {
|
|
12189
12284
|
var _vm = this;
|
|
12190
12285
|
var _h = _vm.$createElement;
|
|
12191
12286
|
var _c = _vm._self._c || _h;
|
|
@@ -12303,44 +12398,44 @@
|
|
|
12303
12398
|
1
|
|
12304
12399
|
)
|
|
12305
12400
|
};
|
|
12306
|
-
var __vue_staticRenderFns__$
|
|
12307
|
-
__vue_render__$
|
|
12401
|
+
var __vue_staticRenderFns__$i = [];
|
|
12402
|
+
__vue_render__$i._withStripped = true;
|
|
12308
12403
|
|
|
12309
12404
|
/* style */
|
|
12310
|
-
const __vue_inject_styles__$
|
|
12405
|
+
const __vue_inject_styles__$i = function (inject) {
|
|
12311
12406
|
if (!inject) return
|
|
12312
|
-
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 });
|
|
12407
|
+
inject("data-v-781e3c4c_0", { source: "[data-v-781e3c4c] .ant-modal-body {\n padding: 16px;\n}\n[data-v-781e3c4c] .ant-modal-header {\n padding: 16px;\n}\n.ele-imgCrop__wrapper[data-v-781e3c4c] {\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-781e3c4c] {\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-781e3c4c] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-781e3c4c] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__left .ele-imgCrop__noImg .ele-img-crop__upload[data-v-781e3c4c] .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-781e3c4c] .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-781e3c4c] .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-781e3c4c] {\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-781e3c4c] {\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-781e3c4c] {\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-781e3c4c] {\n position: relative;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__right span[data-v-781e3c4c] {\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-781e3c4c] {\n width: 100%;\n height: 100%;\n}\n.ele-imgCrop__wrapper .ele-imgCrop__item[data-v-781e3c4c] {\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-781e3c4c] {\n float: left;\n width: 80%;\n}\n.ele-imgCrop__error[data-v-781e3c4c] {\n color: var(--idooel-form-border-err-color) !important;\n}\n.ele-imgCrop__error2[data-v-781e3c4c] {\n color: var(--idooel-img-crop-err-color) !important;\n}\n.ele-imgCrop__icon[data-v-781e3c4c] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
12313
12408
|
|
|
12314
12409
|
};
|
|
12315
12410
|
/* scoped */
|
|
12316
|
-
const __vue_scope_id__$
|
|
12411
|
+
const __vue_scope_id__$i = "data-v-781e3c4c";
|
|
12317
12412
|
/* module identifier */
|
|
12318
|
-
const __vue_module_identifier__$
|
|
12413
|
+
const __vue_module_identifier__$i = undefined;
|
|
12319
12414
|
/* functional template */
|
|
12320
|
-
const __vue_is_functional_template__$
|
|
12415
|
+
const __vue_is_functional_template__$i = false;
|
|
12321
12416
|
/* style inject SSR */
|
|
12322
12417
|
|
|
12323
12418
|
/* style inject shadow dom */
|
|
12324
12419
|
|
|
12325
12420
|
|
|
12326
12421
|
|
|
12327
|
-
const __vue_component__$
|
|
12328
|
-
{ render: __vue_render__$
|
|
12329
|
-
__vue_inject_styles__$
|
|
12330
|
-
__vue_script__$
|
|
12331
|
-
__vue_scope_id__$
|
|
12332
|
-
__vue_is_functional_template__$
|
|
12333
|
-
__vue_module_identifier__$
|
|
12422
|
+
const __vue_component__$i = /*#__PURE__*/normalizeComponent(
|
|
12423
|
+
{ render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
|
|
12424
|
+
__vue_inject_styles__$i,
|
|
12425
|
+
__vue_script__$i,
|
|
12426
|
+
__vue_scope_id__$i,
|
|
12427
|
+
__vue_is_functional_template__$i,
|
|
12428
|
+
__vue_module_identifier__$i,
|
|
12334
12429
|
false,
|
|
12335
12430
|
createInjector,
|
|
12336
12431
|
undefined,
|
|
12337
12432
|
undefined
|
|
12338
12433
|
);
|
|
12339
12434
|
|
|
12340
|
-
__vue_component__$
|
|
12435
|
+
__vue_component__$i.install = Vue => Vue.component(__vue_component__$i.name, __vue_component__$i);
|
|
12341
12436
|
|
|
12342
12437
|
//
|
|
12343
|
-
var script$
|
|
12438
|
+
var script$h = {
|
|
12344
12439
|
name: 'ele-text-editor',
|
|
12345
12440
|
props: {
|
|
12346
12441
|
editorWidth: {
|
|
@@ -12386,10 +12481,10 @@
|
|
|
12386
12481
|
};
|
|
12387
12482
|
|
|
12388
12483
|
/* script */
|
|
12389
|
-
const __vue_script__$
|
|
12484
|
+
const __vue_script__$h = script$h;
|
|
12390
12485
|
|
|
12391
12486
|
/* template */
|
|
12392
|
-
var __vue_render__$
|
|
12487
|
+
var __vue_render__$h = function () {
|
|
12393
12488
|
var _vm = this;
|
|
12394
12489
|
var _h = _vm.$createElement;
|
|
12395
12490
|
var _c = _vm._self._c || _h;
|
|
@@ -12412,41 +12507,41 @@
|
|
|
12412
12507
|
1
|
|
12413
12508
|
)
|
|
12414
12509
|
};
|
|
12415
|
-
var __vue_staticRenderFns__$
|
|
12416
|
-
__vue_render__$
|
|
12510
|
+
var __vue_staticRenderFns__$h = [];
|
|
12511
|
+
__vue_render__$h._withStripped = true;
|
|
12417
12512
|
|
|
12418
12513
|
/* style */
|
|
12419
|
-
const __vue_inject_styles__$
|
|
12514
|
+
const __vue_inject_styles__$h = function (inject) {
|
|
12420
12515
|
if (!inject) return
|
|
12421
|
-
inject("data-v-
|
|
12516
|
+
inject("data-v-48934605_0", { source: ".ele-editor__bottom[data-v-48934605] {\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-48934605] {\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":["E:\\code\\OnlineStudy-Base\\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 });
|
|
12422
12517
|
|
|
12423
12518
|
};
|
|
12424
12519
|
/* scoped */
|
|
12425
|
-
const __vue_scope_id__$
|
|
12520
|
+
const __vue_scope_id__$h = "data-v-48934605";
|
|
12426
12521
|
/* module identifier */
|
|
12427
|
-
const __vue_module_identifier__$
|
|
12522
|
+
const __vue_module_identifier__$h = undefined;
|
|
12428
12523
|
/* functional template */
|
|
12429
|
-
const __vue_is_functional_template__$
|
|
12524
|
+
const __vue_is_functional_template__$h = false;
|
|
12430
12525
|
/* style inject SSR */
|
|
12431
12526
|
|
|
12432
12527
|
/* style inject shadow dom */
|
|
12433
12528
|
|
|
12434
12529
|
|
|
12435
12530
|
|
|
12436
|
-
const __vue_component__$
|
|
12437
|
-
{ render: __vue_render__$
|
|
12438
|
-
__vue_inject_styles__$
|
|
12439
|
-
__vue_script__$
|
|
12440
|
-
__vue_scope_id__$
|
|
12441
|
-
__vue_is_functional_template__$
|
|
12442
|
-
__vue_module_identifier__$
|
|
12531
|
+
const __vue_component__$h = /*#__PURE__*/normalizeComponent(
|
|
12532
|
+
{ render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
|
|
12533
|
+
__vue_inject_styles__$h,
|
|
12534
|
+
__vue_script__$h,
|
|
12535
|
+
__vue_scope_id__$h,
|
|
12536
|
+
__vue_is_functional_template__$h,
|
|
12537
|
+
__vue_module_identifier__$h,
|
|
12443
12538
|
false,
|
|
12444
12539
|
createInjector,
|
|
12445
12540
|
undefined,
|
|
12446
12541
|
undefined
|
|
12447
12542
|
);
|
|
12448
12543
|
|
|
12449
|
-
__vue_component__$
|
|
12544
|
+
__vue_component__$h.install = Vue => Vue.component(__vue_component__$h.name, __vue_component__$h);
|
|
12450
12545
|
|
|
12451
12546
|
//
|
|
12452
12547
|
//
|
|
@@ -12461,7 +12556,7 @@
|
|
|
12461
12556
|
//
|
|
12462
12557
|
//
|
|
12463
12558
|
|
|
12464
|
-
var script$
|
|
12559
|
+
var script$g = {
|
|
12465
12560
|
name: 'ele-textarea',
|
|
12466
12561
|
model: {
|
|
12467
12562
|
prop: 'value',
|
|
@@ -12503,10 +12598,10 @@
|
|
|
12503
12598
|
};
|
|
12504
12599
|
|
|
12505
12600
|
/* script */
|
|
12506
|
-
const __vue_script__$
|
|
12601
|
+
const __vue_script__$g = script$g;
|
|
12507
12602
|
|
|
12508
12603
|
/* template */
|
|
12509
|
-
var __vue_render__$
|
|
12604
|
+
var __vue_render__$g = function () {
|
|
12510
12605
|
var _vm = this;
|
|
12511
12606
|
var _h = _vm.$createElement;
|
|
12512
12607
|
var _c = _vm._self._c || _h;
|
|
@@ -12522,41 +12617,41 @@
|
|
|
12522
12617
|
on: { change: _vm.onChange },
|
|
12523
12618
|
})
|
|
12524
12619
|
};
|
|
12525
|
-
var __vue_staticRenderFns__$
|
|
12526
|
-
__vue_render__$
|
|
12620
|
+
var __vue_staticRenderFns__$g = [];
|
|
12621
|
+
__vue_render__$g._withStripped = true;
|
|
12527
12622
|
|
|
12528
12623
|
/* style */
|
|
12529
|
-
const __vue_inject_styles__$
|
|
12624
|
+
const __vue_inject_styles__$g = function (inject) {
|
|
12530
12625
|
if (!inject) return
|
|
12531
|
-
inject("data-v-
|
|
12626
|
+
inject("data-v-2cd6a0f7_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 });
|
|
12532
12627
|
|
|
12533
12628
|
};
|
|
12534
12629
|
/* scoped */
|
|
12535
|
-
const __vue_scope_id__$
|
|
12630
|
+
const __vue_scope_id__$g = "data-v-2cd6a0f7";
|
|
12536
12631
|
/* module identifier */
|
|
12537
|
-
const __vue_module_identifier__$
|
|
12632
|
+
const __vue_module_identifier__$g = undefined;
|
|
12538
12633
|
/* functional template */
|
|
12539
|
-
const __vue_is_functional_template__$
|
|
12634
|
+
const __vue_is_functional_template__$g = false;
|
|
12540
12635
|
/* style inject SSR */
|
|
12541
12636
|
|
|
12542
12637
|
/* style inject shadow dom */
|
|
12543
12638
|
|
|
12544
12639
|
|
|
12545
12640
|
|
|
12546
|
-
const __vue_component__$
|
|
12547
|
-
{ render: __vue_render__$
|
|
12548
|
-
__vue_inject_styles__$
|
|
12549
|
-
__vue_script__$
|
|
12550
|
-
__vue_scope_id__$
|
|
12551
|
-
__vue_is_functional_template__$
|
|
12552
|
-
__vue_module_identifier__$
|
|
12641
|
+
const __vue_component__$g = /*#__PURE__*/normalizeComponent(
|
|
12642
|
+
{ render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
|
|
12643
|
+
__vue_inject_styles__$g,
|
|
12644
|
+
__vue_script__$g,
|
|
12645
|
+
__vue_scope_id__$g,
|
|
12646
|
+
__vue_is_functional_template__$g,
|
|
12647
|
+
__vue_module_identifier__$g,
|
|
12553
12648
|
false,
|
|
12554
12649
|
createInjector,
|
|
12555
12650
|
undefined,
|
|
12556
12651
|
undefined
|
|
12557
12652
|
);
|
|
12558
12653
|
|
|
12559
|
-
__vue_component__$
|
|
12654
|
+
__vue_component__$g.install = Vue => Vue.component(__vue_component__$g.name, __vue_component__$g);
|
|
12560
12655
|
|
|
12561
12656
|
//
|
|
12562
12657
|
//
|
|
@@ -12565,7 +12660,7 @@
|
|
|
12565
12660
|
//
|
|
12566
12661
|
//
|
|
12567
12662
|
|
|
12568
|
-
var script$
|
|
12663
|
+
var script$f = {
|
|
12569
12664
|
name: 'ele-loading',
|
|
12570
12665
|
props: {
|
|
12571
12666
|
loading: {
|
|
@@ -12576,53 +12671,53 @@
|
|
|
12576
12671
|
};
|
|
12577
12672
|
|
|
12578
12673
|
/* script */
|
|
12579
|
-
const __vue_script__$
|
|
12674
|
+
const __vue_script__$f = script$f;
|
|
12580
12675
|
|
|
12581
12676
|
/* template */
|
|
12582
|
-
var __vue_render__$
|
|
12677
|
+
var __vue_render__$f = function () {
|
|
12583
12678
|
var _vm = this;
|
|
12584
12679
|
var _h = _vm.$createElement;
|
|
12585
12680
|
var _c = _vm._self._c || _h;
|
|
12586
12681
|
return _vm.loading ? _c("div", { staticClass: "g-loading" }) : _vm._e()
|
|
12587
12682
|
};
|
|
12588
|
-
var __vue_staticRenderFns__$
|
|
12589
|
-
__vue_render__$
|
|
12683
|
+
var __vue_staticRenderFns__$f = [];
|
|
12684
|
+
__vue_render__$f._withStripped = true;
|
|
12590
12685
|
|
|
12591
12686
|
/* style */
|
|
12592
|
-
const __vue_inject_styles__$
|
|
12687
|
+
const __vue_inject_styles__$f = function (inject) {
|
|
12593
12688
|
if (!inject) return
|
|
12594
|
-
inject("data-v-
|
|
12689
|
+
inject("data-v-214908b6_0", { source: ".g-loading[data-v-214908b6] {\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-214908b6 infinite 0.75s linear;\n}\n@keyframes rotate-data-v-214908b6 {\n0% {\n transform: rotate(0);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
12595
12690
|
|
|
12596
12691
|
};
|
|
12597
12692
|
/* scoped */
|
|
12598
|
-
const __vue_scope_id__$
|
|
12693
|
+
const __vue_scope_id__$f = "data-v-214908b6";
|
|
12599
12694
|
/* module identifier */
|
|
12600
|
-
const __vue_module_identifier__$
|
|
12695
|
+
const __vue_module_identifier__$f = undefined;
|
|
12601
12696
|
/* functional template */
|
|
12602
|
-
const __vue_is_functional_template__$
|
|
12697
|
+
const __vue_is_functional_template__$f = false;
|
|
12603
12698
|
/* style inject SSR */
|
|
12604
12699
|
|
|
12605
12700
|
/* style inject shadow dom */
|
|
12606
12701
|
|
|
12607
12702
|
|
|
12608
12703
|
|
|
12609
|
-
const __vue_component__$
|
|
12610
|
-
{ render: __vue_render__$
|
|
12611
|
-
__vue_inject_styles__$
|
|
12612
|
-
__vue_script__$
|
|
12613
|
-
__vue_scope_id__$
|
|
12614
|
-
__vue_is_functional_template__$
|
|
12615
|
-
__vue_module_identifier__$
|
|
12704
|
+
const __vue_component__$f = /*#__PURE__*/normalizeComponent(
|
|
12705
|
+
{ render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
|
|
12706
|
+
__vue_inject_styles__$f,
|
|
12707
|
+
__vue_script__$f,
|
|
12708
|
+
__vue_scope_id__$f,
|
|
12709
|
+
__vue_is_functional_template__$f,
|
|
12710
|
+
__vue_module_identifier__$f,
|
|
12616
12711
|
false,
|
|
12617
12712
|
createInjector,
|
|
12618
12713
|
undefined,
|
|
12619
12714
|
undefined
|
|
12620
12715
|
);
|
|
12621
12716
|
|
|
12622
|
-
__vue_component__$
|
|
12717
|
+
__vue_component__$f.install = Vue => Vue.component(__vue_component__$f.name, __vue_component__$f);
|
|
12623
12718
|
|
|
12624
12719
|
//
|
|
12625
|
-
var script$
|
|
12720
|
+
var script$e = {
|
|
12626
12721
|
name: 'ele-tree-select',
|
|
12627
12722
|
model: {
|
|
12628
12723
|
prop: 'value',
|
|
@@ -12758,10 +12853,10 @@
|
|
|
12758
12853
|
};
|
|
12759
12854
|
|
|
12760
12855
|
/* script */
|
|
12761
|
-
const __vue_script__$
|
|
12856
|
+
const __vue_script__$e = script$e;
|
|
12762
12857
|
|
|
12763
12858
|
/* template */
|
|
12764
|
-
var __vue_render__$
|
|
12859
|
+
var __vue_render__$e = function () {
|
|
12765
12860
|
var _vm = this;
|
|
12766
12861
|
var _h = _vm.$createElement;
|
|
12767
12862
|
var _c = _vm._self._c || _h;
|
|
@@ -12784,17 +12879,334 @@
|
|
|
12784
12879
|
1
|
|
12785
12880
|
)
|
|
12786
12881
|
};
|
|
12882
|
+
var __vue_staticRenderFns__$e = [];
|
|
12883
|
+
__vue_render__$e._withStripped = true;
|
|
12884
|
+
|
|
12885
|
+
/* style */
|
|
12886
|
+
const __vue_inject_styles__$e = function (inject) {
|
|
12887
|
+
if (!inject) return
|
|
12888
|
+
inject("data-v-74181520_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
12889
|
+
|
|
12890
|
+
};
|
|
12891
|
+
/* scoped */
|
|
12892
|
+
const __vue_scope_id__$e = "data-v-74181520";
|
|
12893
|
+
/* module identifier */
|
|
12894
|
+
const __vue_module_identifier__$e = undefined;
|
|
12895
|
+
/* functional template */
|
|
12896
|
+
const __vue_is_functional_template__$e = false;
|
|
12897
|
+
/* style inject SSR */
|
|
12898
|
+
|
|
12899
|
+
/* style inject shadow dom */
|
|
12900
|
+
|
|
12901
|
+
|
|
12902
|
+
|
|
12903
|
+
const __vue_component__$e = /*#__PURE__*/normalizeComponent(
|
|
12904
|
+
{ render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
|
|
12905
|
+
__vue_inject_styles__$e,
|
|
12906
|
+
__vue_script__$e,
|
|
12907
|
+
__vue_scope_id__$e,
|
|
12908
|
+
__vue_is_functional_template__$e,
|
|
12909
|
+
__vue_module_identifier__$e,
|
|
12910
|
+
false,
|
|
12911
|
+
createInjector,
|
|
12912
|
+
undefined,
|
|
12913
|
+
undefined
|
|
12914
|
+
);
|
|
12915
|
+
|
|
12916
|
+
__vue_component__$e.install = Vue => Vue.component(__vue_component__$e.name, __vue_component__$e);
|
|
12917
|
+
|
|
12918
|
+
//
|
|
12919
|
+
const {
|
|
12920
|
+
toNumber
|
|
12921
|
+
} = shared.util;
|
|
12922
|
+
var script$d = {
|
|
12923
|
+
name: 'ele-pagination',
|
|
12924
|
+
props: {
|
|
12925
|
+
query: {
|
|
12926
|
+
type: Object,
|
|
12927
|
+
default: () => ({})
|
|
12928
|
+
},
|
|
12929
|
+
data: {
|
|
12930
|
+
type: Array,
|
|
12931
|
+
default: () => []
|
|
12932
|
+
},
|
|
12933
|
+
loading: {
|
|
12934
|
+
type: Boolean,
|
|
12935
|
+
default: false
|
|
12936
|
+
},
|
|
12937
|
+
total: {
|
|
12938
|
+
type: [String, Number],
|
|
12939
|
+
default: 0
|
|
12940
|
+
},
|
|
12941
|
+
pageSizeOptions: {
|
|
12942
|
+
type: Array,
|
|
12943
|
+
default: () => [50, 100, 500, 1000]
|
|
12944
|
+
},
|
|
12945
|
+
current: {
|
|
12946
|
+
type: [Number, String],
|
|
12947
|
+
default: 1
|
|
12948
|
+
},
|
|
12949
|
+
pageSize: {
|
|
12950
|
+
type: [Number, String],
|
|
12951
|
+
default: 10
|
|
12952
|
+
},
|
|
12953
|
+
disabledNextButton: {
|
|
12954
|
+
type: Boolean,
|
|
12955
|
+
default: false
|
|
12956
|
+
}
|
|
12957
|
+
},
|
|
12958
|
+
data() {
|
|
12959
|
+
return {
|
|
12960
|
+
currentPage: 1,
|
|
12961
|
+
currentPageSize: 0,
|
|
12962
|
+
disabledPrev: false,
|
|
12963
|
+
disabledNext: false,
|
|
12964
|
+
currentTotal: 0,
|
|
12965
|
+
currentTotalLoading: true,
|
|
12966
|
+
cacheQuery: []
|
|
12967
|
+
};
|
|
12968
|
+
},
|
|
12969
|
+
computed: {
|
|
12970
|
+
innerPageSizeOptions() {
|
|
12971
|
+
const normalized = this.pageSizeOptions.map(item => toNumber(item)).filter(n => typeof n === 'number' && Number.isFinite(n) && n > 0);
|
|
12972
|
+
|
|
12973
|
+
// 兜底:避免 a-select option 出现 undefined/空数组
|
|
12974
|
+
return normalized.length ? normalized : [10];
|
|
12975
|
+
},
|
|
12976
|
+
pageQuery() {
|
|
12977
|
+
const {
|
|
12978
|
+
currentPage,
|
|
12979
|
+
pageSize
|
|
12980
|
+
} = this.query;
|
|
12981
|
+
return {
|
|
12982
|
+
currentPage,
|
|
12983
|
+
pageSize
|
|
12984
|
+
};
|
|
12985
|
+
}
|
|
12986
|
+
},
|
|
12987
|
+
watch: {
|
|
12988
|
+
current: {
|
|
12989
|
+
handler(current) {
|
|
12990
|
+
this.syncCurrentFromProps(current);
|
|
12991
|
+
},
|
|
12992
|
+
immediate: true
|
|
12993
|
+
},
|
|
12994
|
+
total: {
|
|
12995
|
+
handler(total) {
|
|
12996
|
+
this.currentTotalLoading = true;
|
|
12997
|
+
if (typeof total === 'number') {
|
|
12998
|
+
this.currentTotal = total;
|
|
12999
|
+
this.currentTotalLoading = false;
|
|
13000
|
+
}
|
|
13001
|
+
},
|
|
13002
|
+
immediate: true
|
|
13003
|
+
},
|
|
13004
|
+
query: {
|
|
13005
|
+
handler(newQuery, oldQuery) {
|
|
13006
|
+
// 1s内多次请求合并
|
|
13007
|
+
// clearTimeout(this.timer)
|
|
13008
|
+
// this.timer = setTimeout(() => {
|
|
13009
|
+
// this.requestHandler(this.total, { ...newQuery, ...this.pageQuery })
|
|
13010
|
+
// }, 1000)
|
|
13011
|
+
}
|
|
13012
|
+
},
|
|
13013
|
+
data: {
|
|
13014
|
+
handler(data) {
|
|
13015
|
+
if (!this.currentPageSize) return;
|
|
13016
|
+
if (data.length != this.currentPageSize) {
|
|
13017
|
+
this.disabledNext = true;
|
|
13018
|
+
} else {
|
|
13019
|
+
this.disabledNext = false;
|
|
13020
|
+
}
|
|
13021
|
+
},
|
|
13022
|
+
immediate: true
|
|
13023
|
+
},
|
|
13024
|
+
disabledNextButton: {
|
|
13025
|
+
handler(status) {
|
|
13026
|
+
this.disabledNext = status;
|
|
13027
|
+
},
|
|
13028
|
+
immediate: true
|
|
13029
|
+
},
|
|
13030
|
+
pageSize: {
|
|
13031
|
+
handler(size) {
|
|
13032
|
+
this.syncPageSizeFromProps(size);
|
|
13033
|
+
},
|
|
13034
|
+
immediate: true
|
|
13035
|
+
}
|
|
13036
|
+
},
|
|
13037
|
+
methods: {
|
|
13038
|
+
handleChangePageSize(value) {
|
|
13039
|
+
const nextSize = this.normalizePageSize(value, this.currentPageSize || 10);
|
|
13040
|
+
if (!nextSize) return;
|
|
13041
|
+
this.currentPageSize = nextSize;
|
|
13042
|
+
// pageSize 变化建议回到第一页,避免页码越界
|
|
13043
|
+
this.currentPage = 1;
|
|
13044
|
+
this.setDisabledPrev(this.currentPage);
|
|
13045
|
+
|
|
13046
|
+
// 仅用户交互时触发
|
|
13047
|
+
this.$emit('showSizeChange', this.currentPage, this.currentPageSize);
|
|
13048
|
+
},
|
|
13049
|
+
setDisabledNext(status) {
|
|
13050
|
+
this.disabledNext = status;
|
|
13051
|
+
},
|
|
13052
|
+
handleClickHome() {
|
|
13053
|
+
this.currentPage = 1;
|
|
13054
|
+
this.setDisabledPrev(this.currentPage);
|
|
13055
|
+
// 仅用户交互时触发
|
|
13056
|
+
this.$emit('change', this.currentPage, this.currentPageSize);
|
|
13057
|
+
},
|
|
13058
|
+
setDisabledPrev(currentPage) {
|
|
13059
|
+
if (currentPage > 1) {
|
|
13060
|
+
this.disabledPrev = false;
|
|
13061
|
+
} else {
|
|
13062
|
+
this.disabledPrev = true;
|
|
13063
|
+
}
|
|
13064
|
+
},
|
|
13065
|
+
handleClickPrev() {
|
|
13066
|
+
if (this.currentPage > 1) {
|
|
13067
|
+
this.currentPage -= 1;
|
|
13068
|
+
this.setDisabledPrev(this.currentPage);
|
|
13069
|
+
// 仅用户交互时触发
|
|
13070
|
+
this.$emit('change', this.currentPage, this.currentPageSize);
|
|
13071
|
+
}
|
|
13072
|
+
},
|
|
13073
|
+
handleClickNext() {
|
|
13074
|
+
if (this.disabledNext) return;
|
|
13075
|
+
this.currentPage += 1;
|
|
13076
|
+
this.setDisabledPrev(this.currentPage);
|
|
13077
|
+
// 仅用户交互时触发
|
|
13078
|
+
this.$emit('change', this.currentPage, this.currentPageSize);
|
|
13079
|
+
},
|
|
13080
|
+
normalizePage(value, fallback = 1) {
|
|
13081
|
+
const n = toNumber(value);
|
|
13082
|
+
if (typeof n !== 'number' || !Number.isFinite(n)) return fallback;
|
|
13083
|
+
const page = Math.floor(n);
|
|
13084
|
+
return page >= 1 ? page : fallback;
|
|
13085
|
+
},
|
|
13086
|
+
normalizePageSize(value, fallback = 10) {
|
|
13087
|
+
const n = toNumber(value);
|
|
13088
|
+
if (typeof n !== 'number' || !Number.isFinite(n)) return fallback;
|
|
13089
|
+
const size = Math.floor(n);
|
|
13090
|
+
return size >= 1 ? size : fallback;
|
|
13091
|
+
},
|
|
13092
|
+
// props 同步:只更新内部 state,不触发 emit
|
|
13093
|
+
syncCurrentFromProps(current) {
|
|
13094
|
+
this.currentPage = this.normalizePage(current, 1);
|
|
13095
|
+
this.setDisabledPrev(this.currentPage);
|
|
13096
|
+
},
|
|
13097
|
+
// props 同步:只更新内部 state,不触发 emit
|
|
13098
|
+
syncPageSizeFromProps(size) {
|
|
13099
|
+
this.currentPageSize = this.normalizePageSize(size, this.currentPageSize || 10);
|
|
13100
|
+
}
|
|
13101
|
+
},
|
|
13102
|
+
destroyed() {
|
|
13103
|
+
this.cacheQuery = [];
|
|
13104
|
+
}
|
|
13105
|
+
};
|
|
13106
|
+
|
|
13107
|
+
/* script */
|
|
13108
|
+
const __vue_script__$d = script$d;
|
|
13109
|
+
|
|
13110
|
+
/* template */
|
|
13111
|
+
var __vue_render__$d = function () {
|
|
13112
|
+
var _vm = this;
|
|
13113
|
+
var _h = _vm.$createElement;
|
|
13114
|
+
var _c = _vm._self._c || _h;
|
|
13115
|
+
return _c("div", { staticClass: "ele-page--wrapper" }, [
|
|
13116
|
+
_c("section", { staticClass: "ele-page--panel" }, [
|
|
13117
|
+
_c(
|
|
13118
|
+
"div",
|
|
13119
|
+
{ staticClass: "total" },
|
|
13120
|
+
[
|
|
13121
|
+
_vm._v("\n 共\n "),
|
|
13122
|
+
!_vm.currentTotalLoading
|
|
13123
|
+
? _c("span", [_vm._v(_vm._s(_vm.currentTotal))])
|
|
13124
|
+
: _c("a-icon", { attrs: { type: "loading" } }),
|
|
13125
|
+
_vm._v("\n 条\n "),
|
|
13126
|
+
],
|
|
13127
|
+
1
|
|
13128
|
+
),
|
|
13129
|
+
_vm._v(" "),
|
|
13130
|
+
_c("div", { staticClass: "page" }, [
|
|
13131
|
+
_c("div", { staticClass: "home", on: { click: _vm.handleClickHome } }, [
|
|
13132
|
+
_vm._v("首页"),
|
|
13133
|
+
]),
|
|
13134
|
+
_vm._v(" "),
|
|
13135
|
+
_c(
|
|
13136
|
+
"div",
|
|
13137
|
+
{
|
|
13138
|
+
class: [
|
|
13139
|
+
"page--prev",
|
|
13140
|
+
_vm.loading && "page-disabled",
|
|
13141
|
+
_vm.disabledPrev && "page-disabled",
|
|
13142
|
+
],
|
|
13143
|
+
on: { click: _vm.handleClickPrev },
|
|
13144
|
+
},
|
|
13145
|
+
[_c("a-icon", { attrs: { type: "left" } })],
|
|
13146
|
+
1
|
|
13147
|
+
),
|
|
13148
|
+
_vm._v(" "),
|
|
13149
|
+
_c("div", { staticClass: "page--current" }, [
|
|
13150
|
+
_vm._v("\n " + _vm._s(_vm.currentPage) + "\n "),
|
|
13151
|
+
]),
|
|
13152
|
+
_vm._v(" "),
|
|
13153
|
+
_c(
|
|
13154
|
+
"div",
|
|
13155
|
+
{
|
|
13156
|
+
class: [
|
|
13157
|
+
"page--next",
|
|
13158
|
+
_vm.loading && "page-disabled",
|
|
13159
|
+
_vm.disabledNext && "page-disabled",
|
|
13160
|
+
],
|
|
13161
|
+
on: { click: _vm.handleClickNext },
|
|
13162
|
+
},
|
|
13163
|
+
[_c("a-icon", { attrs: { type: "right" } })],
|
|
13164
|
+
1
|
|
13165
|
+
),
|
|
13166
|
+
]),
|
|
13167
|
+
_vm._v(" "),
|
|
13168
|
+
_c(
|
|
13169
|
+
"div",
|
|
13170
|
+
{ staticClass: "size" },
|
|
13171
|
+
[
|
|
13172
|
+
_c(
|
|
13173
|
+
"a-select",
|
|
13174
|
+
{
|
|
13175
|
+
on: { change: _vm.handleChangePageSize },
|
|
13176
|
+
model: {
|
|
13177
|
+
value: _vm.currentPageSize,
|
|
13178
|
+
callback: function ($$v) {
|
|
13179
|
+
_vm.currentPageSize = $$v;
|
|
13180
|
+
},
|
|
13181
|
+
expression: "currentPageSize",
|
|
13182
|
+
},
|
|
13183
|
+
},
|
|
13184
|
+
_vm._l(_vm.innerPageSizeOptions, function (item) {
|
|
13185
|
+
return _c(
|
|
13186
|
+
"a-select-option",
|
|
13187
|
+
{ key: item, attrs: { value: item } },
|
|
13188
|
+
[_vm._v("\n " + _vm._s(item) + " 条/页\n ")]
|
|
13189
|
+
)
|
|
13190
|
+
}),
|
|
13191
|
+
1
|
|
13192
|
+
),
|
|
13193
|
+
],
|
|
13194
|
+
1
|
|
13195
|
+
),
|
|
13196
|
+
]),
|
|
13197
|
+
])
|
|
13198
|
+
};
|
|
12787
13199
|
var __vue_staticRenderFns__$d = [];
|
|
12788
13200
|
__vue_render__$d._withStripped = true;
|
|
12789
13201
|
|
|
12790
13202
|
/* style */
|
|
12791
13203
|
const __vue_inject_styles__$d = function (inject) {
|
|
12792
13204
|
if (!inject) return
|
|
12793
|
-
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 });
|
|
13205
|
+
inject("data-v-15a4e77c_0", { source: "@keyframes ani-load-loop-data-v-15a4e77c {\n0% {\n transform: rotate(0);\n}\n50% {\n transform: rotate(180deg);\n}\n100% {\n transform: rotate(1turn);\n}\n}\n.ele-page--wrapper[data-v-15a4e77c] {\n width: 100%;\n height: 100%;\n background: transparent;\n border-top: unset;\n padding: 0px 16px 16px 16px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n /* margin-left: 16px;\n margin-right: 16px; */\n}\n.ele-page--wrapper .ele-page--panel[data-v-15a4e77c] {\n width: auto;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-page--wrapper .ele-page--panel .total .ivu-load-loop[data-v-15a4e77c] {\n color: #409EFF;\n animation: ani-load-loop-data-v-15a4e77c 1s linear infinite;\n}\n.ele-page--wrapper .ele-page--panel .total[data-v-15a4e77c] {\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n}\n.ele-page--wrapper .ele-page--panel .page[data-v-15a4e77c] {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n}\n.ele-page--wrapper .ele-page--panel .page .home[data-v-15a4e77c] {\n height: auto;\n width: auto;\n color: rgba(0, 0, 0, 0.88);\n padding: 5px 4px 5px 4px;\n text-align: center;\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: #FFF;\n box-sizing: border-box;\n cursor: pointer;\n}\n.ele-page--wrapper .ele-page--panel .page .page--prev[data-v-15a4e77c] {\n margin-left: 12px;\n cursor: pointer;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: #FFF;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}\n.ele-page--wrapper .ele-page--panel .page .page--prev .ivu-icon-ios-arrow-left[data-v-15a4e77c] {\n font-size: 16px;\n}\n.ele-page--wrapper .ele-page--panel .page .page--current[data-v-15a4e77c] {\n margin-left: 12px;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n background: #409EFF;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n color: #FFF;\n}\n.ele-page--wrapper .ele-page--panel .page .page--next[data-v-15a4e77c] {\n margin-left: 12px;\n cursor: pointer;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: #FFF;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}\n.ele-page--wrapper .ele-page--panel .page .page--next .ivu-icon-ios-arrow-right[data-v-15a4e77c] {\n font-size: 16px;\n}\n.ele-page--wrapper .ele-page--panel .page .page--prev.page-disabled[data-v-15a4e77c], .ele-page--wrapper .ele-page--panel .page .page--next.page-disabled[data-v-15a4e77c] {\n margin-left: 12px;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: not-allowed;\n}\n.ele-page--wrapper .ele-page--panel .size[data-v-15a4e77c] {\n width: auto;\n display: flex;\n flex-direction: row;\n margin-left: 12px;\n}\n.ele-page--wrapper .ele-page--panel .size .ant-select[data-v-15a4e77c] {\n min-width: 91px;\n flex-basis: 91px;\n /* flex-shrink: 0; */\n flex-grow: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\pagination\\src\\index.vue","index.vue"],"names":[],"mappings":"AA0NA;AACA;IACA,oBAAA;ACzNE;AD2NF;IACA,yBAAA;ACzNE;AD2NF;IACA,wBAAA;ACzNE;AACF;AD2NA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;EACA,iBAAA;EACA,2BAAA;EACA,sBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;EACA;uBAAA;ACxNA;AD0NA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACxNA;AD0NA;EACA,cAAA;EACA,2DAAA;ACxNA;ADqNA;EAKA,0BAAA;EACA,0CAAA;EACA,eAAA;EACA,gBAAA;ACvNA;ADyNA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;ACvNA;ADwNA;EACA,YAAA;EACA,WAAA;EACA,0BAAA;EACA,wBAAA;EACA,kBAAA;EACA,0CAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,qCAAA;EACA,gBAAA;EACA,sBAAA;EACA,eAAA;ACtNA;ADwNA;EACA,iBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,0BAAA;EACA,0CAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,qCAAA;EACA,gBAAA;EACA,sBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;ACtNA;ADuNA;EACA,eAAA;ACrNA;ADwNA;EACA,iBAAA;EACA,YAAA;EACA,WAAA;EACA,0BAAA;EACA,0CAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,mBAAA;EACA,sBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;ACtNA;ADwNA;EACA,iBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,0BAAA;EACA,0CAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,qCAAA;EACA,gBAAA;EACA,sBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;ACtNA;ADuNA;EACA,eAAA;ACrNA;ADyNA;EACA,iBAAA;EACA,YAAA;EACA,WAAA;EACA,0BAAA;EACA,0CAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,qCAAA;EACA,+BAAA;EACA,sBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,mBAAA;ACvNA;AD2NA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;ACzNA;AD0NA;EACA,eAAA;EACA,gBAAA;EACA,oBAAA;EACA,YAAA;ACxNA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-page--wrapper\">\r\n <section class=\"ele-page--panel\">\r\n <div class=\"total\">\r\n 共\r\n <span v-if=\"!currentTotalLoading\">{{ currentTotal }}</span>\r\n <a-icon v-else type=\"loading\" />\r\n 条\r\n </div>\r\n <div class=\"page\">\r\n <div class=\"home\" @click=\"handleClickHome\">首页</div>\r\n <div :class=\"['page--prev', loading && 'page-disabled', disabledPrev && 'page-disabled']\" @click=\"handleClickPrev\">\r\n <a-icon type=\"left\"></a-icon>\r\n </div>\r\n <div class=\"page--current\">\r\n {{ currentPage }}\r\n </div>\r\n <div :class=\"['page--next', loading && 'page-disabled', disabledNext && 'page-disabled']\" @click=\"handleClickNext\">\r\n <a-icon type=\"right\"></a-icon>\r\n </div>\r\n </div>\r\n <div class=\"size\">\r\n <a-select v-model=\"currentPageSize\" @change=\"handleChangePageSize\">\r\n <a-select-option v-for=\"item in innerPageSizeOptions\" :value=\"item\" :key=\"item\">\r\n {{ item }} 条/页\r\n </a-select-option>\r\n </a-select>\r\n </div>\r\n </section>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { util } from '@idooel/shared'\r\nconst { toNumber } = util\r\nexport default {\r\n name: 'ele-pagination',\r\n props: {\r\n query: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n data: {\r\n type: Array,\r\n default: () => ([])\r\n },\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n }, \r\n total: {\r\n type: [String, Number],\r\n default: 0\r\n },\r\n pageSizeOptions: {\r\n type: Array,\r\n default: () => ([50, 100, 500, 1000])\r\n },\r\n current: {\r\n type: [Number, String],\r\n default: 1\r\n },\r\n pageSize: {\r\n type: [Number, String],\r\n default: 10\r\n },\r\n disabledNextButton: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n data () {\r\n return {\r\n currentPage: 1,\r\n currentPageSize: 0,\r\n disabledPrev: false,\r\n disabledNext: false,\r\n currentTotal: 0,\r\n currentTotalLoading: true,\r\n cacheQuery: []\r\n }\r\n },\r\n computed: {\r\n innerPageSizeOptions () {\r\n const normalized = this.pageSizeOptions\r\n .map(item => toNumber(item))\r\n .filter(n => typeof n === 'number' && Number.isFinite(n) && n > 0)\r\n\r\n // 兜底:避免 a-select option 出现 undefined/空数组\r\n return normalized.length ? normalized : [10]\r\n },\r\n pageQuery () {\r\n const { currentPage, pageSize } = this.query\r\n return { currentPage, pageSize }\r\n }\r\n },\r\n watch: {\r\n current: {\r\n handler (current) {\r\n this.syncCurrentFromProps(current)\r\n },\r\n immediate: true\r\n },\r\n total: {\r\n handler (total) {\r\n this.currentTotalLoading = true\r\n if (typeof total === 'number') {\r\n this.currentTotal = total\r\n this.currentTotalLoading = false\r\n }\r\n },\r\n immediate: true\r\n },\r\n query: {\r\n handler (newQuery, oldQuery) {\r\n // 1s内多次请求合并\r\n // clearTimeout(this.timer)\r\n // this.timer = setTimeout(() => {\r\n // this.requestHandler(this.total, { ...newQuery, ...this.pageQuery })\r\n // }, 1000)\r\n }\r\n },\r\n data: {\r\n handler (data) {\r\n if (!this.currentPageSize) return\r\n if (data.length != this.currentPageSize) {\r\n this.disabledNext = true\r\n } else {\r\n this.disabledNext = false\r\n }\r\n },\r\n immediate: true\r\n },\r\n disabledNextButton: {\r\n handler (status) {\r\n this.disabledNext = status\r\n },\r\n immediate: true\r\n },\r\n pageSize: {\r\n handler (size) {\r\n this.syncPageSizeFromProps(size)\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n handleChangePageSize (value) {\r\n const nextSize = this.normalizePageSize(value, this.currentPageSize || 10)\r\n if (!nextSize) return\r\n\r\n this.currentPageSize = nextSize\r\n // pageSize 变化建议回到第一页,避免页码越界\r\n this.currentPage = 1\r\n this.setDisabledPrev(this.currentPage)\r\n\r\n // 仅用户交互时触发\r\n this.$emit('showSizeChange', this.currentPage, this.currentPageSize)\r\n },\r\n setDisabledNext (status) {\r\n this.disabledNext = status\r\n },\r\n handleClickHome () {\r\n this.currentPage = 1\r\n this.setDisabledPrev(this.currentPage)\r\n // 仅用户交互时触发\r\n this.$emit('change', this.currentPage, this.currentPageSize)\r\n },\r\n setDisabledPrev (currentPage) {\r\n if (currentPage > 1) {\r\n this.disabledPrev = false\r\n } else {\r\n this.disabledPrev = true\r\n }\r\n },\r\n handleClickPrev () {\r\n if (this.currentPage > 1) {\r\n this.currentPage -= 1\r\n this.setDisabledPrev(this.currentPage)\r\n // 仅用户交互时触发\r\n this.$emit('change', this.currentPage, this.currentPageSize)\r\n }\r\n },\r\n handleClickNext () {\r\n if (this.disabledNext) return\r\n this.currentPage += 1\r\n this.setDisabledPrev(this.currentPage)\r\n // 仅用户交互时触发\r\n this.$emit('change', this.currentPage, this.currentPageSize)\r\n },\r\n normalizePage (value, fallback = 1) {\r\n const n = toNumber(value)\r\n if (typeof n !== 'number' || !Number.isFinite(n)) return fallback\r\n const page = Math.floor(n)\r\n return page >= 1 ? page : fallback\r\n },\r\n normalizePageSize (value, fallback = 10) {\r\n const n = toNumber(value)\r\n if (typeof n !== 'number' || !Number.isFinite(n)) return fallback\r\n const size = Math.floor(n)\r\n return size >= 1 ? size : fallback\r\n },\r\n // props 同步:只更新内部 state,不触发 emit\r\n syncCurrentFromProps (current) {\r\n this.currentPage = this.normalizePage(current, 1)\r\n this.setDisabledPrev(this.currentPage)\r\n },\r\n // props 同步:只更新内部 state,不触发 emit\r\n syncPageSizeFromProps (size) {\r\n this.currentPageSize = this.normalizePageSize(size, this.currentPageSize || 10)\r\n }\r\n },\r\n destroyed () {\r\n this.cacheQuery = []\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n @keyframes ani-load-loop {\r\n 0% {\r\n transform: rotate(0);\r\n }\r\n 50% {\r\n transform: rotate(180deg);\r\n }\r\n 100% {\r\n transform: rotate(1turn);\r\n }\r\n}\r\n.ele-page--wrapper {\r\n width: 100%;\r\n height: 100%;\r\n background: transparent;\r\n border-top: unset;\r\n padding: 0px 16px 16px 16px;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n /* margin-left: 16px;\r\n margin-right: 16px; */\r\n .ele-page--panel {\r\n width: auto;\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n .total {\r\n .ivu-load-loop {\r\n color: #409EFF;\r\n animation: ani-load-loop 1s linear infinite;\r\n }\r\n color: rgba(0, 0, 0, 0.88);\r\n font-family: 'AlibabaPuHuiTi_2_55_Regular';\r\n font-size: 14px;\r\n font-weight: 400;\r\n }\r\n .page {\r\n margin-left: 12px;\r\n display: flex;\r\n flex-direction: row;\r\n .home {\r\n height: auto;\r\n width: auto;\r\n color: rgba(0, 0, 0, 0.88);\r\n padding: 5px 4px 5px 4px;\r\n text-align: center;\r\n font-family: 'AlibabaPuHuiTi_2_55_Regular';\r\n font-size: 14px;\r\n font-weight: 400;\r\n border-radius: 2px;\r\n border: 1px solid rgba(0, 0, 0, 0.16);\r\n background: #FFF;\r\n box-sizing: border-box;\r\n cursor: pointer;\r\n }\r\n .page--prev {\r\n margin-left: 12px;\r\n cursor: pointer;\r\n height: 32px;\r\n width: 32px;\r\n color: rgba(0, 0, 0, 0.88);\r\n font-family: 'AlibabaPuHuiTi_2_55_Regular';\r\n font-size: 14px;\r\n font-weight: 400;\r\n border-radius: 2px;\r\n border: 1px solid rgba(0, 0, 0, 0.16);\r\n background: #FFF;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n .ivu-icon-ios-arrow-left {\r\n font-size: 16px;\r\n }\r\n }\r\n .page--current {\r\n margin-left: 12px;\r\n height: 32px;\r\n width: 32px;\r\n color: rgba(0, 0, 0, 0.88);\r\n font-family: 'AlibabaPuHuiTi_2_55_Regular';\r\n font-size: 14px;\r\n font-weight: 400;\r\n border-radius: 2px;\r\n background: #409EFF;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n color: #FFF;\r\n }\r\n .page--next {\r\n margin-left: 12px;\r\n cursor: pointer;\r\n height: 32px;\r\n width: 32px;\r\n color: rgba(0, 0, 0, 0.88);\r\n font-family: 'AlibabaPuHuiTi_2_55_Regular';\r\n font-size: 14px;\r\n font-weight: 400;\r\n border-radius: 2px;\r\n border: 1px solid rgba(0, 0, 0, 0.16);\r\n background: #FFF;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n .ivu-icon-ios-arrow-right {\r\n font-size: 16px;\r\n }\r\n }\r\n .page--prev, .page--next {\r\n &.page-disabled {\r\n margin-left: 12px;\r\n height: 32px;\r\n width: 32px;\r\n color: rgba(0, 0, 0, 0.88);\r\n font-family: 'AlibabaPuHuiTi_2_55_Regular';\r\n font-size: 14px;\r\n font-weight: 400;\r\n border-radius: 2px;\r\n border: 1px solid rgba(0, 0, 0, 0.16);\r\n background: rgba(0, 0, 0, 0.04);\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: not-allowed;\r\n }\r\n }\r\n }\r\n .size {\r\n width: auto;\r\n display: flex;\r\n flex-direction: row;\r\n margin-left: 12px;\r\n .ant-select {\r\n min-width: 91px;\r\n flex-basis: 91px;\r\n /* flex-shrink: 0; */\r\n flex-grow: 1;\r\n }\r\n }\r\n }\r\n}\r\n</style>","@keyframes ani-load-loop {\n 0% {\n transform: rotate(0);\n }\n 50% {\n transform: rotate(180deg);\n }\n 100% {\n transform: rotate(1turn);\n }\n}\n.ele-page--wrapper {\n width: 100%;\n height: 100%;\n background: transparent;\n border-top: unset;\n padding: 0px 16px 16px 16px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n /* margin-left: 16px;\n margin-right: 16px; */\n}\n.ele-page--wrapper .ele-page--panel {\n width: auto;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-page--wrapper .ele-page--panel .total .ivu-load-loop {\n color: #409EFF;\n animation: ani-load-loop 1s linear infinite;\n}\n.ele-page--wrapper .ele-page--panel .total {\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n}\n.ele-page--wrapper .ele-page--panel .page {\n margin-left: 12px;\n display: flex;\n flex-direction: row;\n}\n.ele-page--wrapper .ele-page--panel .page .home {\n height: auto;\n width: auto;\n color: rgba(0, 0, 0, 0.88);\n padding: 5px 4px 5px 4px;\n text-align: center;\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: #FFF;\n box-sizing: border-box;\n cursor: pointer;\n}\n.ele-page--wrapper .ele-page--panel .page .page--prev {\n margin-left: 12px;\n cursor: pointer;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: #FFF;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}\n.ele-page--wrapper .ele-page--panel .page .page--prev .ivu-icon-ios-arrow-left {\n font-size: 16px;\n}\n.ele-page--wrapper .ele-page--panel .page .page--current {\n margin-left: 12px;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n background: #409EFF;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n color: #FFF;\n}\n.ele-page--wrapper .ele-page--panel .page .page--next {\n margin-left: 12px;\n cursor: pointer;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: #FFF;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}\n.ele-page--wrapper .ele-page--panel .page .page--next .ivu-icon-ios-arrow-right {\n font-size: 16px;\n}\n.ele-page--wrapper .ele-page--panel .page .page--prev.page-disabled, .ele-page--wrapper .ele-page--panel .page .page--next.page-disabled {\n margin-left: 12px;\n height: 32px;\n width: 32px;\n color: rgba(0, 0, 0, 0.88);\n font-family: \"AlibabaPuHuiTi_2_55_Regular\";\n font-size: 14px;\n font-weight: 400;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: not-allowed;\n}\n.ele-page--wrapper .ele-page--panel .size {\n width: auto;\n display: flex;\n flex-direction: row;\n margin-left: 12px;\n}\n.ele-page--wrapper .ele-page--panel .size .ant-select {\n min-width: 91px;\n flex-basis: 91px;\n /* flex-shrink: 0; */\n flex-grow: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12794
13206
|
|
|
12795
13207
|
};
|
|
12796
13208
|
/* scoped */
|
|
12797
|
-
const __vue_scope_id__$d = "data-v-
|
|
13209
|
+
const __vue_scope_id__$d = "data-v-15a4e77c";
|
|
12798
13210
|
/* module identifier */
|
|
12799
13211
|
const __vue_module_identifier__$d = undefined;
|
|
12800
13212
|
/* functional template */
|
|
@@ -12856,11 +13268,11 @@
|
|
|
12856
13268
|
/* style */
|
|
12857
13269
|
const __vue_inject_styles__$c = function (inject) {
|
|
12858
13270
|
if (!inject) return
|
|
12859
|
-
inject("data-v-
|
|
13271
|
+
inject("data-v-29265e42_0", { source: ".g-search__label[data-v-29265e42] {\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-29265e42], .g-search__label .label__suffix[data-v-29265e42] {\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-29265e42] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
12860
13272
|
|
|
12861
13273
|
};
|
|
12862
13274
|
/* scoped */
|
|
12863
|
-
const __vue_scope_id__$c = "data-v-
|
|
13275
|
+
const __vue_scope_id__$c = "data-v-29265e42";
|
|
12864
13276
|
/* module identifier */
|
|
12865
13277
|
const __vue_module_identifier__$c = undefined;
|
|
12866
13278
|
/* functional template */
|
|
@@ -13262,11 +13674,11 @@
|
|
|
13262
13674
|
/* style */
|
|
13263
13675
|
const __vue_inject_styles__$b = function (inject) {
|
|
13264
13676
|
if (!inject) return
|
|
13265
|
-
inject("data-v-603c5ec8_0", { source: ".search-area__wrapper[data-v-603c5ec8] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-603c5ec8] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-603c5ec8] {\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-603c5ec8] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-603c5ec8] {\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-603c5ec8] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-603c5ec8] {\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":"AA0MA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACzMA;AD2MA;EACA,YAAA;ACzMA;AD4MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC1MA;AD2MA;EACA,oBAAA;ACzMA;AD2MA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACzMA;AD0MA;EACA,eAAA;ACxMA;AD0MA;EACA,eAAA;EACA,gBAAA;ACxMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\" v-show=\"dataSource.length\">\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 default: () => []\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, initSearch: true })\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 });
|
|
13677
|
+
inject("data-v-53f877c8_0", { source: ".search-area__wrapper[data-v-53f877c8] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-53f877c8] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-53f877c8] {\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-53f877c8] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-53f877c8] {\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-53f877c8] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-53f877c8] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AA0MA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACzMA;AD2MA;EACA,YAAA;ACzMA;AD4MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC1MA;AD2MA;EACA,oBAAA;ACzMA;AD2MA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACzMA;AD0MA;EACA,eAAA;ACxMA;AD0MA;EACA,eAAA;EACA,gBAAA;ACxMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\" v-show=\"dataSource.length\">\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 default: () => []\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, initSearch: true })\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 });
|
|
13266
13678
|
|
|
13267
13679
|
};
|
|
13268
13680
|
/* scoped */
|
|
13269
|
-
const __vue_scope_id__$b = "data-v-
|
|
13681
|
+
const __vue_scope_id__$b = "data-v-53f877c8";
|
|
13270
13682
|
/* module identifier */
|
|
13271
13683
|
const __vue_module_identifier__$b = undefined;
|
|
13272
13684
|
/* functional template */
|
|
@@ -13509,11 +13921,11 @@
|
|
|
13509
13921
|
/* style */
|
|
13510
13922
|
const __vue_inject_styles__$a = function (inject) {
|
|
13511
13923
|
if (!inject) return
|
|
13512
|
-
inject("data-v-
|
|
13924
|
+
inject("data-v-4058505b_0", { source: ".button-group__wrapper[data-v-4058505b] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-4058505b] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-4058505b]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
13513
13925
|
|
|
13514
13926
|
};
|
|
13515
13927
|
/* scoped */
|
|
13516
|
-
const __vue_scope_id__$a = "data-v-
|
|
13928
|
+
const __vue_scope_id__$a = "data-v-4058505b";
|
|
13517
13929
|
/* module identifier */
|
|
13518
13930
|
const __vue_module_identifier__$a = undefined;
|
|
13519
13931
|
/* functional template */
|
|
@@ -14025,11 +14437,11 @@
|
|
|
14025
14437
|
/* style */
|
|
14026
14438
|
const __vue_inject_styles__$8 = function (inject) {
|
|
14027
14439
|
if (!inject) return
|
|
14028
|
-
inject("data-v-
|
|
14440
|
+
inject("data-v-3ca93364_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
14029
14441
|
|
|
14030
14442
|
};
|
|
14031
14443
|
/* scoped */
|
|
14032
|
-
const __vue_scope_id__$8 = "data-v-
|
|
14444
|
+
const __vue_scope_id__$8 = "data-v-3ca93364";
|
|
14033
14445
|
/* module identifier */
|
|
14034
14446
|
const __vue_module_identifier__$8 = undefined;
|
|
14035
14447
|
/* functional template */
|
|
@@ -14189,12 +14601,12 @@
|
|
|
14189
14601
|
/* style */
|
|
14190
14602
|
const __vue_inject_styles__$7 = function (inject) {
|
|
14191
14603
|
if (!inject) return
|
|
14192
|
-
inject("data-v-
|
|
14193
|
-
,inject("data-v-
|
|
14604
|
+
inject("data-v-3ea2bcb0_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 })
|
|
14605
|
+
,inject("data-v-3ea2bcb0_1", { source: ".ele-modal-confirm__content[data-v-3ea2bcb0] {\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":["E:\\code\\OnlineStudy-Base\\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 });
|
|
14194
14606
|
|
|
14195
14607
|
};
|
|
14196
14608
|
/* scoped */
|
|
14197
|
-
const __vue_scope_id__$7 = "data-v-
|
|
14609
|
+
const __vue_scope_id__$7 = "data-v-3ea2bcb0";
|
|
14198
14610
|
/* module identifier */
|
|
14199
14611
|
const __vue_module_identifier__$7 = undefined;
|
|
14200
14612
|
/* functional template */
|
|
@@ -14437,11 +14849,11 @@
|
|
|
14437
14849
|
/* style */
|
|
14438
14850
|
const __vue_inject_styles__$6 = function (inject) {
|
|
14439
14851
|
if (!inject) return
|
|
14440
|
-
inject("data-v-
|
|
14852
|
+
inject("data-v-92441724_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
14441
14853
|
|
|
14442
14854
|
};
|
|
14443
14855
|
/* scoped */
|
|
14444
|
-
const __vue_scope_id__$6 = "data-v-
|
|
14856
|
+
const __vue_scope_id__$6 = "data-v-92441724";
|
|
14445
14857
|
/* module identifier */
|
|
14446
14858
|
const __vue_module_identifier__$6 = undefined;
|
|
14447
14859
|
/* functional template */
|
|
@@ -14636,11 +15048,11 @@
|
|
|
14636
15048
|
/* style */
|
|
14637
15049
|
const __vue_inject_styles__$5 = function (inject) {
|
|
14638
15050
|
if (!inject) return
|
|
14639
|
-
inject("data-v-
|
|
15051
|
+
inject("data-v-abad7efe_0", { source: ".ele__img--form .form__img--wrapper[data-v-abad7efe] {\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-abad7efe] {\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-abad7efe] {\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-abad7efe] {\n font-size: 40px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon__text--oper[data-v-abad7efe] {\n font-size: 16px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
14640
15052
|
|
|
14641
15053
|
};
|
|
14642
15054
|
/* scoped */
|
|
14643
|
-
const __vue_scope_id__$5 = "data-v-
|
|
15055
|
+
const __vue_scope_id__$5 = "data-v-abad7efe";
|
|
14644
15056
|
/* module identifier */
|
|
14645
15057
|
const __vue_module_identifier__$5 = undefined;
|
|
14646
15058
|
/* functional template */
|
|
@@ -15198,12 +15610,12 @@
|
|
|
15198
15610
|
/* style */
|
|
15199
15611
|
const __vue_inject_styles__$3 = function (inject) {
|
|
15200
15612
|
if (!inject) return
|
|
15201
|
-
inject("data-v-
|
|
15202
|
-
,inject("data-v-
|
|
15613
|
+
inject("data-v-6c64c223_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 })
|
|
15614
|
+
,inject("data-v-6c64c223_1", { source: ".import-download__link[data-v-6c64c223] {\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-6c64c223] {\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-6c64c223] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right[data-v-6c64c223] {\n margin-left: 16px;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__title[data-v-6c64c223] {\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-6c64c223] {\n font-size: 14px;\n color: var(--idooel-link-03);\n}\n.ele-modal-import__hint .import-footer__hint--text[data-v-6c64c223] {\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":["E:\\code\\OnlineStudy-Base\\base-elearning-frontend-model\\packages\\components\\packages\\business-components\\modal-import\\src\\index.vue","index.vue"],"names":[],"mappings":"AAqLA;EACA,4BAAA;EACA,eAAA;EACA,eAAA;EACA,iBAAA;ACpLA;ADuLA;EACA,aAAA;EACA,kBAAA;EACA,YAAA;EACA,wCAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACpLA;ADsLA;EACA,eAAA;EACA,4BAAA;ACpLA;ADuLA;EACA,iBAAA;ACrLA;ADsLA;EACA,eAAA;EACA,4BAAA;EACA,eAAA;ACpLA;ADsLA;EACA,eAAA;EACA,4BAAA;ACpLA;ADwLA;EACA,eAAA;EACA,4BAAA;EACA,iBAAA;ACtLA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <ele-modal :value=\"innerValue\" :buttonGroupMeta=\"buttonGroupMeta\" @cancel=\"onCancel\" @handleClose=\"handleClose\" :title=\"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-if=\"(!isFileEmpty && mode === 'async')\" 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 <div v-if=\"!isFileEmpty && mode === 'sync'\" class=\"ele-modal-import__errors\">\r\n <template v-if=\"statusList.length > 0\">\r\n <div v-for=\"(value, idx) in statusList\" :key=\"idx\">\r\n {{ value.message }}\r\n </div>\r\n </template>\r\n <template v-else>\r\n <ele-alert :type=\"hooks.uploaded.messages.type\" :message=\"hooks.uploaded.messages.message\"></ele-alert>\r\n </template>\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport { type, net } from '@idooel/shared'\r\nimport { parseFieldMap } from '../../../utils'\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 title: {\r\n type: String,\r\n default: '导入'\r\n },\r\n mode: {\r\n type: String,\r\n default: 'async'\r\n },\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n hooks: {\r\n type: Object,\r\n default: () => ({\r\n download: {},\r\n uploaded: {\r\n url: '',\r\n requestType: 'POST',\r\n params: {},\r\n fieldMap: {},\r\n messages: {\r\n type: 'success',\r\n message: '文件上传成功'\r\n }\r\n }\r\n })\r\n },\r\n errorList: {\r\n type: Array,\r\n default: () => []\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 innerErrorList: []\r\n }\r\n },\r\n computed: {\r\n isFileEmpty () {\r\n return type.isEmpty(this.file)\r\n },\r\n statusList () {\r\n // 0 default\r\n if (this.errorList.length > 0) {\r\n return this.buildErrorList(this.errorList)\r\n }\r\n return this.innerErrorList\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 execFieldMap (fieldMap = {}, payloads = {}) {\r\n const ctx = { _route: this.$route.query, route: this.$route, ...payloads }\r\n return parseFieldMap(fieldMap, ctx)\r\n },\r\n buildErrorList (dataSource = []) {\r\n const ret = dataSource.map(item => {\r\n if (type.isStr(item)) {\r\n return {\r\n statusCode: '0',\r\n message: item\r\n }\r\n } else {\r\n // TODO\r\n console.warn('not support error list type', item)\r\n }\r\n })\r\n return ret\r\n },\r\n uploadFileSuccess (props) {\r\n const { uploaded } = this.hooks\r\n const { url, requestType = 'POST', params = {}, fieldMap = {} } = uploaded\r\n if (!url) {\r\n return this.emitEvent({ action: 'uploaded', file: props })\r\n }\r\n const payloads = this.execFieldMap(fieldMap, { file: props.file })\r\n const formData = new FormData()\r\n Object.keys(payloads).forEach(key => {\r\n formData.append(key, payloads[key])\r\n })\r\n net[requestType.toLowerCase()](url, formData , { headers: { 'Content-Type': 'multipart/form-data' } }).then(resp => {\r\n const { code, data } = resp\r\n if (code !== '2000') {\r\n this.innerErrorList = this.buildErrorList(data || [])\r\n } else {\r\n this.innerErrorList = []\r\n }\r\n })\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 });
|
|
15203
15615
|
|
|
15204
15616
|
};
|
|
15205
15617
|
/* scoped */
|
|
15206
|
-
const __vue_scope_id__$3 = "data-v-
|
|
15618
|
+
const __vue_scope_id__$3 = "data-v-6c64c223";
|
|
15207
15619
|
/* module identifier */
|
|
15208
15620
|
const __vue_module_identifier__$3 = undefined;
|
|
15209
15621
|
/* functional template */
|
|
@@ -15344,11 +15756,11 @@
|
|
|
15344
15756
|
/* style */
|
|
15345
15757
|
const __vue_inject_styles__$2 = function (inject) {
|
|
15346
15758
|
if (!inject) return
|
|
15347
|
-
inject("data-v-
|
|
15759
|
+
inject("data-v-189b0d56_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
15348
15760
|
|
|
15349
15761
|
};
|
|
15350
15762
|
/* scoped */
|
|
15351
|
-
const __vue_scope_id__$2 = "data-v-
|
|
15763
|
+
const __vue_scope_id__$2 = "data-v-189b0d56";
|
|
15352
15764
|
/* module identifier */
|
|
15353
15765
|
const __vue_module_identifier__$2 = undefined;
|
|
15354
15766
|
/* functional template */
|
|
@@ -15557,12 +15969,12 @@
|
|
|
15557
15969
|
/* style */
|
|
15558
15970
|
const __vue_inject_styles__$1 = function (inject) {
|
|
15559
15971
|
if (!inject) return
|
|
15560
|
-
inject("data-v-
|
|
15561
|
-
,inject("data-v-
|
|
15972
|
+
inject("data-v-e7783588_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 })
|
|
15973
|
+
,inject("data-v-e7783588_1", { source: ".ele-modal-fsm__display[data-v-e7783588] {\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-e7783588], .ele-modal-fsm__display .fms-display__action[data-v-e7783588] {\n font-weight: bold;\n color: var(--idoole-black-088);\n}\n.ele-modal-fsm__display .fms-display__name[data-v-e7783588]::before, .ele-modal-fsm__display .fms-display__action[data-v-e7783588]::before {\n content: \"\";\n margin-left: 4px;\n}\n.ele-modal-fsm__display .fms-display__name[data-v-e7783588]::after, .ele-modal-fsm__display .fms-display__action[data-v-e7783588]::after {\n content: \"\";\n margin-right: 4px;\n}\n.ele-modal-fsm__display .title-info[data-v-e7783588] {\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-e7783588]::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-e7783588]::before {\n background: var(--idoole-success-06);\n}\n.ele-modal-fsm__display .title-info.warning[data-v-e7783588]::before {\n background: var(--idoole-warning-06);\n}\n.ele-modal-fsm__display .title-info.error[data-v-e7783588]::before {\n background: var(--idoole-error-06);\n}\n.ele-modal-fsm__opinion-wrapper[data-v-e7783588] {\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-e7783588] {\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-e7783588] {\n color: var(--idoole-black-088);\n font-weight: bold;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
15562
15974
|
|
|
15563
15975
|
};
|
|
15564
15976
|
/* scoped */
|
|
15565
|
-
const __vue_scope_id__$1 = "data-v-
|
|
15977
|
+
const __vue_scope_id__$1 = "data-v-e7783588";
|
|
15566
15978
|
/* module identifier */
|
|
15567
15979
|
const __vue_module_identifier__$1 = undefined;
|
|
15568
15980
|
/* functional template */
|
|
@@ -15720,11 +16132,11 @@
|
|
|
15720
16132
|
/* style */
|
|
15721
16133
|
const __vue_inject_styles__ = function (inject) {
|
|
15722
16134
|
if (!inject) return
|
|
15723
|
-
inject("data-v-
|
|
16135
|
+
inject("data-v-2a1ed87a_0", { source: ".g-form__tabs[data-v-2a1ed87a] {\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-2a1ed87a] {\n display: flex;\n flex-direction: row;\n}\n.g-form__tabs .g-form__wrapper.disabled .g-form__item[data-v-2a1ed87a] {\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-2a1ed87a] {\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-2a1ed87a] {\n display: flex;\n}\n.g-form__tabs .g-form__wrapper .g-form__item[data-v-2a1ed87a]: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-2a1ed87a] {\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-2a1ed87a] {\n border-left: 1px solid #409eff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\code\\OnlineStudy-Base\\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 });
|
|
15724
16136
|
|
|
15725
16137
|
};
|
|
15726
16138
|
/* scoped */
|
|
15727
|
-
const __vue_scope_id__ = "data-v-
|
|
16139
|
+
const __vue_scope_id__ = "data-v-2a1ed87a";
|
|
15728
16140
|
/* module identifier */
|
|
15729
16141
|
const __vue_module_identifier__ = undefined;
|
|
15730
16142
|
/* functional template */
|
|
@@ -15750,19 +16162,19 @@
|
|
|
15750
16162
|
|
|
15751
16163
|
__vue_component__.install = Vue => Vue.component(__vue_component__.name, __vue_component__);
|
|
15752
16164
|
|
|
15753
|
-
__vue_component__$
|
|
15754
|
-
|
|
15755
|
-
__vue_component__$y.install = Vue => Vue.component(__vue_component__$y.name, __vue_component__$y);
|
|
16165
|
+
__vue_component__$B.install = Vue => Vue.component(__vue_component__$B.name, __vue_component__$B);
|
|
15756
16166
|
|
|
15757
16167
|
__vue_component__$z.install = Vue => Vue.component(__vue_component__$z.name, __vue_component__$z);
|
|
15758
16168
|
|
|
15759
|
-
__vue_component__$
|
|
16169
|
+
__vue_component__$A.install = Vue => Vue.component(__vue_component__$A.name, __vue_component__$A);
|
|
16170
|
+
|
|
16171
|
+
__vue_component__$y.install = Vue => Vue.component(__vue_component__$y.name, __vue_component__$y);
|
|
15760
16172
|
|
|
15761
16173
|
// 初始化全局数据池(必须在其他组件之前)
|
|
15762
|
-
const compositeComponents = [__vue_component__$a, __vue_component__$b, __vue_component__$9, __vue_component__$8, __vue_component__$
|
|
16174
|
+
const compositeComponents = [__vue_component__$a, __vue_component__$b, __vue_component__$9, __vue_component__$8, __vue_component__$i, __vue_component__$7, __vue_component__$6, __vue_component__$5, __vue_component__$4];
|
|
15763
16175
|
const businessComponents = [__vue_component__$3, __vue_component__$2, __vue_component__$1, __vue_component__];
|
|
15764
|
-
const models = [__vue_component__$
|
|
15765
|
-
const components = [__vue_component__$H, __vue_component__$G, __vue_component__$F, __vue_component__$
|
|
16176
|
+
const models = [__vue_component__$B, __vue_component__$z, __vue_component__$A, __vue_component__$y];
|
|
16177
|
+
const components = [__vue_component__$I, __vue_component__$H, __vue_component__$G, __vue_component__$F, __vue_component__$D, __vue_component__$C, __vue_component__$x, __vue_component__$w, __vue_component__$v, __vue_component__$u, __vue_component__$t, __vue_component__$s, __vue_component__$r, __vue_component__$q, __vue_component__$p, __vue_component__$o, __vue_component__$n, __vue_component__$m, __vue_component__$l, __vue_component__$k, __vue_component__$j, __vue_component__$h, __vue_component__$g, __vue_component__$f, __vue_component__$e, __vue_component__$d, ...compositeComponents, ...businessComponents, ...models];
|
|
15766
16178
|
const install = Vue => {
|
|
15767
16179
|
if (install.installed) return;
|
|
15768
16180
|
install.installed = true;
|
|
@@ -15771,48 +16183,49 @@
|
|
|
15771
16183
|
});
|
|
15772
16184
|
};
|
|
15773
16185
|
|
|
15774
|
-
exports.EleAlert = __vue_component__$
|
|
15775
|
-
exports.EleBatchExport = __vue_component__$
|
|
15776
|
-
exports.EleButton = __vue_component__$
|
|
16186
|
+
exports.EleAlert = __vue_component__$v;
|
|
16187
|
+
exports.EleBatchExport = __vue_component__$n;
|
|
16188
|
+
exports.EleButton = __vue_component__$I;
|
|
15777
16189
|
exports.EleButtonGroup = __vue_component__$a;
|
|
15778
|
-
exports.EleCheckbox = __vue_component__$
|
|
15779
|
-
exports.EleDate = __vue_component__$
|
|
15780
|
-
exports.EleDateRange = __vue_component__$
|
|
15781
|
-
exports.EleForm = __vue_component__$
|
|
15782
|
-
exports.EleFormGroupModel = __vue_component__$
|
|
16190
|
+
exports.EleCheckbox = __vue_component__$p;
|
|
16191
|
+
exports.EleDate = __vue_component__$H;
|
|
16192
|
+
exports.EleDateRange = __vue_component__$m;
|
|
16193
|
+
exports.EleForm = __vue_component__$w;
|
|
16194
|
+
exports.EleFormGroupModel = __vue_component__$A;
|
|
15783
16195
|
exports.EleFormImgCrop = __vue_component__$5;
|
|
15784
|
-
exports.EleFormPageModel = __vue_component__$
|
|
15785
|
-
exports.EleIcon = __vue_component__$
|
|
15786
|
-
exports.EleInput = __vue_component__$
|
|
15787
|
-
exports.EleInputNumber = __vue_component__$
|
|
15788
|
-
exports.EleLoading = __vue_component__$
|
|
15789
|
-
exports.EleModal = __vue_component__$
|
|
16196
|
+
exports.EleFormPageModel = __vue_component__$z;
|
|
16197
|
+
exports.EleIcon = __vue_component__$s;
|
|
16198
|
+
exports.EleInput = __vue_component__$G;
|
|
16199
|
+
exports.EleInputNumber = __vue_component__$r;
|
|
16200
|
+
exports.EleLoading = __vue_component__$f;
|
|
16201
|
+
exports.EleModal = __vue_component__$q;
|
|
15790
16202
|
exports.EleModalConfirm = __vue_component__$7;
|
|
15791
16203
|
exports.EleModalForm = __vue_component__$9;
|
|
15792
16204
|
exports.EleModalFsm = __vue_component__$1;
|
|
15793
|
-
exports.EleModalImgCrop = __vue_component__$
|
|
16205
|
+
exports.EleModalImgCrop = __vue_component__$i;
|
|
15794
16206
|
exports.EleModalImport = __vue_component__$3;
|
|
15795
16207
|
exports.EleModalTable = __vue_component__$6;
|
|
15796
16208
|
exports.EleModalTimeline = __vue_component__$2;
|
|
15797
16209
|
exports.EleModalTree = __vue_component__$8;
|
|
15798
|
-
exports.
|
|
16210
|
+
exports.ElePagination = __vue_component__$d;
|
|
16211
|
+
exports.EleRadio = __vue_component__$o;
|
|
15799
16212
|
exports.EleSearchArea = __vue_component__$b;
|
|
15800
|
-
exports.EleSelect = __vue_component__$
|
|
15801
|
-
exports.EleSelectEntity = __vue_component__$
|
|
16213
|
+
exports.EleSelect = __vue_component__$F;
|
|
16214
|
+
exports.EleSelectEntity = __vue_component__$t;
|
|
15802
16215
|
exports.EleSelectEntityModalTable = __vue_component__$4;
|
|
15803
|
-
exports.EleStepModel = __vue_component__$
|
|
15804
|
-
exports.EleTable = __vue_component__$
|
|
15805
|
-
exports.EleTabs = __vue_component__$
|
|
16216
|
+
exports.EleStepModel = __vue_component__$y;
|
|
16217
|
+
exports.EleTable = __vue_component__$D;
|
|
16218
|
+
exports.EleTabs = __vue_component__$j;
|
|
15806
16219
|
exports.EleTabsSubCenter = __vue_component__;
|
|
15807
|
-
exports.EleText = __vue_component__$
|
|
15808
|
-
exports.EleTextEditor = __vue_component__$
|
|
15809
|
-
exports.EleTextarea = __vue_component__$
|
|
15810
|
-
exports.EleTimeline = __vue_component__$
|
|
15811
|
-
exports.EleTpl = __vue_component__$
|
|
15812
|
-
exports.EleTree = __vue_component__$
|
|
15813
|
-
exports.EleTreeSelect = __vue_component__$
|
|
15814
|
-
exports.EleTreeTableModel = __vue_component__$
|
|
15815
|
-
exports.EleUpload = __vue_component__$
|
|
16220
|
+
exports.EleText = __vue_component__$k;
|
|
16221
|
+
exports.EleTextEditor = __vue_component__$h;
|
|
16222
|
+
exports.EleTextarea = __vue_component__$g;
|
|
16223
|
+
exports.EleTimeline = __vue_component__$l;
|
|
16224
|
+
exports.EleTpl = __vue_component__$x;
|
|
16225
|
+
exports.EleTree = __vue_component__$C;
|
|
16226
|
+
exports.EleTreeSelect = __vue_component__$e;
|
|
16227
|
+
exports.EleTreeTableModel = __vue_component__$B;
|
|
16228
|
+
exports.EleUpload = __vue_component__$u;
|
|
15816
16229
|
exports["default"] = install;
|
|
15817
16230
|
exports.models = models;
|
|
15818
16231
|
|