zet-lib 1.0.91 → 1.0.93
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/zRoute.js +12 -2
- package/package.json +1 -1
package/lib/zRoute.js
CHANGED
|
@@ -1119,6 +1119,7 @@ zRoute.selectAllowedField = (req, res, MYMODEL, arr = []) => {
|
|
|
1119
1119
|
zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
|
|
1120
1120
|
let virtuals = []
|
|
1121
1121
|
let customs = []
|
|
1122
|
+
let asDate = []
|
|
1122
1123
|
for (var key in MYMODEL.widgets) {
|
|
1123
1124
|
if (MYMODEL.widgets[key].name === 'virtual') {
|
|
1124
1125
|
virtuals.push(key)
|
|
@@ -1126,6 +1127,12 @@ zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
|
|
|
1126
1127
|
if (MYMODEL.widgets[key].name === 'custom') {
|
|
1127
1128
|
customs.push(key)
|
|
1128
1129
|
}
|
|
1130
|
+
if (MYMODEL.widgets[key].name == 'datetime') {
|
|
1131
|
+
asDate.push(key)
|
|
1132
|
+
}
|
|
1133
|
+
if (MYMODEL.widgets[key].name == 'datepicker') {
|
|
1134
|
+
asDate.push(key)
|
|
1135
|
+
}
|
|
1129
1136
|
}
|
|
1130
1137
|
//check directory for import not export
|
|
1131
1138
|
const dir = `${dirRoot}/public/excel/tmp`
|
|
@@ -1173,11 +1180,16 @@ zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
|
|
|
1173
1180
|
let columns = body.columns
|
|
1174
1181
|
columns.forEach(function (item) {
|
|
1175
1182
|
if (item.search.value) {
|
|
1183
|
+
let astype = 'text'
|
|
1184
|
+
if (asDate.includes(body.fields[item.data])) {
|
|
1185
|
+
astype = 'date'
|
|
1186
|
+
}
|
|
1176
1187
|
whereArray.push({
|
|
1177
1188
|
field: body.fields[item.data],
|
|
1178
1189
|
option: MYMODEL.options[body.fields[item.data]],
|
|
1179
1190
|
value: item.search.value,
|
|
1180
1191
|
operator: 'AND',
|
|
1192
|
+
type: astype,
|
|
1181
1193
|
})
|
|
1182
1194
|
}
|
|
1183
1195
|
})
|
|
@@ -1189,8 +1201,6 @@ zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
|
|
|
1189
1201
|
select: select,
|
|
1190
1202
|
table: MYMODEL.table,
|
|
1191
1203
|
whereArray: whereArray,
|
|
1192
|
-
/* limit: body.length,
|
|
1193
|
-
offset : body.start,*/
|
|
1194
1204
|
orderBy: [orderColumn, body.order[0].dir],
|
|
1195
1205
|
}
|
|
1196
1206
|
if (!zall) {
|