eoss 0.1.0-alpha.24 → 0.1.0-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/lib/0.js +1 -1
  2. package/lib/1.js +1 -1
  3. package/lib/10.js +1 -1
  4. package/lib/11.js +1 -1
  5. package/lib/12.js +1 -1
  6. package/lib/13.js +1 -1
  7. package/lib/14.js +1 -1
  8. package/lib/15.js +1 -1
  9. package/lib/16.js +1 -1
  10. package/lib/17.js +1 -1
  11. package/lib/18.js +1 -1
  12. package/lib/19.js +1 -1
  13. package/lib/20.js +1 -1
  14. package/lib/21.js +1 -1
  15. package/lib/22.js +1 -1
  16. package/lib/23.js +1 -1
  17. package/lib/24.js +1 -1
  18. package/lib/25.js +1 -1
  19. package/lib/26.js +1 -1
  20. package/lib/27.js +1 -1
  21. package/lib/28.js +1 -1
  22. package/lib/29.js +1 -1
  23. package/lib/3.js +1 -1
  24. package/lib/30.js +1 -1
  25. package/lib/31.js +1 -1
  26. package/lib/32.js +1 -1
  27. package/lib/33.js +1 -1
  28. package/lib/34.js +1 -1
  29. package/lib/35.js +1 -1
  30. package/lib/36.js +1 -1
  31. package/lib/37.js +1 -1
  32. package/lib/38.js +1 -1
  33. package/lib/39.js +1 -1
  34. package/lib/4.js +1 -1
  35. package/lib/40.js +1 -1
  36. package/lib/41.js +1 -1
  37. package/lib/42.js +1 -1
  38. package/lib/43.js +1 -1
  39. package/lib/44.js +1 -1
  40. package/lib/45.js +1 -1
  41. package/lib/46.js +1 -1
  42. package/lib/47.js +1 -1
  43. package/lib/48.js +1 -1
  44. package/lib/49.js +1 -1
  45. package/lib/5.js +1 -1
  46. package/lib/50.js +1 -1
  47. package/lib/51.js +1 -1
  48. package/lib/52.js +1 -1
  49. package/lib/53.js +1 -1
  50. package/lib/54.js +1 -1
  51. package/lib/55.js +1 -1
  52. package/lib/56.js +1 -1
  53. package/lib/57.js +1 -1
  54. package/lib/58.js +1 -1
  55. package/lib/59.js +1 -1
  56. package/lib/6.js +1 -1
  57. package/lib/60.js +1 -1
  58. package/lib/61.js +1 -1
  59. package/lib/62.js +1 -1
  60. package/lib/63.js +1 -1
  61. package/lib/64.js +1 -1
  62. package/lib/65.js +1 -1
  63. package/lib/66.js +1 -1
  64. package/lib/67.js +1 -1
  65. package/lib/68.js +1 -1
  66. package/lib/69.js +1 -1
  67. package/lib/7.js +1 -1
  68. package/lib/70.js +1 -1
  69. package/lib/71.js +1 -1
  70. package/lib/72.js +1 -1
  71. package/lib/73.js +1 -1
  72. package/lib/74.js +1 -1
  73. package/lib/75.js +1 -1
  74. package/lib/76.js +1 -1
  75. package/lib/77.js +1 -1
  76. package/lib/78.js +1 -1
  77. package/lib/79.js +1 -1
  78. package/lib/8.js +1 -1
  79. package/lib/80.js +1 -1
  80. package/lib/81.js +1 -1
  81. package/lib/9.js +1 -1
  82. package/lib/account-login.js +1455 -1367
  83. package/lib/alert.js +2 -2
  84. package/lib/aside.js +2 -2
  85. package/lib/audit-trajectory.js +924 -0
  86. package/lib/autocomplete.js +2306 -2491
  87. package/lib/avatar.js +2 -2
  88. package/lib/backtop.js +2 -2
  89. package/lib/badge.js +2 -2
  90. package/lib/breadcrumb-item.js +2 -2
  91. package/lib/breadcrumb.js +2 -2
  92. package/lib/button-group.js +13 -13
  93. package/lib/button.js +2 -2
  94. package/lib/ca-login.js +1375 -1400
  95. package/lib/calendar.js +972 -997
  96. package/lib/card.js +2 -2
  97. package/lib/carousel-item.js +1300 -1325
  98. package/lib/carousel.js +1218 -1243
  99. package/lib/cascader-panel.js +2442 -2467
  100. package/lib/cascader.js +2873 -3058
  101. package/lib/checkbox-button.js +2 -2
  102. package/lib/checkbox-group.js +1669 -1614
  103. package/lib/checkbox.js +9 -42
  104. package/lib/col.js +2 -2
  105. package/lib/collapse-item.js +2471 -2602
  106. package/lib/collapse.js +2475 -2602
  107. package/lib/color-picker.js +955 -1115
  108. package/lib/config/api.js +77 -1
  109. package/lib/container.js +2 -2
  110. package/lib/cron.js +2 -2
  111. package/lib/data-table.js +2050 -1952
  112. package/lib/date-picker.js +2882 -3067
  113. package/lib/dialog.js +1638 -1661
  114. package/lib/divider.js +2 -2
  115. package/lib/drawer.js +4 -4
  116. package/lib/dropdown-item.js +2 -2
  117. package/lib/dropdown-menu.js +944 -1104
  118. package/lib/dropdown.js +1529 -1554
  119. package/lib/email-login.js +1572 -1484
  120. package/lib/empty.js +2 -2
  121. package/lib/eoss.common.js +12000 -5745
  122. package/lib/flip.js +2 -2
  123. package/lib/flow-group.js +1297 -1322
  124. package/lib/flow.js +1922 -1834
  125. package/lib/flows.js +1461 -1373
  126. package/lib/footer.js +2 -2
  127. package/lib/form-item.js +1887 -1912
  128. package/lib/form.js +2494 -2616
  129. package/lib/header.js +2 -2
  130. package/lib/icon.js +1526 -1438
  131. package/lib/icons.js +2 -2
  132. package/lib/image-viewer.js +1253 -1278
  133. package/lib/image.js +71 -71
  134. package/lib/index.js +1 -1
  135. package/lib/infinite-scroll.js +71 -71
  136. package/lib/input-number.js +4 -4
  137. package/lib/input.js +1355 -1380
  138. package/lib/link.js +2 -2
  139. package/lib/loading.js +5 -5
  140. package/lib/login.js +3111 -3010
  141. package/lib/lowcode.js +9296 -5835
  142. package/lib/main.js +4863 -4775
  143. package/lib/marquee.js +1297 -1322
  144. package/lib/menu-item-group.js +2 -2
  145. package/lib/menu-item.js +2 -2
  146. package/lib/menu.js +2935 -3120
  147. package/lib/message-box.js +1724 -1749
  148. package/lib/message.js +1258 -1283
  149. package/lib/notification.js +1907 -1932
  150. package/lib/option-group.js +2 -2
  151. package/lib/option.js +1260 -1285
  152. package/lib/page-header.js +2 -2
  153. package/lib/pagination.js +1587 -1612
  154. package/lib/phone-login.js +1562 -1474
  155. package/lib/popconfirm.js +12 -12
  156. package/lib/popover.js +3252 -3437
  157. package/lib/process-config.js +7645 -0
  158. package/lib/process-module.js +7051 -0
  159. package/lib/process-rule.js +8217 -0
  160. package/lib/progress.js +2 -2
  161. package/lib/qr-code.js +7 -7
  162. package/lib/qrcode-login.js +1561 -1473
  163. package/lib/radio-button.js +10 -21
  164. package/lib/radio-group.js +1691 -1632
  165. package/lib/radio.js +10 -25
  166. package/lib/rate.js +1377 -1402
  167. package/lib/row.js +2 -2
  168. package/lib/scrollbar.js +1491 -1516
  169. package/lib/select.js +3481 -3552
  170. package/lib/selector-panel.js +1791 -1765
  171. package/lib/selector.js +1856 -1778
  172. package/lib/slider.js +2 -2
  173. package/lib/step.js +2475 -2602
  174. package/lib/steps.js +1292 -1317
  175. package/lib/submenu.js +1454 -1614
  176. package/lib/switch.js +1333 -1358
  177. package/lib/tab-pane.js +2 -2
  178. package/lib/table-column.js +1293 -1318
  179. package/lib/table.js +3951 -4023
  180. package/lib/tabs.js +2334 -2359
  181. package/lib/tag.js +2 -2
  182. package/lib/theme-chalk/audit-trajectory.css +0 -0
  183. package/lib/theme-chalk/button-group.css +1 -1
  184. package/lib/theme-chalk/calendar.css +1 -1
  185. package/lib/theme-chalk/icons.css +1 -1
  186. package/lib/theme-chalk/index.css +1 -1
  187. package/lib/theme-chalk/lowcode.css +1 -1
  188. package/lib/theme-chalk/process-config.css +0 -0
  189. package/lib/theme-chalk/process-module.css +0 -0
  190. package/lib/theme-chalk/process-rule.css +1 -0
  191. package/lib/theme-chalk/tree.css +1 -1
  192. package/lib/theme-chalk/update-history.css +0 -0
  193. package/lib/time-picker.js +1953 -2138
  194. package/lib/time-select.js +1949 -2134
  195. package/lib/timeline-item.js +2 -2
  196. package/lib/timeline.js +2 -2
  197. package/lib/tips.js +1496 -1408
  198. package/lib/toolbar.js +6 -6
  199. package/lib/tooltip.js +2730 -2915
  200. package/lib/transfer.js +1350 -1375
  201. package/lib/tree-group.js +1524 -1436
  202. package/lib/tree.js +1843 -1755
  203. package/lib/update-history.js +879 -0
  204. package/lib/upload.js +2375 -2287
  205. package/lib/utils/ajax.js +3 -5
  206. package/package.json +1 -1
  207. package/packages/audit-trajectory/index.js +5 -0
  208. package/packages/audit-trajectory/src/main.vue +99 -0
  209. package/packages/button/src/button-group.vue +1 -1
  210. package/packages/checkbox/src/checkbox.vue +9 -14
  211. package/packages/data-table/src/data-table.vue +13 -4
  212. package/packages/dialog/src/dialog.vue +2 -0
  213. package/packages/form/src/form-item-render.vue +4 -0
  214. package/packages/form/src/form.vue +2 -2
  215. package/packages/login/src/login.vue +47 -46
  216. package/packages/lowcode/src/aside.vue +3 -1
  217. package/packages/lowcode/src/attribute/bind.vue +449 -236
  218. package/packages/lowcode/src/attribute/dependency.vue +487 -267
  219. package/packages/lowcode/src/attribute/function.vue +391 -51
  220. package/packages/lowcode/src/attribute/javascript.vue +311 -0
  221. package/packages/lowcode/src/attribute/property.vue +269 -166
  222. package/packages/lowcode/src/attribute/styles.vue +11 -4
  223. package/packages/lowcode/src/attribute.vue +684 -46
  224. package/packages/lowcode/src/canvas.vue +199 -24
  225. package/packages/lowcode/src/editor.vue +15 -2
  226. package/packages/lowcode/src/lowcode.vue +205 -17
  227. package/packages/lowcode/src/mixins/history.js +132 -0
  228. package/packages/lowcode/src/pages.vue +0 -52
  229. package/packages/lowcode/src/render.vue +87 -4
  230. package/packages/lowcode/src/source.vue +12 -5
  231. package/packages/lowcode/src/toolbar.vue +43 -20
  232. package/packages/lowcode/src/util/source-generator.js +535 -0
  233. package/packages/lowcode/src/{source-parser.js → util/source-parser.js} +86 -32
  234. package/packages/lowcode/src/view.vue +187 -0
  235. package/packages/lowcode-view/index.js +5 -0
  236. package/packages/process-config/index.js +5 -0
  237. package/packages/process-config/src/FormList.vue +180 -0
  238. package/packages/process-config/src/NodeConfig.vue +212 -0
  239. package/packages/process-config/src/NodeForm.vue +237 -0
  240. package/packages/process-config/src/main.vue +257 -0
  241. package/packages/process-module/index.js +5 -0
  242. package/packages/process-module/src/FormList.vue +177 -0
  243. package/packages/process-module/src/main.vue +233 -0
  244. package/packages/process-rule/index.js +5 -0
  245. package/packages/process-rule/src/FormList.vue +614 -0
  246. package/packages/process-rule/src/companyReportDetail.vue +92 -0
  247. package/packages/process-rule/src/main.vue +749 -0
  248. package/packages/radio/src/radio-button.vue +12 -9
  249. package/packages/radio/src/radio-group.vue +10 -14
  250. package/packages/radio/src/radio.vue +12 -11
  251. package/packages/select/src/option-tree.vue +4 -4
  252. package/packages/select/src/option.vue +2 -2
  253. package/packages/select/src/select.vue +32 -36
  254. package/packages/selector/src/selector.vue +10 -12
  255. package/packages/theme-chalk/src/audit-trajectory.scss +0 -0
  256. package/packages/theme-chalk/src/button-group.scss +7 -0
  257. package/packages/theme-chalk/src/icons.scss +1 -1
  258. package/packages/theme-chalk/src/index.scss +5 -0
  259. package/packages/theme-chalk/src/lowcode.scss +48 -1
  260. package/packages/theme-chalk/src/process-config.scss +0 -0
  261. package/packages/theme-chalk/src/process-module.scss +0 -0
  262. package/packages/theme-chalk/src/process-rule.scss +57 -0
  263. package/packages/theme-chalk/src/tree.scss +1 -0
  264. package/packages/theme-chalk/src/update-history.scss +0 -0
  265. package/packages/update-history/index.js +5 -0
  266. package/packages/update-history/src/main.vue +54 -0
  267. package/src/components/field-render.vue +5 -0
  268. package/src/config/api.js +77 -0
  269. package/src/index.js +322 -307
  270. package/src/utils/ajax.js +2 -2
  271. package/packages/lowcode/src/source-generator.js +0 -316
  272. /package/packages/lowcode/src/{json-repair.js → util/json-repair.js} +0 -0
  273. /package/packages/lowcode/src/{monaco-vue-completions.js → util/monaco-vue-completions.js} +0 -0
@@ -2,17 +2,30 @@
2
2
  <div :style="newNode.style" :data-id="newNode.id" @click.stop="handleClick">
3
3
  <component
4
4
  :is="newNode.name"
5
- v-bind="newNode.props"
5
+ v-bind="cleanProps"
6
6
  v-on="newNode.events"
7
7
  :key="newNode.id"
8
+ v-text="resolvedText"
9
+ v-show="
10
+ newNode.directives['show'] !== undefined
11
+ ? newNode.directives['show']
12
+ : true
13
+ "
8
14
  >
9
15
  <template v-if="newNode.children && newNode.children.length > 0">
10
16
  <Render
11
17
  v-for="child in newNode.children"
12
18
  :key="child.id"
13
19
  :node="child"
20
+ :page="page"
14
21
  />
15
22
  </template>
23
+ <template v-else-if="newNode.directives['text']">
24
+ <!-- v-text 已经通过组件的 v-text 属性渲染 -->
25
+ </template>
26
+ <template v-else-if="newNode.template">
27
+ <div v-html="renderTemplate(newNode.template)"></div>
28
+ </template>
16
29
  <template v-else>
17
30
  {{ newNode.description }}
18
31
  </template>
@@ -75,6 +88,10 @@ export default {
75
88
  type: Object,
76
89
  default: null
77
90
  },
91
+ page: {
92
+ type: Object,
93
+ default: null
94
+ },
78
95
  active: {
79
96
  type: String,
80
97
  default: ''
@@ -85,8 +102,11 @@ export default {
85
102
  }
86
103
  },
87
104
  data() {
105
+ const newNode = JSON.parse(JSON.stringify(this.node)) || {};
106
+ // directives 在页面结构上已定义,这里兼容子节点未携带的情况
107
+ newNode.directives = newNode.directives || {};
88
108
  return {
89
- newNode: JSON.parse(JSON.stringify(this.node)),
109
+ newNode,
90
110
  resizingComponent: null,
91
111
  initialMouseX: 0,
92
112
  initialMouseY: 0,
@@ -102,11 +122,61 @@ export default {
102
122
  watch: {
103
123
  node: {
104
124
  handler(newVal) {
105
- this.newNode = JSON.parse(JSON.stringify(newVal));
125
+ const node = JSON.parse(JSON.stringify(newVal)) || {};
126
+ node.directives = node.directives || {};
127
+ this.newNode = node;
106
128
  },
107
129
  deep: true
108
130
  }
109
131
  },
132
+ computed: {
133
+ /**
134
+ * 解析 text 指令中的表达式
135
+ * 支持 {{variable}} 形式,从 page.data 中获取值
136
+ */
137
+ resolvedText() {
138
+ const textExpr =
139
+ this.newNode.directives && this.newNode.directives['text'];
140
+ if (!textExpr) return '';
141
+ // 如果是表达式(不含空格,可能是变量名),尝试从 data 中获取值
142
+ if (
143
+ typeof textExpr === 'string' &&
144
+ !textExpr.includes(' ') &&
145
+ !textExpr.includes("'") &&
146
+ !textExpr.includes('"')
147
+ ) {
148
+ // 尝试从 page.data 中获取值
149
+ if (
150
+ this.page &&
151
+ this.page.data &&
152
+ this.page.data[textExpr] !== undefined
153
+ ) {
154
+ return this.page.data[textExpr];
155
+ }
156
+ }
157
+ return textExpr;
158
+ },
159
+ /**
160
+ * 过滤掉 Vue 指令(v-xxx)的 props,避免它们作为普通属性传递给组件
161
+ * 指令统一存在 directives 字段,这里仅兼容历史数据中混入 props 的 v- 键
162
+ */
163
+ cleanProps() {
164
+ if (!this.newNode) return {};
165
+ const result = {};
166
+ // 合并 HTML 属性
167
+ if (this.newNode.attrs) {
168
+ Object.assign(result, this.newNode.attrs);
169
+ }
170
+ // 合并组件 props(跳过 Vue 指令)
171
+ if (this.newNode.props) {
172
+ Object.keys(this.newNode.props).forEach((key) => {
173
+ if (key.startsWith('v-')) return;
174
+ result[key] = this.newNode.props[key];
175
+ });
176
+ }
177
+ return result;
178
+ }
179
+ },
110
180
  mounted() {},
111
181
  beforeDestroy() {},
112
182
  methods: {
@@ -251,13 +321,26 @@ export default {
251
321
  if (this.isResizing) {
252
322
  return;
253
323
  }
254
- this.$emit('click');
324
+ this.$emit('click', this.newNode);
255
325
  },
256
326
  /**
257
327
  * 处理组件删除事件
258
328
  */
259
329
  handleRemove() {
260
330
  this.$emit('remove');
331
+ },
332
+ /**
333
+ * 渲染模板内容
334
+ * @param {String} template - 模板字符串(可能包含 <template> 标签)
335
+ * @returns {String} 处理后的 HTML 内容
336
+ */
337
+ renderTemplate(template) {
338
+ if (!template) return '';
339
+ // 提取 <template> 标签内的内容
340
+ const match = template.match(/<template>([\s\S]*?)<\/template>/);
341
+ const content = match ? match[1] : template;
342
+ // 返回原始 HTML(Vue 模板表达式如 {{id}} 会原样显示)
343
+ return content.trim();
261
344
  }
262
345
  }
263
346
  };
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script>
12
12
  import editor from './editor.vue';
13
- import { generateVueSource } from './source-generator';
14
- import { parseVueSource } from './source-parser';
13
+ import { generateVueSource } from './util/source-generator';
14
+ import { parseVueSource } from './util/source-parser';
15
15
 
16
16
  export default {
17
17
  name: 'Source',
@@ -31,16 +31,23 @@ export default {
31
31
  data() {
32
32
  return {
33
33
  // 编辑器内容,随页面实时生成
34
- source: generateVueSource(this.page)
34
+ source: ''
35
35
  };
36
36
  },
37
37
 
38
+ mounted() {
39
+ // 在 mounted 中初始化源码,确保 page prop 已正确设置
40
+ this.refreshSource();
41
+ },
42
+
38
43
  watch: {
39
44
  // 页面变化(画布操作、外部更新)时重新生成源码
40
45
  page: {
41
46
  deep: true,
42
- handler() {
43
- this.refreshSource();
47
+ handler(newPage) {
48
+ if (newPage) {
49
+ this.refreshSource();
50
+ }
44
51
  }
45
52
  }
46
53
  },
@@ -24,23 +24,25 @@
24
24
  </es-button>
25
25
  </es-button-group>
26
26
  <div class="es-lowcode__toolbar--size" v-show="activeTool === 'custom'">
27
- <es-input v-model="width" size="small" placeholder="请输入宽度" @change="handleChangeSize" />
27
+ <es-input
28
+ v-model="width"
29
+ size="small"
30
+ placeholder="请输入宽度"
31
+ @change="handleChangeSize"
32
+ />
28
33
  <span class="es-lowcode__toolbar--size-split">x</span>
29
- <es-input v-model="height" size="small" placeholder="请输入高度" @change="handleChangeSize" />
34
+ <es-input
35
+ v-model="height"
36
+ size="small"
37
+ placeholder="请输入高度"
38
+ @change="handleChangeSize"
39
+ />
30
40
  </div>
31
41
  <es-button-group>
32
- <es-button
33
- size="small"
34
- :disabled="isUndoDisabled"
35
- @click="handleClick('repeal')"
36
- >
42
+ <es-button size="small" :disabled="isUndoDisabled" @click="handleUndo">
37
43
  <i class="es-icon-chehui"></i>
38
44
  </es-button>
39
- <es-button
40
- size="small"
41
- :disabled="isRedoDisabled"
42
- @click="handleClick('advance')"
43
- >
45
+ <es-button size="small" :disabled="isRedoDisabled" @click="handleRedo">
44
46
  <i class="es-icon-qianjin"></i>
45
47
  </es-button>
46
48
  </es-button-group>
@@ -85,7 +87,7 @@
85
87
  </template>
86
88
 
87
89
  <script>
88
- import bus from 'eoss/src/utils/bus.js'
90
+ import bus from 'eoss/src/utils/bus.js';
89
91
  import Button from 'eoss/packages/button';
90
92
  import ButtonGroup from 'eoss/packages/button-group';
91
93
  import Dropdown from 'eoss/packages/dropdown';
@@ -104,6 +106,8 @@ export default {
104
106
  Icon
105
107
  },
106
108
 
109
+ inject: ['lowcode'],
110
+
107
111
  props: {},
108
112
 
109
113
  data() {
@@ -111,13 +115,18 @@ export default {
111
115
  activeTool: 'web',
112
116
  activeTab: 'design',
113
117
  width: 300,
114
- height: 200,
115
- isUndoDisabled: true,
116
- isRedoDisabled: true
118
+ height: 200
117
119
  };
118
120
  },
119
121
 
120
- computed: {},
122
+ computed: {
123
+ isUndoDisabled() {
124
+ return !this.lowcode.canUndo;
125
+ },
126
+ isRedoDisabled() {
127
+ return !this.lowcode.canRedo;
128
+ }
129
+ },
121
130
 
122
131
  watch: {},
123
132
 
@@ -128,10 +137,24 @@ export default {
128
137
  methods: {
129
138
  handleClick(tool) {
130
139
  this.activeTool = tool;
131
- bus.$emit('changeSize', tool, {width: `${this.width}px`, height: `${this.height}px` });
140
+ bus.$emit('changeSize', tool, {
141
+ width: `${this.width}px`,
142
+ height: `${this.height}px`
143
+ });
144
+ },
145
+ /** 撤销 */
146
+ handleUndo() {
147
+ this.lowcode.undo();
148
+ },
149
+ /** 重做 */
150
+ handleRedo() {
151
+ this.lowcode.redo();
132
152
  },
133
153
  handleChangeSize() {
134
- bus.$emit('changeSize', this.activeTool, {width: `${this.width}px`, height: `${this.height}px` });
154
+ bus.$emit('changeSize', this.activeTool, {
155
+ width: `${this.width}px`,
156
+ height: `${this.height}px`
157
+ });
135
158
  },
136
159
  handleOpen(type) {
137
160
  bus.$emit('open', type);
@@ -141,7 +164,7 @@ export default {
141
164
  },
142
165
  handlePreview() {
143
166
  bus.$emit('preview');
144
- },
167
+ }
145
168
  }
146
169
  };
147
170
  </script>