ide-assi 0.327.0 → 0.329.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs.js +323 -4
- package/dist/bundle.esm.js +323 -4
- package/dist/components/ideAssi.js +322 -3
- package/dist/components/ideDiffPopup.js +1 -1
- package/package.json +1 -1
- package/src/components/ideAssi.js +322 -3
- package/src/components/ideDiffPopup.js +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -194116,10 +194116,329 @@ class IdeAssi extends HTMLElement
|
|
|
194116
194116
|
|
|
194117
194117
|
//this.shadowRoot.querySelector('ide-diff-popup').remove();
|
|
194118
194118
|
|
|
194119
|
-
|
|
194120
|
-
|
|
194119
|
+
this.shadowRoot.appendChild(document.createElement('ide-diff-popup'));
|
|
194120
|
+
|
|
194121
194121
|
//setTimeout(() => {
|
|
194122
|
-
|
|
194122
|
+
const src1 = `
|
|
194123
|
+
import React, { useRef, useEffect } from "react";
|
|
194124
|
+
import { api, ai } from "ide-assi";
|
|
194125
|
+
import ninegrid from "ninegrid2";
|
|
194126
|
+
|
|
194127
|
+
const DocManager = () => {
|
|
194128
|
+
const tabRef = useRef(null);
|
|
194129
|
+
const gridRef = useRef(null);
|
|
194130
|
+
|
|
194131
|
+
const selectList = async (params) => {
|
|
194132
|
+
if (!gridRef.current) return;
|
|
194133
|
+
gridRef.current.classList.add("loading");
|
|
194134
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, params).then((res) => {
|
|
194135
|
+
gridRef.current.data.source = res.list;
|
|
194136
|
+
});
|
|
194137
|
+
};
|
|
194138
|
+
|
|
194139
|
+
const handleNaturalLanguageSearch = async () => {
|
|
194140
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
194141
|
+
const searchText = searchTextElement ? searchTextElement.value : "";
|
|
194142
|
+
|
|
194143
|
+
if (!gridRef.current) return;
|
|
194144
|
+
gridRef.current.classList.add("loading");
|
|
194145
|
+
|
|
194146
|
+
let params = {};
|
|
194147
|
+
if (searchText) {
|
|
194148
|
+
params = {
|
|
194149
|
+
_whereClause: await ai.generateWhereCause(
|
|
194150
|
+
"tmpla/DocManagerMapper.xml",
|
|
194151
|
+
"selectList",
|
|
194152
|
+
searchText,
|
|
194153
|
+
import.meta.env.VITE_GEMINI_API_KEY
|
|
194154
|
+
),
|
|
194155
|
+
};
|
|
194156
|
+
}
|
|
194157
|
+
selectList(params);
|
|
194158
|
+
};
|
|
194159
|
+
|
|
194160
|
+
const handleClassicSearch = () => {
|
|
194161
|
+
const form2Element = ninegrid.querySelector(".form2", tabRef.current);
|
|
194162
|
+
const params = form2Element ? form2Element.getData() : {};
|
|
194163
|
+
selectList(params);
|
|
194164
|
+
};
|
|
194165
|
+
|
|
194166
|
+
useEffect(() => {
|
|
194167
|
+
selectList({});
|
|
194168
|
+
|
|
194169
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
194170
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
194171
|
+
|
|
194172
|
+
const handleKeyDown = (e) => {
|
|
194173
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
194174
|
+
handleNaturalLanguageSearch();
|
|
194175
|
+
}
|
|
194176
|
+
};
|
|
194177
|
+
|
|
194178
|
+
const handleClick = () => {
|
|
194179
|
+
handleClassicSearch();
|
|
194180
|
+
};
|
|
194181
|
+
|
|
194182
|
+
if (searchTextElement) {
|
|
194183
|
+
searchTextElement.addEventListener("keydown", handleKeyDown);
|
|
194184
|
+
}
|
|
194185
|
+
if (searchButton) {
|
|
194186
|
+
searchButton.addEventListener("click", handleClick);
|
|
194187
|
+
}
|
|
194188
|
+
|
|
194189
|
+
return () => {
|
|
194190
|
+
if (searchTextElement) {
|
|
194191
|
+
searchTextElement.removeEventListener("keydown", handleKeyDown);
|
|
194192
|
+
}
|
|
194193
|
+
if (searchButton) {
|
|
194194
|
+
searchButton.removeEventListener("click", handleClick);
|
|
194195
|
+
}
|
|
194196
|
+
};
|
|
194197
|
+
}, []);
|
|
194198
|
+
|
|
194199
|
+
return (
|
|
194200
|
+
<div className="wrapper">
|
|
194201
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
194202
|
+
<div className="list-wrapper">
|
|
194203
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
194204
|
+
<nx-tab-page caption="자연어 검색">
|
|
194205
|
+
<nx-form className="form1">
|
|
194206
|
+
<input
|
|
194207
|
+
type="text"
|
|
194208
|
+
id="searchText"
|
|
194209
|
+
name="searchText"
|
|
194210
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"
|
|
194211
|
+
/>
|
|
194212
|
+
</nx-form>
|
|
194213
|
+
</nx-tab-page>
|
|
194214
|
+
<nx-tab-page caption="클래식 검색">
|
|
194215
|
+
<nx-form className="form2">
|
|
194216
|
+
<label>문서명: <input type="text" name="docNm" /></label>
|
|
194217
|
+
<label>매출액:
|
|
194218
|
+
<input type="number" name="minAmt" placeholder="최소" /> ~
|
|
194219
|
+
<input type="number" name="maxAmt" placeholder="최대" />
|
|
194220
|
+
</label>
|
|
194221
|
+
</nx-form>
|
|
194222
|
+
<button className="search">검색</button>
|
|
194223
|
+
</nx-tab-page>
|
|
194224
|
+
</nx-tab>
|
|
194225
|
+
|
|
194226
|
+
<div className="grid-wrapper">
|
|
194227
|
+
<nine-grid
|
|
194228
|
+
ref={gridRef}
|
|
194229
|
+
caption="문서관리"
|
|
194230
|
+
select-type="row"
|
|
194231
|
+
show-title-bar="true"
|
|
194232
|
+
show-menu-icon="true"
|
|
194233
|
+
show-status-bar="true"
|
|
194234
|
+
enable-fixed-col="true"
|
|
194235
|
+
row-resizable="false"
|
|
194236
|
+
col-movable="true"
|
|
194237
|
+
>
|
|
194238
|
+
<table>
|
|
194239
|
+
<colgroup>
|
|
194240
|
+
<col width="50" fixed="left" background-color="gray" />
|
|
194241
|
+
<col width="100" />
|
|
194242
|
+
<col width="100" />
|
|
194243
|
+
<col width="200" />
|
|
194244
|
+
<col width="120" />
|
|
194245
|
+
<col width="100" />
|
|
194246
|
+
<col width="150" />
|
|
194247
|
+
<col width="150" />
|
|
194248
|
+
</colgroup>
|
|
194249
|
+
<thead>
|
|
194250
|
+
<tr>
|
|
194251
|
+
<th>No.</th>
|
|
194252
|
+
<th>최종수정자</th>
|
|
194253
|
+
<th>문서ID</th>
|
|
194254
|
+
<th>문서명</th>
|
|
194255
|
+
<th>매출액</th>
|
|
194256
|
+
<th>최초등록자</th>
|
|
194257
|
+
<th>최초등록일</th>
|
|
194258
|
+
<th>최종수정일</th>
|
|
194259
|
+
</tr>
|
|
194260
|
+
</thead>
|
|
194261
|
+
<tbody>
|
|
194262
|
+
<tr>
|
|
194263
|
+
<th><ng-row-indicator /></th>
|
|
194264
|
+
<td data-bind="updateUser" text-align="center"></td>
|
|
194265
|
+
<td data-bind="docId" text-align="center"></td>
|
|
194266
|
+
<td data-bind="docNm" text-align="left"></td>
|
|
194267
|
+
<td
|
|
194268
|
+
data-bind="amt"
|
|
194269
|
+
data-expr="data.amt.toLocaleString()"
|
|
194270
|
+
text-align="right"
|
|
194271
|
+
show-icon="true"
|
|
194272
|
+
icon-type="sphere"
|
|
194273
|
+
icon-color="data.amt >= 2000 ? 'red' : 'gray'"
|
|
194274
|
+
></td>
|
|
194275
|
+
<td data-bind="insertUser" text-align="center"></td>
|
|
194276
|
+
<td data-bind="insertDt" text-align="center"></td>
|
|
194277
|
+
<td data-bind="updateDt" text-align="center"></td>
|
|
194278
|
+
</tr>
|
|
194279
|
+
</tbody>
|
|
194280
|
+
</table>
|
|
194281
|
+
</nine-grid>
|
|
194282
|
+
</div>
|
|
194283
|
+
</div>
|
|
194284
|
+
</div>
|
|
194285
|
+
);
|
|
194286
|
+
};
|
|
194287
|
+
|
|
194288
|
+
export default DocManager;
|
|
194289
|
+
`;
|
|
194290
|
+
|
|
194291
|
+
const src2 = `
|
|
194292
|
+
import React, { useRef, useEffect } from 'react';
|
|
194293
|
+
import { api, ai } from "ide-assi";
|
|
194294
|
+
import ninegrid from "ninegrid2";
|
|
194295
|
+
|
|
194296
|
+
const DocManager = () => {
|
|
194297
|
+
const tabRef = useRef(null);
|
|
194298
|
+
const gridRef = useRef(null);
|
|
194299
|
+
|
|
194300
|
+
const toCamelCase = (s) => {
|
|
194301
|
+
return s.toLowerCase().replace(/_([a-z])/g, (g) => g[1].toUpperCase());
|
|
194302
|
+
};
|
|
194303
|
+
|
|
194304
|
+
const tableDefinitions = JSON.parse(\`{"list":[{"columns":[{"COLUMN_NAME":"doc_id","COLUMN_ID":1,"COLUMN_COMMENT":"문서ID"},{"COLUMN_NAME":"doc_nm","COLUMN_ID":2,"COLUMN_COMMENT":"문서명"},{"COLUMN_NAME":"amt","COLUMN_ID":3,"COLUMN_COMMENT":"매출액"},{"COLUMN_NAME":"insert_user","COLUMN_ID":4,"COLUMN_COMMENT":"최초등록자"},{"COLUMN_NAME":"insert_dt","COLUMN_ID":5,"COLUMN_COMMENT":"최초등록일"},{"COLUMN_NAME":"update_user","COLUMN_ID":6,"COLUMN_COMMENT":"최종수정자"},{"COLUMN_NAME":"update_dt","COLUMN_ID":7,"COLUMN_COMMENT":"최종수정일"}],"table":"t_doc"},{"columns":[{"COLUMN_NAME":"file_id","COLUMN_ID":1,"COLUMN_COMMENT":""},{"COLUMN_NAME":"doc_id","COLUMN_ID":2,"COLUMN_COMMENT":""},{"COLUMN_NAME":"download_cnt","COLUMN_ID":3,"COLUMN_COMMENT":""},{"COLUMN_NAME":"file_nm","COLUMN_ID":4,"COLUMN_COMMENT":""},{"COLUMN_NAME":"file_size","COLUMN_ID":5,"COLUMN_COMMENT":""},{"COLUMN_NAME":"file_contents","COLUMN_ID":6,"COLUMN_COMMENT":""},{"COLUMN_NAME":"insert_user","COLUMN_ID":7,"COLUMN_COMMENT":""},{"COLUMN_NAME":"insert_dt","COLUMN_ID":8,"COLUMN_COMMENT":""}],"table":"t_doc_file"},{"columns":[{"COLUMN_NAME":"file_id","COLUMN_ID":1,"COLUMN_COMMENT":""},{"COLUMN_NAME":"page","COLUMN_ID":2,"COLUMN_COMMENT":""},{"COLUMN_NAME":"text","COLUMN_ID":3,"COLUMN_COMMENT":""},{"COLUMN_NAME":"image","COLUMN_ID":4,"COLUMN_COMMENT":""},{"COLUMN_NAME":"vector_text","COLUMN_ID":5,"COLUMN_COMMENT":""},{"COLUMN_NAME":"vector_image","COLUMN_ID":6,"COLUMN_COMMENT":""}],"table":"t_doc_file_page"}]}\`);
|
|
194305
|
+
const mainTableColumns = tableDefinitions.list[0].columns;
|
|
194306
|
+
|
|
194307
|
+
const selectList = async (formData = {}) => {
|
|
194308
|
+
if (!gridRef.current) return;
|
|
194309
|
+
|
|
194310
|
+
gridRef.current.classList.add("loading");
|
|
194311
|
+
/**
|
|
194312
|
+
const form1Data = ninegrid.querySelector(".form1", tabRef.current).getData();
|
|
194313
|
+
const form2Data = ninegrid.querySelector(".form2", tabRef.current).getData();
|
|
194314
|
+
const formData = { ...form1Data, ...form2Data };
|
|
194315
|
+
|
|
194316
|
+
const formData1 = {
|
|
194317
|
+
"_whereClause": await getWhere(),
|
|
194318
|
+
}
|
|
194319
|
+
console.log(formData1);
|
|
194320
|
+
*/
|
|
194321
|
+
|
|
194322
|
+
console.log(formData);
|
|
194323
|
+
|
|
194324
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, formData).then((res) => {
|
|
194325
|
+
gridRef.current.data.source = res.list;
|
|
194326
|
+
});
|
|
194327
|
+
};
|
|
194328
|
+
|
|
194329
|
+
const getWhere = async () => {
|
|
194330
|
+
return await ai.generateWhereCause("tmpla/DocManagerMapper.xml", "selectList", ninegrid.querySelector("#searchText", tabRef.current).value, import.meta.env.VITE_GEMINI_API_KEY);
|
|
194331
|
+
};
|
|
194332
|
+
|
|
194333
|
+
useEffect(() => {
|
|
194334
|
+
selectList();
|
|
194335
|
+
|
|
194336
|
+
const searchTextInput = ninegrid.querySelector("#searchText", tabRef.current);
|
|
194337
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
194338
|
+
|
|
194339
|
+
const handleSearchTextKeydown = (e) => {
|
|
194340
|
+
if (e.key === 'Enter' && !e.isComposing) {
|
|
194341
|
+
|
|
194342
|
+
//getWhere();
|
|
194343
|
+
getWhere().then(res => {
|
|
194344
|
+
selectList({"_whereClause":res});
|
|
194345
|
+
});
|
|
194346
|
+
}
|
|
194347
|
+
};
|
|
194348
|
+
|
|
194349
|
+
const handleSearchButtonClick = () => {
|
|
194350
|
+
selectList(ninegrid.querySelector(".form2", tabRef.current).getData());
|
|
194351
|
+
};
|
|
194352
|
+
|
|
194353
|
+
if (searchTextInput) {
|
|
194354
|
+
searchTextInput.addEventListener('keydown', handleSearchTextKeydown);
|
|
194355
|
+
}
|
|
194356
|
+
if (searchButton) {
|
|
194357
|
+
searchButton.addEventListener('click', handleSearchButtonClick);
|
|
194358
|
+
}
|
|
194359
|
+
|
|
194360
|
+
return () => {
|
|
194361
|
+
if (searchTextInput) {
|
|
194362
|
+
searchTextInput.removeEventListener('keydown', handleSearchTextKeydown);
|
|
194363
|
+
}
|
|
194364
|
+
if (searchButton) {
|
|
194365
|
+
searchButton.removeEventListener('click', handleSearchButtonClick);
|
|
194366
|
+
}
|
|
194367
|
+
};
|
|
194368
|
+
}, []);
|
|
194369
|
+
|
|
194370
|
+
return (
|
|
194371
|
+
<div className="wrapper">
|
|
194372
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
194373
|
+
<div className="list-wrapper">
|
|
194374
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
194375
|
+
<nx-tab-page caption="자연어 검색">
|
|
194376
|
+
<nx-form className="form1">
|
|
194377
|
+
<input type="text" id="searchText" name="searchText"
|
|
194378
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"/>
|
|
194379
|
+
</nx-form>
|
|
194380
|
+
</nx-tab-page>
|
|
194381
|
+
<nx-tab-page caption="클래식 검색">
|
|
194382
|
+
<nx-form className="form2">
|
|
194383
|
+
<label>문서ID: <input type="text" name="docId"/></label>
|
|
194384
|
+
<label>문서명: <input type="text" name="docNm"/></label>
|
|
194385
|
+
<label>매출액: <input type="number" name="amt"/></label>
|
|
194386
|
+
<label>최초등록자: <input type="text" name="insertUser"/></label>
|
|
194387
|
+
<label>최초등록일: <input type="text" name="insertDt"/></label>
|
|
194388
|
+
<label>최종수정자: <input type="text" name="updateUser"/></label>
|
|
194389
|
+
<label>최종수정일: <input type="text" name="updateDt"/></label>
|
|
194390
|
+
</nx-form>
|
|
194391
|
+
<button className="search">검색</button>
|
|
194392
|
+
</nx-tab-page>
|
|
194393
|
+
</nx-tab>
|
|
194394
|
+
|
|
194395
|
+
<div className="grid-wrapper">
|
|
194396
|
+
<nine-grid
|
|
194397
|
+
ref={gridRef}
|
|
194398
|
+
caption="문서관리"
|
|
194399
|
+
select-type="row"
|
|
194400
|
+
show-title-bar="true"
|
|
194401
|
+
show-menu-icon="true"
|
|
194402
|
+
show-status-bar="true"
|
|
194403
|
+
enable-fixed-col="true"
|
|
194404
|
+
row-resizable="false"
|
|
194405
|
+
col-movable="true"
|
|
194406
|
+
>
|
|
194407
|
+
<table>
|
|
194408
|
+
<colgroup>
|
|
194409
|
+
<col width="50" fixed="left" background-color="gray"/>
|
|
194410
|
+
{mainTableColumns.map((col) => (
|
|
194411
|
+
<col key={col.COLUMN_ID} width="150"/>
|
|
194412
|
+
))}
|
|
194413
|
+
</colgroup>
|
|
194414
|
+
<thead>
|
|
194415
|
+
<tr>
|
|
194416
|
+
<th>No.</th>
|
|
194417
|
+
{mainTableColumns.map((col) => (
|
|
194418
|
+
<th key={col.COLUMN_ID}>{col.COLUMN_COMMENT || col.COLUMN_NAME}</th>
|
|
194419
|
+
))}
|
|
194420
|
+
</tr>
|
|
194421
|
+
</thead>
|
|
194422
|
+
<tbody>
|
|
194423
|
+
<tr>
|
|
194424
|
+
<th><ng-row-indicator/></th>
|
|
194425
|
+
{mainTableColumns.map((col) => (
|
|
194426
|
+
<td key={col.COLUMN_ID} data-bind={toCamelCase(col.COLUMN_NAME)}></td>
|
|
194427
|
+
))}
|
|
194428
|
+
</tr>
|
|
194429
|
+
</tbody>
|
|
194430
|
+
</table>
|
|
194431
|
+
</nine-grid>
|
|
194432
|
+
</div>
|
|
194433
|
+
</div>
|
|
194434
|
+
</div>
|
|
194435
|
+
);
|
|
194436
|
+
};
|
|
194437
|
+
|
|
194438
|
+
export default DocManager;
|
|
194439
|
+
`;
|
|
194440
|
+
|
|
194441
|
+
this.shadowRoot.querySelector("ide-diff-popup").popup(src1, src2);
|
|
194123
194442
|
|
|
194124
194443
|
return;
|
|
194125
194444
|
}
|
|
@@ -194318,7 +194637,7 @@ class IdeDiffPopup extends HTMLElement
|
|
|
194318
194637
|
</style>
|
|
194319
194638
|
|
|
194320
194639
|
<nx-dialog>
|
|
194321
|
-
<nx-tab theme="theme-
|
|
194640
|
+
<nx-tab theme="theme-4" ref={tabRef}>
|
|
194322
194641
|
<nx-tab-page caption="1">
|
|
194323
194642
|
<ide-diff></ide-diff>
|
|
194324
194643
|
</nx-tab-page>
|
package/dist/bundle.esm.js
CHANGED
|
@@ -194112,10 +194112,329 @@ class IdeAssi extends HTMLElement
|
|
|
194112
194112
|
|
|
194113
194113
|
//this.shadowRoot.querySelector('ide-diff-popup').remove();
|
|
194114
194114
|
|
|
194115
|
-
|
|
194116
|
-
|
|
194115
|
+
this.shadowRoot.appendChild(document.createElement('ide-diff-popup'));
|
|
194116
|
+
|
|
194117
194117
|
//setTimeout(() => {
|
|
194118
|
-
|
|
194118
|
+
const src1 = `
|
|
194119
|
+
import React, { useRef, useEffect } from "react";
|
|
194120
|
+
import { api, ai } from "ide-assi";
|
|
194121
|
+
import ninegrid from "ninegrid2";
|
|
194122
|
+
|
|
194123
|
+
const DocManager = () => {
|
|
194124
|
+
const tabRef = useRef(null);
|
|
194125
|
+
const gridRef = useRef(null);
|
|
194126
|
+
|
|
194127
|
+
const selectList = async (params) => {
|
|
194128
|
+
if (!gridRef.current) return;
|
|
194129
|
+
gridRef.current.classList.add("loading");
|
|
194130
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, params).then((res) => {
|
|
194131
|
+
gridRef.current.data.source = res.list;
|
|
194132
|
+
});
|
|
194133
|
+
};
|
|
194134
|
+
|
|
194135
|
+
const handleNaturalLanguageSearch = async () => {
|
|
194136
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
194137
|
+
const searchText = searchTextElement ? searchTextElement.value : "";
|
|
194138
|
+
|
|
194139
|
+
if (!gridRef.current) return;
|
|
194140
|
+
gridRef.current.classList.add("loading");
|
|
194141
|
+
|
|
194142
|
+
let params = {};
|
|
194143
|
+
if (searchText) {
|
|
194144
|
+
params = {
|
|
194145
|
+
_whereClause: await ai.generateWhereCause(
|
|
194146
|
+
"tmpla/DocManagerMapper.xml",
|
|
194147
|
+
"selectList",
|
|
194148
|
+
searchText,
|
|
194149
|
+
import.meta.env.VITE_GEMINI_API_KEY
|
|
194150
|
+
),
|
|
194151
|
+
};
|
|
194152
|
+
}
|
|
194153
|
+
selectList(params);
|
|
194154
|
+
};
|
|
194155
|
+
|
|
194156
|
+
const handleClassicSearch = () => {
|
|
194157
|
+
const form2Element = ninegrid.querySelector(".form2", tabRef.current);
|
|
194158
|
+
const params = form2Element ? form2Element.getData() : {};
|
|
194159
|
+
selectList(params);
|
|
194160
|
+
};
|
|
194161
|
+
|
|
194162
|
+
useEffect(() => {
|
|
194163
|
+
selectList({});
|
|
194164
|
+
|
|
194165
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
194166
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
194167
|
+
|
|
194168
|
+
const handleKeyDown = (e) => {
|
|
194169
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
194170
|
+
handleNaturalLanguageSearch();
|
|
194171
|
+
}
|
|
194172
|
+
};
|
|
194173
|
+
|
|
194174
|
+
const handleClick = () => {
|
|
194175
|
+
handleClassicSearch();
|
|
194176
|
+
};
|
|
194177
|
+
|
|
194178
|
+
if (searchTextElement) {
|
|
194179
|
+
searchTextElement.addEventListener("keydown", handleKeyDown);
|
|
194180
|
+
}
|
|
194181
|
+
if (searchButton) {
|
|
194182
|
+
searchButton.addEventListener("click", handleClick);
|
|
194183
|
+
}
|
|
194184
|
+
|
|
194185
|
+
return () => {
|
|
194186
|
+
if (searchTextElement) {
|
|
194187
|
+
searchTextElement.removeEventListener("keydown", handleKeyDown);
|
|
194188
|
+
}
|
|
194189
|
+
if (searchButton) {
|
|
194190
|
+
searchButton.removeEventListener("click", handleClick);
|
|
194191
|
+
}
|
|
194192
|
+
};
|
|
194193
|
+
}, []);
|
|
194194
|
+
|
|
194195
|
+
return (
|
|
194196
|
+
<div className="wrapper">
|
|
194197
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
194198
|
+
<div className="list-wrapper">
|
|
194199
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
194200
|
+
<nx-tab-page caption="자연어 검색">
|
|
194201
|
+
<nx-form className="form1">
|
|
194202
|
+
<input
|
|
194203
|
+
type="text"
|
|
194204
|
+
id="searchText"
|
|
194205
|
+
name="searchText"
|
|
194206
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"
|
|
194207
|
+
/>
|
|
194208
|
+
</nx-form>
|
|
194209
|
+
</nx-tab-page>
|
|
194210
|
+
<nx-tab-page caption="클래식 검색">
|
|
194211
|
+
<nx-form className="form2">
|
|
194212
|
+
<label>문서명: <input type="text" name="docNm" /></label>
|
|
194213
|
+
<label>매출액:
|
|
194214
|
+
<input type="number" name="minAmt" placeholder="최소" /> ~
|
|
194215
|
+
<input type="number" name="maxAmt" placeholder="최대" />
|
|
194216
|
+
</label>
|
|
194217
|
+
</nx-form>
|
|
194218
|
+
<button className="search">검색</button>
|
|
194219
|
+
</nx-tab-page>
|
|
194220
|
+
</nx-tab>
|
|
194221
|
+
|
|
194222
|
+
<div className="grid-wrapper">
|
|
194223
|
+
<nine-grid
|
|
194224
|
+
ref={gridRef}
|
|
194225
|
+
caption="문서관리"
|
|
194226
|
+
select-type="row"
|
|
194227
|
+
show-title-bar="true"
|
|
194228
|
+
show-menu-icon="true"
|
|
194229
|
+
show-status-bar="true"
|
|
194230
|
+
enable-fixed-col="true"
|
|
194231
|
+
row-resizable="false"
|
|
194232
|
+
col-movable="true"
|
|
194233
|
+
>
|
|
194234
|
+
<table>
|
|
194235
|
+
<colgroup>
|
|
194236
|
+
<col width="50" fixed="left" background-color="gray" />
|
|
194237
|
+
<col width="100" />
|
|
194238
|
+
<col width="100" />
|
|
194239
|
+
<col width="200" />
|
|
194240
|
+
<col width="120" />
|
|
194241
|
+
<col width="100" />
|
|
194242
|
+
<col width="150" />
|
|
194243
|
+
<col width="150" />
|
|
194244
|
+
</colgroup>
|
|
194245
|
+
<thead>
|
|
194246
|
+
<tr>
|
|
194247
|
+
<th>No.</th>
|
|
194248
|
+
<th>최종수정자</th>
|
|
194249
|
+
<th>문서ID</th>
|
|
194250
|
+
<th>문서명</th>
|
|
194251
|
+
<th>매출액</th>
|
|
194252
|
+
<th>최초등록자</th>
|
|
194253
|
+
<th>최초등록일</th>
|
|
194254
|
+
<th>최종수정일</th>
|
|
194255
|
+
</tr>
|
|
194256
|
+
</thead>
|
|
194257
|
+
<tbody>
|
|
194258
|
+
<tr>
|
|
194259
|
+
<th><ng-row-indicator /></th>
|
|
194260
|
+
<td data-bind="updateUser" text-align="center"></td>
|
|
194261
|
+
<td data-bind="docId" text-align="center"></td>
|
|
194262
|
+
<td data-bind="docNm" text-align="left"></td>
|
|
194263
|
+
<td
|
|
194264
|
+
data-bind="amt"
|
|
194265
|
+
data-expr="data.amt.toLocaleString()"
|
|
194266
|
+
text-align="right"
|
|
194267
|
+
show-icon="true"
|
|
194268
|
+
icon-type="sphere"
|
|
194269
|
+
icon-color="data.amt >= 2000 ? 'red' : 'gray'"
|
|
194270
|
+
></td>
|
|
194271
|
+
<td data-bind="insertUser" text-align="center"></td>
|
|
194272
|
+
<td data-bind="insertDt" text-align="center"></td>
|
|
194273
|
+
<td data-bind="updateDt" text-align="center"></td>
|
|
194274
|
+
</tr>
|
|
194275
|
+
</tbody>
|
|
194276
|
+
</table>
|
|
194277
|
+
</nine-grid>
|
|
194278
|
+
</div>
|
|
194279
|
+
</div>
|
|
194280
|
+
</div>
|
|
194281
|
+
);
|
|
194282
|
+
};
|
|
194283
|
+
|
|
194284
|
+
export default DocManager;
|
|
194285
|
+
`;
|
|
194286
|
+
|
|
194287
|
+
const src2 = `
|
|
194288
|
+
import React, { useRef, useEffect } from 'react';
|
|
194289
|
+
import { api, ai } from "ide-assi";
|
|
194290
|
+
import ninegrid from "ninegrid2";
|
|
194291
|
+
|
|
194292
|
+
const DocManager = () => {
|
|
194293
|
+
const tabRef = useRef(null);
|
|
194294
|
+
const gridRef = useRef(null);
|
|
194295
|
+
|
|
194296
|
+
const toCamelCase = (s) => {
|
|
194297
|
+
return s.toLowerCase().replace(/_([a-z])/g, (g) => g[1].toUpperCase());
|
|
194298
|
+
};
|
|
194299
|
+
|
|
194300
|
+
const tableDefinitions = JSON.parse(\`{"list":[{"columns":[{"COLUMN_NAME":"doc_id","COLUMN_ID":1,"COLUMN_COMMENT":"문서ID"},{"COLUMN_NAME":"doc_nm","COLUMN_ID":2,"COLUMN_COMMENT":"문서명"},{"COLUMN_NAME":"amt","COLUMN_ID":3,"COLUMN_COMMENT":"매출액"},{"COLUMN_NAME":"insert_user","COLUMN_ID":4,"COLUMN_COMMENT":"최초등록자"},{"COLUMN_NAME":"insert_dt","COLUMN_ID":5,"COLUMN_COMMENT":"최초등록일"},{"COLUMN_NAME":"update_user","COLUMN_ID":6,"COLUMN_COMMENT":"최종수정자"},{"COLUMN_NAME":"update_dt","COLUMN_ID":7,"COLUMN_COMMENT":"최종수정일"}],"table":"t_doc"},{"columns":[{"COLUMN_NAME":"file_id","COLUMN_ID":1,"COLUMN_COMMENT":""},{"COLUMN_NAME":"doc_id","COLUMN_ID":2,"COLUMN_COMMENT":""},{"COLUMN_NAME":"download_cnt","COLUMN_ID":3,"COLUMN_COMMENT":""},{"COLUMN_NAME":"file_nm","COLUMN_ID":4,"COLUMN_COMMENT":""},{"COLUMN_NAME":"file_size","COLUMN_ID":5,"COLUMN_COMMENT":""},{"COLUMN_NAME":"file_contents","COLUMN_ID":6,"COLUMN_COMMENT":""},{"COLUMN_NAME":"insert_user","COLUMN_ID":7,"COLUMN_COMMENT":""},{"COLUMN_NAME":"insert_dt","COLUMN_ID":8,"COLUMN_COMMENT":""}],"table":"t_doc_file"},{"columns":[{"COLUMN_NAME":"file_id","COLUMN_ID":1,"COLUMN_COMMENT":""},{"COLUMN_NAME":"page","COLUMN_ID":2,"COLUMN_COMMENT":""},{"COLUMN_NAME":"text","COLUMN_ID":3,"COLUMN_COMMENT":""},{"COLUMN_NAME":"image","COLUMN_ID":4,"COLUMN_COMMENT":""},{"COLUMN_NAME":"vector_text","COLUMN_ID":5,"COLUMN_COMMENT":""},{"COLUMN_NAME":"vector_image","COLUMN_ID":6,"COLUMN_COMMENT":""}],"table":"t_doc_file_page"}]}\`);
|
|
194301
|
+
const mainTableColumns = tableDefinitions.list[0].columns;
|
|
194302
|
+
|
|
194303
|
+
const selectList = async (formData = {}) => {
|
|
194304
|
+
if (!gridRef.current) return;
|
|
194305
|
+
|
|
194306
|
+
gridRef.current.classList.add("loading");
|
|
194307
|
+
/**
|
|
194308
|
+
const form1Data = ninegrid.querySelector(".form1", tabRef.current).getData();
|
|
194309
|
+
const form2Data = ninegrid.querySelector(".form2", tabRef.current).getData();
|
|
194310
|
+
const formData = { ...form1Data, ...form2Data };
|
|
194311
|
+
|
|
194312
|
+
const formData1 = {
|
|
194313
|
+
"_whereClause": await getWhere(),
|
|
194314
|
+
}
|
|
194315
|
+
console.log(formData1);
|
|
194316
|
+
*/
|
|
194317
|
+
|
|
194318
|
+
console.log(formData);
|
|
194319
|
+
|
|
194320
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, formData).then((res) => {
|
|
194321
|
+
gridRef.current.data.source = res.list;
|
|
194322
|
+
});
|
|
194323
|
+
};
|
|
194324
|
+
|
|
194325
|
+
const getWhere = async () => {
|
|
194326
|
+
return await ai.generateWhereCause("tmpla/DocManagerMapper.xml", "selectList", ninegrid.querySelector("#searchText", tabRef.current).value, import.meta.env.VITE_GEMINI_API_KEY);
|
|
194327
|
+
};
|
|
194328
|
+
|
|
194329
|
+
useEffect(() => {
|
|
194330
|
+
selectList();
|
|
194331
|
+
|
|
194332
|
+
const searchTextInput = ninegrid.querySelector("#searchText", tabRef.current);
|
|
194333
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
194334
|
+
|
|
194335
|
+
const handleSearchTextKeydown = (e) => {
|
|
194336
|
+
if (e.key === 'Enter' && !e.isComposing) {
|
|
194337
|
+
|
|
194338
|
+
//getWhere();
|
|
194339
|
+
getWhere().then(res => {
|
|
194340
|
+
selectList({"_whereClause":res});
|
|
194341
|
+
});
|
|
194342
|
+
}
|
|
194343
|
+
};
|
|
194344
|
+
|
|
194345
|
+
const handleSearchButtonClick = () => {
|
|
194346
|
+
selectList(ninegrid.querySelector(".form2", tabRef.current).getData());
|
|
194347
|
+
};
|
|
194348
|
+
|
|
194349
|
+
if (searchTextInput) {
|
|
194350
|
+
searchTextInput.addEventListener('keydown', handleSearchTextKeydown);
|
|
194351
|
+
}
|
|
194352
|
+
if (searchButton) {
|
|
194353
|
+
searchButton.addEventListener('click', handleSearchButtonClick);
|
|
194354
|
+
}
|
|
194355
|
+
|
|
194356
|
+
return () => {
|
|
194357
|
+
if (searchTextInput) {
|
|
194358
|
+
searchTextInput.removeEventListener('keydown', handleSearchTextKeydown);
|
|
194359
|
+
}
|
|
194360
|
+
if (searchButton) {
|
|
194361
|
+
searchButton.removeEventListener('click', handleSearchButtonClick);
|
|
194362
|
+
}
|
|
194363
|
+
};
|
|
194364
|
+
}, []);
|
|
194365
|
+
|
|
194366
|
+
return (
|
|
194367
|
+
<div className="wrapper">
|
|
194368
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
194369
|
+
<div className="list-wrapper">
|
|
194370
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
194371
|
+
<nx-tab-page caption="자연어 검색">
|
|
194372
|
+
<nx-form className="form1">
|
|
194373
|
+
<input type="text" id="searchText" name="searchText"
|
|
194374
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"/>
|
|
194375
|
+
</nx-form>
|
|
194376
|
+
</nx-tab-page>
|
|
194377
|
+
<nx-tab-page caption="클래식 검색">
|
|
194378
|
+
<nx-form className="form2">
|
|
194379
|
+
<label>문서ID: <input type="text" name="docId"/></label>
|
|
194380
|
+
<label>문서명: <input type="text" name="docNm"/></label>
|
|
194381
|
+
<label>매출액: <input type="number" name="amt"/></label>
|
|
194382
|
+
<label>최초등록자: <input type="text" name="insertUser"/></label>
|
|
194383
|
+
<label>최초등록일: <input type="text" name="insertDt"/></label>
|
|
194384
|
+
<label>최종수정자: <input type="text" name="updateUser"/></label>
|
|
194385
|
+
<label>최종수정일: <input type="text" name="updateDt"/></label>
|
|
194386
|
+
</nx-form>
|
|
194387
|
+
<button className="search">검색</button>
|
|
194388
|
+
</nx-tab-page>
|
|
194389
|
+
</nx-tab>
|
|
194390
|
+
|
|
194391
|
+
<div className="grid-wrapper">
|
|
194392
|
+
<nine-grid
|
|
194393
|
+
ref={gridRef}
|
|
194394
|
+
caption="문서관리"
|
|
194395
|
+
select-type="row"
|
|
194396
|
+
show-title-bar="true"
|
|
194397
|
+
show-menu-icon="true"
|
|
194398
|
+
show-status-bar="true"
|
|
194399
|
+
enable-fixed-col="true"
|
|
194400
|
+
row-resizable="false"
|
|
194401
|
+
col-movable="true"
|
|
194402
|
+
>
|
|
194403
|
+
<table>
|
|
194404
|
+
<colgroup>
|
|
194405
|
+
<col width="50" fixed="left" background-color="gray"/>
|
|
194406
|
+
{mainTableColumns.map((col) => (
|
|
194407
|
+
<col key={col.COLUMN_ID} width="150"/>
|
|
194408
|
+
))}
|
|
194409
|
+
</colgroup>
|
|
194410
|
+
<thead>
|
|
194411
|
+
<tr>
|
|
194412
|
+
<th>No.</th>
|
|
194413
|
+
{mainTableColumns.map((col) => (
|
|
194414
|
+
<th key={col.COLUMN_ID}>{col.COLUMN_COMMENT || col.COLUMN_NAME}</th>
|
|
194415
|
+
))}
|
|
194416
|
+
</tr>
|
|
194417
|
+
</thead>
|
|
194418
|
+
<tbody>
|
|
194419
|
+
<tr>
|
|
194420
|
+
<th><ng-row-indicator/></th>
|
|
194421
|
+
{mainTableColumns.map((col) => (
|
|
194422
|
+
<td key={col.COLUMN_ID} data-bind={toCamelCase(col.COLUMN_NAME)}></td>
|
|
194423
|
+
))}
|
|
194424
|
+
</tr>
|
|
194425
|
+
</tbody>
|
|
194426
|
+
</table>
|
|
194427
|
+
</nine-grid>
|
|
194428
|
+
</div>
|
|
194429
|
+
</div>
|
|
194430
|
+
</div>
|
|
194431
|
+
);
|
|
194432
|
+
};
|
|
194433
|
+
|
|
194434
|
+
export default DocManager;
|
|
194435
|
+
`;
|
|
194436
|
+
|
|
194437
|
+
this.shadowRoot.querySelector("ide-diff-popup").popup(src1, src2);
|
|
194119
194438
|
|
|
194120
194439
|
return;
|
|
194121
194440
|
}
|
|
@@ -194314,7 +194633,7 @@ class IdeDiffPopup extends HTMLElement
|
|
|
194314
194633
|
</style>
|
|
194315
194634
|
|
|
194316
194635
|
<nx-dialog>
|
|
194317
|
-
<nx-tab theme="theme-
|
|
194636
|
+
<nx-tab theme="theme-4" ref={tabRef}>
|
|
194318
194637
|
<nx-tab-page caption="1">
|
|
194319
194638
|
<ide-diff></ide-diff>
|
|
194320
194639
|
</nx-tab-page>
|