ReadCSV() {
let form = new Form<any>();
let fp = new FilePicker().width(400);
let dlg = new Dialog();
form.content(new Wrap().children([
new Label("選擇CSV檔案"), fp, new Button("讀取").click((src, args) => {
if (UI.validateRequired(fp, "請選擇檔案")) {
form.upload().then(ufs => {
if (!String.isNullOrEmpty(fp.remotePath())) {
//var fileName = fp.fileName();
let result = Goms.Services.Cases.HistoryRecordClient.RecordReadCSV(fp.remotePath());//C:\Users\kwct.daicl\Desktop
if (result == true) {
alert("讀取成功!!!");
dlg.close();
} else {
alert("讀取失敗!!!")
}
}
})
}
})
]));
dlg.title("讀取CSV檔案").contentStyle({ padding: 30 }).content(form).show();
}
我這個前臺是Typescript,我這個匯入資料庫的代碼在資料量不到10萬條的時候 匯入沒問題,當達到十幾萬的時候就呼叫不到后臺方法了,在form.upload().then(ufs => {這個地方就直接報“Unexpected token in JSON at position 0 ”這個錯誤,求大佬指教!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/244503.html
標籤:JavaScript
上一篇:小程式
