cloud-web-corejs 1.0.54-dev.589 → 1.0.54-dev.590
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/table/index - /345/211/257/346/234/254.js" +1101 -0
- package/src/components/table/index.js +6 -2
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +10 -1
- package/src/components/xform/form-designer/form-widget/field-widget/{dropdown-menu-widget.vue → dropdown-widget.vue} +36 -14
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +89 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -2
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +14 -11
- package/src/components/xform/form-render/indexMixin.js +3696 -1
- package/src/components/xform/lang/zh-CN.js +1 -1
- package/src/components/xform/utils/formula-util.js +3 -0
- package/src/components/xform/utils/util.js +1465 -1
|
@@ -261,8 +261,12 @@ function columnDrop(t, tableName, tableRef) {
|
|
|
261
261
|
const oldColumnIndex = $table.getColumnIndex(collectColumn[oldIndex]);
|
|
262
262
|
const newColumnIndex = $table.getColumnIndex(collectColumn[newIndex]);
|
|
263
263
|
// 移动到目标列
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
let oldIndexFinal = oldColumnIndex;
|
|
265
|
+
let newIndexFinal = newColumnIndex;
|
|
266
|
+
// let oldIndexFinal = oldColumnIndex > newColumnIndex ? oldColumnIndex : newColumnIndex;
|
|
267
|
+
// let newIndexFinal = oldColumnIndex > newColumnIndex ? newColumnIndex : oldColumnIndex;
|
|
268
|
+
const currRow = collectColumn.splice(oldIndexFinal, 1)[0];
|
|
269
|
+
collectColumn.splice(newIndexFinal, 0, currRow);
|
|
266
270
|
$table.loadColumn(collectColumn);
|
|
267
271
|
addTableJson(that, $table, tableName, collectColumn);
|
|
268
272
|
},
|
package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue
CHANGED
|
@@ -65,7 +65,16 @@ export default {
|
|
|
65
65
|
},
|
|
66
66
|
|
|
67
67
|
methods: {
|
|
68
|
-
|
|
68
|
+
setHidden: function (e) {
|
|
69
|
+
this.field.options.hidden = e;
|
|
70
|
+
this.hidden = e;
|
|
71
|
+
this.$emit('hiddenChange' )
|
|
72
|
+
},
|
|
73
|
+
setDisabled: function (e) {
|
|
74
|
+
this.field.options.disabled = e;
|
|
75
|
+
this.disabled = e;
|
|
76
|
+
this.$emit('disabledChange')
|
|
77
|
+
},
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:index-of-parent-list="indexOfParentList"
|
|
6
6
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
|
7
7
|
:sub-form-row-id="subFormRowId">
|
|
8
|
-
<el-dropdown trigger="hover">
|
|
8
|
+
<el-dropdown trigger="hover" :disabled="field.options.disabled">
|
|
9
9
|
|
|
10
10
|
<el-button type="primary" class="button-sty" size="mini">
|
|
11
11
|
<span>{{ getI18nLabel(field.options.label) }}</span><span class="line"></span> <i
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
</el-button>
|
|
14
14
|
<el-dropdown-menu slot="dropdown">
|
|
15
15
|
<template v-for="(subWidget,index) in field.widgetList">
|
|
16
|
-
<el-dropdown-item v-
|
|
17
|
-
@click.native="handleSubButtonWidgetClick(index)">
|
|
16
|
+
<el-dropdown-item v-show="!subWidget.options.hidden" :key="index" :icon="subWidget.options.icon"
|
|
17
|
+
@click.native="(e) => handleSubButtonWidgetClick(e,index)" :disabled="subWidget.options.disabled">
|
|
18
18
|
<!-- {{ getI18nLabel(subWidget.options.label) }}-->
|
|
19
19
|
<dropdownItemWidget :field="subWidget" :parent-list="field.widgetList"
|
|
20
20
|
:index-of-parent-list="index" :parent-widget="field" :tableParam="tableParam"
|
|
21
|
-
:formItemProp="formItemProp" :ref="'item'+index"
|
|
21
|
+
:formItemProp="formItemProp" :ref="'item'+index" @hiddenChange="handleHidden"
|
|
22
|
+
@disabledChange="handleDisabled">
|
|
22
23
|
</dropdownItemWidget>
|
|
23
24
|
</el-dropdown-item>
|
|
24
25
|
|
|
@@ -30,13 +31,13 @@
|
|
|
30
31
|
|
|
31
32
|
<script>
|
|
32
33
|
import StaticContentWrapper from './static-content-wrapper'
|
|
33
|
-
import emitter from '
|
|
34
|
-
import i18n from "
|
|
35
|
-
import fieldMixin from "
|
|
36
|
-
import dropdownItemWidget from '
|
|
34
|
+
import emitter from '../../../utils/emitter'
|
|
35
|
+
import i18n from "../../../utils/i18n";
|
|
36
|
+
import fieldMixin from "./fieldMixin";
|
|
37
|
+
import dropdownItemWidget from './dropdown-item-widget.vue';
|
|
37
38
|
|
|
38
39
|
export default {
|
|
39
|
-
name: "dropdown-
|
|
40
|
+
name: "dropdown-widget",
|
|
40
41
|
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
41
42
|
mixins: [emitter, fieldMixin, i18n],
|
|
42
43
|
props: {
|
|
@@ -69,7 +70,9 @@ export default {
|
|
|
69
70
|
StaticContentWrapper,
|
|
70
71
|
dropdownItemWidget
|
|
71
72
|
},
|
|
72
|
-
computed: {
|
|
73
|
+
computed: {
|
|
74
|
+
|
|
75
|
+
},
|
|
73
76
|
beforeCreate() {
|
|
74
77
|
/* 这里不能访问方法和属性!! */
|
|
75
78
|
},
|
|
@@ -79,7 +82,7 @@ export default {
|
|
|
79
82
|
需要在父组件created中初始化!! */
|
|
80
83
|
this.registerToRefList()
|
|
81
84
|
this.initEventHandler()
|
|
82
|
-
|
|
85
|
+
this.init()
|
|
83
86
|
this.handleOnCreated()
|
|
84
87
|
},
|
|
85
88
|
|
|
@@ -92,9 +95,28 @@ export default {
|
|
|
92
95
|
},
|
|
93
96
|
|
|
94
97
|
methods: {
|
|
95
|
-
|
|
96
|
-
this
|
|
97
|
-
|
|
98
|
+
init(){
|
|
99
|
+
if(this.designState)return
|
|
100
|
+
let isShow = this.field.widgetList.some((item) => !item.options.hidden)
|
|
101
|
+
if(!isShow){
|
|
102
|
+
this.field.options.hidden = true
|
|
103
|
+
}
|
|
104
|
+
let isEnabled = this.field.widgetList.some((item) => !item.options.disabled)
|
|
105
|
+
if(!isEnabled){
|
|
106
|
+
this.field.options.disabled = true
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
handleSubButtonWidgetClick(e, index) {
|
|
110
|
+
this.$refs["item"+index][0].handleButtonWidgetClick(e)
|
|
111
|
+
},
|
|
112
|
+
handleHidden() {
|
|
113
|
+
let isShow = this.field.widgetList.some((item) => !item.options.hidden)
|
|
114
|
+
this.setHidden(!isShow)
|
|
115
|
+
},
|
|
116
|
+
handleDisabled() {
|
|
117
|
+
let isEnabled = this.field.widgetList.some((item) => !item.options.disabled)
|
|
118
|
+
this.setDisabled(!isEnabled)
|
|
119
|
+
},
|
|
98
120
|
}
|
|
99
121
|
|
|
100
122
|
}
|
package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item label-width="0">
|
|
4
|
+
<el-divider class="custom-divider">下拉按钮设置</el-divider>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<el-form-item label="当前下拉按钮"></el-form-item>
|
|
7
|
+
<el-form-item label-width="0">
|
|
8
|
+
<draggable tag="ul" class="draggable-box" :list="selectedWidget.widgetList"
|
|
9
|
+
v-bind="{ group: 'optionsGroup', ghostClass: 'ghost', handle: '.drag-option' }">
|
|
10
|
+
<li v-for="(colItem, colIdx) in selectedWidget.widgetList" :key="colIdx" class="col-item">
|
|
11
|
+
<i class="el-icon-s-operation drag-option"></i>
|
|
12
|
+
<el-input v-model="colItem.options.label" class="cell-span-input"></el-input>
|
|
13
|
+
<el-button circle plain size="mini" type="button"
|
|
14
|
+
icon="el-icon-edit" class="col-delete-button" style="position: unset;" @click="openEditFormatConfigDialog(colItem, colIdx)"></el-button>
|
|
15
|
+
<el-button circle plain size="mini" type="danger" @click="deleteCol(selectedWidget, colIdx)"
|
|
16
|
+
icon="el-icon-minus" class="col-delete-button" style="position: unset;"></el-button>
|
|
17
|
+
</li>
|
|
18
|
+
</draggable>
|
|
19
|
+
<div>
|
|
20
|
+
<el-button type="text" @click="addNewCol(selectedWidget)" icon="el-icon-circle-plus-outline" class="add-option">
|
|
21
|
+
增加
|
|
22
|
+
</el-button>
|
|
23
|
+
</div>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import Draggable from 'vuedraggable';
|
|
30
|
+
import i18n from "../../../utils/i18n"
|
|
31
|
+
import {deepClone, generateId} from "../../../utils/util"
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: "dropdownFlag-editor",
|
|
35
|
+
mixins: [i18n],
|
|
36
|
+
components: {
|
|
37
|
+
Draggable,
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
designer: Object,
|
|
41
|
+
selectedWidget: Object,
|
|
42
|
+
optionModel: Object,
|
|
43
|
+
},
|
|
44
|
+
inject: ['openWidgetPropertyDialog'],
|
|
45
|
+
methods: {
|
|
46
|
+
deleteCol(gridWidget, colIdx) {
|
|
47
|
+
if (!!gridWidget && !!gridWidget.widgetList) {
|
|
48
|
+
gridWidget.widgetList.splice(colIdx, 1);
|
|
49
|
+
}
|
|
50
|
+
this.designer.emitHistoryChange()
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
addNewCol(gridWidget) {
|
|
54
|
+
let newGridCol = deepClone(this.designer.getFieldWidgetByType('dropdown-item'));
|
|
55
|
+
let tmpId = generateId();
|
|
56
|
+
newGridCol.id = 'dropdown-item-' + tmpId;
|
|
57
|
+
newGridCol.options.name = 'dropdownItem' + tmpId;
|
|
58
|
+
newGridCol.options.label = 'dropdownItem' + tmpId;
|
|
59
|
+
gridWidget.widgetList.push(newGridCol);
|
|
60
|
+
this.designer.emitHistoryChange()
|
|
61
|
+
},
|
|
62
|
+
openEditFormatConfigDialog(fieldWidget, index) {
|
|
63
|
+
this.openWidgetPropertyDialog({
|
|
64
|
+
columnSelectedWidget: deepClone(fieldWidget),
|
|
65
|
+
callback: (columnOption) => {
|
|
66
|
+
fieldWidget.options = columnOption;
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style lang="scss" scoped>
|
|
75
|
+
li.col-item {
|
|
76
|
+
list-style: none;
|
|
77
|
+
|
|
78
|
+
span.col-span-title {
|
|
79
|
+
display: inline-block;
|
|
80
|
+
font-size: 13px;
|
|
81
|
+
width: 120px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.col-delete-button {
|
|
85
|
+
margin-left: 6px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
</style>
|
|
@@ -115,8 +115,8 @@ const COMMON_PROPERTIES = {
|
|
|
115
115
|
'showRuleFlag': 'showRuleFlag-editor',
|
|
116
116
|
'widgetShowRuleFlag': 'widgetShowRuleFlag-editor',
|
|
117
117
|
|
|
118
|
-
'
|
|
119
|
-
'dropdownItemFlag': 'dropdown-item-editor',
|
|
118
|
+
'dropdownFlag': 'dropdownFlag-editor',
|
|
119
|
+
// 'dropdownItemFlag': 'dropdown-item-editor',
|
|
120
120
|
|
|
121
121
|
'oplogFlag': 'oplogFlag-editor',
|
|
122
122
|
'ganttConfig': 'gantt-editor',
|
|
@@ -901,8 +901,9 @@ export const hiddenWidgetTypesOfWf = [
|
|
|
901
901
|
"import-button",
|
|
902
902
|
"import2-button",
|
|
903
903
|
"print-button",
|
|
904
|
+
"dropdown-item",
|
|
904
905
|
];
|
|
905
|
-
export const freeWidgetTypesOfWf = ["reset_button","copy_button", "a-link", "a-text"];
|
|
906
|
+
export const freeWidgetTypesOfWf = ["reset_button","copy_button", "a-link", "a-text", 'dropdown'];
|
|
906
907
|
|
|
907
908
|
export const basicFields = [
|
|
908
909
|
{
|
|
@@ -3378,9 +3379,9 @@ export const advancedFields = [
|
|
|
3378
3379
|
},
|
|
3379
3380
|
},
|
|
3380
3381
|
{
|
|
3381
|
-
type: "dropdown
|
|
3382
|
+
type: "dropdown",
|
|
3382
3383
|
icon: "tab",
|
|
3383
|
-
|
|
3384
|
+
commonFlag: !0,
|
|
3384
3385
|
// columnFlag: true,
|
|
3385
3386
|
widgetList: [],
|
|
3386
3387
|
options: {
|
|
@@ -3388,12 +3389,9 @@ export const advancedFields = [
|
|
|
3388
3389
|
label: "",
|
|
3389
3390
|
hidden: !1,
|
|
3390
3391
|
disabled: !1,
|
|
3391
|
-
height: "",
|
|
3392
|
-
// isFullscreen: false,
|
|
3393
|
-
tabClass: "tab-boxCard tabCard-sty1",
|
|
3394
3392
|
customClass: "",
|
|
3395
|
-
|
|
3396
|
-
...defaultWfConfig,
|
|
3393
|
+
dropdownFlag: 1,
|
|
3394
|
+
// ...defaultWfConfig,
|
|
3397
3395
|
onCreated: "",
|
|
3398
3396
|
onMounted: "",
|
|
3399
3397
|
},
|
|
@@ -3406,12 +3404,14 @@ export const advancedFields = [
|
|
|
3406
3404
|
name: "",
|
|
3407
3405
|
label: "",
|
|
3408
3406
|
hidden: !1,
|
|
3409
|
-
active: !1,
|
|
3410
3407
|
disabled: !1,
|
|
3411
3408
|
customClass: "",
|
|
3412
3409
|
dropdownItemFlag: 1,
|
|
3413
3410
|
|
|
3414
3411
|
onClick: "",
|
|
3412
|
+
onCreated: "",
|
|
3413
|
+
onMounted: "",
|
|
3414
|
+
|
|
3415
3415
|
clickBindEvent: null,
|
|
3416
3416
|
onBeforeClickButton: null,
|
|
3417
3417
|
searchDialogConfig: {
|
|
@@ -3421,6 +3421,9 @@ export const advancedFields = [
|
|
|
3421
3421
|
tableRef: null,
|
|
3422
3422
|
tableData: {},
|
|
3423
3423
|
},
|
|
3424
|
+
|
|
3425
|
+
...defaultWfConfig,
|
|
3426
|
+
...defaultWidgetShowRuleConfig,
|
|
3424
3427
|
},
|
|
3425
3428
|
},
|
|
3426
3429
|
{
|
|
@@ -3484,7 +3487,7 @@ export const advancedFields = [
|
|
|
3484
3487
|
},
|
|
3485
3488
|
},
|
|
3486
3489
|
|
|
3487
|
-
{
|
|
3490
|
+
/* {
|
|
3488
3491
|
type: "vue-page",
|
|
3489
3492
|
icon: "html-text",
|
|
3490
3493
|
commonFlag: !0,
|
|
@@ -3502,7 +3505,7 @@ export const advancedFields = [
|
|
|
3502
3505
|
labelHidden: !1,
|
|
3503
3506
|
|
|
3504
3507
|
},
|
|
3505
|
-
},
|
|
3508
|
+
}, */
|
|
3506
3509
|
];
|
|
3507
3510
|
|
|
3508
3511
|
export const businessFields = [
|