imatrix-ui 2.8.21 → 2.8.22-boe1

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.
Files changed (176) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -5
  3. package/package.json +2 -2
  4. package/src/api/sso-service.js +19 -1
  5. package/src/i18n/langs/cn.js +13 -3
  6. package/src/i18n/langs/en.js +15 -4
  7. package/src/router/index.js +10 -0
  8. package/src/store/modules/tab-content.js +6 -0
  9. package/src/store/modules/user.js +19 -0
  10. package/src/styles/index.scss +72 -2
  11. package/src/styles/theme/black/font-style.scss +70 -0
  12. package/src/styles/theme/black/index.scss +6 -30
  13. package/src/styles/theme/blue/font-style.scss +37 -0
  14. package/src/styles/theme/blue/index.scss +2 -18
  15. package/src/styles/theme/blue2/font-style.scss +70 -0
  16. package/src/styles/theme/blue2/index.scss +3 -13
  17. package/src/styles/theme/dark-blue/index.scss +26 -5
  18. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  19. package/src/styles/theme/dark-blue/table.scss +1 -1
  20. package/src/styles/theme/gray/card-style.scss +13 -1
  21. package/src/styles/theme/gray/font-style.scss +38 -0
  22. package/src/styles/theme/gray/index.scss +13 -25
  23. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  24. package/src/styles/theme/gray/sidebar.scss +5 -0
  25. package/src/utils/auth-api.js +45 -1
  26. package/src/utils/common-util.js +11 -0
  27. package/src/utils/range-selector.js +185 -0
  28. package/src/utils/request.js +5 -2
  29. package/src/utils/util.js +7 -5
  30. package/src/views/dsc-component/Sidebar/Item.vue +4 -2
  31. package/src/views/dsc-component/Sidebar/SidebarItem.vue +1 -2
  32. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  33. package/src/views/dsc-component/tabs/tab-content.vue +1 -5
  34. package/src/views/layout/NewLayout.vue +6 -65
  35. package/src/views/layout/components/Menubar/Item.vue +23 -7
  36. package/src/views/layout/components/Menubar/Link.vue +11 -2
  37. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  38. package/src/views/layout/components/Menubar/index.vue +51 -16
  39. package/src/views/layout/components/tabs/tab-content.vue +160 -0
  40. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  41. package/src/views/layout/tab-content-index.vue +85 -0
  42. package/packages/breadcrumb/index.js +0 -6
  43. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  44. package/packages/department-tree/index.js +0 -6
  45. package/packages/department-tree/src/department-tree.vue +0 -108
  46. package/packages/department-tree-inline/index.js +0 -6
  47. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  48. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  49. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  50. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  51. package/packages/department-tree-inline/src/search-result.vue +0 -176
  52. package/packages/department-user-tree/index.js +0 -6
  53. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  54. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  55. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  56. package/packages/department-user-tree-inline/index.js +0 -6
  57. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  58. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  59. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  60. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  61. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  62. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  63. package/packages/directives/prevent-reclick.js +0 -19
  64. package/packages/dynamic-source-select/index.js +0 -6
  65. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  66. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  67. package/packages/dynamic-source-select/src/events.js +0 -55
  68. package/packages/fs-preview/index.js +0 -6
  69. package/packages/fs-preview/src/fs-preview.vue +0 -226
  70. package/packages/fs-upload/index.js +0 -6
  71. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  72. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  73. package/packages/fs-upload/src/fs-upload.vue +0 -189
  74. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  75. package/packages/fs-upload-list/index.js +0 -6
  76. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  77. package/packages/hamburger/index.js +0 -6
  78. package/packages/hamburger/src/hamburger.vue +0 -38
  79. package/packages/index.js +0 -121
  80. package/packages/multipart-upload/index.js +0 -6
  81. package/packages/multipart-upload/src/index.vue +0 -73
  82. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  83. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  84. package/packages/organization-input/index.js +0 -6
  85. package/packages/organization-input/src/organization-input.vue +0 -542
  86. package/packages/plugins/export-data-new.js +0 -453
  87. package/packages/plugins/export-data.js +0 -361
  88. package/packages/plugins/index.js +0 -15
  89. package/packages/plugins/public-method.js +0 -43
  90. package/packages/remove-department/index.js +0 -6
  91. package/packages/remove-department/src/remove-department.vue +0 -172
  92. package/packages/remove-department/src/remove-dept-service.js +0 -20
  93. package/packages/remove-user/index.js +0 -6
  94. package/packages/remove-user/src/remove-user-service.js +0 -20
  95. package/packages/remove-user/src/remove-user.vue +0 -195
  96. package/packages/remove-workgroup/index.js +0 -6
  97. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  98. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  99. package/packages/rich-editor/index.js +0 -7
  100. package/packages/rich-editor/index.vue +0 -278
  101. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  102. package/packages/rich-editor/viewer.vue +0 -103
  103. package/packages/scan-code-input/index.js +0 -6
  104. package/packages/scan-code-input/src/events.js +0 -33
  105. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  106. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  107. package/packages/secret-info/index.js +0 -7
  108. package/packages/secret-info/index.vue +0 -90
  109. package/packages/super-grid/index.js +0 -7
  110. package/packages/super-grid/src/apis.js +0 -763
  111. package/packages/super-grid/src/columns-config.vue +0 -335
  112. package/packages/super-grid/src/custom-formatter.js +0 -250
  113. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  114. package/packages/super-grid/src/eventBus.js +0 -2
  115. package/packages/super-grid/src/events.js +0 -55
  116. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  117. package/packages/super-grid/src/formatter.js +0 -181
  118. package/packages/super-grid/src/group-column.vue +0 -100
  119. package/packages/super-grid/src/header-context-menu.vue +0 -87
  120. package/packages/super-grid/src/index-column.vue +0 -51
  121. package/packages/super-grid/src/normal-column.vue +0 -769
  122. package/packages/super-grid/src/public-methods.js +0 -31
  123. package/packages/super-grid/src/row-operation.vue +0 -161
  124. package/packages/super-grid/src/search-button.vue +0 -66
  125. package/packages/super-grid/src/search-condition-input.vue +0 -61
  126. package/packages/super-grid/src/search-condition-list.vue +0 -59
  127. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  128. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  129. package/packages/super-grid/src/search-form-item.vue +0 -386
  130. package/packages/super-grid/src/search-form-number.vue +0 -38
  131. package/packages/super-grid/src/search-form-open.vue +0 -162
  132. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  133. package/packages/super-grid/src/search-form.vue +0 -634
  134. package/packages/super-grid/src/search-methods.js +0 -387
  135. package/packages/super-grid/src/selection-column.vue +0 -43
  136. package/packages/super-grid/src/store.js +0 -3
  137. package/packages/super-grid/src/super-grid-service.js +0 -561
  138. package/packages/super-grid/src/super-grid.vue +0 -2793
  139. package/packages/super-grid/src/utils.js +0 -763
  140. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  141. package/packages/super-nine-grid/index.js +0 -7
  142. package/packages/super-nine-grid/src/apis.js +0 -103
  143. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  144. package/packages/super-nine-grid/src/formatter.js +0 -132
  145. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  146. package/packages/super-nine-grid/src/search-form.vue +0 -430
  147. package/packages/super-nine-grid/src/search-methods.js +0 -134
  148. package/packages/super-nine-grid/src/store.js +0 -3
  149. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  150. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  151. package/packages/super-nine-grid/src/utils.js +0 -261
  152. package/packages/svg-icon/index.js +0 -6
  153. package/packages/svg-icon/src/svg-icon.vue +0 -43
  154. package/packages/utils/utils.js +0 -152
  155. package/packages/utils/value-set.js +0 -86
  156. package/packages/valid-code/index.js +0 -7
  157. package/packages/valid-code/src/valid-code.vue +0 -95
  158. package/packages/workflow-button/index.js +0 -6
  159. package/packages/workflow-button/src/workflow-button.vue +0 -325
  160. package/packages/workflow-history-list/index.js +0 -6
  161. package/packages/workflow-history-list/src/api.js +0 -7
  162. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  163. package/packages/workgroup-tree/index.js +0 -6
  164. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  165. package/packages/workgroup-tree-inline/index.js +0 -6
  166. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  167. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  168. package/packages/workgroup-user-tree/index.js +0 -6
  169. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  170. package/packages/workgroup-user-tree-inline/index.js +0 -6
  171. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  172. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  173. package/packages/year-range-picker/index.js +0 -6
  174. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  175. package/src/index.js +0 -93
  176. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,440 +0,0 @@
1
- <template>
2
- <span class="select-top-span">
3
- <el-select
4
- v-if="isLoaded"
5
- ref="dynamicDataSourceRef"
6
- :value="value"
7
- v-bind="myProps"
8
- filterable
9
- :remote="remote"
10
- :remote-method="remoteMethod"
11
- :value-key="valueAttribute"
12
- :loading="loading"
13
- :reserve-keyword="true"
14
- clearable
15
- style="width:100%;height:100%"
16
- @input="inputValue"
17
- @change="change"
18
- @visible-change="visibleChange"
19
- @remove-tag="removeTag(remote,$event)"
20
- @clear="clear"
21
- @blur="blur"
22
- @focus="focus"
23
- >
24
- <el-option
25
- v-for="item in optionItems"
26
- :key="item.value"
27
- :label="item._label_"
28
- :value="item[valueAttribute]"
29
- />
30
- </el-select>
31
- </span>
32
- </template>
33
- <style>
34
- .select-top-span {
35
- width: 100%;
36
- }
37
- </style>
38
- <script>
39
- import dynamicSourceSelectService from './dynamic-source-select-service'
40
- import events from './events'
41
- import {
42
- setEntityFieldValue,
43
- getPropNameWhenJoinTable
44
- } from '../../../src/utils/util'
45
- export default {
46
- name: 'DynamicSourceSelect',
47
- components: {},
48
- model: {
49
- prop: 'value',
50
- event: 'input'
51
- },
52
- props: {
53
- // 字段配置
54
- column: {
55
- type: Object,
56
- default: null
57
- },
58
- value: {
59
- type: [String, Boolean, Number, Array],
60
- default: null
61
- },
62
- baseProps: {
63
- type: Object,
64
- default: null
65
- },
66
- entity: {
67
- type: Object,
68
- default: null
69
- },
70
- // dynamicDataSourceCode、valueSetOptions、isSql(默认是false,在配置系统中使用时需要是true)、additionalParameter( json字符串)
71
- options: {
72
- type: Object,
73
- default: null
74
- },
75
- // 列表组件行编辑使用,sql查询时数据表名称,用于自定义系统中列表组件中字段多表查询带有别名时,将点"."改成两个下划线"__"时使用
76
- tableName: {
77
- type: String,
78
- default: null
79
- },
80
- // 列表组件行编辑使用,是否是关联表,用于确定属性名是否需要拼接tableName
81
- isJoinTable: {
82
- type: Boolean,
83
- default: false
84
- },
85
- // 子表行编辑时,父表单数据
86
- parent: {
87
- type: Object,
88
- default: null
89
- },
90
- // 所在的列表编码
91
- listCode: {
92
- type: String,
93
- default: null
94
- },
95
- // 所在的表单编码
96
- formCode: {
97
- type: String,
98
- default: null
99
- }
100
- },
101
- data() {
102
- const myProps = Object.assign({}, this.baseProps)
103
- let markValue
104
- if (this.entity) {
105
- markValue = JSON.stringify(this.entity)
106
- }
107
- return {
108
- /**
109
- * 用于回显动态数据源选择的默认值,因为初始进入编辑状态时,没有获取映射关系,
110
- * 如果当前字段是保存的label值则无法确定当前选项组的值对应哪一个,导致row中的对应字段变成了空值,所以备份一份
111
- * 然后在获取动态数据源选项组后,给上默认值
112
- */
113
- markValue,
114
- optionItems: [],
115
- myProps,
116
- valueSetOptions: [], // 字段映射集合配置
117
- dynamicDataSourceCode: '', // 动态数据源编码
118
- loading: false, // 是否在加载
119
- valueAttribute: null, // 选项值字段,即控制下拉框组件的value-key属性的
120
- remote: false, // 是否是远程搜索
121
- additionalParameterStr: this.options.additionalParameter, // 附加参数json字符串
122
- isLoaded: false,
123
- watchAttr: null, // 监控的entity属性名,多个属性名逗号分隔。即当该属性修改时,需要走后台重新获得当前下拉选的选项集合
124
- backendUrl: null // 后台访问路径
125
- }
126
- },
127
- watch: {
128
- baseProps: {
129
- deep: true,
130
- handler(newModels) {
131
- this.myProps = Object.assign({}, newModels)
132
- }
133
- }
134
- },
135
- created() {
136
- if (this.options && this.options.dynamicDataSourceCode) {
137
- this.dynamicDataSourceCode = this.options.dynamicDataSourceCode.trim()
138
- const param = {
139
- _listCode: this.listCode,
140
- _formCode: this.formCode,
141
- _tableName: this.tableName
142
- }
143
- if (this.parent) {
144
- param.parent = this.parent
145
- }
146
- this.packageDynamicDataSourceInfo(this.dynamicDataSourceCode, param)
147
- .then(dynamicDataSourceDto => {
148
- if (dynamicDataSourceDto.backendUrl) {
149
- this.backendUrl = dynamicDataSourceDto.backendUrl
150
- }
151
- if (
152
- dynamicDataSourceDto.fuzzyQuery !== undefined &&
153
- dynamicDataSourceDto.fuzzyQuery === true
154
- ) {
155
- // 是否启用远程搜索
156
- this.remote = true
157
- }
158
- if (this.options && this.options.valueSetOptions) {
159
- this.valueSetOptions = this.options.valueSetOptions
160
- }
161
- if (
162
- this.options &&
163
- this.options.isSql !== undefined &&
164
- this.options.isSql !== null
165
- ) {
166
- this.isSql = this.options.isSql
167
- }
168
- if (this.watchAttr) {
169
- let initWatchValue
170
- const watchAttrs = this.watchAttr.split(',')
171
- watchAttrs.forEach((attr) => {
172
- // 初始化下拉选内容
173
- if (this.entity) {
174
- initWatchValue = this.entity[attr]
175
- }
176
- this.$watch('entity.' + attr, function(newValue, oldValue) {
177
- this.watchAttrValueChange(newValue)
178
- // this.inputValue('')
179
- const items = this.optionItems.filter(
180
- item => item[this.valueAttribute] === newValue
181
- )
182
- if (!items) {
183
- this.inputValue('')
184
- }
185
- })
186
- })
187
- this.watchAttrValueChange(initWatchValue)
188
- }
189
- this.isLoaded = true
190
- })
191
- .catch(error => {
192
- console.log(error)
193
- this.isLoaded = true
194
- })
195
- } else {
196
- this.isLoaded = true
197
- }
198
- },
199
- methods: {
200
- ...dynamicSourceSelectService,
201
- ...events,
202
- // 必须有该方法,否则无法给字段赋值
203
- inputValue(newValue) {
204
- this.$emit('input', newValue)
205
- if (newValue === null || newValue === undefined || newValue === '') {
206
- this.remoteQueryMethod(newValue)
207
- }
208
- this.setValues(newValue)
209
- },
210
- packageDynamicDataSourceInfo(dynamicDataSourceCode, param) {
211
- return new Promise((resolve, reject) => {
212
- this.findDynamicDataSourceByCode(
213
- dynamicDataSourceCode,
214
- this.entity,
215
- param,
216
- this.additionalParameterStr,
217
- this.backendUrl
218
- )
219
- .then(dynamicDataSourceDto => {
220
- if (dynamicDataSourceDto) {
221
- if (dynamicDataSourceDto.options) {
222
- this.optionItems = dynamicDataSourceDto.options
223
- if (this.watchAttr) {
224
- // 解决当监控值变化时,数据源重新加载后select输入框中显示的值和下拉中的值不一致问题
225
- if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true) {
226
- this.$nextTick(() => {
227
- this.$refs['dynamicDataSourceRef'].setSelected()
228
- })
229
- }
230
- }
231
- //
232
- if (this.column) { // 只有行编辑时处理
233
- // 设置选项组数据、 选项组值字段、 映射关系
234
- if (this.column.prop !== dynamicDataSourceDto.valueAttribute) {
235
- this.$set(this.column, '_dynamic-source-data-' + this.column.prop,
236
- {
237
- valueSetOptions: this.options.valueSetOptions,
238
- optionItems: this.optionItems,
239
- valueAttribute: dynamicDataSourceDto.valueAttribute
240
- })
241
- }
242
- for (let i = 0; i < this.options.valueSetOptions.length; i++) {
243
- const valueSetOption = this.options.valueSetOptions[i]
244
- if (dynamicDataSourceDto.valueAttribute === valueSetOption.columnName) {
245
- if (this.markValue) {
246
- const muMarkValue = JSON.parse(this.markValue)
247
- if (muMarkValue && muMarkValue[valueSetOption.valueColumn.dbColumnName]) {
248
- let targeValue = muMarkValue[valueSetOption.valueColumn.dbColumnName].split(',')
249
- if (this.column.componentType === 'select') {
250
- // 如果是单选
251
- targeValue = targeValue[0]
252
- }
253
- this.$emit('set-value', {
254
- value: targeValue,
255
- targetColumnName: this.column.prop
256
- })
257
- }
258
- }
259
- break
260
- }
261
- }
262
- }
263
- } else {
264
- this.optionItems = []
265
- }
266
- if (dynamicDataSourceDto.valueAttribute) {
267
- this.valueAttribute = dynamicDataSourceDto.valueAttribute
268
- }
269
- this.valueAttribute = this.getValueAttribute()
270
- this.watchAttr = dynamicDataSourceDto.watchAttr
271
- resolve(dynamicDataSourceDto)
272
- } else {
273
- resolve()
274
- }
275
- })
276
- .catch(error => {
277
- reject(error)
278
- })
279
- })
280
- },
281
- // 远程搜索方法
282
- remoteQuery(searchText, watchAttrValue) {
283
- if (
284
- (searchText !== null && searchText !== undefined) ||
285
- (watchAttrValue !== null && watchAttrValue !== undefined)
286
- ) {
287
- const param = {
288
- _listCode: this.listCode,
289
- _formCode: this.formCode,
290
- _tableName: this.tableName }
291
- if (searchText !== null && searchText !== undefined) {
292
- param.searchText = searchText
293
- }
294
- if (watchAttrValue !== null && watchAttrValue !== undefined) {
295
- // 监控的属性值改变了远程搜索方法
296
- if (Object.prototype.toString.apply(watchAttrValue) === '[object Array]') {
297
- param.watchAttrValue = watchAttrValue.join(',')
298
- } else {
299
- param.watchAttrValue = watchAttrValue + ''
300
- }
301
- } else if (this.entity) {
302
- // 搜索时下拉选项的集合
303
- const watchValue = this.entity[this.watchAttr]
304
- if (watchValue !== null && watchValue !== undefined) {
305
- if (Object.prototype.toString.apply(watchValue) === '[object Array]') {
306
- param.watchAttrValue = watchValue.join(',')
307
- } else {
308
- param.watchAttrValue = watchValue + ''
309
- }
310
- }
311
- }
312
- if (this.parent) {
313
- param.parent = this.parent
314
- }
315
- this.loading = true
316
- this.packageDynamicDataSourceInfo(this.dynamicDataSourceCode, param)
317
- .then(dynamicDataSourceDto => {
318
- this.loading = false
319
- })
320
- .catch(error => {
321
- console.log(error)
322
- this.loading = false
323
- })
324
- }
325
- },
326
- // 远程搜索方法
327
- remoteQueryMethod(searchText) {
328
- if (Array.isArray(this.value)) {
329
- if (this.value.length === 0) {
330
- this.remoteQuery(searchText, null)
331
- }
332
- } else {
333
- this.remoteQuery(searchText, null)
334
- }
335
- },
336
- /**
337
- * 输入框输入查询值时搜索方法,
338
- * 不使用remoteQueryMethod, 解决输入框第一次输入时可查询,第二次输入时没有触发查询方法问题
339
- * @param {*} searchText
340
- */
341
- remoteMethod(searchText) {
342
- this.remoteQuery(searchText, null)
343
- },
344
- // 监控的属性值改变了远程搜索方法
345
- watchAttrValueChange(watchAttrValues) {
346
- this.remoteQuery(null, watchAttrValues)
347
- },
348
- getValueAttribute() {
349
- return !this.valueAttribute || this.valueAttribute === '[label]'
350
- ? '_label_'
351
- : this.valueAttribute
352
- },
353
- setValues(newValue) {
354
- if (this.valueSetOptions && this.valueSetOptions.length > 0) {
355
- this.valueSetOptions.forEach(columnInfo => {
356
- const sourceColumnName = columnInfo.columnName
357
- let value
358
- if (this.optionItems && sourceColumnName) {
359
- value = this.getTargetColumnValue(newValue, sourceColumnName)
360
- }
361
- let targetColumnName = null
362
- const targetColumnInfo = columnInfo.valueColumn
363
- if (targetColumnInfo) {
364
- targetColumnName = targetColumnInfo.name
365
- if (this.isSql === true) {
366
- targetColumnName = targetColumnInfo.dbColumnName
367
- targetColumnName = getPropNameWhenJoinTable(
368
- targetColumnName,
369
- this.isJoinTable,
370
- this.tableName
371
- )
372
- }
373
- }
374
- if (
375
- this.entity &&
376
- targetColumnName &&
377
- targetColumnName !== null &&
378
- targetColumnName !== ''
379
- ) {
380
- setEntityFieldValue(this.entity, targetColumnName, value)
381
- }
382
- this.$emit('set-value', {
383
- value: value,
384
- sourceColumnName: sourceColumnName,
385
- targetColumnName: targetColumnName,
386
- options: this.optionItems
387
- })
388
- })
389
- }
390
- },
391
- // 获得目的字段的值
392
- getTargetColumnValue(newValue, sourceColumnName) {
393
- if (newValue) {
394
- let value = ''
395
- if (
396
- this.baseProps.multiple !== undefined &&
397
- this.baseProps.multiple === true &&
398
- Array.isArray(newValue)
399
- ) {
400
- // 多选值处理,数组信息,使用逗号分开的格式设置其它字段的值
401
- let i = 0
402
- newValue.forEach(itemValue => {
403
- const items = this.optionItems.filter(
404
- item => item[this.valueAttribute] === itemValue
405
- )
406
- if (items && items.length > 0) {
407
- value += items[0][sourceColumnName]
408
- if (i < newValue.length - 1) {
409
- // 最后一个元素不加逗号
410
- value += ','
411
- }
412
- i++
413
- }
414
- })
415
- } else {
416
- // 单选
417
- const items = this.optionItems.filter(
418
- item => item[this.valueAttribute] === newValue
419
- )
420
- if (items && items.length > 0) {
421
- value = items[0][sourceColumnName]
422
- }
423
- }
424
- return value
425
- }
426
- },
427
- // 移除所有tag和clear时候清除markValue的值解决清除选项时关联字段清空了但是当前动态数据源控件仍然有值问题
428
- clearMarkValue() {
429
- if (this.markValue && this.entity) {
430
- const muMarkValue = JSON.parse(this.markValue)
431
- for (let i = 0; i < this.options.valueSetOptions.length; i++) {
432
- const valueSetOption = this.options.valueSetOptions[i]
433
- muMarkValue[valueSetOption.valueColumn.dbColumnName] = null
434
- }
435
- this.markValue = JSON.stringify(muMarkValue)
436
- }
437
- }
438
- }
439
- }
440
- </script>
@@ -1,55 +0,0 @@
1
- const events = {
2
- /**
3
- * 选中值发生变化时触发
4
- * @param {*} newValue
5
- */
6
- change: function(newValue) {
7
- this.$emit('change', newValue)
8
- },
9
- /**
10
- * 下拉框出现/隐藏时触发
11
- * @param {*} visible 出现则为 true,隐藏则为 false
12
- */
13
- visibleChange: function(visible) {
14
- this.$emit('visible-change', visible)
15
- },
16
- /**
17
- * 多选模式下移除tag时触发
18
- * @param {*} remote 是否启用了远程搜索
19
- * @param {*} tag 移除的tag值
20
- */
21
- removeTag: function(remote, tag) {
22
- this.$emit('remove-tag', tag)
23
- if (Array.isArray(this.value)) {
24
- if (this.value.length === 1 && remote) {
25
- this.clearMarkValue()
26
- this.remoteQuery('', null)
27
- }
28
- }
29
- },
30
- /**
31
- * 可清空的单选模式下用户点击清空按钮时触发
32
- */
33
- clear: function() {
34
- this.clearMarkValue()
35
- this.$emit('clear')
36
- },
37
- /**
38
- * 当 input 失去焦点时触发
39
- * @param {*} event
40
- */
41
- blur: function(event) {
42
- this.$emit('blur', event)
43
- },
44
- /**
45
- * 当 input 获得焦点时触发
46
- * @param {*} event
47
- */
48
- focus: function(event) {
49
- this.$emit('focus', event)
50
- },
51
- input(newValue) {
52
- this.$emit('input', newValue)
53
- }
54
- }
55
- export default events
@@ -1,6 +0,0 @@
1
- import FsPreview from './src/fs-preview.vue'
2
- FsPreview.install = function(Vue) {
3
- Vue.component(FsPreview.name, FsPreview)
4
- }
5
-
6
- export default FsPreview