-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode.gs
48 lines (43 loc) · 2.04 KB
/
Code.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var equipamentos = []
var registros = []
var patrimonios = []
console.log('Fim importações')
// function myFunction() {
// var alasql = AlaSQLGS.load();
// console.log('Funçao principal')
// var categoria = "Arco Cirúrgico"
// //console.log(passTableItems(4))
// //var res = sql('select * from ?',[equipamentos])
// if (patrimonios==""){
// patrimonios = SpreadsheetApp.openById("1vtjst1jKqqR2IPj2rbeaicaQicPsR_EDk5tQ_PEbr3w").getSheetByName('Patrimônios').getDataRange().getValues();
// }
// if (registros==""){
// registros = SpreadsheetApp.openById("1vtjst1jKqqR2IPj2rbeaicaQicPsR_EDk5tQ_PEbr3w").getSheetByName('Respostas ao formulário 2').getDataRange().getValues();
// }
// query = "SELECT reg.Col6 AS tipo,reg.Col4 as data,reg.Col5 as arquivo,pat.Col4 as unidade,pat.Col3 as equipamento,pat.Col1 as patrimonio\
// FROM ? as reg JOIN ? as pat ON reg.Col3=pat.Col1\
// ORDER BY data DESC"
// res = alasql(AlaSQLGS.transformQueryColsNotation(query),[registros,patrimonios])
// console.log(res)
// //console.log(alasql("SELECT * FROM ? as reg JOIN ? as pat ON reg.[Código do equipamento] = pat.[id_propriedade] WHERE pat.[Patrimônio] = 'DM3572'",[registrosTable,patrimoniosTable]));
// }
function doGet(e) {
if(e.parameters.v=='so_details'){
return HtmlService.createTemplateFromFile('so_details').evaluate().setTitle('Registro de preventivas').addMetaTag( "viewport",'width=device-width, initial-scale=1')
}
return HtmlService.createTemplateFromFile('Homepage').evaluate().setTitle('Manuais de equipamentos HOB').addMetaTag( "viewport",'width=device-width, initial-scale=1');
}
// function readData(spreadsheet) {
// console.log(spreadsheet.getName())
// var range = spreadsheet.getRange(1,1,spreadsheet.getLastRow(),spreadsheet.getLastColumn()).getValues();
// let headers = range.shift()
// let data = range.map( r => {
// let obj={}
// r.forEach((cell,i) =>{
// obj[headers[i]]=cell;
// })
// return obj;
// })
// console.log('Ok')
// return data;
// }