agilebuilder-ui 1.0.90-tmp18 → 1.0.90-tmp1811
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.js +48482 -46682
- package/lib/super-ui.umd.cjs +94 -97
- package/package.json +1 -1
- package/packages/super-grid/src/apis.js +244 -390
- package/packages/super-grid/src/dynamic-input.vue +45 -33
- package/packages/super-grid/src/formValidatorUtil.js +0 -2
- package/packages/super-grid/src/normal-column-content.vue +2 -0
- package/packages/super-grid/src/normal-column.vue +8 -16
- package/packages/super-grid/src/super-grid.vue +0 -3
- package/packages/super-grid/src/utils.js +5 -9
- package/src/utils/util.js +716 -767
package/src/utils/util.js
CHANGED
|
@@ -3,24 +3,24 @@ import { executeExpression } from './calculator/calculator-util'
|
|
|
3
3
|
import { getLangByShort } from './common-util'
|
|
4
4
|
|
|
5
5
|
export function getI18n() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
let myI18n = window.$i18n
|
|
7
|
+
if (!myI18n) {
|
|
8
|
+
myI18n = i18n
|
|
9
|
+
}
|
|
10
|
+
if (!window.$locale) {
|
|
11
|
+
i18n.locale = 'cn'
|
|
12
|
+
} else {
|
|
13
|
+
i18n.locale = window.$locale
|
|
14
|
+
}
|
|
15
|
+
return myI18n.global
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export function getLanguageWithLocale() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
let currentLocale = window.$locale
|
|
20
|
+
if (!currentLocale || currentLocale === 'zh') {
|
|
21
|
+
currentLocale = 'cn'
|
|
22
|
+
}
|
|
23
|
+
return getLangByShort(currentLocale)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -31,51 +31,45 @@ export function getLanguageWithLocale() {
|
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
33
|
export function findOptionsByDynamicDataSource(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
dynamicSourceCode,
|
|
35
|
+
searchText,
|
|
36
|
+
entity,
|
|
37
|
+
additionalParameterStr,
|
|
38
|
+
searchParam
|
|
39
39
|
) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const value = item[valueAttribute]
|
|
62
|
-
// 显示的标签
|
|
63
|
-
const label = item['_label_']
|
|
64
|
-
options.push({
|
|
65
|
-
label,
|
|
66
|
-
value,
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
if (!options) {
|
|
71
|
-
options = []
|
|
72
|
-
}
|
|
73
|
-
resolve(options)
|
|
74
|
-
})
|
|
75
|
-
.catch((error) => {
|
|
76
|
-
reject(error)
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
findDynamicDataSourceByCode(dynamicSourceCode, searchText, entity, additionalParameterStr, searchParam)
|
|
42
|
+
.then((dynamicDataSourceDto) => {
|
|
43
|
+
let options = []
|
|
44
|
+
if (dynamicDataSourceDto && dynamicDataSourceDto.options) {
|
|
45
|
+
const setOptions = dynamicDataSourceDto.options
|
|
46
|
+
let valueAttribute
|
|
47
|
+
if (dynamicDataSourceDto.valueAttribute) {
|
|
48
|
+
valueAttribute = dynamicDataSourceDto.valueAttribute
|
|
49
|
+
}
|
|
50
|
+
if (!valueAttribute || valueAttribute === '[label]') {
|
|
51
|
+
valueAttribute = '_label_'
|
|
52
|
+
}
|
|
53
|
+
setOptions.forEach((item) => {
|
|
54
|
+
// 值
|
|
55
|
+
const value = item[valueAttribute]
|
|
56
|
+
// 显示的标签
|
|
57
|
+
const label = item['_label_']
|
|
58
|
+
options.push({
|
|
59
|
+
label,
|
|
60
|
+
value
|
|
77
61
|
})
|
|
78
|
-
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
if (!options) {
|
|
65
|
+
options = []
|
|
66
|
+
}
|
|
67
|
+
resolve(options)
|
|
68
|
+
})
|
|
69
|
+
.catch((error) => {
|
|
70
|
+
reject(error)
|
|
71
|
+
})
|
|
72
|
+
})
|
|
79
73
|
}
|
|
80
74
|
|
|
81
75
|
/**
|
|
@@ -86,76 +80,84 @@ export function findOptionsByDynamicDataSource(
|
|
|
86
80
|
* @returns
|
|
87
81
|
*/
|
|
88
82
|
export function findDynamicDataSourceByCode(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
dynamicSourceCode,
|
|
84
|
+
searchText,
|
|
85
|
+
entity,
|
|
86
|
+
additionalParameterStr,
|
|
87
|
+
searchParam
|
|
94
88
|
) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const backendUrl = window.$vueApp.config.globalProperties.baseURL
|
|
89
|
+
let watchAttrValue
|
|
90
|
+
let parentEntity
|
|
91
|
+
let listCode
|
|
92
|
+
let formCode
|
|
93
|
+
let tableName
|
|
94
|
+
if (searchParam) {
|
|
95
|
+
watchAttrValue = searchParam.watchAttrValue
|
|
96
|
+
if (watchAttrValue === undefined || watchAttrValue === null) {
|
|
97
|
+
watchAttrValue = ''
|
|
98
|
+
}
|
|
99
|
+
parentEntity = searchParam.parent
|
|
100
|
+
listCode = searchParam._listCode
|
|
101
|
+
formCode = searchParam._formCode
|
|
102
|
+
tableName = searchParam._tableName
|
|
103
|
+
}
|
|
104
|
+
const params = {
|
|
105
|
+
searchText,
|
|
106
|
+
watchAttrValue,
|
|
107
|
+
parent: parentEntity
|
|
108
|
+
}
|
|
109
|
+
if (additionalParameterStr && typeof additionalParameterStr === 'object') {
|
|
110
|
+
params.additionalParamMap = additionalParameterStr
|
|
111
|
+
} else if (additionalParameterStr && typeof additionalParameterStr === 'string') {
|
|
112
|
+
params.additionalParamMap = JSON.parse(additionalParameterStr)
|
|
113
|
+
}
|
|
114
|
+
if (params.additionalParamMap === undefined) {
|
|
115
|
+
params.additionalParamMap = {}
|
|
116
|
+
}
|
|
117
|
+
if (listCode) {
|
|
118
|
+
params.additionalParamMap._listCode = listCode
|
|
119
|
+
}
|
|
120
|
+
if (formCode) {
|
|
121
|
+
params.additionalParamMap._formCode = formCode
|
|
122
|
+
}
|
|
123
|
+
if (tableName) {
|
|
124
|
+
params.additionalParamMap._tableName = tableName
|
|
125
|
+
}
|
|
126
|
+
if (entity && entity !== null) {
|
|
127
|
+
params.entity = entity
|
|
128
|
+
}
|
|
129
|
+
const backendUrl = window.$vueApp.config.globalProperties.baseURL
|
|
137
130
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
// 页面设计不请求动态数据源
|
|
133
|
+
if (
|
|
134
|
+
window.$vueApp.config.globalProperties.systemCode !== undefined &&
|
|
135
|
+
window.$vueApp.config.globalProperties.systemCode === 'agilebuilder'
|
|
136
|
+
) {
|
|
137
|
+
resolve()
|
|
138
|
+
} else {
|
|
139
|
+
window.$vueApp.config.globalProperties.$http
|
|
140
|
+
.post(backendUrl + '/common/dynamic-data-source/' + dynamicSourceCode, params)
|
|
141
|
+
.then((result) => {
|
|
142
|
+
if (result.backendUrl) {
|
|
143
|
+
// result.backendUrl表示需要使用动态数据源所属的系统路径重新获得一次数据
|
|
144
|
+
window.$vueApp.config.globalProperties.$http
|
|
145
|
+
.post(result.backendUrl + '/common/dynamic-data-source/' + dynamicSourceCode, params)
|
|
146
|
+
.then((finallyResult) => {
|
|
147
|
+
resolve(finallyResult)
|
|
148
|
+
})
|
|
149
|
+
.catch((error) => {
|
|
155
150
|
reject(error)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
})
|
|
152
|
+
} else {
|
|
153
|
+
resolve(result)
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
.catch((error) => {
|
|
157
|
+
reject(error)
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
})
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
/**
|
|
@@ -169,266 +171,233 @@ export function findDynamicDataSourceByCode(
|
|
|
169
171
|
* @returns
|
|
170
172
|
*/
|
|
171
173
|
export function analysisCondition(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
conditionListJson,
|
|
175
|
+
entity,
|
|
176
|
+
additionalParameter,
|
|
177
|
+
contextParameter,
|
|
178
|
+
isSql,
|
|
179
|
+
tableName,
|
|
180
|
+
parentFormData,
|
|
181
|
+
pageContext
|
|
180
182
|
) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
contextParameterMap = JSON.parse(contextParameter)
|
|
219
|
-
} else if (contextParameter && typeof contextParameter === 'object') {
|
|
220
|
-
contextParameterMap = contextParameter
|
|
221
|
-
}
|
|
222
|
-
let conditionList = []
|
|
223
|
-
if (
|
|
224
|
-
conditionListJson &&
|
|
225
|
-
typeof conditionListJson === 'string' &&
|
|
226
|
-
conditionListJson !== ''
|
|
227
|
-
) {
|
|
228
|
-
// conditionList = eval('('+conditionListJson+')')
|
|
229
|
-
conditionList = JSON.parse(conditionListJson)
|
|
230
|
-
} else if (conditionListJson && Array.isArray(conditionListJson)) {
|
|
231
|
-
conditionList = conditionListJson
|
|
232
|
-
}
|
|
233
|
-
return parseCondition(
|
|
234
|
-
entity,
|
|
235
|
-
conditionList,
|
|
236
|
-
isSql,
|
|
237
|
-
tableName,
|
|
238
|
-
additionalParameterMap,
|
|
239
|
-
contextParameterMap,
|
|
240
|
-
parentFormData,
|
|
241
|
-
pageContext
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function parseCondition(
|
|
183
|
+
// console.log('analysisCondition判断条件conditionListJson', conditionListJson)
|
|
184
|
+
// console.log('analysisCondition判断条件entity', entity)
|
|
185
|
+
// console.log('analysisCondition判断条件additionalParameter', additionalParameter)
|
|
186
|
+
// console.log('analysisCondition判断条件contextParameter', contextParameter)
|
|
187
|
+
// console.log('analysisCondition判断条件isSql', isSql)
|
|
188
|
+
// console.log('analysisCondition判断条件tableName', tableName)
|
|
189
|
+
// console.log('analysisCondition判断条件parentFormData', parentFormData)
|
|
190
|
+
if (conditionListJson === undefined || conditionListJson === '' || conditionListJson === null) {
|
|
191
|
+
// 如果条件不存在,则默认返回true
|
|
192
|
+
return true
|
|
193
|
+
}
|
|
194
|
+
if (typeof isSql === 'undefined' || isSql === null) {
|
|
195
|
+
// 默认是定制开发时
|
|
196
|
+
isSql = false
|
|
197
|
+
}
|
|
198
|
+
// 页面附加参数
|
|
199
|
+
let additionalParameterMap = {}
|
|
200
|
+
if (additionalParameter && typeof additionalParameter === 'string' && additionalParameter !== '') {
|
|
201
|
+
additionalParameterMap = JSON.parse(additionalParameter)
|
|
202
|
+
} else if (additionalParameter && typeof additionalParameter === 'object') {
|
|
203
|
+
additionalParameterMap = additionalParameter
|
|
204
|
+
}
|
|
205
|
+
// 环境变量,例如:当前用户id、当前用户登录名等
|
|
206
|
+
let contextParameterMap = {}
|
|
207
|
+
if (contextParameter && typeof contextParameter === 'string' && contextParameter !== '') {
|
|
208
|
+
contextParameterMap = JSON.parse(contextParameter)
|
|
209
|
+
} else if (contextParameter && typeof contextParameter === 'object') {
|
|
210
|
+
contextParameterMap = contextParameter
|
|
211
|
+
}
|
|
212
|
+
let conditionList = []
|
|
213
|
+
if (conditionListJson && typeof conditionListJson === 'string' && conditionListJson !== '') {
|
|
214
|
+
// conditionList = eval('('+conditionListJson+')')
|
|
215
|
+
conditionList = JSON.parse(conditionListJson)
|
|
216
|
+
} else if (conditionListJson && Array.isArray(conditionListJson)) {
|
|
217
|
+
conditionList = conditionListJson
|
|
218
|
+
}
|
|
219
|
+
return parseCondition(
|
|
246
220
|
entity,
|
|
247
221
|
conditionList,
|
|
248
222
|
isSql,
|
|
249
223
|
tableName,
|
|
250
|
-
|
|
224
|
+
additionalParameterMap,
|
|
251
225
|
contextParameterMap,
|
|
252
226
|
parentFormData,
|
|
253
227
|
pageContext
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function parseCondition(
|
|
232
|
+
entity,
|
|
233
|
+
conditionList,
|
|
234
|
+
isSql,
|
|
235
|
+
tableName,
|
|
236
|
+
additionalParamMap,
|
|
237
|
+
contextParameterMap,
|
|
238
|
+
parentFormData,
|
|
239
|
+
pageContext
|
|
254
240
|
) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
let
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (
|
|
286
|
-
tableName &&
|
|
287
|
-
propDbName.toLowerCase().startsWith(tableName.toLowerCase() + '.')
|
|
288
|
-
) {
|
|
289
|
-
// 表示是当前表的字段
|
|
290
|
-
const myProp = propDbName.substring(propDbName.indexOf('.'))
|
|
291
|
-
leftValue = getValue(entity, myProp, isSql)
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
} else {
|
|
295
|
-
if (propName.indexOf('parent_+_') !== -1) {
|
|
296
|
-
propName = propName.replace('parent_+_', '')
|
|
297
|
-
const propNameArr = propName.split('_+_')
|
|
298
|
-
propName = propNameArr[1]
|
|
299
|
-
leftValue = getValue(parentFormData, propName, isSql)
|
|
300
|
-
} else {
|
|
301
|
-
leftValue = getValue(entity, propName, isSql)
|
|
302
|
-
}
|
|
303
|
-
if (propDbName && (leftValue === undefined || leftValue === null)) {
|
|
304
|
-
leftValue = getValue(entity, propDbName, isSql)
|
|
305
|
-
}
|
|
241
|
+
if (conditionList === undefined || conditionList === null || conditionList.length === 0) {
|
|
242
|
+
// 表示没有设置条件,默认是true
|
|
243
|
+
return true
|
|
244
|
+
}
|
|
245
|
+
// 条件封装的表达式
|
|
246
|
+
let conditions = ''
|
|
247
|
+
for (let i = 0; i < conditionList.length; i++) {
|
|
248
|
+
const condition = conditionList[i]
|
|
249
|
+
let propName = condition.propName
|
|
250
|
+
let propDbName = condition.propDbName
|
|
251
|
+
if ((!propName || propName === '') && (!propDbName || propDbName === '')) {
|
|
252
|
+
// 没有属性和字段名表示是无效的条件
|
|
253
|
+
continue
|
|
254
|
+
}
|
|
255
|
+
let leftValue
|
|
256
|
+
if (isSql && propDbName) {
|
|
257
|
+
if (propDbName.indexOf('parent_+_') !== -1) {
|
|
258
|
+
propDbName = propDbName.replace('parent_+_', '')
|
|
259
|
+
// 再获取属于那张表
|
|
260
|
+
const propDbNameArr = propDbName.split('_+_')
|
|
261
|
+
propDbName = propDbNameArr[1]
|
|
262
|
+
leftValue = getValue(parentFormData, propDbName, isSql)
|
|
263
|
+
} else {
|
|
264
|
+
leftValue = getValue(entity, propDbName, isSql)
|
|
265
|
+
}
|
|
266
|
+
if (leftValue === undefined || leftValue === null) {
|
|
267
|
+
if (tableName && propDbName.toLowerCase().startsWith(tableName.toLowerCase() + '.')) {
|
|
268
|
+
// 表示是当前表的字段
|
|
269
|
+
const myProp = propDbName.substring(propDbName.indexOf('.'))
|
|
270
|
+
leftValue = getValue(entity, myProp, isSql)
|
|
306
271
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
if (propName.indexOf('parent_+_') !== -1) {
|
|
275
|
+
propName = propName.replace('parent_+_', '')
|
|
276
|
+
const propNameArr = propName.split('_+_')
|
|
277
|
+
propName = propNameArr[1]
|
|
278
|
+
leftValue = getValue(parentFormData, propName, isSql)
|
|
279
|
+
} else {
|
|
280
|
+
leftValue = getValue(entity, propName, isSql)
|
|
281
|
+
}
|
|
282
|
+
if (propDbName && (leftValue === undefined || leftValue === null)) {
|
|
283
|
+
leftValue = getValue(entity, propDbName, isSql)
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const operator = condition.operator
|
|
287
|
+
const propValue = condition.propValue
|
|
288
|
+
const dataType = condition.dataType
|
|
289
|
+
const variableIsNullStr = condition.variableIsNull
|
|
290
|
+
// 解析单个条件的值
|
|
291
|
+
// 判断value类型
|
|
292
|
+
let value
|
|
293
|
+
if (pageContext) {
|
|
294
|
+
value = getPropValueNew(propValue, pageContext)
|
|
295
|
+
} else {
|
|
296
|
+
value = getPropValue(propValue, entity, additionalParamMap, contextParameterMap)
|
|
297
|
+
}
|
|
298
|
+
if (variableIsNullStr && variableIsNullStr === 'null') {
|
|
299
|
+
if (value === undefined || value === '') {
|
|
300
|
+
value = null
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
let conditionResult = executeExpression(leftValue, operator, value, dataType)
|
|
304
|
+
const leftBracket = condition.leftBracket
|
|
305
|
+
const rightBracket = condition.rightBracket
|
|
306
|
+
let joinSign = condition.joinSign
|
|
307
|
+
if (leftBracket && leftBracket !== null && leftBracket !== '') {
|
|
308
|
+
conditions = conditions + leftBracket
|
|
309
|
+
conditions = conditions + ' '
|
|
310
|
+
// conditions.append(leftBracket).append(' ')
|
|
311
|
+
}
|
|
312
|
+
if (variableIsNullStr && variableIsNullStr !== 'null') {
|
|
313
|
+
if (value === undefined || value === null || value + '' === '') {
|
|
314
|
+
if (variableIsNullStr === '1=1') {
|
|
315
|
+
conditionResult = true
|
|
316
316
|
} else {
|
|
317
|
-
|
|
318
|
-
propValue,
|
|
319
|
-
entity,
|
|
320
|
-
additionalParamMap,
|
|
321
|
-
contextParameterMap
|
|
322
|
-
)
|
|
323
|
-
}
|
|
324
|
-
if (variableIsNullStr && variableIsNullStr === 'null') {
|
|
325
|
-
if (value === undefined || value === '') {
|
|
326
|
-
value = null
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
let conditionResult = executeExpression(
|
|
330
|
-
leftValue,
|
|
331
|
-
operator,
|
|
332
|
-
value,
|
|
333
|
-
dataType
|
|
334
|
-
)
|
|
335
|
-
const leftBracket = condition.leftBracket
|
|
336
|
-
const rightBracket = condition.rightBracket
|
|
337
|
-
let joinSign = condition.joinSign
|
|
338
|
-
if (leftBracket && leftBracket !== null && leftBracket !== '') {
|
|
339
|
-
conditions = conditions + leftBracket
|
|
340
|
-
conditions = conditions + ' '
|
|
341
|
-
// conditions.append(leftBracket).append(' ')
|
|
342
|
-
}
|
|
343
|
-
if (variableIsNullStr && variableIsNullStr !== 'null') {
|
|
344
|
-
if (value === undefined || value === null || value + '' === '') {
|
|
345
|
-
if (variableIsNullStr === '1=1') {
|
|
346
|
-
conditionResult = true
|
|
347
|
-
} else {
|
|
348
|
-
conditionResult = false
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
conditions += conditionResult + ' '
|
|
353
|
-
if (rightBracket && rightBracket !== null && rightBracket !== '') {
|
|
354
|
-
conditions = conditions + rightBracket
|
|
355
|
-
conditions = conditions + ' '
|
|
356
|
-
// conditions.append(rightBracket).append(' ')
|
|
357
|
-
}
|
|
358
|
-
if (i < conditionList.length - 1) {
|
|
359
|
-
// 最后一个不拼接“连接符”
|
|
360
|
-
if (joinSign && joinSign !== null && joinSign !== '') {
|
|
361
|
-
const joinSignIgnoreCase = joinSign.toLowerCase()
|
|
362
|
-
if (joinSignIgnoreCase === 'and') {
|
|
363
|
-
joinSign = joinSignIgnoreCase.replace('and', '&&')
|
|
364
|
-
} else if (joinSignIgnoreCase === 'or') {
|
|
365
|
-
joinSign = joinSignIgnoreCase.replace('or', '||')
|
|
366
|
-
}
|
|
367
|
-
conditions += joinSign + ' '
|
|
368
|
-
}
|
|
317
|
+
conditionResult = false
|
|
369
318
|
}
|
|
319
|
+
}
|
|
370
320
|
}
|
|
371
|
-
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
321
|
+
conditions += conditionResult + ' '
|
|
322
|
+
if (rightBracket && rightBracket !== null && rightBracket !== '') {
|
|
323
|
+
conditions = conditions + rightBracket
|
|
324
|
+
conditions = conditions + ' '
|
|
325
|
+
// conditions.append(rightBracket).append(' ')
|
|
326
|
+
}
|
|
327
|
+
if (i < conditionList.length - 1) {
|
|
328
|
+
// 最后一个不拼接“连接符”
|
|
329
|
+
if (joinSign && joinSign !== null && joinSign !== '') {
|
|
330
|
+
const joinSignIgnoreCase = joinSign.toLowerCase()
|
|
331
|
+
if (joinSignIgnoreCase === 'and') {
|
|
332
|
+
joinSign = joinSignIgnoreCase.replace('and', '&&')
|
|
333
|
+
} else if (joinSignIgnoreCase === 'or') {
|
|
334
|
+
joinSign = joinSignIgnoreCase.replace('or', '||')
|
|
335
|
+
}
|
|
336
|
+
conditions += joinSign + ' '
|
|
337
|
+
}
|
|
377
338
|
}
|
|
339
|
+
}
|
|
340
|
+
console.log('parseCondition----conditions=', conditions)
|
|
341
|
+
if (conditions) {
|
|
342
|
+
// eslint-disable-next-line no-eval
|
|
343
|
+
return eval('(' + conditions + ')')
|
|
344
|
+
} else {
|
|
345
|
+
return true
|
|
346
|
+
}
|
|
378
347
|
}
|
|
379
348
|
|
|
380
349
|
const REPLACE_DOT = '__'
|
|
381
350
|
|
|
382
351
|
function getValue(entityData, fieldName, isSql) {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
352
|
+
let value = null
|
|
353
|
+
if (entityData && entityData !== null) {
|
|
354
|
+
if (fieldName && fieldName !== null) {
|
|
355
|
+
value = getValueByField(entityData, fieldName)
|
|
356
|
+
if (value === undefined || value === null) {
|
|
357
|
+
if (isSql) {
|
|
358
|
+
if (value === undefined || value == null) {
|
|
359
|
+
if (fieldName.indexOf('.') > 0) {
|
|
360
|
+
// 将“.”替换为'__',列表组件中的entity中如果是'.',传过来的实体信息中的字段属性会是“__”
|
|
361
|
+
fieldName = fieldName.replace('.', REPLACE_DOT)
|
|
362
|
+
value = getValueByField(entityData, fieldName)
|
|
397
363
|
}
|
|
364
|
+
}
|
|
398
365
|
}
|
|
366
|
+
}
|
|
399
367
|
}
|
|
400
|
-
|
|
368
|
+
}
|
|
369
|
+
return value
|
|
401
370
|
}
|
|
402
371
|
|
|
403
372
|
export function getValueByField(entityData, fieldName) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
return value
|
|
373
|
+
if (entityData && entityData !== null) {
|
|
374
|
+
let value
|
|
375
|
+
if (fieldName.indexOf('.') > 0) {
|
|
376
|
+
// 表示是子表字段
|
|
377
|
+
value = getSubEntityValue(entityData, fieldName)
|
|
378
|
+
} else {
|
|
379
|
+
value = entityData[fieldName.toUpperCase()]
|
|
380
|
+
if (value === undefined) {
|
|
381
|
+
value = entityData[fieldName.toLowerCase()]
|
|
382
|
+
}
|
|
416
383
|
}
|
|
384
|
+
return value
|
|
385
|
+
}
|
|
417
386
|
}
|
|
418
387
|
|
|
419
388
|
function getSubEntityValue(entityData, fieldName) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
389
|
+
let value = null
|
|
390
|
+
let subEntityData = entityData
|
|
391
|
+
const fieldNames = fieldName.split('\\.')
|
|
392
|
+
for (let i = 0; i < fieldNames.length; i++) {
|
|
393
|
+
const field = fieldNames[i]
|
|
394
|
+
if (i === fieldNames.length) {
|
|
395
|
+
value = getSubEntityFieldValue(subEntityData, field)
|
|
396
|
+
} else {
|
|
397
|
+
subEntityData = getSubEntityFieldValue(subEntityData, field)
|
|
430
398
|
}
|
|
431
|
-
|
|
399
|
+
}
|
|
400
|
+
return value
|
|
432
401
|
}
|
|
433
402
|
|
|
434
403
|
/**
|
|
@@ -439,18 +408,18 @@ function getSubEntityValue(entityData, fieldName) {
|
|
|
439
408
|
* @return
|
|
440
409
|
*/
|
|
441
410
|
function getSubEntityFieldValue(subEntityData, fieldName) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
411
|
+
if (subEntityData === undefined || subEntityData === null) {
|
|
412
|
+
return null
|
|
413
|
+
}
|
|
414
|
+
return subEntityData[fieldName]
|
|
446
415
|
}
|
|
447
416
|
|
|
448
417
|
function getContextValue(contextParameterMap, propValue) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
418
|
+
let value = getLastNDate(propValue)
|
|
419
|
+
if (contextParameterMap) {
|
|
420
|
+
value = contextParameterMap[propValue]
|
|
421
|
+
}
|
|
422
|
+
return value
|
|
454
423
|
}
|
|
455
424
|
/**
|
|
456
425
|
* 获得最近n天的开始日期和结束日期集合
|
|
@@ -458,57 +427,51 @@ function getContextValue(contextParameterMap, propValue) {
|
|
|
458
427
|
* @returns [startDate,endDate],例如:[2024/2/26 00:00:00,2023/3/3 23:59:59]
|
|
459
428
|
*/
|
|
460
429
|
export function getLastNDate(propValue) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
propValue.indexOf('lastNDay') >= 0) {
|
|
489
|
-
// 最近n天 lastNDay:n,例如:lastNDay:5,表示最近5天
|
|
490
|
-
const n = propValue.substring(propValue.indexOf(':') + 1)
|
|
491
|
-
value = getLastNDay(parseInt(n))
|
|
492
|
-
}
|
|
493
|
-
return value
|
|
430
|
+
let value
|
|
431
|
+
if (propValue && propValue === 'currentTime') {
|
|
432
|
+
// 当前时间
|
|
433
|
+
value = new Date()
|
|
434
|
+
}
|
|
435
|
+
if (propValue && propValue === 'currentWeek') {
|
|
436
|
+
// 本周
|
|
437
|
+
value = getCurrentWeek()
|
|
438
|
+
}
|
|
439
|
+
if (propValue && propValue === 'currentMonth') {
|
|
440
|
+
// 本月
|
|
441
|
+
value = getCurrentMonth()
|
|
442
|
+
}
|
|
443
|
+
if (propValue && propValue === 'currentQuarter') {
|
|
444
|
+
// 本季度
|
|
445
|
+
value = getCurrentQuarter()
|
|
446
|
+
}
|
|
447
|
+
if (propValue && propValue === 'currentYear') {
|
|
448
|
+
// 本年
|
|
449
|
+
value = getCurrentYear()
|
|
450
|
+
}
|
|
451
|
+
if (propValue && propValue.indexOf('lastNDay') >= 0) {
|
|
452
|
+
// 最近n天 lastNDay:n,例如:lastNDay:5,表示最近5天
|
|
453
|
+
const n = propValue.substring(propValue.indexOf(':') + 1)
|
|
454
|
+
value = getLastNDay(parseInt(n))
|
|
455
|
+
}
|
|
456
|
+
return value
|
|
494
457
|
}
|
|
495
458
|
/**
|
|
496
459
|
* 获得当前周的周一和周日的的日期
|
|
497
460
|
* 例如:[2024/2/26 00:00:00,2023/3/3 23:59:59]
|
|
498
|
-
* @returns
|
|
461
|
+
* @returns
|
|
499
462
|
*/
|
|
500
463
|
function getCurrentWeek() {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
464
|
+
const new_Date = new Date() //获取本周一周日期
|
|
465
|
+
const timesStamp = new_Date.getTime()
|
|
466
|
+
const currenDay = new_Date.getDay()
|
|
467
|
+
// 周一
|
|
468
|
+
const monday = new Date(timesStamp + 24 * 60 * 60 * 1000 * (0 - ((currenDay + 6) % 7)))
|
|
469
|
+
// 周日
|
|
470
|
+
const sunday = new Date(timesStamp + 24 * 60 * 60 * 1000 * (6 - ((currenDay + 6) % 7)))
|
|
471
|
+
const startDate = monday.toLocaleDateString() + ' ' + monday.toLocaleTimeString()
|
|
472
|
+
const endDate = sunday.toLocaleDateString() + ' ' + sunday.toLocaleTimeString()
|
|
473
|
+
console.log(`getCurrentMonth从 ${startDate} 开始,到 ${endDate} 结束`)
|
|
474
|
+
return [monday, sunday]
|
|
512
475
|
}
|
|
513
476
|
/**
|
|
514
477
|
* 获得当前月第1天和最后1天的日期
|
|
@@ -516,230 +479,240 @@ function getCurrentWeek() {
|
|
|
516
479
|
* @returns [xxx,xxx]
|
|
517
480
|
*/
|
|
518
481
|
function getCurrentMonth() {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
482
|
+
// 创建一个新的Date对象,表示当前时间
|
|
483
|
+
const currentDate = new Date()
|
|
484
|
+
|
|
485
|
+
// 获取当前年份和月份
|
|
486
|
+
const year = currentDate.getFullYear() // 获取完整的四位年份
|
|
487
|
+
const month = currentDate.getMonth() + 1 // getMonth返回值范围为0-11,因此加上1得到真正的月份
|
|
488
|
+
|
|
489
|
+
// 设置起始日期为本月第一天
|
|
490
|
+
currentDate.setDate(1)
|
|
491
|
+
|
|
492
|
+
// 将起始日期格式化成字符串形式(YYYY-MM-DD)
|
|
493
|
+
const startDateStr = `${year}/${month < 10 ? '0' : ''}${month}/01`
|
|
494
|
+
|
|
495
|
+
// 设置结束日期为下个月第一天的前一天
|
|
496
|
+
currentDate.setMonth(currentDate.getMonth() + 2)
|
|
497
|
+
currentDate.setDate(0)
|
|
498
|
+
|
|
499
|
+
// 将结束日期格式化成字符串形式(YYYY-MM-DD)
|
|
500
|
+
const endDateStr = `${currentDate.getFullYear()}/${currentDate.getMonth() < 9 ? '0' : ''}${
|
|
501
|
+
currentDate.getMonth() + 1
|
|
502
|
+
}/01`
|
|
503
|
+
const startDate11 = new Date(Date.parse(startDateStr))
|
|
504
|
+
const endDate11 = new Date(new Date(Date.parse(endDateStr)).getTime() - 1000)
|
|
505
|
+
const startDate = startDate11.toLocaleDateString() + ' ' + startDate11.toLocaleTimeString()
|
|
506
|
+
const endDate = endDate11.toLocaleDateString() + ' ' + endDate11.toLocaleTimeString()
|
|
507
|
+
console.log(`getCurrentMonth从 ${startDate} 开始,到 ${endDate} 结束`)
|
|
508
|
+
return [startDate11, endDate11]
|
|
544
509
|
}
|
|
545
510
|
/**
|
|
546
511
|
* 获得当前季度第1天和最后一天的日期
|
|
547
512
|
* 例如:[2023/1/1 00:00:00,2023/3/31 23:59:59]
|
|
548
|
-
* @returns
|
|
513
|
+
* @returns
|
|
549
514
|
*/
|
|
550
515
|
function getCurrentQuarter() {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
516
|
+
const currentDate = new Date()
|
|
517
|
+
const quarterStartIndex = (currentDate.getMonth() + 3) % 12
|
|
518
|
+
let firstDayOfQuarter // 存放第一天的Date对象
|
|
519
|
+
if (currentDate.getMonth() < quarterStartIndex + 2) {
|
|
520
|
+
firstDayOfQuarter = new Date(currentDate.getFullYear(), quarterStartIndex, 1)
|
|
521
|
+
} else {
|
|
522
|
+
firstDayOfQuarter = new Date(currentDate.getFullYear() + 1, quarterStartIndex, 1)
|
|
523
|
+
}
|
|
559
524
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
525
|
+
let lastDayOfQuarter // 存放最后一天的Date对象
|
|
526
|
+
if (firstDayOfQuarter.getMonth() === 11) {
|
|
527
|
+
lastDayOfQuarter = new Date(firstDayOfQuarter.getFullYear() + 1, 0, 0)
|
|
528
|
+
} else {
|
|
529
|
+
lastDayOfQuarter = new Date(firstDayOfQuarter.getFullYear(), firstDayOfQuarter.getMonth() + 3, 0)
|
|
530
|
+
}
|
|
531
|
+
lastDayOfQuarter = new Date(lastDayOfQuarter.getTime() + 24 * 60 * 60 * 1000 - 1000)
|
|
532
|
+
const startDate = firstDayOfQuarter.toLocaleDateString() + ' ' + firstDayOfQuarter.toLocaleTimeString()
|
|
533
|
+
const endDate = lastDayOfQuarter.toLocaleDateString() + ' ' + lastDayOfQuarter.toLocaleTimeString()
|
|
534
|
+
console.log(`getCurrentQuarter从 ${startDate} 开始,到 ${endDate} 结束`)
|
|
535
|
+
return [firstDayOfQuarter, lastDayOfQuarter]
|
|
571
536
|
}
|
|
572
537
|
/**
|
|
573
538
|
* 获得本年的第1天和最后一天的日期
|
|
574
539
|
* 例如:[2023/1/1 00:00:00,2023/12/31 23:59:59]
|
|
575
|
-
* @returns
|
|
540
|
+
* @returns
|
|
576
541
|
*/
|
|
577
542
|
function getCurrentYear() {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
543
|
+
// 创建一个新的日期对象
|
|
544
|
+
const currentYear = new Date().getFullYear() // 获取当前年份
|
|
545
|
+
|
|
546
|
+
// 设置为当前年的1月1号(第一天)
|
|
547
|
+
let firstDayOfCurrentYear = new Date(currentYear, 0)
|
|
548
|
+
firstDayOfCurrentYear.setMonth(0, 1) // 将月份设置为0表示1月
|
|
549
|
+
|
|
550
|
+
// 设置为下一年的12月31号(最后一天)
|
|
551
|
+
let lastDayOfCurrentYear = new Date(currentYear + 1, 0)
|
|
552
|
+
lastDayOfCurrentYear = lastDayOfCurrentYear.getTime() - 1000
|
|
553
|
+
lastDayOfCurrentYear = new Date(lastDayOfCurrentYear)
|
|
554
|
+
const startDate = firstDayOfCurrentYear.toLocaleDateString() + ' ' + firstDayOfCurrentYear.toLocaleTimeString()
|
|
555
|
+
const endDate = lastDayOfCurrentYear.toLocaleDateString() + ' ' + lastDayOfCurrentYear.toLocaleTimeString()
|
|
556
|
+
console.log(`getCurrentYear从 ${startDate} 开始,到 ${endDate} 结束`)
|
|
557
|
+
return [firstDayOfCurrentYear, lastDayOfCurrentYear]
|
|
593
558
|
}
|
|
594
559
|
/**
|
|
595
560
|
* 获得最近n天的日期[n天前,当前日期]。
|
|
596
561
|
* 例如:[2024/2/25 00:00:00,2024/2/29 23:59:59]
|
|
597
|
-
* @param {} n
|
|
562
|
+
* @param {} n
|
|
598
563
|
*/
|
|
599
564
|
function getLastNDay(n) {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
565
|
+
let currentDate = new Date() // 创建一个表示今天的Date对象
|
|
566
|
+
let year = currentDate.getFullYear() // 获取完整的四位年份
|
|
567
|
+
let month = currentDate.getMonth() + 1 // getMonth返回值范围为0-11,因此加上1得到真正的月份
|
|
568
|
+
let date = currentDate.getDate() // getMonth返回值范围为0-11,因此加上1得到真正的月份
|
|
569
|
+
let startDateStr = `${year}/${month < 10 ? '0' : ''}${month}/${date}`
|
|
570
|
+
currentDate = new Date(Date.parse(startDateStr))
|
|
571
|
+
currentDate.setDate(currentDate.getDate() + 1)
|
|
572
|
+
currentDate = new Date(currentDate.getTime() - 1000)
|
|
573
|
+
|
|
574
|
+
let lastNDay = new Date() // 创建一个表示今天的Date对象
|
|
575
|
+
lastNDay.setDate(lastNDay.getDate() - (n - 1))
|
|
576
|
+
const lastNYear = lastNDay.getFullYear() // 获取完整的四位年份
|
|
577
|
+
const lastNMonth = lastNDay.getMonth() + 1 // getMonth返回值范围为0-11,因此加上1得到真正的月份
|
|
578
|
+
const lastNDate = lastNDay.getDate() // getMonth返回值范围为0-11,因此加上1得到真正的月份
|
|
579
|
+
const endtDateStr = `${lastNYear}/${lastNMonth < 10 ? '0' : ''}${lastNMonth}/${lastNDate}`
|
|
580
|
+
lastNDay = new Date(Date.parse(endtDateStr))
|
|
581
|
+
|
|
582
|
+
const startDate = lastNDay.toLocaleDateString() + ' ' + lastNDay.toLocaleTimeString()
|
|
583
|
+
const endDate = currentDate.toLocaleDateString() + ' ' + currentDate.toLocaleTimeString()
|
|
584
|
+
console.log(`getLastNDay从 ${startDate} 开始,到 ${endDate} 结束`)
|
|
585
|
+
retur[(lastNDay, currentDate)]
|
|
621
586
|
}
|
|
622
587
|
export function getPropValue(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
588
|
+
propValue,
|
|
589
|
+
entity,
|
|
590
|
+
additionalParamMap,
|
|
591
|
+
contextParameterMap,
|
|
592
|
+
parentEntity,
|
|
593
|
+
subEntity,
|
|
594
|
+
task
|
|
630
595
|
) {
|
|
631
|
-
|
|
632
|
-
|
|
596
|
+
const pageContext = {
|
|
597
|
+
entity: {
|
|
598
|
+
data: entity,
|
|
599
|
+
context: contextParameterMap,
|
|
600
|
+
request: additionalParamMap,
|
|
601
|
+
parent: parentEntity,
|
|
602
|
+
row: subEntity,
|
|
603
|
+
task: task
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return getPropValueNew(propValue, pageContext)
|
|
633
607
|
}
|
|
634
608
|
|
|
635
|
-
function getAdditionalParamMap(pageContext){
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
const requestMap = pageContext.entity.request
|
|
642
|
-
if (requestMap) {
|
|
643
|
-
Object.assign(additionalParamMap, requestMap)
|
|
644
|
-
}
|
|
645
|
-
return additionalParamMap
|
|
609
|
+
function getAdditionalParamMap(pageContext) {
|
|
610
|
+
if (pageContext && pageContext.entity) {
|
|
611
|
+
let additionalParamMap = pageContext.entity.page
|
|
612
|
+
if (!additionalParamMap) {
|
|
613
|
+
additionalParamMap = {}
|
|
646
614
|
}
|
|
615
|
+
const requestMap = pageContext.entity.request
|
|
616
|
+
if (requestMap) {
|
|
617
|
+
Object.assign(additionalParamMap, requestMap)
|
|
618
|
+
}
|
|
619
|
+
return additionalParamMap
|
|
647
620
|
}
|
|
621
|
+
}
|
|
648
622
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
623
|
+
export function getPropValueNew(propValue, pageContext) {
|
|
624
|
+
let value = null
|
|
625
|
+
if (propValue && propValue !== null && propValue !== '') {
|
|
626
|
+
const entity = pageContext && pageContext.entity ? pageContext.entity.data : null
|
|
627
|
+
const additionalParamMap = getAdditionalParamMap(pageContext)
|
|
628
|
+
const contextParameterMap = pageContext && pageContext.entity ? pageContext.entity.context : null
|
|
629
|
+
const parentEntity =
|
|
630
|
+
pageContext && pageContext.entity
|
|
631
|
+
? pageContext.entity.parent
|
|
632
|
+
? pageContext.entity.parent
|
|
633
|
+
: pageContext.entity.data
|
|
634
|
+
: null
|
|
635
|
+
const subEntity = pageContext && pageContext.entity ? pageContext.entity.row : null
|
|
636
|
+
const task = pageContext && pageContext.entity ? pageContext.entity.task : null
|
|
637
|
+
const system = pageContext && pageContext.entity ? pageContext.entity.system : null
|
|
638
|
+
if (propValue === 'null') {
|
|
639
|
+
value = null
|
|
640
|
+
} else if (
|
|
641
|
+
propValue.includes('${context.') ||
|
|
642
|
+
propValue.includes('${request.') ||
|
|
643
|
+
propValue.includes('${obj.') ||
|
|
644
|
+
propValue.includes('${data.')
|
|
645
|
+
) {
|
|
646
|
+
// 填写的固定值
|
|
647
|
+
if (propValue.includes('${context.')) {
|
|
648
|
+
propValue = propValue.replace('${context.', '').replace('}', '')
|
|
649
|
+
value = getContextValue(contextParameterMap, propValue)
|
|
650
|
+
} else if (propValue.includes('${request.') && propValue !== '${request.term}') {
|
|
651
|
+
// ${request.term}表示页面中手动输入的值
|
|
652
|
+
propValue = propValue.replace('${request.', '').replace('}', '')
|
|
653
|
+
if (
|
|
654
|
+
additionalParamMap &&
|
|
655
|
+
additionalParamMap != null &&
|
|
656
|
+
Object.keys(additionalParamMap).indexOf(propValue) >= 0 &&
|
|
657
|
+
additionalParamMap[propValue] &&
|
|
658
|
+
additionalParamMap[propValue] !== null
|
|
669
659
|
) {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
additionalParamMap[propValue] &&
|
|
685
|
-
additionalParamMap[propValue] !== null
|
|
686
|
-
) {
|
|
687
|
-
value = additionalParamMap[propValue]
|
|
688
|
-
} else {
|
|
689
|
-
value = null
|
|
690
|
-
}
|
|
691
|
-
} else if (propValue.includes('${obj.')) {
|
|
692
|
-
if (entity === undefined || entity == null) {
|
|
693
|
-
value = null
|
|
694
|
-
} else {
|
|
695
|
-
const propName = propValue.replace('${obj.', '').replace('}', '')
|
|
696
|
-
value = getEntityFieldValue(entity, propName)
|
|
697
|
-
}
|
|
698
|
-
} else if (propValue.includes('${data.')) {
|
|
699
|
-
if (entity === undefined || entity == null) {
|
|
700
|
-
value = null
|
|
701
|
-
} else {
|
|
702
|
-
const propName = propValue.replace('${data.', '').replace('}', '')
|
|
703
|
-
value = getEntityFieldValue(entity, propName)
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
} else if (propValue.includes('${parent.')) {
|
|
707
|
-
if (parentEntity === undefined || parentEntity == null) {
|
|
708
|
-
value = null
|
|
709
|
-
} else {
|
|
710
|
-
const propName = propValue.replace('${parent.', '').replace('}', '')
|
|
711
|
-
value = getEntityFieldValue(parentEntity, propName)
|
|
712
|
-
}
|
|
713
|
-
}else if (propValue.includes('${system.')) {
|
|
714
|
-
if (system === undefined || system == null) {
|
|
715
|
-
value = null
|
|
716
|
-
} else {
|
|
717
|
-
const propName = propValue.replace('${system.', '').replace('}', '')
|
|
718
|
-
value = getEntityFieldValue(system, propName)
|
|
719
|
-
}
|
|
720
|
-
} else if (propValue.includes('${task.')) {
|
|
721
|
-
if (task === undefined || task == null) {
|
|
722
|
-
value = null
|
|
723
|
-
} else {
|
|
724
|
-
const propName = propValue.replace('${task.', '').replace('}', '')
|
|
725
|
-
value = getEntityFieldValue(task, propName)
|
|
726
|
-
}
|
|
727
|
-
} else if (propValue.includes('${subObj.')) {
|
|
728
|
-
if (subEntity === undefined || subEntity == null) {
|
|
729
|
-
value = null
|
|
730
|
-
} else {
|
|
731
|
-
const propName = propValue.replace('${subObj.', '').replace('}', '')
|
|
732
|
-
value = getEntityFieldValue(subEntity, propName)
|
|
733
|
-
}
|
|
734
|
-
}else if (propValue.includes('${input.') ) {
|
|
735
|
-
value = propValue.replace('${input.', '').replace('}', '')
|
|
736
|
-
} else if (propValue.includes('${fixed.')) {
|
|
737
|
-
value = propValue.replace('${fixed.', '').replace('}', '')
|
|
660
|
+
value = additionalParamMap[propValue]
|
|
661
|
+
} else {
|
|
662
|
+
value = null
|
|
663
|
+
}
|
|
664
|
+
} else if (propValue.includes('${obj.')) {
|
|
665
|
+
if (entity === undefined || entity == null) {
|
|
666
|
+
value = null
|
|
667
|
+
} else {
|
|
668
|
+
const propName = propValue.replace('${obj.', '').replace('}', '')
|
|
669
|
+
value = getEntityFieldValue(entity, propName)
|
|
670
|
+
}
|
|
671
|
+
} else if (propValue.includes('${data.')) {
|
|
672
|
+
if (entity === undefined || entity == null) {
|
|
673
|
+
value = null
|
|
738
674
|
} else {
|
|
739
|
-
|
|
675
|
+
const propName = propValue.replace('${data.', '').replace('}', '')
|
|
676
|
+
value = getEntityFieldValue(entity, propName)
|
|
740
677
|
}
|
|
678
|
+
}
|
|
679
|
+
} else if (propValue.includes('${parent.')) {
|
|
680
|
+
if (parentEntity === undefined || parentEntity == null) {
|
|
681
|
+
value = null
|
|
682
|
+
} else {
|
|
683
|
+
const propName = propValue.replace('${parent.', '').replace('}', '')
|
|
684
|
+
value = getEntityFieldValue(parentEntity, propName)
|
|
685
|
+
}
|
|
686
|
+
} else if (propValue.includes('${system.')) {
|
|
687
|
+
if (system === undefined || system == null) {
|
|
688
|
+
value = null
|
|
689
|
+
} else {
|
|
690
|
+
const propName = propValue.replace('${system.', '').replace('}', '')
|
|
691
|
+
value = getEntityFieldValue(system, propName)
|
|
692
|
+
}
|
|
693
|
+
} else if (propValue.includes('${task.')) {
|
|
694
|
+
if (task === undefined || task == null) {
|
|
695
|
+
value = null
|
|
696
|
+
} else {
|
|
697
|
+
const propName = propValue.replace('${task.', '').replace('}', '')
|
|
698
|
+
value = getEntityFieldValue(task, propName)
|
|
699
|
+
}
|
|
700
|
+
} else if (propValue.includes('${subObj.')) {
|
|
701
|
+
if (subEntity === undefined || subEntity == null) {
|
|
702
|
+
value = null
|
|
703
|
+
} else {
|
|
704
|
+
const propName = propValue.replace('${subObj.', '').replace('}', '')
|
|
705
|
+
value = getEntityFieldValue(subEntity, propName)
|
|
706
|
+
}
|
|
707
|
+
} else if (propValue.includes('${input.')) {
|
|
708
|
+
value = propValue.replace('${input.', '').replace('}', '')
|
|
709
|
+
} else if (propValue.includes('${fixed.')) {
|
|
710
|
+
value = propValue.replace('${fixed.', '').replace('}', '')
|
|
711
|
+
} else {
|
|
712
|
+
value = propValue
|
|
741
713
|
}
|
|
742
|
-
|
|
714
|
+
}
|
|
715
|
+
return value
|
|
743
716
|
}
|
|
744
717
|
|
|
745
718
|
/**
|
|
@@ -750,41 +723,27 @@ function getAdditionalParamMap(pageContext){
|
|
|
750
723
|
* @param {*} contextParameter
|
|
751
724
|
* @returns
|
|
752
725
|
*/
|
|
753
|
-
export function analysisValue(
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
) {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
value = getPropValue(
|
|
775
|
-
item,
|
|
776
|
-
entity,
|
|
777
|
-
additionalParameter,
|
|
778
|
-
contextParameter
|
|
779
|
-
)
|
|
780
|
-
}
|
|
781
|
-
if (!value || value === null) {
|
|
782
|
-
value = ''
|
|
783
|
-
}
|
|
784
|
-
label += value
|
|
785
|
-
})
|
|
786
|
-
}
|
|
787
|
-
return label
|
|
726
|
+
export function analysisValue(conditionValue, entity, additionalParameter, contextParameter, pageContext) {
|
|
727
|
+
if (!conditionValue) {
|
|
728
|
+
return
|
|
729
|
+
}
|
|
730
|
+
let label = ''
|
|
731
|
+
const split = conditionValue.split('-#-#')
|
|
732
|
+
if (split != null && split.length > 0) {
|
|
733
|
+
split.forEach((item) => {
|
|
734
|
+
let value
|
|
735
|
+
if (pageContext) {
|
|
736
|
+
value = getPropValueNew(item, pageContext)
|
|
737
|
+
} else {
|
|
738
|
+
value = getPropValue(item, entity, additionalParameter, contextParameter)
|
|
739
|
+
}
|
|
740
|
+
if (!value || value === null) {
|
|
741
|
+
value = ''
|
|
742
|
+
}
|
|
743
|
+
label += value
|
|
744
|
+
})
|
|
745
|
+
}
|
|
746
|
+
return label
|
|
788
747
|
}
|
|
789
748
|
|
|
790
749
|
/**
|
|
@@ -794,29 +753,29 @@ export function analysisValue(
|
|
|
794
753
|
* @param {*} value
|
|
795
754
|
*/
|
|
796
755
|
export function setEntityFieldValue(entity, prop, value) {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
} else {
|
|
806
|
-
// 静态对象属性赋值,提高性能
|
|
807
|
-
parentObj[subProp] = value
|
|
808
|
-
}
|
|
809
|
-
}
|
|
756
|
+
if (prop && entity) {
|
|
757
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
758
|
+
const parentObj = getParentObjectUtil(prop, entity)
|
|
759
|
+
if (parentObj) {
|
|
760
|
+
const subProp = prop.substring(prop.lastIndexOf('.') + 1)
|
|
761
|
+
if (parentObj[subProp] === undefined) {
|
|
762
|
+
// 动态对象属性赋值,防止属性不存在,导致属性无法赋值问题
|
|
763
|
+
parentObj[prop.substring(prop.lastIndexOf('.') + 1)] = value
|
|
810
764
|
} else {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
entity[prop] = value
|
|
814
|
-
} else {
|
|
815
|
-
// 静态对象属性赋值,提高性能
|
|
816
|
-
entity[prop] = value
|
|
817
|
-
}
|
|
765
|
+
// 静态对象属性赋值,提高性能
|
|
766
|
+
parentObj[subProp] = value
|
|
818
767
|
}
|
|
768
|
+
}
|
|
769
|
+
} else {
|
|
770
|
+
if (entity[prop] === undefined || entity[prop] === null) {
|
|
771
|
+
// 动态对象属性赋值,防止属性不存在,导致属性无法赋值问题
|
|
772
|
+
entity[prop] = value
|
|
773
|
+
} else {
|
|
774
|
+
// 静态对象属性赋值,提高性能
|
|
775
|
+
entity[prop] = value
|
|
776
|
+
}
|
|
819
777
|
}
|
|
778
|
+
}
|
|
820
779
|
}
|
|
821
780
|
|
|
822
781
|
/**
|
|
@@ -826,13 +785,13 @@ export function setEntityFieldValue(entity, prop, value) {
|
|
|
826
785
|
* @returns
|
|
827
786
|
*/
|
|
828
787
|
export function getEntityFieldValueWithOutCase(entity, prop) {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
788
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
789
|
+
const parentOjbect = getParentObjectUtil(prop, entity)
|
|
790
|
+
const modelName = prop.substring(prop.lastIndexOf('.') + 1)
|
|
791
|
+
return parentOjbect[modelName]
|
|
792
|
+
} else {
|
|
793
|
+
return entity[prop]
|
|
794
|
+
}
|
|
836
795
|
}
|
|
837
796
|
|
|
838
797
|
/**
|
|
@@ -842,68 +801,71 @@ export function getEntityFieldValueWithOutCase(entity, prop) {
|
|
|
842
801
|
* @returns
|
|
843
802
|
*/
|
|
844
803
|
export function getEntityFieldValue(entity, prop, isLowerCase) {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
804
|
+
if (!prop) {
|
|
805
|
+
return null
|
|
806
|
+
}
|
|
807
|
+
let value = getEntityFieldValueWithCase(entity, prop)
|
|
808
|
+
if (value === undefined || value === null) {
|
|
809
|
+
// 兼容mysql数据库
|
|
810
|
+
value = getEntityFieldValueWithCase(entity, prop.toLowerCase())
|
|
811
|
+
}
|
|
812
|
+
if (value === undefined || (value === null && isLowerCase === undefined)) {
|
|
813
|
+
// 兼容oracle数据库
|
|
814
|
+
value = getEntityFieldValueWithCase(entity, prop.toUpperCase())
|
|
815
|
+
}
|
|
816
|
+
return value
|
|
855
817
|
}
|
|
856
818
|
|
|
857
819
|
function getEntityFieldValueWithCase(entity, prop) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
820
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
821
|
+
const parentOjbect = getParentObjectUtil(prop, entity)
|
|
822
|
+
const modelName = prop.substring(prop.lastIndexOf('.') + 1)
|
|
823
|
+
return parentOjbect[modelName]
|
|
824
|
+
} else {
|
|
825
|
+
return entity[prop]
|
|
826
|
+
}
|
|
865
827
|
}
|
|
866
828
|
|
|
867
829
|
export function getParentObjectUtil(prop, entity) {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
}
|
|
882
|
-
return parentObject
|
|
830
|
+
const nestedProp = prop.split('.')
|
|
831
|
+
// 属性只有一个时父对象就是models
|
|
832
|
+
if (nestedProp.length === 1) {
|
|
833
|
+
return entity
|
|
834
|
+
} else {
|
|
835
|
+
let parentObject
|
|
836
|
+
// 属性超过2个时先找到最后一层属性的父对象
|
|
837
|
+
for (let i = 0; i < nestedProp.length - 1; i++) {
|
|
838
|
+
if (i === 0) {
|
|
839
|
+
parentObject = getParentModelProp(nestedProp[i], entity)
|
|
840
|
+
} else {
|
|
841
|
+
parentObject = getParentModelProp(nestedProp[i], parentObject)
|
|
842
|
+
}
|
|
883
843
|
}
|
|
844
|
+
return parentObject
|
|
845
|
+
}
|
|
884
846
|
}
|
|
885
847
|
|
|
886
848
|
function getParentModelProp(prop, parentObj) {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
849
|
+
let myPparentObject = getParentModelPropWithCase(prop, parentObj)
|
|
850
|
+
if (myPparentObject === undefined) {
|
|
851
|
+
// 兼容mysql数据库
|
|
852
|
+
myPparentObject = getParentModelPropWithCase(prop.toLowerCase(), parentObj)
|
|
853
|
+
}
|
|
854
|
+
if (myPparentObject === undefined) {
|
|
855
|
+
// 兼容oracle数据库
|
|
856
|
+
myPparentObject = getParentModelPropWithCase(prop.toUpperCase(), parentObj)
|
|
857
|
+
}
|
|
858
|
+
return myPparentObject
|
|
897
859
|
}
|
|
898
860
|
|
|
899
861
|
function getParentModelPropWithCase(prop, parentObj) {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
862
|
+
if (!parentObj) {
|
|
863
|
+
parentObj = {}
|
|
864
|
+
}
|
|
865
|
+
if (!parentObj[prop] && !parentObj[prop.toUpperCase()]) {
|
|
866
|
+
parentObj[prop] = {}
|
|
867
|
+
}
|
|
868
|
+
return parentObj[prop]
|
|
907
869
|
}
|
|
908
870
|
|
|
909
871
|
/**
|
|
@@ -912,66 +874,53 @@ function getParentModelPropWithCase(prop, parentObj) {
|
|
|
912
874
|
* @returns
|
|
913
875
|
*/
|
|
914
876
|
export function findSystemInfoByCode(systemCode) {
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
877
|
+
return new Promise((resolve, reject) => {
|
|
878
|
+
if (!systemCode) {
|
|
879
|
+
systemCode = window.$vueApp.config.globalProperties.systemCode
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
window.$vueApp.config.globalProperties.$http
|
|
883
|
+
.get(window.$vueApp.config.globalProperties.baseAPI + '/component/business-systems/' + systemCode)
|
|
884
|
+
.then((system) => {
|
|
885
|
+
if (system) {
|
|
886
|
+
resolve({
|
|
887
|
+
zh_CN: system.name,
|
|
888
|
+
en_US: system.enName,
|
|
889
|
+
frontendUrl: system.frontendUrl
|
|
890
|
+
})
|
|
891
|
+
} else {
|
|
892
|
+
resolve('系统:' + systemCode + '不存在')
|
|
918
893
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
systemCode
|
|
925
|
-
)
|
|
926
|
-
.then((system) => {
|
|
927
|
-
if (system) {
|
|
928
|
-
resolve({
|
|
929
|
-
zh_CN: system.name,
|
|
930
|
-
en_US: system.enName,
|
|
931
|
-
frontendUrl: system.frontendUrl,
|
|
932
|
-
})
|
|
933
|
-
} else {
|
|
934
|
-
resolve('系统:' + systemCode + '不存在')
|
|
935
|
-
}
|
|
936
|
-
})
|
|
937
|
-
.catch((error) => {
|
|
938
|
-
reject(error)
|
|
939
|
-
})
|
|
940
|
-
})
|
|
894
|
+
})
|
|
895
|
+
.catch((error) => {
|
|
896
|
+
reject(error)
|
|
897
|
+
})
|
|
898
|
+
})
|
|
941
899
|
}
|
|
942
900
|
|
|
943
901
|
export function getPropNameWhenJoinTable(prop, isJoinTable, tableName) {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
prop.indexOf(tableName + replaceDot) < 0
|
|
955
|
-
) {
|
|
956
|
-
// 如果属性名没有拼接表名才需要拼接
|
|
957
|
-
prop = tableName + replaceDot + prop
|
|
958
|
-
}
|
|
959
|
-
}
|
|
902
|
+
if (prop && isJoinTable !== undefined && isJoinTable === true) {
|
|
903
|
+
// 关联表时将点改成下划线,如果没点,则表示是主表字段,拼接主表tableName,因为列表组件中是这样处理的
|
|
904
|
+
const replaceDot = '__'
|
|
905
|
+
if (prop.indexOf('.') > 0) {
|
|
906
|
+
prop = prop.replace('.', replaceDot)
|
|
907
|
+
} else {
|
|
908
|
+
if (tableName && tableName !== null && tableName !== '' && prop.indexOf(tableName + replaceDot) < 0) {
|
|
909
|
+
// 如果属性名没有拼接表名才需要拼接
|
|
910
|
+
prop = tableName + replaceDot + prop
|
|
911
|
+
}
|
|
960
912
|
}
|
|
961
|
-
|
|
913
|
+
}
|
|
914
|
+
return prop
|
|
962
915
|
}
|
|
963
916
|
|
|
964
917
|
export function isImage(fileName) {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
return true
|
|
974
|
-
} else {
|
|
975
|
-
return false
|
|
976
|
-
}
|
|
918
|
+
// const fileType = fileName.substring(fileName.lastIndexOf('.'), fileName.length).toLowerCase()
|
|
919
|
+
// const imageTypes = ['.jpg', '.JPG', '.png', '.bmp', '.BMP', '.jpeg', '.gif', '.psd', '.tif', '.tga', '.svg', '.eps']
|
|
920
|
+
// const index = imageTypes.indexOf(fileType)
|
|
921
|
+
if (fileName && /\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|bmp|BMP|psd|PSD|tif|TIF)$/.test(fileName)) {
|
|
922
|
+
return true
|
|
923
|
+
} else {
|
|
924
|
+
return false
|
|
925
|
+
}
|
|
977
926
|
}
|