Merge branch 'shadi/develop' of http://192.168.23.150:3000/front/base_ui into main

This commit is contained in:
mustafa-rezae 2025-05-08 16:43:13 +03:30
commit 0a643930b1
10 changed files with 514 additions and 25 deletions

1
.env
View File

@ -55,7 +55,6 @@ VITE_ENTITY_SYSTEM=entity-view-system
VITE_BORHAN_SYSTEM=borhan-system VITE_BORHAN_SYSTEM=borhan-system
VITE_THIQAT_SYSTEM=thiqat-system VITE_THIQAT_SYSTEM=thiqat-system
VITE_CHAT_SYSTEM=chat-system VITE_CHAT_SYSTEM=chat-system
VITE_TASK_SYSTEM=task-system
VITE_REPORT_SYSTEM=report-system VITE_REPORT_SYSTEM=report-system
VITE_ADMIN_SYSTEM=admin-panel VITE_ADMIN_SYSTEM=admin-panel
VITE_TAHRIR_SYSTEM=tahrir-system VITE_TAHRIR_SYSTEM=tahrir-system

View File

@ -21,6 +21,7 @@ VITE_TAHRIR_PAGE_TITLE = قانون - سامانه ای برای سندنگار
VITE_REPORT_PAGE_TITLE = قانون - سامانه گزارش گیری داده VITE_REPORT_PAGE_TITLE = قانون - سامانه گزارش گیری داده
VITE_PERMISSION_PAGE_TITLE = قانون - سامانه کنترل وظایف VITE_PERMISSION_PAGE_TITLE = قانون - سامانه کنترل وظایف
VITE_CHAT_PAGE_TITLE = قانون - سامانه گفتگو VITE_CHAT_PAGE_TITLE = قانون - سامانه گفتگو
VITE_TASK_PAGE_TITLE = قانون - سامانه وظایف
VITE_RESEARCH_PAGE_TITLE = قانون - تحقیقات من VITE_RESEARCH_PAGE_TITLE = قانون - تحقیقات من
VITE_AI_TOOLS_PAGE_TITLE = قانون - حاشیه نویسی VITE_AI_TOOLS_PAGE_TITLE = قانون - حاشیه نویسی

View File

@ -6,13 +6,14 @@ git clone --single-branch --branch rezae/feat/add-task-module --recurse-submodul
Cloning a Repository with Submodules Cloning a Repository with Submodules
If you clone a repository that contains submodules, you'll need to initialize and update the submodules: If you clone a repository that contains submodules, you'll need to initialize and update the submodules:
git clone <repository-url> git clone repository-url
cd <repository-directory> cd repository-directory
git submodule init git submodule init
git submodule update git submodule update
Or, you can do it in one step: Or, you can do it in one step:
git clone --recurse-submodules <repository-url> git clone --recurse-submodules https://git2.tavasi.ir/front/base_ui.git
Updating Submodules Updating Submodules
To update a submodule to the latest commit on its branch: To update a submodule to the latest commit on its branch:

View File

@ -15,6 +15,7 @@
</template> </template>
<script> <script>
export default { export default {
props: ["counter"], props: ["counter"],
data() { data() {
@ -55,27 +56,27 @@ export default {
}, refreshInterval); }, refreshInterval);
}, },
// goToRouteName() { goToRouteName() {
// this.$router.push({ this.$router.push({
// name: "searchResult", name: "search",
// query: { query: {
// q: undefined, q: undefined,
// key: this.counter.routeName, key: this.counter.routeName,
// }, },
// }); });
// }, },
urlResolver() { urlResolver() {
console.log("555");
// const routeData = this.$router.resolve({
// name: "searchResult", const routeData = this.$router.resolve({
// query: { name: "search",
// q: undefined, query: {
// key: this.counter.routeName, q: undefined,
// }, key: this.counter.routeName,
// }); },
// return routeData.href; });
return routeData.href;
}, },
}, },
}; };

View File

@ -6,6 +6,7 @@ import chat from "./routes/chat";
import haditha from "./routes/haditha"; import haditha from "./routes/haditha";
import search from "./routes/search"; import search from "./routes/search";
import research from "./routes/research"; import research from "./routes/research";
import task from "./routes/task";
const envs = import.meta.env; const envs = import.meta.env;
let sassEnvVariables = ""; let sassEnvVariables = "";
@ -44,7 +45,7 @@ export default defineNuxtConfig({
"pages:extend"(pages) { "pages:extend"(pages) {
// Add custom routes // Add custom routes
pages.push(...search, ...research, ...haditha, ...chat); pages.push(...search, ...research, ...haditha, ...chat, ...task);
}, },
}, },
@ -175,6 +176,7 @@ export default defineNuxtConfig({
"@research": "~/systems/research_ui", "@research": "~/systems/research_ui",
"@haditha": "~/systems/hadith_ui", "@haditha": "~/systems/hadith_ui",
"@chat": "~/systems/chat_ui", "@chat": "~/systems/chat_ui",
"@task": "~/systems/task_ui",
}, },
vite: { vite: {
assetsInclude: ["**/*.svg"], assetsInclude: ["**/*.svg"],

380
plugins/persianNumber.js Normal file
View File

@ -0,0 +1,380 @@
const oneDigit = [
"صفر",
"یک",
"دو",
"سه",
"چهار",
"پنج",
"شش",
"هفت",
"هشت",
"نه",
];
const twoDigits = {
10: "ده",
11: "یازده",
12: "دوازده",
13: "سیزده",
14: "چهارده",
15: "پانزده",
16: "شانزده",
17: "هفده",
18: "هجده",
19: "نوزده",
20: "بیست",
30: "سی",
40: "چهل",
50: "پنجاه",
60: "شصت",
70: "هفتاد",
80: "هشتاد",
90: "نود",
};
const threeDigits = {
100: "صد",
200: "دویست",
300: "سیصد",
400: "چهارصد",
500: "پانصد",
600: "شش صد",
700: "هفت صد",
800: "هشت صد",
900: "نه صد",
};
const types = ["تلیارد", "میلیارد", "میلیون", "هزار", ""];
const decimalTypes = ["دهم", "صدم", "هزارم", "ده هزارم"];
let numbers = [];
let decimals = [];
//Convert Number To Words
const convert = (number) => {
let negative = "";
let decNumber = "";
let decimal = "";
let percent = "";
if (isPercent(number)) {
number = number.replace("%", "");
percent = " درصد";
}
number = getString(number);
if (number == "") return "";
sliceNumber(number);
if (isNegative(number)) negative = "منفی ";
number = number.replace("-", "");
if (isDecimal(number)) {
let index = number.indexOf(".");
let decNumberStr = "";
decNumber = number.substr(index + 1, number.length);
number = number.substr(0, index);
decNumberStr = parseInt(decNumber).toString();
if (decNumberStr.length === 1 && decNumberStr != "0") {
decimal += oneDigit[decNumberStr] + " ";
decimal += decimalTypes[decNumber.length - 1];
} else {
decimal = calculateDigits(decimals);
decimal += " " + decimalTypes[decNumber.length - 1];
}
}
if (number.length === 1) {
if (!decimal) {
return negative + oneDigit[number] + percent;
}
if (number == "0") {
return negative + decimal + percent;
}
return negative + oneDigit[number] + " ممیز " + decimal + percent;
}
if (!decimal) {
return negative + calculateDigits(numbers) + percent;
}
return negative + calculateDigits(numbers) + " ممیز " + decimal + percent;
};
//split number 3 by 3 with a separator (123456789.3025=>123,456,789.3,025) Do Not Give It Persian Numbers
const sliceNumber = (number, separator = ",") => {
let percent = "";
let neg = "";
let dNum = "";
let n = "";
let d = "";
if (isPercent(number)) {
number = number.replace("%", "");
percent = "%";
}
number = getString(number);
if (number == "") return "";
if (isNegative(number)) neg = "-";
number = number.replace("-", "");
if (isDecimal(number)) {
let index = number.indexOf(".");
dNum = number.substr(index + 1, number.length);
number = number.substr(0, index);
}
n = putSeparator(number, separator);
numbers = n.split(separator);
if (!dNum) return neg + n + percent;
d = putSeparator(dNum, separator);
decimals = d.split(separator);
return neg + n + "." + d + percent;
};
//Puts a separator between the chunks of the given numString.
const putSeparator = (numString, separator = ",") => {
if (typeof numString !== "string") return "";
if (numString.length < 4) return numString;
let result = "";
for (let i = numString.length - 1, counter = 0; i >= 0; i--) {
if (counter == 3) {
result += separator;
counter = 0;
}
result += numString[i];
counter++;
}
result = result.split("").reverse().join("");
return result;
};
//Processing on Digits of A Number
const calculateDigits = (arrNum) => {
let result = "";
for (let i = 0; i < arrNum.length; i++) {
let parsedNum = parseInt(arrNum[i]);
let number = parsedNum;
let sadgan = Math.floor(number / 100) * 100;
number = number % 100;
let dahgan = Math.floor(number / 10) * 10;
let yekan = number % 10;
result += i !== 0 && parsedNum ? " و " : "";
result +=
getPersian(sadgan, dahgan, yekan, i, arrNum) + " " + getType(i, arrNum);
}
return result.trim();
};
//Main Process That Turn a Number Into a String(122=>100+20+2)
const getPersian = (sadgan, dahgan, yekan, index, numbers) => {
let flag = false;
let result = "";
let dahganPlusYekan = dahgan + yekan;
if (threeDigits[sadgan]) {
result +=
yekan > 0 || dahgan > 0
? threeDigits[sadgan] + " و "
: threeDigits[sadgan];
}
if (twoDigits[dahganPlusYekan]) {
result += twoDigits[dahganPlusYekan] + " ";
return result;
}
if (twoDigits[dahgan]) {
result += twoDigits[dahgan] + " و ";
}
if (
numbers.length === 2 &&
index === 0 &&
yekan === 1 &&
dahgan === 0 &&
sadgan === 0
) {
return result;
}
if (
numbers.length > 2 &&
index === numbers.length - 2 &&
yekan === 1 &&
dahgan === 0 &&
sadgan === 0
) {
return result;
}
if (yekan > 0) result += oneDigit[yekan] + " ";
return result;
};
//getting The Type Of Each Number (Billion, Million,...)
const getType = (i, numbers) => {
let parsedNum = parseInt(numbers[i]);
if (isNaN(parsedNum)) return "";
if (!parsedNum) return "";
let length = numbers.length - i;
let index = types.length - length;
return types[index];
};
//Calculate if number:String is Negative Or Not
const isNegative = (number) => {
number = getString(number);
if (!number) return false;
if (number[0] != "-") return false;
number = number.replace("-", "");
return number != "0";
};
//Calculate if number:String has '%' as Percent
const isPercent = (string) => {
if (typeof string !== "string") return false;
let index = string.indexOf("%");
let lIndex = string.lastIndexOf("%");
if (index != lIndex) return false;
return index > 0;
};
//is number:String:Number is a Valid Number? if type is Number turn it to String And Return it
const getString = (number) => {
if (number === undefined) return "";
if (number === null) return "";
if (isNaN(number)) return "";
if (typeof number === "number") return number.toString();
return number.trim();
};
//Calculate if number:String has Decimal Point Or Not
const isDecimal = (number) => {
number = getString(number);
if (number == "") return false;
let index = number.indexOf(".");
let lIndex = number.lastIndexOf(".");
if (index != lIndex) return false;
return index > 0;
};
//Convert English Numbers To Persian Numbers
const convertEnToPe = (number) => {
if (number == null || number == undefined) return "";
if (typeof number == "number") number = number.toString();
let res = "";
for (let i = 0; i < number.length; i++) {
switch (number[i]) {
case "\u0030":
res += "\u06F0";
break;
case "\u0031":
res += "\u06F1";
break;
case "\u0032":
res += "\u06F2";
break;
case "\u0033":
res += "\u06F3";
break;
case "\u0034":
res += "\u06F4";
break;
case "\u0035":
res += "\u06F5";
break;
case "\u0036":
res += "\u06F6";
break;
case "\u0037":
res += "\u06F7";
break;
case "\u0038":
res += "\u06F8";
break;
case "\u0039":
res += "\u06F9";
break;
default:
res += number[i];
}
}
return res;
};
//Convert Persian Numbers To English Numbers
const convertPeToEn = (number) => {
if (number == null || number == undefined) return "";
let res = "";
for (let i = 0; i < number.length; i++) {
switch (number[i]) {
case "\u06F0":
res += "\u0030";
break;
case "\u06F1":
res += "\u0031";
break;
case "\u06F2":
res += "\u0032";
break;
case "\u06F3":
res += "\u0033";
break;
case "\u06F4":
res += "\u0034";
break;
case "\u06F5":
res += "\u0035";
break;
case "\u06F6":
res += "\u0036";
break;
case "\u06F7":
res += "\u0037";
break;
case "\u06F8":
res += "\u0038";
break;
case "\u06F9":
res += "\u0039";
break;
default:
res += number[i];
}
}
return res;
};
const e2p = (s) => s.replace(/\d/g, (d) => "۰۱۲۳۴۵۶۷۸۹"[d]);
const e2a = (s) => s.replace(/\d/g, (d) => "٠١٢٣٤٥٦٧٨٩"[d]);
const p2e = (s) => s.replace(/[۰-۹]/g, (d) => "۰۱۲۳۴۵۶۷۸۹".indexOf(d));
const a2e = (s) => s.replace(/[٠-٩]/g, (d) => "٠١٢٣٤٥٦٧٨٩".indexOf(d));
const p2a = (s) =>
s.replace(/[۰-۹]/g, (d) => "٠١٢٣٤٥٦٧٨٩"["۰۱۲۳۴۵۶۷۸۹".indexOf(d)]);
const a2p = (s) =>
s.replace(/[٠-٩]/g, (d) => "۰۱۲۳۴۵۶۷۸۹"["٠١٢٣٤٥٦٧٨٩".indexOf(d)]);
export {
convert,
sliceNumber,
convertEnToPe,
convertPeToEn,
e2p,
e2a,
p2e,
a2e,
p2a,
a2p,
};

View File

@ -0,0 +1,52 @@
<svg width="64" height="25" viewBox="0 0 64 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M36.0096 17.6483C37.4078 17.6483 38.5034 17.4396 39.2965 17.0223C40.1103 16.6049 40.6947 15.9788 41.0495 15.1441L39.2965 5.09567L40.5799 4.43829L42.3642 14.7371C42.5103 15.5301 42.9068 16.2188 43.5537 16.8031C44.2215 17.3666 45.0876 17.6483 46.1519 17.6483H47.4667C47.6545 17.6483 47.811 17.7318 47.9362 17.8988C48.0823 18.0657 48.1553 18.264 48.1553 18.4935C48.1553 18.7231 48.0823 18.9213 47.9362 19.0883C47.811 19.2552 47.6545 19.3387 47.4667 19.3387H46.4336C45.2441 19.3387 44.2424 19.0883 43.4285 18.5874C42.6146 18.0657 42.0512 17.3666 41.7381 16.4901C41.2999 17.3875 40.6112 18.0866 39.6721 18.5874C38.733 19.0883 37.5539 19.3387 36.1348 19.3387H33.114L32.9575 17.6483H36.0096Z" fill="url(#paint0_linear_344_2248)"/>
<path d="M47.4094 19.3387C47.2216 19.3387 47.0651 19.2552 46.9399 19.0883C46.7938 18.9213 46.7208 18.7231 46.7208 18.4935C46.7208 18.2431 46.7938 18.0448 46.9399 17.8988C47.0651 17.7318 47.2216 17.6483 47.4094 17.6483H59.8682L58.9917 11.1998C58.783 9.80161 58.3134 8.75816 57.583 8.06949C56.8735 7.35994 55.9448 7.00517 54.797 7.00517C54.5466 7.00517 54.1501 7.04691 53.6075 7.13039L49.7572 7.75645L49.9137 6.06607L53.5762 5.47131C54.0144 5.4087 54.4318 5.3774 54.8283 5.3774C56.3309 5.3774 57.5726 5.83651 58.5534 6.75475C59.5552 7.65211 60.1708 8.92512 60.4003 10.5738L61.3707 17.6483H64.0002L63.5307 19.3387H47.4094Z" fill="url(#paint1_linear_344_2248)"/>
<path d="M24.9984 17.6481C26.2506 17.6481 27.2627 17.4185 28.0348 16.9594C28.8279 16.5003 29.3705 15.8429 29.6626 14.9873L27.8783 5.97193L29.287 5.34586L30.8209 12.9526C30.9043 13.37 30.9461 13.8291 30.9461 14.3299C30.9461 15.8534 30.4243 17.0742 29.3809 17.9924C28.3583 18.8898 26.9184 19.3385 25.061 19.3385C21.3002 19.3385 21.1849 17.6481 24.9984 17.6481Z" fill="#1B2132"/>
<path d="M17.3823 17.0222C18.1962 16.6049 18.7805 15.9788 19.1353 15.144L17.5295 7.59986L18.813 6.94249L20.2686 13.2736L20.4501 14.7371C20.5961 15.5301 20.9927 16.2188 21.6396 16.8031C22.3074 17.3666 23.1735 17.6483 24.2378 17.6483H25.5525C25.7403 17.6483 25.8968 17.7318 26.0221 17.8987C26.1681 18.0657 26.2412 18.2639 26.2412 18.4935C26.2412 18.7231 26.1681 18.9213 26.0221 19.0883C25.8968 19.2552 25.7403 19.3387 25.5525 19.3387H24.5195C23.33 19.3387 22.3283 19.0883 21.5144 18.5874C20.7005 18.0657 20.137 17.3666 19.824 16.4901C19.3857 17.3875 18.6971 18.0866 17.758 18.5874L17.3823 17.0222Z" fill="#1B2132"/>
<path d="M25.4953 19.3387C25.3075 19.3387 25.1509 19.2552 25.0257 19.0883C24.8797 18.9213 24.8066 18.7231 24.8066 18.4935C24.8066 18.2431 24.8797 18.0448 25.0257 17.8987C25.1509 17.7318 25.3075 17.6483 25.4953 17.6483V19.3387Z" fill="#1B2132"/>
<path d="M7.2878 19.3381C5.70176 19.3381 4.44962 18.8998 3.53139 18.0233C2.61316 17.1469 2.15404 15.8843 2.15404 14.2356V3.29512L0.606445 3.78424V2.02342L3.50008 1.08821V13.7348C3.50008 16.3434 4.76266 17.6477 7.2878 17.6477H8.00778C8.1956 17.6477 8.35211 17.7312 8.47733 17.8981C8.62341 18.0651 8.69645 18.2633 8.69645 18.4929C8.69645 18.7225 8.62341 18.9207 8.47733 19.0877C8.35211 19.2546 8.1956 19.3381 8.00778 19.3381H7.2878Z" fill="url(#paint2_linear_344_2248)"/>
<path d="M7.96767 19.3381C7.77985 19.3381 7.62333 19.2546 7.49812 19.0877C7.35203 18.9207 7.27899 18.7225 7.27899 18.4929C7.27899 18.2633 7.35203 18.0651 7.49812 17.8981C7.62333 17.7312 7.77985 17.6477 7.96767 17.6477H11.8806C12.0684 17.6477 12.2249 17.7312 12.3501 17.8981C12.4962 18.0651 12.5693 18.2633 12.5693 18.4929C12.5693 18.7225 12.4962 18.9207 12.3501 19.0877C12.2249 19.2546 12.0684 19.3381 11.8806 19.3381H7.96767Z" fill="url(#paint3_linear_344_2248)"/>
<path d="M11.8493 19.3381C11.6615 19.3381 11.505 19.2546 11.3797 19.0877C11.2337 18.9207 11.1606 18.7225 11.1606 18.4929C11.1606 18.2425 11.2337 18.0442 11.3797 17.8981C11.505 17.7312 11.6615 17.6477 11.8493 17.6477H14.3849C15.637 17.6477 16.6491 17.4181 17.4213 16.959C18.2143 16.4999 18.7569 15.8425 19.0491 14.9869L17.4213 7.50149L18.83 6.87542L20.2073 12.9522C20.2908 13.3696 20.3325 13.8287 20.3325 14.3295C20.3325 15.853 19.8108 17.0738 18.7673 17.992C17.7448 18.8894 16.3048 19.3381 14.4475 19.3381H11.8493Z" fill="url(#paint4_linear_344_2248)"/>
<path d="M9.69727 3.04489H16.2397V4.76658H9.69727V3.04489Z" fill="url(#paint5_linear_344_2248)"/>
<path d="M11.7584 0.215851H13.9105V1.97667H11.7584V0.215851Z" fill="url(#paint6_linear_344_2248)"/>
<path d="M23.0732 22.9774H29.5844V24.6991H23.0732V22.9774Z" fill="#1B2132"/>
<defs>
<linearGradient id="paint0_linear_344_2248" x1="32.8895" y1="7.84648" x2="38.5865" y2="12.6934" gradientUnits="userSpaceOnUse">
<stop stop-color="#84FFC8"/>
<stop offset="0.419292" stop-color="#00E03C"/>
<stop offset="1" stop-color="#1B2132"/>
</linearGradient>
<linearGradient id="paint1_linear_344_2248" x1="32.8895" y1="7.84648" x2="38.5865" y2="12.6934" gradientUnits="userSpaceOnUse">
<stop stop-color="#84FFC8"/>
<stop offset="0.419292" stop-color="#00E03C"/>
<stop offset="1" stop-color="#1B2132"/>
</linearGradient>
<linearGradient id="paint2_linear_344_2248" x1="0.143793" y1="-2.0274" x2="11.5175" y2="-0.647003" gradientUnits="userSpaceOnUse">
<stop stop-color="#D284FF"/>
<stop offset="0.245187" stop-color="#4D00FF"/>
<stop offset="1" stop-color="#1B2132"/>
</linearGradient>
<linearGradient id="paint3_linear_344_2248" x1="0.143793" y1="-2.0274" x2="11.5175" y2="-0.647003" gradientUnits="userSpaceOnUse">
<stop stop-color="#D284FF"/>
<stop offset="0.245187" stop-color="#4D00FF"/>
<stop offset="1" stop-color="#1B2132"/>
</linearGradient>
<linearGradient id="paint4_linear_344_2248" x1="0.143793" y1="-2.0274" x2="11.5175" y2="-0.647003" gradientUnits="userSpaceOnUse">
<stop stop-color="#D284FF"/>
<stop offset="0.245187" stop-color="#4D00FF"/>
<stop offset="1" stop-color="#1B2132"/>
</linearGradient>
<linearGradient id="paint5_linear_344_2248" x1="9.54382" y1="-0.561046" x2="25.143" y2="2.76377" gradientUnits="userSpaceOnUse">
<stop stop-color="#D284FF"/>
<stop offset="0.245187" stop-color="#4D00FF"/>
<stop offset="0.410433"/>
<stop offset="1"/>
</linearGradient>
<linearGradient id="paint6_linear_344_2248" x1="9.54382" y1="-0.561046" x2="25.143" y2="2.76377" gradientUnits="userSpaceOnUse">
<stop stop-color="#D284FF"/>
<stop offset="0.245187" stop-color="#4D00FF"/>
<stop offset="0.410433"/>
<stop offset="1"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

53
routes/task.ts Normal file
View File

@ -0,0 +1,53 @@
export default [
{
path: "/task",
file: "@task/pages/index.vue",
meta: { breadcrumb: "سامانه وظایف" },
children: [
{
path: "",
redirect: { name: "taskDashboard" },
},
{
path: "dashboard",
name: "taskDashboard",
file: "@task/pages/TaskDashboard.vue",
meta: {
breadcrumb: "پیشخوان مدیریت وظایف",
},
},
{
path: "times/list",
name: "taskTimes",
file: "@task/pages/Task.vue",
meta: {
breadcrumb: "ساعات",
},
},
{
path: "tasks/list",
name: "taskList",
file: "@task/pages/Task.vue",
meta: {
breadcrumb: "وظایف",
},
},
{
path: "teams/list",
name: "teams",
file: "@task/pages/TaskTeams.vue",
meta: {
breadcrumb: "تیم ها",
},
},
{
path: "admin/list",
name: "taskReport",
file: "@task/pages/TaskReport.vue",
meta: {
breadcrumb: "گزارش وظایف",
},
},
],
},
];

@ -1 +1 @@
Subproject commit 917824f098aff05dc7ece05c8e159a6bbf1fd35c Subproject commit 9fd2e58067d8293340e72abb6c0085db6dbdc2e1

@ -1 +1 @@
Subproject commit ad470940f4cf986638b575d4b8afaa2ec50c267c Subproject commit cc55ac6684ad57c6d801d897e7f2328d9a64fea2