[ルックアップ更新]条件式の不具合対応

This commit is contained in:
xiaozhe.ma
2024-08-29 12:33:00 +09:00
parent 60359ed9bd
commit 5fc03c6fe0
9 changed files with 965 additions and 27 deletions

View File

@@ -70,8 +70,9 @@
| placeholder | 対象項目を選択してください| 入力フィールドに表示されるプレースホルダーのテキストです。この場合は設定されていません。 |
| hint | 説明文| 長い説明文を設定することが可能です。markdown形式サポート予定、現在HTML可能 |
| selectType |`single` or `multiple`| フィールド選択・他のアプリのフィールド選択の選択モードを設定する |
| required | boolean | 必須チェックするかどうか |
| requiredMessage | string | 必須チェック時のエラーメッセージ。未設定の場合「XXXX」が必須です。になります |
| rules |"[val=>val<=100 && val>=1 \|\| '1-100の範囲内の数値を入力してください']"| 必須チェック以外のルールを設定する |
### 使用可能なコンポーネント
| No. | コンポーネント名 | コンポーネントタイプ | 説明 |
@@ -83,9 +84,9 @@
| 5 | 選択リスト | SelectBox | 複数のオプションから選択するためのドロップダウンリストです。 |
| 6 | 条件式設定 | ConditionInput | 条件式やロジックを入力するためのコンポーネントです。 |
| 7 | イベント設定 |EventSetter | ボタンイベント設定のコンポーネントです。 |
| 8 | 色選択 | ColorPicker | 色を設定する(追加予定中) |
| 9 | 他のアプリのフィールド選択 | AppFieldPicker | 他のアプリのフィールドを選択する(追加予定中) |
| 10 |ユーザー選択 | UserPicker | ユーザーを選択する(追加予定中) |
| 8 | 色選択 | ColorPicker | 色を設定する |
| 9 | 他のアプリのフィールド選択 | AppFieldSelect | 他のアプリのフィールドを選択する |
| 10 | アプリ選択 | AppSelect | アプリを選択する |
## 2.アクションアドインの開発
@@ -270,7 +271,7 @@ npm run build:dev
- Azure App Service 拡張機能でデプロイが完了したことを確認します。
- ka-addin の URL にアクセスしてアプリケーションが正常に動作しているか確認します。
3. **ローカルでプラグインをテストする**
3. **ローカルでプラグインをテストする(ZCCの導入ため、廃止する)**
1. kintone-addinsをPreviewで起動する
```bash
yarn build:dev
@@ -278,7 +279,7 @@ yarn preview
#またはyarn devは yarn build:dev + yarn preview と同じです
yarn dev
```
2. **ngrokをインストールする**
2. **ngrokをインストールする(ZCCの導入ため、廃止する)**
1. [ngrok の公式ウェブサイト](https://ngrok.com/)にアクセスします。
2. 「Sign up」をクリックしてアカウントを登録するか、既存のアカウントにログインします。
3. 登録またはログイン後、ダッシュボードに進み、ダウンロードリンクが表示されます。操作システムWindows、macOS、Linuxに応じて、適切なバージョンを選択してダウンロードします。
@@ -292,4 +293,10 @@ yarn dev
6. ngrok を起動する
```bash
ngrok https http://localhost:4173/
```
```
3. kintone-addinsをビルドする
```bash
yarn build:dev #開発モード
#またはyarn devは yarn build:dev + yarn preview と同じです
yarn build #本番リリースモード
```

View File

@@ -16,7 +16,7 @@ import "bootstrap/js/dist/modal";
import {Modal} from "bootstrap"
import $ from "jquery";
interface Props {
interface IAutoLookUpProps {
displayName: string;
lookupField: LookupField;
condition: Condition;
@@ -84,11 +84,11 @@ interface App {
export class AutoLookUpAction implements IAction {
name: string;
actionProps: IActionProperty[];
props: Props;
props: IAutoLookUpProps;
constructor() {
this.name = "ルックアップ更新";
this.actionProps = [];
this.props = {} as Props;
this.props = {} as IAutoLookUpProps;
this.register();
}
@@ -104,7 +104,7 @@ export class AutoLookUpAction implements IAction {
this.props = {
...actionNode.ActionValue,
condition: JSON.parse((actionNode.ActionValue as any).condition),
} as Props;
} as IAutoLookUpProps;
// console.log(context);
let result = {
@@ -150,12 +150,17 @@ export class AutoLookUpAction implements IAction {
* @returns
*/
makeQuery=(lookUpField:Field,key:any)=>{
let query ="";
if(typeof key==='number'){
return `${lookUpField.code} = ${key}`
query = `${lookUpField.code} = ${key}`
}
if(typeof key==='string'){
return `${lookUpField.code} = "${key}"`
query = `${lookUpField.code} = "${key}"`
}
if(this.props.condition.queryString!==''){
query = `${query} and (${this.props.condition.queryString})`
}
return query;
}
/**