| @@ -30,6 +30,10 @@ | |||||
| this.$router.replace({name: 'login'}); | this.$router.replace({name: 'login'}); | ||||
| break; | break; | ||||
| } | } | ||||
| case '2': { | |||||
| this.$router.replace({name: 'type'}); | |||||
| break; | |||||
| } | |||||
| default: { | default: { | ||||
| this.$router.replace({name: 'asset_group'}); | this.$router.replace({name: 'asset_group'}); | ||||
| } | } | ||||
| @@ -98,6 +98,8 @@ | |||||
| <p>{{item.level === '2' ? '一般使用者' : ''}}</p> | <p>{{item.level === '2' ? '一般使用者' : ''}}</p> | ||||
| <p>{{item.level === '3' ? '稽核人員' : ''}}</p> | <p>{{item.level === '3' ? '稽核人員' : ''}}</p> | ||||
| </template> | </template> | ||||
| <template v-slot:item.pwd="{ }"> | |||||
| </template> | |||||
| <template v-slot:item.actions="{ item }"> | <template v-slot:item.actions="{ item }"> | ||||
| <div class="d-flex"> | <div class="d-flex"> | ||||
| <v-btn | <v-btn | ||||
| @@ -171,7 +173,7 @@ | |||||
| {'text': '部門', 'value': 'department'}, | {'text': '部門', 'value': 'department'}, | ||||
| // {'text': '型態', 'value': 'type'}, | // {'text': '型態', 'value': 'type'}, | ||||
| {'text': '帳號', 'value': 'account'}, | {'text': '帳號', 'value': 'account'}, | ||||
| {'text': '密碼', 'value': 'pwd'}, | |||||
| // {'text': '密碼', 'value': 'pwd'}, | |||||
| {'text': '權限', 'value': 'level'}], | {'text': '權限', 'value': 'level'}], | ||||
| items: [], | items: [], | ||||
| departments: [], | departments: [], | ||||
| @@ -36,6 +36,7 @@ | |||||
| > | > | ||||
| <template v-slot:activator='{ on, attrs }'> | <template v-slot:activator='{ on, attrs }'> | ||||
| <v-btn | <v-btn | ||||
| v-if="level === 0" | |||||
| v-bind='attrs' | v-bind='attrs' | ||||
| v-on='on' | v-on='on' | ||||
| icon | icon | ||||
| @@ -167,7 +168,7 @@ | |||||
| </v-card> | </v-card> | ||||
| </v-dialog> | </v-dialog> | ||||
| <v-btn icon> | <v-btn icon> | ||||
| <v-icon v-show="optionIconShow === index" small @click="deleteAssertGroup(item)"> | |||||
| <v-icon v-show="level === 0" small @click="deleteAssertGroup(item)"> | |||||
| mdi-delete | mdi-delete | ||||
| </v-icon> | </v-icon> | ||||
| </v-btn> | </v-btn> | ||||
| @@ -578,6 +579,7 @@ | |||||
| dialogModifySelectItem: false, | dialogModifySelectItem: false, | ||||
| oldIndex: '', | oldIndex: '', | ||||
| modifyTypeSelectItem: '', | modifyTypeSelectItem: '', | ||||
| level: parseInt(localStorage.getItem('level')) | |||||
| } | } | ||||
| }, | }, | ||||
| async mounted() { | async mounted() { | ||||
| @@ -229,6 +229,10 @@ | |||||
| //一般管理員 | //一般管理員 | ||||
| if (level === '1') { | if (level === '1') { | ||||
| this.items.push({text: '資訊資產群組', route: '/asset_group'}); | this.items.push({text: '資訊資產群組', route: '/asset_group'}); | ||||
| this.items.push({'text': '資產類別管理', 'route': '/type'}); | |||||
| } | |||||
| if (level === '2') { | |||||
| this.items.push({'text': '資產類別管理', 'route': '/type'}); | |||||
| } | } | ||||
| if (level === '3') { | if (level === '3') { | ||||
| this.items = [{'text': '資訊資產清冊', 'route': '/serverlist'}]; | this.items = [{'text': '資訊資產清冊', 'route': '/serverlist'}]; | ||||
| @@ -35,7 +35,7 @@ | |||||
| <div class="row align-center"> | <div class="row align-center"> | ||||
| <p v-if="haveSearch" class="mb-0 pa-0">搜尋條件:</p> | <p v-if="haveSearch" class="mb-0 pa-0">搜尋條件:</p> | ||||
| <div v-for="(val, key, index) in searchItem" :key="index" class="pa-0 ma-0"> | <div v-for="(val, key, index) in searchItem" :key="index" class="pa-0 ma-0"> | ||||
| <v-chip color="secondary" v-if="val !== null"> | |||||
| <v-chip color="secondary" v-if="haveSearch === true && val !== null && val !== ''"> | |||||
| {{mappingHeaders[key]}} 包含: {{val}} | {{mappingHeaders[key]}} 包含: {{val}} | ||||
| <v-icon @click="clearSinglePropInSearchItem(key)">mdi-close</v-icon> | <v-icon @click="clearSinglePropInSearchItem(key)">mdi-close</v-icon> | ||||
| </v-chip> | </v-chip> | ||||
| @@ -51,13 +51,14 @@ | |||||
| > | > | ||||
| <template v-slot:activator="{ on, attrs }"> | <template v-slot:activator="{ on, attrs }"> | ||||
| <v-btn | <v-btn | ||||
| v-if="level < 2" | |||||
| color="white" | color="white" | ||||
| class="primary mr-5" | class="primary mr-5" | ||||
| v-bind="attrs" | v-bind="attrs" | ||||
| v-on="on" | v-on="on" | ||||
| icon | icon | ||||
| > | > | ||||
| <v-icon>mdi-file-import-outline</v-icon> | |||||
| <v-icon >mdi-file-import-outline</v-icon> | |||||
| </v-btn> | </v-btn> | ||||
| </template> | </template> | ||||
| @@ -93,6 +94,7 @@ | |||||
| </v-card> | </v-card> | ||||
| </v-dialog> | </v-dialog> | ||||
| <v-btn | <v-btn | ||||
| v-if="level < 2" | |||||
| color="white" | color="white" | ||||
| class="primary mr-5" | class="primary mr-5" | ||||
| @click="exportFile" | @click="exportFile" | ||||
| @@ -275,6 +277,7 @@ | |||||
| <v-icon>mdi-pencil</v-icon> | <v-icon>mdi-pencil</v-icon> | ||||
| </v-btn> | </v-btn> | ||||
| <v-icon | <v-icon | ||||
| v-if="level < 2" | |||||
| small | small | ||||
| @click="deleteOne(item)" | @click="deleteOne(item)" | ||||
| > | > | ||||
| @@ -378,6 +381,7 @@ | |||||
| dialogImport: false, | dialogImport: false, | ||||
| file: null, | file: null, | ||||
| progress: false, | progress: false, | ||||
| level: parseInt(localStorage.getItem('level')), | |||||
| } | } | ||||
| }, | }, | ||||
| async mounted() { | async mounted() { | ||||
| @@ -446,7 +450,7 @@ | |||||
| this.isrequired.push(item.colname); | this.isrequired.push(item.colname); | ||||
| } | } | ||||
| this.insertItem[item.colname] = null; | this.insertItem[item.colname] = null; | ||||
| this.searchItem[item.colname] = null; | |||||
| this.searchItem[item.colname] = ''; | |||||
| }); | }); | ||||
| }); | }); | ||||
| }, | }, | ||||
| @@ -544,13 +548,13 @@ | |||||
| this.getInventories(); | this.getInventories(); | ||||
| }, | }, | ||||
| async clearSearchItem() { | async clearSearchItem() { | ||||
| const self = this; | |||||
| this.haveSearch = false; | |||||
| const obj = {}; | |||||
| Object.keys(this.searchItem).forEach(function(key){ | Object.keys(this.searchItem).forEach(function(key){ | ||||
| self.searchItem[key] = null; | |||||
| obj[key] = null; | |||||
| }); | }); | ||||
| console.log(this.searchItem); | |||||
| this.searchItem = obj; | |||||
| this.getInventories(); | this.getInventories(); | ||||
| this.haveSearch = false; | |||||
| }, | }, | ||||
| onFileChange(e) { | onFileChange(e) { | ||||
| const files = e.target.files || e.dataTransfer.files; | const files = e.target.files || e.dataTransfer.files; | ||||
| @@ -12,7 +12,7 @@ | |||||
| > | > | ||||
| <v-col cols="12" align-self="center" class="d-flex"> | <v-col cols="12" align-self="center" class="d-flex"> | ||||
| <v-spacer/> | <v-spacer/> | ||||
| <img src="/rms/obank_logo.svg"> | |||||
| <img src="/rms/obank_logo.svg" type="img"> | |||||
| <v-spacer/> | <v-spacer/> | ||||
| </v-col> | </v-col> | ||||
| <v-col | <v-col | ||||
| @@ -21,6 +21,8 @@ | |||||
| md='4' | md='4' | ||||
| > | > | ||||
| <v-card class='elevation-12 grey lighten-3'> | <v-card class='elevation-12 grey lighten-3'> | ||||
| <div @keyup.enter="login"> | |||||
| <v-toolbar | <v-toolbar | ||||
| color='primary' | color='primary' | ||||
| dark | dark | ||||
| @@ -51,8 +53,9 @@ | |||||
| </v-card-text> | </v-card-text> | ||||
| <v-card-actions> | <v-card-actions> | ||||
| <v-spacer /> | <v-spacer /> | ||||
| <v-btn color='primary' v-on:click='login()'>登入</v-btn> | |||||
| <v-btn color='primary' @click="login">登入</v-btn> | |||||
| </v-card-actions> | </v-card-actions> | ||||
| </div> | |||||
| </v-card> | </v-card> | ||||
| </v-col> | </v-col> | ||||
| </v-row> | </v-row> | ||||
| @@ -83,6 +86,7 @@ | |||||
| } | } | ||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| log() { alert('asda')}, | |||||
| login() { | login() { | ||||
| this.loginError = false; | this.loginError = false; | ||||
| const _this = this; | const _this = this; | ||||
| @@ -34,7 +34,7 @@ | |||||
| </v-col> | </v-col> | ||||
| </v-row> | </v-row> | ||||
| <v-btn | <v-btn | ||||
| v-if="result !== null" | |||||
| v-if="level < 2 && result !== null" | |||||
| color="white" | color="white" | ||||
| class="primary mr-5" | class="primary mr-5" | ||||
| @click="exportFile" | @click="exportFile" | ||||
| @@ -98,7 +98,8 @@ | |||||
| currentTab: 0, | currentTab: 0, | ||||
| assertGroup: [], | assertGroup: [], | ||||
| allHeaders: {}, | allHeaders: {}, | ||||
| progress: false | |||||
| progress: false, | |||||
| level: parseInt(localStorage.getItem('level')) | |||||
| } | } | ||||
| }, | }, | ||||
| mounted() { | mounted() { | ||||
| @@ -120,6 +121,7 @@ | |||||
| this.$forceUpdate(); | this.$forceUpdate(); | ||||
| } | } | ||||
| }, | }, | ||||
| // before | |||||
| methods: { | methods: { | ||||
| async getTabs() { | async getTabs() { | ||||
| await this.$axios.get(`/assert/assertGroups`).then((resp) => { | await this.$axios.get(`/assert/assertGroups`).then((resp) => { | ||||
| @@ -48,12 +48,14 @@ | |||||
| > | > | ||||
| <template v-slot:item.actions='{ item }'> | <template v-slot:item.actions='{ item }'> | ||||
| <v-btn | <v-btn | ||||
| v-if="level === 0" | |||||
| icon | icon | ||||
| @click='openDialogModifyCol(item)' | @click='openDialogModifyCol(item)' | ||||
| > | > | ||||
| <v-icon>mdi-pencil</v-icon> | <v-icon>mdi-pencil</v-icon> | ||||
| </v-btn> | </v-btn> | ||||
| <v-icon | <v-icon | ||||
| v-if="level === 0" | |||||
| small | small | ||||
| @click='deleteCol(item)' | @click='deleteCol(item)' | ||||
| > | > | ||||
| @@ -72,6 +74,7 @@ | |||||
| > | > | ||||
| <template v-slot:activator='{ on, attrs }'> | <template v-slot:activator='{ on, attrs }'> | ||||
| <v-btn | <v-btn | ||||
| v-if="level === 0" | |||||
| v-bind='attrs' | v-bind='attrs' | ||||
| v-on='on' | v-on='on' | ||||
| color='primary' | color='primary' | ||||
| @@ -232,6 +235,7 @@ | |||||
| currentTab: 0, | currentTab: 0, | ||||
| cols: [], | cols: [], | ||||
| oldId: '', | oldId: '', | ||||
| level: parseInt(localStorage.getItem('level')) | |||||
| } | } | ||||
| }, | }, | ||||
| async mounted() { | async mounted() { | ||||