Procházet zdrojové kódy

学校-应用策略模板

gzb
wangzhonglu před 9 měsíci
rodič
revize
6f869a366f

+ 0
- 6
src/api/class.js Zobrazit soubor

@@ -1,6 +0,0 @@
1
-import { setRequest } from "@/utils/httpRequest";
2
-
3
-/**
4
- * 3.2.2用户--学校下班级列表
5
- */
6
-export const class_list = (data) => setRequest("class/list", data);

+ 1
- 0
src/components/TimeStrategy/TimeStrategy.vue Zobrazit soubor

@@ -217,6 +217,7 @@ export default {
217 217
     tableMousedown(event) {
218 218
       let timeInfo = event.target.dataset.time;
219 219
       if (timeInfo) {
220
+        this.tempTimeInfo = JSON.parse(JSON.stringify(this.timeInfo));
220 221
         timeInfo = JSON.parse(timeInfo);
221 222
         this.tableMouseInfo = {
222 223
           // 是否开始选中

+ 1
- 1
src/router/school.js Zobrazit soubor

@@ -106,7 +106,7 @@ export default {
106 106
       path: "appStrategyTemplateEdit",
107 107
       component: () =>
108 108
         import(
109
-          "@/views/schoolSection/applicationStrategy/appStrategyTemplateAdd.vue"
109
+          "@/views/schoolSection/applicationStrategy/appStrategyTemplateEdit.vue"
110 110
         ),
111 111
       name: "appStrategyTemplateEdit",
112 112
       meta: {

+ 3
- 1
src/views/platformSection/networkManage/whitelistLibrary.vue Zobrazit soubor

@@ -112,7 +112,9 @@
112 112
       </Form>
113 113
       <div slot="footer">
114 114
         <Button @click="whiteLibraryInfo.show = false">取消</Button>
115
-        <Button @click="saveAddInfo()" type="primary">保存</Button>
115
+        <Button @click="saveAddInfo()" type="primary" class="primary_btn"
116
+          >保存</Button
117
+        >
116 118
       </div>
117 119
     </Modal>
118 120
     <!-- 查看 -->

+ 3
- 1
src/views/platformSection/notice/notice.vue Zobrazit soubor

@@ -101,7 +101,9 @@
101 101
       </Form>
102 102
       <div slot="footer">
103 103
         <Button @click="noticeInfo.show = false">取消</Button>
104
-        <Button @click="saveAddInfo()" type="primary">保存</Button>
104
+        <Button @click="saveAddInfo()" type="primary" class="primary_btn"
105
+          >保存</Button
106
+        >
105 107
       </div>
106 108
     </Modal>
107 109
     <!-- 查看 -->

+ 3
- 1
src/views/platformSection/regionManage/adminManage.vue Zobrazit soubor

@@ -202,7 +202,9 @@
202 202
         </div>
203 203
         <div>
204 204
           <Button @click="adminInfo.show = false">取消</Button>
205
-          <Button @click="saveAddInfo()" type="primary">保存</Button>
205
+          <Button @click="saveAddInfo()" type="primary" class="primary_btn"
206
+            >保存</Button
207
+          >
206 208
         </div>
207 209
       </div>
208 210
     </Modal>

+ 13
- 2
src/views/platformSection/regionManage/regionManage.vue Zobrazit soubor

@@ -146,7 +146,9 @@
146 146
         </div>
147 147
         <div>
148 148
           <Button @click="regionInfo.show = false">取消</Button>
149
-          <Button @click="saveAddInfo()" type="primary">保存</Button>
149
+          <Button @click="saveAddInfo()" type="primary" class="primary_btn"
150
+            >保存</Button
151
+          >
150 152
         </div>
151 153
       </div>
152 154
     </Modal>
@@ -193,7 +195,9 @@
193 195
       </Form>
194 196
       <div slot="footer">
195 197
         <Button @click="modifyRegion.show = false">取消</Button>
196
-        <Button @click="saveModifyInfo()" type="primary">保存</Button>
198
+        <Button @click="saveModifyInfo()" type="primary" class="primary_btn"
199
+          >保存</Button
200
+        >
197 201
       </div>
198 202
     </Modal>
199 203
     <!-- 查看 -->
@@ -335,6 +339,13 @@ export default {
335 339
             trigger: "blur"
336 340
           }
337 341
         ],
342
+        regionCode: [
343
+          {
344
+            required: true,
345
+            message: "请输入6位区域码",
346
+            trigger: "blur"
347
+          }
348
+        ],
338 349
         "admin.aname": [
339 350
           {
340 351
             required: true,

+ 139
- 7
src/views/schoolSection/applicationStrategy/appStrategyTemplate.vue Zobrazit soubor

@@ -53,11 +53,41 @@
53 53
         show-sizer
54 54
       ></Page>
55 55
     </div>
56
+    <Modal
57
+      class="modal1"
58
+      :mask-closable="false"
59
+      v-model="empowerInfo.show"
60
+      title="授权"
61
+    >
62
+      <div class="strategy_name">{{ empowerInfo.name }}</div>
63
+      <div class="school_name">{{ schoolInfo.schoolname }}</div>
64
+      <CheckboxGroup v-model="empowerInfo.classids">
65
+        <Checkbox
66
+          :label="classItem.id"
67
+          v-for="classItem in schoolInfo.classList"
68
+          :key="classItem.id"
69
+          >{{ classItem.name }}</Checkbox
70
+        >
71
+      </CheckboxGroup>
72
+      <div slot="footer">
73
+        <Button @click="empowerInfo.show = false">取消</Button>
74
+        <Button @click="saveEmpowerInfo()" type="primary" class="primary_btn"
75
+          >保存</Button
76
+        >
77
+      </div>
78
+    </Modal>
56 79
   </div>
57 80
 </template>
58 81
 
59 82
 <script>
60
-import { stApp_list, stApp_enable, stApp_disabled } from "@/api/stPad";
83
+import {
84
+  stApp_list,
85
+  stApp_enable,
86
+  stApp_disabled,
87
+  stApp_delete,
88
+  stApp_add_empower
89
+} from "@/api/stPad";
90
+import { class_list } from "@/api/school";
61 91
 export default {
62 92
   data() {
63 93
     return {
@@ -68,6 +98,17 @@ export default {
68 98
         list: [],
69 99
         total: 0
70 100
       },
101
+      empowerInfo: {
102
+        show: false,
103
+        name: "",
104
+        stappid: null,
105
+        classids: []
106
+      },
107
+      schoolInfo: {
108
+        schoolid: null,
109
+        schoolname: null,
110
+        classList: []
111
+      },
71 112
       columns: [
72 113
         {
73 114
           title: "序号",
@@ -89,7 +130,7 @@ export default {
89 130
         },
90 131
         {
91 132
           title: "状态",
92
-          key: "enabledSlot",
133
+          slot: "enabledSlot",
93 134
           align: "center"
94 135
         },
95 136
         {
@@ -176,15 +217,95 @@ export default {
176 217
       this.$router.push("/school/appStrategyTemplateAdd");
177 218
     },
178 219
     // 查看
179
-    toView() {},
220
+    toView(row) {
221
+      this.$router.push({
222
+        path: "/school/appStrategyTemplateView",
223
+        query: {
224
+          stappid: row.stappid
225
+        }
226
+      });
227
+    },
180 228
     // 编辑
181
-    toEdit() {
182
-      this.$router.push("/school/appStrategyTemplateEdit");
229
+    toEdit(row) {
230
+      this.$router.push({
231
+        path: "/school/appStrategyTemplateEdit",
232
+        query: {
233
+          stappid: row.stappid
234
+        }
235
+      });
183 236
     },
184 237
     // 删除
185
-    toDel() {},
238
+    toDel(row) {
239
+      this.$Modal.confirm({
240
+        title: "提示",
241
+        content: "您确定删除选中数据吗?",
242
+        onOk: () => {
243
+          stApp_delete({
244
+            rtype: this.powerParams.rtype,
245
+            objectid: this.powerParams.objectid,
246
+            stappid: row.stappid,
247
+            rversion: row.rversion
248
+          }).then((data) => {
249
+            if (data.code === 0) {
250
+              this.getList();
251
+              this.$Message.success(data.msg);
252
+            } else {
253
+              this.$Message.error(data.msg);
254
+            }
255
+          });
256
+        },
257
+        onCancel: () => {}
258
+      });
259
+    },
186 260
     // 授权
187
-    toEmpower() {}
261
+    toEmpower(row) {
262
+      this.empowerInfo = {
263
+        show: true,
264
+        name: row.name,
265
+        stappid: row.stappid,
266
+        classids: []
267
+      };
268
+      this.getClassList();
269
+    },
270
+    // 保存授权
271
+    saveEmpowerInfo() {
272
+      if (this.empowerInfo.classids.length === 0) {
273
+        this.$Message.error("请选择班级");
274
+        return;
275
+      }
276
+      stApp_add_empower({
277
+        rtype: this.powerParams.rtype,
278
+        objectid: this.powerParams.objectid,
279
+        schoolid: this.powerParams.objectid,
280
+        stappid: this.empowerInfo.stappid,
281
+        classids: this.empowerInfo.classids
282
+      }).then((data) => {
283
+        if (data.code === 0) {
284
+          this.empowerInfo.show = false;
285
+          this.$Message.success(data.msg);
286
+        } else {
287
+          this.$Message.error(data.msg);
288
+        }
289
+      });
290
+    },
291
+    // 获取班级列表
292
+    getClassList() {
293
+      class_list({
294
+        rtype: this.powerParams.rtype,
295
+        objectid: this.powerParams.objectid,
296
+        schoolid: this.powerParams.objectid
297
+      }).then((data) => {
298
+        if (data.code === 0) {
299
+          this.schoolInfo = {
300
+            schoolid: data.obj.id,
301
+            schoolname: data.obj.name,
302
+            classList: data.obj.children
303
+          };
304
+        } else {
305
+          this.$Message.error(data.msg);
306
+        }
307
+      });
308
+    }
188 309
   }
189 310
 };
190 311
 </script>
@@ -215,4 +336,15 @@ export default {
215 336
     }
216 337
   }
217 338
 }
339
+.strategy_name {
340
+  margin-bottom: 16px;
341
+  font-size: 18px;
342
+  text-align: center;
343
+  font-weight: bold;
344
+}
345
+.school_name {
346
+  margin-bottom: 16px;
347
+  font-size: 16px;
348
+  font-weight: bold;
349
+}
218 350
 </style>

+ 53
- 1
src/views/schoolSection/applicationStrategy/appStrategyTemplateAdd.vue Zobrazit soubor

@@ -61,7 +61,9 @@
61 61
         </div>
62 62
       </div>
63 63
     </div>
64
-    <div class="strategy_list_title">应用策略列表</div>
64
+    <div class="strategy_list_title" v-if="appStrategyInfo.groups.length > 0">
65
+      应用策略列表
66
+    </div>
65 67
     <div
66 68
       class="strategy_item"
67 69
       v-for="(groupItem, groupIndex) in appStrategyInfo.groups"
@@ -120,6 +122,12 @@
120 122
         </tr>
121 123
       </table>
122 124
     </div>
125
+    <div class="bottom_btns">
126
+      <Button @click="toGoBack()">返回</Button>
127
+      <Button type="primary" class="primary_btn" @click="toSaveAppStrategy()"
128
+        >确定</Button
129
+      >
130
+    </div>
123 131
   </div>
124 132
 </template>
125 133
 
@@ -127,6 +135,7 @@
127 135
 import { weekDay } from "@/utils";
128 136
 import TimeStrategy from "@/components/TimeStrategy/TimeStrategy";
129 137
 import { app_list_sel } from "@/api/appgroup";
138
+import { stApp_add } from "@/api/stPad";
130 139
 export default {
131 140
   components: {
132 141
     TimeStrategy
@@ -188,6 +197,39 @@ export default {
188 197
     }
189 198
   },
190 199
   methods: {
200
+    toGoBack() {
201
+      this.$router.go(-1);
202
+    },
203
+    toSaveAppStrategy() {
204
+      if (!this.appStrategyInfo.name) {
205
+        this.$Message.error("请输入名称");
206
+        return;
207
+      }
208
+      if (this.appStrategyInfo.groups.length === 0) {
209
+        this.$Message.error("请添加应用策略");
210
+        return;
211
+      }
212
+      let _groups = this.appStrategyInfo.groups.map((groupItem) => {
213
+        groupItem = JSON.parse(JSON.stringify(groupItem));
214
+        groupItem.apps = groupItem.apps.map((appid) => {
215
+          return { appid };
216
+        });
217
+        return groupItem;
218
+      });
219
+      stApp_add({
220
+        rtype: this.powerParams.rtype,
221
+        objectid: this.powerParams.objectid,
222
+        name: this.appStrategyInfo.name,
223
+        groups: _groups,
224
+        sttype: 0
225
+      }).then((data) => {
226
+        if (data.code === 0) {
227
+          this.toGoBack();
228
+        } else {
229
+          this.$Message.error(data.msg);
230
+        }
231
+      });
232
+    },
191 233
     toEditeGroupItem(groupItem, groupIndex) {
192 234
       this.tempStrategyInfo = JSON.parse(JSON.stringify(groupItem));
193 235
       this.appStrategyInfo.groups.splice(groupIndex, 1);
@@ -478,4 +520,14 @@ export default {
478 520
     }
479 521
   }
480 522
 }
523
+.bottom_btns {
524
+  display: flex;
525
+  justify-content: flex-end;
526
+  align-items: center;
527
+  margin-top: 16px;
528
+  margin-right: 16px;
529
+  .primary_btn {
530
+    margin-left: 16px;
531
+  }
532
+}
481 533
 </style>

+ 555
- 0
src/views/schoolSection/applicationStrategy/appStrategyTemplateEdit.vue Zobrazit soubor

@@ -0,0 +1,555 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="add_strategy_info">
4
+      <div class="add_strategy_left">
5
+        <div class="name_form">
6
+          <div class="name_form_item">名称</div>
7
+          <Input
8
+            placeholder="请输入名称"
9
+            v-model="appStrategyInfo.name"
10
+          ></Input>
11
+        </div>
12
+        <div class="time_strategy">
13
+          时间策略
14
+          <div class="time_tip">
15
+            (应用列表中选中的应用只能在限制的时间内使用)
16
+          </div>
17
+        </div>
18
+        <TimeStrategy
19
+          :times="tempStrategyInfo.times"
20
+          @timesChange="timesChange"
21
+        ></TimeStrategy>
22
+        <div class="action_btns">
23
+          <Button @click="toResetStrategy()">取消</Button>
24
+          <Button type="primary" class="primary_btn" @click="toAddStrategySet()"
25
+            >添加当前设置</Button
26
+          >
27
+        </div>
28
+      </div>
29
+      <div class="add_strategy_right">
30
+        <div class="optional_applications">
31
+          <div>可选应用</div>
32
+          <div>
33
+            <Checkbox
34
+              :disabled="appList.length === 0"
35
+              :value="appAllCheck"
36
+              @on-change="appAllCheckChange"
37
+              >全选</Checkbox
38
+            >
39
+          </div>
40
+        </div>
41
+        <div class="app_list">
42
+          <div
43
+            class="app_item"
44
+            :title="appItem.appName"
45
+            v-for="appItem in appList"
46
+            :key="appItem.appid"
47
+            @click="toSelectApp(appItem.appid)"
48
+          >
49
+            <div class="app_item_top">
50
+              <img :src="$api.showImageUrl + appItem.appIcon" />
51
+            </div>
52
+            <div class="app_item_name">
53
+              {{ appItem.appName }}
54
+            </div>
55
+            <div class="app_item_check">
56
+              <Checkbox
57
+                :value="tempStrategyInfo.apps.includes(appItem.appid)"
58
+              ></Checkbox>
59
+            </div>
60
+          </div>
61
+        </div>
62
+      </div>
63
+    </div>
64
+    <div class="strategy_list_title" v-if="appStrategyInfo.groups.length > 0">
65
+      应用策略列表
66
+    </div>
67
+    <div
68
+      class="strategy_item"
69
+      v-for="(groupItem, groupIndex) in appStrategyInfo.groups"
70
+      :key="groupIndex"
71
+    >
72
+      <table class="my_table">
73
+        <tr>
74
+          <th colspan="7">
75
+            <div class="table_header">
76
+              <div class="table_header_title">应用策略{{ groupIndex + 1 }}</div>
77
+              <div class="table_header_action">
78
+                <div @click="toEditeGroupItem(groupItem, groupIndex)">编辑</div>
79
+                <div class="del" @click="toDelGroupItem(groupIndex)">删除</div>
80
+              </div>
81
+            </div>
82
+          </th>
83
+        </tr>
84
+        <tr>
85
+          <td v-for="weekItem in weekDay" :key="weekItem.value">
86
+            {{ weekItem.label }}
87
+          </td>
88
+        </tr>
89
+        <tr>
90
+          <td v-for="weekItem in weekDay" :key="weekItem.value">
91
+            <div class="time_list">
92
+              <span
93
+                v-for="(timeItem, timeIndex) in appStrategyGroupInfo[
94
+                  groupIndex
95
+                ] && appStrategyGroupInfo[groupIndex][weekItem.value]"
96
+                :key="timeIndex"
97
+                >{{ timeItem.starttime }} - {{ timeItem.stoptime }}</span
98
+              >
99
+            </div>
100
+          </td>
101
+        </tr>
102
+        <tr>
103
+          <td colspan="7">
104
+            <div class="table_app_list">
105
+              <div
106
+                class="table_app_item"
107
+                v-for="appid in groupItem.apps"
108
+                :key="appid"
109
+              >
110
+                <div class="app_top">
111
+                  <img
112
+                    v-if="appsInfo[appid]"
113
+                    :src="$api.showImageUrl + appsInfo[appid].appIcon"
114
+                  />
115
+                </div>
116
+                <div class="app_name">
117
+                  {{ appsInfo[appid] && appsInfo[appid].appName }}
118
+                </div>
119
+              </div>
120
+            </div>
121
+          </td>
122
+        </tr>
123
+      </table>
124
+    </div>
125
+    <div class="bottom_btns">
126
+      <Button @click="toGoBack()">返回</Button>
127
+      <Button type="primary" class="primary_btn" @click="toSaveAppStrategy()"
128
+        >确定</Button
129
+      >
130
+    </div>
131
+  </div>
132
+</template>
133
+
134
+<script>
135
+import { weekDay } from "@/utils";
136
+import TimeStrategy from "@/components/TimeStrategy/TimeStrategy";
137
+import { app_list_sel } from "@/api/appgroup";
138
+import { stApp_edit, stApp_detail } from "@/api/stPad";
139
+export default {
140
+  components: {
141
+    TimeStrategy
142
+  },
143
+  data() {
144
+    return {
145
+      weekDay,
146
+      appList: [],
147
+      // 应用策略信息
148
+      appStrategyInfo: {
149
+        stappid: null,
150
+        rversion: null,
151
+        name: "",
152
+        // {apps[appid], times[{week, starttime, stoptime}]}
153
+        groups: []
154
+      },
155
+      // 临时保存策略
156
+      tempStrategyInfo: {
157
+        apps: [],
158
+        times: []
159
+      }
160
+    };
161
+  },
162
+  created() {
163
+    this.getAppList();
164
+    this.getAppStrategyDetail();
165
+  },
166
+  computed: {
167
+    powerParams() {
168
+      return this.$store.getters.powerParams;
169
+    },
170
+    appAllCheck() {
171
+      let allAppids = this.appList.map((appItem) => appItem.appid);
172
+      let isCheck = true;
173
+      for (const appid of allAppids) {
174
+        if (!this.tempStrategyInfo.apps.includes(appid)) {
175
+          isCheck = false;
176
+        }
177
+      }
178
+      return allAppids.length > 0 ? isCheck : false;
179
+    },
180
+    appsInfo() {
181
+      let info = {};
182
+      this.appList.forEach((item) => {
183
+        info[item.appid] = item;
184
+      });
185
+      return info;
186
+    },
187
+    appStrategyGroupInfo() {
188
+      let info = [];
189
+      this.appStrategyInfo.groups.forEach((groupItem) => {
190
+        let groupTimes = {};
191
+        groupItem.times.forEach((timeItem) => {
192
+          if (!groupTimes[timeItem.week]) {
193
+            groupTimes[timeItem.week] = [];
194
+          }
195
+          groupTimes[timeItem.week].push(timeItem);
196
+        });
197
+        info.push(groupTimes);
198
+      });
199
+      return info;
200
+    }
201
+  },
202
+  methods: {
203
+    getAppStrategyDetail() {
204
+      stApp_detail({
205
+        rtype: this.powerParams.rtype,
206
+        objectid: this.powerParams.objectid,
207
+        stappid: this.$route.query.stappid
208
+      }).then((data) => {
209
+        if (data.code === 0) {
210
+          this.appStrategyInfo.name = data.obj.name;
211
+          this.appStrategyInfo.groups = data.obj.groups.map((groupItem) => {
212
+            groupItem.apps = groupItem.apps.map((appItem) => appItem.appid);
213
+            return groupItem;
214
+          });
215
+          this.appStrategyInfo.stappid = data.obj.stappid;
216
+          this.appStrategyInfo.rversion = data.obj.rversion;
217
+        } else {
218
+          this.$Message.error(data.msg);
219
+        }
220
+      });
221
+    },
222
+    toGoBack() {
223
+      this.$router.go(-1);
224
+    },
225
+    toSaveAppStrategy() {
226
+      if (!this.appStrategyInfo.name) {
227
+        this.$Message.error("请输入名称");
228
+        return;
229
+      }
230
+      if (this.appStrategyInfo.groups.length === 0) {
231
+        this.$Message.error("请添加应用策略");
232
+        return;
233
+      }
234
+      let _groups = this.appStrategyInfo.groups.map((groupItem) => {
235
+        groupItem = JSON.parse(JSON.stringify(groupItem));
236
+        groupItem.apps = groupItem.apps.map((appid) => {
237
+          return { appid };
238
+        });
239
+        return groupItem;
240
+      });
241
+      stApp_edit({
242
+        // rtype: this.powerParams.rtype,
243
+        // objectid: this.powerParams.objectid,
244
+        name: this.appStrategyInfo.name,
245
+        groups: _groups,
246
+        stappid: this.appStrategyInfo.stappid,
247
+        rversion: this.appStrategyInfo.rversion
248
+      }).then((data) => {
249
+        if (data.code === 0) {
250
+          this.toGoBack();
251
+        } else {
252
+          this.$Message.error(data.msg);
253
+        }
254
+      });
255
+    },
256
+    toEditeGroupItem(groupItem, groupIndex) {
257
+      this.tempStrategyInfo = JSON.parse(JSON.stringify(groupItem));
258
+      this.appStrategyInfo.groups.splice(groupIndex, 1);
259
+    },
260
+    toDelGroupItem(groupIndex) {
261
+      this.$Modal.confirm({
262
+        title: "提示",
263
+        content: "您确定删除选中数据吗?",
264
+        onOk: () => {
265
+          this.appStrategyInfo.groups.splice(groupIndex, 1);
266
+        },
267
+        onCancel: () => {}
268
+      });
269
+    },
270
+    appAllCheckChange(selected) {
271
+      if (selected) {
272
+        this.tempStrategyInfo.apps = this.appList.map(
273
+          (appItem) => appItem.appid
274
+        );
275
+      } else {
276
+        this.tempStrategyInfo.apps = [];
277
+      }
278
+    },
279
+    toSelectApp(appid) {
280
+      if (this.tempStrategyInfo.apps.includes(appid)) {
281
+        this.tempStrategyInfo.apps = this.tempStrategyInfo.apps.filter(
282
+          (id) => id !== appid
283
+        );
284
+      } else {
285
+        this.tempStrategyInfo.apps.push(appid);
286
+      }
287
+    },
288
+    getAppList() {
289
+      app_list_sel({
290
+        rtype: this.powerParams.rtype,
291
+        objectid: this.powerParams.objectid
292
+      }).then((data) => {
293
+        if (data.code === 0) {
294
+          this.appList = data.obj;
295
+        } else {
296
+          this.appList = [];
297
+          this.$Message.error(data.msg);
298
+        }
299
+      });
300
+    },
301
+    timesChange(times) {
302
+      this.tempStrategyInfo.times = times;
303
+    },
304
+    toResetStrategy() {
305
+      this.tempStrategyInfo = {
306
+        apps: [],
307
+        times: []
308
+      };
309
+    },
310
+    toAddStrategySet() {
311
+      let _tempStrategyInfo = JSON.parse(JSON.stringify(this.tempStrategyInfo));
312
+      if (_tempStrategyInfo.times.length === 0) {
313
+        this.$Message.error("请选择时间范围");
314
+        return;
315
+      }
316
+      if (_tempStrategyInfo.apps.length === 0) {
317
+        this.$Message.error("请选择应用");
318
+        return;
319
+      }
320
+      this.appStrategyInfo.groups.push(_tempStrategyInfo);
321
+      this.toResetStrategy();
322
+    }
323
+  }
324
+};
325
+</script>
326
+
327
+<style lang="less" scoped>
328
+.add_strategy_info {
329
+  display: flex;
330
+  justify-content: space-between;
331
+  margin: 16px 16px 0;
332
+  .add_strategy_left {
333
+    width: calc(50% - 20px);
334
+    .name_form {
335
+      display: flex;
336
+      justify-content: flex-start;
337
+      align-items: center;
338
+      margin-bottom: 16px;
339
+      font-size: 16px;
340
+      font-weight: bold;
341
+      .name_form_item {
342
+        margin-right: 16px;
343
+        white-space: nowrap;
344
+      }
345
+    }
346
+    .time_strategy {
347
+      display: flex;
348
+      justify-content: flex-start;
349
+      align-items: center;
350
+      margin-bottom: 16px;
351
+      font-size: 16px;
352
+      font-weight: bold;
353
+      .time_tip {
354
+        margin-left: 10px;
355
+        font-size: 12px;
356
+        font-weight: normal;
357
+        color: #f0153f;
358
+      }
359
+    }
360
+    .action_btns {
361
+      display: flex;
362
+      justify-content: flex-start;
363
+      align-items: center;
364
+      margin-top: 40px;
365
+      .primary_btn {
366
+        margin-left: 16px;
367
+      }
368
+    }
369
+  }
370
+  .add_strategy_right {
371
+    width: 50%;
372
+    // max-height: 400px;
373
+    overflow: auto;
374
+    .optional_applications {
375
+      display: flex;
376
+      justify-content: space-between;
377
+      align-items: center;
378
+      font-size: 16px;
379
+      line-height: 30px;
380
+      font-weight: bold;
381
+    }
382
+    .app_list {
383
+      display: flex;
384
+      justify-content: flex-start;
385
+      flex-wrap: wrap;
386
+      width: 100%;
387
+      // max-height: calc(100% - 33px);
388
+      overflow: auto;
389
+      .app_item {
390
+        position: relative;
391
+        margin: 8px;
392
+        width: 100px;
393
+        height: 100px;
394
+        border-radius: 10px;
395
+        border: 1px solid #798cb51a;
396
+        background: #ffffff;
397
+        cursor: pointer;
398
+        &:hover {
399
+          box-shadow: 4px 4px 8px 0 #339dff26;
400
+        }
401
+        .app_item_top {
402
+          display: flex;
403
+          justify-content: center;
404
+          align-items: center;
405
+          margin-top: 10px;
406
+          padding-top: 10px;
407
+          height: calc(100% - 44px);
408
+          img {
409
+            width: 38px;
410
+            height: 38px;
411
+          }
412
+        }
413
+        .app_item_name {
414
+          margin: 10px 0;
415
+          line-height: 1;
416
+          font-size: 14px;
417
+          text-align: center;
418
+          overflow: hidden;
419
+          text-overflow: ellipsis;
420
+          white-space: nowrap;
421
+        }
422
+        .app_item_check {
423
+          position: absolute;
424
+          right: 8px;
425
+          top: 8px;
426
+          /deep/.ivu-checkbox-wrapper {
427
+            margin-right: 0;
428
+            .ivu-checkbox-inner {
429
+              border-radius: 50%;
430
+            }
431
+          }
432
+        }
433
+      }
434
+    }
435
+  }
436
+}
437
+.strategy_list_title {
438
+  margin: 16px;
439
+  font-size: 16px;
440
+  font-weight: bold;
441
+}
442
+.strategy_item {
443
+  margin: 16px;
444
+  .my_table {
445
+    width: 100%;
446
+    empty-cells: show;
447
+    border-collapse: collapse;
448
+    table-layout: fixed;
449
+    border: 1px solid #dcdee2;
450
+    border-spacing: 0;
451
+    box-sizing: border-box;
452
+    font-size: 12px;
453
+    th {
454
+      padding: 0;
455
+      line-height: 30px;
456
+      font-weight: normal;
457
+      text-align: center;
458
+      vertical-align: middle;
459
+      white-space: nowrap;
460
+      background-color: #fff;
461
+      border: 1px solid #ced9f2;
462
+    }
463
+    td {
464
+      position: relative;
465
+      padding: 0;
466
+      line-height: 30px;
467
+      text-align: center;
468
+      vertical-align: middle;
469
+      white-space: nowrap;
470
+      border: 1px solid #ced9f2;
471
+    }
472
+  }
473
+  .table_header {
474
+    display: flex;
475
+    justify-content: space-between;
476
+    align-items: center;
477
+    padding: 0 10px;
478
+    background-color: #edf3ff;
479
+    .table_header_title {
480
+      font-size: 12px;
481
+      font-weight: bold;
482
+    }
483
+    .table_header_action {
484
+      display: flex;
485
+      justify-content: flex-start;
486
+      align-items: center;
487
+      > div {
488
+        margin-left: 4px;
489
+        padding: 0 4px;
490
+        cursor: pointer;
491
+        &:hover {
492
+          color: #339dff;
493
+          &.del {
494
+            color: #f0153f;
495
+          }
496
+        }
497
+      }
498
+    }
499
+  }
500
+  .time_list {
501
+    display: flex;
502
+    justify-content: center;
503
+    align-items: center;
504
+    flex-wrap: wrap;
505
+    > span {
506
+      margin: 4px 6px;
507
+      line-height: 1;
508
+      white-space: nowrap;
509
+    }
510
+  }
511
+  .table_app_list {
512
+    display: flex;
513
+    justify-content: flex-start;
514
+    align-items: center;
515
+    flex-wrap: wrap;
516
+    .table_app_item {
517
+      margin: 10px;
518
+      .app_top {
519
+        display: flex;
520
+        justify-content: center;
521
+        align-items: center;
522
+        margin: 0 auto;
523
+        width: 56px;
524
+        height: 56px;
525
+        border-radius: 6px;
526
+        border: 1px solid #e5e5e5;
527
+        background: #ffffff;
528
+        img {
529
+          width: 38px;
530
+          height: 38px;
531
+        }
532
+      }
533
+      .app_name {
534
+        margin-top: 10px;
535
+        max-width: 100px;
536
+        line-height: 1;
537
+        font-size: 12px;
538
+        text-align: center;
539
+        overflow: hidden;
540
+        text-overflow: ellipsis;
541
+        white-space: nowrap;
542
+      }
543
+    }
544
+  }
545
+}
546
+.bottom_btns {
547
+  display: flex;
548
+  justify-content: flex-end;
549
+  align-items: center;
550
+  margin: 16px;
551
+  .primary_btn {
552
+    margin-left: 16px;
553
+  }
554
+}
555
+</style>

+ 236
- 5
src/views/schoolSection/applicationStrategy/appStrategyTemplateView.vue Zobrazit soubor

@@ -1,20 +1,251 @@
1 1
 <template>
2
-  <div class="main_root">应用策略模板查看</div>
2
+  <div class="main_root">
3
+    <div class="strategy_title">{{ appStrategyInfo.name }}</div>
4
+    <div class="strategy_list_title">应用策略列表</div>
5
+    <div
6
+      class="strategy_item"
7
+      v-for="(groupItem, groupIndex) in appStrategyInfo.groups"
8
+      :key="groupIndex"
9
+    >
10
+      <table class="my_table">
11
+        <tr>
12
+          <th colspan="7">
13
+            <div class="table_header">
14
+              <div class="table_header_title">应用策略{{ groupIndex + 1 }}</div>
15
+              <div class="table_header_action"></div>
16
+            </div>
17
+          </th>
18
+        </tr>
19
+        <tr>
20
+          <td v-for="weekItem in weekDay" :key="weekItem.value">
21
+            {{ weekItem.label }}
22
+          </td>
23
+        </tr>
24
+        <tr>
25
+          <td v-for="weekItem in weekDay" :key="weekItem.value">
26
+            <div class="time_list">
27
+              <span
28
+                v-for="(timeItem, timeIndex) in appStrategyGroupInfo[
29
+                  groupIndex
30
+                ] && appStrategyGroupInfo[groupIndex][weekItem.value]"
31
+                :key="timeIndex"
32
+                >{{ timeItem.starttime }} - {{ timeItem.stoptime }}</span
33
+              >
34
+            </div>
35
+          </td>
36
+        </tr>
37
+        <tr>
38
+          <td colspan="7">
39
+            <div class="table_app_list">
40
+              <div
41
+                class="table_app_item"
42
+                v-for="appItem in groupItem.apps"
43
+                :key="appItem.appid"
44
+              >
45
+                <div class="app_top">
46
+                  <img :src="$api.showImageUrl + appItem.appIcon" />
47
+                </div>
48
+                <div class="app_name">
49
+                  {{ appItem.appName }}
50
+                </div>
51
+              </div>
52
+            </div>
53
+          </td>
54
+        </tr>
55
+      </table>
56
+    </div>
57
+    <div class="bottom_btns">
58
+      <Button @click="toGoBack()">返回</Button>
59
+    </div>
60
+  </div>
3 61
 </template>
4 62
 
5 63
 <script>
64
+import { weekDay } from "@/utils";
65
+import { stApp_detail } from "@/api/stPad";
6 66
 export default {
7 67
   data() {
8
-    return {};
68
+    return {
69
+      weekDay,
70
+      // 应用策略信息
71
+      appStrategyInfo: {
72
+        stappid: null,
73
+        rversion: null,
74
+        name: "",
75
+        groups: []
76
+      }
77
+    };
78
+  },
79
+  created() {
80
+    this.getAppStrategyDetail();
9 81
   },
10
-  created() {},
11 82
   computed: {
12 83
     powerParams() {
13 84
       return this.$store.getters.powerParams;
85
+    },
86
+    appStrategyGroupInfo() {
87
+      let info = [];
88
+      this.appStrategyInfo.groups.forEach((groupItem) => {
89
+        let groupTimes = {};
90
+        groupItem.times.forEach((timeItem) => {
91
+          if (!groupTimes[timeItem.week]) {
92
+            groupTimes[timeItem.week] = [];
93
+          }
94
+          groupTimes[timeItem.week].push(timeItem);
95
+        });
96
+        info.push(groupTimes);
97
+      });
98
+      return info;
14 99
     }
15 100
   },
16
-  methods: {}
101
+  methods: {
102
+    getAppStrategyDetail() {
103
+      stApp_detail({
104
+        rtype: this.powerParams.rtype,
105
+        objectid: this.powerParams.objectid,
106
+        stappid: this.$route.query.stappid
107
+      }).then((data) => {
108
+        if (data.code === 0) {
109
+          this.appStrategyInfo.name = data.obj.name;
110
+          this.appStrategyInfo.groups = data.obj.groups;
111
+          this.appStrategyInfo.stappid = data.obj.stappid;
112
+          this.appStrategyInfo.rversion = data.obj.rversion;
113
+        } else {
114
+          this.$Message.error(data.msg);
115
+        }
116
+      });
117
+    },
118
+    toGoBack() {
119
+      this.$router.go(-1);
120
+    }
121
+  }
17 122
 };
18 123
 </script>
19 124
 
20
-<style lang="less" scoped></style>
125
+<style lang="less" scoped>
126
+.strategy_title {
127
+  margin: 16px;
128
+  font-size: 18px;
129
+  font-weight: bold;
130
+  text-align: center;
131
+  overflow: hidden;
132
+  text-overflow: ellipsis;
133
+  white-space: nowrap;
134
+}
135
+.strategy_list_title {
136
+  margin: 16px;
137
+  font-size: 16px;
138
+  font-weight: bold;
139
+}
140
+.strategy_item {
141
+  margin: 16px;
142
+  .my_table {
143
+    width: 100%;
144
+    empty-cells: show;
145
+    border-collapse: collapse;
146
+    table-layout: fixed;
147
+    border: 1px solid #dcdee2;
148
+    border-spacing: 0;
149
+    box-sizing: border-box;
150
+    font-size: 12px;
151
+    th {
152
+      padding: 0;
153
+      line-height: 30px;
154
+      font-weight: normal;
155
+      text-align: center;
156
+      vertical-align: middle;
157
+      white-space: nowrap;
158
+      background-color: #fff;
159
+      border: 1px solid #ced9f2;
160
+    }
161
+    td {
162
+      position: relative;
163
+      padding: 0;
164
+      line-height: 30px;
165
+      text-align: center;
166
+      vertical-align: middle;
167
+      white-space: nowrap;
168
+      border: 1px solid #ced9f2;
169
+    }
170
+  }
171
+  .table_header {
172
+    display: flex;
173
+    justify-content: space-between;
174
+    align-items: center;
175
+    padding: 0 10px;
176
+    background-color: #edf3ff;
177
+    .table_header_title {
178
+      font-size: 12px;
179
+      font-weight: bold;
180
+    }
181
+    .table_header_action {
182
+      display: flex;
183
+      justify-content: flex-start;
184
+      align-items: center;
185
+      > div {
186
+        margin-left: 4px;
187
+        padding: 0 4px;
188
+        cursor: pointer;
189
+        &:hover {
190
+          color: #339dff;
191
+          &.del {
192
+            color: #f0153f;
193
+          }
194
+        }
195
+      }
196
+    }
197
+  }
198
+  .time_list {
199
+    display: flex;
200
+    justify-content: center;
201
+    align-items: center;
202
+    flex-wrap: wrap;
203
+    > span {
204
+      margin: 4px 6px;
205
+      line-height: 1;
206
+      white-space: nowrap;
207
+    }
208
+  }
209
+  .table_app_list {
210
+    display: flex;
211
+    justify-content: flex-start;
212
+    align-items: center;
213
+    flex-wrap: wrap;
214
+    .table_app_item {
215
+      margin: 10px;
216
+      .app_top {
217
+        display: flex;
218
+        justify-content: center;
219
+        align-items: center;
220
+        margin: 0 auto;
221
+        width: 56px;
222
+        height: 56px;
223
+        border-radius: 6px;
224
+        border: 1px solid #e5e5e5;
225
+        background: #ffffff;
226
+        img {
227
+          width: 38px;
228
+          height: 38px;
229
+        }
230
+      }
231
+      .app_name {
232
+        margin-top: 10px;
233
+        max-width: 100px;
234
+        line-height: 1;
235
+        font-size: 12px;
236
+        text-align: center;
237
+        overflow: hidden;
238
+        text-overflow: ellipsis;
239
+        white-space: nowrap;
240
+      }
241
+    }
242
+  }
243
+}
244
+.bottom_btns {
245
+  display: flex;
246
+  justify-content: center;
247
+  align-items: center;
248
+  margin-top: 16px;
249
+  margin-right: 16px;
250
+}
251
+</style>

+ 1
- 1
src/views/schoolSection/deviceManage/deviceManage.vue Zobrazit soubor

@@ -113,7 +113,7 @@
113 113
 
114 114
 <script>
115 115
 import { exportToExcel } from "@/utils/exportToExcel";
116
-import { class_list } from "@/api/class";
116
+import { class_list } from "@/api/school";
117 117
 import {
118 118
   device_manager_list_d,
119 119
   device_manager_export_d,

+ 3
- 1
src/views/schoolSection/userManage/userManage.vue Zobrazit soubor

@@ -292,7 +292,9 @@
292 292
         </div>
293 293
         <div>
294 294
           <Button @click="addInfo.show = false">取消</Button>
295
-          <Button @click="saveAddInfo()" type="primary">保存</Button>
295
+          <Button @click="saveAddInfo()" type="primary" class="primary_btn"
296
+            >保存</Button
297
+          >
296 298
         </div>
297 299
       </div>
298 300
     </Modal>

Načítá se…
Zrušit
Uložit