Commit 21dfdeae42638efda117a313af013e4d57b39001
1 parent
03bce046
平台管理员
Showing
14 changed files
with
1009 additions
and
227 deletions
src/api/apis/apis.js
@@ -1120,4 +1120,46 @@ export default { | @@ -1120,4 +1120,46 @@ export default { | ||
1120 | data | 1120 | data |
1121 | }); | 1121 | }); |
1122 | }, | 1122 | }, |
1123 | + | ||
1124 | + /** 平台管理 */ | ||
1125 | + //账户管理 | ||
1126 | + tenantPage(data) { | ||
1127 | + return service({ | ||
1128 | + url: setUpUrls.tenantPage, | ||
1129 | + method: "POST", | ||
1130 | + data | ||
1131 | + }); | ||
1132 | + }, | ||
1133 | + //修改账号 | ||
1134 | + updateTenant(data) { | ||
1135 | + return service({ | ||
1136 | + url: setUpUrls.updateTenant, | ||
1137 | + method: "POST", | ||
1138 | + data | ||
1139 | + }); | ||
1140 | + }, | ||
1141 | + //新增租户账号 | ||
1142 | + addTenant(data) { | ||
1143 | + return service({ | ||
1144 | + url: setUpUrls.addTenant, | ||
1145 | + method: "POST", | ||
1146 | + data | ||
1147 | + }); | ||
1148 | + }, | ||
1149 | + //授课端版本管理 | ||
1150 | + versionPage(data) { | ||
1151 | + return service({ | ||
1152 | + url: setUpUrls.versionPage, | ||
1153 | + method: "POST", | ||
1154 | + data | ||
1155 | + }); | ||
1156 | + }, | ||
1157 | + //新增授课端版本 | ||
1158 | + addVersion(data) { | ||
1159 | + return service({ | ||
1160 | + url: setUpUrls.addVersion, | ||
1161 | + method: "POST", | ||
1162 | + data | ||
1163 | + }); | ||
1164 | + }, | ||
1123 | }; | 1165 | }; |
src/router/permission.js
src/store/index.js
@@ -40,9 +40,9 @@ const store = new Vuex.Store({ | @@ -40,9 +40,9 @@ const store = new Vuex.Store({ | ||
40 | }, | 40 | }, |
41 | setRouters: (state, routers) => { | 41 | setRouters: (state, routers) => { |
42 | let addrouterList = [] | 42 | let addrouterList = [] |
43 | - if(state.info.showRole == 'ROLE_PINGTAI'){ | 43 | + if(state.info.showRole == 'ROLE_PERSONAL'){ |
44 | addrouterList = [...addroutersPersonal] | 44 | addrouterList = [...addroutersPersonal] |
45 | - }else if(state.info.showRole == 'ROLE_ADMIN'){ | 45 | + }else if(state.info.showRole == 'ROLE_PINGTAI'){ |
46 | addrouterList = [...addRoutersAdmin] | 46 | addrouterList = [...addRoutersAdmin] |
47 | }else{ | 47 | }else{ |
48 | addrouterList = [...addrouters] | 48 | addrouterList = [...addrouters] |
@@ -80,33 +80,33 @@ const store = new Vuex.Store({ | @@ -80,33 +80,33 @@ const store = new Vuex.Store({ | ||
80 | const userInfo = { ...response.data }; | 80 | const userInfo = { ...response.data }; |
81 | if (userInfo.permissions && userInfo.permissions.length) { | 81 | if (userInfo.permissions && userInfo.permissions.length) { |
82 | userInfo.showRoleName = response.data.permissions[0]?.roleName; | 82 | userInfo.showRoleName = response.data.permissions[0]?.roleName; |
83 | - // userInfo.showRole = response.data.permissions[0]?.role; | 83 | + userInfo.showRole = response.data.permissions[0]?.role; |
84 | // 开发用,测试删除 | 84 | // 开发用,测试删除 |
85 | - userInfo.showRole = "ROLE_PINGTAI"; | 85 | + // userInfo.showRole = "ROLE_PERSONAL"; |
86 | commit("setToken", "isLogin"); | 86 | commit("setToken", "isLogin"); |
87 | commit("setInfo", { ...userInfo }); | 87 | commit("setInfo", { ...userInfo }); |
88 | - // commit("setRouters", [ | ||
89 | - // ...userInfo.permissions[0]?.authorityRouter, | ||
90 | - // ]); | 88 | + commit("setRouters", [ |
89 | + ...userInfo.permissions[0]?.authorityRouter, | ||
90 | + ]); | ||
91 | //start 开发用,测试删除 | 91 | //start 开发用,测试删除 |
92 | - commit("setRouters", [ | ||
93 | - "setUpStudent", | ||
94 | - "examinationPaper", | ||
95 | - "examinationPaperAdd", | ||
96 | - "examinationPaperEdit", | ||
97 | - "examinationPaperRecycle", | ||
98 | - "ask", | ||
99 | - "askAnalysis", | ||
100 | - "test", | ||
101 | - "testAnalysis", | ||
102 | - "portrait", | ||
103 | - "dataSync", | ||
104 | - "down", | 92 | + // commit("setRouters", [ |
93 | + // "setUpStudent", | ||
94 | + // "examinationPaper", | ||
95 | + // "examinationPaperAdd", | ||
96 | + // "examinationPaperEdit", | ||
97 | + // "examinationPaperRecycle", | ||
98 | + // "ask", | ||
99 | + // "askAnalysis", | ||
100 | + // "test", | ||
101 | + // "testAnalysis", | ||
102 | + // "portrait", | ||
103 | + // "dataSync", | ||
104 | + // "down", | ||
105 | 105 | ||
106 | - "account", | ||
107 | - "device", | ||
108 | - "clientVersion" | ||
109 | - ]); | 106 | + // "account", |
107 | + // "device", | ||
108 | + // "clientVersion" | ||
109 | + // ]); | ||
110 | //end | 110 | //end |
111 | 111 | ||
112 | state.addRouters.forEach((res) => { | 112 | state.addRouters.forEach((res) => { |
src/views/admin/account/index.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <back-box> | 3 | + <back-box> |
4 | <template slot="title"> | 4 | <template slot="title"> |
5 | <span>账号管理</span> | 5 | <span>账号管理</span> |
6 | </template> | 6 | </template> |
7 | + <template slot="btns"> | ||
8 | + <el-tooltip effect="dark" content="添加账号" placement="bottom"> | ||
9 | + <el-button | ||
10 | + type="primary" | ||
11 | + icon="el-icon-plus" | ||
12 | + size="mini" | ||
13 | + plain | ||
14 | + circle | ||
15 | + @click="openAddDia" | ||
16 | + ></el-button> | ||
17 | + </el-tooltip> | ||
18 | + </template> | ||
7 | </back-box> | 19 | </back-box> |
8 | - <div class="page-content"> | ||
9 | - 功能开发中。 | 20 | + <div class="answer-header"> |
21 | + <div class="sel-box"> | ||
22 | + <el-select | ||
23 | + class="sel" | ||
24 | + v-model="query.versionType" | ||
25 | + placeholder="选择账号类型" | ||
26 | + @change="(page = 1), _QueryData()" | ||
27 | + > | ||
28 | + <el-option label="无" :value="0"></el-option> | ||
29 | + <el-option label="标准版" :value="1"></el-option> | ||
30 | + <el-option label="个人版" :value="2"></el-option> | ||
31 | + <el-option label="定制版" :value="3"></el-option> | ||
32 | + </el-select> | ||
33 | + <el-select | ||
34 | + class="sel" | ||
35 | + v-model="query.available" | ||
36 | + placeholder="选择账号状态" | ||
37 | + @change="(page = 1), _QueryData()" | ||
38 | + > | ||
39 | + <el-option label="正常" :value="0"></el-option> | ||
40 | + <el-option label="禁用" :value="1"></el-option> | ||
41 | + </el-select> | ||
42 | + <el-input | ||
43 | + placeholder="请输入账号名称" | ||
44 | + v-model="query.loginName" | ||
45 | + class="input-with-select" | ||
46 | + @keyup.enter.native="(page = 1), _QueryData()" | ||
47 | + > | ||
48 | + <el-button | ||
49 | + slot="append" | ||
50 | + icon="el-icon-search" | ||
51 | + @click="(page = 1), _QueryData()" | ||
52 | + ></el-button> | ||
53 | + </el-input> | ||
54 | + <el-button type="primary" round @click="(page = 1), _QueryData()" | ||
55 | + >筛选</el-button | ||
56 | + > | ||
57 | + </div> | ||
58 | + </div> | ||
59 | + <div class="table-box"> | ||
60 | + <el-table | ||
61 | + :data="tableData" | ||
62 | + border | ||
63 | + style="width: 100%" | ||
64 | + v-loading="loading" | ||
65 | + > | ||
66 | + <el-table-column | ||
67 | + prop="loginName" | ||
68 | + label="账号" | ||
69 | + align="center" | ||
70 | + ></el-table-column> | ||
71 | + <el-table-column | ||
72 | + prop="realName" | ||
73 | + label="姓名" | ||
74 | + align="center" | ||
75 | + ></el-table-column> | ||
76 | + <el-table-column prop="versionType" label="账号类型" align="center"> | ||
77 | + <template slot-scope="scoped">{{ | ||
78 | + `${ | ||
79 | + scoped.row.versionType == 0 | ||
80 | + ? "无" | ||
81 | + : scoped.row.versionType == 1 | ||
82 | + ? "标准版" | ||
83 | + : scoped.row.versionType == 2 | ||
84 | + ? "个人版" | ||
85 | + : "定制版" | ||
86 | + }` | ||
87 | + }}</template></el-table-column | ||
88 | + > | ||
89 | + <el-table-column | ||
90 | + prop="tenantName" | ||
91 | + label="学校名称" | ||
92 | + align="center" | ||
93 | + ></el-table-column> | ||
94 | + <el-table-column prop="available" label="状态" align="center" | ||
95 | + ><template slot-scope="scoped">{{ | ||
96 | + `${scoped.row.available == 0 ? "正常" : "禁用"}` | ||
97 | + }}</template></el-table-column | ||
98 | + > | ||
99 | + <el-table-column | ||
100 | + prop="createdTime" | ||
101 | + label="创建时间" | ||
102 | + align="center" | ||
103 | + width="200" | ||
104 | + ></el-table-column> | ||
105 | + <el-table-column label="操作" align="center" width="160"> | ||
106 | + <template slot-scope="scoped"> | ||
107 | + <el-tooltip content="修改账号" placement="left"> | ||
108 | + <el-button | ||
109 | + class="set-count" | ||
110 | + type="primary" | ||
111 | + circle | ||
112 | + icon="el-icon-edit-outline" | ||
113 | + size="mini" | ||
114 | + @click="setCount(scoped.row)" | ||
115 | + ></el-button> | ||
116 | + </el-tooltip> | ||
117 | + <el-dropdown | ||
118 | + trigger="hover" | ||
119 | + @command="handleDropdownClick($event, scoped.row)" | ||
120 | + > | ||
121 | + <el-button | ||
122 | + type="info" | ||
123 | + size="mini" | ||
124 | + circle | ||
125 | + icon="el-icon-more" | ||
126 | + ></el-button> | ||
127 | + <el-dropdown-menu slot="dropdown"> | ||
128 | + <el-dropdown-item :command="0">重置密码</el-dropdown-item> | ||
129 | + <el-dropdown-item :command="1">{{ | ||
130 | + `${scoped.row.available == 0 ? "禁用" : "启用"}` | ||
131 | + }}</el-dropdown-item> | ||
132 | + <el-dropdown-item :command="2">删除</el-dropdown-item> | ||
133 | + </el-dropdown-menu> | ||
134 | + </el-dropdown> | ||
135 | + </template> | ||
136 | + </el-table-column> | ||
137 | + </el-table> | ||
138 | + <div class="pagination-box"> | ||
139 | + <el-pagination | ||
140 | + layout="total,prev, pager, next" | ||
141 | + :hide-on-single-page="true" | ||
142 | + :total="total" | ||
143 | + @current-change="changePage" | ||
144 | + :current-page="page" | ||
145 | + :page-size="size" | ||
146 | + > | ||
147 | + </el-pagination> | ||
148 | + </div> | ||
10 | </div> | 149 | </div> |
150 | + <el-dialog title="修改账号信息" :visible.sync="diaCount" width="400"> | ||
151 | + <el-form | ||
152 | + class="form-box" | ||
153 | + :model="formCount" | ||
154 | + :rules="ruleCount" | ||
155 | + ref="formCount" | ||
156 | + label-width="160px" | ||
157 | + > | ||
158 | + <el-form-item label="账号:" prop="loginName"> | ||
159 | + <el-col :span="12"> | ||
160 | + <el-input | ||
161 | + placeholder="请输入账号" | ||
162 | + v-model.trim="formCount.loginName" | ||
163 | + maxlength="30" | ||
164 | + > | ||
165 | + </el-input> | ||
166 | + </el-col> | ||
167 | + </el-form-item> | ||
168 | + <el-form-item label="密码:" prop="password"> | ||
169 | + <el-col :span="12"> | ||
170 | + <el-input | ||
171 | + placeholder="请输入密码" | ||
172 | + v-model.trim="formCount.password" | ||
173 | + maxlength="18" | ||
174 | + > | ||
175 | + </el-input> | ||
176 | + </el-col> | ||
177 | + </el-form-item> | ||
178 | + <el-form-item label="联系人姓名:" prop="contactPerson"> | ||
179 | + <el-col :span="12"> | ||
180 | + <el-input | ||
181 | + placeholder="请输入联系人姓名" | ||
182 | + v-model.trim="formCount.contactPerson" | ||
183 | + maxlength="12" | ||
184 | + > | ||
185 | + </el-input> | ||
186 | + </el-col> | ||
187 | + </el-form-item> | ||
188 | + <el-form-item label="联系人手机号:" prop="contactPhone"> | ||
189 | + <el-col :span="12"> | ||
190 | + <el-input | ||
191 | + placeholder="请输入联系人手机号" | ||
192 | + v-model.trim="formCount.contactPhone" | ||
193 | + type="number" | ||
194 | + oninput="if(value.length > 11) value = value.slice(0,11)" | ||
195 | + > | ||
196 | + </el-input> | ||
197 | + </el-col> | ||
198 | + </el-form-item> | ||
199 | + <el-form-item label="学校/集团名称:" prop="tenantName"> | ||
200 | + <el-col :span="12"> | ||
201 | + <el-input | ||
202 | + placeholder="学校/集团名称" | ||
203 | + v-model.trim="formCount.tenantName" | ||
204 | + maxlength="30" | ||
205 | + > | ||
206 | + </el-input> | ||
207 | + </el-col> | ||
208 | + </el-form-item> | ||
209 | + </el-form> | ||
210 | + <div class="dialog-footer" slot="footer"> | ||
211 | + <el-button @click="saveCount">确 定</el-button> | ||
212 | + <el-button @click="diaCount = false">取 消</el-button> | ||
213 | + </div> | ||
214 | + </el-dialog> | ||
215 | + <el-dialog title="添加账号" :visible.sync="diaAdd" width="400"> | ||
216 | + <el-form | ||
217 | + class="form-box" | ||
218 | + :model="formAddCount" | ||
219 | + :rules="ruleAddCount" | ||
220 | + ref="formAddCount" | ||
221 | + label-width="160px" | ||
222 | + > | ||
223 | + <el-form-item label="请输入账号:" prop="loginName"> | ||
224 | + <el-col :span="12"> | ||
225 | + <el-input | ||
226 | + placeholder="请输入联系电话" | ||
227 | + v-model.trim="formAddCount.loginName" | ||
228 | + type="number" | ||
229 | + oninput="if(value.length > 11) value = value.slice(0,11)" | ||
230 | + > | ||
231 | + </el-input> | ||
232 | + </el-col> | ||
233 | + </el-form-item> | ||
234 | + <el-form-item label="选择账号类型:" prop="versionType"> | ||
235 | + <el-col :span="12"> | ||
236 | + <el-select | ||
237 | + class="sel" | ||
238 | + v-model="formAddCount.versionType" | ||
239 | + placeholder="请选择账号类型" | ||
240 | + > | ||
241 | + <el-option label="无" :value="0"></el-option> | ||
242 | + <el-option label="标准版" :value="1"></el-option> | ||
243 | + <el-option label="个人版" :value="2"></el-option> | ||
244 | + <el-option label="定制版" :value="3"></el-option> | ||
245 | + </el-select> | ||
246 | + </el-col> | ||
247 | + </el-form-item> | ||
248 | + <el-form-item label="联系人姓名:" prop="contactPerson"> | ||
249 | + <el-col :span="12"> | ||
250 | + <el-input | ||
251 | + placeholder="请输入联系人姓名" | ||
252 | + v-model.trim="formAddCount.contactPerson" | ||
253 | + maxlength="12" | ||
254 | + > | ||
255 | + </el-input> | ||
256 | + </el-col> | ||
257 | + </el-form-item> | ||
258 | + <el-form-item label="联系人手机号:" prop="contactPhone"> | ||
259 | + <el-col :span="12"> | ||
260 | + <el-input | ||
261 | + placeholder="请输入联系人手机号" | ||
262 | + v-model.trim="formAddCount.contactPhone" | ||
263 | + type="number" | ||
264 | + oninput="if(value.length > 11) value = value.slice(0,11)" | ||
265 | + > | ||
266 | + </el-input> | ||
267 | + </el-col> | ||
268 | + </el-form-item> | ||
269 | + <el-form-item label="学校/集团名称:" prop="tenantName"> | ||
270 | + <el-col :span="12"> | ||
271 | + <el-input | ||
272 | + placeholder="学校/集团名称" | ||
273 | + v-model.trim="formAddCount.tenantName" | ||
274 | + maxlength="30" | ||
275 | + > | ||
276 | + </el-input> | ||
277 | + </el-col> | ||
278 | + </el-form-item> | ||
279 | + </el-form> | ||
280 | + <div class="dialog-footer" slot="footer"> | ||
281 | + <el-button @click="saveAddCount">确 定</el-button> | ||
282 | + <el-button @click="diaAdd = false">取 消</el-button> | ||
283 | + </div> | ||
284 | + </el-dialog> | ||
11 | </div> | 285 | </div> |
12 | </template> | 286 | </template> |
13 | 287 | ||
14 | <script> | 288 | <script> |
289 | +import { encryptLoginPassword } from "@/utils"; | ||
15 | export default { | 290 | export default { |
291 | + data() { | ||
292 | + return { | ||
293 | + diaAdd: false, | ||
294 | + loading: false, | ||
295 | + diaCount: false, | ||
296 | + props: { multiple: true, checkStrictly: true }, | ||
297 | + query: { | ||
298 | + type: "", | ||
299 | + available: "", | ||
300 | + loginName: "", | ||
301 | + }, | ||
302 | + tableData: [], | ||
303 | + total: 0, | ||
304 | + page: 1, | ||
305 | + size: 20, | ||
306 | + formCount: { | ||
307 | + loginName: "", | ||
308 | + type: "", | ||
309 | + tenantName: "", | ||
310 | + contactPerson: "", | ||
311 | + contactPhone: "", | ||
312 | + }, | ||
313 | + ruleCount: { | ||
314 | + loginName: [{ required: true, message: "请输入账号", trigger: "blur" }], | ||
315 | + password: [{ required: true, message: "请输入密码", trigger: "blur" }], | ||
316 | + contactPhone: [ | ||
317 | + { required: true, message: "请输入联系电话", trigger: "blur" }, | ||
318 | + ], | ||
319 | + contactPerson: [ | ||
320 | + { required: true, message: "请输入联系人姓名", trigger: "blur" }, | ||
321 | + ], | ||
322 | + }, | ||
323 | + formAddCount: { | ||
324 | + loginName: "", | ||
325 | + contactPhone: "", | ||
326 | + contactPerson: "", | ||
327 | + versionType: "", | ||
328 | + tenantName: "", | ||
329 | + }, | ||
330 | + ruleAddCount: { | ||
331 | + loginName: [{ required: true, message: "请输入账号", trigger: "blur" }], | ||
332 | + contactPhone: [ | ||
333 | + { required: true, message: "请输入联系电话", trigger: "blur" }, | ||
334 | + ], | ||
335 | + contactPerson: [ | ||
336 | + { required: true, message: "请输入联系人姓名", trigger: "blur" }, | ||
337 | + ], | ||
338 | + versionType: [ | ||
339 | + { required: true, message: "请选择租户类型", trigger: "blur" }, | ||
340 | + ], | ||
341 | + }, | ||
342 | + }; | ||
343 | + }, | ||
344 | + created() { | ||
345 | + // _QueryData(); | ||
346 | + }, | ||
347 | + methods: { | ||
348 | + openAddDia() { | ||
349 | + //添加账号 | ||
350 | + this.formAddCount.loginName = ""; | ||
351 | + this.formAddCount.contactPhone = ""; | ||
352 | + this.formAddCount.contactPerson = ""; | ||
353 | + this.formAddCount.tenantName = ""; | ||
354 | + this.formAddCount.versionType = 0; | ||
355 | + this.diaAdd = true; | ||
356 | + }, | ||
357 | + saveAddCount() { | ||
358 | + //保存新增账号 | ||
359 | + this.$refs.formAddCount.validate(async (valid) => { | ||
360 | + if (valid) { | ||
361 | + let params = { ...this.formAddCount }; | ||
362 | + const { data, status, info } = await this.$request.addUser({ | ||
363 | + ...params, | ||
364 | + }); | ||
365 | + if (status === 0) { | ||
366 | + this.$message.success(info); | ||
367 | + this._QueryData(); | ||
368 | + this.diaAdd = false; | ||
369 | + } else { | ||
370 | + this.$message.error(info); | ||
371 | + } | ||
372 | + } else { | ||
373 | + this.$message.warning("输入有误请检查!"); | ||
374 | + return false; | ||
375 | + } | ||
376 | + }); | ||
377 | + }, | ||
378 | + setCount(obj) { | ||
379 | + //修改账号 | ||
380 | + this.formCount = { ...obj }; | ||
381 | + this.diaCount = true; | ||
382 | + }, | ||
383 | + handleDropdownClick(value, item) { | ||
384 | + console.log(item); | ||
385 | + //更多 | ||
386 | + if (value == 2) { | ||
387 | + this.$confirm("确定要删除这条账号信息吗?", "提示", { | ||
388 | + customClass: "del-model", | ||
389 | + cancelButttonText: "取消", | ||
390 | + confirmButtonText: "确定", | ||
391 | + type: "warning", | ||
392 | + }).then(() => { | ||
393 | + this.updateUser(item, value); | ||
394 | + }); | ||
395 | + } else { | ||
396 | + this.updateUser(item, value); | ||
397 | + } | ||
398 | + }, | ||
399 | + changePage(page) { | ||
400 | + this.page = page; | ||
401 | + this._QueryData(); | ||
402 | + }, | ||
403 | + saveCount() { | ||
404 | + //保存修改账号 | ||
405 | + this.$refs.formCount.validate(async (valid) => { | ||
406 | + if (valid) { | ||
407 | + let params = { ...this.formCount }; | ||
408 | + params.password = encryptLoginPassword(params.password); | ||
409 | + const { data, status, info } = await this.$request.tenantUpdateUser({ | ||
410 | + type: 3, | ||
411 | + ...params, | ||
412 | + }); | ||
413 | + if (status === 0) { | ||
414 | + this.$message.success(info); | ||
415 | + this.diaCount = false; | ||
416 | + this._QueryData(); | ||
417 | + } else { | ||
418 | + this.$message.error(info); | ||
419 | + } | ||
420 | + } else { | ||
421 | + this.$message.warning("输入有误请检查!"); | ||
422 | + return false; | ||
423 | + } | ||
424 | + }); | ||
425 | + }, | ||
426 | + async updateUser(obj, type) { | ||
427 | + let query = {}; | ||
428 | + console.log(query); | ||
429 | + if (type == 1) { | ||
430 | + query.available = obj.available == 0 ? 1 : 0; | ||
431 | + } | ||
432 | + const { data, status, info } = await this.$request.tenantUpdateUser({ | ||
433 | + userId: obj.id, | ||
434 | + type: type, | ||
435 | + ...query, | ||
436 | + }); | ||
437 | + if (status === 0) { | ||
438 | + this.$message.success(info); | ||
439 | + this._QueryData(); | ||
440 | + } else { | ||
441 | + this.$message.error(info); | ||
442 | + } | ||
443 | + }, | ||
444 | + async _QueryData() { | ||
445 | + let query = { ...this.query }; | ||
446 | + if (query.loginName) { | ||
447 | + delete query.type; | ||
448 | + delete query.available; | ||
449 | + } | ||
450 | + this.loading = true; | ||
451 | + this.tableData = []; | ||
452 | + const { data, status, info } = await this.$request.tenantPage({ | ||
453 | + ...query, | ||
454 | + page: this.page, | ||
455 | + size: this.size, | ||
456 | + }); | ||
16 | 457 | ||
17 | -} | 458 | + this.loading = false; |
459 | + if (status === 0) { | ||
460 | + this.tableData = data.list || []; | ||
461 | + this.total = data.count; | ||
462 | + } else { | ||
463 | + this.$message.error(info); | ||
464 | + } | ||
465 | + }, | ||
466 | + }, | ||
467 | +}; | ||
18 | </script> | 468 | </script> |
19 | - | ||
20 | -<style> | ||
21 | - | 469 | +<style lang="scss"> |
470 | +.del-model { | ||
471 | + .el-message-box__btns button:nth-child(1) { | ||
472 | + color: #667ffd; | ||
473 | + } | ||
474 | +} | ||
475 | +</style> | ||
476 | +<style lang="scss" scoped> | ||
477 | +.el-message-box .el-button--default { | ||
478 | + color: red; | ||
479 | +} | ||
480 | +.set-count { | ||
481 | + margin-right: 12px; | ||
482 | +} | ||
483 | +.table-box { | ||
484 | + padding: 0 20px; | ||
485 | +} | ||
22 | </style> | 486 | </style> |
23 | \ No newline at end of file | 487 | \ No newline at end of file |
src/views/admin/clientVersion/components/upLoad.vue
0 → 100644
1 | +<template> | ||
2 | + <div> | ||
3 | + <slot name="down"></slot> | ||
4 | + <div class="d1"> | ||
5 | + <el-upload | ||
6 | + class="upload-demo" | ||
7 | + ref="upload" | ||
8 | + :action="url" | ||
9 | + :multiple="false" | ||
10 | + :data="{ ...query }" | ||
11 | + :with-credentials="true" | ||
12 | + :limit="1" | ||
13 | + :on-change="change" | ||
14 | + :on-success="upSuccess" | ||
15 | + :on-error="upError" | ||
16 | + > | ||
17 | + <!-- accept="application/vnd.ms-excel" --> | ||
18 | + <div class="upload-btn"> | ||
19 | + <el-button class="btn" size="mini" type="primary">选择文件</el-button> | ||
20 | + </div> | ||
21 | + </el-upload> | ||
22 | + </div> | ||
23 | + </div> | ||
24 | +</template> | ||
25 | + | ||
26 | +<script> | ||
27 | +export default { | ||
28 | + name: "downUpData", | ||
29 | + props: { | ||
30 | + query: { | ||
31 | + type: Object, | ||
32 | + default: function () { | ||
33 | + return {}; | ||
34 | + }, | ||
35 | + }, | ||
36 | + url: { | ||
37 | + type: String, | ||
38 | + default: "", | ||
39 | + }, | ||
40 | + }, | ||
41 | + data() { | ||
42 | + return { | ||
43 | + file: null, | ||
44 | + }; | ||
45 | + }, | ||
46 | + methods: { | ||
47 | + async submitUpload() { | ||
48 | + this.$refs.upload.submit(); | ||
49 | + | ||
50 | + // const formData = new FormData() | ||
51 | + // formData.append('id',this.componentId) | ||
52 | + // formData.append('file',new File(this.file.raw)) | ||
53 | + // let {status,info} = await uploadExcel(formData); | ||
54 | + // if(status===0){ | ||
55 | + // this.$message.success(info); | ||
56 | + // this.$emit("upSuccess") | ||
57 | + // } else { | ||
58 | + // this.$message.error(info); | ||
59 | + // } | ||
60 | + }, | ||
61 | + upSuccess(res) { | ||
62 | + if (res && res.status == 0) { | ||
63 | + this.$message.success("上传成功"); | ||
64 | + this.$emit("upSuccess", res); | ||
65 | + } else { | ||
66 | + this.$message.error(res.info); | ||
67 | + } | ||
68 | + }, | ||
69 | + upError(res) { | ||
70 | + if (res && res.status == 0) { | ||
71 | + this.$message.error("上传失败"); | ||
72 | + } else { | ||
73 | + this.$message.error(res.message); | ||
74 | + } | ||
75 | + }, | ||
76 | + change(file) { | ||
77 | + this.file = file; | ||
78 | + }, | ||
79 | + }, | ||
80 | +}; | ||
81 | +</script> | ||
82 | + | ||
83 | +<style lang="scss" scoped> | ||
84 | +.btn { | ||
85 | + border-radius: 8px; | ||
86 | + font-weight: normal; | ||
87 | +} | ||
88 | +.upload-btn { | ||
89 | + .el-icon-upload { | ||
90 | + font-size: 48px; | ||
91 | + margin-bottom: 6px; | ||
92 | + color: #667ffd; | ||
93 | + } | ||
94 | +} | ||
95 | +</style> |
src/views/admin/clientVersion/components/upLoadImg.vue
0 → 100644
1 | +<template> | ||
2 | + <div> | ||
3 | + <slot name="down"></slot> | ||
4 | + <el-upload | ||
5 | + class="avatar-uploader" | ||
6 | + ref="upload" | ||
7 | + :action="url" | ||
8 | + :multiple="false" | ||
9 | + :data="{ ...query }" | ||
10 | + :with-credentials="true" | ||
11 | + :limit="1" | ||
12 | + :on-success="upSuccess" | ||
13 | + :on-error="upError" | ||
14 | + > | ||
15 | + <!-- accept="application/vnd.ms-excel" --> | ||
16 | + <img v-if="imageUrl" :src="imageUrl" class="avatar" /> | ||
17 | + <i v-else class="el-icon-plus avatar-uploader-icon"></i> | ||
18 | + </el-upload> | ||
19 | + </div> | ||
20 | +</template> | ||
21 | + | ||
22 | +<script> | ||
23 | +export default { | ||
24 | + name: "downUpData", | ||
25 | + props: { | ||
26 | + query: { | ||
27 | + type: Object, | ||
28 | + default: function () { | ||
29 | + return {}; | ||
30 | + }, | ||
31 | + }, | ||
32 | + url: { | ||
33 | + type: String, | ||
34 | + default: "", | ||
35 | + }, | ||
36 | + }, | ||
37 | + data() { | ||
38 | + return { | ||
39 | + file: null, | ||
40 | + imageUrl: "", | ||
41 | + }; | ||
42 | + }, | ||
43 | + methods: { | ||
44 | + async submitUpload() { | ||
45 | + this.$refs.upload.submit(); | ||
46 | + | ||
47 | + // const formData = new FormData() | ||
48 | + // formData.append('id',this.componentId) | ||
49 | + // formData.append('file',new File(this.file.raw)) | ||
50 | + // let {status,info} = await uploadExcel(formData); | ||
51 | + // if(status===0){ | ||
52 | + // this.$message.success(info); | ||
53 | + // this.$emit("upSuccess") | ||
54 | + // } else { | ||
55 | + // this.$message.error(info); | ||
56 | + // } | ||
57 | + }, | ||
58 | + upSuccess(res, file) { | ||
59 | + if (res && res.status == 0) { | ||
60 | + this.imageUrl = URL.createObjectURL(file.raw); | ||
61 | + this.$message.success("上传成功"); | ||
62 | + this.$emit("upSuccess", res); | ||
63 | + } else { | ||
64 | + this.$message.error(res.info); | ||
65 | + } | ||
66 | + }, | ||
67 | + upError(res) { | ||
68 | + if (res && res.status == 0) { | ||
69 | + this.$message.error("上传失败"); | ||
70 | + } else { | ||
71 | + this.$message.error(res.message); | ||
72 | + } | ||
73 | + }, | ||
74 | + }, | ||
75 | +}; | ||
76 | +</script> | ||
77 | + | ||
78 | +<style> | ||
79 | +.avatar-uploader { | ||
80 | + line-height: 1; | ||
81 | +} | ||
82 | +.avatar-uploader .el-upload { | ||
83 | + border: 1px dashed #d9d9d9; | ||
84 | + border-radius: 6px; | ||
85 | + cursor: pointer; | ||
86 | + position: relative; | ||
87 | + overflow: hidden; | ||
88 | +} | ||
89 | +.avatar-uploader .el-upload:hover { | ||
90 | + border-color: #409eff; | ||
91 | +} | ||
92 | +.avatar-uploader .avatar-uploader-icon { | ||
93 | + font-size: 24px; | ||
94 | + color: #8c939d; | ||
95 | + width: 80px; | ||
96 | + height: 80px; | ||
97 | + line-height: 80px; | ||
98 | + text-align: center; | ||
99 | +} | ||
100 | +.avatar-uploader .avatar { | ||
101 | + width: 80px; | ||
102 | + height: 80px; | ||
103 | + display: block; | ||
104 | +} | ||
105 | +</style> |
src/views/admin/clientVersion/index.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <back-box> | 3 | + <back-box> |
4 | <template slot="title"> | 4 | <template slot="title"> |
5 | <span>授课端版本管理</span> | 5 | <span>授课端版本管理</span> |
6 | </template> | 6 | </template> |
7 | + <template slot="btns"> | ||
8 | + <el-tooltip effect="dark" content="添加版本" placement="bottom"> | ||
9 | + <el-button | ||
10 | + type="primary" | ||
11 | + icon="el-icon-plus" | ||
12 | + size="mini" | ||
13 | + plain | ||
14 | + circle | ||
15 | + @click="openAddDia" | ||
16 | + ></el-button> | ||
17 | + </el-tooltip> | ||
18 | + </template> | ||
7 | </back-box> | 19 | </back-box> |
8 | - <div class="page-content"> | ||
9 | - 功能开发中。 | 20 | + <div class="table-box"> |
21 | + <el-table | ||
22 | + :data="tableData" | ||
23 | + border | ||
24 | + style="width: 100%" | ||
25 | + v-loading="loading" | ||
26 | + > | ||
27 | + <el-table-column | ||
28 | + prop="md5" | ||
29 | + label="MD5编码" | ||
30 | + align="center" | ||
31 | + ></el-table-column> | ||
32 | + <el-table-column | ||
33 | + prop="versionName" | ||
34 | + label="版本名称" | ||
35 | + align="center" | ||
36 | + ></el-table-column> | ||
37 | + <el-table-column | ||
38 | + prop="versionNumber" | ||
39 | + label="版本号" | ||
40 | + align="center" | ||
41 | + ></el-table-column> | ||
42 | + <el-table-column | ||
43 | + prop="createdTime" | ||
44 | + label="上传时间" | ||
45 | + align="center" | ||
46 | + width="200" | ||
47 | + ></el-table-column> | ||
48 | + <el-table-column | ||
49 | + prop="fileSize" | ||
50 | + label="文件大小" | ||
51 | + align="center" | ||
52 | + ></el-table-column> | ||
53 | + <el-table-column | ||
54 | + prop="description" | ||
55 | + label="更新描述" | ||
56 | + align="center" | ||
57 | + ></el-table-column> | ||
58 | + <el-table-column label="操作" align="center" width="160"> | ||
59 | + <template slot-scope="scoped"> | ||
60 | + <el-popconfirm title="确定删除吗?" @confirm="remove(scoped.row)"> | ||
61 | + <span class="del" slot="reference">删除</span> | ||
62 | + </el-popconfirm> | ||
63 | + </template> | ||
64 | + </el-table-column> | ||
65 | + </el-table> | ||
66 | + <div class="pagination-box"> | ||
67 | + <el-pagination | ||
68 | + layout="total,prev, pager, next" | ||
69 | + :hide-on-single-page="true" | ||
70 | + :total="total" | ||
71 | + @current-change="changePage" | ||
72 | + :current-page="page" | ||
73 | + :page-size="size" | ||
74 | + > | ||
75 | + </el-pagination> | ||
76 | + </div> | ||
10 | </div> | 77 | </div> |
78 | + <el-dialog title="添加账号" :visible.sync="diaAdd" width="400"> | ||
79 | + <el-form | ||
80 | + class="form-box" | ||
81 | + :model="formAdd" | ||
82 | + :rules="ruleAdd" | ||
83 | + ref="formAdd" | ||
84 | + label-width="160px" | ||
85 | + > | ||
86 | + <el-form-item label="版本名称:" prop="versionName"> | ||
87 | + <el-col :span="12"> | ||
88 | + <el-input | ||
89 | + placeholder="请输入版本名称" | ||
90 | + v-model.trim="formAdd.versionName" | ||
91 | + maxlength="30" | ||
92 | + > | ||
93 | + </el-input> | ||
94 | + </el-col> | ||
95 | + </el-form-item> | ||
96 | + <el-form-item label="版本号:" prop="versionNumber"> | ||
97 | + <el-col :span="12"> | ||
98 | + <el-input | ||
99 | + placeholder="请输入版本号" | ||
100 | + v-model.trim="formAdd.versionNumber" | ||
101 | + maxlength="30" | ||
102 | + > | ||
103 | + </el-input> | ||
104 | + </el-col> | ||
105 | + </el-form-item> | ||
106 | + <el-form-item label="软件图标:" prop="logo"> | ||
107 | + <el-col :span="12"> | ||
108 | + <upLoadImg :url="url" @upSuccess="logoSuccess"/> | ||
109 | + </el-col> | ||
110 | + </el-form-item> | ||
111 | + <el-form-item label="上传全量文件包:" prop="appfiles"> | ||
112 | + <el-col :span="12"> | ||
113 | + <upLoad :url="url" @upSuccess="appfilesSuccess"/> | ||
114 | + </el-col> | ||
115 | + </el-form-item> | ||
116 | + <el-form-item label="上传增量文件包:" prop="addfiles"> | ||
117 | + <el-col :span="12"> | ||
118 | + <upLoad :url="url" @upSuccess="addfilesSuccess"/> | ||
119 | + </el-col> | ||
120 | + </el-form-item> | ||
121 | + <el-form-item label="更新描述:" prop="description"> | ||
122 | + <el-col :span="12"> | ||
123 | + <el-input | ||
124 | + type="textarea" | ||
125 | + :rows="3" | ||
126 | + v-model="formAdd.description" | ||
127 | + placeholder="填写描述" | ||
128 | + ></el-input> | ||
129 | + </el-col> | ||
130 | + </el-form-item> | ||
131 | + </el-form> | ||
132 | + <div class="dialog-footer" slot="footer"> | ||
133 | + <el-button @click="save">确 定</el-button> | ||
134 | + <el-button @click="diaAdd = false">取 消</el-button> | ||
135 | + </div> | ||
136 | + </el-dialog> | ||
11 | </div> | 137 | </div> |
12 | </template> | 138 | </template> |
13 | 139 | ||
14 | <script> | 140 | <script> |
141 | +import upLoad from "./components/upLoad.vue" | ||
142 | +import upLoadImg from "./components/upLoadImg.vue" | ||
15 | export default { | 143 | export default { |
144 | + components:{ | ||
145 | + upLoad, | ||
146 | + upLoadImg | ||
147 | + }, | ||
148 | + data() { | ||
149 | + return { | ||
150 | + url: "/file/uploadApp", | ||
151 | + loading: false, | ||
152 | + diaAdd: false, | ||
153 | + tableData: [ | ||
154 | + { | ||
155 | + schoolName: "111", | ||
156 | + }, | ||
157 | + ], | ||
158 | + formAdd: { | ||
159 | + versionName: "", | ||
160 | + versionNumber: "", | ||
161 | + appImage: "", | ||
162 | + filePath: "", | ||
163 | + incrementFilePath: "", | ||
164 | + description: "", | ||
165 | + }, | ||
166 | + ruleAdd: { | ||
167 | + versionName: [ | ||
168 | + { required: true, message: "请输入版本名称", trigger: "blur" }, | ||
169 | + ], | ||
170 | + versionNumber: [ | ||
171 | + { required: true, message: "请输入版本号", trigger: "blur" }, | ||
172 | + ], | ||
173 | + appImage: [ | ||
174 | + { required: true, message: "请上传软件图标", trigger: "blur" }, | ||
175 | + ], | ||
176 | + filePath: [ | ||
177 | + { required: true, message: "请上传全量文件包", trigger: "blur" }, | ||
178 | + ], | ||
179 | + incrementFilePath: [ | ||
180 | + { required: true, message: "请上传增量文件包", trigger: "blur" }, | ||
181 | + ], | ||
182 | + }, | ||
183 | + page: 1, | ||
184 | + size: 20, | ||
185 | + total: 0, | ||
186 | + }; | ||
187 | + }, | ||
188 | + created() { | ||
189 | + // this._QueryData(); | ||
190 | + }, | ||
191 | + methods: { | ||
192 | + openAddDia() { | ||
193 | + this.formAdd.versionName = ""; | ||
194 | + this.formAdd.versionNumber = ""; | ||
195 | + this.formAdd.appImage = ""; | ||
196 | + this.formAdd.filePath = ""; | ||
197 | + this.formAdd.incrementFilePath = ""; | ||
198 | + this.formAdd.description = ""; | ||
199 | + this.diaAdd = true; | ||
200 | + }, | ||
201 | + changePage(page) { | ||
202 | + this.page = page; | ||
203 | + this._QueryData(); | ||
204 | + }, | ||
205 | + remove(obj) {}, | ||
206 | + logoSuccess(res){ | ||
207 | + this.formAdd.appImage = res.data; | ||
208 | + }, | ||
209 | + appfilesSuccess(res){ | ||
210 | + this.formAdd.filePath = res.data; | ||
211 | + }, | ||
212 | + addfilesSuccess(res){ | ||
213 | + this.formAdd.incrementFilePath = res.data; | ||
214 | + }, | ||
215 | + save() {}, | ||
216 | + async _QueryData() { | ||
217 | + this.loading = true; | ||
218 | + this.tableData = []; | ||
219 | + const { data, status, info } = await this.$request.versionPage({ | ||
220 | + page: this.page, | ||
221 | + size: this.size, | ||
222 | + }); | ||
16 | 223 | ||
17 | -} | 224 | + this.loading = false; |
225 | + if (status === 0) { | ||
226 | + this.tableData = data.list || []; | ||
227 | + this.total = data.count; | ||
228 | + } else { | ||
229 | + this.$message.error(info); | ||
230 | + } | ||
231 | + }, | ||
232 | + }, | ||
233 | +}; | ||
18 | </script> | 234 | </script> |
19 | 235 | ||
20 | -<style> | ||
21 | - | 236 | +<style lang="scss" scoped> |
237 | +.table-box { | ||
238 | + padding: 20px; | ||
239 | +} | ||
240 | +.del { | ||
241 | + font-size: 14px; | ||
242 | + color: #666; | ||
243 | + cursor: pointer; | ||
244 | +} | ||
22 | </style> | 245 | </style> |
23 | \ No newline at end of file | 246 | \ No newline at end of file |
src/views/admin/device/index.vue
@@ -10,7 +10,6 @@ | @@ -10,7 +10,6 @@ | ||
10 | <el-radio-group v-model="type"> | 10 | <el-radio-group v-model="type"> |
11 | <el-radio-button :label="1">基站管理</el-radio-button> | 11 | <el-radio-button :label="1">基站管理</el-radio-button> |
12 | <el-radio-button :label="2">答题器管理</el-radio-button> | 12 | <el-radio-button :label="2">答题器管理</el-radio-button> |
13 | - <el-radio-button :label="3">授课端管理</el-radio-button> | ||
14 | </el-radio-group> | 13 | </el-radio-group> |
15 | </div> | 14 | </div> |
16 | <div class="content"> | 15 | <div class="content"> |
@@ -24,32 +23,20 @@ | @@ -24,32 +23,20 @@ | ||
24 | <pie-chart | 23 | <pie-chart |
25 | id="pieChart" | 24 | id="pieChart" |
26 | :params="chartData" | 25 | :params="chartData" |
27 | - @clickPieChart="clickPieChart" | ||
28 | ></pie-chart> | 26 | ></pie-chart> |
29 | </div> | 27 | </div> |
30 | </div> | 28 | </div> |
31 | <div class="table-box"> | 29 | <div class="table-box"> |
32 | <div class="answer-header"> | 30 | <div class="answer-header"> |
33 | <div class="sel-box"> | 31 | <div class="sel-box"> |
34 | - <el-cascader | ||
35 | - size="small" | ||
36 | - class="sel sel2" | ||
37 | - clearable | ||
38 | - placeholder="选择班级" | ||
39 | - v-model="query.classId" | ||
40 | - :options="gradeList" | ||
41 | - :props="props" | ||
42 | - collapse-tags | ||
43 | - :show-all-levels="false" | ||
44 | - ></el-cascader> | ||
45 | <el-select | 32 | <el-select |
46 | class="sel" | 33 | class="sel" |
47 | - v-model="query.onlineStatus" | ||
48 | - placeholder="选择状态" | 34 | + v-model="query.school" |
35 | + placeholder="选择学校" | ||
49 | @change="_QueryData(true)" | 36 | @change="_QueryData(true)" |
50 | > | 37 | > |
51 | <el-option | 38 | <el-option |
52 | - v-for="item in statusList" | 39 | + v-for="item in schoolList" |
53 | :key="item.value" | 40 | :key="item.value" |
54 | :label="item.label" | 41 | :label="item.label" |
55 | :value="item.value" | 42 | :value="item.value" |
@@ -57,7 +44,7 @@ | @@ -57,7 +44,7 @@ | ||
57 | </el-option> | 44 | </el-option> |
58 | </el-select> | 45 | </el-select> |
59 | <el-input | 46 | <el-input |
60 | - placeholder="请输入设备编码" | 47 | + placeholder="请输入租户" |
61 | v-model="query.sn" | 48 | v-model="query.sn" |
62 | class="input-with-select" | 49 | class="input-with-select" |
63 | @keyup.enter.native="_QueryData(true)" | 50 | @keyup.enter.native="_QueryData(true)" |
@@ -147,32 +134,20 @@ | @@ -147,32 +134,20 @@ | ||
147 | <scatter-chart | 134 | <scatter-chart |
148 | id="scatterChart" | 135 | id="scatterChart" |
149 | :params="chartData2" | 136 | :params="chartData2" |
150 | - @clickScatterChart="clickScatterChart" | ||
151 | ></scatter-chart> | 137 | ></scatter-chart> |
152 | </div> | 138 | </div> |
153 | </div> | 139 | </div> |
154 | <div class="table-box"> | 140 | <div class="table-box"> |
155 | <div class="answer-header"> | 141 | <div class="answer-header"> |
156 | <div class="sel-box"> | 142 | <div class="sel-box"> |
157 | - <el-cascader | ||
158 | - size="small" | ||
159 | - class="sel sel2" | ||
160 | - clearable | ||
161 | - placeholder="选择班级" | ||
162 | - v-model="query.classId" | ||
163 | - :options="gradeList" | ||
164 | - :props="props" | ||
165 | - collapse-tags | ||
166 | - :show-all-levels="false" | ||
167 | - ></el-cascader> | ||
168 | - <el-select | 143 | + <el-select |
169 | class="sel" | 144 | class="sel" |
170 | - v-model="query.type" | ||
171 | - placeholder="选择状态" | 145 | + v-model="query.school" |
146 | + placeholder="选择学校" | ||
172 | @change="_QueryData(true)" | 147 | @change="_QueryData(true)" |
173 | > | 148 | > |
174 | <el-option | 149 | <el-option |
175 | - v-for="item in typeList" | 150 | + v-for="item in schoolList" |
176 | :key="item.value" | 151 | :key="item.value" |
177 | :label="item.label" | 152 | :label="item.label" |
178 | :value="item.value" | 153 | :value="item.value" |
@@ -180,7 +155,7 @@ | @@ -180,7 +155,7 @@ | ||
180 | </el-option> | 155 | </el-option> |
181 | </el-select> | 156 | </el-select> |
182 | <el-input | 157 | <el-input |
183 | - placeholder="请输入设备编码" | 158 | + placeholder="请输入租户" |
184 | v-model="query.sn" | 159 | v-model="query.sn" |
185 | class="input-with-select" | 160 | class="input-with-select" |
186 | @keyup.enter.native="_QueryData(true)" | 161 | @keyup.enter.native="_QueryData(true)" |
@@ -303,36 +278,12 @@ export default { | @@ -303,36 +278,12 @@ export default { | ||
303 | return { | 278 | return { |
304 | code: "", | 279 | code: "", |
305 | loading: false, | 280 | loading: false, |
306 | - gradeList: [], | ||
307 | - gradeListAll: [], | ||
308 | - schoolAll: [], | ||
309 | - school: {}, //校园账号所属学校信息 | ||
310 | - props: { | ||
311 | - multiple: true, | ||
312 | - checkStrictly: true, | ||
313 | - }, | 281 | + schoolList: [], |
314 | type: 1, | 282 | type: 1, |
315 | query: { | 283 | query: { |
316 | - classId: [], | ||
317 | - onlineStatus: "", | ||
318 | - sn: "", | ||
319 | - type: "", | 284 | + school: [], |
285 | + zuhu: "", | ||
320 | }, | 286 | }, |
321 | - statusList: [ | ||
322 | - { label: "全部", value: "" }, | ||
323 | - { label: "离线", value: 0 }, | ||
324 | - { label: "在线", value: 1 }, | ||
325 | - { label: "异常", value: 2 }, | ||
326 | - ], | ||
327 | - typeList: [ | ||
328 | - { label: "全部", value: 0 }, | ||
329 | - { label: "1日内", value: 1 }, | ||
330 | - { label: "3日内", value: 2 }, | ||
331 | - { label: "7日内", value: 3 }, | ||
332 | - { label: "1月内", value: 4 }, | ||
333 | - { label: "3月内", value: 5 }, | ||
334 | - { label: "3月以上", value: 6 }, | ||
335 | - ], | ||
336 | tableData: [], | 287 | tableData: [], |
337 | total: 0, | 288 | total: 0, |
338 | count: 0, | 289 | count: 0, |
@@ -344,37 +295,8 @@ export default { | @@ -344,37 +295,8 @@ export default { | ||
344 | }, | 295 | }, |
345 | created() { | 296 | created() { |
346 | this.code = localStorage.getItem("csCode") || ""; | 297 | this.code = localStorage.getItem("csCode") || ""; |
347 | - | ||
348 | - (this.props.lazy = true), | ||
349 | - (this.props.lazyLoad = function (node, resolve) { | ||
350 | - const { level } = node; | ||
351 | - if (level == 2) { | ||
352 | - console.log(node); | ||
353 | - api | ||
354 | - .tenantClassList({ | ||
355 | - schoolId: node.data.value, | ||
356 | - }) | ||
357 | - .then((res) => { | ||
358 | - let children = formatGradeNameClass(res.data?.list).sort( | ||
359 | - (a, b) => { | ||
360 | - return a.grade - b.grade; | ||
361 | - } | ||
362 | - ); | ||
363 | - console.log(); | ||
364 | - | ||
365 | - const nodes = [...children]; | ||
366 | - // 通过调用resolve将子节点数据返回,通知组件数据加载完成 | ||
367 | - resolve(nodes); | ||
368 | - }); | ||
369 | - } else { | ||
370 | - resolve(node); | ||
371 | - } | ||
372 | - }); | ||
373 | - | ||
374 | - this.stationReport(); | ||
375 | - this._QueryGradeList(); | ||
376 | - this._QueryData(); | ||
377 | - this.showSchool(); | 298 | + // this.stationReport(); |
299 | + // this._QueryData(); | ||
378 | }, | 300 | }, |
379 | activated() { | 301 | activated() { |
380 | const that = this; | 302 | const that = this; |
@@ -383,16 +305,13 @@ export default { | @@ -383,16 +305,13 @@ export default { | ||
383 | that.page = 1; | 305 | that.page = 1; |
384 | that.total = 0; | 306 | that.total = 0; |
385 | that.count = 0; | 307 | that.count = 0; |
386 | - that.query.classId = []; | ||
387 | - that.query.onlineStatus = ""; | ||
388 | - that.query.sn = ""; | ||
389 | - that.query.type = ""; | ||
390 | - that.stationReport(); | ||
391 | - that._QueryData(); | 308 | + that.query.school = ""; |
309 | + that.query.zuhu = ""; | ||
310 | + // that.stationReport(); | ||
311 | + // that._QueryData(); | ||
392 | }); | 312 | }); |
393 | }, | 313 | }, |
394 | methods: { | 314 | methods: { |
395 | - | ||
396 | linkTo(obj, type) { | 315 | linkTo(obj, type) { |
397 | this.$router.push({ | 316 | this.$router.push({ |
398 | path: "/deviceLog", | 317 | path: "/deviceLog", |
@@ -402,87 +321,10 @@ export default { | @@ -402,87 +321,10 @@ export default { | ||
402 | }, | 321 | }, |
403 | }); | 322 | }); |
404 | }, | 323 | }, |
405 | - clickPieChart(obj) { | ||
406 | - this.query.onlineStatus = | ||
407 | - obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2; | ||
408 | - this.query.sn = ""; | ||
409 | - this.query.classId = []; | ||
410 | - this.page = 1; | ||
411 | - this._QueryData(false); | ||
412 | - }, | ||
413 | - clickScatterChart(obj) { | ||
414 | - this.query.type = | ||
415 | - obj.name == "1日内" | ||
416 | - ? 1 | ||
417 | - : obj.name == "3日内" | ||
418 | - ? 2 | ||
419 | - : obj.name == "7日内" | ||
420 | - ? 3 | ||
421 | - : obj.name == "1月内" | ||
422 | - ? 4 | ||
423 | - : obj.name == "3月内" | ||
424 | - ? 5 | ||
425 | - : 6; | ||
426 | - this.query.sn = ""; | ||
427 | - this.query.classId = []; | ||
428 | - this.page = 1; | ||
429 | - this._QueryData(false); | ||
430 | - }, | ||
431 | changePage(page) { | 324 | changePage(page) { |
432 | this.page = page; | 325 | this.page = page; |
433 | this._QueryData(false); | 326 | this._QueryData(false); |
434 | }, | 327 | }, |
435 | - | ||
436 | - async showSchool() { | ||
437 | - const { data, status, info } = await this.$request.schoolList(); | ||
438 | - if (status === 0) { | ||
439 | - let gradeListAll = data.list?.map((item) => { | ||
440 | - return { | ||
441 | - value: item.id, | ||
442 | - label: item.schoolName, | ||
443 | - }; | ||
444 | - }); | ||
445 | - this.schoolAll = [ | ||
446 | - { | ||
447 | - value: 0, | ||
448 | - label: "全部", | ||
449 | - children: [...gradeListAll], | ||
450 | - }, | ||
451 | - ]; | ||
452 | - this.gradeList = [...this.schoolAll, ...this.gradeList]; | ||
453 | - } else { | ||
454 | - this.$message.error(info); | ||
455 | - } | ||
456 | - }, | ||
457 | - | ||
458 | - | ||
459 | - // 查找班级 | ||
460 | - async _QueryGradeList() { | ||
461 | - this.loading = true; | ||
462 | - const { data, status, info } = await this.$request.gradeList(); | ||
463 | - if (status === 0) { | ||
464 | - if (!!data.list) { | ||
465 | - this.gradeList = | ||
466 | - data.list?.map((item) => { | ||
467 | - let gradeList = { | ||
468 | - value: item.id, | ||
469 | - label: item.regionName, | ||
470 | - }; | ||
471 | - gradeList.children = | ||
472 | - item.schoolList?.map((items) => { | ||
473 | - return { | ||
474 | - value: items.id, | ||
475 | - label: items.schoolName, | ||
476 | - }; | ||
477 | - }) || []; | ||
478 | - return gradeList; | ||
479 | - }) || []; | ||
480 | - this.gradeList = [...this.schoolAll, ...this.gradeList]; | ||
481 | - } | ||
482 | - } else { | ||
483 | - this.$message.error(info); | ||
484 | - } | ||
485 | - }, | ||
486 | // 基站统计数据 | 328 | // 基站统计数据 |
487 | async stationReport() { | 329 | async stationReport() { |
488 | const { data, status, info } = await this.$request.stationReport(); | 330 | const { data, status, info } = await this.$request.stationReport(); |
@@ -595,13 +437,16 @@ export default { | @@ -595,13 +437,16 @@ export default { | ||
595 | // 设备列表信息 | 437 | // 设备列表信息 |
596 | async _QueryData(isRef) { | 438 | async _QueryData(isRef) { |
597 | this.loading = true; | 439 | this.loading = true; |
598 | - let query = this.setQuery(); | 440 | + let query = {...this.query}; |
441 | + if(query.zuhu){ | ||
442 | + delete query.school | ||
443 | + } | ||
599 | if (isRef) { | 444 | if (isRef) { |
600 | this.page = 1; | 445 | this.page = 1; |
601 | } | 446 | } |
602 | this.loading = true; | 447 | this.loading = true; |
603 | this.tableData = []; | 448 | this.tableData = []; |
604 | - const { data, status, info } = await this.$request.deviceList({ | 449 | + const { data, status, info } = await this.$request.pDeviceList({ |
605 | ...query, | 450 | ...query, |
606 | deviceType: this.type, | 451 | deviceType: this.type, |
607 | page: this.page, | 452 | page: this.page, |
@@ -646,7 +491,6 @@ export default { | @@ -646,7 +491,6 @@ export default { | ||
646 | } | 491 | } |
647 | .content { | 492 | .content { |
648 | background: #f8f8f8; | 493 | background: #f8f8f8; |
649 | - border: 1px solid #e2e2e2; | ||
650 | border-radius: 10px; | 494 | border-radius: 10px; |
651 | overflow: hidden; | 495 | overflow: hidden; |
652 | :deep(.fa-edit) { | 496 | :deep(.fa-edit) { |
src/views/admin/device/log.vue
@@ -267,7 +267,7 @@ export default { | @@ -267,7 +267,7 @@ export default { | ||
267 | this._QueryData(); | 267 | this._QueryData(); |
268 | }, | 268 | }, |
269 | async _QueryDetail() { | 269 | async _QueryDetail() { |
270 | - const { data, status, info } = await this.$request.deviceDetail({ | 270 | + const { data, status, info } = await this.$request.pDeviceDetail({ |
271 | deviceId: this.id, | 271 | deviceId: this.id, |
272 | }); | 272 | }); |
273 | if (status === 0) { | 273 | if (status === 0) { |
src/views/index/mainIndex.vue
@@ -158,7 +158,7 @@ | @@ -158,7 +158,7 @@ | ||
158 | </li> | 158 | </li> |
159 | </template> | 159 | </template> |
160 | </ul> | 160 | </ul> |
161 | - <ul class="nav-list" v-if="type == 'ROLE_PINGTAI'"> | 161 | + <ul class="nav-list" v-if="type == 'ROLE_PERSONAL'"> |
162 | <li class="nav-item item1" @click="links('/examinationPaper')"> | 162 | <li class="nav-item item1" @click="links('/examinationPaper')"> |
163 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> | 163 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> |
164 | <div class="text"> | 164 | <div class="text"> |
@@ -225,7 +225,7 @@ | @@ -225,7 +225,7 @@ | ||
225 | </li> | 225 | </li> |
226 | 226 | ||
227 | </ul> | 227 | </ul> |
228 | - <ul class="nav-list" v-if="type == 'ROLE_ADMIN'"> | 228 | + <ul class="nav-list" v-if="type == 'ROLE_PINGTAI'"> |
229 | <li class="nav-item item1" @click="links('/account')"> | 229 | <li class="nav-item item1" @click="links('/account')"> |
230 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> | 230 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> |
231 | <div class="text"> | 231 | <div class="text"> |
@@ -279,7 +279,6 @@ export default { | @@ -279,7 +279,6 @@ export default { | ||
279 | }, | 279 | }, |
280 | _Init(val) { | 280 | _Init(val) { |
281 | this.type = this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; | 281 | this.type = this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; |
282 | - this.type = 'ROLE_PINGTAI' | ||
283 | this.navList = this.$store.getters.addRouters.map((item) => { | 282 | this.navList = this.$store.getters.addRouters.map((item) => { |
284 | return { | 283 | return { |
285 | name: item.name, | 284 | name: item.name, |
@@ -296,7 +295,7 @@ export default { | @@ -296,7 +295,7 @@ export default { | ||
296 | this.tenantIndex(); | 295 | this.tenantIndex(); |
297 | } else if (this.type == "ROLE_BANZHUREN") { | 296 | } else if (this.type == "ROLE_BANZHUREN") { |
298 | this.classIndex(); | 297 | this.classIndex(); |
299 | - } else if (this.type == "ROLE_PINGTAI") { | 298 | + } else if (this.type == "ROLE_PERSONAL") { |
300 | this.personalIndex(); | 299 | this.personalIndex(); |
301 | } | 300 | } |
302 | }, | 301 | }, |
src/views/layout/header/header.vue
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <!-- <li> | 9 | <!-- <li> |
10 | <langSelect></langSelect> | 10 | <langSelect></langSelect> |
11 | </li> --> | 11 | </li> --> |
12 | - <li class="dropdown-box" v-if="role != 'ROLE_PINGTAI'"> | 12 | + <li class="dropdown-box" v-if="role != 'ROLE_PERSONAL'&&role != 'ROLE_PINGTAI'"> |
13 | <div class="userInfo"> | 13 | <div class="userInfo"> |
14 | <img :src="avatar" /> | 14 | <img :src="avatar" /> |
15 | <div class="txt"> | 15 | <div class="txt"> |
@@ -34,7 +34,16 @@ | @@ -34,7 +34,16 @@ | ||
34 | </el-dropdown-menu> | 34 | </el-dropdown-menu> |
35 | </el-dropdown> | 35 | </el-dropdown> |
36 | </li> | 36 | </li> |
37 | - <li class="dropdown-box" v-else @click="linkToUserInfo"> | 37 | + <li class="dropdown-box" v-if="role == 'ROLE_PINGTAI'"> |
38 | + <div class="userInfo"> | ||
39 | + <img :src="avatar" /> | ||
40 | + <div class="txt"> | ||
41 | + <p>{{ `${this.$store.getters.info.name}` }}</p> | ||
42 | + <p>管理员</p> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + </li> | ||
46 | + <li class="dropdown-box" v-if="role == 'ROLE_PERSONAL'" @click="linkToUserInfo"> | ||
38 | <div class="userInfo"> | 47 | <div class="userInfo"> |
39 | <img :src="avatar" /> | 48 | <img :src="avatar" /> |
40 | <div class="txt"> | 49 | <div class="txt"> |
src/views/personal/examinationPaper/add.vue
@@ -572,7 +572,6 @@ | @@ -572,7 +572,6 @@ | ||
572 | questionForm.questionType == 2 || | 572 | questionForm.questionType == 2 || |
573 | questionForm.questionType == 6 | 573 | questionForm.questionType == 6 |
574 | " | 574 | " |
575 | - class="answer-box" | ||
576 | > | 575 | > |
577 | <template v-for="(option, opIdx) in rightOptions"> | 576 | <template v-for="(option, opIdx) in rightOptions"> |
578 | <span | 577 | <span |
src/views/standard/examinationPaper/add.vue
@@ -570,7 +570,6 @@ | @@ -570,7 +570,6 @@ | ||
570 | questionForm.questionType == 2 || | 570 | questionForm.questionType == 2 || |
571 | questionForm.questionType == 6 | 571 | questionForm.questionType == 6 |
572 | " | 572 | " |
573 | - class="answer-box" | ||
574 | > | 573 | > |
575 | <template v-for="(option, opIdx) in rightOptions"> | 574 | <template v-for="(option, opIdx) in rightOptions"> |
576 | <span | 575 | <span |
@@ -792,7 +791,7 @@ | @@ -792,7 +791,7 @@ | ||
792 | >,</span | 791 | >,</span |
793 | > | 792 | > |
794 | </template> | 793 | </template> |
795 | - <template v-if="formAns.qusType == 2" class="answer-box"> | 794 | + <template v-if="formAns.qusType == 2"> |
796 | <span | 795 | <span |
797 | class="answer-s active" | 796 | class="answer-s active" |
798 | v-for="option in formAns.answerOptions.split(',')" | 797 | v-for="option in formAns.answerOptions.split(',')" |
src/views/standard/examinationPaper/edit.vue
@@ -301,7 +301,7 @@ | @@ -301,7 +301,7 @@ | ||
301 | >,</span | 301 | >,</span |
302 | > | 302 | > |
303 | </template> | 303 | </template> |
304 | - <template v-if="formAns.qusType == 2" class="answer-box"> | 304 | + <template v-if="formAns.qusType == 2"> |
305 | <span | 305 | <span |
306 | class="answer-s active" | 306 | class="answer-s active" |
307 | v-for="option in formAns.answerOptions.split(',')" | 307 | v-for="option in formAns.answerOptions.split(',')" |