@idooel/components 0.0.2-beta.18 → 0.0.2-beta.19
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.
|
@@ -1216,11 +1216,11 @@ __vue_render__$G._withStripped = true;
|
|
|
1216
1216
|
/* style */
|
|
1217
1217
|
const __vue_inject_styles__$G = function (inject) {
|
|
1218
1218
|
if (!inject) return
|
|
1219
|
-
inject("data-v-
|
|
1219
|
+
inject("data-v-1d79ddf9_0", { source: ".ele-date__wrapper[data-v-1d79ddf9] {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\date\\src\\index.vue","index.vue"],"names":[],"mappings":"AA6GA;EACA,WAAA;AC5GA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-date__wrapper\">\r\n <a-date-picker \r\n style=\"width: 100%;\" \r\n :mode=\"modeValue\"\r\n v-if=\"modeValue == 'year'\"\r\n :open=\"open\"\r\n :disabled=\"disabled\"\r\n :value=\"value\"\r\n :placeholder=\"placeholder\"\r\n :show-time=\"showTime\"\r\n :show-today=\"showToday\"\r\n :valueFormat=\"innerValueFormat\"\r\n @panelChange=\"onPanelChange\"\r\n @openChange=\"openChange\"\r\n @change=\"onChange\"\r\n :format=\"format\">\r\n </a-date-picker>\r\n <a-date-picker \r\n v-else\r\n style=\"width: 100%;\"\r\n :placeholder=\"placeholder\"\r\n :open=\"open\"\r\n :disabled=\"disabled\"\r\n :value=\"value\"\r\n :show-time=\"showTime\"\r\n :show-today=\"showToday\"\r\n :valueFormat=\"innerValueFormat\"\r\n @panelChange=\"onPanelChange\"\r\n @openChange=\"openChange\"\r\n @change=\"onChange\"\r\n :format=\"format\">\r\n </a-date-picker>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport moment from 'moment'\r\nexport default {\r\n name: 'ele-date',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Object]\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n format: {\r\n type: String,\r\n default: 'YYYY/MM/DD'\r\n },\r\n mode: {\r\n type: String\r\n },\r\n valueFormat: {\r\n type: String\r\n },\r\n showTime: {\r\n type: [Boolean, Object],\r\n default: true\r\n },\r\n showToday: {\r\n type: Boolean,\r\n default: true\r\n },\r\n placeholder: {\r\n type: String,\r\n default: '请选择日期'\r\n }\r\n },\r\n data () {\r\n return {\r\n open: false\r\n }\r\n },\r\n computed: {\r\n innerValueFormat () {\r\n if (this.valueFormat) return this.valueFormat\r\n return this.format\r\n },\r\n modeValue () {\r\n if (this.mode) return this.mode\r\n if (this.format === 'YYYY') return 'year'\r\n return 'date'\r\n }\r\n },\r\n methods: {\r\n onChange (_, dataString) {\r\n this.$emit('input', dataString)\r\n this.$emit('change', dataString)\r\n },\r\n onPanelChange (value, mode) {\r\n if (this.modeValue !== 'year') return\r\n this.$emit('input', moment(value).format(this.format))\r\n this.$emit('change', moment(value).format(this.format))\r\n this.open = false\r\n },\r\n openChange (open) {\r\n this.open = open\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ele-date__wrapper {\r\n width: 100%;\r\n}\r\n</style>",".ele-date__wrapper {\n width: 100%;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
1220
1220
|
|
|
1221
1221
|
};
|
|
1222
1222
|
/* scoped */
|
|
1223
|
-
const __vue_scope_id__$G = "data-v-
|
|
1223
|
+
const __vue_scope_id__$G = "data-v-1d79ddf9";
|
|
1224
1224
|
/* module identifier */
|
|
1225
1225
|
const __vue_module_identifier__$G = undefined;
|
|
1226
1226
|
/* functional template */
|
|
@@ -1301,11 +1301,11 @@ __vue_render__$F._withStripped = true;
|
|
|
1301
1301
|
/* style */
|
|
1302
1302
|
const __vue_inject_styles__$F = function (inject) {
|
|
1303
1303
|
if (!inject) return
|
|
1304
|
-
inject("data-v-
|
|
1304
|
+
inject("data-v-22b90b54_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
1305
1305
|
|
|
1306
1306
|
};
|
|
1307
1307
|
/* scoped */
|
|
1308
|
-
const __vue_scope_id__$F = "data-v-
|
|
1308
|
+
const __vue_scope_id__$F = "data-v-22b90b54";
|
|
1309
1309
|
/* module identifier */
|
|
1310
1310
|
const __vue_module_identifier__$F = undefined;
|
|
1311
1311
|
/* functional template */
|
|
@@ -1460,11 +1460,11 @@ __vue_render__$E._withStripped = true;
|
|
|
1460
1460
|
/* style */
|
|
1461
1461
|
const __vue_inject_styles__$E = function (inject) {
|
|
1462
1462
|
if (!inject) return
|
|
1463
|
-
inject("data-v-
|
|
1463
|
+
inject("data-v-d3a1fb9e_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
1464
1464
|
|
|
1465
1465
|
};
|
|
1466
1466
|
/* scoped */
|
|
1467
|
-
const __vue_scope_id__$E = "data-v-
|
|
1467
|
+
const __vue_scope_id__$E = "data-v-d3a1fb9e";
|
|
1468
1468
|
/* module identifier */
|
|
1469
1469
|
const __vue_module_identifier__$E = undefined;
|
|
1470
1470
|
/* functional template */
|
|
@@ -2058,11 +2058,11 @@ __vue_render__$D._withStripped = true;
|
|
|
2058
2058
|
/* style */
|
|
2059
2059
|
const __vue_inject_styles__$D = function (inject) {
|
|
2060
2060
|
if (!inject) return
|
|
2061
|
-
inject("data-v-
|
|
2061
|
+
inject("data-v-526e67ca_0", { source: ".g-table__action[data-v-526e67ca] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-526e67ca] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-526e67ca]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\table\\src\\action.vue","action.vue"],"names":[],"mappings":"AA+JA;EACA,aAAA;EACA,mBAAA;AC9JA;AD+JA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;AC7JA;AD8JA;EACA,cAAA;AC5JA;;AAEA,qCAAqC","file":"action.vue","sourcesContent":["<template>\r\n <div class=\"g-table__action\">\r\n <div class=\"table-action__item\" v-for=\"(item, idx) in execOperationExpression(dataSource)\" :key=\"idx\">\r\n <template v-if=\"item.type == 'text'\">\r\n <span @click=\"handleClickText(item)\">{{ item.label }}</span>\r\n </template>\r\n <template v-else-if=\"item.type == 'confirm'\">\r\n <div>\r\n <a-popconfirm :title=\"item.message\" @confirm=\"handleClickConfirm(item)\">\r\n {{ item.label }}\r\n </a-popconfirm>\r\n </div>\r\n </template>\r\n <template v-else-if=\"item.type == 'dropdown'\">\r\n <a-dropdown>\r\n <a-menu slot=\"overlay\" @click=\"handleDropdownClick\">\r\n <a-menu-item :key=\"`${item.key || ''}${menuKeyDelimiter}${opt.value || ''}`\" v-for=\"opt in execOperationExpression(item.optionList)\">\r\n <template v-if=\"opt.type == 'confirm'\">\r\n <a-popconfirm :title=\"opt.message\" @confirm=\"handleClickConfirm(opt)\">\r\n {{ opt.label }}\r\n </a-popconfirm>\r\n </template>\r\n <template v-else-if=\"opt.type == 'modal-confirm'\">\r\n <div style=\"width: 100%\" @click=\"handleClickModalConfirm(opt)\">{{ opt.label }}</div>\r\n <ele-modal-confirm v-bind=\"opt.modalConfirm\" v-on=\"$listeners\" v-model=\"showModalConfirm\"></ele-modal-confirm>\r\n </template>\r\n <template v-else>\r\n {{ opt.label }}\r\n </template>\r\n </a-menu-item>\r\n </a-menu>\r\n <span>{{ item.label }}</span>\r\n </a-dropdown>\r\n </template>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v5 as uuidv5 } from 'uuid'\r\nimport { type, route } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nimport { CONTEXT } from '../../utils'\r\nconst MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002'\r\nexport default {\r\n props: {\r\n record: {\r\n type: Object\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n inject: {\r\n requestTreeData: {\r\n default: void 0\r\n },\r\n requestTableData: {\r\n default: void 0\r\n }\r\n },\r\n data() {\r\n return {\r\n showModalConfirm: false\r\n }\r\n },\r\n provide () {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n exposed: this.builtInMethods,\r\n ...this.record\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n menuKeyDelimiter () {\r\n return uuidv5('_', MENU_KEY_NAMESPACE)\r\n },\r\n builtInMethods () {\r\n return { \r\n requestTreeData: this.requestTreeData, \r\n requestTableData: this.requestTableData,\r\n closeModalConfirm: this.closeModalConfirm,\r\n showModalConfirm: this.handleClickModalConfirm,\r\n currentRowData: this.record\r\n }\r\n }\r\n },\r\n methods: {\r\n closeModalConfirm () {\r\n this.showModalConfirm = false\r\n },\r\n handleClickModalConfirm () {\r\n this.showModalConfirm = true\r\n },\r\n execOperationExpression (dataSource = []) {\r\n const ret = dataSource.map(item => {\r\n const { show } = item\r\n if (type.isUndefined(show)) {\r\n return item\r\n } else if (type.isBool(show)) {\r\n if (show) return item\r\n } else if (type.isStr(show)) {\r\n const parseRet = parse(show, { \r\n ...this.record, \r\n _route: route.searchToQueryParams(window.location.search) \r\n })\r\n if (parseRet) return item\r\n }\r\n }).filter(item => item)\r\n return ret\r\n },\r\n handleClickConfirm (props) {\r\n //TODO generate event by special rule\r\n const { eventName, value, key } = props\r\n this.$emit(eventName || key, { \r\n key: value || key, \r\n record: this.record,\r\n builtInMethods: this.builtInMethods,\r\n exposed: this.builtInMethods\r\n })\r\n },\r\n handleDropdownClick (props) {\r\n const { key } = props\r\n const [parent, child] = key.split(this.menuKeyDelimiter)\r\n if (!parent || !child) {\r\n throw new Error('key is required')\r\n }\r\n const currentDropdown = this.dataSource.find(item => item.key === parent)\r\n const currentClickTarget = currentDropdown.optionList.find(item => item.value === child)\r\n const { eventName, type, key: currentKey } = currentClickTarget\r\n //TODO generate event by special rule\r\n if (type === 'confirm' || type === 'modal-confirm') return\r\n this.$emit(eventName || currentKey, { \r\n key: child, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods,\r\n exposed: this.builtInMethods\r\n })\r\n },\r\n handleClickText (props) {\r\n const { eventName, key } = props\r\n this.$emit(eventName || key, { \r\n key, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods,\r\n exposed: this.builtInMethods\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__action {\r\n display: flex;\r\n flex-direction: row;\r\n .table-action__item {\r\n font-size: 14px;\r\n color: #409EFF;\r\n margin-left: 16px;\r\n cursor: pointer;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
|
|
2062
2062
|
|
|
2063
2063
|
};
|
|
2064
2064
|
/* scoped */
|
|
2065
|
-
const __vue_scope_id__$D = "data-v-
|
|
2065
|
+
const __vue_scope_id__$D = "data-v-526e67ca";
|
|
2066
2066
|
/* module identifier */
|
|
2067
2067
|
const __vue_module_identifier__$D = undefined;
|
|
2068
2068
|
/* functional template */
|
|
@@ -2362,11 +2362,11 @@ __vue_render__$C._withStripped = true;
|
|
|
2362
2362
|
/* style */
|
|
2363
2363
|
const __vue_inject_styles__$C = function (inject) {
|
|
2364
2364
|
if (!inject) return
|
|
2365
|
-
inject("data-v-16735042_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-16735042] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n}\n.g-table__wrapper[data-v-16735042] .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-16735042] .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-16735042] .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-16735042] .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-16735042] {\n /* 确保表体能够正常纵向滚动 */\n}\n.g-table__wrapper[data-v-16735042] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-16735042] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-16735042] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-16735042] .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-16735042] .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-16735042] .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-16735042] .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-16735042] .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-16735042] .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-16735042] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-16735042] .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper[data-v-16735042] {\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper .g-table__pagination[data-v-16735042] {\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-16735042] {\n /* 空数据状态顶部显示 */\n}\n.g-table__wrapper .g-table__no-data[data-v-16735042] {\n position: relative;\n}\n.g-table__wrapper .g-table__no-data[data-v-16735042] .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;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 });
|
|
2365
|
+
inject("data-v-3d0d3edf_0", { source: "@charset \"UTF-8\";\n.g-table__wrapper[data-v-3d0d3edf] {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3d0d3edf] {\n /* 确保表体能够正常纵向滚动 */\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover td {\n background-color: var(--idooel-row-hover-color);\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-tbody .g-table__row--odd td {\n background-color: var(--idooel-row-odd-color);\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper[data-v-3d0d3edf] .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper[data-v-3d0d3edf] {\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper .g-table__pagination[data-v-3d0d3edf] {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n}\n.g-table__wrapper[data-v-3d0d3edf] {\n /* 空数据状态顶部显示 */\n}\n.g-table__wrapper .g-table__no-data[data-v-3d0d3edf] {\n position: relative;\n}\n.g-table__wrapper .g-table__no-data[data-v-3d0d3edf] .ant-table-placeholder {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -40%);\n width: 100%;\n height: 100%;\n text-align: center;\n color: #999;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n overflow: hidden;\n border: unset;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue","C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\table\\src\\index.vue"],"names":[],"mappings":"AAAA,gBAAgB;ACyNhB;EACA,8BAAA;EACA,aAAA;EACA,sBAAA;EACA,gBAAA;EAEA,sBAAA;ADxNA;ACyNA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADvNA;AC0NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADxNA;AC2NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;ADzNA;AC4NA;EACA,cAAA;EACA,aAAA;EACA,aAAA;EACA,sBAAA;AD1NA;AC0LA;EAmCA,iBAAA;AD1NA;AC2NA;EACA,cAAA;EACA,aAAA;EACA,gBAAA;ADzNA;AC4NA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AD1NA;AC6NA;EACA,cAAA;EACA,gBAAA;AD3NA;ACiOA;EACA,+CAAA;AD/NA;ACiOA;EACA,0DAAA;AD/NA;ACiOA;EACA,0DAAA;AD/NA;ACkOA;EACA,6CAAA;ADhOA;ACkOA;EACA,wDAAA;ADhOA;ACkOA;EACA,wDAAA;ADhOA;ACoOA;EACA,0CAAA;ADlOA;ACsOA;EACA,cAAA;EACA,yBAAA;EACA,mBAAA;EACA,wBAAA;ADpOA;AC8IA;EAyFA,qBAAA;ADpOA;ACqOA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;ADnOA;ACgIA;EAsGA,cAAA;ADnOA;ACoOA;EACA,kBAAA;ADlOA;ACmOA;EACA,kBAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,WAAA;EACA,eAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,aAAA;ADjOA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["@charset \"UTF-8\";\n.g-table__wrapper {\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* 表格区域占满剩余空间,启用纵向滚动 */\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-spin-nested-loading {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-spin-container {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper {\n /* 确保表体能够正常纵向滚动 */\n}\n.g-table__wrapper ::v-deep .ant-table-content {\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-table-scroll {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.g-table__wrapper ::v-deep .ant-table-header {\n flex: 0 0 auto;\n overflow: hidden;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover td {\n background-color: var(--idooel-row-hover-color);\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-selection-column {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd.ant-table-row-hover .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-hover-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd td {\n background-color: var(--idooel-row-odd-color);\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-selection-column {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-tbody .g-table__row--odd .ant-table-row-cell-break-word {\n background-color: var(--idooel-row-odd-color) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-fixed .ant-table-thead {\n background: rgba(0, 0, 0, 0.03) !important;\n}\n.g-table__wrapper ::v-deep .ant-table-body {\n flex: 1 1 auto;\n overflow: auto !important;\n /* 确保滚动条稳定,避免列宽抖动 */\n scrollbar-gutter: stable;\n}\n.g-table__wrapper {\n /* 分页区域固定在底部,不被挤出视口 */\n}\n.g-table__wrapper .g-table__pagination {\n flex: 0 0 auto;\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n background: #fff;\n z-index: 999;\n}\n.g-table__wrapper {\n /* 空数据状态顶部显示 */\n}\n.g-table__wrapper .g-table__no-data {\n position: relative;\n}\n.g-table__wrapper .g-table__no-data ::v-deep .ant-table-placeholder {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -40%);\n width: 100%;\n height: 100%;\n text-align: center;\n color: #999;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n overflow: hidden;\n border: unset;\n}\n\n/*# sourceMappingURL=index.vue.map */","<template>\r\n <div class=\"g-table__wrapper\" :style=\"wrapperStyle\" :class=\"{ 'g-table--no-scroll-y': !needScrollY }\">\r\n <a-table\r\n :bordered=\"bordered\"\r\n :class=\"[isNoData && 'g-table__no-data']\"\r\n :pagination=\"false\"\r\n :loading=\"loading\"\r\n size=\"middle\"\r\n :columns=\"innerColumns\"\r\n :row-selection=\"rowSelection\"\r\n :row-class-name=\"setRowClassName\"\r\n :data-source=\"dataSource\"\r\n :scroll=\"getScroll\">\r\n <template slot=\"action\" slot-scope=\"record\">\r\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\r\n </template>\r\n </a-table>\r\n <div class=\"g-table__pagination\">\r\n <a-pagination\r\n :show-total=\"all => `共 ${all} 条数据`\"\r\n show-size-changer \r\n show-quick-jumper\r\n :pageSize=\"innerPageSize\"\r\n :current=\"innerCurrentPage\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n @change=\"onChangePagination\"\r\n @showSizeChange=\"onShowSizeChange\"\r\n :total=\"total\">\r\n </a-pagination>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Actions from './action.vue'\r\nexport default {\r\n name: 'ele-table',\r\n components: {\r\n Actions\r\n },\r\n props: {\r\n // ant table wrapper\r\n height: {\r\n type: Number\r\n },\r\n width: {\r\n type: Number\r\n },\r\n x: {\r\n type: Number,\r\n default: 1200\r\n },\r\n y: {\r\n type: Number,\r\n default: 200\r\n },\r\n scroll: {\r\n type: Object\r\n },\r\n rowSelection: {\r\n type: Object\r\n },\r\n actions: {\r\n type: Array,\r\n default: () => []\r\n },\r\n total: {\r\n type: Number,\r\n default: 0\r\n },\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n columns: {\r\n type: Array,\r\n default: () => []\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n pageSize: {\r\n type: Number,\r\n default: 10\r\n },\r\n pageSizeOptions: {\r\n type: Array,\r\n default: () => ['10', '20', '30', '40']\r\n },\r\n bordered: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n tableHeaderHeight: 0,\r\n paginationHeight: 0,\r\n innerPageSize: 10,\r\n innerCurrentPage: 1,\r\n tableContentHeight: 0,\r\n obs: []\r\n }\r\n },\r\n computed: {\r\n wrapperStyle () {\r\n // 外层容器样式:确保分页始终可见,表格充满剩余空间\r\n if (!this.height) return {}\r\n return { height: `${this.height}px` }\r\n },\r\n needScrollY () {\r\n // 判断是否需要 y 轴滚动:基于数据行数与可用高度预估\r\n if (!this.height) return false\r\n \r\n const availableHeight = this.getScrollHeightByHeight\r\n if (availableHeight <= 0) return false\r\n \r\n // 预估每行高度(包含边框),antd 默认约 54px\r\n const estimatedRowHeight = 54\r\n const estimatedTableHeight = this.dataSource.length * estimatedRowHeight\r\n \r\n return estimatedTableHeight > availableHeight\r\n },\r\n innerColumns () {\r\n return this.columns.filter(col => !Object.keys(col).includes('multiple'))\r\n },\r\n isNoData () {\r\n return !this.dataSource.length\r\n },\r\n getScrollHeightByHeight () {\r\n // 始终返回可用的剩余高度,让表格内容不足时也能占满容器\r\n return this.height - this.tableHeaderHeight - this.paginationHeight\r\n },\r\n isFlexColumn () {\r\n return this.columns.every(col => !col.width)\r\n },\r\n getScroll () {\r\n if (this.scroll) {\r\n return this.scroll\r\n } else {\r\n const baseX = this.isFlexColumn ? 0 : (this.width > this.x ? 0 : this.x)\r\n if (this.height) {\r\n // 计算表体可用高度\r\n const availableHeight = this.tableHeaderHeight && this.paginationHeight \r\n ? this.getScrollHeightByHeight \r\n : this.height - 100 // 预估值,给表头和分页留空间\r\n \r\n if (availableHeight > 50) { // 确保有足够的最小高度\r\n console.log('Table scroll config:', { x: baseX, y: availableHeight, height: this.height, headerHeight: this.tableHeaderHeight, paginationHeight: this.paginationHeight })\r\n return { x: baseX, y: availableHeight }\r\n }\r\n }\r\n return { x: baseX }\r\n }\r\n }\r\n },\r\n watch: {\r\n pageSize: {\r\n handler (pageSize) {\r\n this.innerPageSize = pageSize\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n onShowSizeChange (current, pageSize) {\r\n this.innerCurrentPage = current\r\n this.innerPageSize = pageSize\r\n this.$emit('change-page', current, pageSize)\r\n },\r\n setPaginationHeight () {\r\n this.$nextTick(() => {\r\n const { height } = document.querySelector('.g-table__pagination').getBoundingClientRect()\r\n this.paginationHeight = height\r\n })\r\n },\r\n setTableHeaderHeight () {\r\n this.$nextTick(() => {\r\n const el = document.querySelector('.ant-table-header')\r\n if (!el) return\r\n const { height } = el.getBoundingClientRect()\r\n this.tableHeaderHeight = height\r\n })\r\n },\r\n setTableTbodyHeight () {\r\n // 简化:仅需要获取表头高度,不再依赖表体高度的动态监听\r\n this.$nextTick(() => {\r\n this.setTableHeaderHeight()\r\n })\r\n },\r\n setRowClassName (record, idx) {\r\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\r\n },\r\n onChangePagination (page, pageSize) {\r\n this.innerCurrentPage = page\r\n this.innerPageSize = pageSize\r\n this.$emit('change-page', page, pageSize)\r\n }\r\n },\r\n mounted() {\r\n this.$nextTick(() => {\r\n this.setPaginationHeight()\r\n setTimeout(() => {\r\n this.setTableTbodyHeight()\r\n // 再测一次分页高度,确保初次渲染完成后数值准确\r\n this.setPaginationHeight()\r\n }, 200)\r\n })\r\n },\r\n destroyed () {\r\n this.obs.forEach(ob => ob.disconnect())\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__wrapper {\r\n /* 外层采用列布局,确保分页始终可见,表格充满剩余空间 */\r\n display: flex;\r\n flex-direction: column;\r\n overflow: hidden;\r\n\r\n /* 表格区域占满剩余空间,启用纵向滚动 */\r\n ::v-deep .ant-table-wrapper {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-spin-nested-loading {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-spin-container {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-table {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n /* 确保表体能够正常纵向滚动 */\r\n ::v-deep .ant-table-content {\r\n flex: 1 1 auto;\r\n min-height: 0;\r\n overflow: hidden;\r\n }\r\n\r\n ::v-deep .ant-table-scroll {\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n ::v-deep .ant-table-header {\r\n flex: 0 0 auto;\r\n overflow: hidden;\r\n }\r\n ::v-deep .ant-table-fixed {\r\n .ant-table-tbody {\r\n .g-table__row--odd {\r\n &.ant-table-row-hover {\r\n td {\r\n background-color: var(--idooel-row-hover-color);\r\n }\r\n .ant-table-selection-column {\r\n background-color: var(--idooel-row-hover-color) !important;\r\n }\r\n .ant-table-row-cell-break-word {\r\n background-color: var(--idooel-row-hover-color) !important;\r\n }\r\n }\r\n td {\r\n background-color: var(--idooel-row-odd-color);\r\n }\r\n .ant-table-selection-column {\r\n background-color: var(--idooel-row-odd-color) !important;\r\n }\r\n .ant-table-row-cell-break-word {\r\n background-color: var(--idooel-row-odd-color) !important;\r\n }\r\n }\r\n }\r\n .ant-table-thead {\r\n background: rgba(0, 0, 0, 0.03) !important;\r\n }\r\n }\r\n\r\n ::v-deep .ant-table-body {\r\n flex: 1 1 auto;\r\n overflow: auto !important;\r\n /* 确保滚动条稳定,避免列宽抖动 */\r\n scrollbar-gutter: stable;\r\n }\r\n\r\n /* 分页区域固定在底部,不被挤出视口 */\r\n .g-table__pagination {\r\n flex: 0 0 auto;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: end;\r\n border-top: unset;\r\n padding-top: 8px;\r\n padding-bottom: 8px;\r\n background: #fff;\r\n z-index: 999;\r\n }\r\n\r\n /* 空数据状态顶部显示 */\r\n .g-table__no-data {\r\n position: relative;\r\n ::v-deep .ant-table-placeholder {\r\n position: absolute;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -40%);\r\n width: 100%;\r\n height: 100%;\r\n text-align: center;\r\n color: #999;\r\n font-size: 14px;\r\n font-weight: normal;\r\n line-height: 20px;\r\n overflow: hidden;\r\n border: unset;\r\n }\r\n }\r\n}\r\n</style>"]}, media: undefined });
|
|
2366
2366
|
|
|
2367
2367
|
};
|
|
2368
2368
|
/* scoped */
|
|
2369
|
-
const __vue_scope_id__$C = "data-v-
|
|
2369
|
+
const __vue_scope_id__$C = "data-v-3d0d3edf";
|
|
2370
2370
|
/* module identifier */
|
|
2371
2371
|
const __vue_module_identifier__$C = undefined;
|
|
2372
2372
|
/* functional template */
|
|
@@ -2566,11 +2566,11 @@ __vue_render__$B._withStripped = true;
|
|
|
2566
2566
|
/* style */
|
|
2567
2567
|
const __vue_inject_styles__$B = function (inject) {
|
|
2568
2568
|
if (!inject) return
|
|
2569
|
-
inject("data-v-
|
|
2569
|
+
inject("data-v-252ec372_0", { source: ".g-tree__wrapper[data-v-252ec372] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-252ec372] .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper[data-v-252ec372] .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\tree\\src\\index.vue","index.vue"],"names":[],"mappings":"AAwFA;EACA,gBAAA;ACvFA;ADyFA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;ACvFA;ADyFA;EACA,WAAA;ACvFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-tree__wrapper\">\r\n <a-tree\r\n v-if=\"innerTreeData.length\"\r\n :tree-data=\"innerTreeData\"\r\n :checkable=\"checkable\"\r\n @select=\"selectTreeNode\"\r\n @check=\"checkTreeNode\"\r\n :replaceFields=\"replaceFields\"\r\n :default-expanded-keys=\"defaultExpandedKeys\"\r\n :default-selected-keys=\"defaultSelectedKeys\"\r\n :show-line=\"showLine\"\r\n blockNode \r\n :show-icon=\"showIcon\">\r\n <a-icon v-if=\"switcherIcon\" slot=\"switcherIcon\" :type=\"switcherIcon\" />\r\n <template #title=\"props\">\r\n <span :title=\"props[replaceFields.title]\" class=\"tree-node__title\">\r\n {{ props[replaceFields.title] }}\r\n </span>\r\n </template>\r\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\r\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\r\n </template>\r\n </a-tree>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tree',\r\n props: {\r\n treeData: {\r\n type: Array,\r\n default: () => []\r\n },\r\n showLine: {\r\n type: Boolean,\r\n default: false\r\n },\r\n switcherIcon: {\r\n type: String\r\n },\r\n checkable: {\r\n type: Boolean,\r\n default: false\r\n },\r\n replaceFields: {\r\n type: Object,\r\n default: () => ({\r\n title: 'title',\r\n key: 'id',\r\n children: 'children'\r\n })\r\n },\r\n defaultExpandedKeys: {\r\n type: Array\r\n },\r\n defaultSelectedKeys: {\r\n type: Array\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n innerTreeData () {\r\n return this.treeData\r\n }\r\n },\r\n methods: {\r\n checkTreeNode (checkedKeys, e) {\r\n const { checkedNodes } = e\r\n const nodeDatas = checkedNodes.map(item => item.data.props.dataRef)\r\n this.$emit('check', checkedKeys, nodeDatas)\r\n },\r\n refreshTreeStatus (props = {}) {},\r\n selectTreeNode (selectedKeys, e) {\r\n this.$emit('select', selectedKeys, e)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-tree__wrapper {\r\n overflow: hidden;\r\n ::v-deep .ant-tree {\r\n .ant-tree-node-content-wrapper {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n .ant-tree-node-selected {\r\n color: #fff;\r\n }\r\n }\r\n}\r\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2570
2570
|
|
|
2571
2571
|
};
|
|
2572
2572
|
/* scoped */
|
|
2573
|
-
const __vue_scope_id__$B = "data-v-
|
|
2573
|
+
const __vue_scope_id__$B = "data-v-252ec372";
|
|
2574
2574
|
/* module identifier */
|
|
2575
2575
|
const __vue_module_identifier__$B = undefined;
|
|
2576
2576
|
/* functional template */
|
|
@@ -2752,6 +2752,7 @@ var script$A = {
|
|
|
2752
2752
|
currentTableSelection: this.currentTableSelection,
|
|
2753
2753
|
currentTreeNode: this.currentTreeNodeData,
|
|
2754
2754
|
requestTableData: this.requestTableData,
|
|
2755
|
+
keepAliveRefresh: this.keepAliveRefresh,
|
|
2755
2756
|
refreshTreeData: this.refreshTreeData,
|
|
2756
2757
|
querys: this.tableQuerys,
|
|
2757
2758
|
currentRowData: this.getCurrentRowData(),
|
|
@@ -3628,11 +3629,11 @@ __vue_render__$A._withStripped = true;
|
|
|
3628
3629
|
/* style */
|
|
3629
3630
|
const __vue_inject_styles__$A = function (inject) {
|
|
3630
3631
|
if (!inject) return
|
|
3631
|
-
inject("data-v-0641f844_0", { source: ".ele.model__tree-table[data-v-0641f844] {\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-0641f844] {\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-0641f844] {\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-0641f844] {\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-0641f844] {\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-0641f844] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-0641f844] {\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-0641f844] {\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":"AA8vBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC7vBA;AD+vBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC7vBA;ADgwBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AC9vBA;ADgwBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;AC9vBA;ADgwBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;AC9vBA;ADiwBA;EACA,gBAAA;AC/vBA;ADgwBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;AC9vBA;ADiwBA;EACA,eAAA;EACA,kCAAA;AC/vBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"ele model__tree-table\">\r\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\r\n <div class=\"model__tree--title\"></div>\r\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\" :style=\"{height: `${treeWrapperHeight}px`}\">\r\n <ele-tree\r\n :tree-data=\"treeData\"\r\n :defaultExpandedKeys=\"defaultExpandedKeys\"\r\n :defaultSelectedKeys=\"defaultSelectedKeys\"\r\n @select=\"selectTreeNode\"\r\n :replace-fields=\"mapFields\">\r\n </ele-tree>\r\n </section>\r\n </section>\r\n <section class=\"model__table--container\" :ref=\"modelTableContainerRef\">\r\n <div class=\"model__table--title\" v-if=\"title\">\r\n <template v-if=\"titleMode\">\r\n <div :class=\"[`model__table-title--${titleMode}`]\"></div>\r\n </template>\r\n <template v-else>\r\n <div class=\"model__table-title--text\">{{ title }}</div>\r\n </template>\r\n </div>\r\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\r\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\r\n <div class=\"button-row__area\">\r\n <ele-button-group class=\"model-table__button-group\" v-on=\"overrideButtonGroupEvent\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" :data-source=\"getButtonGroupElements\"></ele-button-group>\r\n <slot name=\"tags\"></slot>\r\n <slot v-if=\"$slots['sub-center']\" name=\"sub-center\"></slot>\r\n </div>\r\n <ele-table\r\n v-on=\"overrideTableEvent\"\r\n :ref=\"tableRef\"\r\n :row-selection=\"rowSelection\"\r\n :loading=\"loading\" \r\n :columns=\"columns\"\r\n :total=\"total\"\r\n :x=\"x\"\r\n :y=\"y\"\r\n :bordered=\"setBorder\"\r\n :height=\"tableHeight\"\r\n :width=\"tableWidth\"\r\n :actions=\"actions\"\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n :data-source=\"tableData\"\r\n @change-page=\"onChangePage\"\r\n ></ele-table>\r\n </section>\r\n </section>\r\n <ele-modal-form v-model=\"modalFormValue\" v-on=\"overrideModalFormEvent\" :meta=\"modalFormMeta\"></ele-modal-form>\r\n <ele-modal-fsm v-model=\"showFsmModal\" :contextProp=\"fsmContextProp\" :meta=\"fsmMeta\" @cancel=\"handleCloseFsmModal\"></ele-modal-fsm>\r\n <ele-modal-table\r\n :meta=\"modalTableMeta\"\r\n v-model=\"modalTableValue\"\r\n v-on=\"overrideModalTableEvent\"\r\n ></ele-modal-table>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nimport { type, net } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, BUILT_IN_TRIGGER, CONTEXT } from '../../../utils'\r\nimport { createTreeTableModel } from '../../../utils/runtime-context'\r\nexport default {\r\n name: 'ele-tree-table-model',\r\n props: {\r\n title: {\r\n type: [Object, String]\r\n },\r\n overHeight: {\r\n type: Number,\r\n default: 0\r\n },\r\n treeMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n searchMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n typeof: Object,\r\n default: () => ({})\r\n },\r\n tableMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n createMeta: {\r\n type: Object\r\n },\r\n editMeta: {\r\n type: Object\r\n }\r\n },\r\n provide () {\r\n return {\r\n requestTreeData: this.requestTreeData,\r\n requestTableData: this.requestTableData,\r\n [CONTEXT]: () => {\r\n return {\r\n exposed: this.exposed\r\n }\r\n }\r\n }\r\n },\r\n data () {\r\n return {\r\n tableHeight: 0,\r\n tableWidth: 0,\r\n modalFormMeta: {},\r\n modalFormValue: false,\r\n treeData: [],\r\n tableData: [],\r\n defaultExpandedKeys: [],\r\n defaultSelectedKeys: [],\r\n replaceFields: {\r\n title: 'title',\r\n children: 'children',\r\n key: 'id'\r\n },\r\n loading: false,\r\n total: 0,\r\n tableQuerys: {},\r\n resizeObserverModelTableWrapper: null,\r\n modelTableWrapperHeight: 0,\r\n currentTreeNodeData: {},\r\n currentRowData: {},\r\n treeWrapperHeight: 0,\r\n currentTableSelection: this.currentTableMode == 'radio' ? {} : [],\r\n showFsmModal: false,\r\n fsmMeta: {},\r\n fsmContextProp: {},\r\n modalTableValue: false,\r\n modalTableMeta: {},\r\n dataPoolManager: null\r\n }\r\n },\r\n computed: {\r\n setBorder () {\r\n return this.tableMeta.bordered === false ? false : true\r\n },\r\n rowSelection () {\r\n if (!this.currentTableMode) return void 0\r\n return {\r\n columnTitle: this.currentSelectionColumn.columnTitle,\r\n fixed: true,\r\n type: this.currentTableMode,\r\n onChange: this.onChangeTableSelection\r\n }\r\n },\r\n currentSelectionColumn () {\r\n const { multiple } = this.tableMeta\r\n const target = this.columns.find(item => Object.keys(item).includes('multiple'))\r\n const isGlobalExistMultiple = Object.keys(this.tableMeta).includes('multiple')\r\n if (target) {\r\n return target\r\n } else if (isGlobalExistMultiple) {\r\n return { multiple }\r\n }\r\n return void 0\r\n },\r\n x () {\r\n const { x } = this.tableMeta\r\n return x\r\n },\r\n y () {\r\n const { y } = this.tableMeta\r\n return y\r\n },\r\n currentTableMode () {\r\n if (!this.currentSelectionColumn) return void 0\r\n const { multiple } = this.currentSelectionColumn\r\n if (type.isBool(multiple)) {\r\n if (multiple) {\r\n return 'checkbox'\r\n } else {\r\n return 'radio'\r\n }\r\n } else {\r\n return void 0\r\n }\r\n },\r\n modelTableContainerRef () {\r\n return uuidv4()\r\n },\r\n titleMode () {\r\n if (type.isObject(this.title)) {\r\n const { mode = '' } = this.title\r\n return mode\r\n }\r\n return void 0\r\n },\r\n tableRef () {\r\n return uuidv4()\r\n },\r\n exposed () {\r\n return {\r\n showModalForm: this.showModalForm,\r\n closeModalForm: this.closeModalForm,\r\n showModalTable: this.showModalTable,\r\n closeModalTable: this.closeModalTable,\r\n currentTableSelection: this.currentTableSelection,\r\n currentTreeNode: this.currentTreeNodeData,\r\n requestTableData: this.requestTableData,\r\n refreshTreeData: this.refreshTreeData,\r\n querys: this.tableQuerys,\r\n currentRowData: this.getCurrentRowData(),\r\n getCurrentRowData: this.getCurrentRowData,\r\n setCurrentRowData: this.setCurrentRowData,\r\n setCurrentTableSelection: this.setCurrentTableSelection,\r\n getCurrentTableSelection: this.getCurrentTableSelection,\r\n cleanCurrentModelEffect: this.cleanCurrentModelEffect,\r\n route: this.$route,\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n dataPool: this.model ? this.model.getDataPool() : null,\r\n dataPoolManager: this.model || null\r\n }\r\n },\r\n overrideTableEvent () {\r\n const events = this.actions.reduce((ret, action) => {\r\n ret[action.eventName || action.key] = (e) => {\r\n this.setCurrentRowData(e.exposed.currentRowData)\r\n const { target } = action\r\n const targetMeta = this.findMetaByKey(target)\r\n const { mode } = targetMeta\r\n mode && this.dispatchTrigger({ mode, record: e.exposed.currentRowData, modeMeta: targetMeta })\r\n this.$emit(action.eventName || action.key, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: { ...this.exposed, ...e.exposed } })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.EDIT]: this[BUILT_IN_EVENT_NAMES.EDIT],\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\r\n }\r\n },\r\n overrideModalFormEvent () {\r\n const { footerMeta } = this.modalFormMeta\r\n const { elements = [] } = footerMeta || {}\r\n const eles = type.isFunction(elements) ? elements.call(this) : elements\r\n const events = eles.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e = {}) => {\r\n if (ele.eventName === 'cancel') {\r\n this.closeModalForm()\r\n } else {\r\n const { exposed = {} } = e\r\n this.$emit(`${ele.eventName || ele.key}`, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed )})\r\n }\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...events\r\n }\r\n },\r\n overrideModalTableEvent () {\r\n const { footerMeta } = this.modalTableMeta\r\n const { elements = [] } = footerMeta || {}\r\n const eles = type.isFunction(elements) ? elements.call(this) : elements\r\n const events = eles.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e = {}) => {\r\n if (ele.eventName === 'cancel') {\r\n this.closeModalTable()\r\n } else {\r\n const { exposed = {} } = e\r\n this.$emit(`${ele.eventName || ele.key}`, { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, exposed )})\r\n }\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...events,\r\n exposed: this.exposed\r\n }\r\n },\r\n overrideButtonGroupEvent () {\r\n const events = this.getButtonGroupElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, currentTreeNode: this.currentTreeNodeData, exposed: Object.assign({}, e.exposed || {}, this.exposed)})\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.CREATE]: this[BUILT_IN_EVENT_NAMES.CREATE],\r\n exposed: this.exposed\r\n }\r\n },\r\n showTree () {\r\n return !!Object.keys(this.treeMeta).length\r\n },\r\n buttonGroup () {\r\n return uuidv4()\r\n },\r\n searchArea () {\r\n return uuidv4()\r\n },\r\n modelTreeWrapper () {\r\n return uuidv4()\r\n },\r\n modelTableWrapper () {\r\n return uuidv4()\r\n },\r\n actions () {\r\n const { operations } = this.tableMeta\r\n if (operations) {\r\n return operations.elements\r\n } else {\r\n return []\r\n }\r\n },\r\n pageSize () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSize || 10\r\n },\r\n pageSizeOptions () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSizeOptions || ['10', '20', '30', '40']\r\n },\r\n columns () {\r\n const { columns, operations } = this.tableMeta\r\n if (type.get(columns) === 'array') {\r\n const columnsOptions = columns.map(item => {\r\n const { mode = 'text' } = item\r\n if (item.render) {\r\n return {\r\n ...item,\r\n customRender: (text, record, index) => {\r\n const { $createElement } = this\r\n return item.render.call(this, \r\n { h: $createElement, ctx: this },\r\n text ? typeof text == 'object' ? text[item.dataIndex] : text : '', \r\n record, index)\r\n }\r\n }\r\n } else if (mode !== BUILT_IN_TRIGGER.TEXT) {\r\n const { [`${mode}Meta`]: modeMeta } = item\r\n return {\r\n ...item,\r\n customRender: (text, record, index) => {\r\n return <span onClick={() => this.dispatchTrigger({ mode, record, modeMeta, index })} class={ mode }>{ text }</span>\r\n }\r\n }\r\n }\r\n return {\r\n ...item\r\n }\r\n })\r\n if (operations) {\r\n return [\r\n ...columnsOptions,\r\n {\r\n title: '操作',\r\n width: operations.width,\r\n key: 'action',\r\n fixed: 'right',\r\n scopedSlots: { customRender: 'action' }\r\n }\r\n ]\r\n }\r\n return columnsOptions\r\n } else {\r\n console.error('Error: columns is invalid, please check it')\r\n return []\r\n }\r\n },\r\n getButtonGroupElements () {\r\n const { elements } = this.buttonGroupMeta\r\n if (type.get(elements) === 'function') {\r\n return elements.call(this)\r\n } else if (type.get(elements) === 'array') {\r\n return elements\r\n } else {\r\n return []\r\n }\r\n },\r\n mapFields () {\r\n const { replaceFields = {} } = this.treeMeta\r\n const mapFields = type.isEmpty(replaceFields) ? this.replaceFields : replaceFields\r\n return mapFields\r\n }\r\n },\r\n async created () {\r\n // 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 if (this.showTree) 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 });
|
|
3632
|
+
inject("data-v-1471bfc6_0", { source: ".ele.model__tree-table[data-v-1471bfc6] {\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-1471bfc6] {\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-1471bfc6] {\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-1471bfc6] {\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-1471bfc6] {\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-1471bfc6] {\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper .button-row__area[data-v-1471bfc6] {\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-1471bfc6] {\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":"AA+vBA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC9vBA;ADgwBA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC9vBA;ADiwBA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AC/vBA;ADiwBA;EACA,WAAA;EACA,WAAA;EACA,uCAAA;EACA,2BAAA;EACA,4BAAA;AC/vBA;ADiwBA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,qCAAA;AC/vBA;ADkwBA;EACA,gBAAA;AChwBA;ADiwBA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;AC/vBA;ADkwBA;EACA,eAAA;EACA,kCAAA;AChwBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"ele model__tree-table\">\r\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\r\n <div class=\"model__tree--title\"></div>\r\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\" :style=\"{height: `${treeWrapperHeight}px`}\">\r\n <ele-tree\r\n :tree-data=\"treeData\"\r\n :defaultExpandedKeys=\"defaultExpandedKeys\"\r\n :defaultSelectedKeys=\"defaultSelectedKeys\"\r\n @select=\"selectTreeNode\"\r\n :replace-fields=\"mapFields\">\r\n </ele-tree>\r\n </section>\r\n </section>\r\n <section class=\"model__table--container\" :ref=\"modelTableContainerRef\">\r\n <div class=\"model__table--title\" v-if=\"title\">\r\n <template v-if=\"titleMode\">\r\n <div :class=\"[`model__table-title--${titleMode}`]\"></div>\r\n </template>\r\n <template v-else>\r\n <div class=\"model__table-title--text\">{{ title }}</div>\r\n </template>\r\n </div>\r\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\r\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\r\n <div class=\"button-row__area\">\r\n <ele-button-group class=\"model-table__button-group\" v-on=\"overrideButtonGroupEvent\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" :data-source=\"getButtonGroupElements\"></ele-button-group>\r\n <slot name=\"tags\"></slot>\r\n <slot v-if=\"$slots['sub-center']\" name=\"sub-center\"></slot>\r\n </div>\r\n <ele-table\r\n v-on=\"overrideTableEvent\"\r\n :ref=\"tableRef\"\r\n :row-selection=\"rowSelection\"\r\n :loading=\"loading\" \r\n :columns=\"columns\"\r\n :total=\"total\"\r\n :x=\"x\"\r\n :y=\"y\"\r\n :bordered=\"setBorder\"\r\n :height=\"tableHeight\"\r\n :width=\"tableWidth\"\r\n :actions=\"actions\"\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n :data-source=\"tableData\"\r\n @change-page=\"onChangePage\"\r\n ></ele-table>\r\n </section>\r\n </section>\r\n <ele-modal-form v-model=\"modalFormValue\" v-on=\"overrideModalFormEvent\" :meta=\"modalFormMeta\"></ele-modal-form>\r\n <ele-modal-fsm v-model=\"showFsmModal\" :contextProp=\"fsmContextProp\" :meta=\"fsmMeta\" @cancel=\"handleCloseFsmModal\"></ele-modal-fsm>\r\n <ele-modal-table\r\n :meta=\"modalTableMeta\"\r\n v-model=\"modalTableValue\"\r\n v-on=\"overrideModalTableEvent\"\r\n ></ele-modal-table>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nimport { type, net } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap, BUILT_IN_TRIGGER, CONTEXT } from '../../../utils'\r\nimport { createTreeTableModel } from '../../../utils/runtime-context'\r\nexport default {\r\n name: 'ele-tree-table-model',\r\n props: {\r\n title: {\r\n type: [Object, String]\r\n },\r\n overHeight: {\r\n type: Number,\r\n default: 0\r\n },\r\n treeMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n searchMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n typeof: Object,\r\n default: () => ({})\r\n },\r\n tableMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n createMeta: {\r\n type: Object\r\n },\r\n editMeta: {\r\n type: Object\r\n }\r\n },\r\n provide () {\r\n return {\r\n requestTreeData: this.requestTreeData,\r\n requestTableData: this.requestTableData,\r\n [CONTEXT]: () => {\r\n return {\r\n exposed: this.exposed\r\n }\r\n }\r\n }\r\n },\r\n data () {\r\n return {\r\n tableHeight: 0,\r\n tableWidth: 0,\r\n modalFormMeta: {},\r\n modalFormValue: false,\r\n treeData: [],\r\n tableData: [],\r\n defaultExpandedKeys: [],\r\n defaultSelectedKeys: [],\r\n replaceFields: {\r\n title: 'title',\r\n children: 'children',\r\n key: 'id'\r\n },\r\n loading: false,\r\n total: 0,\r\n tableQuerys: {},\r\n resizeObserverModelTableWrapper: null,\r\n modelTableWrapperHeight: 0,\r\n currentTreeNodeData: {},\r\n currentRowData: {},\r\n treeWrapperHeight: 0,\r\n currentTableSelection: this.currentTableMode == 'radio' ? {} : [],\r\n showFsmModal: false,\r\n fsmMeta: {},\r\n fsmContextProp: {},\r\n modalTableValue: false,\r\n modalTableMeta: {},\r\n dataPoolManager: null\r\n }\r\n },\r\n computed: {\r\n setBorder () {\r\n return this.tableMeta.bordered === false ? false : true\r\n },\r\n rowSelection () {\r\n if (!this.currentTableMode) return void 0\r\n return {\r\n columnTitle: this.currentSelectionColumn.columnTitle,\r\n fixed: true,\r\n type: this.currentTableMode,\r\n onChange: this.onChangeTableSelection\r\n }\r\n },\r\n currentSelectionColumn () {\r\n const { multiple } = this.tableMeta\r\n const target = this.columns.find(item => Object.keys(item).includes('multiple'))\r\n const isGlobalExistMultiple = Object.keys(this.tableMeta).includes('multiple')\r\n if (target) {\r\n return target\r\n } else if (isGlobalExistMultiple) {\r\n return { multiple }\r\n }\r\n return void 0\r\n },\r\n x () {\r\n const { x } = this.tableMeta\r\n return x\r\n },\r\n y () {\r\n const { y } = this.tableMeta\r\n return y\r\n },\r\n currentTableMode () {\r\n if (!this.currentSelectionColumn) return void 0\r\n const { multiple } = this.currentSelectionColumn\r\n if (type.isBool(multiple)) {\r\n if (multiple) {\r\n return 'checkbox'\r\n } else {\r\n return 'radio'\r\n }\r\n } else {\r\n return void 0\r\n }\r\n },\r\n modelTableContainerRef () {\r\n return uuidv4()\r\n },\r\n titleMode () {\r\n if (type.isObject(this.title)) {\r\n const { mode = '' } = this.title\r\n return mode\r\n }\r\n return void 0\r\n },\r\n tableRef () {\r\n return uuidv4()\r\n },\r\n exposed () {\r\n return {\r\n showModalForm: this.showModalForm,\r\n closeModalForm: this.closeModalForm,\r\n showModalTable: this.showModalTable,\r\n closeModalTable: this.closeModalTable,\r\n currentTableSelection: this.currentTableSelection,\r\n currentTreeNode: this.currentTreeNodeData,\r\n requestTableData: this.requestTableData,\r\n 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 if (this.showTree) 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 });
|
|
3632
3633
|
|
|
3633
3634
|
};
|
|
3634
3635
|
/* scoped */
|
|
3635
|
-
const __vue_scope_id__$A = "data-v-
|
|
3636
|
+
const __vue_scope_id__$A = "data-v-1471bfc6";
|
|
3636
3637
|
/* module identifier */
|
|
3637
3638
|
const __vue_module_identifier__$A = undefined;
|
|
3638
3639
|
/* functional template */
|
|
@@ -4048,11 +4049,11 @@ __vue_render__$z._withStripped = true;
|
|
|
4048
4049
|
/* style */
|
|
4049
4050
|
const __vue_inject_styles__$z = function (inject) {
|
|
4050
4051
|
if (!inject) return
|
|
4051
|
-
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 });
|
|
4052
|
+
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 });
|
|
4052
4053
|
|
|
4053
4054
|
};
|
|
4054
4055
|
/* scoped */
|
|
4055
|
-
const __vue_scope_id__$z = "data-v-
|
|
4056
|
+
const __vue_scope_id__$z = "data-v-db482174";
|
|
4056
4057
|
/* module identifier */
|
|
4057
4058
|
const __vue_module_identifier__$z = undefined;
|
|
4058
4059
|
/* functional template */
|
|
@@ -4413,11 +4414,11 @@ __vue_render__$y._withStripped = true;
|
|
|
4413
4414
|
/* style */
|
|
4414
4415
|
const __vue_inject_styles__$y = function (inject) {
|
|
4415
4416
|
if (!inject) return
|
|
4416
|
-
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 });
|
|
4417
|
+
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 });
|
|
4417
4418
|
|
|
4418
4419
|
};
|
|
4419
4420
|
/* scoped */
|
|
4420
|
-
const __vue_scope_id__$y = "data-v-
|
|
4421
|
+
const __vue_scope_id__$y = "data-v-5149ea56";
|
|
4421
4422
|
/* module identifier */
|
|
4422
4423
|
const __vue_module_identifier__$y = undefined;
|
|
4423
4424
|
/* functional template */
|
|
@@ -4708,11 +4709,11 @@ __vue_render__$x._withStripped = true;
|
|
|
4708
4709
|
/* style */
|
|
4709
4710
|
const __vue_inject_styles__$x = function (inject) {
|
|
4710
4711
|
if (!inject) return
|
|
4711
|
-
inject("data-v-
|
|
4712
|
+
inject("data-v-3000c68c_0", { source: ".ele-step-model__wrapper[data-v-3000c68c] {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper[data-v-3000c68c] {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper .ele-steps .ant-steps-item[data-v-3000c68c] {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper[data-v-3000c68c] {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n}\n.ele-step-model__wrapper .ele-step-model__footer--wrapper[data-v-3000c68c] {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\models\\step-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAwLA;EACA,WAAA;EACA,aAAA;EACA,kBAAA;ACvLA;ADwLA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;ACtLA;ADwLA;EACA,gBAAA;ACtLA;AD0LA;EACA,WAAA;EACA,WAAA;EACA,gBAAA;EACA,mBAAA;EACA,+CAAA;EACA,cAAA;ACxLA;AD0LA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;ACxLA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-step-model__wrapper\">\r\n <div class=\"ele-step-model__step--wrapper\">\r\n <a-steps class=\"ele-steps\" :current=\"current\" size=\"small\">\r\n <a-step v-for=\"step in elements\" :title=\"step.title\" :key=\"step.key\" />\r\n </a-steps>\r\n </div>\r\n <div class=\"ele-step-model__content--wrapper\">\r\n <template v-for=\"name in scopedSlotsNames\">\r\n <div :key=\"name\" v-if=\"currentSlotName == name\" :class=\"['ele-step-model__slot', `ele-step-model__slot--${name}`]\">\r\n <slot :name=\"name\"></slot>\r\n </div>\r\n </template>\r\n </div>\r\n <div class=\"ele-step-model__footer--wrapper\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { BUILT_IN_EVENT_NAMES, CONTEXT } from '../../../utils'\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-step-model',\r\n props: {\r\n stepMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n footerMeta: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n data() {\r\n return {\r\n current: 0,\r\n currentSlotComponentRef: null,\r\n innerFooterElements: []\r\n }\r\n },\r\n provide() {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n ...this.expressionData\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n routeMetaDisabled () {\r\n return this.executeExpression(this.$route.meta.disabled)\r\n },\r\n expressionData () {\r\n return {\r\n current: this.current,\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta\r\n }\r\n },\r\n currentSlotName () {\r\n return this.scopedSlotsNames[this.current]\r\n },\r\n footerElements () {\r\n return this.innerFooterElements\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.evalShowExpressionForFooterElements()\r\n this.$emit(ele.eventName || 'click', { ...e, exposed: this.exposedMethods })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.NEXT]: this[BUILT_IN_EVENT_NAMES.NEXT],\r\n [BUILT_IN_EVENT_NAMES.PREVIOUS]: this[BUILT_IN_EVENT_NAMES.PREVIOUS],\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT]\r\n }\r\n },\r\n activeIndex () {\r\n const { activeIndex } = this.stepMeta\r\n return activeIndex\r\n },\r\n elements () {\r\n const { elements } = this.stepMeta\r\n return elements\r\n },\r\n scopedSlotsNames () {\r\n const slotNames = this.elements.map(item => item.key)\r\n return slotNames\r\n },\r\n exposedMethods () {\r\n return {\r\n slotRef: this.currentSlotComponentRef,\r\n setCurrentStep: this.setCurrentStep,\r\n next: this.nextStep,\r\n prev: this.prevStep,\r\n current: this.current\r\n }\r\n }\r\n },\r\n watch: {\r\n activeIndex: {\r\n handler (idx) {\r\n this.current = idx\r\n },\r\n immediate: true\r\n },\r\n current: {\r\n handler () {\r\n this.$nextTick(() => {\r\n this.currentSlotComponentRef = this.getCurrentSlotComponentRef()\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n created () {\r\n const { elements } = this.footerMeta\r\n this.innerFooterElements = elements.call(this)\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n methods: {\r\n executeExpression (expression) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return false\r\n return parse(expression, { ...this.expressionData })\r\n },\r\n evalShowExpressionForFooterElements () {\r\n this.innerFooterElements = this.innerFooterElements.map(element => {\r\n const { show = true, key, eventName } = element\r\n if(key == BUILT_IN_EVENT_NAMES.SUBMIT || eventName == BUILT_IN_EVENT_NAMES.SUBMIT) {\r\n // built in submit button should according to the route meta disabled\r\n this.$set(element, '_show', this.executeExpression(show, this.expressionData) && !this.routeMetaDisabled)\r\n return element\r\n }\r\n show && this.$set(element, '_show', this.executeExpression(show, this.expressionData))\r\n return element\r\n })\r\n },\r\n getCurrentSlotComponentRef () {\r\n const includeMetaCmp = this.$children.find(child => child.meta)\r\n if (!includeMetaCmp) return null\r\n const { $children: components } = includeMetaCmp\r\n const target = components.find(cmp => cmp.$options._componentTag === 'ele-tpl')\r\n return target.getModel ? target.getModel() : null\r\n },\r\n setCurrentStep (index) {\r\n this.current = index\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n nextStep () {\r\n if (this.current >= this.elements.length - 1) return\r\n this.current ++\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n prevStep () {\r\n if (this.current <= 0) return\r\n this.current --\r\n this.evalShowExpressionForFooterElements()\r\n },\r\n [BUILT_IN_EVENT_NAMES.NEXT] (props) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.NEXT, { ...props, exposed: { ...this.exposedMethods } })\r\n },\r\n [BUILT_IN_EVENT_NAMES.PREVIOUS] (props) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.PREVIOUS, { ...props, exposed: { ...this.exposedMethods } })\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props) {\r\n const currentComponent = this.getCurrentSlotComponentRef() || {}\r\n const hasSubmitMethod = currentComponent.hasOwnProperty(BUILT_IN_EVENT_NAMES.SUBMIT)\r\n hasSubmitMethod && currentComponent[BUILT_IN_EVENT_NAMES.SUBMIT]()\r\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, exposed: { ...this.exposedMethods } })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-step-model__wrapper {\r\n width: 100%;\r\n height: 100vh;\r\n position: relative;\r\n .ele-step-model__step--wrapper {\r\n width: 100%;\r\n height: 64px;\r\n padding: 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n background: #fff;\r\n .ele-steps {\r\n .ant-steps-item {\r\n text-align: left;\r\n }\r\n }\r\n }\r\n .ele-step-model__content--wrapper {\r\n width: 100%;\r\n width: 100%;\r\n margin-top: 16px;\r\n margin-bottom: 16px;\r\n height: calc(100vh - 64px - 64px - 16px - 16px);\r\n overflow: auto;\r\n }\r\n .ele-step-model__footer--wrapper {\r\n width: 100%;\r\n height: 64px;\r\n background: #fff;\r\n position: absolute;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n}\r\n</style>import meta from '@/views/tree-table-page/meta'import meta from '@/views/tree-table-page/meta'\r\n\r\n",".ele-step-model__wrapper {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper .ele-steps .ant-steps-item {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n}\n.ele-step-model__wrapper .ele-step-model__footer--wrapper {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4712
4713
|
|
|
4713
4714
|
};
|
|
4714
4715
|
/* scoped */
|
|
4715
|
-
const __vue_scope_id__$x = "data-v-
|
|
4716
|
+
const __vue_scope_id__$x = "data-v-3000c68c";
|
|
4716
4717
|
/* module identifier */
|
|
4717
4718
|
const __vue_module_identifier__$x = undefined;
|
|
4718
4719
|
/* functional template */
|
|
@@ -4817,7 +4818,7 @@ __vue_render__$w._withStripped = true;
|
|
|
4817
4818
|
/* style */
|
|
4818
4819
|
const __vue_inject_styles__$w = function (inject) {
|
|
4819
4820
|
if (!inject) return
|
|
4820
|
-
inject("data-v-
|
|
4821
|
+
inject("data-v-18f3cb29_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4821
4822
|
|
|
4822
4823
|
};
|
|
4823
4824
|
/* scoped */
|
|
@@ -5598,11 +5599,11 @@ __vue_render__$v._withStripped = true;
|
|
|
5598
5599
|
/* style */
|
|
5599
5600
|
const __vue_inject_styles__$v = function (inject) {
|
|
5600
5601
|
if (!inject) return
|
|
5601
|
-
inject("data-v-95ad4e12_0", { source: ".ele__form--wrapper[data-v-95ad4e12] {\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":"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 });
|
|
5602
|
+
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 });
|
|
5602
5603
|
|
|
5603
5604
|
};
|
|
5604
5605
|
/* scoped */
|
|
5605
|
-
const __vue_scope_id__$v = "data-v-
|
|
5606
|
+
const __vue_scope_id__$v = "data-v-061511f7";
|
|
5606
5607
|
/* module identifier */
|
|
5607
5608
|
const __vue_module_identifier__$v = undefined;
|
|
5608
5609
|
/* functional template */
|
|
@@ -5694,11 +5695,11 @@ __vue_render__$u._withStripped = true;
|
|
|
5694
5695
|
/* style */
|
|
5695
5696
|
const __vue_inject_styles__$u = function (inject) {
|
|
5696
5697
|
if (!inject) return
|
|
5697
|
-
inject("data-v-
|
|
5698
|
+
inject("data-v-83e11950_0", { source: ".ele-alert[data-v-83e11950] {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\alert\\src\\index.vue","index.vue"],"names":[],"mappings":"AA0CA;EACA,2BAAA;ACzCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-alert\r\n class=\"ele-alert\"\r\n :message=\"message\" \r\n :description=\"description\" \r\n :type=\"type\"\r\n :closable=\"closable\"\r\n :closeText=\"closeText\"\r\n :show-icon=\"showIcon\" />\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-alert',\r\n props: {\r\n type: {\r\n type: String,\r\n default: 'success'\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n },\r\n message: {\r\n type: String,\r\n default: 'Success Tips'\r\n },\r\n description: {\r\n type: String\r\n },\r\n closable: {\r\n type: Boolean,\r\n default: true\r\n },\r\n closeText: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-alert {\r\n text-align: left !important;\r\n}\r\n</style>",".ele-alert {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5698
5699
|
|
|
5699
5700
|
};
|
|
5700
5701
|
/* scoped */
|
|
5701
|
-
const __vue_scope_id__$u = "data-v-
|
|
5702
|
+
const __vue_scope_id__$u = "data-v-83e11950";
|
|
5702
5703
|
/* module identifier */
|
|
5703
5704
|
const __vue_module_identifier__$u = undefined;
|
|
5704
5705
|
/* functional template */
|
|
@@ -6798,11 +6799,11 @@ __vue_render__$t._withStripped = true;
|
|
|
6798
6799
|
/* style */
|
|
6799
6800
|
const __vue_inject_styles__$t = function (inject) {
|
|
6800
6801
|
if (!inject) return
|
|
6801
|
-
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 });
|
|
6802
|
+
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 });
|
|
6802
6803
|
|
|
6803
6804
|
};
|
|
6804
6805
|
/* scoped */
|
|
6805
|
-
const __vue_scope_id__$t = "data-v-
|
|
6806
|
+
const __vue_scope_id__$t = "data-v-3db5c928";
|
|
6806
6807
|
/* module identifier */
|
|
6807
6808
|
const __vue_module_identifier__$t = undefined;
|
|
6808
6809
|
/* functional template */
|
|
@@ -6953,11 +6954,11 @@ __vue_render__$s._withStripped = true;
|
|
|
6953
6954
|
/* style */
|
|
6954
6955
|
const __vue_inject_styles__$s = function (inject) {
|
|
6955
6956
|
if (!inject) return
|
|
6956
|
-
inject("data-v-
|
|
6957
|
+
inject("data-v-d83730f2_0", { source: ".g-select-entity__wrapper[data-v-d83730f2] {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper[data-v-d83730f2]:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input[data-v-d83730f2] {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon[data-v-d83730f2] {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n.has-error .g-select-entity__wrapper[data-v-d83730f2] {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input[data-v-d83730f2] {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\select-entity\\src\\index.vue","index.vue"],"names":[],"mappings":"AAmFA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,6BAAA;EACA,kBAAA;EACA,uDAAA;AClFA;ADmFA;EACA,yCAAA;ACjFA;ADmFA;EACA,eAAA;EACA,sBAAA;EACA,kBAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;ACjFA;ADmFA;EACA,eAAA;EACA,6BAAA;EACA,wCAAA;EACA,4DAAA;EACA,eAAA;EACA,gBAAA;EACA,mBAAA;ACjFA;ADoFA;EACA,iDAAA;ACjFA;ADmFA;EACA,wCAAA;AChFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-select-entity__wrapper\" :class=\"disabled ? 'g-select-entity__disabled' : ''\">\r\n <span class=\"select-entity__input\">\r\n <a-tag\r\n v-for=\"(item, inx) in getValueList\"\r\n :key=\"item.value\"\r\n :closable=\"!disabled && !getIsMaxCount\"\r\n @close=\"onClose(...arguments, inx, item)\"\r\n >\r\n {{ item.label }}\r\n </a-tag>\r\n <a-tag v-if=\"getIsMaxCount\">......</a-tag>\r\n </span>\r\n <span class=\"select-entity__addon\" @click=\"onChange\">{{ addonAfter }}</span>\r\n <slot></slot>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-select-entity',\r\n props: {\r\n value: {\r\n type: [Array, Object]\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: true\r\n },\r\n maxCount: {\r\n type: Number,\r\n default: 7\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n addonAfter: {\r\n type: String,\r\n default: '选择'\r\n }\r\n },\r\n computed: {\r\n getValueList () {\r\n if (this.value) {\r\n if (this.multiple) {\r\n return this.getIsMaxCount ? this.value.slice(0, this.maxCount) : this.value\r\n }\r\n return type.isArray(this.value) ? this.value : [this.value]\r\n }\r\n return []\r\n },\r\n getIsMaxCount () {\r\n if (this.value && this.multiple) {\r\n return this.value.length >= this.maxCount\r\n }\r\n return false\r\n }\r\n },\r\n methods: {\r\n onChange () {\r\n if (this.disabled) return\r\n this.$emit('change', this.value)\r\n this.$emit('evoke')\r\n },\r\n onClose (e, inx, props) {\r\n e = window.event || e\r\n e.preventDefault()\r\n if (!this.multiple) {\r\n this.$emit('close', props)\r\n this.$emit('change', null)\r\n return\r\n }\r\n this.value.splice(inx, 1)\r\n this.$emit('close', props)\r\n this.$emit('change', this.value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-select-entity__wrapper {\r\n font-size: 14px;\r\n line-height: 30px;\r\n position: relative;\r\n width: 100%;\r\n display: flex;\r\n color: var(--idoole-black-07);\r\n border-radius: 4px;\r\n border: 1px solid var(--idooel-form-title-border-color);\r\n &:hover {\r\n border-color: var(--idooel-primary-color);\r\n }\r\n .select-entity__input {\r\n padding: 0 11px;\r\n background-color: #fff;\r\n border-radius: 4px;\r\n flex-grow: 1;\r\n min-height: 30px;\r\n text-align: left;\r\n }\r\n .select-entity__addon {\r\n padding: 0 11px;\r\n color: var(--idoole-black-07);\r\n background-color: var(--idoole-black-02);\r\n border-left: 1px solid var(--idooel-form-title-border-color);\r\n cursor: pointer;\r\n min-height: 30px;\r\n white-space: nowrap;\r\n }\r\n}\r\n.has-error .g-select-entity__wrapper {\r\n border-color: var(--idooel-form-border-err-color);\r\n}\r\n.g-select-entity__disabled .select-entity__input {\r\n background-color: var(--idoole-black-02);\r\n}\r\n</style>",".g-select-entity__wrapper {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n\n.has-error .g-select-entity__wrapper {\n border-color: var(--idooel-form-border-err-color);\n}\n\n.g-select-entity__disabled .select-entity__input {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
6957
6958
|
|
|
6958
6959
|
};
|
|
6959
6960
|
/* scoped */
|
|
6960
|
-
const __vue_scope_id__$s = "data-v-
|
|
6961
|
+
const __vue_scope_id__$s = "data-v-d83730f2";
|
|
6961
6962
|
/* module identifier */
|
|
6962
6963
|
const __vue_module_identifier__$s = undefined;
|
|
6963
6964
|
/* functional template */
|
|
@@ -7374,11 +7375,11 @@ __vue_render__$p._withStripped = true;
|
|
|
7374
7375
|
/* style */
|
|
7375
7376
|
const __vue_inject_styles__$p = function (inject) {
|
|
7376
7377
|
if (!inject) return
|
|
7377
|
-
inject("data-v-
|
|
7378
|
+
inject("data-v-2872c57a_0", { source: ".ele-modal__footer[data-v-2872c57a] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.ele-modal__footer .footer-btn__wrapper[data-v-2872c57a] {\n flex: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\modal\\src\\index.vue","index.vue"],"names":[],"mappings":"AA+KA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;EACA,mBAAA;AC9KA;AD+KA;EACA,OAAA;AC7KA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-modal\r\n :title=\"title\"\r\n :cancelText=\"cancelText\"\r\n :okText=\"okText\"\r\n :closable=\"closable\"\r\n v-model:visible=\"showModal\"\r\n :width=\"width\"\r\n :keyboard=\"false\"\r\n :maskClosable=\"maskClosable\"\r\n :dialogStyle=\"{ top: `${upDownDistance[size]}px` }\"\r\n :bodyStyle=\"{ maxHeight: maxheight, overflowY: 'auto' }\"\r\n :footer=\"showFooter ? undefined : null\"\r\n @cancel=\"handleCancel\"\r\n @ok=\"handleOk\"\r\n >\r\n <slot v-if=\"showModal\"></slot>\r\n <template slot=\"footer\" v-if=\"!showDefaultFooter\">\r\n <div class=\"ele-modal__footer\">\r\n <slot name=\"footer-text\"></slot>\r\n <div class=\"footer-btn__wrapper\">\r\n <ele-button\r\n v-for=\"btn in buttonGroupMeta.elements\"\r\n :type=\"btn.type\"\r\n v-on=\"assignAttrEvents\"\r\n :event-name=\"btn.eventName\"\r\n :key=\"btn.key\">\r\n {{ btn.label }}\r\n </ele-button>\r\n </div>\r\n </div>\r\n </template>\r\n </a-modal>\r\n</template>\r\n<script>\r\nimport { CONTEXT } from '../../utils'\r\nexport default {\r\n name: 'ele-modal',\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: '标题'\r\n },\r\n cancelText: {\r\n type: String,\r\n default: '关闭'\r\n },\r\n okText: {\r\n type: String,\r\n default: '确定'\r\n },\r\n size: {\r\n type: String,\r\n default: 'middle'\r\n },\r\n map: {\r\n type: Object,\r\n default () {\r\n return {}\r\n }\r\n },\r\n closable: {\r\n type: Boolean,\r\n default: true\r\n },\r\n maskClosable: {\r\n type: Boolean,\r\n default: false\r\n },\r\n showFooter: {\r\n type: Boolean,\r\n default: true\r\n },\r\n footer: {\r\n type: Function,\r\n default: null\r\n },\r\n onlyClose: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n // 是否展示组件默认底部按钮\r\n showDefaultFooter: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.$nextTick(() => {\r\n this.showModal = value\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n computed: {\r\n assignAttrEvents () {\r\n const events = this.buttons.reduce((ret, btn) => {\r\n ret[btn.eventName] = (e) => {\r\n this.$emit(btn.eventName || 'click', { ...e, ...this[CONTEXT]() })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events\r\n }\r\n },\r\n buttons () {\r\n const { elements = [] } = this.buttonGroupMeta\r\n return elements\r\n },\r\n width () {\r\n return this.map[this.size]\r\n },\r\n maxheight () {\r\n return `calc(100vh - ${this.upDownDistance[this.size] * 2 + (this.title ? 55 : 0) + (this.showFooter ? 53 : 0) }px`\r\n }\r\n },\r\n data () {\r\n return {\r\n showModal: false\r\n }\r\n },\r\n created () {\r\n let defaultMap = {\r\n small: 480,\r\n middle: 768,\r\n big: 1200\r\n }\r\n this.upDownDistance = {\r\n small: 80,\r\n middle: 80,\r\n big: 40\r\n }\r\n this.map = Object.assign(this.map, defaultMap)\r\n },\r\n methods: {\r\n openModal () {\r\n this.showModal = true\r\n this.removeHidden()\r\n },\r\n handleCancel () {\r\n this.showModal = false\r\n this.$emit('input', this.showModal)\r\n this.$emit('change', this.showModal)\r\n this.removeHidden()\r\n this.$emit('cancel')\r\n },\r\n handleOk () {\r\n this.$emit('ok')\r\n },\r\n removeHidden () {\r\n let ishidden = document.body.style.overflow === 'hidden'\r\n ishidden && (document.body.style.overflow = 'initial')\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ele-modal__footer {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n .footer-btn__wrapper {\r\n flex: 1;\r\n }\r\n}\r\n</style>",".ele-modal__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.ele-modal__footer .footer-btn__wrapper {\n flex: 1;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7378
7379
|
|
|
7379
7380
|
};
|
|
7380
7381
|
/* scoped */
|
|
7381
|
-
const __vue_scope_id__$p = "data-v-
|
|
7382
|
+
const __vue_scope_id__$p = "data-v-2872c57a";
|
|
7382
7383
|
/* module identifier */
|
|
7383
7384
|
const __vue_module_identifier__$p = undefined;
|
|
7384
7385
|
/* functional template */
|
|
@@ -7464,11 +7465,11 @@ __vue_render__$o._withStripped = true;
|
|
|
7464
7465
|
/* style */
|
|
7465
7466
|
const __vue_inject_styles__$o = function (inject) {
|
|
7466
7467
|
if (!inject) return
|
|
7467
|
-
inject("data-v-
|
|
7468
|
+
inject("data-v-087ae2a9_0", { source: ".ant-checkbox-group[data-v-087ae2a9] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-checkbox-group[data-v-087ae2a9] .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group[data-v-087ae2a9] .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\checkbox\\src\\index.vue","index.vue"],"names":[],"mappings":"AAsCA;EACA,gBAAA;EACA,iBAAA;ACrCA;ADyCA;EACA,0CAAA;ACtCA;ADwCA;EACA,iDAAA;ACtCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-checkbox-group\r\n :value=\"value\"\r\n :options=\"dataSource\" \r\n :disabled=\"disabled\" \r\n @change=\"onChange\">\r\n </a-checkbox-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-checkbox',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: Array\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n onChange (value) {\r\n this.$emit('change', value)\r\n this.$emit('input', value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-checkbox-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-checkbox-group {\r\n ::v-deep .ant-checkbox-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-checkbox-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-checkbox-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7468
7469
|
|
|
7469
7470
|
};
|
|
7470
7471
|
/* scoped */
|
|
7471
|
-
const __vue_scope_id__$o = "data-v-
|
|
7472
|
+
const __vue_scope_id__$o = "data-v-087ae2a9";
|
|
7472
7473
|
/* module identifier */
|
|
7473
7474
|
const __vue_module_identifier__$o = undefined;
|
|
7474
7475
|
/* functional template */
|
|
@@ -7563,11 +7564,11 @@ __vue_render__$n._withStripped = true;
|
|
|
7563
7564
|
/* style */
|
|
7564
7565
|
const __vue_inject_styles__$n = function (inject) {
|
|
7565
7566
|
if (!inject) return
|
|
7566
|
-
inject("data-v-
|
|
7567
|
+
inject("data-v-3e01936f_0", { source: ".ant-radio-group[data-v-3e01936f] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-3e01936f] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-3e01936f] .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\radio\\src\\index.vue","index.vue"],"names":[],"mappings":"AA0CA;EACA,gBAAA;EACA,iBAAA;ACzCA;AD6CA;EACA,0CAAA;AC1CA;AD4CA;EACA,iDAAA;AC1CA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-radio-group :value=\"value\" @change=\"onChange\" :disabled=\"disabled\">\r\n <a-radio v-for=\"item in dataSource\" :key=\"item.value\" :value=\"item.value\">\r\n {{ item.label }}\r\n </a-radio>\r\n </a-radio-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-radio',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Array, Number]\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n watch: {\r\n value (val) {\r\n console.log('valvalval', val)\r\n }\r\n },\r\n methods: {\r\n onChange (e) {\r\n this.$emit('change', e.target.value)\r\n this.$emit('input', e.target.value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-radio-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-radio-group {\r\n ::v-deep .ant-radio-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-radio-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-radio-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-radio-group ::v-deep .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group ::v-deep .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7567
7568
|
|
|
7568
7569
|
};
|
|
7569
7570
|
/* scoped */
|
|
7570
|
-
const __vue_scope_id__$n = "data-v-
|
|
7571
|
+
const __vue_scope_id__$n = "data-v-3e01936f";
|
|
7571
7572
|
/* module identifier */
|
|
7572
7573
|
const __vue_module_identifier__$n = undefined;
|
|
7573
7574
|
/* functional template */
|
|
@@ -7727,12 +7728,12 @@ __vue_render__$m._withStripped = true;
|
|
|
7727
7728
|
/* style */
|
|
7728
7729
|
const __vue_inject_styles__$m = function (inject) {
|
|
7729
7730
|
if (!inject) return
|
|
7730
|
-
inject("data-v-
|
|
7731
|
-
,inject("data-v-
|
|
7731
|
+
inject("data-v-5cdc3f9f_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
7732
|
+
,inject("data-v-5cdc3f9f_1", { source: ".ele-batch-export__content[data-v-5cdc3f9f] {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container[data-v-5cdc3f9f] {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__icon[data-v-5cdc3f9f] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle[data-v-5cdc3f9f] {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn[data-v-5cdc3f9f] {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn--hint[data-v-5cdc3f9f] {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message[data-v-5cdc3f9f] {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\batch-export\\src\\index.vue","index.vue"],"names":[],"mappings":"AAuEA;EACA,aAAA;ACtEA;ADuEA;EACA,iBAAA;EACA,oBAAA;EACA,YAAA;EACA,mCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,eAAA;ACrEA;ADsEA;EACA,eAAA;EACA,4BAAA;ACpEA;ADsEA;EACA,iBAAA;ACpEA;ADqEA;EACA,4BAAA;EACA,eAAA;EACA,eAAA;ACnEA;ADqEA;EACA,4BAAA;EACA,eAAA;ACnEA;ADuEA;EACA,4BAAA;EACA,eAAA;ACrEA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <ele-modal \r\n v-model=\"innerValue\" \r\n v-on=\"$listeners\"\r\n :buttonGroupMeta=\"buttonGroupMeta\" \r\n title=\"批量导出\">\r\n <div class=\"ele-batch-export__content\">\r\n <div class=\"ele-batch-export__container\">\r\n <ele-icon class=\"ele-batch-export__icon\" type=\"download\"></ele-icon>\r\n <div class=\"ele-batch-export__handle\">\r\n <div class=\"ele-batch-export__btn\" @click=\"handleClick\">导出任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>\r\n <div class=\"ele-batch-export__btn--hint\">批处理任务的准备工作会在后台运行</div>\r\n </div>\r\n </div>\r\n <div class=\"ele-batch-export__message\">\r\n 您可以请点击上方按钮查看任务进度或关闭弹框\r\n </div>\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-batch-export',\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n elements: [\r\n {\r\n label: '关闭',\r\n key: 'close',\r\n type: 'primary',\r\n eventName: 'handleClose'\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n innerValue: false\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.$nextTick(() => {\r\n this.innerValue = value\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n handleClick () {\r\n this.$emit('on-batch-export')\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-batch-export__content {\r\n height: 106px;\r\n .ele-batch-export__container {\r\n border-width: 1px;\r\n border-style: dashed;\r\n height: 80px;\r\n border-color: var(--idooel-link-06);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: 0 16px;\r\n .ele-batch-export__icon {\r\n font-size: 48px;\r\n color: var(--idooel-link-06);\r\n }\r\n .ele-batch-export__handle {\r\n margin-left: 16px;\r\n .ele-batch-export__btn {\r\n color: var(--idooel-link-06);\r\n font-size: 16px;\r\n cursor: pointer;\r\n }\r\n .ele-batch-export__btn--hint {\r\n color: var(--idooel-link-03);\r\n font-size: 14px;\r\n }\r\n }\r\n }\r\n .ele-batch-export__message {\r\n color: var(--idooel-link-06);\r\n font-size: 14px;\r\n }\r\n}\r\n</style>",".ele-batch-export__content {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn--hint {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
7732
7733
|
|
|
7733
7734
|
};
|
|
7734
7735
|
/* scoped */
|
|
7735
|
-
const __vue_scope_id__$m = "data-v-
|
|
7736
|
+
const __vue_scope_id__$m = "data-v-5cdc3f9f";
|
|
7736
7737
|
/* module identifier */
|
|
7737
7738
|
const __vue_module_identifier__$m = undefined;
|
|
7738
7739
|
/* functional template */
|
|
@@ -7825,11 +7826,11 @@ __vue_render__$l._withStripped = true;
|
|
|
7825
7826
|
/* style */
|
|
7826
7827
|
const __vue_inject_styles__$l = function (inject) {
|
|
7827
7828
|
if (!inject) return
|
|
7828
|
-
inject("data-v-
|
|
7829
|
+
inject("data-v-28d8d270_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
7829
7830
|
|
|
7830
7831
|
};
|
|
7831
7832
|
/* scoped */
|
|
7832
|
-
const __vue_scope_id__$l = "data-v-
|
|
7833
|
+
const __vue_scope_id__$l = "data-v-28d8d270";
|
|
7833
7834
|
/* module identifier */
|
|
7834
7835
|
const __vue_module_identifier__$l = undefined;
|
|
7835
7836
|
/* functional template */
|
|
@@ -8046,12 +8047,12 @@ __vue_render__$k._withStripped = true;
|
|
|
8046
8047
|
/* style */
|
|
8047
8048
|
const __vue_inject_styles__$k = function (inject) {
|
|
8048
8049
|
if (!inject) return
|
|
8049
|
-
inject("data-v-
|
|
8050
|
-
,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 });
|
|
8050
|
+
inject("data-v-717789a6_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
8051
|
+
,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 });
|
|
8051
8052
|
|
|
8052
8053
|
};
|
|
8053
8054
|
/* scoped */
|
|
8054
|
-
const __vue_scope_id__$k = "data-v-
|
|
8055
|
+
const __vue_scope_id__$k = "data-v-717789a6";
|
|
8055
8056
|
/* module identifier */
|
|
8056
8057
|
const __vue_module_identifier__$k = undefined;
|
|
8057
8058
|
/* functional template */
|
|
@@ -8129,11 +8130,11 @@ __vue_render__$j._withStripped = true;
|
|
|
8129
8130
|
/* style */
|
|
8130
8131
|
const __vue_inject_styles__$j = function (inject) {
|
|
8131
8132
|
if (!inject) return
|
|
8132
|
-
inject("data-v-
|
|
8133
|
+
inject("data-v-45452493_0", { source: ".ele-text__wrapper[data-v-45452493] {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-text__wrapper.default .anticon[data-v-45452493], .ele-text__wrapper.default .message[data-v-45452493] {\n color: var(--idoole-black-064);\n}\n.ele-text__wrapper .anticon[data-v-45452493] {\n font-size: 16px;\n}\n.ele-text__wrapper .message[data-v-45452493] {\n font-size: 14px;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\text\\src\\index.vue","index.vue"],"names":[],"mappings":"AA8BA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC7BA;AD+BA;EACA,8BAAA;AC7BA;ADgCA;EACA,eAAA;AC9BA;ADgCA;EACA,eAAA;EACA,gBAAA;AC9BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div :class=\"['ele-text__wrapper', type]\">\r\n <ele-icon theme=\"filled\" :type=\"icon\"></ele-icon>\r\n <span class=\"message\">{{ message }}</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-text',\r\n props: {\r\n type: {\r\n String,\r\n // default success error warning info\r\n default: 'default'\r\n },\r\n message: {\r\n type: String\r\n }\r\n },\r\n computed: {\r\n icon() {\r\n return 'info-circle'\r\n }\r\n },\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n//\r\n.ele-text__wrapper {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.default {\r\n .anticon, .message {\r\n color: var(--idoole-black-064);\r\n }\r\n }\r\n .anticon {\r\n font-size: 16px;\r\n }\r\n .message {\r\n font-size: 14px;\r\n margin-left: 4px;\r\n }\r\n}\r\n</style>",".ele-text__wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-text__wrapper.default .anticon, .ele-text__wrapper.default .message {\n color: var(--idoole-black-064);\n}\n.ele-text__wrapper .anticon {\n font-size: 16px;\n}\n.ele-text__wrapper .message {\n font-size: 14px;\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
8133
8134
|
|
|
8134
8135
|
};
|
|
8135
8136
|
/* scoped */
|
|
8136
|
-
const __vue_scope_id__$j = "data-v-
|
|
8137
|
+
const __vue_scope_id__$j = "data-v-45452493";
|
|
8137
8138
|
/* module identifier */
|
|
8138
8139
|
const __vue_module_identifier__$j = undefined;
|
|
8139
8140
|
/* functional template */
|
|
@@ -8270,11 +8271,11 @@ __vue_render__$i._withStripped = true;
|
|
|
8270
8271
|
/* style */
|
|
8271
8272
|
const __vue_inject_styles__$i = function (inject) {
|
|
8272
8273
|
if (!inject) return
|
|
8273
|
-
inject("data-v-
|
|
8274
|
+
inject("data-v-9485b23c_0", { source: "[data-v-9485b23c] .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\tabs\\src\\index.vue","index.vue"],"names":[],"mappings":"AAoDA;EACA,sBAAA;ACnDA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div>\r\n <a-tabs :default-active-key=\"activeKey\" :tabBarGutter=\"tabBarGutter\" :tabBarStyle=\"tabBarStyle\" @change=\"changeHandle\">\r\n <a-tab-pane v-for=\"(item, index) in tabsList\" :key=\"index\" :tab=\"item.tabName\" :disabled=\"item.disabled\">\r\n <template #tab>\r\n <component v-if=\"item.renderHeader\" :is=\"item.renderHeader\" ></component>\r\n <span v-else>{{ item.tabName }}</span>\r\n </template>\r\n <component :is=\"item.content\"></component>\r\n </a-tab-pane>\r\n </a-tabs>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tabs',\r\n components: {},\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n activeKey: {\r\n type: Number,\r\n default: 0\r\n },\r\n tabsList: {\r\n type: Array,\r\n default () {\r\n return []\r\n }\r\n },\r\n tabBarStyle: {\r\n type: Object,\r\n default () {\r\n return {}\r\n }\r\n },\r\n tabBarGutter: {\r\n type: Number\r\n }\r\n },\r\n methods: {\r\n changeHandle (key) {\r\n this.$emit('changeActiveKey', key)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .ant-tabs-nav-scroll {\r\n float: left !important;\r\n}\r\n</style>","::v-deep .ant-tabs-nav-scroll {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
8274
8275
|
|
|
8275
8276
|
};
|
|
8276
8277
|
/* scoped */
|
|
8277
|
-
const __vue_scope_id__$i = "data-v-
|
|
8278
|
+
const __vue_scope_id__$i = "data-v-9485b23c";
|
|
8278
8279
|
/* module identifier */
|
|
8279
8280
|
const __vue_module_identifier__$i = undefined;
|
|
8280
8281
|
/* functional template */
|
|
@@ -12295,11 +12296,11 @@ __vue_render__$h._withStripped = true;
|
|
|
12295
12296
|
/* style */
|
|
12296
12297
|
const __vue_inject_styles__$h = function (inject) {
|
|
12297
12298
|
if (!inject) return
|
|
12298
|
-
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 });
|
|
12299
|
+
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 });
|
|
12299
12300
|
|
|
12300
12301
|
};
|
|
12301
12302
|
/* scoped */
|
|
12302
|
-
const __vue_scope_id__$h = "data-v-
|
|
12303
|
+
const __vue_scope_id__$h = "data-v-3676b54c";
|
|
12303
12304
|
/* module identifier */
|
|
12304
12305
|
const __vue_module_identifier__$h = undefined;
|
|
12305
12306
|
/* functional template */
|
|
@@ -12404,11 +12405,11 @@ __vue_render__$g._withStripped = true;
|
|
|
12404
12405
|
/* style */
|
|
12405
12406
|
const __vue_inject_styles__$g = function (inject) {
|
|
12406
12407
|
if (!inject) return
|
|
12407
|
-
inject("data-v-
|
|
12408
|
+
inject("data-v-05b001f6_0", { source: ".ele-editor__bottom[data-v-05b001f6] {\n height: 40px;\n padding: 8px 20px 8px 8px;\n border: 1px solid var(--idooel-form-title-border-color);\n border-top: 0px;\n}\n.ele-editor__bottom span[data-v-05b001f6] {\n color: var(--idoole-black-088);\n text-align: right;\n font-size: 12px;\n line-height: 20px;\n width: 100%;\n display: inline-block;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\text-editor\\src\\index.vue","index.vue"],"names":[],"mappings":"AA0DA;EACA,YAAA;EACA,yBAAA;EACA,uDAAA;EACA,eAAA;ACzDA;AD0DA;EACA,8BAAA;EACA,iBAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;EACA,qBAAA;ACxDA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-editor__wrapper\" :style=\"{width: editorWidth, height: editorHeight}\">\r\n <Vueditor :ref=\"getVueditor\" :style=\"{width: editorWidth, height: editorHeight}\"></Vueditor>\r\n <div class=\"ele-editor__bottom\">\r\n <span>{{ innerContent.length }}字</span>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v4 as uuidv4 } from 'uuid'\r\nexport default {\r\n name: 'ele-text-editor',\r\n props: {\r\n editorWidth: {\r\n type: String\r\n },\r\n editorHeight: {\r\n type: String\r\n },\r\n maxLength: {\r\n type: Number,\r\n default () {\r\n return 10\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n editorConfig: {},\r\n textEditorRef: null\r\n }\r\n },\r\n computed: {\r\n innerContent () {\r\n let content = this.textEditorRef ? this.textEditorRef.getContent() : ''\r\n if (this.textEditorRef && content.length > this.maxLength) {\r\n content = content.substring(0, this.maxLength)\r\n this.$nextTick(() => {\r\n this.textEditorRef.setContent(content)\r\n })\r\n }\r\n this.$emit('input', content)\r\n return content\r\n },\r\n getVueditor () {\r\n return uuidv4()\r\n }\r\n },\r\n watch: {},\r\n methods: {},\r\n mounted () {\r\n this.textEditorRef = this.$refs[this.getVueditor]\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-editor__bottom {\r\n height: 40px;\r\n padding: 8px 20px 8px 8px;\r\n border: 1px solid var(--idooel-form-title-border-color);\r\n border-top: 0px;\r\n span {\r\n color: var(--idoole-black-088);\r\n text-align: right;\r\n font-size: 12px;\r\n line-height: 20px;\r\n width: 100%;\r\n display: inline-block;\r\n }\r\n}\r\n</style>",".ele-editor__bottom {\n height: 40px;\n padding: 8px 20px 8px 8px;\n border: 1px solid var(--idooel-form-title-border-color);\n border-top: 0px;\n}\n.ele-editor__bottom span {\n color: var(--idoole-black-088);\n text-align: right;\n font-size: 12px;\n line-height: 20px;\n width: 100%;\n display: inline-block;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12408
12409
|
|
|
12409
12410
|
};
|
|
12410
12411
|
/* scoped */
|
|
12411
|
-
const __vue_scope_id__$g = "data-v-
|
|
12412
|
+
const __vue_scope_id__$g = "data-v-05b001f6";
|
|
12412
12413
|
/* module identifier */
|
|
12413
12414
|
const __vue_module_identifier__$g = undefined;
|
|
12414
12415
|
/* functional template */
|
|
@@ -12514,11 +12515,11 @@ __vue_render__$f._withStripped = true;
|
|
|
12514
12515
|
/* style */
|
|
12515
12516
|
const __vue_inject_styles__$f = function (inject) {
|
|
12516
12517
|
if (!inject) return
|
|
12517
|
-
inject("data-v-
|
|
12518
|
+
inject("data-v-468787f7_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
12518
12519
|
|
|
12519
12520
|
};
|
|
12520
12521
|
/* scoped */
|
|
12521
|
-
const __vue_scope_id__$f = "data-v-
|
|
12522
|
+
const __vue_scope_id__$f = "data-v-468787f7";
|
|
12522
12523
|
/* module identifier */
|
|
12523
12524
|
const __vue_module_identifier__$f = undefined;
|
|
12524
12525
|
/* functional template */
|
|
@@ -12577,11 +12578,11 @@ __vue_render__$e._withStripped = true;
|
|
|
12577
12578
|
/* style */
|
|
12578
12579
|
const __vue_inject_styles__$e = function (inject) {
|
|
12579
12580
|
if (!inject) return
|
|
12580
|
-
inject("data-v-
|
|
12581
|
+
inject("data-v-3750a094_0", { source: ".g-loading[data-v-3750a094] {\n width: 16px;\n height: 16px;\n border: 1px solid #409EFF;\n border-top-color: transparent;\n border-left-color: transparent;\n border-radius: 100%;\n animation: rotate-data-v-3750a094 infinite 0.75s linear;\n}\n@keyframes rotate-data-v-3750a094 {\n0% {\n transform: rotate(0);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\loading\\src\\index.vue","index.vue"],"names":[],"mappings":"AAmBA;EACA,WAAA;EACA,YAAA;EACA,yBAAA;EACA,6BAAA;EACA,8BAAA;EACA,mBAAA;EACA,uDAAA;AClBA;ADoBA;AACA;IACA,oBAAA;ACjBE;ADmBF;IACA,yBAAA;ACjBE;AACF;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div v-if=\"loading\" class=\"g-loading\">\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-loading',\r\n props: {\r\n loading: {\r\n type: Boolean,\r\n default: true\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-loading {\r\n width: 16px;\r\n height: 16px;\r\n border: 1px solid #409EFF;\r\n border-top-color: transparent;\r\n border-left-color: transparent;\r\n border-radius: 100%;\r\n animation: rotate infinite 0.75s linear;\r\n}\r\n@keyframes rotate {\r\n 0% {\r\n transform: rotate(0);\r\n }\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}\r\n</style>",".g-loading {\n width: 16px;\n height: 16px;\n border: 1px solid #409EFF;\n border-top-color: transparent;\n border-left-color: transparent;\n border-radius: 100%;\n animation: rotate infinite 0.75s linear;\n}\n\n@keyframes rotate {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
12581
12582
|
|
|
12582
12583
|
};
|
|
12583
12584
|
/* scoped */
|
|
12584
|
-
const __vue_scope_id__$e = "data-v-
|
|
12585
|
+
const __vue_scope_id__$e = "data-v-3750a094";
|
|
12585
12586
|
/* module identifier */
|
|
12586
12587
|
const __vue_module_identifier__$e = undefined;
|
|
12587
12588
|
/* functional template */
|
|
@@ -12776,11 +12777,11 @@ __vue_render__$d._withStripped = true;
|
|
|
12776
12777
|
/* style */
|
|
12777
12778
|
const __vue_inject_styles__$d = function (inject) {
|
|
12778
12779
|
if (!inject) return
|
|
12779
|
-
inject("data-v-
|
|
12780
|
+
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 });
|
|
12780
12781
|
|
|
12781
12782
|
};
|
|
12782
12783
|
/* scoped */
|
|
12783
|
-
const __vue_scope_id__$d = "data-v-
|
|
12784
|
+
const __vue_scope_id__$d = "data-v-8b1c2320";
|
|
12784
12785
|
/* module identifier */
|
|
12785
12786
|
const __vue_module_identifier__$d = undefined;
|
|
12786
12787
|
/* functional template */
|
|
@@ -12842,11 +12843,11 @@ __vue_render__$c._withStripped = true;
|
|
|
12842
12843
|
/* style */
|
|
12843
12844
|
const __vue_inject_styles__$c = function (inject) {
|
|
12844
12845
|
if (!inject) return
|
|
12845
|
-
inject("data-v-
|
|
12846
|
+
inject("data-v-45e85742_0", { source: ".g-search__label[data-v-45e85742] {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title[data-v-45e85742], .g-search__label .label__suffix[data-v-45e85742] {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix[data-v-45e85742] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\search-area\\src\\label.vue","label.vue"],"names":[],"mappings":"AAkBA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACjBA;ADkBA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;AChBA;ADkBA;EACA,gBAAA;AChBA;;AAEA,oCAAoC","file":"label.vue","sourcesContent":["<template>\r\n <div class=\"g-search__label\">\r\n <span class=\"label__title\">{{ label }}</span>\r\n <span class=\"label__suffix\">:</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n label: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-search__label {\r\n /* width: 69px; */\r\n flex-basis: 69px;\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n .label__title, .label__suffix {\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.88);\r\n white-space: nowrap;\r\n }\r\n .label__suffix {\r\n margin-left: 4px;\r\n }\r\n}\r\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
|
|
12846
12847
|
|
|
12847
12848
|
};
|
|
12848
12849
|
/* scoped */
|
|
12849
|
-
const __vue_scope_id__$c = "data-v-
|
|
12850
|
+
const __vue_scope_id__$c = "data-v-45e85742";
|
|
12850
12851
|
/* module identifier */
|
|
12851
12852
|
const __vue_module_identifier__$c = undefined;
|
|
12852
12853
|
/* functional template */
|
|
@@ -13234,11 +13235,11 @@ __vue_render__$b._withStripped = true;
|
|
|
13234
13235
|
/* style */
|
|
13235
13236
|
const __vue_inject_styles__$b = function (inject) {
|
|
13236
13237
|
if (!inject) return
|
|
13237
|
-
inject("data-v-70ebbeba_0", { source: ".search-area__wrapper[data-v-70ebbeba] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-70ebbeba] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-70ebbeba] {\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-70ebbeba] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-70ebbeba] {\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-70ebbeba] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-70ebbeba] {\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":"AAyMA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACxMA;AD0MA;EACA,YAAA;ACxMA;AD2MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACzMA;AD0MA;EACA,oBAAA;ACxMA;AD0MA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACxMA;ADyMA;EACA,eAAA;ACvMA;ADyMA;EACA,eAAA;EACA,gBAAA;ACvMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <template v-for=\"(item, idx) in innerDataSource\">\r\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n <div v-if=\"innerDataSource.length > cuttingFormula + 1\" class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\r\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\r\n <span class=\"expand-collapse__icon\">\r\n <a-icon v-if=\"isExpand\" type=\"up\" />\r\n <a-icon v-else type=\"down\" />\r\n </span>\r\n </div>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"(item.type == 'ele-input') || (item.type == 'Input')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"(item.type == 'ele-select') || (item.type == 'Select')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :init=\"item.init\" :mode=\"item.mode\" :code=\"item.code\" :params=\"item.params\" :url=\"item.url\" :multiple=\"item.multiple\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"(item.type == 'ele-date') || (item.type == 'DatePicker')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :placeholder=\"item.placeholder\" :format=\"item.format\"></ele-date>\r\n </template>\r\n <template v-else-if=\"item.type == 'ele-date-range'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date-range v-model=\"item._value\" :format=\"item.format\" :show-time=\"item.showTime\"></ele-date-range>\r\n </template>\r\n </div>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n Label\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n isExpand: false\r\n }\r\n },\r\n computed: {\r\n cuttingFormula () {\r\n return (24 / this.span - 1)\r\n },\r\n buildDataSource () {\r\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\r\n },\r\n innerDataSource () {\r\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\r\n }\r\n },\r\n created() {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n methods: {\r\n controlDisplayByFormula (dataSource = []) {\r\n if (this.isExpand) {\r\n dataSource.forEach(item => {\r\n this.$set(item, '_show', true)\r\n })\r\n } else {\r\n dataSource.forEach((item, idx) => {\r\n if (idx < this.cuttingFormula) {\r\n this.$set(item, '_show', true)\r\n } else {\r\n this.$set(item, '_show', false)\r\n }\r\n })\r\n }\r\n return dataSource\r\n },\r\n buildDefaultValue (arg) {\r\n if (type.isFunction(arg)) return arg.call(this)\r\n if (type.notStr(arg)) return arg\r\n if (!arg || arg.charAt(0) !== '_') return arg\r\n return parse(arg, {\r\n _route: this.$route.query\r\n })\r\n },\r\n mapDefaultValueToValue () {\r\n this.dataSource.forEach(props => {\r\n this.$set(props, '_show', this.isExpand)\r\n if (props.defaultValue) {\r\n if (type.isFunction(props.defaultValue)) {\r\n const ret = props.defaultValue.call(this)\r\n this.$set(props, '_value', this.buildDefaultValue(ret))\r\n } else {\r\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\r\n }\r\n }\r\n })\r\n return this.dataSource\r\n },\r\n handleClickExpandCollapse () {\r\n this.isExpand = !this.isExpand\r\n },\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n buildMapto (mapTo = [], dataSource) {\r\n const [ startField, endField ] = mapTo\r\n const [ startValue, endValue ] = dataSource || [null, null]\r\n return {\r\n [startField]: startValue,\r\n [endField]: endValue\r\n }\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n case 'ele-date-range':\r\n if (item.mapTo) {\r\n Object.assign(ret, this.buildMapto(item.mapTo, item._value))\r\n } else {\r\n ret[item.name] = (item._value || []).join(',')\r\n }\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n cleanValues () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n const { defaultValue } = item\r\n switch (item.type) {\r\n case 'Select':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', undefined)\r\n break\r\n case 'ele-date-range':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', [])\r\n break\r\n default:\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n },\r\n handleClickReset () {\r\n this.cleanValues()\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n },\r\n destroyed () {\r\n this.cleanValues()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.search-area--action {\r\n justify-content: end;\r\n }\r\n .expand-collapse {\r\n margin-left: 8px;\r\n height: 32px;\r\n padding: 4px 16px;\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n .expand-collapse__text {\r\n font-size: 14px;\r\n }\r\n .expand-collapse__icon {\r\n font-size: 16px;\r\n margin-left: 8px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
13238
|
+
inject("data-v-77b7e5ba_0", { source: ".search-area__wrapper[data-v-77b7e5ba] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-77b7e5ba] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-77b7e5ba] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action[data-v-77b7e5ba] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-77b7e5ba] {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text[data-v-77b7e5ba] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-77b7e5ba] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyMA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACxMA;AD0MA;EACA,YAAA;ACxMA;AD2MA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACzMA;AD0MA;EACA,oBAAA;ACxMA;AD0MA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACxMA;ADyMA;EACA,eAAA;ACvMA;ADyMA;EACA,eAAA;EACA,gBAAA;ACvMA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <template v-for=\"(item, idx) in innerDataSource\">\r\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n <div v-if=\"innerDataSource.length > cuttingFormula + 1\" class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\r\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\r\n <span class=\"expand-collapse__icon\">\r\n <a-icon v-if=\"isExpand\" type=\"up\" />\r\n <a-icon v-else type=\"down\" />\r\n </span>\r\n </div>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"(item.type == 'ele-input') || (item.type == 'Input')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"(item.type == 'ele-select') || (item.type == 'Select')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :init=\"item.init\" :mode=\"item.mode\" :code=\"item.code\" :params=\"item.params\" :url=\"item.url\" :multiple=\"item.multiple\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"(item.type == 'ele-date') || (item.type == 'DatePicker')\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :placeholder=\"item.placeholder\" :format=\"item.format\"></ele-date>\r\n </template>\r\n <template v-else-if=\"item.type == 'ele-date-range'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date-range v-model=\"item._value\" :format=\"item.format\" :show-time=\"item.showTime\"></ele-date-range>\r\n </template>\r\n </div>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n Label\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n isExpand: false\r\n }\r\n },\r\n computed: {\r\n cuttingFormula () {\r\n return (24 / this.span - 1)\r\n },\r\n buildDataSource () {\r\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\r\n },\r\n innerDataSource () {\r\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\r\n }\r\n },\r\n created() {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n methods: {\r\n controlDisplayByFormula (dataSource = []) {\r\n if (this.isExpand) {\r\n dataSource.forEach(item => {\r\n this.$set(item, '_show', true)\r\n })\r\n } else {\r\n dataSource.forEach((item, idx) => {\r\n if (idx < this.cuttingFormula) {\r\n this.$set(item, '_show', true)\r\n } else {\r\n this.$set(item, '_show', false)\r\n }\r\n })\r\n }\r\n return dataSource\r\n },\r\n buildDefaultValue (arg) {\r\n if (type.isFunction(arg)) return arg.call(this)\r\n if (type.notStr(arg)) return arg\r\n if (!arg || arg.charAt(0) !== '_') return arg\r\n return parse(arg, {\r\n _route: this.$route.query\r\n })\r\n },\r\n mapDefaultValueToValue () {\r\n this.dataSource.forEach(props => {\r\n this.$set(props, '_show', this.isExpand)\r\n if (props.defaultValue) {\r\n if (type.isFunction(props.defaultValue)) {\r\n const ret = props.defaultValue.call(this)\r\n this.$set(props, '_value', this.buildDefaultValue(ret))\r\n } else {\r\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\r\n }\r\n }\r\n })\r\n return this.dataSource\r\n },\r\n handleClickExpandCollapse () {\r\n this.isExpand = !this.isExpand\r\n },\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n buildMapto (mapTo = [], dataSource) {\r\n const [ startField, endField ] = mapTo\r\n const [ startValue, endValue ] = dataSource || [null, null]\r\n return {\r\n [startField]: startValue,\r\n [endField]: endValue\r\n }\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n case 'ele-date-range':\r\n if (item.mapTo) {\r\n Object.assign(ret, this.buildMapto(item.mapTo, item._value))\r\n } else {\r\n ret[item.name] = (item._value || []).join(',')\r\n }\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n cleanValues () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n const { defaultValue } = item\r\n switch (item.type) {\r\n case 'Select':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', undefined)\r\n break\r\n case 'ele-date-range':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', [])\r\n break\r\n default:\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n },\r\n handleClickReset () {\r\n this.cleanValues()\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n },\r\n destroyed () {\r\n this.cleanValues()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.search-area--action {\r\n justify-content: end;\r\n }\r\n .expand-collapse {\r\n margin-left: 8px;\r\n height: 32px;\r\n padding: 4px 16px;\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n .expand-collapse__text {\r\n font-size: 14px;\r\n }\r\n .expand-collapse__icon {\r\n font-size: 16px;\r\n margin-left: 8px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
13238
13239
|
|
|
13239
13240
|
};
|
|
13240
13241
|
/* scoped */
|
|
13241
|
-
const __vue_scope_id__$b = "data-v-
|
|
13242
|
+
const __vue_scope_id__$b = "data-v-77b7e5ba";
|
|
13242
13243
|
/* module identifier */
|
|
13243
13244
|
const __vue_module_identifier__$b = undefined;
|
|
13244
13245
|
/* functional template */
|
|
@@ -13481,11 +13482,11 @@ __vue_render__$a._withStripped = true;
|
|
|
13481
13482
|
/* style */
|
|
13482
13483
|
const __vue_inject_styles__$a = function (inject) {
|
|
13483
13484
|
if (!inject) return
|
|
13484
|
-
inject("data-v-
|
|
13485
|
+
inject("data-v-6e62914a_0", { source: ".button-group__wrapper[data-v-6e62914a] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-6e62914a] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-6e62914a]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\button-group\\src\\index.vue","index.vue"],"names":[],"mappings":"AA4IA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;AC3IA;AD4IA;EACA,gBAAA;AC1IA;AD2IA;EACA,cAAA;ACzIA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"button-group__wrapper\">\r\n <template v-for=\"(item, idx) in innerDatasource\" >\r\n <ele-button\r\n v-if=\"isBool(item._show) ? item._show : true\"\r\n :type=\"item.type\"\r\n :icon=\"item.icon\"\r\n :mode=\"item.mode\"\r\n :data-source=\"item.optionList\"\r\n :event-name=\"item.eventName\"\r\n :record=\"item\"\r\n v-on=\"overrideButtonEvent\"\r\n :key=\"idx\">\r\n {{ item.label }}\r\n </ele-button>\r\n </template>\r\n <ele-modal-confirm v-model=\"modalConfirmValue\" :contextProp=\"currentContext\" v-on=\"overrideModalConfirmEvent\" v-bind=\"modalConfirmMeta\"></ele-modal-confirm>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { type, util } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nimport { CONTEXT, AREA_NAMES } from '../../../utils'\r\nexport default {\r\n name: 'ele-button-group',\r\n props: {\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n data() {\r\n return {\r\n innerDatasource: [],\r\n modalConfirmValue: false,\r\n modalConfirmMeta: {}\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n computed: {\r\n callContext () {\r\n return this[CONTEXT].call(this)\r\n },\r\n currentExposed () {\r\n const exposed = Object.assign({}, this.callContext.exposed || {}, { [AREA_NAMES.BUTTON_GROUP]: { setModalConfirm: this.setModalConfirm } })\r\n return exposed\r\n },\r\n contextData () {\r\n return {\r\n ...this.currentContext,\r\n exposed: this.currentExposed\r\n }\r\n },\r\n overrideButtonEvent () {\r\n const events = this.dataSource.reduce((ret, item) => {\r\n const { mode, optionList = [] } = item\r\n if (mode == 'dropdown') {\r\n optionList.forEach(props => {\r\n ret[props.eventName || 'click'] = (e) => {\r\n const { modalConfirm } = props\r\n modalConfirm && (this.modalConfirmMeta = modalConfirm)\r\n if (this.preventModalConfirm(modalConfirm)) {\r\n this.$emit(props.eventName || 'click', { ...e, ...props, record: props, ...this.contextData })\r\n return\r\n }\r\n modalConfirm && (this.modalConfirmValue = true)\r\n this.$emit(props.eventName || 'click', { ...e, ...props, record: props, ...this.contextData })\r\n }\r\n })\r\n }\r\n ret[item.eventName || 'click'] = (e) => {\r\n const { modalConfirm } = item\r\n modalConfirm && (this.modalConfirmMeta = modalConfirm)\r\n if (this.preventModalConfirm(modalConfirm)) {\r\n this.$emit(item.eventName || 'click', { ...e, record: item, ...this.contextData })\r\n return\r\n }\r\n modalConfirm && (this.modalConfirmValue = true)\r\n this.$emit(item.eventName || 'click', { ...e, record: item, ...this.contextData })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n ...this.contextData\r\n }\r\n },\r\n overrideModalConfirmEvent () {\r\n return {\r\n ...this.$listeners\r\n }\r\n },\r\n currentContext () {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n ...this.callContext\r\n }\r\n }\r\n },\r\n watch: {\r\n dataSource: {\r\n handler (dataSource) {\r\n this.innerDatasource = dataSource.map(item => {\r\n return {\r\n ...item,\r\n _show: this.executeExpression(item.show)\r\n }\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n setModalConfirm (arg = false) {\r\n this.modalConfirmValue = arg\r\n },\r\n preventModalConfirm (modalConfirm = {}) {\r\n const { show } = modalConfirm\r\n return !this.executeExpression(show)\r\n },\r\n executeExpression (expression) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return true\r\n return parse(expression, { ...this.currentContext, ...this.contextData })\r\n },\r\n isBool (arg) {\r\n return type.isBool(arg)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.button-group__wrapper {\r\n display: flex;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n .ant-btn {\r\n margin-left: 8px;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
13485
13486
|
|
|
13486
13487
|
};
|
|
13487
13488
|
/* scoped */
|
|
13488
|
-
const __vue_scope_id__$a = "data-v-
|
|
13489
|
+
const __vue_scope_id__$a = "data-v-6e62914a";
|
|
13489
13490
|
/* module identifier */
|
|
13490
13491
|
const __vue_module_identifier__$a = undefined;
|
|
13491
13492
|
/* functional template */
|
|
@@ -13997,11 +13998,11 @@ __vue_render__$8._withStripped = true;
|
|
|
13997
13998
|
/* style */
|
|
13998
13999
|
const __vue_inject_styles__$8 = function (inject) {
|
|
13999
14000
|
if (!inject) return
|
|
14000
|
-
inject("data-v-
|
|
14001
|
+
inject("data-v-59b22738_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
14001
14002
|
|
|
14002
14003
|
};
|
|
14003
14004
|
/* scoped */
|
|
14004
|
-
const __vue_scope_id__$8 = "data-v-
|
|
14005
|
+
const __vue_scope_id__$8 = "data-v-59b22738";
|
|
14005
14006
|
/* module identifier */
|
|
14006
14007
|
const __vue_module_identifier__$8 = undefined;
|
|
14007
14008
|
/* functional template */
|
|
@@ -14161,12 +14162,12 @@ __vue_render__$7._withStripped = true;
|
|
|
14161
14162
|
/* style */
|
|
14162
14163
|
const __vue_inject_styles__$7 = function (inject) {
|
|
14163
14164
|
if (!inject) return
|
|
14164
|
-
inject("data-v-
|
|
14165
|
-
,inject("data-v-
|
|
14165
|
+
inject("data-v-11e1b8a0_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
14166
|
+
,inject("data-v-11e1b8a0_1", { source: ".ele-modal-confirm__content[data-v-11e1b8a0] {\n margin-top: 8px;\n color: var(--idoole-black-088);\n font-size: 14px;\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\modal-confirm\\src\\index.vue","index.vue"],"names":[],"mappings":"AAiGA;EACA,eAAA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;AChGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <ele-modal :title=\"title\" :value=\"value\" :size=\"size\" @cancel=\"onCancel\" v-on=\"overrideEvents\" :buttonGroupMeta=\"buttonGroupMeta\">\r\n <ele-alert v-if=\"alert\" v-bind=\"alert\"></ele-alert>\r\n <div v-if=\"contentText\" class=\"ele-modal-confirm__content\">\r\n {{ contentText }}\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport { CONTEXT } from '../../../utils'\r\nexport default {\r\n name: 'ele-modal-confirm',\r\n model: {\r\n event: 'change',\r\n prop: 'value'\r\n },\r\n props: {\r\n title: {\r\n type: String\r\n },\r\n size: {\r\n type: String,\r\n default: 'small'\r\n },\r\n alert: {\r\n type: [Object, Boolean],\r\n default: () => ({\r\n type: 'warning',\r\n message: '确定要删除吗?',\r\n description: '删除后将无法恢复',\r\n closable: false\r\n })\r\n },\r\n contentText: {\r\n type: String\r\n },\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object\r\n },\r\n //!deprecated\r\n contextProp: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n inject: {\r\n [CONTEXT]: {\r\n default: () => (() => ({}))\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n currentContext () {\r\n const { exposed: exposedData = {} } = this[CONTEXT]()\r\n const exposed = Object.assign({}, exposedData, { closeModalConfirm: this.closeModalConfirm })\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n ...this[CONTEXT](),\r\n exposed\r\n }\r\n },\r\n overrideEvents () {\r\n if (!this.buttonGroupMeta) return {}\r\n const { elements = [] } = this.buttonGroupMeta\r\n const events = elements.reduce((ret, ele) =>{\r\n ret[ele.eventName || 'click'] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, ...this.currentContext })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...events\r\n }\r\n }\r\n },\r\n methods: {\r\n closeModalConfirm () {\r\n this.$emit('change', false)\r\n },\r\n onCancel () {\r\n this.$emit('change', false)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-modal-confirm__content {\r\n margin-top: 8px;\r\n color: var(--idoole-black-088);\r\n font-size: 14px;\r\n line-height: 22px;\r\n}\r\n</style>",".ele-modal-confirm__content {\n margin-top: 8px;\n color: var(--idoole-black-088);\n font-size: 14px;\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
14166
14167
|
|
|
14167
14168
|
};
|
|
14168
14169
|
/* scoped */
|
|
14169
|
-
const __vue_scope_id__$7 = "data-v-
|
|
14170
|
+
const __vue_scope_id__$7 = "data-v-11e1b8a0";
|
|
14170
14171
|
/* module identifier */
|
|
14171
14172
|
const __vue_module_identifier__$7 = undefined;
|
|
14172
14173
|
/* functional template */
|
|
@@ -14409,11 +14410,11 @@ __vue_render__$6._withStripped = true;
|
|
|
14409
14410
|
/* style */
|
|
14410
14411
|
const __vue_inject_styles__$6 = function (inject) {
|
|
14411
14412
|
if (!inject) return
|
|
14412
|
-
inject("data-v-
|
|
14413
|
+
inject("data-v-3d3d1b6e_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
14413
14414
|
|
|
14414
14415
|
};
|
|
14415
14416
|
/* scoped */
|
|
14416
|
-
const __vue_scope_id__$6 = "data-v-
|
|
14417
|
+
const __vue_scope_id__$6 = "data-v-3d3d1b6e";
|
|
14417
14418
|
/* module identifier */
|
|
14418
14419
|
const __vue_module_identifier__$6 = undefined;
|
|
14419
14420
|
/* functional template */
|
|
@@ -14608,11 +14609,11 @@ __vue_render__$5._withStripped = true;
|
|
|
14608
14609
|
/* style */
|
|
14609
14610
|
const __vue_inject_styles__$5 = function (inject) {
|
|
14610
14611
|
if (!inject) return
|
|
14611
|
-
inject("data-v-
|
|
14612
|
+
inject("data-v-cc928cfe_0", { source: ".ele__img--form .form__img--wrapper[data-v-cc928cfe] {\n cursor: pointer;\n border-radius: 4px;\n background: #000;\n opacity: 0.3;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n position: relative;\n}\n.ele__img--form .form__img--wrapper .form__img--preivew[data-v-cc928cfe] {\n position: absolute;\n color: red;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper[data-v-cc928cfe] {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n color: #fff;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon--oper[data-v-cc928cfe] {\n font-size: 40px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon__text--oper[data-v-cc928cfe] {\n font-size: 16px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\composite-components\\form-img-crop\\src\\index.vue","index.vue"],"names":[],"mappings":"AAmGA;EACA,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,kBAAA;AClGA;ADmGA;EACA,kBAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;ACjGA;ADmGA;EACA,kBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,WAAA;ACjGA;ADkGA;EACA,eAAA;AChGA;ADkGA;EACA,eAAA;AChGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele__img--form\">\r\n <div class=\"form__img--wrapper\" \r\n @click=\"handleClick\" \r\n :style=\"style\">\r\n <div class=\"form__img--preivew\" v-if=\"value\">\r\n <img style=\"width:100%;height:100%\" :src=\"imageUrl\" alt=\"\" srcset=\"\">\r\n </div>\r\n <div class=\"form__icon--wrapper\">\r\n <ele-icon class=\"icon--oper\" type=\"icon-camera\"></ele-icon>\r\n <span class=\"icon__text--oper\">{{ operText }}</span>\r\n </div>\r\n </div>\r\n <ele-modal-img-crop \r\n v-model=\"showModalImgCropValue\"\r\n :uploadFileConfig=\"uploadFileConfig\"\r\n @change=\"onChangeModalCropImg\"\r\n :cropperConfig=\"cropperConfig\"\r\n :imageId=\"value\"\r\n :title=\"modalTitle\">\r\n </ele-modal-img-crop>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-form-img-crop',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Number]\r\n },\r\n modalTitle: {\r\n type: String\r\n },\r\n operText: {\r\n type: String,\r\n default: '更改头像'\r\n },\r\n width: {\r\n type: [Number, String],\r\n default: 200\r\n },\r\n height: {\r\n type: [Number, String],\r\n default: 200\r\n },\r\n cropperConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n aspectRatio: 16 / 9\r\n }\r\n }\r\n },\r\n uploadFileConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n size: 10,\r\n accept: '*',\r\n byteConversion: 1024 * 1024\r\n }\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n showModalImgCropValue: false\r\n }\r\n },\r\n computed: {\r\n style () {\r\n return {\r\n width: this.width + 'px',\r\n height: this.height + 'px'\r\n }\r\n },\r\n imageUrl () {\r\n return `/api-file/workbench/file/stream/${this.value}?origin=true`\r\n }\r\n },\r\n methods: {\r\n handleClick () {\r\n this.showModalImgCropValue = true\r\n },\r\n onChangeModalCropImg (fileId) {\r\n console.log('fileId', fileId)\r\n this.$emit('change', fileId)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele__img--form {\r\n .form__img--wrapper {\r\n cursor: pointer;\r\n border-radius: 4px;\r\n background: #000;\r\n opacity: 0.3;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n .form__img--preivew {\r\n position: absolute;\r\n color: red;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 4px;\r\n }\r\n .form__icon--wrapper {\r\n position: absolute;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n color: #fff;\r\n .icon--oper {\r\n font-size: 40px;\r\n }\r\n .icon__text--oper {\r\n font-size: 16px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".ele__img--form .form__img--wrapper {\n cursor: pointer;\n border-radius: 4px;\n background: #000;\n opacity: 0.3;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n position: relative;\n}\n.ele__img--form .form__img--wrapper .form__img--preivew {\n position: absolute;\n color: red;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n color: #fff;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon--oper {\n font-size: 40px;\n}\n.ele__img--form .form__img--wrapper .form__icon--wrapper .icon__text--oper {\n font-size: 16px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
14612
14613
|
|
|
14613
14614
|
};
|
|
14614
14615
|
/* scoped */
|
|
14615
|
-
const __vue_scope_id__$5 = "data-v-
|
|
14616
|
+
const __vue_scope_id__$5 = "data-v-cc928cfe";
|
|
14616
14617
|
/* module identifier */
|
|
14617
14618
|
const __vue_module_identifier__$5 = undefined;
|
|
14618
14619
|
/* functional template */
|
|
@@ -15170,12 +15171,12 @@ __vue_render__$3._withStripped = true;
|
|
|
15170
15171
|
/* style */
|
|
15171
15172
|
const __vue_inject_styles__$3 = function (inject) {
|
|
15172
15173
|
if (!inject) return
|
|
15173
|
-
inject("data-v-
|
|
15174
|
-
,inject("data-v-
|
|
15174
|
+
inject("data-v-49352923_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 })
|
|
15175
|
+
,inject("data-v-49352923_1", { source: ".import-download__link[data-v-49352923] {\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-49352923] {\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-49352923] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right[data-v-49352923] {\n margin-left: 16px;\n}\n.ele-modal-import__hint .import-hint__content .import-hint__right .hint-right__title[data-v-49352923] {\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-49352923] {\n font-size: 14px;\n color: var(--idooel-link-03);\n}\n.ele-modal-import__hint .import-footer__hint--text[data-v-49352923] {\n font-size: 14px;\n color: var(--idooel-link-06);\n line-height: 22px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\business-components\\modal-import\\src\\index.vue","index.vue"],"names":[],"mappings":"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 });
|
|
15175
15176
|
|
|
15176
15177
|
};
|
|
15177
15178
|
/* scoped */
|
|
15178
|
-
const __vue_scope_id__$3 = "data-v-
|
|
15179
|
+
const __vue_scope_id__$3 = "data-v-49352923";
|
|
15179
15180
|
/* module identifier */
|
|
15180
15181
|
const __vue_module_identifier__$3 = undefined;
|
|
15181
15182
|
/* functional template */
|
|
@@ -15316,11 +15317,11 @@ __vue_render__$2._withStripped = true;
|
|
|
15316
15317
|
/* style */
|
|
15317
15318
|
const __vue_inject_styles__$2 = function (inject) {
|
|
15318
15319
|
if (!inject) return
|
|
15319
|
-
inject("data-v-
|
|
15320
|
+
inject("data-v-1f132055_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
15320
15321
|
|
|
15321
15322
|
};
|
|
15322
15323
|
/* scoped */
|
|
15323
|
-
const __vue_scope_id__$2 = "data-v-
|
|
15324
|
+
const __vue_scope_id__$2 = "data-v-1f132055";
|
|
15324
15325
|
/* module identifier */
|
|
15325
15326
|
const __vue_module_identifier__$2 = undefined;
|
|
15326
15327
|
/* functional template */
|
|
@@ -15529,12 +15530,12 @@ __vue_render__$1._withStripped = true;
|
|
|
15529
15530
|
/* style */
|
|
15530
15531
|
const __vue_inject_styles__$1 = function (inject) {
|
|
15531
15532
|
if (!inject) return
|
|
15532
|
-
inject("data-v-
|
|
15533
|
-
,inject("data-v-
|
|
15533
|
+
inject("data-v-1c7f4c3c_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n.margin-t-8 {\n margin-top: 8px;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,eAAe;AACjB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,uCAAuC;EACvC,uCAAuC;EACvC,mDAAmD;EACnD,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,2CAA2C;EAC3C,6BAA6B;EAC7B,iCAAiC;EACjC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;EACzB,oCAAoC;AACtC;AAEA;EACE,4DAA4D;AAC9D;AAEA;EACE,4DAA4D;AAC9D;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n.margin-t-8 {\n margin-top: 8px;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-064: rgba(0, 0, 0, 0.64);\n --idoole-black-088: rgba(0, 0, 0, 0.88);\n --idoole-black-016: rgba(0, 0, 0, 0.16);\n --idooel-disabled-border-color: rgba(0, 0, 0, 0.16);\n --idoole-success-06: #52C41A;\n --idoole-warning-06: #FAAD14;\n --idoole-error-06: #F5222D;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-row-odd-color: rgba(0, 0, 0, 0.04);\n --idooel-row-even-color: #FFF;\n --idooel-row-hover-color: #E6F7FF;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n --idooel-img-crop-err-color: #FFA39E;\n}\n\n.ant-input-disabled {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n.ant-select-disabled .ant-select-selection {\n border-color: var(--idooel-disabled-border-color) !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
|
15534
|
+
,inject("data-v-1c7f4c3c_1", { source: ".ele-modal-fsm__display[data-v-1c7f4c3c] {\n display: flex;\n flex-direction: row;\n font-size: 14px;\n line-height: 22px;\n}\n.ele-modal-fsm__display .fms-display__name[data-v-1c7f4c3c], .ele-modal-fsm__display .fms-display__action[data-v-1c7f4c3c] {\n font-weight: bold;\n color: var(--idoole-black-088);\n}\n.ele-modal-fsm__display .fms-display__name[data-v-1c7f4c3c]::before, .ele-modal-fsm__display .fms-display__action[data-v-1c7f4c3c]::before {\n content: \"\";\n margin-left: 4px;\n}\n.ele-modal-fsm__display .fms-display__name[data-v-1c7f4c3c]::after, .ele-modal-fsm__display .fms-display__action[data-v-1c7f4c3c]::after {\n content: \"\";\n margin-right: 4px;\n}\n.ele-modal-fsm__display .title-info[data-v-1c7f4c3c] {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-modal-fsm__display .title-info[data-v-1c7f4c3c]::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-modal-fsm__display .title-info.success[data-v-1c7f4c3c]::before {\n background: var(--idoole-success-06);\n}\n.ele-modal-fsm__display .title-info.warning[data-v-1c7f4c3c]::before {\n background: var(--idoole-warning-06);\n}\n.ele-modal-fsm__display .title-info.error[data-v-1c7f4c3c]::before {\n background: var(--idoole-error-06);\n}\n.ele-modal-fsm__opinion-wrapper[data-v-1c7f4c3c] {\n margin-top: 4px;\n line-height: 22px;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__label[data-v-1c7f4c3c] {\n width: 42px;\n flex-shrink: 0;\n color: var(--idoole-black-064);\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__value[data-v-1c7f4c3c] {\n color: var(--idoole-black-088);\n font-weight: bold;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\business-components\\modal-fsm\\src\\index.vue","index.vue"],"names":[],"mappings":"AAkGA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;ACjGA;ADkGA;EACA,iBAAA;EACA,8BAAA;AChGA;ADiGA;EACA,WAAA;EACA,gBAAA;AC/FA;ADiGA;EACA,WAAA;EACA,iBAAA;AC/FA;ADkGA;EACA,eAAA;EACA,8BAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AChGA;ADiGA;EACA,WAAA;EACA,qBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,iBAAA;AC/FA;ADkGA;EACA,oCAAA;AChGA;ADoGA;EACA,oCAAA;AClGA;ADsGA;EACA,kCAAA;ACpGA;ADyGA;EACA,eAAA;EACA,iBAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;ACtGA;ADuGA;EACA,WAAA;EACA,cAAA;EACA,8BAAA;ACrGA;ADuGA;EACA,8BAAA;EACA,iBAAA;ACrGA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <ele-modal v-on=\"$listeners\" :value=\"value\" :title=\"meta.title || title\" @cancel=\"handleCancel\" :buttonGroupMeta=\"buttonGroupMeta\">\r\n <slot name=\"alert\"></slot>\r\n <ele-timeline v-bind=\"meta\">\r\n <template #right=\"{ data: item }\">\r\n <div class=\"ele-modal-fsm__display\">\r\n <span>由</span>\r\n <span class=\"fms-display__name\">{{ item.userName || '管理员' }}</span>\r\n <span>执行了</span>\r\n <span class=\"fms-display__action\">{{ item.action || '结班' }}</span>\r\n <span>操作</span>\r\n <span :class=\"['title-info', item.state == 1 && 'success', item.state == 2 && 'warning', item.state == 3 && 'error']\">{{ item.stateName }}</span>\r\n </div>\r\n <div class=\"ele-modal-fsm__opinion-wrapper\">\r\n <div class=\"fsm-opinion__label\">意见:</div>\r\n <div class=\"fsm-opinion__value\">{{ item.opinion }}</div>\r\n </div>\r\n </template>\r\n </ele-timeline>\r\n <template v-if=\"showTextSlot\" #footer-text>\r\n <ele-text v-bind=\"textAttrs\"></ele-text>\r\n </template>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport { CONTEXT } from '../../../utils'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-modal-fsm',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: '状态变更记录'\r\n },\r\n meta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n elements: [\r\n {\r\n label: '关闭',\r\n key: 'cancel',\r\n type: 'default',\r\n eventName: 'cancel'\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n contextProp: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n provide() {\r\n return {\r\n [CONTEXT]: () => {\r\n return {\r\n _route: this.$route.query,\r\n _routeMeta: this.$route.meta,\r\n ...this.contextProp\r\n }\r\n }\r\n }\r\n },\r\n computed: {\r\n showTextSlot () {\r\n return !type.isEmpty(this.textAttrs)\r\n },\r\n textAttrs() {\r\n const { text = {} } = this.buttonGroupMeta\r\n return text\r\n }\r\n },\r\n methods: {\r\n handleCancel () {\r\n this.$emit('change', false)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\">\r\n@import '../../../theme/index';\r\n</style>\r\n<style lang=\"scss\" scoped>\r\n.ele-modal-fsm__display {\r\n display: flex;\r\n flex-direction: row;\r\n font-size: 14px;\r\n line-height: 22px;\r\n .fms-display__name, .fms-display__action {\r\n font-weight: bold;\r\n color: var(--idoole-black-088);\r\n &::before {\r\n content: '';\r\n margin-left: 4px;\r\n }\r\n &::after {\r\n content: '';\r\n margin-right: 4px;\r\n }\r\n }\r\n .title-info {\r\n font-size: 14px;\r\n color: var(--idoole-black-064);\r\n margin-left: 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &::before {\r\n content: '';\r\n display: inline-block;\r\n width: 6px;\r\n height: 6px;\r\n border-radius: 50%;\r\n margin-right: 8px;\r\n }\r\n &.success {\r\n &::before {\r\n background: var(--idoole-success-06);\r\n }\r\n }\r\n &.warning {\r\n &::before {\r\n background: var(--idoole-warning-06);\r\n }\r\n }\r\n &.error {\r\n &::before {\r\n background: var(--idoole-error-06);\r\n }\r\n }\r\n }\r\n}\r\n.ele-modal-fsm__opinion-wrapper {\r\n margin-top: 4px;\r\n line-height: 22px;\r\n font-size: 14px;\r\n display: flex;\r\n flex-direction: row;\r\n .fsm-opinion__label {\r\n width: 42px;\r\n flex-shrink: 0;\r\n color: var(--idoole-black-064);\r\n }\r\n .fsm-opinion__value {\r\n color: var(--idoole-black-088);\r\n font-weight: bold;\r\n }\r\n}\r\n</style>",".ele-modal-fsm__display {\n display: flex;\n flex-direction: row;\n font-size: 14px;\n line-height: 22px;\n}\n.ele-modal-fsm__display .fms-display__name, .ele-modal-fsm__display .fms-display__action {\n font-weight: bold;\n color: var(--idoole-black-088);\n}\n.ele-modal-fsm__display .fms-display__name::before, .ele-modal-fsm__display .fms-display__action::before {\n content: \"\";\n margin-left: 4px;\n}\n.ele-modal-fsm__display .fms-display__name::after, .ele-modal-fsm__display .fms-display__action::after {\n content: \"\";\n margin-right: 4px;\n}\n.ele-modal-fsm__display .title-info {\n font-size: 14px;\n color: var(--idoole-black-064);\n margin-left: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-modal-fsm__display .title-info::before {\n content: \"\";\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 8px;\n}\n.ele-modal-fsm__display .title-info.success::before {\n background: var(--idoole-success-06);\n}\n.ele-modal-fsm__display .title-info.warning::before {\n background: var(--idoole-warning-06);\n}\n.ele-modal-fsm__display .title-info.error::before {\n background: var(--idoole-error-06);\n}\n\n.ele-modal-fsm__opinion-wrapper {\n margin-top: 4px;\n line-height: 22px;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__label {\n width: 42px;\n flex-shrink: 0;\n color: var(--idoole-black-064);\n}\n.ele-modal-fsm__opinion-wrapper .fsm-opinion__value {\n color: var(--idoole-black-088);\n font-weight: bold;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
15534
15535
|
|
|
15535
15536
|
};
|
|
15536
15537
|
/* scoped */
|
|
15537
|
-
const __vue_scope_id__$1 = "data-v-
|
|
15538
|
+
const __vue_scope_id__$1 = "data-v-1c7f4c3c";
|
|
15538
15539
|
/* module identifier */
|
|
15539
15540
|
const __vue_module_identifier__$1 = undefined;
|
|
15540
15541
|
/* functional template */
|
|
@@ -15692,11 +15693,11 @@ __vue_render__._withStripped = true;
|
|
|
15692
15693
|
/* style */
|
|
15693
15694
|
const __vue_inject_styles__ = function (inject) {
|
|
15694
15695
|
if (!inject) return
|
|
15695
|
-
inject("data-v-
|
|
15696
|
+
inject("data-v-936fe67a_0", { source: ".g-form__tabs[data-v-936fe67a] {\n width: 100%;\n background: #fff;\n display: flex;\n flex-direction: row;\n height: 32px;\n}\n.g-form__tabs .g-form__wrapper[data-v-936fe67a] {\n display: flex;\n flex-direction: row;\n}\n.g-form__tabs .g-form__wrapper.disabled .g-form__item[data-v-936fe67a] {\n cursor: not-allowed;\n border-color: rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.24);\n}\n.g-form__tabs .g-form__wrapper .g-form__item[data-v-936fe67a] {\n padding: 0px 16px;\n cursor: pointer;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgba(0, 0, 0, 0.16);\n color: rgba(0, 0, 0, 0.64);\n border-right: unset;\n}\n.g-form__tabs .g-form__wrapper .g-form__item .suffix[data-v-936fe67a] {\n display: flex;\n}\n.g-form__tabs .g-form__wrapper .g-form__item[data-v-936fe67a]:last-child {\n border-right: 1px solid rgba(0, 0, 0, 0.16);\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived[data-v-936fe67a] {\n border-color: #409eff;\n color: #409eff;\n font-size: 14px;\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived + .g-form__item[data-v-936fe67a] {\n border-left: 1px solid #409eff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["C:\\Users\\ZOU\\Code\\OnlineStudy\\base-elearning-frontend-model\\packages\\components\\packages\\business-components\\tabs-sub-center\\src\\index.vue","index.vue"],"names":[],"mappings":"AAwEA;EACA,WAAA;EACA,gBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;ACvEA;ADwEA;EACA,aAAA;EACA,mBAAA;ACtEA;ADwEA;EACA,mBAAA;EACA,iCAAA;EACA,+BAAA;EACA,0BAAA;ACtEA;ADyEA;EACA,iBAAA;EACA,eAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,qCAAA;EACA,0BAAA;EACA,mBAAA;ACvEA;ADwEA;EACA,aAAA;ACtEA;ADwEA;EACA,2CAAA;ACtEA;ADwEA;EACA,qBAAA;EACA,cAAA;EACA,eAAA;ACtEA;ADuEA;EACA,8BAAA;ACrEA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-form__tabs\">\r\n <div :class=\"['g-form__wrapper', disabled && 'disabled']\">\r\n <div :class=\"['g-form__item', !disabled && (innerActiveKey == props.key) && 'actived']\" @click=\"handleTabClick(props)\" v-for=\"props in dataSource\" :key=\"props.key\">\r\n <div>{{ props.title }}</div>\r\n <div v-if=\"isSuffix\" class=\"suffix\">\r\n <template v-if=\"props.loading\">\r\n <ele-loading style=\"margin-left:4px;\" :loading=\"props.loading\"></ele-loading>\r\n </template>\r\n <div v-else>({{ props.suffix }}人)</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tabs-sub-center',\r\n props: {\r\n activeKey: {\r\n type: [String, Number]\r\n },\r\n isSuffix: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n dataSource: {\r\n type: Array\r\n }\r\n },\r\n data () {\r\n return {\r\n innerActiveKey: 1\r\n }\r\n },\r\n watch: {\r\n activeKey: {\r\n handler (key) {\r\n this.innerActiveKey = key\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n setLoadingByKey (key, status = true) {\r\n const target = this.dataSource.find(item => item.key == key)\r\n this.$set(target, 'loading', status)\r\n },\r\n setTitleByKey (key, title) {\r\n const target = this.dataSource.find(item => item.key == key)\r\n this.$set(target, 'title', title)\r\n },\r\n setSuffixByKey (key, suffix) {\r\n const target = this.dataSource.find(item => item.key == key)\r\n this.$set(target, 'suffix', suffix)\r\n },\r\n handleTabClick (props) {\r\n if (this.disabled) return\r\n const { key } = props\r\n this.innerActiveKey = key\r\n this.$emit('on-click', props)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-form__tabs {\r\n width: 100%;\r\n background: #fff;\r\n display: flex;\r\n flex-direction: row;\r\n height: 32px;\r\n .g-form__wrapper {\r\n display: flex;\r\n flex-direction: row;\r\n &.disabled {\r\n .g-form__item {\r\n cursor: not-allowed;\r\n border-color: rgba(0, 0, 0, 0.16);\r\n background: rgba(0, 0, 0, 0.04);\r\n color: rgba(0, 0, 0, 0.24);\r\n }\r\n }\r\n .g-form__item {\r\n padding: 0px 16px;\r\n cursor: pointer;\r\n font-size: 14px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n border: 1px solid rgba(0, 0, 0, 0.16);\r\n color: rgba(0, 0, 0, 0.64);\r\n border-right: unset;\r\n & .suffix {\r\n display: flex;\r\n }\r\n &:last-child {\r\n border-right: 1px solid rgba(0, 0, 0, 0.16);\r\n }\r\n &.actived {\r\n border-color:#409eff;\r\n color: #409eff;\r\n font-size: 14px;\r\n &+.g-form__item {\r\n border-left: 1px solid #409eff;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>",".g-form__tabs {\n width: 100%;\n background: #fff;\n display: flex;\n flex-direction: row;\n height: 32px;\n}\n.g-form__tabs .g-form__wrapper {\n display: flex;\n flex-direction: row;\n}\n.g-form__tabs .g-form__wrapper.disabled .g-form__item {\n cursor: not-allowed;\n border-color: rgba(0, 0, 0, 0.16);\n background: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.24);\n}\n.g-form__tabs .g-form__wrapper .g-form__item {\n padding: 0px 16px;\n cursor: pointer;\n font-size: 14px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgba(0, 0, 0, 0.16);\n color: rgba(0, 0, 0, 0.64);\n border-right: unset;\n}\n.g-form__tabs .g-form__wrapper .g-form__item .suffix {\n display: flex;\n}\n.g-form__tabs .g-form__wrapper .g-form__item:last-child {\n border-right: 1px solid rgba(0, 0, 0, 0.16);\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived {\n border-color: #409eff;\n color: #409eff;\n font-size: 14px;\n}\n.g-form__tabs .g-form__wrapper .g-form__item.actived + .g-form__item {\n border-left: 1px solid #409eff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
15696
15697
|
|
|
15697
15698
|
};
|
|
15698
15699
|
/* scoped */
|
|
15699
|
-
const __vue_scope_id__ = "data-v-
|
|
15700
|
+
const __vue_scope_id__ = "data-v-936fe67a";
|
|
15700
15701
|
/* module identifier */
|
|
15701
15702
|
const __vue_module_identifier__ = undefined;
|
|
15702
15703
|
/* functional template */
|