npmapps 1.1.3 → 1.1.5

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.
Files changed (114) hide show
  1. package/app/wujie-vue2-child/.eslintrc.js +19 -0
  2. package/app/wujie-vue2-child/README.md +24 -0
  3. package/app/wujie-vue2-child/babel.config.js +5 -0
  4. package/app/wujie-vue2-child/docs/superpowers/plans/2026-05-29-quill-editor.md +836 -0
  5. package/app/wujie-vue2-child/docs/superpowers/specs/2026-05-29-quill-editor-design.md +210 -0
  6. package/app/wujie-vue2-child/jsconfig.json +19 -0
  7. package/app/wujie-vue2-child/package-lock.json +21333 -0
  8. package/app/wujie-vue2-child/package.json +63 -0
  9. package/app/wujie-vue2-child/postcss.config.js +10 -0
  10. package/app/wujie-vue2-child/public/favicon.ico +0 -0
  11. package/app/wujie-vue2-child/public/index.html +17 -0
  12. package/app/wujie-vue2-child/public/rili.jpg +0 -0
  13. package/app/wujie-vue2-child/public//344/270/200/351/224/256/351/273/221/346/232/227.html +136 -0
  14. package/app/wujie-vue2-child/src/App.vue +110 -0
  15. package/app/wujie-vue2-child/src/assets/bpmn-camunda.jpg +0 -0
  16. package/app/wujie-vue2-child/src/assets/css/diagram.less +17 -0
  17. package/app/wujie-vue2-child/src/assets/icon/Icon.less +31 -0
  18. package/app/wujie-vue2-child/src/assets/icon/font/app-codes.css +26 -0
  19. package/app/wujie-vue2-child/src/assets/icon/font/app.eot +0 -0
  20. package/app/wujie-vue2-child/src/assets/icon/font/app.svg +60 -0
  21. package/app/wujie-vue2-child/src/assets/icon/font/app.ttf +0 -0
  22. package/app/wujie-vue2-child/src/assets/icon/font/app.woff +0 -0
  23. package/app/wujie-vue2-child/src/assets/icon/font/app.woff2 +0 -0
  24. package/app/wujie-vue2-child/src/assets/icon/font/config.json +248 -0
  25. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/align-bottom-tool.svg +30 -0
  26. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +85 -0
  27. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/align-left-tool.svg +84 -0
  28. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/align-right-tool.svg +80 -0
  29. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/align-top-tool.svg +84 -0
  30. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +89 -0
  31. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +95 -0
  32. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +99 -0
  33. package/app/wujie-vue2-child/src/assets/icon/font/source/raw/set-color-tool.svg +111 -0
  34. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/align-bottom-tool.svg +30 -0
  35. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +30 -0
  36. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/align-left-tool.svg +30 -0
  37. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/align-right-tool.svg +30 -0
  38. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/align-top-tool.svg +30 -0
  39. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +30 -0
  40. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +30 -0
  41. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +30 -0
  42. package/app/wujie-vue2-child/src/assets/icon/font/source/symbols/set-color-tool.svg +63 -0
  43. package/app/wujie-vue2-child/src/assets/logo.png +0 -0
  44. package/app/wujie-vue2-child/src/components/EllTable/README.md +70 -0
  45. package/app/wujie-vue2-child/src/components/EllTable/article.md +184 -0
  46. package/app/wujie-vue2-child/src/components/EllTable/index.js +213 -0
  47. package/app/wujie-vue2-child/src/components/EventCalendar/CalendarSkeleton.vue +147 -0
  48. package/app/wujie-vue2-child/src/components/EventCalendar/CodeBlock.vue +199 -0
  49. package/app/wujie-vue2-child/src/components/EventCalendar/MonthSelect.vue +376 -0
  50. package/app/wujie-vue2-child/src/components/EventCalendar/README.md +368 -0
  51. package/app/wujie-vue2-child/src/components/EventCalendar/example.vue +1551 -0
  52. package/app/wujie-vue2-child/src/components/EventCalendar/index.vue +1646 -0
  53. package/app/wujie-vue2-child/src/components/EventCalendar/mockData.js +349 -0
  54. package/app/wujie-vue2-child/src/components/EventCalendar/utils.js +201 -0
  55. package/app/wujie-vue2-child/src/components/FormulaEditor/FunctionSelector.vue +123 -0
  56. package/app/wujie-vue2-child/src/components/FormulaEditor/OperatorSelector.vue +184 -0
  57. package/app/wujie-vue2-child/src/components/FormulaEditor/ParameterSelector.vue +123 -0
  58. package/app/wujie-vue2-child/src/components/FormulaEditor/api.js +69 -0
  59. package/app/wujie-vue2-child/src/components/FormulaEditor/index.vue +435 -0
  60. package/app/wujie-vue2-child/src/components/HelloWorld.vue +58 -0
  61. package/app/wujie-vue2-child/src/components/PageHeader/index.vue +158 -0
  62. package/app/wujie-vue2-child/src/components/Splitter/README.md +144 -0
  63. package/app/wujie-vue2-child/src/components/Splitter/example.vue +84 -0
  64. package/app/wujie-vue2-child/src/components/Splitter/index.vue +203 -0
  65. package/app/wujie-vue2-child/src/components/diagram/ToolBar.vue +357 -0
  66. package/app/wujie-vue2-child/src/components/diagram/customTranslate/customTranslate.js +12 -0
  67. package/app/wujie-vue2-child/src/components/diagram/customTranslate/translationsGerman.js +241 -0
  68. package/app/wujie-vue2-child/src/components/diagram/index.vue +261 -0
  69. package/app/wujie-vue2-child/src/components/diagram/xmlData.js +29 -0
  70. package/app/wujie-vue2-child/src/directives/filldown.js +155 -0
  71. package/app/wujie-vue2-child/src/directives/filldownTable.js +291 -0
  72. package/app/wujie-vue2-child/src/main.js +40 -0
  73. package/app/wujie-vue2-child/src/router/index.js +72 -0
  74. package/app/wujie-vue2-child/src/store/index.js +23 -0
  75. package/app/wujie-vue2-child/src/utils/winBox.js +23 -0
  76. package/app/wujie-vue2-child/src/views/Extend/A.vue +12 -0
  77. package/app/wujie-vue2-child/src/views/Extend/B.vue +10 -0
  78. package/app/wujie-vue2-child/src/views/Extend/MagicalComponentsForELFormItem.vue +78 -0
  79. package/app/wujie-vue2-child/src/views/Extend/index.vue +59 -0
  80. package/app/wujie-vue2-child/src/views/Extend/tableMouseHorizontalWheel.vue +184 -0
  81. package/app/wujie-vue2-child/src/views/Home.vue +27 -0
  82. package/app/wujie-vue2-child/src/views/RouterJump.vue +145 -0
  83. package/app/wujie-vue2-child/src/views/calendar/index.vue +19 -0
  84. package/app/wujie-vue2-child/src/views/css.vue +57 -0
  85. package/app/wujie-vue2-child/src/views/cssComponents/EllipsisText.vue +73 -0
  86. package/app/wujie-vue2-child/src/views/cssComponents/HoverCard.vue +69 -0
  87. package/app/wujie-vue2-child/src/views/cssComponents/TableHover.vue +130 -0
  88. package/app/wujie-vue2-child/src/views/cssComponents/inputSlo.vue +42 -0
  89. package/app/wujie-vue2-child/src/views/cssComponents/tableFixed.vue +148 -0
  90. package/app/wujie-vue2-child/src/views/echarts/echart-dome.vue +73 -0
  91. package/app/wujie-vue2-child/src/views/echarts/index.vue +118 -0
  92. package/app/wujie-vue2-child/src/views/echarts/pei3d.vue +658 -0
  93. package/app/wujie-vue2-child/src/views/element/bpmn/index.vue +15 -0
  94. package/app/wujie-vue2-child/src/views/element/components/attendanceCycle/index.vue +131 -0
  95. package/app/wujie-vue2-child/src/views/element/components/attendanceGroup/index.vue +147 -0
  96. package/app/wujie-vue2-child/src/views/element/components/attendancePersonnel/index.vue +158 -0
  97. package/app/wujie-vue2-child/src/views/element/components/companyCalendar/index.vue +147 -0
  98. package/app/wujie-vue2-child/src/views/element/components/shift/index.vue +147 -0
  99. package/app/wujie-vue2-child/src/views/element/components/shiftRotationSystem/index.vue +147 -0
  100. package/app/wujie-vue2-child/src/views/element/elTableJsx/columnManagement.vue +340 -0
  101. package/app/wujie-vue2-child/src/views/element/elTableJsx/dialogInput.vue +71 -0
  102. package/app/wujie-vue2-child/src/views/element/elTableJsx/elTableJsx.vue +1826 -0
  103. package/app/wujie-vue2-child/src/views/element/elTableJsx/formTable.vue +595 -0
  104. package/app/wujie-vue2-child/src/views/element/elTableJsx/index.vue +29 -0
  105. package/app/wujie-vue2-child/src/views/element/elTableJsx/simpleTable.vue +189 -0
  106. package/app/wujie-vue2-child/src/views/element/elTableJsx.zip +0 -0
  107. package/app/wujie-vue2-child/src/views/element/index.vue +39 -0
  108. package/app/wujie-vue2-child/src/views/element/quillEditor/README.md +163 -0
  109. package/app/wujie-vue2-child/src/views/element/quillEditor/example.vue +307 -0
  110. package/app/wujie-vue2-child/src/views/element/quillEditor/index.vue +409 -0
  111. package/app/wujie-vue2-child/src/views/element/quillEditor/toolbar.js +122 -0
  112. package/app/wujie-vue2-child/vue.config.js +15 -0
  113. package/package.json +1 -1
  114. package/app/html-note(1).zip +0 -0
@@ -0,0 +1,210 @@
1
+ # QuillEditor组件封装设计
2
+
3
+ **日期**:2026-05-29
4
+ **作者**: wk-7500f
5
+ **状态**: Approved
6
+
7
+ ##背景
8
+
9
+ `src/views/element/index.vue` 已经预留了 "Quill编辑器" tab 并 import 了
10
+ `./quillEditor/example.vue`,但 `src/views/element/quillEditor/`目录为空,
11
+ example.vue也不存在。需要:
12
+
13
+ 1.封装一个功能齐全的 Quill 富文本编辑器 Vue2组件
14
+ 2. 必须包含表格(table)功能
15
+ 3. 在 element tab 下展示多实例对比案例
16
+
17
+ ##决策记录
18
+
19
+ |维度 | 选择 |理由 |
20
+ |------|------|------|
21
+ | Quill 版本 |2.0.2 | quill-table-better@1.2.3明确要求 quill.js >= v2.0.0;Quill 是框架无关的,Vue2也能用2.x;生态最新最活跃 |
22
+ |表格模块 | quill-table-better1.2.3 |唯一活跃维护的 Quill表格模块,功能齐全(增删/合并/拆分/样式),官方要求 Quill2.x |
23
+ | 图片上传 | base64 内联 | 无后端依赖、零配置、适合 demo场景 |
24
+ |主题 | snow | Quill 默认浅色主题,和现有 element tab风格一致 |
25
+ |放置位置 | `src/views/element/quillEditor/` | 仅给 element tab 用,不放全局 components |
26
+ |案例形式 | 多实例对比 | 同时展示基础/只读/禁用三种配置 |
27
+
28
+ ##架构
29
+
30
+ ```
31
+ src/views/element/index.vue (el-tabs)
32
+ └─ <el-tab-pane name="quillEditor">
33
+ └─ <QuillEditorDemo /> (example.vue)
34
+ ├─ <QuillEditor v-model="..." /> 实例1:基础
35
+ ├─ <QuillEditor v-model="..." :readonly="true"/> 实例2:只读
36
+ └─ <QuillEditor v-model="..." :disabled="true"/> 实例3:禁用
37
+
38
+ src/views/element/quillEditor/
39
+ ├── index.vue QuillEditor 主组件
40
+ ├── example.vue Demo页面(已存在 tab引用)
41
+ ├── toolbar.js 默认工具栏配置
42
+ └── README.md 使用文档
43
+ ```
44
+
45
+ 外部依赖:
46
+
47
+ - `quill@2.0.2` 富文本核心
48
+ - `quill-table-better@1.2.3`表格模块(明确要求 Quill >=2.0.0)
49
+ - `quill-image-drop-module` 图片拖拽上传(兼容 Quill2.x)
50
+ - `quill-image-resize-module` (兼容 Quill2.x 版本) 图片缩放
51
+ - `quill/dist/quill.snow.css` snow主题样式
52
+ - `quill-table-better/dist/quill-table-better.css`表格样式
53
+
54
+ > **修订记录**:2026-05-29实施前发现 quill-table-better实际依赖 Quill2.x,
55
+ >升级方案由 "Quill1.x + quill-table-better"改为 "Quill2.x + quill-table-better1.2.3"。
56
+
57
+ ##组件 API
58
+
59
+ ### Props
60
+
61
+ | Prop | 类型 | 默认值 | 说明 |
62
+ |------|------|--------|------|
63
+ | `value` | String | `''` | 编辑器 HTML 内容,支持 v-model |
64
+ | `placeholder` | String | `'请输入内容...'` | 占位文字 |
65
+ | `readonly` | Boolean | `false` | 是否只读 |
66
+ | `disabled` | Boolean | `false` | 是否禁用工具栏 |
67
+ | `height` | String \| Number | `300` | 编辑区高度,数字按 px,字符串按原值 |
68
+ | `toolbar` | Array \| Object | 见下方"默认工具栏" | 自定义工具栏配置;不传则用默认全量 |
69
+ | `imageHandler` | Function | `null` | 自定义图片处理;不传则走 base64 内联 |
70
+ | `theme` | String | `'snow'` |主题 |
71
+
72
+ ### Events
73
+
74
+ |事件 |触发时机 | 参数 |
75
+ |------|---------|------|
76
+ | `input` | 内容变化 | `(html: String)` |
77
+ | `change` | 内容变化(去抖300ms) | `(html: String)` |
78
+ | `ready` | Quill初始化完成 | `(quill: Quill)` |
79
+ | `focus` | 编辑器获得焦点 | `()` |
80
+ | `blur` | 编辑器失去焦点 | `()` |
81
+
82
+ ### Methods(ref 调用)
83
+
84
+ | 方法 | 返回值 | 说明 |
85
+ |------|--------|------|
86
+ | `getHtml()` | String | 获取当前 HTML |
87
+ | `getText()` | String | 获取纯文本 |
88
+ | `setHtml(html)` | - | 设置内容 |
89
+ | `clear()` | - | 清空内容 |
90
+ | `focus()` | - |聚焦 |
91
+ | `getQuill()` | Quill | 获取底层 Quill 实例 |
92
+
93
+ ### 默认工具栏(全量)
94
+
95
+ ```
96
+ [
97
+ [{ header: [1,2,3,4,5,6, false] }],
98
+ [{ font: [] }],
99
+ [{ size: ['small', false, 'large', 'huge'] }],
100
+ ['bold', 'italic', 'underline', 'strike'],
101
+ [{ color: [] }, { background: [] }],
102
+ [{ script: 'sub' }, { script: 'super' }],
103
+ ['blockquote', 'code-block'],
104
+ [{ list: 'ordered' }, { list: 'bullet' }],
105
+ [{ indent: '-1' }, { indent: '+1' }],
106
+ [{ align: [] }],
107
+ ['link', 'image', 'video'],
108
+ ['table-better'],
109
+ ['clean'],
110
+ ['undo', 'redo'],
111
+ ]
112
+ ```
113
+
114
+ ## 文件内部实现要点
115
+
116
+ ### toolbar.js
117
+
118
+ 导出:
119
+
120
+ - `defaultToolbar`:默认工具栏数组(上述全量配置)
121
+ - `defaultHandlers`:`{ image, 'table-better' }`,image handler触发组件内的 file input;
122
+ table-better 由 quill-table-better 模块自身注册
123
+
124
+ ### index.vue关键实现
125
+
126
+ 1. **生命周期**
127
+ - `mounted`(nextTick):创建 Quill 实例,挂载到 `ref="editor"` div
128
+ - `beforeDestroy`:销毁 Quill 实例、清理事件、移除 file input
129
+ - 用 `this._quill`缓存实例,避免 hot reload重复挂载
130
+
131
+ 2. **v-model双向同步**
132
+ - `watch.value`(immediate):外部值变化 → `quill.clipboard.dangerouslyPasteHTML(value)`
133
+ - 用 `isInternalChange`标志位避免 watch循环
134
+ - Quill `text-change`事件 →触发 `input` +300ms 去抖触发 `change`
135
+
136
+ 3. **图片处理(base64 内联)**
137
+ - 自定义 image handler:创建隐藏 `<input type="file" accept="image/*">`,点击触发选择
138
+ - FileReader读 File → onload 转 base64 → `quill.insertEmbed(range.index, 'image', dataUrl)`
139
+ - 若 `imageHandler` prop传入,优先调用 prop;失败回退 base64
140
+
141
+ 4. **表格模块**
142
+ - 通过 Quill `theme.include`机制注册 quill-table-better
143
+ - 在 `index.vue` 中 import quill-table-better CSS
144
+
145
+ 5. **样式**
146
+ - scoped容器,只控制外层高度和 disabled态样式
147
+ - Quill内部样式通过 `index.vue` 中 `import 'quill/dist/quill.snow.css'`
148
+
149
+ ### example.vue 内容
150
+
151
+ ```vue
152
+ <template>
153
+ <div class="quill-demo">
154
+ <h3>实例1:基础编辑器(v-model双向绑定)</h3>
155
+ <QuillEditor v-model="content1" @change="onChange" />
156
+
157
+ <h3>实例2:只读模式(readonly)</h3>
158
+ <QuillEditor v-model="content2" :readonly="true" />
159
+
160
+ <h3>实例3:禁用模式(disabled,工具栏灰掉)</h3>
161
+ <QuillEditor v-model="content3" :disabled="true" :height="200" />
162
+
163
+ <h3>当前实例1 的 v-model 内容:</h3>
164
+ <pre>{{ content1 }}</pre>
165
+ </div>
166
+ </template>
167
+ ```
168
+
169
+ 实例1预填一段带表格的 HTML,演示表格功能;实例2、3共享同一份初始内容,
170
+ 便于对比 readonly 和 disabled 的视觉差异。
171
+
172
+ ##错误处理与边界
173
+
174
+ |场景 | 处理 |
175
+ |------|------|
176
+ |依赖未安装(window.Quill 不存在) |渲染 `<div class="quill-editor-error">请先安装 quill依赖</div>` + console.error |
177
+ | value 非字符串 |强制 `String(value)` |
178
+ |重复创建 | 用 `this._quill`缓存,hot reload 不重复挂载 |
179
+ | watch循环 | `isInternalChange`标志位 |
180
+ |组件销毁 |销毁 Quill 实例、清理事件、移除 file input |
181
+ | 图片 >5MB | ElMessage.warning提示但仍允许插入(base64 内联策略) |
182
+
183
+ ## 测试策略
184
+
185
+ 项目无现成测试框架(jest/vitest 未安装),通过 example演示 +人工验证:
186
+
187
+ -三个实例能否正常渲染
188
+ - v-model双向同步是否正确
189
+ -工具栏按钮(尤其 table-better、image)是否可用
190
+ - readonly / disabled切换是否生效
191
+ -组件销毁后无控制台报错
192
+
193
+ ## 实现步骤
194
+
195
+ 1. 安装依赖:`quill@2.0.2`、`quill-table-better@1.2.3`、`quill-image-drop-module`、
196
+ `quill-image-resize-module`(注意选兼容 Quill2.x 的版本)
197
+ 2.写 `toolbar.js`(默认工具栏 + handlers)
198
+ 3.写 `index.vue`(QuillEditor 主组件,实现上述所有要点)
199
+ 4.写 `example.vue`(三实例对比 demo)
200
+ 5.写 `README.md`(用法 + Props/Events/Methods 说明)
201
+ 6. `index.vue` (element tab) 已经 import 该组件,无需修改
202
+
203
+ ##范围之外(本期不做)
204
+
205
+ - 图片上传到后端 API(默认 base64,后续如需可加 `imageHandler` prop)
206
+ - 自定义主题(只用 snow)
207
+ -暗黑模式
208
+ -协同编辑
209
+ - 字数限制(可在调用方通过 `change`事件自行截断)
210
+ -移动端适配
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "esnext",
5
+ "baseUrl": "./",
6
+ "moduleResolution": "node",
7
+ "paths": {
8
+ "@/*": [
9
+ "src/*"
10
+ ]
11
+ },
12
+ "lib": [
13
+ "esnext",
14
+ "dom",
15
+ "dom.iterable",
16
+ "scripthost"
17
+ ]
18
+ }
19
+ }