diff --git a/src/assets/icon-x.svg b/src/assets/icon-x.svg new file mode 100644 index 0000000..35aa328 --- /dev/null +++ b/src/assets/icon-x.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/AccountMenu/SearchBar.vue b/src/components/AccountMenu/SearchBar.vue index 68d87ae..f3a640e 100644 --- a/src/components/AccountMenu/SearchBar.vue +++ b/src/components/AccountMenu/SearchBar.vue @@ -2,7 +2,7 @@
- +
diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 5900076..1f5589a 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -135,7 +135,9 @@ export default { return result; }, noShowSaveButton: function() { - return this.navViewName === 'UPLOAD' || this.navViewName === 'COMPARE' || this.activePage === 'PERFORMANCE' ? true : false; + return this.navViewName === 'UPLOAD' || this.navViewName === 'COMPARE' || + this.navViewName === 'ACCOUNT MANAGEMENT' || + this.activePage === 'PERFORMANCE' ? true : false; }, ...mapState(PageAdminStore, [ 'activePage', diff --git a/src/i18n/en.json b/src/i18n/en.json index 46019f6..23a0bd1 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -5,7 +5,8 @@ "Apply": "Apply", "Cancel": "Cancel", "Clear": "Clear", - "Save": "Save" + "Save": "Save", + "Confirm": "Confirm" }, "AcctMgmt":{ "hi": "Hi, ", @@ -18,7 +19,8 @@ "AdminRights": "Admin Rights", "AccountActivation": "Account Activation", "Detail": "Detail", - "Edit": "Edit" + "Edit": "Edit", + "AccountEdit": "Account Edit" }, "Compare": { "timeUsage": "Time Usage", diff --git a/src/module/alertModal.js b/src/module/alertModal.js index 29fbae6..257a1dc 100644 --- a/src/module/alertModal.js +++ b/src/module/alertModal.js @@ -3,6 +3,7 @@ import AllMapDataStore from '@/stores/allMapData.js'; import ConformanceStore from '@/stores/conformance.js'; import FilesStore from '@/stores/files.js'; import PageAdminStore from '@/stores/pageAdmin.js'; +import { useModalStore } from '@/stores/modal.js'; const customClass = { container: '!z-[99999]', @@ -484,3 +485,27 @@ export async function reallyDeldetInformation(files, reallyDeldetData) { recordIdData = await Promise.all(reallyDeldetData.map(file => filesStore.deletionRecord(file.id))); await filesStore.fetchAllFiles(); } + +/** + * When user is leaving the acct mgmt page but hasn't finished editing, + * we jump out this alert modal to remind her. + */ +export async function leaveAccountManagementToRemind(){ + const modalStore = useModalStore(); + const result = await Swal.fire({ + title: 'SAVE YOUR EDIT?', + icon: 'info', + showCancelButton: true, + didOpen: () => { + const confirmButton = Swal.getConfirmButton(); + + confirmButton.style.border = '1px solid #0099FF'; + } + }); + if(result.isConfirmed) { + //TODO: Call Pinia Save Backend API + } else { + //TODO: + modalStore.openModal(); + } +}; \ No newline at end of file diff --git a/src/views/AccountManagement/AccountAdmin/index.vue b/src/views/AccountManagement/AccountAdmin/index.vue index b483eb7..4009a75 100644 --- a/src/views/AccountManagement/AccountAdmin/index.vue +++ b/src/views/AccountManagement/AccountAdmin/index.vue @@ -42,7 +42,7 @@ @@ -66,7 +66,7 @@ function repeatAccountList(accountList, N) { // 复制每次的对象并将其添加到新数组中 accountList.forEach(account => { // 创建一个新的对象,避免直接引用 - const newAccount = { ...account }; + const newAccount = { ...account, id: account.id + i }; repeatedList.push(newAccount); }); } @@ -168,6 +168,9 @@ export default { onDetailBtnClick(dataId){ this.openModal(); }, + onEditBtnClick(dataId){ + this.openModal(); + }, ...mapActions(useModalStore, ['openModal']), }, created() { diff --git a/src/views/AccountManagement/ModalAccountEdit.vue b/src/views/AccountManagement/ModalAccountEdit.vue new file mode 100644 index 0000000..f5293d5 --- /dev/null +++ b/src/views/AccountManagement/ModalAccountEdit.vue @@ -0,0 +1,76 @@ + + + + \ No newline at end of file diff --git a/src/views/AccountManagement/ModalContainer.vue b/src/views/AccountManagement/ModalContainer.vue index 924100d..e7af0a8 100644 --- a/src/views/AccountManagement/ModalContainer.vue +++ b/src/views/AccountManagement/ModalContainer.vue @@ -1,21 +1,16 @@ \ No newline at end of file