agilebuilder-ui 1.1.35 → 1.1.36-sit1
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/{401-20f1c97c.js → 401-e367a09a.js} +1 -1
- package/lib/{404-36d09e24.js → 404-45104bc5.js} +1 -1
- package/lib/{iframe-page-51c292dc.js → iframe-page-8a758d4d.js} +1 -1
- package/lib/{index-19f46200.js → index-8c6ab0ba.js} +2054 -1966
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +100 -100
- package/lib/{tab-content-iframe-index-5d9d85c0.js → tab-content-iframe-index-16f7cb65.js} +1 -1
- package/lib/{tab-content-index-bd535c86.js → tab-content-index-f136be89.js} +1 -1
- package/lib/{tache-subprocess-history-56bf69ba.js → tache-subprocess-history-4f9a7773.js} +1 -1
- package/package.json +1 -1
- package/packages/department-tree/src/department-tree.vue +130 -123
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +435 -466
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +335 -342
- package/packages/department-tree-inline/src/department-tree-inline.vue +18 -11
- package/packages/department-tree-inline/src/department-tree-service.js +10 -11
- package/packages/department-tree-mobile/src/department-tree-app.vue +103 -75
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +256 -225
- package/packages/department-tree-mobile/src/department-tree-service.ts +98 -75
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +111 -115
- package/packages/department-user-tree/src/department-user-single-tree.vue +85 -88
- package/packages/department-user-tree/src/department-user-tree.vue +127 -119
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +6 -1
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +5 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +18 -11
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +25 -51
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +97 -90
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +28 -32
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +103 -75
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +282 -224
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +58 -51
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +1 -1
- package/packages/organization-input/src/organization-input.vue +34 -12
- package/packages/super-grid/src/apis.js +21 -4
- package/packages/super-grid/src/dynamic-input.vue +1 -12
- package/packages/super-grid/src/formatter.js +4 -3
- package/packages/super-grid/src/normal-column-content.vue +25 -1
- package/packages/super-grid/src/row-operation.vue +23 -13
- package/packages/super-grid/src/search-form-open.vue +0 -1
- package/packages/super-grid/src/super-grid-service.js +1 -1
- package/packages/super-grid/src/super-grid.vue +51 -42
- package/packages/super-grid/src/utils.js +19 -6
- package/packages/super-icon/src/index.vue +11 -2
- package/packages/utils/value-set.js +147 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +117 -110
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +6 -1
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +103 -75
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +229 -208
- package/src/api/sso-service.js +6 -5
- package/src/store/modules/table.js +0 -1
- package/src/styles/theme/black/font-style.scss +2 -0
- package/src/styles/theme/blue/font-style.scss +2 -0
- package/src/styles/theme/blue2/font-style.scss +2 -0
- package/src/styles/theme/dark-blue/font.scss +2 -0
- package/src/styles/theme/dark-blue/sidebar.scss +8 -0
- package/src/styles/theme/gray/font-style.scss +2 -0
- package/src/styles/theme/green/font.scss +3 -1
- package/src/styles/theme/green/sidebar.scss +9 -0
- package/src/styles/theme/ocean-blue/font.scss +3 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +8 -0
- package/src/styles/theme/tiffany-blue-mobile/font.scss +2 -0
- package/src/styles/theme/tiffany-blue-mobile/sidebar.scss +8 -0
- package/src/utils/file-util.ts +32 -0
- package/src/utils/insert_css.js +1 -1
- package/src/utils/util.js +721 -715
- package/src/views/dsc-component/Sidebar/Item.vue +7 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -2
- package/src/views/dsc-component/Sidebar/index.vue +36 -18
- package/src/views/layout/components/Menubar/Item.vue +0 -9
- package/src/views/layout/components/Menubar/SidebarItem.vue +2 -2
- package/src/views/layout/components/Sidebar/Item.vue +4 -1
- package/src/views/layout/components/Sidebar/SidebarItem.vue +2 -2
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,45 +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
|
-
})
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
if (!options) {
|
|
65
|
-
options = []
|
|
66
|
-
}
|
|
67
|
-
resolve(options)
|
|
68
|
-
})
|
|
69
|
-
.catch((error) => {
|
|
70
|
-
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
|
|
71
61
|
})
|
|
72
|
-
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
if (!options) {
|
|
65
|
+
options = []
|
|
66
|
+
}
|
|
67
|
+
resolve(options)
|
|
68
|
+
})
|
|
69
|
+
.catch((error) => {
|
|
70
|
+
reject(error)
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
@@ -80,84 +80,84 @@ export function findOptionsByDynamicDataSource(
|
|
|
80
80
|
* @returns
|
|
81
81
|
*/
|
|
82
82
|
export function findDynamicDataSourceByCode(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
dynamicSourceCode,
|
|
84
|
+
searchText,
|
|
85
|
+
entity,
|
|
86
|
+
additionalParameterStr,
|
|
87
|
+
searchParam
|
|
88
88
|
) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
|
130
|
+
|
|
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表示需要使用动态数据源所属的系统路径重新获得一次数据
|
|
139
144
|
window.$vueApp.config.globalProperties.$http
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
.catch((error) => {
|
|
157
|
-
reject(error)
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
})
|
|
145
|
+
.post(result.backendUrl + '/common/dynamic-data-source/' + dynamicSourceCode, params)
|
|
146
|
+
.then((finallyResult) => {
|
|
147
|
+
resolve(finallyResult)
|
|
148
|
+
})
|
|
149
|
+
.catch((error) => {
|
|
150
|
+
reject(error)
|
|
151
|
+
})
|
|
152
|
+
} else {
|
|
153
|
+
resolve(result)
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
.catch((error) => {
|
|
157
|
+
reject(error)
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/**
|
|
@@ -171,233 +171,233 @@ export function findDynamicDataSourceByCode(
|
|
|
171
171
|
* @returns
|
|
172
172
|
*/
|
|
173
173
|
export function analysisCondition(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
conditionListJson,
|
|
175
|
+
entity,
|
|
176
|
+
additionalParameter,
|
|
177
|
+
contextParameter,
|
|
178
|
+
isSql,
|
|
179
|
+
tableName,
|
|
180
|
+
parentFormData,
|
|
181
|
+
pageContext
|
|
182
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
|
-
|
|
219
|
-
|
|
220
|
-
entity,
|
|
221
|
-
conditionList,
|
|
222
|
-
isSql,
|
|
223
|
-
tableName,
|
|
224
|
-
additionalParameterMap,
|
|
225
|
-
contextParameterMap,
|
|
226
|
-
parentFormData,
|
|
227
|
-
pageContext
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
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(
|
|
232
220
|
entity,
|
|
233
221
|
conditionList,
|
|
234
222
|
isSql,
|
|
235
223
|
tableName,
|
|
236
|
-
|
|
224
|
+
additionalParameterMap,
|
|
237
225
|
contextParameterMap,
|
|
238
226
|
parentFormData,
|
|
239
227
|
pageContext
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function parseCondition(
|
|
232
|
+
entity,
|
|
233
|
+
conditionList,
|
|
234
|
+
isSql,
|
|
235
|
+
tableName,
|
|
236
|
+
additionalParamMap,
|
|
237
|
+
contextParameterMap,
|
|
238
|
+
parentFormData,
|
|
239
|
+
pageContext
|
|
240
240
|
) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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)
|
|
254
271
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
|
273
316
|
} else {
|
|
274
|
-
|
|
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
|
-
}
|
|
317
|
+
conditionResult = false
|
|
285
318
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
319
|
+
}
|
|
320
|
+
}
|
|
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', '||')
|
|
297
335
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
} else {
|
|
317
|
-
conditionResult = false
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
336
|
+
conditions += joinSign + ' '
|
|
337
|
+
}
|
|
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
|
+
}
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
const REPLACE_DOT = '__'
|
|
350
350
|
|
|
351
351
|
function getValue(entityData, fieldName, isSql) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
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)
|
|
366
363
|
}
|
|
364
|
+
}
|
|
367
365
|
}
|
|
366
|
+
}
|
|
368
367
|
}
|
|
369
|
-
|
|
368
|
+
}
|
|
369
|
+
return value
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
export function getValueByField(entityData, fieldName) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
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
|
+
}
|
|
385
383
|
}
|
|
384
|
+
return value
|
|
385
|
+
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
function getSubEntityValue(entityData, fieldName) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
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)
|
|
399
398
|
}
|
|
400
|
-
|
|
399
|
+
}
|
|
400
|
+
return value
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
/**
|
|
@@ -408,18 +408,18 @@ function getSubEntityValue(entityData, fieldName) {
|
|
|
408
408
|
* @return
|
|
409
409
|
*/
|
|
410
410
|
function getSubEntityFieldValue(subEntityData, fieldName) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
411
|
+
if (subEntityData === undefined || subEntityData === null) {
|
|
412
|
+
return null
|
|
413
|
+
}
|
|
414
|
+
return subEntityData[fieldName]
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
function getContextValue(contextParameterMap, propValue) {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
418
|
+
let value = getLastNDate(propValue)
|
|
419
|
+
if (contextParameterMap) {
|
|
420
|
+
value = contextParameterMap[propValue]
|
|
421
|
+
}
|
|
422
|
+
return value
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* 获得最近n天的开始日期和结束日期集合
|
|
@@ -427,33 +427,33 @@ function getContextValue(contextParameterMap, propValue) {
|
|
|
427
427
|
* @returns [startDate,endDate],例如:[2024/2/26 00:00:00,2023/3/3 23:59:59]
|
|
428
428
|
*/
|
|
429
429
|
export function getLastNDate(propValue) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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
|
|
457
457
|
}
|
|
458
458
|
/**
|
|
459
459
|
* 获得当前周的周一和周日的的日期
|
|
@@ -461,17 +461,17 @@ export function getLastNDate(propValue) {
|
|
|
461
461
|
* @returns
|
|
462
462
|
*/
|
|
463
463
|
function getCurrentWeek() {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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]
|
|
475
475
|
}
|
|
476
476
|
/**
|
|
477
477
|
* 获得当前月第1天和最后1天的日期
|
|
@@ -479,33 +479,33 @@ function getCurrentWeek() {
|
|
|
479
479
|
* @returns [xxx,xxx]
|
|
480
480
|
*/
|
|
481
481
|
function getCurrentMonth() {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
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]
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
* 获得当前季度第1天和最后一天的日期
|
|
@@ -513,26 +513,26 @@ function getCurrentMonth() {
|
|
|
513
513
|
* @returns
|
|
514
514
|
*/
|
|
515
515
|
function getCurrentQuarter() {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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
|
+
}
|
|
524
|
+
|
|
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]
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
538
538
|
* 获得本年的第1天和最后一天的日期
|
|
@@ -540,21 +540,21 @@ function getCurrentQuarter() {
|
|
|
540
540
|
* @returns
|
|
541
541
|
*/
|
|
542
542
|
function getCurrentYear() {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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]
|
|
558
558
|
}
|
|
559
559
|
/**
|
|
560
560
|
* 获得最近n天的日期[n天前,当前日期]。
|
|
@@ -562,157 +562,163 @@ function getCurrentYear() {
|
|
|
562
562
|
* @param {} n
|
|
563
563
|
*/
|
|
564
564
|
function getLastNDay(n) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
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)]
|
|
586
586
|
}
|
|
587
587
|
export function getPropValue(
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
588
|
+
propValue,
|
|
589
|
+
entity,
|
|
590
|
+
additionalParamMap,
|
|
591
|
+
contextParameterMap,
|
|
592
|
+
parentEntity,
|
|
593
|
+
subEntity,
|
|
594
|
+
task
|
|
595
595
|
) {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
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)
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
function getAdditionalParamMap(pageContext) {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
}
|
|
619
|
-
return additionalParamMap
|
|
610
|
+
if (pageContext && pageContext.entity) {
|
|
611
|
+
let additionalParamMap = pageContext.entity.page
|
|
612
|
+
if (!additionalParamMap) {
|
|
613
|
+
additionalParamMap = {}
|
|
614
|
+
}
|
|
615
|
+
const requestMap = pageContext.entity.request
|
|
616
|
+
if (requestMap) {
|
|
617
|
+
Object.assign(additionalParamMap, requestMap)
|
|
620
618
|
}
|
|
619
|
+
return additionalParamMap
|
|
620
|
+
}
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
-
export function getPropValueNew(propValue, pageContext) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
623
|
+
export function getPropValueNew(propValue, pageContext, row) {
|
|
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 (propValue.startsWith('${row.')) {
|
|
641
|
+
// 处理表格行数据 ${row.fieldName}
|
|
642
|
+
if (row) {
|
|
643
|
+
const propName = propValue.replace('${row.', '').replace('}', '')
|
|
644
|
+
value = getEntityFieldValue(row, propName)
|
|
645
|
+
}
|
|
646
|
+
} else if (
|
|
647
|
+
propValue.includes('${context.') ||
|
|
648
|
+
propValue.includes('${request.') ||
|
|
649
|
+
propValue.includes('${obj.') ||
|
|
650
|
+
propValue.includes('${data.')
|
|
651
|
+
) {
|
|
652
|
+
// 填写的固定值
|
|
653
|
+
if (propValue.includes('${context.')) {
|
|
654
|
+
propValue = propValue.replace('${context.', '').replace('}', '')
|
|
655
|
+
value = getContextValue(contextParameterMap, propValue)
|
|
656
|
+
} else if (propValue.includes('${request.') && propValue !== '${request.term}') {
|
|
657
|
+
// ${request.term}表示页面中手动输入的值
|
|
658
|
+
propValue = propValue.replace('${request.', '').replace('}', '')
|
|
659
|
+
if (
|
|
660
|
+
additionalParamMap &&
|
|
661
|
+
additionalParamMap != null &&
|
|
662
|
+
Object.keys(additionalParamMap).indexOf(propValue) >= 0 &&
|
|
663
|
+
additionalParamMap[propValue] &&
|
|
664
|
+
additionalParamMap[propValue] !== null
|
|
645
665
|
) {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
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
|
|
674
|
-
} else {
|
|
675
|
-
const propName = propValue.replace('${data.', '').replace('}', '')
|
|
676
|
-
value = getEntityFieldValue(entity, propName)
|
|
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('}', '')
|
|
666
|
+
value = additionalParamMap[propValue]
|
|
667
|
+
} else {
|
|
668
|
+
value = null
|
|
669
|
+
}
|
|
670
|
+
} else if (propValue.includes('${obj.')) {
|
|
671
|
+
if (entity === undefined || entity == null) {
|
|
672
|
+
value = null
|
|
673
|
+
} else {
|
|
674
|
+
const propName = propValue.replace('${obj.', '').replace('}', '')
|
|
675
|
+
value = getEntityFieldValue(entity, propName)
|
|
676
|
+
}
|
|
677
|
+
} else if (propValue.includes('${data.')) {
|
|
678
|
+
if (entity === undefined || entity == null) {
|
|
679
|
+
value = null
|
|
711
680
|
} else {
|
|
712
|
-
|
|
681
|
+
const propName = propValue.replace('${data.', '').replace('}', '')
|
|
682
|
+
value = getEntityFieldValue(entity, propName)
|
|
713
683
|
}
|
|
684
|
+
}
|
|
685
|
+
} else if (propValue.includes('${parent.')) {
|
|
686
|
+
if (parentEntity === undefined || parentEntity == null) {
|
|
687
|
+
value = null
|
|
688
|
+
} else {
|
|
689
|
+
const propName = propValue.replace('${parent.', '').replace('}', '')
|
|
690
|
+
value = getEntityFieldValue(parentEntity, propName)
|
|
691
|
+
}
|
|
692
|
+
} else if (propValue.includes('${system.')) {
|
|
693
|
+
if (system === undefined || system == null) {
|
|
694
|
+
value = null
|
|
695
|
+
} else {
|
|
696
|
+
const propName = propValue.replace('${system.', '').replace('}', '')
|
|
697
|
+
value = getEntityFieldValue(system, propName)
|
|
698
|
+
}
|
|
699
|
+
} else if (propValue.includes('${task.')) {
|
|
700
|
+
if (task === undefined || task == null) {
|
|
701
|
+
value = null
|
|
702
|
+
} else {
|
|
703
|
+
const propName = propValue.replace('${task.', '').replace('}', '')
|
|
704
|
+
value = getEntityFieldValue(task, propName)
|
|
705
|
+
}
|
|
706
|
+
} else if (propValue.includes('${subObj.')) {
|
|
707
|
+
if (subEntity === undefined || subEntity == null) {
|
|
708
|
+
value = null
|
|
709
|
+
} else {
|
|
710
|
+
const propName = propValue.replace('${subObj.', '').replace('}', '')
|
|
711
|
+
value = getEntityFieldValue(subEntity, propName)
|
|
712
|
+
}
|
|
713
|
+
} else if (propValue.includes('${input.')) {
|
|
714
|
+
value = propValue.replace('${input.', '').replace('}', '')
|
|
715
|
+
} else if (propValue.includes('${fixed.')) {
|
|
716
|
+
value = propValue.replace('${fixed.', '').replace('}', '')
|
|
717
|
+
} else {
|
|
718
|
+
value = propValue
|
|
714
719
|
}
|
|
715
|
-
|
|
720
|
+
}
|
|
721
|
+
return value
|
|
716
722
|
}
|
|
717
723
|
|
|
718
724
|
/**
|
|
@@ -724,26 +730,26 @@ export function getPropValueNew(propValue, pageContext) {
|
|
|
724
730
|
* @returns
|
|
725
731
|
*/
|
|
726
732
|
export function analysisValue(conditionValue, entity, additionalParameter, contextParameter, pageContext) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
733
|
+
if (!conditionValue) {
|
|
734
|
+
return
|
|
735
|
+
}
|
|
736
|
+
let label = ''
|
|
737
|
+
const split = conditionValue.split('-#-#')
|
|
738
|
+
if (split != null && split.length > 0) {
|
|
739
|
+
split.forEach((item) => {
|
|
740
|
+
let value
|
|
741
|
+
if (pageContext) {
|
|
742
|
+
value = getPropValueNew(item, pageContext, entity)
|
|
743
|
+
} else {
|
|
744
|
+
value = getPropValue(item, entity, additionalParameter, contextParameter)
|
|
745
|
+
}
|
|
746
|
+
if (!value || value === null) {
|
|
747
|
+
value = ''
|
|
748
|
+
}
|
|
749
|
+
label += value
|
|
750
|
+
})
|
|
751
|
+
}
|
|
752
|
+
return label
|
|
747
753
|
}
|
|
748
754
|
|
|
749
755
|
/**
|
|
@@ -753,29 +759,29 @@ export function analysisValue(conditionValue, entity, additionalParameter, conte
|
|
|
753
759
|
* @param {*} value
|
|
754
760
|
*/
|
|
755
761
|
export function setEntityFieldValue(entity, prop, value) {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
} else {
|
|
765
|
-
// 静态对象属性赋值,提高性能
|
|
766
|
-
parentObj[subProp] = value
|
|
767
|
-
}
|
|
768
|
-
}
|
|
762
|
+
if (prop && entity) {
|
|
763
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
764
|
+
const parentObj = getParentObjectUtil(prop, entity)
|
|
765
|
+
if (parentObj) {
|
|
766
|
+
const subProp = prop.substring(prop.lastIndexOf('.') + 1)
|
|
767
|
+
if (parentObj[subProp] === undefined) {
|
|
768
|
+
// 动态对象属性赋值,防止属性不存在,导致属性无法赋值问题
|
|
769
|
+
parentObj[prop.substring(prop.lastIndexOf('.') + 1)] = value
|
|
769
770
|
} else {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
entity[prop] = value
|
|
773
|
-
} else {
|
|
774
|
-
// 静态对象属性赋值,提高性能
|
|
775
|
-
entity[prop] = value
|
|
776
|
-
}
|
|
771
|
+
// 静态对象属性赋值,提高性能
|
|
772
|
+
parentObj[subProp] = value
|
|
777
773
|
}
|
|
778
|
-
|
|
774
|
+
}
|
|
775
|
+
} else {
|
|
776
|
+
if (entity[prop] === undefined || entity[prop] === null) {
|
|
777
|
+
// 动态对象属性赋值,防止属性不存在,导致属性无法赋值问题
|
|
778
|
+
entity[prop] = value
|
|
779
|
+
} else {
|
|
780
|
+
// 静态对象属性赋值,提高性能
|
|
781
|
+
entity[prop] = value
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
779
785
|
}
|
|
780
786
|
|
|
781
787
|
/**
|
|
@@ -785,13 +791,13 @@ export function setEntityFieldValue(entity, prop, value) {
|
|
|
785
791
|
* @returns
|
|
786
792
|
*/
|
|
787
793
|
export function getEntityFieldValueWithOutCase(entity, prop) {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
794
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
795
|
+
const parentOjbect = getParentObjectUtil(prop, entity)
|
|
796
|
+
const modelName = prop.substring(prop.lastIndexOf('.') + 1)
|
|
797
|
+
return parentOjbect[modelName]
|
|
798
|
+
} else {
|
|
799
|
+
return entity[prop]
|
|
800
|
+
}
|
|
795
801
|
}
|
|
796
802
|
|
|
797
803
|
/**
|
|
@@ -801,71 +807,71 @@ export function getEntityFieldValueWithOutCase(entity, prop) {
|
|
|
801
807
|
* @returns
|
|
802
808
|
*/
|
|
803
809
|
export function getEntityFieldValue(entity, prop, isLowerCase) {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
810
|
+
if (!prop) {
|
|
811
|
+
return null
|
|
812
|
+
}
|
|
813
|
+
let value = getEntityFieldValueWithCase(entity, prop)
|
|
814
|
+
if (value === undefined || value === null) {
|
|
815
|
+
// 兼容mysql数据库
|
|
816
|
+
value = getEntityFieldValueWithCase(entity, prop.toLowerCase())
|
|
817
|
+
}
|
|
818
|
+
if (value === undefined || (value === null && isLowerCase === undefined)) {
|
|
819
|
+
// 兼容oracle数据库
|
|
820
|
+
value = getEntityFieldValueWithCase(entity, prop.toUpperCase())
|
|
821
|
+
}
|
|
822
|
+
return value
|
|
817
823
|
}
|
|
818
824
|
|
|
819
825
|
function getEntityFieldValueWithCase(entity, prop) {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
826
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
827
|
+
const parentOjbect = getParentObjectUtil(prop, entity)
|
|
828
|
+
const modelName = prop.substring(prop.lastIndexOf('.') + 1)
|
|
829
|
+
return parentOjbect[modelName]
|
|
830
|
+
} else {
|
|
831
|
+
return entity[prop]
|
|
832
|
+
}
|
|
827
833
|
}
|
|
828
834
|
|
|
829
835
|
export function getParentObjectUtil(prop, entity) {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
836
|
+
const nestedProp = prop.split('.')
|
|
837
|
+
// 属性只有一个时父对象就是models
|
|
838
|
+
if (nestedProp.length === 1) {
|
|
839
|
+
return entity
|
|
840
|
+
} else {
|
|
841
|
+
let parentObject
|
|
842
|
+
// 属性超过2个时先找到最后一层属性的父对象
|
|
843
|
+
for (let i = 0; i < nestedProp.length - 1; i++) {
|
|
844
|
+
if (i === 0) {
|
|
845
|
+
parentObject = getParentModelProp(nestedProp[i], entity)
|
|
846
|
+
} else {
|
|
847
|
+
parentObject = getParentModelProp(nestedProp[i], parentObject)
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return parentObject
|
|
851
|
+
}
|
|
846
852
|
}
|
|
847
853
|
|
|
848
854
|
function getParentModelProp(prop, parentObj) {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
855
|
+
let myPparentObject = getParentModelPropWithCase(prop, parentObj)
|
|
856
|
+
if (myPparentObject === undefined) {
|
|
857
|
+
// 兼容mysql数据库
|
|
858
|
+
myPparentObject = getParentModelPropWithCase(prop.toLowerCase(), parentObj)
|
|
859
|
+
}
|
|
860
|
+
if (myPparentObject === undefined) {
|
|
861
|
+
// 兼容oracle数据库
|
|
862
|
+
myPparentObject = getParentModelPropWithCase(prop.toUpperCase(), parentObj)
|
|
863
|
+
}
|
|
864
|
+
return myPparentObject
|
|
859
865
|
}
|
|
860
866
|
|
|
861
867
|
function getParentModelPropWithCase(prop, parentObj) {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
868
|
+
if (!parentObj) {
|
|
869
|
+
parentObj = {}
|
|
870
|
+
}
|
|
871
|
+
if (!parentObj[prop] && !parentObj[prop.toUpperCase()]) {
|
|
872
|
+
parentObj[prop] = {}
|
|
873
|
+
}
|
|
874
|
+
return parentObj[prop]
|
|
869
875
|
}
|
|
870
876
|
|
|
871
877
|
/**
|
|
@@ -874,53 +880,53 @@ function getParentModelPropWithCase(prop, parentObj) {
|
|
|
874
880
|
* @returns
|
|
875
881
|
*/
|
|
876
882
|
export function findSystemInfoByCode(systemCode) {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
883
|
+
return new Promise((resolve, reject) => {
|
|
884
|
+
if (!systemCode) {
|
|
885
|
+
systemCode = window.$vueApp.config.globalProperties.systemCode
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
window.$vueApp.config.globalProperties.$http
|
|
889
|
+
.get(window.$vueApp.config.globalProperties.baseAPI + '/component/business-systems/' + systemCode)
|
|
890
|
+
.then((system) => {
|
|
891
|
+
if (system) {
|
|
892
|
+
resolve({
|
|
893
|
+
zh_CN: system.name,
|
|
894
|
+
en_US: system.enName,
|
|
895
|
+
frontendUrl: system.frontendUrl
|
|
896
|
+
})
|
|
897
|
+
} else {
|
|
898
|
+
resolve('系统:' + systemCode + '不存在')
|
|
880
899
|
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
resolve({
|
|
887
|
-
zh_CN: system.name,
|
|
888
|
-
en_US: system.enName,
|
|
889
|
-
frontendUrl: system.frontendUrl
|
|
890
|
-
})
|
|
891
|
-
} else {
|
|
892
|
-
resolve('系统:' + systemCode + '不存在')
|
|
893
|
-
}
|
|
894
|
-
})
|
|
895
|
-
.catch((error) => {
|
|
896
|
-
reject(error)
|
|
897
|
-
})
|
|
898
|
-
})
|
|
900
|
+
})
|
|
901
|
+
.catch((error) => {
|
|
902
|
+
reject(error)
|
|
903
|
+
})
|
|
904
|
+
})
|
|
899
905
|
}
|
|
900
906
|
|
|
901
907
|
export function getPropNameWhenJoinTable(prop, isJoinTable, tableName) {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}
|
|
908
|
+
if (prop && isJoinTable !== undefined && isJoinTable === true) {
|
|
909
|
+
// 关联表时将点改成下划线,如果没点,则表示是主表字段,拼接主表tableName,因为列表组件中是这样处理的
|
|
910
|
+
const replaceDot = '__'
|
|
911
|
+
if (prop.indexOf('.') > 0) {
|
|
912
|
+
prop = prop.replace('.', replaceDot)
|
|
913
|
+
} else {
|
|
914
|
+
if (tableName && tableName !== null && tableName !== '' && prop.indexOf(tableName + replaceDot) < 0) {
|
|
915
|
+
// 如果属性名没有拼接表名才需要拼接
|
|
916
|
+
prop = tableName + replaceDot + prop
|
|
917
|
+
}
|
|
913
918
|
}
|
|
914
|
-
|
|
919
|
+
}
|
|
920
|
+
return prop
|
|
915
921
|
}
|
|
916
922
|
|
|
917
923
|
export function isImage(fileName) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
924
|
+
// const fileType = fileName.substring(fileName.lastIndexOf('.'), fileName.length).toLowerCase()
|
|
925
|
+
// const imageTypes = ['.jpg', '.JPG', '.png', '.bmp', '.BMP', '.jpeg', '.gif', '.psd', '.tif', '.tga', '.svg', '.eps']
|
|
926
|
+
// const index = imageTypes.indexOf(fileType)
|
|
927
|
+
if (fileName && /\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|bmp|BMP|psd|PSD|tif|TIF)$/.test(fileName)) {
|
|
928
|
+
return true
|
|
929
|
+
} else {
|
|
930
|
+
return false
|
|
931
|
+
}
|
|
926
932
|
}
|