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,247 @@
1
+ <template>
2
+ <div>
3
+ <modal-table ref="table" :static="true" :setting-enable="false" :footer-enable="true" :draggable="true" :sticky="true" @on-drag-drop="dragDrop" v-if="active">
4
+ <template #command="{ row, index }">
5
+ <Button size="small" title="编辑" type="primary" ghost custom-icon="fa fa-edit" @click="edit(row, index)"></Button>
6
+ <Button size="small" title="上移" type="primary" ghost custom-icon="fa fa-chevron-up" @click="up(row, index)"></Button>
7
+ <Button size="small" title="下移" type="primary" ghost custom-icon="fa fa-chevron-down" @click="down(row, index)"></Button>
8
+ <Button size="small" title="移除" type="primary" ghost custom-icon="fa fa-times" @click="remove(row, index)"></Button>
9
+ </template>
10
+ <template #footer>
11
+ <Button type="primary" ghost custom-icon="fa fa-eye" @click="layoutMode">预览模式</Button>
12
+ <Button type="primary" v-if="!dataView.isVirtual" ghost custom-icon="fa fa-indent" @click="openColumnSelect">选择字段</Button>
13
+ <Button type="primary" custom-icon="fa fa-bookmark" @click="createVirtual">虚拟字段</Button>
14
+ <Button type="primary" custom-icon="fa fa-save" v-if="!isSetting" @click="save">保存</Button>
15
+ <Button type="error" custom-icon="fa fa-save" v-if="isSetting" @click="globalSave">全局保存</Button>
16
+ <Button type="error" custom-icon="fa fa-cog" v-if="isSetting" @click="setting">表单设置</Button>
17
+ </template>
18
+ </modal-table>
19
+ <column-select ref="columnSelect" />
20
+ <column-edit ref="columnEdit" view-type="FormView" />
21
+ <modal-form ref="setting" view-code="FormViewSetting" v-if="isSetting">
22
+ <template #footer>
23
+ <Button type="primary" custom-icon="fa fa-save" @click="saveSetting">保存</Button>
24
+ </template>
25
+ </modal-form>
26
+ </div>
27
+ </template>
28
+ <script>
29
+ import mixinPage from '../../mixins/page';
30
+ import columnSelect from './column-select';
31
+ import columnEdit from './column-edit';
32
+ import { mapActions } from 'vuex';
33
+
34
+ export default {
35
+ mixins: [mixinPage],
36
+ components: { columnSelect, columnEdit },
37
+ data() {
38
+ return {
39
+ active: false,
40
+ dataView: {}
41
+ };
42
+ },
43
+ created() {},
44
+ props: {
45
+ // 是否公共配置界面
46
+ isSetting: {
47
+ type: Boolean,
48
+ default: false
49
+ }
50
+ },
51
+ computed: {},
52
+ methods: {
53
+ ...mapActions('admin/dataView', {
54
+ saveDataView: 'save',
55
+ saveDataViewSetting: 'saveSetting'
56
+ }),
57
+ // 打开
58
+ open(dataView, columns) {
59
+ this.dataView = dataView;
60
+ this.active = true;
61
+
62
+ setTimeout(async () => {
63
+ await this.$refs.table.init('FormViewColumn');
64
+ this.$refs.table.loadData(columns);
65
+ this.$refs.table.open();
66
+ });
67
+ },
68
+ // 关闭
69
+ close() {
70
+ this.$refs.table.close();
71
+ },
72
+ // 打开字段设置界面
73
+ edit(row, index) {
74
+ this.$refs.columnEdit.open(row, index, this.$refs.table.data, data => {
75
+ let columns = this.$refs.table.data;
76
+ columns.splice(index, 1, data);
77
+
78
+ this.$refs.table.loadData(columns);
79
+ });
80
+ },
81
+ // 上移
82
+ up(row, index) {
83
+ let columns = this.$refs.table.data;
84
+ if (index > 0) {
85
+ columns.splice(index, 1);
86
+ columns.splice(index - 1, 0, row);
87
+
88
+ this.$refs.table.loadData(columns);
89
+ }
90
+ },
91
+ // 下移
92
+ down(row, index) {
93
+ let columns = this.$refs.table.data;
94
+ if (index < columns.length - 1) {
95
+ columns.splice(index, 1);
96
+ columns.splice(index + 1, 0, row);
97
+
98
+ this.$refs.table.loadData(columns);
99
+ }
100
+ },
101
+ // 拖动完成
102
+ dragDrop({ index1, index2 }) {
103
+ if (index1 != index2) {
104
+ let columns = this.$refs.table.data;
105
+ let row = columns[index1];
106
+
107
+ columns.splice(index1, 1);
108
+ columns.splice(index2, 0, row);
109
+ }
110
+ },
111
+ // 移除
112
+ remove(row, index) {
113
+ let columns = this.$refs.table.data;
114
+ columns.splice(index, 1);
115
+
116
+ this.$refs.table.loadData(columns);
117
+ },
118
+ // 打开字段选择界面
119
+ openColumnSelect() {
120
+ let columns = this.$refs.table.data;
121
+ this.$refs.columnSelect.open(this.dataView, columns, checked => {
122
+ // 移除未勾选的
123
+ columns = columns.filter(column => {
124
+ return (
125
+ checked.some(item => {
126
+ return column.code === item.code;
127
+ }) || column.isVirtual
128
+ );
129
+ });
130
+
131
+ // 添加新勾选的
132
+ checked.forEach(item => {
133
+ if (
134
+ !columns.some(column => {
135
+ return column.code === item.code;
136
+ })
137
+ ) {
138
+ columns.push({
139
+ code: item.code,
140
+ name: item.name,
141
+ dataType: item.dataType,
142
+ dataView: this.dataView,
143
+ isShow: true,
144
+ controlType: this.getDefaultControlType(item.dataType),
145
+ columnWidth: 'Column6', // 默认宽度1/2
146
+ source: item.objColumn != null ? item.objColumn.dataType : null,
147
+ sourceDataCode: item.objColumn != null ? 'id' : null,
148
+ sourceModel: item.objColumn != null ? item.objColumn.dataType : null,
149
+ sourceDisplayCode:
150
+ item.objColumn != null &&
151
+ item.objColumn.columns.some(function (column) {
152
+ return column.code === item.objColumn.code + '.name';
153
+ })
154
+ ? 'name'
155
+ : null
156
+ });
157
+ }
158
+ });
159
+
160
+ setTimeout(() => {
161
+ this.$refs.table.loadData(columns);
162
+ });
163
+ });
164
+ },
165
+ // 创建虚拟字段
166
+ createVirtual() {
167
+ let columns = this.$refs.table.data;
168
+
169
+ let row = {
170
+ isShow: true,
171
+ isVirtual: true,
172
+ dataType: 'String',
173
+ dataView: this.dataView
174
+ };
175
+
176
+ this.$refs.columnEdit.open(row, -1, this.$refs.table.data, data => {
177
+ columns.push(data);
178
+ this.$refs.table.loadData(columns);
179
+ });
180
+ },
181
+ // 全局保存
182
+ globalSave() {
183
+ this.confirm('确定要保存全局设置吗?', () => {
184
+ this.confirm('本次操作将修改全局设置,确认要保存吗?', async () => {
185
+ await this.saveDataView({
186
+ code: this.dataView.code,
187
+ columns: this.$refs.table.data
188
+ });
189
+
190
+ this.$emit('on-change', this.dataView.code);
191
+ this.success('保存成功!', () => {
192
+ this.$refs.table.close();
193
+ });
194
+ });
195
+ });
196
+ },
197
+ // 保存
198
+ save() {
199
+ this.confirm('确定要保存设置吗?', async () => {
200
+ await this.saveDataView({
201
+ code: this.dataView.code,
202
+ columns: this.$refs.table.data
203
+ });
204
+
205
+ this.success('保存成功!', () => {
206
+ this.$refs.table.close();
207
+ });
208
+ });
209
+ },
210
+ // 设置
211
+ setting() {
212
+ this.$refs.setting.open(this.copy(this.dataView));
213
+ },
214
+ // 保存设置
215
+ saveSetting() {
216
+ this.confirm('确定要保存设置吗?', async () => {
217
+ let res = await this.saveDataViewSetting(this.$refs.setting.data);
218
+ this.dataView = res.dataView;
219
+
220
+ this.$emit('on-change', this.dataView.code);
221
+ this.success('保存成功!', () => {
222
+ this.$refs.setting.close();
223
+ });
224
+ });
225
+ },
226
+ // 切换至预览模式
227
+ layoutMode() {
228
+ this.$emit('layout-mode', {
229
+ dataView: this.dataView,
230
+ columns: this.$refs.table.data
231
+ });
232
+ },
233
+ // 获取默认控件类型
234
+ getDefaultControlType(dataType) {
235
+ if (dataType == 'Integer' || dataType == 'BigInteger' || dataType == 'Decimal' || dataType == 'Float' || dataType == 'Double') {
236
+ return 'NumberInput';
237
+ } else if (dataType == 'Boolean') {
238
+ return 'Check';
239
+ } else if (dataType == 'DateTime') {
240
+ return 'Date';
241
+ } else {
242
+ return 'TextInput';
243
+ }
244
+ }
245
+ }
246
+ };
247
+ </script>
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div>
3
+ <modal-table ref="table" view-code="GroupColumn" :static="true" :footer-enable="true" @create="editItem()" @edit="({ row, index }) => editItem(row, index)">
4
+ <template #command="{ row, index }">
5
+ <Button size="small" title="删除" type="warning" custom-icon="fa fa-trash-alt" @click="removeItem(row, index)"></Button>
6
+ </template>
7
+ <template #footer>
8
+ <Button type="primary" custom-icon="fa fa-save" @click="save">保存</Button>
9
+ </template>
10
+ </modal-table>
11
+ <modal-form ref="form" view-code="GroupColumnEdit">
12
+ <template #column="{ data, code }">
13
+ <div v-if="code == 'columnExp'">
14
+ <Input type="text" v-model="data.columnExp" :readonly="true" @click="columnCheck(model, data)">
15
+ <template #prepend>
16
+ <Button custom-icon="fa fa-search" @click="columnCheck(model, data)"></Button>
17
+ </template>
18
+ </Input>
19
+ </div>
20
+ </template>
21
+ <template #footer>
22
+ <Button type="primary" custom-icon="fa fa-save" @click="saveItem">保存</Button>
23
+ </template>
24
+ </modal-form>
25
+ <column-check ref="columnCheck" />
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import mixinPage from '../../mixins/page';
31
+ import columnCheck from './column-check';
32
+
33
+ export default {
34
+ mixins: [mixinPage],
35
+ components: { columnCheck },
36
+ props: {},
37
+ computed: {},
38
+ data() {
39
+ return {
40
+ model: null,
41
+ data: [],
42
+ editIndex: null,
43
+ callback: null
44
+ };
45
+ },
46
+ async created() {},
47
+ methods: {
48
+ open(model, json, callback) {
49
+ if (!(model || '').trim()) {
50
+ this.error('请先选择模型!');
51
+ return;
52
+ }
53
+
54
+ this.model = model;
55
+ this.callback = callback;
56
+
57
+ if (json) {
58
+ this.data = JSON.parse(json);
59
+ } else {
60
+ this.data = [];
61
+ }
62
+ this.$refs.table.loadData(this.data);
63
+ this.$refs.table.open();
64
+ },
65
+ editItem(row, index) {
66
+ this.editIndex = index;
67
+ this.$refs.form.open(row);
68
+ },
69
+ async saveItem() {
70
+ let isOK = await this.$refs.form.validate();
71
+
72
+ if (!isOK) {
73
+ this.error('有内容不符合要求,请正确填写!');
74
+ } else {
75
+ if (this.editIndex == null) {
76
+ this.data.push(this.$refs.form.data);
77
+ } else {
78
+ this.data.splice(this.editIndex, 1, this.$refs.form.data);
79
+ }
80
+ this.$refs.table.loadData(this.data);
81
+ this.$refs.form.close();
82
+ }
83
+ },
84
+ removeItem(row, index) {
85
+ this.data.splice(index, 1);
86
+ this.$refs.table.loadData(this.data);
87
+ },
88
+ save() {
89
+ let json = this.data.length > 0 ? JSON.stringify(this.data) : null;
90
+ this.callback(json);
91
+ this.$refs.table.close();
92
+ },
93
+ columnCheck(model, data) {
94
+ this.$refs.columnCheck.open(model, column => {
95
+ data.columnExp = column.code;
96
+ data.property = column.code.split('.').pop();
97
+ data.dataType = column.dataType;
98
+
99
+ this.$refs.form.refresh();
100
+ });
101
+ }
102
+ }
103
+ };
104
+ </script>
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div>
3
+ <modal-table ref="table" view-code="GroupMethod" :static="true" :footer-enable="true" @create="editItem()" @edit="({ row, index }) => editItem(row, index)">
4
+ <template #command="{ row, index }">
5
+ <Button size="small" title="删除" type="warning" custom-icon="fa fa-trash-alt" @click="removeItem(row, index)"></Button>
6
+ </template>
7
+ <template #footer>
8
+ <Button type="primary" custom-icon="fa fa-save" @click="save">保存</Button>
9
+ </template>
10
+ </modal-table>
11
+ <modal-form ref="form" view-code="GroupMethodEdit">
12
+ <template #column="{ data, code }">
13
+ <div v-if="code == 'columnExp'">
14
+ <Input type="text" v-model="data.columnExp" :readonly="true" @click="columnCheck(model, data)">
15
+ <template #prepend>
16
+ <Button custom-icon="fa fa-search" @click="columnCheck(model, data)"></Button>
17
+ </template>
18
+ </Input>
19
+ </div>
20
+ </template>
21
+ <template #footer>
22
+ <Button type="primary" custom-icon="fa fa-save" @click="saveItem">保存</Button>
23
+ </template>
24
+ </modal-form>
25
+ <column-check ref="columnCheck" />
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import mixinPage from '../../mixins/page';
31
+ import columnCheck from './column-check';
32
+
33
+ export default {
34
+ mixins: [mixinPage],
35
+ components: { columnCheck },
36
+ props: {},
37
+ computed: {},
38
+ data() {
39
+ return {
40
+ model: null,
41
+ data: [],
42
+ editIndex: null,
43
+ callback: null
44
+ };
45
+ },
46
+ async created() {},
47
+ methods: {
48
+ open(model, json, callback) {
49
+ if (!(model || '').trim()) {
50
+ this.error('请先选择模型!');
51
+ return;
52
+ }
53
+
54
+ this.model = model;
55
+ this.callback = callback;
56
+
57
+ if (json) {
58
+ this.data = JSON.parse(json);
59
+ } else {
60
+ this.data = [];
61
+ }
62
+ this.$refs.table.loadData(this.data);
63
+ this.$refs.table.open();
64
+ },
65
+ editItem(row, index) {
66
+ this.editIndex = index;
67
+ this.$refs.form.open(row);
68
+ },
69
+ async saveItem() {
70
+ let isOK = await this.$refs.form.validate();
71
+
72
+ if (!isOK) {
73
+ this.error('有内容不符合要求,请正确填写!');
74
+ } else {
75
+ if (this.editIndex == null) {
76
+ this.data.push(this.$refs.form.data);
77
+ } else {
78
+ this.data.splice(this.editIndex, 1, this.$refs.form.data);
79
+ }
80
+ this.$refs.table.loadData(this.data);
81
+ this.$refs.form.close();
82
+ }
83
+ },
84
+ removeItem(row, index) {
85
+ this.data.splice(index, 1);
86
+ this.$refs.table.loadData(this.data);
87
+ },
88
+ save() {
89
+ let json = this.data.length > 0 ? JSON.stringify(this.data) : null;
90
+ this.callback(json);
91
+ this.$refs.table.close();
92
+ },
93
+ columnCheck(model, data) {
94
+ this.$refs.columnCheck.open(model, column => {
95
+ data.columnExp = column.code;
96
+ data.property = column.code.split('.').pop();
97
+ data.dataType = column.dataType;
98
+
99
+ //this.$forceUpdate();
100
+ });
101
+ }
102
+ }
103
+ };
104
+ </script>
@@ -0,0 +1,72 @@
1
+ export default {
2
+ data() {
3
+ return {};
4
+ },
5
+ computed: {},
6
+ methods: {
7
+ // 获取表格宽度
8
+ getGrid(columnWidth) {
9
+ switch (columnWidth) {
10
+ case 'Column12':
11
+ return this.grid24;
12
+ case 'Column9':
13
+ return this.grid18;
14
+ case 'Column8':
15
+ return this.grid16;
16
+ case 'Column6':
17
+ return this.grid12;
18
+ case 'Column4':
19
+ return this.grid8;
20
+ case 'Column3':
21
+ return this.grid6;
22
+ case 'Column2':
23
+ return this.grid4;
24
+ default:
25
+ return this.grid6;
26
+ }
27
+ },
28
+ // 获取参数
29
+ getParam(data, column, parentData) {
30
+ let param = {};
31
+
32
+ if (!!(column.param || '').trim()) {
33
+ // 有参数
34
+ param = JSON.parse(column.param);
35
+
36
+ // 填充参数
37
+ for (let key in param) {
38
+ // 常量
39
+ let index = param[key].search(/^\[.*?\]$/);
40
+ if (index === 0) {
41
+ param[key] = param[key].substring(1, param[key].length - 1);
42
+ continue;
43
+ }
44
+
45
+ // 变量
46
+ if (param[key].substr(0, 2) == '$.' && parentData != null) {
47
+ // 父对象
48
+ let paramData = this.parseData(parentData, param[key].substr(2));
49
+
50
+ if (paramData != null) {
51
+ param[key] = paramData;
52
+ continue;
53
+ }
54
+ } else {
55
+ // 自身对象
56
+ let paramData = this.parseData(data, param[key]);
57
+
58
+ if (paramData != null) {
59
+ param[key] = paramData;
60
+ continue;
61
+ }
62
+ }
63
+
64
+ // 参数不完整
65
+ return null;
66
+ }
67
+ }
68
+
69
+ return param;
70
+ }
71
+ }
72
+ };