|
@@ -16,8 +16,8 @@
|
16
|
16
|
<Table :columns="columns" :data="searchForm.list">
|
17
|
17
|
<template slot-scope="{ row }" slot="actionSlot">
|
18
|
18
|
<div class="action_list">
|
19
|
|
- <div @click="toView(row)">查看</div>
|
20
|
|
- <div @click="toEdit(row)">编辑</div>
|
|
19
|
+ <div @click="toEdit(row, 1)">查看</div>
|
|
20
|
+ <div @click="toEdit(row, 2)">编辑</div>
|
21
|
21
|
<div class="action_del" @click="toDel(row)">删除</div>
|
22
|
22
|
<div @click="toEmpower(row)">授权</div>
|
23
|
23
|
</div>
|
|
@@ -72,35 +72,48 @@
|
72
|
72
|
</Modal>
|
73
|
73
|
<!-- 编辑 -->
|
74
|
74
|
<Modal
|
75
|
|
- class="modal5"
|
76
|
|
- :mask-closable="false"
|
77
|
|
- v-model="strategyInfo.show"
|
78
|
|
- title="编辑"
|
|
75
|
+ class="modal5"
|
|
76
|
+ :mask-closable="false"
|
|
77
|
+ v-model="strategyInfo.show"
|
|
78
|
+ :title="strategyInfo.model"
|
79
|
79
|
>
|
80
|
|
- <div class="content">
|
|
80
|
+ <div class="content" v-if="strategyInfo.show">
|
|
81
|
+ <div class="titles">
|
|
82
|
+ <div class="require">策略名称</div>
|
|
83
|
+ <Input
|
|
84
|
+ v-model.trim="strategyInfo.name"
|
|
85
|
+ :disabled="strategyInfo.model === '查看'"
|
|
86
|
+ style="width: 400px"
|
|
87
|
+ placeholder="请输入策略名称"
|
|
88
|
+ ></Input>
|
|
89
|
+ </div>
|
81
|
90
|
<div class="strategy_list">
|
82
|
91
|
<div class="strategy_title">
|
83
|
92
|
<div>
|
84
|
|
- <span
|
85
|
|
- style="font-size: 26px"
|
86
|
|
- class="ivu-icon iconfont icon-shijian"
|
87
|
|
- ></span
|
88
|
|
- >时间限制策略
|
|
93
|
+ <span
|
|
94
|
+ style="font-size: 26px"
|
|
95
|
+ class="ivu-icon iconfont icon-shijian"
|
|
96
|
+ ></span
|
|
97
|
+ >时间限制策略
|
89
|
98
|
</div>
|
90
|
99
|
<div>
|
91
|
|
- <Checkbox v-if="strategyInfo.model != 'see'" v-model="strategyInfo.hastime"
|
92
|
|
- >启用</Checkbox
|
|
100
|
+ <Checkbox
|
|
101
|
+ v-if="strategyInfo.model != '查看'"
|
|
102
|
+ v-model="strategyInfo.hastime"
|
|
103
|
+ >启用</Checkbox
|
93
|
104
|
>
|
94
|
105
|
</div>
|
95
|
106
|
</div>
|
96
|
107
|
<div style="margin-bottom: 10px" v-if="strategyInfo.hastime">
|
97
|
108
|
<TimeStrategy
|
98
|
|
- v-if="strategyInfo.model != 'see'"
|
99
|
|
- :times="strategyInfo.padTimes"
|
100
|
|
- @timesChange="timesChange"
|
|
109
|
+ v-if="strategyInfo.model != '查看'"
|
|
110
|
+ :times="strategyInfo.padTimes"
|
|
111
|
+ @timesChange="timesChange"
|
101
|
112
|
></TimeStrategy>
|
102
|
|
- <div class="showtime" v-if="strategyInfo.model === 'see'">
|
103
|
|
- <div style="line-height: 30px; font-size: 16px; margin-bottom: 10px">
|
|
113
|
+ <div class="showtime" v-if="strategyInfo.model === '查看'">
|
|
114
|
+ <div
|
|
115
|
+ style="line-height: 30px; font-size: 16px; margin-bottom: 10px"
|
|
116
|
+ >
|
104
|
117
|
设备生效时间
|
105
|
118
|
</div>
|
106
|
119
|
<div class="week">
|
|
@@ -108,7 +121,9 @@
|
108
|
121
|
<div class="day_title">{{ item.title }}</div>
|
109
|
122
|
<div class="day_content">
|
110
|
123
|
<div class="time" v-for="sitem in getDay(item.id)">
|
111
|
|
- {{ getTime(sitem.starttime) }}-{{ getTime(sitem.stoptime) }}
|
|
124
|
+ {{ getTime(sitem.starttime) }}-{{
|
|
125
|
+ getTime(sitem.stoptime)
|
|
126
|
+ }}
|
112
|
127
|
</div>
|
113
|
128
|
</div>
|
114
|
129
|
</div>
|
|
@@ -123,8 +138,10 @@
|
123
|
138
|
<span class="ivu-icon iconfont icon-yingyongcelve"></span>应用策略
|
124
|
139
|
</div>
|
125
|
140
|
<div>
|
126
|
|
- <Checkbox v-if="strategyInfo.model != 'see'" v-model="strategyInfo.hasapp"
|
127
|
|
- >启用</Checkbox
|
|
141
|
+ <Checkbox
|
|
142
|
+ v-if="strategyInfo.model != '查看'"
|
|
143
|
+ v-model="strategyInfo.hasapp"
|
|
144
|
+ >启用</Checkbox
|
128
|
145
|
>
|
129
|
146
|
</div>
|
130
|
147
|
</div>
|
|
@@ -133,17 +150,17 @@
|
133
|
150
|
<span>授权应用</span>
|
134
|
151
|
</div>
|
135
|
152
|
<div
|
136
|
|
- class="strategy_bottom"
|
137
|
|
- style="min-height: 160px"
|
138
|
|
- v-if="padApps.length > 0"
|
|
153
|
+ class="strategy_bottom"
|
|
154
|
+ style="min-height: 160px"
|
|
155
|
+ v-if="padApps.length > 0"
|
139
|
156
|
>
|
140
|
157
|
<div class="app_list" v-for="item in padApps" :key="item.appid">
|
141
|
158
|
<img :src="$api.baseImageUrl + item.appIcon" />
|
142
|
159
|
<div>{{ item.appName }}</div>
|
143
|
160
|
<Checkbox
|
144
|
|
- class="checked"
|
145
|
|
- :disabled="strategyInfo.model === 'see'"
|
146
|
|
- v-model="item.checked"
|
|
161
|
+ class="checked"
|
|
162
|
+ :disabled="strategyInfo.model === '查看'"
|
|
163
|
+ v-model="item.checked"
|
147
|
164
|
></Checkbox>
|
148
|
165
|
</div>
|
149
|
166
|
</div>
|
|
@@ -152,10 +169,14 @@
|
152
|
169
|
</div>
|
153
|
170
|
<div class="strategy_list">
|
154
|
171
|
<div class="strategy_title">
|
155
|
|
- <div><span class="ivu-icon iconfont icon-shezhi"></span>设备策略</div>
|
156
|
172
|
<div>
|
157
|
|
- <Checkbox v-if="strategyInfo.model != 'see'" v-model="strategyInfo.hasdevice"
|
158
|
|
- >启用</Checkbox
|
|
173
|
+ <span class="ivu-icon iconfont icon-shezhi"></span>设备策略
|
|
174
|
+ </div>
|
|
175
|
+ <div>
|
|
176
|
+ <Checkbox
|
|
177
|
+ v-if="strategyInfo.model != '查看'"
|
|
178
|
+ v-model="strategyInfo.hasdevice"
|
|
179
|
+ >启用</Checkbox
|
159
|
180
|
>
|
160
|
181
|
</div>
|
161
|
182
|
</div>
|
|
@@ -165,20 +186,20 @@
|
165
|
186
|
</div>
|
166
|
187
|
<div class="strategy_bottom" style="min-height: 160px">
|
167
|
188
|
<div
|
168
|
|
- class="device_list"
|
169
|
|
- v-for="item in padDevices"
|
170
|
|
- :key="item.pdorder"
|
|
189
|
+ class="device_list"
|
|
190
|
+ v-for="item in padDevices"
|
|
191
|
+ :key="item.pdorder"
|
171
|
192
|
>
|
172
|
193
|
<div class="icon">
|
173
|
194
|
<span :class="[item.icon]"></span>
|
174
|
195
|
</div>
|
175
|
196
|
<div class="title">{{ item.pdtype }}</div>
|
176
|
197
|
<i-switch
|
177
|
|
- size="large"
|
178
|
|
- v-model="item.enabled"
|
179
|
|
- :disabled="strategyInfo.model === 'see'"
|
180
|
|
- :true-value="1"
|
181
|
|
- :false-value="2"
|
|
198
|
+ size="large"
|
|
199
|
+ v-model="item.enabled"
|
|
200
|
+ :disabled="strategyInfo.model === '查看'"
|
|
201
|
+ :true-value="1"
|
|
202
|
+ :false-value="2"
|
182
|
203
|
>
|
183
|
204
|
<span slot="open">开启</span>
|
184
|
205
|
<span slot="close">关闭</span>
|
|
@@ -191,44 +212,46 @@
|
191
|
212
|
<div class="strategy_list">
|
192
|
213
|
<div class="strategy_title">
|
193
|
214
|
<div>
|
194
|
|
- <span
|
195
|
|
- style="font-size: 18px"
|
196
|
|
- class="ivu-icon iconfont icon-wifi"
|
197
|
|
- ></span
|
198
|
|
- >Wifi白名单策略
|
|
215
|
+ <span
|
|
216
|
+ style="font-size: 18px"
|
|
217
|
+ class="ivu-icon iconfont icon-wifi"
|
|
218
|
+ ></span
|
|
219
|
+ >Wifi白名单策略
|
199
|
220
|
</div>
|
200
|
221
|
<div>
|
201
|
|
- <Checkbox v-if="strategyInfo.model != 'see'" v-model="strategyInfo.haswifi"
|
202
|
|
- >启用</Checkbox
|
|
222
|
+ <Checkbox
|
|
223
|
+ v-if="strategyInfo.model != '查看'"
|
|
224
|
+ v-model="strategyInfo.haswifi"
|
|
225
|
+ >启用</Checkbox
|
203
|
226
|
>
|
204
|
227
|
</div>
|
205
|
228
|
</div>
|
206
|
229
|
<div class="strategy_content" v-if="strategyInfo.haswifi">
|
207
|
230
|
<div class="strategy_top">
|
208
|
231
|
<span>SSID</span>
|
209
|
|
- <span v-if="strategyInfo.model != 'see'">
|
210
|
|
- <Input
|
211
|
|
- v-model.trim="ssidName"
|
212
|
|
- placeholder="请输入SSID"
|
213
|
|
- style="width: 260px; margin: 0 10px"
|
214
|
|
- />
|
215
|
|
- <Button type="primary" class="primary_btn" @click="AddWifi()"
|
216
|
|
- >添加</Button
|
217
|
|
- >
|
218
|
|
- </span>
|
|
232
|
+ <span v-if="strategyInfo.model != '查看'">
|
|
233
|
+ <Input
|
|
234
|
+ v-model.trim="ssidName"
|
|
235
|
+ placeholder="请输入SSID"
|
|
236
|
+ style="width: 260px; margin: 0 10px"
|
|
237
|
+ />
|
|
238
|
+ <Button type="primary" class="primary_btn" @click="AddWifi()"
|
|
239
|
+ >添加</Button
|
|
240
|
+ >
|
|
241
|
+ </span>
|
219
|
242
|
</div>
|
220
|
243
|
<div class="strategy_bottom" style="min-height: 76px">
|
221
|
244
|
<div
|
222
|
|
- class="padWifis"
|
223
|
|
- v-for="(item, index) in strategyInfo.padWifis"
|
224
|
|
- :key="index"
|
|
245
|
+ class="padWifis"
|
|
246
|
+ v-for="(item, index) in strategyInfo.padWifis"
|
|
247
|
+ :key="index"
|
225
|
248
|
>
|
226
|
249
|
<div class="title">{{ item }}</div>
|
227
|
250
|
<img
|
228
|
|
- v-if="strategyInfo.model != 'see'"
|
229
|
|
- @click="delWifi(item)"
|
230
|
|
- class="del"
|
231
|
|
- src="../../../assets/img/guanbi_red.png"
|
|
251
|
+ v-if="strategyInfo.model != '查看'"
|
|
252
|
+ @click="delWifi(item)"
|
|
253
|
+ class="del"
|
|
254
|
+ src="../../../assets/img/guanbi_red.png"
|
232
|
255
|
/>
|
233
|
256
|
</div>
|
234
|
257
|
</div>
|
|
@@ -241,53 +264,66 @@
|
241
|
264
|
<span class="ivu-icon iconfont icon-weiguiguanli"></span>违规处理
|
242
|
265
|
</div>
|
243
|
266
|
<div>
|
244
|
|
- <Checkbox v-if="strategyInfo.model != 'see'" v-model="strategyInfo.hasviolate"
|
245
|
|
- >启用</Checkbox
|
|
267
|
+ <Checkbox
|
|
268
|
+ v-if="strategyInfo.model != '查看'"
|
|
269
|
+ v-model="strategyInfo.hasviolate"
|
|
270
|
+ >启用</Checkbox
|
246
|
271
|
>
|
247
|
272
|
</div>
|
248
|
273
|
</div>
|
249
|
274
|
<Table
|
250
|
|
- v-if="strategyInfo.hasviolate"
|
251
|
|
- class="table"
|
252
|
|
- :columns="columns1"
|
253
|
|
- :data="padViolates"
|
|
275
|
+ v-if="strategyInfo.hasviolate"
|
|
276
|
+ class="table"
|
|
277
|
+ :columns="columns1"
|
|
278
|
+ :data="padViolates"
|
254
|
279
|
>
|
255
|
280
|
<template slot-scope="{ row }" slot="violationEvents">
|
256
|
281
|
<Checkbox
|
257
|
|
- :disabled="strategyInfo.model === 'see'"
|
258
|
|
- class="checked"
|
259
|
|
- @on-change="checkedChange(row)"
|
260
|
|
- v-model="row.checked"
|
|
282
|
+ :disabled="strategyInfo.model === '查看'"
|
|
283
|
+ class="checked"
|
|
284
|
+ @on-change="checkedChange(row)"
|
|
285
|
+ v-model="row.checked"
|
261
|
286
|
></Checkbox>
|
262
|
|
- <span style="display: inline-block; width: 120px; text-align: left">{{
|
263
|
|
- row.title
|
264
|
|
- }}</span>
|
|
287
|
+ <span
|
|
288
|
+ style="display: inline-block; width: 120px; text-align: left"
|
|
289
|
+ >{{ row.title }}</span
|
|
290
|
+ >
|
265
|
291
|
</template>
|
266
|
292
|
<template slot-scope="{ row }" slot="violationHandling">
|
267
|
293
|
<CheckboxGroup
|
268
|
|
- @on-change="checkboxChange(row)"
|
269
|
|
- v-model="row.handleMethod"
|
|
294
|
+ @on-change="checkboxChange(row)"
|
|
295
|
+ v-model="row.handleMethod"
|
270
|
296
|
>
|
271
|
|
- <Checkbox :disabled="strategyInfo.model === 'see'" label="通知管理员"></Checkbox>
|
272
|
297
|
<Checkbox
|
273
|
|
- :disabled="strategyInfo.model === 'see'"
|
274
|
|
- style="margin: 0 40px"
|
275
|
|
- label="限制使用"
|
|
298
|
+ :disabled="strategyInfo.model === '查看'"
|
|
299
|
+ label="通知管理员"
|
|
300
|
+ ></Checkbox>
|
|
301
|
+ <Checkbox
|
|
302
|
+ :disabled="strategyInfo.model === '查看'"
|
|
303
|
+ style="margin: 0 40px"
|
|
304
|
+ label="限制使用"
|
276
|
305
|
></Checkbox>
|
277
|
306
|
<Checkbox
|
278
|
|
- :disabled="strategyInfo.model === 'see'"
|
279
|
|
- label="恢复出厂设置"
|
|
307
|
+ :disabled="strategyInfo.model === '查看'"
|
|
308
|
+ label="恢复出厂设置"
|
280
|
309
|
></Checkbox>
|
281
|
310
|
</CheckboxGroup>
|
282
|
311
|
</template>
|
283
|
312
|
</Table>
|
284
|
|
- <div class="nodata" v-if="!strategyInfo.hasviolate">未设置违规处理</div>
|
|
313
|
+ <div class="nodata" v-if="!strategyInfo.hasviolate">
|
|
314
|
+ 未设置违规处理
|
|
315
|
+ </div>
|
285
|
316
|
</div>
|
286
|
317
|
</div>
|
287
|
318
|
<div slot="footer" style="text-align: right">
|
288
|
|
- <Button style="margin-right: 10px" @click="strategyInfo.show = false">关闭</Button>
|
289
|
|
- <Button type="primary" class="primary_btn" @click="save()"
|
290
|
|
- >保存</Button
|
|
319
|
+ <Button @click="strategyInfo.show = false">关闭</Button>
|
|
320
|
+ <Button
|
|
321
|
+ v-if="strategyInfo.model != '查看'"
|
|
322
|
+ style="margin-left: 10px"
|
|
323
|
+ type="primary"
|
|
324
|
+ class="primary_btn"
|
|
325
|
+ @click="save()"
|
|
326
|
+ >保存</Button
|
291
|
327
|
>
|
292
|
328
|
</div>
|
293
|
329
|
</Modal>
|
|
@@ -301,11 +337,14 @@
|
301
|
337
|
<script>
|
302
|
338
|
import {
|
303
|
339
|
class_list_strategy,
|
304
|
|
- stApp_add_empower, stPad_add,
|
305
|
|
- stPad_delete, stPad_detail, stPad_edit,
|
|
340
|
+ stPad_add,
|
|
341
|
+ stPad_add_empower,
|
|
342
|
+ stPad_delete,
|
|
343
|
+ stPad_detail,
|
|
344
|
+ stPad_edit,
|
306
|
345
|
stPad_list
|
307
|
346
|
} from "@/api/stPad";
|
308
|
|
-import {app_list_sel} from "@/api/appgroup";
|
|
347
|
+import { app_list_sel } from "@/api/appgroup";
|
309
|
348
|
|
310
|
349
|
import TimeStrategy from "@/components/TimeStrategy/TimeStrategy";
|
311
|
350
|
export default {
|
|
@@ -322,26 +361,18 @@ export default {
|
322
|
361
|
list: [],
|
323
|
362
|
total: 0
|
324
|
363
|
},
|
325
|
|
- rules: {
|
326
|
|
- name: [
|
327
|
|
- {
|
328
|
|
- required: true,
|
329
|
|
- message: "请输入名称",
|
330
|
|
- trigger: "change"
|
331
|
|
- }
|
332
|
|
- ]
|
333
|
|
- },
|
334
|
364
|
empowerInfo: {
|
335
|
365
|
show: false,
|
336
|
366
|
name: "",
|
337
|
367
|
checked: false,
|
338
|
|
- stappid: null,
|
|
368
|
+ padid: null,
|
339
|
369
|
schoolid: null,
|
340
|
370
|
classids: [],
|
341
|
371
|
schoolInfo: {}
|
342
|
372
|
},
|
343
|
373
|
strategyInfo: {
|
344
|
374
|
model: "add", //add添加/edit编辑/see查看
|
|
375
|
+ name: null,
|
345
|
376
|
userid: null,
|
346
|
377
|
rversion: null,
|
347
|
378
|
padid: null,
|
|
@@ -415,7 +446,7 @@ export default {
|
415
|
446
|
},
|
416
|
447
|
{
|
417
|
448
|
pdorder: 10,
|
418
|
|
- pdtype: "SD卡",
|
|
449
|
+ pdtype: "OTG",
|
419
|
450
|
enabled: 2,
|
420
|
451
|
icon: "ivu-icon iconfont icon-icon-OTG"
|
421
|
452
|
}
|
|
@@ -563,64 +594,6 @@ export default {
|
563
|
594
|
item.checked = item.padid === row.padid ? true : false;
|
564
|
595
|
});
|
565
|
596
|
},
|
566
|
|
- saveStPadInfo() {
|
567
|
|
- //保存引用策略
|
568
|
|
- let obj = this.stPadInfo.list.filter((v) => v.checked)[0] || null;
|
569
|
|
- if (!obj) {
|
570
|
|
- this.$Message.error("请选择引用策略!");
|
571
|
|
- return;
|
572
|
|
- }
|
573
|
|
- this.showLoading = true;
|
574
|
|
- stPad_detail({ padid: obj.padid }).then((res) => {
|
575
|
|
- this.showLoading = false;
|
576
|
|
- if (res.code === 0) {
|
577
|
|
- //数据回显
|
578
|
|
- this.strategyInfo = res.obj;
|
579
|
|
- this.strategyInfo.hastime = this.strategyInfo.hastime ? true : false;
|
580
|
|
- this.strategyInfo.hasapp = this.strategyInfo.hasapp ? true : false;
|
581
|
|
- this.strategyInfo.hasdevice = this.strategyInfo.hasdevice
|
582
|
|
- ? true
|
583
|
|
- : false;
|
584
|
|
- this.strategyInfo.haswifi = this.strategyInfo.haswifi ? true : false;
|
585
|
|
- this.strategyInfo.hasviolate = this.strategyInfo.hasviolate
|
586
|
|
- ? true
|
587
|
|
- : false;
|
588
|
|
- if (this.strategyInfo.hasapp) {
|
589
|
|
- //回显应用策略
|
590
|
|
- this.padApps.forEach((item) => {
|
591
|
|
- let ishas = this.strategyInfo.padApps.some((v) => {
|
592
|
|
- return v.appid === item.appid;
|
593
|
|
- });
|
594
|
|
- item.checked = ishas ? true : false;
|
595
|
|
- });
|
596
|
|
- }
|
597
|
|
- if (this.strategyInfo.hasdevice) {
|
598
|
|
- //回显设备策略
|
599
|
|
- this.padDevices.forEach((item) => {
|
600
|
|
- let obj = this.strategyInfo.padDevices.filter((v) => {
|
601
|
|
- return v.pdtype === item.pdtype;
|
602
|
|
- })[0] || { enabled: 2 };
|
603
|
|
- item.enabled = obj.enabled;
|
604
|
|
- });
|
605
|
|
- }
|
606
|
|
- if (this.strategyInfo.hasviolate) {
|
607
|
|
- //回显违规处理
|
608
|
|
- this.padViolates.forEach((item) => {
|
609
|
|
- let arr = this.strategyInfo.padViolates.filter((v) => {
|
610
|
|
- return v.violateType === item.violateType;
|
611
|
|
- });
|
612
|
|
- item.checked = arr.length > 0 ? true : false;
|
613
|
|
- item.handleMethod =
|
614
|
|
- arr.length > 0 ? arr[0].handleMethod.split(";") : [];
|
615
|
|
- });
|
616
|
|
- }
|
617
|
|
- this.curState = 2; //编辑状态
|
618
|
|
- this.stPadInfo.show = false;
|
619
|
|
- } else {
|
620
|
|
- this.$Message.error(res.msg);
|
621
|
|
- }
|
622
|
|
- });
|
623
|
|
- },
|
624
|
597
|
getTime(time) {
|
625
|
598
|
return time;
|
626
|
599
|
},
|
|
@@ -633,9 +606,23 @@ export default {
|
633
|
606
|
this.strategyInfo.padTimes = times;
|
634
|
607
|
},
|
635
|
608
|
save() {
|
|
609
|
+ if (!this.strategyInfo.name) {
|
|
610
|
+ this.$Message.error("请输入策略名称!");
|
|
611
|
+ return;
|
|
612
|
+ }
|
|
613
|
+ if (
|
|
614
|
+ !this.strategyInfo.hastime &&
|
|
615
|
+ !this.strategyInfo.hasapp &&
|
|
616
|
+ !this.strategyInfo.hasdevice &&
|
|
617
|
+ !this.strategyInfo.haswifi &&
|
|
618
|
+ !this.strategyInfo.hasviolate
|
|
619
|
+ ) {
|
|
620
|
+ this.$Message.error("请选择策略!");
|
|
621
|
+ return;
|
|
622
|
+ }
|
636
|
623
|
let padDevices = [],
|
637
|
|
- padViolates = [],
|
638
|
|
- padApps = [];
|
|
624
|
+ padViolates = [],
|
|
625
|
+ padApps = [];
|
639
|
626
|
//获取授权应用
|
640
|
627
|
for (let item of this.padApps) {
|
641
|
628
|
if (item.checked) {
|
|
@@ -696,8 +683,9 @@ export default {
|
696
|
683
|
}
|
697
|
684
|
}
|
698
|
685
|
let form = {
|
699
|
|
- sttype: 3, //1学校策略 2班级策略 3个人策略
|
700
|
|
- objectid: this.strategyInfo.userid,
|
|
686
|
+ name: this.strategyInfo.name,
|
|
687
|
+ sttype: 0, //0公共 1学校策略 2班级策略 3个人策略
|
|
688
|
+ objectid: this.powerParams.objectid,
|
701
|
689
|
hastime: this.strategyInfo.hastime ? 1 : 0,
|
702
|
690
|
hasapp: this.strategyInfo.hasapp ? 1 : 0,
|
703
|
691
|
hasdevice: this.strategyInfo.hasdevice ? 1 : 0,
|
|
@@ -709,19 +697,19 @@ export default {
|
709
|
697
|
padWifis: this.strategyInfo.haswifi ? this.strategyInfo.padWifis : [],
|
710
|
698
|
padApps: this.strategyInfo.hasapp ? padApps : []
|
711
|
699
|
};
|
712
|
|
- if (this.strategyInfo.model === 'edit') {
|
|
700
|
+ if (this.strategyInfo.model === "编辑") {
|
713
|
701
|
//编辑
|
714
|
702
|
form.padid = this.strategyInfo.padid;
|
715
|
703
|
form.rversion = this.strategyInfo.rversion;
|
716
|
704
|
}
|
717
|
|
- let api = this.strategyInfo.model === 'edit' ? stPad_edit : stPad_add;
|
|
705
|
+ let api = this.strategyInfo.model === "编辑" ? stPad_edit : stPad_add;
|
718
|
706
|
console.log(form);
|
719
|
707
|
api(form).then((res) => {
|
720
|
708
|
if (res.code === 0) {
|
721
|
709
|
this.$Message.success(res.msg);
|
722
|
710
|
this.searchList();
|
723
|
711
|
this.strategyInfo.show = false;
|
724
|
|
- console.log(res.obj)
|
|
712
|
+ console.log(res.obj);
|
725
|
713
|
} else {
|
726
|
714
|
this.$Message.error(res.msg);
|
727
|
715
|
}
|
|
@@ -750,7 +738,7 @@ export default {
|
750
|
738
|
delWifi(val) {
|
751
|
739
|
//删除wifi白名单
|
752
|
740
|
this.strategyInfo.padWifis = this.strategyInfo.padWifis.filter(
|
753
|
|
- (v) => v != val
|
|
741
|
+ (v) => v != val
|
754
|
742
|
);
|
755
|
743
|
},
|
756
|
744
|
AddWifi() {
|
|
@@ -760,18 +748,17 @@ export default {
|
760
|
748
|
}
|
761
|
749
|
this.strategyInfo.padWifis.push(this.ssidName);
|
762
|
750
|
this.strategyInfo.padWifis = Array.from(
|
763
|
|
- new Set(this.strategyInfo.padWifis)
|
|
751
|
+ new Set(this.strategyInfo.padWifis)
|
764
|
752
|
);
|
765
|
753
|
},
|
766
|
754
|
saveEmpowerInfo() {
|
767
|
755
|
//保存授权
|
768
|
|
- console.log(this.empowerInfo);
|
769
|
756
|
if (this.empowerInfo.classids.length === 0 && !this.empowerInfo.checked) {
|
770
|
757
|
this.$Message.error("请选择学校/班级!");
|
771
|
758
|
return;
|
772
|
759
|
}
|
773
|
760
|
let form = {
|
774
|
|
- stappid: this.empowerInfo.stappid
|
|
761
|
+ padid: this.empowerInfo.padid
|
775
|
762
|
};
|
776
|
763
|
if (this.empowerInfo.checked) {
|
777
|
764
|
form.schoolid = this.empowerInfo.schoolid;
|
|
@@ -781,7 +768,7 @@ export default {
|
781
|
768
|
}
|
782
|
769
|
console.log(form);
|
783
|
770
|
this.empowerInfo.show = true;
|
784
|
|
- stApp_add_empower(form).then((data) => {
|
|
771
|
+ stPad_add_empower(form).then((data) => {
|
785
|
772
|
if (data.code === 0) {
|
786
|
773
|
this.empowerInfo.show = false;
|
787
|
774
|
this.$Message.success(data.msg);
|
|
@@ -807,10 +794,32 @@ export default {
|
807
|
794
|
this.searchForm.page = 1;
|
808
|
795
|
this.getList();
|
809
|
796
|
},
|
|
797
|
+ initData() {
|
|
798
|
+ //数据初始化
|
|
799
|
+ this.strategyInfo.padTimes = []; // 平板策略时间
|
|
800
|
+ this.strategyInfo.padApps = []; //appid集合
|
|
801
|
+ this.strategyInfo.padDevices = []; //授权应用
|
|
802
|
+ this.strategyInfo.padWifis = []; //wifi白名单
|
|
803
|
+ this.strategyInfo.padViolates = []; //设备违规
|
|
804
|
+ this.padDevices.forEach((item) => {
|
|
805
|
+ item.enabled = 2;
|
|
806
|
+ });
|
|
807
|
+ this.padViolates.forEach((item) => {
|
|
808
|
+ item.checked = false;
|
|
809
|
+ item.handleMethod = [];
|
|
810
|
+ });
|
|
811
|
+ this.padApps.forEach((item) => {
|
|
812
|
+ item.checked = false;
|
|
813
|
+ });
|
|
814
|
+ },
|
810
|
815
|
// 获取列表
|
811
|
816
|
getList() {
|
812
|
817
|
this.showLoading = true;
|
813
|
|
- stPad_list({ schoolid: this.powerParams.objectid }).then((res) => {
|
|
818
|
+ stPad_list({
|
|
819
|
+ size: this.searchForm.size,
|
|
820
|
+ page: this.searchForm.page,
|
|
821
|
+ schoolid: this.powerParams.objectid
|
|
822
|
+ }).then((res) => {
|
814
|
823
|
this.showLoading = false;
|
815
|
824
|
if (res.code === 0) {
|
816
|
825
|
this.searchForm.list = res.obj;
|
|
@@ -824,8 +833,10 @@ export default {
|
824
|
833
|
// 新建
|
825
|
834
|
async toAdd() {
|
826
|
835
|
await this.getAppList();
|
|
836
|
+ this.initData();
|
827
|
837
|
this.strategyInfo = {
|
828
|
|
- model: "add", //添加
|
|
838
|
+ model: "新建", //添加
|
|
839
|
+ name: null,
|
829
|
840
|
padid: null,
|
830
|
841
|
rversion: null,
|
831
|
842
|
show: true,
|
|
@@ -839,13 +850,13 @@ export default {
|
839
|
850
|
padWifis: [], //wifi白名单
|
840
|
851
|
hasviolate: false, //是否开启违规通知:0否 1是
|
841
|
852
|
padViolates: [] //设备违规
|
842
|
|
- }
|
843
|
|
- console.log(this.strategyInfo)
|
|
853
|
+ };
|
|
854
|
+ console.log(this.strategyInfo);
|
844
|
855
|
},
|
845
|
|
- async getAppList(){
|
|
856
|
+ async getAppList() {
|
846
|
857
|
//获取应用列表
|
847
|
858
|
this.showLoading = true;
|
848
|
|
- let res = await app_list_sel({
|
|
859
|
+ let res = await app_list_sel({
|
849
|
860
|
rtype: this.powerParams.rtype,
|
850
|
861
|
objectid: this.powerParams.objectid
|
851
|
862
|
});
|
|
@@ -855,7 +866,7 @@ export default {
|
855
|
866
|
v.checked = false;
|
856
|
867
|
return v;
|
857
|
868
|
});
|
858
|
|
- console.log(this.padApps)
|
|
869
|
+ console.log(this.padApps);
|
859
|
870
|
} else {
|
860
|
871
|
this.$Message.error(res.msg);
|
861
|
872
|
}
|
|
@@ -863,9 +874,73 @@ export default {
|
863
|
874
|
// 保存新建
|
864
|
875
|
saveAddInfo() {},
|
865
|
876
|
// 查看
|
866
|
|
- toView(row) {},
|
|
877
|
+ toView(row) {
|
|
878
|
+ this.initData();
|
|
879
|
+ },
|
867
|
880
|
// 编辑
|
868
|
|
- toEdit(row) {},
|
|
881
|
+ async toEdit(row, type) {
|
|
882
|
+ //type 1查看 2编辑
|
|
883
|
+ await this.getAppList();
|
|
884
|
+ this.initData();
|
|
885
|
+ this.showLoading = true;
|
|
886
|
+ stPad_detail({ padid: row.padid }).then((res) => {
|
|
887
|
+ this.showLoading = false;
|
|
888
|
+ if (res.code === 0) {
|
|
889
|
+ console.log(res.obj);
|
|
890
|
+ //数据回显
|
|
891
|
+ this.strategyInfo.model = type === 1 ? "查看" : "编辑";
|
|
892
|
+ this.strategyInfo.name = res.obj.name;
|
|
893
|
+ this.strategyInfo.username = row.username;
|
|
894
|
+ this.strategyInfo.padid = res.obj.padid;
|
|
895
|
+ this.strategyInfo.userid = row.userid;
|
|
896
|
+ this.strategyInfo.rversion = res.obj.rversion;
|
|
897
|
+ this.strategyInfo.hastime = res.obj.hastime ? true : false;
|
|
898
|
+ this.strategyInfo.hasapp = res.obj.hasapp ? true : false;
|
|
899
|
+ this.strategyInfo.hasdevice = res.obj.hasdevice ? true : false;
|
|
900
|
+ this.strategyInfo.haswifi = res.obj.haswifi ? true : false;
|
|
901
|
+ this.strategyInfo.hasviolate = res.obj.hasviolate ? true : false;
|
|
902
|
+ if (this.strategyInfo.hastime) {
|
|
903
|
+ this.strategyInfo.padTimes = res.obj.padTimes;
|
|
904
|
+ }
|
|
905
|
+ if (this.strategyInfo.hasapp) {
|
|
906
|
+ //回显应用策略
|
|
907
|
+ this.padApps.forEach((item) => {
|
|
908
|
+ let ishas = res.obj.padApps.some((v) => {
|
|
909
|
+ return v.appid === item.appid;
|
|
910
|
+ });
|
|
911
|
+ item.checked = ishas ? true : false;
|
|
912
|
+ });
|
|
913
|
+ }
|
|
914
|
+ if (this.strategyInfo.hasdevice) {
|
|
915
|
+ //回显设备策略
|
|
916
|
+ this.padDevices.forEach((item) => {
|
|
917
|
+ let obj = res.obj.padDevices.filter((v) => {
|
|
918
|
+ return v.pdtype === item.pdtype;
|
|
919
|
+ })[0] || { enabled: 2 };
|
|
920
|
+ item.enabled = obj.enabled;
|
|
921
|
+ });
|
|
922
|
+ }
|
|
923
|
+ if (this.strategyInfo.hastime) {
|
|
924
|
+ this.strategyInfo.padWifis = res.obj.padWifis;
|
|
925
|
+ }
|
|
926
|
+ if (this.strategyInfo.hasviolate) {
|
|
927
|
+ //回显违规处理
|
|
928
|
+ this.padViolates.forEach((item) => {
|
|
929
|
+ let arr = res.obj.padViolates.filter((v) => {
|
|
930
|
+ return v.violateType === item.violateType;
|
|
931
|
+ });
|
|
932
|
+ item.checked = arr.length > 0 ? true : false;
|
|
933
|
+ item.handleMethod =
|
|
934
|
+ arr.length > 0 ? arr[0].handleMethod.split(";") : [];
|
|
935
|
+ });
|
|
936
|
+ }
|
|
937
|
+ this.strategyInfo.show = true;
|
|
938
|
+ console.log(this.strategyInfo);
|
|
939
|
+ } else {
|
|
940
|
+ this.$Message.error(res.msg);
|
|
941
|
+ }
|
|
942
|
+ });
|
|
943
|
+ },
|
869
|
944
|
// 删除
|
870
|
945
|
toDel(row) {
|
871
|
946
|
this.$Modal.confirm({
|
|
@@ -902,7 +977,7 @@ export default {
|
902
|
977
|
name: row.name,
|
903
|
978
|
schoolInfo: res.obj,
|
904
|
979
|
checked: false,
|
905
|
|
- stappid: row.padid,
|
|
980
|
+ padid: row.padid,
|
906
|
981
|
schoolid: res.obj.id,
|
907
|
982
|
classids: []
|
908
|
983
|
};
|
|
@@ -957,7 +1032,30 @@ export default {
|
957
|
1032
|
}
|
958
|
1033
|
}
|
959
|
1034
|
}
|
960
|
|
-.content{
|
|
1035
|
+.content {
|
|
1036
|
+ .titles {
|
|
1037
|
+ height: 40px;
|
|
1038
|
+ margin-bottom: 10px;
|
|
1039
|
+ display: flex;
|
|
1040
|
+ align-items: center;
|
|
1041
|
+ .require {
|
|
1042
|
+ width: 80px;
|
|
1043
|
+ color: #253a70;
|
|
1044
|
+ font-size: 16px;
|
|
1045
|
+ font-weight: 400;
|
|
1046
|
+ font-family: "SourceHanSansCN";
|
|
1047
|
+ margin-right: 10px;
|
|
1048
|
+ &::before {
|
|
1049
|
+ content: "*" !important;
|
|
1050
|
+ display: inline-block;
|
|
1051
|
+ margin-right: 4px;
|
|
1052
|
+ line-height: 1;
|
|
1053
|
+ font-family: SimSun;
|
|
1054
|
+ font-size: 14px;
|
|
1055
|
+ color: #ed4014;
|
|
1056
|
+ }
|
|
1057
|
+ }
|
|
1058
|
+ }
|
961
|
1059
|
.strategy_list {
|
962
|
1060
|
font-family: "SourceHanSansCN";
|
963
|
1061
|
.strategy_title {
|
|
@@ -1057,7 +1155,7 @@ export default {
|
1057
|
1155
|
height: 26px;
|
1058
|
1156
|
margin: 0 20px 10px 0;
|
1059
|
1157
|
position: relative;
|
1060
|
|
- .title{
|
|
1158
|
+ .title {
|
1061
|
1159
|
line-height: 14px;
|
1062
|
1160
|
}
|
1063
|
1161
|
img {
|