eoss 0.1.0-alpha.40 → 0.1.0-alpha.41
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/lib/0.js +1 -1
- package/lib/1.js +1 -1
- package/lib/10.js +1 -1
- package/lib/11.js +1 -1
- package/lib/12.js +1 -1
- package/lib/13.js +1 -1
- package/lib/14.js +1 -1
- package/lib/15.js +1 -1
- package/lib/16.js +1 -1
- package/lib/17.js +1 -1
- package/lib/18.js +1 -1
- package/lib/19.js +1 -1
- package/lib/20.js +1 -1
- package/lib/21.js +1 -1
- package/lib/22.js +1 -1
- package/lib/23.js +1 -1
- package/lib/24.js +1 -1
- package/lib/25.js +1 -1
- package/lib/26.js +1 -1
- package/lib/27.js +1 -1
- package/lib/28.js +1 -1
- package/lib/29.js +1 -1
- package/lib/3.js +1 -1
- package/lib/30.js +1 -1
- package/lib/31.js +1 -1
- package/lib/32.js +1 -1
- package/lib/33.js +1 -1
- package/lib/34.js +1 -1
- package/lib/35.js +1 -1
- package/lib/36.js +1 -1
- package/lib/37.js +1 -1
- package/lib/38.js +1 -1
- package/lib/39.js +1 -1
- package/lib/4.js +1 -1
- package/lib/40.js +1 -1
- package/lib/41.js +1 -1
- package/lib/42.js +1 -1
- package/lib/43.js +1 -1
- package/lib/44.js +1 -1
- package/lib/45.js +1 -1
- package/lib/46.js +1 -1
- package/lib/47.js +1 -1
- package/lib/48.js +1 -1
- package/lib/49.js +1 -1
- package/lib/5.js +1 -1
- package/lib/50.js +1 -1
- package/lib/51.js +1 -1
- package/lib/52.js +1 -1
- package/lib/53.js +1 -1
- package/lib/54.js +1 -1
- package/lib/55.js +1 -1
- package/lib/56.js +1 -1
- package/lib/57.js +1 -1
- package/lib/58.js +1 -1
- package/lib/59.js +1 -1
- package/lib/6.js +1 -1
- package/lib/60.js +1 -1
- package/lib/61.js +1 -1
- package/lib/62.js +1 -1
- package/lib/63.js +1 -1
- package/lib/64.js +1 -1
- package/lib/65.js +1 -1
- package/lib/66.js +1 -1
- package/lib/67.js +1 -1
- package/lib/68.js +1 -1
- package/lib/69.js +1 -1
- package/lib/7.js +1 -1
- package/lib/70.js +1 -1
- package/lib/71.js +1 -1
- package/lib/72.js +1 -1
- package/lib/73.js +1 -1
- package/lib/74.js +1 -1
- package/lib/75.js +1 -1
- package/lib/76.js +1 -1
- package/lib/77.js +1 -1
- package/lib/78.js +1 -1
- package/lib/79.js +1 -1
- package/lib/8.js +1 -1
- package/lib/80.js +1 -1
- package/lib/81.js +1 -1
- package/lib/9.js +1 -1
- package/lib/account-login.js +59 -59
- package/lib/alert.js +2 -2
- package/lib/aside.js +2 -2
- package/lib/audit-trajectory.js +2 -2
- package/lib/autocomplete.js +56 -56
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +6 -6
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +4 -4
- package/lib/button-group.js +4 -4
- package/lib/button.js +2 -2
- package/lib/ca-login.js +37 -37
- package/lib/calendar.js +4 -4
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +36 -36
- package/lib/carousel.js +38 -38
- package/lib/cascader-panel.js +71 -71
- package/lib/cascader.js +220 -220
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +65 -65
- package/lib/checkbox.js +6 -6
- package/lib/code-editor.js +1134 -0
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +76 -76
- package/lib/collapse.js +76 -76
- package/lib/color-picker.js +10 -10
- package/lib/container.js +2 -2
- package/lib/cron.js +20 -20
- package/lib/data-table.js +66 -66
- package/lib/date-picker.js +2419 -2419
- package/lib/descriptions-item.js +4 -4
- package/lib/descriptions.js +4 -4
- package/lib/dialog.js +42 -42
- package/lib/divider.js +2 -2
- package/lib/drawer.js +6 -6
- package/lib/dropdown-item.js +8 -8
- package/lib/dropdown-menu.js +20 -20
- package/lib/dropdown.js +40 -40
- package/lib/email-login.js +64 -64
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +23730 -5967
- package/lib/flip.js +2 -2
- package/lib/flow-group.js +55 -55
- package/lib/flow.js +171 -171
- package/lib/flows.js +77 -77
- package/lib/footer.js +2 -2
- package/lib/form-editor.js +12534 -0
- package/lib/form-item.js +57 -49
- package/lib/form.js +233 -174
- package/lib/guide.js +2 -2
- package/lib/header.js +2 -2
- package/lib/icon.js +38 -38
- package/lib/icons.js +11 -11
- package/lib/image-viewer.js +38 -38
- package/lib/image.js +6 -6
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +4 -4
- package/lib/input-number.js +39 -39
- package/lib/input.js +60 -60
- package/lib/link.js +2 -2
- package/lib/loading.js +6 -6
- package/lib/login.js +193 -193
- package/lib/lowcode-view.js +824 -132
- package/lib/lowcode.js +27278 -16925
- package/lib/main.js +270 -257
- package/lib/marquee.js +38 -38
- package/lib/menu-item-group.js +14 -14
- package/lib/menu-item.js +10 -10
- package/lib/menu.js +129 -129
- package/lib/message-box.js +52 -52
- package/lib/message.js +62 -62
- package/lib/notification.js +40 -40
- package/lib/option-group.js +4 -4
- package/lib/option.js +36 -36
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +37 -37
- package/lib/phone-login.js +58 -58
- package/lib/popconfirm.js +4 -4
- package/lib/popover.js +42 -42
- package/lib/process-config.js +65 -65
- package/lib/process-module.js +62 -62
- package/lib/process-rule.js +66 -66
- package/lib/progress.js +2 -2
- package/lib/qr-code.js +6 -6
- package/lib/qrcode-login.js +57 -57
- package/lib/radio-button.js +4 -4
- package/lib/radio-group.js +63 -63
- package/lib/radio.js +6 -6
- package/lib/rate.js +36 -36
- package/lib/retrial-auth.js +55 -55
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +41 -41
- package/lib/select.js +95 -95
- package/lib/selector-panel.js +92 -91
- package/lib/selector.js +935 -935
- package/lib/slider.js +6 -6
- package/lib/step.js +35 -35
- package/lib/steps.js +82 -82
- package/lib/submenu.js +38 -38
- package/lib/switch.js +38 -38
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +39 -39
- package/lib/table.js +653 -653
- package/lib/tabs.js +42 -42
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/code-editor.css +1 -0
- package/lib/theme-chalk/form-editor.css +1 -0
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -1
- package/lib/theme-chalk/selector.css +1 -1
- package/lib/time-picker.js +1276 -1276
- package/lib/time-select.js +21 -21
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tips.js +59 -59
- package/lib/toolbar.js +6 -6
- package/lib/tooltip.js +44 -44
- package/lib/transfer.js +36 -36
- package/lib/tree-group.js +49 -49
- package/lib/tree.js +432 -432
- package/lib/update-history.js +2 -2
- package/lib/upload.js +942 -942
- package/lib/utils/source-generator.js +586 -0
- package/lib/utils/source-parser.js +581 -0
- package/lib/wujie.js +39 -39
- package/package.json +1 -1
- package/packages/code-editor/index.js +5 -0
- package/packages/{lowcode/src/editor.vue → code-editor/src/code-editor.vue} +14 -17
- package/packages/form/src/form-item-render.vue +25 -0
- package/packages/form/src/form-item.vue +10 -3
- package/packages/form-editor/index.js +5 -0
- package/packages/form-editor/src/components.js +6736 -0
- package/packages/form-editor/src/form-editor.vue +981 -0
- package/packages/form-editor/src/props-panel.vue +168 -0
- package/packages/lowcode/src/attribute/bind.vue +5 -5
- package/packages/lowcode/src/attribute/function.vue +24 -9
- package/packages/lowcode/src/attribute/javascript.vue +4 -4
- package/packages/lowcode/src/attribute/property.vue +1 -1
- package/packages/lowcode/src/attribute/props.vue +44 -29
- package/packages/lowcode/src/attribute/styles.vue +1 -1
- package/packages/lowcode/src/attribute.vue +4 -4
- package/packages/lowcode/src/canvas.vue +45 -100
- package/packages/lowcode/src/form-render.vue +25 -13
- package/packages/lowcode/src/json.vue +4 -4
- package/packages/lowcode/src/lowcode.vue +1 -1
- package/packages/lowcode/src/modules.vue +8 -1
- package/packages/lowcode/src/render.vue +14 -9
- package/packages/lowcode/src/source.vue +6 -6
- package/packages/lowcode/src/util/components.js +15646 -68
- package/packages/lowcode/src/util/form-controls.js +87 -0
- package/packages/lowcode/src/util/props-util.js +9 -8
- package/packages/lowcode-view/src/render.vue +13 -6
- package/packages/lowcode-view/src/view.vue +4 -1
- package/packages/main/src/components/user.vue +2 -0
- package/packages/main/src/components/userinfo.vue +22 -14
- package/packages/selector-panel/src/mixin.js +1 -0
- package/packages/theme-chalk/src/code-editor.scss +59 -0
- package/packages/theme-chalk/src/form-editor.scss +240 -0
- package/packages/theme-chalk/src/form.scss +10 -1
- package/packages/theme-chalk/src/index.scss +2 -0
- package/packages/theme-chalk/src/lowcode.scss +1 -42
- package/packages/theme-chalk/src/selector.scss +2 -0
- package/src/index.js +7 -1
- package/{packages/lowcode/src/util → src/utils}/source-generator.js +24 -15
- package/{packages/lowcode/src/util → src/utils}/source-parser.js +67 -23
- /package/packages/{lowcode → code-editor}/src/util/json-repair.js +0 -0
- /package/packages/{lowcode → code-editor}/src/util/monaco-vue-completions.js +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单控件包裹契约共享常量:表单控件(EsInput/EsSelect 等)无论挂在哪个父节点下,
|
|
3
|
+
* 都以 label(字段标签)+ name(字段键)承载字段元信息,渲染时由 form-render
|
|
4
|
+
* 包一层 es-form-item(JSON 不存包裹节点);canvas 拖入与 source-parser
|
|
5
|
+
* 历史迁移共用本文件,保证字段键前缀与判定口径一致
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** 需被 es-form-item 包裹的表单控件(Pascal 名) */
|
|
9
|
+
export const FORM_CONTROLS = [
|
|
10
|
+
'EsIcons',
|
|
11
|
+
'EsRadio',
|
|
12
|
+
'EsRadioGroup',
|
|
13
|
+
'EsCheckbox',
|
|
14
|
+
'EsCheckboxGroup',
|
|
15
|
+
'EsInput',
|
|
16
|
+
'EsInputNumber',
|
|
17
|
+
'EsSelect',
|
|
18
|
+
'EsSelector',
|
|
19
|
+
'EsCascader',
|
|
20
|
+
'EsSwitch',
|
|
21
|
+
'EsSlider',
|
|
22
|
+
'EsTimePicker',
|
|
23
|
+
'EsDatePicker',
|
|
24
|
+
'EsDateTimePicker',
|
|
25
|
+
'EsUpload',
|
|
26
|
+
'EsRate',
|
|
27
|
+
'EsColorPicker',
|
|
28
|
+
'EsTransfer',
|
|
29
|
+
'EsCron',
|
|
30
|
+
'EsAutocomplete'
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
// 组件名 → 字段键前缀(对齐 field-render 的 COMPONENT_MAP)
|
|
34
|
+
export const COMP_TO_TYPE = {
|
|
35
|
+
EsInput: 'input',
|
|
36
|
+
EsInputNumber: 'number',
|
|
37
|
+
EsSelect: 'select',
|
|
38
|
+
EsSelector: 'selector',
|
|
39
|
+
EsCascader: 'cascader',
|
|
40
|
+
EsSwitch: 'switch',
|
|
41
|
+
EsDatePicker: 'date',
|
|
42
|
+
EsDateTimePicker: 'datetime',
|
|
43
|
+
EsTimePicker: 'time',
|
|
44
|
+
EsUpload: 'upload',
|
|
45
|
+
EsRate: 'rate',
|
|
46
|
+
EsSlider: 'slider',
|
|
47
|
+
EsColorPicker: 'color',
|
|
48
|
+
EsTransfer: 'transfer',
|
|
49
|
+
EsRadio: 'radio',
|
|
50
|
+
EsRadioGroup: 'radio',
|
|
51
|
+
EsCheckbox: 'checkbox',
|
|
52
|
+
EsCheckboxGroup: 'checkbox',
|
|
53
|
+
EsTree: 'tree'
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** es-input / esInput → EsInput */
|
|
57
|
+
export function toPascal(name) {
|
|
58
|
+
return String(name).replace(/(^|-)(\w)/g, (m, sep, c) => c.toUpperCase());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** 节点/条目是否为需包 es-form-item 的表单控件 */
|
|
62
|
+
export function isFormControlNode(item) {
|
|
63
|
+
return !!item && FORM_CONTROLS.includes(toPascal(item.nodeName || item.name));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** 字段键前缀:组件名未收录时兜底 input(与 canvas 拖入口径一致) */
|
|
67
|
+
export function fieldPrefix(pascalName) {
|
|
68
|
+
return COMP_TO_TYPE[pascalName] || 'input';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 在同级节点中生成不冲突的字段键:前缀 + 序号(与 canvas buildFieldProp 同规则)
|
|
73
|
+
* @param {Array} siblings 同级节点数组
|
|
74
|
+
* @param {string} pascalName 控件 Pascal 名
|
|
75
|
+
* @returns {string} 如 input1 / select2
|
|
76
|
+
*/
|
|
77
|
+
export function buildFieldKey(siblings, pascalName) {
|
|
78
|
+
const type = fieldPrefix(pascalName);
|
|
79
|
+
// 从 1 递增查重:首个控件产出 input1(length+1 起算会使首控件变 input2)
|
|
80
|
+
let idx = 1;
|
|
81
|
+
let fieldName = type + idx;
|
|
82
|
+
while ((siblings || []).some((c) => c && c.name === fieldName)) {
|
|
83
|
+
idx += 1;
|
|
84
|
+
fieldName = type + idx;
|
|
85
|
+
}
|
|
86
|
+
return fieldName;
|
|
87
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 节点 props
|
|
2
|
+
* 节点 props 取值转换工具
|
|
3
3
|
*
|
|
4
|
-
* 节点 props
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* 节点 props 存取值对象 { propName: value },仅改动过的 prop 写入;
|
|
5
|
+
* 字符串取值支持 {{变量名}} 语法引用页面 data 中定义的变量
|
|
6
|
+
* (整体匹配按变量绑定,局部匹配按插值);
|
|
7
|
+
* 历史定义数组形态 [{ name, value? }] 仍兼容读取
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
/** 整体匹配 {{expr}} */
|
|
@@ -31,7 +32,7 @@ export function resolvePropValue(raw, data) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
/**
|
|
35
|
+
/** 按名读取原始取值:对象形态直读;数组形态 value 优先、其次 default */
|
|
35
36
|
export function getPropRaw(props, name) {
|
|
36
37
|
if (!props) return undefined;
|
|
37
38
|
if (!Array.isArray(props)) return props[name];
|
|
@@ -41,8 +42,8 @@ export function getPropRaw(props, name) {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
45
|
+
* 取值对象 → 组件 v-bind 用的取值对象(解析 {{var}},跳过 v- 键);
|
|
46
|
+
* 兼容历史定义数组形态(value 优先其次 default)
|
|
46
47
|
*/
|
|
47
48
|
export function propsToObject(props, data) {
|
|
48
49
|
if (!props) return {};
|
|
@@ -50,7 +51,7 @@ export function propsToObject(props, data) {
|
|
|
50
51
|
const result = {};
|
|
51
52
|
Object.keys(props).forEach((key) => {
|
|
52
53
|
if (key.startsWith('v-')) return;
|
|
53
|
-
result[key] = props[key];
|
|
54
|
+
result[key] = resolvePropValue(props[key], data);
|
|
54
55
|
});
|
|
55
56
|
return result;
|
|
56
57
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<component
|
|
10
10
|
v-else
|
|
11
11
|
style="width: 100%; height: 100%"
|
|
12
|
-
:is="newNode.name"
|
|
12
|
+
:is="newNode.nodeName || newNode.name"
|
|
13
13
|
:height="newHeight"
|
|
14
14
|
v-bind="cleanProps"
|
|
15
15
|
v-on="newNode.events"
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
>
|
|
23
23
|
<!-- 不用 v-if/v-else 包裹:children 为空时假分支的空注释/文本节点
|
|
24
24
|
会被 EsForm 等组件误判默认插槽有内容,导致 slot fallback 不渲染 -->
|
|
25
|
-
<!--
|
|
26
|
-
|
|
25
|
+
<!-- 子节点统一递归渲染;表单控件子节点(form-controls 清单命中,
|
|
26
|
+
与是否在 es-form 内无关)复用编辑器同一个 form-render(es-form-item 包裹层渲染时生成,无选中手柄) -->
|
|
27
27
|
<component
|
|
28
28
|
:is="childRender(child)"
|
|
29
29
|
v-for="child in newNode.children"
|
|
@@ -87,6 +87,10 @@
|
|
|
87
87
|
import Frame from './Iframe.vue';
|
|
88
88
|
import { propsToObject } from 'eoss/packages/lowcode/src/util/props-util.js';
|
|
89
89
|
import FormRender from 'eoss/packages/lowcode/src/form-render.vue';
|
|
90
|
+
import {
|
|
91
|
+
isFormControlNode,
|
|
92
|
+
toPascal
|
|
93
|
+
} from 'eoss/packages/lowcode/src/util/form-controls.js';
|
|
90
94
|
import EsButton from 'eoss/packages/button';
|
|
91
95
|
|
|
92
96
|
export default {
|
|
@@ -254,11 +258,14 @@ export default {
|
|
|
254
258
|
beforeDestroy() {},
|
|
255
259
|
methods: {
|
|
256
260
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
261
|
+
* 子节点渲染器:表单控件子节点仅在 es-form 内由 form-render 渲染,
|
|
262
|
+
* es-form 外拖入的控件裸渲染走通用 Render(与编辑器 render.vue 同一判定)
|
|
259
263
|
*/
|
|
260
264
|
childRender(child) {
|
|
261
|
-
|
|
265
|
+
if (!isFormControlNode(child)) return 'Render';
|
|
266
|
+
return toPascal(this.newNode.nodeName) === 'EsForm'
|
|
267
|
+
? 'FormRender'
|
|
268
|
+
: 'Render';
|
|
262
269
|
},
|
|
263
270
|
/**
|
|
264
271
|
* 处理组件大小调整开始事件
|
|
@@ -114,6 +114,7 @@ import EsIcon from 'eoss/packages/icon';
|
|
|
114
114
|
import EsScrollbar from 'eoss/packages/scrollbar';
|
|
115
115
|
import { getStorage } from 'eoss/src/utils/storage';
|
|
116
116
|
import Message from 'eoss/packages/message';
|
|
117
|
+
import { migrateDirectives } from 'eoss/src/utils/source-parser.js';
|
|
117
118
|
// 编辑态下布局末尾预留的投放区域高度:masonry 计入容器高度,流式布局用 padding-bottom
|
|
118
119
|
const DROP_SPACE = 200;
|
|
119
120
|
export default {
|
|
@@ -347,7 +348,9 @@ export default {
|
|
|
347
348
|
} else {
|
|
348
349
|
this.pageData = { ...page, ...parsed };
|
|
349
350
|
}
|
|
350
|
-
// 合并:page 保留元信息,parsed 提供 children/style
|
|
351
|
+
// 合并:page 保留元信息,parsed 提供 children/style 等渲染所需结构;
|
|
352
|
+
// 历史形态(name/formItem/props 定义数组/doc)递归迁移后再渲染
|
|
353
|
+
migrateDirectives(this.pageData);
|
|
351
354
|
this.setPageData(this.pageData);
|
|
352
355
|
// mounted 时 pages 尚为空,异步拿到数据后需重新触发布局
|
|
353
356
|
this.$nextTick(() => {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
<script>
|
|
19
19
|
import { updateUserInfo } from 'eoss/src/config/api.js';
|
|
20
|
-
import { startWith,
|
|
20
|
+
import { startWith, getWinTop } from 'eoss/src/utils/util';
|
|
21
21
|
import { getStorage } from 'eoss/src/utils/storage';
|
|
22
22
|
import { ajax } from 'eoss/src/utils/ajax';
|
|
23
23
|
import { doEncrypt } from 'eoss/src/utils/sm';
|
|
@@ -45,11 +45,13 @@ export default {
|
|
|
45
45
|
return {};
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
type:
|
|
50
|
-
default
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
checkPassword: {
|
|
49
|
+
type: [RegExp, Function, String],
|
|
50
|
+
default: null
|
|
51
|
+
},
|
|
52
|
+
checkPasswordMsg: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: null
|
|
53
55
|
}
|
|
54
56
|
},
|
|
55
57
|
data() {
|
|
@@ -175,13 +177,15 @@ export default {
|
|
|
175
177
|
message: '请输入新密码'
|
|
176
178
|
}
|
|
177
179
|
: {},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
this.checkPassword
|
|
181
|
+
? {
|
|
182
|
+
pattern: this.checkPassword,
|
|
183
|
+
message: this.checkPasswordMsg
|
|
184
|
+
? this.checkPasswordMsg
|
|
185
|
+
: '密码格式不合法',
|
|
186
|
+
trigger: 'blur'
|
|
187
|
+
}
|
|
188
|
+
: {}
|
|
185
189
|
],
|
|
186
190
|
repassword: [
|
|
187
191
|
this.model.password || this.model.oldpassword
|
|
@@ -383,7 +387,11 @@ export default {
|
|
|
383
387
|
},
|
|
384
388
|
repassword(rule, value, callback) {
|
|
385
389
|
if (this.model.oldpassword && this.model.password && value) {
|
|
386
|
-
|
|
390
|
+
if (value !== this.model.password) {
|
|
391
|
+
callback(new Error('两次输入的密码不一致'));
|
|
392
|
+
} else {
|
|
393
|
+
callback();
|
|
394
|
+
}
|
|
387
395
|
} else {
|
|
388
396
|
callback();
|
|
389
397
|
return true;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@import './common/var.scss';
|
|
2
|
+
@import './mixins/mixins.scss';
|
|
3
|
+
|
|
4
|
+
/* 代码编辑器(monaco 封装):根容器撑满父级,底部 28px 状态栏 */
|
|
5
|
+
@include b(code-editor) {
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
min-height: 200px;
|
|
10
|
+
|
|
11
|
+
@include e(instance) {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: calc(100% - 28px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include e(bar) {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
height: 28px;
|
|
21
|
+
padding: 0 12px;
|
|
22
|
+
background: #252526;
|
|
23
|
+
border-top: 1px solid #3c3c3c;
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
color: #9d9d9d;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@include e(status) {
|
|
29
|
+
color: #89d185;
|
|
30
|
+
|
|
31
|
+
@include when(dirty) {
|
|
32
|
+
color: #e2c08d;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include when(error) {
|
|
36
|
+
color: #f48771;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@include e(tip) {
|
|
41
|
+
kbd {
|
|
42
|
+
padding: 1px 6px;
|
|
43
|
+
margin: 0 2px;
|
|
44
|
+
background: #3c3c3c;
|
|
45
|
+
border: 1px solid #555;
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
font-family: inherit;
|
|
48
|
+
color: #cccccc;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Monaco 编辑器当前行高亮样式 - 使用全局样式 */
|
|
54
|
+
.monaco-editor .current-line {
|
|
55
|
+
background-color: rgba(255, 213, 0, 0.15) !important;
|
|
56
|
+
}
|
|
57
|
+
.monaco-editor .current-line-margin-top {
|
|
58
|
+
background-color: rgba(255, 213, 0, 0.15) !important;
|
|
59
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
@import './common/var.scss';
|
|
2
|
+
@import './mixins/mixins.scss';
|
|
3
|
+
|
|
4
|
+
/* 表单编辑器:三栏布局(控件面板 / 表单画布 / 属性面板)+ JSON 编辑弹窗 */
|
|
5
|
+
@include b(form-editor) {
|
|
6
|
+
display: flex;
|
|
7
|
+
height: 100%;
|
|
8
|
+
min-height: 480px;
|
|
9
|
+
border: 1px solid #e4e7ed;
|
|
10
|
+
background: #fff;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
|
|
13
|
+
@include e(aside) {
|
|
14
|
+
width: 220px;
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
border-right: 1px solid #e4e7ed;
|
|
19
|
+
background: #fafafa;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include e(search) {
|
|
23
|
+
padding: 8px;
|
|
24
|
+
border-bottom: 1px solid #e4e7ed;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@include e(palette-wrap) {
|
|
28
|
+
flex: 1;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include e(palette) {
|
|
33
|
+
padding: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include e(palette-group) {
|
|
37
|
+
padding: 6px 4px;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
color: #909399;
|
|
40
|
+
user-select: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include e(palette-item) {
|
|
44
|
+
padding: 7px 10px;
|
|
45
|
+
margin-bottom: 6px;
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
color: #606266;
|
|
48
|
+
background: #fff;
|
|
49
|
+
border: 1px solid #dcdfe6;
|
|
50
|
+
border-radius: 3px;
|
|
51
|
+
cursor: move;
|
|
52
|
+
user-select: none;
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
color: #409eff;
|
|
56
|
+
border-color: #409eff;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@include e(main) {
|
|
61
|
+
flex: 1;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
min-width: 0;
|
|
65
|
+
background: #f5f7fa;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include e(toolbar) {
|
|
69
|
+
text-align: right;
|
|
70
|
+
padding: 10px 12px;
|
|
71
|
+
background: #fff;
|
|
72
|
+
border-bottom: 1px solid #e4e7ed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include e(title) {
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
color: #303133;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@include e(canvas-wrap) {
|
|
81
|
+
flex: 1;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
.es-scrollbar__view {
|
|
84
|
+
min-height: calc(100% - 15px);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@include e(canvas) {
|
|
89
|
+
min-height: 100%;
|
|
90
|
+
padding: 16px;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@include e(form) {
|
|
95
|
+
background: #fff;
|
|
96
|
+
border: 1px dashed #dcdfe6;
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
padding: 16px 16px 0;
|
|
99
|
+
&.is-active {
|
|
100
|
+
border-color: $--color-primary;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@include e(fields) {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
min-height: 120px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@include e(field) {
|
|
111
|
+
position: relative;
|
|
112
|
+
cursor: move;
|
|
113
|
+
&::before {
|
|
114
|
+
display: block;
|
|
115
|
+
position: absolute;
|
|
116
|
+
border-radius: $--border-radius-base;
|
|
117
|
+
border: 1px dashed #c0c4cc;
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
bottom: 0;
|
|
122
|
+
z-index: 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:hover {
|
|
126
|
+
background: #f5f7fa;
|
|
127
|
+
&::before {
|
|
128
|
+
border-color: $--color-primary;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.is-active {
|
|
133
|
+
background: #ecf5ff;
|
|
134
|
+
&::before {
|
|
135
|
+
border-color: $--color-primary;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.is-ghost {
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
&::before {
|
|
142
|
+
border-color: $--color-primary;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* handle 插槽挂在 form-item 根级:字段需提供定位锚 */
|
|
148
|
+
@include e(field) {
|
|
149
|
+
position: relative;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@include e(field-remove) {
|
|
153
|
+
position: absolute !important;
|
|
154
|
+
top: 2px;
|
|
155
|
+
right: 4px;
|
|
156
|
+
display: none;
|
|
157
|
+
z-index: 2;
|
|
158
|
+
color: #f56c6c;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* 列宽拖拽手柄:贴字段左右缘,向对应方向拖动按列取整改 span */
|
|
162
|
+
@include e(resize-handle) {
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 0;
|
|
165
|
+
bottom: 0;
|
|
166
|
+
width: 10px;
|
|
167
|
+
display: none;
|
|
168
|
+
z-index: 2;
|
|
169
|
+
cursor: col-resize;
|
|
170
|
+
color: $--color-primary;
|
|
171
|
+
text-align: center;
|
|
172
|
+
|
|
173
|
+
&::before {
|
|
174
|
+
line-height: 40px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.is-left {
|
|
178
|
+
left: -5px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.is-right {
|
|
182
|
+
right: -5px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* 选中字段时显示手柄按钮(跨元素组合选择器,平铺书写) */
|
|
187
|
+
.es-form-editor__field.is-active .es-form-editor__field-remove,
|
|
188
|
+
.es-form-editor__field.is-active .es-form-editor__resize-handle {
|
|
189
|
+
display: block;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@include e(empty) {
|
|
193
|
+
width: 100%;
|
|
194
|
+
padding: 48px 0;
|
|
195
|
+
text-align: center;
|
|
196
|
+
font-size: 13px;
|
|
197
|
+
color: #909399;
|
|
198
|
+
user-select: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@include e(attribute) {
|
|
202
|
+
width: 320px;
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
border-left: 1px solid #e4e7ed;
|
|
205
|
+
background: #fff;
|
|
206
|
+
overflow: auto;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@include e(panel-title) {
|
|
210
|
+
padding: 12px;
|
|
211
|
+
font-size: 13px;
|
|
212
|
+
color: #303133;
|
|
213
|
+
border-bottom: 1px solid #e4e7ed;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* 字段属性标题右侧的切回入口:点击回到表单属性面板 */
|
|
217
|
+
@include e(panel-switch) {
|
|
218
|
+
float: right;
|
|
219
|
+
font-size: 12px;
|
|
220
|
+
color: #409eff;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
}
|
|
223
|
+
@include e(props) {
|
|
224
|
+
height: calc(100% - 45px);
|
|
225
|
+
.es-form-content {
|
|
226
|
+
padding: 12px 20px 12px 12px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/* JSON 编辑弹窗内的 monaco 编辑器:EsCodeEditor 根容器需外层撑高 */
|
|
230
|
+
@include e(json-editor) {
|
|
231
|
+
height: calc(100vh - 220px);
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
|
|
235
|
+
.es-code-editor__instance {
|
|
236
|
+
flex: 1;
|
|
237
|
+
min-height: 0;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -55,7 +55,15 @@
|
|
|
55
55
|
|
|
56
56
|
@include b(form-content) {
|
|
57
57
|
display: flex;
|
|
58
|
-
|
|
58
|
+
// 行向换行:插槽直挂的 es-form-item(lowcode es-form 内字段/业务插槽)
|
|
59
|
+
// 按 itemStyle 宽度换行成多列;contents 路径经 form-item-render 的
|
|
60
|
+
// .es-form-items 包裹层独占整行,内部布局不变
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
flex-direction: row;
|
|
63
|
+
> .es-form-items,
|
|
64
|
+
> *:not(.es-form-item) {
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
59
67
|
@include when(scroll) {
|
|
60
68
|
padding-right: 8px;
|
|
61
69
|
}
|
|
@@ -63,6 +71,7 @@
|
|
|
63
71
|
padding-right: 20px;
|
|
64
72
|
}
|
|
65
73
|
@include m(inline) {
|
|
74
|
+
flex-wrap: nowrap;
|
|
66
75
|
flex-direction: row;
|
|
67
76
|
padding: 0;
|
|
68
77
|
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
@import "./checkbox.scss";
|
|
21
21
|
@import "./checkbox-button.scss";
|
|
22
22
|
@import "./checkbox-group.scss";
|
|
23
|
+
@import "./code-editor.scss";
|
|
23
24
|
@import "./col.scss";
|
|
24
25
|
@import "./collapse.scss";
|
|
25
26
|
@import "./collapse-item.scss";
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
@import "./flows.scss";
|
|
44
45
|
@import "./flow-group.scss";
|
|
45
46
|
@import "./form.scss";
|
|
47
|
+
@import "./form-editor.scss";
|
|
46
48
|
@import "./form-item.scss";
|
|
47
49
|
@import "./footer.scss";
|
|
48
50
|
@import "./guide.scss";
|
|
@@ -537,46 +537,5 @@
|
|
|
537
537
|
text-align: right;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
|
|
541
|
-
position: relative;
|
|
542
|
-
width: 100%;
|
|
543
|
-
height: 100%;
|
|
544
|
-
min-height: 200px;
|
|
545
|
-
@include m(instance) {
|
|
546
|
-
width: 100%;
|
|
547
|
-
height: calc(100% - 28px);
|
|
548
|
-
}
|
|
549
|
-
@include m(bar) {
|
|
550
|
-
display: flex;
|
|
551
|
-
align-items: center;
|
|
552
|
-
justify-content: space-between;
|
|
553
|
-
height: 28px;
|
|
554
|
-
padding: 0 12px;
|
|
555
|
-
background: #252526;
|
|
556
|
-
border-top: 1px solid #3c3c3c;
|
|
557
|
-
font-size: 12px;
|
|
558
|
-
color: #9d9d9d;
|
|
559
|
-
}
|
|
560
|
-
@include m(status) {
|
|
561
|
-
color: #89d185;
|
|
562
|
-
@include when(dirty) {
|
|
563
|
-
color: #e2c08d;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
@include when(error) {
|
|
567
|
-
color: #f48771;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
@include m(tip) {
|
|
571
|
-
kbd {
|
|
572
|
-
padding: 1px 6px;
|
|
573
|
-
margin: 0 2px;
|
|
574
|
-
background: #3c3c3c;
|
|
575
|
-
border: 1px solid #555;
|
|
576
|
-
border-radius: 3px;
|
|
577
|
-
font-family: inherit;
|
|
578
|
-
color: #cccccc;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
540
|
+
/* 代码编辑器样式已随 editor.vue 独立成 EsCodeEditor 组件,迁至 code-editor.scss */
|
|
582
541
|
}
|