cloud-web-corejs 1.0.54-dev.689 → 1.0.54-dev.690
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/package.json +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +66 -53
- package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +143 -143
- package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +4 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +54 -54
- package/src/components/xform/form-render/container-item/data-table-item.vue +2 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +67 -24
- package/src/components/xform/form-render/indexMixin.js +22 -1
package/package.json
CHANGED
|
@@ -1,35 +1,52 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<static-content-wrapper
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<static-content-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:design-state="designState"
|
|
6
|
+
:display-style="field.options.displayStyle"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<div class="ellipsis">
|
|
15
|
+
<a class="a-link" :class="widgetClass" @click="handleClick">
|
|
16
|
+
<el-tooltip
|
|
17
|
+
:enterable="false"
|
|
18
|
+
effect="dark"
|
|
19
|
+
:content="label"
|
|
20
|
+
placement="top"
|
|
21
|
+
popper-class="tooltip-skin"
|
|
22
|
+
:disabled="!label || field.options.disabled"
|
|
23
|
+
>
|
|
24
|
+
<span>
|
|
25
|
+
<i
|
|
26
|
+
:class="field.options.prefixIcon"
|
|
27
|
+
v-if="!!field.options.prefixIcon"
|
|
28
|
+
></i>
|
|
29
|
+
<span v-if="!!label">{{ label }}</span>
|
|
30
|
+
<i
|
|
31
|
+
:class="field.options.suffixIcon"
|
|
32
|
+
v-if="!!field.options.suffixIcon"
|
|
33
|
+
></i>
|
|
34
|
+
</span>
|
|
35
|
+
</el-tooltip>
|
|
36
|
+
</a>
|
|
20
37
|
</div>
|
|
21
|
-
|
|
38
|
+
</static-content-wrapper>
|
|
22
39
|
</template>
|
|
23
40
|
|
|
24
41
|
<script>
|
|
25
|
-
import StaticContentWrapper from
|
|
26
|
-
import emitter from
|
|
42
|
+
import StaticContentWrapper from "./static-content-wrapper";
|
|
43
|
+
import emitter from "../../../../../components/xform/utils/emitter";
|
|
27
44
|
import i18n from "../../../../../components/xform/utils/i18n";
|
|
28
45
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
29
46
|
|
|
30
47
|
export default {
|
|
31
48
|
name: "a-link-widget",
|
|
32
|
-
componentName:
|
|
49
|
+
componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
33
50
|
mixins: [emitter, fieldMixin, i18n],
|
|
34
51
|
props: {
|
|
35
52
|
field: Object,
|
|
@@ -40,41 +57,39 @@ export default {
|
|
|
40
57
|
|
|
41
58
|
designState: {
|
|
42
59
|
type: Boolean,
|
|
43
|
-
default: false
|
|
60
|
+
default: false,
|
|
44
61
|
},
|
|
45
62
|
|
|
46
|
-
subFormRowIndex: {
|
|
47
|
-
type: Number,
|
|
48
|
-
default: -1
|
|
63
|
+
subFormRowIndex: {
|
|
64
|
+
/* 子表单组件行索引,从0开始计数 */ type: Number,
|
|
65
|
+
default: -1,
|
|
49
66
|
},
|
|
50
|
-
subFormColIndex: {
|
|
51
|
-
type: Number,
|
|
52
|
-
default: -1
|
|
67
|
+
subFormColIndex: {
|
|
68
|
+
/* 子表单组件列索引,从0开始计数 */ type: Number,
|
|
69
|
+
default: -1,
|
|
53
70
|
},
|
|
54
|
-
subFormRowId: {
|
|
55
|
-
type: String,
|
|
56
|
-
default:
|
|
71
|
+
subFormRowId: {
|
|
72
|
+
/* 子表单组件行Id,唯一id且不可变 */ type: String,
|
|
73
|
+
default: "",
|
|
57
74
|
},
|
|
58
|
-
|
|
59
75
|
},
|
|
60
76
|
components: {
|
|
61
77
|
StaticContentWrapper,
|
|
62
78
|
},
|
|
63
79
|
computed: {
|
|
64
|
-
showLabel(){
|
|
65
|
-
return this.field.options.labelHidden? null: this.label;
|
|
66
|
-
},
|
|
67
80
|
label() {
|
|
68
|
-
return this.field.options.isFormLabel
|
|
81
|
+
return this.field.options.isFormLabel
|
|
82
|
+
? this.getCurrentValue()
|
|
83
|
+
: this.getI18nLabel(this.field.options.label);
|
|
69
84
|
},
|
|
70
85
|
widgetClass() {
|
|
71
86
|
let list = [];
|
|
72
|
-
let optionModel = this.field.options
|
|
87
|
+
let optionModel = this.field.options;
|
|
73
88
|
if (optionModel.colorClass) list.push(optionModel.colorClass);
|
|
74
|
-
if (optionModel.underline) list.push(
|
|
75
|
-
if (optionModel.disabled) list.push(
|
|
76
|
-
return list
|
|
77
|
-
}
|
|
89
|
+
if (optionModel.underline) list.push("underLine");
|
|
90
|
+
if (optionModel.disabled) list.push("is-disabled");
|
|
91
|
+
return list;
|
|
92
|
+
},
|
|
78
93
|
},
|
|
79
94
|
beforeCreate() {
|
|
80
95
|
/* 这里不能访问方法和属性!! */
|
|
@@ -83,31 +98,30 @@ export default {
|
|
|
83
98
|
created() {
|
|
84
99
|
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
|
85
100
|
需要在父组件created中初始化!! */
|
|
86
|
-
this.registerToRefList()
|
|
87
|
-
this.initEventHandler()
|
|
101
|
+
this.registerToRefList();
|
|
102
|
+
this.initEventHandler();
|
|
88
103
|
|
|
89
|
-
this.handleOnCreated()
|
|
104
|
+
this.handleOnCreated();
|
|
90
105
|
},
|
|
91
106
|
|
|
92
107
|
mounted() {
|
|
93
|
-
this.handleOnMounted()
|
|
108
|
+
this.handleOnMounted();
|
|
94
109
|
},
|
|
95
110
|
|
|
96
111
|
beforeDestroy() {
|
|
97
|
-
this.unregisterFromRefList()
|
|
112
|
+
this.unregisterFromRefList();
|
|
98
113
|
},
|
|
99
114
|
|
|
100
115
|
methods: {
|
|
101
116
|
handleClick(e) {
|
|
102
|
-
if(this.field.options.disabled)return
|
|
117
|
+
if (this.field.options.disabled) return;
|
|
103
118
|
this.handleButtonWidgetClick(e);
|
|
104
119
|
if (!this.designState && this.field.options.href) {
|
|
105
120
|
window.open(this.field.options.href);
|
|
106
121
|
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
}
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
111
125
|
</script>
|
|
112
126
|
|
|
113
127
|
<style lang="scss" scoped>
|
|
@@ -115,5 +129,4 @@ export default {
|
|
|
115
129
|
a.is-disabled {
|
|
116
130
|
cursor: not-allowed;
|
|
117
131
|
}
|
|
118
|
-
|
|
119
132
|
</style>
|
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form-item-wrapper
|
|
3
|
-
:designer="designer"
|
|
4
|
-
:field="field"
|
|
5
|
-
:rules="rules"
|
|
6
|
-
:design-state="designState"
|
|
7
|
-
:parent-widget="parentWidget"
|
|
8
|
-
:parent-list="parentList"
|
|
9
|
-
:index-of-parent-list="indexOfParentList"
|
|
10
|
-
:sub-form-row-index="subFormRowIndex"
|
|
11
|
-
:sub-form-col-index="subFormColIndex"
|
|
12
|
-
:sub-form-row-id="subFormRowId"
|
|
13
|
-
>
|
|
14
|
-
<div v-if="designState" class="script-input-design-placeholder">
|
|
15
|
-
{{ getI18nLabel(field.options.placeholder) || "脚本输入框" }}
|
|
16
|
-
<span class="script-input-mode">({{ editorMode }})</span>
|
|
17
|
-
</div>
|
|
18
|
-
<template v-else-if="isReadMode">
|
|
19
|
-
<pre class="readonly-mode-field script-input-readonly">{{ fieldModel }}</pre>
|
|
20
|
-
</template>
|
|
21
|
-
<code-editor
|
|
22
|
-
v-else
|
|
23
|
-
v-model="fieldModel"
|
|
24
|
-
:mode="editorMode"
|
|
25
|
-
:readonly="field.options.readonly || field.options.disabled"
|
|
26
|
-
:height="editorHeight"
|
|
27
|
-
:min-lines="editorMinLines"
|
|
28
|
-
:max-lines="editorMaxLines"
|
|
29
|
-
:user-worker="userWorker"
|
|
30
|
-
:resize="!field.options.disabled && !field.options.readonly"
|
|
31
|
-
@input="onEditorInput"
|
|
32
|
-
/>
|
|
33
|
-
</form-item-wrapper>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import FormItemWrapper from "./form-item-wrapper";
|
|
38
|
-
import emitter from "../../../utils/emitter";
|
|
39
|
-
import i18n from "../../../utils/i18n";
|
|
40
|
-
import fieldMixin from "./fieldMixin";
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: "script-input-widget",
|
|
44
|
-
componentName: "FieldWidget",
|
|
45
|
-
mixins: [emitter, fieldMixin, i18n],
|
|
46
|
-
props: {
|
|
47
|
-
field: Object,
|
|
48
|
-
parentWidget: Object,
|
|
49
|
-
parentList: Array,
|
|
50
|
-
indexOfParentList: Number,
|
|
51
|
-
designer: Object,
|
|
52
|
-
designState: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
},
|
|
56
|
-
subFormRowIndex: {
|
|
57
|
-
type: Number,
|
|
58
|
-
default: -1,
|
|
59
|
-
},
|
|
60
|
-
subFormColIndex: {
|
|
61
|
-
type: Number,
|
|
62
|
-
default: -1,
|
|
63
|
-
},
|
|
64
|
-
subFormRowId: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: "",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
components: {
|
|
70
|
-
FormItemWrapper,
|
|
71
|
-
},
|
|
72
|
-
inject: ["refList", "globalOptionData", "globalModel"],
|
|
73
|
-
data() {
|
|
74
|
-
return {
|
|
75
|
-
oldFieldValue: null,
|
|
76
|
-
fieldModel: null,
|
|
77
|
-
rules: [],
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
computed: {
|
|
81
|
-
editorMode() {
|
|
82
|
-
return this.field.options.editorMode || "javascript";
|
|
83
|
-
},
|
|
84
|
-
editorHeight() {
|
|
85
|
-
return this.field.options.editorHeight || "200px";
|
|
86
|
-
},
|
|
87
|
-
editorMinLines() {
|
|
88
|
-
return this.field.options.editorMinLines || 8;
|
|
89
|
-
},
|
|
90
|
-
editorMaxLines() {
|
|
91
|
-
return this.field.options.editorMaxLines || 30;
|
|
92
|
-
},
|
|
93
|
-
userWorker() {
|
|
94
|
-
return this.field.options.userWorker === true;
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
created() {
|
|
98
|
-
this.initFieldModel();
|
|
99
|
-
this.registerToRefList();
|
|
100
|
-
this.initEventHandler();
|
|
101
|
-
this.buildFieldRules();
|
|
102
|
-
this.handleOnCreated();
|
|
103
|
-
},
|
|
104
|
-
mounted() {
|
|
105
|
-
this.handleOnMounted();
|
|
106
|
-
},
|
|
107
|
-
beforeDestroy() {
|
|
108
|
-
this.unregisterFromRefList();
|
|
109
|
-
},
|
|
110
|
-
methods: {
|
|
111
|
-
onEditorInput(val) {
|
|
112
|
-
this.handleInputCustomEvent(val);
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<style lang="scss" scoped>
|
|
119
|
-
@import "~@/styles/global.scss";
|
|
120
|
-
|
|
121
|
-
.script-input-design-placeholder {
|
|
122
|
-
min-height: 120px;
|
|
123
|
-
padding: 12px;
|
|
124
|
-
border: 1px dashed #c0c4cc;
|
|
125
|
-
border-radius: 4px;
|
|
126
|
-
color: #909399;
|
|
127
|
-
font-size: 13px;
|
|
128
|
-
background: #fafafa;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.script-input-mode {
|
|
132
|
-
margin-left: 6px;
|
|
133
|
-
color: #336699;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.script-input-readonly {
|
|
137
|
-
margin: 0;
|
|
138
|
-
white-space: pre-wrap;
|
|
139
|
-
word-break: break-all;
|
|
140
|
-
font-family: Consolas, Monaco, monospace;
|
|
141
|
-
font-size: 12px;
|
|
142
|
-
}
|
|
143
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<form-item-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:rules="rules"
|
|
6
|
+
:design-state="designState"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<div v-if="designState" class="script-input-design-placeholder">
|
|
15
|
+
{{ getI18nLabel(field.options.placeholder) || "脚本输入框" }}
|
|
16
|
+
<span class="script-input-mode">({{ editorMode }})</span>
|
|
17
|
+
</div>
|
|
18
|
+
<template v-else-if="isReadMode">
|
|
19
|
+
<pre class="readonly-mode-field script-input-readonly">{{ fieldModel }}</pre>
|
|
20
|
+
</template>
|
|
21
|
+
<code-editor
|
|
22
|
+
v-else
|
|
23
|
+
v-model="fieldModel"
|
|
24
|
+
:mode="editorMode"
|
|
25
|
+
:readonly="field.options.readonly || field.options.disabled"
|
|
26
|
+
:height="editorHeight"
|
|
27
|
+
:min-lines="editorMinLines"
|
|
28
|
+
:max-lines="editorMaxLines"
|
|
29
|
+
:user-worker="userWorker"
|
|
30
|
+
:resize="!field.options.disabled && !field.options.readonly"
|
|
31
|
+
@input="onEditorInput"
|
|
32
|
+
/>
|
|
33
|
+
</form-item-wrapper>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import FormItemWrapper from "./form-item-wrapper";
|
|
38
|
+
import emitter from "../../../utils/emitter";
|
|
39
|
+
import i18n from "../../../utils/i18n";
|
|
40
|
+
import fieldMixin from "./fieldMixin";
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: "script-input-widget",
|
|
44
|
+
componentName: "FieldWidget",
|
|
45
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
46
|
+
props: {
|
|
47
|
+
field: Object,
|
|
48
|
+
parentWidget: Object,
|
|
49
|
+
parentList: Array,
|
|
50
|
+
indexOfParentList: Number,
|
|
51
|
+
designer: Object,
|
|
52
|
+
designState: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
subFormRowIndex: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: -1,
|
|
59
|
+
},
|
|
60
|
+
subFormColIndex: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: -1,
|
|
63
|
+
},
|
|
64
|
+
subFormRowId: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
components: {
|
|
70
|
+
FormItemWrapper,
|
|
71
|
+
},
|
|
72
|
+
inject: ["refList", "globalOptionData", "globalModel"],
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
oldFieldValue: null,
|
|
76
|
+
fieldModel: null,
|
|
77
|
+
rules: [],
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
editorMode() {
|
|
82
|
+
return this.field.options.editorMode || "javascript";
|
|
83
|
+
},
|
|
84
|
+
editorHeight() {
|
|
85
|
+
return this.field.options.editorHeight || "200px";
|
|
86
|
+
},
|
|
87
|
+
editorMinLines() {
|
|
88
|
+
return this.field.options.editorMinLines || 8;
|
|
89
|
+
},
|
|
90
|
+
editorMaxLines() {
|
|
91
|
+
return this.field.options.editorMaxLines || 30;
|
|
92
|
+
},
|
|
93
|
+
userWorker() {
|
|
94
|
+
return this.field.options.userWorker === true;
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
created() {
|
|
98
|
+
this.initFieldModel();
|
|
99
|
+
this.registerToRefList();
|
|
100
|
+
this.initEventHandler();
|
|
101
|
+
this.buildFieldRules();
|
|
102
|
+
this.handleOnCreated();
|
|
103
|
+
},
|
|
104
|
+
mounted() {
|
|
105
|
+
this.handleOnMounted();
|
|
106
|
+
},
|
|
107
|
+
beforeDestroy() {
|
|
108
|
+
this.unregisterFromRefList();
|
|
109
|
+
},
|
|
110
|
+
methods: {
|
|
111
|
+
onEditorInput(val) {
|
|
112
|
+
this.handleInputCustomEvent(val);
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style lang="scss" scoped>
|
|
119
|
+
@import "~@/styles/global.scss";
|
|
120
|
+
|
|
121
|
+
.script-input-design-placeholder {
|
|
122
|
+
min-height: 120px;
|
|
123
|
+
padding: 12px;
|
|
124
|
+
border: 1px dashed #c0c4cc;
|
|
125
|
+
border-radius: 4px;
|
|
126
|
+
color: #909399;
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
background: #fafafa;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.script-input-mode {
|
|
132
|
+
margin-left: 6px;
|
|
133
|
+
color: #336699;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.script-input-readonly {
|
|
137
|
+
margin: 0;
|
|
138
|
+
white-space: pre-wrap;
|
|
139
|
+
word-break: break-all;
|
|
140
|
+
font-family: Consolas, Monaco, monospace;
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
}
|
|
143
|
+
</style>
|
package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue
CHANGED
|
@@ -87,6 +87,10 @@ export default {
|
|
|
87
87
|
result = result && !hasWf;
|
|
88
88
|
}*/
|
|
89
89
|
if(!this.designState){
|
|
90
|
+
// 表格行内嵌组件不走表单字段 dispermissions 校验
|
|
91
|
+
if (this.$parent?.tableParam) {
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
90
94
|
let authCode = this.$parent.getAuthCode ? this.$parent.getAuthCode() : null
|
|
91
95
|
if(authCode){
|
|
92
96
|
let dispermissions = this.$store.getters.dispermissions;
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-form-item label="编辑器语言">
|
|
4
|
-
<el-select v-model="optionModel.editorMode">
|
|
5
|
-
<el-option value="javascript" label="JavaScript"></el-option>
|
|
6
|
-
<el-option value="java" label="Java"></el-option>
|
|
7
|
-
<el-option value="json" label="JSON"></el-option>
|
|
8
|
-
</el-select>
|
|
9
|
-
</el-form-item>
|
|
10
|
-
<el-form-item label="编辑器高度">
|
|
11
|
-
<el-input
|
|
12
|
-
v-model="optionModel.editorHeight"
|
|
13
|
-
placeholder="如 200px"
|
|
14
|
-
></el-input>
|
|
15
|
-
</el-form-item>
|
|
16
|
-
<el-form-item label="最小行数">
|
|
17
|
-
<el-input-number
|
|
18
|
-
v-model="optionModel.editorMinLines"
|
|
19
|
-
:min="3"
|
|
20
|
-
:max="100"
|
|
21
|
-
controls-position="right"
|
|
22
|
-
style="width: 100%"
|
|
23
|
-
></el-input-number>
|
|
24
|
-
</el-form-item>
|
|
25
|
-
<el-form-item label="最大行数">
|
|
26
|
-
<el-input-number
|
|
27
|
-
v-model="optionModel.editorMaxLines"
|
|
28
|
-
:min="3"
|
|
29
|
-
:max="200"
|
|
30
|
-
controls-position="right"
|
|
31
|
-
style="width: 100%"
|
|
32
|
-
></el-input-number>
|
|
33
|
-
</el-form-item>
|
|
34
|
-
<el-form-item label="语法检查">
|
|
35
|
-
<el-switch v-model="optionModel.userWorker"></el-switch>
|
|
36
|
-
</el-form-item>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import i18n from "../../../../utils/i18n";
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
name: "script-input-editor",
|
|
45
|
-
mixins: [i18n],
|
|
46
|
-
props: {
|
|
47
|
-
designer: Object,
|
|
48
|
-
selectedWidget: Object,
|
|
49
|
-
optionModel: Object,
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style scoped></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item label="编辑器语言">
|
|
4
|
+
<el-select v-model="optionModel.editorMode">
|
|
5
|
+
<el-option value="javascript" label="JavaScript"></el-option>
|
|
6
|
+
<el-option value="java" label="Java"></el-option>
|
|
7
|
+
<el-option value="json" label="JSON"></el-option>
|
|
8
|
+
</el-select>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
<el-form-item label="编辑器高度">
|
|
11
|
+
<el-input
|
|
12
|
+
v-model="optionModel.editorHeight"
|
|
13
|
+
placeholder="如 200px"
|
|
14
|
+
></el-input>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
<el-form-item label="最小行数">
|
|
17
|
+
<el-input-number
|
|
18
|
+
v-model="optionModel.editorMinLines"
|
|
19
|
+
:min="3"
|
|
20
|
+
:max="100"
|
|
21
|
+
controls-position="right"
|
|
22
|
+
style="width: 100%"
|
|
23
|
+
></el-input-number>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
<el-form-item label="最大行数">
|
|
26
|
+
<el-input-number
|
|
27
|
+
v-model="optionModel.editorMaxLines"
|
|
28
|
+
:min="3"
|
|
29
|
+
:max="200"
|
|
30
|
+
controls-position="right"
|
|
31
|
+
style="width: 100%"
|
|
32
|
+
></el-input-number>
|
|
33
|
+
</el-form-item>
|
|
34
|
+
<el-form-item label="语法检查">
|
|
35
|
+
<el-switch v-model="optionModel.userWorker"></el-switch>
|
|
36
|
+
</el-form-item>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import i18n from "../../../../utils/i18n";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "script-input-editor",
|
|
45
|
+
mixins: [i18n],
|
|
46
|
+
props: {
|
|
47
|
+
designer: Object,
|
|
48
|
+
selectedWidget: Object,
|
|
49
|
+
optionModel: Object,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style scoped></style>
|
|
@@ -158,13 +158,13 @@
|
|
|
158
158
|
<component
|
|
159
159
|
v-else
|
|
160
160
|
:is="getColumnWidgetName(obj.column.params.widget)"
|
|
161
|
-
:field="
|
|
161
|
+
:field="getTableColumnWidget(obj)"
|
|
162
162
|
:form-model="globalModel.formModel"
|
|
163
163
|
:designer="null"
|
|
164
164
|
:key="
|
|
165
165
|
obj.rowIndex +
|
|
166
166
|
'-' +
|
|
167
|
-
|
|
167
|
+
(getTableColumnWidget(obj) && getTableColumnWidget(obj).id)
|
|
168
168
|
"
|
|
169
169
|
:parent-widget="widget"
|
|
170
170
|
:columnConfig="obj.column.params.columnConfig"
|
|
@@ -242,8 +242,19 @@ modules = {
|
|
|
242
242
|
return widget.options.labelKey || "label";
|
|
243
243
|
},
|
|
244
244
|
getTableColumnWidget(obj) {
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
const rowKey = obj?.row?._X_ROW_KEY;
|
|
246
|
+
const widget = obj?.column?.params?.widget;
|
|
247
|
+
if (!rowKey || !widget?.id) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
let rowSchema = this.fieldSchemaMap[rowKey];
|
|
251
|
+
if (!rowSchema) {
|
|
252
|
+
rowSchema = this.createRowFieldSchemaMap();
|
|
253
|
+
this.$set(this.fieldSchemaMap, rowKey, rowSchema);
|
|
254
|
+
} else if (!rowSchema[widget.id]) {
|
|
255
|
+
this.$set(rowSchema, widget.id, this.cloneFieldSchema(widget));
|
|
256
|
+
}
|
|
257
|
+
return rowSchema[widget.id] || null;
|
|
247
258
|
},
|
|
248
259
|
isShowColumnStatusWidget(obj, item) {
|
|
249
260
|
let widget = this.getTableColumnWidget(obj);
|
|
@@ -3764,38 +3775,70 @@ modules = {
|
|
|
3764
3775
|
return
|
|
3765
3776
|
}*/
|
|
3766
3777
|
|
|
3767
|
-
let rows = this.formModel[this.fieldKeyName];
|
|
3768
3778
|
let rowIdData = this.rowIdData;
|
|
3769
3779
|
let rowLength = this.rowIdData.length;
|
|
3770
3780
|
// this.fieldSchemaData.splice(0, this.fieldSchemaData.length) //清除数组必须用splice,length=0不会响应式更新!!
|
|
3771
3781
|
// if(initFlag)this.fieldSchemaMap = {};
|
|
3772
3782
|
if (rowLength > 0) {
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3783
|
+
const build = () => {
|
|
3784
|
+
if (!this.getTableFullColumns().length) {
|
|
3785
|
+
return false;
|
|
3786
|
+
}
|
|
3787
|
+
let fieldSchemaMap = {};
|
|
3788
|
+
let fieldSchemaMap0 = this.fieldSchemaMap;
|
|
3789
|
+
for (let i = 0; i < rowLength; i++) {
|
|
3790
|
+
let rowId = rowIdData[i];
|
|
3791
|
+
let fieldSchemaMap2 = null;
|
|
3792
|
+
if (initFlag) {
|
|
3793
|
+
fieldSchemaMap2 = this.createRowFieldSchemaMap();
|
|
3794
|
+
} else {
|
|
3795
|
+
let fieldSchemaMap01 = fieldSchemaMap0[rowId];
|
|
3796
|
+
fieldSchemaMap2 = fieldSchemaMap01
|
|
3797
|
+
? this.$baseLodash.cloneDeep(fieldSchemaMap01)
|
|
3798
|
+
: this.createRowFieldSchemaMap();
|
|
3799
|
+
}
|
|
3800
|
+
fieldSchemaMap[rowId] = fieldSchemaMap2;
|
|
3790
3801
|
}
|
|
3791
|
-
fieldSchemaMap
|
|
3802
|
+
this.fieldSchemaMap = fieldSchemaMap;
|
|
3803
|
+
return true;
|
|
3804
|
+
};
|
|
3805
|
+
if (!build()) {
|
|
3806
|
+
this.$nextTick(() => {
|
|
3807
|
+
if (this.rowIdData.length) {
|
|
3808
|
+
this.initFieldSchemaData(initFlag);
|
|
3809
|
+
}
|
|
3810
|
+
});
|
|
3792
3811
|
}
|
|
3793
|
-
this.fieldSchemaMap = fieldSchemaMap;
|
|
3794
3812
|
}
|
|
3795
3813
|
},
|
|
3796
|
-
|
|
3814
|
+
getTableFullColumns() {
|
|
3797
3815
|
let target = this.getGridTable();
|
|
3798
|
-
|
|
3816
|
+
if (target?.getTableColumn) {
|
|
3817
|
+
let { fullColumn } = target.getTableColumn();
|
|
3818
|
+
if (fullColumn?.length) {
|
|
3819
|
+
return fullColumn;
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
return this.vxeOption?.columns || [];
|
|
3823
|
+
},
|
|
3824
|
+
collectLeafTableColumns(columns, result = []) {
|
|
3825
|
+
if (!Array.isArray(columns)) {
|
|
3826
|
+
return result;
|
|
3827
|
+
}
|
|
3828
|
+
columns.forEach((column) => {
|
|
3829
|
+
if (column?.children?.length) {
|
|
3830
|
+
this.collectLeafTableColumns(column.children, result);
|
|
3831
|
+
} else {
|
|
3832
|
+
result.push(column);
|
|
3833
|
+
}
|
|
3834
|
+
});
|
|
3835
|
+
return result;
|
|
3836
|
+
},
|
|
3837
|
+
createRowFieldSchemaMap() {
|
|
3838
|
+
let fullColumn = this.collectLeafTableColumns(
|
|
3839
|
+
this.getTableFullColumns(),
|
|
3840
|
+
[]
|
|
3841
|
+
);
|
|
3799
3842
|
|
|
3800
3843
|
let fieldSchemaMap2 = {};
|
|
3801
3844
|
fullColumn.forEach((column) => {
|
|
@@ -566,6 +566,24 @@ modules = {
|
|
|
566
566
|
}
|
|
567
567
|
});
|
|
568
568
|
},
|
|
569
|
+
normalizeActionColumnWidget(fieldWidget, formatS) {
|
|
570
|
+
if (!fieldWidget?.options) return;
|
|
571
|
+
if (formatS === "editButton") {
|
|
572
|
+
fieldWidget.options.prefixIcon =
|
|
573
|
+
fieldWidget.options.prefixIcon || "el-icon-edit";
|
|
574
|
+
fieldWidget.options.label = fieldWidget.options.label || "查看";
|
|
575
|
+
if (fieldWidget.options.labelHidden === undefined) {
|
|
576
|
+
fieldWidget.options.labelHidden = true;
|
|
577
|
+
}
|
|
578
|
+
} else if (formatS === "editDelete") {
|
|
579
|
+
fieldWidget.options.prefixIcon =
|
|
580
|
+
fieldWidget.options.prefixIcon || "el-icon-delete";
|
|
581
|
+
fieldWidget.options.label = fieldWidget.options.label || "删除";
|
|
582
|
+
if (fieldWidget.options.labelHidden === undefined) {
|
|
583
|
+
fieldWidget.options.labelHidden = true;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
},
|
|
569
587
|
handleTableColumnWidget(widget) {
|
|
570
588
|
//修复data-table旧数据表格列widget与editWidget为空的问题
|
|
571
589
|
if (
|
|
@@ -590,7 +608,10 @@ modules = {
|
|
|
590
608
|
} else {
|
|
591
609
|
applyColumnMetaToFieldWidget(t.widget, t, false);
|
|
592
610
|
}
|
|
593
|
-
if (t.widget)
|
|
611
|
+
if (t.widget) {
|
|
612
|
+
t.widget.columnType = t.formatS;
|
|
613
|
+
this.normalizeActionColumnWidget(t.widget, t.formatS);
|
|
614
|
+
}
|
|
594
615
|
}
|
|
595
616
|
let type2 = columnFormatMap[t.editFormatS];
|
|
596
617
|
if (type2) {
|