Dataset Viewer
Auto-converted to Parquet
repo_id
stringclasses
419 values
file_path
stringlengths
29
154
content
stringlengths
29
50.9k
__index_level_0__
int64
0
0
Eval\client
Eval\client\modules\manifest.lock.json
{ "account": "1.7.2", "account-corporate": "1.1.3", "account-deduplication-dialog": "1.1.2", "account-entrepreneur": "1.1.3", "account-entrepreneur-insert": "1.2.3", "account-individual": "1.2.2", "account-individual-insert": "2.1.3", "account-individual-tab-details": "1.1.1", "account-info": "1.3.3", "account-insert": "2.5.2", "account-marketing-company": "1.0.1", "account-private": "2.3.1", "account-private-insert": "3.1.3", "account-private-tab-details": "2.1.2", "account-tab-activities": "1.2.1", "account-tab-associations": "1.1.3", "account-tab-attachments": "1.1.1", "account-tab-audit": "1.1.1", "account-tab-contact-info": "1.1.1", "account-tab-contacts": "1.5.2", "account-tab-details": "1.3.3", "account-tab-employments": "1.2.1", "account-tab-employments-security": "1.1.1", "account-tab-history": "1.2.1", "account-tab-managers": "1.1.1", "account-tab-managers-security": "1.1.1", "account-tab-marketing-offers": "1.0.1", "account-tab-opportunities": "1.3.1", "account-tab-tickets": "1.1.2", "activities": "1.1.1", "activities-tab-all-completed": "1.5.2", "activities-tab-all-opened": "1.6.2", "activities-tab-completed-by-me": "1.5.2", "activities-tab-my-activities": "1.6.2", "activity-dialog": "2.4.4", "activity-dialog-tab-agenda": "1.0.1", "activity-dialog-tab-attachments": "1.4.6", "activity-dialog-tab-notes": "1.1.1", "activity-dialog-tab-recurring": "1.2.4", "activity-selector-dialog": "1.1.2", "address-suggestion": "1.1.2", "advanced-search": "1.2.3", "analytics": "1.1.1", "approval": "1.0.5", "approval-tab-audit": "1.0.1", "approval-tab-logs": "1.0.3", "approval-tab-process": "1.0.0", "attachment-add-edit": "1.1.7", "attribute": "1.2.1", "attribute-form": "1.1.2", "attribute-insert": "1.2.2", "attribute-tab-products": "1.2.1", "beneficiary-add-edit": "1.1.1", "boolean-list-viewer-filter": "1.1.2", "boolean-list-viewer-formatter": "1.1.2", "calendar": "2.3.8", "code-highlight": "1.2.1", "common-attribute": "1.1.2", "common-modified-by": "1.1.1", "common-tab-activities": "1.3.2", "common-tab-analytics": "1.1.1", "common-tab-attachments": "1.4.5", "common-tab-audit": "1.2.2", "common-tab-calendar-access": "1.3.1", "common-tab-competitors": "1.2.2", "common-tab-contact-info": "1.5.1", "common-tab-history": "1.4.2", "common-tab-managers": "1.2.1", "common-tab-process": "1.0.1", "communication-channel-add-edit": "1.1.1", "companies-group": "1.4.2", "companies-group-insert": "1.2.1", "companies-group-tab-audit": "1.2.1", "companies-group-tab-composition": "1.5.1", "companies-group-tab-detail": "1.3.1", "companies-group-tab-managers": "1.1.1", "companies-group-tab-opportunities": "2.2.1", "competitor": "1.1.1", "competitor-insert": "1.1.2", "competitor-tab-contact-info": "1.1.1", "contact": "1.5.2", "contact-add-edit": "2.2.5", "contact-info": "1.3.4", "contact-tab-activities": "1.3.1", "contact-tab-attachments": "1.1.1", "contact-tab-audit": "1.3.1", "contact-tab-contact-info": "1.3.1", "contact-tab-history": "1.3.1", "currency-list-viewer-formatter": "1.1.2", "custom-setting": "2.1.2", "custom-setting-insert": "2.1.2", "dashboard": "1.4.2", "dashboard-contribution-calendar": "1.1.2", "dashboard-my-accounts": "1.2.1", "dashboard-my-activities": "1.2.2", "dashboard-my-opportunities": "2.1.3", "dashboard-my-tickets": "1.0.3", "dashboard-opportunities-by-month": "1.1.1", "dashboard-sales-funnel": "1.1.1", "date-time-list-viewer-formatter": "1.1.2", "date-time-range-list-viewer-filter": "1.1.2", "development-empty": "1.0.0", "division": "1.1.1", "division-insert": "1.1.2", "division-tab-accesses": "1.2.1", "division-tab-employees": "1.2.1", "division-tab-employees-security": "1.1.1", "division-tab-opportunities": "1.1.1", "duration-list-viewer-formatter": "1.1.2", "email-list-viewer-formatter": "1.1.2", "enterprise-event": "1.1.2", "enterprise-event-insert": "1.1.2", "enterprise-event-tab-attachments": "1.1.1", "enterprise-event-tab-guests": "1.2.1", "entity-link-list-viewer-formatter": "1.1.2", "entity-notification-type": "1.3.2", "entity-notification-type-insert": "1.3.2", "entity-notification-type-tab-notifications": "1.2.1", "entity-notification-widget": "1.1.1", "entity-users-widget": "1.2.0", "fake-data-generator": "1.5.0", "founder-add-edit": "1.1.1", "group-operation": "1.0.1", "header": "2.0.1", "health": "1.9.2", "job": "1.4.5", "lead": "1.0.0", "lead-insert": "1.0.0", "lead-source": "1.2.1", "lead-source-new": "1.2.2", "lead-tab-contact-info": "1.0.0", "license": "1.1.1", "license-insert": "1.1.1", "list-viewer-builder": "2.8.3", "login": "1.6.2", "logoff": "1.3.0", "main_page": "1.1.2", "manager-lookup": "1.1.3", "marketing-company": "1.0.2", "marketing-company-insert": "1.0.2", "marketing-company-tab-attachments": "1.0.1", "marketing-company-tab-product": "1.0.1", "marketing-company-tab-target-audience": "1.0.1", "meta": "1.3.1", "migration": "1.4.2", "migration-export-picklist": "1.1.2", "migration-export-secured-action": "1.1.1", "navbar": "2.0.1", "news-renderer": "1.2.1", "news-settings": "1.5.1", "news-widget": "1.5.0", "notification-widget": "1.6.0", "number-list-viewer-formatter": "1.1.2", "number-range-list-viewer-filter": "1.1.2", "opportunity": "1.8.5", "opportunity-close-dialog": "1.1.2", "opportunity-info": "1.3.3", "opportunity-insert": "1.6.5", "opportunity-product-attributes": "1.3.5", "opportunity-sales-process": "2.1.2", "opportunity-tab-activities": "1.2.1", "opportunity-tab-attachments": "1.1.1", "opportunity-tab-audit": "1.1.1", "opportunity-tab-competitors": "1.1.1", "opportunity-tab-history": "1.2.1", "opportunity-tab-managers": "1.1.1", "percent-list-viewer-formatter": "1.1.2", "performance": "1.1.1", "phone-list-viewer-formatter": "1.1.2", "phone-widget": "1.1.2", "photo": "1.2.1", "picklist": "2.5.1", "picklist-export": "1.1.1", "picklist-import": "1.1.1", "picklist-insert": "1.1.2", "picklist-list-viewer-filter": "1.1.2", "picklist-tab-items": "2.3.1", "process": "1.1.1", "process-insert": "1.1.2", "process-lookup": "1.1.2", "process-tab-conditions": "1.1.2", "product": "1.4.2", "product-add-edit": "1.0.2", "product-insert": "1.3.2", "product-structure": "2.2.2", "product-tab-attributes": "1.5.7", "production-calendar": "1.2.2", "profile": "1.1.2", "profile-insert": "1.1.2", "profile-tab-secured-actions": "1.3.5", "profiler": "1.6.1", "quick-search": "2.4.1", "radio-group-picklist": "1.1.2", "relative-time-list-viewer-formatter": "1.1.2", "report": "2.3.3", "report-add-edit": "1.2.2", "report-create-dialog": "1.2.2", "role": "1.3.1", "role-insert": "1.2.2", "role-sa-matrix": "1.1.1", "role-sa-matrix-list-roles": "1.1.1", "role-tab-secured-actions": "1.4.1", "role-tab-users": "1.4.1", "sales-process": "2.3.1", "sales-process-action-open-appointment": "1.1.1", "sales-process-action-open-phone-call": "1.1.1", "sales-process-action-open-to-do": "1.1.1", "sales-process-check-default": "1.1.1", "sales-process-insert": "1.1.2", "sales-process-tab-opportunities": "1.1.1", "sales-process-tab-opportunities-security": "1.1.1", "sales-process-tab-stages": "2.1.2", "secured-action": "1.3.1", "secured-action-insert": "1.1.2", "secured-action-tab-roles": "1.3.1", "show-account-deduplication-dialog": "1.1.2", "show-group-operation-dialog": "1.0.0", "team": "1.1.1", "team-insert": "1.1.2", "team-tab-attendees": "1.2.1", "text-like-list-viewer-filter": "1.1.2", "ticket": "1.2.3", "ticket-insert": "1.1.4", "ticket-tab-attachments": "1.1.1", "ticket-tab-response-channels": "1.1.1", "ticket-tab-timeline": "1.1.2", "ui_guide": "2.1.0", "user": "1.7.1", "user-add": "2.2.4", "user-info": "1.6.3", "user-info-list-viewer-formatter": "1.1.2", "user-list-viewer-filter": "1.1.2", "user-lookup": "1.3.1", "user-options": "1.6.0", "user-options-tab-dashboards": "1.1.1", "user-options-tab-secured-actions": "1.1.1", "user-tab-accessed-calendars": "1.2.1", "user-tab-admin-security": "1.1.1", "user-tab-analytics": "1.1.1", "user-tab-auditlog": "1.2.1", "user-tab-authservice-admin-security": "1.0.0", "user-tab-authservice-audit": "1.0.0", "user-tab-business-roles": "1.2.1", "user-tab-calendar-access": "1.2.1", "user-tab-opportunities": "1.1.1", "user-tab-roles": "1.3.1", "user-tab-team-members": "1.2.1", "user-tab-team-membership": "1.2.1", "user-tab-teams": "1.2.1", "user-tab-telephony": "1.1.2", "xlsx": "1.0.2" }
0
Eval\client\modules
Eval\client\modules\account\jest.config.js
module.exports = { ...require('../../configs/jest.config.base'), };
0
Eval\client\modules
Eval\client\modules\account\manifest.json
{ "$schema": "../../module.schema.json", "version": "1.7.2", "name": "account", "type": "EntityPage", "entityName": "Account", "tableName": "ACCOUNT", "meta": { "entity": { "default": "Account", "ru-ru": "Клиент" }, "entity--plural": { "default": "Accounts", "ru-ru": "Клиенты" }, "entity--genitive": { "default": "Account", "ru-ru": "Клиентов" } }, "securedAction": "Entities/Account/View", "path": "/account/:id?", "title": { "default": "Accounts", "ru-ru": "Клиенты" }, "description": { "default": "Accounts", "ru-ru": "Клиенты" }, "navbar": { "id": "nav_account-list", "link": "/account", "securedAction": "Entities/Account/View", "icon": "fb-entities-account", "group": "navbar_group_common", "text": { "default": "Accounts", "ru-ru": "Клиенты" }, "order": 1 } }
0
Eval\client\modules
Eval\client\modules\account\package.json
{ "name": "@fbc/account", "version": "1.3.0", "description": "", "main": "index.ts", "directories": { "test": "tests" }, "scripts": { "build": "webpack --mode production", "build:analytics": "webpack --mode production --env BUNDLE_ANALYTICS", "dev": "webpack --watch --mode development", "eslint": "eslint --config ../../configs/.eslintrc.base.mjs --cache src", "lint-next": "eslint --config ../../configs/.eslintrc.next.base.jsonc --ext .js,.vue,.ts src && stylelint --config ../../configs/.stylelintrc.next.base.json \"**/*.{vue,scss}\" --allow-empty-input --cache", "lint-next:code": "eslint --config ../../configs/.eslintrc.next.base.jsonc --ext .js,.vue,.ts src", "lint-next:style": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.next.base.json --cache --allow-empty-input", "test": "jest --passWithNoTests", "test:ci": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit", "prettier": "prettier --config ../../.prettierrc --write \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "stylelint": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.base.json --cache --allow-empty-input", "typecheck": "tsc --noEmit", "duplicates": "jscpd src -l 15 -x 9999 --ignore \"../../libs/types/Api/DataMethods.d.ts,**/*.spec.ts,**/*.json\"" }, "author": "" }
0
Eval\client\modules
Eval\client\modules\account\tsconfig.json
{ "extends": "../../configs/tsconfig.base", "include": ["./src/**/*", "../../global.d.ts", "../../vue-shim.d.ts", "../../vue.d.ts"] }
0
Eval\client\modules
Eval\client\modules\account\webpack.config.js
const { moduleBaseConfig } = require('../../configs/webpack.config.base'); module.exports = moduleBaseConfig('account');
0
Eval\client\modules\account\node_modules\.cache
Eval\client\modules\account\node_modules\.cache\eslint-webpack-plugin\.eslintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\index.ts":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\ui\\s-account.vue":"2","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\services\\api.ts":"3"},{"size":47,"mtime":1713084078966,"results":"4","hashOfConfig":"5"},{"size":2624,"mtime":1717761884503,"results":"6","hashOfConfig":"5"},{"size":1189,"mtime":1717144489989,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","suppressedMessages":"10","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ne15pg",{"filePath":"11","messages":"12","suppressedMessages":"13","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\index.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\ui\\s-account.vue",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\services\\api.ts",[],[]]
0
Eval\client\modules\account\node_modules\.cache
Eval\client\modules\account\node_modules\.cache\stylelint-webpack-plugin\.stylelintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account\\src\\ui\\s-account.vue":"1"},{"size":2827,"mtime":1726737006458,"hashOfConfig":"2"},"10gefbv"]
0
Eval\client\modules\account
Eval\client\modules\account\src\index.ts
export { default } from './ui/s-account.vue';
0
Eval\client\modules\account\src
Eval\client\modules\account\src\services\api.ts
import { services } from '@fbc/core/services'; import type { EntityId, OmitEntityBase, SimpleEntity } from '@fbc/types'; import type { IAccount } from '../types/Account'; import { Division } from '../types/Division'; const entities = new services.entitiesApi<{ accounts: { from: OmitEntityBase<IAccount, 'registrationDate' | 'okved'> & { registrationDate?: string | null; okveds: { okved: string }[]; }; to: Partial<IAccount>; interface: IAccount; }; divisions: SimpleEntity<Division & { id: EntityId }>; accountOkveds: SimpleEntity<{ id: EntityId; okved: string; isPrimary: boolean; accountId: EntityId }>; }>({ accounts: { from: (entity, mapper) => ({ registrationDate: mapper.toClientDateTime(entity.registrationDate), okved: entity.okveds?.at(0)?.okved, }), to: entity => { if (entity.manager) { entity.managerId = entity.manager.id; delete (entity as Partial<IAccount>).manager; } if (entity.division) { entity.divisionId = entity.division.id; delete (entity as Partial<IAccount>).division; } delete entity.okved; return entity; }, }, }); export default { entities, };
0
Eval\client\modules\account\src
Eval\client\modules\account\src\types\Account.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import { DateTime } from 'luxon'; import { Division } from './Division'; import { User } from './User'; export interface IAccount extends EntityBase { personCode: 'Corporate' | 'Individual' | 'Entrepreneur' | null; photoId: EntityId | null; seccodeId: EntityId; name: string; type: string | null; divisionId: EntityId | null; division: Division; managerId: EntityId; manager: User; inn: string | null; kpp: string | null; okpo: string | null; ogrn: string | null; kio: string | null; phone: string | null; email: string | null; webAddress: string | null; aka: string | null; isResident: boolean; businessSize: string | null; status: string | null; description: string | null; authorizedCapital: number | null; registrationDate: DateTime | null; okfs: string | null; okopf: string | null; // Заполняется из зависимых сущностей, readonly okved?: string | null; }
0
Eval\client\modules\account\src
Eval\client\modules\account\src\types\Division.d.ts
import type { EntityId } from '@fbc/types'; export type Division = { id: EntityId; name: string; type: string };
0
Eval\client\modules\account\src
Eval\client\modules\account\src\types\User.d.ts
import type { EntityId } from '@fbc/types'; export type User = { id: EntityId; shortName: string; lastName: string; firstName: string | null; middleName: string | null; };
0
Eval\client\modules\account\src
Eval\client\modules\account\src\ui\s-account.vue
<template> <div :class="$style.root"> <div v-if="isLoading" :class="$style.placeholder"> <s-placeholder :class="$style['details-placeholder']" /> <s-placeholder :class="$style['tabs-placeholder']" /> </div> <template v-else> <s-page v-if="accountType" :name="accountType" :entityId="entityId" :entityName="entityName" /> <s-page v-if="accountType && $store.user.hasAccess('Entities/Account/MarketingCompany/View').value" name="account-marketing-company" :entityId="entityId" :entityName="entityName" /> <suspense> <s-detail-tab-container v-if="accountType" v-bind="$props" :entitySubName="accountType === entityName ? undefined : accountType" /> <template #fallback> <s-placeholder :class="$style['tabs-placeholder']" /> </template> </suspense> </template> </div> </template> <script lang="ts"> import { services } from '@fbc/core/services'; import { defineComponent, onUnmounted, ref, watch } from 'vue'; import api from '../services/api'; type AccountType = 'account-corporate' | 'account-private' | 'account-individual' | 'account-entrepreneur'; const mapPersonCodeToAccountType = new Map([ ['Corporate', 'account-corporate'], ['Individual', 'account-individual'], ['Entrepreneur', 'account-entrepreneur'], ['Private', 'account-private'], ] as const); export default defineComponent({ name: 'account', props: { entityId: { type: String, required: true }, entityName: { type: String, required: true }, }, setup(props) { const accountType = ref<AccountType>(); const { store } = services; const isLoading = ref(true); watch( () => props.entityId, async () => { accountType.value = undefined; isLoading.value = true; const [error, account] = await api.entities.read('accounts', props.entityId, __filename, { select: ['personCode', 'seccodeId'], }); if (error) log.prod.error(__filename, error); await store.user.loadProfile(account?.seccodeId ?? ''); isLoading.value = false; accountType.value = mapPersonCodeToAccountType.get(account?.personCode ?? 'Corporate'); }, { immediate: true, }, ); onUnmounted(store.user.unloadProfile); return { accountType, isLoading, }; }, }); </script> <style lang="scss" module> @layer modules { .root { overflow-y: auto; overflow-x: hidden; .header { height: 150px; background-color: var(--background); } .body { background-color: var(--background); } .placeholder { display: flex; flex-direction: column; gap: var(--sm); } .details-placeholder { height: 400px; } .tabs-placeholder { width: 100%; height: 200px; } } } </style>
0
Eval\client\modules
Eval\client\modules\account-corporate\jest.config.js
module.exports = { ...require('../../configs/jest.config.base'), };
0
Eval\client\modules
Eval\client\modules\account-corporate\manifest.json
{ "$schema": "../../module.schema.json", "version": "1.1.6", "name": "account-corporate", "type": "Page" }
0
Eval\client\modules
Eval\client\modules\account-corporate\package.json
{ "name": "@fbc/account-corporate", "version": "1.0.0", "description": "", "main": "src/index.ts", "directories": { "test": "tests" }, "scripts": { "build": "webpack --mode production", "build:analytics": "webpack --mode production --env BUNDLE_ANALYTICS", "dev": "webpack --watch --mode development", "eslint": "eslint --config ../../configs/.eslintrc.base.mjs --cache src", "lint-next": "eslint --config ../../configs/.eslintrc.next.base.jsonc --ext .js,.vue,.ts src && stylelint --config ../../configs/.stylelintrc.next.base.json \"**/*.{vue,scss}\" --allow-empty-input --cache", "lint-next:code": "eslint --config ../../configs/.eslintrc.next.base.jsonc --ext .js,.vue,.ts src", "lint-next:style": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.next.base.json --cache --allow-empty-input", "test": "jest --passWithNoTests", "test:ci": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit", "prettier": "prettier --config ../../.prettierrc --write \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "stylelint": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.base.json --cache --allow-empty-input", "typecheck": "tsc --noEmit", "duplicates": "jscpd src -l 15 -x 9999 --ignore \"../../libs/types/Api/DataMethods.d.ts,**/*.spec.ts,**/*.json\"" }, "author": "" }
0
Eval\client\modules
Eval\client\modules\account-corporate\tsconfig.json
{ "extends": "../../configs/tsconfig.base", "include": ["./src/**/*", "../../global.d.ts", "../../vue-shim.d.ts", "../../vue.d.ts"] }
0
Eval\client\modules
Eval\client\modules\account-corporate\webpack.config.js
const { moduleBaseConfig } = require('../../configs/webpack.config.base'); module.exports = moduleBaseConfig('account-corporate');
0
Eval\client\modules\account-corporate\node_modules\.cache
Eval\client\modules\account-corporate\node_modules\.cache\eslint-webpack-plugin\.eslintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\index.ts":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\ui\\s-account-corporate-details.vue":"2","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\ui\\s-account-corporate-details.ts":"3","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\services\\api.ts":"4","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\presenter\\account-corporate-module.ts":"5"},{"size":65,"mtime":1717144489944,"results":"6","hashOfConfig":"7"},{"size":10816,"mtime":1728378249951,"results":"8","hashOfConfig":"9"},{"size":3195,"mtime":1727855856861,"results":"10","hashOfConfig":"7"},{"size":2421,"mtime":1726737006354,"results":"11","hashOfConfig":"7"},{"size":6064,"mtime":1726737006354,"results":"12","hashOfConfig":"7"},{"filePath":"13","messages":"14","suppressedMessages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"njcdfs",{"filePath":"16","messages":"17","suppressedMessages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"fecpok",{"filePath":"19","messages":"20","suppressedMessages":"21","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","suppressedMessages":"24","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","suppressedMessages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\index.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\ui\\s-account-corporate-details.vue",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\ui\\s-account-corporate-details.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\services\\api.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\presenter\\account-corporate-module.ts",[],["28","29"],{"ruleId":"30","severity":2,"message":"31","line":49,"column":44,"nodeType":"32","messageId":"33","endLine":49,"endColumn":46,"suggestions":"34","suppressions":"35"},{"ruleId":"30","severity":2,"message":"31","line":49,"column":58,"nodeType":"32","messageId":"33","endLine":49,"endColumn":60,"suggestions":"36","suppressions":"37"},"@typescript-eslint/prefer-nullish-coalescing","Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.","Punctuator","preferNullishOverOr",["38"],["39"],["40"],["41"],{"messageId":"42","fix":"43","desc":"44"},{"kind":"45","justification":"46"},{"messageId":"42","fix":"47","desc":"44"},{"kind":"45","justification":"46"},"suggestNullish",{"range":"48","text":"49"},"Fix to nullish coalescing operator (`??`).","directive","",{"range":"50","text":"51"},[2061,2093],"(entity.description ?? entity.aka)",[2094,2096],"??"]
0
Eval\client\modules\account-corporate\node_modules\.cache
Eval\client\modules\account-corporate\node_modules\.cache\stylelint-webpack-plugin\.stylelintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\ui\\s-account-corporate-details.scss":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-corporate\\src\\ui\\s-account-corporate-details.vue":"2"},{"size":4203,"mtime":1727936399912,"hashOfConfig":"3"},{"size":10816,"mtime":1728378249951,"hashOfConfig":"4"},"1dnpjin","10gefbv"]
0
Eval\client\modules\account-corporate
Eval\client\modules\account-corporate\src\index.ts
export { default } from './ui/s-account-corporate-details.vue';
0
Eval\client\modules\account-corporate
Eval\client\modules\account-corporate\src\localization.json
{ "default": { "entity": "Account [LP]", "name": "Name", "type": "Type", "companiesGroup": "Companies groups", "authorizedCapital": "Authorized capital", "division": "Division", "manager": "Manager", "inn": "TIN", "kpp": "KPP", "okpo": "OKPO", "okved": "OKVED", "okfs": "OKFS", "okopf": "OKOPF", "ogrn": "OGRN", "kio": "KIO", "description": "Description", "status": "Status", "photoId": "Photo", "aka": "AKA", "isResident": "Resident RF", "businessSize": "Business size", "registrationDate": "Registration date", "dataFilling": "Completeness of data filling", "confirm-delete": "Are you sure you want to delete this account?", "phone": "Phone", "email": "Email", "webAddress": "Web address", "incorrect": "Incorrect" }, "ru-ru": { "entity": "Клиент [ЮЛ]", "name": "Название", "type": "Тип", "companiesGroup": "Группы компаний", "authorizedCapital": "Уставный капитал", "division": "Подразделение", "manager": "Менеджер", "inn": "ИНН", "kpp": "КПП", "okpo": "ОКПО", "okved": "ОКВЭД", "okfs": "ОКФС", "okopf": "ОКОПФ", "ogrn": "ОГРН", "kio": "КИО", "description": "Описание", "status": "Статус", "photoId": "Фото", "aka": "Юридическое наименование", "isResident": "Резидент РФ", "businessSize": "Размер бизнеса", "registrationDate": "Дата регистрации", "dataFilling": "Полнота заполнения данных", "confirm-delete": "Вы уверены что хотите удалить этого клиента?", "phone": "Телефон", "email": "Email", "webAddress": "Сайт", "incorrect": "Некорректный" } }
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\presenter\account-corporate-module.ts
import { services } from '@fbc/core/services'; import { useEntityStore } from '@fbc/core/storage'; import { EntityId } from '@fbc/types'; import { defineStore } from 'pinia'; import { computed, reactive } from 'vue'; import resource from '../localization.json'; import api, { accountODataConfig } from '../services/api'; import { Account } from '../types/Account'; import { Division } from '../types/Division'; import { User } from '../types/User'; const isAccountOkved = (x: unknown): x is { okved: string; isPrimary: boolean } => Boolean(typeof x === 'object' && x && 'okved' in x && 'isPrimary' in x); const isCommunicationChannel = (x: unknown): x is { entityId: EntityId; entity: string; isPrimary: boolean } => Boolean(typeof x === 'object' && x && 'entityId' in x && 'entity' in x && 'isPrimary' in x); export const useAccount = defineStore('account', () => { const { bus, i18n, store: { user: { hasAccess }, }, } = services; const local = (value: string) => i18n.extract(resource, value); const okvedMap = reactive(new Map<string, string>()); const loadOkvedInfo = (code: string) => api.web .get('picklist/itemByCode', { name: 'ОКВЭД2', code }, __filename) .then(x => x[1] ? okvedMap.set(x[1].code, x[1].text ?? x[1].shortText ?? '') : log.prod.error(__filename, x[0]), ); const base = useEntityStore(api.entities, 'accounts', __filename, { odataConfig: accountODataConfig, getDisplayName: entity => `${entity.name} ${entity.inn ?? ''}`, loadWithEntity: async () => { const { store } = services; await store.picklists.loadMultiple(['Статус организации', 'Категория ЮЛ', 'ОКФС', 'ОКОПФ'], __filename); }, onEntityLoaded(entity) { const { store } = services; if (!store) return; store.title = [store.defaultTitle.at(0), local('entity'), `${entity.name} ${entity.inn ?? ''}`]; // так сделано, чтобы в описании страницы не было пустой строки // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing store.description = (entity.description || entity.aka || entity.name) ?? ''; if (!entity.okved || okvedMap.has(entity.okved)) return; loadOkvedInfo(entity.okved); }, maxLengthMap: new Map([ ['inn', 12], ['kpp', 9], ['okpo', 10], ['ogrn', 15], ['okopf', 512], ['okfs', 512], ['businessSize', 512], ['type', 512], ['name', 512], ['aka', 512], ['phone', 128], ['email', 128], ['webAddress', 128], ] as const), }); const onAccountOkvedChange = async (x: unknown) => { if (!base.entity.value?.id || !isAccountOkved(x) || !x.isPrimary) return; const [error, [okved] = []] = await api.entities.where( 'accountOkveds', { filter: [ { fieldName: 'isPrimary', operator: 'eq', value: true }, { fieldName: 'accountId', operator: 'eq', value: `'${base.entity.value.id}'` }, ], select: ['okved'], }, __filename, ); base.entity.value.okved = okved?.okved; base.updateStack.value = base.updateStack.value.filter(x => x[0] !== 'okved'); if (error) log.prod.error(__filename, error); else if (okved) { loadOkvedInfo(okved.okved); } }; bus.on('/entity/accountOkved/created', onAccountOkvedChange); bus.on('/entity/accountOkved/deleted', onAccountOkvedChange); bus.on('/entity/accountOkved/updated', onAccountOkvedChange); const dataFillMap = new Map<keyof Account, number>([ ['inn', 60], ['aka', 10], ['businessSize', 10], ['kpp', 20], ['okpo', 20], ['ogrn', 20], ['okopf', 20], ['okfs', 20], ['authorizedCapital', 10], ['registrationDate', 10], ['status', 10], ['description', 10], ]); const dataFill = computed(() => { const entity = base.entity.value; if (!entity) return 0; const { total, sum } = [...dataFillMap.entries()].reduce( (p, c) => { p.total += c[1]; if (entity[c[0]]) p.sum += c[1]; return p; }, { total: 0, sum: 0 }, ); return sum / total; }); const onCommunicationChannelChanged = (communicationChannel: unknown) => { if ( !isCommunicationChannel(communicationChannel) || communicationChannel.entity !== 'Account' || base.entity.value?.id !== communicationChannel.entityId || !communicationChannel.isPrimary ) return; base.load(communicationChannel.entityId); }; bus.on(`/entity/communicationChannel/created`, onCommunicationChannelChanged); bus.on(`/entity/communicationChannel/updated`, onCommunicationChannelChanged); bus.on(`/entity/communicationChannel/deleted`, onCommunicationChannelChanged); function unregister() { bus.off('/entity/accountOkved/created', onAccountOkvedChange); bus.off('/entity/accountOkved/deleted', onAccountOkvedChange); bus.off('/entity/accountOkved/updated', onAccountOkvedChange); bus.off('/entity/communicationChannel/created', onCommunicationChannelChanged); bus.off('/entity/communicationChannel/updated', onCommunicationChannelChanged); bus.off('/entity/communicationChannel/deleted', onCommunicationChannelChanged); } const canEdit = hasAccess('Entities/Account/Edit'); const canDelete = hasAccess('Entities/Account/Delete'); const isCommunicationChannelVisible = hasAccess('Entities/Account/Tab/ContactInfo/CommChannels/View'); const isCommunicationChannelEditable = hasAccess('Entities/Account/Tab/ContactInfo/CommChannels/Edit'); const onManagerChanged = (value: { user: User; division: Division }) => { if (!base.entity.value) return; base.entity.value.manager = value?.user ?? null; base.entity.value.managerId = value?.user.id; base.entity.value.division = value?.division; base.entity.value.divisionId = value?.division?.id; }; return { ...base, dataFill, dataFillMap, okvedMap, unregister, canEdit, canDelete, isCommunicationChannelVisible, isCommunicationChannelEditable, onManagerChanged, }; });
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\services\api.ts
import { services } from '@fbc/core/services'; import type { EntityId, FullODataConfig, OmitEntityBase, SimpleEntity } from '@fbc/types'; import type { Account } from '../types/Account'; import { Division } from '../types/Division'; const entities = new services.entitiesApi<{ accounts: { from: OmitEntityBase<Account, 'registrationDate' | 'okved'> & { registrationDate?: string | null; okveds: { okved: string }[]; }; to: Partial<Account>; interface: Account; }; divisions: SimpleEntity<Division & { id: EntityId }>; accountOkveds: SimpleEntity<{ id: EntityId; okved: string; isPrimary: boolean; accountId: EntityId }>; }>({ accounts: { from: (entity, mapper) => ({ registrationDate: mapper.toClientDateTime(entity.registrationDate), okved: entity.okveds?.at(0)?.okved, }), to: entity => { if (entity.manager) { entity.managerId = entity.manager.id; delete (entity as Partial<Account>).manager; } if (entity.division) { entity.divisionId = entity.division.id; delete (entity as Partial<Account>).division; } delete entity.okved; return entity; }, }, }); export default { entities, web: new services.webApi< { 'picklist/itemByCode': { parameters: { name: string; code: string }; response: { code: string; text: string; shortText: string | null; }; }; }, Record<never, never>, Record<never, never>, Record<never, never> >(), attachments: new services.attachmentsApi(), }; export const accountODataConfig: FullODataConfig = { select: [ 'id', 'modifyDate', 'modifyUser', 'name', 'divisionId', 'seccodeId', 'personCode', 'aka', 'type', 'businessSize', 'inn', 'kio', 'kpp', 'okpo', 'ogrn', 'okopf', 'okfs', 'isResident', 'authorizedCapital', 'registrationDate', 'photoId', 'status', 'description', 'managerId', 'phone', 'email', 'webAddress', ], expand: [ 'managers/id', 'managers/businessRole', 'division/id', 'division/name', 'division/type', 'manager/id', 'manager/lastName', 'manager/firstName', 'manager/middleName', 'manager/shortName', 'okveds/id', 'okveds/okved', 'okveds/isPrimary', ], expandFilters: { okveds: 'isPrimary eq true', managers: "businessRole eq 'Клиентский менеджер'" }, };
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\types\Account.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import { DateTime } from 'luxon'; import { Division } from './Division'; import { User } from './User'; export type Account = EntityBase & { personCode: 'Corporate' | 'Individual' | 'Entrepreneur' | null; photoId: EntityId | null; seccodeId: EntityId; name: string; type: string | null; divisionId: EntityId | null; division: Division; managerId: EntityId; manager: User; inn: string | null; kpp: string | null; okpo: string | null; ogrn: string | null; kio: string | null; phone: string | null; email: string | null; webAddress: string | null; aka: string | null; isResident: boolean; businessSize: string | null; status: string | null; description: string | null; authorizedCapital: number | null; registrationDate: DateTime | null; okfs: string | null; okopf: string | null; // Заполняется из зависимых сущностей, readonly okved?: string | null; };
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\types\Division.d.ts
import type { EntityId } from '@fbc/types'; export type Division = { id: EntityId; name: string; type: string };
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\types\User.d.ts
import type { EntityId } from '@fbc/types'; export type User = { id: EntityId; shortName: string; lastName: string; firstName: string | null; middleName: string | null; };
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\ui\s-account-corporate-details.scss
@layer modules { @media screen and (width < 1366px) { .name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; } } .root, .placeholder { display: grid; grid-template-columns: 1fr; grid-auto-rows: auto; gap: var(--sm); margin-top: var(--sm); :global(.v-container--contrast) { @media screen and (width < 1366px) { gap: var(--xs); } @media screen and (width >= 1366px) { > li { flex: 1; } } } } div.photo { --photo-size: 60px; --photo-delete-size: 14px; --photo-delete-top: 10px; --photo-delete-right: -10px; align-items: center; &:global(.photo__s-photo .photo__s-photo__img) { border-radius: 50%; } &:global(.photo__s-photo.photo__s-photo__empty i) { color: var(--on-contrast-icon); font-size: var(--icon-md); background-color: transparent; } :global(.s-placeholder) { background: transparent; } } .strip { grid-area: strip; display: flex; justify-content: space-between; gap: var(--xs); padding-block: var(--x2s); > label { flex: 1; display: flex; align-items: center; gap: var(--xs); color: var(--disabled); } :global(.s-codetext .s-input .s-input-control > .s-input-control-inner:before) { content: unset; } } .body { padding: 0 var(--sm); display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: var(--sm); grid-template-areas: 'strip strip strip' 'categories middle description'; @media screen and (width > 1920px) { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-areas: 'strip categories middle description'; .strip { flex-direction: column; > label { display: flex; gap: var(--xs); align-items: center; justify-content: space-between; flex: 1 1 auto; > :first-child { color: var(--disabled); min-width: 120px; max-width: 120px; &.value { flex: 1 1 auto; color: var(--on-surface); } } > div { flex: 1 1 auto; } } } } @media screen and (width <= 1366px) { grid-template-columns: 1fr 1fr; grid-template-areas: 'strip strip' 'categories middle' 'description description'; :global(.s-codetext) { width: unset; } } @media screen and (width <= 600px) { display: flex; flex-direction: column; } .description-block { grid-area: description; > div { width: 100%; } } .categories-block { grid-area: categories; } .middle-block { grid-area: middle; display: flex; flex-direction: column; gap: var(--sm); } .communication-block { flex-grow: 1; a { word-break: break-word; } } .description-block, .categories-block, .business-block, .communication-block { display: flex; flex-direction: column; gap: var(--xs); label, > :global(.s-property) { display: flex; gap: var(--xs); align-items: center; flex: 1 1 auto; min-height: 32px; width: 100%; > span:first-child { color: var(--disabled); min-width: 120px; max-width: 120px; @media screen and (width <= 1000px) { min-width: 90px; max-width: 90px; } &.value { flex: 1 1 auto; color: var(--on-surface); } } > div { flex: 1 1 auto; } } > :global(.s-textarea) { > label { min-height: unset; } } } } .data-fill-tooltip { padding: var(--sm); display: flex; flex-direction: column; gap: var(--xs); > div { display: flex; gap: var(--xs); align-items: center; } } .line-clamp :global(.s-property__readonly) > span { color: var(--on-surface); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; } @media screen and (width <= 600px) { .strip > label, .communication-block > label { width: 100%; > *:first-child { flex: 0 0 20%; } > *:last-child { flex: 1 1 auto; } } } }
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\ui\s-account-corporate-details.ts
import { services } from '@fbc/core/services'; import { getCachedModule } from '@fbc/core/utils'; import type { EntityId, LookupColumn } from '@fbc/types'; import { computed, defineComponent, h, markRaw, onUnmounted, watch } from 'vue'; import { useRouter } from 'vue-router'; import resource from '../localization.json'; import { useAccount } from '../presenter/account-corporate-module'; import api from '../services/api'; import { Account } from '../types/Account'; export default defineComponent({ name: 'account-corporate', props: { entityId: { type: String, required: true }, entityName: { type: String, required: true }, }, setup(props) { const { confirm, toast, bus, i18n, alert } = services; const local = (value: string) => i18n.extract(resource, value); const { module, unregister } = getCachedModule('account', useAccount); onUnmounted(unregister); watch( () => props.entityId, () => module.load(props.entityId), { immediate: true, }, ); const router = useRouter(); const save = () => module.save().then(x => (x ? toast.saved() : toast.notSaved())); const deleteClick = async () => { if (!(await confirm.delete(local('confirm-delete'), 350))) return; const [error, success] = await module.delete(); if (success) { router.replace({ name: 'account' }); toast.deleted(); return; } if (error) log.prod.error(__filename, error); if (error?.innerException?.message) alert.error(error.innerException.message); else toast.notDeleted(); }; const entity = computed(() => module.entity ?? ({} as Account)); const divisionColumns = computed<LookupColumn[]>(() => [ { field: 'id', visible: false, }, { field: 'name', caption: local('division'), filter: 'text', isDisplayName: true, }, { field: 'type', caption: local('type'), filter: 'text', }, ]); const savePhoto = (photoId: EntityId | null) => { if (!module.entity) return; module.entity.photoId = photoId; return module.save(); }; const validateWebAddress = (value?: string | null) => !value || /^https?:\/\//g.test(value) || `${local('incorrect')} ${local('webAddress')}`; const dataFillTooltip = markRaw(() => [...module.dataFillMap.entries()].map(x => h('div', [ entity.value[x[0]] ? h('i', { class: 'fb-common-done', style: 'color: var(--success)' }) : h('i', { class: 'fb-common-close', style: 'color: var(--error)' }), local(x[0]) ?? x[0], ]), ), ); const toolbar = computed(() => ({ left: [ { visible: module.entity?.modifyDate, slot: 'left-1' }, { visible: true, showOnMobile: true, slot: 'left-2' }, ], right: [ { visible: module.canDelete, text: services.i18n.global('delete'), onlyIcon: true, icon: 'fb-common-recycle-bin', action: deleteClick, }, ], })); return { api, save, deleteClick, module, divisionColumns, entity, savePhoto, validateWebAddress, bus, local, dataFillTooltip, toolbar, }; }, });
0
Eval\client\modules\account-corporate\src
Eval\client\modules\account-corporate\src\ui\s-account-corporate-details.vue
<template> <div :class="$style.root"> <s-main-content-toolbar v-bind="toolbar"> <template #left-1="{ disposition }"> <s-page v-if="module.entity?.modifyDate" name="common-modified-by" optional :modifyUser="module.entity.modifyUser" :modifyDate="module.entity.modifyDate" :style="disposition === 'menu' ? 'width: 180px;' : undefined" /> </template> <template #left-2> <s-page name="entity-users-widget" :entityId="entityId" :entityName="entityName" /> </template> </s-main-content-toolbar> <ul v-container:contrast> <li> <s-page v-if="module.entity" v-model="module.entity.photoId" name="photo" :class="$style.photo" :readonly="!module.canEdit" :save="savePhoto" :placeholder="{ props: { contrast: true, style: 'width: 56px;background: transparent' } }" > <template #empty> <i class="fb-entities-account" /> </template> </s-page> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('name') }}</template> <template #readonly> <div v-tooltip.showOnlyIfOverflown="entity.name" :class="$style.name">{{ entity.name }}</div> </template> <s-input v-model="entity.name" :maxlength="module.maxLengthMap?.get('name')" @update:modelValue="save" /> </s-property> </li> <li> <i class="fb-common-new" /> <s-property contrast :loading="module.loading.isLocked" readonly> <template #label>{{ local('type') }}</template> <template #readonly>{{ entity.type }}</template> </s-property> </li> <li> <i class="fb-entities-division" /> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('division') }}</template> <template #readonly>{{ entity.division?.name }}</template> <s-odata-lookup v-model="entity.division" v-model:columns="divisionColumns" :parameters="{ api: api.entities, key: 'divisions' }" idField="id" :caption="local('division')" readonly @update:modelValue="save" /> </s-property> </li> <li> <i class="fb-entities-user" /> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('manager') }}</template> <template #readonly>{{ entity.manager?.shortName }}</template> <s-page :modelValue="{ user: entity.manager, division: entity.division, }" name="manager-lookup" entityName="Account" contrast :placeholder="{ props: { contrast: true } }" @update:modelValue=" module.onManagerChanged($event); save().then(() => bus.emit(`/entity/${entityName}/managerChanged`, $event)); " /> </s-property> </li> <li> <label v-tooltip.pre="{ label: dataFillTooltip, offsetY: 20, class: $style['data-fill-tooltip'] }"> {{ local('dataFilling') }} <s-progressbar :aria-label="local('dataFilling')" style="color: var(--on-success-container); --progress-border-radius: 20px; --progress-size: 16px" :style="{ '--progress-color': `var(--${ module.dataFill < 0.3 ? 'error' : module.dataFill < 0.7 ? 'warning' : 'success' }-container)`, }" :value="module.dataFill" /> </label> </li> </ul> <s-page name="entity-notification-widget" :entityId="entityId" entityName="Account" :class="$style.notifications" style="min-height: 24px" /> <div :class="$style.body"> <div v-container :class="$style.strip"> <label> <span>{{ local('inn') }}</span> <s-codetext v-model="entity.inn" :readonly="!module.canEdit" codeType="InnCorporate" @update:modelValue="save" /> </label> <label> <span>{{ local('kpp') }}</span> <s-codetext v-model="entity.kpp" :readonly="!module.canEdit" codeType="Kpp" @update:modelValue="save" /> </label> <label> <span>{{ local('okpo') }}</span> <s-codetext v-model="entity.okpo" :readonly="!module.canEdit" codeType="Okpo" @update:modelValue="save" /> </label> <label> <span>{{ local('kio') }}</span> <s-codetext v-model="entity.kio" :readonly="!module.canEdit" codeType="Kio" @update:modelValue="save" /> </label> <label> <span>{{ local('ogrn') }}</span> <s-codetext v-model="entity.ogrn" :readonly="!module.canEdit" codeType="Ogrn" @update:modelValue="save" /> </label> </div> <div v-container :class="$style['categories-block']"> <s-property :class="$style['line-clamp']" :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('aka') }}</template> <template #readonly> <span v-tooltip.showOnlyIfOverflown="entity.aka"> {{ entity.aka }} </span> </template> <s-input v-model="entity.aka" :maxlength="module.maxLengthMap?.get('aka')" @update:modelValue="save" /> </s-property> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('status') }}</template> <template #readonly>{{ entity.status }}</template> <s-picklist v-model="entity.status" picklistName="Статус организации" :maxlength="module.maxLengthMap?.get('status')" @update:modelValue="save" /> </s-property> <s-property :class="$style['line-clamp']" :loading="module.loading.isLocked" readonly> <template #label>{{ local('okved') }}</template> <template #readonly> <span v-tooltip.showOnlyIfOverflown="entity.okved + ' ' + (module.okvedMap.get(entity.okved!) ?? '')"> {{ entity.okved }} {{ module.okvedMap.get(entity.okved!) ?? '' }} </span> </template> </s-property> <s-property :class="$style['line-clamp']" :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('okfs') }}</template> <template #readonly> <span v-tooltip.showOnlyIfOverflown="entity.okfs"> {{ entity.okfs }} </span> </template> <s-picklist-lookup :modelValue="{ text: entity.okfs }" picklistName="ОКФС" :columns=" new Map([ ['text', { caption: local('okfs') }], ['code', { width: 200 }], ]) " @update:modelValue=" entity.okfs = $event?.text; save(); " /> </s-property> <s-property :class="$style['line-clamp']" :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('okopf') }}</template> <template #readonly> <span v-tooltip.showOnlyIfOverflown="entity.okopf"> {{ entity.okopf }} </span> </template> <s-picklist-lookup :modelValue="{ text: entity.okopf }" picklistName="ОКОПФ" :columns=" new Map([ ['text', { caption: local('okopf') }], ['code', { width: 200 }], ]) " @update:modelValue=" entity.okopf = $event?.text; save(); " /> </s-property> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('isResident') }}</template> <template #readonly>{{ $i18n.global(entity.isResident ? 'yes' : 'no') }}</template> <s-checkbox v-model="entity.isResident" @update:modelValue="save" /> </s-property> </div> <div :class="$style['middle-block']"> <div v-container :class="$style['business-block']"> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('registrationDate') }}</template> <template #readonly>{{ entity.registrationDate?.toLocaleString() }}</template> <s-date-time-picker v-model="entity.registrationDate" dateOnly @update:modelValue="save" /> </s-property> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('businessSize') }}</template> <template #readonly>{{ entity.businessSize }}</template> <s-picklist v-model="entity.businessSize" picklistName="Категория ЮЛ" :maxlength="module.maxLengthMap?.get('businessSize')" @update:modelValue="save" /> </s-property> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('authorizedCapital') }}</template> <template #readonly>{{ entity.authorizedCapital?.toLocaleString() }}</template> <s-input v-model="entity.authorizedCapital" type="double" @update:modelValue="save" /> </s-property> </div> <div v-container :class="$style['communication-block']"> <label> <span>{{ local('phone') }}</span> <s-page v-model="entity.phone" :class="$style.phone" :readonly="!module.canEdit || !module.isCommunicationChannelEditable" :isValueHidden="!module.isCommunicationChannelVisible" name="communication-channel-add-edit" channelType="Контактный телефон" :entityName="entityName" :entityId="entityId" /> </label> <label> <span>{{ local('email') }}</span> <s-page v-model="entity.email" :class="$style.email" :readonly="!module.canEdit || !module.isCommunicationChannelEditable" :isValueHidden="!module.isCommunicationChannelVisible" name="communication-channel-add-edit" channelType="E-mail" :entityName="entityName" :entityId="entityId" /> </label> <label> <span>{{ local('webAddress') }}</span> <s-page v-model="entity.webAddress" name="communication-channel-add-edit" channelType="Web-адрес" :readonly="!module.canEdit || !module.isCommunicationChannelEditable" :isValueHidden="!module.isCommunicationChannelVisible" :entityName="entityName" :entityId="entityId" /> </label> </div> </div> <div v-container :class="$style['description-block']"> <s-textarea v-model="entity.description" :disabled="!module.canEdit" rows="10" expandable maxRows="10" :label="local('description')" :placeholder="local('description-placeholder')" @update:modelValue="save" /> </div> </div> </div> </template> <script lang="ts" src="./s-account-corporate-details.ts"></script> <style lang="scss" src="./s-account-corporate-details.scss" module></style>
0
Eval\client\modules
Eval\client\modules\account-deduplication-dialog\jest.config.js
module.exports = { ...require('../../configs/jest.config.base'), };
0
Eval\client\modules
Eval\client\modules\account-deduplication-dialog\manifest.json
{ "$schema": "../../module.schema.json", "version": "1.1.2", "name": "account-deduplication-dialog", "type": "Dialog" }
0
Eval\client\modules
Eval\client\modules\account-deduplication-dialog\package.json
{ "name": "@fbc/account-deduplication-dialog", "version": "1.0.0", "description": "", "main": "src/index.ts", "directories": { "test": "tests" }, "scripts": { "dev": "webpack --watch --mode development", "build": "webpack --mode production", "build:analytics": "webpack --mode production --env BUNDLE_ANALYTICS", "eslint": "eslint --config ../../configs/.eslintrc.base.mjs --cache src", "lint-next": "node ./.eslint.next.js", "lint-next:code": "node ./.eslint.next.js --code", "lint-next:style": "node ./.eslint.next.js --style", "test": "jest --passWithNoTests", "test:ci": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit", "prettier": "prettier --config ../../.prettierrc --write \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "stylelint": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.base.json --cache --allow-empty-input", "typecheck": "tsc --noEmit", "duplicates": "jscpd src -l 15 -x 9999 --ignore \"../../libs/types/Api/DataMethods.d.ts,**/*.spec.ts,**/*.json\"" }, "author": "" }
0
Eval\client\modules
Eval\client\modules\account-deduplication-dialog\tsconfig.json
{ "extends": "../../configs/tsconfig.base", "include": ["./src/**/*", "../../global.d.ts", "../../vue-shim.d.ts", "../../vue.d.ts"] }
0
Eval\client\modules
Eval\client\modules\account-deduplication-dialog\webpack.config.js
const { moduleBaseConfig } = require('../../configs/webpack.config.base'); module.exports = moduleBaseConfig('account-deduplication-dialog');
0
Eval\client\modules\account-deduplication-dialog\node_modules\.cache
Eval\client\modules\account-deduplication-dialog\node_modules\.cache\eslint-webpack-plugin\.eslintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\index.ts":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\ui\\s-account-deduplication-dialog.vue":"2","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\ui\\s-account-deduplication-dialog.ts":"3","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\presenter\\account-deduplication-dialog-module.ts":"4","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\services\\i18n.ts":"5","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\use-cases\\account-table.ts":"6","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\services\\api.ts":"7"},{"size":68,"mtime":1713084078826,"results":"8","hashOfConfig":"9"},{"size":839,"mtime":1719392840501,"results":"10","hashOfConfig":"9"},{"size":3319,"mtime":1717144489956,"results":"11","hashOfConfig":"9"},{"size":3112,"mtime":1718351750170,"results":"12","hashOfConfig":"9"},{"size":213,"mtime":1713084078828,"results":"13","hashOfConfig":"9"},{"size":3562,"mtime":1719394700459,"results":"14","hashOfConfig":"9"},{"size":977,"mtime":1714110634695,"results":"15","hashOfConfig":"9"},{"filePath":"16","messages":"17","suppressedMessages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"13daacd",{"filePath":"19","messages":"20","suppressedMessages":"21","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","suppressedMessages":"24","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","suppressedMessages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\index.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\ui\\s-account-deduplication-dialog.vue",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\ui\\s-account-deduplication-dialog.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\presenter\\account-deduplication-dialog-module.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\services\\i18n.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\use-cases\\account-table.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\services\\api.ts",[],[]]
0
Eval\client\modules\account-deduplication-dialog\node_modules\.cache
Eval\client\modules\account-deduplication-dialog\node_modules\.cache\stylelint-webpack-plugin\.stylelintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-deduplication-dialog\\src\\ui\\s-account-deduplication-dialog.vue":"1"},{"size":832,"mtime":1726737006358,"hashOfConfig":"2"},"10gefbv"]
0
Eval\client\modules\account-deduplication-dialog
Eval\client\modules\account-deduplication-dialog\src\index.ts
export { default } from './ui/s-account-deduplication-dialog.vue';
0
Eval\client\modules\account-deduplication-dialog
Eval\client\modules\account-deduplication-dialog\src\localization.json
{ "default": { "operationType-master-duplicate": "Master-duplicate", "operationType-exclude": "Exclude", "operationType-combine": "Combine", "operationType-remove": "Remove", "execute": "Execute", "operationType": "Operation Setup", "account": "Account", "inn": "INN", "okpo": "OKPO", "kpp": "RPP", "type": "Type", "modifyDate": "Modify date", "ogrn": "OGRN", "deduplication-executing": "Deduplication of selected accounts in progress", "error--master-duplicate-not-found": "Master-duplicate not specified", "error--combine-not-found": "None of the clients have selected the \"Combine\" operation", "warning-caption": "Check yourself" }, "ru-ru": { "operationType-master-duplicate": "Мастер-дубль", "operationType-exclude": "Исключить", "operationType-combine": "Объединить", "operationType-remove": "Удалить", "execute": "Выполнить", "operationType": "Настройка операции", "account": "Клиент", "inn": "ИНН", "okpo": "ОКПО", "kpp": "КПП", "type": "Тип", "modifyDate": "Изменен", "ogrn": "ОГРН", "deduplication-executing": "Выполняется дедубликация выбранных клиентов", "error--master-duplicate-not-found": "Не указан мастер-дубль", "error--combine-not-found": "Ни у одного клиента не выбрана операция \"Объединить\"", "warning-caption": "Проверьте данные" } }
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\presenter\account-deduplication-dialog-module.ts
import { useSemaphore } from '@fbc/core/storage'; import { EntityId } from '@fbc/types'; import { defineStore } from 'pinia'; import { computed, ref } from 'vue'; import api, { config } from '../services/api'; import { Account } from '../types/Account'; export const useAccountDeduplicationDialog = defineStore('account-deduplication-dialog', () => { const loading = useSemaphore(); const accounts = ref<Account[]>([]); const loadAccounts = async (keys: EntityId[]) => { loading.lock(); const [accountsError, accountsData = []] = await api.entities.where('accounts', x => config(x, keys), __filename); if (accountsError) return log.prod.error(__filename, accountsError), loading.unlock(), false; accounts.value = accountsData?.map(x => Object.assign(x, { operationType: 'combine' as const, }), ); loading.unlock(); return true; }; const load = async (keys: EntityId[]) => { const isLoaded = await loadAccounts(keys); if (!isLoaded) return false; setMasterDuplicate(); return true; }; const sortedAccounts = computed(() => [...accounts.value].sort(compareAccount)); const setMasterDuplicate = () => (sortedAccounts.value[0].operationType = 'master-duplicate'); const types = ['Клиент', 'Бывший клиент', 'Проспект']; const businessSizes = ['Крупный', 'Средний', 'Малый']; const compareAccount = (first: Account, second: Account) => { let indexA: number, indexB: number; [indexA, indexB] = [ types.indexOf(first.type?.toLowerCase() ?? ''), types.indexOf(second.type?.toLowerCase() ?? ''), ]; if (indexA !== indexB) return indexA > indexB ? 1 : -1; [indexA, indexB] = [ businessSizes.indexOf(first.businessSize?.toLowerCase() ?? ''), businessSizes.indexOf(second.businessSize?.toLowerCase() ?? ''), ]; if (indexA !== indexB) return indexA > indexB ? 1 : -1; return 0; }; const hasMasterRecord = computed(() => accounts.value.some(x => x.operationType === 'master-duplicate')); const hasCombineRecord = computed(() => accounts.value.some(x => x.operationType === 'combine')); const masterRecord = computed(() => accounts.value.find(x => x.operationType === 'master-duplicate') as Account); const combineRecords = computed(() => accounts.value.filter(x => x.operationType === 'combine') as Account[]); const removeRecords = computed(() => accounts.value.filter(x => x.operationType === 'remove') as Account[]); const startMergeDuplicatesJob = async () => { loading.lock(); const [error] = await api.web.post( 'accountDeduplicationController/job', { masterRecordId: masterRecord.value.id, mergeRecordIds: combineRecords.value.map(x => x.id), removeRecordIds: removeRecords.value.map(x => x.id), }, __filename, ); if (error) return log.prod.error(__filename, error), loading.unlock(), false; loading.unlock(); return true; }; return { loading, sortedAccounts, load, hasCombineRecord, hasMasterRecord, masterRecord, startMergeDuplicatesJob, }; });
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\services\api.ts
import { services } from '@fbc/core/services'; import { EntityId, OmitEntityBase } from '@fbc/types'; import { ODataQuery } from 'odata-fluent-query'; import { Account } from '../types/Account'; type AccountFrom = OmitEntityBase<Account, 'operationType'>; type ApiDtoMap = { accounts: { from: AccountFrom; to: Partial<Account>; interface: Account; }; }; export default { entities: new services.entitiesApi<ApiDtoMap>({}), web: new services.webApi< Record<never, never>, { 'accountDeduplicationController/job': { parameters: { masterRecordId: string; mergeRecordIds: string[]; removeRecordIds: string[] }; response: null; }; }, Record<never, never>, Record<never, never> >(), }; export const config = (odataQuery: ODataQuery<AccountFrom>, ids: EntityId[]) => odataQuery .select('id', 'personCode', 'name', 'kpp', 'inn', 'ogrn', 'okpo', 'type', 'modifyDate', 'businessSize') .filter(x => x.id.in(ids));
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\services\i18n.ts
import { services } from '@fbc/core/services'; import resources from '../localization.json'; export default (key: string, map?: Record<string, string | number>) => services.i18n.extract(resources, key, map);
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\types\Account.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; export type Account = { id: EntityId; operationType: 'master-duplicate' | 'exclude' | 'combine' | 'remove'; personCode: 'Corporate' | 'Individual' | 'Entrepreneur' | 'Private' | null; businessSize: string | null; name: string; type: string | null; inn: string | null; kpp: string | null; okpo: string | null; ogrn: string | null; } & EntityBase;
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\ui\s-account-deduplication-dialog.ts
import { services } from '@fbc/core/services'; import { getCachedModule } from '@fbc/core/utils'; import { EntityId } from '@fbc/types'; import { PropType, defineComponent, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'; import { useRouter } from 'vue-router'; import { useAccountDeduplicationDialog } from '../presenter/account-deduplication-dialog-module'; import local from '../services/i18n'; import { Account } from '../types/Account'; import { useAccountTable } from '../use-cases/account-table'; export default defineComponent({ name: 's-account-deduplication-dialog', props: { visible: { type: Boolean, default: false }, parameters: { type: Object as PropType<{ accountIds: string[] }>, default: () => ({ accountIds: [] }), }, }, emits: ['update:visible'], setup(props, { emit }) { const { toast, alert, i18n } = services; const router = useRouter(); const { module, unregister } = getCachedModule('account-deduplication-dialog', useAccountDeduplicationDialog); onUnmounted(() => { window.removeEventListener('resize', resizeModal); unregister(); }); const isProgressVisible = ref(false); const modalWidth = ref(600); onMounted(() => { resizeModal(); window.addEventListener('resize', resizeModal); emit('update:visible', true); }); const onCreated = async () => { await module.load(props.parameters.accountIds); }; watch(() => props.parameters.accountIds, onCreated, { immediate: true }); const mergeRecords = async () => { if (!isValid()) return false; if (!module.masterRecord) return await alert.warning(local('error--master-duplicate-not-found'), undefined, i18n.global('error')), false; isProgressVisible.value = true; const isStarted = await module.startMergeDuplicatesJob(); isProgressVisible.value = false; await nextTick(); return isStarted; }; const isValid = () => { const msg: string[] = []; if (!module.hasMasterRecord) msg.push(local('error--master-duplicate-not-found')); if (!module.hasCombineRecord) msg.push(local('error--combine-not-found')); if (msg.length) { alert.warning(msg.join('\n'), 500, local('warning-caption')); return false; } return true; }; function resizeModal() { modalWidth.value = Math.max(window.innerWidth * 0.68, 300); } const hide = () => emit('update:visible', false); const okClick = async () => { if (await mergeRecords()) { hide(); toast.saved(); } else { toast.notSaved(); } }; const changeOperationType = (account: Account, operationType: Account['operationType']) => { if (operationType === 'master-duplicate') { module.masterRecord && (module.masterRecord.operationType = 'combine'); } account.operationType = operationType; }; const onClickAccountCell = (entityId: EntityId) => { router.push({ name: 'account', params: { id: entityId } }); hide(); }; const { columns } = useAccountTable(changeOperationType, onClickAccountCell); return { local, okClick, module, hide, isProgressVisible, columns, modalWidth }; }, });
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\ui\s-account-deduplication-dialog.vue
<template> <s-modal :modelValue="visible" :caption="local('modal-caption')" :width="modalWidth" centralize> <template #default> <s-data-table v-model:columns="columns" :height="300" :loading="module.loading.isLocked" :items="module.sortedAccounts" allowResize allowSort idField="accountId" renderMode="endlessPaging" unfixedWidth /> <s-progress-modal v-model="isProgressVisible" :width="500" centralize> <p v-text="local('deduplication-executing')" /> </s-progress-modal> </template> <template #footer> <s-button success @click="okClick">{{ local('execute') }}</s-button> <s-button @click="hide">{{ $i18n.global('close') }}</s-button> </template> </s-modal> </template> <script lang="ts" src="./s-account-deduplication-dialog"></script>
0
Eval\client\modules\account-deduplication-dialog\src
Eval\client\modules\account-deduplication-dialog\src\use-cases\account-table.ts
import { defineFunctionalComponent, withTooltip } from '@fbc/core/utils'; import { DataTableColumn, EntityId } from '@fbc/types'; import { formatCellValue } from '@fbc/ui/components'; import { Component, PropType, computed, h, ref, resolveComponent } from 'vue'; import i18n from '../services/i18n'; import { Account } from './../types/Account'; export function useAccountTable( changeRowOperationFunction: (entity: Account, value: Account['operationType']) => void, accountCellOnClick: (entityId: EntityId) => void, ) { const selectMargins = { marginTop: 'var(--xs)', marginBottom: 'var(--xs)', marginRight: 'var(--xs)' }; const operationTypeTemplate = () => defineFunctionalComponent({ entity: { type: Object as PropType<Account>, required: true } }, ({ entity }) => h(resolveComponent('s-select') as Component, { style: selectMargins, labelField: 'label', modelValue: operationType.value.find(x => x.value === entity.operationType), narrow: true, noLabel: true, options: operationType.value, 'onUpdate:modelValue': ({ value }: { value: Account['operationType'] }) => changeRowOperationFunction(entity, value), }), ); const commonTemplate = () => defineFunctionalComponent( { entity: { type: Object as PropType<Account>, required: true }, column: Object as PropType<Partial<DataTableColumn> & { field: keyof Account }>, }, ({ entity, column }) => withTooltip( h('span', { class: 'text-ellipsis' }, formatCellValue(entity, column.field, column.formatter) ?? ''), formatCellValue(entity, column.field, column.formatter) ?? '', { showOnlyIfOverflown: true, top: true, }, ), ); const linkTemplate = () => defineFunctionalComponent( { entity: Object as PropType<Account>, column: Object as PropType<Partial<DataTableColumn> & { field: keyof Account }>, index: Number, }, ({ entity, column }) => entity ? withTooltip( h('a', { class: 'text-ellipsis', onClick: () => accountCellOnClick(entity.id), textContent: entity.name ?? '', }), formatCellValue(entity, column.field, column.formatter) ?? '', { top: true, }, ) : undefined, ); const operationType = computed((): { value: Account['operationType']; label: string }[] => [ { value: 'master-duplicate', label: i18n('operationType-master-duplicate') }, { value: 'exclude', label: i18n('operationType-exclude') }, { value: 'combine', label: i18n('operationType-combine') }, { value: 'remove', label: i18n('operationType-remove') }, ]); const columns = ref<Partial<DataTableColumn>[]>([ { field: 'operationType', caption: i18n('operationType'), sortable: false, width: 190, cellTemplate: operationTypeTemplate(), }, { field: 'name', caption: i18n('account'), width: 180, cellTemplate: linkTemplate() }, { field: 'type', caption: i18n('type'), cellTemplate: commonTemplate() }, { field: 'inn', caption: i18n('inn'), cellTemplate: commonTemplate() }, { field: 'kpp', caption: i18n('kpp'), cellTemplate: commonTemplate() }, { field: 'okpo', caption: i18n('okpo'), cellTemplate: commonTemplate() }, { field: 'ogrn', caption: i18n('ogrn'), cellTemplate: commonTemplate() }, { field: 'modifyDate', caption: i18n('modifyDate'), cellTemplate: commonTemplate() }, ]); return { columns, linkTemplate, commonTemplate, operationTypeTemplate }; }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur\jest.config.js
module.exports = { ...require('../../configs/jest.config.base'), };
0
Eval\client\modules
Eval\client\modules\account-entrepreneur\manifest.json
{ "$schema": "../../module.schema.json", "version": "1.1.9", "name": "account-entrepreneur", "type": "Page" }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur\package.json
{ "name": "@fbc/account-entrepreneur", "version": "1.0.0", "description": "", "main": "src/index.ts", "directories": { "test": "tests" }, "scripts": { "dev": "webpack --watch --mode development", "build": "webpack --mode production", "build:analytics": "webpack --mode production --env BUNDLE_ANALYTICS", "eslint": "eslint --config ../../configs/.eslintrc.base.mjs --cache src", "lint-next": "node ./.eslint.next.js", "lint-next:code": "node ./.eslint.next.js --code", "lint-next:style": "node ./.eslint.next.js --style", "test": "jest --passWithNoTests", "test:ci": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit", "prettier": "prettier --config ../../.prettierrc --write \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "stylelint": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.base.json --cache --allow-empty-input", "typecheck": "tsc --noEmit", "duplicates": "jscpd src -l 15 -x 9999 --ignore \"../../libs/types/Api/DataMethods.d.ts,**/*.spec.ts,**/*.json\"" }, "author": "" }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur\tsconfig.json
{ "extends": "../../configs/tsconfig.base", "include": ["./src/**/*", "../../global.d.ts", "../../vue-shim.d.ts", "../../vue.d.ts"] }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur\webpack.config.js
const { moduleBaseConfig } = require('../../configs/webpack.config.base'); module.exports = moduleBaseConfig('account-entrepreneur');
0
Eval\client\modules\account-entrepreneur\node_modules\.cache
Eval\client\modules\account-entrepreneur\node_modules\.cache\eslint-webpack-plugin\.eslintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\index.ts":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\ui\\s-account-entrepreneur-details.vue":"2","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\ui\\s-account-entrepreneur-details.ts":"3","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\services\\api.ts":"4","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\presenter\\account-entrepreneur-module.ts":"5"},{"size":68,"mtime":1713084078840,"results":"6","hashOfConfig":"7"},{"size":6697,"mtime":1716795874831,"results":"8","hashOfConfig":"7"},{"size":2749,"mtime":1716372794326,"results":"9","hashOfConfig":"7"},{"size":1426,"mtime":1713084078841,"results":"10","hashOfConfig":"7"},{"size":4863,"mtime":1716372794302,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","suppressedMessages":"14","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"16xfsug",{"filePath":"15","messages":"16","suppressedMessages":"17","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","suppressedMessages":"20","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"21","messages":"22","suppressedMessages":"23","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","suppressedMessages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\index.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\ui\\s-account-entrepreneur-details.vue",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\ui\\s-account-entrepreneur-details.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\services\\api.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\presenter\\account-entrepreneur-module.ts",[],[]]
0
Eval\client\modules\account-entrepreneur\node_modules\.cache
Eval\client\modules\account-entrepreneur\node_modules\.cache\stylelint-webpack-plugin\.stylelintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\ui\\s-account-entrepreneur-details.scss":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur\\src\\ui\\s-account-entrepreneur-details.vue":"2"},{"size":2773,"mtime":1718351750174,"hashOfConfig":"3"},{"size":6687,"mtime":1726737006366,"hashOfConfig":"3"},"1dnpjin"]
0
Eval\client\modules\account-entrepreneur
Eval\client\modules\account-entrepreneur\src\index.ts
export { default } from './ui/s-account-entrepreneur-details.vue';
0
Eval\client\modules\account-entrepreneur
Eval\client\modules\account-entrepreneur\src\localization.json
{ "default": { "entity": "Account [IE]", "fio": "Full name", "gender": "Gender", "division": "Division", "manager": "Manager", "inn": "TIN", "ogrn": "OGRN", "okpo": "OKPO", "okopf": "OKOPF", "okved": "OKVED", "column-name": "Name", "column-division": "Division", "confirm-delete": "Are you sure you want to delete this account?", "empty-error": "Required filed", "phone": "Phone", "email": "Email", "webAddress": "Web address", "incorrect": "Incorrect" }, "ru-ru": { "entity": "Клиент [ИП]", "fio": "ФИО", "gender": "Пол", "division": "Подразделение", "manager": "Менеджер", "inn": "ИНН", "ogrn": "ОГРН", "okpo": "OKПO", "okopf": "ОКОПФ", "okved": "ОКВЭД", "column-name": "Наименование", "column-division": "Подразделение", "confirm-delete": "Вы уверены что хотите удалить этого клиента?", "empty-error": "Обязательное поле", "phone": "Телефон", "email": "Email", "webAddress": "Сайт", "incorrect": "Некорректный" } }
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\presenter\account-entrepreneur-module.ts
import { services } from '@fbc/core/services'; import { useEntityStore } from '@fbc/core/storage'; import { EntityId } from '@fbc/types'; import { defineStore } from 'pinia'; import { reactive } from 'vue'; import resources from '../localization.json'; import api from '../services/api'; import { UserBusinessRole } from '../types/UserBusinessRole'; export const useAccountEntrepreneur = defineStore('account', () => { const { store, store: { user: { hasAccess }, }, bus, } = services; const okvedMap = reactive(new Map<string, string>()); const loadOkvedInfo = (code: string) => api.web .get('picklist/itemByCode', { name: 'ОКВЭД2', code }, __filename) .then(x => (x[1] ? okvedMap.set(x[1].code, x[1].text) : log.prod.error(__filename, x[0]))); const entityStore = useEntityStore(api.entities, 'accounts', __filename, { odataConfig: { select: [ 'id', 'personCode', 'gender', 'firstName', 'lastName', 'middleName', 'name', 'divisionId', 'managerId', 'phone', 'email', 'webAddress', 'inn', 'ogrn', 'okpo', 'okopf', 'modifyUser', 'modifyDate', ], expand: [ 'manager/shortName', 'manager/id', 'division/name', 'division/id', 'okveds/id', 'okveds/okved', 'okveds/isPrimary', ], }, getDisplayName: entity => entity.name ?? null, onEntityLoaded(entity) { if (!store) return; store.title = [store.defaultTitle.at(0), services.i18n.extract(resources, 'entity'), entity.name]; store.description = entity.name ?? ''; if (!entity.okved || okvedMap.has(entity.okved)) return; loadOkvedInfo(entity.okved); }, }); const canEdit = hasAccess('Entities/Account/Edit'); const canDelete = hasAccess('Entities/Account/Delete'); const isCommunicationChannelVisible = hasAccess('Entities/Account/Tab/ContactInfo/CommChannels/View'); const isCommunicationChannelEditable = hasAccess('Entities/Account/Tab/ContactInfo/CommChannels/Edit'); const isCommunicationChannel = (x: unknown): x is { entityId: EntityId; entity: string; isPrimary: boolean } => Boolean(typeof x === 'object' && x && 'entityId' in x && 'entity' in x && 'isPrimary' in x); const isAccountOkved = (x: unknown): x is { okved: string; isPrimary: boolean } => Boolean(typeof x === 'object' && x && 'okved' in x && 'isPrimary' in x); const onCommunicationChannelChanged = (communicationChannel: unknown) => { if ( !isCommunicationChannel(communicationChannel) || communicationChannel.entity !== 'Account' || entityStore.entity.value?.id !== communicationChannel.entityId || !communicationChannel.isPrimary ) return; entityStore.load(communicationChannel.entityId); }; const onManagerChanged = (value: UserBusinessRole | null) => { if (!entityStore.entity.value) return; entityStore.entity.value.manager = value?.user ?? null; entityStore.entity.value.managerId = value?.userId ?? null; entityStore.entity.value.division = value?.division ?? null; entityStore.entity.value.divisionId = value?.division?.id ?? null; }; const onAccountOkvedChange = async (x: unknown) => { if (!entityStore.entity.value?.id || !isAccountOkved(x) || !x.isPrimary) return; const [error, [okved] = []] = await api.entities.where( 'accountOkveds', { filter: [ { fieldName: 'isPrimary', operator: 'eq', value: true }, { fieldName: 'accountId', operator: 'eq', value: `'${entityStore.entity.value.id}'` }, ], select: ['okved'], }, __filename, ); if (error) log.prod.error(__filename, error); else if (okved) { entityStore.entity.value.okved = okved.okved; entityStore.updateStack.value = entityStore.updateStack.value.filter(x => x[0] !== 'okved'); loadOkvedInfo(okved.okved); } }; bus.on('/entity/accountOkved/created', onAccountOkvedChange); bus.on('/entity/accountOkved/deleted', onAccountOkvedChange); bus.on(`/entity/communicationChannel/created`, onCommunicationChannelChanged); bus.on(`/entity/communicationChannel/updated`, onCommunicationChannelChanged); bus.on(`/entity/communicationChannel/deleted`, onCommunicationChannelChanged); function unregister() { bus.off('/entity/accountOkved/created', onAccountOkvedChange); bus.off('/entity/accountOkved/deleted', onAccountOkvedChange); bus.off('/entity/communicationChannel/created', onCommunicationChannelChanged); bus.off('/entity/communicationChannel/updated', onCommunicationChannelChanged); bus.off('/entity/communicationChannel/deleted', onCommunicationChannelChanged); } return { ...entityStore, canEdit, canDelete, onManagerChanged, unregister, okvedMap, isCommunicationChannelVisible, isCommunicationChannelEditable, }; });
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\services\api.ts
import { services } from '@fbc/core/services'; import type { EntityId, OmitEntityBase, SimpleEntity } from '@fbc/types'; import type { Account } from '../types/Account'; import type { Division } from '../types/Division'; import type { UserBusinessRole } from '../types/UserBusinessRole'; type ApiDtoMap = { accounts: { from: OmitEntityBase<Account, 'okved'> & { okveds: { okved: string }[]; }; to: Partial<Account>; interface: Account; }; accountOkveds: SimpleEntity<{ id: EntityId; okved: string; isPrimary: boolean; accountId: EntityId }>; divisions: SimpleEntity<Division>; userBusinessRoles: SimpleEntity<UserBusinessRole>; }; const entities = new services.entitiesApi<ApiDtoMap>({ accounts: { from: entity => ({ okved: entity.okveds?.at(0)?.okved, }), to: account => ({ ...account, division: undefined, manager: undefined, okved: undefined, managerId: account.managerId ?? account.manager?.id, divisionId: account.divisionId ?? account.division?.id, }), }, }); export default { entities, web: new services.webApi< { 'picklist/itemByCode': { parameters: { name: string; code: string }; response: { code: string; text: string; }; }; }, Record<never, never>, Record<never, never>, Record<never, never> >(), };
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\types\Account.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import type { Division } from './Division'; import type { User } from './User'; export type Account = EntityBase & { id: EntityId | null; personCode: 'Entrepreneur' | null; gender: string | null; firstName: string | null; lastName: string | null; middleName: string | null; name: string | null; divisionId: EntityId | null; division: Division | null; managerId: EntityId | null; manager: User | null; phone: string | null; email: string | null; webAddress: string | null; inn: string | null; ogrn: string | null; okpo: string | null; okopf: string | null; photoId: string | null; // Заполняется из зависимых сущностей, readonly okved?: string | null; };
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\types\Division.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; export type Division = EntityBase & { id: EntityId; name: string; };
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\types\User.d.ts
import type { EntityId } from '@fbc/types'; export type User = { id: EntityId; shortName: string; };
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\types\UserBusinessRole.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import type { Division } from './Division'; import type { User } from './User'; export type UserBusinessRole = EntityBase & { id: EntityId; userId: EntityId | null; user?: User | null; businessRole: string | null; divisionId: EntityId | null; division: Division | null; };
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\ui\s-account-entrepreneur-details.scss
@layer modules { .root { display: grid; grid-template-columns: 350px 350px 1fr; grid-template-areas: 'contrast contrast contrast' 'inn communication okopf'; grid-column-gap: var(--sm); grid-row-gap: var(--sm); margin-inline: var(--sm); margin-top: var(--sm); @media screen and (width < 1366px) { .name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; } } @media screen and (width <= 1366px) { grid-template-columns: 1fr 1fr; grid-template-areas: 'contrast contrast' 'inn communication' 'okopf okopf'; } @media screen and (width <= 600px) { display: flex; flex-direction: column; } .contrast { grid-area: contrast; display: flex; flex-direction: column; gap: var(--sm); } .header { margin: 0; > li { > label { > :first-child { color: var(--disabled); } :last-child { text-overflow: ellipsis; min-height: 18px; white-space: nowrap; } } } } .notification { padding-left: 0; margin: 0; } section { display: grid; align-items: center; gap: var(--xs); label { display: grid; grid-template-columns: 120px auto; align-items: center; span:first-child { color: var(--disabled); } } :global(.s-property) { align-items: center; min-height: 32px; :global(.s-property__readonly) { justify-content: start; } } :global(.s-placeholder) { height: 32px; } } .inn-section { grid-area: inn; label, :global(.s-property) { display: grid; grid-template-columns: 70px auto; } } .communication-section { grid-area: communication; label { grid-template-columns: 120px auto; } a { word-break: break-word; } } .okopf-section { grid-area: okopf; :global(.s-property) { display: grid; grid-template-columns: 70px auto; height: 32px; } .okved-property :global(.s-property__readonly) > span { color: var(--on-surface); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; } } div.photo { --photo-size: 60px; --photo-delete-size: 14px; --photo-delete-top: 10px; --photo-delete-right: -10px; align-items: center; &:global(.photo__s-photo .photo__s-photo__img) { border-radius: 50%; } &:global(.photo__s-photo.photo__s-photo__empty i) { color: var(--on-contrast-icon); font-size: var(--icon-md); background-color: transparent; } :global(.s-placeholder) { background: transparent; } } } }
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\ui\s-account-entrepreneur-details.ts
import { services } from '@fbc/core/services'; import { getCachedModule } from '@fbc/core/utils'; import type { EntityId, FullODataConfig, LookupColumn } from '@fbc/types'; import { computed, defineComponent, onUnmounted, ref, watch } from 'vue'; import { useRouter } from 'vue-router'; import resource from '../localization.json'; import { useAccountEntrepreneur } from '../presenter/account-entrepreneur-module'; import api from '../services/api'; import { Account } from '../types/Account'; import { UserBusinessRole } from '../types/UserBusinessRole'; export default defineComponent({ name: 'account-entrepreneur', props: { entityId: { type: String, required: true }, entityName: { type: String, required: true }, }, setup(props) { const { i18n, confirm, toast, bus, alert } = services; const local = (value: string) => i18n.extract(resource, value); const { module, unregister } = getCachedModule('account', useAccountEntrepreneur); onUnmounted(unregister); watch( () => props.entityId, () => module.load(props.entityId), { immediate: true, }, ); const entity = computed<Partial<Account>>(() => module.entity ?? {}); const router = useRouter(); const saveAccount = async () => { const isSaved = await module.save({ needToSwitchLoading: false }); if (isSaved) toast.saved(); else toast.notSaved(); }; const deleteAccount = async () => { if (!(await confirm.delete(local('confirm-delete'), 350))) return; const [error, success] = await module.delete(); if (success) { router.replace({ name: 'account' }); toast.deleted(); return; } if (error) log.prod.error(__filename, error); if (error?.innerException?.message) alert.error(error.innerException.message); else toast.notDeleted(); }; const savePhoto = (photoId: EntityId | null) => { if (!module.entity) return; module.entity.photoId = photoId; return module.save(); }; const onManagerChanged = async (manager: UserBusinessRole | null) => { module.onManagerChanged(manager); const isSaved = await module.partialSave(['managerId', 'divisionId'], ['manager', 'division']); if (isSaved) { toast.saved(); bus.emit(`/entity/${props.entityName}/managerChanged`, manager); } else toast.notSaved(); }; const divisionConfig: FullODataConfig = { select: ['id', 'name'], filter: [ { fieldName: 'parentId', operator: 'ne', value: 'null', }, ], }; const divisionColumns = ref<LookupColumn[]>([ { field: 'id', filter: 'text', visible: false, }, { field: 'name', caption: local('column-name'), filter: 'text', isDisplayName: true, }, ]); const toolbar = computed(() => ({ left: [ { visible: module.entity?.modifyDate, slot: 'left-1' }, { visible: true, showOnMobile: true, slot: 'left-2' }, ], right: [ { visible: module.canDelete, text: services.i18n.global('delete'), onlyIcon: true, icon: 'fb-common-recycle-bin', action: deleteAccount, }, ], })); return { local, entity, api, savePhoto, saveAccount, deleteAccount, module, divisionColumns, divisionConfig, onManagerChanged, toolbar, }; }, });
0
Eval\client\modules\account-entrepreneur\src
Eval\client\modules\account-entrepreneur\src\ui\s-account-entrepreneur-details.vue
<template> <div :class="$style.root"> <s-main-content-toolbar v-bind="toolbar"> <template #left-1="{ disposition }"> <s-page v-if="module.entity?.modifyDate" name="common-modified-by" optional :modifyUser="module.entity.modifyUser" :modifyDate="module.entity.modifyDate" :style="disposition === 'menu' ? 'width: 180px;' : undefined" /> </template> <template #left-2> <s-page name="entity-users-widget" :entityId="entityId" :entityName="entityName" /> </template> </s-main-content-toolbar> <div :class="$style.contrast"> <ul v-container:contrast :class="$style.header"> <li> <s-placeholder v-if="module.loading.isLocked" contrast /> <s-page v-else v-model="entity.photoId" name="photo" :class="$style.photo" :readonly="!module.canEdit" :save="savePhoto" :placeholder="{ props: { contrast: true, style: 'width: 56px;background: transparent' } }" /> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('fio') }}</template> <template #readonly> <div v-tooltip.showOnlyIfOverflown="entity.name" :class="$style.name">{{ entity.name }}</div> </template> <s-fullname v-model:firstName="entity.firstName" v-model:lastName="entity.lastName" v-model:middleName="entity.middleName" :firstNameMaxLength="32" :middleNameMaxLength="32" :lastNameMaxLength="32" firstNameRequired lastNameRequired @click:ok="saveAccount" /> </s-property> </li> <li> <i class="fb-common-card" /> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('gender') }}</template> <template #readonly>{{ entity.gender }}</template> <s-picklist v-model="entity.gender" :class="$style.gender" picklistName="Пол" placeholderContrast @update:modelValue="saveAccount" /> </s-property> </li> <li> <i class="fb-entities-user" /> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('manager') }}</template> <template #readonly>{{ entity.manager?.shortName }}</template> <s-page :modelValue="{ user: entity.manager, division: entity.division, }" name="manager-lookup" entityName="Account" contrast :placeholder="{ props: { contrast: true } }" @update:modelValue="onManagerChanged" /> </s-property> </li> <li> <i class="fb-entities-division" /> <s-property contrast :loading="module.loading.isLocked" :readonly="!module.canEdit"> <template #label>{{ local('division') }}</template> <template #readonly>{{ entity.division?.name }}</template> <s-odata-lookup v-model:columns="divisionColumns" :modelValue="entity.division" :parameters="{ api: api.entities, key: 'divisions', config: divisionConfig }" idField="id" :caption="local('division')" readonly @update:modelValue="saveAccount" /> </s-property> </li> </ul> <s-page name="entity-notification-widget" :entityId="entityId" entityName="Account" :class="$style.notification" /> </div> <section v-container :class="$style['inn-section']"> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit" @click="$event.preventDefault()"> <template #label>{{ local('inn') }}</template> <template #readonly>{{ entity.inn }}</template> <s-codetext v-model="entity.inn" codeType="InnIndividual" @update:modelValue="saveAccount" /> </s-property> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit" @click="$event.preventDefault()"> <template #label>{{ local('ogrn') }}</template> <template #readonly>{{ entity.ogrn }}</template> <s-codetext v-model="entity.ogrn" codeType="Ogrn" @update:modelValue="saveAccount" /> </s-property> <s-property :loading="module.loading.isLocked" :readonly="!module.canEdit" @click="$event.preventDefault()"> <template #label>{{ local('okpo') }}</template> <template #readonly>{{ entity.okpo }}</template> <s-codetext v-model="entity.okpo" codeType="Okpo" @update:modelValue="saveAccount" /> </s-property> </section> <section v-container :class="$style['communication-section']"> <s-property :loading="module.loading.isLocked"> <template #label>{{ local('phone') }}</template> <s-page v-model="entity.phone" :class="$style.phone" name="communication-channel-add-edit" channelType="Контактный телефон" :entityName="entityName" :entityId="entityId" :readonly="!module.canEdit || !module.isCommunicationChannelEditable" :isValueHidden="!module.isCommunicationChannelVisible" /> </s-property> <s-property :loading="module.loading.isLocked"> <template #label>{{ local('email') }}</template> <s-page v-model="entity.email" :class="$style.email" name="communication-channel-add-edit" channelType="E-mail" :entityName="entityName" :entityId="entityId" :readonly="!module.canEdit || !module.isCommunicationChannelEditable" :isValueHidden="!module.isCommunicationChannelVisible" /> </s-property> <s-property :loading="module.loading.isLocked"> <template #label>{{ local('webAddress') }}</template> <s-page v-model="entity.webAddress" name="communication-channel-add-edit" channelType="Web-адрес" :entityName="entityName" :entityId="entityId" :readonly="!module.canEdit || !module.isCommunicationChannelEditable" :isValueHidden="!module.isCommunicationChannelVisible" /> </s-property> </section> <section v-container :class="$style['okopf-section']"> <s-property :loading="module.loading.isLocked" readonly> <template #label>{{ local('okopf') }}</template> <template #readonly>{{ entity.okopf }}</template> </s-property> <s-property :class="$style['okved-property']" :loading="module.loading.isLocked" readonly> <template #label>{{ local('okved') }}</template> <template #readonly> <span v-tooltip.showOnlyIfOverflown="entity.okved + ' ' + module.okvedMap.get(entity.okved!)"> {{ entity.okved }} {{ module.okvedMap.get(entity.okved!) }} </span> </template> </s-property> </section> </div> </template> <script lang="ts" src="./s-account-entrepreneur-details.ts"></script> <style lang="scss" src="./s-account-entrepreneur-details.scss" module></style>
0
Eval\client\modules
Eval\client\modules\account-entrepreneur-insert\jest.config.js
module.exports = { ...require('../../configs/jest.config.base'), };
0
Eval\client\modules
Eval\client\modules\account-entrepreneur-insert\manifest.json
{ "$schema": "../../module.schema.json", "version": "1.2.5", "name": "account-entrepreneur-insert", "type": "Dialog", "header": { "icon": "fb-entities-account", "link": { "$type": "dialog", "path": "account-entrepreneur-insert" }, "group": "mnuNew", "securedAction": "Entities/AccountEntrepreneur/Add", "order": 2, "text": { "default": "Individual entrepreneur", "ru-ru": "Индивидуального предпринимателя" } } }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur-insert\package.json
{ "name": "@fbc/account-entrepreneur-insert", "version": "1.0.0", "description": "", "main": "src/index.ts", "directories": { "test": "tests" }, "scripts": { "dev": "webpack --watch --mode development", "build": "webpack --mode production", "build:analytics": "webpack --mode production --env BUNDLE_ANALYTICS", "eslint": "eslint --config ../../configs/.eslintrc.base.mjs --cache src", "lint-next": "node ./.eslint.next.js", "lint-next:code": "node ./.eslint.next.js --code", "lint-next:style": "node ./.eslint.next.js --style", "test": "jest --passWithNoTests", "test:ci": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit", "prettier": "prettier --config ../../.prettierrc --write \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "stylelint": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.base.json --cache --allow-empty-input", "typecheck": "tsc --noEmit", "duplicates": "jscpd src -l 15 -x 9999 --ignore \"../../libs/types/Api/DataMethods.d.ts,**/*.spec.ts,**/*.json\"" }, "author": "" }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur-insert\tsconfig.json
{ "extends": "../../configs/tsconfig.base", "include": ["./src/**/*", "../../global.d.ts", "../../vue-shim.d.ts", "../../vue.d.ts"] }
0
Eval\client\modules
Eval\client\modules\account-entrepreneur-insert\webpack.config.js
const { moduleBaseConfig } = require('../../configs/webpack.config.base'); module.exports = moduleBaseConfig('account-entrepreneur-insert');
0
Eval\client\modules\account-entrepreneur-insert\node_modules\.cache
Eval\client\modules\account-entrepreneur-insert\node_modules\.cache\eslint-webpack-plugin\.eslintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\index.ts":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\ui\\s-account-entrepreneur-insert.vue":"2","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\ui\\s-account-entrepreneur-insert.ts":"3","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\presenter\\account-entrepreneur-insert-module.ts":"4","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\services\\api.ts":"5"},{"size":67,"mtime":1713084078833,"results":"6","hashOfConfig":"7"},{"size":7739,"mtime":1726737006361,"results":"8","hashOfConfig":"9"},{"size":2357,"mtime":1727428984034,"results":"10","hashOfConfig":"7"},{"size":4017,"mtime":1727428915190,"results":"11","hashOfConfig":"7"},{"size":2000,"mtime":1727428870480,"results":"12","hashOfConfig":"7"},{"filePath":"13","messages":"14","suppressedMessages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1vnpb99",{"filePath":"16","messages":"17","suppressedMessages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1vptld6",{"filePath":"19","messages":"20","suppressedMessages":"21","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","suppressedMessages":"24","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","suppressedMessages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\index.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\ui\\s-account-entrepreneur-insert.vue",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\ui\\s-account-entrepreneur-insert.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\presenter\\account-entrepreneur-insert-module.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\services\\api.ts",[],[]]
0
Eval\client\modules\account-entrepreneur-insert\node_modules\.cache
Eval\client\modules\account-entrepreneur-insert\node_modules\.cache\stylelint-webpack-plugin\.stylelintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-entrepreneur-insert\\src\\ui\\s-account-entrepreneur-insert.vue":"1"},{"size":7739,"mtime":1726737006361,"hashOfConfig":"2"},"10gefbv"]
0
Eval\client\modules\account-entrepreneur-insert
Eval\client\modules\account-entrepreneur-insert\src\index.ts
export { default } from './ui/s-account-entrepreneur-insert.vue';
0
Eval\client\modules\account-entrepreneur-insert
Eval\client\modules\account-entrepreneur-insert\src\localization.json
{ "default": { "modalCaption": "Creating account entrepreneur", "fio": "Full name", "gender": "Gender", "manager": "Manager", "division": "Division", "inn": "TIN", "ogrn": "OGRN", "okpo": "OKPO", "okopf": "OKOPF", "code": "Code", "okved": "OKVED", "phone": "Phone", "email": "Email", "webAddress": "Web address", "search-account-from-external-source": "Search from external source", "enter-inn-for-search": "To search, you need enter INN" }, "ru-ru": { "modalCaption": "Создание индивидуального предпринимателя", "fio": "ФИО", "gender": "Пол", "manager": "Менеджер", "division": "Подразделение", "inn": "ИНН", "ogrn": "ОГРН", "okpo": "ОКПО", "okopf": "ОКОПФ", "code": "Код", "okved": "ОКВЭД", "phone": "Телефон", "email": "Email", "webAddress": "Сайт", "search-account-from-external-source": "Выполнить поиск в ИС", "enter-inn-for-search": "Для поиска необходимо ввести ИНН" } }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\presenter\account-entrepreneur-insert-module.ts
import { services } from '@fbc/core/services'; import { useSemaphore } from '@fbc/core/storage'; import { defineStore } from 'pinia'; import { computed, ref } from 'vue'; import api from '../services/api'; import { IAccountEntrepreneur } from '../types/IAccountEntrepreneur'; import { IUserBusinessRole } from '../types/IUserBusinessRole'; export const useAccountEntrepreneurInsert = defineStore('account-entrepreneur-insert', () => { const loading = useSemaphore(); const entity = ref<IAccountEntrepreneur>(); const { store } = services; const template = async () => { if (!store.user.user?.id) return; loading.lock(); const [error, entityTemplate] = await api.entities.template('accounts'); loading.unlock(); if (error) log.prod.error(__filename, error); if (!entityTemplate) { entity.value = undefined; return; } entity.value = entityTemplate; entity.value.personCode = 'Entrepreneur'; entity.value.okopf = 'Индивидуальные предприниматели'; }; const save = async () => { if (!entity.value) return; loading.lock(); const [error, createdAccount] = await api.entities.create('accounts', entity.value, __filename); if (error ?? !createdAccount) return log.prod.error(__filename, error), loading.unlock(), undefined; loading.unlock(); return createdAccount.id; }; const isValid = computed( () => entity.value?.firstName && entity.value.lastName && entity.value.gender && entity.value.inn && entity.value.phone, ); const onManagerChanged = (value: IUserBusinessRole | null) => { if (!entity.value) return; entity.value.manager = value?.user ?? null; entity.value.managerId = value?.user?.id ?? null; entity.value.division = value?.division ?? null; entity.value.divisionId = value?.division?.id ?? null; }; const maxLengthMap = new Map<keyof IAccountEntrepreneur, number>([ ['firstName', 32], ['middleName', 32], ['lastName', 32], ]); const searchFromExternalSource = async () => { if (!entity.value?.inn) return; loading.lock(); const [error, account] = await api.web.get('adapters/account/info', { inn: entity.value.inn }, __filename); loading.unlock(); if (error) log.prod.error(__filename, error); const [okfsPicklist, okopfPicklist, okvedPicklist] = await store.picklists.loadMultiple( ['ОКФС', 'ОКОПФ', 'ОКВЭД2'], __filename, ); const okfs = okfsPicklist?.items.find(x => x.code === account?.okfs)?.text ?? ''; const okopf = okopfPicklist?.items.find(x => x.code === account?.okopf)?.text ?? ''; const primaryOkved = account?.okveds?.find(x => x.isPrimary); const okved = primaryOkved ? { itemCode: primaryOkved.okved, itemName: okvedPicklist?.items.find(x => x.code === primaryOkved.okved)?.text ?? '', } : undefined; entity.value = { ...entity.value, ...account, okfs, okopf, okved, }; }; const onPrimaryOkvedChanged = (okved: IAccountEntrepreneur['okved']) => { if (!entity.value) return; entity.value.okved = okved; const primaryOkved = entity.value?.okveds?.find(x => x.isPrimary); if (!entity.value.okveds) entity.value.okveds = []; if (!primaryOkved) { entity.value.okveds?.push({ okved: okved?.itemCode ?? '', isPrimary: true, accountId: '' }); return; } primaryOkved.okved = okved?.itemCode ?? ''; }; return { entity, template, save, loading, isValid, onManagerChanged, maxLengthMap, searchFromExternalSource, onPrimaryOkvedChanged, }; });
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\services\api.ts
import { services } from '@fbc/core/services'; import { isTruthy } from '@fbc/core/utils'; import type { EntityId, OmitEntityBase, SimpleEntity } from '@fbc/types'; import type { IAccountEntrepreneur } from '../types/IAccountEntrepreneur'; import type { IDivision } from '../types/IDivision'; import type { IUserBusinessRole } from '../types/IUserBusinessRole'; const web = new services.webApi< { 'adapters/account/info': { parameters: { inn: string }; response: Pick< IAccountEntrepreneur, 'inn' | 'ogrn' | 'lastName' | 'firstName' | 'middleName' | 'okpo' | 'okfs' | 'okopf' | 'status' | 'okveds' >; }; }, Record<never, never>, Record<never, never>, Record<never, never> >(); type ApiDtoMap = { accounts: { from: OmitEntityBase<IAccountEntrepreneur>; to: Omit<Partial<IAccountEntrepreneur>, 'okved'> & { okveds: { okved: string; isPrimary: boolean }[]; }; interface: IAccountEntrepreneur; }; divisions: SimpleEntity<IDivision>; userBusinessRoles: SimpleEntity<IUserBusinessRole>; picklistItems: SimpleEntity<{ itemName: string; itemCode: string; id: EntityId }>; }; const entities = new services.entitiesApi<ApiDtoMap>({ accounts: { from: () => ({}), to: account => ({ ...account, name: '', division: undefined, manager: undefined, okved: undefined, contacts: undefined, addresses: undefined, phoneEntity: undefined, emailEntity: undefined, webAddressEntity: undefined, communicationChannels: [account.phoneEntity, account.emailEntity, account.webAddressEntity] .filter(isTruthy) .map(x => Object.assign(x, { entity: '', entityId: '', }), ), okveds: account.okveds?.map(x => ({ ...x, accountId: '' })), managerId: account.managerId ?? account.manager?.id, divisionId: account.divisionId ?? account.division?.id, }), }, }); export default { web, entities, };
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\types\IAccountEntrepreneur.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import { ICommunicationChannel } from './ICommunicationChannel'; import type { IDivision } from './IDivision'; import { IOkved } from './IOkved'; import type { IUser } from './IUser'; export interface IAccountEntrepreneur extends EntityBase { id: EntityId | null; personCode: 'Entrepreneur' | null; gender: string | null; firstName: string | null; lastName: string | null; middleName: string | null; divisionId: EntityId | null; division: IDivision | null; managerId: EntityId | null; manager: IUser | null; phone: string | null; phoneEntity?: ICommunicationChannel; // Fake поле email: string | null; emailEntity?: ICommunicationChannel; // Fake поле webAddress: string | null; webAddressEntity?: ICommunicationChannel; // Fake поле status: string | null; inn: string | null; ogrn: string | null; okpo: string | null; okopf: string | null; okfs: string | null; okveds?: IOkved[]; // Fake поле okved?: { itemName: string; itemCode: string }; }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\types\ICommunicationChannel.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; export interface ICommunicationChannel extends EntityBase { id?: EntityId; channelType: string; channelSubType: string | null; isPrimary: boolean; channelValue: string | null; createSource: string | null; notes: string | null; entityId: EntityId; }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\types\IDivision.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; export interface IDivision extends EntityBase { id: EntityId; name: string; }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\types\IOkved.d.ts
import { EntityId } from '@fbc/types'; export interface IOkved { okved: string; isPrimary: boolean; accountId: EntityId; }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\types\IUser.d.ts
import type { EntityId } from '@fbc/types'; export interface IUser { id: EntityId; shortName: string; }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\types\IUserBusinessRole.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import type { IDivision } from './IDivision'; import type { IUser } from './IUser'; export interface IUserBusinessRole extends EntityBase { id: EntityId; userId: EntityId | null; user?: IUser | null; businessRole: string | null; divisionId: EntityId | null; division: IDivision | null; }
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\ui\s-account-entrepreneur-insert.ts
import { services } from '@fbc/core/services'; import { getCachedModule } from '@fbc/core/utils'; import { LookupColumn } from '@fbc/types'; import { computed, defineComponent, nextTick, onMounted, onUnmounted, ref } from 'vue'; import { useRouter } from 'vue-router'; import resource from '../localization.json'; import { useAccountEntrepreneurInsert } from '../presenter/account-entrepreneur-insert-module'; import api from '../services/api'; export default defineComponent({ name: 'account-entrepreneur-insert', props: { visible: { type: Boolean, default: false }, }, emits: ['update:visible'], setup(_, { emit }) { const { i18n, toast } = services; const local = (value: string) => i18n.extract(resource, value); const { module, unregister } = getCachedModule('account-entrepreneur-insert', useAccountEntrepreneurInsert); const router = useRouter(); onUnmounted(unregister); onMounted(async () => { await module.template(); nextTick(() => (centralize.value = true)); }); const centralize = ref(true); const hide = () => { emit('update:visible', false); }; const saveClick = async () => { const accountId = await module.save(); if (accountId) { toast.saved(); hide(); router.push({ name: 'account', params: { id: accountId } }); } else { toast.notSaved(); } }; const okvedColumns = computed<LookupColumn[]>(() => [ { field: 'id', visible: false, }, { field: 'itemCode', caption: local('code'), filter: 'text', isDisplayName: true, width: 120, sortIndex: 0, sortOrder: 'asc', }, { field: 'itemName', caption: local('okved'), filter: 'text', isDisplayName: true, }, ]); return { module, centralize, i18n, okvedColumns, api, hide, saveClick, local, }; }, });
0
Eval\client\modules\account-entrepreneur-insert\src
Eval\client\modules\account-entrepreneur-insert\src\ui\s-account-entrepreneur-insert.vue
<template> <s-modal v-model:centralize="centralize" :modelValue="visible" :caption="local('modalCaption')" :class="$style.root" :width="850" mobileFullscreen > <template #default> <div :class="$style.body"> <div :class="$style.grid"> <section v-container :class="$style['name-section']"> <label required> <span>{{ local('fio') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-fullname v-else v-model:firstName="module.entity.firstName" v-model:lastName="module.entity.lastName" v-model:middleName="module.entity.middleName" :firstNameMaxLength="module.maxLengthMap.get('firstName')" :middleNameMaxLength="module.maxLengthMap.get('middleName')" :lastNameMaxLength="module.maxLengthMap.get('lastName')" firstNameRequired lastNameRequired /> </label> <label required @click="$event.preventDefault()"> <span>{{ local('gender') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-page v-else v-model="module.entity.gender" name="radio-group-picklist" pickListName="Пол" :class="$style.gender" allowClear /> </label> </section> <section v-container :class="$style['manager-section']"> <label> <span>{{ local('manager') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-page v-else :modelValue="{ user: module.entity.manager ?? { id: module.entity.managerId }, division: module.entity.division ?? { id: module.entity.divisionId }, }" name="manager-lookup" entityName="Account" @update:modelValue="module.onManagerChanged" /> </label> <label> <span>{{ local('division') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <span v-else>{{ module.entity.division?.name }}</span> </label> </section> <section v-container :class="$style['inn-section']"> <label required @click="$event.preventDefault()"> <span>{{ local('inn') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-codetext v-else v-model="module.entity.inn" codeType="InnIndividual" /> </label> <label @click="$event.preventDefault()"> <span>{{ local('ogrn') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-codetext v-else v-model="module.entity.ogrn" codeType="Ogrn" /> </label> <label @click="$event.preventDefault()"> <span>{{ local('okpo') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-codetext v-else v-model="module.entity.okpo" codeType="Okpo" /> </label> </section> <section v-container :class="$style['communication-section']"> <label required> <span>{{ local('phone') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-page v-else v-model="module.entity.phone" v-model:communicationChannel="module.entity.phoneEntity" name="communication-channel-add-edit" channelType="Контактный телефон" entityName="Account" skipSave /> </label> <label> <span>{{ local('email') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-page v-else v-model="module.entity.email" v-model:communicationChannel="module.entity.emailEntity" name="communication-channel-add-edit" channelType="E-mail" entityName="Account" skipSave /> </label> <label> <span>{{ local('webAddress') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-page v-else v-model="module.entity.webAddress" v-model:communicationChannel="module.entity.webAddressEntity" name="communication-channel-add-edit" channelType="Web-адрес" entityName="Account" skipSave /> </label> </section> <section v-container :class="$style['okopf-section']"> <label> <span>{{ local('okopf') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <span v-else>{{ module.entity.okopf }}</span> </label> <label @click="$event.preventDefault()"> <span>{{ local('okved') }}</span> <s-placeholder v-if="module.loading.isLocked || !module.entity" /> <s-odata-lookup v-else v-model:columns="okvedColumns" :modelValue="module.entity.okved" :parameters="{ api: api.entities, key: 'picklistItems' }" idField="id" :caption="local('okved')" :hiddenFilters="[ { fieldName: 'picklistName', type: 'equal', value: `'ОКВЭД2'`, }, ]" @update:modelValue="module.onPrimaryOkvedChanged" /> </label> </section> <section :class="$style['search-account-section']"> <s-button :disabled="!module.entity?.inn || module.loading.isLocked" @click="module.searchFromExternalSource" > {{ local('search-account-from-external-source') }} </s-button> <span v-if="!module.entity?.inn">{{ local('enter-inn-for-search') }}</span> </section> </div> </div> </template> <template #footer> <s-button :disabled="!module.isValid" success @click="saveClick">{{ $i18n.global('save') }}</s-button> <s-button @click="hide">{{ $i18n.global('cancel') }}</s-button> </template> </s-modal> </template> <script lang="ts" src="./s-account-entrepreneur-insert"></script> <style lang="scss" module> @layer modules { .root { .body { display: flex; flex-direction: column; row-gap: var(--sm); .grid { display: grid; gap: var(--sm); grid-template-columns: 1fr 1fr; grid-template-areas: 'name manager' 'inn communication' 'okopf okopf' 'search-account search-account'; section { display: grid; gap: var(--xs); label { display: grid; grid-template-columns: 120px auto; align-items: center; span:first-child { color: var(--disabled); } } :global(.s-placeholder) { height: 32px; } } .name-section { grid-area: name; label { grid-template-columns: 70px auto; } .gender { justify-content: left; flex-wrap: nowrap; label { font-size: var(--font-sm); } } } .manager-section { grid-area: manager; label { grid-template-columns: 120px auto; } } .inn-section { grid-area: inn; label { grid-template-columns: 70px 150px; } } .communication-section { grid-area: communication; label { grid-template-columns: 120px auto; } } .okopf-section { grid-area: okopf; label { height: 32px; grid-template-columns: 70px 350px; } } .search-account-section { grid-area: search-account; display: flex; align-items: center; gap: var(--sm); > span { color: var(--disabled); } } } } } } </style>
0
Eval\client\modules
Eval\client\modules\account-individual\jest.config.js
module.exports = { ...require('../../configs/jest.config.base'), };
0
Eval\client\modules
Eval\client\modules\account-individual\manifest.json
{ "$schema": "../../module.schema.json", "version": "1.2.4", "name": "account-individual", "type": "Page" }
0
Eval\client\modules
Eval\client\modules\account-individual\package.json
{ "name": "@fbc/account-individual", "version": "1.0.0", "description": "", "main": "index.ts", "directories": { "test": "tests" }, "scripts": { "build": "webpack --mode production", "build:analytics": "webpack --mode production --env BUNDLE_ANALYTICS", "dev": "webpack --watch --mode development", "eslint": "eslint --config ../../configs/.eslintrc.base.mjs --cache src", "lint-next": "eslint --config ../../configs/.eslintrc.next.base.jsonc --ext .js,.vue,.ts src && stylelint --config ../../configs/.stylelintrc.next.base.json \"**/*.{vue,scss}\" --allow-empty-input --cache", "lint-next:code": "eslint --config ../../configs/.eslintrc.next.base.jsonc --ext .js,.vue,.ts src", "lint-next:style": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.next.base.json --cache --allow-empty-input", "test": "jest --passWithNoTests", "test:ci": "jest --passWithNoTests --ci --reporters=default --reporters=jest-junit", "prettier": "prettier --config ../../.prettierrc --write \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.+(ts|i18n|scss|js|json|tsx|vue)\"", "stylelint": "stylelint \"**/*.{vue,scss}\" --config ../../configs/.stylelintrc.base.json --cache --allow-empty-input", "typecheck": "tsc --noEmit", "duplicates": "jscpd src -l 15 -x 9999 --ignore \"../../libs/types/Api/DataMethods.d.ts,**/*.spec.ts,**/*.json\"" }, "author": "" }
0
Eval\client\modules
Eval\client\modules\account-individual\tsconfig.json
{ "extends": "../../configs/tsconfig.base", "include": ["./src/**/*", "../../global.d.ts", "../../vue-shim.d.ts", "../../vue.d.ts"] }
0
Eval\client\modules
Eval\client\modules\account-individual\webpack.config.js
const { moduleBaseConfig } = require('../../configs/webpack.config.base'); module.exports = moduleBaseConfig('account-individual');
0
Eval\client\modules\account-individual\node_modules\.cache
Eval\client\modules\account-individual\node_modules\.cache\eslint-webpack-plugin\.eslintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\index.ts":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\ui\\s-account-individual-details.vue":"2","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\ui\\s-account-individual-details.ts":"3","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\use-cases\\use-region.ts":"4","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\services\\api.ts":"5","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\use-cases\\use-division.ts":"6","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\presenter\\account-individual-module.ts":"7"},{"size":66,"mtime":1713084078857,"results":"8","hashOfConfig":"9"},{"size":6389,"mtime":1714117849967,"results":"10","hashOfConfig":"9"},{"size":2342,"mtime":1713084078864,"results":"11","hashOfConfig":"9"},{"size":593,"mtime":1713084078866,"results":"12","hashOfConfig":"9"},{"size":1128,"mtime":1713084078860,"results":"13","hashOfConfig":"9"},{"size":996,"mtime":1713084078865,"results":"14","hashOfConfig":"9"},{"size":3570,"mtime":1714117915041,"results":"15","hashOfConfig":"9"},{"filePath":"16","messages":"17","suppressedMessages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1hwwtdz",{"filePath":"19","messages":"20","suppressedMessages":"21","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","suppressedMessages":"24","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","suppressedMessages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\index.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\ui\\s-account-individual-details.vue",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\ui\\s-account-individual-details.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\use-cases\\use-region.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\services\\api.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\use-cases\\use-division.ts",[],[],"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\presenter\\account-individual-module.ts",[],[]]
0
Eval\client\modules\account-individual\node_modules\.cache
Eval\client\modules\account-individual\node_modules\.cache\stylelint-webpack-plugin\.stylelintcache
[{"C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\ui\\s-account-individual-details.scss":"1","C:\\Users\\admin\\Desktop\\Work\\Fora\\Eval\\client\\modules\\account-individual\\src\\ui\\s-account-individual-details.vue":"2"},{"size":2771,"mtime":1726737006374,"hashOfConfig":"3"},{"size":6792,"mtime":1726737006375,"hashOfConfig":"3"},"1dnpjin"]
0
Eval\client\modules\account-individual
Eval\client\modules\account-individual\src\index.ts
export { default } from './ui/s-account-individual-details.vue';
0
Eval\client\modules\account-individual
Eval\client\modules\account-individual\src\localization.json
{ "default": { "entity": "Account [IP]", "field-type": "Type", "field-inn": "INN", "field-sex": "Gender", "field-birthDate": "Birth date", "field-birthPlace": "Birth place", "field-region": "Region", "field-division": "Division", "field-fio": "Full name", "field-resident": "Resident", "field-notesAbout": "Notes about", "column-name": "Name", "column-division": "Division", "column-title": "Title", "confirm-delete": "Are you sure you want to delete this account?", "field-empty-error": "Required filed", "field-phone": "Phone", "field-email": "Email", "incorrect": "Incorrect" }, "ru-ru": { "entity": "Клиент [ФЛ]", "field-type": "Тип", "field-inn": "ИНН", "field-sex": "Пол", "field-birthDate": "Дата рождения", "field-birthPlace": "Место рождения", "field-region": "Регион", "field-division": "Подразделение", "field-fio": "ФИО", "field-resident": "Резидент РФ", "field-notesAbout": "Заметки", "column-name": "Наименование", "column-division": "Подразделение", "column-title": "Должность", "confirm-delete": "Вы уверены что хотите удалить этого клиента?", "field-empty-error": "Обязательное поле", "field-phone": "Телефон", "field-email": "Email", "incorrect": "Некорректный" } }
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\presenter\account-individual-module.ts
import { services } from '@fbc/core/services'; import { useEntityStore } from '@fbc/core/storage'; import { EntityId } from '@fbc/types'; import { defineStore } from 'pinia'; import resources from '../localization.json'; import api from '../services/api'; import { Division } from '../types/Division'; export const useAccountIndividual = defineStore('account', () => { const { store, store: { user: { hasAccess }, }, } = services; const entityStore = useEntityStore(api.entities, 'accounts', __filename, { odataConfig: { select: [ 'id', 'inn', 'name', 'modifyUser', 'modifyDate', 'firstName', 'photoId', 'lastName', 'middleName', 'description', 'personCode', 'type', 'divisionId', 'regionId', 'isResident', 'birthDate', 'birthPlace', 'gender', 'phone', 'email', 'webAddress', 'seccodeId', ], expand: ['division/name', 'region/name'], }, getDisplayName: entity => entity.name ?? null, onEntityLoaded(entity) { if (!store) return; store.title = [store.defaultTitle.at(0), services.i18n.extract(resources, 'entity'), entity.name]; store.description = entity.name ?? ''; }, }); const canEdit = hasAccess('Entities/Account/Edit'); const canDelete = hasAccess('Entities/Account/Delete'); const isCommunicationChannelVisible = hasAccess('Entities/Account/Tab/ContactInfo/CommChannels/View'); const isCommunicationChannelEditable = hasAccess('Entities/Account/Tab/ContactInfo/CommChannels/Edit'); const { bus } = services; const isCommunicationChannel = (x: unknown): x is { entityId: EntityId; entity: string; isPrimary: boolean } => Boolean(typeof x === 'object' && x && 'entityId' in x && 'entity' in x && 'isPrimary' in x); const onCommunicationChannelChanged = (communicationChannel: unknown) => { if ( !isCommunicationChannel(communicationChannel) || communicationChannel.entity !== 'Account' || entityStore.entity.value?.id !== communicationChannel.entityId || !communicationChannel.isPrimary ) return; entityStore.load(communicationChannel.entityId); }; const onRegionChanged = (value: Division | null) => { if (!entityStore.entity.value) return; entityStore.entity.value.region = value; entityStore.entity.value.regionId = value?.id; }; const onDivisionChanged = async (value: Division | null) => { if (!entityStore.entity.value) return; entityStore.entity.value.division = value; entityStore.entity.value.divisionId = value?.id ?? value?.id; if (value?.regionId) { const [error, region] = await api.entities.read('divisions', value?.regionId, __filename); if (error) return log.prod.error(__filename, error); onRegionChanged(region); } else { onRegionChanged(null); } }; bus.on(`/entity/communicationChannel/created`, onCommunicationChannelChanged); bus.on(`/entity/communicationChannel/updated`, onCommunicationChannelChanged); bus.on(`/entity/communicationChannel/deleted`, onCommunicationChannelChanged); function unregister() { bus.off('/entity/communicationChannel/created', onCommunicationChannelChanged); bus.off('/entity/communicationChannel/updated', onCommunicationChannelChanged); bus.off('/entity/communicationChannel/deleted', onCommunicationChannelChanged); } return { ...entityStore, canEdit, canDelete, unregister, onDivisionChanged, isCommunicationChannelVisible, isCommunicationChannelEditable, }; });
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\services\api.ts
import { services } from '@fbc/core/services'; import { dateTimeFromODataDate } from '@fbc/core/utils'; import type { OmitEntityBase, SimpleEntity } from '@fbc/types'; import type { Account } from '../types/Account'; import type { Division } from '../types/Division'; import type { User } from '../types/User'; import type { UserBusinessRole } from '../types/UserBusinessRole'; const entities = new services.entitiesApi<{ accounts: { from: OmitEntityBase<Account, 'birthDate'> & { birthDate?: string | null }; to: Account; interface: Account; }; userBusinessRoles: SimpleEntity<UserBusinessRole>; divisions: SimpleEntity<Division>; users: SimpleEntity<User>; }>({ accounts: { from: entity => ({ birthDate: dateTimeFromODataDate(entity.birthDate), }), to: () => ({ division: undefined, region: undefined, }), }, userBusinessRoles: { from: (entity, mapper) => ({ division: entity?.division ? mapper.toClientView('divisions', entity.division) : null, }), }, }); export default { entities, };
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\types\Account.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import type { DateTime } from 'luxon'; import type { Division } from './Division'; export type Account = EntityBase & { name?: string | null; seccodeId?: EntityId; inn?: string | null; photoId?: EntityId | null; description?: string | null; personCode?: 'Individual' | null; type?: string | null; divisionId?: EntityId | null; regionId?: EntityId | null; region?: Division | null; isResident?: boolean | null; firstName?: string | null; lastName?: string | null; middleName?: string | null; gender?: string | null; birthDate?: DateTime | null; birthPlace?: DateTime | null; division?: Division | null; phone?: string | null; email?: string | null; webAddress?: string | null; };
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\types\Division.d.ts
import type { EntityId } from '@fbc/types'; export type Division = { id?: EntityId | null; name?: string | null; regionId?: string | null; };
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\types\User.d.ts
import type { EntityBase } from '@fbc/types'; export type User = EntityBase & { shortName?: string | null; };
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\types\UserBusinessRole.d.ts
import type { EntityBase, EntityId } from '@fbc/types'; import type { Division } from './Division'; export type UserBusinessRole = EntityBase & { userId?: EntityId | null; divisionId?: EntityId | null; businessRole?: string | null; user?: null | { shortName?: string | null; title?: string | null; }; division?: Division | null; };
0
Eval\client\modules\account-individual\src
Eval\client\modules\account-individual\src\ui\s-account-individual-details.scss
@layer modules { .root { display: grid; margin-inline: var(--sm); margin-top: var(--sm); grid-template-areas: 'contrast contrast' 'info inn' 'info communication' 'about about'; grid-template-columns: auto auto; grid-column-gap: var(--sm); grid-row-gap: var(--sm); @media screen and (width < 1366px) { .name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; } } .contrast { grid-area: contrast; display: flex; flex-direction: column; gap: var(--sm); } .header { column-gap: var(--xs); margin: 0; > li > label { > :first-child { color: var(--disabled); } :last-child { text-overflow: ellipsis; min-height: 18px; white-space: nowrap; } } } @media screen and (width > 1366px) { grid-template-areas: 'contrast contrast contrast' 'info inn about' 'info communication about'; grid-template-columns: repeat(3, 1fr); .header { column-gap: var(--lg); > li { flex: 1; > label { width: 70%; } } > :first-child { flex: 1.2; } > :last-child { flex: 0.7; } } } @media screen and (width > 1920px) { max-width: 1700px; } @media screen and (width <= 600px) { display: flex; flex-direction: column; } .notification { padding-left: 0; margin: 0; } .about { grid-area: about; > label { color: var(--disabled); align-items: start; } :global(.s-textarea) { height: calc(100% - var(--md)); } } .inn-container { grid-area: inn; } div.photo { --photo-size: 60px; --photo-delete-size: 14px; --photo-delete-top: 10px; --photo-delete-right: -10px; align-items: center; &:global(.photo__s-photo .photo__s-photo__img) { border-radius: 50%; } &:global(.photo__s-photo.photo__s-photo__empty i) { color: var(--on-contrast-icon); font-size: var(--icon-md); background-color: transparent; } :global(.s-placeholder) { background: transparent; } } .block { list-style-type: none; display: flex; flex-direction: column; row-gap: var(--xs); > * { display: flex; height: 32px; column-gap: var(--md); } > label, :global(.s-property) { > :first-child { display: flex; align-items: center; color: var(--disabled); width: 110px; } > :last-child:not(:global(.s-checkbox)) { flex: 1; display: flex; align-items: center; > :first-child { flex-grow: 1; } } } > button { width: fit-content; margin-left: auto; } } } }
0
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
34