cloud-web-corejs 1.0.76 → 1.0.77
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/VabUpload/view.vue +2 -2
- package/src/components/advancedSearchDialog/mixins.js +1 -1
- package/src/components/fileLibrary/filterDialog.vue +383 -0
- package/src/components/fileLibrary/index.vue +22 -23
- package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
- package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +7 -7
- package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +4 -4
- package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +4 -4
- package/src/components/fileLibrary/mixins/indexMixins.js +45 -9
- package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +61 -2
- package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +1 -1
- package/src/components/fileLibrary/propertiesDialog.vue +18 -0
- package/src/components/fileLibrary/shareDialog.vue +1 -1
- package/src/components/table/index.js +1 -1
- package/src/components/table/tableForm.vue +99 -63
- package/src/components/table/tableFormMixin.js +1 -1
- package/src/components/wf/wf.js +1 -1
- package/src/components/wf/wfStartDialog.vue +1 -1
- package/src/components/wf/wfUtil.js +1 -1
- package/src/components/xform/form-designer/designer.js +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +10 -5
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +16 -16
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +54 -14
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +9 -4
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +8 -2
- package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -0
- package/src/components/xform/form-designer/indexMixin.js +1 -1
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +12 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1051 -1051
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +42 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +107 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +22 -18
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
- package/src/components/xform/form-designer/toolbar-panel/index.vue +4 -3
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +38 -6
- package/src/components/xform/form-render/container-item/data-table-item.vue +18 -19
- package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -1
- package/src/components/xform/form-render/indexMixin.js +2 -1
- package/src/components/xform/lang/zh-CN.js +1 -1
- package/src/components/xform/mixins/defaultHandle.js +1 -1
- package/src/components/xform/mixins/scriptHttp.js +1 -1
- package/src/components/xform/utils/util.js +1 -1
- package/src/layout/components/Sidebar/default.vue +1266 -1233
- package/src/layout/components/extractedCode/createDialog.vue +92 -0
- package/src/layout/components/extractedCode/queryDialog.vue +96 -0
- package/src/layout/components/extractedCode/viewDialog.vue +192 -0
- package/src/store/config/index.js +1 -1
- package/src/utils/index.js +4 -2
- package/src/utils/pddLog.js +103 -0
- package/src/utils/vab.js +19 -27
- package/src/views/bd/setting/bd_attach_setting/edit.vue +1 -1
- package/src/views/bd/setting/bd_attach_setting/mixins/edit.js +1 -1
- package/src/views/bd/setting/form_import_log/edit.vue +127 -0
- package/src/views/bd/setting/form_import_log/list.vue +205 -0
- package/src/views/bd/setting/form_script/edit1.vue +1 -1
- package/src/views/bd/setting/form_script/mixins/edit.js +3 -1
- package/src/views/bd/setting/form_script/mixins/edit1.js +1 -1
- package/src/views/bd/setting/form_script/mixins/list.js +1 -1
- package/src/views/bd/setting/form_script/mixins/list1.js +14 -14
- package/src/views/bd/setting/form_template/edit.vue +9 -1
- package/src/views/bd/setting/form_template/mixins/edit.js +1 -1
- package/src/views/bd/setting/form_template/mixins/list.js +25 -22
- package/src/views/bd/setting/menu_kind/authDialog.vue +1 -1
- package/src/views/bd/setting/menu_kind/mixins/authDialog.js +7 -7
- package/src/views/bd/setting/menu_kind/mixins/list.js +1 -1
- package/src/views/bd/setting/table_model/edit.vue +70 -12
- package/src/views/bd/setting/table_model/mixins/edit copy.js +903 -0
- package/src/views/bd/setting/table_model/mixins/edit.js +12 -13
- package/src/views/bd/setting/table_model/mixins/list.js +1 -1
- package/src/views/user/access_log/list.vue +349 -349
- package/src/views/user/company_info/dialog.vue +164 -164
- package/src/views/user/form/vform/designer.vue +5 -1
- package/src/views/user/home/default.vue +15 -11
- package/src/views/user/login/index2.vue +131 -0
- package/src/views/user/notify_message/dialog.vue +1 -1
- package/src/views/user/notify_template/edit.vue +188 -187
- package/src/views/user/notify_template/edit2.vue +176 -0
- package/src/views/user/notify_template/list.vue +4 -1
- package/src/views/user/notify_template/list2.vue +190 -0
- package/src/views/user/position/list.vue +2 -2
- package/src/views/user/role/dialog.vue +1 -1
- package/src/views/user/role/list.vue +2 -2
- package/src/views/user/sale_org/dialog.vue +1 -1
- package/src/views/user/user/dialog.vue +1 -1
@@ -1,1051 +1,1051 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<el-form-item :label="i18nt('designer.setting.tableWidth')">
|
4
|
-
<el-input v-model="optionModel.tableWidth"></el-input>
|
5
|
-
</el-form-item>
|
6
|
-
<el-form-item :label="i18nt('designer.setting.tableHeight')">
|
7
|
-
<el-input v-model="optionModel.tableHeight"></el-input>
|
8
|
-
</el-form-item>
|
9
|
-
<!-- <el-form-item :label="i18nt('designer.setting.customClass')">
|
10
|
-
<el-select v-model="optionModel.customClass" multiple="" filterable="" allow-create="" default-first-option="">
|
11
|
-
<el-option v-for="(e, t) in cssClassList" :key="t" :value="e" :label="e"></el-option>
|
12
|
-
</el-select>
|
13
|
-
</el-form-item>-->
|
14
|
-
<!-- <el-form-item :label="i18nt('designer.setting.showIndex')"><el-switch v-model="optionModel.showIndex"></el-switch></el-form-item>
|
15
|
-
<el-form-item :label="i18nt('designer.setting.showCheckBox')"><el-switch v-model="optionModel.showCheckBox"></el-switch></el-form-item> -->
|
16
|
-
<el-form-item label="启用数据行合并">
|
17
|
-
<el-switch v-model="optionModel.mergeRowEnabled"></el-switch>
|
18
|
-
</el-form-item>
|
19
|
-
<el-form-item :label="i18nt('合并行唯一字段')">
|
20
|
-
<el-input v-model="optionModel.mergeRowKey"></el-input>
|
21
|
-
</el-form-item>
|
22
|
-
<el-form-item label="查询列表">
|
23
|
-
<el-switch v-model="optionModel.isQueryTable"></el-switch>
|
24
|
-
</el-form-item>
|
25
|
-
<el-form-item :label="i18nt('designer.setting.showPagination')">
|
26
|
-
<el-switch v-model="optionModel.showPagination"></el-switch>
|
27
|
-
</el-form-item>
|
28
|
-
<el-form-item :label="i18nt('
|
29
|
-
<el-switch v-model="optionModel.showGridFooter"></el-switch>
|
30
|
-
</el-form-item>
|
31
|
-
<!-- <el-form-item :label="i18nt('显示导出')">
|
32
|
-
<el-switch v-model="optionModel.showExportBtn"></el-switch>
|
33
|
-
</el-form-item>-->
|
34
|
-
<!-- <el-form-item :label="i18nt('显示搜索栏')">
|
35
|
-
<el-switch v-model="optionModel.showSearchArea"></el-switch>
|
36
|
-
</el-form-item>-->
|
37
|
-
<!-- <el-form-item :label="i18nt('designer.setting.smallPagination')"><el-switch v-model="optionModel.smallPagination"></el-switch></el-form-item>
|
38
|
-
<el-form-item :label="i18nt('designer.setting.showSummary')"><el-switch v-model="optionModel.showSummary"></el-switch></el-form-item>
|
39
|
-
<el-form-item :label="i18nt('designer.setting.stripe')"><el-switch v-model="optionModel.stripe"></el-switch></el-form-item>
|
40
|
-
<el-form-item :label="i18nt('designer.setting.rowSpacing')">
|
41
|
-
<el-input-number style="width:100%;" controls-position="right" :min="0" :max="20" v-model="optionModel.rowSpacing"></el-input-number>
|
42
|
-
</el-form-item>
|
43
|
-
<el-form-item :label="i18nt('designer.setting.widgetSize')">
|
44
|
-
<el-select v-model="optionModel.tableSize" @change="refreshTableLayout">
|
45
|
-
<el-option v-for="e in widgetSizes" :key="e.value" :value="e.value" :label="e.label"></el-option>
|
46
|
-
</el-select>
|
47
|
-
</el-form-item> -->
|
48
|
-
<el-form-item :label="i18nt('designer.setting.tableColEdit')">
|
49
|
-
<el-button type="primary" plain="" round="" @click="openSetting">{{
|
50
|
-
i18nt('designer.setting.editAction')
|
51
|
-
}}
|
52
|
-
</el-button>
|
53
|
-
</el-form-item>
|
54
|
-
<el-form-item label="自定义表格配置" label-width="150px">
|
55
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
56
|
-
@click="editEventHandler('tableConfig', tableConfigParams)">
|
57
|
-
<span>{{ optionModel.tableConfig }}</span>
|
58
|
-
<i class="el-icon-edit"></i>
|
59
|
-
</a>
|
60
|
-
</el-form-item>
|
61
|
-
<el-form-item label-width="0">
|
62
|
-
<el-divider class="custom-divider-margin-top">编辑表格设置</el-divider>
|
63
|
-
</el-form-item>
|
64
|
-
<el-form-item :label="i18nt('编辑表格')">
|
65
|
-
<el-switch v-model="optionModel.isEditTable"></el-switch>
|
66
|
-
</el-form-item>
|
67
|
-
<el-form-item :label="i18nt('树表格')">
|
68
|
-
<el-switch v-model="optionModel.isTreeTable"></el-switch>
|
69
|
-
</el-form-item>
|
70
|
-
<el-form-item :label="i18nt('启用WBS码')">
|
71
|
-
<el-switch v-model="optionModel.wbsEnabled"></el-switch>
|
72
|
-
</el-form-item>
|
73
|
-
<el-form-item :label="i18nt('排序脚本编码')" v-if="optionModel.isEditTable">
|
74
|
-
<el-input v-model="optionModel.sortScriptCode"></el-input>
|
75
|
-
</el-form-item>
|
76
|
-
<!-- <el-form-item :label="i18nt('上级关联字段')">
|
77
|
-
<el-input v-model="optionModel.parentField"></el-input>
|
78
|
-
</el-form-item>
|
79
|
-
<el-form-item label="编辑表格默认数据" label-width="150px">
|
80
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
81
|
-
@click="editEventHandler('editDefaultRow', tableConfigParams)">
|
82
|
-
<span>{{ optionModel.editDefaultRow }}</span>
|
83
|
-
<i class="el-icon-edit"></i>
|
84
|
-
</a>
|
85
|
-
</el-form-item>-->
|
86
|
-
<!-- <el-form-item :label="i18nt('designer.setting.tableDataEdit')">
|
87
|
-
<el-button type="primary" plain="" round="" @click="openTableDataEdit">{{
|
88
|
-
i18nt('designer.setting.editAction')
|
89
|
-
}}
|
90
|
-
</el-button>
|
91
|
-
</el-form-item>-->
|
92
|
-
<!-- <el-form-item :label="i18nt('designer.setting.dsEnabled')">
|
93
|
-
<el-switch v-model="optionModel.dsEnabled"></el-switch>
|
94
|
-
</el-form-item>-->
|
95
|
-
<!-- <el-form-item v-if="optionModel.dsEnabled" :label="i18nt('designer.setting.dsName')">
|
96
|
-
<el-select v-model="optionModel.dsName" filterable="" clearable="">
|
97
|
-
<el-option v-for="(e, t) in dataSourceList" :key="t" :value="e.uniqueName" :label="e.uniqueName" :title="e.description"></el-option>
|
98
|
-
</el-select>
|
99
|
-
</el-form-item> -->
|
100
|
-
<!-- <el-form-item v-if="!optionModel.dsEnabled" :label="i18nt('designer.setting.showButtonsColumn')">
|
101
|
-
<el-switch v-model="optionModel.showButtonsColumn" @change="handleShowButtonsColumnChange"></el-switch>
|
102
|
-
</el-form-item> -->
|
103
|
-
<!-- <el-form-item v-if="optionModel.dsEnabled" :label="i18nt('请求访问')">
|
104
|
-
<!– <el-button type="primary" plain="" round="" @click="openSqlEditDialog">{{ i18nt('designer.setting.editAction') }}</el-button> –>
|
105
|
-
<el-input
|
106
|
-
class="search-input"
|
107
|
-
max="200"
|
108
|
-
v-model="optionModel.accessName"
|
109
|
-
@clear="
|
110
|
-
optionModel.accessCode = '';
|
111
|
-
$forceUpdate();
|
112
|
-
"
|
113
|
-
v-el-readonly
|
114
|
-
clearable
|
115
|
-
>
|
116
|
-
<i slot="suffix" class="el-input__icon el-icon-search" @click="showRequestaccessDialog=true"></i>
|
117
|
-
</el-input>
|
118
|
-
</el-form-item>-->
|
119
|
-
<!-- <el-form-item v-if="optionModel.showButtonsColumn" :label="i18nt('designer.setting.buttonsColumnEdit')">
|
120
|
-
<el-button type="primary" plain="" round="" @click="editButtonsColumn">{{ i18nt('designer.setting.editAction') }}</el-button>
|
121
|
-
</el-form-item> -->
|
122
|
-
<el-dialog
|
123
|
-
v-if="dataDialogVisible"
|
124
|
-
custom-class="dialog-style list-dialog"
|
125
|
-
:title="i18nt('designer.setting.tableDataEdit')"
|
126
|
-
:visible.sync="dataDialogVisible"
|
127
|
-
:show-close="!0"
|
128
|
-
append-to-body=""
|
129
|
-
:close-on-click-modal="!1"
|
130
|
-
:close-on-press-escape="!1"
|
131
|
-
:destroy-on-close="!0"
|
132
|
-
width="75%"
|
133
|
-
v-dialog-drag
|
134
|
-
>
|
135
|
-
<template slot="footer">
|
136
|
-
<div class="dialog-footer">
|
137
|
-
<el-button type="" @click="dataDialogVisible = !1" class="button-sty" icon="el-icon-close">
|
138
|
-
{{ i18nt('designer.hint.cancel') }}
|
139
|
-
</el-button>
|
140
|
-
<el-button type="primary" @click="saveTableData" class="button-sty" icon="el-icon-check">
|
141
|
-
{{ i18nt('designer.hint.confirm') }}
|
142
|
-
</el-button>
|
143
|
-
</div>
|
144
|
-
</template>
|
145
|
-
<code-editor mode="json" :readonly="!1" v-model="tableDataOptions"></code-editor>
|
146
|
-
</el-dialog>
|
147
|
-
<!-- <el-dialog
|
148
|
-
v-if="dialogVisible"
|
149
|
-
custom-class="dialog-style list-dialog"
|
150
|
-
:title="i18nt('designer.setting.tableColEdit')"
|
151
|
-
:visible.sync="dialogVisible"
|
152
|
-
:show-close="!0"
|
153
|
-
:append-to-body="false"
|
154
|
-
:modal="false"
|
155
|
-
:close-on-click-modal="!1"
|
156
|
-
:close-on-press-escape="!1"
|
157
|
-
:destroy-on-close="!0"
|
158
|
-
width="1220px"
|
159
|
-
v-dialog-drag
|
160
|
-
>
|
161
|
-
<div class="cont">
|
162
|
-
<template slot="footer">
|
163
|
-
<div class="dialog-footer">
|
164
|
-
<el-button type="" @click="dialogVisible = !1" class="button-sty" icon="el-icon-close">
|
165
|
-
{{ i18nt('designer.hint.cancel') }}
|
166
|
-
</el-button>
|
167
|
-
<el-button type="primary" @click="colSubmit" class="button-sty" icon="el-icon-check">
|
168
|
-
{{ i18nt('designer.hint.confirm') }}
|
169
|
-
</el-button>
|
170
|
-
|
171
|
-
</div>
|
172
|
-
</template>
|
173
|
-
<el-table
|
174
|
-
ref="singleTable"
|
175
|
-
width="100%"
|
176
|
-
:data="optionModel.tableColumns"
|
177
|
-
|
178
|
-
height="500"
|
179
|
-
border=""
|
180
|
-
row-key="columnId"
|
181
|
-
stripe=""
|
182
|
-
>
|
183
|
-
<el-table-column type="index" width="35" fixed="left"></el-table-column>
|
184
|
-
<el-table-column label="" width="35"><i class="el-icon-s-operation drag-option"></i></el-table-column>
|
185
|
-
<el-table-column :label="i18nt('designer.setting.columnLabel')" width="150" prop="label">
|
186
|
-
<template slot-scope="scope">
|
187
|
-
<el-input v-model="scope.row.label"></el-input>
|
188
|
-
</template>
|
189
|
-
</el-table-column>
|
190
|
-
<el-table-column :label="i18nt('designer.setting.columnName')" width="150" prop="prop">
|
191
|
-
<template slot-scope="scope">
|
192
|
-
<el-input v-model="scope.row.prop"></el-input>
|
193
|
-
</template>
|
194
|
-
</el-table-column>
|
195
|
-
<el-table-column :label="i18nt('designer.setting.columnWidth')" width="100" prop="width">
|
196
|
-
<template slot-scope="scope">
|
197
|
-
<el-input v-model="scope.row.width"></el-input>
|
198
|
-
</template>
|
199
|
-
</el-table-column>
|
200
|
-
<el-table-column :label="i18nt('designer.setting.visibleColumn')" width="70" prop="show">
|
201
|
-
<template slot-scope="scope">
|
202
|
-
<el-switch v-model="scope.row.show"></el-switch>
|
203
|
-
</template>
|
204
|
-
</el-table-column>
|
205
|
-
<el-table-column :label="i18nt('必填')" width="70" prop="required">
|
206
|
-
<template slot-scope="scope">
|
207
|
-
<el-switch v-model="scope.row.required"></el-switch>
|
208
|
-
</template>
|
209
|
-
</el-table-column>
|
210
|
-
<el-table-column :label="i18nt('designer.setting.sortableColumn')" width="70" prop="sortable">
|
211
|
-
<template slot-scope="scope">
|
212
|
-
<el-switch v-model="scope.row.sortable"></el-switch>
|
213
|
-
</template>
|
214
|
-
</el-table-column>
|
215
|
-
<el-table-column :label="i18nt('designer.setting.fixedColumn')" width="100" prop="fixed">
|
216
|
-
<template slot-scope="scope">
|
217
|
-
<el-select v-model="scope.row.fixed" clearable>
|
218
|
-
<el-option value="left">left</el-option>
|
219
|
-
<el-option value="right">right</el-option>
|
220
|
-
</el-select>
|
221
|
-
</template>
|
222
|
-
</el-table-column>
|
223
|
-
<!– <el-table-column :label="i18nt('designer.setting.alignTypeOfColumn')" width="100" prop="align">
|
224
|
-
<template slot-scope="scope">
|
225
|
-
<el-select v-model="scope.row.align">
|
226
|
-
<el-option v-for="(e,index) in alignOptions" :key="index" :value="e.value" :label="e.label"></el-option>
|
227
|
-
</el-select>
|
228
|
-
</template>
|
229
|
-
</el-table-column>–>
|
230
|
-
<el-table-column :label="i18nt('designer.setting.formatOfColumn')" width="200" prop="formatS">
|
231
|
-
<template slot-scope="scope">
|
232
|
-
<el-select v-model="scope.row.formatS" @change="changeFormatS(scope.row)" clearable>
|
233
|
-
<el-option-group :label="i18nt('designer.setting.customRenderGroup')">
|
234
|
-
<el-option value="render" label="render"></el-option>
|
235
|
-
</el-option-group>
|
236
|
-
<el-option-group v-for="t in op" :key="t.label" :label="t.label">
|
237
|
-
<el-option v-for="e in t.options" :key="e.value" :value="e.value" :label="e.label"></el-option>
|
238
|
-
</el-option-group>
|
239
|
-
</el-select>
|
240
|
-
</template>
|
241
|
-
</el-table-column>
|
242
|
-
<el-table-column label="格式化配置" width="70" fixed="right" align="center">
|
243
|
-
<template slot-scope="scope">
|
244
|
-
<el-button size="mini" plain="" round="" icon="el-icon-edit"
|
245
|
-
@click="openFormatConfigDialog(scope.row,scope.$index)"
|
246
|
-
:disabled="!columnFormatMap[scope.row.formatS]"></el-button>
|
247
|
-
</template>
|
248
|
-
</el-table-column>
|
249
|
-
<el-table-column :label="i18nt('designer.setting.renderFunction')" width="70" fixed="right" align="center">
|
250
|
-
<template slot-scope="scope">
|
251
|
-
<el-button :disabled="'render' !== scope.row.formatS" size="mini" plain="" round="" icon="el-icon-edit"
|
252
|
-
@click="showRenderDialog(scope.row)"></el-button>
|
253
|
-
</template>
|
254
|
-
</el-table-column>
|
255
|
-
<el-table-column :label="i18nt('designer.setting.actionColumn')" width="100" fixed="right" align="center">
|
256
|
-
<template #header>
|
257
|
-
<span>{{ i18nt('designer.setting.actionColumn') }}</span>
|
258
|
-
<!– <el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
|
259
|
-
icon="el-icon-plus" @click="openFieldTreeDialog"></el-button>–>
|
260
|
-
</template>
|
261
|
-
<template slot-scope="scope">
|
262
|
-
<el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
|
263
|
-
icon="el-icon-plus" @click="addCol"></el-button>
|
264
|
-
<el-button
|
265
|
-
:title="i18nt('designer.setting.deleteTableColumn')"
|
266
|
-
size="mini"
|
267
|
-
type=""
|
268
|
-
circle=""
|
269
|
-
icon="el-icon-minus"
|
270
|
-
@click="handleDelete(scope.$index, scope.row)"
|
271
|
-
></el-button>
|
272
|
-
</template>
|
273
|
-
</el-table-column>
|
274
|
-
|
275
|
-
</el-table>
|
276
|
-
</div>
|
277
|
-
|
278
|
-
</el-dialog>-->
|
279
|
-
<!-- <el-dialog
|
280
|
-
v-if="showRenderDialogFlag"
|
281
|
-
:title="i18nt('designer.setting.renderFunction')"
|
282
|
-
:visible.sync="showRenderDialogFlag"
|
283
|
-
append-to-body=""
|
284
|
-
:show-close="!0"
|
285
|
-
custom-class="dialog-style list-dialog"
|
286
|
-
:close-on-click-modal="!1"
|
287
|
-
:close-on-press-escape="!1"
|
288
|
-
:destroy-on-close="!0"
|
289
|
-
v-dialog-drag
|
290
|
-
>
|
291
|
-
<el-alert type="info" :closable="!1" title="function customRender(params,h) {"/>
|
292
|
-
<code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="renderJson"></code-editor>
|
293
|
-
<el-alert type="info" :closable="!1" title="}"/>
|
294
|
-
<div class="dialog-footer" slot="footer">
|
295
|
-
<el-button @click="showRenderDialogFlag = !1" class="button-sty" icon="el-icon-close">
|
296
|
-
{{ i18nt('designer.hint.cancel') }}
|
297
|
-
</el-button>
|
298
|
-
<el-button type="primary" @click="saveColumnRender" class="button-sty" icon="el-icon-check">
|
299
|
-
{{ i18nt('designer.hint.confirm') }}
|
300
|
-
</el-button>
|
301
|
-
</div>
|
302
|
-
</el-dialog>-->
|
303
|
-
<el-dialog
|
304
|
-
v-if="showSqlEditDialog"
|
305
|
-
:title="i18nt('数据源SQL编辑')"
|
306
|
-
:visible.sync="showSqlEditDialog"
|
307
|
-
append-to-body=""
|
308
|
-
:show-close="!0"
|
309
|
-
custom-class="dialog-style list-dialog"
|
310
|
-
:close-on-click-modal="!1"
|
311
|
-
:close-on-press-escape="!1"
|
312
|
-
:destroy-on-close="!0"
|
313
|
-
v-dialog-drag
|
314
|
-
>
|
315
|
-
<el-alert type="info" :closable="!1"/>
|
316
|
-
<code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="dataSourceSql"></code-editor>
|
317
|
-
<el-alert type="info" :closable="!1"/>
|
318
|
-
<div class="dialog-footer" slot="footer">
|
319
|
-
<el-button @click="showSqlEditDialog = !1" class="button-sty" icon="el-icon-close">
|
320
|
-
{{ i18nt('designer.hint.cancel') }}
|
321
|
-
</el-button>
|
322
|
-
<el-button type="primary" @click="saveDataSourceSql" class="button-sty" icon="el-icon-check">
|
323
|
-
{{ i18nt('designer.hint.confirm') }}
|
324
|
-
</el-button>
|
325
|
-
</div>
|
326
|
-
</el-dialog>
|
327
|
-
<requestaccessDialog v-if="showRequestaccessDialog" :visiable.sync="showRequestaccessDialog"
|
328
|
-
@confirm="confirmInsertRequestaccess" multi="false"
|
329
|
-
:param="{reportCode:reportTemplate.reportCode}"/>
|
330
|
-
|
331
|
-
<el-dialog
|
332
|
-
v-if="showFieldTreeDialog"
|
333
|
-
custom-class="dialog-style list-dialog"
|
334
|
-
title="新增列表列"
|
335
|
-
:visible.sync="showFieldTreeDialog"
|
336
|
-
:show-close="!0"
|
337
|
-
:append-to-body="false"
|
338
|
-
:modal="false"
|
339
|
-
:close-on-click-modal="!1"
|
340
|
-
:close-on-press-escape="!1"
|
341
|
-
:destroy-on-close="!0"
|
342
|
-
width="500px"
|
343
|
-
v-dialog-drag
|
344
|
-
>
|
345
|
-
<div class="cont" style="height: 500px;">
|
346
|
-
<el-tree
|
347
|
-
ref="tree"
|
348
|
-
:data="treeData"
|
349
|
-
show-checkbox
|
350
|
-
node-key="name"
|
351
|
-
:default-expand-all="true"
|
352
|
-
:check-on-click-node="true"
|
353
|
-
:expand-on-click-node="false"
|
354
|
-
:default-checked-keys="defaultCheckedKeys"
|
355
|
-
:props="defaultProps">
|
356
|
-
</el-tree>
|
357
|
-
</div>
|
358
|
-
<span slot="footer" class="dialog-footer">
|
359
|
-
<el-button type="primary" plain class="button-sty" @click="showFieldTreeDialog=false">
|
360
|
-
<i class="el-icon-close el-icon"></i>
|
361
|
-
取 消
|
362
|
-
</el-button>
|
363
|
-
<el-button type="primary" @click="confirmFieldTreeDialog" class="button-sty">
|
364
|
-
<i class="el-icon-check el-icon"></i>
|
365
|
-
确 定
|
366
|
-
</el-button>
|
367
|
-
</span>
|
368
|
-
</el-dialog>
|
369
|
-
<!-- <el-dialog
|
370
|
-
v-if="showDateConfigDialog"
|
371
|
-
:title="i18nt('日期配置编辑')"
|
372
|
-
:visible.sync="showDateConfigDialog"
|
373
|
-
append-to-body=""
|
374
|
-
:show-close="!0"
|
375
|
-
custom-class="dialog-style list-dialog"
|
376
|
-
:close-on-click-modal="!1"
|
377
|
-
:close-on-press-escape="!1"
|
378
|
-
:destroy-on-close="!0"
|
379
|
-
v-dialog-drag
|
380
|
-
>
|
381
|
-
<div class="cont">
|
382
|
-
<el-form>
|
383
|
-
<template v-for="(editorName, index) in dateFieldList">
|
384
|
-
<component
|
385
|
-
:is="editorName"
|
386
|
-
:designer="designer"
|
387
|
-
:selected-widget="selectedWidget"
|
388
|
-
:option-model="columnOption"
|
389
|
-
:key="index"
|
390
|
-
></component>
|
391
|
-
</template>
|
392
|
-
</el-form>
|
393
|
-
</div>
|
394
|
-
<div class="dialog-footer" slot="footer">
|
395
|
-
<el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
|
396
|
-
{{ i18nt('designer.hint.cancel') }}
|
397
|
-
</el-button>
|
398
|
-
<el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
|
399
|
-
{{ i18nt('designer.hint.confirm') }}
|
400
|
-
</el-button>
|
401
|
-
</div>
|
402
|
-
</el-dialog>-->
|
403
|
-
<!-- <el-dialog
|
404
|
-
v-if="showDateConfigDialog"
|
405
|
-
:title="i18nt('日期配置编辑')"
|
406
|
-
:visible.sync="showDateConfigDialog"
|
407
|
-
append-to-body=""
|
408
|
-
:show-close="!0"
|
409
|
-
custom-class="dialog-style list-dialog"
|
410
|
-
:close-on-click-modal="!1"
|
411
|
-
:close-on-press-escape="!1"
|
412
|
-
:destroy-on-close="!0"
|
413
|
-
v-dialog-drag
|
414
|
-
>
|
415
|
-
<div class="cont">
|
416
|
-
<el-scrollbar class="setting-scrollbar">
|
417
|
-
<el-form :model="columnOption" size="mini" label-position="left" label-width="120px" class="setting-form"
|
418
|
-
@submit.native.prevent>
|
419
|
-
<el-collapse v-model="widgetActiveCollapseNames" class="setting-collapse">
|
420
|
-
<el-collapse-item name="1" v-if="showCollapse(commonProps)"
|
421
|
-
:title="i18nt('designer.setting.commonSetting')">
|
422
|
-
<template v-for="(editorName, propName) in commonProps">
|
423
|
-
<component
|
424
|
-
v-if="hasPropEditor(propName, editorName)"
|
425
|
-
:is="getPropEditor(propName, editorName)"
|
426
|
-
:designer="designer"
|
427
|
-
:selected-widget="columnSelectedWidget"
|
428
|
-
:option-model="columnOption"
|
429
|
-
:key="propName"
|
430
|
-
></component>
|
431
|
-
</template>
|
432
|
-
</el-collapse-item>
|
433
|
-
|
434
|
-
<el-collapse-item name="2" v-if="showCollapse(advProps)"
|
435
|
-
:title="i18nt('designer.setting.advancedSetting')">
|
436
|
-
<template v-for="(editorName, propName) in advProps">
|
437
|
-
<component
|
438
|
-
v-if="hasPropEditor(propName, editorName)"
|
439
|
-
:is="getPropEditor(propName, editorName)"
|
440
|
-
:designer="designer"
|
441
|
-
:selected-widget="selectedWidget"
|
442
|
-
:option-model="columnOption"
|
443
|
-
:key="propName"
|
444
|
-
></component>
|
445
|
-
</template>
|
446
|
-
</el-collapse-item>
|
447
|
-
|
448
|
-
<el-collapse-item name="3" v-if="showEventCollapse() && showCollapse(eventProps)"
|
449
|
-
:title="i18nt('designer.setting.eventSetting')">
|
450
|
-
<template v-for="(editorName, propName) in eventProps">
|
451
|
-
<component
|
452
|
-
v-if="hasPropEditor(propName, editorName)"
|
453
|
-
:is="getPropEditor(propName, editorName)"
|
454
|
-
:designer="designer"
|
455
|
-
:selected-widget="selectedWidget"
|
456
|
-
:option-model="columnOption"
|
457
|
-
:key="propName"
|
458
|
-
></component>
|
459
|
-
</template>
|
460
|
-
</el-collapse-item>
|
461
|
-
</el-collapse>
|
462
|
-
</el-form>
|
463
|
-
</el-scrollbar>
|
464
|
-
</div>
|
465
|
-
<div class="dialog-footer" slot="footer">
|
466
|
-
<el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
|
467
|
-
{{ i18nt('designer.hint.cancel') }}
|
468
|
-
</el-button>
|
469
|
-
<el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
|
470
|
-
{{ i18nt('designer.hint.confirm') }}
|
471
|
-
</el-button>
|
472
|
-
</div>
|
473
|
-
</el-dialog>-->
|
474
|
-
<tableColumnDialog v-if="dialogVisible" :visiable.sync="dialogVisible" :designer="designer"
|
475
|
-
:selectedWidget="selectedWidget"
|
476
|
-
:optionModel="optionModel"/>
|
477
|
-
|
478
|
-
|
479
|
-
</div>
|
480
|
-
</template>
|
481
|
-
|
482
|
-
<script>
|
483
|
-
import i18n from '../../../../../../components/xform/utils/i18n';
|
484
|
-
// import Draggable from 'vuedraggable';
|
485
|
-
import {deepClone, generateId} from '../../../../../../components/xform/utils/util';
|
486
|
-
import Sortable from 'sortablejs';
|
487
|
-
import requestaccessDialog from '../../../../../../views/user/form/report_requestaccess/dialog.vue'
|
488
|
-
import conditionEditor from './condition-editor.vue'
|
489
|
-
import tableColumnDialog from "./table-column-dialog.vue";
|
490
|
-
import eventMixin
|
491
|
-
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
492
|
-
import setttingConfig from "@/settings";
|
493
|
-
|
494
|
-
export default {
|
495
|
-
name: 'data-table-editor',
|
496
|
-
componentName: 'PropertyEditor',
|
497
|
-
mixins: [i18n, eventMixin],
|
498
|
-
components: {
|
499
|
-
requestaccessDialog,
|
500
|
-
conditionEditor,
|
501
|
-
tableColumnDialog
|
502
|
-
},
|
503
|
-
props: {
|
504
|
-
designer: Object,
|
505
|
-
selectedWidget: Object,
|
506
|
-
optionModel: Object
|
507
|
-
},
|
508
|
-
inject: ['getReportTemplate', 'showEventCollapse', 'openWidgetPropertyDialog'],
|
509
|
-
data: function () {
|
510
|
-
return {
|
511
|
-
showTableConfigDialog: false,
|
512
|
-
tableConfigCode: null,
|
513
|
-
dialogVisible: !1,
|
514
|
-
dataDialogVisible: !1,
|
515
|
-
showButtonsEditDialog: !1,
|
516
|
-
oldButtonName: '',
|
517
|
-
cssClassList: [],
|
518
|
-
tableDataOptions: [],
|
519
|
-
widgetSizes: [
|
520
|
-
{
|
521
|
-
label: 'default',
|
522
|
-
value: ''
|
523
|
-
},
|
524
|
-
{
|
525
|
-
label: 'large',
|
526
|
-
value: 'large'
|
527
|
-
},
|
528
|
-
{
|
529
|
-
label: 'medium',
|
530
|
-
value: 'medium'
|
531
|
-
},
|
532
|
-
{
|
533
|
-
label: 'small',
|
534
|
-
value: 'small'
|
535
|
-
},
|
536
|
-
{
|
537
|
-
label: 'mini',
|
538
|
-
value: 'mini'
|
539
|
-
}
|
540
|
-
],
|
541
|
-
alignOptions: [
|
542
|
-
{
|
543
|
-
value: 'left',
|
544
|
-
label: 'left'
|
545
|
-
},
|
546
|
-
{
|
547
|
-
value: 'center',
|
548
|
-
label: 'center'
|
549
|
-
},
|
550
|
-
{
|
551
|
-
value: 'right',
|
552
|
-
label: 'right'
|
553
|
-
}
|
554
|
-
],
|
555
|
-
fieldTypeOptions: [
|
556
|
-
{
|
557
|
-
value: 'text',
|
558
|
-
label: 'Text'
|
559
|
-
},
|
560
|
-
{
|
561
|
-
value: 'number',
|
562
|
-
label: 'Number'
|
563
|
-
},
|
564
|
-
{
|
565
|
-
value: 'date',
|
566
|
-
label: 'Date'
|
567
|
-
}
|
568
|
-
],
|
569
|
-
op: [
|
570
|
-
{
|
571
|
-
label: 'Date Format',
|
572
|
-
options: [
|
573
|
-
{
|
574
|
-
value: 'd1',
|
575
|
-
label: 'yyyy-MM-dd'
|
576
|
-
},
|
577
|
-
{
|
578
|
-
value: 'd2',
|
579
|
-
label: 'yyyy/MM/dd'
|
580
|
-
},
|
581
|
-
{
|
582
|
-
value: 'd3',
|
583
|
-
label: 'yyyy年MM月dd日'
|
584
|
-
},
|
585
|
-
{
|
586
|
-
value: 'd4',
|
587
|
-
label: 'yyyy-MM-dd HH:mm:ss'
|
588
|
-
},
|
589
|
-
{
|
590
|
-
value: 'd5',
|
591
|
-
label: 'yyyy-MM-dd hh:mm:ss'
|
592
|
-
}
|
593
|
-
]
|
594
|
-
},
|
595
|
-
{
|
596
|
-
label: 'Number Format',
|
597
|
-
options: [
|
598
|
-
{
|
599
|
-
value: 'n1',
|
600
|
-
label: '###,###,###,##0.######'
|
601
|
-
},
|
602
|
-
{
|
603
|
-
value: 'n2',
|
604
|
-
label: '###,###,###,##0.00####'
|
605
|
-
},
|
606
|
-
{
|
607
|
-
value: 'n3',
|
608
|
-
label: '###,###,###,##0.000000'
|
609
|
-
},
|
610
|
-
{
|
611
|
-
value: 'n4',
|
612
|
-
label: '###,###,###,##0.000'
|
613
|
-
},
|
614
|
-
{
|
615
|
-
value: 'n5',
|
616
|
-
label: '###,###,###,##0.00'
|
617
|
-
},
|
618
|
-
{
|
619
|
-
value: 'n6',
|
620
|
-
label: '###,###,###,##0'
|
621
|
-
},
|
622
|
-
{
|
623
|
-
value: 'n7',
|
624
|
-
label: '###,##0.00##%'
|
625
|
-
}
|
626
|
-
]
|
627
|
-
},
|
628
|
-
{
|
629
|
-
label: 'edit Format',
|
630
|
-
options: [
|
631
|
-
{
|
632
|
-
value: 'editInput',
|
633
|
-
label: '文本输入框'
|
634
|
-
},
|
635
|
-
{
|
636
|
-
value: 'editNumber',
|
637
|
-
label: '数字输入框'
|
638
|
-
},
|
639
|
-
{
|
640
|
-
value: 'editDate',
|
641
|
-
label: '日期输入框'
|
642
|
-
},
|
643
|
-
{
|
644
|
-
value: 'editSelect',
|
645
|
-
label: '下拉框'
|
646
|
-
},
|
647
|
-
{
|
648
|
-
value: 'editSearch',
|
649
|
-
label: '搜索框'
|
650
|
-
},
|
651
|
-
{
|
652
|
-
value: 'editDelete',
|
653
|
-
label: '删除按钮'
|
654
|
-
},
|
655
|
-
{
|
656
|
-
value: 'editButton',
|
657
|
-
label: '查看按钮'
|
658
|
-
}
|
659
|
-
]
|
660
|
-
},
|
661
|
-
],
|
662
|
-
columnFormatMap: {
|
663
|
-
editInput: 'input',
|
664
|
-
editNumber: 'number',
|
665
|
-
editDate: 'date',
|
666
|
-
editSelect: 'select',
|
667
|
-
editSearch: 'vabsearch'
|
668
|
-
},
|
669
|
-
showRenderDialogFlag: !1,
|
670
|
-
renderJson: '',
|
671
|
-
currentTableColumn: null,
|
672
|
-
nameRules: [
|
673
|
-
{
|
674
|
-
required: !0,
|
675
|
-
trigger: ['blur', 'change'],
|
676
|
-
message: this.i18nt('designer.setting.fieldValueRequired')
|
677
|
-
}
|
678
|
-
],
|
679
|
-
showSqlEditDialog: false,
|
680
|
-
dataSourceSql: "",
|
681
|
-
showRequestaccessDialog: false,
|
682
|
-
showDateConfigDialog: false,
|
683
|
-
columnOption: {},
|
684
|
-
dateFieldList: [],
|
685
|
-
columnSelectedWidget: {},
|
686
|
-
// reportTemplate:{}
|
687
|
-
|
688
|
-
showFieldTreeDialog: false,
|
689
|
-
treeData: [],
|
690
|
-
defaultProps: {
|
691
|
-
children: 'children',
|
692
|
-
label: 'label'
|
693
|
-
},
|
694
|
-
defaultCheckedKeys: [],
|
695
|
-
tableConfigParams: ["dataId", "formCode"]
|
696
|
-
};
|
697
|
-
},
|
698
|
-
computed: {
|
699
|
-
dataSourceList: function () {
|
700
|
-
return this.designer.formConfig && this.designer.formConfig.dataSources ? this.designer.formConfig.dataSources : [];
|
701
|
-
},
|
702
|
-
reportTemplate: function () {
|
703
|
-
return this.getReportTemplate();
|
704
|
-
}
|
705
|
-
},
|
706
|
-
created: function () {
|
707
|
-
// this.reportTemplate = this.getReportTemplate();
|
708
|
-
var e = this;
|
709
|
-
(this.cssClassList = deepClone(this.designer.getCssClassList())),
|
710
|
-
this.designer.handleEvent('form-css-updated', function (t) {
|
711
|
-
e.cssClassList = t;
|
712
|
-
});
|
713
|
-
if (this.optionModel.showExportBtn == null) this.$set(this.optionModel, 'showExportBtn', true);
|
714
|
-
if (this.optionModel.tableConfig === void 0) this.$set(this.optionModel, 'tableConfig', "");
|
715
|
-
},
|
716
|
-
mounted: function () {
|
717
|
-
/*let dateFieldList = Object.keys(dateFieldComponents);
|
718
|
-
this.dateFieldList = dateFieldList;*/
|
719
|
-
},
|
720
|
-
methods: {
|
721
|
-
|
722
|
-
dragSort: function () {
|
723
|
-
var e = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0],
|
724
|
-
t = this.optionModel.tableColumns;
|
725
|
-
this.sortable = Sortable.create(e, {
|
726
|
-
ghostClass: 'sortable-ghost',
|
727
|
-
setData: function (e) {
|
728
|
-
e.setData('Text', '');
|
729
|
-
},
|
730
|
-
onEnd: function (e) {
|
731
|
-
var i = t.splice(e.oldIndex, 1)[0];
|
732
|
-
t.splice(e.newIndex, 0, i);
|
733
|
-
t[e.newIndex].id;
|
734
|
-
t[e.newIndex - 1] && t[e.newIndex - 1].id, t[e.newIndex + 1] && t[e.newIndex + 1].id;
|
735
|
-
}
|
736
|
-
});
|
737
|
-
},
|
738
|
-
openTableDataEdit: function () {
|
739
|
-
(this.dataDialogVisible = !0), (this.tableDataOptions = JSON.stringify(this.optionModel.tableData, null, ' '));
|
740
|
-
},
|
741
|
-
saveTableData: function () {
|
742
|
-
try {
|
743
|
-
(this.optionModel.tableData = JSON.parse(this.tableDataOptions)), (this.dataDialogVisible = !1);
|
744
|
-
} catch (e) {
|
745
|
-
this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + e.message);
|
746
|
-
}
|
747
|
-
},
|
748
|
-
openSetting: function () {
|
749
|
-
var e = this;
|
750
|
-
(this.dialogVisible = !0)/*,
|
751
|
-
this.$nextTick(function () {
|
752
|
-
e.dragSort();
|
753
|
-
});*/
|
754
|
-
},
|
755
|
-
colSubmit: function () {
|
756
|
-
this.dialogVisible = !1;
|
757
|
-
},
|
758
|
-
addCol: function () {
|
759
|
-
let tmpId = 'column' + generateId();
|
760
|
-
var e = {
|
761
|
-
columnId: new Date().getTime(),
|
762
|
-
required: false,
|
763
|
-
width: 150,
|
764
|
-
prop: tmpId,
|
765
|
-
label: tmpId,
|
766
|
-
align: "left",
|
767
|
-
show: true,
|
768
|
-
sortable: true
|
769
|
-
};
|
770
|
-
this.optionModel.tableColumns.push(e), this.designer.emitHistoryChange();
|
771
|
-
},
|
772
|
-
handleDelete: function (e, t) {
|
773
|
-
if (1 === this.optionModel.tableColumns.length) return this.$message.warning(this.i18nt('designer.setting.onlyOneColumnCannotBeDeleted')), !1;
|
774
|
-
this.optionModel.tableColumns.splice(e, 1);
|
775
|
-
},
|
776
|
-
showRenderDialog: function (e) {
|
777
|
-
(this.currentTableColumn = e), (this.renderJson = e.render || ''), (this.showRenderDialogFlag = !0);
|
778
|
-
},
|
779
|
-
saveColumnRender: function () {
|
780
|
-
this.$set(this.currentTableColumn, 'render', this.renderJson), (this.showRenderDialogFlag = !1);
|
781
|
-
},
|
782
|
-
handleShowButtonsColumnChange: function (e) {
|
783
|
-
if (e) {
|
784
|
-
var t = this.designer.formWidget.getSelectedWidgetRef();
|
785
|
-
t &&
|
786
|
-
t.refreshLayout &&
|
787
|
-
this.$nextTick(function () {
|
788
|
-
t.refreshLayout();
|
789
|
-
});
|
790
|
-
}
|
791
|
-
},
|
792
|
-
onButtonNameFocus: function (e) {
|
793
|
-
console.log('test', e), (this.oldButtonName = e.target.value);
|
794
|
-
},
|
795
|
-
onButtonNameChange: function (e, t) {
|
796
|
-
var i = !1;
|
797
|
-
this.optionModel.operationButtons.map(function (n, o) {
|
798
|
-
n.name === e && o !== t && (i = !0);
|
799
|
-
}),
|
800
|
-
i && (this.$message.error(this.i18nt('designer.setting.operationButtonDuplicatedNameError')), (this.optionModel.operationButtons[t].name = this.oldButtonName));
|
801
|
-
},
|
802
|
-
editButtonsColumn: function () {
|
803
|
-
this.showButtonsEditDialog = !0;
|
804
|
-
},
|
805
|
-
deleteOperationButton: function (e) {
|
806
|
-
var t = this;
|
807
|
-
this.$confirm(this.i18nt('designer.setting.deleteOperationButtonHint'), this.i18nt('render.hint.prompt'), {
|
808
|
-
confirmButtonText: this.i18nt('render.hint.confirm'),
|
809
|
-
cancelButtonText: this.i18nt('render.hint.cancel')
|
810
|
-
})
|
811
|
-
.then(function () {
|
812
|
-
t.optionModel.operationButtons.splice(e, 1);
|
813
|
-
})
|
814
|
-
.catch(function (e) {
|
815
|
-
});
|
816
|
-
},
|
817
|
-
addOperationButton: function () {
|
818
|
-
this.$set(this.optionModel, 'operationButtons', this.optionModel.operationButtons || []),
|
819
|
-
this.optionModel.operationButtons.push({
|
820
|
-
name: 'btn' + generateId(),
|
821
|
-
label: 'new btn',
|
822
|
-
type: 'text',
|
823
|
-
size: 'small',
|
824
|
-
round: !1,
|
825
|
-
hidden: !1,
|
826
|
-
disabled: !1
|
827
|
-
});
|
828
|
-
},
|
829
|
-
refreshTableLayout: function () {
|
830
|
-
var e = this.designer.formWidget.getSelectedWidgetRef();
|
831
|
-
e &&
|
832
|
-
e.refreshLayout &&
|
833
|
-
this.$nextTick(function () {
|
834
|
-
e.refreshLayout();
|
835
|
-
});
|
836
|
-
},
|
837
|
-
saveDataSourceSql() {
|
838
|
-
this.optionModel.dataSourceSql = this.dataSourceSql;
|
839
|
-
this.showSqlEditDialog = false;
|
840
|
-
},
|
841
|
-
openSqlEditDialog() {
|
842
|
-
this.dataSourceSql = this.optionModel.dataSourceSql ? deepClone(this.optionModel.dataSourceSql) : "";
|
843
|
-
this.showSqlEditDialog = true;
|
844
|
-
},
|
845
|
-
confirmInsertRequestaccess(rows) {
|
846
|
-
if (rows.length) {
|
847
|
-
let row = rows[0];
|
848
|
-
this.optionModel.accessName = row.accessName;
|
849
|
-
this.optionModel.accessCode = row.accessCode;
|
850
|
-
}
|
851
|
-
},
|
852
|
-
changeFormatS(row) {
|
853
|
-
let columnWidgetConfig = this.getColumnWidgetConfig(row, true);
|
854
|
-
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
855
|
-
if (columnSelectedWidget) {
|
856
|
-
row.columnOption = columnSelectedWidget.options;
|
857
|
-
} else {
|
858
|
-
row.columnOption = {}
|
859
|
-
}
|
860
|
-
if (row.formatS == 'editDelete' || row.formatS == 'editButton') {
|
861
|
-
row.width = 47;
|
862
|
-
row.prop = null;
|
863
|
-
row.label = null;
|
864
|
-
row.sortable = false;
|
865
|
-
} else {
|
866
|
-
let tmpId = 'column' + generateId();
|
867
|
-
if (!row.width || row.width == 47) row.width = 150;
|
868
|
-
if (!row.prop) row.prop = tmpId;
|
869
|
-
if (!row.label) row.label = tmpId;
|
870
|
-
row.sortable = true;
|
871
|
-
}
|
872
|
-
},
|
873
|
-
getColumnWidgetConfig(row, isChange) {
|
874
|
-
let formatS = row.formatS
|
875
|
-
let columnSelectedWidget = null;
|
876
|
-
let columnEditFields = null;
|
877
|
-
|
878
|
-
let type = this.columnFormatMap[row.formatS];
|
879
|
-
/*if (type == 'date') {
|
880
|
-
columnEditFields = ['type', 'format', 'valueFormat']
|
881
|
-
} else if (type == 'select') {
|
882
|
-
|
883
|
-
}
|
884
|
-
if (type == 'vabsearch') {
|
885
|
-
columnEditFields = ['vabSearchField', 'formCode', 'formVersion', 'required', 'showFormField', 'onSearchConfirm', 'onSearchClear']
|
886
|
-
}*/
|
887
|
-
|
888
|
-
if (type) {
|
889
|
-
columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
|
890
|
-
let tmpId = generateId();
|
891
|
-
let idVal = row.prop ? row.prop : (type + tmpId);
|
892
|
-
columnSelectedWidget.id = idVal;
|
893
|
-
columnSelectedWidget.options.name = idVal;
|
894
|
-
if (!isChange && row.columnOption && Object.keys(row.columnOption).length) {
|
895
|
-
row.columnOption.required = row.required || false;
|
896
|
-
columnSelectedWidget.options = row.columnOption;
|
897
|
-
} else {
|
898
|
-
columnSelectedWidget.options.required = row.required || false;
|
899
|
-
row.columnOption = columnSelectedWidget.options;
|
900
|
-
}
|
901
|
-
columnSelectedWidget.options.name = row.prop;
|
902
|
-
columnSelectedWidget.options.label = row.label;
|
903
|
-
columnSelectedWidget.options.labelHidden = true;
|
904
|
-
|
905
|
-
}
|
906
|
-
return {columnSelectedWidget, columnEditFields};
|
907
|
-
},
|
908
|
-
openFormatConfigDialog(row, index) {
|
909
|
-
let option = row.columnOption;
|
910
|
-
let selectedWidget;
|
911
|
-
let columnWidgetConfig = this.getColumnWidgetConfig(row);
|
912
|
-
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
913
|
-
if (columnSelectedWidget) {
|
914
|
-
option = columnSelectedWidget.options;
|
915
|
-
selectedWidget = columnSelectedWidget;
|
916
|
-
} else {
|
917
|
-
option = {}
|
918
|
-
selectedWidget = {};
|
919
|
-
}
|
920
|
-
|
921
|
-
let columnOption = this.$baseLodash.cloneDeep(option);
|
922
|
-
row.columnOption = columnOption;
|
923
|
-
this.operateIndex = index;
|
924
|
-
|
925
|
-
this.openWidgetPropertyDialog({
|
926
|
-
row: row,
|
927
|
-
columnSelectedWidget: selectedWidget,
|
928
|
-
index: index,
|
929
|
-
columnEditFields: columnEditFields,
|
930
|
-
callback: (columnOption) => {
|
931
|
-
this.confirmFormatConfigDialog(columnOption);
|
932
|
-
}
|
933
|
-
})
|
934
|
-
},
|
935
|
-
confirmFormatConfigDialog(columnOption) {
|
936
|
-
let row = this.optionModel.tableColumns[this.operateIndex];
|
937
|
-
row.columnOption = columnOption;
|
938
|
-
row.prop = columnOption.name;
|
939
|
-
row.label = columnOption.label;
|
940
|
-
row.required = columnOption.required;
|
941
|
-
},
|
942
|
-
openFieldTreeDialog() {
|
943
|
-
this.treeData = [{
|
944
|
-
"name": "Jinjilianxiren",
|
945
|
-
"label": "员工-紧急联系人",
|
946
|
-
children: [
|
947
|
-
{
|
948
|
-
"detailEntity": "Jinjilianxiren",
|
949
|
-
"name": "createdOn",
|
950
|
-
"label": "员工-紧急联系人.创建时间",
|
951
|
-
"type": "DateTime",
|
952
|
-
"required": "1"
|
953
|
-
}, /*{
|
954
|
-
"searchDialogWidth": "520px",
|
955
|
-
"detailEntity": "Jinjilianxiren",
|
956
|
-
"name": "createdBy",
|
957
|
-
"label": "员工-紧急联系人.创建用户",
|
958
|
-
"type": "Reference",
|
959
|
-
"required": "1"
|
960
|
-
},*/ {
|
961
|
-
"detailEntity": "Jinjilianxiren",
|
962
|
-
"name": "modifiedOn",
|
963
|
-
"label": "员工-紧急联系人.最近修改时间",
|
964
|
-
"type": "DateTime",
|
965
|
-
"required": "0"
|
966
|
-
}, /*{
|
967
|
-
"searchDialogWidth": "520px",
|
968
|
-
"detailEntity": "Jinjilianxiren",
|
969
|
-
"name": "modifiedBy",
|
970
|
-
"label": "员工-紧急联系人.修改用户",
|
971
|
-
"type": "Reference",
|
972
|
-
"required": "0"
|
973
|
-
}, {
|
974
|
-
"searchDialogWidth": "520px",
|
975
|
-
"detailEntity": "Jinjilianxiren",
|
976
|
-
"name": "mdYuangongdanganId",
|
977
|
-
"label": "员工-紧急联系人.主从关联Id",
|
978
|
-
"type": "Reference",
|
979
|
-
"required": "1"
|
980
|
-
},*/ {
|
981
|
-
"detailEntity": "Jinjilianxiren",
|
982
|
-
"name": "shouji",
|
983
|
-
"label": "员工-紧急联系人.手机",
|
984
|
-
"type": "Text",
|
985
|
-
"required": "0",
|
986
|
-
"maxLength": "200"
|
987
|
-
}, {
|
988
|
-
"detailEntity": "Jinjilianxiren",
|
989
|
-
"name": "jinjilianxirenxingming",
|
990
|
-
"label": "员工-紧急联系人.紧急联系人姓名",
|
991
|
-
"type": "Text",
|
992
|
-
"required": "0",
|
993
|
-
"maxLength": "200"
|
994
|
-
}]
|
995
|
-
}];
|
996
|
-
|
997
|
-
let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
|
998
|
-
let defaultCheckedKeys = [];
|
999
|
-
this.treeData.forEach(item1 => {
|
1000
|
-
item1.children.forEach(item2 => {
|
1001
|
-
if (fields.includes(item2.name) && !defaultCheckedKeys.includes(item2.name)) {
|
1002
|
-
defaultCheckedKeys.push(item2.name)
|
1003
|
-
}
|
1004
|
-
})
|
1005
|
-
})
|
1006
|
-
this.defaultCheckedKeys = defaultCheckedKeys
|
1007
|
-
this.showFieldTreeDialog = true;
|
1008
|
-
},
|
1009
|
-
confirmFieldTreeDialog() {
|
1010
|
-
// defaultCheckedKeys
|
1011
|
-
let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
|
1012
|
-
let datas = this.$refs.tree.getCheckedNodes(true, false);
|
1013
|
-
datas.filter(item => !fields.includes(item.name)).forEach(item => {
|
1014
|
-
this.addCol2(item);
|
1015
|
-
});
|
1016
|
-
this.designer.emitHistoryChange();
|
1017
|
-
this.showFieldTreeDialog = false;
|
1018
|
-
},
|
1019
|
-
addCol2: function (item) {
|
1020
|
-
let tmpId = 'column' + generateId();
|
1021
|
-
var e = {
|
1022
|
-
columnId: new Date().getTime(),
|
1023
|
-
required: false,
|
1024
|
-
width: 150,
|
1025
|
-
prop: item.name,
|
1026
|
-
label: item.label,
|
1027
|
-
show: true,
|
1028
|
-
sortable: true
|
1029
|
-
};
|
1030
|
-
this.optionModel.tableColumns.push(e)
|
1031
|
-
},
|
1032
|
-
openTableConfigDialog() {
|
1033
|
-
this.eventHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(', ')}) {`;
|
1034
|
-
this.eventHandlerCode = selectedWidget.options[eventName] || '';
|
1035
|
-
this.showTableConfigDialog = true;
|
1036
|
-
},
|
1037
|
-
downloadExcel() {
|
1038
|
-
let defaultUrl = 'http://file.sc.5mall.com/download/repo1/b/mk1/2024/12/13/b2aea548-a9a8-4dca-bba7-8d9c6134ebe3.xlsx';
|
1039
|
-
let xformImportTemplateFile = setttingConfig.xformImportTemplateFile || defaultUrl;
|
1040
|
-
if (!xformImportTemplateFile) return;
|
1041
|
-
this.$commonFileUtil.downloadFile(xformImportTemplateFile, "通用导入模板.xlsx");
|
1042
|
-
}
|
1043
|
-
}
|
1044
|
-
};
|
1045
|
-
</script>
|
1046
|
-
|
1047
|
-
<style>
|
1048
|
-
.icon-drag:before {
|
1049
|
-
content: '\e61d';
|
1050
|
-
}
|
1051
|
-
</style>
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<el-form-item :label="i18nt('designer.setting.tableWidth')">
|
4
|
+
<el-input v-model="optionModel.tableWidth"></el-input>
|
5
|
+
</el-form-item>
|
6
|
+
<el-form-item :label="i18nt('designer.setting.tableHeight')">
|
7
|
+
<el-input v-model="optionModel.tableHeight"></el-input>
|
8
|
+
</el-form-item>
|
9
|
+
<!-- <el-form-item :label="i18nt('designer.setting.customClass')">
|
10
|
+
<el-select v-model="optionModel.customClass" multiple="" filterable="" allow-create="" default-first-option="">
|
11
|
+
<el-option v-for="(e, t) in cssClassList" :key="t" :value="e" :label="e"></el-option>
|
12
|
+
</el-select>
|
13
|
+
</el-form-item>-->
|
14
|
+
<!-- <el-form-item :label="i18nt('designer.setting.showIndex')"><el-switch v-model="optionModel.showIndex"></el-switch></el-form-item>
|
15
|
+
<el-form-item :label="i18nt('designer.setting.showCheckBox')"><el-switch v-model="optionModel.showCheckBox"></el-switch></el-form-item> -->
|
16
|
+
<el-form-item label="启用数据行合并">
|
17
|
+
<el-switch v-model="optionModel.mergeRowEnabled"></el-switch>
|
18
|
+
</el-form-item>
|
19
|
+
<el-form-item :label="i18nt('合并行唯一字段')">
|
20
|
+
<el-input v-model="optionModel.mergeRowKey"></el-input>
|
21
|
+
</el-form-item>
|
22
|
+
<el-form-item label="查询列表">
|
23
|
+
<el-switch v-model="optionModel.isQueryTable"></el-switch>
|
24
|
+
</el-form-item>
|
25
|
+
<el-form-item :label="i18nt('designer.setting.showPagination')">
|
26
|
+
<el-switch v-model="optionModel.showPagination"></el-switch>
|
27
|
+
</el-form-item>
|
28
|
+
<el-form-item :label="i18nt('是否显示表尾统计行')">
|
29
|
+
<el-switch v-model="optionModel.showGridFooter"></el-switch>
|
30
|
+
</el-form-item>
|
31
|
+
<!-- <el-form-item :label="i18nt('显示导出')">
|
32
|
+
<el-switch v-model="optionModel.showExportBtn"></el-switch>
|
33
|
+
</el-form-item>-->
|
34
|
+
<!-- <el-form-item :label="i18nt('显示搜索栏')">
|
35
|
+
<el-switch v-model="optionModel.showSearchArea"></el-switch>
|
36
|
+
</el-form-item>-->
|
37
|
+
<!-- <el-form-item :label="i18nt('designer.setting.smallPagination')"><el-switch v-model="optionModel.smallPagination"></el-switch></el-form-item>
|
38
|
+
<el-form-item :label="i18nt('designer.setting.showSummary')"><el-switch v-model="optionModel.showSummary"></el-switch></el-form-item>
|
39
|
+
<el-form-item :label="i18nt('designer.setting.stripe')"><el-switch v-model="optionModel.stripe"></el-switch></el-form-item>
|
40
|
+
<el-form-item :label="i18nt('designer.setting.rowSpacing')">
|
41
|
+
<el-input-number style="width:100%;" controls-position="right" :min="0" :max="20" v-model="optionModel.rowSpacing"></el-input-number>
|
42
|
+
</el-form-item>
|
43
|
+
<el-form-item :label="i18nt('designer.setting.widgetSize')">
|
44
|
+
<el-select v-model="optionModel.tableSize" @change="refreshTableLayout">
|
45
|
+
<el-option v-for="e in widgetSizes" :key="e.value" :value="e.value" :label="e.label"></el-option>
|
46
|
+
</el-select>
|
47
|
+
</el-form-item> -->
|
48
|
+
<el-form-item :label="i18nt('designer.setting.tableColEdit')">
|
49
|
+
<el-button type="primary" plain="" round="" @click="openSetting">{{
|
50
|
+
i18nt('designer.setting.editAction')
|
51
|
+
}}
|
52
|
+
</el-button>
|
53
|
+
</el-form-item>
|
54
|
+
<el-form-item label="自定义表格配置" label-width="150px">
|
55
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
56
|
+
@click="editEventHandler('tableConfig', tableConfigParams)">
|
57
|
+
<span>{{ optionModel.tableConfig }}</span>
|
58
|
+
<i class="el-icon-edit"></i>
|
59
|
+
</a>
|
60
|
+
</el-form-item>
|
61
|
+
<el-form-item label-width="0">
|
62
|
+
<el-divider class="custom-divider-margin-top">编辑表格设置</el-divider>
|
63
|
+
</el-form-item>
|
64
|
+
<el-form-item :label="i18nt('编辑表格')">
|
65
|
+
<el-switch v-model="optionModel.isEditTable"></el-switch>
|
66
|
+
</el-form-item>
|
67
|
+
<el-form-item :label="i18nt('树表格')">
|
68
|
+
<el-switch v-model="optionModel.isTreeTable"></el-switch>
|
69
|
+
</el-form-item>
|
70
|
+
<el-form-item :label="i18nt('启用WBS码')">
|
71
|
+
<el-switch v-model="optionModel.wbsEnabled"></el-switch>
|
72
|
+
</el-form-item>
|
73
|
+
<el-form-item :label="i18nt('排序脚本编码')" v-if="optionModel.isEditTable">
|
74
|
+
<el-input v-model="optionModel.sortScriptCode"></el-input>
|
75
|
+
</el-form-item>
|
76
|
+
<!-- <el-form-item :label="i18nt('上级关联字段')">
|
77
|
+
<el-input v-model="optionModel.parentField"></el-input>
|
78
|
+
</el-form-item>
|
79
|
+
<el-form-item label="编辑表格默认数据" label-width="150px">
|
80
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
81
|
+
@click="editEventHandler('editDefaultRow', tableConfigParams)">
|
82
|
+
<span>{{ optionModel.editDefaultRow }}</span>
|
83
|
+
<i class="el-icon-edit"></i>
|
84
|
+
</a>
|
85
|
+
</el-form-item>-->
|
86
|
+
<!-- <el-form-item :label="i18nt('designer.setting.tableDataEdit')">
|
87
|
+
<el-button type="primary" plain="" round="" @click="openTableDataEdit">{{
|
88
|
+
i18nt('designer.setting.editAction')
|
89
|
+
}}
|
90
|
+
</el-button>
|
91
|
+
</el-form-item>-->
|
92
|
+
<!-- <el-form-item :label="i18nt('designer.setting.dsEnabled')">
|
93
|
+
<el-switch v-model="optionModel.dsEnabled"></el-switch>
|
94
|
+
</el-form-item>-->
|
95
|
+
<!-- <el-form-item v-if="optionModel.dsEnabled" :label="i18nt('designer.setting.dsName')">
|
96
|
+
<el-select v-model="optionModel.dsName" filterable="" clearable="">
|
97
|
+
<el-option v-for="(e, t) in dataSourceList" :key="t" :value="e.uniqueName" :label="e.uniqueName" :title="e.description"></el-option>
|
98
|
+
</el-select>
|
99
|
+
</el-form-item> -->
|
100
|
+
<!-- <el-form-item v-if="!optionModel.dsEnabled" :label="i18nt('designer.setting.showButtonsColumn')">
|
101
|
+
<el-switch v-model="optionModel.showButtonsColumn" @change="handleShowButtonsColumnChange"></el-switch>
|
102
|
+
</el-form-item> -->
|
103
|
+
<!-- <el-form-item v-if="optionModel.dsEnabled" :label="i18nt('请求访问')">
|
104
|
+
<!– <el-button type="primary" plain="" round="" @click="openSqlEditDialog">{{ i18nt('designer.setting.editAction') }}</el-button> –>
|
105
|
+
<el-input
|
106
|
+
class="search-input"
|
107
|
+
max="200"
|
108
|
+
v-model="optionModel.accessName"
|
109
|
+
@clear="
|
110
|
+
optionModel.accessCode = '';
|
111
|
+
$forceUpdate();
|
112
|
+
"
|
113
|
+
v-el-readonly
|
114
|
+
clearable
|
115
|
+
>
|
116
|
+
<i slot="suffix" class="el-input__icon el-icon-search" @click="showRequestaccessDialog=true"></i>
|
117
|
+
</el-input>
|
118
|
+
</el-form-item>-->
|
119
|
+
<!-- <el-form-item v-if="optionModel.showButtonsColumn" :label="i18nt('designer.setting.buttonsColumnEdit')">
|
120
|
+
<el-button type="primary" plain="" round="" @click="editButtonsColumn">{{ i18nt('designer.setting.editAction') }}</el-button>
|
121
|
+
</el-form-item> -->
|
122
|
+
<el-dialog
|
123
|
+
v-if="dataDialogVisible"
|
124
|
+
custom-class="dialog-style list-dialog"
|
125
|
+
:title="i18nt('designer.setting.tableDataEdit')"
|
126
|
+
:visible.sync="dataDialogVisible"
|
127
|
+
:show-close="!0"
|
128
|
+
append-to-body=""
|
129
|
+
:close-on-click-modal="!1"
|
130
|
+
:close-on-press-escape="!1"
|
131
|
+
:destroy-on-close="!0"
|
132
|
+
width="75%"
|
133
|
+
v-dialog-drag
|
134
|
+
>
|
135
|
+
<template slot="footer">
|
136
|
+
<div class="dialog-footer">
|
137
|
+
<el-button type="" @click="dataDialogVisible = !1" class="button-sty" icon="el-icon-close">
|
138
|
+
{{ i18nt('designer.hint.cancel') }}
|
139
|
+
</el-button>
|
140
|
+
<el-button type="primary" @click="saveTableData" class="button-sty" icon="el-icon-check">
|
141
|
+
{{ i18nt('designer.hint.confirm') }}
|
142
|
+
</el-button>
|
143
|
+
</div>
|
144
|
+
</template>
|
145
|
+
<code-editor mode="json" :readonly="!1" v-model="tableDataOptions"></code-editor>
|
146
|
+
</el-dialog>
|
147
|
+
<!-- <el-dialog
|
148
|
+
v-if="dialogVisible"
|
149
|
+
custom-class="dialog-style list-dialog"
|
150
|
+
:title="i18nt('designer.setting.tableColEdit')"
|
151
|
+
:visible.sync="dialogVisible"
|
152
|
+
:show-close="!0"
|
153
|
+
:append-to-body="false"
|
154
|
+
:modal="false"
|
155
|
+
:close-on-click-modal="!1"
|
156
|
+
:close-on-press-escape="!1"
|
157
|
+
:destroy-on-close="!0"
|
158
|
+
width="1220px"
|
159
|
+
v-dialog-drag
|
160
|
+
>
|
161
|
+
<div class="cont">
|
162
|
+
<template slot="footer">
|
163
|
+
<div class="dialog-footer">
|
164
|
+
<el-button type="" @click="dialogVisible = !1" class="button-sty" icon="el-icon-close">
|
165
|
+
{{ i18nt('designer.hint.cancel') }}
|
166
|
+
</el-button>
|
167
|
+
<el-button type="primary" @click="colSubmit" class="button-sty" icon="el-icon-check">
|
168
|
+
{{ i18nt('designer.hint.confirm') }}
|
169
|
+
</el-button>
|
170
|
+
|
171
|
+
</div>
|
172
|
+
</template>
|
173
|
+
<el-table
|
174
|
+
ref="singleTable"
|
175
|
+
width="100%"
|
176
|
+
:data="optionModel.tableColumns"
|
177
|
+
|
178
|
+
height="500"
|
179
|
+
border=""
|
180
|
+
row-key="columnId"
|
181
|
+
stripe=""
|
182
|
+
>
|
183
|
+
<el-table-column type="index" width="35" fixed="left"></el-table-column>
|
184
|
+
<el-table-column label="" width="35"><i class="el-icon-s-operation drag-option"></i></el-table-column>
|
185
|
+
<el-table-column :label="i18nt('designer.setting.columnLabel')" width="150" prop="label">
|
186
|
+
<template slot-scope="scope">
|
187
|
+
<el-input v-model="scope.row.label"></el-input>
|
188
|
+
</template>
|
189
|
+
</el-table-column>
|
190
|
+
<el-table-column :label="i18nt('designer.setting.columnName')" width="150" prop="prop">
|
191
|
+
<template slot-scope="scope">
|
192
|
+
<el-input v-model="scope.row.prop"></el-input>
|
193
|
+
</template>
|
194
|
+
</el-table-column>
|
195
|
+
<el-table-column :label="i18nt('designer.setting.columnWidth')" width="100" prop="width">
|
196
|
+
<template slot-scope="scope">
|
197
|
+
<el-input v-model="scope.row.width"></el-input>
|
198
|
+
</template>
|
199
|
+
</el-table-column>
|
200
|
+
<el-table-column :label="i18nt('designer.setting.visibleColumn')" width="70" prop="show">
|
201
|
+
<template slot-scope="scope">
|
202
|
+
<el-switch v-model="scope.row.show"></el-switch>
|
203
|
+
</template>
|
204
|
+
</el-table-column>
|
205
|
+
<el-table-column :label="i18nt('必填')" width="70" prop="required">
|
206
|
+
<template slot-scope="scope">
|
207
|
+
<el-switch v-model="scope.row.required"></el-switch>
|
208
|
+
</template>
|
209
|
+
</el-table-column>
|
210
|
+
<el-table-column :label="i18nt('designer.setting.sortableColumn')" width="70" prop="sortable">
|
211
|
+
<template slot-scope="scope">
|
212
|
+
<el-switch v-model="scope.row.sortable"></el-switch>
|
213
|
+
</template>
|
214
|
+
</el-table-column>
|
215
|
+
<el-table-column :label="i18nt('designer.setting.fixedColumn')" width="100" prop="fixed">
|
216
|
+
<template slot-scope="scope">
|
217
|
+
<el-select v-model="scope.row.fixed" clearable>
|
218
|
+
<el-option value="left">left</el-option>
|
219
|
+
<el-option value="right">right</el-option>
|
220
|
+
</el-select>
|
221
|
+
</template>
|
222
|
+
</el-table-column>
|
223
|
+
<!– <el-table-column :label="i18nt('designer.setting.alignTypeOfColumn')" width="100" prop="align">
|
224
|
+
<template slot-scope="scope">
|
225
|
+
<el-select v-model="scope.row.align">
|
226
|
+
<el-option v-for="(e,index) in alignOptions" :key="index" :value="e.value" :label="e.label"></el-option>
|
227
|
+
</el-select>
|
228
|
+
</template>
|
229
|
+
</el-table-column>–>
|
230
|
+
<el-table-column :label="i18nt('designer.setting.formatOfColumn')" width="200" prop="formatS">
|
231
|
+
<template slot-scope="scope">
|
232
|
+
<el-select v-model="scope.row.formatS" @change="changeFormatS(scope.row)" clearable>
|
233
|
+
<el-option-group :label="i18nt('designer.setting.customRenderGroup')">
|
234
|
+
<el-option value="render" label="render"></el-option>
|
235
|
+
</el-option-group>
|
236
|
+
<el-option-group v-for="t in op" :key="t.label" :label="t.label">
|
237
|
+
<el-option v-for="e in t.options" :key="e.value" :value="e.value" :label="e.label"></el-option>
|
238
|
+
</el-option-group>
|
239
|
+
</el-select>
|
240
|
+
</template>
|
241
|
+
</el-table-column>
|
242
|
+
<el-table-column label="格式化配置" width="70" fixed="right" align="center">
|
243
|
+
<template slot-scope="scope">
|
244
|
+
<el-button size="mini" plain="" round="" icon="el-icon-edit"
|
245
|
+
@click="openFormatConfigDialog(scope.row,scope.$index)"
|
246
|
+
:disabled="!columnFormatMap[scope.row.formatS]"></el-button>
|
247
|
+
</template>
|
248
|
+
</el-table-column>
|
249
|
+
<el-table-column :label="i18nt('designer.setting.renderFunction')" width="70" fixed="right" align="center">
|
250
|
+
<template slot-scope="scope">
|
251
|
+
<el-button :disabled="'render' !== scope.row.formatS" size="mini" plain="" round="" icon="el-icon-edit"
|
252
|
+
@click="showRenderDialog(scope.row)"></el-button>
|
253
|
+
</template>
|
254
|
+
</el-table-column>
|
255
|
+
<el-table-column :label="i18nt('designer.setting.actionColumn')" width="100" fixed="right" align="center">
|
256
|
+
<template #header>
|
257
|
+
<span>{{ i18nt('designer.setting.actionColumn') }}</span>
|
258
|
+
<!– <el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
|
259
|
+
icon="el-icon-plus" @click="openFieldTreeDialog"></el-button>–>
|
260
|
+
</template>
|
261
|
+
<template slot-scope="scope">
|
262
|
+
<el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
|
263
|
+
icon="el-icon-plus" @click="addCol"></el-button>
|
264
|
+
<el-button
|
265
|
+
:title="i18nt('designer.setting.deleteTableColumn')"
|
266
|
+
size="mini"
|
267
|
+
type=""
|
268
|
+
circle=""
|
269
|
+
icon="el-icon-minus"
|
270
|
+
@click="handleDelete(scope.$index, scope.row)"
|
271
|
+
></el-button>
|
272
|
+
</template>
|
273
|
+
</el-table-column>
|
274
|
+
|
275
|
+
</el-table>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</el-dialog>-->
|
279
|
+
<!-- <el-dialog
|
280
|
+
v-if="showRenderDialogFlag"
|
281
|
+
:title="i18nt('designer.setting.renderFunction')"
|
282
|
+
:visible.sync="showRenderDialogFlag"
|
283
|
+
append-to-body=""
|
284
|
+
:show-close="!0"
|
285
|
+
custom-class="dialog-style list-dialog"
|
286
|
+
:close-on-click-modal="!1"
|
287
|
+
:close-on-press-escape="!1"
|
288
|
+
:destroy-on-close="!0"
|
289
|
+
v-dialog-drag
|
290
|
+
>
|
291
|
+
<el-alert type="info" :closable="!1" title="function customRender(params,h) {"/>
|
292
|
+
<code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="renderJson"></code-editor>
|
293
|
+
<el-alert type="info" :closable="!1" title="}"/>
|
294
|
+
<div class="dialog-footer" slot="footer">
|
295
|
+
<el-button @click="showRenderDialogFlag = !1" class="button-sty" icon="el-icon-close">
|
296
|
+
{{ i18nt('designer.hint.cancel') }}
|
297
|
+
</el-button>
|
298
|
+
<el-button type="primary" @click="saveColumnRender" class="button-sty" icon="el-icon-check">
|
299
|
+
{{ i18nt('designer.hint.confirm') }}
|
300
|
+
</el-button>
|
301
|
+
</div>
|
302
|
+
</el-dialog>-->
|
303
|
+
<el-dialog
|
304
|
+
v-if="showSqlEditDialog"
|
305
|
+
:title="i18nt('数据源SQL编辑')"
|
306
|
+
:visible.sync="showSqlEditDialog"
|
307
|
+
append-to-body=""
|
308
|
+
:show-close="!0"
|
309
|
+
custom-class="dialog-style list-dialog"
|
310
|
+
:close-on-click-modal="!1"
|
311
|
+
:close-on-press-escape="!1"
|
312
|
+
:destroy-on-close="!0"
|
313
|
+
v-dialog-drag
|
314
|
+
>
|
315
|
+
<el-alert type="info" :closable="!1"/>
|
316
|
+
<code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="dataSourceSql"></code-editor>
|
317
|
+
<el-alert type="info" :closable="!1"/>
|
318
|
+
<div class="dialog-footer" slot="footer">
|
319
|
+
<el-button @click="showSqlEditDialog = !1" class="button-sty" icon="el-icon-close">
|
320
|
+
{{ i18nt('designer.hint.cancel') }}
|
321
|
+
</el-button>
|
322
|
+
<el-button type="primary" @click="saveDataSourceSql" class="button-sty" icon="el-icon-check">
|
323
|
+
{{ i18nt('designer.hint.confirm') }}
|
324
|
+
</el-button>
|
325
|
+
</div>
|
326
|
+
</el-dialog>
|
327
|
+
<requestaccessDialog v-if="showRequestaccessDialog" :visiable.sync="showRequestaccessDialog"
|
328
|
+
@confirm="confirmInsertRequestaccess" multi="false"
|
329
|
+
:param="{reportCode:reportTemplate.reportCode}"/>
|
330
|
+
|
331
|
+
<el-dialog
|
332
|
+
v-if="showFieldTreeDialog"
|
333
|
+
custom-class="dialog-style list-dialog"
|
334
|
+
title="新增列表列"
|
335
|
+
:visible.sync="showFieldTreeDialog"
|
336
|
+
:show-close="!0"
|
337
|
+
:append-to-body="false"
|
338
|
+
:modal="false"
|
339
|
+
:close-on-click-modal="!1"
|
340
|
+
:close-on-press-escape="!1"
|
341
|
+
:destroy-on-close="!0"
|
342
|
+
width="500px"
|
343
|
+
v-dialog-drag
|
344
|
+
>
|
345
|
+
<div class="cont" style="height: 500px;">
|
346
|
+
<el-tree
|
347
|
+
ref="tree"
|
348
|
+
:data="treeData"
|
349
|
+
show-checkbox
|
350
|
+
node-key="name"
|
351
|
+
:default-expand-all="true"
|
352
|
+
:check-on-click-node="true"
|
353
|
+
:expand-on-click-node="false"
|
354
|
+
:default-checked-keys="defaultCheckedKeys"
|
355
|
+
:props="defaultProps">
|
356
|
+
</el-tree>
|
357
|
+
</div>
|
358
|
+
<span slot="footer" class="dialog-footer">
|
359
|
+
<el-button type="primary" plain class="button-sty" @click="showFieldTreeDialog=false">
|
360
|
+
<i class="el-icon-close el-icon"></i>
|
361
|
+
取 消
|
362
|
+
</el-button>
|
363
|
+
<el-button type="primary" @click="confirmFieldTreeDialog" class="button-sty">
|
364
|
+
<i class="el-icon-check el-icon"></i>
|
365
|
+
确 定
|
366
|
+
</el-button>
|
367
|
+
</span>
|
368
|
+
</el-dialog>
|
369
|
+
<!-- <el-dialog
|
370
|
+
v-if="showDateConfigDialog"
|
371
|
+
:title="i18nt('日期配置编辑')"
|
372
|
+
:visible.sync="showDateConfigDialog"
|
373
|
+
append-to-body=""
|
374
|
+
:show-close="!0"
|
375
|
+
custom-class="dialog-style list-dialog"
|
376
|
+
:close-on-click-modal="!1"
|
377
|
+
:close-on-press-escape="!1"
|
378
|
+
:destroy-on-close="!0"
|
379
|
+
v-dialog-drag
|
380
|
+
>
|
381
|
+
<div class="cont">
|
382
|
+
<el-form>
|
383
|
+
<template v-for="(editorName, index) in dateFieldList">
|
384
|
+
<component
|
385
|
+
:is="editorName"
|
386
|
+
:designer="designer"
|
387
|
+
:selected-widget="selectedWidget"
|
388
|
+
:option-model="columnOption"
|
389
|
+
:key="index"
|
390
|
+
></component>
|
391
|
+
</template>
|
392
|
+
</el-form>
|
393
|
+
</div>
|
394
|
+
<div class="dialog-footer" slot="footer">
|
395
|
+
<el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
|
396
|
+
{{ i18nt('designer.hint.cancel') }}
|
397
|
+
</el-button>
|
398
|
+
<el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
|
399
|
+
{{ i18nt('designer.hint.confirm') }}
|
400
|
+
</el-button>
|
401
|
+
</div>
|
402
|
+
</el-dialog>-->
|
403
|
+
<!-- <el-dialog
|
404
|
+
v-if="showDateConfigDialog"
|
405
|
+
:title="i18nt('日期配置编辑')"
|
406
|
+
:visible.sync="showDateConfigDialog"
|
407
|
+
append-to-body=""
|
408
|
+
:show-close="!0"
|
409
|
+
custom-class="dialog-style list-dialog"
|
410
|
+
:close-on-click-modal="!1"
|
411
|
+
:close-on-press-escape="!1"
|
412
|
+
:destroy-on-close="!0"
|
413
|
+
v-dialog-drag
|
414
|
+
>
|
415
|
+
<div class="cont">
|
416
|
+
<el-scrollbar class="setting-scrollbar">
|
417
|
+
<el-form :model="columnOption" size="mini" label-position="left" label-width="120px" class="setting-form"
|
418
|
+
@submit.native.prevent>
|
419
|
+
<el-collapse v-model="widgetActiveCollapseNames" class="setting-collapse">
|
420
|
+
<el-collapse-item name="1" v-if="showCollapse(commonProps)"
|
421
|
+
:title="i18nt('designer.setting.commonSetting')">
|
422
|
+
<template v-for="(editorName, propName) in commonProps">
|
423
|
+
<component
|
424
|
+
v-if="hasPropEditor(propName, editorName)"
|
425
|
+
:is="getPropEditor(propName, editorName)"
|
426
|
+
:designer="designer"
|
427
|
+
:selected-widget="columnSelectedWidget"
|
428
|
+
:option-model="columnOption"
|
429
|
+
:key="propName"
|
430
|
+
></component>
|
431
|
+
</template>
|
432
|
+
</el-collapse-item>
|
433
|
+
|
434
|
+
<el-collapse-item name="2" v-if="showCollapse(advProps)"
|
435
|
+
:title="i18nt('designer.setting.advancedSetting')">
|
436
|
+
<template v-for="(editorName, propName) in advProps">
|
437
|
+
<component
|
438
|
+
v-if="hasPropEditor(propName, editorName)"
|
439
|
+
:is="getPropEditor(propName, editorName)"
|
440
|
+
:designer="designer"
|
441
|
+
:selected-widget="selectedWidget"
|
442
|
+
:option-model="columnOption"
|
443
|
+
:key="propName"
|
444
|
+
></component>
|
445
|
+
</template>
|
446
|
+
</el-collapse-item>
|
447
|
+
|
448
|
+
<el-collapse-item name="3" v-if="showEventCollapse() && showCollapse(eventProps)"
|
449
|
+
:title="i18nt('designer.setting.eventSetting')">
|
450
|
+
<template v-for="(editorName, propName) in eventProps">
|
451
|
+
<component
|
452
|
+
v-if="hasPropEditor(propName, editorName)"
|
453
|
+
:is="getPropEditor(propName, editorName)"
|
454
|
+
:designer="designer"
|
455
|
+
:selected-widget="selectedWidget"
|
456
|
+
:option-model="columnOption"
|
457
|
+
:key="propName"
|
458
|
+
></component>
|
459
|
+
</template>
|
460
|
+
</el-collapse-item>
|
461
|
+
</el-collapse>
|
462
|
+
</el-form>
|
463
|
+
</el-scrollbar>
|
464
|
+
</div>
|
465
|
+
<div class="dialog-footer" slot="footer">
|
466
|
+
<el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
|
467
|
+
{{ i18nt('designer.hint.cancel') }}
|
468
|
+
</el-button>
|
469
|
+
<el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
|
470
|
+
{{ i18nt('designer.hint.confirm') }}
|
471
|
+
</el-button>
|
472
|
+
</div>
|
473
|
+
</el-dialog>-->
|
474
|
+
<tableColumnDialog v-if="dialogVisible" :visiable.sync="dialogVisible" :designer="designer"
|
475
|
+
:selectedWidget="selectedWidget"
|
476
|
+
:optionModel="optionModel"/>
|
477
|
+
|
478
|
+
|
479
|
+
</div>
|
480
|
+
</template>
|
481
|
+
|
482
|
+
<script>
|
483
|
+
import i18n from '../../../../../../components/xform/utils/i18n';
|
484
|
+
// import Draggable from 'vuedraggable';
|
485
|
+
import {deepClone, generateId} from '../../../../../../components/xform/utils/util';
|
486
|
+
import Sortable from 'sortablejs';
|
487
|
+
import requestaccessDialog from '../../../../../../views/user/form/report_requestaccess/dialog.vue'
|
488
|
+
import conditionEditor from './condition-editor.vue'
|
489
|
+
import tableColumnDialog from "./table-column-dialog.vue";
|
490
|
+
import eventMixin
|
491
|
+
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
492
|
+
import setttingConfig from "@/settings";
|
493
|
+
|
494
|
+
export default {
|
495
|
+
name: 'data-table-editor',
|
496
|
+
componentName: 'PropertyEditor',
|
497
|
+
mixins: [i18n, eventMixin],
|
498
|
+
components: {
|
499
|
+
requestaccessDialog,
|
500
|
+
conditionEditor,
|
501
|
+
tableColumnDialog
|
502
|
+
},
|
503
|
+
props: {
|
504
|
+
designer: Object,
|
505
|
+
selectedWidget: Object,
|
506
|
+
optionModel: Object
|
507
|
+
},
|
508
|
+
inject: ['getReportTemplate', 'showEventCollapse', 'openWidgetPropertyDialog'],
|
509
|
+
data: function () {
|
510
|
+
return {
|
511
|
+
showTableConfigDialog: false,
|
512
|
+
tableConfigCode: null,
|
513
|
+
dialogVisible: !1,
|
514
|
+
dataDialogVisible: !1,
|
515
|
+
showButtonsEditDialog: !1,
|
516
|
+
oldButtonName: '',
|
517
|
+
cssClassList: [],
|
518
|
+
tableDataOptions: [],
|
519
|
+
widgetSizes: [
|
520
|
+
{
|
521
|
+
label: 'default',
|
522
|
+
value: ''
|
523
|
+
},
|
524
|
+
{
|
525
|
+
label: 'large',
|
526
|
+
value: 'large'
|
527
|
+
},
|
528
|
+
{
|
529
|
+
label: 'medium',
|
530
|
+
value: 'medium'
|
531
|
+
},
|
532
|
+
{
|
533
|
+
label: 'small',
|
534
|
+
value: 'small'
|
535
|
+
},
|
536
|
+
{
|
537
|
+
label: 'mini',
|
538
|
+
value: 'mini'
|
539
|
+
}
|
540
|
+
],
|
541
|
+
alignOptions: [
|
542
|
+
{
|
543
|
+
value: 'left',
|
544
|
+
label: 'left'
|
545
|
+
},
|
546
|
+
{
|
547
|
+
value: 'center',
|
548
|
+
label: 'center'
|
549
|
+
},
|
550
|
+
{
|
551
|
+
value: 'right',
|
552
|
+
label: 'right'
|
553
|
+
}
|
554
|
+
],
|
555
|
+
fieldTypeOptions: [
|
556
|
+
{
|
557
|
+
value: 'text',
|
558
|
+
label: 'Text'
|
559
|
+
},
|
560
|
+
{
|
561
|
+
value: 'number',
|
562
|
+
label: 'Number'
|
563
|
+
},
|
564
|
+
{
|
565
|
+
value: 'date',
|
566
|
+
label: 'Date'
|
567
|
+
}
|
568
|
+
],
|
569
|
+
op: [
|
570
|
+
{
|
571
|
+
label: 'Date Format',
|
572
|
+
options: [
|
573
|
+
{
|
574
|
+
value: 'd1',
|
575
|
+
label: 'yyyy-MM-dd'
|
576
|
+
},
|
577
|
+
{
|
578
|
+
value: 'd2',
|
579
|
+
label: 'yyyy/MM/dd'
|
580
|
+
},
|
581
|
+
{
|
582
|
+
value: 'd3',
|
583
|
+
label: 'yyyy年MM月dd日'
|
584
|
+
},
|
585
|
+
{
|
586
|
+
value: 'd4',
|
587
|
+
label: 'yyyy-MM-dd HH:mm:ss'
|
588
|
+
},
|
589
|
+
{
|
590
|
+
value: 'd5',
|
591
|
+
label: 'yyyy-MM-dd hh:mm:ss'
|
592
|
+
}
|
593
|
+
]
|
594
|
+
},
|
595
|
+
{
|
596
|
+
label: 'Number Format',
|
597
|
+
options: [
|
598
|
+
{
|
599
|
+
value: 'n1',
|
600
|
+
label: '###,###,###,##0.######'
|
601
|
+
},
|
602
|
+
{
|
603
|
+
value: 'n2',
|
604
|
+
label: '###,###,###,##0.00####'
|
605
|
+
},
|
606
|
+
{
|
607
|
+
value: 'n3',
|
608
|
+
label: '###,###,###,##0.000000'
|
609
|
+
},
|
610
|
+
{
|
611
|
+
value: 'n4',
|
612
|
+
label: '###,###,###,##0.000'
|
613
|
+
},
|
614
|
+
{
|
615
|
+
value: 'n5',
|
616
|
+
label: '###,###,###,##0.00'
|
617
|
+
},
|
618
|
+
{
|
619
|
+
value: 'n6',
|
620
|
+
label: '###,###,###,##0'
|
621
|
+
},
|
622
|
+
{
|
623
|
+
value: 'n7',
|
624
|
+
label: '###,##0.00##%'
|
625
|
+
}
|
626
|
+
]
|
627
|
+
},
|
628
|
+
{
|
629
|
+
label: 'edit Format',
|
630
|
+
options: [
|
631
|
+
{
|
632
|
+
value: 'editInput',
|
633
|
+
label: '文本输入框'
|
634
|
+
},
|
635
|
+
{
|
636
|
+
value: 'editNumber',
|
637
|
+
label: '数字输入框'
|
638
|
+
},
|
639
|
+
{
|
640
|
+
value: 'editDate',
|
641
|
+
label: '日期输入框'
|
642
|
+
},
|
643
|
+
{
|
644
|
+
value: 'editSelect',
|
645
|
+
label: '下拉框'
|
646
|
+
},
|
647
|
+
{
|
648
|
+
value: 'editSearch',
|
649
|
+
label: '搜索框'
|
650
|
+
},
|
651
|
+
{
|
652
|
+
value: 'editDelete',
|
653
|
+
label: '删除按钮'
|
654
|
+
},
|
655
|
+
{
|
656
|
+
value: 'editButton',
|
657
|
+
label: '查看按钮'
|
658
|
+
}
|
659
|
+
]
|
660
|
+
},
|
661
|
+
],
|
662
|
+
columnFormatMap: {
|
663
|
+
editInput: 'input',
|
664
|
+
editNumber: 'number',
|
665
|
+
editDate: 'date',
|
666
|
+
editSelect: 'select',
|
667
|
+
editSearch: 'vabsearch'
|
668
|
+
},
|
669
|
+
showRenderDialogFlag: !1,
|
670
|
+
renderJson: '',
|
671
|
+
currentTableColumn: null,
|
672
|
+
nameRules: [
|
673
|
+
{
|
674
|
+
required: !0,
|
675
|
+
trigger: ['blur', 'change'],
|
676
|
+
message: this.i18nt('designer.setting.fieldValueRequired')
|
677
|
+
}
|
678
|
+
],
|
679
|
+
showSqlEditDialog: false,
|
680
|
+
dataSourceSql: "",
|
681
|
+
showRequestaccessDialog: false,
|
682
|
+
showDateConfigDialog: false,
|
683
|
+
columnOption: {},
|
684
|
+
dateFieldList: [],
|
685
|
+
columnSelectedWidget: {},
|
686
|
+
// reportTemplate:{}
|
687
|
+
|
688
|
+
showFieldTreeDialog: false,
|
689
|
+
treeData: [],
|
690
|
+
defaultProps: {
|
691
|
+
children: 'children',
|
692
|
+
label: 'label'
|
693
|
+
},
|
694
|
+
defaultCheckedKeys: [],
|
695
|
+
tableConfigParams: ["dataId", "formCode"]
|
696
|
+
};
|
697
|
+
},
|
698
|
+
computed: {
|
699
|
+
dataSourceList: function () {
|
700
|
+
return this.designer.formConfig && this.designer.formConfig.dataSources ? this.designer.formConfig.dataSources : [];
|
701
|
+
},
|
702
|
+
reportTemplate: function () {
|
703
|
+
return this.getReportTemplate();
|
704
|
+
}
|
705
|
+
},
|
706
|
+
created: function () {
|
707
|
+
// this.reportTemplate = this.getReportTemplate();
|
708
|
+
var e = this;
|
709
|
+
(this.cssClassList = deepClone(this.designer.getCssClassList())),
|
710
|
+
this.designer.handleEvent('form-css-updated', function (t) {
|
711
|
+
e.cssClassList = t;
|
712
|
+
});
|
713
|
+
if (this.optionModel.showExportBtn == null) this.$set(this.optionModel, 'showExportBtn', true);
|
714
|
+
if (this.optionModel.tableConfig === void 0) this.$set(this.optionModel, 'tableConfig', "");
|
715
|
+
},
|
716
|
+
mounted: function () {
|
717
|
+
/*let dateFieldList = Object.keys(dateFieldComponents);
|
718
|
+
this.dateFieldList = dateFieldList;*/
|
719
|
+
},
|
720
|
+
methods: {
|
721
|
+
|
722
|
+
dragSort: function () {
|
723
|
+
var e = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0],
|
724
|
+
t = this.optionModel.tableColumns;
|
725
|
+
this.sortable = Sortable.create(e, {
|
726
|
+
ghostClass: 'sortable-ghost',
|
727
|
+
setData: function (e) {
|
728
|
+
e.setData('Text', '');
|
729
|
+
},
|
730
|
+
onEnd: function (e) {
|
731
|
+
var i = t.splice(e.oldIndex, 1)[0];
|
732
|
+
t.splice(e.newIndex, 0, i);
|
733
|
+
t[e.newIndex].id;
|
734
|
+
t[e.newIndex - 1] && t[e.newIndex - 1].id, t[e.newIndex + 1] && t[e.newIndex + 1].id;
|
735
|
+
}
|
736
|
+
});
|
737
|
+
},
|
738
|
+
openTableDataEdit: function () {
|
739
|
+
(this.dataDialogVisible = !0), (this.tableDataOptions = JSON.stringify(this.optionModel.tableData, null, ' '));
|
740
|
+
},
|
741
|
+
saveTableData: function () {
|
742
|
+
try {
|
743
|
+
(this.optionModel.tableData = JSON.parse(this.tableDataOptions)), (this.dataDialogVisible = !1);
|
744
|
+
} catch (e) {
|
745
|
+
this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + e.message);
|
746
|
+
}
|
747
|
+
},
|
748
|
+
openSetting: function () {
|
749
|
+
var e = this;
|
750
|
+
(this.dialogVisible = !0)/*,
|
751
|
+
this.$nextTick(function () {
|
752
|
+
e.dragSort();
|
753
|
+
});*/
|
754
|
+
},
|
755
|
+
colSubmit: function () {
|
756
|
+
this.dialogVisible = !1;
|
757
|
+
},
|
758
|
+
addCol: function () {
|
759
|
+
let tmpId = 'column' + generateId();
|
760
|
+
var e = {
|
761
|
+
columnId: new Date().getTime(),
|
762
|
+
required: false,
|
763
|
+
width: 150,
|
764
|
+
prop: tmpId,
|
765
|
+
label: tmpId,
|
766
|
+
align: "left",
|
767
|
+
show: true,
|
768
|
+
sortable: true
|
769
|
+
};
|
770
|
+
this.optionModel.tableColumns.push(e), this.designer.emitHistoryChange();
|
771
|
+
},
|
772
|
+
handleDelete: function (e, t) {
|
773
|
+
if (1 === this.optionModel.tableColumns.length) return this.$message.warning(this.i18nt('designer.setting.onlyOneColumnCannotBeDeleted')), !1;
|
774
|
+
this.optionModel.tableColumns.splice(e, 1);
|
775
|
+
},
|
776
|
+
showRenderDialog: function (e) {
|
777
|
+
(this.currentTableColumn = e), (this.renderJson = e.render || ''), (this.showRenderDialogFlag = !0);
|
778
|
+
},
|
779
|
+
saveColumnRender: function () {
|
780
|
+
this.$set(this.currentTableColumn, 'render', this.renderJson), (this.showRenderDialogFlag = !1);
|
781
|
+
},
|
782
|
+
handleShowButtonsColumnChange: function (e) {
|
783
|
+
if (e) {
|
784
|
+
var t = this.designer.formWidget.getSelectedWidgetRef();
|
785
|
+
t &&
|
786
|
+
t.refreshLayout &&
|
787
|
+
this.$nextTick(function () {
|
788
|
+
t.refreshLayout();
|
789
|
+
});
|
790
|
+
}
|
791
|
+
},
|
792
|
+
onButtonNameFocus: function (e) {
|
793
|
+
console.log('test', e), (this.oldButtonName = e.target.value);
|
794
|
+
},
|
795
|
+
onButtonNameChange: function (e, t) {
|
796
|
+
var i = !1;
|
797
|
+
this.optionModel.operationButtons.map(function (n, o) {
|
798
|
+
n.name === e && o !== t && (i = !0);
|
799
|
+
}),
|
800
|
+
i && (this.$message.error(this.i18nt('designer.setting.operationButtonDuplicatedNameError')), (this.optionModel.operationButtons[t].name = this.oldButtonName));
|
801
|
+
},
|
802
|
+
editButtonsColumn: function () {
|
803
|
+
this.showButtonsEditDialog = !0;
|
804
|
+
},
|
805
|
+
deleteOperationButton: function (e) {
|
806
|
+
var t = this;
|
807
|
+
this.$confirm(this.i18nt('designer.setting.deleteOperationButtonHint'), this.i18nt('render.hint.prompt'), {
|
808
|
+
confirmButtonText: this.i18nt('render.hint.confirm'),
|
809
|
+
cancelButtonText: this.i18nt('render.hint.cancel')
|
810
|
+
})
|
811
|
+
.then(function () {
|
812
|
+
t.optionModel.operationButtons.splice(e, 1);
|
813
|
+
})
|
814
|
+
.catch(function (e) {
|
815
|
+
});
|
816
|
+
},
|
817
|
+
addOperationButton: function () {
|
818
|
+
this.$set(this.optionModel, 'operationButtons', this.optionModel.operationButtons || []),
|
819
|
+
this.optionModel.operationButtons.push({
|
820
|
+
name: 'btn' + generateId(),
|
821
|
+
label: 'new btn',
|
822
|
+
type: 'text',
|
823
|
+
size: 'small',
|
824
|
+
round: !1,
|
825
|
+
hidden: !1,
|
826
|
+
disabled: !1
|
827
|
+
});
|
828
|
+
},
|
829
|
+
refreshTableLayout: function () {
|
830
|
+
var e = this.designer.formWidget.getSelectedWidgetRef();
|
831
|
+
e &&
|
832
|
+
e.refreshLayout &&
|
833
|
+
this.$nextTick(function () {
|
834
|
+
e.refreshLayout();
|
835
|
+
});
|
836
|
+
},
|
837
|
+
saveDataSourceSql() {
|
838
|
+
this.optionModel.dataSourceSql = this.dataSourceSql;
|
839
|
+
this.showSqlEditDialog = false;
|
840
|
+
},
|
841
|
+
openSqlEditDialog() {
|
842
|
+
this.dataSourceSql = this.optionModel.dataSourceSql ? deepClone(this.optionModel.dataSourceSql) : "";
|
843
|
+
this.showSqlEditDialog = true;
|
844
|
+
},
|
845
|
+
confirmInsertRequestaccess(rows) {
|
846
|
+
if (rows.length) {
|
847
|
+
let row = rows[0];
|
848
|
+
this.optionModel.accessName = row.accessName;
|
849
|
+
this.optionModel.accessCode = row.accessCode;
|
850
|
+
}
|
851
|
+
},
|
852
|
+
changeFormatS(row) {
|
853
|
+
let columnWidgetConfig = this.getColumnWidgetConfig(row, true);
|
854
|
+
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
855
|
+
if (columnSelectedWidget) {
|
856
|
+
row.columnOption = columnSelectedWidget.options;
|
857
|
+
} else {
|
858
|
+
row.columnOption = {}
|
859
|
+
}
|
860
|
+
if (row.formatS == 'editDelete' || row.formatS == 'editButton') {
|
861
|
+
row.width = 47;
|
862
|
+
row.prop = null;
|
863
|
+
row.label = null;
|
864
|
+
row.sortable = false;
|
865
|
+
} else {
|
866
|
+
let tmpId = 'column' + generateId();
|
867
|
+
if (!row.width || row.width == 47) row.width = 150;
|
868
|
+
if (!row.prop) row.prop = tmpId;
|
869
|
+
if (!row.label) row.label = tmpId;
|
870
|
+
row.sortable = true;
|
871
|
+
}
|
872
|
+
},
|
873
|
+
getColumnWidgetConfig(row, isChange) {
|
874
|
+
let formatS = row.formatS
|
875
|
+
let columnSelectedWidget = null;
|
876
|
+
let columnEditFields = null;
|
877
|
+
|
878
|
+
let type = this.columnFormatMap[row.formatS];
|
879
|
+
/*if (type == 'date') {
|
880
|
+
columnEditFields = ['type', 'format', 'valueFormat']
|
881
|
+
} else if (type == 'select') {
|
882
|
+
|
883
|
+
}
|
884
|
+
if (type == 'vabsearch') {
|
885
|
+
columnEditFields = ['vabSearchField', 'formCode', 'formVersion', 'required', 'showFormField', 'onSearchConfirm', 'onSearchClear']
|
886
|
+
}*/
|
887
|
+
|
888
|
+
if (type) {
|
889
|
+
columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
|
890
|
+
let tmpId = generateId();
|
891
|
+
let idVal = row.prop ? row.prop : (type + tmpId);
|
892
|
+
columnSelectedWidget.id = idVal;
|
893
|
+
columnSelectedWidget.options.name = idVal;
|
894
|
+
if (!isChange && row.columnOption && Object.keys(row.columnOption).length) {
|
895
|
+
row.columnOption.required = row.required || false;
|
896
|
+
columnSelectedWidget.options = row.columnOption;
|
897
|
+
} else {
|
898
|
+
columnSelectedWidget.options.required = row.required || false;
|
899
|
+
row.columnOption = columnSelectedWidget.options;
|
900
|
+
}
|
901
|
+
columnSelectedWidget.options.name = row.prop;
|
902
|
+
columnSelectedWidget.options.label = row.label;
|
903
|
+
columnSelectedWidget.options.labelHidden = true;
|
904
|
+
|
905
|
+
}
|
906
|
+
return {columnSelectedWidget, columnEditFields};
|
907
|
+
},
|
908
|
+
openFormatConfigDialog(row, index) {
|
909
|
+
let option = row.columnOption;
|
910
|
+
let selectedWidget;
|
911
|
+
let columnWidgetConfig = this.getColumnWidgetConfig(row);
|
912
|
+
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
913
|
+
if (columnSelectedWidget) {
|
914
|
+
option = columnSelectedWidget.options;
|
915
|
+
selectedWidget = columnSelectedWidget;
|
916
|
+
} else {
|
917
|
+
option = {}
|
918
|
+
selectedWidget = {};
|
919
|
+
}
|
920
|
+
|
921
|
+
let columnOption = this.$baseLodash.cloneDeep(option);
|
922
|
+
row.columnOption = columnOption;
|
923
|
+
this.operateIndex = index;
|
924
|
+
|
925
|
+
this.openWidgetPropertyDialog({
|
926
|
+
row: row,
|
927
|
+
columnSelectedWidget: selectedWidget,
|
928
|
+
index: index,
|
929
|
+
columnEditFields: columnEditFields,
|
930
|
+
callback: (columnOption) => {
|
931
|
+
this.confirmFormatConfigDialog(columnOption);
|
932
|
+
}
|
933
|
+
})
|
934
|
+
},
|
935
|
+
confirmFormatConfigDialog(columnOption) {
|
936
|
+
let row = this.optionModel.tableColumns[this.operateIndex];
|
937
|
+
row.columnOption = columnOption;
|
938
|
+
row.prop = columnOption.name;
|
939
|
+
row.label = columnOption.label;
|
940
|
+
row.required = columnOption.required;
|
941
|
+
},
|
942
|
+
openFieldTreeDialog() {
|
943
|
+
this.treeData = [{
|
944
|
+
"name": "Jinjilianxiren",
|
945
|
+
"label": "员工-紧急联系人",
|
946
|
+
children: [
|
947
|
+
{
|
948
|
+
"detailEntity": "Jinjilianxiren",
|
949
|
+
"name": "createdOn",
|
950
|
+
"label": "员工-紧急联系人.创建时间",
|
951
|
+
"type": "DateTime",
|
952
|
+
"required": "1"
|
953
|
+
}, /*{
|
954
|
+
"searchDialogWidth": "520px",
|
955
|
+
"detailEntity": "Jinjilianxiren",
|
956
|
+
"name": "createdBy",
|
957
|
+
"label": "员工-紧急联系人.创建用户",
|
958
|
+
"type": "Reference",
|
959
|
+
"required": "1"
|
960
|
+
},*/ {
|
961
|
+
"detailEntity": "Jinjilianxiren",
|
962
|
+
"name": "modifiedOn",
|
963
|
+
"label": "员工-紧急联系人.最近修改时间",
|
964
|
+
"type": "DateTime",
|
965
|
+
"required": "0"
|
966
|
+
}, /*{
|
967
|
+
"searchDialogWidth": "520px",
|
968
|
+
"detailEntity": "Jinjilianxiren",
|
969
|
+
"name": "modifiedBy",
|
970
|
+
"label": "员工-紧急联系人.修改用户",
|
971
|
+
"type": "Reference",
|
972
|
+
"required": "0"
|
973
|
+
}, {
|
974
|
+
"searchDialogWidth": "520px",
|
975
|
+
"detailEntity": "Jinjilianxiren",
|
976
|
+
"name": "mdYuangongdanganId",
|
977
|
+
"label": "员工-紧急联系人.主从关联Id",
|
978
|
+
"type": "Reference",
|
979
|
+
"required": "1"
|
980
|
+
},*/ {
|
981
|
+
"detailEntity": "Jinjilianxiren",
|
982
|
+
"name": "shouji",
|
983
|
+
"label": "员工-紧急联系人.手机",
|
984
|
+
"type": "Text",
|
985
|
+
"required": "0",
|
986
|
+
"maxLength": "200"
|
987
|
+
}, {
|
988
|
+
"detailEntity": "Jinjilianxiren",
|
989
|
+
"name": "jinjilianxirenxingming",
|
990
|
+
"label": "员工-紧急联系人.紧急联系人姓名",
|
991
|
+
"type": "Text",
|
992
|
+
"required": "0",
|
993
|
+
"maxLength": "200"
|
994
|
+
}]
|
995
|
+
}];
|
996
|
+
|
997
|
+
let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
|
998
|
+
let defaultCheckedKeys = [];
|
999
|
+
this.treeData.forEach(item1 => {
|
1000
|
+
item1.children.forEach(item2 => {
|
1001
|
+
if (fields.includes(item2.name) && !defaultCheckedKeys.includes(item2.name)) {
|
1002
|
+
defaultCheckedKeys.push(item2.name)
|
1003
|
+
}
|
1004
|
+
})
|
1005
|
+
})
|
1006
|
+
this.defaultCheckedKeys = defaultCheckedKeys
|
1007
|
+
this.showFieldTreeDialog = true;
|
1008
|
+
},
|
1009
|
+
confirmFieldTreeDialog() {
|
1010
|
+
// defaultCheckedKeys
|
1011
|
+
let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
|
1012
|
+
let datas = this.$refs.tree.getCheckedNodes(true, false);
|
1013
|
+
datas.filter(item => !fields.includes(item.name)).forEach(item => {
|
1014
|
+
this.addCol2(item);
|
1015
|
+
});
|
1016
|
+
this.designer.emitHistoryChange();
|
1017
|
+
this.showFieldTreeDialog = false;
|
1018
|
+
},
|
1019
|
+
addCol2: function (item) {
|
1020
|
+
let tmpId = 'column' + generateId();
|
1021
|
+
var e = {
|
1022
|
+
columnId: new Date().getTime(),
|
1023
|
+
required: false,
|
1024
|
+
width: 150,
|
1025
|
+
prop: item.name,
|
1026
|
+
label: item.label,
|
1027
|
+
show: true,
|
1028
|
+
sortable: true
|
1029
|
+
};
|
1030
|
+
this.optionModel.tableColumns.push(e)
|
1031
|
+
},
|
1032
|
+
openTableConfigDialog() {
|
1033
|
+
this.eventHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(', ')}) {`;
|
1034
|
+
this.eventHandlerCode = selectedWidget.options[eventName] || '';
|
1035
|
+
this.showTableConfigDialog = true;
|
1036
|
+
},
|
1037
|
+
downloadExcel() {
|
1038
|
+
let defaultUrl = 'http://file.sc.5mall.com/download/repo1/b/mk1/2024/12/13/b2aea548-a9a8-4dca-bba7-8d9c6134ebe3.xlsx';
|
1039
|
+
let xformImportTemplateFile = setttingConfig.xformImportTemplateFile || defaultUrl;
|
1040
|
+
if (!xformImportTemplateFile) return;
|
1041
|
+
this.$commonFileUtil.downloadFile(xformImportTemplateFile, "通用导入模板.xlsx");
|
1042
|
+
}
|
1043
|
+
}
|
1044
|
+
};
|
1045
|
+
</script>
|
1046
|
+
|
1047
|
+
<style>
|
1048
|
+
.icon-drag:before {
|
1049
|
+
content: '\e61d';
|
1050
|
+
}
|
1051
|
+
</style>
|