You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.0 KiB
59 lines
2.0 KiB
4 years ago
|
var express = require('express');
|
||
|
var router = express.Router();
|
||
|
var mock = require('../../public/javascripts/mock')
|
||
|
var Mock = require("mockjs")
|
||
|
var multipart = require('connect-multiparty');
|
||
|
var multipartMiddleware = multipart();
|
||
|
var moment = require("moment")
|
||
|
var util=require("../../public/javascripts/util")
|
||
|
var route=require('../../public/javascripts/route')
|
||
|
|
||
|
router.get('/sif/:nodeId/:sifId', function (req, res, next) {
|
||
|
var sst=Mock.mock({
|
||
|
"si|1-100":[{
|
||
|
t:/\d{3}/
|
||
|
}]
|
||
|
})
|
||
|
|
||
|
var data=Mock.mock({
|
||
|
...mock.ok(`LOPA获取节点${req.params.nodeId},${req.params.sifId}数据成功`),
|
||
|
...{
|
||
|
body:{
|
||
|
sst,
|
||
|
sheetData:{
|
||
|
row:function (){
|
||
|
let rowCount=50
|
||
|
let colCount=39
|
||
|
let rows=Array.from(new Array(rowCount).keys())
|
||
|
let cols=Array.from(new Array(colCount).keys())
|
||
|
for(let row in rows){
|
||
|
rows[+row]={
|
||
|
r:+row+1,
|
||
|
spans:`1:${colCount}`,
|
||
|
c:[]
|
||
|
}
|
||
|
for(let col in cols){
|
||
|
col=String.fromCharCode(+col+"A".charCodeAt())
|
||
|
rows[row].c.push({
|
||
|
r: `${col}${+row + 1}`,
|
||
|
s: 1,
|
||
|
t: 's',
|
||
|
v: Mock.Random.integer(0, sst.si.length - 1)
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
return rows
|
||
|
}
|
||
|
},
|
||
|
mergeCells:{
|
||
|
mergeCell:[{ref:'F1:F3'},{ref:'F5:F6'}],
|
||
|
count:1
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
res.json(data)
|
||
|
})
|
||
|
|
||
|
module.exports=router
|