zsysview 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +3 -1
  2. package/assets/default_avatar.png +0 -0
  3. package/assets/default_logo.png +0 -0
  4. package/assets/default_logo_40.png +0 -0
  5. package/assets/login_bg.jpg +0 -0
  6. package/components/export/export_dialog.vue +150 -0
  7. package/components/export/export_progress.vue +62 -0
  8. package/components/list/zsyslist.vue +2 -2
  9. package/components/list/zsyslist_header.vue +1 -1
  10. package/components/zsys_delbutton.vue +60 -0
  11. package/core/app.ts +21 -2
  12. package/core/common/common.ts +29 -0
  13. package/core/common/zsys_eventBus.ts +45 -0
  14. package/core/common/zsys_time.ts +26 -0
  15. package/core/httpapi/http_api_return_data.ts +43 -0
  16. package/core/httpapi/http_api_v1.ts +151 -0
  17. package/core/httpapi/http_axios.ts +54 -0
  18. package/core/router copy.ts +148 -0
  19. package/core/router.ts +149 -0
  20. package/core/runtime.ts +14 -0
  21. package/core/user_token.ts +17 -0
  22. package/css/common.css +16 -0
  23. package/package.json +9 -2
  24. package/view/app.vue +0 -1
  25. package/view/backup/backup.vue +308 -0
  26. package/view/building.vue +22 -0
  27. package/view/department/department.vue +111 -0
  28. package/view/department/department_edit_dialog.vue +267 -0
  29. package/view/desktop/desktop.vue +11 -0
  30. package/view/log/log.vue +60 -0
  31. package/view/log/log_setting.vue +41 -0
  32. package/view/login.vue +5 -5
  33. package/view/main/breadcrumb.vue +41 -0
  34. package/view/main/main.vue +60 -0
  35. package/view/main/userHeader.vue +73 -0
  36. package/view/main/userMenu.vue +132 -0
  37. package/view/main/userMenuItem.vue +49 -0
  38. package/view/position/position.vue +58 -0
  39. package/view/position/position_edit_dialog.vue +203 -0
  40. package/view/role/role.vue +72 -0
  41. package/view/role/role_edit_dialog.vue +271 -0
  42. package/view/self/change_password.vue +97 -0
  43. package/view/self/self.vue +62 -0
  44. package/view/sys/sys.vue +19 -0
  45. package/view/user/change_user_password_dialog.vue +155 -0
  46. package/view/user/user.vue +110 -0
  47. package/view/user/user_edit_dialog.vue +283 -0
@@ -0,0 +1,308 @@
1
+ <template>
2
+ <breadcrumb />
3
+ <div style="padding: 0px 20px">
4
+ <el-tabs v-model="activeName">
5
+ <el-tab-pane label="备份记录" name="list">
6
+ <el-alert
7
+ title="如需还原备份点,请联系技术人员。"
8
+ type="info"
9
+ show-icon
10
+ :closable="false"
11
+ style="width: 450px"
12
+ />
13
+ <zsyslist :config="listconfig" module="backup" style="margin-top: 10px">
14
+ <template #headermain>
15
+ <el-button class="main_btn" type="primary" @click="startBackup"
16
+ >立即备份</el-button
17
+ >
18
+ </template>
19
+ <template #content>
20
+ <el-table-column prop="item_name" label="备份点" min-width="240" />
21
+ <el-table-column prop="size_desc" label="大小" width="200" />
22
+ <!-- <el-table-column label="操作" width="60">
23
+ <template #default="{ row }">
24
+ <el-space>
25
+ <el-link type="primary">删除</el-link> -->
26
+ <!-- <el-link type="primary"
27
+ @click="view.edit_id = BigInt(row.position_id); view.edit_dialog_show = true;">修改</el-link> -->
28
+ <!-- <zsys_delbutton :id="BigInt(row.position_id)"
29
+ :api_url="HttpApiV1.url_position_del" /> -->
30
+ <!-- </el-space>
31
+ </template>
32
+ </el-table-column> -->
33
+ </template>
34
+ </zsyslist>
35
+ </el-tab-pane>
36
+ <el-tab-pane label="设置" name="setting">
37
+ <el-form label-width="100px" style="margin-top: 10px">
38
+ <el-form-item label="自动备份">
39
+ <el-switch v-model="form.auto" />
40
+ </el-form-item>
41
+ <div v-if="form.auto">
42
+ <el-form-item label="备份频次">
43
+ <el-space>
44
+ <el-select v-model="form.plan" style="width: 150px">
45
+ <el-option label="每天" value="Everyday" />
46
+ <el-option label="每周一" value="Monday" />
47
+ <el-option label="每月第一天" value="FirstDayOfMonth" />
48
+ </el-select>
49
+ <el-select v-model="form.hour" style="width: 100px">
50
+ <el-option label="00点" value="00" />
51
+ <el-option label="01点" value="01" />
52
+ <el-option label="02点" value="02" />
53
+ <el-option label="03点" value="03" />
54
+ <el-option label="04点" value="04" />
55
+ <el-option label="05点" value="05" />
56
+ <el-option label="06点" value="06" />
57
+ <el-option label="07点" value="07" />
58
+ <el-option label="08点" value="08" />
59
+ <el-option label="09点" value="09" />
60
+ <el-option label="10点" value="10" />
61
+ <el-option label="11点" value="11" />
62
+ <el-option label="12点" value="12" />
63
+ <el-option label="13点" value="13" />
64
+ <el-option label="14点" value="14" />
65
+ <el-option label="15点" value="15" />
66
+ <el-option label="16点" value="16" />
67
+ <el-option label="17点" value="17" />
68
+ <el-option label="18点" value="18" />
69
+ <el-option label="19点" value="19" />
70
+ <el-option label="20点" value="20" />
71
+ <el-option label="21点" value="21" />
72
+ <el-option label="22点" value="22" />
73
+ <el-option label="23点" value="23" />
74
+ </el-select>
75
+ <el-select v-model="form.minute" style="width: 100px">
76
+ <el-option label="00分" value="00" />
77
+ <el-option label="15分" value="15" />
78
+ <el-option label="30分" value="30" />
79
+ <el-option label="45分" value="45" />
80
+ </el-select>
81
+ </el-space>
82
+ </el-form-item>
83
+ <el-form-item label="备份路径">
84
+ <el-space direction="vertical" :size="2" alignment="stretch">
85
+ <el-input style="width: 500px" />
86
+ <el-text type="info"
87
+ >如果您使用的是物理主机,并且不具备磁盘阵列功能,强烈建议备份路径设置到第二个硬盘/U盘</el-text
88
+ >
89
+ </el-space>
90
+ </el-form-item>
91
+ <el-form-item label="保存选项">
92
+ <el-select v-model="form.keep" style="width: 200px">
93
+ <el-option label="保留最近20个备份" value="lastkeep20" />
94
+ <el-option label="保留最近10个备份" value="lastkeep10" />
95
+ </el-select>
96
+ </el-form-item>
97
+ <el-divider content-position="left" style="width: 400px"
98
+ >上传FTP</el-divider
99
+ >
100
+
101
+ <el-form-item label="启用/关闭">
102
+ <el-switch v-model="form.use_ftp" />
103
+ <el-text type="info" style="margin-left: 10px"
104
+ >上传FTP可以解决本机备份空间不足的问题</el-text
105
+ >
106
+ </el-form-item>
107
+ <div v-if="form.use_ftp">
108
+ <el-form-item label="FTP主机地址">
109
+ <el-space>
110
+ <el-input v-model="form.f_host" style="width: 300px" />
111
+ <el-text>端口</el-text>
112
+ <el-input-number
113
+ v-model="form.f_port"
114
+ :min="1"
115
+ :max="65535"
116
+ :value-on-clear="21"
117
+ style="width: 120px"
118
+ controls-position="right"
119
+ />
120
+ <!-- <el-input v-model="form.f_port" style="width: 80px;" /> -->
121
+ </el-space>
122
+ </el-form-item>
123
+ <el-form-item label="FTP用户">
124
+ <el-input v-model="form.f_u" style="width: 200px" />
125
+ </el-form-item>
126
+ <el-form-item label="FTP密码">
127
+ <el-space direction="vertical" :size="2" alignment="stretch">
128
+ <el-input
129
+ v-model="form.f_p"
130
+ type="password"
131
+ style="width: 200px"
132
+ />
133
+ <el-text type="info"
134
+ >这里不显示保存的密码,要修改时才输入</el-text
135
+ >
136
+ </el-space>
137
+ </el-form-item>
138
+ <el-form-item label="FTP目录名">
139
+ <el-space direction="vertical" :size="2" alignment="stretch">
140
+ <el-input v-model="form.f_path" style="width: 200px" />
141
+ <el-text type="info"
142
+ >多台机器备份到同一个FTP时可按目录名区分</el-text
143
+ >
144
+ </el-space>
145
+ </el-form-item>
146
+ <el-form-item label="TLS">
147
+ <el-switch v-model="form.f_tls" />
148
+ </el-form-item>
149
+ </div>
150
+ </div>
151
+ <el-form-item>
152
+ <el-button type="primary" @click="saveConfig">应用设置</el-button>
153
+ </el-form-item>
154
+ </el-form>
155
+ </el-tab-pane>
156
+ </el-tabs>
157
+ </div>
158
+
159
+ <department_edit_dialog :id="view.edit_id" v-model="view.edit_dialog_show" />
160
+ </template>
161
+
162
+ <script setup lang="ts">
163
+ import breadcrumb from "../main/breadcrumb.vue";
164
+ import { ref, reactive, onMounted } from "vue";
165
+ import { HttpApiV1 as http, HttpApiV1 } from "../../core/httpapi/http_api_v1";
166
+ // import zsys_delbutton from "@/components/zsys/zsys_delbutton.vue";
167
+ import zsyslist from "../../components/list/zsyslist.vue";
168
+ import { type ListConfig } from "../../components/list/zsyslist.vue";
169
+ // import { zsysEventBus } from "@/utils/zsys_eventBus";
170
+ import { ZSYSMessage } from "../../components/message";
171
+
172
+ const activeName = ref("list");
173
+
174
+ // const eventBus = zsysEventBus();
175
+
176
+ //============列表控件===========================
177
+ const listconfig: ListConfig = reactive({
178
+ ApiUrl: HttpApiV1.url_backup_list,
179
+ QuickConditionsGroups: [],
180
+ HideBottomToolbar: true,
181
+ });
182
+
183
+ const view = reactive({
184
+ edit_id: BigInt(0),
185
+ edit_dialog_show: false,
186
+ });
187
+
188
+ interface BackupConfig {
189
+ auto: number;
190
+ plan: string;
191
+ hour: string;
192
+ minute: string;
193
+ path: string;
194
+ keep: string;
195
+ use_ftp: number;
196
+ f_host: string;
197
+ f_port: number;
198
+ f_u: string;
199
+ f_p: string;
200
+ f_path: string;
201
+ f_tls: number;
202
+ }
203
+
204
+ const form = reactive({
205
+ auto: true,
206
+ plan: "Everyday",
207
+ hour: "01",
208
+ minute: "00",
209
+ path: "",
210
+ keep: "keep20",
211
+ use_ftp: false,
212
+ f_host: "",
213
+ f_port: 21,
214
+ f_u: "",
215
+ f_p: "",
216
+ f_path: "",
217
+ f_tls: true,
218
+ });
219
+
220
+ const startBackup = async () => {
221
+ try {
222
+ let res = await http.Post(http.url_backup_start, {});
223
+ if (res.IsSuccess) {
224
+ ZSYSMessage.ShowSuccess("开始备份");
225
+ } else {
226
+ ZSYSMessage.ShowError(res.message);
227
+ }
228
+ } catch (e) {
229
+ console.log(e);
230
+ ZSYSMessage.ShowError("启动备份失败");
231
+ }
232
+ };
233
+
234
+ async function saveConfig() {
235
+ try {
236
+ let data = {
237
+ auto: form.auto ? 1 : 0,
238
+ plan: form.plan,
239
+ hour: form.hour,
240
+ minute: form.minute,
241
+ path: form.path,
242
+ keep: form.keep,
243
+ use_ftp: form.use_ftp ? 1 : 0,
244
+ f_host: form.f_host,
245
+ f_port: form.f_port,
246
+ f_u: form.f_u,
247
+ f_p: form.f_p,
248
+ f_path: form.f_path,
249
+ f_tls: form.f_tls ? 1 : 0,
250
+ };
251
+ let res = await http.Post(http.url_backup_config_save, data);
252
+ if (res.IsSuccess) {
253
+ ZSYSMessage.ShowSuccess("保存成功");
254
+ } else {
255
+ ZSYSMessage.ShowError(res.message);
256
+ }
257
+ } catch (e) {
258
+ console.log(e);
259
+ ZSYSMessage.ShowError("保存配置失败");
260
+ }
261
+ }
262
+
263
+ async function getConfig() {
264
+ try {
265
+ let res = await HttpApiV1.Post(HttpApiV1.url_backup_config_get, {});
266
+ if (res.IsSuccess) {
267
+ let data = res.data as BackupConfig;
268
+ form.auto = data.auto == 1 ? true : false;
269
+ form.plan = data.plan;
270
+ form.hour = data.hour;
271
+ form.minute = data.minute;
272
+ form.path = data.path;
273
+ form.keep = data.keep;
274
+ form.use_ftp = data.use_ftp == 1 ? true : false;
275
+ form.f_host = data.f_host;
276
+ form.f_port = data.f_port;
277
+ form.f_u = data.f_u;
278
+ form.f_p = data.f_p;
279
+ form.f_path = data.f_path;
280
+ form.f_tls = data.f_tls == 1 ? true : false;
281
+ } else {
282
+ ZSYSMessage.ShowError("获取备份配置失败");
283
+ }
284
+ } catch (e) {
285
+ ZSYSMessage.ShowError("获取备份配置失败");
286
+ console.log(e);
287
+ }
288
+ }
289
+
290
+ // //====基础
291
+ onMounted(() => {
292
+ getConfig();
293
+ // eventBus.on('aud', aud_event);
294
+ });
295
+
296
+ // onUnmounted(() => {
297
+ // eventBus.off('aud', aud_event);
298
+ // })
299
+
300
+ // // 处理aud事件
301
+ // const aud_event = (payload: { module: string, id: bigint }) => {
302
+ // if (payload.module = 'department') {
303
+ // getData()
304
+ // }
305
+ // };
306
+ </script>
307
+
308
+ <style scoped></style>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <breadcrumb />
3
+ <div style="padding: 0px 20px; margin-top: 20px;">
4
+ <el-result icon="info" title="该功能开发中">
5
+ <template #sub-title>
6
+ <p>请期待</p>
7
+ </template>
8
+ <!-- <template #extra>
9
+ <el-button type="primary">Back</el-button>
10
+ </template> -->
11
+ </el-result>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import breadcrumb from './breadcrumb.vue';
17
+
18
+ </script>
19
+
20
+ <style scoped>
21
+
22
+ </style>
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <breadcrumb />
3
+ <div style="padding: 0px 20px;">
4
+ <el-tabs v-model="activeName">
5
+ <el-tab-pane label="组织架构" name="first">
6
+ <el-row>
7
+ <el-col :span="24">
8
+ <el-space :size="4" wrap>
9
+ <el-button class="main_btn" type="primary"
10
+ @click="view.edit_id = 0n; view.edit_dialog_show = true">新建</el-button>
11
+ <el-tooltip content="刷新列表数据">
12
+ <el-button :icon="Refresh" @click="refresh" />
13
+ </el-tooltip>
14
+ </el-space>
15
+ </el-col>
16
+ </el-row>
17
+ <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="department_id">
18
+ <el-table-column prop="department_title" label="名称" min-width="300" />
19
+ <el-table-column prop="department_sort" label="排序" width="80" />
20
+ <el-table-column prop="department_title" label="操作" width="130">
21
+ <template #default="{ row }">
22
+ <el-space>
23
+ <el-link type="primary"
24
+ @click="view.edit_id = BigInt(row.department_id); view.edit_dialog_show = true;">查看和编辑</el-link>
25
+ <zsys_delbutton :id="BigInt(row.department_id)"
26
+ :api_url="HttpApiV1.url_department_del" />
27
+ </el-space>
28
+ </template>
29
+ </el-table-column>
30
+ <template #empty>
31
+ <el-empty description="无相关部门数据" :image-size="100" />
32
+ </template>
33
+ </el-table>
34
+ </el-tab-pane>
35
+ <el-tab-pane label="类型设置" name="second">
36
+ <el-alert title="暂只支持创建普通部门节点" type="info" show-icon :closable="false" />
37
+ </el-tab-pane>
38
+ </el-tabs>
39
+ </div>
40
+
41
+ <department_edit_dialog :id="view.edit_id" v-model="view.edit_dialog_show" />
42
+ </template>
43
+
44
+ <script setup lang="ts">
45
+ import breadcrumb from '../main/breadcrumb.vue';
46
+ import { ref, reactive, onMounted, onUnmounted } from 'vue'
47
+ import { HttpApiV1 as http, HttpApiV1 } from '../../core/httpapi/http_api_v1';
48
+ import { Refresh } from '@element-plus/icons-vue'
49
+ import zsys_delbutton from '../../components/zsys_delbutton.vue';
50
+ import { zsysEventBus } from '../../core/common/zsys_eventBus';
51
+ import department_edit_dialog from './department_edit_dialog.vue';
52
+
53
+ const activeName = ref('first')
54
+
55
+ const eventBus = zsysEventBus()
56
+
57
+ //============列表控件===========================
58
+ interface Department {
59
+ department_id: bigint
60
+ department_sort: number
61
+ department_title: string
62
+ children?: Department[]
63
+ }
64
+
65
+ const tableData = ref<Department[]>([])
66
+
67
+ const view = reactive({
68
+ edit_id: BigInt(0),
69
+ edit_dialog_show: false,
70
+ })
71
+
72
+ const refresh = () => {
73
+ getData()
74
+ }
75
+
76
+ const getData = async () => {
77
+ try {
78
+ let res = await http.Post(http.url_department_list, {})
79
+ if (res.IsSuccess) {
80
+ tableData.value = (res.data as { listdata: Department[] })?.listdata
81
+ }
82
+
83
+ } catch (e) {
84
+ console.log(e);
85
+
86
+ }
87
+ }
88
+
89
+ //=============新建和编辑弹窗
90
+
91
+
92
+ //====基础
93
+ onMounted(() => {
94
+ eventBus.on('aud', aud_event);
95
+ getData()
96
+ })
97
+
98
+ onUnmounted(() => {
99
+ eventBus.off('aud', aud_event);
100
+ })
101
+
102
+ // 处理aud事件
103
+ const aud_event = (payload: { module: string, id: bigint }) => {
104
+ if (payload.module = 'department') {
105
+ getData()
106
+ }
107
+ };
108
+
109
+ </script>
110
+
111
+ <style scoped></style>