Browse Source

学校-应用策略

gzb
wangzhonglu 9 months ago
parent
commit
6e88ad292a

+ 0
- 11
src/router/school.js View File

@@ -133,17 +133,6 @@ export default {
133 133
         title: "学校管控-解除管控设备"
134 134
       }
135 135
     },
136
-    {
137
-      path: "parentControlDevice",
138
-      component: () =>
139
-        import("@/views/schoolSection/deviceManage/parentControlDevice.vue"),
140
-      name: "parentControlDevice",
141
-      meta: {
142
-        keepAlive: true,
143
-        isAuth: true,
144
-        title: "学校管控-家长管控设备"
145
-      }
146
-    },
147 136
     {
148 137
       path: "inLineDevice",
149 138
       component: () =>

+ 6
- 1
src/views/platformSection/regionManage/adminManage.vue View File

@@ -159,7 +159,12 @@
159 159
             <Radio :label="2">禁用</Radio>
160 160
           </RadioGroup>
161 161
         </FormItem>
162
-        <FormItem label="所属区域" prop="regionid" style="width: 100%">
162
+        <FormItem
163
+          label="所属区域"
164
+          prop="regionid"
165
+          style="width: 100%"
166
+          v-if="adminInfo.adminid && adminInfo.atype !== 1"
167
+        >
163 168
           <Select
164 169
             :transfer="true"
165 170
             v-model="adminInfo.regionid"

+ 303
- 4
src/views/schoolSection/applicationStrategy/applicationStrategy.vue View File

@@ -1,14 +1,313 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="main_left">
4
+      <div class="main_left_title">用户组</div>
5
+      <div class="class_list">
6
+        <div
7
+          :class="['class_item', !searchForm.classid ? 'selceted' : '']"
8
+          @click="classChange(null)"
9
+        >
10
+          {{ schoolInfo.schoolname }}
11
+        </div>
12
+        <div
13
+          :class="[
14
+            'class_item',
15
+            searchForm.classid === classItem.id ? 'selceted' : ''
16
+          ]"
17
+          v-for="classItem in schoolInfo.classList"
18
+          :key="classItem.id"
19
+          @click="classChange(classItem.id)"
20
+        >
21
+          {{ classItem.name }}
22
+        </div>
23
+      </div>
24
+    </div>
25
+    <div class="main_right">
26
+      <div class="search_header">
27
+        <div class="search_left">
28
+          <Input
29
+            v-model="searchForm.name"
30
+            placeholder="请输入名称"
31
+            search
32
+            @on-search="searchList()"
33
+            style="width: 150px"
34
+          />
35
+        </div>
36
+        <div class="search_right">
37
+          <Button type="primary" class="primary_btn" @click="toAdd()"
38
+            >新建</Button
39
+          >
40
+        </div>
41
+      </div>
42
+      <div class="table_wrap">
43
+        <Table :columns="columns" :data="searchForm.list">
44
+          <template slot-scope="{ row }" slot="enabledSlot">
45
+            <i-switch
46
+              size="large"
47
+              v-model="row.enabled"
48
+              :true-value="1"
49
+              :false-value="2"
50
+              @on-change="enabledChange(row)"
51
+            >
52
+              <span slot="open">启用</span>
53
+              <span slot="close">禁用</span>
54
+            </i-switch>
55
+          </template>
56
+          <template slot-scope="{ row }" slot="actionSlot">
57
+            <div class="action_list">
58
+              <div @click="toView(row)">查看</div>
59
+              <div @click="toEdit(row)">编辑</div>
60
+              <div class="action_del" @click="toDel(row)">删除</div>
61
+              <div @click="toEmpower(row)">授权</div>
62
+            </div>
63
+          </template>
64
+        </Table>
65
+      </div>
66
+      <div class="page_wrap">
67
+        <Page
68
+          :transfer="true"
69
+          :total="searchForm.total"
70
+          :current="searchForm.page"
71
+          :page-size="searchForm.size"
72
+          :page-size-opts="[10, 20, 40, 60]"
73
+          @on-change="pageChange"
74
+          @on-page-size-change="pageSizeChange"
75
+          show-total
76
+          show-sizer
77
+        ></Page>
78
+      </div>
79
+    </div>
80
+  </div>
3 81
 </template>
4 82
 
5 83
 <script>
84
+import { class_list } from "@/api/class";
85
+import { stApp_list, stApp_enable, stApp_disabled } from "@/api/stPad";
6 86
 export default {
7 87
   data() {
8
-    return {};
88
+    return {
89
+      searchForm: {
90
+        classid: null,
91
+        name: "",
92
+        page: 1,
93
+        size: 10,
94
+        list: [],
95
+        total: 0
96
+      },
97
+      schoolInfo: {
98
+        schoolid: null,
99
+        schoolname: null,
100
+        classList: []
101
+      },
102
+      columns: [
103
+        {
104
+          title: "序号",
105
+          align: "center",
106
+          width: 70,
107
+          render: (h, params) => {
108
+            return h(
109
+              "span",
110
+              params.index +
111
+                (this.searchForm.page - 1) * this.searchForm.size +
112
+                1
113
+            );
114
+          }
115
+        },
116
+        {
117
+          title: "名称",
118
+          key: "name",
119
+          align: "center"
120
+        },
121
+        {
122
+          title: "状态",
123
+          key: "enabledSlot",
124
+          align: "center"
125
+        },
126
+        {
127
+          title: "操作人",
128
+          key: "updatename",
129
+          align: "center"
130
+        },
131
+        {
132
+          title: "操作时间",
133
+          key: "updatetime",
134
+          width: 190,
135
+          align: "center"
136
+        },
137
+        {
138
+          title: "操作",
139
+          slot: "actionSlot",
140
+          width: 220,
141
+          align: "center"
142
+        }
143
+      ]
144
+    };
9 145
   },
10
-  methods: {}
146
+  created() {
147
+    this.getClassList();
148
+  },
149
+  computed: {
150
+    powerParams() {
151
+      return this.$store.getters.powerParams;
152
+    }
153
+  },
154
+  methods: {
155
+    classChange(classid) {
156
+      this.searchForm.classid = classid;
157
+      this.searchList();
158
+    },
159
+    // 搜索
160
+    searchList() {
161
+      this.searchForm.page = 1;
162
+      this.getList();
163
+    },
164
+    // 页码改变
165
+    pageChange(page) {
166
+      this.searchForm.page = page;
167
+      this.getList();
168
+    },
169
+    // 每页显示数量改变
170
+    pageSizeChange(size) {
171
+      this.searchForm.size = size;
172
+      this.searchForm.page = 1;
173
+      this.getList();
174
+    },
175
+    // 获取班级列表
176
+    getClassList() {
177
+      class_list({
178
+        // rtype: this.powerParams.rtype,
179
+        // objectid: this.powerParams.objectid,
180
+        schoolid: this.powerParams.objectid
181
+      }).then((data) => {
182
+        if (data.code === 0) {
183
+          this.schoolInfo = {
184
+            schoolid: data.obj.id,
185
+            schoolname: data.obj.name,
186
+            classList: data.obj.children
187
+          };
188
+          this.searchList();
189
+        } else {
190
+          this.$Message.error(data.msg);
191
+        }
192
+      });
193
+    },
194
+    // 获取列表
195
+    getList() {
196
+      stApp_list({
197
+        rtype: this.powerParams.rtype,
198
+        objectid: this.powerParams.objectid,
199
+        page: this.searchForm.page,
200
+        size: this.searchForm.size,
201
+        schoolid: this.schoolInfo.schoolid,
202
+        classid: this.searchForm.classid,
203
+        name: this.searchForm.name
204
+      }).then((data) => {
205
+        if (data.code === 0) {
206
+          this.searchForm.list = data.obj.data;
207
+          this.searchForm.total = data.obj.total;
208
+        } else {
209
+          this.$Message.error(data.msg);
210
+        }
211
+      });
212
+    },
213
+    enabledChange(row) {
214
+      let api = row.enabled === 1 ? stApp_enable : stApp_disabled;
215
+      api({
216
+        rtype: this.powerParams.rtype,
217
+        objectid: this.powerParams.objectid,
218
+        stappid: row.stappid,
219
+        rversion: row.rversion
220
+      }).then((data) => {
221
+        this.getList();
222
+        if (data.code === 0) {
223
+          this.$Message.success(data.msg);
224
+        } else {
225
+          this.$Message.error(data.msg);
226
+        }
227
+      });
228
+    },
229
+    // 新建
230
+    toAdd() {},
231
+    // 查看
232
+    toView() {},
233
+    // 编辑
234
+    toEdit() {},
235
+    // 删除
236
+    toDel() {},
237
+    // 授权
238
+    toEmpower() {}
239
+  }
11 240
 };
12 241
 </script>
13 242
 
14
-<style lang="less" scoped></style>
243
+<style lang="less" scoped>
244
+.main_root {
245
+  display: flex;
246
+  justify-content: space-between;
247
+  align-items: center;
248
+  height: calc(100% - 10px);
249
+  border-radius: 0;
250
+  border: none;
251
+  background-color: transparent;
252
+  .main_left {
253
+    margin-right: 10px;
254
+    width: 200px;
255
+    height: 100%;
256
+    border-radius: 15px;
257
+    border: 1px solid #e9f0f9;
258
+    background-color: #fff;
259
+    overflow: auto;
260
+    .main_left_title {
261
+      margin: 10px;
262
+      padding: 20px 0;
263
+      line-height: 20px;
264
+      font-size: 16px;
265
+      text-align: center;
266
+      color: #798cb5;
267
+      border-bottom: 1px solid #e9f0f9;
268
+    }
269
+    .class_list {
270
+      max-height: calc(100% - 82px);
271
+      font-size: 14px;
272
+      line-height: 32px;
273
+      text-align: center;
274
+      overflow: auto;
275
+      .class_item {
276
+        margin: 0 10px;
277
+        border-radius: 6px;
278
+        cursor: pointer;
279
+        &:hover,
280
+        &.selceted {
281
+          font-weight: bold;
282
+          color: #339dff;
283
+          background-color: #dbeeff;
284
+        }
285
+      }
286
+    }
287
+  }
288
+  .main_right {
289
+    width: calc(100% - 210px);
290
+    height: 100%;
291
+    border-radius: 15px;
292
+    border: 1px solid #e9f0f9;
293
+    background-color: #fff;
294
+    overflow: auto;
295
+    .search_header {
296
+      display: flex;
297
+      justify-content: space-between;
298
+      align-items: center;
299
+      margin: 16px 16px;
300
+      .search_left {
301
+        display: flex;
302
+        justify-content: flex-start;
303
+        align-items: center;
304
+      }
305
+      .search_right {
306
+        display: flex;
307
+        justify-content: flex-start;
308
+        align-items: center;
309
+      }
310
+    }
311
+  }
312
+}
313
+</style>

+ 2
- 2
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -233,8 +233,8 @@ export default {
233 233
     // 获取班级列表
234 234
     getClassList() {
235 235
       class_list({
236
-        rtype: this.powerParams.rtype,
237
-        objectid: this.powerParams.objectid,
236
+        // rtype: this.powerParams.rtype,
237
+        // objectid: this.powerParams.objectid,
238 238
         schoolid: this.powerParams.objectid
239 239
       }).then((data) => {
240 240
         if (data.code === 0) {

+ 0
- 14
src/views/schoolSection/deviceManage/parentControlDevice.vue View File

@@ -1,14 +0,0 @@
1
-<template>
2
-  <div class="main_root">不做</div>
3
-</template>
4
-
5
-<script>
6
-export default {
7
-  data() {
8
-    return {};
9
-  },
10
-  methods: {}
11
-};
12
-</script>
13
-
14
-<style lang="less" scoped></style>

+ 0
- 8
src/views/schoolSection/index.vue View File

@@ -99,13 +99,6 @@
99 99
               class="drop_down_list_item"
100 100
               >解除管控设备</router-link
101 101
             >
102
-            <!-- <router-link
103
-              @click.native="routeDropdownChange()"
104
-              tag="div"
105
-              to="/school/parentControlDevice"
106
-              class="drop_down_list_item"
107
-              >家长管控设备</router-link
108
-            > -->
109 102
             <router-link
110 103
               @click.native="routeDropdownChange()"
111 104
               tag="div"
@@ -287,7 +280,6 @@ export default {
287 280
         this.$route.path.includes("/school/breakRuleDevice") ||
288 281
         this.$route.path.includes("/school/outControlDevice") ||
289 282
         this.$route.path.includes("/school/removeControlDevice") ||
290
-        this.$route.path.includes("/school/parentControlDevice") ||
291 283
         this.$route.path.includes("/school/inLineDevice")
292 284
       );
293 285
     },

+ 0
- 14
src/views/schoolSection/timeLimit/timeLimit.vue View File

@@ -1,14 +0,0 @@
1
-<template>
2
-  <div class="main_root"></div>
3
-</template>
4
-
5
-<script>
6
-export default {
7
-  data() {
8
-    return {};
9
-  },
10
-  methods: {}
11
-};
12
-</script>
13
-
14
-<style lang="less" scoped></style>

Loading…
Cancel
Save