diff --git a/app/apis/elpApi.js b/app/apis/elpApi.js index 4fb03f8..c5dcd85 100755 --- a/app/apis/elpApi.js +++ b/app/apis/elpApi.js @@ -23,5 +23,8 @@ export default { }, data_entry:{ getSchema:"elp/schema/get" + }, + conflict:{ + get:"elp/conflict/{{type_name}}/get/text/{{doc_id}}" } }; diff --git a/app/components/auto-import/TiptapEditor.vue b/app/components/auto-import/TiptapEditor.vue index d632d05..9f8c873 100755 --- a/app/components/auto-import/TiptapEditor.vue +++ b/app/components/auto-import/TiptapEditor.vue @@ -129,7 +129,7 @@ diff --git a/app/composables/useElpService.js b/app/composables/useElpService.js index 7e9240a..2fe5265 100755 --- a/app/composables/useElpService.js +++ b/app/composables/useElpService.js @@ -69,10 +69,37 @@ export function useElpService(props, emit) { }); } + ///----------------------------------------------------- + ///--- با توجه به یک فیلد، مقدار محاسبه شده ای بر میگردند مثلا : بیشترین مقدار یا مجموع یا ... + ///----------------------------------------------------- + async function uepGetConflictDoc( + doc_id, + key = "qaconflict" + ) { + let url = elpApi.conflict.get; + url = url.replace("{{type_name}}", key); + url = url.replace("{{doc_id}}", doc_id); + + return await httpService + .getRequest(url) + .then((res) => { + return res; + }) + .catch(() => { + toast.add({ + title: "خطا", + description: "خطا در انجام عملیات، دوباره تلاش کنید", + color: "red", + }); + return undefined; + }); + } + ///----------------------------------------------------- ///----------------------------------------------------- return { uepUpdateField, uepGetComputeField, + uepGetConflictDoc, }; } diff --git a/app/manuals/utilities.js b/app/manuals/utilities.js index 367df63..4c8b016 100755 --- a/app/manuals/utilities.js +++ b/app/manuals/utilities.js @@ -6,16 +6,16 @@ export const isLoginRemoved = () => process.env.VUE_APP_LOGIN_REMOVE == 1; // util to export to excel file using plugin // https://github.com/zheeeng/export-from-json -export const convertJsonToExcelUsingPlugin = async ( - data, - fileName = "download" -) => { - // 'txt'(default), 'css', 'html', 'json', 'csv', 'xls', 'xml' - const exportType = exportFromJSON.types.xls; - const withBOM = true; +// export const convertJsonToExcelUsingPlugin = async ( +// data, +// fileName = "download" +// ) => { +// // 'txt'(default), 'css', 'html', 'json', 'csv', 'xls', 'xml' +// const exportType = exportFromJSON.types.xls; +// const withBOM = true; - return await exportFromJSON({ data, fileName, exportType, withBOM }); -}; +// return await exportFromJSON({ data, fileName, exportType, withBOM }); +// }; // util to export to excel file manually export const exportJsonToExcelManually = (JSONData, FileTitle, ShowLabel) => { diff --git a/app/pages/index.vue b/app/pages/index.vue index a7455e4..98ea7c6 100755 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -14,7 +14,7 @@ v-if="currentComponent" :activeTabKey="activeTabKey" :listConflicts="listConflicts" - :conflictSelected="conflictSelected" + :conflict_id="conflictSelected?._id" @conflict-details="conflictDetails" /> @@ -136,7 +136,7 @@ const getListConflict = async (textSearch = "", filterExtended = "") => { } }; function conflictDetails(event) { - conflictSelected.value = event; + conflictSelected.value = event.item; activeTabKey.value = "RelationEdit"; console.log("event", event); }