diff --git a/src/components/dashboard/inquiryPrivacyFencing/index.jsx b/src/components/dashboard/inquiryPrivacyFencing/index.jsx index afc2a32..f7189f8 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/index.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/index.jsx @@ -11,7 +11,7 @@ const InquiryPrivacyFencingPage = () => { () => [ { accessorKey: "dabirkhaneh_number", - header: "dabirkhaneh_number", + header: "شماره دبیرخانه درخواست", id: "dabirkhaneh_number", enableColumnFilter: false, datatype: "text", @@ -20,7 +20,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "marjae_pasokh", - header: "marjae_pasokh", + header: "مرجع درخواست کننده پاسخ به استعلام", id: "marjae_pasokh", enableColumnFilter: false, datatype: "text", @@ -29,7 +29,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "motaghazi_is_legal", - header: "motaghazi_is_legal", + header: "متقاضی", id: "motaghazi_is_legal", enableColumnFilter: false, datatype: "text", @@ -38,7 +38,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "nameh_date", - header: "nameh_date", + header: "تاریخ نامه درخواست", id: "nameh_date", enableColumnFilter: false, datatype: "date", @@ -46,7 +46,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "motaghazi_type", - header: "motaghazi_type", + header: "نوع متقاضی", id: "motaghazi_type", enableColumnFilter: false, datatype: "text", @@ -55,7 +55,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "motaghazi_firstname", - header: "motaghazi_firstname", + header: "نام متقاضی", id: "motaghazi_firstname", enableColumnFilter: false, datatype: "text", @@ -64,7 +64,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "motaghazi_lastname", - header: "motaghazi_lastname", + header: "نام خانوادگی متقاضی", id: "motaghazi_lastname", enableColumnFilter: false, datatype: "text", @@ -73,25 +73,16 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "national_id", - header: "national_id", + header: "کد ملی/شناسه ملی", id: "national_id", enableColumnFilter: false, datatype: "text", filterFn: "contains", columnFilterModeOptions: ["equals", "notEquals", "contains"], }, - { - accessorKey: "shenase_melli", - header: "shenase_melli", - id: "shenase_melli", - enableColumnFilter: false, - datatype: "text", - filterFn: "contains", - columnFilterModeOptions: ["equals", "notEquals", "contains"], - }, { accessorKey: "tel_number", - header: "tel_number", + header: "تلفن", id: "tel_number", enableColumnFilter: false, datatype: "text", @@ -100,7 +91,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "mobile_number", - header: "mobile_number", + header: "تلفن همراه", id: "mobile_number", enableColumnFilter: false, datatype: "text", @@ -109,7 +100,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "address", - header: "address", + header: "آدرس", id: "address", enableColumnFilter: false, datatype: "text", @@ -118,7 +109,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "edare_kol", - header: "edare_kol", + header: "اداره كل راهداری", id: "edare_kol", enableColumnFilter: false, datatype: "text", @@ -127,7 +118,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "edare_shahri", - header: "edare_shahri", + header: "اداره شهرستان", id: "edare_shahri", enableColumnFilter: false, datatype: "text", @@ -136,7 +127,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "rah_type", - header: "rah_type", + header: "نوع راه", id: "rah_type", enableColumnFilter: false, datatype: "text", @@ -145,7 +136,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "name_mehvar_fa", - header: "name_mehvar_fa", + header: "نام محور", id: "name_mehvar_fa", enableColumnFilter: false, datatype: "text", @@ -154,7 +145,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "mizan_harim", - header: "mizan_harim", + header: "میزان حریم", id: "mizan_harim", enableColumnFilter: false, datatype: "text", @@ -163,7 +154,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "arze_navar", - header: "arze_navar", + header: "عرض نوار تاسیساتی زیربنایی", id: "arze_navar", enableColumnFilter: false, datatype: "text", @@ -172,7 +163,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "samt", - header: "samt", + header: "سمت", id: "samt", enableColumnFilter: false, datatype: "text", @@ -181,7 +172,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "kilometr", - header: "kilometr", + header: "كيلومتر", id: "kilometr", enableColumnFilter: false, datatype: "text", @@ -199,7 +190,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "karbari_type", - header: "karbari_type", + header: "نوع کاربری", id: "karbari_type", enableColumnFilter: false, datatype: "text", @@ -208,7 +199,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "tarh_title", - header: "tarh_title", + header: "عنوان طرح", id: "tarh_title", enableColumnFilter: false, datatype: "text", @@ -217,7 +208,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "masahat_zirbana", - header: "masahat_zirbana", + header: "مساحت زیربنا", id: "masahat_zirbana", enableColumnFilter: false, datatype: "text", @@ -226,7 +217,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "ehdasat_type", - header: "ehdasat_type", + header: "نوع احداثات", id: "ehdasat_type", enableColumnFilter: false, datatype: "text", @@ -235,7 +226,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "divarkeshi_distance", - header: "divarkeshi_distance", + header: "فاصله دیوارکشی از آکس محور", id: "divarkeshi_distance", enableColumnFilter: false, datatype: "text", @@ -244,7 +235,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "mahale_ejra", - header: "mahale_ejra", + header: "محل اجرا", id: "mahale_ejra", enableColumnFilter: false, datatype: "text", @@ -253,7 +244,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "traffic", - header: "traffic", + header: "میزان ترافیک", id: "traffic", enableColumnFilter: false, datatype: "text", @@ -262,7 +253,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "vaziat_eghtesadi", - header: "vaziat_eghtesadi", + header: "وضعیت اقتصادی", id: "vaziat_eghtesadi", enableColumnFilter: false, datatype: "text", @@ -271,7 +262,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "has_access", - header: "has_access", + header: "آیا راه دسترسی از قبل وجود دارد؟", id: "has_access", enableColumnFilter: false, datatype: "text", @@ -280,7 +271,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "shomare_estelam_harim", - header: "shomare_estelam_harim", + header: "شماره استعلام دفتر ایمنی و حریم", id: "shomare_estelam_harim", enableColumnFilter: false, datatype: "text", @@ -289,7 +280,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "max_month", - header: "max_month", + header: "ماه", id: "max_month", enableColumnFilter: false, datatype: "text", @@ -298,7 +289,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "max_day", - header: "max_day", + header: "روز", id: "max_day", enableColumnFilter: false, datatype: "text", @@ -307,7 +298,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "shomare_tahaodname", - header: "shomare_tahaodname", + header: "شماره تعهدنامه", id: "shomare_tahaodname", enableColumnFilter: false, datatype: "text", @@ -316,7 +307,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "shomare_daftarkhaneh", - header: "shomare_daftarkhaneh", + header: "شماره دفترخانه", id: "shomare_daftarkhaneh", enableColumnFilter: false, datatype: "text", @@ -325,7 +316,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "description", - header: "description", + header: "توضیحات", id: "description", enableColumnFilter: false, datatype: "text", @@ -334,7 +325,7 @@ const InquiryPrivacyFencingPage = () => { }, { accessorKey: "ronevesht", - header: "ronevesht", + header: "رونوشت", id: "ronevesht", enableColumnFilter: false, datatype: "text", @@ -348,7 +339,7 @@ const InquiryPrivacyFencingPage = () => { return ( { return ( { - refactorAction(userId, pageName, tableName); + mutate(); }; return ( diff --git a/src/core/components/DataTable/table/Paper.js b/src/core/components/DataTable/table/Paper.js index 88902a8..289cabd 100644 --- a/src/core/components/DataTable/table/Paper.js +++ b/src/core/components/DataTable/table/Paper.js @@ -4,7 +4,17 @@ import DataTable_BottomToolbar from "../toolbar/BottomToolbar"; import DataTable_TopToolbar from "../toolbar/TopToolbar"; import DataTable_TableContainer from "./TableContainer"; -const DataTable_Paper = ({ table, ...rest }) => { +const DataTable_Paper = ({ + table, + table_name, + columns, + user_id, + page_name, + mutate, + need_filter, + table_url, + ...rest +}) => { const { getState, options: { @@ -66,13 +76,14 @@ const DataTable_Paper = ({ table, ...rest }) => { {enableTopToolbar && (parseFromValuesOrFunc(renderTopToolbar, { table }) ?? ( ))} diff --git a/src/core/components/DataTable/toolbar/TopToolbar.js b/src/core/components/DataTable/toolbar/TopToolbar.js index bd008a0..81bc84a 100644 --- a/src/core/components/DataTable/toolbar/TopToolbar.js +++ b/src/core/components/DataTable/toolbar/TopToolbar.js @@ -6,7 +6,7 @@ import DataTable_ToolbarInternalButtons from "./ToolbarInternalButtons"; import FilterColumn from "@/core/components/DataTable/filter"; import RefactorTable from "@/core/components/DataTable/refactor/RefactorTable"; -const DataTable_TopToolbar = ({ need_filter, table, columns, table_url, user_id, page_name, table_name }) => { +const DataTable_TopToolbar = ({ mutate, need_filter, table, columns, table_url, user_id, page_name, table_name }) => { const { getState, options: { @@ -69,8 +69,8 @@ const DataTable_TopToolbar = ({ need_filter, table, columns, table_url, user_id, justifyContent: "flex-end", }} > - - {need_filter === "true" && ( + + {need_filter && ( { localStorage.setItem("_setting-app", JSON.stringify(updatedLocalStorage)); setSettingStore(updatedLocalStorage); }; - const refactorAction = (user_id, page_name, table_name) => { - const prevLocalStorage = JSON.parse(localStorage.getItem("_setting-app")) || {}; - const userSettings = prevLocalStorage[user_id] || {}; - const pageSettings = userSettings[page_name] || {}; - const refactorData = { - ...prevLocalStorage, - [user_id]: { - ...userSettings, - [page_name]: { - ...pageSettings, - [table_name]: {}, - }, - }, - }; - localStorage.setItem("_setting-app", JSON.stringify(refactorData)); - setSettingStore(refactorData); - }; + const SummaryTextMessage = (values, columns) => { let SummaryText = ""; let HideText = ""; @@ -133,7 +117,7 @@ export const TableSettingProvider = ({ children }) => { }; return ( - + {children} ); diff --git a/src/lib/hooks/useTableSetting.js b/src/lib/hooks/useTableSetting.js index 6588446..e9e6cef 100644 --- a/src/lib/hooks/useTableSetting.js +++ b/src/lib/hooks/useTableSetting.js @@ -2,8 +2,8 @@ import { useContext } from "react"; import { TableSettingContext } from "../contexts/tableSetting"; const useTableSetting = () => { - const { settingStore, hideAction, sortAction, filterAction, refactorAction } = useContext(TableSettingContext); - return { settingStore, hideAction, sortAction, filterAction, refactorAction }; + const { settingStore, hideAction, sortAction, filterAction } = useContext(TableSettingContext); + return { settingStore, hideAction, sortAction, filterAction }; }; export default useTableSetting;