file upload

This commit is contained in:
2021-11-05 16:43:14 +08:00
commit 7777119e97
427 changed files with 162488 additions and 0 deletions

141
api/menu.js Normal file
View File

@@ -0,0 +1,141 @@
//dropdown
$(function () {
var Data = [
{ 資料點: '資料點 1', 資料點IDs: '1' },
{ 資料點: '資料點 2', 資料點IDs: '2' },
{ 資料點: '資料點 3', 資料點IDs: '3' },
{ 資料點: '資料點 4', 資料點IDs: '4' },
{ 資料點: '資料點 5', 資料點IDs: '5' },
{ 資料點: '資料點 6', 資料點IDs: '6' },
{ 資料點: '資料點 7', 資料點IDs: '7' },
{ 資料點: '資料點 8', 資料點IDs: '8' },
{ 資料點: '資料點 9', 資料點IDs: '9' },
{ 資料點: '資料點 10', 資料點IDs: '10' },
{ 資料點: '資料點 11', 資料點IDs: '11' },
{ 資料點: '資料點 12', 資料點IDs: '12' },
{ 資料點: '資料點 13', 資料點IDs: '13' },
{ 資料點: '資料點 14', 資料點IDs: '14' },
{ 資料點: '資料點 15', 資料點IDs: '15' },
{ 資料點: '資料點 16', 資料點IDs: '16' },
{ 資料點: '資料點 17', 資料點IDs: '17' }
];
$('#選單元件').html(`<div id="選單"></div>`);
$('#選單').DropSetting({
Class: 'button btn_sky',
ButtonText: '請選擇資料點',
Data: DropListDataHelp(Data, '', '資料點', '資料點IDs'),
Type: 'multiple',
})
})
//timepick
$(function () {
$('#start').html('<div id="選擇時間選單"></div>')
$('#選擇時間選單').TimeSetting({
ButtonText: '選擇起始時間',
TimePick: true,
SecondsPike: true,
Class: 'button btn_peach',
})
})
$(function () {
$('#end').html('<div id="選擇時間選單2"></div>')
$('#選擇時間選單2').TimeSetting({
ButtonText: '選擇結束時間',
TimePick: true,
SecondsPike: true,
Class: 'button btn_darkgreen'
})
});
//api
$(function () {
$('#send').click(function () {
var startTime = $('#選擇時間選單').TimeGet();
var endTime = $('#選擇時間選單2').TimeGet();
var dataID = $('#選單').DropGet();
//取出dataID陣列中的物件的值
var dataIDArray = dataID.map(item => Object.values(item)[2]);
let data = {
起始時間: startTime.Format,
結束時間: endTime.Format,
資料點IDs: dataIDArray
}
$.ajax({
url: 'http://beidafarm.solamimi.org/api/History/GetData',
type: 'post',
dataType: 'json',
contentType: 'application/json;charset=utf-8',
data: data,
success: function (data) {
console.log('success');
},
error: function (xhr) {
console.log(data);
concole.log('123')
alertBox({
Title: 'Error',
Ctrl: 'API獲取失敗',
TouchClose: true,
Html: 'Failed'
});
}
});
})
})
//table
$(function () {
let teaData = [{ 茶道名稱: 'a', data: '1' }, { 茶道名稱: 'b', data: '2' }];
TableListBuild({
Name: 'teaList',
Recover: false,
OnStart: function () {
},
GetSearch: function (ReSearch) {
var Search = {
}
return Search;
},
GetCount: function (Option) {
return teaData.length;
},
GetData: function (Option) {
return teaData;
},
OnEnd: function () {
},
})
$('#show').on('click', function () {
var arr = TableListGetCheck('teaList')
console.log( arr);
})
})