imatrix-ui 2.8.21-dw → 2.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +4 -2
- package/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +245 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +453 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +763 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +250 -0
- package/packages/super-grid/src/dynamic-input.vue +1279 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column.vue +769 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +386 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +162 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
- package/packages/super-grid/src/search-form.vue +634 -0
- package/packages/super-grid/src/search-methods.js +387 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service.js +561 -0
- package/packages/super-grid/src/super-grid.vue +2793 -0
- package/packages/super-grid/src/utils.js +763 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +132 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +91 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +4 -2
- package/src/i18n/langs/en.js +4 -2
- package/src/index.js +93 -0
- package/src/permission.js +7 -3
- package/src/plugins.js +3 -3
- package/src/router/index.js +24 -0
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +32 -4
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +247 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +296 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/form-style.scss +2 -2
- package/src/styles/theme/gray/input-style.scss +8 -0
- package/src/utils/auth-api.js +115 -0
- package/src/utils/auth.js +34 -42
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/common-util.js +34 -0
- package/src/utils/jump-page-utils.js +29 -5
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/request.js +18 -2
- package/src/utils/util.js +7 -3
- package/src/views/dsc-component/Sidebar/Item.vue +4 -4
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -20
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +16 -1
- package/src/views/login/index.vue +1 -1
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-table-column
|
|
3
|
+
:fixed="fixed"
|
|
4
|
+
:sortable="sortable"
|
|
5
|
+
:filters="filters"
|
|
6
|
+
:filter-method="filterMethod"
|
|
7
|
+
:prop="column.prop"
|
|
8
|
+
:width="getColumnWidth()"
|
|
9
|
+
:align="align"
|
|
10
|
+
:header-align="headerAlign"
|
|
11
|
+
:class-name="column.prop"
|
|
12
|
+
>
|
|
13
|
+
<template v-slot:header>
|
|
14
|
+
<span :class="{is_req: isFieldRequired()}"><span class="cell--span required__label" :title="$escapeHtml(label)" v-html="$escapeHtml(label)" /></span>
|
|
15
|
+
<i
|
|
16
|
+
v-if="isShowAdd"
|
|
17
|
+
class="el-icon-circle-plus-outline"
|
|
18
|
+
style="font-size:20px;color:#409EFF"
|
|
19
|
+
@click="createFormSubTableRow"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
<template slot-scope="scope">
|
|
23
|
+
<!--添加:key="column.prop+'_'+scope.$index"是为了解决多行是行编辑状态时新建的记录的文本框内有值的问题-->
|
|
24
|
+
<dynamic-input
|
|
25
|
+
v-if="lineEdit.editable&& isEditable && scope.row.$editing"
|
|
26
|
+
:key="column.prop+'_'+scope.$index"
|
|
27
|
+
v-model="scope.row[column.prop]"
|
|
28
|
+
:type="column.componentType"
|
|
29
|
+
:position="{
|
|
30
|
+
row:scope.$index,
|
|
31
|
+
prop:column.prop
|
|
32
|
+
}"
|
|
33
|
+
:line-edit="lineEdit"
|
|
34
|
+
:options="column.valueSet"
|
|
35
|
+
:row="scope.row"
|
|
36
|
+
:column="column"
|
|
37
|
+
:list-code="listCode"
|
|
38
|
+
:is-sql="isSql"
|
|
39
|
+
@findIndex="findIndex(scope.$index)"
|
|
40
|
+
@focus="onFocus(scope.$index)"
|
|
41
|
+
@refresData="refresData"
|
|
42
|
+
@refresPortData="refresPortData"
|
|
43
|
+
@refresPortsData="refresPortsData"
|
|
44
|
+
@refresMainTableFields="refresMainTableFields"
|
|
45
|
+
@prohibitToEdit="prohibitToEdit"
|
|
46
|
+
/>
|
|
47
|
+
<span v-else>
|
|
48
|
+
<span v-if="column.operations">
|
|
49
|
+
<span v-for="(operation,operationIndex) in column.operations" :key="operationIndex" class="cell--span">
|
|
50
|
+
<el-dropdown
|
|
51
|
+
v-if="operation.isGroup"
|
|
52
|
+
:key="operationIndex"
|
|
53
|
+
style="padding-left:10px"
|
|
54
|
+
split-button
|
|
55
|
+
:size="operation.buttons&&operation.buttons.length>0?operation.buttons[0].props.size:'small'"
|
|
56
|
+
@command="handleCommand"
|
|
57
|
+
>
|
|
58
|
+
{{ $escapeHtml(operation.label) }}
|
|
59
|
+
<template v-slot:dropdown>
|
|
60
|
+
<el-dropdown-menu>
|
|
61
|
+
<span
|
|
62
|
+
v-for="(buttonChild,buttonChildIndex) in operation.buttons"
|
|
63
|
+
:key="buttonChild.props.code + buttonChildIndex"
|
|
64
|
+
>
|
|
65
|
+
<el-dropdown-item
|
|
66
|
+
v-permission="buttonChild.props.permission"
|
|
67
|
+
:command="beforeHandleCommand(buttonChild.props.code, scope.row,scope.$index)"
|
|
68
|
+
:disabled="preventReclick"
|
|
69
|
+
>
|
|
70
|
+
{{ $escapeHtml(buttonChild.props.label?buttonChild.props.label: (buttonChild.props.code==='search'?$t('superPageMessage.searchButtonLabel'):'')) }}
|
|
71
|
+
</el-dropdown-item>
|
|
72
|
+
</span>
|
|
73
|
+
</el-dropdown-menu>
|
|
74
|
+
</template>
|
|
75
|
+
</el-dropdown>
|
|
76
|
+
<row-operation
|
|
77
|
+
v-else
|
|
78
|
+
:operation-setting="operation.props"
|
|
79
|
+
:label="operation.props.label?operation.props.label:scope.row[column.prop]"
|
|
80
|
+
:operation-index="operationIndex"
|
|
81
|
+
:entity="scope.row"
|
|
82
|
+
:editing="scope.row.$editing"
|
|
83
|
+
:column="column"
|
|
84
|
+
:row-index="scope.$index"
|
|
85
|
+
:is-show="operation.isShow"
|
|
86
|
+
:on-click="operation.onClick"
|
|
87
|
+
/>
|
|
88
|
+
</span>
|
|
89
|
+
</span>
|
|
90
|
+
<span v-else-if="customFormatValue(scope.row, column.prop, customFormat, scope.$index)" class="cell--span">
|
|
91
|
+
<component :is="column.prop + scope.$index" :row="scope.row" :entity="scope.row" :prop="column.prop" :parent="parentFormData" :row-index="scope.$index" :show-value="$escapeHtml(getLabel(scope.row,scope.$index))" :value="getCellValue(scope.row)" :select-options="column.valueSet" />
|
|
92
|
+
</span>
|
|
93
|
+
<!-- 自定义格式的时候 -->
|
|
94
|
+
<span v-else-if="columnFormatter !== undefined && columnFormatter.type !== undefined && columnFormatter.type === 'customControl' && columnFormatter.options && columnFormatter.options.format && columnFormatter.options.format !== ''" class="cell--span">
|
|
95
|
+
<!--:key="column.prop+'_'+scope.$index+'_'+currentPage" 为了解决子表分页时,新增自动跳转到下一页,第一条记录的自定义控件被复用,导致业务逻辑没执行 -->
|
|
96
|
+
<component
|
|
97
|
+
:is="columnFormatter.options.format"
|
|
98
|
+
:key="column.prop+'_'+scope.$index+'_'+currentPage"
|
|
99
|
+
:disabled="true"
|
|
100
|
+
:row="pageGridData[scope.$index]"
|
|
101
|
+
:entity="pageGridData[scope.$index]"
|
|
102
|
+
:prop="column.prop"
|
|
103
|
+
:parent="parentFormData"
|
|
104
|
+
:row-index="scope.$index"
|
|
105
|
+
:show-value="$escapeHtml(getLabel(pageGridData[scope.$index],scope.$index))"
|
|
106
|
+
:value="getCellValue(pageGridData[scope.$index])"
|
|
107
|
+
:select-options="column.valueSet"
|
|
108
|
+
:grid-data="gridData"
|
|
109
|
+
:page-grid-data="pageGridData"
|
|
110
|
+
:current-page="currentPage"
|
|
111
|
+
/></span>
|
|
112
|
+
<span v-else-if="columnFormatter !== undefined && columnFormatter.type !== undefined && columnFormatter.type === 'secretInfo'" :id="column.prop+'DomData'+scope.$index" class="cell--span">
|
|
113
|
+
<secret-info
|
|
114
|
+
:entity="scope.row"
|
|
115
|
+
:prop="column.prop"
|
|
116
|
+
:value="getCellValue(scope.row)"
|
|
117
|
+
:table-name="tableName"
|
|
118
|
+
:list-code="listCode"
|
|
119
|
+
:page-code="pageCode"
|
|
120
|
+
:list-name="listName"
|
|
121
|
+
:field-label="$escapeHtml(label)"
|
|
122
|
+
/>
|
|
123
|
+
</span>
|
|
124
|
+
<span v-else-if="isObjectProp(column.prop)">
|
|
125
|
+
<span v-if="column.componentType === 'annex'" type="primary">
|
|
126
|
+
<span v-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="$escapeHtml(getLabel(scope.row))" :style="{width:cellWidth+'px'}">
|
|
127
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
128
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
129
|
+
</span>
|
|
130
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
131
|
+
</span>
|
|
132
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">
|
|
133
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
134
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
135
|
+
</span>
|
|
136
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
137
|
+
</span>
|
|
138
|
+
</span>
|
|
139
|
+
<span v-else-if="column.formatter && column.formatter.type === 'files'" type="primary">
|
|
140
|
+
<span v-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="$escapeHtml(getLabel(scope.row))" :style="{width:cellWidth+'px'}">
|
|
141
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
142
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
143
|
+
</span>
|
|
144
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
145
|
+
|
|
146
|
+
</span>
|
|
147
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">
|
|
148
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
149
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
150
|
+
</span>
|
|
151
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
152
|
+
</span>
|
|
153
|
+
</span>
|
|
154
|
+
<el-link v-else-if="columnFormatter !== undefined && columnFormatter.type !== undefined && columnFormatter.type === 'hyperlinks' && getMyHyperLinkSetting(scope.row).visible === true" type="primary" @click="clickHyperLink(column, scope.row, listCode,scope.$index)">
|
|
155
|
+
<span v-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="getMyHyperLinkSetting(scope.row).title" :style="{width:cellWidth+'px'}">{{ getMyHyperLinkSetting(scope.row).label }}<i v-if="getMyHyperLinkSetting(scope.row).icon" :class="getMyHyperLinkSetting(scope.row).icon" /></span>
|
|
156
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">{{ getMyHyperLinkSetting(scope.row).label }}<i v-if="getMyHyperLinkSetting(scope.row).icon" :class="getMyHyperLinkSetting(scope.row).icon" /></span>
|
|
157
|
+
</el-link>
|
|
158
|
+
<span v-else-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="$escapeHtml(getLabel(scope.row))" :style="{width:cellWidth+'px'}">{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}</span>
|
|
159
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}</span>
|
|
160
|
+
</span>
|
|
161
|
+
<span v-else>
|
|
162
|
+
<span v-if="column.componentType === 'annex'|| column.componentType==='multipartUpload'" type="primary">
|
|
163
|
+
<span v-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="$escapeHtml(getLabel(scope.row))" :style="{width:cellWidth+'px'}">
|
|
164
|
+
<FsPreview
|
|
165
|
+
:label="$escapeHtml(getLabel(scope.row,scope.$index))"
|
|
166
|
+
:entity="scope.row"
|
|
167
|
+
:file-set-obj=" JSON.parse(column.fileSet)"
|
|
168
|
+
:is-sql="isSql"
|
|
169
|
+
/>
|
|
170
|
+
</span>
|
|
171
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">
|
|
172
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
173
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
174
|
+
</span>
|
|
175
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
176
|
+
</span>
|
|
177
|
+
</span>
|
|
178
|
+
<span v-else-if="column.formatter && column.formatter.type === 'files'">
|
|
179
|
+
<span v-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="$escapeHtml(getLabel(scope.row))" :style="{width:cellWidth+'px'}">
|
|
180
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
181
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
182
|
+
</span>
|
|
183
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
184
|
+
</span>
|
|
185
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">
|
|
186
|
+
<span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
|
|
187
|
+
<i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
|
|
188
|
+
</span>
|
|
189
|
+
{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
|
|
190
|
+
</span>
|
|
191
|
+
</span>
|
|
192
|
+
<el-link v-else-if="columnFormatter !== undefined && columnFormatter.type !== undefined && columnFormatter.type === 'hyperlinks' && getMyHyperLinkSetting(scope.row).visible === true" type="primary" @click="clickHyperLink(column, scope.row, listCode,scope.$index)">
|
|
193
|
+
<span v-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" class="ellipsis cell--span" :title="$escapeHtml(getMyHyperLinkSetting(scope.row).title)" :style="{width:cellWidth+'px'}">{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label) }}<i v-if="getMyHyperLinkSetting(scope.row).icon" :class="getMyHyperLinkSetting(scope.row).icon" /></span>
|
|
194
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label) }}<i v-if="getMyHyperLinkSetting(scope.row).icon" :class="getMyHyperLinkSetting(scope.row).icon" /></span>
|
|
195
|
+
</el-link>
|
|
196
|
+
<span v-else-if="column.formatter && column.formatter.type === 'richEditor'">
|
|
197
|
+
<el-tooltip :content="$t('superGrid.show')" class="item" effect="dark" placement="top">
|
|
198
|
+
<em class="fa fa-info-circle annex-cell" @click="showRichEditorContent(scope.row,column,getHeader())" />
|
|
199
|
+
</el-tooltip>
|
|
200
|
+
</span>
|
|
201
|
+
<span v-else-if="isShowOverflowTooltip" :id="column.prop+'DomData'+scope.$index" :title="getLabel(scope.row)" :style="{width:cellWidth+'px'}" style="white-space: pre;" class="ellipsis cell--span" v-html="$escapeHtml(getLabel(scope.row,scope.$index)) " />
|
|
202
|
+
<span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">{{ $escapeHtml(getLabel(scope.row,scope.$index)) }}</span>
|
|
203
|
+
</span>
|
|
204
|
+
</span>
|
|
205
|
+
</template>
|
|
206
|
+
<view-image-dialog
|
|
207
|
+
v-if="showSingleImgFlag"
|
|
208
|
+
:file-list="fileList"
|
|
209
|
+
@close="showSingleImgFlag = false"
|
|
210
|
+
/>
|
|
211
|
+
<rich-editor-viewer v-if="showRichEditorViewer" ref="richEditorViewerRef" @closeRichEditorContent="closeRichEditorContent" />
|
|
212
|
+
</el-table-column>
|
|
213
|
+
</template>
|
|
214
|
+
<script>
|
|
215
|
+
import { getColumnValues, isRequiredEdit } from './utils'
|
|
216
|
+
import DynamicInput from './dynamic-input'
|
|
217
|
+
import store from './store'
|
|
218
|
+
import { ArrowKeyAction, isHasEditOption, getFileList } from './utils'
|
|
219
|
+
import { doFormatWithValueSet } from './formatter'
|
|
220
|
+
import customFormatter from './custom-formatter'
|
|
221
|
+
import RowOperation from './row-operation'
|
|
222
|
+
import apis from './apis'
|
|
223
|
+
import { mapGetters } from 'vuex'
|
|
224
|
+
import { getEntityFieldValue, getParentObjectUtil } from '../../../src/utils/util'
|
|
225
|
+
import ViewImageDialog from './view-image-dialog.vue'
|
|
226
|
+
import eventBus from './eventBus'
|
|
227
|
+
import { isDynamicDataSourceSource } from './utils'
|
|
228
|
+
import FsPreview from '../../fs-preview'
|
|
229
|
+
import RichEditorViewer from '../../rich-editor/viewer.vue'
|
|
230
|
+
export default {
|
|
231
|
+
name: 'NormalColumn',
|
|
232
|
+
components: {
|
|
233
|
+
DynamicInput,
|
|
234
|
+
RowOperation,
|
|
235
|
+
ViewImageDialog,
|
|
236
|
+
FsPreview,
|
|
237
|
+
RichEditorViewer
|
|
238
|
+
},
|
|
239
|
+
props: {
|
|
240
|
+
column: {
|
|
241
|
+
type: Object,
|
|
242
|
+
default: null
|
|
243
|
+
},
|
|
244
|
+
customFormat: {
|
|
245
|
+
type: Function,
|
|
246
|
+
default: null
|
|
247
|
+
},
|
|
248
|
+
listCode: {
|
|
249
|
+
type: String,
|
|
250
|
+
default: null
|
|
251
|
+
},
|
|
252
|
+
isSql: {
|
|
253
|
+
type: Boolean,
|
|
254
|
+
default: false
|
|
255
|
+
},
|
|
256
|
+
newWidth: {
|
|
257
|
+
type: Number,
|
|
258
|
+
default: null
|
|
259
|
+
},
|
|
260
|
+
dragColumnProp: {
|
|
261
|
+
type: String,
|
|
262
|
+
default: null
|
|
263
|
+
},
|
|
264
|
+
tableName: {
|
|
265
|
+
type: String,
|
|
266
|
+
default: null
|
|
267
|
+
},
|
|
268
|
+
pageCode: {
|
|
269
|
+
type: String,
|
|
270
|
+
default: null
|
|
271
|
+
},
|
|
272
|
+
listName: {
|
|
273
|
+
type: String,
|
|
274
|
+
default: null
|
|
275
|
+
},
|
|
276
|
+
currentPage: {
|
|
277
|
+
type: Number,
|
|
278
|
+
default: 1
|
|
279
|
+
},
|
|
280
|
+
gridData: {
|
|
281
|
+
type: Array,
|
|
282
|
+
default: null
|
|
283
|
+
},
|
|
284
|
+
pageGridData: {
|
|
285
|
+
type: Array,
|
|
286
|
+
default: null
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
data() {
|
|
290
|
+
let parentFormData
|
|
291
|
+
const gridParams = store.get(this.listCode)
|
|
292
|
+
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
293
|
+
parentFormData = gridParams.options.extraParam.entityMap
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
selectRow: null,
|
|
297
|
+
that: this,
|
|
298
|
+
align: 'left', // 文本内容对齐
|
|
299
|
+
headerAlign: 'left', // 表头对齐方式
|
|
300
|
+
columnFormatter: this.column.formatter,
|
|
301
|
+
hyperLinks: {},
|
|
302
|
+
fileDownType: '',
|
|
303
|
+
isFormSubTable: false, // 是否是表单子表
|
|
304
|
+
subTableCanAdd: true, // 表单子表时是否有新增权限
|
|
305
|
+
isShowAdd: false, // 是否显示表头的新增按钮
|
|
306
|
+
cellWidth: null,
|
|
307
|
+
parentFormData,
|
|
308
|
+
fileMultiple: false, // 附件上传是否多选
|
|
309
|
+
showSingleImgFlag: false,
|
|
310
|
+
singleImgSrc: '',
|
|
311
|
+
fileList: [],
|
|
312
|
+
index: null,
|
|
313
|
+
isEditable: this.column.editable,
|
|
314
|
+
showRichEditorViewer: false
|
|
315
|
+
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
computed: {
|
|
319
|
+
filters() {
|
|
320
|
+
if (this.column.filterable) {
|
|
321
|
+
const gridParams = store.get(this.listCode)
|
|
322
|
+
const values = getColumnValues(gridParams.gridData, this.column.prop)
|
|
323
|
+
const filters = []
|
|
324
|
+
for (const value of values) {
|
|
325
|
+
filters.push({
|
|
326
|
+
text: value,
|
|
327
|
+
value
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
return filters
|
|
331
|
+
} else {
|
|
332
|
+
return null
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
filterMethod() {
|
|
336
|
+
if (this.column.filterable) {
|
|
337
|
+
return this.filterHandler
|
|
338
|
+
} else {
|
|
339
|
+
return null
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
fixed() {
|
|
343
|
+
if ((this.column.fixed && this.column.fixed === 'false') || this.column.fixed === undefined || this.column.fixed === '') {
|
|
344
|
+
return false
|
|
345
|
+
}
|
|
346
|
+
if (this.column.prop === 'operation' && this.column.fixed && this.column.fixed === 'left') {
|
|
347
|
+
// 操作列居右固定
|
|
348
|
+
return 'right'
|
|
349
|
+
}
|
|
350
|
+
return this.column.fixed
|
|
351
|
+
},
|
|
352
|
+
sortable() {
|
|
353
|
+
const gridParams = store.get(this.listCode)
|
|
354
|
+
if (gridParams && gridParams.options && gridParams.options.isFormSubTable && gridParams.options.showOperationButton) {
|
|
355
|
+
return false
|
|
356
|
+
}
|
|
357
|
+
if (this.column.sortable === 'false' || this.column.sortable === false || this.column.sortable === '') {
|
|
358
|
+
return false
|
|
359
|
+
} else if (this.column.sortable === 'true' || this.column.sortable === true) {
|
|
360
|
+
return 'custom'
|
|
361
|
+
}
|
|
362
|
+
if (this.column.sortable) {
|
|
363
|
+
return 'custom'
|
|
364
|
+
} else {
|
|
365
|
+
return false
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
lineEdit() {
|
|
369
|
+
let isLineEdit = false
|
|
370
|
+
if (this.listCode) {
|
|
371
|
+
const gridParams = store.get(this.listCode)
|
|
372
|
+
if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
|
|
373
|
+
isLineEdit = gridParams.lineEdit
|
|
374
|
+
} else {
|
|
375
|
+
isLineEdit = false
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return isLineEdit
|
|
379
|
+
},
|
|
380
|
+
|
|
381
|
+
...mapGetters([
|
|
382
|
+
'preventReclick'
|
|
383
|
+
])
|
|
384
|
+
},
|
|
385
|
+
watch: {
|
|
386
|
+
isSql: {
|
|
387
|
+
handler(newValue, oldValue) {
|
|
388
|
+
this.isSql = newValue
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
newWidth: {
|
|
392
|
+
handler(newValue, oldValue) {
|
|
393
|
+
if (newValue !== undefined && newValue !== null && this.dragColumnProp && this.dragColumnProp === this.column.prop) {
|
|
394
|
+
this.cellWidth = newValue
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
created() {
|
|
400
|
+
if (this.column.width) {
|
|
401
|
+
this.cellWidth = this.column.width - 10
|
|
402
|
+
}
|
|
403
|
+
const gridParams = store.get(this.listCode)
|
|
404
|
+
if (gridParams && gridParams.options && gridParams.options.isFormSubTable) {
|
|
405
|
+
this.isFormSubTable = gridParams.options.isFormSubTable
|
|
406
|
+
}
|
|
407
|
+
if (gridParams && gridParams.options && gridParams.options.subTableCanAdd !== undefined && gridParams.options.subTableCanAdd !== null) {
|
|
408
|
+
this.subTableCanAdd = gridParams.options.subTableCanAdd
|
|
409
|
+
}
|
|
410
|
+
if (this.column.prop && this.column.prop === 'operation') {
|
|
411
|
+
// 如果是操作列按钮则不显示省略号
|
|
412
|
+
this.isShowOverflowTooltip = false
|
|
413
|
+
} else {
|
|
414
|
+
if (typeof (gridParams.options.showOverflowTooltip) !== 'undefined' && gridParams.options.showOverflowTooltip === false) {
|
|
415
|
+
this.isShowOverflowTooltip = false
|
|
416
|
+
} else {
|
|
417
|
+
this.isShowOverflowTooltip = true
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (typeof (gridParams.options.align) !== 'undefined') {
|
|
421
|
+
this.align = gridParams.options.align
|
|
422
|
+
} else if (this.column.contAlign && this.column.contAlign !== '') {
|
|
423
|
+
this.align = this.column.contAlign
|
|
424
|
+
}
|
|
425
|
+
if (typeof (gridParams.options.headerAlign) !== 'undefined') {
|
|
426
|
+
this.headerAlign = gridParams.options.headerAlign
|
|
427
|
+
} else if (this.column.titleAlign && this.column.titleAlign !== '') {
|
|
428
|
+
this.headerAlign = this.column.titleAlign
|
|
429
|
+
} else {
|
|
430
|
+
// 如果没有配置表头对齐方式,默认使用内容对齐方式
|
|
431
|
+
this.headerAlign = 'left'
|
|
432
|
+
}
|
|
433
|
+
if (gridParams.isHasDynamic === undefined && this.column.dynamic !== undefined && this.column.dynamic === true) {
|
|
434
|
+
// 当前列表中有动态列
|
|
435
|
+
gridParams.isHasDynamic = true
|
|
436
|
+
}
|
|
437
|
+
this.label = this.getHeader()
|
|
438
|
+
if (this.column.operations) {
|
|
439
|
+
// console.log('this.column.operations', this.column.operations)
|
|
440
|
+
}
|
|
441
|
+
// console.log('gridParams.options.subTableCanAdd=', gridParams.options.subTableCanAdd, 'this.subTableCanAdd=', this.subTableCanAdd)
|
|
442
|
+
this.isShowAdd = this.isFormSubTable && this.column.prop === 'operation' && this.subTableCanAdd && gridParams.options && gridParams.options.showOperationButton
|
|
443
|
+
if (this.column.fileSet && this.column.fileSet !== '' && this.column.componentType === 'annex') {
|
|
444
|
+
const fileSetObj = JSON.parse(this.column.fileSet)
|
|
445
|
+
if (fileSetObj && fileSetObj.multiple) {
|
|
446
|
+
this.fileMultiple = true
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
mounted() {
|
|
451
|
+
// 监听保存时点击按钮事件线触发
|
|
452
|
+
eventBus.$on('un-edit', (param) => {
|
|
453
|
+
// 处理多选选项组问题保存问题
|
|
454
|
+
if (this.column.componentType && (this.column.componentType === 'multiselect' || this.column.componentType === 'select')) {
|
|
455
|
+
const isDynamic = isDynamicDataSourceSource(this.column)
|
|
456
|
+
if (!isDynamic) {
|
|
457
|
+
// 选项组保存时将数组处理为字符串
|
|
458
|
+
const beforeColumnValue = param.row[this.column.prop]
|
|
459
|
+
if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
|
|
460
|
+
// 如果是数组才需要转换
|
|
461
|
+
this.$set(param.row, this.column.prop, beforeColumnValue.join(','))
|
|
462
|
+
}
|
|
463
|
+
} else {
|
|
464
|
+
// 动态数据源多选保存时,获取已选择的字段,由于多选选项组的值是数组,保存时要拼接成“ ,” 分隔的字符串
|
|
465
|
+
if ('_dynamic-source-data-' + this.column.prop in this.column) {
|
|
466
|
+
const temp = this.column['_dynamic-source-data-' + this.column.prop]
|
|
467
|
+
const valueSetOptions = temp.valueSetOptions
|
|
468
|
+
// 获取当前字段对应在映射关系中对应的是选项组中的哪一个key
|
|
469
|
+
let selectDataKey
|
|
470
|
+
for (let i = 0; i < valueSetOptions.length; i++) {
|
|
471
|
+
const valueSetOption = valueSetOptions[i]
|
|
472
|
+
if (this.column.prop === valueSetOption.valueColumn.dbColumnName) {
|
|
473
|
+
selectDataKey = valueSetOption.columnName
|
|
474
|
+
break
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (selectDataKey) {
|
|
478
|
+
// beforeColumnValue是数组值,如果是单选则是字符串
|
|
479
|
+
const beforeColumnValue = param.row[this.column.prop]
|
|
480
|
+
if (this.column.componentType === 'select') {
|
|
481
|
+
// 如果是单选
|
|
482
|
+
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
483
|
+
// temp.optionItems.forEach(optionItem => {
|
|
484
|
+
// if (optionItem[temp.valueAttribute] === beforeColumnValue) {
|
|
485
|
+
// this.$set(param.row, this.column.prop, optionItem[selectDataKey])
|
|
486
|
+
// }
|
|
487
|
+
// })
|
|
488
|
+
this.$set(param.row, this.column.prop, beforeColumnValue)
|
|
489
|
+
} else {
|
|
490
|
+
// 如果是多选,join “ ,” , 并给row赋值
|
|
491
|
+
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
492
|
+
// const afterColumnValue = []
|
|
493
|
+
// temp.optionItems.forEach(optionItem => {
|
|
494
|
+
// beforeColumnValue.forEach(value => {
|
|
495
|
+
// if (optionItem[temp.valueAttribute] === value) {
|
|
496
|
+
// afterColumnValue.push(optionItem[selectDataKey])
|
|
497
|
+
// }
|
|
498
|
+
// })
|
|
499
|
+
// })
|
|
500
|
+
this.$set(param.row, this.column.prop, beforeColumnValue.join(','))
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} else {
|
|
504
|
+
const beforeColumnValue = param.row[this.column.prop]
|
|
505
|
+
if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
|
|
506
|
+
// 如果是数组才需要转换
|
|
507
|
+
this.$set(param.row, this.column.prop, beforeColumnValue.join(','))
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
},
|
|
514
|
+
destroyed() {
|
|
515
|
+
eventBus.$off('un-edit')
|
|
516
|
+
},
|
|
517
|
+
methods: {
|
|
518
|
+
...customFormatter,
|
|
519
|
+
...apis,
|
|
520
|
+
getHeader() {
|
|
521
|
+
if (!this.column.titleValueSet) {
|
|
522
|
+
return this.column.label.replace(/\\n/g, '</br>')
|
|
523
|
+
} else {
|
|
524
|
+
return this.formatHeader()
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
formatHeader() {
|
|
528
|
+
return doFormatWithValueSet(this.column.titleValueSetValue, this.column.label)
|
|
529
|
+
},
|
|
530
|
+
filterHandler(value, row, column) {
|
|
531
|
+
const property = column['property']
|
|
532
|
+
return row[property] === value
|
|
533
|
+
},
|
|
534
|
+
onFocus(index) {
|
|
535
|
+
const gridParams = store.get(this.listCode)
|
|
536
|
+
if (gridParams.lineEdit.editingCell) {
|
|
537
|
+
gridParams.lineEdit.editingCell.row = index
|
|
538
|
+
gridParams.lineEdit.editingCell.prop = this.column.prop
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
findIndex(index) {
|
|
542
|
+
this.index = index
|
|
543
|
+
const gridParams = store.get(this.listCode)
|
|
544
|
+
if (gridParams.lineEdit.editingCell) {
|
|
545
|
+
gridParams.lineEdit.editingCell.row = index
|
|
546
|
+
gridParams.lineEdit.editingCell.prop = this.column.prop
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
refresData(data) {
|
|
550
|
+
this.$emit('refresData', data)
|
|
551
|
+
},
|
|
552
|
+
refresPortData(port, value) {
|
|
553
|
+
const gridParams = store.get(this.listCode)
|
|
554
|
+
console.log('gridParams', gridParams)
|
|
555
|
+
console.log('this.index', this.index)
|
|
556
|
+
if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editingCell) {
|
|
557
|
+
this.$emit('refresPortData', port, value, gridParams.lineEdit.editingCell.row)
|
|
558
|
+
} else {
|
|
559
|
+
this.$emit('refresPortData', port, value, this.index)
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
refresPortsData(map) {
|
|
563
|
+
const gridParams = store.get(this.listCode)
|
|
564
|
+
console.log('gridParams', gridParams)
|
|
565
|
+
console.log('this.index', this.index)
|
|
566
|
+
if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editingCell) {
|
|
567
|
+
this.$emit('refresPortsData', map, gridParams.lineEdit.editingCell.row)
|
|
568
|
+
} else {
|
|
569
|
+
this.$emit('refresPortsData', map, this.index)
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
refresMainTableFields(map) {
|
|
573
|
+
this.$emit('refresMainTableFields', map)
|
|
574
|
+
},
|
|
575
|
+
// @keyup.native.left="move('left')"
|
|
576
|
+
// @keyup.native.right="move('right')"
|
|
577
|
+
// @keyup.native.up="move('up')"
|
|
578
|
+
// @keyup.native.down="move('down')"
|
|
579
|
+
move(direction) {
|
|
580
|
+
if (direction === 'left') {
|
|
581
|
+
const prop = ArrowKeyAction.getLeftColumn(this.column.prop)
|
|
582
|
+
const gridParams = store.get(this.listCode)
|
|
583
|
+
gridParams.lineEdit.editingCell.prop = prop
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
// filterHandler(value, row, column) {
|
|
587
|
+
// const property = column['property']
|
|
588
|
+
// return row[property] === value
|
|
589
|
+
// },
|
|
590
|
+
isSaveByEnter() {
|
|
591
|
+
const gridParams = store.get(this.listCode)
|
|
592
|
+
return typeof (gridParams.options.lineEditOptions.isSaveByEnter) === 'undefined' || (isHasEditOption('isSaveByEnter', this.listCode) && gridParams.options.lineEditOptions.isSaveByEnter === true)
|
|
593
|
+
},
|
|
594
|
+
isRestoreByEsc() {
|
|
595
|
+
const gridParams = store.get(this.listCode)
|
|
596
|
+
return typeof (gridParams.options.lineEditOptions.isRestoreByEsc) === 'undefined' || (isHasEditOption('isRestoreByEsc', this.listCode) && gridParams.options.lineEditOptions.isRestoreByEsc === true)
|
|
597
|
+
},
|
|
598
|
+
canFocus(index) {
|
|
599
|
+
const gridParams = store.get(this.listCode)
|
|
600
|
+
if (index === gridParams.lineEdit.editingCell.row && this.column.prop === gridParams.lineEdit.editingCell.prop) {
|
|
601
|
+
return true
|
|
602
|
+
} else {
|
|
603
|
+
return false
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
getLabel(row, index) {
|
|
607
|
+
// const get1 = new Date().getTime()
|
|
608
|
+
this.transferColumnDataToUpperCase(row)
|
|
609
|
+
const obj = this.objectPropValueTwo(row, this.column)
|
|
610
|
+
// // 存储执行时间
|
|
611
|
+
// const get2 = new Date().getTime()
|
|
612
|
+
// const get3 = Number(get2) - Number(get1)
|
|
613
|
+
// if (!sessionStorage.getItem('getLabel')) {
|
|
614
|
+
// sessionStorage.setItem('getLabel', get3)
|
|
615
|
+
// } else {
|
|
616
|
+
// const get4 = sessionStorage.getItem('getLabel')
|
|
617
|
+
// const get5 = Number(get4) + Number(get3)
|
|
618
|
+
// sessionStorage.setItem('getLabel', get5)
|
|
619
|
+
// }
|
|
620
|
+
return obj
|
|
621
|
+
// const returnValue = this.objectPropValueTwo(row, this.column)
|
|
622
|
+
// if (returnValue) {
|
|
623
|
+
// // 解决当文本中有多个空格时候, vue自动将多个空格合并为一个空格,
|
|
624
|
+
// // 或者修改vue的配置 https://cn.vuejs.org/api/application.html#app-config-compileroptions app.config.compilerOptions.whitespace
|
|
625
|
+
// return returnValue.replaceAll(' ', '\u00A0')
|
|
626
|
+
// }
|
|
627
|
+
// return returnValue
|
|
628
|
+
},
|
|
629
|
+
getCellValue(row) {
|
|
630
|
+
let cellValue = getEntityFieldValue(row, this.column.prop, false)
|
|
631
|
+
if (cellValue === undefined || cellValue === null) {
|
|
632
|
+
this.transferColumnDataToUpperCase(row)
|
|
633
|
+
cellValue = getEntityFieldValue(row, this.column.prop, false)
|
|
634
|
+
}
|
|
635
|
+
return cellValue
|
|
636
|
+
},
|
|
637
|
+
// 兼容oracle和mysql数据库,oracle是字段名是大写的,mysql是小写的,将小写转为大写
|
|
638
|
+
transferColumnDataToUpperCase(row) {
|
|
639
|
+
const reg1 = /[A-Z]+/ // 大写字母
|
|
640
|
+
if (this.isSql && reg1.test(this.column.prop)) {
|
|
641
|
+
this.transferColumnDataToUpperCaseWithProp(row, this.column.prop.toLowerCase(), this.column.prop)
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
transferColumnDataToUpperCaseWithProp(row, propLowerCase, columnProp) {
|
|
645
|
+
let dataModel
|
|
646
|
+
if (propLowerCase && propLowerCase.indexOf('.') > 0) {
|
|
647
|
+
const parentObj = getParentObjectUtil(propLowerCase, row)
|
|
648
|
+
const prop = propLowerCase.substring(propLowerCase.lastIndexOf('.') + 1)
|
|
649
|
+
dataModel = parentObj[prop]
|
|
650
|
+
if (dataModel !== undefined) {
|
|
651
|
+
// sql字段名小写转大写,兼容mysql、oracle数据库
|
|
652
|
+
parentObj[columnProp] = dataModel
|
|
653
|
+
delete parentObj[prop]
|
|
654
|
+
}
|
|
655
|
+
} else {
|
|
656
|
+
dataModel = row[propLowerCase]
|
|
657
|
+
if (dataModel !== undefined) {
|
|
658
|
+
// sql字段名小写转大写,兼容mysql、oracle数据库
|
|
659
|
+
row[columnProp] = dataModel
|
|
660
|
+
delete row[propLowerCase]
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
return dataModel
|
|
664
|
+
},
|
|
665
|
+
getMyHyperLinkSetting(row) {
|
|
666
|
+
// const get1 = new Date().getTime()
|
|
667
|
+
this.transferColumnDataToUpperCase(row)
|
|
668
|
+
const gridParams = store.get(this.listCode)
|
|
669
|
+
let tableName
|
|
670
|
+
if (gridParams && gridParams.basicInfo && gridParams.basicInfo.tableName) {
|
|
671
|
+
tableName = gridParams.basicInfo.tableName
|
|
672
|
+
}
|
|
673
|
+
const hyperLinkResult = this.getHyperLinkSetting(this.column, row, this.isSql, gridParams.additionalParamMap, gridParams.contextParameter, tableName, this.listCode)
|
|
674
|
+
hyperLinkResult.icon = this.getHyperIconClass(hyperLinkResult)
|
|
675
|
+
// // 存储执行时间
|
|
676
|
+
// const get2 = new Date().getTime()
|
|
677
|
+
// const get3 = Number(get2) - Number(get1)
|
|
678
|
+
// if (!sessionStorage.getItem('getMyHyperLinkSetting')) {
|
|
679
|
+
// sessionStorage.setItem('getMyHyperLinkSetting', get3)
|
|
680
|
+
// } else {
|
|
681
|
+
// const get4 = sessionStorage.getItem('getMyHyperLinkSetting')
|
|
682
|
+
// const get5 = Number(get4) + Number(get3)
|
|
683
|
+
// sessionStorage.setItem('getMyHyperLinkSetting', get5)
|
|
684
|
+
// }
|
|
685
|
+
return hyperLinkResult
|
|
686
|
+
},
|
|
687
|
+
getHyperIconClass(hyperLinkResult) {
|
|
688
|
+
let iconName
|
|
689
|
+
if (hyperLinkResult && hyperLinkResult !== null && hyperLinkResult.icon && hyperLinkResult.icon !== '') {
|
|
690
|
+
iconName = hyperLinkResult.icon
|
|
691
|
+
}
|
|
692
|
+
if (iconName && iconName.indexOf('fa-') === 0) {
|
|
693
|
+
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
694
|
+
iconName = 'fa ' + iconName
|
|
695
|
+
}
|
|
696
|
+
return iconName
|
|
697
|
+
},
|
|
698
|
+
createFormSubTableRow() {
|
|
699
|
+
console.log('触发了行新建')
|
|
700
|
+
this.createRow(this.listCode)
|
|
701
|
+
},
|
|
702
|
+
handleCommand(comman) {
|
|
703
|
+
let prop = null
|
|
704
|
+
this.column.operations.forEach(item => {
|
|
705
|
+
if (item.isGroup) {
|
|
706
|
+
item.buttons.forEach(button => {
|
|
707
|
+
if (button.props.code === comman.comman) {
|
|
708
|
+
prop = button
|
|
709
|
+
}
|
|
710
|
+
})
|
|
711
|
+
}
|
|
712
|
+
})
|
|
713
|
+
if (prop) {
|
|
714
|
+
customFormatter.onClickFun(comman.row, this.column, prop.onClick, comman.rowIndex)
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
beforeHandleCommand(comman, row, rowIndex) {
|
|
718
|
+
return {
|
|
719
|
+
comman: comman,
|
|
720
|
+
row: row,
|
|
721
|
+
rowIndex: rowIndex
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
previewImg(row) {
|
|
725
|
+
this.fileList = getFileList(row, this.column, this.isSql)
|
|
726
|
+
this.showSingleImgFlag = true
|
|
727
|
+
},
|
|
728
|
+
getFileList(row) {
|
|
729
|
+
return getFileList(row, this.column, this.isSql)
|
|
730
|
+
},
|
|
731
|
+
getColumnWidth() {
|
|
732
|
+
if (this.column && this.column.prop === 'operation' && !this.column.width) {
|
|
733
|
+
// 表示操作列,宽度固定
|
|
734
|
+
return '210'
|
|
735
|
+
}
|
|
736
|
+
return this.column.width ? this.column.width + '' : '130'
|
|
737
|
+
},
|
|
738
|
+
// 设置字段禁止编辑
|
|
739
|
+
fnProhibitToEdit(isEditable) {
|
|
740
|
+
this.isEditable = isEditable
|
|
741
|
+
},
|
|
742
|
+
// 设置字段禁止编辑
|
|
743
|
+
prohibitToEdit(entity) {
|
|
744
|
+
this.$emit('prohibitToEdit', entity)
|
|
745
|
+
},
|
|
746
|
+
isFieldRequired() {
|
|
747
|
+
return isRequiredEdit(this.column.prop, this.listCode)
|
|
748
|
+
// return true
|
|
749
|
+
},
|
|
750
|
+
// 展示富文本内容
|
|
751
|
+
showRichEditorContent(row, column, header) {
|
|
752
|
+
this.showRichEditorViewer = true
|
|
753
|
+
this.$nextTick(() => {
|
|
754
|
+
this.$refs.richEditorViewerRef.showContent(row[column.prop], header)
|
|
755
|
+
})
|
|
756
|
+
},
|
|
757
|
+
closeRichEditorContent() {
|
|
758
|
+
this.showRichEditorViewer = false
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
</script>
|
|
763
|
+
<style lang="scss" scoped>
|
|
764
|
+
.annex-cell {
|
|
765
|
+
padding-right:5px;
|
|
766
|
+
cursor:pointer;
|
|
767
|
+
color:#409EFF;
|
|
768
|
+
}
|
|
769
|
+
</style>
|