mooho-base-admin-plus 0.1.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 (283) hide show
  1. package/.env +5 -0
  2. package/.env.development +0 -0
  3. package/.env.production +0 -0
  4. package/.eslintignore +11 -0
  5. package/.eslintrc.js +47 -0
  6. package/.prettierrc +15 -0
  7. package/README.md +18 -0
  8. package/dist/favicon.ico +0 -0
  9. package/dist/mooho-base-admin-plus.min.esm.js +131746 -0
  10. package/dist/mooho-base-admin-plus.min.js +279 -0
  11. package/dist/setting.js +31 -0
  12. package/dist/static/images/app-barcode.png +0 -0
  13. package/dist/static/images/login/bg.png +0 -0
  14. package/dist/static/images/login/logo.png +0 -0
  15. package/dist/static/images/login/password-active.png +0 -0
  16. package/dist/static/images/login/password-default.png +0 -0
  17. package/dist/static/images/login/signIn-img.png +0 -0
  18. package/dist/static/images/login/user-active.png +0 -0
  19. package/dist/static/images/login/user-default.png +0 -0
  20. package/dist/static/images/logo-dark.png +0 -0
  21. package/dist/static/images/logo-small.png +0 -0
  22. package/dist/static/images/logo.png +0 -0
  23. package/dist/static/images/logo.svg +510 -0
  24. package/dist/static/images/no-image.png +0 -0
  25. package/dist/style.css +4 -0
  26. package/index.html +18 -0
  27. package/other/pda.vue +28 -0
  28. package/package.json +59 -0
  29. package/public/favicon.ico +0 -0
  30. package/public/setting.js +31 -0
  31. package/public/static/images/app-barcode.png +0 -0
  32. package/public/static/images/login/bg.png +0 -0
  33. package/public/static/images/login/logo.png +0 -0
  34. package/public/static/images/login/password-active.png +0 -0
  35. package/public/static/images/login/password-default.png +0 -0
  36. package/public/static/images/login/signIn-img.png +0 -0
  37. package/public/static/images/login/user-active.png +0 -0
  38. package/public/static/images/login/user-default.png +0 -0
  39. package/public/static/images/logo-dark.png +0 -0
  40. package/public/static/images/logo-small.png +0 -0
  41. package/public/static/images/logo.png +0 -0
  42. package/public/static/images/logo.svg +510 -0
  43. package/public/static/images/no-image.png +0 -0
  44. package/src/App.vue +60 -0
  45. package/src/api/application.js +35 -0
  46. package/src/api/customModel.js +187 -0
  47. package/src/api/customPage.js +15 -0
  48. package/src/api/customTable.js +24 -0
  49. package/src/api/dataSource.js +93 -0
  50. package/src/api/dataView.js +199 -0
  51. package/src/api/dictType.js +23 -0
  52. package/src/api/entityView.js +13 -0
  53. package/src/api/enum.js +15 -0
  54. package/src/api/filterColumn.js +16 -0
  55. package/src/api/model.js +244 -0
  56. package/src/api/movePlan.js +29 -0
  57. package/src/api/notification.js +28 -0
  58. package/src/api/openApiPermission.js +25 -0
  59. package/src/api/permission.js +51 -0
  60. package/src/api/planJob.js +15 -0
  61. package/src/api/process.js +23 -0
  62. package/src/api/processDef.js +36 -0
  63. package/src/api/processInst.js +16 -0
  64. package/src/api/rolePermission.js +17 -0
  65. package/src/api/roleProperty.js +36 -0
  66. package/src/api/shortcut.js +20 -0
  67. package/src/api/system.js +23 -0
  68. package/src/api/task.js +56 -0
  69. package/src/api/taskQueue.js +24 -0
  70. package/src/api/user.js +45 -0
  71. package/src/api/viewColumn.js +16 -0
  72. package/src/assets/svg/body.svg +17 -0
  73. package/src/assets/svg/header-theme-dark.svg +40 -0
  74. package/src/assets/svg/header-theme-primary.svg +40 -0
  75. package/src/assets/svg/header-top.svg +40 -0
  76. package/src/assets/svg/icon-happy.svg +1 -0
  77. package/src/assets/svg/icon-sad.svg +1 -0
  78. package/src/assets/svg/icon-social-bilibili.svg +1 -0
  79. package/src/assets/svg/icon-social-dingding.svg +1 -0
  80. package/src/assets/svg/icon-social-facebook.svg +1 -0
  81. package/src/assets/svg/icon-social-juejin.svg +1 -0
  82. package/src/assets/svg/icon-social-qq.svg +1 -0
  83. package/src/assets/svg/icon-social-twitter.svg +1 -0
  84. package/src/assets/svg/icon-social-wechat.svg +1 -0
  85. package/src/assets/svg/icon-social-weibo.svg +1 -0
  86. package/src/assets/svg/icon-social-zhihu.svg +1 -0
  87. package/src/assets/svg/nav-theme-dark.svg +40 -0
  88. package/src/assets/svg/nav-theme-light.svg +40 -0
  89. package/src/components/copyright/index.vue +28 -0
  90. package/src/components/home/notice-list.vue +62 -0
  91. package/src/components/home/shortcut.vue +125 -0
  92. package/src/components/input/dialog-select.vue +301 -0
  93. package/src/components/input/item-select.vue +195 -0
  94. package/src/components/link/index.vue +54 -0
  95. package/src/components/richEditor/index.vue +86 -0
  96. package/src/components/upload/file-upload.vue +84 -0
  97. package/src/components/upload/upload-attachment.vue +119 -0
  98. package/src/components/upload/upload-image.vue +212 -0
  99. package/src/components/view/column-check.vue +223 -0
  100. package/src/components/view/column-edit.vue +850 -0
  101. package/src/components/view/column-select.vue +206 -0
  102. package/src/components/view/condition-edit.vue +164 -0
  103. package/src/components/view/filter-edit.vue +633 -0
  104. package/src/components/view/filter-setting.vue +126 -0
  105. package/src/components/view/form-setting-layout.vue +375 -0
  106. package/src/components/view/form-setting.vue +247 -0
  107. package/src/components/view/group-column.vue +104 -0
  108. package/src/components/view/group-method.vue +104 -0
  109. package/src/components/view/mixin.js +72 -0
  110. package/src/components/view/modal-form-filter.vue +319 -0
  111. package/src/components/view/modal-form-sort.vue +248 -0
  112. package/src/components/view/modal-form.vue +453 -0
  113. package/src/components/view/modal-table.vue +471 -0
  114. package/src/components/view/table-filter.vue +702 -0
  115. package/src/components/view/table-setting.vue +533 -0
  116. package/src/components/view/view-chart.vue +423 -0
  117. package/src/components/view/view-form-draggable.vue +837 -0
  118. package/src/components/view/view-form.vue +1444 -0
  119. package/src/components/view/view-table.vue +2261 -0
  120. package/src/components/workflow/flow-chart.vue +846 -0
  121. package/src/directive/focus.js +10 -0
  122. package/src/directive/tabHide.js +9 -0
  123. package/src/i18n/index.js +15 -0
  124. package/src/i18n/locale/en-US.js +1 -0
  125. package/src/i18n/locale/lang.js +1 -0
  126. package/src/i18n/locale/zh-CN.js +1 -0
  127. package/src/i18n/locale.js +102 -0
  128. package/src/index.js +222 -0
  129. package/src/layouts/basic-layout/header-breadcrumb/index.vue +122 -0
  130. package/src/layouts/basic-layout/header-collapse/index.vue +44 -0
  131. package/src/layouts/basic-layout/header-fullscreen/index.vue +19 -0
  132. package/src/layouts/basic-layout/header-i18n/index.vue +45 -0
  133. package/src/layouts/basic-layout/header-log/index.vue +41 -0
  134. package/src/layouts/basic-layout/header-logo/index.vue +23 -0
  135. package/src/layouts/basic-layout/header-notice/index.vue +218 -0
  136. package/src/layouts/basic-layout/header-reload/index.vue +21 -0
  137. package/src/layouts/basic-layout/header-search/index.vue +37 -0
  138. package/src/layouts/basic-layout/header-setting/index.vue +219 -0
  139. package/src/layouts/basic-layout/header-user/index.vue +175 -0
  140. package/src/layouts/basic-layout/i18n.js +50 -0
  141. package/src/layouts/basic-layout/index.vue +280 -0
  142. package/src/layouts/basic-layout/menu-head/index.vue +120 -0
  143. package/src/layouts/basic-layout/menu-head/title.vue +48 -0
  144. package/src/layouts/basic-layout/menu-side/index.vue +113 -0
  145. package/src/layouts/basic-layout/menu-side/menu-collapse.vue +76 -0
  146. package/src/layouts/basic-layout/menu-side/menu-item.vue +31 -0
  147. package/src/layouts/basic-layout/menu-side/menu-title.vue +56 -0
  148. package/src/layouts/basic-layout/menu-side/submenu.vue +31 -0
  149. package/src/layouts/basic-layout/mixins/click-item.js +21 -0
  150. package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -0
  151. package/src/layouts/basic-layout/mixins/translate-title.js +11 -0
  152. package/src/layouts/basic-layout/tabs/index.vue +192 -0
  153. package/src/layouts/basic-layout/water-mark/index.vue +29 -0
  154. package/src/libs/lodop/index.js +145 -0
  155. package/src/libs/random_str.js +10 -0
  156. package/src/libs/request/index.js +158 -0
  157. package/src/libs/system/index.js +234 -0
  158. package/src/libs/util.cookies.js +44 -0
  159. package/src/libs/util.db.js +13 -0
  160. package/src/libs/util.js +55 -0
  161. package/src/libs/util.log.js +88 -0
  162. package/src/libs/water-mark.js +44 -0
  163. package/src/menu/header.js +20 -0
  164. package/src/menu/modules/dashboard.js +23 -0
  165. package/src/menu/sider.js +12 -0
  166. package/src/mixins/app.js +9 -0
  167. package/src/mixins/page.js +643 -0
  168. package/src/pages/account/login.vue +101 -0
  169. package/src/pages/common/home.vue +169 -0
  170. package/src/pages/common/task-form.vue +350 -0
  171. package/src/pages/common/todo.vue +31 -0
  172. package/src/pages/system/apiLog.vue +79 -0
  173. package/src/pages/system/applicationType.vue +182 -0
  174. package/src/pages/system/customPage.vue +62 -0
  175. package/src/pages/system/customTable.vue +98 -0
  176. package/src/pages/system/dict.vue +36 -0
  177. package/src/pages/system/dictType.vue +58 -0
  178. package/src/pages/system/entityView.vue +38 -0
  179. package/src/pages/system/error/404.vue +6 -0
  180. package/src/pages/system/extendColumn.vue +99 -0
  181. package/src/pages/system/formView.vue +136 -0
  182. package/src/pages/system/log.vue +55 -0
  183. package/src/pages/system/notice.vue +26 -0
  184. package/src/pages/system/openApi.vue +26 -0
  185. package/src/pages/system/openUser.vue +66 -0
  186. package/src/pages/system/organization.vue +98 -0
  187. package/src/pages/system/organizationType.vue +26 -0
  188. package/src/pages/system/permission.vue +175 -0
  189. package/src/pages/system/planJob.vue +40 -0
  190. package/src/pages/system/printTemplate.vue +48 -0
  191. package/src/pages/system/process.vue +79 -0
  192. package/src/pages/system/processType.vue +26 -0
  193. package/src/pages/system/role.vue +395 -0
  194. package/src/pages/system/rolePropertyEdit.vue +480 -0
  195. package/src/pages/system/sequenceSetting.vue +26 -0
  196. package/src/pages/system/systemData.vue +52 -0
  197. package/src/pages/system/tableView.vue +386 -0
  198. package/src/pages/system/taskQueue.vue +48 -0
  199. package/src/pages/system/user.vue +250 -0
  200. package/src/pages/template/processPage.vue +243 -0
  201. package/src/pages/template/reportPage.vue +66 -0
  202. package/src/pages/template/viewPage.vue +139 -0
  203. package/src/plugins/auth/index.js +21 -0
  204. package/src/plugins/error/index.js +31 -0
  205. package/src/plugins/index.js +24 -0
  206. package/src/plugins/sweetalert2/index.js +20 -0
  207. package/src/router/dynamic.js +183 -0
  208. package/src/router/index.js +84 -0
  209. package/src/setting.js +202 -0
  210. package/src/store/index.js +9 -0
  211. package/src/store/modules/admin/index.js +16 -0
  212. package/src/store/modules/admin/modules/account.js +103 -0
  213. package/src/store/modules/admin/modules/cache.js +119 -0
  214. package/src/store/modules/admin/modules/dataView.js +112 -0
  215. package/src/store/modules/admin/modules/db.js +231 -0
  216. package/src/store/modules/admin/modules/i18n.js +87 -0
  217. package/src/store/modules/admin/modules/layout.js +115 -0
  218. package/src/store/modules/admin/modules/loader.js +44 -0
  219. package/src/store/modules/admin/modules/log.js +77 -0
  220. package/src/store/modules/admin/modules/menu.js +338 -0
  221. package/src/store/modules/admin/modules/page.js +466 -0
  222. package/src/store/modules/admin/modules/user.js +96 -0
  223. package/src/store/modules/admin/modules/viewPage.js +34 -0
  224. package/src/styles/common.less +47 -0
  225. package/src/styles/css/default.css +510 -0
  226. package/src/styles/css/login.css +1217 -0
  227. package/src/styles/default/index.less +6 -0
  228. package/src/styles/font/demo.css +539 -0
  229. package/src/styles/font/demo_index.html +372 -0
  230. package/src/styles/font/icon-demo/demo.css +539 -0
  231. package/src/styles/font/icon-demo/demo_index.html +423 -0
  232. package/src/styles/font/icon-demo/iconfont.css +61 -0
  233. package/src/styles/font/icon-demo/iconfont.eot +0 -0
  234. package/src/styles/font/icon-demo/iconfont.js +1 -0
  235. package/src/styles/font/icon-demo/iconfont.svg +59 -0
  236. package/src/styles/font/icon-demo/iconfont.ttf +0 -0
  237. package/src/styles/font/icon-demo/iconfont.woff +0 -0
  238. package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
  239. package/src/styles/font/iconfont.css +47 -0
  240. package/src/styles/font/iconfont.js +1 -0
  241. package/src/styles/font/iconfont.json +65 -0
  242. package/src/styles/font/iconfont.ttf +0 -0
  243. package/src/styles/font/iconfont.woff +0 -0
  244. package/src/styles/font/iconfont.woff2 +0 -0
  245. package/src/styles/font/ionicons.svg +870 -0
  246. package/src/styles/font/ionicons.ttf +0 -0
  247. package/src/styles/font/ionicons.woff +0 -0
  248. package/src/styles/font/ionicons.woff2 +0 -0
  249. package/src/styles/index.less +7 -0
  250. package/src/styles/layout/basic-layout/layout.less +527 -0
  251. package/src/styles/layout/basic-layout/menu.less +274 -0
  252. package/src/styles/layout/index.less +2 -0
  253. package/src/styles/setting.less +6 -0
  254. package/styleguide.config.js +22 -0
  255. package/test/api/barcode.js +50 -0
  256. package/test/api/inbound.js +47 -0
  257. package/test/api/interfaceLog.js +15 -0
  258. package/test/api/interfaceQueue.js +15 -0
  259. package/test/api/interfaceServer.js +29 -0
  260. package/test/api/movePlan.js +50 -0
  261. package/test/api/movePlanItem.js +13 -0
  262. package/test/api/moveType.js +22 -0
  263. package/test/api/openApiPermission.js +25 -0
  264. package/test/api/outbound.js +40 -0
  265. package/test/api/permission.js +34 -0
  266. package/test/api/rolePermission.js +17 -0
  267. package/test/api/user.js +40 -0
  268. package/test/api/viewColumn.js +16 -0
  269. package/test/api/warehouse.js +13 -0
  270. package/test/api/warehouseMoveType.js +18 -0
  271. package/test/main.js +55 -0
  272. package/test/package.js +33 -0
  273. package/test/pages/home/index.vue +22 -0
  274. package/test/pages/task/test.vue +28 -0
  275. package/test/pages/test/dataViewTest.vue +28 -0
  276. package/test/pages/test/logReport.vue +25 -0
  277. package/test/pages/test/testPage.vue +38 -0
  278. package/test/router/routes.js +88 -0
  279. package/test/setting.env.js +22 -0
  280. package/test/styles/css/custom.css +0 -0
  281. package/test/styles/css/login.css +1217 -0
  282. package/vite.config.js +72 -0
  283. package/vue.config.js +20 -0
@@ -0,0 +1,386 @@
1
+ <template>
2
+ <div>
3
+ <div class="i-layout-page-header">
4
+ <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
5
+ </div>
6
+ <Card :bordered="false" dis-hover class="ivu-mt">
7
+ <view-table ref="table" view-code="TableView" :filter="filter" :selectEnable="true" @create="create" @edit="edit">
8
+ <template #filterCommand>
9
+ <Button size="small" type="info" custom-icon="fa fa-cloud-download-alt" @click="exportFile()">导出</Button>
10
+ <file-upload url="api/DataView/importFile" accept=".view" @on-success="importFileSuccess" style="display: inline-block; margin-left: 4px; margin-right: 4px">
11
+ <template #>
12
+ <Button type="primary" custom-icon="fa fa-cloud-upload-alt" size="small">导入</Button>
13
+ </template>
14
+ </file-upload>
15
+ </template>
16
+ <template #command="{ row }">
17
+ <Button size="small" title="字段设置" type="info" custom-icon="fa fa-bars" @click="tableSetting(row)"></Button>
18
+ <Button size="small" title="筛选设置" type="info" custom-icon="fa fa-filter" @click="filterSetting(row)"></Button>
19
+ </template>
20
+ </view-table>
21
+ </Card>
22
+ <modal-form ref="form" view-code="TableViewEdit" @on-change="formChange" @on-after-save="$refs.table.loadData()">
23
+ <template #column="{ data, code }">
24
+ <div v-if="code == 'keywordColumn'">
25
+ <Input type="text" :readonly="true" v-model="data.keywordColumn" @click="keywordColumnOpen()"></Input>
26
+ </div>
27
+ <div v-if="code == 'sorting'">
28
+ <Input type="text" :readonly="true" v-model="$refs.form.data.sorting" @click="openSort">
29
+ <template #prepend>
30
+ <Button custom-icon="fa fa-edit" @click="openSort"></Button>
31
+ </template>
32
+ </Input>
33
+ </div>
34
+ <div v-if="code == 'filtering'">
35
+ <Input type="text" :readonly="true" v-model="$refs.form.data.filtering" @click="openFilter">
36
+ <template #prepend>
37
+ <Button custom-icon="fa fa-edit" @click="openFilter"></Button>
38
+ </template>
39
+ </Input>
40
+ </div>
41
+ <div v-if="code == 'batchSelectDataCode'">
42
+ <Input type="text" :readonly="true" v-model="$refs.form.data.batchSelectDataCode" @click="openColumnCheck($refs.form.data, 'batchSelectDataCode')">
43
+ <template #prepend>
44
+ <Button custom-icon="fa fa-search" @click="openColumnCheck($refs.form.data, 'batchSelectDataCode')"></Button>
45
+ </template>
46
+ </Input>
47
+ </div>
48
+ <div v-if="code == 'groupColumn'">
49
+ <Input
50
+ type="text"
51
+ :readonly="true"
52
+ v-model="$refs.form.data.groupColumn"
53
+ @click="
54
+ $refs.groupColumn.open($refs.form.data.model, $refs.form.data.groupColumn, json => {
55
+ $refs.form.data.groupColumn = json;
56
+ })
57
+ "
58
+ >
59
+ <template #prepend>
60
+ <Button
61
+ custom-icon="fa fa-edit"
62
+ @click="
63
+ $refs.groupColumn.open($refs.form.data.model, $refs.form.data.groupColumn, json => {
64
+ $refs.form.data.groupColumn = json;
65
+ })
66
+ "
67
+ ></Button>
68
+ </template>
69
+ </Input>
70
+ </div>
71
+ <div v-if="code == 'groupMethod'">
72
+ <Input
73
+ type="text"
74
+ :readonly="true"
75
+ v-model="$refs.form.data.groupMethod"
76
+ @click="
77
+ $refs.groupMethod.open($refs.form.data.model, $refs.form.data.groupMethod, json => {
78
+ $refs.form.data.groupMethod = json;
79
+ })
80
+ "
81
+ >
82
+ <template #prepend>
83
+ <Button
84
+ custom-icon="fa fa-edit"
85
+ @click="
86
+ $refs.groupMethod.open($refs.form.data.model, $refs.form.data.groupMethod, json => {
87
+ $refs.form.data.groupMethod = json;
88
+ })
89
+ "
90
+ ></Button>
91
+ </template>
92
+ </Input>
93
+ </div>
94
+ <div v-if="code == 'editEnable'">
95
+ <Switch
96
+ :model-value="!!data.editEnable"
97
+ v-if="showCheck(data.editEnableJson)"
98
+ @update:model-value="
99
+ $event => {
100
+ data.editEnable = $event;
101
+ //$forceUpdate();
102
+ }
103
+ "
104
+ @on-change="checkChange('editEnableJson', 'editEnable')"
105
+ />
106
+ <Button
107
+ style="margin-left: 8px"
108
+ @click="$refs.conditionEdit.open(data, 'editEnableJson', 'editEnable', $refs.form.data.model)"
109
+ type="primary"
110
+ size="small"
111
+ icon="ios-settings"
112
+ >
113
+ 条件
114
+ </Button>
115
+ </div>
116
+ <div v-if="code == 'removeEnable'">
117
+ <Switch
118
+ :model-value="!!data.removeEnable"
119
+ v-if="showCheck(data.removeEnableJson)"
120
+ @update:model-value="
121
+ $event => {
122
+ data.removeEnable = $event;
123
+ //$forceUpdate();
124
+ }
125
+ "
126
+ @on-change="checkChange('removeEnableJson', 'removeEnable')"
127
+ />
128
+ <Button
129
+ style="margin-left: 8px"
130
+ @click="$refs.conditionEdit.open(data, 'removeEnableJson', 'removeEnable', $refs.form.data.model)"
131
+ type="primary"
132
+ size="small"
133
+ icon="ios-settings"
134
+ >
135
+ 条件
136
+ </Button>
137
+ </div>
138
+ </template>
139
+ <template #footer>
140
+ <Button type="primary" custom-icon="fa fa-save" @click="() => $refs.form.onSave()">保存</Button>
141
+ <Button type="primary" v-if="canCopy" custom-icon="fa fa-copy" @click="copy">复制</Button>
142
+ </template>
143
+ </modal-form>
144
+ <modal-form-sort ref="modal_sort" :sort="data.sorting" :dataView="data" @bindSort="bindSort" />
145
+ <modal-form-filter ref="modal_filter" :filter="data.filtering" :dataView="data" @bindFilter="bindFilter" />
146
+ <table-setting ref="tableSetting" />
147
+ <filter-setting ref="filterSetting" />
148
+ <column-select ref="columnSelect" />
149
+ <column-check ref="columnCheck" />
150
+ <group-method ref="groupMethod" />
151
+ <group-column ref="groupColumn" />
152
+ <condition-edit ref="conditionEdit" />
153
+ </div>
154
+ </template>
155
+ <script>
156
+ import dataViewApi from '../../api/dataView';
157
+ import mixinPage from '../../mixins/page';
158
+ import viewColumnApi from '../../api/viewColumn';
159
+ import filterColumnApi from '../../api/filterColumn';
160
+ import columnSelect from '../../components/view/column-select';
161
+ import columnCheck from '../../components/view/column-check';
162
+ import filterSetting from '../../components/view/filter-setting';
163
+ import groupMethod from '../../components/view/group-method';
164
+ import groupColumn from '../../components/view/group-column';
165
+ import conditionEdit from '../../components/view/condition-edit';
166
+
167
+ export default {
168
+ name: 'system-ui-tableView',
169
+ mixins: [mixinPage],
170
+ components: { columnSelect, columnCheck, filterSetting, groupMethod, groupColumn, conditionEdit },
171
+ data() {
172
+ return {
173
+ filter: {
174
+ viewType: 'TableView',
175
+ newCode: null
176
+ },
177
+ data: {},
178
+ canCopy: null
179
+ };
180
+ },
181
+ computed: {},
182
+ created() {},
183
+ methods: {
184
+ formChange() {
185
+ const data = this.$refs.form.data;
186
+ const columns = this.$refs.form.columns;
187
+
188
+ const columnModel = columns.find(item => {
189
+ return item.code === 'model';
190
+ });
191
+ const columnDataSource = columns.find(item => {
192
+ return item.code === 'dataSource';
193
+ });
194
+ const columnIsVirtual = columns.find(item => {
195
+ return item.code === 'isVirtual';
196
+ });
197
+ // const columnBatchSelectDataCode = columns.find(item => {
198
+ // return item.code === 'batchSelectDataCode';
199
+ // });
200
+ // const columnHolder1 = columns.find(item => {
201
+ // return item.code === 'holder1';
202
+ // });
203
+
204
+ if (data.isDataSource) {
205
+ columnIsVirtual.isShow = false;
206
+ columnModel.isShow = false;
207
+ columnDataSource.isShow = true;
208
+ } else {
209
+ columnIsVirtual.isShow = true;
210
+ columnDataSource.isShow = false;
211
+
212
+ if (data.isVirtual) {
213
+ columnModel.isShow = false;
214
+ } else {
215
+ columnModel.isShow = true;
216
+ }
217
+ }
218
+
219
+ // if (data.batchSelectEnable) {
220
+ // columnBatchSelectDataCode.isShow = true;
221
+ // columnHolder1.isShow = false;
222
+ // } else {
223
+ // columnBatchSelectDataCode.isShow = false;
224
+ // columnHolder1.isShow = true;
225
+ // }
226
+
227
+ //this.$refs.form.forceUpdate();
228
+ },
229
+ // 字段设置
230
+ async tableSetting(row) {
231
+ let res = await viewColumnApi.queryByDataViewID(row.id);
232
+ this.$refs.tableSetting.open(row, res.data);
233
+ },
234
+ // 筛选设置
235
+ async filterSetting(row) {
236
+ let res = await filterColumnApi.queryByDataViewID(row.id);
237
+ this.$refs.filterSetting.open(row, res.data);
238
+ },
239
+ //绑定排序组件返回的排序json
240
+ bindSort(value) {
241
+ this.$refs.form.data.sorting = value;
242
+ // this.data.sorting = value;
243
+ },
244
+ //绑定筛选组件返回的排序json
245
+ bindFilter(value) {
246
+ this.$refs.form.data.filtering = value;
247
+ // this.data.filtering = value;
248
+ },
249
+ // 打开排序编辑框
250
+ async openSort() {
251
+ if (!this.$refs.form.data.model == '') {
252
+ this.data = this.$refs.form.data;
253
+ this.$refs.modal_sort.open();
254
+ } else {
255
+ this.error('请先选择模型!');
256
+ }
257
+ },
258
+ // 打开筛选编辑框
259
+ async openFilter() {
260
+ if (!this.$refs.form.data.model == '') {
261
+ this.data = this.$refs.form.data;
262
+ this.$refs.modal_filter.open();
263
+ } else {
264
+ this.error('请先选择模型!');
265
+ }
266
+ },
267
+ // 导出文件
268
+ exportFile() {
269
+ let ids = this.$refs.table.getSelected().map(x => {
270
+ return x.id;
271
+ });
272
+ if (ids.length > 0) {
273
+ dataViewApi.exportFile(ids);
274
+ } else {
275
+ this.error('请选择需要导出的内容!');
276
+ }
277
+ },
278
+ // 导入成功
279
+ importFileSuccess(res) {
280
+ if (res.code == 0) {
281
+ this.success('导入成功!', () => {
282
+ this.$refs.table.loadData();
283
+ });
284
+ } else {
285
+ this.error(res.message);
286
+ }
287
+ },
288
+ // 复制
289
+ copy() {
290
+ if (!this.$refs.form.data.id) {
291
+ this.error('新建时不能复制');
292
+ return;
293
+ }
294
+
295
+ this.confirmInput(
296
+ '确认要复制并创建新的视图吗?',
297
+ '视图代码',
298
+ async () => {
299
+ let dataView = await dataViewApi.copy(this.$refs.form.data.id, this.newCode);
300
+ this.$refs.form.open(dataView);
301
+ this.$refs.table.loadData();
302
+ },
303
+ newCode => {
304
+ if (!(newCode || '').trim()) {
305
+ this.warning('请输入需要创建的视图代码!');
306
+ return false;
307
+ } else {
308
+ this.newCode = newCode;
309
+ return true;
310
+ }
311
+ }
312
+ );
313
+ },
314
+ // 新建
315
+ create() {
316
+ this.canCopy = false;
317
+ this.$refs.form.openDefault({ viewType: 'TableView' });
318
+ },
319
+ // 编辑
320
+ edit({ row }) {
321
+ this.canCopy = true;
322
+ this.$refs.form.open(row);
323
+ },
324
+ // 打开字段选择界面
325
+ openColumnCheck(data, code) {
326
+ if (data.model == null) {
327
+ return;
328
+ }
329
+
330
+ this.$refs.columnCheck.open(data.model, checked => {
331
+ data[code] = checked.code;
332
+ //this.$forceUpdate();
333
+ });
334
+ },
335
+ // 打开筛选字段选择
336
+ keywordColumnOpen() {
337
+ if (!(this.$refs.form.data.model || '').trim()) {
338
+ this.error('请先选择模型!');
339
+ return;
340
+ }
341
+
342
+ let data = this.$refs.form.data;
343
+ let keywordColumn = data.keywordColumn;
344
+ let columns = [];
345
+
346
+ if (!!(keywordColumn || '').trim()) {
347
+ columns = keywordColumn.split(',').map(item => {
348
+ return { code: item };
349
+ });
350
+ }
351
+
352
+ this.$refs.columnSelect.open(this.$refs.form.data, columns, checked => {
353
+ this.$refs.form.data.keywordColumn = checked
354
+ .map(item => {
355
+ return item.code;
356
+ })
357
+ .join();
358
+
359
+ //this.$forceUpdate();
360
+ });
361
+ },
362
+ // 是否显示选择框
363
+ showCheck(json) {
364
+ if (!(json || '').trim()) {
365
+ return true;
366
+ } else {
367
+ let setting = JSON.parse(json);
368
+
369
+ return setting.type == 'True' || setting.type == 'False';
370
+ }
371
+ },
372
+ // 选择框变化
373
+ checkChange(jsonKey, checkKey) {
374
+ if (!!(this.data[jsonKey] || '').trim()) {
375
+ let setting = JSON.parse(this.data[jsonKey]);
376
+ if (this.data[checkKey]) {
377
+ setting.type = 'True';
378
+ } else {
379
+ setting.type = 'False';
380
+ }
381
+ this.data[jsonKey] = JSON.stringify(setting);
382
+ }
383
+ }
384
+ }
385
+ };
386
+ </script>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div>
3
+ <div class="i-layout-page-header">
4
+ <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
5
+ </div>
6
+ <Card :bordered="false" dis-hover class="ivu-mt">
7
+ <view-table ref="table" view-code="TaskQueue">
8
+ <template #command="{ row }">
9
+ <Button size="small" title="执行" type="primary" custom-icon="fa fa-bolt" @click="execute(row)"></Button>
10
+ <Button size="small" v-if="row.status == 'Pending' || row.status == 'Retry'" title="取消" type="warning" custom-icon="fa fa-times" @click="cancel(row)"></Button>
11
+ </template>
12
+ </view-table>
13
+ </Card>
14
+ </div>
15
+ </template>
16
+ <script>
17
+ import mixinPage from '../../mixins/page';
18
+ import taskQueueApi from '../../api/taskQueue';
19
+
20
+ export default {
21
+ name: 'system-taskQueue',
22
+ mixins: [mixinPage],
23
+ components: {},
24
+ data() {
25
+ return {};
26
+ },
27
+ computed: {},
28
+ created() {},
29
+ methods: {
30
+ // 执行
31
+ execute(row) {
32
+ this.confirm('确定要立即执行该任务吗?', async () => {
33
+ await taskQueueApi.execute(row.id);
34
+ this.success('操作成功!');
35
+ this.$refs.table.loadData();
36
+ });
37
+ },
38
+ // 取消
39
+ cancel(row) {
40
+ this.confirm('确定要取消该任务吗?', async () => {
41
+ await taskQueueApi.cancel(row.id);
42
+ this.success('取消成功');
43
+ this.$refs.table.loadData();
44
+ });
45
+ }
46
+ }
47
+ };
48
+ </script>
@@ -0,0 +1,250 @@
1
+ <template>
2
+ <div>
3
+ <div class="i-layout-page-header">
4
+ <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
5
+ </div>
6
+ <Card :bordered="false" dis-hover class="ivu-mt">
7
+ <view-table ref="table" view-code="User" @create="$refs.form.open()">
8
+ <template #command="{ row }">
9
+ <Button size="small" title="角色" type="info" custom-icon="fa fa-users" @click="$refs.userRoleTable.open({ userID: row.id })"></Button>
10
+ <Button size="small" title="编辑" type="primary" custom-icon="fa fa-edit" @click="$refs.form.open(row)"></Button>
11
+ <Button size="small" title="删除" type="warning" custom-icon="fa fa-trash-alt" @click="$refs.table.remove(row)"></Button>
12
+ </template>
13
+ </view-table>
14
+ </Card>
15
+ <modal-form ref="form" view-code="UserEdit" @on-after-save="$refs.table.loadData()">
16
+ <template #footer>
17
+ <Button type="primary" custom-icon="fa fa-save" @click="$refs.form.onSave()">保存</Button>
18
+ <Button type="primary" custom-icon="fa fa-user-lock" @click="resetPassword">重置密码</Button>
19
+ </template>
20
+ </modal-form>
21
+ <modal-table ref="userRoleTable" view-code="UserRole" @edit="({ row }) => editUserRole(row)">
22
+ <template #filterCommand>
23
+ <Button size="small" type="primary" custom-icon="fa fa-plus" @click="addUserRole()">添加</Button>
24
+ </template>
25
+ </modal-table>
26
+ <modal-form ref="userRoleForm" view-code="UserRoleEdit" @on-after-save="$refs.userRoleTable.loadData()" @on-change="userRoleChange">
27
+ <template #bottom>
28
+ <view-table ref="userRoleDataTable" view-code="UserRoleDataEdit" :static="true">
29
+ <template #column="{ row, code }">
30
+ <template v-if="row.controlType === 'TextInput'">
31
+ <Input type="text" size="small" v-model="row.propertyValue" />
32
+ </template>
33
+ <template v-else-if="row.controlType === 'NumberInput'">
34
+ <Input type="number" size="small" number v-model="row.propertyValue" />
35
+ </template>
36
+ <template v-else-if="row.controlType === 'Select'">
37
+ <Select size="small" v-model="row.propertyValue" clearable :transfer="true">
38
+ <Option v-for="item in row._dataSource" :key="item.id" :value="item.id">{{ item.name }}</Option>
39
+ </Select>
40
+ </template>
41
+ <template v-else-if="row.controlType === 'DialogSelect'">
42
+ <dialog-select
43
+ v-model="row.propertyValue"
44
+ size="small"
45
+ :source="row.source"
46
+ :source-data-code="row.sourceDataCode"
47
+ :source-display-code="row.sourceDisplayCode"
48
+ :param="getParam(row)"
49
+ ></dialog-select>
50
+ </template>
51
+ <template v-else-if="row.controlType === 'MultiDialogSelect'">
52
+ <dialog-select
53
+ v-model="row.propertyValue"
54
+ size="small"
55
+ :multi="true"
56
+ :source="row.source"
57
+ :source-data-code="row.sourceDataCode"
58
+ :source-display-code="row.sourceDisplayCode"
59
+ :param="getParam(row)"
60
+ ></dialog-select>
61
+ </template>
62
+ <template v-else-if="row.controlType === 'Check'">
63
+ <Checkbox :model-value="!!parseData(row, code)" @update:model-value="$event => setData(row, code, $event)" />
64
+ </template>
65
+ </template>
66
+ </view-table>
67
+ </template>
68
+ <template #footer>
69
+ <Button type="primary" custom-icon="fa fa-save" @click="userRoleSave">保存</Button>
70
+ </template>
71
+ </modal-form>
72
+ </div>
73
+ </template>
74
+ <script>
75
+ import mixinPage from '../../mixins/page';
76
+ import modelApi from '../../api/model';
77
+ import userApi from '../../api/user';
78
+ import customModelApi from '../../api/customModel';
79
+
80
+ export default {
81
+ name: 'system-user',
82
+ mixins: [mixinPage],
83
+ components: {},
84
+ data() {
85
+ return {
86
+ userID: null,
87
+ factories: []
88
+ };
89
+ },
90
+ computed: {},
91
+ created() {},
92
+ methods: {
93
+ // 给角色添加用户
94
+ async addUserRole() {
95
+ this.$refs.userRoleForm.columns.find(item => item.code == 'roleID').isReadonly = false;
96
+
97
+ this.$refs.userRoleDataTable.loadData([]);
98
+ this.$refs.userRoleForm.openDefault(this.$refs.userRoleTable.param);
99
+ },
100
+ // 用户角色编辑
101
+ async editUserRole(row) {
102
+ this.$refs.userRoleForm.columns.find(item => item.code == 'roleID').isReadonly = true;
103
+
104
+ this.initUserRoleData(row.userID, row.roleID);
105
+ this.$refs.userRoleForm.open(row);
106
+ },
107
+ // 加载数据源
108
+ async initDataSource() {
109
+ for (let i = 0; i < this.roleProperties.length; i++) {
110
+ let item = this.roleProperties[i];
111
+ if (!!(item.source || '').trim()) {
112
+ if (item.controlType === 'Select') {
113
+ item._dataSource = [];
114
+ let param = this.getParam(item);
115
+
116
+ // 选择框、单选框组
117
+ if (param != null) {
118
+ await this.fillDataSource(item, param);
119
+ }
120
+ }
121
+ }
122
+ }
123
+ },
124
+ // 填充数据源
125
+ async fillDataSource(data, param) {
126
+ // 参数完整,查询数据
127
+ let res;
128
+ if (data.isSourceCustom) {
129
+ res = await customModelApi.query(data.source, param);
130
+ } else {
131
+ res = await modelApi.query(data.source, param);
132
+ }
133
+ res.data.forEach(item => {
134
+ data._dataSource.push({
135
+ id: !(data.sourceDataCode || '').trim() ? item.id : this.parseData(item, data.sourceDataCode),
136
+ name: this.parseData(item, data.sourceDisplayCode)
137
+ });
138
+ });
139
+ },
140
+ // 获取参数
141
+ getParam(data) {
142
+ let param = {};
143
+
144
+ if (!!(data.param || '').trim()) {
145
+ // 有参数
146
+ param = JSON.parse(data.param);
147
+
148
+ // 填充参数
149
+ for (let key in param) {
150
+ // 常量
151
+ let index = param[key].search(/^\[.*?\]$/);
152
+ if (index === 0) {
153
+ param[key] = param[key].substring(1, param[key].length - 1);
154
+ continue;
155
+ }
156
+
157
+ // 变量
158
+ let paramData = this.parseData(data, param[key]);
159
+
160
+ if (paramData != null) {
161
+ param[key] = paramData;
162
+ continue;
163
+ }
164
+
165
+ // 参数不完整
166
+ return null;
167
+ }
168
+ }
169
+
170
+ return param;
171
+ },
172
+ // 用户角色保存
173
+ async userRoleSave() {
174
+ let isOK = await this.$refs.userRoleForm.validate();
175
+
176
+ if (!isOK) {
177
+ this.error('有内容不符合要求,请正确填写!');
178
+ } else {
179
+ this.confirm('确定要保存吗?', async () => {
180
+ let userRole = this.$refs.userRoleForm.getFullData();
181
+
182
+ if (!userRole) {
183
+ // 表格验证失败
184
+ return;
185
+ }
186
+
187
+ let userRoleDatas = this.$refs.userRoleDataTable.data;
188
+
189
+ let data = {
190
+ userRole,
191
+ userRoleDatas
192
+ };
193
+
194
+ if (!userRole.id) {
195
+ await modelApi.add('UserRole', data);
196
+ } else {
197
+ await modelApi.update('UserRole', data);
198
+ }
199
+
200
+ this.success('操作成功!', () => {
201
+ this.$refs.userRoleDataTable.loadData([]);
202
+ this.$refs.userRoleTable.loadData();
203
+ this.$refs.userRoleForm.close();
204
+ });
205
+ });
206
+ }
207
+ },
208
+ // 角色变化
209
+ async userRoleChange(sender) {
210
+ if (sender && sender.code == 'roleID') {
211
+ let roleID = this.$refs.userRoleForm.data.roleID;
212
+ let userID = this.$refs.userRoleForm.data.userID;
213
+
214
+ this.initUserRoleData(userID, roleID);
215
+ }
216
+ },
217
+ // 初始化用户角色数据
218
+ async initUserRoleData(userID, roleID) {
219
+ let res = await modelApi.query('RoleProperty', { roleID });
220
+ let roleProperties = res.data;
221
+
222
+ let userRoleDatas = [];
223
+
224
+ if (this.$refs.userRoleForm.data.id) {
225
+ res = await modelApi.query('UserRoleData', { userID: userID, roleID: roleID });
226
+ userRoleDatas = res.data;
227
+ }
228
+
229
+ this.roleProperties = roleProperties.map(roleProperty => {
230
+ let userRoleData = userRoleDatas.find(item => item.propertyCode == roleProperty.propertyCode);
231
+
232
+ return {
233
+ ...roleProperty,
234
+ propertyValue: userRoleData == null ? null : userRoleData.propertyValue
235
+ };
236
+ });
237
+ await this.initDataSource();
238
+
239
+ this.$refs.userRoleDataTable.loadData(this.roleProperties);
240
+ },
241
+ // 重置密码
242
+ async resetPassword() {
243
+ this.confirm('确定要重置该用户的密码吗?', async () => {
244
+ await userApi.resetPassword(this.$refs.form.data.id);
245
+ this.success('已重置为初始密码!');
246
+ });
247
+ }
248
+ }
249
+ };
250
+ </script>