npmapps 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PUBLISH.md +268 -0
- package/app/.codegraph/daemon.pid +6 -0
- package/app/.eslintrc.js +19 -0
- package/app/README.md +24 -0
- package/app/babel.config.js +5 -0
- package/app/devtool-windows-amd64.zip +0 -0
- package/app/docs/superpowers/plans/2026-05-29-quill-editor.md +836 -0
- package/app/docs/superpowers/specs/2026-05-29-quill-editor-design.md +210 -0
- package/app/docs/superpowers/specs/2026-06-06-lazy-cascader-design.md +400 -0
- package/app/jsconfig.json +19 -0
- package/app/package-lock.json +21347 -0
- package/app/package.json +63 -0
- package/app/postcss.config.js +10 -0
- package/app/public/favicon.ico +0 -0
- package/app/public/index.html +17 -0
- package/app/public//344/270/200/351/224/256/351/273/221/346/232/227.html +136 -0
- package/app/src/App.vue +110 -0
- package/app/src/assets/bpmn-camunda.jpg +0 -0
- package/app/src/assets/css/diagram.less +17 -0
- package/app/src/assets/icon/Icon.less +31 -0
- package/app/src/assets/icon/font/app-codes.css +26 -0
- package/app/src/assets/icon/font/app.eot +0 -0
- package/app/src/assets/icon/font/app.svg +60 -0
- package/app/src/assets/icon/font/app.ttf +0 -0
- package/app/src/assets/icon/font/app.woff +0 -0
- package/app/src/assets/icon/font/app.woff2 +0 -0
- package/app/src/assets/icon/font/config.json +248 -0
- package/app/src/assets/icon/font/source/raw/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +85 -0
- package/app/src/assets/icon/font/source/raw/align-left-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-right-tool.svg +80 -0
- package/app/src/assets/icon/font/source/raw/align-top-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +89 -0
- package/app/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +95 -0
- package/app/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +99 -0
- package/app/src/assets/icon/font/source/raw/set-color-tool.svg +111 -0
- package/app/src/assets/icon/font/source/symbols/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-left-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-right-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-top-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/set-color-tool.svg +63 -0
- package/app/src/assets/logo.png +0 -0
- package/app/src/components/EllTable/README.md +70 -0
- package/app/src/components/EllTable/article.md +184 -0
- package/app/src/components/EllTable/index.js +213 -0
- package/app/src/components/FormulaEditor/FunctionSelector.vue +123 -0
- package/app/src/components/FormulaEditor/OperatorSelector.vue +184 -0
- package/app/src/components/FormulaEditor/ParameterSelector.vue +123 -0
- package/app/src/components/FormulaEditor/api.js +69 -0
- package/app/src/components/FormulaEditor/index.vue +435 -0
- package/app/src/components/HelloWorld.vue +58 -0
- package/app/src/components/PageHeader/index.vue +158 -0
- package/app/src/components/Splitter/README.md +144 -0
- package/app/src/components/Splitter/example.vue +88 -0
- package/app/src/components/Splitter/index.vue +203 -0
- package/app/src/components/diagram/ToolBar.vue +357 -0
- package/app/src/components/diagram/customTranslate/customTranslate.js +12 -0
- package/app/src/components/diagram/customTranslate/translationsGerman.js +241 -0
- package/app/src/components/diagram/index.vue +261 -0
- package/app/src/components/diagram/xmlData.js +29 -0
- package/app/src/directives/filldown.js +155 -0
- package/app/src/directives/filldownTable.js +291 -0
- package/app/src/main.js +40 -0
- package/app/src/router/index.js +63 -0
- package/app/src/store/index.js +23 -0
- package/app/src/utils/winBox.js +23 -0
- package/app/src/views/Extend/A.vue +12 -0
- package/app/src/views/Extend/B.vue +10 -0
- package/app/src/views/Extend/MagicalComponentsForELFormItem.vue +87 -0
- package/app/src/views/Extend/index.vue +59 -0
- package/app/src/views/Extend/tableMouseHorizontalWheel.vue +193 -0
- package/app/src/views/Home.vue +37 -0
- package/app/src/views/RouterJump.vue +155 -0
- package/app/src/views/css.vue +57 -0
- package/app/src/views/cssComponents/EllipsisText.vue +83 -0
- package/app/src/views/cssComponents/HoverCard.vue +79 -0
- package/app/src/views/cssComponents/TableHover.vue +140 -0
- package/app/src/views/cssComponents/inputSlo.vue +52 -0
- package/app/src/views/cssComponents/tableFixed.vue +158 -0
- package/app/src/views/echarts/echart-dome.vue +82 -0
- package/app/src/views/echarts/index.vue +118 -0
- package/app/src/views/echarts/pei3d.vue +667 -0
- package/app/src/views/element/bpmn/index.vue +18 -0
- package/app/src/views/element/components/attendanceCycle/index.vue +131 -0
- package/app/src/views/element/components/attendanceGroup/index.vue +147 -0
- package/app/src/views/element/components/attendancePersonnel/index.vue +158 -0
- package/app/src/views/element/components/companyCalendar/index.vue +147 -0
- package/app/src/views/element/components/shift/index.vue +147 -0
- package/app/src/views/element/components/shiftRotationSystem/index.vue +147 -0
- package/app/src/views/element/elTableJsx/columnManagement.vue +340 -0
- package/app/src/views/element/elTableJsx/dialogInput.vue +71 -0
- package/app/src/views/element/elTableJsx/elTableJsx.vue +1826 -0
- package/app/src/views/element/elTableJsx/formTable.vue +598 -0
- package/app/src/views/element/elTableJsx/index.vue +29 -0
- package/app/src/views/element/elTableJsx/simpleTable.vue +192 -0
- package/app/src/views/element/elTableJsx.zip +0 -0
- package/app/src/views/element/index.vue +44 -0
- package/app/src/views/element/lazyCascader/LazyCascader.vue +302 -0
- package/app/src/views/element/lazyCascader/data.js +205 -0
- package/app/src/views/element/lazyCascader/index.vue +315 -0
- package/app/src/views/element/quillEditor/README.md +163 -0
- package/app/src/views/element/quillEditor/example.vue +314 -0
- package/app/src/views/element/quillEditor/index.vue +409 -0
- package/app/src/views/element/quillEditor/toolbar.js +122 -0
- package/app/vue.config.js +15 -0
- package/package.json +1 -1
- package/app/wujie-vue3-child/.claude/settings.local.json +0 -8
- package/app/wujie-vue3-child/.vscode/extensions.json +0 -3
- package/app/wujie-vue3-child/PROJECT_MEMORY.md +0 -427
- package/app/wujie-vue3-child/README.md +0 -5
- package/app/wujie-vue3-child/index.html +0 -13
- package/app/wujie-vue3-child/package-lock.json +0 -5744
- package/app/wujie-vue3-child/package.json +0 -28
- package/app/wujie-vue3-child/public/vite.svg +0 -1
- package/app/wujie-vue3-child/src/App.vue +0 -130
- package/app/wujie-vue3-child/src/assets/vue.svg +0 -1
- package/app/wujie-vue3-child/src/components/HelloWorld.vue +0 -43
- package/app/wujie-vue3-child/src/components/SmartAnchorTabs/index.jsx +0 -224
- package/app/wujie-vue3-child/src/components/SmartAnchorTabs/style.css +0 -154
- package/app/wujie-vue3-child/src/components/tags-view.vue +0 -193
- package/app/wujie-vue3-child/src/components/tags-view1.vue +0 -131
- package/app/wujie-vue3-child/src/directives/aiLoading.js +0 -182
- package/app/wujie-vue3-child/src/hooks/useClickOutside.js +0 -11
- package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +0 -28
- package/app/wujie-vue3-child/src/main.js +0 -18
- package/app/wujie-vue3-child/src/router/index.js +0 -104
- package/app/wujie-vue3-child/src/store/tagsViewStroe.js +0 -34
- package/app/wujie-vue3-child/src/style.css +0 -171
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.jsx +0 -108
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.module.scss +0 -97
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +0 -836
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +0 -728
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +0 -687
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +0 -560
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +0 -570
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +0 -330
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +0 -378
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +0 -228
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +0 -399
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +0 -252
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +0 -585
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +0 -331
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +0 -392
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +0 -248
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +0 -194
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +0 -1459
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +0 -301
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.module.scss +0 -28
- package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +0 -375
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +0 -121
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +0 -76
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +0 -104
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +0 -75
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +0 -12
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +0 -62
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +0 -43
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +0 -5
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +0 -58
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +0 -92
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +0 -56
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +0 -40
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +0 -53
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +0 -132
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +0 -176
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +0 -96
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +0 -162
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +0 -16
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +0 -164
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +0 -203
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +0 -145
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +0 -126
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +0 -67
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +0 -105
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +0 -81
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +0 -47
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +0 -64
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +0 -44
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +0 -83
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +0 -101
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +0 -50
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.jsx +0 -196
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.module.scss +0 -41
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.jsx +0 -183
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.module.scss +0 -115
- package/app/wujie-vue3-child/src/views/child-to-parent.vue +0 -117
- package/app/wujie-vue3-child/src/views/home.vue +0 -53
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +0 -169
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +0 -69
- package/app/wujie-vue3-child/src/views/jsx/com.vue +0 -44
- package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +0 -66
- package/app/wujie-vue3-child/src/views/jsx/index.vue +0 -72
- package/app/wujie-vue3-child/src/views/jsx/props.vue +0 -33
- package/app/wujie-vue3-child/src/views/parent-to-child.vue +0 -225
- package/app/wujie-vue3-child/src/views/phone-code.vue +0 -318
- package/app/wujie-vue3-child/src/views/router-jump.vue +0 -123
- package/app/wujie-vue3-child/src/views/test.vue +0 -192
- package/app/wujie-vue3-child/vite.config.js +0 -15
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<PageHeader title="简单表格" description="展示基础 JSX 表格用法,支持通过 columns 配置列、data 渲染数据" usage="<elTableJsx :columns="columns" :tableData="tableData" />" />
|
|
4
|
+
<elTableJsx
|
|
5
|
+
:columns="columns"
|
|
6
|
+
:tableData="tableData"
|
|
7
|
+
stripe
|
|
8
|
+
@cell-click="onCellClick"
|
|
9
|
+
>
|
|
10
|
+
<template #header-left>
|
|
11
|
+
<span>header-left</span>
|
|
12
|
+
</template>
|
|
13
|
+
<!-- <template #header-right>
|
|
14
|
+
<span>header-right</span>
|
|
15
|
+
</template> -->
|
|
16
|
+
</elTableJsx>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import PageHeader from '@/components/PageHeader/index.vue';
|
|
22
|
+
import elTableJsx from "./elTableJsx.vue";
|
|
23
|
+
export default {
|
|
24
|
+
components: {
|
|
25
|
+
PageHeader,
|
|
26
|
+
elTableJsx,
|
|
27
|
+
},
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
columns: [
|
|
31
|
+
{
|
|
32
|
+
label: "基本信息",
|
|
33
|
+
key: "basic",
|
|
34
|
+
width: "600",
|
|
35
|
+
props: {
|
|
36
|
+
align: "center",
|
|
37
|
+
},
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
label: "姓名",
|
|
41
|
+
key: "name",
|
|
42
|
+
props: {
|
|
43
|
+
align: "center",
|
|
44
|
+
width: "220",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "性别",
|
|
49
|
+
key: "gender",
|
|
50
|
+
props: {
|
|
51
|
+
align: "center",
|
|
52
|
+
width: "180",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "年龄",
|
|
57
|
+
key: "age",
|
|
58
|
+
props: {
|
|
59
|
+
align: "center",
|
|
60
|
+
width: "180",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
{
|
|
67
|
+
label: "电话",
|
|
68
|
+
key: "phone",
|
|
69
|
+
props: {
|
|
70
|
+
align: "center",
|
|
71
|
+
minWidth: "250",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: "邮箱",
|
|
76
|
+
key: "email",
|
|
77
|
+
props: {
|
|
78
|
+
align: "center",
|
|
79
|
+
minWidth: "300",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: "住址",
|
|
84
|
+
key: "address",
|
|
85
|
+
props: {
|
|
86
|
+
align: "center",
|
|
87
|
+
minWidth: "350",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
{
|
|
92
|
+
label: "部门",
|
|
93
|
+
key: "department",
|
|
94
|
+
props: {
|
|
95
|
+
align: "center",
|
|
96
|
+
minWidth: "250",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "职位",
|
|
101
|
+
key: "position",
|
|
102
|
+
props: {
|
|
103
|
+
align: "center",
|
|
104
|
+
minWidth: "250",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: "入职时间",
|
|
109
|
+
key: "entryDate",
|
|
110
|
+
props: {
|
|
111
|
+
align: "center",
|
|
112
|
+
minWidth: "250",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
tableData: [
|
|
117
|
+
{
|
|
118
|
+
name: "张三",
|
|
119
|
+
gender: "男",
|
|
120
|
+
age: 28,
|
|
121
|
+
phone: "13812345678",
|
|
122
|
+
email: "zhangsan@example.com",
|
|
123
|
+
address: "北京市海淀区中关村大街1号",
|
|
124
|
+
department: "研发部",
|
|
125
|
+
position: "高级工程师",
|
|
126
|
+
entryDate: "2020-01-15",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "李四",
|
|
130
|
+
gender: "女",
|
|
131
|
+
age: 32,
|
|
132
|
+
phone: "13987654321",
|
|
133
|
+
email: "lisi@example.com",
|
|
134
|
+
address: "上海市浦东新区陆家嘴环路888号",
|
|
135
|
+
department: "产品部",
|
|
136
|
+
position: "产品经理",
|
|
137
|
+
entryDate: "2019-06-20",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "王五",
|
|
141
|
+
gender: "男",
|
|
142
|
+
age: 35,
|
|
143
|
+
phone: "13567891234",
|
|
144
|
+
email: "wangwu@example.com",
|
|
145
|
+
address: "广州市天河区珠江新城华夏路10号",
|
|
146
|
+
department: "市场部",
|
|
147
|
+
position: "市场总监",
|
|
148
|
+
entryDate: "2018-03-10",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "赵六",
|
|
152
|
+
gender: "女",
|
|
153
|
+
age: 26,
|
|
154
|
+
phone: "13789012345",
|
|
155
|
+
email: "zhaoliu@example.com",
|
|
156
|
+
address: "深圳市南山区科技园科发路8号",
|
|
157
|
+
department: "设计部",
|
|
158
|
+
position: "UI设计师",
|
|
159
|
+
entryDate: "2021-09-01",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "钱七",
|
|
163
|
+
gender: "男",
|
|
164
|
+
age: 40,
|
|
165
|
+
phone: "13456789012",
|
|
166
|
+
email: "qianqi@example.com",
|
|
167
|
+
address: "成都市武侯区天府大道1234号",
|
|
168
|
+
department: "财务部",
|
|
169
|
+
position: "财务总监",
|
|
170
|
+
entryDate: "2017-12-05",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "孙八",
|
|
174
|
+
gender: "女",
|
|
175
|
+
age: 29,
|
|
176
|
+
phone: "13234567890",
|
|
177
|
+
email: "sunba@example.com",
|
|
178
|
+
address: "武汉市江汉区解放大道456号",
|
|
179
|
+
department: "人力资源部",
|
|
180
|
+
position: "HR经理",
|
|
181
|
+
entryDate: "2020-07-15",
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
methods: {
|
|
187
|
+
onCellClick(row, column, cell, event) {
|
|
188
|
+
console.log("onCellClick", row, column, cell, event);
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
</script>
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-tabs type="border-card" v-model="activeName">
|
|
4
|
+
<el-tab-pane label="BPMN">
|
|
5
|
+
<bpmn />
|
|
6
|
+
</el-tab-pane>
|
|
7
|
+
<el-tab-pane label="分屏示例">
|
|
8
|
+
<SplitterExample />
|
|
9
|
+
</el-tab-pane>
|
|
10
|
+
<el-tab-pane label="JSX表格">
|
|
11
|
+
<elTableJsx />
|
|
12
|
+
</el-tab-pane>
|
|
13
|
+
<el-tab-pane label="富文本编辑器" name="quillEditor">
|
|
14
|
+
<quillEditor />
|
|
15
|
+
</el-tab-pane>
|
|
16
|
+
<el-tab-pane label="级联懒加载" name="lazyCascader">
|
|
17
|
+
<LazyCascaderDemo />
|
|
18
|
+
</el-tab-pane>
|
|
19
|
+
</el-tabs>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import bpmn from "./bpmn/index.vue";
|
|
25
|
+
import SplitterExample from "../../components/Splitter/example.vue";
|
|
26
|
+
import elTableJsx from "./elTableJsx/index.vue";
|
|
27
|
+
import quillEditor from "./quillEditor/example.vue";
|
|
28
|
+
import LazyCascaderDemo from "./lazyCascader/index.vue";
|
|
29
|
+
export default {
|
|
30
|
+
name: "element",
|
|
31
|
+
components: {
|
|
32
|
+
bpmn,
|
|
33
|
+
SplitterExample,
|
|
34
|
+
elTableJsx,
|
|
35
|
+
quillEditor,
|
|
36
|
+
LazyCascaderDemo,
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
activeName: "lazyCascader",
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-cascader
|
|
3
|
+
:key="cascaderKey"
|
|
4
|
+
ref="cascader"
|
|
5
|
+
:value="value"
|
|
6
|
+
:props="cascaderProps"
|
|
7
|
+
:placeholder="placeholder"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
:clearable="clearable"
|
|
10
|
+
:show-all-levels="showAllLevels"
|
|
11
|
+
:separator="separator"
|
|
12
|
+
:options="emptyOptions"
|
|
13
|
+
@change="onChange"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
/**
|
|
19
|
+
* LazyCascader
|
|
20
|
+
*
|
|
21
|
+
* 一次性拿到后端扁平数据,前端按层"懒"加载,体验上等价于 el-cascader 的
|
|
22
|
+
* lazy 模式,但实际上是同步查表 + 缓存;可选模拟接口延时让 loading 可见。
|
|
23
|
+
*
|
|
24
|
+
* v-model: String — 叶子节点的 id(单值)
|
|
25
|
+
* - 即使 checkStrictly=true,v-model 也只是单个 id
|
|
26
|
+
* - 输入框只显示该节点自己的 label
|
|
27
|
+
*
|
|
28
|
+
* 关键能力:
|
|
29
|
+
* - 默认值回显:mount / value 变化时,把链上每一层的兄弟全部预 resolve 进
|
|
30
|
+
* 自己的 cache,再手动调 panel.lazyLoad 把链逐层喂给 el-cascader 的 store,
|
|
31
|
+
* 最后 computePresentText 更新输入框(见 _loadPathForValue)
|
|
32
|
+
* - v-if 销毁/重建:重新 mount,重新 prime
|
|
33
|
+
* - 先有默认值后到数据:data 更新后调 reload(),组件自增 cascaderKey 强制
|
|
34
|
+
* 重渲染,然后再次跑 _loadPathForValue
|
|
35
|
+
* - lazyDelay:模拟接口延时(ms);设为 0 即同步
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ 为什么需要手动 _loadPathForValue:
|
|
38
|
+
* el-cascader 2.x 的 lazy 模式只在 checkedValue 是 Array 时,会在 lazyLoad
|
|
39
|
+
* resolve 回调里自动递归展开下一级(看 cascader-panel.js:1424 的
|
|
40
|
+
* `Array.isArray(_this5.checkedValue)` 分支)。当 emitPath=false 时
|
|
41
|
+
* checkedValue 是单值,这层自动加载逻辑不触发,导致外部设置 value 后
|
|
42
|
+
* el-cascader 找不到对应节点,输入框是空的。这里手动补齐这个行为。
|
|
43
|
+
*/
|
|
44
|
+
export default {
|
|
45
|
+
name: 'LazyCascader',
|
|
46
|
+
|
|
47
|
+
props: {
|
|
48
|
+
value: { type: String, default: '' },
|
|
49
|
+
data: { type: Array, default: () => [] },
|
|
50
|
+
placeholder: { type: String, default: '请选择' },
|
|
51
|
+
checkStrictly: { type: Boolean, default: false },
|
|
52
|
+
// 输入框显示控制:
|
|
53
|
+
// showAllLevels=false(默认):只显示叶子节点的 label(例如"市北区")
|
|
54
|
+
// showAllLevels=true:显示完整路径(例如"山东省 / 青岛市 / 市北区")
|
|
55
|
+
// 注:el-cascader 原生默认值是 true;我们默认改 false,贴合"只显示最后一级"的需求
|
|
56
|
+
showAllLevels: { type: Boolean, default: false },
|
|
57
|
+
// 路径分隔符(只在 showAllLevels=true 时生效)
|
|
58
|
+
separator: { type: String, default: ' / ' },
|
|
59
|
+
lazyDelay: { type: Number, default: 50 },
|
|
60
|
+
disabled: { type: Boolean, default: false },
|
|
61
|
+
clearable: { type: Boolean, default: true },
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
// 喂给 el-cascader 的空 options(配合 lazy=true),真实节点由 lazyLoad 按需返回
|
|
67
|
+
emptyOptions: [],
|
|
68
|
+
// 缓存 parentId -> 已 resolve 的子节点列表(普通对象,避免 Vue 2 对 Map 响应式 wrap 带来的坑)
|
|
69
|
+
_resolvedCache: Object.create(null),
|
|
70
|
+
// 缓存当前的扁平数据引用
|
|
71
|
+
_flatList: [],
|
|
72
|
+
// el-cascader 强制重渲染的 key;reload() 时自增
|
|
73
|
+
cascaderKey: 0,
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
computed: {
|
|
78
|
+
cascaderProps() {
|
|
79
|
+
return {
|
|
80
|
+
lazy: true,
|
|
81
|
+
lazyLoad: this.lazyLoad,
|
|
82
|
+
value: 'id',
|
|
83
|
+
label: 'label',
|
|
84
|
+
children: 'children',
|
|
85
|
+
leaf: 'leaf',
|
|
86
|
+
checkStrictly: this.checkStrictly,
|
|
87
|
+
emitPath: false,
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
watch: {
|
|
93
|
+
data: {
|
|
94
|
+
immediate: true,
|
|
95
|
+
handler(v) {
|
|
96
|
+
this._flatList = Array.isArray(v) ? v : []
|
|
97
|
+
this._clearCache()
|
|
98
|
+
this._primeDefaultValue()
|
|
99
|
+
// data 到位后,把 value 的路径喂给 el-cascader
|
|
100
|
+
this.$nextTick(() => this._loadPathForValue())
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
value: {
|
|
104
|
+
immediate: true,
|
|
105
|
+
handler() {
|
|
106
|
+
this._primeDefaultValue()
|
|
107
|
+
this.$nextTick(() => this._loadPathForValue())
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
// showAllLevels 变化时不会自动触发 computePresentText,这里手动调
|
|
111
|
+
showAllLevels: {
|
|
112
|
+
handler() {
|
|
113
|
+
this.$nextTick(() => {
|
|
114
|
+
const cascaderRef = this.$refs.cascader
|
|
115
|
+
if (cascaderRef && typeof cascaderRef.computePresentText === 'function') {
|
|
116
|
+
cascaderRef.computePresentText()
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
mounted() {
|
|
124
|
+
this._primeDefaultValue()
|
|
125
|
+
this.$nextTick(() => this._loadPathForValue())
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
methods: {
|
|
129
|
+
/**
|
|
130
|
+
* 供外部主动调用:清空缓存 + 自增 key 强制 el-cascader 重渲染 + 重新喂路径
|
|
131
|
+
* 用于"先有默认值后到数据"场景:data 变化后调用
|
|
132
|
+
*/
|
|
133
|
+
reload() {
|
|
134
|
+
this.cascaderKey += 1
|
|
135
|
+
this._clearCache()
|
|
136
|
+
this._primeDefaultValue()
|
|
137
|
+
this.$nextTick(() => this._loadPathForValue())
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* el-cascader lazy 模式回调
|
|
142
|
+
* - node.level === 0 表示根级请求
|
|
143
|
+
* - node.data 是上一层返回的节点对象
|
|
144
|
+
*/
|
|
145
|
+
lazyLoad(node, resolve) {
|
|
146
|
+
if (typeof resolve !== 'function') return
|
|
147
|
+
const level = node && typeof node.level === 'number' ? node.level : 0
|
|
148
|
+
const parentId = level === 0 ? '' : (node.data && node.data.id) || ''
|
|
149
|
+
|
|
150
|
+
if (!this._resolvedCache || typeof this._resolvedCache !== 'object') {
|
|
151
|
+
this._resolvedCache = Object.create(null)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (Object.prototype.hasOwnProperty.call(this._resolvedCache, parentId)) {
|
|
155
|
+
return resolve(this._resolvedCache[parentId])
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const delay = Math.max(0, Number(this.lazyDelay) || 0)
|
|
159
|
+
const doResolve = () => {
|
|
160
|
+
const children = this._buildChildren(parentId)
|
|
161
|
+
this._resolvedCache[parentId] = children
|
|
162
|
+
resolve(children)
|
|
163
|
+
}
|
|
164
|
+
if (delay > 0) {
|
|
165
|
+
setTimeout(doResolve, Math.random() * delay)
|
|
166
|
+
} else {
|
|
167
|
+
doResolve()
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
_buildChildren(parentId) {
|
|
172
|
+
const flat = this._flatList || []
|
|
173
|
+
return flat
|
|
174
|
+
.filter(item => (item.parentId || '') === (parentId || ''))
|
|
175
|
+
.map(item => ({
|
|
176
|
+
...item,
|
|
177
|
+
leaf: !flat.some(c => (c.parentId || '') === item.id),
|
|
178
|
+
children: [],
|
|
179
|
+
}))
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
_clearCache() {
|
|
183
|
+
this._resolvedCache = Object.create(null)
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* 默认值回显 step 1:在 cache 里把链上每一层的兄弟预 resolve
|
|
188
|
+
* 这样即便后面 panel.lazyLoad 调到,我们 lazyLoad 也能秒返
|
|
189
|
+
*/
|
|
190
|
+
_primeDefaultValue() {
|
|
191
|
+
if (!this._resolvedCache || typeof this._resolvedCache !== 'object') {
|
|
192
|
+
this._resolvedCache = Object.create(null)
|
|
193
|
+
}
|
|
194
|
+
if (!this._flatList || this._flatList.length === 0) return
|
|
195
|
+
if (!this.value) return
|
|
196
|
+
|
|
197
|
+
const leafId = this.value
|
|
198
|
+
const chain = []
|
|
199
|
+
let cur = this._flatList.find(i => i.id === leafId)
|
|
200
|
+
while (cur) {
|
|
201
|
+
chain.unshift(cur)
|
|
202
|
+
cur = cur.parentId ? this._flatList.find(i => i.id === cur.parentId) : null
|
|
203
|
+
}
|
|
204
|
+
if (!chain.length) return
|
|
205
|
+
|
|
206
|
+
const parentIds = ['', ...chain.slice(0, -1).map(n => n.id)]
|
|
207
|
+
parentIds.forEach(pid => {
|
|
208
|
+
if (!Object.prototype.hasOwnProperty.call(this._resolvedCache, pid)) {
|
|
209
|
+
this._resolvedCache[pid] = this._buildChildren(pid)
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* 默认值回显 step 2:手动把 value 的链逐层喂给 el-cascader 的 store
|
|
216
|
+
*
|
|
217
|
+
* 触发场景:value 变化 / data 到位 / 组件挂载
|
|
218
|
+
*
|
|
219
|
+
* ⚠️ 这是绕过 el-cascader 限制的关键:
|
|
220
|
+
* el-cascader 2.x 的 lazy 模式只在 checkedValue 是 Array(emitPath=true)
|
|
221
|
+
* 时,会在 lazyLoad 的 resolve 里自动递归加载下一级。我们 emitPath=false,
|
|
222
|
+
* value 是单值,自动加载不触发,导致 presentText 找不到节点 → 输入框空。
|
|
223
|
+
* 这里手动调 panel.lazyLoad 把链上每一级都加载好,最后 computePresentText。
|
|
224
|
+
*/
|
|
225
|
+
_loadPathForValue() {
|
|
226
|
+
if (!this.value) return
|
|
227
|
+
if (!this._flatList || this._flatList.length === 0) return
|
|
228
|
+
|
|
229
|
+
const cascaderRef = this.$refs.cascader
|
|
230
|
+
if (!cascaderRef || !cascaderRef.$refs || !cascaderRef.$refs.panel) return
|
|
231
|
+
const panel = cascaderRef.$refs.panel
|
|
232
|
+
if (typeof panel.lazyLoad !== 'function') return
|
|
233
|
+
|
|
234
|
+
// 反向追溯整条链
|
|
235
|
+
const chain = []
|
|
236
|
+
let cur = this._flatList.find(i => i.id === this.value)
|
|
237
|
+
while (cur) {
|
|
238
|
+
chain.unshift(cur)
|
|
239
|
+
cur = cur.parentId ? this._flatList.find(i => i.id === cur.parentId) : null
|
|
240
|
+
}
|
|
241
|
+
if (!chain.length) return
|
|
242
|
+
|
|
243
|
+
const self = this
|
|
244
|
+
const refresh = () => {
|
|
245
|
+
self.$nextTick(() => {
|
|
246
|
+
if (typeof cascaderRef.computePresentText === 'function') {
|
|
247
|
+
cascaderRef.computePresentText()
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// 逐层喂:parentNode === null 表示从根开始
|
|
253
|
+
const cascade = (parentNode, idx) => {
|
|
254
|
+
if (idx >= chain.length) {
|
|
255
|
+
refresh()
|
|
256
|
+
return
|
|
257
|
+
}
|
|
258
|
+
const targetId = chain[idx].id
|
|
259
|
+
|
|
260
|
+
// 先看是否已经在 store 里(避免重复 appendNode)
|
|
261
|
+
const siblings = parentNode
|
|
262
|
+
? (parentNode.children || [])
|
|
263
|
+
: ((panel.store && panel.store.nodes) || [])
|
|
264
|
+
const found = siblings.find(c => c.value === targetId)
|
|
265
|
+
if (found) {
|
|
266
|
+
cascade(found, idx + 1)
|
|
267
|
+
return
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// 不在 store,调 panel.lazyLoad
|
|
271
|
+
const nodeToLoad = parentNode || { root: true, level: 0 }
|
|
272
|
+
panel.lazyLoad(nodeToLoad, () => {
|
|
273
|
+
const newSiblings = parentNode
|
|
274
|
+
? (parentNode.children || [])
|
|
275
|
+
: ((panel.store && panel.store.nodes) || [])
|
|
276
|
+
const newFound = newSiblings.find(c => c.value === targetId)
|
|
277
|
+
if (newFound) {
|
|
278
|
+
cascade(newFound, idx + 1)
|
|
279
|
+
} else {
|
|
280
|
+
// 找不到(数据不一致),放弃
|
|
281
|
+
refresh()
|
|
282
|
+
}
|
|
283
|
+
})
|
|
284
|
+
}
|
|
285
|
+
cascade(null, 0)
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
onChange(val) {
|
|
289
|
+
const out = val == null ? '' : (typeof val === 'object' ? val.id : String(val))
|
|
290
|
+
this.$emit('input', out)
|
|
291
|
+
this.$emit('change', out)
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
}
|
|
295
|
+
</script>
|
|
296
|
+
|
|
297
|
+
<style scoped>
|
|
298
|
+
.el-cascader {
|
|
299
|
+
width: 100%;
|
|
300
|
+
max-width: 360px;
|
|
301
|
+
}
|
|
302
|
+
</style>
|