zsysview 0.0.17 → 0.0.18

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 (76) hide show
  1. package/README.md +19 -3
  2. package/dist/backup-BwHGMFM9.js +519 -0
  3. package/dist/breadcrumb.vue_vue_type_script_setup_true_lang-B-s19d7a.js +42 -0
  4. package/dist/change_password-Cvx2fsBt.js +135 -0
  5. package/dist/department-D19P31la.js +410 -0
  6. package/dist/desktop-IlIshTtF.js +9 -0
  7. package/dist/http_api_v1-DFc71lD8.js +2755 -0
  8. package/dist/index-C_d1JnWR.js +49346 -0
  9. package/dist/index.es-BcGc183Q.js +170 -0
  10. package/dist/log-sQxXMuk2.js +163 -0
  11. package/dist/login-CN37wrzM.js +111 -0
  12. package/dist/main-B5GBQKz0.js +292 -0
  13. package/dist/message-Dd0EkBmy.js +26 -0
  14. package/dist/position-DfWT0ovL.js +312 -0
  15. package/dist/role-CNn2CuOU.js +405 -0
  16. package/dist/self-CraGrpq3.js +102 -0
  17. package/dist/sys-BjlP52cg.js +30 -0
  18. package/dist/user-CYvTCZB6.js +651 -0
  19. package/dist/vite.svg +1 -0
  20. package/dist/zsys_delbutton.vue_vue_type_script_setup_true_lang-DTE_uo5w.js +72 -0
  21. package/dist/zsys_eventBus-Dc_JZwH4.js +36 -0
  22. package/dist/zsys_time-DHEMuVgo.js +17 -0
  23. package/dist/zsyslist.vue_vue_type_script_setup_true_lang-CiKZqB0j.js +465 -0
  24. package/dist/zsysview.css +1 -0
  25. package/dist/zsysview.es.js +2 -0
  26. package/package.json +34 -20
  27. package/assets/default_avatar.png +0 -0
  28. package/assets/default_logo.png +0 -0
  29. package/assets/default_logo_40.png +0 -0
  30. package/assets/login_bg.jpg +0 -0
  31. package/components/export/export_dialog.vue +0 -150
  32. package/components/export/export_progress.vue +0 -62
  33. package/components/list/zsyslist.vue +0 -164
  34. package/components/list/zsyslist_content.vue +0 -29
  35. package/components/list/zsyslist_header.vue +0 -62
  36. package/components/message/index.ts +0 -3
  37. package/components/message/message.ts +0 -35
  38. package/components/zsys_delbutton.vue +0 -60
  39. package/core/app.ts +0 -32
  40. package/core/common/common.ts +0 -29
  41. package/core/common/zsys_eventBus.ts +0 -45
  42. package/core/common/zsys_time.ts +0 -26
  43. package/core/httpapi/http_api_return_data.ts +0 -43
  44. package/core/httpapi/http_api_v1.ts +0 -151
  45. package/core/httpapi/http_axios.ts +0 -54
  46. package/core/router copy.ts +0 -148
  47. package/core/router.ts +0 -153
  48. package/core/runtime.ts +0 -14
  49. package/core/user_token.ts +0 -17
  50. package/css/common.css +0 -16
  51. package/css/style.css +0 -79
  52. package/index.ts +0 -0
  53. package/view/app.vue +0 -10
  54. package/view/backup/backup.vue +0 -308
  55. package/view/building.vue +0 -22
  56. package/view/department/department.vue +0 -111
  57. package/view/department/department_edit_dialog.vue +0 -267
  58. package/view/desktop/desktop.vue +0 -11
  59. package/view/log/log.vue +0 -60
  60. package/view/log/log_setting.vue +0 -41
  61. package/view/login.vue +0 -91
  62. package/view/main/breadcrumb.vue +0 -41
  63. package/view/main/main.vue +0 -60
  64. package/view/main/userHeader.vue +0 -73
  65. package/view/main/userMenu.vue +0 -132
  66. package/view/main/userMenuItem.vue +0 -49
  67. package/view/position/position.vue +0 -58
  68. package/view/position/position_edit_dialog.vue +0 -203
  69. package/view/role/role.vue +0 -72
  70. package/view/role/role_edit_dialog.vue +0 -271
  71. package/view/self/change_password.vue +0 -97
  72. package/view/self/self.vue +0 -62
  73. package/view/sys/sys.vue +0 -19
  74. package/view/user/change_user_password_dialog.vue +0 -155
  75. package/view/user/user.vue +0 -110
  76. package/view/user/user_edit_dialog.vue +0 -283
@@ -1,110 +0,0 @@
1
- <template>
2
- <breadcrumb />
3
- <div style="padding: 0px 20px;">
4
- <el-tabs v-model="activeName">
5
- <el-tab-pane label="全部用户" name="userList">
6
- <zsyslist :config="listconfig" module="user">
7
- <template #headermain>
8
- <el-button class="main_btn" type="primary"
9
- @click="view.edit_id = 0n; view.edit_dialog_show = true;">新建</el-button>
10
- </template>
11
- <template #content>
12
- <!-- <el-table-column prop="uid" label="UID" width="180" /> -->
13
- <el-table-column prop="uname" label="姓名" width="100" />
14
- <el-table-column prop="enable" label="状态" width="70">
15
- <template #default="{ row }">
16
- <el-tag type="success" v-if="row.user_enable == 1" :disable-transitions="true" size="small">正常</el-tag>
17
- <el-tag type="info" v-if="row.user_enable == 0" :disable-transitions="true" size="small">禁用</el-tag>
18
- </template>
19
- </el-table-column>
20
- <el-table-column prop="username" label="用户名" width="100" />
21
- <el-table-column label="角色" min-width="240">
22
- <template #default="{ row }">
23
- <el-tag v-if="(row as user).role_titles != ''" v-for="r in (row as user).role_titles.split(',')"
24
- style="margin-right: 2px;" :disable-transitions="true" size="small">{{ r }}</el-tag>
25
- </template>
26
- </el-table-column>
27
- <!-- <el-table-column prop="phone" label="手机号码" min-width="120" /> -->
28
- <el-table-column label="最后登录时间" prop="last_login_time" width="180">
29
- <template #default="{ row }">
30
- {{ dataformat(row.last_login_time) }}
31
- </template>
32
- </el-table-column>
33
- <el-table-column fixed="right" label="操作" width="180">
34
- <template #default="{ row }">
35
- <el-space>
36
- <el-link type="primary"
37
- @click="view.edit_id = BigInt(row.uid); view.edit_dialog_show = true;">查看和编辑</el-link>
38
- <el-link type="primary"
39
- @click="view.edit_id = BigInt(row.uid); view.change_pwd_dialog_show = true;">改密码</el-link>
40
- <zsys_delbutton :id="BigInt(row.uid)" :api_url="HttpApiV1.url_user_del" module="user" />
41
- </el-space>
42
- </template>
43
- </el-table-column>
44
- </template>
45
- </zsyslist>
46
-
47
- </el-tab-pane>
48
- <el-tab-pane label="设置" name="second">
49
-
50
- </el-tab-pane>
51
- </el-tabs>
52
- </div>
53
-
54
- <user_edit_dialog :id="view.edit_id" v-model="view.edit_dialog_show" />
55
- <change_user_password_dialog :id="view.edit_id" v-model="view.change_pwd_dialog_show" />
56
- </template>
57
-
58
- <script setup lang="ts">
59
- import breadcrumb from '../main/breadcrumb.vue';
60
- import { ref, reactive, computed } from 'vue'
61
- import zsyslist, { type ListConfig } from '../../components/list/zsyslist.vue';
62
- import { HttpApiV1 } from '../../core/httpapi/http_api_v1';
63
- import user_edit_dialog from './user_edit_dialog.vue';
64
- import zsys_delbutton from '../../components/zsys_delbutton.vue';
65
- import { formatDateTime } from '../../core/common/zsys_time';
66
- import change_user_password_dialog from './change_user_password_dialog.vue';
67
-
68
-
69
- const activeName = ref('userList')
70
-
71
- //============列表控件===========================
72
- const listconfig: ListConfig = reactive({
73
- ApiUrl: HttpApiV1.url_user_list,
74
- KeywordTip: '姓名、用户名',
75
- QuickConditionsGroups: [
76
- {
77
- Label: '状态:', Select: 0, QuickConditions: [
78
- { label: '全部', column: null },
79
- { label: '正常', column: 'user_enable', condition: '=', value: 1 },
80
- { label: '已禁用', column: 'user_enable', condition: '=', value: 0 },
81
- ]
82
- }
83
- ],
84
- ExportUrl:HttpApiV1.url_user_export,
85
- // ExportColumn:[
86
- // {ColumnTitle:'姓名',ColumnName:'uname'},
87
- // {ColumnTitle:'用户名',ColumnName:'username'},
88
- // {ColumnTitle:'状态',ColumnName:'user_enable'},
89
- // {ColumnTitle:'最后登录时间',ColumnName:'last_login_time'},
90
- // {ColumnTitle:'角色',ColumnName:'role_titles'},
91
- // ]
92
- })
93
-
94
- //=============新建和编辑弹窗
95
- const view = reactive({
96
- edit_id: BigInt(0),
97
- edit_dialog_show: false,
98
- change_pwd_dialog_show: false
99
- })
100
-
101
- interface user {
102
- role_titles: string
103
- }
104
-
105
-
106
- //日期格式化
107
- const dataformat = computed(() => (item: string) => formatDateTime(item))
108
- </script>
109
-
110
- <style scoped></style>
@@ -1,283 +0,0 @@
1
- <!-- ReusableDialog.vue -->
2
- <template>
3
- <el-dialog v-model="visible" title="用户" :align-center="true" :before-close="handleBeforeClose" @open="open"
4
- width="550" :draggable="true" :overflow="true" @opened="focus" destroy-on-close :close-on-click-modal="false">
5
- <!-- 默认插槽放主要内容 -->
6
- <el-form @submit.prevent ref="ruleFormRef" :model="form" :rules="rules"
7
- style="padding-left: 10px;padding-right: 10px;" label-width="auto" v-loading="view.loading"
8
- :disabled="view.saving">
9
- <el-form-item label="姓名" prop="uname">
10
- <el-input ref="inputRef" v-model="form.uname" style="width: 300px;" />
11
- <el-switch v-model="form.is_enable" inline-prompt active-text="已启用" inactive-text="已禁用"
12
- style="margin-left: 10px;" />
13
- </el-form-item>
14
- <el-form-item label="用户名" prop="username">
15
- <el-input v-model="form.username" style="width: 300px;" />
16
- </el-form-item>
17
- <el-form-item v-if="form.uid == 0n" label="初始密码" prop="password">
18
- <el-input v-model="form.password" style="width: 300px;" />
19
- </el-form-item>
20
- <el-form-item label="角色权限" prop="role_title">
21
- <el-select multiple v-model="form.role_value" placeholder="未选择" clearable>
22
- <el-option v-for="item in role_option" :key="item.value" :label="item.label" :value="item.value">
23
- <span style="float: left">{{ item.label }}</span>
24
- <span v-if="!item.enable" style="
25
- float: right;
26
- color: var(--el-text-color-secondary);
27
- font-size: 13px;
28
- ">
29
- 禁用不生效
30
- </span>
31
- </el-option>
32
- </el-select>
33
- </el-form-item>
34
-
35
- </el-form>
36
-
37
- <!-- 底部按钮区插槽 -->
38
- <template #footer>
39
- <div style="display: flex;justify-content: right;">
40
- <el-tooltip v-if="view.isnew" content="保存成功后不关闭窗口">
41
- <el-checkbox v-model="view.donotClose" label="连续录入" style="margin-right: 10px;" />
42
- </el-tooltip>
43
-
44
- <el-tooltip content="快捷键 Alt+S" :show-after="800">
45
- <el-button type="primary" @click="submitForm(ruleFormRef)" :disabled="view.loading"
46
- :loading="view.saving">保存(<el-text tag="ins" style="color: white;">S</el-text>)</el-button>
47
- </el-tooltip>
48
-
49
- <el-button @click="close">取消</el-button>
50
- </div>
51
-
52
- </template>
53
- </el-dialog>
54
- </template>
55
-
56
- <script setup lang="ts">
57
- import { ref, watch, reactive, type PropType } from 'vue';
58
- import { HttpApiV1 as http } from '../../core/httpapi/http_api_v1';
59
- import { ZSYSMessage } from '../../components/message';
60
- import type { FormInstance, FormRules, ElInput } from 'element-plus'
61
- import { useMagicKeys, whenever } from '@vueuse/core'
62
- import type { HttpApiReturnData } from '../../core/httpapi/http_api_return_data';
63
- import { zsysEventBus } from '../../core/common/zsys_eventBus';
64
- import { Md5 } from 'ts-md5'
65
- const eventBus = zsysEventBus()
66
- const inputRef = ref<InstanceType<typeof ElInput> | null>(null)
67
- const props = defineProps({
68
- modelValue: { type: Boolean, required: true }, // 控制显示隐藏
69
- id: { type: BigInt as unknown as PropType<bigint>, required: true }
70
- });
71
-
72
- const emit = defineEmits<{
73
- (e: 'update:modelValue', value: boolean): void;
74
- // (e: 'confirm'): void;
75
- // (e: 'close'): void;
76
- }>();
77
-
78
- const visible = ref(false);
79
-
80
- // 同步外部 v-model 变化
81
- watch(
82
- () => props.modelValue,
83
- (val) => {
84
- visible.value = val;
85
- },
86
- { immediate: true }
87
- );
88
-
89
- // 内部状态变化通知外部
90
- watch(visible, (val) => {
91
- emit('update:modelValue', val);
92
- });
93
-
94
- //弹窗显示时的处理
95
- const open = () => {
96
- view.isnew = (props.id == 0n ? true : false)
97
- getData()
98
- }
99
-
100
- const close = () => {
101
- visible.value = false;
102
- // emit('close');
103
- };
104
-
105
- const handleBeforeClose = (done: () => void) => {
106
- ruleFormRef.value?.clearValidate();
107
- // 可以在这里添加关闭前的拦截逻辑
108
- done();
109
- };
110
-
111
- const view = reactive({
112
- loading: true,
113
- saving: false,
114
- donotClose: false,
115
- isnew: true
116
- })
117
-
118
-
119
- if (props.id == 0n) { view.isnew = true }
120
- //^^^^^^^^^^^^^^^上方为对话框功能^^^^^^^^^^^^^^^
121
-
122
- //===============下方为数据部分===============
123
- interface RoleOption {
124
- value: string,
125
- label: string,
126
- enable: boolean
127
- }
128
-
129
-
130
- const getRoleOption = async () => {
131
- let d: RoleOption[] = []
132
- let res = await http.Post(http.url_sysrole_list, { "page_size": 999, "page_index": 1 })
133
- if (res.IsSuccess) {
134
- let data = res.data as {
135
- listdata: {
136
- role_name: string,
137
- role_id: bigint,
138
- role_enable: boolean
139
- }[]
140
- }
141
- for (let i = 0; i < data.listdata.length; i++) {
142
- let r = data.listdata[i]
143
- d.push({ value: r.role_id.toString(), label: r.role_name, enable: r.role_enable })
144
- }
145
- return d
146
- }
147
- return []
148
- }
149
-
150
- const role_option = ref<RoleOption[]>([])
151
-
152
- //=================表单
153
- const ruleFormRef = ref<FormInstance>()
154
- const form = ref({
155
- uid: props.id as bigint,
156
- uname: "",
157
- username: "",
158
- password: "",
159
- is_enable: true,
160
- role_value: [] as string[],
161
- })
162
- const rules = reactive<FormRules<typeof form>>({
163
- uname: [
164
- { required: true, message: '请输入姓名', trigger: 'blur' },
165
- ],
166
- })
167
- //=================
168
-
169
- //获取修改数据
170
- const getData = async () => {
171
- view.loading = true
172
- //获取可以用的权限值
173
- role_option.value = await getRoleOption()
174
- form.value.uid = props.id
175
- if (props.id != 0n) {
176
- view.donotClose = false
177
- try {
178
- let res = await http.Post(http.url_user_detail, { id: props.id })
179
- if (res.IsSuccess) {
180
- let data = res.data as {
181
- uid: bigint
182
- uname: string
183
- username: string
184
- user_enable: number
185
- role_ids: bigint[]
186
- }
187
-
188
- form.value.uid = data.uid
189
- form.value.uname = data.uname
190
- form.value.username = data.username
191
- form.value.is_enable = data.user_enable == 1
192
- let rs: string[] = []
193
- for (const s of data.role_ids) {
194
- for (let tmp of role_option.value) {
195
- if (tmp.value == s.toString()) {
196
- rs.push(s.toString())
197
- break
198
- }
199
- }
200
- }
201
- form.value.role_value = rs
202
- }
203
- } catch (e) {
204
- console.log(e);
205
- } finally {
206
-
207
- }
208
- } else {
209
-
210
- }
211
- view.loading = false
212
- }
213
-
214
- //保存
215
- const saveData = async (): Promise<HttpApiReturnData> => {
216
- let r: bigint[] = []
217
- for (const s of form.value.role_value) {
218
- r.push(BigInt(s))
219
- }
220
- let postdata = {
221
- uid: form.value.uid,
222
- username: form.value.username,
223
- password: form.value.uid == 0n ? Md5.hashStr(form.value.password) : "",
224
- uname: form.value.uname,
225
- user_enable: form.value.is_enable ? 1 : 0,
226
- role_ids: r
227
- }
228
-
229
- return await http.Post(http.url_user_save, postdata)
230
- }
231
-
232
- //验证表单处理界面并保存
233
- const submitForm = (formEl: FormInstance | undefined) => {
234
- if (!formEl) return
235
- formEl.validate(async (valid) => {
236
- if (valid) {
237
- view.saving = true
238
- try {
239
- let res = await saveData()
240
- if (res.IsSuccess) {
241
- // emit('confirm');
242
- if (view.donotClose) {
243
- form.value.uid = 0n
244
- setTimeout(() => { focus() }, 200);
245
- } else {
246
- close();
247
- }
248
- ZSYSMessage.ShowSuccess("保存成功")
249
- eventBus.emit('aud', { module: 'user', id: form.value.uid })
250
- } else {
251
- ZSYSMessage.ShowError(res.message)
252
- }
253
- } catch (e) {
254
-
255
- } finally {
256
- // emit('confirm');
257
- // close();
258
- view.saving = false
259
-
260
- }
261
- }
262
- })
263
- }
264
-
265
- const focus = () => {
266
- inputRef.value?.focus()
267
- inputRef.value?.select()
268
- }
269
-
270
- //==========快捷键
271
- const keys = useMagicKeys()
272
-
273
- whenever(keys.alt_s, () => {
274
- if (visible.value) {
275
- console.log('Alt+S提交')
276
- submitForm(ruleFormRef.value)
277
- }
278
- // 在这里执行你的业务逻辑
279
- })
280
-
281
- </script>
282
-
283
- <style scoped></style>