Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout
New file |
| | |
| | | VUE_APP_ENV = 'dev' |
| | | VUE_APP_API_URL = "https://jsek.bnuic.com" |
| | | PUBLIC_PATH = '/books/book' |
New file |
| | |
| | | VUE_APP_ENV = 'product' |
| | | VUE_APP_API_URL = "https://jsek.bnuic.com" |
| | | PUBLIC_PATH = 'http://182.92.203.7:3007/books/book' |
| | |
| | | { |
| | | "name": "temp-book", |
| | | "version": "0.1.0", |
| | | "name": "testbook", |
| | | "version": "1.0.0", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "build": "vue-cli-service build", |
| | | "serve": "vue-cli-service serve --mode dev", |
| | | "build": "vue-cli-service build --mode product", |
| | | "lint": "vue-cli-service lint" |
| | | }, |
| | | "dependencies": { |
| | |
| | | import axios from "axios"; |
| | | export const requestCtx = "https://jsek.bnuic.com"; // 请求地址 |
| | | export const resourceCtx = "http://182.92.203.7:3007/books/resource/3"; // 资源请求地址 |
| | | export const resourceCtx = "http://182.92.203.7:3007/books/resource/1"; // 资源请求地址 |
| | | export let activeBook = {}; // 资源请求地址 |
| | | export let goodsStore = ""; |
| | | // 请求教材配置信息 |
| | |
| | | export const tokenKey = "jsek-token"; |
| | | |
| | | const config = { |
| | | requestCtx, |
| | | resourceCtx, |
| | | activeBook, |
| | | requestTimeOut, |
| | |
| | | import { requestCtx, appId } from "@/assets/js/config.js"; |
| | | import { appId } from "@/assets/js/config.js"; |
| | | import defaultImg from "@/assets/images/default-book-img.png"; |
| | | import defaultBookFair from "@/assets/images/default-bookFair.png" |
| | | import bookCover from "@/assets/images/book-cover.png"; |
| | | import moment from "moment"; |
| | | // 处理列表查询结果 |
| | |
| | | export function getPublicImage(md5, width, height,storeInfo) { |
| | | let src = null; |
| | | if (md5) { |
| | | src = requestCtx + `/file/GetPreViewImage?md5=${md5}`; |
| | | src = process.env.VUE_APP_API_URL + `/file/GetPreViewImage?md5=${md5}`; |
| | | } else { |
| | | if(storeInfo == 'jsek_bookFair') { |
| | | // return defaultBookFair; |
| | |
| | | let cardList = [ |
| | | { |
| | | catalogName: "单选题", |
| | | infoList: [], |
| | | infoList: [] |
| | | }, |
| | | { |
| | | catalogName: "判断题", |
| | | infoList: [], |
| | | infoList: [] |
| | | }, |
| | | { |
| | | catalogName: "多选题", |
| | | infoList: [], |
| | | infoList: [] |
| | | }, |
| | | { |
| | | catalogName: "填空题", |
| | | infoList: [], |
| | | infoList: [] |
| | | }, |
| | | { |
| | | catalogName: "简答题", |
| | | infoList: [], |
| | | }, |
| | | infoList: [] |
| | | } |
| | | ]; |
| | | let singleChoiceArr = []; // 单选 |
| | | let judgeArr = []; // 判断 |
| | | let shortArr = []; // 简答 |
| | | let multipleChoiceArr = []; // 多选 |
| | | let completionArr = []; // 填空 |
| | | console.log('active',activeBook); |
| | | console.log("active", activeBook); |
| | | for (let qindex = 0; qindex < questionList.length; qindex++) { |
| | | const qitem = questionList[qindex]; |
| | | let query = { |
| | |
| | | Embedded_QuestionBank_StemStyle: [], |
| | | Embedded_QuestionBank_OptionStyle: [], |
| | | Embedded_QuestionBank_KnowledgePoint: [], |
| | | Embedded_QuestionBank_Difficulty: [], |
| | | }, |
| | | Embedded_QuestionBank_Difficulty: [] |
| | | } |
| | | }; |
| | | const res = await MG.store.getProductDetail(query); |
| | | res.datas.cmsDatas[0].datas.forEach((item, index) => { |
| | | let oldObj = {} |
| | | let oldObj = {}; |
| | | if(oldList) { |
| | | oldObj = oldList.find(item => item.id == qitem) |
| | | oldObj = oldList.find((item) => item.id == qitem); |
| | | } |
| | | const questionObj = { |
| | | number: index + 1, // 题号 |
| | |
| | | difficulty: item.Embedded_QuestionBank_Difficulty |
| | | ? 4 - item.Embedded_QuestionBank_Difficulty |
| | | : 0, // 难度等级 |
| | | userAnswer:oldObj ? oldObj.userAnswer : |
| | | item.Embedded_QuestionBank_QuestionType == "completion" || |
| | | userAnswer: oldObj |
| | | ? oldObj.userAnswer |
| | | : item.Embedded_QuestionBank_QuestionType == "completion" || |
| | | item.Embedded_QuestionBank_QuestionType == "multipleChoice" |
| | | ? [] |
| | | : "", |
| | |
| | | isRight: null, // 是否正确 |
| | | isComplete: false, |
| | | isCollect: true, |
| | | isUnfold: "", |
| | | isUnfold: "" |
| | | }; |
| | | // 多选和填空答案肯为数组,要转换JSON格式 |
| | | if ( |
| | |
| | | if (item == "input") { |
| | | questionObj.stem[i] = { |
| | | num: index, |
| | | data: "input", |
| | | data: "input" |
| | | }; |
| | | questionObj.userAnswer[index] = ""; |
| | | index++; |
| | |
| | | '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ' |
| | | ) |
| | | .replace(/\<p/gi, '<p class="stem-rich-p"') |
| | | .replace("../file", app.config.requestCtx + "/file"); |
| | | .replace("../file", process.env.VUE_APP_API_URL + "/file"); |
| | | } |
| | | // 选项富文本处理 |
| | | if ( |
| | |
| | | item.txt = item.txt |
| | | .replace(/\<img/gi, '<img class="option-rich-img"') |
| | | .replace(/\<p/gi, '<p class="stem-rich-p"') |
| | | .replace("../file", app.config.requestCtx + "/file"); |
| | | .replace("../file", process.env.VUE_APP_API_URL + "/file"); |
| | | }); |
| | | } |
| | | // 解析富文本处理 |
| | |
| | | } else if (item.Embedded_QuestionBank_QuestionType == "singleChoice") { |
| | | questionObj.type = "单选题"; |
| | | singleChoiceArr.push(questionObj); |
| | | } else if ( |
| | | item.Embedded_QuestionBank_QuestionType == "multipleChoice" |
| | | ) { |
| | | } else if (item.Embedded_QuestionBank_QuestionType == "multipleChoice") { |
| | | questionObj.type = "多选题"; |
| | | multipleChoiceArr.push(questionObj); |
| | | } else if (item.Embedded_QuestionBank_QuestionType == "completion") { |
| | |
| | | } |
| | | }); |
| | | } |
| | | cardList[0].infoList = singleChoiceArr |
| | | cardList[1].infoList = judgeArr |
| | | cardList[2].infoList = multipleChoiceArr |
| | | cardList[3].infoList = completionArr |
| | | cardList[4].infoList = shortArr |
| | | cardList[0].infoList = singleChoiceArr; |
| | | cardList[1].infoList = judgeArr; |
| | | cardList[2].infoList = multipleChoiceArr; |
| | | cardList[3].infoList = completionArr; |
| | | cardList[4].infoList = shortArr; |
| | | for (let index = 0; index < cardList.length; index++) { |
| | | const item = cardList[index]; |
| | | for (let cindex = 0; cindex < item.infoList.length; cindex++) { |
| | |
| | | citem.number = cindex + 1; |
| | | } |
| | | } |
| | | return cardList.filter(item=>item.infoList.length > 0); |
| | | return cardList.filter((item) => item.infoList.length > 0); |
| | | }; |
| | | |
| | | const getQuestionData = async (chapter,chapterData) => { |
| | | const data = { ...chapterData }; |
| | | const oldAnswerData = localStorage.getItem('oldAnswerData') |
| | | const oldData = oldAnswerData ? JSON.parse(oldAnswerData) :{} |
| | | let oldChapterData |
| | | const oldAnswerData = localStorage.getItem("oldAnswerData"); |
| | | const oldData = oldAnswerData ? JSON.parse(oldAnswerData) : {}; |
| | | let oldChapterData; |
| | | if(oldData) { |
| | | oldChapterData = oldData[chapter] |
| | | oldChapterData = oldData[chapter]; |
| | | } |
| | | for (let key in chapterData) { |
| | | let oldList = [] |
| | | let oldList = []; |
| | | if(oldChapterData) { |
| | | oldList = oldChapterData[key] |
| | | oldList = oldChapterData[key]; |
| | | } |
| | | data[key] = await getQuestionList(oldList,chapterData[key]); |
| | | } |
| | |
| | | import config from "../js/config" |
| | | const getResourcePath = (md5) => { |
| | | return config.requestCtx + '/file/api/ApiDownload?md5=' + md5 |
| | | return process.env.VUE_APP_API_URL + '/file/api/ApiDownload?md5=' + md5 |
| | | } |
| | | |
| | | export default getResourcePath |
| | |
| | | 46:[65979, 65980, 65981], |
| | | 49:[65983, 65984], |
| | | 52:[65986, 65987], |
| | | 54_1:[65990, 65991, 65992, 65993, 65994, 65995, 65996, 65997, 65998, 65999, |
| | | 66000, 66001, 66002, 66003, 66004, 66005], |
| | | 54_2:[66008, 66009, 66010, 66011, 66012, 66013, 66014, 66015, 66016, 66017, |
| | | 66018, 66019, 66020, 66021, 66022, 66023] |
| | | 54_1: [ |
| | | 65990, 65991, 65992, 65993, 65994, 65995, 65996, 65997, 65998, 65999, |
| | | 66000, 66001, 66002, 66003, 66004, 66005 |
| | | ], |
| | | 54_2: [ |
| | | 66008, 66009, 66010, 66011, 66012, 66013, 66014, 66015, 66016, 66017, |
| | | 66018, 66019, 66020, 66021, 66022, 66023 |
| | | ] |
| | | }, |
| | | 3:{ |
| | | 64:[66025, 66026, 66027, 66028, 66029], |
| | |
| | | 9:{ |
| | | 243:[66396,66397,66398,66399,66400], |
| | | 255:[66412,66413,66414,66415,66416], |
| | | 256_1:[66418,66419,66420,66421,66422,66423,66424,66425,66426,66427,66438,66439,66440,66441,66442,66443], |
| | | 256_2:[66428,66429,66430,66431,66432,66433,66434,66435,66436,66437,66402,66403,66404,66405,66406,66407] |
| | | 256_1: [ |
| | | 66418, 66419, 66420, 66421, 66422, 66423, 66424, 66425, 66426, 66427, |
| | | 66438, 66439, 66440, 66441, 66442, 66443 |
| | | ], |
| | | 256_2: [ |
| | | 66428, 66429, 66430, 66431, 66432, 66433, 66434, 66435, 66436, 66437, |
| | | 66402, 66403, 66404, 66405, 66406, 66407 |
| | | ] |
| | | }, |
| | | 10:{ |
| | | 267:[66445,66446,66447,66448,66449,66450], |
| | | 272:[66455,66456,66457,66458,66459], |
| | | 273_1:[66469,66470,66471,66472,66473,66474,66475,66476,66477,66478,66502,66503,66504,66505,66506,66507], |
| | | 273_2:[66479,66480,66481,66482,66483,66484,66485,66486,66487,66488,66495,66496,66497,66498,66499,66500] |
| | | 273_1: [ |
| | | 66469, 66470, 66471, 66472, 66473, 66474, 66475, 66476, 66477, 66478, |
| | | 66502, 66503, 66504, 66505, 66506, 66507 |
| | | ], |
| | | 273_2: [ |
| | | 66479, 66480, 66481, 66482, 66483, 66484, 66485, 66486, 66487, 66488, |
| | | 66495, 66496, 66497, 66498, 66499, 66500 |
| | | ] |
| | | }, |
| | | 11:{ |
| | | 274_1:[66529,66530,66531,66532,66533,66534,66535,66536,66537,66538,66629,66630,66631,66632,66633,66634], |
| | | 274_2:[66539,66540,66541,66542,66543,66544,66545,66546,66547,66548,66635,66636,66637,66638,66639,66640], |
| | | 274_3:[66549,66550,66551,66552,66553,66554,66555,66556,66557,66558,66643,66644,66645,66646,66647,66648], |
| | | 274_4:[66559,66560,66561,66562,66563,66564,66565,66566,66567,66568,66650,66651,66652,66653,66654,66655], |
| | | 274_5:[66569,66570,66571,66572,66573,66574,66575,66576,66577,66578,66657,66658,66659,66660,66661,66662], |
| | | 274_6:[66579,66580,66581,66582,66583,66584,66585,66586,66587,66588,66663,66664,66665,66666,66667,66668], |
| | | 274_7:[66589,66590,66591,66592,66593,66594,66595,66596,66597,66598,66669,66670,66671,66672,66673,66674], |
| | | 274_8:[66599,66600,66601,66602,66603,66604,66605,66606,66607,66608,66675,66676,66677,66678,66679,66680], |
| | | 274_9:[66609,66610,66611,66612,66613,66614,66615,66616,66617,66618,66681,66682,66683,66684,66685,66686], |
| | | 274_10:[66619,66620,66621,66622,66623,66624,66625,66626,66627,66628,66688,66689,66690,66691,66692,66693], |
| | | 274_1: [ |
| | | 66529, 66530, 66531, 66532, 66533, 66534, 66535, 66536, 66537, 66538, |
| | | 66629, 66630, 66631, 66632, 66633, 66634 |
| | | ], |
| | | 274_2: [ |
| | | 66539, 66540, 66541, 66542, 66543, 66544, 66545, 66546, 66547, 66548, |
| | | 66635, 66636, 66637, 66638, 66639, 66640 |
| | | ], |
| | | 274_3: [ |
| | | 66549, 66550, 66551, 66552, 66553, 66554, 66555, 66556, 66557, 66558, |
| | | 66643, 66644, 66645, 66646, 66647, 66648 |
| | | ], |
| | | 274_4: [ |
| | | 66559, 66560, 66561, 66562, 66563, 66564, 66565, 66566, 66567, 66568, |
| | | 66650, 66651, 66652, 66653, 66654, 66655 |
| | | ], |
| | | 274_5: [ |
| | | 66569, 66570, 66571, 66572, 66573, 66574, 66575, 66576, 66577, 66578, |
| | | 66657, 66658, 66659, 66660, 66661, 66662 |
| | | ], |
| | | 274_6: [ |
| | | 66579, 66580, 66581, 66582, 66583, 66584, 66585, 66586, 66587, 66588, |
| | | 66663, 66664, 66665, 66666, 66667, 66668 |
| | | ], |
| | | 274_7: [ |
| | | 66589, 66590, 66591, 66592, 66593, 66594, 66595, 66596, 66597, 66598, |
| | | 66669, 66670, 66671, 66672, 66673, 66674 |
| | | ], |
| | | 274_8: [ |
| | | 66599, 66600, 66601, 66602, 66603, 66604, 66605, 66606, 66607, 66608, |
| | | 66675, 66676, 66677, 66678, 66679, 66680 |
| | | ], |
| | | 274_9: [ |
| | | 66609, 66610, 66611, 66612, 66613, 66614, 66615, 66616, 66617, 66618, |
| | | 66681, 66682, 66683, 66684, 66685, 66686 |
| | | ], |
| | | 274_10: [ |
| | | 66619, 66620, 66621, 66622, 66623, 66624, 66625, 66626, 66627, 66628, |
| | | 66688, 66689, 66690, 66691, 66692, 66693 |
| | | ] |
| | | } |
| | | } |
| | | }; |
| | | |
| | | export default testData |
| | | export default testData; |
| | |
| | | const testData = { |
| | | 1: { |
| | | 9: [66984,66985,66986], |
| | | }, |
| | | 9: [66984, 66985, 66986] |
| | | } |
| | | }; |
| | | |
| | | export default testData |
| | | export default testData; |
| | |
| | | // import toolClass from '@/assets/js/toolClass.js' |
| | | // 创建 axios 实例 |
| | | const service = axios.create({ |
| | | baseURL: myConfig.requestCtx, |
| | | baseURL: process.env.VUE_APP_API_URL, |
| | | timeout: myConfig.requestTimeOut // 请求超时时间 |
| | | }) |
| | | |
| | |
| | | const { defineConfig } = require("@vue/cli-service"); |
| | | module.exports = defineConfig({ |
| | | // publicPath: 'http://182.92.203.7:3007/books/book/3', |
| | | publicPath:'/books/book', |
| | | publicPath: process.env.PUBLIC_PATH, |
| | | transpileDependencies: true, |
| | | lintOnSave: false, |
| | | // devServer: { |
| | |
| | | output: { |
| | | library: `app-content`, |
| | | libraryTarget: "umd", |
| | | chunkLoadingGlobal: `webpackJsonp_app-content`, |
| | | }, |
| | | chunkLoadingGlobal: `webpackJsonp_app-content` |
| | | } |
| | | }, |
| | | chainWebpack: (config) => { |
| | | config.module |
| | |
| | | .loader("change-prefix-loader") |
| | | .options({ |
| | | prefix: "el-", |
| | | replace: "gp-", |
| | | replace: "gp-" |
| | | }) |
| | | .end(); |
| | | }, |
| | | } |
| | | }); |