| @@ -117,6 +117,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 | ||||
| @@ -202,12 +203,14 @@ | |||||
| </template> | </template> | ||||
| <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)' | ||||
| > | > | ||||
| @@ -226,6 +229,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' | ||||
| @@ -824,7 +828,7 @@ | |||||
| this.optionIconShow = index; | this.optionIconShow = index; | ||||
| }, | }, | ||||
| async deleteAssertGroup(item) { | async deleteAssertGroup(item) { | ||||
| let yes = confirm('確認刪除此群組?'); | |||||
| let yes = confirm(`確認刪除${item.text}類資產清冊?`); | |||||
| if (yes) { | if (yes) { | ||||
| await this.$axios.delete(`/assert/assertGroups?tablename=${item.value}`).then(() => { | await this.$axios.delete(`/assert/assertGroups?tablename=${item.value}`).then(() => { | ||||
| // this.getTabs(); | // this.getTabs(); | ||||
| @@ -20,6 +20,7 @@ | |||||
| </v-card> | </v-card> | ||||
| </v-dialog> | </v-dialog> | ||||
| <v-data-table class="" :headers="headers" :items="items" | <v-data-table class="" :headers="headers" :items="items" | ||||
| disable-sort | disable-sort | ||||
| fixed-header | fixed-header | ||||
| :footer-props="{'items-per-page-options': [30, 40, 50, 60]}" | :footer-props="{'items-per-page-options': [30, 40, 50, 60]}" | ||||
| @@ -285,6 +286,9 @@ | |||||
| </v-icon> | </v-icon> | ||||
| </div> | </div> | ||||
| </template> | </template> | ||||
| <template v-slot:item.id="{ item }"> | |||||
| {{items.indexOf(item) + 1}} | |||||
| </template> | |||||
| </v-data-table> | </v-data-table> | ||||
| <!--修改對話--> | <!--修改對話--> | ||||
| <v-dialog | <v-dialog | ||||
| @@ -6,6 +6,7 @@ import com.moze.rms.entity.model.Account; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.Locale; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import java.util.Optional; | import java.util.Optional; | ||||
| @@ -18,7 +19,7 @@ public class AccountController { | |||||
| @PostMapping("/login") | @PostMapping("/login") | ||||
| public JsonResult login(@RequestBody Map<String, String> data) { | public JsonResult login(@RequestBody Map<String, String> data) { | ||||
| Optional<Map<String, Object>> user = accountDAO.findUser(data.get("account")); | |||||
| Optional<Map<String, Object>> user = accountDAO.findUser(data.get("account").toLowerCase()); | |||||
| if (user.isPresent() && user.get().get("pwd").equals(data.get("password"))) { | if (user.isPresent() && user.get().get("pwd").equals(data.get("password"))) { | ||||
| return new JsonResult(StatusCode.SUCCESS, user); | return new JsonResult(StatusCode.SUCCESS, user); | ||||
| } else { | } else { | ||||
| @@ -15,7 +15,7 @@ public interface AccountDAO extends SqlObject { | |||||
| @RegisterBeanMapper(Object.class) | @RegisterBeanMapper(Object.class) | ||||
| default Optional<Map<String, Object>> findUser(String account) { | default Optional<Map<String, Object>> findUser(String account) { | ||||
| Handle handle = this.getHandle(); | Handle handle = this.getHandle(); | ||||
| String sql = "select * from account where account = '" + account + "'"; | |||||
| String sql = "select * from account where lower(account) = '" + account + "'"; | |||||
| return handle.createQuery(sql).mapToMap().findOne(); | return handle.createQuery(sql).mapToMap().findOne(); | ||||
| } | } | ||||
| @@ -1,5 +1,5 @@ | |||||
| spring.profiles.active=dev | |||||
| #spring.profiles.active=pro | |||||
| #spring.profiles.active=dev | |||||
| spring.profiles.active=pro | |||||
| server.servlet.context-path=/rms | server.servlet.context-path=/rms | ||||
| spring.servlet.multipart.max-file-size=100MB | spring.servlet.multipart.max-file-size=100MB | ||||