npmapps 1.2.0 → 1.3.1

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 (120) hide show
  1. package/README.md +41 -0
  2. package/files/part-002 +4 -0
  3. package/get.js +193 -0
  4. package/manifest.json +28 -0
  5. package/package.json +17 -10
  6. package/PUBLISH.md +0 -268
  7. package/app/wujie-wk/t.html +0 -90
  8. package/app/wujie-wk/wujie-vue2-child/.eslintrc.js +0 -19
  9. package/app/wujie-wk/wujie-vue2-child/README.md +0 -24
  10. package/app/wujie-wk/wujie-vue2-child/babel.config.js +0 -5
  11. package/app/wujie-wk/wujie-vue2-child/docs/superpowers/plans/2026-05-29-quill-editor.md +0 -836
  12. package/app/wujie-wk/wujie-vue2-child/docs/superpowers/specs/2026-05-29-quill-editor-design.md +0 -210
  13. package/app/wujie-wk/wujie-vue2-child/jsconfig.json +0 -19
  14. package/app/wujie-wk/wujie-vue2-child/package-lock.json +0 -21333
  15. package/app/wujie-wk/wujie-vue2-child/package.json +0 -63
  16. package/app/wujie-wk/wujie-vue2-child/postcss.config.js +0 -10
  17. package/app/wujie-wk/wujie-vue2-child/public/favicon.ico +0 -0
  18. package/app/wujie-wk/wujie-vue2-child/public/index.html +0 -17
  19. package/app/wujie-wk/wujie-vue2-child/public/rili.jpg +0 -0
  20. package/app/wujie-wk/wujie-vue2-child/public//344/270/200/351/224/256/351/273/221/346/232/227.html +0 -136
  21. package/app/wujie-wk/wujie-vue2-child/src/App.vue +0 -110
  22. package/app/wujie-wk/wujie-vue2-child/src/assets/bpmn-camunda.jpg +0 -0
  23. package/app/wujie-wk/wujie-vue2-child/src/assets/css/diagram.less +0 -17
  24. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/Icon.less +0 -31
  25. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app-codes.css +0 -26
  26. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.eot +0 -0
  27. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.svg +0 -60
  28. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.ttf +0 -0
  29. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff +0 -0
  30. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff2 +0 -0
  31. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/config.json +0 -248
  32. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-bottom-tool.svg +0 -30
  33. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +0 -85
  34. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-left-tool.svg +0 -84
  35. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-right-tool.svg +0 -80
  36. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-top-tool.svg +0 -84
  37. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +0 -89
  38. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +0 -95
  39. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +0 -99
  40. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/set-color-tool.svg +0 -111
  41. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-bottom-tool.svg +0 -30
  42. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +0 -30
  43. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-left-tool.svg +0 -30
  44. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-right-tool.svg +0 -30
  45. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-top-tool.svg +0 -30
  46. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +0 -30
  47. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +0 -30
  48. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +0 -30
  49. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/set-color-tool.svg +0 -63
  50. package/app/wujie-wk/wujie-vue2-child/src/assets/logo.png +0 -0
  51. package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/README.md +0 -70
  52. package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/article.md +0 -184
  53. package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/index.js +0 -213
  54. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CalendarSkeleton.vue +0 -147
  55. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CodeBlock.vue +0 -199
  56. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/MonthSelect.vue +0 -376
  57. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/README.md +0 -485
  58. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/example.vue +0 -1747
  59. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/index.vue +0 -2720
  60. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/mockData.js +0 -475
  61. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/recruitmentAdapter.js +0 -51
  62. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/utils.js +0 -202
  63. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/FunctionSelector.vue +0 -123
  64. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/OperatorSelector.vue +0 -184
  65. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/ParameterSelector.vue +0 -123
  66. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/api.js +0 -69
  67. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/index.vue +0 -435
  68. package/app/wujie-wk/wujie-vue2-child/src/components/HelloWorld.vue +0 -58
  69. package/app/wujie-wk/wujie-vue2-child/src/components/PageHeader/index.vue +0 -158
  70. package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/README.md +0 -144
  71. package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/example.vue +0 -84
  72. package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/index.vue +0 -203
  73. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/ToolBar.vue +0 -357
  74. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/customTranslate.js +0 -12
  75. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/translationsGerman.js +0 -241
  76. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/index.vue +0 -261
  77. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/xmlData.js +0 -29
  78. package/app/wujie-wk/wujie-vue2-child/src/directives/filldown.js +0 -155
  79. package/app/wujie-wk/wujie-vue2-child/src/directives/filldownTable.js +0 -291
  80. package/app/wujie-wk/wujie-vue2-child/src/main.js +0 -40
  81. package/app/wujie-wk/wujie-vue2-child/src/router/index.js +0 -72
  82. package/app/wujie-wk/wujie-vue2-child/src/store/index.js +0 -23
  83. package/app/wujie-wk/wujie-vue2-child/src/utils/winBox.js +0 -23
  84. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/A.vue +0 -12
  85. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/B.vue +0 -10
  86. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/MagicalComponentsForELFormItem.vue +0 -78
  87. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/index.vue +0 -59
  88. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/tableMouseHorizontalWheel.vue +0 -184
  89. package/app/wujie-wk/wujie-vue2-child/src/views/Home.vue +0 -27
  90. package/app/wujie-wk/wujie-vue2-child/src/views/RouterJump.vue +0 -145
  91. package/app/wujie-wk/wujie-vue2-child/src/views/calendar/index.vue +0 -19
  92. package/app/wujie-wk/wujie-vue2-child/src/views/css.vue +0 -57
  93. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/EllipsisText.vue +0 -73
  94. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/HoverCard.vue +0 -69
  95. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/TableHover.vue +0 -130
  96. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/inputSlo.vue +0 -42
  97. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/tableFixed.vue +0 -148
  98. package/app/wujie-wk/wujie-vue2-child/src/views/echarts/echart-dome.vue +0 -73
  99. package/app/wujie-wk/wujie-vue2-child/src/views/echarts/index.vue +0 -118
  100. package/app/wujie-wk/wujie-vue2-child/src/views/echarts/pei3d.vue +0 -658
  101. package/app/wujie-wk/wujie-vue2-child/src/views/element/bpmn/index.vue +0 -15
  102. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceCycle/index.vue +0 -131
  103. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceGroup/index.vue +0 -147
  104. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendancePersonnel/index.vue +0 -158
  105. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/companyCalendar/index.vue +0 -147
  106. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shift/index.vue +0 -147
  107. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shiftRotationSystem/index.vue +0 -147
  108. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/columnManagement.vue +0 -340
  109. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/dialogInput.vue +0 -71
  110. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/elTableJsx.vue +0 -1826
  111. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/formTable.vue +0 -595
  112. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/index.vue +0 -29
  113. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/simpleTable.vue +0 -189
  114. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx.zip +0 -0
  115. package/app/wujie-wk/wujie-vue2-child/src/views/element/index.vue +0 -39
  116. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/README.md +0 -163
  117. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/example.vue +0 -307
  118. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/index.vue +0 -409
  119. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/toolbar.js +0 -122
  120. package/app/wujie-wk/wujie-vue2-child/vue.config.js +0 -15
@@ -1,202 +0,0 @@
1
- /**
2
- * EventCalendar 工具函数集
3
- * ------------------------------------------------------------------
4
- * 说明:本文件不依赖任何第三方库(含 dayjs / moment / lodash),
5
- * 仅使用原生 Date,保证组件文件夹可以整体拷贝到任意项目使用。
6
- */
7
-
8
- /** 数字补零:7 -> '07' */
9
- export function pad2(n) {
10
- return n < 10 ? '0' + n : String(n)
11
- }
12
-
13
- /**
14
- * 默认字段映射表
15
- * ------------------------------------------------------------------
16
- * 后端返回的字段名往往与组件内部约定不一致,
17
- * 使用者可通过 `field-names` prop 覆盖其中任意一项(支持 'a.b.c' 点路径)。
18
- */
19
- export const DEFAULT_FIELD_NAMES = {
20
- // —— 月份层(data 数组的每一项)——
21
- month: 'month', // 月份标识,形如 '2026-09'
22
- monthLabel: 'monthLabel', // 下拉框显示文案;缺省时自动生成「2026年9月」
23
- days: 'days', // 该月的日期数组
24
-
25
- // —— 日期层(days 数组的每一项)——
26
- date: 'date', // 日期标识,形如 '2026-09-07'
27
- items: 'items', // 当天的条目数组
28
-
29
- // —— 条目层(items 数组的每一项)——
30
- itemKey: 'id', // 条目唯一键(用于 v-for :key)
31
- itemLabel: 'label', // 条目主文案,如「电子科技大学」
32
- itemAddress: 'address', // 条目地址;为空时不渲染地址行
33
- itemBadge: 'badge', // 条目右上角角标文案,如「宣讲」「双选」
34
- itemType: 'type', // 条目类型,用于匹配 typeColors 配色
35
- itemDisabled: 'disabled' // 条目是否禁用(禁用后不响应点击)
36
- }
37
-
38
- /**
39
- * 按路径取值,支持 'a.b.c' 形式
40
- * @param {Object} obj 源对象
41
- * @param {String} path 字段路径
42
- */
43
- export function getByPath(obj, path) {
44
- if (obj == null || !path) return undefined
45
- if (path.indexOf('.') === -1) return obj[path]
46
- return path.split('.').reduce((acc, key) => (acc == null ? acc : acc[key]), obj)
47
- }
48
-
49
- /** 是否为合法 Date 对象 */
50
- function isValidDate(d) {
51
- return d instanceof Date && !isNaN(d.getTime())
52
- }
53
-
54
- /**
55
- * 把多种输入统一解析成 Date
56
- * 支持:Date / '2026-09-07' / '2026/9/7' / 时间戳
57
- */
58
- export function toDate(value) {
59
- if (isValidDate(value)) return value
60
- if (value == null || value === '') return null
61
-
62
- if (typeof value === 'number') {
63
- const d = new Date(value)
64
- return isValidDate(d) ? d : null
65
- }
66
-
67
- const str = String(value).trim()
68
- // 手动解析,规避 Safari / iOS 对 '2026-09-07' 的时区差异(会被当成 UTC)
69
- const m = str.match(/^(\d{4})[-/](\d{1,2})(?:[-/](\d{1,2}))?/)
70
- if (m) {
71
- const d = new Date(Number(m[1]), Number(m[2]) - 1, m[3] ? Number(m[3]) : 1)
72
- return isValidDate(d) ? d : null
73
- }
74
-
75
- const fallback = new Date(str)
76
- return isValidDate(fallback) ? fallback : null
77
- }
78
-
79
- /** Date -> 'YYYY-MM-DD' */
80
- export function formatDateKey(date) {
81
- const d = toDate(date)
82
- if (!d) return ''
83
- return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`
84
- }
85
-
86
- /** Date -> 'YYYY-MM' */
87
- export function formatMonthKey(date) {
88
- const d = toDate(date)
89
- if (!d) return ''
90
- return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}`
91
- }
92
-
93
- /**
94
- * 解析月份标识
95
- * @param {String|Date} monthKey '2026-09' / '2026/9' / Date
96
- * @returns {{ year: Number, month: Number }} month 为 1~12
97
- */
98
- export function parseMonthKey(monthKey) {
99
- const d = toDate(monthKey)
100
- if (!d) {
101
- const now = new Date()
102
- return { year: now.getFullYear(), month: now.getMonth() + 1 }
103
- }
104
- return { year: d.getFullYear(), month: d.getMonth() + 1 }
105
- }
106
-
107
- /** 两个 Date 是否为同一天 */
108
- export function isSameDay(a, b) {
109
- const d1 = toDate(a)
110
- const d2 = toDate(b)
111
- if (!d1 || !d2) return false
112
- return (
113
- d1.getFullYear() === d2.getFullYear() &&
114
- d1.getMonth() === d2.getMonth() &&
115
- d1.getDate() === d2.getDate()
116
- )
117
- }
118
-
119
- /**
120
- * 月份偏移,自动跨年
121
- * @param {String} monthKey '2026-01'
122
- * @param {Number} offset -1 上个月 / 1 下个月
123
- * @returns {String} '2025-12'
124
- */
125
- export function shiftMonth(monthKey, offset) {
126
- const { year, month } = parseMonthKey(monthKey)
127
- // new Date 的月份允许越界(-1 / 12),会自动进位到上一年 / 下一年
128
- return formatMonthKey(new Date(year, month - 1 + offset, 1))
129
- }
130
-
131
- /**
132
- * 构建一个月的日历格子矩阵(核心逻辑)
133
- * ------------------------------------------------------------------
134
- * 需求要点:
135
- * 1. 每个月天数不固定(28/29/30/31),且 1 号是星期几也不固定;
136
- * 2. 需要用「上个月末尾几天」补齐第一行,用「下个月开头几天」补齐最后一行;
137
- * 3. 跨年(1 月往前补 12 月、12 月往后补次年 1 月)必须正确。
138
- *
139
- * 实现方式:先算出本月 1 号相对「一周起始日」的偏移量 leading,
140
- * 然后以 `new Date(year, month - 1, 1 - leading + i)` 递推生成所有格子。
141
- * 原生 Date 对天数越界(负数或超出当月天数)会自动进位/借位,
142
- * 因此跨月、跨年都会被自动处理,无需特判 1 月 / 12 月。
143
- *
144
- * @param {String} monthKey '2026-02'
145
- * @param {Number} firstDayOfWeek 一周起始日,0=周日(设计图)1=周一
146
- * @param {Date} today 今天(便于测试时注入)
147
- * @returns {Array} 42 或 35 个格子(始终是 7 的整数倍)
148
- */
149
- export function buildMonthMatrix(monthKey, firstDayOfWeek = 0, today = new Date()) {
150
- const { year, month } = parseMonthKey(monthKey)
151
-
152
- const firstDayOfMonth = new Date(year, month - 1, 1)
153
- // new Date(y, m, 0) 表示「第 m 月的第 0 天」即上个月最后一天,用来取当月总天数
154
- const daysInMonth = new Date(year, month, 0).getDate()
155
-
156
- // 本月 1 号是星期几(0=周日),再换算成相对一周起始日的偏移
157
- const leading = (firstDayOfMonth.getDay() - firstDayOfWeek + 7) % 7
158
- // 向上取整到 7 的倍数,保证最后一行也被补满
159
- const totalCells = Math.ceil((leading + daysInMonth) / 7) * 7
160
-
161
- const cells = []
162
- for (let i = 0; i < totalCells; i++) {
163
- const date = new Date(year, month - 1, 1 - leading + i)
164
- const cellMonth = date.getMonth() + 1
165
- const isCurrentMonth = date.getFullYear() === year && cellMonth === month
166
-
167
- cells.push({
168
- date,
169
- dateKey: formatDateKey(date),
170
- monthKey: formatMonthKey(date),
171
- year: date.getFullYear(),
172
- month: cellMonth,
173
- day: date.getDate(),
174
- weekday: date.getDay(),
175
- /** 是否属于当前渲染的月份(false 时置灰) */
176
- isCurrentMonth,
177
- /** 'prev' 上月补位 | 'current' 当月 | 'next' 下月补位 */
178
- position: isCurrentMonth ? 'current' : i < leading ? 'prev' : 'next',
179
- isToday: isSameDay(date, today),
180
- isWeekend: date.getDay() === 0 || date.getDay() === 6,
181
- /** 所在行索引,从 0 开始 */
182
- rowIndex: Math.floor(i / 7),
183
- colIndex: i % 7
184
- })
185
- }
186
-
187
- return cells
188
- }
189
-
190
- /** 默认星期文案,下标即 Date.getDay() 的返回值 */
191
- export const DEFAULT_WEEK_LABELS = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
192
-
193
- /** 默认日期文案格式化:{ month: 9, day: 7 } -> '9月7日' */
194
- export function defaultDayFormatter(cell) {
195
- return `${cell.month}月${cell.day}日`
196
- }
197
-
198
- /** 默认月份下拉文案:'2026-09' -> '2026年9月' */
199
- export function defaultMonthFormatter(monthKey) {
200
- const { year, month } = parseMonthKey(monthKey)
201
- return `${year}年${month}月`
202
- }
@@ -1,123 +0,0 @@
1
- <template>
2
- <div class="selector-container">
3
- <div class="header">函数</div>
4
- <div class="tree-wrapper">
5
- <el-tree
6
- :data="treeData"
7
- :props="defaultProps"
8
- @node-click="handleNodeClick"
9
- default-expand-all
10
- highlight-current
11
- >
12
- <span
13
- class="custom-tree-node"
14
- slot-scope="{ node, data }"
15
- :draggable="!onlyLeafClickable || node.isLeaf"
16
- @dragstart="handleDragStart(node, data, $event)"
17
- >
18
- {{ node.label }}
19
- </span>
20
- </el-tree>
21
- </div>
22
- </div>
23
- </template>
24
-
25
- <script>
26
- import { getFunctions } from "./api";
27
-
28
- export default {
29
- name: "FunctionSelector",
30
- props: {
31
- onlyLeafClickable: {
32
- type: Boolean,
33
- default: true,
34
- },
35
- prefix: {
36
- type: String,
37
- default: "F_",
38
- },
39
- },
40
- data() {
41
- return {
42
- treeData: [],
43
- defaultProps: {
44
- children: "children",
45
- label: "label",
46
- },
47
- };
48
- },
49
- mounted() {
50
- this.fetchData();
51
- },
52
- methods: {
53
- async fetchData() {
54
- this.treeData = await getFunctions();
55
- },
56
- handleNodeClick(data, node) {
57
- if (this.onlyLeafClickable && !node.isLeaf) {
58
- return;
59
- }
60
- this.$emit("select", { ...data, value: `${this.prefix}${data.name}()` });
61
- },
62
- handleDragStart(node, data, e) {
63
- if (this.onlyLeafClickable && !node.isLeaf) {
64
- e.preventDefault();
65
- return;
66
- }
67
- const value = `${this.prefix}${data.name}()`;
68
- e.dataTransfer.setData("text/plain", value);
69
- e.dataTransfer.effectAllowed = "copy";
70
-
71
- // 设置自定义拖拽镜像
72
- const div = document.createElement('div');
73
- div.innerText = value;
74
- div.style.position = 'absolute';
75
- div.style.top = '-9999px';
76
- div.style.padding = '5px 10px';
77
- div.style.background = '#fff';
78
- div.style.border = '1px solid #409eff';
79
- div.style.borderRadius = '4px';
80
- div.style.fontSize = '14px';
81
- div.style.color = '#303133';
82
- div.style.boxShadow = '0 2px 12px 0 rgba(0,0,0,0.1)';
83
- div.style.zIndex = '9999';
84
- document.body.appendChild(div);
85
-
86
- e.dataTransfer.setDragImage(div, 0, 0);
87
-
88
- setTimeout(() => {
89
- document.body.removeChild(div);
90
- }, 0);
91
- },
92
- },
93
- };
94
- </script>
95
-
96
- <style scoped>
97
- .custom-tree-node {
98
- flex: 1;
99
- display: flex;
100
- align-items: center;
101
- font-size: 14px;
102
- }
103
- .selector-container {
104
- width: 100%;
105
- height: 100%;
106
- display: flex;
107
- flex-direction: column;
108
- }
109
-
110
- .header {
111
- padding: 10px;
112
- background-color: #f5f7fa;
113
- border-bottom: 1px solid #ebeef5;
114
- font-weight: bold;
115
- text-align: center;
116
- }
117
-
118
- .tree-wrapper {
119
- flex: 1;
120
- overflow-y: auto;
121
- padding: 10px;
122
- }
123
- </style>
@@ -1,184 +0,0 @@
1
- <template>
2
- <div class="selector-container">
3
- <div class="header">操作符</div>
4
- <div class="tree-wrapper">
5
- <el-tree
6
- :data="operatorData"
7
- :props="defaultProps"
8
- @node-click="handleNodeClick"
9
- default-expand-all
10
- :expand-on-click-node="false"
11
- >
12
- <span
13
- class="custom-tree-node"
14
- slot-scope="{ node, data }"
15
- :draggable="!onlyLeafClickable || !data.children"
16
- @dragstart="handleDragStart(node, data, $event)"
17
- >
18
- <span>{{ node.label }}</span>
19
- <span v-if="!data.children && data.value" class="node-value">{{ data.value }}</span>
20
- </span>
21
- </el-tree>
22
- </div>
23
- </div>
24
- </template>
25
-
26
- <script>
27
- export default {
28
- name: "OperatorSelector",
29
- props: {
30
- onlyLeafClickable: {
31
- type: Boolean,
32
- default: true,
33
- },
34
- prefix: {
35
- type: String,
36
- default: "",
37
- },
38
- },
39
- data() {
40
- return {
41
- defaultProps: {
42
- children: "children",
43
- label: "label",
44
- },
45
- operatorData: [
46
- {
47
- label: "关键字",
48
- children: [
49
- { label: "如果", value: "if" },
50
- { label: "否则", value: "else" },
51
- ],
52
- },
53
- {
54
- label: "计算运算符",
55
- children: [
56
- { label: "加", value: "+" },
57
- { label: "减", value: "-" },
58
- { label: "乘", value: "*" },
59
- { label: "除", value: "/" },
60
- { label: "取余", value: "%" },
61
- { label: "左括号", value: "(" },
62
- { label: "右括号", value: ")" },
63
- ],
64
- },
65
- {
66
- label: "比较运算符",
67
- children: [
68
- { label: "大于", value: ">" },
69
- { label: "小于", value: "<" },
70
- { label: "等于", value: "==" },
71
- { label: "不等于", value: "!=" },
72
- { label: "大于等于", value: ">=" },
73
- { label: "小于等于", value: "<=" },
74
- ],
75
- },
76
- {
77
- label: "逻辑运算符",
78
- children: [
79
- { label: "并且", value: "&&" },
80
- { label: "或者", value: "||" },
81
- { label: "非", value: "!" },
82
- ],
83
- },
84
- ],
85
- };
86
- },
87
- methods: {
88
- handleNodeClick(data) {
89
- // 如果配置了只允许点击叶子节点,且当前节点有子节点,则不处理
90
- if (this.onlyLeafClickable && data.children) {
91
- return;
92
- }
93
-
94
- // 处理特殊关键字
95
- if (data.value === 'if') {
96
- this.$emit("select", { label: data.label, value: `${this.prefix}如果(){\n \n}` });
97
- } else if (data.value === 'else') {
98
- this.$emit("select", { label: data.label, value: `${this.prefix}否则{\n \n}` });
99
- } else {
100
- this.$emit("select", { ...data, value: `${this.prefix}${data.value}` });
101
- }
102
- },
103
- handleDragStart(node, data, e) {
104
- if (this.onlyLeafClickable && data.children) {
105
- e.preventDefault();
106
- return;
107
- }
108
-
109
- let value = '';
110
- if (data.value === 'if') {
111
- value = `${this.prefix}如果(){\n \n}`;
112
- } else if (data.value === 'else') {
113
- value = `${this.prefix}否则{\n \n}`;
114
- } else {
115
- value = `${this.prefix}${data.value}`;
116
- }
117
-
118
- e.dataTransfer.setData("text/plain", value);
119
- e.dataTransfer.effectAllowed = "copy";
120
-
121
- // 设置自定义拖拽镜像
122
- const div = document.createElement('div');
123
- div.innerText = value;
124
- div.style.position = 'absolute';
125
- div.style.top = '-9999px';
126
- div.style.padding = '5px 10px';
127
- div.style.background = '#fff';
128
- div.style.border = '1px solid #409eff';
129
- div.style.borderRadius = '4px';
130
- div.style.fontSize = '14px';
131
- div.style.color = '#303133';
132
- div.style.boxShadow = '0 2px 12px 0 rgba(0,0,0,0.1)';
133
- div.style.zIndex = '9999';
134
- // 保持换行
135
- div.style.whiteSpace = 'pre';
136
- document.body.appendChild(div);
137
-
138
- e.dataTransfer.setDragImage(div, 0, 0);
139
-
140
- setTimeout(() => {
141
- document.body.removeChild(div);
142
- }, 0);
143
- },
144
- },
145
- };
146
- </script>
147
-
148
- <style scoped>
149
- .selector-container {
150
- width: 100%;
151
- height: 100%;
152
- display: flex;
153
- flex-direction: column;
154
- }
155
-
156
- .header {
157
- padding: 10px;
158
- background-color: #f5f7fa;
159
- border-bottom: 1px solid #ebeef5;
160
- font-weight: bold;
161
- text-align: center;
162
- }
163
-
164
- .tree-wrapper {
165
- flex: 1;
166
- overflow-y: auto;
167
- padding: 5px;
168
- }
169
-
170
- .custom-tree-node {
171
- flex: 1;
172
- display: flex;
173
- align-items: center;
174
- justify-content: space-between;
175
- font-size: 14px;
176
- padding-right: 8px;
177
- }
178
-
179
- .node-value {
180
- color: #909399;
181
- font-size: 12px;
182
- font-family: monospace;
183
- }
184
- </style>
@@ -1,123 +0,0 @@
1
- <template>
2
- <div class="selector-container">
3
- <div class="header">参数</div>
4
- <div class="tree-wrapper">
5
- <el-tree
6
- :data="treeData"
7
- :props="defaultProps"
8
- @node-click="handleNodeClick"
9
- default-expand-all
10
- highlight-current
11
- >
12
- <span
13
- class="custom-tree-node"
14
- slot-scope="{ node, data }"
15
- :draggable="!onlyLeafClickable || node.isLeaf"
16
- @dragstart="handleDragStart(node, data, $event)"
17
- >
18
- {{ node.label }}
19
- </span>
20
- </el-tree>
21
- </div>
22
- </div>
23
- </template>
24
-
25
- <script>
26
- import { getParameters } from "./api";
27
-
28
- export default {
29
- name: "ParameterSelector",
30
- props: {
31
- onlyLeafClickable: {
32
- type: Boolean,
33
- default: true,
34
- },
35
- prefix: {
36
- type: String,
37
- default: "P_",
38
- },
39
- },
40
- data() {
41
- return {
42
- treeData: [],
43
- defaultProps: {
44
- children: "children",
45
- label: "label",
46
- },
47
- };
48
- },
49
- mounted() {
50
- this.fetchData();
51
- },
52
- methods: {
53
- async fetchData() {
54
- this.treeData = await getParameters();
55
- },
56
- handleNodeClick(data, node) {
57
- if (this.onlyLeafClickable && !node.isLeaf) {
58
- return;
59
- }
60
- this.$emit("select", { ...data, value: `${this.prefix}${data.name}` });
61
- },
62
- handleDragStart(node, data, e) {
63
- if (this.onlyLeafClickable && !node.isLeaf) {
64
- e.preventDefault();
65
- return;
66
- }
67
- const value = `${this.prefix}${data.name}`;
68
- e.dataTransfer.setData("text/plain", value);
69
- e.dataTransfer.effectAllowed = "copy";
70
-
71
- // 设置自定义拖拽镜像
72
- const div = document.createElement('div');
73
- div.innerText = value;
74
- div.style.position = 'absolute';
75
- div.style.top = '-9999px';
76
- div.style.padding = '5px 10px';
77
- div.style.background = '#fff';
78
- div.style.border = '1px solid #409eff';
79
- div.style.borderRadius = '4px';
80
- div.style.fontSize = '14px';
81
- div.style.color = '#303133';
82
- div.style.boxShadow = '0 2px 12px 0 rgba(0,0,0,0.1)';
83
- div.style.zIndex = '9999';
84
- document.body.appendChild(div);
85
-
86
- e.dataTransfer.setDragImage(div, 0, 0);
87
-
88
- setTimeout(() => {
89
- document.body.removeChild(div);
90
- }, 0);
91
- },
92
- },
93
- };
94
- </script>
95
-
96
- <style scoped>
97
- .custom-tree-node {
98
- flex: 1;
99
- display: flex;
100
- align-items: center;
101
- font-size: 14px;
102
- }
103
- .selector-container {
104
- width: 100%;
105
- height: 100%;
106
- display: flex;
107
- flex-direction: column;
108
- }
109
-
110
- .header {
111
- padding: 10px;
112
- background-color: #f5f7fa;
113
- border-bottom: 1px solid #ebeef5;
114
- font-weight: bold;
115
- text-align: center;
116
- }
117
-
118
- .tree-wrapper {
119
- flex: 1;
120
- overflow-y: auto;
121
- padding: 10px;
122
- }
123
- </style>
@@ -1,69 +0,0 @@
1
- export const getFunctions = () => {
2
- return new Promise((resolve) => {
3
- setTimeout(() => {
4
- resolve([
5
- {
6
- id: 1,
7
- label: '数学函数',
8
- children: [
9
- { id: 11, label: '求和', name: '求和' },
10
- { id: 12, label: '平均值', name: '平均值' },
11
- { id: 13, label: '最大值', name: '最大值' },
12
- { id: 14, label: '最小值', name: '最小值' }
13
- ]
14
- },
15
- {
16
- id: 2,
17
- label: '逻辑函数',
18
- children: [
19
- { id: 21, label: '条件判断', name: '条件判断' },
20
- { id: 22, label: '与', name: '与' },
21
- { id: 23, label: '或', name: '或' }
22
- ]
23
- },
24
- {
25
- id: 3,
26
- label: '文本函数',
27
- children: [
28
- { id: 31, label: '拼接', name: '拼接' },
29
- { id: 32, label: '截取', name: '截取' }
30
- ]
31
- }
32
- ]);
33
- }, 500);
34
- });
35
- };
36
-
37
- export const getParameters = () => {
38
- return new Promise((resolve) => {
39
- setTimeout(() => {
40
- resolve([
41
- {
42
- id: 100,
43
- label: '基础信息',
44
- children: [
45
- { id: 101, label: '员工姓名', name: '员工姓名' },
46
- { id: 102, label: '入职日期', name: '入职日期' },
47
- { id: 103, label: '部门', name: '部门' }
48
- ]
49
- },
50
- {
51
- id: 200,
52
- label: '薪资数据',
53
- children: [
54
- {
55
- id: 210,
56
- label: '基本工资',
57
- children: [
58
- { id: 211, label: '岗位工资', name: '岗位工资' },
59
- { id: 212, label: '绩效基数', name: '绩效基数' }
60
- ]
61
- },
62
- { id: 220, label: '奖金', name: '奖金' },
63
- { id: 230, label: '补贴', name: '补贴' }
64
- ]
65
- }
66
- ]);
67
- }, 500);
68
- });
69
- };