Переглянути джерело

Merge remote-tracking branch 'origin/gzb' into wzl

# Conflicts:
#	src/api/setting.js
gzb
wangzhonglu 9 місяці тому
джерело
коміт
39c72df883

+ 39
- 0
src/api/region.js Переглянути файл

@@ -13,6 +13,11 @@ export const region_list_qy = (data) => setRequest("region/list_qy", data);
13 13
  */
14 14
 export const region_list_sel_pt = (data) =>
15 15
   setRequest("region/list_sel_pt", data);
16
+/**
17
+ * 2.1.1.2区域--区域选择列表
18
+ */
19
+export const region_list_sel_qy = (data) =>
20
+    setRequest("region/list_sel_qy", data);
16 21
 /**
17 22
  * 2.1.1.2区域--区域学校选择列表
18 23
  */
@@ -38,3 +43,37 @@ export const region_detail = (data) => setRequest("region/detail", data);
38 43
  */
39 44
 export const region_list_admin = (data) =>
40 45
   setRequest("region/list_admin", data);
46
+
47
+/**
48
+ * 2.2.1搜索--搜索所有用户
49
+ */
50
+export const search_list_user = (data) => setRequest("search/list_user", data);
51
+/**
52
+ * 2.2.2搜索--搜索设备用户
53
+ */
54
+export const search_list_duser = (data) =>
55
+  setRequest("search/list_duser", data);
56
+/**
57
+ * 2.2.3搜索--搜索设备
58
+ */
59
+export const search_list_device = (data) =>
60
+  setRequest("search/list_device", data);
61
+/**
62
+ * 2.2.4搜索--搜索所有应用
63
+ */
64
+export const search_list_app = (data) => setRequest("search/list_app", data);
65
+/**
66
+ * 2.2.5搜索--搜索所有白名单
67
+ */
68
+export const search_list_white = (data) =>
69
+  setRequest("search/list_white", data);
70
+/**
71
+ * 2.2.6搜索--搜索设备型号
72
+ */
73
+export const search_list_dmodel = (data) =>
74
+  setRequest("search/list_dmodel", data);
75
+/**
76
+ * 2.2.7搜索--搜索客户端版本
77
+ */
78
+export const search_list_client = (data) =>
79
+  setRequest("search/list_client", data);

+ 12
- 0
src/api/setting.js Переглянути файл

@@ -56,3 +56,15 @@ export const deviceSet_edit = (data) => setRequest("deviceSet/edit", data);
56 56
  * 8.3.2.3 设备设置管理-重置
57 57
  */
58 58
 export const deviceSet_delete = (data) => setRequest("deviceSet/delete", data);
59
+/**
60
+ * 8.4.1 开机设置-详情
61
+ */
62
+export const autoapp_detail = (data) => setRequest("autoapp/detail", data);
63
+/**
64
+ * 8.4.2 开机设置-保存
65
+ */
66
+export const autoapp_edit = (data) => setRequest("autoapp/edit", data);
67
+/**
68
+ * 8.4.3 开机设置-重置
69
+ */
70
+export const autoapp_delete = (data) => setRequest("autoapp/delete", data);

+ 1
- 1
src/views/login/login.vue Переглянути файл

@@ -137,7 +137,7 @@ export default {
137 137
         ],
138 138
         phone: [{ required: true, validator: phoneCheck, trigger: "blur" }],
139 139
         msgcode: [
140
-          { required: true, message: "短信验证码不能为空", trigger: "blur" }
140
+          { required: true, message: "验证码不能为空", trigger: "blur" }
141 141
         ]
142 142
       },
143 143
       isaccount: false,

+ 5
- 5
src/views/regionSection/applicationManage/applicationManage.vue Переглянути файл

@@ -144,7 +144,7 @@
144 144
           </Select>
145 145
         </FormItem>
146 146
         <FormItem label="状态" style="width: 300px">
147
-          <RadioGroup v-model="wallpaperInfo.appState">
147
+          <RadioGroup v-model="wallpaperInfo.enable">
148 148
             <Radio :label="1">启用</Radio>
149 149
             <Radio :label="2">禁用</Radio>
150 150
           </RadioGroup>
@@ -525,7 +525,7 @@ export default {
525 525
         appid: null,
526 526
         appName: "",
527 527
         appgroupid: "",
528
-        appState: 1,
528
+        enable: 1,
529 529
         appType: 1,
530 530
         forced: 1,
531 531
         whited: 1,
@@ -980,7 +980,7 @@ export default {
980 980
         appid: null,
981 981
         appName: "",
982 982
         appgroupid: "",
983
-        appState: 1,
983
+        enable: 1,
984 984
         appType: 1,
985 985
         forced: 1,
986 986
         whited: 1,
@@ -1052,7 +1052,7 @@ export default {
1052 1052
           let appImg = this.wallpaperInfo.appImg.join(";");
1053 1053
           let form = {
1054 1054
             appName: this.wallpaperInfo.appName,
1055
-            appState: this.wallpaperInfo.appState,
1055
+            enable: this.wallpaperInfo.enable,
1056 1056
             appType: this.wallpaperInfo.appType,
1057 1057
             forced: this.wallpaperInfo.forced,
1058 1058
             whited: this.wallpaperInfo.whited,
@@ -1138,7 +1138,7 @@ export default {
1138 1138
             appid: res.obj.appid,
1139 1139
             appName: res.obj.appName,
1140 1140
             appgroupid: res.obj.appgroupid,
1141
-            appState: res.obj.enable,
1141
+            enable: res.obj.enable,
1142 1142
             appType: res.obj.appType,
1143 1143
             forced: res.obj.forced,
1144 1144
             whited: res.obj.whited,

+ 1
- 1
src/views/regionSection/index.vue Переглянути файл

@@ -115,7 +115,7 @@
115 115
               tag="div"
116 116
               to="/region/settingDevice"
117 117
               class="drop_down_list_item"
118
-              >设设置</router-link
118
+              >设设置</router-link
119 119
             >
120 120
             <router-link
121 121
               @click.native="routeDropdownChange()"

+ 149
- 4
src/views/regionSection/log/admin.vue Переглянути файл

@@ -1,14 +1,159 @@
1 1
 <template>
2
-  <div class="main_root">管理员日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+          v-model="searchForm.name"
18
+          placeholder="请输入登录名、事件"
19
+          search
20
+          @on-search="searchList()"
21
+          style="width: 180px"
22
+        />
23
+      </div>
24
+    </div>
25
+    <div class="table_wrap">
26
+      <Table :columns="columns" :data="searchForm.list"></Table>
27
+    </div>
28
+    <div class="page_wrap">
29
+      <Page
30
+        :transfer="true"
31
+        :total="searchForm.total"
32
+        :current="searchForm.page"
33
+        :page-size="searchForm.size"
34
+        :page-size-opts="[10, 20, 40, 60]"
35
+        @on-change="pageChange"
36
+        @on-page-size-change="pageSizeChange"
37
+        show-total
38
+        show-sizer
39
+      ></Page>
40
+    </div>
41
+  </div>
3 42
 </template>
4 43
 
5 44
 <script>
45
+import { dateFormat } from "@/utils";
46
+import { logOperate_list } from "@/api/log";
6 47
 export default {
7 48
   data() {
8
-    return {};
49
+    return {
50
+      searchForm: {
51
+        dataRange: [],
52
+        name: "",
53
+        page: 1,
54
+        size: 10,
55
+        list: [],
56
+        total: 0
57
+      },
58
+      userInfo: {},
59
+      columns: [
60
+        {
61
+          title: "序号",
62
+          align: "center",
63
+          width: 70,
64
+          render: (h, params) => {
65
+            return h(
66
+              "span",
67
+              params.index +
68
+                (this.searchForm.page - 1) * this.searchForm.size +
69
+                1
70
+            );
71
+          }
72
+        },
73
+        {
74
+          title: "登录名",
75
+          key: "loginname",
76
+          align: "center"
77
+        },
78
+        {
79
+          title: "姓名",
80
+          key: "aname",
81
+          align: "center"
82
+        },
83
+        {
84
+          title: "事件",
85
+          key: "content",
86
+          align: "center"
87
+        },
88
+        {
89
+          title: "时间",
90
+          key: "createtime",
91
+          width: 190,
92
+          align: "center"
93
+        }
94
+      ]
95
+    };
9 96
   },
10
-  methods: {}
97
+  created() {
98
+    this.userInfo = JSON.parse(
99
+        localStorage.getItem("xh_control_userInfo")
100
+    ).content;
101
+    this.searchList();
102
+  },
103
+  methods: {
104
+    // 搜索
105
+    searchList() {
106
+      this.searchForm.page = 1;
107
+      this.getList();
108
+    },
109
+    // 页码改变
110
+    pageChange(page) {
111
+      this.searchForm.page = page;
112
+      this.getList();
113
+    },
114
+    // 每页显示数量改变
115
+    pageSizeChange(size) {
116
+      this.searchForm.size = size;
117
+      this.searchForm.page = 1;
118
+      this.getList();
119
+    },
120
+    // 获取列表
121
+    getList() {
122
+      let _begindate = this.searchForm.dataRange[0];
123
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
124
+      let _enddate = this.searchForm.dataRange[1];
125
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
126
+      logOperate_list({
127
+        page: this.searchForm.page,
128
+        size: this.searchForm.size,
129
+        begindate: _begindate,
130
+        enddate: _enddate,
131
+        name: this.searchForm.name,
132
+        regionid: this.userInfo.regionid
133
+      }).then((data) => {
134
+        if (data.code === 0) {
135
+          this.searchForm.list = data.obj.data;
136
+          this.searchForm.total = data.obj.total;
137
+        } else {
138
+          this.$Message.error(data.msg);
139
+        }
140
+      });
141
+    },
142
+    toExport() {}
143
+  }
11 144
 };
12 145
 </script>
13 146
 
14
-<style lang="less" scoped></style>
147
+<style lang="less" scoped>
148
+.search_header {
149
+  display: flex;
150
+  justify-content: space-between;
151
+  align-items: center;
152
+  margin: 16px 16px;
153
+  .search_left {
154
+    display: flex;
155
+    justify-content: flex-start;
156
+    align-items: center;
157
+  }
158
+}
159
+</style>

+ 176
- 4
src/views/regionSection/log/appLaunch.vue Переглянути файл

@@ -1,14 +1,186 @@
1 1
 <template>
2
-  <div class="main_root">应用启动日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+          v-model="searchForm.name"
18
+          placeholder="请输入登录名、设备号"
19
+          search
20
+          @on-search="searchList()"
21
+          style="width: 180px"
22
+        />
23
+      </div>
24
+    </div>
25
+    <div class="table_wrap">
26
+      <Table :columns="columns" :data="searchForm.list">
27
+        <template slot-scope="{ row }" slot="violatedSlot">
28
+          <div class="action_list">
29
+            <!-- 0不违规1违规 -->
30
+            <div v-if="row.violated === 1" class="action_success">是</div>
31
+            <div v-else-if="row.violated === 0" class="action_error">否</div>
32
+          </div>
33
+        </template>
34
+      </Table>
35
+    </div>
36
+    <div class="page_wrap">
37
+      <Page
38
+        :transfer="true"
39
+        :total="searchForm.total"
40
+        :current="searchForm.page"
41
+        :page-size="searchForm.size"
42
+        :page-size-opts="[10, 20, 40, 60]"
43
+        @on-change="pageChange"
44
+        @on-page-size-change="pageSizeChange"
45
+        show-total
46
+        show-sizer
47
+      ></Page>
48
+    </div>
49
+  </div>
3 50
 </template>
4 51
 
5 52
 <script>
53
+import { dateFormat } from "@/utils";
54
+import { logAppStart_list_start } from "@/api/log";
6 55
 export default {
7 56
   data() {
8
-    return {};
57
+    return {
58
+      searchForm: {
59
+        dataRange: [],
60
+        name: "",
61
+        page: 1,
62
+        size: 10,
63
+        list: [],
64
+        total: 0
65
+      },
66
+      userInfo: {},
67
+      columns: [
68
+        {
69
+          title: "序号",
70
+          align: "center",
71
+          width: 70,
72
+          render: (h, params) => {
73
+            return h(
74
+              "span",
75
+              params.index +
76
+                (this.searchForm.page - 1) * this.searchForm.size +
77
+                1
78
+            );
79
+          }
80
+        },
81
+        {
82
+          title: "学校名称",
83
+          key: "schoolName",
84
+          align: "center"
85
+        },
86
+        {
87
+          title: "班级",
88
+          key: "classname",
89
+          align: "center"
90
+        },
91
+        {
92
+          title: "登录名",
93
+          key: "loginname",
94
+          align: "center"
95
+        },
96
+        {
97
+          title: "姓名",
98
+          key: "aname",
99
+          align: "center"
100
+        },
101
+        {
102
+          title: "设备号码",
103
+          key: "sn",
104
+          align: "center"
105
+        },
106
+        {
107
+          title: "应用名称",
108
+          key: "appName",
109
+          align: "center"
110
+        },
111
+        {
112
+          title: "违规",
113
+          slot: "violatedSlot",
114
+          align: "center"
115
+        },
116
+        {
117
+          title: "下载时间",
118
+          key: "createtime",
119
+          width: 190,
120
+          align: "center"
121
+        }
122
+      ]
123
+    };
9 124
   },
10
-  methods: {}
125
+  created() {
126
+    this.userInfo = JSON.parse(
127
+      localStorage.getItem("xh_control_userInfo")
128
+    ).content;
129
+    this.searchList();
130
+  },
131
+  methods: {
132
+    // 搜索
133
+    searchList() {
134
+      this.searchForm.page = 1;
135
+      this.getList();
136
+    },
137
+    // 页码改变
138
+    pageChange(page) {
139
+      this.searchForm.page = page;
140
+      this.getList();
141
+    },
142
+    // 每页显示数量改变
143
+    pageSizeChange(size) {
144
+      this.searchForm.size = size;
145
+      this.searchForm.page = 1;
146
+      this.getList();
147
+    },
148
+    // 获取列表
149
+    getList() {
150
+      let _begindate = this.searchForm.dataRange[0];
151
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
152
+      let _enddate = this.searchForm.dataRange[1];
153
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
154
+      logAppStart_list_start({
155
+        page: this.searchForm.page,
156
+        size: this.searchForm.size,
157
+        begindate: _begindate,
158
+        enddate: _enddate,
159
+        name: this.searchForm.name,
160
+        regionid: this.userInfo.regionid
161
+      }).then((data) => {
162
+        if (data.code === 0) {
163
+          this.searchForm.list = data.obj.data;
164
+          this.searchForm.total = data.obj.total;
165
+        } else {
166
+          this.$Message.error(data.msg);
167
+        }
168
+      });
169
+    }
170
+  }
11 171
 };
12 172
 </script>
13 173
 
14
-<style lang="less" scoped></style>
174
+<style lang="less" scoped>
175
+.search_header {
176
+  display: flex;
177
+  justify-content: space-between;
178
+  align-items: center;
179
+  margin: 16px 16px;
180
+  .search_left {
181
+    display: flex;
182
+    justify-content: flex-start;
183
+    align-items: center;
184
+  }
185
+}
186
+</style>

+ 168
- 4
src/views/regionSection/log/applicationDownload.vue Переглянути файл

@@ -1,14 +1,178 @@
1 1
 <template>
2
-  <div class="main_root">应用下载日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+          v-model="searchForm.name"
18
+          placeholder="请输入登录名、事件"
19
+          search
20
+          @on-search="searchList()"
21
+          style="width: 180px"
22
+        />
23
+      </div>
24
+    </div>
25
+    <div class="table_wrap">
26
+      <Table :columns="columns" :data="searchForm.list"></Table>
27
+    </div>
28
+    <div class="page_wrap">
29
+      <Page
30
+        :transfer="true"
31
+        :total="searchForm.total"
32
+        :current="searchForm.page"
33
+        :page-size="searchForm.size"
34
+        :page-size-opts="[10, 20, 40, 60]"
35
+        @on-change="pageChange"
36
+        @on-page-size-change="pageSizeChange"
37
+        show-total
38
+        show-sizer
39
+      ></Page>
40
+    </div>
41
+  </div>
3 42
 </template>
4 43
 
5 44
 <script>
45
+import { dateFormat } from "@/utils";
46
+import { logAppDown_list } from "@/api/log";
6 47
 export default {
7 48
   data() {
8
-    return {};
49
+    return {
50
+      searchForm: {
51
+        dataRange: [],
52
+        name: "",
53
+        page: 1,
54
+        size: 10,
55
+        list: [],
56
+        total: 0
57
+      },
58
+      userInfo: {},
59
+      columns: [
60
+        {
61
+          title: "序号",
62
+          align: "center",
63
+          width: 70,
64
+          render: (h, params) => {
65
+            return h(
66
+              "span",
67
+              params.index +
68
+                (this.searchForm.page - 1) * this.searchForm.size +
69
+                1
70
+            );
71
+          }
72
+        },
73
+        {
74
+          title: "学校名称",
75
+          key: "schoolName",
76
+          align: "center"
77
+        },
78
+        {
79
+          title: "班级",
80
+          key: "classname",
81
+          align: "center"
82
+        },
83
+        {
84
+          title: "登录名",
85
+          key: "loginname",
86
+          align: "center"
87
+        },
88
+        {
89
+          title: "姓名",
90
+          key: "aname",
91
+          align: "center"
92
+        },
93
+        {
94
+          title: "设备号码",
95
+          key: "sn",
96
+          align: "center"
97
+        },
98
+        {
99
+          title: "应用名称",
100
+          key: "appName",
101
+          align: "center"
102
+        },
103
+        {
104
+          title: "版本号",
105
+          key: "appVersion",
106
+          align: "center"
107
+        },
108
+        {
109
+          title: "下载时间",
110
+          key: "createtime",
111
+          width: 190,
112
+          align: "center"
113
+        }
114
+      ]
115
+    };
9 116
   },
10
-  methods: {}
117
+  created() {
118
+    this.userInfo = JSON.parse(
119
+      localStorage.getItem("xh_control_userInfo")
120
+    ).content;
121
+    this.searchList();
122
+  },
123
+  methods: {
124
+    // 搜索
125
+    searchList() {
126
+      this.searchForm.page = 1;
127
+      this.getList();
128
+    },
129
+    // 页码改变
130
+    pageChange(page) {
131
+      this.searchForm.page = page;
132
+      this.getList();
133
+    },
134
+    // 每页显示数量改变
135
+    pageSizeChange(size) {
136
+      this.searchForm.size = size;
137
+      this.searchForm.page = 1;
138
+      this.getList();
139
+    },
140
+    // 获取列表
141
+    getList() {
142
+      let _begindate = this.searchForm.dataRange[0];
143
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
144
+      let _enddate = this.searchForm.dataRange[1];
145
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
146
+      logAppDown_list({
147
+        page: this.searchForm.page,
148
+        size: this.searchForm.size,
149
+        begindate: _begindate,
150
+        enddate: _enddate,
151
+        name: this.searchForm.name,
152
+        regionid: this.userInfo.regionid
153
+      }).then((data) => {
154
+        if (data.code === 0) {
155
+          this.searchForm.list = data.obj.data;
156
+          this.searchForm.total = data.obj.total;
157
+        } else {
158
+          this.$Message.error(data.msg);
159
+        }
160
+      });
161
+    }
162
+  }
11 163
 };
12 164
 </script>
13 165
 
14
-<style lang="less" scoped></style>
166
+<style lang="less" scoped>
167
+.search_header {
168
+  display: flex;
169
+  justify-content: space-between;
170
+  align-items: center;
171
+  margin: 16px 16px;
172
+  .search_left {
173
+    display: flex;
174
+    justify-content: flex-start;
175
+    align-items: center;
176
+  }
177
+}
178
+</style>

+ 206
- 4
src/views/regionSection/log/deviceEvents.vue Переглянути файл

@@ -1,14 +1,216 @@
1 1
 <template>
2
-  <div class="main_root">设备事件日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Select
17
+          v-model="searchForm.doEvent"
18
+          :transfer="true"
19
+          style="margin-right: 10px; width: 150px"
20
+          @on-change="searchList()"
21
+        >
22
+          <Option :value="0">所有事件</Option>
23
+          <Option
24
+            v-for="(eventName, eventVal) in doEventInfo"
25
+            :value="Number(eventVal)"
26
+            :key="eventVal"
27
+            >{{ eventName }}</Option
28
+          >
29
+        </Select>
30
+        <Input
31
+          v-model="searchForm.name"
32
+          placeholder="请输入登录名、设备号"
33
+          search
34
+          @on-search="searchList()"
35
+          style="width: 180px"
36
+        />
37
+      </div>
38
+      <Button type="primary" class="primary_btn" @click="toExport()"
39
+        >导出</Button
40
+      >
41
+    </div>
42
+    <div class="table_wrap">
43
+      <Table :columns="columns" :data="searchForm.list">
44
+        <template slot-scope="{ row }" slot="doEventSlot">
45
+          <!-- 1发送消息 2解除限制 3限制使用 4更新策略 5重启设备 6恢复出厂 -->
46
+          <div>{{ doEventInfo[row.doEvent] }}</div>
47
+        </template>
48
+        <template slot-scope="{ row }" slot="violatedSlot">
49
+          <div class="action_list">
50
+            <!-- 0不违规1违规 -->
51
+            <div v-if="row.violated === 1" class="action_success">是</div>
52
+            <div v-else-if="row.violated === 0" class="action_error">否</div>
53
+          </div>
54
+        </template>
55
+      </Table>
56
+    </div>
57
+    <div class="page_wrap">
58
+      <Page
59
+        :transfer="true"
60
+        :total="searchForm.total"
61
+        :current="searchForm.page"
62
+        :page-size="searchForm.size"
63
+        :page-size-opts="[10, 20, 40, 60]"
64
+        @on-change="pageChange"
65
+        @on-page-size-change="pageSizeChange"
66
+        show-total
67
+        show-sizer
68
+      ></Page>
69
+    </div>
70
+  </div>
3 71
 </template>
4 72
 
5 73
 <script>
74
+import { dateFormat, doEventInfo } from "@/utils";
75
+import { logdoperate_list_event } from "@/api/log";
6 76
 export default {
7 77
   data() {
8
-    return {};
78
+    return {
79
+      doEventInfo,
80
+      searchForm: {
81
+        dataRange: [],
82
+        doEvent: 0,
83
+        name: "",
84
+        page: 1,
85
+        size: 10,
86
+        list: [],
87
+        total: 0
88
+      },
89
+      userInfo: {},
90
+      columns: [
91
+        {
92
+          title: "序号",
93
+          align: "center",
94
+          width: 70,
95
+          render: (h, params) => {
96
+            return h(
97
+              "span",
98
+              params.index +
99
+                (this.searchForm.page - 1) * this.searchForm.size +
100
+                1
101
+            );
102
+          }
103
+        },
104
+        {
105
+          title: "学校名称",
106
+          key: "schoolName",
107
+          align: "center"
108
+        },
109
+        {
110
+          title: "班级",
111
+          key: "classname",
112
+          align: "center"
113
+        },
114
+        {
115
+          title: "登录名",
116
+          key: "loginname",
117
+          align: "center"
118
+        },
119
+        {
120
+          title: "姓名",
121
+          key: "username",
122
+          align: "center"
123
+        },
124
+        {
125
+          title: "设备号码",
126
+          key: "sn",
127
+          align: "center"
128
+        },
129
+        {
130
+          title: "事件",
131
+          slot: "doEventSlot",
132
+          align: "center"
133
+        },
134
+        {
135
+          title: "描述",
136
+          key: "comm",
137
+          align: "center"
138
+        },
139
+        {
140
+          title: "违规",
141
+          slot: "violatedSlot",
142
+          align: "center"
143
+        },
144
+        {
145
+          title: "时间",
146
+          key: "createtime",
147
+          width: 190,
148
+          align: "center"
149
+        }
150
+      ]
151
+    };
9 152
   },
10
-  methods: {}
153
+  created() {
154
+    this.userInfo = JSON.parse(
155
+      localStorage.getItem("xh_control_userInfo")
156
+    ).content;
157
+    this.searchList();
158
+  },
159
+  methods: {
160
+    // 搜索
161
+    searchList() {
162
+      this.searchForm.page = 1;
163
+      this.getList();
164
+    },
165
+    // 页码改变
166
+    pageChange(page) {
167
+      this.searchForm.page = page;
168
+      this.getList();
169
+    },
170
+    // 每页显示数量改变
171
+    pageSizeChange(size) {
172
+      this.searchForm.size = size;
173
+      this.searchForm.page = 1;
174
+      this.getList();
175
+    },
176
+    // 获取列表
177
+    getList() {
178
+      let _begindate = this.searchForm.dataRange[0];
179
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
180
+      let _enddate = this.searchForm.dataRange[1];
181
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
182
+      logdoperate_list_event({
183
+        page: this.searchForm.page,
184
+        size: this.searchForm.size,
185
+        doEvent: this.searchForm.doEvent,
186
+        begindate: _begindate,
187
+        enddate: _enddate,
188
+        name: this.searchForm.name,
189
+        regionid: this.userInfo.regionid
190
+      }).then((data) => {
191
+        if (data.code === 0) {
192
+          this.searchForm.list = data.obj.data;
193
+          this.searchForm.total = data.obj.total;
194
+        } else {
195
+          this.$Message.error(data.msg);
196
+        }
197
+      });
198
+    },
199
+    toExport() {}
200
+  }
11 201
 };
12 202
 </script>
13 203
 
14
-<style lang="less" scoped></style>
204
+<style lang="less" scoped>
205
+.search_header {
206
+  display: flex;
207
+  justify-content: space-between;
208
+  align-items: center;
209
+  margin: 16px 16px;
210
+  .search_left {
211
+    display: flex;
212
+    justify-content: flex-start;
213
+    align-items: center;
214
+  }
215
+}
216
+</style>

+ 144
- 4
src/views/regionSection/log/deviceExport.vue Переглянути файл

@@ -1,14 +1,154 @@
1 1
 <template>
2
-  <div class="main_root">设备导出</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Input
6
+          v-model="searchForm.name"
7
+          placeholder="请输入名称"
8
+          search
9
+          @on-search="searchList()"
10
+          style="width: 150px"
11
+        />
12
+      </div>
13
+      <Button type="primary" class="primary_btn" @click="toExport()"
14
+        >导出</Button
15
+      >
16
+    </div>
17
+    <div class="table_wrap">
18
+      <Table :columns="columns" :data="searchForm.list">
19
+        <template slot-scope="{ row }" slot="actionSlot">
20
+          <div class="action_list">
21
+            <div @click="toExport(row)">导出</div>
22
+          </div>
23
+        </template>
24
+      </Table>
25
+    </div>
26
+    <div class="page_wrap">
27
+      <Page
28
+        :transfer="true"
29
+        :total="searchForm.total"
30
+        :current="searchForm.page"
31
+        :page-size="searchForm.size"
32
+        :page-size-opts="[10, 20, 40, 60]"
33
+        @on-change="pageChange"
34
+        @on-page-size-change="pageSizeChange"
35
+        show-total
36
+        show-sizer
37
+      ></Page>
38
+    </div>
39
+  </div>
3 40
 </template>
4 41
 
5 42
 <script>
43
+import { logDeviceBind_list } from "@/api/log";
6 44
 export default {
7 45
   data() {
8
-    return {};
46
+    return {
47
+      searchForm: {
48
+        name: "",
49
+        page: 1,
50
+        size: 10,
51
+        list: [],
52
+        total: 0
53
+      },
54
+      userInfo: {},
55
+      columns: [
56
+        {
57
+          title: "序号",
58
+          align: "center",
59
+          width: 70,
60
+          render: (h, params) => {
61
+            return h(
62
+              "span",
63
+              params.index +
64
+                (this.searchForm.page - 1) * this.searchForm.size +
65
+                1
66
+            );
67
+          }
68
+        },
69
+        {
70
+          title: "区域名称",
71
+          key: "regionName",
72
+          align: "center"
73
+        },
74
+        {
75
+          title: "学校数",
76
+          key: "schoolnum",
77
+          align: "center"
78
+        },
79
+        {
80
+          title: "用户数",
81
+          key: "usernum",
82
+          align: "center"
83
+        },
84
+        {
85
+          title: "设备数",
86
+          key: "snnum",
87
+          align: "center"
88
+        },
89
+        {
90
+          title: "操作",
91
+          slot: "actionSlot",
92
+          width: 90,
93
+          align: "center"
94
+        }
95
+      ]
96
+    };
9 97
   },
10
-  methods: {}
98
+  created() {
99
+    this.userInfo = JSON.parse(
100
+      localStorage.getItem("xh_control_userInfo")
101
+    ).content;
102
+    this.searchList();
103
+  },
104
+  methods: {
105
+    // 搜索
106
+    searchList() {
107
+      this.searchForm.page = 1;
108
+      this.getList();
109
+    },
110
+    // 页码改变
111
+    pageChange(page) {
112
+      this.searchForm.page = page;
113
+      this.getList();
114
+    },
115
+    // 每页显示数量改变
116
+    pageSizeChange(size) {
117
+      this.searchForm.size = size;
118
+      this.searchForm.page = 1;
119
+      this.getList();
120
+    },
121
+    // 获取列表
122
+    getList() {
123
+      logDeviceBind_list({
124
+        page: this.searchForm.page,
125
+        size: this.searchForm.size,
126
+        name: this.searchForm.name,
127
+        regionid: this.userInfo.regionid
128
+      }).then((data) => {
129
+        if (data.code === 0) {
130
+          this.searchForm.list = data.obj.data;
131
+          this.searchForm.total = data.obj.total;
132
+        } else {
133
+          this.$Message.error(data.msg);
134
+        }
135
+      });
136
+    },
137
+    toExport() {}
138
+  }
11 139
 };
12 140
 </script>
13 141
 
14
-<style lang="less" scoped></style>
142
+<style lang="less" scoped>
143
+.search_header {
144
+  display: flex;
145
+  justify-content: space-between;
146
+  align-items: center;
147
+  margin: 16px 16px;
148
+  .search_left {
149
+    display: flex;
150
+    justify-content: flex-start;
151
+    align-items: center;
152
+  }
153
+}
154
+</style>

+ 182
- 4
src/views/regionSection/log/deviceInstallation.vue Переглянути файл

@@ -1,14 +1,192 @@
1 1
 <template>
2
-  <div class="main_root">设备已安装应用</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+          v-model="searchForm.name"
18
+          placeholder="请输入登录名、设备号、应用"
19
+          search
20
+          @on-search="searchList()"
21
+          style="width: 180px"
22
+        />
23
+      </div>
24
+      <Button type="primary" class="primary_btn" @click="toExport()"
25
+        >导出</Button
26
+      >
27
+    </div>
28
+    <div class="table_wrap">
29
+      <Table :columns="columns" :data="searchForm.list"></Table>
30
+    </div>
31
+    <div class="page_wrap">
32
+      <Page
33
+        :transfer="true"
34
+        :total="searchForm.total"
35
+        :current="searchForm.page"
36
+        :page-size="searchForm.size"
37
+        :page-size-opts="[10, 20, 40, 60]"
38
+        @on-change="pageChange"
39
+        @on-page-size-change="pageSizeChange"
40
+        show-total
41
+        show-sizer
42
+      ></Page>
43
+    </div>
44
+  </div>
3 45
 </template>
4 46
 
5 47
 <script>
48
+import { dateFormat } from "@/utils";
49
+import { logAppStart_list_install } from "@/api/log";
6 50
 export default {
7 51
   data() {
8
-    return {};
52
+    return {
53
+      searchForm: {
54
+        dataRange: [],
55
+        name: "",
56
+        page: 1,
57
+        size: 10,
58
+        list: [],
59
+        total: 0
60
+      },
61
+      userInfo: {},
62
+      columns: [
63
+        {
64
+          title: "序号",
65
+          align: "center",
66
+          width: 70,
67
+          render: (h, params) => {
68
+            return h(
69
+              "span",
70
+              params.index +
71
+                (this.searchForm.page - 1) * this.searchForm.size +
72
+                1
73
+            );
74
+          }
75
+        },
76
+        {
77
+          title: "学校名称",
78
+          key: "schoolName",
79
+          align: "center"
80
+        },
81
+        {
82
+          title: "班级",
83
+          key: "classname",
84
+          align: "center"
85
+        },
86
+        {
87
+          title: "登录名",
88
+          key: "loginname",
89
+          align: "center"
90
+        },
91
+        {
92
+          title: "姓名",
93
+          key: "username",
94
+          align: "center"
95
+        },
96
+        {
97
+          title: "设备号码",
98
+          key: "sn",
99
+          align: "center"
100
+        },
101
+        {
102
+          title: "应用名称",
103
+          key: "appName",
104
+          align: "center"
105
+        },
106
+        {
107
+          title: "应用包名",
108
+          key: "appPackage",
109
+          align: "center"
110
+        },
111
+        {
112
+          title: "版本名称",
113
+          key: "versionName",
114
+          align: "center"
115
+        },
116
+        {
117
+          title: "版本号",
118
+          key: "versionNum",
119
+          align: "center"
120
+        },
121
+        {
122
+          title: "上报时间",
123
+          key: "createtime",
124
+          width: 190,
125
+          align: "center"
126
+        }
127
+      ]
128
+    };
9 129
   },
10
-  methods: {}
130
+  created() {
131
+    this.userInfo = JSON.parse(
132
+      localStorage.getItem("xh_control_userInfo")
133
+    ).content;
134
+    this.searchList();
135
+  },
136
+  methods: {
137
+    // 搜索
138
+    searchList() {
139
+      this.searchForm.page = 1;
140
+      this.getList();
141
+    },
142
+    // 页码改变
143
+    pageChange(page) {
144
+      this.searchForm.page = page;
145
+      this.getList();
146
+    },
147
+    // 每页显示数量改变
148
+    pageSizeChange(size) {
149
+      this.searchForm.size = size;
150
+      this.searchForm.page = 1;
151
+      this.getList();
152
+    },
153
+    // 获取列表
154
+    getList() {
155
+      let _begindate = this.searchForm.dataRange[0];
156
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
157
+      let _enddate = this.searchForm.dataRange[1];
158
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
159
+      logAppStart_list_install({
160
+        page: this.searchForm.page,
161
+        size: this.searchForm.size,
162
+        begindate: _begindate,
163
+        enddate: _enddate,
164
+        name: this.searchForm.name,
165
+        regionid: this.userInfo.regionid
166
+      }).then((data) => {
167
+        if (data.code === 0) {
168
+          this.searchForm.list = data.obj.data;
169
+          this.searchForm.total = data.obj.total;
170
+        } else {
171
+          this.$Message.error(data.msg);
172
+        }
173
+      });
174
+    },
175
+    toExport() {}
176
+  }
11 177
 };
12 178
 </script>
13 179
 
14
-<style lang="less" scoped></style>
180
+<style lang="less" scoped>
181
+.search_header {
182
+  display: flex;
183
+  justify-content: space-between;
184
+  align-items: center;
185
+  margin: 16px 16px;
186
+  .search_left {
187
+    display: flex;
188
+    justify-content: flex-start;
189
+    align-items: center;
190
+  }
191
+}
192
+</style>

+ 167
- 4
src/views/regionSection/log/deviceLocation.vue Переглянути файл

@@ -1,14 +1,177 @@
1 1
 <template>
2
-  <div class="main_root">设备位置日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+            v-model="searchForm.dataRange"
7
+            @on-change="searchList()"
8
+            :editable="false"
9
+            :transfer="true"
10
+            format="yyyy-MM-dd"
11
+            type="daterange"
12
+            placement="bottom-start"
13
+            placeholder="请选择日期范围"
14
+            style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+            v-model="searchForm.name"
18
+            placeholder="请输入登录名、事件"
19
+            search
20
+            @on-search="searchList()"
21
+            style="width: 180px"
22
+        />
23
+      </div>
24
+      <Button type="primary" class="primary_btn" @click="toExport()"
25
+      >导出</Button
26
+      >
27
+    </div>
28
+    <div class="table_wrap">
29
+      <Table :columns="columns" :data="searchForm.list"></Table>
30
+    </div>
31
+    <div class="page_wrap">
32
+      <Page
33
+          :transfer="true"
34
+          :total="searchForm.total"
35
+          :current="searchForm.page"
36
+          :page-size="searchForm.size"
37
+          :page-size-opts="[10, 20, 40, 60]"
38
+          @on-change="pageChange"
39
+          @on-page-size-change="pageSizeChange"
40
+          show-total
41
+          show-sizer
42
+      ></Page>
43
+    </div>
44
+  </div>
3 45
 </template>
4 46
 
5 47
 <script>
48
+import { dateFormat } from "@/utils";
49
+import { logDeviceLogin_list } from "@/api/log";
6 50
 export default {
7 51
   data() {
8
-    return {};
52
+    return {
53
+      searchForm: {
54
+        dataRange: [],
55
+        name: "",
56
+        page: 1,
57
+        size: 10,
58
+        list: [],
59
+        total: 0
60
+      },
61
+      userInfo: {},
62
+      columns: [
63
+        {
64
+          title: "序号",
65
+          align: "center",
66
+          width: 70,
67
+          render: (h, params) => {
68
+            return h(
69
+                "span",
70
+                params.index +
71
+                (this.searchForm.page - 1) * this.searchForm.size +
72
+                1
73
+            );
74
+          }
75
+        },
76
+        {
77
+          title: "设备号码",
78
+          key: "sn",
79
+          align: "center"
80
+        },
81
+        {
82
+          title: "登录名",
83
+          key: "loginname",
84
+          align: "center"
85
+        },
86
+        {
87
+          title: "姓名",
88
+          key: "username",
89
+          align: "center"
90
+        },
91
+        {
92
+          title: "学校名称",
93
+          key: "schoolName",
94
+          align: "center"
95
+        },
96
+        {
97
+          title: "班级",
98
+          key: "classname",
99
+          align: "center"
100
+        },
101
+        {
102
+          title: "地址",
103
+          key: "ipAddress",
104
+          align: "center"
105
+        },
106
+        {
107
+          title: "时间",
108
+          key: "createtime",
109
+          width: 190,
110
+          align: "center"
111
+        }
112
+      ]
113
+    };
9 114
   },
10
-  methods: {}
115
+  created() {
116
+    this.userInfo = JSON.parse(
117
+        localStorage.getItem("xh_control_userInfo")
118
+    ).content;
119
+    this.searchList();
120
+  },
121
+  methods: {
122
+    // 搜索
123
+    searchList() {
124
+      this.searchForm.page = 1;
125
+      this.getList();
126
+    },
127
+    // 页码改变
128
+    pageChange(page) {
129
+      this.searchForm.page = page;
130
+      this.getList();
131
+    },
132
+    // 每页显示数量改变
133
+    pageSizeChange(size) {
134
+      this.searchForm.size = size;
135
+      this.searchForm.page = 1;
136
+      this.getList();
137
+    },
138
+    // 获取列表
139
+    getList() {
140
+      let _begindate = this.searchForm.dataRange[0];
141
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
142
+      let _enddate = this.searchForm.dataRange[1];
143
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
144
+      logDeviceLogin_list({
145
+        page: this.searchForm.page,
146
+        size: this.searchForm.size,
147
+        begindate: _begindate,
148
+        enddate: _enddate,
149
+        name: this.searchForm.name,
150
+        regionid: this.userInfo.regionid
151
+      }).then((data) => {
152
+        if (data.code === 0) {
153
+          this.searchForm.list = data.obj.data;
154
+          this.searchForm.total = data.obj.total;
155
+        } else {
156
+          this.$Message.error(data.msg);
157
+        }
158
+      });
159
+    },
160
+    toExport() {}
161
+  }
11 162
 };
12 163
 </script>
13 164
 
14
-<style lang="less" scoped></style>
165
+<style lang="less" scoped>
166
+.search_header {
167
+  display: flex;
168
+  justify-content: space-between;
169
+  align-items: center;
170
+  margin: 16px 16px;
171
+  .search_left {
172
+    display: flex;
173
+    justify-content: flex-start;
174
+    align-items: center;
175
+  }
176
+}
177
+</style>

+ 159
- 4
src/views/regionSection/log/devicePush.vue Переглянути файл

@@ -1,14 +1,169 @@
1 1
 <template>
2
-  <div class="main_root">设备推送日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+          v-model="searchForm.name"
18
+          placeholder="请输入登录名、事件"
19
+          search
20
+          @on-search="searchList()"
21
+          style="width: 180px"
22
+        />
23
+      </div>
24
+    </div>
25
+    <div class="table_wrap">
26
+      <Table :columns="columns" :data="searchForm.list">
27
+        <template slot-scope="{ row }" slot="pushTypeSlot">
28
+          <!-- 1发送消息 2解除限制 3限制使用 4更新策略 5重启设备 6恢复出厂 -->
29
+          <div>{{ pushTypeInfo[row.pushType] }}</div>
30
+        </template>
31
+      </Table>
32
+    </div>
33
+    <div class="page_wrap">
34
+      <Page
35
+        :transfer="true"
36
+        :total="searchForm.total"
37
+        :current="searchForm.page"
38
+        :page-size="searchForm.size"
39
+        :page-size-opts="[10, 20, 40, 60]"
40
+        @on-change="pageChange"
41
+        @on-page-size-change="pageSizeChange"
42
+        show-total
43
+        show-sizer
44
+      ></Page>
45
+    </div>
46
+  </div>
3 47
 </template>
4 48
 
5 49
 <script>
50
+import { dateFormat, pushTypeInfo } from "@/utils";
51
+import { logPush_list } from "@/api/log";
6 52
 export default {
7 53
   data() {
8
-    return {};
54
+    return {
55
+      pushTypeInfo,
56
+      searchForm: {
57
+        dataRange: [],
58
+        name: "",
59
+        page: 1,
60
+        size: 10,
61
+        list: [],
62
+        total: 0
63
+      },
64
+      userInfo: {},
65
+      columns: [
66
+        {
67
+          title: "序号",
68
+          align: "center",
69
+          width: 70,
70
+          render: (h, params) => {
71
+            return h(
72
+              "span",
73
+              params.index +
74
+                (this.searchForm.page - 1) * this.searchForm.size +
75
+                1
76
+            );
77
+          }
78
+        },
79
+        {
80
+          title: "登录名",
81
+          key: "loginname",
82
+          align: "center"
83
+        },
84
+        {
85
+          title: "姓名",
86
+          key: "aname",
87
+          align: "center"
88
+        },
89
+        {
90
+          title: "事件",
91
+          slot: "pushTypeSlot",
92
+          align: "center"
93
+        },
94
+        {
95
+          title: "设备号码",
96
+          key: "sn",
97
+          align: "center"
98
+        },
99
+        {
100
+          title: "时间",
101
+          key: "createtime",
102
+          width: 190,
103
+          align: "center"
104
+        }
105
+      ]
106
+    };
9 107
   },
10
-  methods: {}
108
+  created() {
109
+    this.userInfo = JSON.parse(
110
+      localStorage.getItem("xh_control_userInfo")
111
+    ).content;
112
+    this.searchList();
113
+  },
114
+  methods: {
115
+    // 搜索
116
+    searchList() {
117
+      this.searchForm.page = 1;
118
+      this.getList();
119
+    },
120
+    // 页码改变
121
+    pageChange(page) {
122
+      this.searchForm.page = page;
123
+      this.getList();
124
+    },
125
+    // 每页显示数量改变
126
+    pageSizeChange(size) {
127
+      this.searchForm.size = size;
128
+      this.searchForm.page = 1;
129
+      this.getList();
130
+    },
131
+    // 获取列表
132
+    getList() {
133
+      let _begindate = this.searchForm.dataRange[0];
134
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
135
+      let _enddate = this.searchForm.dataRange[1];
136
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
137
+      logPush_list({
138
+        page: this.searchForm.page,
139
+        size: this.searchForm.size,
140
+        begindate: _begindate,
141
+        enddate: _enddate,
142
+        name: this.searchForm.name,
143
+        regionid: this.userInfo.regionid
144
+      }).then((data) => {
145
+        if (data.code === 0) {
146
+          this.searchForm.list = data.obj.data;
147
+          this.searchForm.total = data.obj.total;
148
+        } else {
149
+          this.$Message.error(data.msg);
150
+        }
151
+      });
152
+    }
153
+  }
11 154
 };
12 155
 </script>
13 156
 
14
-<style lang="less" scoped></style>
157
+<style lang="less" scoped>
158
+.search_header {
159
+  display: flex;
160
+  justify-content: space-between;
161
+  align-items: center;
162
+  margin: 16px 16px;
163
+  .search_left {
164
+    display: flex;
165
+    justify-content: flex-start;
166
+    align-items: center;
167
+  }
168
+}
169
+</style>

+ 249
- 4
src/views/regionSection/log/violatingDevice.vue Переглянути файл

@@ -1,14 +1,259 @@
1 1
 <template>
2
-  <div class="main_root">违规设备日志</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期范围"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Select
17
+          v-model="searchForm.doEvent"
18
+          :transfer="true"
19
+          style="margin-right: 10px; width: 150px"
20
+          @on-change="searchList()"
21
+        >
22
+          <Option :value="0">所有事件</Option>
23
+          <Option
24
+            v-for="(eventName, eventVal) in doEventInfo"
25
+            :value="Number(eventVal)"
26
+            :key="eventVal"
27
+            >{{ eventName }}</Option
28
+          >
29
+        </Select>
30
+        <Input
31
+          v-model="searchForm.name"
32
+          placeholder="请输入登录名、设备号"
33
+          search
34
+          @on-search="searchList()"
35
+          style="width: 180px"
36
+        />
37
+      </div>
38
+      <Button type="primary" class="primary_btn" @click="toExport()"
39
+        >导出</Button
40
+      >
41
+    </div>
42
+    <div class="table_wrap">
43
+      <Table :columns="columns" :data="searchForm.list">
44
+        <template slot-scope="{ row }" slot="doEventSlot">
45
+          <!-- 1发送消息 2解除限制 3限制使用 4更新策略 5重启设备 6恢复出厂 -->
46
+          <div>{{ doEventInfo[row.doEvent] }}</div>
47
+        </template>
48
+        <template slot-scope="{ row }" slot="noticedSlot">
49
+          <div class="action_list">
50
+            <!-- 是否通知:0否 1是 -->
51
+            <div v-if="row.noticed === 1" class="action_success">是</div>
52
+            <div v-else-if="row.noticed === 0" class="action_error">否</div>
53
+          </div>
54
+        </template>
55
+        <template slot-scope="{ row }" slot="lockedSlot">
56
+          <div class="action_list">
57
+            <!-- 是否锁定:0否 1是 -->
58
+            <div v-if="row.locked === 1" class="action_success">是</div>
59
+            <div v-else-if="row.locked === 0" class="action_error">否</div>
60
+          </div>
61
+        </template>
62
+        <template slot-scope="{ row }" slot="resetedSlot">
63
+          <div class="action_list">
64
+            <!-- 是否重置:0否 1是 -->
65
+            <div v-if="row.reseted === 1" class="action_success">是</div>
66
+            <div v-else-if="row.reseted === 0" class="action_error">否</div>
67
+          </div>
68
+        </template>
69
+        <template slot-scope="{ row }" slot="emailedSlot">
70
+          <div class="action_list">
71
+            <!-- 是否发送邮件:0否 1是 -->
72
+            <div v-if="row.emailed === 1" class="action_success">是</div>
73
+            <div v-else-if="row.emailed === 0" class="action_error">否</div>
74
+          </div>
75
+        </template>
76
+        <template slot-scope="{ row }" slot="handledSlot">
77
+          <div class="action_list">
78
+            <!-- 是否处理:0否 1是 -->
79
+            <div v-if="row.handled === 1" class="action_success">是</div>
80
+            <div v-else-if="row.handled === 0" class="action_error">否</div>
81
+          </div>
82
+        </template>
83
+      </Table>
84
+    </div>
85
+    <div class="page_wrap">
86
+      <Page
87
+        :transfer="true"
88
+        :total="searchForm.total"
89
+        :current="searchForm.page"
90
+        :page-size="searchForm.size"
91
+        :page-size-opts="[10, 20, 40, 60]"
92
+        @on-change="pageChange"
93
+        @on-page-size-change="pageSizeChange"
94
+        show-total
95
+        show-sizer
96
+      ></Page>
97
+    </div>
98
+  </div>
3 99
 </template>
4 100
 
5 101
 <script>
102
+import { dateFormat, doEventInfo } from "@/utils";
103
+import { logdoperate_list_violate } from "@/api/log";
6 104
 export default {
7 105
   data() {
8
-    return {};
106
+    return {
107
+      doEventInfo,
108
+      searchForm: {
109
+        dataRange: [],
110
+        doEvent: 0,
111
+        name: "",
112
+        page: 1,
113
+        size: 10,
114
+        list: [],
115
+        total: 0
116
+      },
117
+      userInfo: {},
118
+      columns: [
119
+        {
120
+          title: "序号",
121
+          align: "center",
122
+          width: 70,
123
+          render: (h, params) => {
124
+            return h(
125
+              "span",
126
+              params.index +
127
+                (this.searchForm.page - 1) * this.searchForm.size +
128
+                1
129
+            );
130
+          }
131
+        },
132
+        {
133
+          title: "学校名称",
134
+          key: "schoolName",
135
+          align: "center"
136
+        },
137
+        {
138
+          title: "班级",
139
+          key: "classname",
140
+          align: "center"
141
+        },
142
+        {
143
+          title: "登录名",
144
+          key: "loginname",
145
+          align: "center"
146
+        },
147
+        {
148
+          title: "姓名",
149
+          key: "username",
150
+          align: "center"
151
+        },
152
+        {
153
+          title: "设备号码",
154
+          key: "sn",
155
+          align: "center"
156
+        },
157
+        {
158
+          title: "事件",
159
+          slot: "doEventSlot",
160
+          align: "center"
161
+        },
162
+        {
163
+          title: "通知",
164
+          slot: "noticedSlot",
165
+          align: "center"
166
+        },
167
+        {
168
+          title: "锁定",
169
+          slot: "lockedSlot",
170
+          align: "center"
171
+        },
172
+        {
173
+          title: "重置",
174
+          slot: "resetedSlot",
175
+          align: "center"
176
+        },
177
+        {
178
+          title: "发邮件",
179
+          slot: "emailedSlot",
180
+          align: "center"
181
+        },
182
+        {
183
+          title: "处理结果",
184
+          slot: "handledSlot",
185
+          align: "center"
186
+        },
187
+        {
188
+          title: "时间",
189
+          key: "createtime",
190
+          width: 190,
191
+          align: "center"
192
+        }
193
+      ]
194
+    };
9 195
   },
10
-  methods: {}
196
+  created() {
197
+    this.userInfo = JSON.parse(
198
+      localStorage.getItem("xh_control_userInfo")
199
+    ).content;
200
+    this.searchList();
201
+  },
202
+  methods: {
203
+    // 搜索
204
+    searchList() {
205
+      this.searchForm.page = 1;
206
+      this.getList();
207
+    },
208
+    // 页码改变
209
+    pageChange(page) {
210
+      this.searchForm.page = page;
211
+      this.getList();
212
+    },
213
+    // 每页显示数量改变
214
+    pageSizeChange(size) {
215
+      this.searchForm.size = size;
216
+      this.searchForm.page = 1;
217
+      this.getList();
218
+    },
219
+    // 获取列表
220
+    getList() {
221
+      let _begindate = this.searchForm.dataRange[0];
222
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
223
+      let _enddate = this.searchForm.dataRange[1];
224
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
225
+      logdoperate_list_violate({
226
+        page: this.searchForm.page,
227
+        size: this.searchForm.size,
228
+        doEvent: this.searchForm.doEvent,
229
+        begindate: _begindate,
230
+        enddate: _enddate,
231
+        name: this.searchForm.name,
232
+        regionid: this.userInfo.regionid
233
+      }).then((data) => {
234
+        if (data.code === 0) {
235
+          this.searchForm.list = data.obj.data;
236
+          this.searchForm.total = data.obj.total;
237
+        } else {
238
+          this.$Message.error(data.msg);
239
+        }
240
+      });
241
+    },
242
+    toExport() {}
243
+  }
11 244
 };
12 245
 </script>
13 246
 
14
-<style lang="less" scoped></style>
247
+<style lang="less" scoped>
248
+.search_header {
249
+  display: flex;
250
+  justify-content: space-between;
251
+  align-items: center;
252
+  margin: 16px 16px;
253
+  .search_left {
254
+    display: flex;
255
+    justify-content: flex-start;
256
+    align-items: center;
257
+  }
258
+}
259
+</style>

+ 3
- 3
src/views/regionSection/networkManage/whitelist.vue Переглянути файл

@@ -319,7 +319,7 @@ export default {
319 319
         },
320 320
         {
321 321
           title: "所属区域",
322
-          key: "regionName",
322
+          key: "name",
323 323
           align: "center"
324 324
         },
325 325
         {
@@ -383,7 +383,7 @@ export default {
383 383
       //获取区域学校
384 384
       region_list_rs({
385 385
         regionid: this.userInfo.regionid,
386
-        regionName: this.whiteLibraryInfo.schoolname
386
+        name: this.whiteLibraryInfo.schoolname
387 387
       }).then((res) => {
388 388
         if (res.code === 0) {
389 389
           this.getHandleData(res.obj[0]);
@@ -394,7 +394,7 @@ export default {
394 394
       });
395 395
     },
396 396
     getHandleData(node) {
397
-      node.title = node.regionName;
397
+      node.title = node.name;
398 398
       node.expand = true;
399 399
       if (node.children && node.children.length > 0) {
400 400
         for (let child of node.children) {

+ 240
- 4
src/views/regionSection/notice/index.vue Переглянути файл

@@ -1,14 +1,250 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+            v-model="searchForm.dataRange"
7
+            @on-change="searchList()"
8
+            :editable="false"
9
+            :transfer="true"
10
+            format="yyyy-MM-dd"
11
+            type="daterange"
12
+            placement="bottom-start"
13
+            placeholder="请选择日期范围"
14
+            style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+            v-model="searchForm.title"
18
+            placeholder="请输入标题"
19
+            search
20
+            @on-search="searchList()"
21
+            style="width: 150px"
22
+        />
23
+      </div>
24
+    </div>
25
+    <div class="table_wrap">
26
+      <Table :columns="columns" :data="searchForm.list">
27
+        <template slot-scope="{ row }" slot="actionSlot">
28
+          <div class="action_list">
29
+            <div @click="toView(row)">查看</div>
30
+          </div>
31
+        </template>
32
+      </Table>
33
+    </div>
34
+    <div class="page_wrap">
35
+      <Page
36
+          :transfer="true"
37
+          :total="searchForm.total"
38
+          :current="searchForm.page"
39
+          :page-size="searchForm.size"
40
+          :page-size-opts="[10, 20, 40, 60]"
41
+          @on-change="pageChange"
42
+          @on-page-size-change="pageSizeChange"
43
+          show-total
44
+          show-sizer
45
+      ></Page>
46
+    </div>
47
+    <!-- 查看 -->
48
+    <Modal
49
+        class="modal1"
50
+        :mask-closable="false"
51
+        v-model="viewInfo.show"
52
+        title="查看"
53
+    >
54
+      <div class="notice_title">{{ viewInfo.noticeTitle }}</div>
55
+      <div class="notice_create">
56
+        <div>{{ viewInfo.createname }}</div>
57
+        <div>{{ viewInfo.updatetime }}</div>
58
+      </div>
59
+      <div class="notice_content" v-html="viewInfo.noticeContent"></div>
60
+      <div slot="footer" style="text-align: center">
61
+        <Button @click="viewInfo.show = false">关闭</Button>
62
+      </div>
63
+    </Modal>
64
+  </div>
3 65
 </template>
4 66
 
5 67
 <script>
68
+import { notice_list_region, notice_detail_region } from "@/api/notice";
69
+import { dateFormat } from "@/utils";
6 70
 export default {
7 71
   data() {
8
-    return {};
72
+    return {
73
+      searchForm: {
74
+        title: "",
75
+        page: 1,
76
+        size: 10,
77
+        dataRange: [],
78
+        list: [],
79
+        total: 0
80
+      },
81
+      // 查看信息
82
+      viewInfo: {
83
+        show: false,
84
+        noticeTitle: null,
85
+        createname: null,
86
+        updatetime: null,
87
+        noticeContent: null,
88
+        noticeType: null,
89
+        regions: []
90
+      },
91
+      userInfo: {},
92
+      columns: [
93
+        {
94
+          title: "序号",
95
+          align: "center",
96
+          width: 70,
97
+          render: (h, params) => {
98
+            return h(
99
+                "span",
100
+                params.index +
101
+                (this.searchForm.page - 1) * this.searchForm.size +
102
+                1
103
+            );
104
+          }
105
+        },
106
+        {
107
+          title: "标题",
108
+          key: "noticeTitle",
109
+          align: "center"
110
+        },
111
+        {
112
+          title: "发布人",
113
+          key: "createname",
114
+          width: 140,
115
+          align: "center"
116
+        },
117
+        {
118
+          title: "时间",
119
+          key: "updatetime",
120
+          width: 190,
121
+          align: "center"
122
+        },
123
+        {
124
+          title: "操作",
125
+          slot: "actionSlot",
126
+          width: 90,
127
+          align: "center"
128
+        }
129
+      ]
130
+    };
9 131
   },
10
-  methods: {}
132
+  created() {
133
+    this.userInfo = JSON.parse(
134
+        localStorage.getItem("xh_control_userInfo")
135
+    ).content;
136
+    this.searchList();
137
+  },
138
+  methods: {
139
+    // 搜索
140
+    searchList() {
141
+      this.searchForm.page = 1;
142
+      this.getList();
143
+    },
144
+    // 页码改变
145
+    pageChange(page) {
146
+      this.searchForm.page = page;
147
+      this.getList();
148
+    },
149
+    // 每页显示数量改变
150
+    pageSizeChange(size) {
151
+      this.searchForm.size = size;
152
+      this.searchForm.page = 1;
153
+      this.getList();
154
+    },
155
+    // 获取列表
156
+    getList() {
157
+      let _begindate = this.searchForm.dataRange[0];
158
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
159
+      let _enddate = this.searchForm.dataRange[1];
160
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
161
+      notice_list_region({
162
+        page: this.searchForm.page,
163
+        size: this.searchForm.size,
164
+        title: this.searchForm.title,
165
+        begindate: _begindate,
166
+        enddate: _enddate
167
+      }).then((data) => {
168
+        if (data.code === 0) {
169
+          this.searchForm.list = data.obj.data;
170
+          this.searchForm.total = data.obj.total;
171
+        } else {
172
+          this.$Message.error(data.msg);
173
+        }
174
+      });
175
+    },
176
+    // 查看
177
+    toView(row) {
178
+      notice_detail_region({
179
+        noticeid: row.noticeid
180
+      }).then((data) => {
181
+        if (data.code === 0) {
182
+          this.viewInfo = {
183
+            show: true,
184
+            noticeTitle: data.obj.noticeTitle,
185
+            createname: data.obj.createname,
186
+            updatetime: data.obj.updatetime,
187
+            noticeContent: data.obj.noticeContent,
188
+            noticeType: data.obj.noticeType,
189
+            regions: data.obj.noticeType === 1 ? [] : data.obj.regions
190
+          };
191
+          console.log(data.obj.noticeContent)
192
+        } else {
193
+          this.$Message.error(data.msg);
194
+        }
195
+      });
196
+    }
197
+  }
11 198
 };
12 199
 </script>
13 200
 
14
-<style lang="less" scoped></style>
201
+<style lang="less" scoped>
202
+.search_header {
203
+  display: flex;
204
+  justify-content: space-between;
205
+  align-items: center;
206
+  margin: 16px 16px;
207
+  .search_left {
208
+    display: flex;
209
+    justify-content: flex-start;
210
+    align-items: center;
211
+  }
212
+}
213
+.notice_title {
214
+  margin-bottom: 16px;
215
+  font-size: 18px;
216
+  font-weight: bold;
217
+  text-align: center;
218
+}
219
+.notice_create {
220
+  display: flex;
221
+  justify-content: center;
222
+  align-items: center;
223
+  margin-bottom: 16px;
224
+  font-size: 12px;
225
+  color: #afbcc7;
226
+  > div {
227
+    margin: 0 10px;
228
+  }
229
+}
230
+.notice_content {
231
+  font-size: 16px;
232
+  /deep/ img{
233
+    width: 100%;
234
+  }
235
+}
236
+.notice_regions {
237
+  display: flex;
238
+  justify-content: flex-start;
239
+  align-items: center;
240
+  flex-wrap: wrap;
241
+  margin-top: 16px;
242
+  padding: 10px 16px;
243
+  font-size: 14px;
244
+  border-radius: 8px;
245
+  background: #f0f6fc;
246
+  > div {
247
+    margin: 10px 16px;
248
+  }
249
+}
250
+</style>

+ 14
- 15
src/views/regionSection/regionManage/regionManage.vue Переглянути файл

@@ -68,7 +68,7 @@
68 68
         </FormItem>
69 69
         <FormItem
70 70
           label="登录账号"
71
-          prop="loginname"
71
+          prop="admin.loginname"
72 72
           style="width: calc(50% - 10px)"
73 73
         >
74 74
           <Input
@@ -76,7 +76,11 @@
76 76
             placeholder="请输入登录账号"
77 77
           ></Input>
78 78
         </FormItem>
79
-        <FormItem label="密码" prop="loginpwd" style="width: calc(50% - 10px)">
79
+        <FormItem
80
+          label="密码"
81
+          prop="admin.loginpwd"
82
+          style="width: calc(50% - 10px)"
83
+        >
80 84
           <Input
81 85
             v-model="regionInfo.admin.loginpwd"
82 86
             placeholder="请输入密码"
@@ -84,7 +88,7 @@
84 88
         </FormItem>
85 89
         <FormItem
86 90
           label="确认密码"
87
-          prop="loginpwd1"
91
+          prop="admin.loginpwd1"
88 92
           style="width: calc(50% - 10px)"
89 93
         >
90 94
           <Input
@@ -92,7 +96,7 @@
92 96
             placeholder="请输入确认密码"
93 97
           ></Input>
94 98
         </FormItem>
95
-        <FormItem label="手机号码" prop="phone" style="width: calc(50% - 10px)">
99
+        <FormItem label="手机号码" style="width: calc(50% - 10px)">
96 100
           <Input
97 101
             v-model="regionInfo.admin.phone"
98 102
             placeholder="请输入手机号码"
@@ -195,21 +199,16 @@ export default {
195 199
     // 密码验证
196 200
     const pwdCheck = (rule, value, callback) => {
197 201
       if (!reg.test(this.regionInfo.admin.loginpwd)) {
198
-        new Error("密码格式不正确!");
199
-      } else {
200
-        callback();
202
+        return callback(new Error("密码格式不正确!"));
201 203
       }
202 204
     };
203 205
     // 重复密码验证
204 206
     const pwdAgainCheck = async (rule, value, callback) => {
205 207
       if (!reg.test(this.regionInfo.admin.loginpwd1)) {
206
-        new Error("密码格式不正确!");
207
-      } else if (
208
-        this.regionInfo.admin.loginpwd != this.regionInfo.admin.loginpwd1
209
-      ) {
208
+        return callback(new Error("密码格式不正确!"));
209
+      }
210
+      if (this.regionInfo.admin.loginpwd != this.regionInfo.admin.loginpwd1) {
210 211
         return callback(new Error("两次输入密码不一致!"));
211
-      } else {
212
-        callback();
213 212
       }
214 213
     };
215 214
     return {
@@ -294,14 +293,14 @@ export default {
294 293
             trigger: "blur"
295 294
           }
296 295
         ],
297
-        loginpwd: [
296
+        "admin.loginpwd": [
298 297
           {
299 298
             required: true,
300 299
             validator: pwdCheck,
301 300
             trigger: "blur"
302 301
           }
303 302
         ],
304
-        loginpwd1: [
303
+        "admin.loginpwd1": [
305 304
           {
306 305
             required: true,
307 306
             validator: pwdAgainCheck,

+ 3
- 3
src/views/regionSection/regionManage/schoolManage.vue Переглянути файл

@@ -314,7 +314,7 @@
314 314
 </template>
315 315
 
316 316
 <script>
317
-import { region_list_sel_pt } from "@/api/region";
317
+import { region_list_sel_pt, region_list_sel_qy } from "@/api/region";
318 318
 import { login_msg_code } from "@/api/login";
319 319
 import { generateRandomString } from "@/utils";
320 320
 import {
@@ -559,7 +559,7 @@ export default {
559 559
     },
560 560
     // 获取搜索区域列表
561 561
     getSearchRegionList() {
562
-      region_list_sel_pt({}).then((data) => {
562
+      region_list_sel_qy({ regionid: this.userInfo.regionid }).then((data) => {
563 563
         if (data.code === 0) {
564 564
           this.searchForm.dropList = data.obj;
565 565
         } else {
@@ -588,7 +588,7 @@ export default {
588 588
       school_list({
589 589
         page: this.searchForm.page,
590 590
         size: this.searchForm.size,
591
-        areaCode: obj && obj.areaCode?obj.areaCode:this.searchForm.areaCode,
591
+        areaCode: obj && obj.areaCode ? obj.areaCode : this.searchForm.areaCode,
592 592
         schoolName: this.searchForm.schoolName,
593 593
         regionid: this.searchForm.regionid
594 594
       }).then((data) => {

+ 18
- 14
src/views/regionSection/search/allUsers.vue Переглянути файл

@@ -2,12 +2,12 @@
2 2
   <div class="main_root">
3 3
     <div class="search_header">
4 4
       <Input
5
-        v-model="searchForm.regionName"
5
+        v-model="searchForm.name"
6 6
         placeholder="请输入学生姓名、账号"
7 7
         style="width: 200px"
8 8
       />
9 9
       <Input
10
-        v-model="searchForm.regionName"
10
+        v-model="searchForm.title"
11 11
         placeholder="请输入学校名称"
12 12
         style="width: 150px; margin: 0 10px"
13 13
       />
@@ -16,7 +16,9 @@
16 16
       </Button>
17 17
     </div>
18 18
     <div class="table_wrap">
19
-      <Table :columns="columns" :data="searchForm.list"> </Table>
19
+      <Table :columns="columns" :data="searchForm.list">
20
+
21
+      </Table>
20 22
     </div>
21 23
     <div class="page_wrap">
22 24
       <Page
@@ -35,12 +37,13 @@
35 37
 </template>
36 38
 
37 39
 <script>
38
-import { region_list_qy } from "@/api/region";
40
+import {region_list_qy, search_list_user} from "@/api/region";
39 41
 export default {
40 42
   data() {
41 43
     return {
42 44
       searchForm: {
43
-        regionName: "",
45
+        title: "",
46
+        name: "",
44 47
         page: 1,
45 48
         size: 10,
46 49
         list: [],
@@ -62,36 +65,36 @@ export default {
62 65
         },
63 66
         {
64 67
           title: "登录名",
65
-          key: "regionName",
68
+          key: "loginname",
66 69
           align: "center"
67 70
         },
68 71
         {
69 72
           title: "学生姓名",
70
-          key: "createname",
73
+          key: "username",
71 74
           width: 140,
72 75
           align: "center"
73 76
         },
74 77
         {
75 78
           title: "状态",
76
-          key: "createtime",
79
+          slot: "enabled",
77 80
           width: 190,
78 81
           align: "center"
79 82
         },
80 83
         {
81 84
           title: "学校名称",
82
-          key: "updatename",
85
+          key: "schoolName",
83 86
           width: 140,
84 87
           align: "center"
85 88
         },
86 89
         {
87 90
           title: "创建时间",
88
-          key: "updatetime",
91
+          key: "createtime",
89 92
           width: 190,
90 93
           align: "center"
91 94
         },
92 95
         {
93 96
           title: "最后登录时间",
94
-          slot: "actionSlot",
97
+          key: "createtime",
95 98
           width: 220,
96 99
           align: "center"
97 100
         }
@@ -120,14 +123,15 @@ export default {
120 123
     },
121 124
     // 获取列表
122 125
     getList() {
123
-      return;
124
-      region_list_qy({
126
+      search_list_user({
125 127
         page: this.searchForm.page,
126 128
         size: this.searchForm.size,
127
-        regionName: this.searchForm.regionName
129
+        name: this.searchForm.name,
130
+        title: this.searchForm.title,
128 131
       }).then((data) => {
129 132
         if (data.code === 0) {
130 133
           this.searchForm.list = data.obj.data;
134
+          console.log(this.searchForm.list)
131 135
           this.searchForm.total = data.obj.total;
132 136
         } else {
133 137
           this.$Message.error(data.msg);

+ 0
- 14
src/views/regionSection/setting/allApps.vue Переглянути файл

@@ -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>

+ 77
- 4
src/views/regionSection/setting/device.vue Переглянути файл

@@ -9,13 +9,16 @@
9 9
     <div class="content">
10 10
       <Form ref="addForm" :model="adminInfo" :label-width="100" inline>
11 11
         <FormItem label="动态密码" style="width: 100%">
12
-          <RadioGroup v-model="adminInfo.whited">
12
+          <RadioGroup v-model="adminInfo.trend">
13 13
             <Radio :label="1">是</Radio>
14 14
             <Radio :label="0">否</Radio>
15 15
           </RadioGroup>
16 16
         </FormItem>
17 17
         <FormItem label="管理密码" style="width: 100%">
18
-          <Input v-model="adminInfo.name" placeholder="请输入管理密码"></Input>
18
+          <Input
19
+            v-model="adminInfo.password"
20
+            placeholder="请输入管理密码"
21
+          ></Input>
19 22
         </FormItem>
20 23
       </Form>
21 24
     </div>
@@ -25,17 +28,78 @@
25 28
         >保存</Button
26 29
       >
27 30
     </div>
31
+    <Spin fix v-if="showLoading" style="background-color: transparent">
32
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
33
+      <div>加载中</div>
34
+    </Spin>
28 35
   </div>
29 36
 </template>
30 37
 
31 38
 <script>
39
+import {
40
+  password_detail,
41
+  password_edit
42
+} from "@/api/setting";
43
+
32 44
 export default {
33 45
   data() {
34 46
     return {
35
-      adminInfo: {}
47
+      adminInfo: {
48
+        trend: 1,
49
+        password: ""
50
+      },
51
+      userInfo: {},
52
+      showLoading: false
36 53
     };
37 54
   },
38
-  methods: {}
55
+  created() {
56
+    this.userInfo = JSON.parse(
57
+      localStorage.getItem("xh_control_userInfo")
58
+    ).content;
59
+    this.init();
60
+  },
61
+  methods: {
62
+    init() {
63
+      password_detail({}).then((res) => {
64
+        this.showLoading = false;
65
+        if (res.code === 0) {
66
+          if (res.obj) {
67
+            this.adminInfo = {
68
+              trend: res.obj.trend,
69
+              password: res.obj.password
70
+            };
71
+          }
72
+        } else {
73
+          this.$Message.error(res.msg);
74
+        }
75
+      });
76
+    },
77
+    //刷新页面
78
+    Refresh() {
79
+      location.reload();
80
+    },
81
+    saveInfo() {
82
+      if (!this.adminInfo.password) {
83
+        this.$Message.error("请输入管理密码!");
84
+        return;
85
+      }
86
+      let form = {
87
+        trend: this.adminInfo.trend,
88
+        password: this.adminInfo.password
89
+      };
90
+      console.log(form);
91
+      this.showLoading = true;
92
+      password_edit(form).then((res) => {
93
+        this.showLoading = false;
94
+        if (res.code === 0) {
95
+          console.log(res.obj);
96
+          this.$Message.success(res.msg);
97
+        } else {
98
+          this.$Message.error(res.msg);
99
+        }
100
+      });
101
+    }
102
+  }
39 103
 };
40 104
 </script>
41 105
 
@@ -55,6 +119,15 @@ export default {
55 119
       padding-left: 20px;
56 120
       height: 40px;
57 121
       line-height: 40px;
122
+      &::before {
123
+        content: "*" !important;
124
+        display: inline-block;
125
+        margin-right: 4px;
126
+        line-height: 1;
127
+        font-family: SimSun;
128
+        font-size: 14px;
129
+        color: #ed4014;
130
+      }
58 131
     }
59 132
   }
60 133
   .content {

+ 117
- 7
src/views/regionSection/setting/logo.vue Переглянути файл

@@ -8,7 +8,8 @@
8 8
     <div class="content">
9 9
       <div class="header">
10 10
         <div class="LOGO">
11
-          <img src="../../../assets/img/setting/LOGO.png" />
11
+          <img v-if="form.logoPath" :src="$api.showImageUrl + form.logoPath" />
12
+          <img v-else src="../../../assets/img/setting/LOGO.png" />
12 13
         </div>
13 14
       </div>
14 15
       <div class="navigation">
@@ -73,14 +74,114 @@
73 74
 </template>
74 75
 
75 76
 <script>
77
+import axios from "axios";
78
+import { logo_delete, logo_detail, logo_edit } from "@/api/setting";
76 79
 export default {
77 80
   data() {
78
-    return {};
81
+    return {
82
+      userInfo: {},
83
+      form: {
84
+        logoPath: "",
85
+        rversion: "",
86
+        objectid: "",
87
+        logoid: ""
88
+      }
89
+    };
90
+  },
91
+  created() {
92
+    this.userInfo = JSON.parse(
93
+      localStorage.getItem("xh_control_userInfo")
94
+    ).content;
95
+    this.init();
79 96
   },
80 97
   methods: {
81
-    upLoad() {},
82
-    resetting() {},
83
-    saveInfo() {},
98
+    init() {
99
+      logo_detail({ objectid: this.userInfo.regionid, llevel: 2 }).then(
100
+        (res) => {
101
+          this.showLoading = false;
102
+          if (res.code === 0) {
103
+            if (res.obj) {
104
+              this.form = {
105
+                logoPath: res.obj.logoPath,
106
+                rversion: res.obj.rversion,
107
+                objectid: res.obj.objectid,
108
+                logoid: res.obj.logoid
109
+              };
110
+            }
111
+          } else {
112
+            this.$Message.error(res.msg);
113
+          }
114
+        }
115
+      );
116
+    },
117
+    upLoad(file) {
118
+      let str = file.name.split(".");
119
+      let suffix = str[str.length - 1];
120
+      suffix = suffix.toLowerCase();
121
+      if (suffix !== "png" && suffix !== "jpeg" && suffix !== "jpg") {
122
+        this.$Message.warning("请上传png、jpeg、jpg类型的文件");
123
+        return false;
124
+      }
125
+      let formData = new FormData();
126
+      formData.append("file", file);
127
+      formData.append("savefolder", "app");
128
+      formData.append("isrename", "1");
129
+      let Url = this.$api.baseImageUrl + "up/upfile";
130
+      this.showLoading = true;
131
+      axios
132
+        .post(Url, formData, {
133
+          timeout: 1000 * this.$api.axiosFileTimeout
134
+        })
135
+        .then((res) => {
136
+          this.showLoading = false;
137
+          if (res.data.code === 0) {
138
+            console.log(res.data);
139
+            this.form.logoPath = res.data.obj;
140
+            this.$Message.success(res.data.msg);
141
+          } else {
142
+            this.$Message.error(res.data.msg);
143
+          }
144
+        })
145
+        .catch(() => {
146
+          this.showLoading = false;
147
+          this.$Message.error("图片上传失败");
148
+        });
149
+    },
150
+    //重置
151
+    resetting() {
152
+      this.showLoading = true;
153
+      logo_delete({
154
+        rversion: this.form.rversion,
155
+        logoid: this.form.logoid
156
+      }).then((res) => {
157
+        this.showLoading = false;
158
+        if (res.code === 0) {
159
+          this.form.logoPath = "";
160
+          console.log(res.obj);
161
+          this.$Message.success(res.msg);
162
+        } else {
163
+          this.$Message.error(res.msg);
164
+        }
165
+      });
166
+    },
167
+    saveInfo() {
168
+      let form = {
169
+        logoPath: this.form.logoPath,
170
+        llevel: 2,
171
+        objectid: this.userInfo.regionid
172
+      };
173
+      console.log(form);
174
+      this.showLoading = true;
175
+      logo_edit(form).then((res) => {
176
+        this.showLoading = false;
177
+        if (res.code === 0) {
178
+          console.log(res.obj);
179
+          this.$Message.success(res.msg);
180
+        } else {
181
+          this.$Message.error(res.msg);
182
+        }
183
+      });
184
+    },
84 185
     //刷新页面
85 186
     Refresh() {
86 187
       location.reload();
@@ -91,13 +192,22 @@ export default {
91 192
 
92 193
 <style lang="less" scoped>
93 194
 .main_root {
94
-  padding: 40px 100px 100px;
195
+  padding: 40px 100px 40px;
95 196
   position: relative;
96 197
   .comm {
97 198
     height: 40px;
98 199
     line-height: 40px;
99 200
     font-size: 16px;
100 201
     color: #253a70;
202
+    &::before {
203
+      content: "*" !important;
204
+      display: inline-block;
205
+      margin-right: 4px;
206
+      line-height: 1;
207
+      font-family: SimSun;
208
+      font-size: 14px;
209
+      color: #ed4014;
210
+    }
101 211
   }
102 212
   .content {
103 213
     margin-top: 10px;
@@ -162,7 +272,7 @@ export default {
162 272
   }
163 273
   .footer {
164 274
     position: absolute;
165
-    bottom: 100px;
275
+    bottom: 40px;
166 276
     width: 100%;
167 277
     height: 32px;
168 278
     text-align: center;

+ 86
- 8
src/views/regionSection/setting/powerUp.vue Переглянути файл

@@ -8,19 +8,21 @@
8 8
       <Form ref="addForm" :model="adminInfo" :label-width="140" inline>
9 9
         <FormItem label="开机启动应用包名" style="width: 100%">
10 10
           <Input
11
-            v-model="adminInfo.name"
11
+            v-model="adminInfo.appPackage"
12 12
             placeholder="请输入开机启动应用包名"
13 13
           ></Input>
14 14
         </FormItem>
15 15
         <FormItem label="页面地址" style="width: 100%">
16
-          <Input v-model="adminInfo.name" placeholder="请输入页面地址"></Input>
16
+          <Input
17
+            v-model="adminInfo.authUrl"
18
+            placeholder="请输入页面地址"
19
+          ></Input>
17 20
         </FormItem>
18 21
         <FormItem label="约定标识" style="width: 100%">
19
-          <RadioGroup v-model="adminInfo.whited">
22
+          <RadioGroup v-model="adminInfo.singleType">
20 23
             <Radio :label="1">账号</Radio>
21
-            <Radio :label="0">学号</Radio>
22
-            <Radio :label="1">手机号码</Radio>
23
-            <Radio :label="0">身份证号码</Radio>
24
+            <Radio :label="2">手机号码</Radio>
25
+            <Radio :label="3">身份证号码</Radio>
24 26
           </RadioGroup>
25 27
         </FormItem>
26 28
       </Form>
@@ -31,17 +33,84 @@
31 33
         >保存</Button
32 34
       >
33 35
     </div>
36
+    <Spin fix v-if="showLoading" style="background-color: transparent">
37
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
38
+      <div>加载中</div>
39
+    </Spin>
34 40
   </div>
35 41
 </template>
36 42
 
37 43
 <script>
44
+import {
45
+  autoapp_detail,
46
+  autoapp_edit
47
+} from "@/api/setting";
48
+
38 49
 export default {
39 50
   data() {
40 51
     return {
41
-      adminInfo: {}
52
+      adminInfo: {
53
+        regionid: "",
54
+        appPackage: "",
55
+        authUrl: "",
56
+        singleType: 1
57
+      },
58
+      userInfo: {},
59
+      showLoading: false
42 60
     };
43 61
   },
44
-  methods: {}
62
+  created() {
63
+    this.userInfo = JSON.parse(
64
+      localStorage.getItem("xh_control_userInfo")
65
+    ).content;
66
+    this.init();
67
+  },
68
+  methods: {
69
+    init() {
70
+      autoapp_detail({ regionid: this.userInfo.regionid }).then((res) => {
71
+        this.showLoading = false;
72
+        if (res.code === 0) {
73
+          if (res.obj) {
74
+            console.log(res.obj);
75
+            this.adminInfo = {
76
+              appPackage: res.obj.appPackage,
77
+              authUrl: res.obj.authUrl,
78
+              singleType: res.obj.singleType
79
+            };
80
+          }
81
+        } else {
82
+          this.$Message.error(res.msg);
83
+        }
84
+      });
85
+    },
86
+    //刷新页面
87
+    Refresh() {
88
+      location.reload();
89
+    },
90
+    saveInfo() {
91
+      if (!this.adminInfo.password) {
92
+        this.$Message.error("请输入管理密码!");
93
+        return;
94
+      }
95
+      let form = {
96
+        regionid: this.userInfo.regionid,
97
+        appPackage: this.adminInfo.appPackage,
98
+        authUrl: this.adminInfo.authUrl,
99
+        singleType: this.adminInfo.singleType
100
+      };
101
+      console.log(form);
102
+      this.showLoading = true;
103
+      autoapp_edit(form).then((res) => {
104
+        this.showLoading = false;
105
+        if (res.code === 0) {
106
+          console.log(res.obj);
107
+          this.$Message.success(res.msg);
108
+        } else {
109
+          this.$Message.error(res.msg);
110
+        }
111
+      });
112
+    }
113
+  }
45 114
 };
46 115
 </script>
47 116
 
@@ -61,6 +130,15 @@ export default {
61 130
       padding-left: 20px;
62 131
       height: 40px;
63 132
       line-height: 40px;
133
+      &::before {
134
+        content: "*" !important;
135
+        display: inline-block;
136
+        margin-right: 4px;
137
+        line-height: 1;
138
+        font-family: SimSun;
139
+        font-size: 14px;
140
+        color: #ed4014;
141
+      }
64 142
     }
65 143
   }
66 144
   .content {

+ 305
- 118
src/views/regionSection/setting/wallpaper.vue Переглянути файл

@@ -2,16 +2,27 @@
2 2
   <div class="main_root">
3 3
     <div class="search_header">
4 4
       <Input
5
-        v-model="searchForm.regionName"
5
+        v-model="searchForm.name"
6 6
         placeholder="请输入壁纸名称"
7 7
         search
8 8
         @on-search="searchList()"
9 9
         style="width: 150px"
10 10
       />
11
-      <Button type="primary" class="primary_btn" @click="toAdd()">新建</Button>
11
+      <Button
12
+        v-if="searchForm.list.length === 0"
13
+        type="primary"
14
+        class="primary_btn"
15
+        @click="toAdd()"
16
+        >新建</Button
17
+      >
12 18
     </div>
13 19
     <div class="table_wrap">
14 20
       <Table :columns="columns" :data="searchForm.list">
21
+        <template slot-scope="{ row }" slot="hpath">
22
+          <div class="hpath">
23
+            <img v-if="row.hpath" :src="$api.showImageUrl + row.hpath" />
24
+          </div>
25
+        </template>
15 26
         <template slot-scope="{ row }" slot="actionSlot">
16 27
           <div class="action_list">
17 28
             <div @click="toView(row)">查看</div>
@@ -39,7 +50,7 @@
39 50
       class="modal1"
40 51
       :mask-closable="false"
41 52
       v-model="wallpaperInfo.show"
42
-      :title="wallpaperInfo.id ? '编辑' : '新建'"
53
+      :title="wallpaperInfo.wallpaperid ? '编辑' : '新建'"
43 54
     >
44 55
       <Form
45 56
         v-if="wallpaperInfo.show"
@@ -49,13 +60,13 @@
49 60
         :label-width="100"
50 61
         inline
51 62
       >
52
-        <FormItem label="名称" prop="Name" style="width: 100%">
63
+        <FormItem label="名称" prop="wname" style="width: 100%">
53 64
           <Input
54
-            v-model="wallpaperInfo.name"
65
+            v-model="wallpaperInfo.wname"
55 66
             placeholder="请输入壁纸名称"
56 67
           ></Input>
57 68
         </FormItem>
58
-        <FormItem label="壁纸" prop="img" style="width: 100%">
69
+        <FormItem label="壁纸" style="width: 100%">
59 70
           <div class="up">
60 71
             <Upload
61 72
               class="Upload"
@@ -67,14 +78,26 @@
67 78
                   return false;
68 79
                 }
69 80
               "
70
-              accept=".png,.jpeg,.jpg,gif"
81
+              accept=".png,.jpeg,.jpg,.gif"
71 82
             >
72
-              <div class="icon">横屏壁纸</div>
83
+              <div v-if="!wallpaperInfo.hpath" class="icon">横屏壁纸</div>
84
+              <div v-else class="hpath">
85
+                <img :src="$api.showImageUrl + wallpaperInfo.hpath" />
86
+              </div>
73 87
             </Upload>
74 88
             <span>支持图片格式:jpg、jgeg、gif、png</span>
75 89
           </div>
76 90
         </FormItem>
77
-        <FormItem label="适配类型" style="width: 100%"> </FormItem>
91
+        <FormItem label="适配类型" class="require" style="width: 100%">
92
+          <div v-for="item in device_list" :key="item.dgroupid">
93
+            <CheckboxDevice
94
+              @CheckboxDevice="CheckboxDevice"
95
+              :dgroupid="item.dgroupid"
96
+              ref="checkbevice"
97
+              :module="item"
98
+            ></CheckboxDevice>
99
+          </div>
100
+        </FormItem>
78 101
       </Form>
79 102
       <div slot="footer">
80 103
         <div>
@@ -87,39 +110,66 @@
87 110
     </Modal>
88 111
     <!-- 查看 -->
89 112
     <Modal
90
-      class="modal1"
113
+      class="modal1 view"
91 114
       :mask-closable="false"
92 115
       v-model="viewInfo.show"
93 116
       title="查看"
94 117
     >
95
-      <div class="view_title">{{ viewInfo.regionName }}</div>
96
-      <Table
97
-        style="border: 1px solid #e8eaec; border-bottom: none"
98
-        :columns="viewInfo.columns"
99
-        :data="viewInfo.list"
100
-      ></Table>
118
+      <div class="view_titles">{{ viewInfo.wname }}</div>
119
+      <div class="view_content">
120
+        <div class="view_title">壁纸效果</div>
121
+        <div class="hpath">
122
+          <img v-if="viewInfo.hpat" :src="$api.showImageUrl + viewInfo.hpath" />
123
+        </div>
124
+      </div>
125
+      <div class="view_content" style="margin-top: 20px">
126
+        <div class="view_title">适配类型</div>
127
+        <div class="view_devices">
128
+          <div
129
+            class="view_list"
130
+            v-for="item in viewInfo.devices"
131
+            :key="item.dgroupid"
132
+          >
133
+            <div class="dgname">{{ item.dgname }}</div>
134
+            <div class="devices">
135
+              <span v-for="sitem in item.devices" :key="sitem.deviceid">{{
136
+                sitem.deviceModel
137
+              }}</span>
138
+            </div>
139
+          </div>
140
+        </div>
141
+      </div>
101 142
       <div slot="footer" style="text-align: center">
102 143
         <Button @click="viewInfo.show = false">关闭</Button>
103 144
       </div>
104 145
     </Modal>
146
+    <Spin fix v-if="showLoading" style="background-color: transparent">
147
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
148
+      <div>加载中</div>
149
+    </Spin>
105 150
   </div>
106 151
 </template>
107 152
 
108 153
 <script>
109
-import { generateRandomString } from "@/utils";
154
+import axios from "axios";
155
+import CheckboxDevice from "@/components/Checkbox/CheckboxDevice";
110 156
 import {
111
-  region_list_admin,
112
-  region_delete,
113
-  region_add,
114
-  region_edit,
115
-  region_list_qy
116
-} from "@/api/region";
117
-import { login_msg_code } from "@/api/login";
157
+  wallpaper_add,
158
+  wallpaper_delete,
159
+  wallpaper_detail,
160
+  wallpaper_edit,
161
+  wallpaper_list
162
+} from "@/api/setting";
163
+import { device_list } from "@/api/appgroup";
118 164
 export default {
165
+  components: {
166
+    CheckboxDevice
167
+  },
119 168
   data() {
120 169
     return {
170
+      showLoading: false,
121 171
       searchForm: {
122
-        regionName: "",
172
+        name: "",
123 173
         page: 1,
124 174
         size: 10,
125 175
         list: [],
@@ -127,16 +177,19 @@ export default {
127 177
       },
128 178
       // 新建
129 179
       wallpaperInfo: {
130
-        show: true,
180
+        show: false,
131 181
         id: null,
132
-        name: "",
133
-        img: ""
182
+        wname: "",
183
+        hpath: "",
184
+        wlevel: "",
185
+        objectid: "",
186
+        deviceids: []
134 187
       },
135 188
       // 编辑
136 189
       modifyRegion: {
137 190
         show: false,
138 191
         regionid: null,
139
-        regionName: "",
192
+        name: "",
140 193
         regionCode: "",
141 194
         comm: "",
142 195
         rversion: null
@@ -144,34 +197,10 @@ export default {
144 197
       // 查看
145 198
       viewInfo: {
146 199
         show: false,
147
-        regionName: "",
148
-        list: [],
149
-        columns: [
150
-          {
151
-            title: "序号",
152
-            type: "index",
153
-            width: 70,
154
-            align: "center"
155
-          },
156
-          {
157
-            title: "名称",
158
-            key: "aname",
159
-            align: "center"
160
-          },
161
-          {
162
-            title: "账号",
163
-            key: "loginname",
164
-            align: "center"
165
-          },
166
-          {
167
-            title: "手机号码",
168
-            key: "phone",
169
-            align: "center"
170
-          }
171
-        ]
200
+        name: ""
172 201
       },
173 202
       rules: {
174
-        regionName: [
203
+        wname: [
175 204
           {
176 205
             required: true,
177 206
             message: "请输入区域名称",
@@ -179,6 +208,9 @@ export default {
179 208
           }
180 209
         ]
181 210
       },
211
+      userInfo: {},
212
+      device_list: [],
213
+      deviceids: {}, //设备类型
182 214
       columns: [
183 215
         {
184 216
           title: "序号",
@@ -195,17 +227,17 @@ export default {
195 227
         },
196 228
         {
197 229
           title: "横屏壁纸",
198
-          key: "regionName",
230
+          slot: "hpath",
199 231
           align: "center"
200 232
         },
201 233
         {
202 234
           title: "壁纸名称",
203
-          key: "createname",
235
+          key: "wname",
204 236
           align: "center"
205 237
         },
206 238
         {
207 239
           title: "操作人",
208
-          key: "createtime",
240
+          key: "updatename",
209 241
           align: "center"
210 242
         },
211 243
         {
@@ -224,10 +256,60 @@ export default {
224 256
     };
225 257
   },
226 258
   created() {
227
-    // this.searchList();
259
+    this.userInfo = JSON.parse(
260
+      localStorage.getItem("xh_control_userInfo")
261
+    ).content;
262
+    this.init();
263
+    this.searchList();
228 264
   },
229 265
   methods: {
230
-    upLoad() {},
266
+    CheckboxDevice(dgroupid, val) {
267
+      this.deviceids[dgroupid] = val;
268
+    },
269
+    init() {
270
+      //获取分组下设备
271
+      this.showLoading = true;
272
+      device_list({}).then((res) => {
273
+        this.showLoading = false;
274
+        if (res.code === 0) {
275
+          this.device_list = res.obj;
276
+        } else {
277
+          this.$Message.error(res.msg);
278
+        }
279
+      });
280
+    },
281
+    upLoad(file) {
282
+      let str = file.name.split(".");
283
+      let suffix = str[str.length - 1];
284
+      suffix = suffix.toLowerCase();
285
+      if (suffix !== "png" && suffix !== "jpeg" && suffix !== "jpg") {
286
+        this.$Message.warning("请上传png、jpeg、jpg类型的文件");
287
+        return false;
288
+      }
289
+      let formData = new FormData();
290
+      formData.append("file", file);
291
+      formData.append("savefolder", "app");
292
+      formData.append("isrename", "1");
293
+      let Url = this.$api.baseImageUrl + "up/upfile";
294
+      this.showLoading = true;
295
+      axios
296
+        .post(Url, formData, {
297
+          timeout: 1000 * this.$api.axiosFileTimeout
298
+        })
299
+        .then((res) => {
300
+          this.showLoading = false;
301
+          if (res.data.code === 0) {
302
+            this.wallpaperInfo.hpath = res.data.obj;
303
+            this.$Message.success(res.data.msg);
304
+          } else {
305
+            this.$Message.error(res.data.msg);
306
+          }
307
+        })
308
+        .catch(() => {
309
+          this.showLoading = false;
310
+          this.$Message.error("图片上传失败");
311
+        });
312
+    },
231 313
     // 搜索
232 314
     searchList() {
233 315
       this.searchForm.page = 1;
@@ -246,11 +328,14 @@ export default {
246 328
     },
247 329
     // 获取列表
248 330
     getList() {
249
-      region_list_qy({
331
+      this.showLoading = true;
332
+      wallpaper_list({
250 333
         page: this.searchForm.page,
251 334
         size: this.searchForm.size,
252
-        regionName: this.searchForm.regionName
335
+        name: this.searchForm.name,
336
+        regionid: this.userInfo.regionid
253 337
       }).then((data) => {
338
+        this.showLoading = false;
254 339
         if (data.code === 0) {
255 340
           this.searchForm.list = data.obj.data;
256 341
           this.searchForm.total = data.obj.total;
@@ -261,57 +346,55 @@ export default {
261 346
     },
262 347
     // 新建
263 348
     toAdd() {
264
-      this.$refs.addForm.resetFields();
265 349
       this.wallpaperInfo = {
266 350
         show: true,
267
-        // 验证码计时
268
-        timer: null,
269
-        name:"",
270
-        img:""
351
+        id: null,
352
+        wname: "",
353
+        hpath: "",
354
+        wlevel: "",
355
+        objectid: "",
356
+        deviceids: []
271 357
       };
272
-
273 358
     },
274 359
     // 保存新建
275 360
     saveAddInfo() {
276 361
       this.$refs.addForm.validate((valid) => {
277 362
         if (valid) {
278
-          this.wallpaperInfo.show = false;
279
-          region_add({
280
-            regionName: this.wallpaperInfo.regionName,
281
-            regionCode: this.wallpaperInfo.regionCode,
282
-            admin: {
283
-              aname: this.wallpaperInfo.admin.aname,
284
-              loginname: this.wallpaperInfo.admin.loginname,
285
-              loginpwd: this.wallpaperInfo.admin.loginpwd,
286
-              phone: this.wallpaperInfo.admin.phone,
287
-              msgcode: this.wallpaperInfo.admin.msgcode,
288
-              address: this.wallpaperInfo.admin.address,
289
-              comm: this.wallpaperInfo.admin.comm
363
+          //获取选中设备
364
+          let deviceids = [];
365
+          for (let key in this.deviceids) {
366
+            for (let deviceid of this.deviceids[key]) {
367
+              deviceids.push(deviceid);
290 368
             }
291
-          }).then((data) => {
292
-            if (data.code === 0) {
293
-              this.searchList();
294
-              this.$Message.success(data.msg);
295
-            } else {
296
-              this.$Message.error(data.msg);
297
-            }
298
-          });
299
-        }
300
-      });
301
-    },
302
-    // 保存编辑
303
-    saveModifyInfo() {
304
-      this.$refs.modifyForm.validate((valid) => {
305
-        if (valid) {
306
-          this.wallpaperInfo.show = false;
307
-          region_edit({
308
-            regionName: this.modifyRegion.regionName,
309
-            regionCode: this.modifyRegion.regionCode,
310
-            comm: this.modifyRegion.comm,
311
-            regionid: this.modifyRegion.regionid,
312
-            rversion: this.modifyRegion.rversion
313
-          }).then((data) => {
369
+          }
370
+          if (deviceids.length === 0) {
371
+            this.$Message.error("请选择设备!");
372
+            return;
373
+          }
374
+          if (!this.wallpaperInfo.hpath) {
375
+            this.$Message.error("请上传横屏壁纸!");
376
+            return;
377
+          }
378
+          let api = this.wallpaperInfo.wallpaperid
379
+            ? wallpaper_edit
380
+            : wallpaper_add;
381
+          let form = {
382
+            wname: this.wallpaperInfo.wname,
383
+            hpath: this.wallpaperInfo.hpath,
384
+            wlevel: 2,
385
+            objectid: this.userInfo.regionid,
386
+            deviceids
387
+          };
388
+          if (this.wallpaperInfo.wallpaperid) {
389
+            //编辑
390
+            form.rversion = this.wallpaperInfo.rversion;
391
+            form.wallpaperid = this.wallpaperInfo.wallpaperid;
392
+          }
393
+          this.showLoading = true;
394
+          api(form).then((data) => {
395
+            this.showLoading = false;
314 396
             if (data.code === 0) {
397
+              this.wallpaperInfo.show = false;
315 398
               this.searchList();
316 399
               this.$Message.success(data.msg);
317 400
             } else {
@@ -323,13 +406,18 @@ export default {
323 406
     },
324 407
     // 查看
325 408
     toView(row) {
326
-      region_list_admin({
327
-        regionid: row.regionid
409
+      this.showLoading = true;
410
+      wallpaper_detail({
411
+        wallpaperid: row.wallpaperid
328 412
       }).then((data) => {
413
+        this.showLoading = false;
329 414
         if (data.code === 0) {
330
-          this.viewInfo.show = true;
331
-          this.viewInfo.regionName = row.regionName;
332
-          this.viewInfo.list = data.obj;
415
+          this.viewInfo = {
416
+            show: true,
417
+            wname: data.obj.wname,
418
+            hpath: data.obj.hpath,
419
+            devices: data.obj.devices
420
+          };
333 421
         } else {
334 422
           this.$Message.error(data.msg);
335 423
         }
@@ -337,13 +425,48 @@ export default {
337 425
     },
338 426
     // 编辑
339 427
     toEdit(row) {
340
-      this.$refs.addForm.resetFields();
428
+      this.showLoading = true;
429
+      wallpaper_detail({
430
+        wallpaperid: row.wallpaperid
431
+      }).then((data) => {
432
+        this.showLoading = false;
433
+        if (data.code === 0) {
434
+          this.wallpaperInfo = {
435
+            show: true,
436
+            wallpaperid: data.obj.wallpaperid,
437
+            wname: data.obj.wname,
438
+            hpath: data.obj.hpath,
439
+            wlevel: data.obj.wlevel,
440
+            objectid: data.obj.objectid,
441
+            deviceids: data.obj.devices,
442
+            rversion: data.obj.rversion
443
+          };
444
+          this.$nextTick(() => {
445
+            //回显设备
446
+            let checkedArr = this.$refs.checkbevice;
447
+            if (checkedArr) {
448
+              for (let m = 0; m < checkedArr.length; m++) {
449
+                let dgroupid = checkedArr[m].module.dgroupid;
450
+                let marr = data.obj.devices;
451
+                for (let h = 0; h < marr.length; h++) {
452
+                  let arr = marr[h].devices;
453
+                  if (dgroupid == marr[h].dgroupid) {
454
+                    checkedArr[m].getCheckedDevices(arr);
455
+                  }
456
+                }
457
+              }
458
+            }
459
+          });
460
+        } else {
461
+          this.$Message.error(data.msg);
462
+        }
463
+      });
341 464
       this.wallpaperInfo = {
342 465
         show: true,
343 466
         // 验证码计时
344 467
         timer: null,
345
-        name:"",
346
-        img:""
468
+        name: "",
469
+        img: ""
347 470
       };
348 471
     },
349 472
     // 删除
@@ -352,8 +475,8 @@ export default {
352 475
         title: "提示",
353 476
         content: "您确定删除选中数据吗?",
354 477
         onOk: () => {
355
-          region_delete({
356
-            regionid: row.regionid,
478
+          wallpaper_delete({
479
+            wallpaperid: row.wallpaperid,
357 480
             rversion: row.rversion
358 481
           }).then((data) => {
359 482
             if (data.code === 0) {
@@ -378,11 +501,63 @@ export default {
378 501
   align-items: center;
379 502
   margin: 16px 16px;
380 503
 }
381
-.view_title {
382
-  margin-bottom: 16px;
383
-  font-size: 18px;
384
-  font-weight: bold;
385
-  text-align: center;
504
+.view {
505
+  .view_titles {
506
+    margin-bottom: 16px;
507
+    font-size: 18px;
508
+    font-weight: bold;
509
+    text-align: center;
510
+  }
511
+  .view_content {
512
+    display: flex;
513
+    .view_title {
514
+      width: 70px;
515
+      flex: none;
516
+      margin: 0 10px;
517
+    }
518
+    .hpath {
519
+      width: 180px;
520
+      height: 120px;
521
+      border-radius: 8px;
522
+      overflow: hidden;
523
+      border: 3px solid #333333;
524
+      background-color: #f0f6fc;
525
+      img {
526
+        width: 100%;
527
+        height: 100%;
528
+        object-fit: cover;
529
+      }
530
+    }
531
+    .view_devices {
532
+      .view_list {
533
+        margin-bottom: 20px;
534
+      }
535
+      .dgname {
536
+        line-height: 30px;
537
+      }
538
+      .devices {
539
+        display: flex;
540
+        flex-wrap: wrap;
541
+        span {
542
+          margin-right: 20px;
543
+          margin-bottom: 10px;
544
+        }
545
+      }
546
+    }
547
+  }
548
+}
549
+
550
+.table_wrap {
551
+  .hpath {
552
+    width: 100px;
553
+    height: 60px;
554
+    margin: 10px auto;
555
+    img {
556
+      width: 100%;
557
+      height: 100%;
558
+      object-fit: cover;
559
+    }
560
+  }
386 561
 }
387 562
 .up {
388 563
   display: flex;
@@ -399,6 +574,18 @@ export default {
399 574
     .icon {
400 575
       color: #b8c2d9;
401 576
     }
577
+    .hpath {
578
+      width: 180px;
579
+      height: 120px;
580
+      border-radius: 8px;
581
+      overflow: hidden;
582
+      padding: 3px;
583
+      img {
584
+        width: 100%;
585
+        height: 100%;
586
+        object-fit: cover;
587
+      }
588
+    }
402 589
   }
403 590
   span {
404 591
     margin-left: 20px;

Завантаження…
Відмінити
Зберегти