From 6b45516d942354eb67733886dd9a0a8173f2e0d5 Mon Sep 17 00:00:00 2001 From: Sipachev Igor Date: Thu, 10 Mar 2022 13:02:17 +0700 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=20=D1=82=D0=B0?= =?UTF-8?q?=D0=B1=20=D0=B2=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popup/src/components/person-tab/script.ts | 35 ++------- popup/src/components/person-tab/style.scss | 66 ++++++++++++++++- popup/src/components/person-tab/template.html | 4 ++ popup/src/components/script.ts | 69 +----------------- popup/src/components/template.html | 72 ++----------------- 5 files changed, 80 insertions(+), 166 deletions(-) diff --git a/popup/src/components/person-tab/script.ts b/popup/src/components/person-tab/script.ts index 13b6a16..a0f4e89 100644 --- a/popup/src/components/person-tab/script.ts +++ b/popup/src/components/person-tab/script.ts @@ -9,8 +9,6 @@ import VueClipboard from 'vue-clipboard2' import { Target } from '@/classes/Enum/Target' import sender from '@/classes/Service/Browser/Chrome/Sender' import { Action } from '@/classes/Enum/Action' -import notificationCleaner from '@/classes/Service/NotificationCleaner' -import { Registers } from '@/classes/DTO/Registers' import Mocks from '@/components/mocks/main.vue' Vue.use(VueClipboard) @@ -23,8 +21,6 @@ Vue.use(VueClipboard) export default class PersonTab extends Vue { personalId = '' person = new Person() - registers = new Registers() - isAutoCleaner = false copyText = '' get allowedMonths () { @@ -44,14 +40,6 @@ export default class PersonTab extends Vue { return result } - mounted () { - /** todo заполнить первоначальное значение */ - notificationCleaner.state().then((isAutoCleaner) => { - this.isAutoCleaner = isAutoCleaner - console.log('this.isAutoCleaner = ' + isAutoCleaner) - }) - } - copyPersonalId () { const personalId = personalIdGenerator.generate(this.person) this.personalId = personalId @@ -60,11 +48,13 @@ export default class PersonTab extends Vue { copyIban () { const iban = ibanGenerator.generate(this.person.country) + this.personalId = '' this.copy(iban) } copyPhone () { const phone = phoneGenerator.generate(this.person.country) + this.personalId = '' this.copy(phone) } @@ -75,6 +65,8 @@ export default class PersonTab extends Vue { autocomplete () { const personalId = personalIdGenerator.generate(this.person) + this.personalId = personalId + this.copy(personalId) this.insertValueToNode(Target.PERSONAL_ID, personalId) const iban = ibanGenerator.generate(this.person.country) this.insertValueToNode(Target.IBAN, iban) @@ -93,23 +85,4 @@ export default class PersonTab extends Vue { value: value }) } - - cleanNotifications (): void { - sender.send({ - action: Action.CLEAN_NOTIFICATION - }) - } - - onChangeAutoCleaner () { - console.log(this.isAutoCleaner) - if (this.isAutoCleaner) { - notificationCleaner.enable() - } else { - notificationCleaner.disable() - } - } - - saveMocks () { - console.log(this.personalId, this.registers) - } } diff --git a/popup/src/components/person-tab/style.scss b/popup/src/components/person-tab/style.scss index e8608be..fe25a0b 100644 --- a/popup/src/components/person-tab/style.scss +++ b/popup/src/components/person-tab/style.scss @@ -1,3 +1,65 @@ -.option-select { - width: 350px; +.container { + max-width: 400px; + min-width: 400px; + border: solid 2px gray; + + .wrapper { + padding: 10px; + + .tab-panel { + display: flex; + + &__item { + flex-grow: 1; + padding: 5px; + cursor: pointer; + border-bottom: solid 2px #cae5fa; + + &_active { + border-bottom: solid 2px #298df8; + } + + &:hover { + border-bottom: solid 2px #298df8; + } + } + } + + .tab-page { + padding-top: 10px; + + &__item { + display: none; + + + &_show { + display: block; + } + + .form-row { + display: flex; + margin-bottom: 5px; + + &__item { + flex-grow: 1; + margin-right: 10px; + + &-input { + width: 100%; + } + } + + &:last-child { + margin-bottom: 0; + } + } + } + } + + .memory-panel { + text-align: left; + padding: 5px; + margin-top: 10px; + } + } } diff --git a/popup/src/components/person-tab/template.html b/popup/src/components/person-tab/template.html index 5ad780e..c46f160 100644 --- a/popup/src/components/person-tab/template.html +++ b/popup/src/components/person-tab/template.html @@ -58,4 +58,8 @@
Memory: {{copyText}}
+
+
+ +
diff --git a/popup/src/components/script.ts b/popup/src/components/script.ts index 78afb08..35188c9 100644 --- a/popup/src/components/script.ts +++ b/popup/src/components/script.ts @@ -1,49 +1,26 @@ import { Component, Vue } from 'vue-property-decorator' -import personalIdGenerator from '@/classes/Service/Generators/PersonalIdGenerator' -import ibanGenerator from '@/classes/Service/Generators/IbanGenerator' -import phoneGenerator from '@/classes/Service/Generators/PhoneGenerator' -import firstNameGenerator from '@/classes/Service/Generators/FirstNameGenerator' -import lastNameGenerator from '@/classes/Service/Generators/LastNameGenerator' import { Person } from '@/classes/DTO/Person' import VueClipboard from 'vue-clipboard2' import { Target } from '@/classes/Enum/Target' import sender from '@/classes/Service/Browser/Chrome/Sender' import { Action } from '@/classes/Enum/Action' import notificationCleaner from '@/classes/Service/NotificationCleaner' -import { Registers } from '@/classes/DTO/Registers' import Mocks from '@/components/mocks/main.vue' +import PersonTab from '@/components/person-tab/main.vue' Vue.use(VueClipboard) @Component({ components: { - Mocks + Mocks, + PersonTab } }) export default class HelloWorld extends Vue { tab = 'person' personalId = '' person = new Person() - registers = new Registers() isAutoCleaner = false - copyText = '' - - get allowedMonths () { - const result = [] - for (let i = 1; i <= 12; i++) { - result.push(i) - } - return result - } - - get allowedYears () { - const result = [] - const currentYear = (new Date()).getFullYear() - for (let i = 1960; i <= currentYear; i++) { - result.push(i) - } - return result - } mounted () { /** todo заполнить первоначальное значение */ @@ -53,42 +30,6 @@ export default class HelloWorld extends Vue { }) } - copyPersonalId () { - const personalId = personalIdGenerator.generate(this.person) - this.personalId = personalId - this.copy(personalId) - } - - copyIban () { - const iban = ibanGenerator.generate(this.person.country) - this.copy(iban) - } - - copyPhone () { - const phone = phoneGenerator.generate(this.person.country) - this.copy(phone) - } - - copy (text: string) { - this.copyText = text - this.$copyText(text) - } - - autocomplete () { - const personalId = personalIdGenerator.generate(this.person) - this.personalId = personalId - this.copy(personalId) - this.insertValueToNode(Target.PERSONAL_ID, personalId) - const iban = ibanGenerator.generate(this.person.country) - this.insertValueToNode(Target.IBAN, iban) - const phone = phoneGenerator.generate(this.person.country) - this.insertValueToNode(Target.PHONE, phone) - const firstName = firstNameGenerator.generate(this.person.country, this.person.gender) - this.insertValueToNode(Target.FIRST_NAME, firstName) - const lastName = lastNameGenerator.generate(this.person.country) - this.insertValueToNode(Target.LAST_NAME, lastName) - } - insertValueToNode (target: Target, value: string): void { sender.send({ action: Action.INSERT, @@ -111,8 +52,4 @@ export default class HelloWorld extends Vue { notificationCleaner.disable() } } - - saveMocks () { - console.log(this.personalId, this.registers) - } } diff --git a/popup/src/components/template.html b/popup/src/components/template.html index c78083f..7d55a0f 100644 --- a/popup/src/components/template.html +++ b/popup/src/components/template.html @@ -13,79 +13,17 @@
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
-
Memory: {{copyText}}
-
-
- -
+
+
+
+ +