Selaa lähdekoodia

日志 公告

gzb
guozhongbo 9 kuukautta sitten
vanhempi
commit
f3af303be7

+ 149
- 4
src/views/regionSection/log/admin.vue Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

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

+ 240
- 4
src/views/regionSection/notice/index.vue Näytä tiedosto

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

Loading…
Peruuta
Tallenna