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,101 @@
1
+ <template>
2
+ <div class="signIn">
3
+ <div class="box cf">
4
+ <div class="left" :style="{ background: 'url(' + rootPath + 'images/login/signIn-img.png) center center no-repeat', 'background-size': 'cover' }">
5
+ <h3>{{ sysInfo.banner }}</h3>
6
+ <p>{{ sysInfo.subBanner }}</p>
7
+ </div>
8
+ <div class="right">
9
+ <div class="logo cf">
10
+ <img :src="rootPath + 'images/login/logo.png'" />
11
+ <h2>{{ sysInfo.title }}</h2>
12
+ <small></small>
13
+ </div>
14
+ <input type="text" v-model="username" @keyup="submit" class="username" autofocus placeholder="请输入账号" />
15
+ <input type="password" v-model="password" @keyup="submit" class="password" placeholder="请输入密码" />
16
+ <!--<div class="remenber">
17
+ <label for="remenber" class="remenber1"><input type="checkbox" ng-model="remember">记住我</label>
18
+ </div>-->
19
+ <button type="button" @click="submit()" class="sign-in">登录 Login</button>
20
+ <button type="button" @click="close" class="exit">退出 Exit</button>
21
+ </div>
22
+ </div>
23
+ <div class="cpt">{{ sysInfo.copyright }}</div>
24
+ </div>
25
+ </template>
26
+ <script>
27
+ import { mapActions } from 'vuex';
28
+ import router from '../../router';
29
+ import mixinPage from '../../mixins/page';
30
+ //import permissionApi from '../../api/permission';
31
+
32
+ export default {
33
+ mixins: [mixinPage],
34
+ components: {},
35
+ data() {
36
+ return {
37
+ username: '',
38
+ password: '',
39
+ autoLogin: true
40
+ };
41
+ },
42
+ created() {},
43
+ computed: {},
44
+ methods: {
45
+ ...mapActions('admin/account', ['login']),
46
+ /**
47
+ * @description 登录
48
+ * 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
49
+ */
50
+ async submit(e) {
51
+ if (e) {
52
+ var keycode = window.event ? e.keyCode : e.which;
53
+
54
+ if (!keycode) {
55
+ return;
56
+ }
57
+
58
+ if (keycode !== 0 && keycode !== 1 && keycode !== 13) {
59
+ return;
60
+ }
61
+ }
62
+
63
+ if (this.username && this.password) {
64
+ await this.login({
65
+ username: this.username,
66
+ password: this.password
67
+ });
68
+
69
+ // 初始化菜单和权限
70
+ // let res = await permissionApi.query();
71
+
72
+ // // 默认包含首页
73
+ // res.menus.unshift({
74
+ // name: '首页',
75
+ // subName: 'Home',
76
+ // parentID: null,
77
+ // url: 'home',
78
+ // templateUrl: '@/home',
79
+ // icon: 'fa fa-home'
80
+ // });
81
+
82
+ // this.$store.dispatch('admin/menu/setSider', res.menus);
83
+ // this.$store.dispatch('admin/permission/set', res.permissions);
84
+
85
+ // 重定向对象不存在则返回顶层路径
86
+ setTimeout(() => {
87
+ router.replace(this.$route.query.redirect || '/home');
88
+ });
89
+ }
90
+ },
91
+ close() {
92
+ this.confirm('确定要关闭系统吗?\r\nAre you sure to exit?', () => {
93
+ window.location.href = 'about:blank';
94
+ window.close();
95
+ });
96
+ }
97
+ }
98
+ };
99
+ </script>
100
+
101
+ <style src="../../styles/css/login.css" scoped></style>
@@ -0,0 +1,169 @@
1
+ <template>
2
+ <div>
3
+ <Row :gutter="24" class="ivu-mt">
4
+ <Col :xxl="8" :xl="12" :lg="12" :md="12" :sm="24" :xs="24" class="ivu-mb">
5
+ <div>
6
+ <Row :gutter="24">
7
+ <Col v-bind="grid" class="ivu-mb">
8
+ <Card :bordered="false" :padding="12">
9
+ <template #title>
10
+ <p>
11
+ <span>检测任务</span>
12
+ </p>
13
+ </template>
14
+ <div class="stat">
15
+ <div class="icon">
16
+ <Icon type="md-speedometer" color="rgb(24, 144, 255)" />
17
+ </div>
18
+ <div class="content">
19
+ <div>
20
+ <Numeral value="85" format="0,0" v-font="30" />
21
+ <div class="value1">待分派</div>
22
+ </div>
23
+ <div>
24
+ <Numeral value="85" format="0,0" v-font="20" />
25
+ <div class="value2">已分派</div>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </Card>
30
+ </Col>
31
+ <Col v-bind="grid" class="ivu-mb">
32
+ <Card :bordered="false" :padding="12">
33
+ <template #title>
34
+ <p>
35
+ <span>原始记录</span>
36
+ </p>
37
+ </template>
38
+ <div class="stat">
39
+ <div class="icon">
40
+ <Icon type="md-list-box" color="rgb(250, 173, 20)" />
41
+ </div>
42
+ <div class="content">
43
+ <div>
44
+ <Numeral value="85" format="0,0" v-font="30" />
45
+ <div class="value1">待分派</div>
46
+ </div>
47
+ <div>
48
+ <Numeral value="85" format="0,0" v-font="20" />
49
+ <div class="value2">已分派</div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </Card>
54
+ </Col>
55
+ <Col v-bind="grid" class="ivu-mb">
56
+ <Card :bordered="false" :padding="12">
57
+ <template #title>
58
+ <p>
59
+ <span>检测报告</span>
60
+ </p>
61
+ </template>
62
+ <div class="stat">
63
+ <div class="icon">
64
+ <Icon type="md-print" color="rgb(19, 194, 194)" />
65
+ </div>
66
+ <div class="content">
67
+ <div>
68
+ <Numeral value="85" format="0,0" v-font="30" />
69
+ <div class="value1">待分派</div>
70
+ </div>
71
+ <div>
72
+ <Numeral value="85" format="0,0" v-font="20" />
73
+ <div class="value2">已分派</div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </Card>
78
+ </Col>
79
+ <Col v-bind="grid" class="ivu-mb">
80
+ <Card :bordered="false" :padding="12">
81
+ <template #title>
82
+ <p>
83
+ <span>检测样件</span>
84
+ </p>
85
+ </template>
86
+ <div class="stat">
87
+ <div class="icon">
88
+ <Icon type="md-analytics" color="#b37feb" />
89
+ </div>
90
+ <div class="content">
91
+ <div>
92
+ <Numeral value="85" format="0,0" v-font="30" />
93
+ <div class="value1">待分派</div>
94
+ </div>
95
+ <div>
96
+ <Numeral value="85" format="0,0" v-font="20" />
97
+ <div class="value2">已分派</div>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </Card>
102
+ </Col>
103
+ </Row>
104
+ </div>
105
+ </Col>
106
+ <Col :xl="10" :lg="8" :md="8" :sm="12" :xs="24" class="ivu-mb">
107
+ <notice-list />
108
+ </Col>
109
+ <Col :xl="6" :lg="8" :md="8" :sm="12" :xs="24" class="ivu-mb">
110
+ <shortcut />
111
+ </Col>
112
+ </Row>
113
+ </div>
114
+ </template>
115
+ <script>
116
+ import mixinPage from '../../mixins/page';
117
+ import shortcut from '../../components/home/shortcut';
118
+ import noticeList from '../../components/home/notice-list';
119
+
120
+ export default {
121
+ name: 'home',
122
+ mixins: [mixinPage],
123
+ components: { noticeList, shortcut },
124
+ data() {
125
+ return {
126
+ grid: {
127
+ xl: 12,
128
+ lg: 12,
129
+ md: 12,
130
+ sm: 12,
131
+ xs: 12
132
+ }
133
+ };
134
+ },
135
+ async mounted() {},
136
+ methods: {}
137
+ };
138
+ </script>
139
+
140
+ <style scoped>
141
+ .stat {
142
+ display: flex;
143
+ }
144
+ .stat .icon {
145
+ width: 50%;
146
+ margin-left: auto;
147
+ margin-right: auto;
148
+ text-align: center;
149
+ }
150
+
151
+ .stat .icon i {
152
+ font-size: 64px;
153
+ }
154
+
155
+ .stat .content {
156
+ width: 50%;
157
+ }
158
+
159
+ .stat .content .value1 {
160
+ font-size: 12px;
161
+ float: right;
162
+ margin-top: 18px;
163
+ }
164
+ .stat .content .value2 {
165
+ font-size: 12px;
166
+ float: right;
167
+ margin-top: 8px;
168
+ }
169
+ </style>
@@ -0,0 +1,350 @@
1
+ <template>
2
+ <div>
3
+ <Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" :width="width">
4
+ <template #header>
5
+ <div>
6
+ <!--
7
+ @slot 页头
8
+ -->
9
+ <slot name="header">
10
+ <span class="title">{{ name }}</span>
11
+ <span class="description">{{ description }}</span>
12
+ </slot>
13
+ </div>
14
+ </template>
15
+ <div class="ivu-ml-8 ivu-mr-8">
16
+ <view-form v-show="!isCustom" ref="form" :readonly="readonly"></view-form>
17
+ <component v-show="isCustom" :is="customComponent" :readonly="readonly" ref="customComponent"></component>
18
+ </div>
19
+ <template #footer>
20
+ <div>
21
+ <Button v-for="(item, index) in outcomes" :key="index" type="primary" custom-icon="fa fa-check-circle" @click="action(item)">
22
+ {{ item.name == null ? '同意' : item.name }}
23
+ </Button>
24
+ <Button type="warning" v-if="isRejectable" custom-icon="fa fa-reply" @click="reject()">拒绝</Button>
25
+ <Button type="primary" v-if="isBackable" custom-icon="fa fa-share" @click="back()">退回上一步</Button>
26
+ <Button type="primary" v-if="isRedirectable" custom-icon="fa fa-share" @click="$refs.redirectTaskForm.open()">转办</Button>
27
+ <Button type="primary" v-if="isMessageEnable" custom-icon="fa fa-comment-dots" @click="openMessage()">发表意见</Button>
28
+ <Button type="info" custom-icon="fa fa-history" @click="$refs.approvalHistoryTable.open({ processInstID: task.processInstID })">历史</Button>
29
+ <Button type="default" custom-icon="fa fa-times" @click="opened = false">关闭</Button>
30
+ </div>
31
+ </template>
32
+ </Modal>
33
+ <modal-table ref="approvalHistoryTable" view-code="ApprovalHistoryModal"></modal-table>
34
+ <modal-form ref="redirectTaskForm" view-code="RedirectTask">
35
+ <template #footer>
36
+ <Button type="primary" custom-icon="fa fa-check" @click="redirect()">确定</Button>
37
+ </template>
38
+ </modal-form>
39
+ <Modal v-model="messageOpened" scrollable>
40
+ <template #header>
41
+ <div>
42
+ <span class="title">意见发表</span>
43
+ <span class="description">Message</span>
44
+ </div>
45
+ </template>
46
+ <div class="ivu-ml-8 ivu-mr-8">
47
+ <Form ref="messageForm" :model="messageData" label-position="top" label-colon=":" class="ivu-mt" @submit.prevent>
48
+ <Row :gutter="24" type="flex">
49
+ <Col v-bind="grid24">
50
+ <FormItem
51
+ label="意见内容"
52
+ key="message"
53
+ prop="message"
54
+ :rules="{
55
+ required: true,
56
+ message: '请输入',
57
+ trigger: 'blur,change'
58
+ }"
59
+ >
60
+ <Input type="textarea" :rows="6" v-model="messageData.message" />
61
+ </FormItem>
62
+ </Col>
63
+ </Row>
64
+ </Form>
65
+ </div>
66
+ <template #footer>
67
+ <Button type="primary" custom-icon="fa fa-check" @click="submitMessage">提交</Button>
68
+ <Button type="default" custom-icon="fa fa-times" @click="messageOpened = false">关闭</Button>
69
+ </template>
70
+ </Modal>
71
+ </div>
72
+ </template>
73
+ <script>
74
+ import mixinPage from '../../mixins/page';
75
+ import customModelApi from '../../api/customModel';
76
+ import processInstApi from '../../api/processInst';
77
+ import modelApi from '../../api/model';
78
+ import taskApi from '../../api/task';
79
+
80
+ export default {
81
+ mixins: [mixinPage],
82
+ components: {},
83
+ data() {
84
+ return {
85
+ task: null,
86
+ model: null,
87
+ comment: null,
88
+ outcomes: [],
89
+ readonly: true,
90
+ isRejectable: false,
91
+ isBackable: false,
92
+ isRedirectable: false,
93
+ isMessageEnable: false,
94
+ messageData: {
95
+ message: null
96
+ },
97
+ messageOpened: false,
98
+ opened: false,
99
+ isCustom: false,
100
+ width: 800,
101
+ name: null,
102
+ description: null,
103
+ customComponent: null,
104
+ form: null
105
+ };
106
+ },
107
+ async created() {},
108
+ computed: {},
109
+ methods: {
110
+ // 打开
111
+ async open(row) {
112
+ let applicationType = row.processInst.applicationType;
113
+ this.outcomes = [];
114
+ this.task = row;
115
+ this.isRejectable = this.task.activityInst.activity.isRejectable;
116
+ this.isBackable = this.task.activityInst.activity.isBackable;
117
+ this.isRedirectable = this.task.activityInst.activity.isRedirectable;
118
+ this.isMessageEnable = this.task.processInst.isMessageEnable;
119
+ this.isCustom = false;
120
+
121
+ if (this.task.activityInst.activity.pageMode == 'Page') {
122
+ // 路由跳转
123
+ this.$router.push({ path: this.task.activityInst.activity.routerPath, query: { taskID: row.id } });
124
+ return;
125
+ } else if (this.task.activityInst.activity.pageMode == 'Component') {
126
+ // 动态组件
127
+ this.customComponent = this.$pages[this.task.activityInst.activity.templateUrl]; // 动态组件
128
+ this.isCustom = true;
129
+
130
+ setTimeout(async () => {
131
+ if (applicationType.isCustom) {
132
+ this.model = await customModelApi.get(applicationType.model, row.processInst.modelID);
133
+ } else {
134
+ this.model = await modelApi.get(applicationType.model, row.processInst.modelID);
135
+ }
136
+
137
+ this.form = this.$refs.customComponent.form;
138
+ this.form.data = this.model;
139
+ this.readonly = !this.task.activityInst.activity.isEditable;
140
+
141
+ if (this.form.formView) {
142
+ this.width = this.form.formView.width || '800';
143
+ this.name = this.form.formView.name;
144
+ this.description = this.form.formView.description;
145
+ }
146
+
147
+ this.opened = true;
148
+ });
149
+ } else if (this.task.activityInst.activity.pageMode == 'Form') {
150
+ this.form = this.$refs.form;
151
+ this.form.init(this.task.activityInst.activity.formViewCode, async view => {
152
+ if (view.dataView.isCustom) {
153
+ this.model = await customModelApi.get(applicationType.model, row.processInst.modelID);
154
+ } else {
155
+ this.model = await modelApi.get(applicationType.model, row.processInst.modelID);
156
+ }
157
+
158
+ this.readonly = !this.task.activityInst.activity.isEditable;
159
+ this.width = this.form.formView.width || '800';
160
+ this.name = this.form.formView.name;
161
+ this.description = this.form.formView.description;
162
+ this.form.data = this.model;
163
+
164
+ setTimeout(() => {
165
+ this.form.onDataChange();
166
+ this.form.clearValidate();
167
+ this.opened = true;
168
+ });
169
+ });
170
+ } else if (applicationType.pageMode == 'Page') {
171
+ this.$router.push({ path: applicationType.routerPath, query: { taskID: row.id } });
172
+ return;
173
+ } else if (applicationType.pageMode == 'Component') {
174
+ // 动态组件
175
+ this.customComponent = this.$pages[applicationType.templateUrl]; // 动态组件
176
+ this.isCustom = true;
177
+
178
+ if (applicationType.isCustom) {
179
+ this.model = await customModelApi.get(applicationType.model, row.processInst.modelID);
180
+ } else {
181
+ this.model = await modelApi.get(applicationType.model, row.processInst.modelID);
182
+ }
183
+
184
+ this.form = this.$refs.customComponent.form;
185
+ this.form.data = this.model;
186
+ this.readonly = !this.task.activityInst.activity.isEditable;
187
+
188
+ if (this.form.formView) {
189
+ this.width = this.form.formView.width || '800';
190
+ this.name = this.form.formView.name;
191
+ this.description = this.form.formView.description;
192
+ }
193
+
194
+ this.opened = true;
195
+ } else if (applicationType.pageMode == 'Form') {
196
+ this.form = this.$refs.form;
197
+ this.form.init(applicationType.formViewCode, async view => {
198
+ if (view.dataView.isCustom) {
199
+ this.model = await customModelApi.get(applicationType.model, row.processInst.modelID);
200
+ } else {
201
+ this.model = await modelApi.get(applicationType.model, row.processInst.modelID);
202
+ }
203
+
204
+ this.readonly = !this.task.activityInst.activity.isEditable;
205
+ this.width = this.form.formView.width || '800';
206
+ this.name = this.form.formView.name;
207
+ this.description = this.form.formView.description;
208
+ this.form.data = this.model;
209
+
210
+ setTimeout(() => {
211
+ this.form.onDataChange();
212
+ this.form.clearValidate();
213
+ this.opened = true;
214
+ });
215
+ });
216
+ } else {
217
+ this.error('配置错误,没有相应的处理界面!');
218
+ return;
219
+ }
220
+
221
+ let res = await modelApi.query('Outcome', { activityFromID: row.activityInst.activityID });
222
+ this.outcomes = res.data;
223
+
224
+ // res = await modelApi.query('Task', { processInstID: row.processInstID });
225
+ // this.$refs.approvalHistoryTable.loadData(res.data);
226
+ },
227
+ // 执行结果
228
+ async action(outcome) {
229
+ let isOK = await this.form.validate();
230
+
231
+ if (!isOK) {
232
+ this.error('有内容不符合要求,请正确填写!');
233
+ } else {
234
+ this.confirmInput(
235
+ '确认要' + (outcome.name == null ? '同意' : outcome.name) + '该申请吗?',
236
+ '备注',
237
+ async () => {
238
+ let data = null;
239
+ if (!this.readonly) {
240
+ data = this.form.getFullData();
241
+
242
+ if (!data) {
243
+ // 表格验证失败
244
+ return;
245
+ }
246
+ }
247
+
248
+ await taskApi.do(this.task.id, outcome.id, data, this.comment);
249
+ this.success('处理成功!');
250
+ this.resetNotice();
251
+ this.$emit('on-after-action');
252
+ this.opened = false;
253
+ },
254
+ comment => {
255
+ this.comment = comment;
256
+ return true;
257
+ }
258
+ );
259
+ }
260
+ },
261
+ // 拒绝
262
+ async reject() {
263
+ this.confirmInput(
264
+ '确认要拒绝该申请吗?',
265
+ '备注',
266
+ async () => {
267
+ await taskApi.reject(this.task.id, this.comment);
268
+ this.success('处理成功!');
269
+ this.resetNotice();
270
+ this.$emit('on-after-action');
271
+ this.opened = false;
272
+ },
273
+ comment => {
274
+ if (!(comment || '').trim()) {
275
+ this.warning('请输入拒绝原因!');
276
+ return false;
277
+ } else {
278
+ this.comment = comment;
279
+ return true;
280
+ }
281
+ }
282
+ );
283
+ },
284
+ // 退回上一步
285
+ async back() {
286
+ this.confirmInput(
287
+ '确认要退回上一步吗?',
288
+ '备注',
289
+ async () => {
290
+ await taskApi.back(this.task.id, this.comment);
291
+ this.success('处理成功!');
292
+ this.resetNotice();
293
+ this.$emit('on-after-action');
294
+ this.opened = false;
295
+ },
296
+ comment => {
297
+ if (!(comment || '').trim()) {
298
+ this.warning('请输入退回原因!');
299
+ return false;
300
+ } else {
301
+ this.comment = comment;
302
+ return true;
303
+ }
304
+ }
305
+ );
306
+ },
307
+ // 转办
308
+ async redirect() {
309
+ let isOK = await this.$refs.redirectTaskForm.validate();
310
+
311
+ if (!isOK) {
312
+ this.error('有内容不符合要求,请正确填写!');
313
+ } else {
314
+ let model = this.$refs.redirectTaskForm.data;
315
+
316
+ this.confirm('确定要将任务转移给 ' + model.target.name + ' 吗?', async () => {
317
+ await taskApi.redirect(this.task.id, model.targetID, model.comment);
318
+ this.success('转办成功!');
319
+ this.resetNotice();
320
+ this.$emit('on-after-action');
321
+ this.$refs.redirectTaskForm.close();
322
+ this.opened = false;
323
+ });
324
+ }
325
+ },
326
+ // 打开意见输入
327
+ openMessage() {
328
+ this.messageData.message = null;
329
+ this.messageOpened = true;
330
+ },
331
+ // 提交意见
332
+ async submitMessage() {
333
+ let isOK = await this.$refs.messageForm.validate();
334
+
335
+ if (!isOK) {
336
+ this.error('有内容不符合要求,请正确填写!');
337
+ } else {
338
+ this.confirm('确定要发表意见吗?', async () => {
339
+ await processInstApi.addMessage(this.task.processInstID, this.messageData.message);
340
+
341
+ this.success('操作成功!', () => {
342
+ this.messageData.message = null;
343
+ this.messageOpened = false;
344
+ });
345
+ });
346
+ }
347
+ }
348
+ }
349
+ };
350
+ </script>
@@ -0,0 +1,31 @@
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="TodoList">
8
+ <template #command="{ row }">
9
+ <Button size="small" title="详细" type="info" custom-icon="fa fa-file-alt" @click="$refs.taskForm.open(row)"></Button>
10
+ </template>
11
+ </view-table>
12
+ </Card>
13
+ <task-form ref="taskForm" @on-after-action="$refs.table.loadData()"></task-form>
14
+ </div>
15
+ </template>
16
+ <script>
17
+ import mixinPage from '../../mixins/page';
18
+ import taskForm from './task-form';
19
+
20
+ export default {
21
+ name: 'common-myTask',
22
+ mixins: [mixinPage],
23
+ components: { taskForm },
24
+ data() {
25
+ return {};
26
+ },
27
+ computed: {},
28
+ created() {},
29
+ methods: {}
30
+ };
31
+ </script>