|
@@ -71,6 +71,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="errmsg" v-if="showAddListReachMax">{{ $t("memberlist['自訂名單已達上限提示字']")}}</div>
|
|
|
+ <div class="errmsg" v-if="showAddStudentReachMax">{{ $t("memberlist['新增單筆名單人數達上限提示字']") }}</div>
|
|
|
</div>
|
|
|
<!--新增學生名單-->
|
|
|
<div class="editmemberlist-card addmember-card" v-show="showAddMemberList && !showEditStudent">
|
|
@@ -149,6 +151,8 @@ export default {
|
|
|
showCorfirmDelete: false,
|
|
|
showEditListName: false,
|
|
|
showEditListNameMsg: false,
|
|
|
+ showAddListReachMax: false,
|
|
|
+ showAddStudentReachMax:false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -181,15 +185,20 @@ export default {
|
|
|
this.Hishow = false;
|
|
|
},
|
|
|
openAddMemberList() {
|
|
|
- let autolength = this.$parent.customMemberlist ? this.$parent.customMemberlist.length : 0;
|
|
|
- this.showAddMemberList = true;
|
|
|
- this.tempAddMemberList = [];
|
|
|
- this.addMemberListErrRow = [];
|
|
|
- this.addMemberListErrMsg = [];
|
|
|
- this.currentEditMemberListName = this.$t("memberlist['自訂名單']") + (autolength + 1);
|
|
|
- this.currentEditMemberList = {};
|
|
|
- this.addmemberlisttext = "";
|
|
|
- this.showAddMemberAutoSeatIDMsg = false;
|
|
|
+ this.showAddListReachMax = false;
|
|
|
+ if (this.$parent.customMemberlist.length < 3) {
|
|
|
+ let autolength = this.$parent.customMemberlist ? this.$parent.customMemberlist.length : 0;
|
|
|
+ this.showAddMemberList = true;
|
|
|
+ this.tempAddMemberList = [];
|
|
|
+ this.addMemberListErrRow = [];
|
|
|
+ this.addMemberListErrMsg = [];
|
|
|
+ this.currentEditMemberListName = this.$t("memberlist['自訂名單']") + (autolength + 1);
|
|
|
+ this.currentEditMemberList = {};
|
|
|
+ this.addmemberlisttext = "";
|
|
|
+ this.showAddMemberAutoSeatIDMsg = false;
|
|
|
+ } else {
|
|
|
+ this.showAddListReachMax = true;
|
|
|
+ }
|
|
|
},
|
|
|
closeEditMemberList() {
|
|
|
this.showEditMemberList = false;
|
|
@@ -217,6 +226,7 @@ export default {
|
|
|
data = data.map((item) => item.trim());
|
|
|
let isAutoSeatID = false;
|
|
|
this.showAddMemberAutoSeatIDMsg = false;
|
|
|
+
|
|
|
//檢測座號是否皆為數字,部分有部分沒有就直接自動編號
|
|
|
if (this.currentEditMemberListName == "") this.setAddMemberErrMsg(this.$t("memberlist['表單名稱不可為空']"));
|
|
|
if (data.length % 2 == 1) {
|
|
@@ -280,6 +290,10 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ if (this.tempAddMemberList.length > 100) {
|
|
|
+ this.setAddMemberErrMsg(this.$t("memberlist['名單人數上限提示字']"));
|
|
|
+ }
|
|
|
},
|
|
|
savecustomMemberlist() {
|
|
|
this.$parent.customMemberlist = this.$parent.customMemberlist ? this.$parent.customMemberlist : [];
|
|
@@ -301,6 +315,7 @@ export default {
|
|
|
this.$parent.customMemberlist.splice(deleteIndex, 1);
|
|
|
this.$parent.currentMemberList = {};
|
|
|
this.showCorfirmDelete = false;
|
|
|
+ this.showAddListReachMax = false;
|
|
|
},
|
|
|
setEditStudent(data) {
|
|
|
this.currentEditStudent = data;
|
|
@@ -354,6 +369,7 @@ export default {
|
|
|
const targetId = this.$parent.customMemberlist[parentIndex].list.findIndex((stu) => stu.memberID === this.currentEditStudent.memberID);
|
|
|
this.$parent.customMemberlist[parentIndex].list.splice(targetId, 1);
|
|
|
this.currentEditStudent = {};
|
|
|
+ this.showAddStudentReachMax=false
|
|
|
},
|
|
|
editStudent() {
|
|
|
this.showStudentErrMsgNum = 0;
|
|
@@ -363,11 +379,15 @@ export default {
|
|
|
this.tempEditName = this.currentEditStudent.memberName;
|
|
|
},
|
|
|
addStudent() {
|
|
|
- this.showStudentErrMsgNum = 0;
|
|
|
- this.showEditStudent = true;
|
|
|
- this.editStudentMode = "add";
|
|
|
- this.tempEditName = "";
|
|
|
- this.tempEditSeatID = "";
|
|
|
+ if ( this.$parent.currentMemberList.list.length < 100) {
|
|
|
+ this.showStudentErrMsgNum = 0;
|
|
|
+ this.showEditStudent = true;
|
|
|
+ this.editStudentMode = "add";
|
|
|
+ this.tempEditName = "";
|
|
|
+ this.tempEditSeatID = "";
|
|
|
+ } else {
|
|
|
+ this.showAddStudentReachMax=true
|
|
|
+ }
|
|
|
},
|
|
|
hintBugRow(row, index) {
|
|
|
return this.addMemberListErrRow.indexOf(index) != -1 ? "bug-row" : "";
|
|
@@ -379,6 +399,7 @@ export default {
|
|
|
this.showEditListNameMsg = false;
|
|
|
this.showEditListName = true;
|
|
|
this.tempEditListName = this.$parent.currentMemberList.listName;
|
|
|
+ this.showAddListReachMax = false;
|
|
|
},
|
|
|
updateListName() {
|
|
|
if (this.tempEditListName != "") {
|
|
@@ -549,7 +570,9 @@ export default {
|
|
|
}
|
|
|
.errmsg {
|
|
|
margin-left: 6px;
|
|
|
+ text-align: left;
|
|
|
color: red;
|
|
|
+ padding-bottom: 4px;
|
|
|
}
|
|
|
.hintmsg {
|
|
|
margin-left: 6px;
|