diff --git a/src/views/basic/ask/index.vue b/src/views/basic/ask/index.vue
index 6c3ba87..2f1545c 100644
--- a/src/views/basic/ask/index.vue
+++ b/src/views/basic/ask/index.vue
@@ -8,41 +8,93 @@
班级:
-
-
+
+
-
+
科目:
- 全选
+ 全选
-
- {{ item
- }}
+
+ {{ item }}
+
日期:
-
+
~
-
+
- 本周
- 本月
- 本季度
+ 本周
+ 本月
+ 本季度
@@ -72,8 +124,8 @@ export default {
classList: [], //班级
subjectList: [], //科目
- isIndeterminate: true,//全选样式
- allSubject: false,//全选状态
+ isIndeterminate: true, //全选样式
+ allSubject: false, //全选状态
};
},
async created() {
@@ -101,10 +153,11 @@ export default {
this.query.subjectNames = val ? this.subjectList : [];
},
handleChecked(value) {
- console.log(value)
+ console.log(value);
let checkedCount = value.length;
this.allSubject = checkedCount === this.subjectList.length;
- this.isIndeterminate = checkedCount > 0 && checkedCount < this.subjectList.length;
+ this.isIndeterminate =
+ checkedCount > 0 && checkedCount < this.subjectList.length;
},
setDate(index) {
const that = this;
@@ -168,18 +221,18 @@ export default {
},
async changeclass() {
- this.allSubject = false
- this.query.subjectNames = []
+ this.allSubject = false;
+ this.query.subjectNames = [];
await this._QuerySubjectList();
},
async _QueryClassList() {
const fetchClassList =
this.role == "ROLE_BANZHUREN"
- ? this.$request.cTClassList :
- this.role == "ROLE_PERSONAL"
- ? this.$request.pClassList
- : this.$request.tClassList;
+ ? this.$request.cTClassList
+ : this.role == "ROLE_PERSONAL"
+ ? this.$request.pClassList
+ : this.$request.tClassList;
const { data, status, info } = await fetchClassList();
if (status === 0) {
this.classList = data.list.map((item) => {
@@ -196,10 +249,10 @@ export default {
async _QuerySubjectList() {
const fetchSubjectList =
this.role == "ROLE_BANZHUREN"
- ? this.$request.cTSubjectList :
- this.role == "ROLE_PERSONAL"
- ? this.$request.pSubjectList
- : this.$request.tSubjectList;
+ ? this.$request.cTSubjectList
+ : this.role == "ROLE_PERSONAL"
+ ? this.$request.pSubjectList
+ : this.$request.tSubjectList;
const { data, status, info } = await fetchSubjectList({
classId: this.query.classId,
@@ -207,9 +260,11 @@ export default {
if (status === 0) {
this.subjectList = data.subjectNames || [];
if (this.role == "ROLE_BANZHUREN") {
- this.query.subjectNames = this.subjectList
+ this.query.subjectNames = this.subjectList;
} else {
- this.subjectList.length ? this.query.subjectNames.push(this.subjectList[0]) : "";
+ this.subjectList.length
+ ? (this.query.subjectNames = this.subjectList[0])
+ : "";
}
} else {
this.$message.error(info);
@@ -219,29 +274,29 @@ export default {
//回主页
goHome() {
this.$router.push({
- path: '/index'
- })
+ path: "/index",
+ });
},
//去列表
goList() {
let className;
- this.classList.map(item => {
+ this.classList.map((item) => {
if (item.value == this.query.classId) {
- className = item.label
+ className = item.label;
}
- })
- if(this.query.subjectNames.length == 0){
- this.$message.warning("请选择科目!")
- return
+ });
+ if (this.query.subjectNames.length == 0) {
+ this.$message.warning("请选择科目!");
+ return;
}
this.$router.push({
- path: '/askList',
+ path: "/askList",
query: {
className: className,
- params: JSON.stringify(this.query)
- }
- })
- }
+ params: JSON.stringify(this.query),
+ },
+ });
+ },
},
};
@@ -259,7 +314,7 @@ div::-webkit-scrollbar-thumb {