upload code

This commit is contained in:
2025-10-17 14:33:33 +08:00
commit 0d9423e6e4
29 changed files with 1526 additions and 0 deletions

36
src/js/mobile.ts Normal file
View File

@@ -0,0 +1,36 @@
import type { Setting } from '@/types/model';
import { KintoneRestAPIClient } from '@kintone/rest-api-client';
(function (PLUGIN_ID) {
kintone.events.on('mobile.app.record.index.show', () => {
// App id
const appId = kintone.app.getId()?.toString();
if (!appId) return;
// get setting
const setting: Setting = kintone.plugin.app.getConfig(PLUGIN_ID);
// header space
const headerSpace = kintone.mobile.app.getHeaderSpaceElement();
if (!headerSpace) {
throw new Error('このページではヘッダー要素が利用できません。');
}
const btnId = 'template-btn-id';
// ボタン追加
if (document.getElementById(btnId)) return;
const button = new Kucs[KUC_VERSION].MobileButton({
text: setting.buttonName,
type: 'submit',
id: btnId,
});
const client = new KintoneRestAPIClient();
button.addEventListener('click', async () => {
const { plugins } = await client.app.getPlugins({
app: appId
})
alert(setting.message + "\n--------\n【Plugins】 " + plugins.map(p => p.name).join('、'));
});
headerSpace.appendChild(button);
});
})(kintone.$PLUGIN_ID);