题目排序
@@ -173,6 +230,7 @@
@@ -433,13 +707,16 @@ export default {
}
.test-box {
display: flex;
+ min-height: 742px;
.test {
flex: 1;
height: fit-content;
- max-height: 642px;
+ max-height: 742px;
overflow-y: auto;
box-shadow: 0 0 10px 0 #999999;
margin-right: 20px;
+ box-sizing: border-box;
+ padding: 0 20px;
.test-title {
font-size: 20px !important;
font-weight: 700;
@@ -459,7 +736,10 @@ export default {
}
.test-group {
.test-group-title {
- padding: 10px 0;
+ position: relative;
+ height: 40px;
+ line-height: 30px;
+ padding: 10px 0 0 0;
}
}
}
@@ -471,16 +751,38 @@ export default {
width: 100%;
height: 200px;
border: 1px solid #999999;
+ .edit-title-info {
+ height: 60px;
+ width: 100%;
+ text-align: center;
+ font-weight: 600;
+ font-size: 16px !important;
+ line-height: 60px;
+ color: #000000;
+ span {
+ color: rgb(234, 163, 73);
+ }
+ }
+ .edit-button {
+ box-sizing: border-box;
+ padding: 0 20px;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+ .button-width {
+ width: 160px !important;
+ margin: 10px 0;
+ }
+ }
}
.edit-info {
flex: 1;
border: 1px solid #999999;
margin-top: 20px;
- max-height: 400px;
+ max-height: 500px;
padding: 10px;
overflow: auto;
.group-item {
- padding: 10px;
margin: 10px;
background: rgba(243, 243, 243, 0.6);
border-radius: 5px;
@@ -551,8 +853,7 @@ export default {
.outer-item,
.inner-item {
height: fit-content;
- padding: 0 20px;
- margin: 5px;
+ margin-bottom: 20px;
}
.tooltip {
position: absolute;
@@ -565,5 +866,10 @@ export default {
.hover {
border: 1px solid rgb(115, 142, 246);
background: rgb(233, 237, 253);
+ width: fit-content;
+}
+.title-bg {
+ background: rgb(115, 142, 246);
+ border-bottom: 1px solid rgb(115, 142, 246);
}
\ No newline at end of file
diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue
index 2147441..caab381 100644
--- a/src/views/basic/askTestQuestion/wrongQuestion.vue
+++ b/src/views/basic/askTestQuestion/wrongQuestion.vue
@@ -160,7 +160,9 @@
@@ -172,7 +174,7 @@
{{ item.knowledge }}
@@ -286,7 +291,7 @@ export default {
formData: {
classId: 1, // 班级选中
// type: "onDay", // 时间类型
- type: "onWeek", // 时间类型
+ type: "term", // 时间类型
dateRange: ["2022-03-01", "2023-05-01"], // 开始结束时间
startScoreRate: 0, // 开始区间
endScoreRate: 100, // 结束区间
@@ -295,13 +300,19 @@ export default {
grade: null, // 年级
gradeName: null, // 年级名称
},
- questions: JSON.parse(localStorage.getItem("testlist")) || [],
+ questions: [],
};
},
created() {
this.handleDate(this.formData.type);
this.queryLoading = true;
this.getGradeList();
+ if (!localStorage.getItem("testlist")) {
+ localStorage.setItem("testlist", JSON.stringify(this.questions));
+ } else {
+ this.questions = JSON.parse(localStorage.getItem("testlist"));
+ console.log(this.questions, "===");
+ }
},
methods: {
async loadAndModifyHTML(array) {
@@ -416,14 +427,15 @@ export default {
// 加入试卷
handleAddTest(item) {
- if (this.questions.includes(item.id)) return;
+ // if (this.questions.includes(item.id)) return;
+ if (this.questions.some((obj) => obj.id === item.id)) return;
this.questions = JSON.parse(localStorage.getItem("testlist")) || [];
- this.questions.push(item.id);
+ this.questions.push(item);
localStorage.setItem("testlist", JSON.stringify(this.questions));
},
// 移除试卷
handleDel(item) {
- let _index = this.questions.indexOf(item.id);
+ let _index = this.questions.findIndex((obj) => obj.id === item.id);
if (_index !== -1) {
this.questions.splice(_index, 1); // 从索引位置删除一个元素
localStorage.setItem("testlist", JSON.stringify(this.questions));
@@ -432,12 +444,13 @@ export default {
// 全部选中
handleAllTest() {
// 获取原来的localStorage
- let list = JSON.parse(localStorage.getItem("testlist"));
- console.log(list);
+ let list = JSON.parse(localStorage.getItem("testlist")) || [];
let ids = this.topicList.map((item) => {
- return item.id;
+ return item;
});
+ console.log(list, "-=-11-=");
+
this.questions = this.removeDuplicates([...ids, ...list]);
localStorage.setItem("testlist", JSON.stringify(this.questions));
},
@@ -445,7 +458,7 @@ export default {
handleDelTest() {
let list = this.removeMatchingValues(
this.topicList.map((item) => item.id),
- this.questions
+ this.questions.map((item) => item.id)
);
this.questions = list;
localStorage.setItem("testlist", JSON.stringify(this.questions));
@@ -457,7 +470,14 @@ export default {
},
// 去重
removeDuplicates(arr) {
- return [...new Set(arr)];
+ const seen = new Set();
+ return arr.filter((item) => {
+ if (!seen.has(item.id)) {
+ seen.add(item.id);
+ return true;
+ }
+ return false;
+ });
},
// 去除第二数组中存在第一数组中的值
removeMatchingValues(arr1, arr2) {
@@ -542,6 +562,30 @@ export default {
// 如果没有匹配,直接返回原字符串
return input;
},
+
+ // 获取ref
+ onIFrameLoad(index) {
+ const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe
+ const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
+ const body = iframeRef.contentWindow.document.body;
+ const height = body.scrollHeight; // 获取内容的高度
+ iframeRef.style.height = `${height}px`; // 设置 iframe 的高度
+ // 获取第一个P标签
+ const firstP = doc.getElementsByTagName("p")[0];
+ // 或者修改第一个 < p > 标签的内容;
+ if (firstP) {
+ console.log(firstP, firstP.innerHTML, "-----innerHTML-----");
+ let a = this.processString(firstP.innerHTML);
+ firstP.innerHTML = a;
+ }
+ },
+
+ // 子集删除后 父级需要更新
+ setQuestions() {
+ console.log("我被调用");
+
+ this.questions = JSON.parse(localStorage.getItem("testlist")) || [];
+ },
},
};
@@ -604,10 +648,8 @@ export default {
border-radius: 5px 5px 0 0;
}
.topic-info {
- height: 100% !important;
- // flex: 1;
- // overflow-y: auto;
- padding: 10px 20px;
+ overflow-y: auto;
+ max-height: 300px;
}
.topic-bottom {
height: 45px;
diff --git a/vue.config.js b/vue.config.js
index 8f82673..c680b57 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,7 +1,8 @@
const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
const IS_PROD = ["production", "prod"].includes(process.env.NODE_ENV);
-const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
+const BundleAnalyzerPlugin =
+ require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const TimeStamp = new Date().getTime();
@@ -26,13 +27,13 @@ module.exports = {
// target:"http://ezquiz.sunvotecloud.cn",
// target:"http://192.168.1.151:8089",
// target: "https://ezquiz.sunvotecloud.cn",
- // target: "http://121.40.127.171:8090",
- target:"http://127.0.0.1:8089",
+ target: "http://121.40.127.171:8090",
+ // target:"http://127.0.0.1:8089",
changeOrigin: true,
ws: true,
},
},
- disableHostCheck: true
+ disableHostCheck: true,
},
// configureWebpack: {
// devtool: 'source-map',
@@ -51,8 +52,8 @@ module.exports = {
// }
},
chainWebpack: (config) => {
- config.plugin('html').tap(args => {
- args[0].title = '云平台';
+ config.plugin("html").tap((args) => {
+ args[0].title = "云平台";
return args;
});
config.resolve.alias
@@ -108,4 +109,3 @@ module.exports = {
});
},
};
-