Skip to content

Instantly share code, notes, and snippets.

@papinianus
Created December 4, 2022 15:01
Show Gist options
  • Save papinianus/62d790df8e1a1ad003dd3cc0f69cf606 to your computer and use it in GitHub Desktop.
Save papinianus/62d790df8e1a1ad003dd3cc0f69cf606 to your computer and use it in GitHub Desktop.
日報を作ってみる
{
"HeaderInfo": {
"AssemblyVersion": "1.3.25.2",
"BaseSiteId": 7122237,
"Server": "https://demo.pleasanter.org",
"CreatorName": "テナント管理者",
"PackageTime": "2022-12-04T15:00:44.1705214+00:00",
"Convertors": [
{
"SiteId": 7122237,
"SiteTitle": "日報",
"ReferenceType": "Results",
"IncludeData": false
}
],
"IncludeSitePermission": false,
"IncludeRecordPermission": false,
"IncludeColumnPermission": false,
"IncludeNotifications": false,
"IncludeReminders": false
},
"Sites": [
{
"TenantId": 13658,
"SiteId": 7122237,
"Title": "日報",
"SiteName": "",
"SiteGroupName": "",
"Body": "",
"GridGuide": "- 今日以外の記録を見る\n - [カレンダー](https://demo.pleasanter.org/items/7122237/calendar?allowList=true)\n - [一覧](https://demo.pleasanter.org/items/7122237//index?allowList=true)",
"EditorGuide": "- 今日以外の記録を見る\n - [カレンダー](https://demo.pleasanter.org/items/7122237/calendar?allowList=true)\n - [一覧](https://demo.pleasanter.org/items/7122237//index?allowList=true)",
"ReferenceType": "Results",
"ParentId": 7094335,
"InheritPermission": 7122237,
"SiteSettings": {
"Version": 1.017,
"ReferenceType": "Results",
"GridView": 1,
"GridColumns": [
"ResultId",
"Title",
"Body",
"DescriptionE",
"NumE",
"CheckA",
"CheckB",
"ClassA",
"NumF",
"NumG",
"NumH",
"NumI"
],
"EditorColumnHash": {
"General": [
"DateA",
"Body",
"DescriptionE",
"CheckA",
"CheckB",
"NumE",
"DescriptionA",
"NumA",
"DescriptionB",
"NumB",
"DescriptionC",
"NumC",
"DescriptionD",
"NumD",
"ClassA",
"NumF",
"NumG",
"NumH",
"NumI"
]
},
"TitleColumns": [
"Title",
"DateA"
],
"Columns": [
{
"ColumnName": "Title",
"DefaultInput": "Rec",
"ValidateRequired": false,
"CopyByDefault": true,
"EditorReadOnly": true
},
{
"ColumnName": "DateA",
"LabelText": "作業日",
"DefaultInput": "0",
"NoDuplication": true
},
{
"ColumnName": "CheckA",
"LabelText": "出勤打刻",
"Description": "https://attendance.moneyforward.com/my_page"
},
{
"ColumnName": "CheckB",
"LabelText": "退勤打刻",
"Description": "https://attendance.moneyforward.com/my_page"
},
{
"ColumnName": "CheckC",
"DefaultInput": "false"
},
{
"ColumnName": "CheckD",
"DefaultInput": "false"
},
{
"ColumnName": "DescriptionA",
"LabelText": "作業内容A",
"ValidateRequired": true
},
{
"ColumnName": "DescriptionB",
"LabelText": "作業内容B"
},
{
"ColumnName": "DescriptionC",
"LabelText": "作業内容C"
},
{
"ColumnName": "Body",
"LabelText": "次回予定",
"DefaultInput": "[md]\n",
"ValidateRequired": true
},
{
"ColumnName": "DescriptionD",
"LabelText": "作業内容D"
},
{
"ColumnName": "NumA",
"LabelText": "作業時間A",
"DefaultInput": "0",
"ValidateRequired": true,
"Unit": "時間",
"RoundingType": 20,
"Min": 0.1,
"Max": 10.0
},
{
"ColumnName": "NumB",
"LabelText": "作業時間B",
"DefaultInput": "0",
"Unit": "時間",
"RoundingType": 20,
"Min": 0.0,
"Max": 10.0
},
{
"ColumnName": "NumC",
"LabelText": "作業時間C",
"DefaultInput": "0",
"Unit": "時間",
"Min": 0.0,
"Max": 10.0
},
{
"ColumnName": "NumD",
"LabelText": "作業時間D",
"DefaultInput": "0",
"Unit": "時間",
"Min": 0.0,
"Max": 10.0
},
{
"ColumnName": "NumE",
"LabelText": "作業時間計",
"Unit": "時間",
"Min": 0.0,
"Max": 24.0,
"EditorReadOnly": true
},
{
"ColumnName": "DescriptionE",
"LabelText": "今日のサマリ",
"DefaultInput": "[md]\n"
},
{
"ColumnName": "ClassA",
"LabelText": "感情"
},
{
"ColumnName": "NumF",
"LabelText": "ポジティブ",
"DecimalPlaces": 4,
"Min": -10.0,
"Max": 10.0
},
{
"ColumnName": "NumG",
"LabelText": "ネガティブ",
"DecimalPlaces": 4,
"Min": -10.0,
"Max": 10.0
},
{
"ColumnName": "NumH",
"LabelText": "混成",
"DecimalPlaces": 4,
"Min": -10.0,
"Max": 10.0
},
{
"ColumnName": "NumI",
"LabelText": "中立",
"DecimalPlaces": 4,
"Min": -10.0,
"Max": 10.0
}
],
"Formulas": [
{
"Target": "NumE",
"Formula": {
"OperatorType": 0,
"Children": [
{
"ColumnName": "NumA",
"OperatorType": 0
},
{
"ColumnName": "NumB",
"OperatorType": 1
},
{
"ColumnName": "NumC",
"OperatorType": 1
},
{
"ColumnName": "NumD",
"OperatorType": 1
}
]
},
"Id": 1
}
],
"ViewLatestId": 1,
"Views": [
{
"Id": 1,
"Name": "Default",
"DefaultMode": "Calendar",
"FiltersDisplayType": 1,
"AggregationsDisplayType": 3,
"BulkMoveTargetsCommand": 1,
"BulkDeleteCommand": 1,
"EditImportSettings": 1,
"ColumnSorterHash": {
"DateA": "desc"
},
"ApiColumnKeyDisplayType": 0,
"ApiColumnValueDisplayType": 0,
"ApiDataType": 0
}
],
"ServerScripts": [
{
"Title": "forwarder",
"Name": "forwarder",
"Body": "// 画面表示の前\ntry {\n const host = 'https://demo.pleasanter.org';\n const siteId = context.SiteId;\n const now = new Date();\n now.setHours(now.getHours() + 9);\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n if (siteId === context.Id) {\n if (context.Action !== 'new' && !context.QueryStrings.Bool('allowList')) {\n const param = {\n View: {\n ColumnFilterHash: {\n DateA: `[\"${today.toLocaleDateString(\n 'ja-JP',\n )} 00:00:00,${today.toLocaleDateString('ja-JP')} 23:59:59\"]`,\n },\n },\n };\n const rec = items.Get(siteId, JSON.stringify(param));\n if (rec.Length < 1) {\n context.Redirect(`${host}/${context.Controller}/${siteId}/new`);\n }\n const recId = rec[0].ResultId || rec[0].IssueId;\n context.Redirect(`${host}/${context.Controller}/${recId}/edit`);\n }\n }\n context.Log(context.Id);\n} catch (e) {\n context.Log(e.stack);\n}\n",
"Id": 1
},
{
"Title": "sentiment",
"Name": "sentiment",
"Body": "try {\n httpClient.RequestUri = 'https://${randomString}.lambda-url.ap-northeast-1.on.aws/';\n const content = { sentence: model.DescriptionE };\n httpClient.Content = JSON.stringify(content);\n const result = JSON.parse(httpClient.Post());\n model.ClassA = result.Sentiment;\n model.NumF = result.Positive;\n model.NumG = result.Negative;\n model.NumH = result.Mixed;\n model.NumI = result.Neutral;\n} catch (e) {\n context.Log(e.stack);\n}",
"Id": 2
}
],
"AllowCopy": false,
"AllowReferenceCopy": true,
"CharToAddWhenCopying": "",
"NoDisplayIfReadOnly": false
},
"Publish": false,
"DisableCrossSearch": false,
"Comments": []
}
],
"Data": [],
"Permissions": [],
"PermissionIdList": {
"DeptIdList": [],
"GroupIdList": [],
"UserIdList": []
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment