ide-assi 0.498.0 → 0.499.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 +346 -54
- package/dist/bundle.esm.js +346 -54
- package/dist/components/ideAssi.js +2 -2
- package/package.json +1 -1
- package/src/components/ideAssi.js +2 -2
package/dist/bundle.cjs.js
CHANGED
|
@@ -202637,6 +202637,351 @@ class IdeAssi extends HTMLElement
|
|
|
202637
202637
|
//this.shadowRoot.querySelector('ide-diff-popup').remove();
|
|
202638
202638
|
|
|
202639
202639
|
this.shadowRoot.appendChild(document.createElement('ide-diff-popup'));
|
|
202640
|
+
|
|
202641
|
+
//setTimeout(() => {
|
|
202642
|
+
let src1 = `
|
|
202643
|
+
import React, { useRef, useEffect } from "react" adfa;
|
|
202644
|
+
import { api, ai } from "ide-assi";
|
|
202645
|
+
import ninegrid from "ninegrid2";
|
|
202646
|
+
|
|
202647
|
+
const DocManager = () => {
|
|
202648
|
+
const tabRef = useRef(null);
|
|
202649
|
+
const gridRef = useRef(null);
|
|
202650
|
+
|
|
202651
|
+
const selectList = async (params) => {
|
|
202652
|
+
if (!gridRef.current) return;
|
|
202653
|
+
gridRef.current.classList.add("loading");
|
|
202654
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, params).then((res) => {
|
|
202655
|
+
gridRef.current.data.source = res.list;
|
|
202656
|
+
});
|
|
202657
|
+
};
|
|
202658
|
+
|
|
202659
|
+
const handleNaturalLanguageSearch = async () => {
|
|
202660
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202661
|
+
const searchText = searchTextElement ? searchTextElement.value : "";
|
|
202662
|
+
|
|
202663
|
+
if (!gridRef.current) return;
|
|
202664
|
+
gridRef.current.classList.add("loading");
|
|
202665
|
+
|
|
202666
|
+
let params = {};
|
|
202667
|
+
if (searchText) {
|
|
202668
|
+
params = {
|
|
202669
|
+
_whereClause: await ai.generateWhereCause(
|
|
202670
|
+
"tmpla/DocManagerMapper.xml",
|
|
202671
|
+
"selectList",
|
|
202672
|
+
searchText,
|
|
202673
|
+
import.meta.env.VITE_GEMINI_API_KEY
|
|
202674
|
+
),
|
|
202675
|
+
};
|
|
202676
|
+
}
|
|
202677
|
+
selectList(params);
|
|
202678
|
+
};
|
|
202679
|
+
|
|
202680
|
+
const handleClassicSearch = () => {
|
|
202681
|
+
if (!gridRef.current) return;
|
|
202682
|
+
gridRef.current.classList.add("loading");
|
|
202683
|
+
|
|
202684
|
+
const form2Element = ninegrid.querySelector(".form2", tabRef.current);
|
|
202685
|
+
const params = form2Element ? form2Element.getData() : {};
|
|
202686
|
+
selectList(params);
|
|
202687
|
+
};
|
|
202688
|
+
|
|
202689
|
+
useEffect(() => {
|
|
202690
|
+
selectList({});
|
|
202691
|
+
|
|
202692
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202693
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
202694
|
+
|
|
202695
|
+
const handleKeyDown = (e) => {
|
|
202696
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
202697
|
+
handleNaturalLanguageSearch();
|
|
202698
|
+
}
|
|
202699
|
+
};
|
|
202700
|
+
|
|
202701
|
+
const handleClick = () => {
|
|
202702
|
+
handleClassicSearch();
|
|
202703
|
+
};
|
|
202704
|
+
|
|
202705
|
+
if (searchTextElement) {
|
|
202706
|
+
searchTextElement.addEventListener("keydown", handleKeyDown);
|
|
202707
|
+
}
|
|
202708
|
+
if (searchButton) {
|
|
202709
|
+
searchButton.addEventListener("click", handleClick);
|
|
202710
|
+
}
|
|
202711
|
+
|
|
202712
|
+
return () => {
|
|
202713
|
+
if (searchTextElement) {
|
|
202714
|
+
searchTextElement.removeEventListener("keydown", handleKeyDown);
|
|
202715
|
+
}
|
|
202716
|
+
if (searchButton) {
|
|
202717
|
+
searchButton.removeEventListener("click", handleClick);
|
|
202718
|
+
}
|
|
202719
|
+
};
|
|
202720
|
+
}, []);
|
|
202721
|
+
|
|
202722
|
+
return (
|
|
202723
|
+
<div className="wrapper">
|
|
202724
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
202725
|
+
<div className="list-wrapper">
|
|
202726
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
202727
|
+
<nx-tab-page caption="자연어 검색">
|
|
202728
|
+
<nx-form className="form1">
|
|
202729
|
+
<input
|
|
202730
|
+
type="text"
|
|
202731
|
+
id="searchText"
|
|
202732
|
+
name="searchText"
|
|
202733
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"
|
|
202734
|
+
/>
|
|
202735
|
+
</nx-form>
|
|
202736
|
+
</nx-tab-page>
|
|
202737
|
+
<nx-tab-page caption="클래식 검색">
|
|
202738
|
+
<nx-form className="form2">
|
|
202739
|
+
<label>문서명: <input type="text" name="docNm" /></label>
|
|
202740
|
+
<label>매출액:
|
|
202741
|
+
<input type="number" name="minAmt" placeholder="최소" /> ~
|
|
202742
|
+
<input type="number" name="maxAmt" placeholder="최대" />
|
|
202743
|
+
</label>
|
|
202744
|
+
</nx-form>
|
|
202745
|
+
<button className="search">검색</button>
|
|
202746
|
+
</nx-tab-page>
|
|
202747
|
+
</nx-tab>
|
|
202748
|
+
|
|
202749
|
+
<div className="grid-wrapper">
|
|
202750
|
+
<nine-grid
|
|
202751
|
+
ref={gridRef}
|
|
202752
|
+
caption="문서관리"
|
|
202753
|
+
select-type="row"
|
|
202754
|
+
show-title-bar="true"
|
|
202755
|
+
show-menu-icon="true"
|
|
202756
|
+
show-status-bar="true"
|
|
202757
|
+
enable-fixed-col="true"
|
|
202758
|
+
row-resizable="false"
|
|
202759
|
+
col-movable="true"
|
|
202760
|
+
>
|
|
202761
|
+
<table>
|
|
202762
|
+
<colgroup>
|
|
202763
|
+
<col width="50" fixed="left" background-color="gray" />
|
|
202764
|
+
<col width="100" />
|
|
202765
|
+
<col width="100" />
|
|
202766
|
+
<col width="200" />
|
|
202767
|
+
<col width="120" />
|
|
202768
|
+
<col width="100" />
|
|
202769
|
+
<col width="150" />
|
|
202770
|
+
<col width="150" />
|
|
202771
|
+
</colgroup>
|
|
202772
|
+
<thead>
|
|
202773
|
+
<tr>
|
|
202774
|
+
<th>No.</th>
|
|
202775
|
+
<th>최종수정자</th>
|
|
202776
|
+
<th>문서ID</th>
|
|
202777
|
+
<th>문서명</th>
|
|
202778
|
+
<th>매출액</th>
|
|
202779
|
+
<th>최초등록자</th>
|
|
202780
|
+
<th>최초등록일</th>
|
|
202781
|
+
<th>최종수정일</th>
|
|
202782
|
+
</tr>
|
|
202783
|
+
</thead>
|
|
202784
|
+
<tbody>
|
|
202785
|
+
<tr>
|
|
202786
|
+
<th><ng-row-indicator /></th>
|
|
202787
|
+
<td data-bind="updateUser" text-align="center"></td>
|
|
202788
|
+
<td data-bind="docId" text-align="center"></td>
|
|
202789
|
+
<td data-bind="docNm" text-align="left"></td>
|
|
202790
|
+
<td
|
|
202791
|
+
data-bind="amt"
|
|
202792
|
+
data-expr="data.amt.toLocaleString()"
|
|
202793
|
+
text-align="right"
|
|
202794
|
+
show-icon="true"
|
|
202795
|
+
icon-type="sphere"
|
|
202796
|
+
icon-color="data.amt >= 2000 ? 'red' : 'gray'"
|
|
202797
|
+
></td>
|
|
202798
|
+
<td data-bind="insertUser" text-align="center"></td>
|
|
202799
|
+
<td data-bind="insertDt" text-align="center"></td>
|
|
202800
|
+
<td data-bind="updateDt" text-align="center"></td>
|
|
202801
|
+
</tr>
|
|
202802
|
+
</tbody>
|
|
202803
|
+
</table>
|
|
202804
|
+
</nine-grid>
|
|
202805
|
+
</div>
|
|
202806
|
+
</div>
|
|
202807
|
+
</div>
|
|
202808
|
+
);
|
|
202809
|
+
};
|
|
202810
|
+
|
|
202811
|
+
export default DocManager;
|
|
202812
|
+
`;
|
|
202813
|
+
|
|
202814
|
+
let src2 = `
|
|
202815
|
+
import React, { useRef, useEffect } from "react";
|
|
202816
|
+
import { api, ai } from "ide-assi";
|
|
202817
|
+
import ninegrid from "ninegrid2";
|
|
202818
|
+
|
|
202819
|
+
const DocManager = () => {
|
|
202820
|
+
const tabRef = useRef(null);
|
|
202821
|
+
const gridRef = useRef(null);
|
|
202822
|
+
|
|
202823
|
+
const selectList = async (params) => {
|
|
202824
|
+
if (!gridRef.current) return;
|
|
202825
|
+
gridRef.current.classList.add("loading");
|
|
202826
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, params).then((res) => {
|
|
202827
|
+
gridRef.current.data.source = res.list;
|
|
202828
|
+
});
|
|
202829
|
+
};
|
|
202830
|
+
|
|
202831
|
+
const handleNaturalLanguageSearch = async () => {
|
|
202832
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202833
|
+
const searchText = searchTextElement ? searchTextElement.value : "";
|
|
202834
|
+
|
|
202835
|
+
if (!gridRef.current) return;
|
|
202836
|
+
gridRef.current.classList.add("loading");
|
|
202837
|
+
|
|
202838
|
+
let params = {};
|
|
202839
|
+
if (searchText) {
|
|
202840
|
+
params = {
|
|
202841
|
+
_whereClause: await ai.generateWhereCause(
|
|
202842
|
+
"tmpla/DocManagerMapper.xml",
|
|
202843
|
+
"selectList",
|
|
202844
|
+
searchText,
|
|
202845
|
+
import.meta.env.VITE_GEMINI_API_KEY
|
|
202846
|
+
),
|
|
202847
|
+
};
|
|
202848
|
+
}
|
|
202849
|
+
selectList(params);
|
|
202850
|
+
};
|
|
202851
|
+
|
|
202852
|
+
const handleClassicSearch = () => {
|
|
202853
|
+
if (!gridRef.current) return;
|
|
202854
|
+
gridRef.current.classList.add("loading");
|
|
202855
|
+
|
|
202856
|
+
const form2Element = ninegrid.querySelector(".form2", tabRef.current);
|
|
202857
|
+
const params = form2Element ? form2Element.getData() : {};
|
|
202858
|
+
selectList(params);
|
|
202859
|
+
};
|
|
202860
|
+
|
|
202861
|
+
useEffect(() => {
|
|
202862
|
+
selectList({});
|
|
202863
|
+
|
|
202864
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202865
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
202866
|
+
|
|
202867
|
+
const handleKeyDown = (e) => {
|
|
202868
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
202869
|
+
handleNaturalLanguageSearch();
|
|
202870
|
+
}
|
|
202871
|
+
};
|
|
202872
|
+
|
|
202873
|
+
const handleClick = () => {
|
|
202874
|
+
handleClassicSearch();
|
|
202875
|
+
};
|
|
202876
|
+
|
|
202877
|
+
if (searchTextElement) {
|
|
202878
|
+
searchTextElement.addEventListener("keydown", handleKeyDown);
|
|
202879
|
+
}
|
|
202880
|
+
if (searchButton) {
|
|
202881
|
+
searchButton.addEventListener("click", handleClick);
|
|
202882
|
+
}
|
|
202883
|
+
|
|
202884
|
+
return () => {
|
|
202885
|
+
if (searchTextElement) {
|
|
202886
|
+
searchTextElement.removeEventListener("keydown", handleKeyDown);
|
|
202887
|
+
}
|
|
202888
|
+
if (searchButton) {
|
|
202889
|
+
searchButton.removeEventListener("click", handleClick);
|
|
202890
|
+
}
|
|
202891
|
+
};
|
|
202892
|
+
}, []);
|
|
202893
|
+
|
|
202894
|
+
return (
|
|
202895
|
+
<div className="wrapper">
|
|
202896
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
202897
|
+
<div className="list-wrapper">
|
|
202898
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
202899
|
+
<nx-tab-page caption="자연어 검색">
|
|
202900
|
+
<nx-form className="form1">
|
|
202901
|
+
<input
|
|
202902
|
+
type="text"
|
|
202903
|
+
id="searchText"
|
|
202904
|
+
name="searchText"
|
|
202905
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"
|
|
202906
|
+
/>
|
|
202907
|
+
</nx-form>
|
|
202908
|
+
</nx-tab-page>
|
|
202909
|
+
<nx-tab-page caption="클래식 검색">
|
|
202910
|
+
<nx-form className="form2">
|
|
202911
|
+
<label>문서명: <input type="text" name="docNm" /></label>
|
|
202912
|
+
<label>매출액:
|
|
202913
|
+
<input type="number" name="minAmt" placeholder="최소" /> ~
|
|
202914
|
+
<input type="number" name="maxAmt" placeholder="최대" />
|
|
202915
|
+
</label>
|
|
202916
|
+
</nx-form>
|
|
202917
|
+
<button className="search">검색</button>
|
|
202918
|
+
</nx-tab-page>
|
|
202919
|
+
</nx-tab>
|
|
202920
|
+
|
|
202921
|
+
<div className="grid-wrapper">
|
|
202922
|
+
<nine-grid
|
|
202923
|
+
ref={gridRef}
|
|
202924
|
+
caption="매출 문서 관리"
|
|
202925
|
+
select-type="row"
|
|
202926
|
+
show-title-bar="true"
|
|
202927
|
+
show-menu-icon="true"
|
|
202928
|
+
show-status-bar="true"
|
|
202929
|
+
enable-fixed-col="true"
|
|
202930
|
+
row-resizable="false"
|
|
202931
|
+
col-movable="true"
|
|
202932
|
+
>
|
|
202933
|
+
<table>
|
|
202934
|
+
<colgroup>
|
|
202935
|
+
<col width="50" fixed="left" background-color="gray" />
|
|
202936
|
+
<col width="100" />
|
|
202937
|
+
<col width="120" />
|
|
202938
|
+
<col width="100" />
|
|
202939
|
+
<col width="200" />
|
|
202940
|
+
<col width="100" />
|
|
202941
|
+
<col width="150" />
|
|
202942
|
+
<col width="150" />
|
|
202943
|
+
</colgroup>
|
|
202944
|
+
<thead>
|
|
202945
|
+
<tr>
|
|
202946
|
+
<th>No.</th>
|
|
202947
|
+
<th>문서ID</th>
|
|
202948
|
+
<th>매출액</th>
|
|
202949
|
+
<th>최종수정자</th>
|
|
202950
|
+
<th>문서명</th>
|
|
202951
|
+
<th>최초등록자</th>
|
|
202952
|
+
<th>최초등록일</th>
|
|
202953
|
+
<th>최종수정일</th>
|
|
202954
|
+
</tr>
|
|
202955
|
+
</thead>
|
|
202956
|
+
<tbody>
|
|
202957
|
+
<tr>
|
|
202958
|
+
<th><ng-row-indicator /></th>
|
|
202959
|
+
<td data-bind="docId" text-align="center"></td>
|
|
202960
|
+
<td
|
|
202961
|
+
data-bind="amt"
|
|
202962
|
+
data-expr="data.amt.toLocaleString()"
|
|
202963
|
+
text-align="right"
|
|
202964
|
+
show-icon="true"
|
|
202965
|
+
icon-type="sphere"
|
|
202966
|
+
icon-color="data.amt >= 2000 ? 'red' : 'gray'"
|
|
202967
|
+
></td>
|
|
202968
|
+
<td data-bind="updateUser" text-align="center"></td>
|
|
202969
|
+
<td data-bind="docNm" text-align="left"></td>
|
|
202970
|
+
<td data-bind="insertUser" text-align="center"></td>
|
|
202971
|
+
<td data-bind="insertDt" text-align="center"></td>
|
|
202972
|
+
<td data-bind="updateDt" text-align="center"></td>
|
|
202973
|
+
</tr>
|
|
202974
|
+
</tbody>
|
|
202975
|
+
</table>
|
|
202976
|
+
</nine-grid>
|
|
202977
|
+
</div>
|
|
202978
|
+
</div>
|
|
202979
|
+
</div>
|
|
202980
|
+
);
|
|
202981
|
+
};
|
|
202982
|
+
|
|
202983
|
+
export default DocManager;
|
|
202984
|
+
`;
|
|
202640
202985
|
/**
|
|
202641
202986
|
src1 = `
|
|
202642
202987
|
<tr>
|
|
@@ -202662,7 +203007,7 @@ class IdeAssi extends HTMLElement
|
|
|
202662
203007
|
<th>최종수정일</th>
|
|
202663
203008
|
</tr>
|
|
202664
203009
|
`; */
|
|
202665
|
-
|
|
203010
|
+
|
|
202666
203011
|
this.shadowRoot.querySelector("ide-diff-popup").popup([{
|
|
202667
203012
|
javascript: {
|
|
202668
203013
|
asis: src1,
|
|
@@ -202671,59 +203016,6 @@ class IdeAssi extends HTMLElement
|
|
|
202671
203016
|
}]);
|
|
202672
203017
|
|
|
202673
203018
|
return;
|
|
202674
|
-
*/
|
|
202675
|
-
|
|
202676
|
-
|
|
202677
|
-
|
|
202678
|
-
|
|
202679
|
-
const apply = {
|
|
202680
|
-
mybatis: this.shadowRoot.querySelector("#mybatis").checked,
|
|
202681
|
-
service: this.shadowRoot.querySelector("#service").checked,
|
|
202682
|
-
controller: this.shadowRoot.querySelector("#controller").checked,
|
|
202683
|
-
javascript: this.shadowRoot.querySelector("#javascript").checked,
|
|
202684
|
-
};
|
|
202685
|
-
|
|
202686
|
-
if (!apply.mybatis && !apply.service && !apply.controller && !apply.javascript) return;
|
|
202687
|
-
|
|
202688
|
-
const userPrompt = e.target.value.trim();
|
|
202689
|
-
if (!userPrompt) return;
|
|
202690
|
-
|
|
202691
|
-
if (this.#ing) return;
|
|
202692
|
-
this.#ing = true;
|
|
202693
|
-
|
|
202694
|
-
/**
|
|
202695
|
-
* 옵션저장
|
|
202696
|
-
*/
|
|
202697
|
-
this.#saveLocalSettings(apply);
|
|
202698
|
-
|
|
202699
|
-
|
|
202700
|
-
|
|
202701
|
-
/**
|
|
202702
|
-
* setTimeout 없으면, 맥에서 한글 잔상이 남음
|
|
202703
|
-
* setTimeout 내에서 e.target이 nx-ai-container가 된다.
|
|
202704
|
-
*/
|
|
202705
|
-
setTimeout(() => {
|
|
202706
|
-
this.shadowRoot.querySelector("textarea").value = "";
|
|
202707
|
-
});
|
|
202708
|
-
|
|
202709
|
-
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
202710
|
-
|
|
202711
|
-
|
|
202712
|
-
elAiChat.add("me", userPrompt);
|
|
202713
|
-
elAiChat.add("ing", "...");
|
|
202714
|
-
|
|
202715
|
-
|
|
202716
|
-
try {
|
|
202717
|
-
const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
|
|
202718
|
-
if (changedSource) {
|
|
202719
|
-
this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
|
|
202720
|
-
}
|
|
202721
|
-
} catch (error) {
|
|
202722
|
-
console.error(error);
|
|
202723
|
-
elAiChat.add("ai", String(error).replace("Error:", ""));
|
|
202724
|
-
}
|
|
202725
|
-
|
|
202726
|
-
this.#ing = false;
|
|
202727
203019
|
}
|
|
202728
203020
|
|
|
202729
203021
|
#toggleCollapseHandler = () => {
|
package/dist/bundle.esm.js
CHANGED
|
@@ -202633,6 +202633,351 @@ class IdeAssi extends HTMLElement
|
|
|
202633
202633
|
//this.shadowRoot.querySelector('ide-diff-popup').remove();
|
|
202634
202634
|
|
|
202635
202635
|
this.shadowRoot.appendChild(document.createElement('ide-diff-popup'));
|
|
202636
|
+
|
|
202637
|
+
//setTimeout(() => {
|
|
202638
|
+
let src1 = `
|
|
202639
|
+
import React, { useRef, useEffect } from "react" adfa;
|
|
202640
|
+
import { api, ai } from "ide-assi";
|
|
202641
|
+
import ninegrid from "ninegrid2";
|
|
202642
|
+
|
|
202643
|
+
const DocManager = () => {
|
|
202644
|
+
const tabRef = useRef(null);
|
|
202645
|
+
const gridRef = useRef(null);
|
|
202646
|
+
|
|
202647
|
+
const selectList = async (params) => {
|
|
202648
|
+
if (!gridRef.current) return;
|
|
202649
|
+
gridRef.current.classList.add("loading");
|
|
202650
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, params).then((res) => {
|
|
202651
|
+
gridRef.current.data.source = res.list;
|
|
202652
|
+
});
|
|
202653
|
+
};
|
|
202654
|
+
|
|
202655
|
+
const handleNaturalLanguageSearch = async () => {
|
|
202656
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202657
|
+
const searchText = searchTextElement ? searchTextElement.value : "";
|
|
202658
|
+
|
|
202659
|
+
if (!gridRef.current) return;
|
|
202660
|
+
gridRef.current.classList.add("loading");
|
|
202661
|
+
|
|
202662
|
+
let params = {};
|
|
202663
|
+
if (searchText) {
|
|
202664
|
+
params = {
|
|
202665
|
+
_whereClause: await ai.generateWhereCause(
|
|
202666
|
+
"tmpla/DocManagerMapper.xml",
|
|
202667
|
+
"selectList",
|
|
202668
|
+
searchText,
|
|
202669
|
+
import.meta.env.VITE_GEMINI_API_KEY
|
|
202670
|
+
),
|
|
202671
|
+
};
|
|
202672
|
+
}
|
|
202673
|
+
selectList(params);
|
|
202674
|
+
};
|
|
202675
|
+
|
|
202676
|
+
const handleClassicSearch = () => {
|
|
202677
|
+
if (!gridRef.current) return;
|
|
202678
|
+
gridRef.current.classList.add("loading");
|
|
202679
|
+
|
|
202680
|
+
const form2Element = ninegrid.querySelector(".form2", tabRef.current);
|
|
202681
|
+
const params = form2Element ? form2Element.getData() : {};
|
|
202682
|
+
selectList(params);
|
|
202683
|
+
};
|
|
202684
|
+
|
|
202685
|
+
useEffect(() => {
|
|
202686
|
+
selectList({});
|
|
202687
|
+
|
|
202688
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202689
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
202690
|
+
|
|
202691
|
+
const handleKeyDown = (e) => {
|
|
202692
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
202693
|
+
handleNaturalLanguageSearch();
|
|
202694
|
+
}
|
|
202695
|
+
};
|
|
202696
|
+
|
|
202697
|
+
const handleClick = () => {
|
|
202698
|
+
handleClassicSearch();
|
|
202699
|
+
};
|
|
202700
|
+
|
|
202701
|
+
if (searchTextElement) {
|
|
202702
|
+
searchTextElement.addEventListener("keydown", handleKeyDown);
|
|
202703
|
+
}
|
|
202704
|
+
if (searchButton) {
|
|
202705
|
+
searchButton.addEventListener("click", handleClick);
|
|
202706
|
+
}
|
|
202707
|
+
|
|
202708
|
+
return () => {
|
|
202709
|
+
if (searchTextElement) {
|
|
202710
|
+
searchTextElement.removeEventListener("keydown", handleKeyDown);
|
|
202711
|
+
}
|
|
202712
|
+
if (searchButton) {
|
|
202713
|
+
searchButton.removeEventListener("click", handleClick);
|
|
202714
|
+
}
|
|
202715
|
+
};
|
|
202716
|
+
}, []);
|
|
202717
|
+
|
|
202718
|
+
return (
|
|
202719
|
+
<div className="wrapper">
|
|
202720
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
202721
|
+
<div className="list-wrapper">
|
|
202722
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
202723
|
+
<nx-tab-page caption="자연어 검색">
|
|
202724
|
+
<nx-form className="form1">
|
|
202725
|
+
<input
|
|
202726
|
+
type="text"
|
|
202727
|
+
id="searchText"
|
|
202728
|
+
name="searchText"
|
|
202729
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"
|
|
202730
|
+
/>
|
|
202731
|
+
</nx-form>
|
|
202732
|
+
</nx-tab-page>
|
|
202733
|
+
<nx-tab-page caption="클래식 검색">
|
|
202734
|
+
<nx-form className="form2">
|
|
202735
|
+
<label>문서명: <input type="text" name="docNm" /></label>
|
|
202736
|
+
<label>매출액:
|
|
202737
|
+
<input type="number" name="minAmt" placeholder="최소" /> ~
|
|
202738
|
+
<input type="number" name="maxAmt" placeholder="최대" />
|
|
202739
|
+
</label>
|
|
202740
|
+
</nx-form>
|
|
202741
|
+
<button className="search">검색</button>
|
|
202742
|
+
</nx-tab-page>
|
|
202743
|
+
</nx-tab>
|
|
202744
|
+
|
|
202745
|
+
<div className="grid-wrapper">
|
|
202746
|
+
<nine-grid
|
|
202747
|
+
ref={gridRef}
|
|
202748
|
+
caption="문서관리"
|
|
202749
|
+
select-type="row"
|
|
202750
|
+
show-title-bar="true"
|
|
202751
|
+
show-menu-icon="true"
|
|
202752
|
+
show-status-bar="true"
|
|
202753
|
+
enable-fixed-col="true"
|
|
202754
|
+
row-resizable="false"
|
|
202755
|
+
col-movable="true"
|
|
202756
|
+
>
|
|
202757
|
+
<table>
|
|
202758
|
+
<colgroup>
|
|
202759
|
+
<col width="50" fixed="left" background-color="gray" />
|
|
202760
|
+
<col width="100" />
|
|
202761
|
+
<col width="100" />
|
|
202762
|
+
<col width="200" />
|
|
202763
|
+
<col width="120" />
|
|
202764
|
+
<col width="100" />
|
|
202765
|
+
<col width="150" />
|
|
202766
|
+
<col width="150" />
|
|
202767
|
+
</colgroup>
|
|
202768
|
+
<thead>
|
|
202769
|
+
<tr>
|
|
202770
|
+
<th>No.</th>
|
|
202771
|
+
<th>최종수정자</th>
|
|
202772
|
+
<th>문서ID</th>
|
|
202773
|
+
<th>문서명</th>
|
|
202774
|
+
<th>매출액</th>
|
|
202775
|
+
<th>최초등록자</th>
|
|
202776
|
+
<th>최초등록일</th>
|
|
202777
|
+
<th>최종수정일</th>
|
|
202778
|
+
</tr>
|
|
202779
|
+
</thead>
|
|
202780
|
+
<tbody>
|
|
202781
|
+
<tr>
|
|
202782
|
+
<th><ng-row-indicator /></th>
|
|
202783
|
+
<td data-bind="updateUser" text-align="center"></td>
|
|
202784
|
+
<td data-bind="docId" text-align="center"></td>
|
|
202785
|
+
<td data-bind="docNm" text-align="left"></td>
|
|
202786
|
+
<td
|
|
202787
|
+
data-bind="amt"
|
|
202788
|
+
data-expr="data.amt.toLocaleString()"
|
|
202789
|
+
text-align="right"
|
|
202790
|
+
show-icon="true"
|
|
202791
|
+
icon-type="sphere"
|
|
202792
|
+
icon-color="data.amt >= 2000 ? 'red' : 'gray'"
|
|
202793
|
+
></td>
|
|
202794
|
+
<td data-bind="insertUser" text-align="center"></td>
|
|
202795
|
+
<td data-bind="insertDt" text-align="center"></td>
|
|
202796
|
+
<td data-bind="updateDt" text-align="center"></td>
|
|
202797
|
+
</tr>
|
|
202798
|
+
</tbody>
|
|
202799
|
+
</table>
|
|
202800
|
+
</nine-grid>
|
|
202801
|
+
</div>
|
|
202802
|
+
</div>
|
|
202803
|
+
</div>
|
|
202804
|
+
);
|
|
202805
|
+
};
|
|
202806
|
+
|
|
202807
|
+
export default DocManager;
|
|
202808
|
+
`;
|
|
202809
|
+
|
|
202810
|
+
let src2 = `
|
|
202811
|
+
import React, { useRef, useEffect } from "react";
|
|
202812
|
+
import { api, ai } from "ide-assi";
|
|
202813
|
+
import ninegrid from "ninegrid2";
|
|
202814
|
+
|
|
202815
|
+
const DocManager = () => {
|
|
202816
|
+
const tabRef = useRef(null);
|
|
202817
|
+
const gridRef = useRef(null);
|
|
202818
|
+
|
|
202819
|
+
const selectList = async (params) => {
|
|
202820
|
+
if (!gridRef.current) return;
|
|
202821
|
+
gridRef.current.classList.add("loading");
|
|
202822
|
+
api.post(\`/api/tmpl-a/doc-manager/selectList\`, params).then((res) => {
|
|
202823
|
+
gridRef.current.data.source = res.list;
|
|
202824
|
+
});
|
|
202825
|
+
};
|
|
202826
|
+
|
|
202827
|
+
const handleNaturalLanguageSearch = async () => {
|
|
202828
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202829
|
+
const searchText = searchTextElement ? searchTextElement.value : "";
|
|
202830
|
+
|
|
202831
|
+
if (!gridRef.current) return;
|
|
202832
|
+
gridRef.current.classList.add("loading");
|
|
202833
|
+
|
|
202834
|
+
let params = {};
|
|
202835
|
+
if (searchText) {
|
|
202836
|
+
params = {
|
|
202837
|
+
_whereClause: await ai.generateWhereCause(
|
|
202838
|
+
"tmpla/DocManagerMapper.xml",
|
|
202839
|
+
"selectList",
|
|
202840
|
+
searchText,
|
|
202841
|
+
import.meta.env.VITE_GEMINI_API_KEY
|
|
202842
|
+
),
|
|
202843
|
+
};
|
|
202844
|
+
}
|
|
202845
|
+
selectList(params);
|
|
202846
|
+
};
|
|
202847
|
+
|
|
202848
|
+
const handleClassicSearch = () => {
|
|
202849
|
+
if (!gridRef.current) return;
|
|
202850
|
+
gridRef.current.classList.add("loading");
|
|
202851
|
+
|
|
202852
|
+
const form2Element = ninegrid.querySelector(".form2", tabRef.current);
|
|
202853
|
+
const params = form2Element ? form2Element.getData() : {};
|
|
202854
|
+
selectList(params);
|
|
202855
|
+
};
|
|
202856
|
+
|
|
202857
|
+
useEffect(() => {
|
|
202858
|
+
selectList({});
|
|
202859
|
+
|
|
202860
|
+
const searchTextElement = ninegrid.querySelector("#searchText", tabRef.current);
|
|
202861
|
+
const searchButton = ninegrid.querySelector(".search", tabRef.current);
|
|
202862
|
+
|
|
202863
|
+
const handleKeyDown = (e) => {
|
|
202864
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
202865
|
+
handleNaturalLanguageSearch();
|
|
202866
|
+
}
|
|
202867
|
+
};
|
|
202868
|
+
|
|
202869
|
+
const handleClick = () => {
|
|
202870
|
+
handleClassicSearch();
|
|
202871
|
+
};
|
|
202872
|
+
|
|
202873
|
+
if (searchTextElement) {
|
|
202874
|
+
searchTextElement.addEventListener("keydown", handleKeyDown);
|
|
202875
|
+
}
|
|
202876
|
+
if (searchButton) {
|
|
202877
|
+
searchButton.addEventListener("click", handleClick);
|
|
202878
|
+
}
|
|
202879
|
+
|
|
202880
|
+
return () => {
|
|
202881
|
+
if (searchTextElement) {
|
|
202882
|
+
searchTextElement.removeEventListener("keydown", handleKeyDown);
|
|
202883
|
+
}
|
|
202884
|
+
if (searchButton) {
|
|
202885
|
+
searchButton.removeEventListener("click", handleClick);
|
|
202886
|
+
}
|
|
202887
|
+
};
|
|
202888
|
+
}, []);
|
|
202889
|
+
|
|
202890
|
+
return (
|
|
202891
|
+
<div className="wrapper">
|
|
202892
|
+
<nx-collapse target="nx-tab" className="search-collapse"></nx-collapse>
|
|
202893
|
+
<div className="list-wrapper">
|
|
202894
|
+
<nx-tab theme="theme-3" ref={tabRef}>
|
|
202895
|
+
<nx-tab-page caption="자연어 검색">
|
|
202896
|
+
<nx-form className="form1">
|
|
202897
|
+
<input
|
|
202898
|
+
type="text"
|
|
202899
|
+
id="searchText"
|
|
202900
|
+
name="searchText"
|
|
202901
|
+
placeholder="자연어 검색어를 입력하세요 (ex: 작성자가 홍길동인 데이타를 찾아줘)"
|
|
202902
|
+
/>
|
|
202903
|
+
</nx-form>
|
|
202904
|
+
</nx-tab-page>
|
|
202905
|
+
<nx-tab-page caption="클래식 검색">
|
|
202906
|
+
<nx-form className="form2">
|
|
202907
|
+
<label>문서명: <input type="text" name="docNm" /></label>
|
|
202908
|
+
<label>매출액:
|
|
202909
|
+
<input type="number" name="minAmt" placeholder="최소" /> ~
|
|
202910
|
+
<input type="number" name="maxAmt" placeholder="최대" />
|
|
202911
|
+
</label>
|
|
202912
|
+
</nx-form>
|
|
202913
|
+
<button className="search">검색</button>
|
|
202914
|
+
</nx-tab-page>
|
|
202915
|
+
</nx-tab>
|
|
202916
|
+
|
|
202917
|
+
<div className="grid-wrapper">
|
|
202918
|
+
<nine-grid
|
|
202919
|
+
ref={gridRef}
|
|
202920
|
+
caption="매출 문서 관리"
|
|
202921
|
+
select-type="row"
|
|
202922
|
+
show-title-bar="true"
|
|
202923
|
+
show-menu-icon="true"
|
|
202924
|
+
show-status-bar="true"
|
|
202925
|
+
enable-fixed-col="true"
|
|
202926
|
+
row-resizable="false"
|
|
202927
|
+
col-movable="true"
|
|
202928
|
+
>
|
|
202929
|
+
<table>
|
|
202930
|
+
<colgroup>
|
|
202931
|
+
<col width="50" fixed="left" background-color="gray" />
|
|
202932
|
+
<col width="100" />
|
|
202933
|
+
<col width="120" />
|
|
202934
|
+
<col width="100" />
|
|
202935
|
+
<col width="200" />
|
|
202936
|
+
<col width="100" />
|
|
202937
|
+
<col width="150" />
|
|
202938
|
+
<col width="150" />
|
|
202939
|
+
</colgroup>
|
|
202940
|
+
<thead>
|
|
202941
|
+
<tr>
|
|
202942
|
+
<th>No.</th>
|
|
202943
|
+
<th>문서ID</th>
|
|
202944
|
+
<th>매출액</th>
|
|
202945
|
+
<th>최종수정자</th>
|
|
202946
|
+
<th>문서명</th>
|
|
202947
|
+
<th>최초등록자</th>
|
|
202948
|
+
<th>최초등록일</th>
|
|
202949
|
+
<th>최종수정일</th>
|
|
202950
|
+
</tr>
|
|
202951
|
+
</thead>
|
|
202952
|
+
<tbody>
|
|
202953
|
+
<tr>
|
|
202954
|
+
<th><ng-row-indicator /></th>
|
|
202955
|
+
<td data-bind="docId" text-align="center"></td>
|
|
202956
|
+
<td
|
|
202957
|
+
data-bind="amt"
|
|
202958
|
+
data-expr="data.amt.toLocaleString()"
|
|
202959
|
+
text-align="right"
|
|
202960
|
+
show-icon="true"
|
|
202961
|
+
icon-type="sphere"
|
|
202962
|
+
icon-color="data.amt >= 2000 ? 'red' : 'gray'"
|
|
202963
|
+
></td>
|
|
202964
|
+
<td data-bind="updateUser" text-align="center"></td>
|
|
202965
|
+
<td data-bind="docNm" text-align="left"></td>
|
|
202966
|
+
<td data-bind="insertUser" text-align="center"></td>
|
|
202967
|
+
<td data-bind="insertDt" text-align="center"></td>
|
|
202968
|
+
<td data-bind="updateDt" text-align="center"></td>
|
|
202969
|
+
</tr>
|
|
202970
|
+
</tbody>
|
|
202971
|
+
</table>
|
|
202972
|
+
</nine-grid>
|
|
202973
|
+
</div>
|
|
202974
|
+
</div>
|
|
202975
|
+
</div>
|
|
202976
|
+
);
|
|
202977
|
+
};
|
|
202978
|
+
|
|
202979
|
+
export default DocManager;
|
|
202980
|
+
`;
|
|
202636
202981
|
/**
|
|
202637
202982
|
src1 = `
|
|
202638
202983
|
<tr>
|
|
@@ -202658,7 +203003,7 @@ class IdeAssi extends HTMLElement
|
|
|
202658
203003
|
<th>최종수정일</th>
|
|
202659
203004
|
</tr>
|
|
202660
203005
|
`; */
|
|
202661
|
-
|
|
203006
|
+
|
|
202662
203007
|
this.shadowRoot.querySelector("ide-diff-popup").popup([{
|
|
202663
203008
|
javascript: {
|
|
202664
203009
|
asis: src1,
|
|
@@ -202667,59 +203012,6 @@ class IdeAssi extends HTMLElement
|
|
|
202667
203012
|
}]);
|
|
202668
203013
|
|
|
202669
203014
|
return;
|
|
202670
|
-
*/
|
|
202671
|
-
|
|
202672
|
-
|
|
202673
|
-
|
|
202674
|
-
|
|
202675
|
-
const apply = {
|
|
202676
|
-
mybatis: this.shadowRoot.querySelector("#mybatis").checked,
|
|
202677
|
-
service: this.shadowRoot.querySelector("#service").checked,
|
|
202678
|
-
controller: this.shadowRoot.querySelector("#controller").checked,
|
|
202679
|
-
javascript: this.shadowRoot.querySelector("#javascript").checked,
|
|
202680
|
-
};
|
|
202681
|
-
|
|
202682
|
-
if (!apply.mybatis && !apply.service && !apply.controller && !apply.javascript) return;
|
|
202683
|
-
|
|
202684
|
-
const userPrompt = e.target.value.trim();
|
|
202685
|
-
if (!userPrompt) return;
|
|
202686
|
-
|
|
202687
|
-
if (this.#ing) return;
|
|
202688
|
-
this.#ing = true;
|
|
202689
|
-
|
|
202690
|
-
/**
|
|
202691
|
-
* 옵션저장
|
|
202692
|
-
*/
|
|
202693
|
-
this.#saveLocalSettings(apply);
|
|
202694
|
-
|
|
202695
|
-
|
|
202696
|
-
|
|
202697
|
-
/**
|
|
202698
|
-
* setTimeout 없으면, 맥에서 한글 잔상이 남음
|
|
202699
|
-
* setTimeout 내에서 e.target이 nx-ai-container가 된다.
|
|
202700
|
-
*/
|
|
202701
|
-
setTimeout(() => {
|
|
202702
|
-
this.shadowRoot.querySelector("textarea").value = "";
|
|
202703
|
-
});
|
|
202704
|
-
|
|
202705
|
-
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
202706
|
-
|
|
202707
|
-
|
|
202708
|
-
elAiChat.add("me", userPrompt);
|
|
202709
|
-
elAiChat.add("ing", "...");
|
|
202710
|
-
|
|
202711
|
-
|
|
202712
|
-
try {
|
|
202713
|
-
const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
|
|
202714
|
-
if (changedSource) {
|
|
202715
|
-
this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
|
|
202716
|
-
}
|
|
202717
|
-
} catch (error) {
|
|
202718
|
-
console.error(error);
|
|
202719
|
-
elAiChat.add("ai", String(error).replace("Error:", ""));
|
|
202720
|
-
}
|
|
202721
|
-
|
|
202722
|
-
this.#ing = false;
|
|
202723
203015
|
}
|
|
202724
203016
|
|
|
202725
203017
|
#toggleCollapseHandler = () => {
|
|
@@ -491,7 +491,7 @@ export default DocManager;
|
|
|
491
491
|
<th>최종수정일</th>
|
|
492
492
|
</tr>
|
|
493
493
|
`; */
|
|
494
|
-
|
|
494
|
+
|
|
495
495
|
this.shadowRoot.querySelector("ide-diff-popup").popup([{
|
|
496
496
|
javascript: {
|
|
497
497
|
asis: src1,
|
|
@@ -500,7 +500,7 @@ export default DocManager;
|
|
|
500
500
|
}]);
|
|
501
501
|
|
|
502
502
|
return;
|
|
503
|
-
|
|
503
|
+
|
|
504
504
|
|
|
505
505
|
|
|
506
506
|
|
package/package.json
CHANGED
|
@@ -491,7 +491,7 @@ export default DocManager;
|
|
|
491
491
|
<th>최종수정일</th>
|
|
492
492
|
</tr>
|
|
493
493
|
`; */
|
|
494
|
-
|
|
494
|
+
|
|
495
495
|
this.shadowRoot.querySelector("ide-diff-popup").popup([{
|
|
496
496
|
javascript: {
|
|
497
497
|
asis: src1,
|
|
@@ -500,7 +500,7 @@ export default DocManager;
|
|
|
500
500
|
}]);
|
|
501
501
|
|
|
502
502
|
return;
|
|
503
|
-
|
|
503
|
+
|
|
504
504
|
|
|
505
505
|
|
|
506
506
|
|