zant-admin 1.0.1 → 2.0.0

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +414 -25
  3. package/README.md +426 -277
  4. package/bin/cli.js +99 -99
  5. package/bin/generator.js +502 -502
  6. package/bin/prompts.js +158 -158
  7. package/bin/utils.js +133 -133
  8. package/package.json +3 -3
  9. package/public/logo.png +0 -0
  10. package/src/App.vue +1 -1
  11. package/src/api/methods/sysAccount.js +0 -1
  12. package/src/api/methods/sysDictItem.js +3 -3
  13. package/src/api/methods/system.js +10 -11
  14. package/src/api/request.js +39 -39
  15. package/src/assets/css/style.css +0 -11
  16. package/src/assets/css/zcui.css +1002 -319
  17. package/src/assets/imgs/logo.png +0 -0
  18. package/src/assets/imgs/md/console.png +0 -0
  19. package/src/assets/imgs/md/login.png +0 -0
  20. package/src/assets/imgs/md/menu.png +0 -0
  21. package/src/assets/imgs/md/serviceMonitoring.png +0 -0
  22. package/src/assets/imgs/md/statistics.png +0 -0
  23. package/src/components/FormTable.vue +50 -37
  24. package/src/components/IconPicker.vue +351 -344
  25. package/src/components/MainPage.vue +220 -339
  26. package/src/components/edit/QuartzEdit.vue +1 -1
  27. package/src/components/edit/SysAccountEdit.vue +15 -8
  28. package/src/components/edit/SysDictEdit.vue +6 -4
  29. package/src/components/edit/SysDictItemEdit.vue +8 -6
  30. package/src/components/edit/SysRoleEdit.vue +5 -3
  31. package/src/components/edit/sysMenuEdit.vue +10 -25
  32. package/src/config/index.js +74 -74
  33. package/src/directives/permission.js +49 -45
  34. package/src/main.js +2 -3
  35. package/src/router/index.js +48 -30
  36. package/src/stores/config.js +7 -1
  37. package/src/stores/menu.js +32 -8
  38. package/src/stores/user.js +17 -17
  39. package/src/utils/regionUtils.js +20 -16
  40. package/src/utils/useFormCRUD.js +59 -60
  41. package/src/views/baiscstatis/center.vue +53 -42
  42. package/src/views/baiscstatis/iframePage.vue +9 -11
  43. package/src/views/console.vue +92 -42
  44. package/src/views/demo/button.vue +269 -0
  45. package/src/views/demo/importexport.vue +8 -12
  46. package/src/views/demo/region.vue +103 -21
  47. package/src/views/demo/statistics.vue +38 -19
  48. package/src/views/home.vue +2 -3
  49. package/src/views/login.vue +254 -149
  50. package/src/views/operations/log/logQuartz.vue +0 -1
  51. package/src/views/operations/quartz.vue +22 -24
  52. package/src/views/system/sysAccount.vue +16 -11
  53. package/src/views/system/sysDict.vue +9 -6
  54. package/src/views/system/sysMenu.vue +17 -15
  55. package/src/views/system/sysRole.vue +44 -21
  56. package/SCAFFOLD_README.md +0 -215
  57. package/src/assets/imgs/md/1.png +0 -0
  58. package/src/assets/imgs/md/10.png +0 -0
  59. package/src/assets/imgs/md/11.png +0 -0
  60. package/src/assets/imgs/md/2.png +0 -0
  61. package/src/assets/imgs/md/3.png +0 -0
  62. package/src/assets/imgs/md/4.png +0 -0
  63. package/src/assets/imgs/md/5.png +0 -0
  64. package/src/assets/imgs/md/6.png +0 -0
  65. package/src/assets/imgs/md/7.png +0 -0
  66. package/src/assets/imgs/md/8.png +0 -0
  67. package/src/assets/imgs/md/9.png +0 -0
Binary file
Binary file
Binary file
Binary file
@@ -82,8 +82,8 @@
82
82
  <template v-if="state.expand"> <UpOutlined />收起 </template>
83
83
  <template v-else> <DownOutlined />更多搜索条件 </template>
84
84
  </a>
85
- <a-button type="primary" html-type="submit">搜索</a-button>
86
- <a-button style="margin: 0 8px" @click="resetForm">重置</a-button>
85
+ <a-button type="primary" html-type="submit">搜索</a-button>
86
+ <a-button style="margin: 0 8px" @click="resetForm">重置</a-button>
87
87
  </a-space>
88
88
  </a-col>
89
89
  </a-row>
@@ -112,18 +112,28 @@
112
112
  </template>
113
113
  <template v-if="column.key === 'operation'">
114
114
  <!-- 插槽内容 -->
115
- <a v-permission="getPermission('details')" @click="details(record)">详情</a>
115
+ <a v-permission="getPermission('details')" @click="details(record)"
116
+ >详情</a
117
+ >
118
+ <a-divider
119
+ v-if="
120
+ hasDetailsPermission &&
121
+ (hasEditPermission || hasDeletePermission)
122
+ "
123
+ type="vertical"
124
+ />
125
+ <a v-permission="getPermission('update')" @click="edit(record)"
126
+ >修改</a
127
+ >
116
128
  <a-divider
117
- v-if="hasDetailsPermission && (hasEditPermission || hasDeletePermission)"
129
+ v-if="hasEditPermission && hasDeletePermission"
118
130
  type="vertical"
119
131
  />
120
- <a v-permission="getPermission('update')" @click="edit(record)">修改</a>
121
- <a-divider v-if="hasEditPermission && hasDeletePermission" type="vertical" />
122
132
  <a-popconfirm
123
133
  title="确定要删除该数据吗?"
124
134
  @confirm="tabelDelete(record)"
125
135
  >
126
- <a v-permission="getPermission('delete')">删除</a>
136
+ <a v-permission="getPermission('delete')">删除</a>
127
137
  </a-popconfirm>
128
138
  </template>
129
139
  <!-- 如果父组件传递了对应列的插槽,则渲染插槽内容,否则默认展示数据 -->
@@ -166,7 +176,7 @@
166
176
  <DeleteOutlined />删除
167
177
  </a-button>
168
178
  <a-button
169
- type="primary"
179
+ type="primary"
170
180
  v-permission="getPermission('export')"
171
181
  @click="dataExport"
172
182
  size="middle"
@@ -174,7 +184,7 @@
174
184
  <ExportOutlined />导出
175
185
  </a-button>
176
186
  <a-button
177
- type="primary"
187
+ type="primary"
178
188
  v-permission="getPermission('import')"
179
189
  @click="showImportModal"
180
190
  size="middle"
@@ -319,7 +329,7 @@ import {
319
329
  UpOutlined,
320
330
  DownOutlined,
321
331
  InboxOutlined,
322
- FileExcelOutlined
332
+ FileExcelOutlined,
323
333
  } from '@ant-design/icons-vue'
324
334
 
325
335
  const config = configStore()
@@ -329,7 +339,7 @@ const formConfig = reactive({
329
339
  tableBordered: config.tableBordered,
330
340
  })
331
341
  // 根据模块路径生成权限标识
332
- const getPermission = (action) => {
342
+ const getPermission = action => {
333
343
  // 优先使用 permissionModulePath,如果不存在则使用 modulePath
334
344
  const pathToUse = props.permissionModulePath || props.modulePath
335
345
  if (!pathToUse) return `table:${action}`
@@ -340,7 +350,7 @@ const getPermission = (action) => {
340
350
 
341
351
  // 检查按钮权限的计算属性
342
352
  const hasDetailsPermission = computed(() => {
343
- return menu.hasPermission(getPermission('details'))
353
+ return menu.hasPermission(getPermission('details'))
344
354
  })
345
355
 
346
356
  const hasEditPermission = computed(() => {
@@ -594,7 +604,6 @@ const batchDelete = () => {
594
604
  return new Promise((resolve, reject) => {
595
605
  setTimeout(Math.random() > 0.5 ? resolve : reject, 1000)
596
606
  }).catch(() => {
597
-
598
607
  get(props.modulePath + '/' + props.ftableDeleteAction, {
599
608
  ids: state.selectedRowKeys,
600
609
  }).then(() => {
@@ -641,13 +650,15 @@ const dataExport = () => {
641
650
  downloadFilePost(
642
651
  props.modulePath + '/' + props.ftableExportAction,
643
652
  data,
644
- ).then(res => {
645
- saveAs(res.blob, res.fileName)
646
- resolve() // 请求成功后再关闭对话框
647
- }).catch(error => {
648
- console.log('Oops errors!')
649
- reject(error) // 请求失败时保持对话框打开
650
- })
653
+ )
654
+ .then(res => {
655
+ saveAs(res.blob, res.fileName)
656
+ resolve() // 请求成功后再关闭对话框
657
+ })
658
+ .catch(error => {
659
+ console.log('Oops errors!')
660
+ reject(error) // 请求失败时保持对话框打开
661
+ })
651
662
  })
652
663
  },
653
664
  onCancel() {},
@@ -675,8 +686,10 @@ const showImportModal = () => {
675
686
  */
676
687
  const beforeUpload = file => {
677
688
  // 检查文件类型
678
- const isExcel = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
679
- file.type === 'application/vnd.ms-excel'
689
+ const isExcel =
690
+ file.type ===
691
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
692
+ file.type === 'application/vnd.ms-excel'
680
693
 
681
694
  if (!isExcel) {
682
695
  message.error('只能上传Excel文件!')
@@ -723,22 +736,22 @@ const handleUpload = () => {
723
736
  uploading.value = true
724
737
 
725
738
  // 这里假设导入接口为模块路径下的import方法
726
- post(props.modulePath + '/import', formData, {
727
- }).then(res => {
739
+ post(props.modulePath + '/import', formData, {})
740
+ .then(res => {
728
741
  uploading.value = false
729
742
  message.success({
730
- content: '导入成功',
731
- duration: 1,
732
- onClose: () => {
733
- importModalVisible.value = false
734
- // 刷新表格数据
735
- tableLoad()
736
- },
737
- })
738
-
739
- }).catch(error => {
740
- uploading.value = false
741
- })
743
+ content: '导入成功',
744
+ duration: 1,
745
+ onClose: () => {
746
+ importModalVisible.value = false
747
+ // 刷新表格数据
748
+ tableLoad()
749
+ },
750
+ })
751
+ })
752
+ .catch(error => {
753
+ uploading.value = false
754
+ })
742
755
  }
743
756
 
744
757
  /**
@@ -761,7 +774,7 @@ defineExpose({
761
774
  tableLoad,
762
775
  getSelectedRows,
763
776
  getDataSource,
764
- // getBtns,
777
+ // getBtns,
765
778
  })
766
779
  </script>
767
780
  <style scoped>