Commit 7812e986196aed320204e84d5487c29b5b061fbf

Authored by 梁保满
1 parent 22095aba

班主任查看报表添加额外信息

src/api/axios.js
@@ -24,6 +24,13 @@ service.interceptors.request.use( @@ -24,6 +24,13 @@ service.interceptors.request.use(
24 const source = axios.CancelToken.source(); 24 const source = axios.CancelToken.source();
25 store.commit("setTokenSources", [source.token, source.cancel]); 25 store.commit("setTokenSources", [source.token, source.cancel]);
26 config.cancelToken = source.token; 26 config.cancelToken = source.token;
  27 + const role = store.getters.info.showRole || store.getters.info.permissions[0].role;
  28 + if (role == "ROLE_BANZHUREN") {
  29 + const classes = store.getters.classes
  30 + config.manager = 1
  31 + config.classes = classes
  32 + }
  33 + console.log(config)
27 return config; 34 return config;
28 }, 35 },
29 (error) => { 36 (error) => {
src/components/charts/lineChart.vue
@@ -57,6 +57,7 @@ export default { @@ -57,6 +57,7 @@ export default {
57 }, 57 },
58 axisLabel: { 58 axisLabel: {
59 color: "#333", 59 color: "#333",
  60 + interval: 0
60 }, 61 },
61 }, 62 },
62 yAxis: { 63 yAxis: {
src/components/exportDia.vue
@@ -25,10 +25,13 @@ @@ -25,10 +25,13 @@
25 <el-table-column prop="studentName" label="姓名" align="center"></el-table-column> 25 <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
26 <el-table-column label="班名" align="center"> 26 <el-table-column label="班名" align="center">
27 <template slot-scope="scoped">{{ 27 <template slot-scope="scoped">{{
28 - scoped.row.classRank || scoped.row.rank }}</template> 28 + scoped.row.classRank || scoped.row.rank || scoped.row.examList[0].classRank }}</template>
29 </el-table-column> 29 </el-table-column>
30 - <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{  
31 - scoped.row.correctRate|| scoped.row.scoringRate }}%</template></el-table-column> 30 + <el-table-column prop="correctRate" :label="this.lastLabel" align="center"><template slot-scope="scoped">
  31 + <span v-if="scoped.row.correctRate || scoped.row.scoringRate">{{
  32 + scoped.row.correctRate || scoped.row.scoringRate }}%</span>
  33 + <span v-else>{{ scoped.row.examList[0].score }}</span>
  34 + </template></el-table-column>
32 </el-table> 35 </el-table>
33 </ul> 36 </ul>
34 <div class="dialog-footer" slot="footer"> 37 <div class="dialog-footer" slot="footer">
@@ -44,7 +47,11 @@ export default { @@ -44,7 +47,11 @@ export default {
44 name: "exportDia", 47 name: "exportDia",
45 props: { 48 props: {
46 diaShow: Boolean, 49 diaShow: Boolean,
47 - exportStudent: Array 50 + exportStudent: Array,
  51 + lastLabel: {
  52 + type: String,
  53 + default: '总正确率'
  54 + }
48 }, 55 },
49 data() { 56 data() {
50 return { 57 return {
src/store/index.js
@@ -25,6 +25,7 @@ const store = new Vuex.Store({ @@ -25,6 +25,7 @@ const store = new Vuex.Store({
25 ? JSON.parse(localStorage.getItem("addRouters")) 25 ? JSON.parse(localStorage.getItem("addRouters"))
26 : [], //动态路由 26 : [], //动态路由
27 tokenSources: new Map(), //正在请求接口(切换取消请求) 27 tokenSources: new Map(), //正在请求接口(切换取消请求)
  28 + classes: localStorage.getItem("classes") || "", //班主任选择班级查询报表(用于教学班学生筛选)
28 }, 29 },
29 mutations: { 30 mutations: {
30 setToken(state, token) { 31 setToken(state, token) {
@@ -71,6 +72,10 @@ const store = new Vuex.Store({ @@ -71,6 +72,10 @@ const store = new Vuex.Store({
71 delTokenSources(state, data) { 72 delTokenSources(state, data) {
72 state.tokenSources.delete(data); 73 state.tokenSources.delete(data);
73 }, 74 },
  75 + setClasses(state, data) {
  76 + state.classes = data;
  77 + localStorage.setItem("classes", data);
  78 + }
74 }, 79 },
75 actions: { 80 actions: {
76 Login({ state, commit }, params) { 81 Login({ state, commit }, params) {
@@ -192,9 +197,10 @@ const store = new Vuex.Store({ @@ -192,9 +197,10 @@ const store = new Vuex.Store({
192 getters: { 197 getters: {
193 addRouters: (state) => state.addRouters, 198 addRouters: (state) => state.addRouters,
194 token: (state) => state.token, 199 token: (state) => state.token,
195 - code: (state) => state.csCode, 200 + csCode: (state) => state.csCode,
196 info: (state) => state.info, 201 info: (state) => state.info,
197 routers: (state) => state.routers, 202 routers: (state) => state.routers,
  203 + classes: (state) => state.classes,
198 logoShow: (state) => state.layoutStore.logoShow, 204 logoShow: (state) => state.layoutStore.logoShow,
199 isCollapse: (state) => state.layoutStore.isCollapse, 205 isCollapse: (state) => state.layoutStore.isCollapse,
200 uniquerouter: (state) => state.layoutStore.uniquerouter, 206 uniquerouter: (state) => state.layoutStore.uniquerouter,
src/views/admin/device/index.vue
@@ -284,7 +284,7 @@ export default { @@ -284,7 +284,7 @@ export default {
284 }; 284 };
285 }, 285 },
286 created() { 286 created() {
287 - this.code = localStorage.getItem("csCode") || ""; 287 + this.code = this.$store.getters.csCode;
288 this.stationReport(); 288 this.stationReport();
289 this._QueryData(); 289 this._QueryData();
290 }, 290 },
src/views/basic/ask/archiving.vue
@@ -494,7 +494,7 @@ export default { @@ -494,7 +494,7 @@ export default {
494 }; 494 };
495 }, 495 },
496 async created() { 496 async created() {
497 - this.code = localStorage.getItem("csCode") || ""; 497 + this.code = this.$store.getters.csCode;
498 this.role = 498 this.role =
499 this.$store.getters.info.showRole || 499 this.$store.getters.info.showRole ||
500 this.$store.getters.info.permissions[0].role; 500 this.$store.getters.info.permissions[0].role;
src/views/basic/ask/index.vue
@@ -77,7 +77,7 @@ export default { @@ -77,7 +77,7 @@ export default {
77 }; 77 };
78 }, 78 },
79 async created() { 79 async created() {
80 - this.code = localStorage.getItem("csCode") || ""; 80 + this.code = this.$store.getters.csCode;
81 this.role = 81 this.role =
82 this.$store.getters.info.showRole || 82 this.$store.getters.info.showRole ||
83 this.$store.getters.info.permissions[0].role; 83 this.$store.getters.info.permissions[0].role;
src/views/basic/ask/list.vue
@@ -93,9 +93,7 @@ export default { @@ -93,9 +93,7 @@ export default {
93 } 93 }
94 }, 94 },
95 async created() { 95 async created() {
96 - this.code = localStorage.getItem("csCode") || "";  
97 - const queryData = this.$route.query.params  
98 - queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : '' 96 + this.code = this.$store.getters.csCode;
99 this.init() 97 this.init()
100 }, 98 },
101 watch: { 99 watch: {
@@ -109,12 +107,15 @@ export default { @@ -109,12 +107,15 @@ export default {
109 methods: { 107 methods: {
110 //初始化 108 //初始化
111 init() { 109 init() {
  110 + const queryData = this.$route.query.params
  111 + queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : ''
112 this.role = 112 this.role =
113 this.$store.getters.info.showRole || 113 this.$store.getters.info.showRole ||
114 this.$store.getters.info.permissions[0].role; 114 this.$store.getters.info.permissions[0].role;
115 if (this.role != "ROLE_PERSONAL") { 115 if (this.role != "ROLE_PERSONAL") {
116 this._QueryGdClass() 116 this._QueryGdClass()
117 }; 117 };
  118 + this.$store.commit('setClasses', this.query.classId)
118 this.page = 1 119 this.page = 1
119 this.total = 0 120 this.total = 0
120 this.tableData = [] 121 this.tableData = []
src/views/basic/device/index.vue
@@ -387,7 +387,7 @@ export default { @@ -387,7 +387,7 @@ export default {
387 }; 387 };
388 }, 388 },
389 created() { 389 created() {
390 - this.code = localStorage.getItem("csCode") || ""; 390 + this.code = this.$store.getters.csCode;
391 this.role = 391 this.role =
392 this.$store.getters.info.showRole || 392 this.$store.getters.info.showRole ||
393 this.$store.getters.info.permissions[0].role; 393 this.$store.getters.info.permissions[0].role;
src/views/basic/setUp/account.vue
@@ -435,7 +435,7 @@ export default { @@ -435,7 +435,7 @@ export default {
435 }; 435 };
436 }, 436 },
437 created() { 437 created() {
438 - this.code = localStorage.getItem("csCode") || ""; 438 + this.code = this.$store.getters.csCode;
439 this.role = 439 this.role =
440 this.$store.getters.info.showRole || 440 this.$store.getters.info.showRole ||
441 this.$store.getters.info.permissions[0].role; 441 this.$store.getters.info.permissions[0].role;
src/views/basic/setUp/clazz.vue
@@ -200,7 +200,7 @@ export default { @@ -200,7 +200,7 @@ export default {
200 } 200 }
201 }, 201 },
202 async created() { 202 async created() {
203 - this.code = localStorage.getItem("csCode") || ""; 203 + this.code = this.$store.getters.csCode;
204 this._QueryData(); 204 this._QueryData();
205 this._QuerySubject(); 205 this._QuerySubject();
206 }, 206 },
src/views/basic/setUp/school.vue
@@ -214,7 +214,7 @@ export default { @@ -214,7 +214,7 @@ export default {
214 }, 214 },
215 }, 215 },
216 created() { 216 created() {
217 - this.code = localStorage.getItem("csCode") || ""; 217 + this.code = this.$store.getters.csCode;
218 this._QueryDataSchool(); 218 this._QueryDataSchool();
219 this._QueryDataGrade(); 219 this._QueryDataGrade();
220 this._QuerySectionList(); 220 this._QuerySectionList();
src/views/basic/setUp/student.vue
@@ -289,7 +289,7 @@ export default { @@ -289,7 +289,7 @@ export default {
289 }, 289 },
290 }, 290 },
291 async created() { 291 async created() {
292 - this.code = localStorage.getItem("csCode") || ""; 292 + this.code = this.$store.getters.csCode;
293 this.role = 293 this.role =
294 this.$store.getters.info.showRole || 294 this.$store.getters.info.showRole ||
295 this.$store.getters.info.permissions[0].role; 295 this.$store.getters.info.permissions[0].role;
src/views/basic/setUp/teacher.vue
@@ -313,7 +313,7 @@ export default { @@ -313,7 +313,7 @@ export default {
313 } 313 }
314 }, 314 },
315 async created() { 315 async created() {
316 - this.code = localStorage.getItem("csCode") || ""; 316 + this.code = this.$store.getters.csCode;
317 this._QueryData(4); 317 this._QueryData(4);
318 await this._QueryDataGrade(); 318 await this._QueryDataGrade();
319 // this._RoleList(); 319 // this._RoleList();
src/views/basic/test/analysis.vue
@@ -41,7 +41,7 @@ export default { @@ -41,7 +41,7 @@ export default {
41 this.$store.getters.info.showRole || 41 this.$store.getters.info.showRole ||
42 this.$store.getters.info.permissions[0].role; 42 this.$store.getters.info.permissions[0].role;
43 this.id = this.$route.query.id || ""; 43 this.id = this.$route.query.id || "";
44 - this.ids = this.$route.query.ids && this.$route.query.ids.split(",") || ""; 44 + this.ids = this.$route.query.ids && this.$route.query.ids.split(",") || [];
45 this.type = this.$route.query.type 45 this.type = this.$route.query.type
46 this.classId = this.$route.query.classId || ""; 46 this.classId = this.$route.query.classId || "";
47 this.title = this.$route.query.title || "" 47 this.title = this.$route.query.title || ""
src/views/basic/test/components/contrast.vue
@@ -131,7 +131,6 @@ export default { @@ -131,7 +131,6 @@ export default {
131 props: { 131 props: {
132 role: "", 132 role: "",
133 ids: Array, 133 ids: Array,
134 - classId: String,  
135 subjectName: String, 134 subjectName: String,
136 title: String, 135 title: String,
137 }, 136 },
src/views/basic/test/components/multipleSubTest.vue
@@ -52,8 +52,8 @@ export default { @@ -52,8 +52,8 @@ export default {
52 props: { 52 props: {
53 role: "", 53 role: "",
54 ids: Array, 54 ids: Array,
55 - classIds: Array,  
56 - subjectNames: Array, 55 + classId: String,
  56 + subjectName: String,
57 }, 57 },
58 data() { 58 data() {
59 return { 59 return {
@@ -135,13 +135,34 @@ export default { @@ -135,13 +135,34 @@ export default {
135 }, 135 },
136 //查看雷达图 136 //查看雷达图
137 openChart(obj) { 137 openChart(obj) {
  138 +
138 this.chartTitle = obj.studentName + '-多科-多课时作答表现图' 139 this.chartTitle = obj.studentName + '-多科-多课时作答表现图'
139 - let subjectList = obj.dataList.map(item => item.subjectName) 140 + let max = 0;
  141 + let subjectList = obj.dataList.map(item => {
  142 + let score = Number(item.highestScore || item.score)
  143 + max = score > max ? score : max
  144 + return item.subjectName
  145 + })
  146 + max += 10
  147 + max = max > 150 ? 150 : max
  148 + this.chartData = {
  149 + indicator: [
  150 + {
  151 + name: '', max: max,
  152 + axisLabel: {
  153 + show: true,
  154 + showMaxLabel: true,
  155 + },
  156 + },
  157 + ],
  158 + seriesData: []
  159 + }
140 subjectList.map((item, index) => { 160 subjectList.map((item, index) => {
141 if (index < 1) { 161 if (index < 1) {
142 this.chartData.indicator[index].name = item 162 this.chartData.indicator[index].name = item
  163 + this.chartData.indicator[index].max = max
143 } else { 164 } else {
144 - this.chartData.indicator.push({ name: item, max: 100 }) 165 + this.chartData.indicator.push({ name: item, max: max })
145 } 166 }
146 }) 167 })
147 // 为了美观 168 // 为了美观
@@ -149,7 +170,7 @@ export default { @@ -149,7 +170,7 @@ export default {
149 let num = this.chartData.indicator.length 170 let num = this.chartData.indicator.length
150 for (let i = 0; i < 6; i++) { 171 for (let i = 0; i < 6; i++) {
151 if (i >= num) { 172 if (i >= num) {
152 - this.chartData.indicator.push({ name: "", max: 100 }) 173 + this.chartData.indicator.push({ name: "", max: max })
153 } 174 }
154 } 175 }
155 } 176 }
@@ -174,7 +195,7 @@ export default { @@ -174,7 +195,7 @@ export default {
174 async phaseExamReport() { 195 async phaseExamReport() {
175 this.loading = true; 196 this.loading = true;
176 const { data, status, info } = await this.$request.cTPhaseExamReport({ 197 const { data, status, info } = await this.$request.cTPhaseExamReport({
177 - classIds: this.classId.split(','), 198 + classId: this.classId,
178 examIds: this.ids, 199 examIds: this.ids,
179 subjectNames: this.subjectList, 200 subjectNames: this.subjectList,
180 }); 201 });
src/views/basic/test/components/multipleTest.vue
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" /> 31 <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" />
32 </div> 32 </div>
33 </el-dialog> 33 </el-dialog>
34 - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" /> 34 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" lastLabel="总分"/>
35 </div> 35 </div>
36 <!-- 单科多卷 --> 36 <!-- 单科多卷 -->
37 </template> 37 </template>
src/views/basic/test/components/scoreSet.vue
@@ -161,7 +161,7 @@ export default { @@ -161,7 +161,7 @@ export default {
161 upSuccess(res) { 161 upSuccess(res) {
162 this.$message.success("导入成功"); 162 this.$message.success("导入成功");
163 this.diaUp = false; 163 this.diaUp = false;
164 - this._QueryData() 164 + this.closeScoreSet()
165 }, 165 },
166 async downExcel() { 166 async downExcel() {
167 //模板下载 167 //模板下载
src/views/basic/test/components/test.vue
@@ -651,7 +651,7 @@ div::-webkit-scrollbar-thumb { @@ -651,7 +651,7 @@ div::-webkit-scrollbar-thumb {
651 background-color: #ffebec; 651 background-color: #ffebec;
652 font-size: 14px; 652 font-size: 14px;
653 color: #fd9795; 653 color: #fd9795;
654 - margin: 10px 20px 0 20px; 654 + margin: 0 20px 10px 20px;
655 display: flex; 655 display: flex;
656 656
657 &-p { 657 &-p {
src/views/basic/test/index.vue
@@ -87,7 +87,7 @@ export default { @@ -87,7 +87,7 @@ export default {
87 }; 87 };
88 }, 88 },
89 async created() { 89 async created() {
90 - this.code = localStorage.getItem("csCode") || ""; 90 + this.code = this.$store.getters.csCode;
91 this.role = 91 this.role =
92 this.$store.getters.info.showRole || 92 this.$store.getters.info.showRole ||
93 this.$store.getters.info.permissions[0].role; 93 this.$store.getters.info.permissions[0].role;
src/views/basic/test/list.vue
@@ -62,13 +62,11 @@ @@ -62,13 +62,11 @@
62 <el-table-column prop="subjectName" label="科目" align="center"></el-table-column> 62 <el-table-column prop="subjectName" label="科目" align="center"></el-table-column>
63 <el-table-column prop="classList" label="班级" align="center"> 63 <el-table-column prop="classList" label="班级" align="center">
64 <template slot-scope="scoped"> 64 <template slot-scope="scoped">
65 - <span v-for="(item, index) in scoped.row.classList">{{  
66 - `${index == 0 ? '' : '/'}` + item.className  
67 - }}</span> 65 + <span v-for="(item, index) in scoped.row.classNames">{{ `${index == 0 ? '' : '/'}` + item }}</span>
68 </template> 66 </template>
69 </el-table-column> 67 </el-table-column>
70 <el-table-column prop="title" label="试卷名称" align="center"></el-table-column> 68 <el-table-column prop="title" label="试卷名称" align="center"></el-table-column>
71 - <el-table-column prop="score" label="卷面分" align="center"></el-table-column> 69 + <el-table-column prop="examPaperScore" label="卷面分" align="center"></el-table-column>
72 <el-table-column label="操作" align="center"> 70 <el-table-column label="操作" align="center">
73 <template slot-scope="scoped"> 71 <template slot-scope="scoped">
74 <el-button type="primary" circle size="mini" icon="el-icon-arrow-right" 72 <el-button type="primary" circle size="mini" icon="el-icon-arrow-right"
@@ -126,8 +124,7 @@ export default { @@ -126,8 +124,7 @@ export default {
126 } 124 }
127 }, 125 },
128 async created() { 126 async created() {
129 - this.code = localStorage.getItem("csCode") || "";  
130 - 127 + this.code = this.$store.getters.csCode;
131 this.init() 128 this.init()
132 }, 129 },
133 mounted() { 130 mounted() {
@@ -147,6 +144,7 @@ export default { @@ -147,6 +144,7 @@ export default {
147 const queryData = this.$route.query.params 144 const queryData = this.$route.query.params
148 queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : '' 145 queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : ''
149 console.log(this.query) 146 console.log(this.query)
  147 + this.$store.commit('setClasses', this.query.classId.join(','))
150 if (this.query.classId.length > 1) { 148 if (this.query.classId.length > 1) {
151 this.isMultipleClass = true 149 this.isMultipleClass = true
152 } 150 }
@@ -225,11 +223,12 @@ export default { @@ -225,11 +223,12 @@ export default {
225 }, 223 },
226 // 多班对比 224 // 多班对比
227 linkContrast(obj) { 225 linkContrast(obj) {
  226 + console.log(obj)
228 this.$router.push({ 227 this.$router.push({
229 path: "/testAnalysis", 228 path: "/testAnalysis",
230 query: { 229 query: {
231 - ids: obj.ids,  
232 - classId: obj.classList.map(item => item.classId).join(), 230 + ids: obj.ids.join(','),
  231 + classId: obj.classIds.join(','),
233 subjectName: obj.subjectName, 232 subjectName: obj.subjectName,
234 title: obj.title, 233 title: obj.title,
235 type: 4 234 type: 4
@@ -284,7 +283,7 @@ export default { @@ -284,7 +283,7 @@ export default {
284 for (let key in this.query) { 283 for (let key in this.query) {
285 if (this.query[key] != "") { 284 if (this.query[key] != "") {
286 if (key == 'classId') { 285 if (key == 'classId') {
287 - if (query.classId?.length == 1) { 286 + if (this.query.classId?.length == 1) {
288 query.classId = this.query[key][0] 287 query.classId = this.query[key][0]
289 } else { 288 } else {
290 query.classIds = [...this.query[key]] 289 query.classIds = [...this.query[key]]
@@ -303,8 +302,35 @@ export default { @@ -303,8 +302,35 @@ export default {
303 }); 302 });
304 this.loading = false; 303 this.loading = false;
305 if (status === 0) { 304 if (status === 0) {
306 - this.tableData = (data?.list && [...data?.list]) || [];  
307 - this.total = data?.count || 0; 305 + if (this.query.classId.length > 1) {
  306 + //多班级
  307 + let tableObj = {};
  308 + data?.list?.map((item) => {
  309 + if (tableObj[item.examPaperId]) {
  310 + tableObj[item.examPaperId].ids.push(item.id)
  311 + tableObj[item.examPaperId].classIds.push(item.classId)
  312 + tableObj[item.examPaperId].classNames.push(item.className)
  313 + } else {
  314 + tableObj[item.examPaperId] = {
  315 + ids: [item.id],
  316 + examPaperId: item.examPaperId,
  317 + classIds: [item.classId],
  318 + classNames: [item.className],
  319 + title: item.title,
  320 + examPaperScore: item.examPaperScore,
  321 + subjectName: item.subjectName
  322 + }
  323 + }
  324 + });
  325 + Object.keys(tableObj).map(keys => {
  326 + if (tableObj[keys].classIds.length > 1) {
  327 + this.tableData.push(tableObj[keys])
  328 + }
  329 + })
  330 + } else {
  331 + this.tableData = (data?.list && [...data?.list]) || [];
  332 + this.total = data?.count || 0;
  333 + }
308 } else { 334 } else {
309 this.$message.error(info); 335 this.$message.error(info);
310 } 336 }
src/views/examinationPaper/archiving.vue
@@ -142,7 +142,7 @@ export default { @@ -142,7 +142,7 @@ export default {
142 }; 142 };
143 }, 143 },
144 async created() { 144 async created() {
145 - this.code = localStorage.getItem("csCode") || ""; 145 + this.code = this.$store.getters.csCode;
146 this.role = 146 this.role =
147 this.$store.getters.info.showRole || 147 this.$store.getters.info.showRole ||
148 this.$store.getters.info.permissions[0].role; 148 this.$store.getters.info.permissions[0].role;
src/views/examinationPaper/index.vue
@@ -190,7 +190,7 @@ export default { @@ -190,7 +190,7 @@ export default {
190 }; 190 };
191 }, 191 },
192 async created() { 192 async created() {
193 - this.code = localStorage.getItem("csCode") || ""; 193 + this.code = this.$store.getters.csCode;
194 this.role = 194 this.role =
195 this.$store.getters.info.showRole || 195 this.$store.getters.info.showRole ||
196 this.$store.getters.info.permissions[0].role; 196 this.$store.getters.info.permissions[0].role;
src/views/index/mainIndex.vue
@@ -257,7 +257,7 @@ export default { @@ -257,7 +257,7 @@ export default {
257 }, 257 },
258 }, 258 },
259 created() { 259 created() {
260 - this.code = localStorage.getItem("csCode") || ""; 260 + this.code = this.$store.getters.csCode;
261 this._Init(this.$store.getters.info.showRoleName); 261 this._Init(this.$store.getters.info.showRoleName);
262 this._QueryData(); 262 this._QueryData();
263 }, 263 },
src/views/layout/aside/aside.vue
@@ -86,7 +86,7 @@ export default { @@ -86,7 +86,7 @@ export default {
86 }; 86 };
87 }, 87 },
88 created() { 88 created() {
89 - this.code = getURLParams("code") || localStorage.getItem("csCode") || ""; 89 + this.code = getURLParams("code") || this.$store.getters.csCode;
90 this.path = this.$route.path; 90 this.path = this.$route.path;
91 }, 91 },
92 methods: { 92 methods: {
src/views/layout/header/header.vue
@@ -194,7 +194,7 @@ export default { @@ -194,7 +194,7 @@ export default {
194 }; 194 };
195 }, 195 },
196 created() { 196 created() {
197 - this.code = localStorage.getItem("csCode") || ""; 197 + this.code = this.$store.getters.csCode;
198 this.role = 198 this.role =
199 this.$store.getters.info.showRole || 199 this.$store.getters.info.showRole ||
200 this.$store.getters.info.permissions[0].role; 200 this.$store.getters.info.permissions[0].role;
src/views/login/index.vue
@@ -115,7 +115,7 @@ export default { @@ -115,7 +115,7 @@ export default {
115 }, 115 },
116 created() { 116 created() {
117 this.url = this.$route.query?.url || ""; 117 this.url = this.$route.query?.url || "";
118 - this.code = getURLParams("code") || localStorage.getItem("csCode") || ""; 118 + this.code = getURLParams("code") || this.$store.getters.csCode;
119 this.dockkey = getURLParams("dockkey") || ""; 119 this.dockkey = getURLParams("dockkey") || "";
120 if (this.code || this.dockkey) { 120 if (this.code || this.dockkey) {
121 this.loading = true; 121 this.loading = true;