This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"2023-04-01", | |
"2023-04-02", | |
"2023-04-08", | |
"2023-04-09", | |
"2023-04-15", | |
"2023-04-16", | |
"2023-04-22", | |
"2023-04-23", | |
"2023-04-29", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Execute this on devtool console | |
(function () { | |
const rows = document.querySelectorAll('[role="row"]') | |
const out = [] | |
rows.forEach((row) => { | |
const cells = row.querySelectorAll('[role="gridcell"]') | |
const outRow = [] | |
cells.forEach((cell) => { | |
outRow.push(cell.innerText.replace(/\n/g, ' ').trim()) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
- 方針概要: DB接続して云々処理するService class を作成し、APIでもバッチでも読み出して実施する | |
- 開発中は、コマンド叩いて実行、デバッグできるように構成したほうがやりやすい | |
- [x] debugger で呼び出して、intellij のブレークポイントでデバッグできるように | |
- デバッグ用スクリプト `script/debug.ts` に | |
- [x] Service class を作成 | |
- [x] DB接続を記述, CLIでデバッグできるように | |
- database接続の取得: | |
- Nodejs の ORM Knex https://knexjs.org/ の接続インスタンスが取得できる | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// api-directus/extensions/endpoints/samplepath/index.js | |
const {$serverErrorReporter} = require("../../../../CORE/src/server/$serverErrorReporter"); | |
module.exports = function ( | |
router, | |
directusOptionalArgs, | |
) { | |
// 別のTypescript ファイルへ分ける場合 | |
// require('../../../../models/modelServices/testApiEndpoint').registerTestApiEndpoints(router, directusOptionalArgs) | |
// 最小限の例 [GET] `/samplepath/minimal-sample` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<base href='https://core-admin-assets-prod.core-fw.com'> | |
<script> | |
// この値を、環境に応じて書き換え | |
window.CORE_API_DOMAIN = 'https://365c948c0ad34a9793ffe837a122b3d9.e250tryb4s6fi7.core-fw.com' | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* データの取得の基本: await $core.$models.[modelName].find() | |
* - デフォルト 100件まで, 取得順のデフォルト: idの降順(DESC) | |
**/ | |
await $core.$models.selectOptionsMaster.find() | |
// IDで1件のみ取得(ID 10のものを取得): findById(10) | |
await $core.$models.selectOptionsMaster.findById(10) | |
// 取得件数制御, 5件のみ (デフォルト 100): find({ limit: 5 }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* "データタイプ" で M2Oリレーションシップ を選択し、 | |
* リレーションデータのラベル表示 (Label formatter) 欄へ下記を入力 | |
**/ | |
return row.name + ` (¥${row.price})` | |
/** | |
* JS形式の追加カラム定義 (otherColAttributes) へ設定 | |
* | |
* ## CORE リレーションカラムの選択値を活用して他のフィールドを更新する (リレーションシップ + editCallback) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ## カラム バリデーションルールを設定: | |
* - 定義済みバリデーション | |
* - 入力必須 notEmpty: boolean (UI上で設定可能) | |
* - 最小値 min: number (UI上で設定可能) | |
* - 最大値 max: number (UI上で設定可能) | |
* - 数値 isInt: boolean | |
* - isFloat: boolean | |
* - isEmail: boolean | |
* - カスタムバリデーション |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ## editCallback の使い方 | |
* - 例: "勘定科目" を選択して、値が変更されているなら、 "種別" をクリアする | |
* - "勘定科目" (accoutingType) のeditCallback関数を追加する | |
*/ | |
{ | |
editCallback: ({row, newValue, oldValue}) => { | |
console.log({row, newValue, oldValue}) | |
// row: 現在編集しているデータ | |
// row.accoutingType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ## 選択肢マスタ を活用する: ダイナミック多段選択肢を実現する | |
* - [ ] "勘定科目" カラムを作成: 通信費, 旅費交通費, 広告宣伝費, 接待交際費, 消耗品費 | |
* - "種別" カラムの選択肢を "勘定科目" で選択された値に応じて表示する | |
* - 例: 勘定科目が "旅費交通費" の場合に、 "通勤" "出張交通費" "客先移動交通費" | |
* - カラム定義の Javascriptにて、 | |
* - dynamicSelections: true | |
* - async selections() {...(ココでダイナミックにしたい) } | |
* - [x] 選択肢マスタを作成 | |
* - グループ名: "旅費交通費:種別" |
NewerOlder