zet-lib 1.2.52 → 1.2.54
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 +6 -12
- package/package.json +1 -1
package/lib/zRoute.js
CHANGED
|
@@ -3499,13 +3499,9 @@ zRoute.import = async (req, res, MYMODEL) => {
|
|
|
3499
3499
|
})
|
|
3500
3500
|
hd += `<th>${LANGUAGE['noted']}</th>`
|
|
3501
3501
|
hd += `</tr>`
|
|
3502
|
-
|
|
3503
|
-
console.log(results)
|
|
3504
3502
|
results[1].map((item, index) => {
|
|
3505
3503
|
keys[index] = item
|
|
3506
3504
|
})
|
|
3507
|
-
|
|
3508
|
-
console.log(keys)
|
|
3509
3505
|
let isCut = false
|
|
3510
3506
|
if (columnLength > 20 && resultsLength > 2000) {
|
|
3511
3507
|
io.to(room).emit('message', 'short display data!')
|
|
@@ -3543,16 +3539,14 @@ zRoute.import = async (req, res, MYMODEL) => {
|
|
|
3543
3539
|
if (result_alias.id) {
|
|
3544
3540
|
data[keys[prop]] = result_alias.id
|
|
3545
3541
|
}
|
|
3546
|
-
} else if (MYMODEL.widgets[keys[prop]].name === 'integer') {
|
|
3547
|
-
data[keys[prop]] = parseInt(value) || null
|
|
3548
|
-
} else if (MYMODEL.widgets[keys[prop]].name === 'virtual') {
|
|
3549
|
-
//empty
|
|
3550
3542
|
} else {
|
|
3551
|
-
|
|
3543
|
+
let name = MYMODEL.widgets[keys[prop]] && MYMODEL.widgets[keys[prop]].name ? MYMODEL.widgets[keys[prop]].name : ''
|
|
3544
|
+
if (name != 'virtual') {
|
|
3545
|
+
data[keys[prop]] = value
|
|
3546
|
+
}
|
|
3552
3547
|
}
|
|
3553
3548
|
}
|
|
3554
3549
|
if (isCut) {
|
|
3555
|
-
console.log('cut and column cut')
|
|
3556
3550
|
if (columnCut < 10) {
|
|
3557
3551
|
hd += `<td>${value || ''}</td>`
|
|
3558
3552
|
}
|
|
@@ -3587,15 +3581,15 @@ zRoute.import = async (req, res, MYMODEL) => {
|
|
|
3587
3581
|
if (mydatas.lock == 1) {
|
|
3588
3582
|
hd += `<td class='text text-success'>Data is locked</td>`
|
|
3589
3583
|
} else {
|
|
3590
|
-
|
|
3584
|
+
await connection.update({
|
|
3591
3585
|
table: MYMODEL.table,
|
|
3592
3586
|
data: data,
|
|
3593
3587
|
where: {
|
|
3594
3588
|
id: data.id,
|
|
3595
3589
|
},
|
|
3596
3590
|
})
|
|
3591
|
+
hd += `<td class='text text-success'>${LANGUAGE['success']}</td>`
|
|
3597
3592
|
}
|
|
3598
|
-
hd += `<td class='text text-success'>${LANGUAGE['success']}</td>`
|
|
3599
3593
|
}
|
|
3600
3594
|
} catch (err) {
|
|
3601
3595
|
hd += `<td class='text text-danger'>${err + ''}</td>`
|