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.
- package/.env +5 -0
- package/.env.development +0 -0
- package/.env.production +0 -0
- package/.eslintignore +11 -0
- package/.eslintrc.js +47 -0
- package/.prettierrc +15 -0
- package/README.md +18 -0
- package/dist/favicon.ico +0 -0
- package/dist/mooho-base-admin-plus.min.esm.js +131746 -0
- package/dist/mooho-base-admin-plus.min.js +279 -0
- package/dist/setting.js +31 -0
- package/dist/static/images/app-barcode.png +0 -0
- package/dist/static/images/login/bg.png +0 -0
- package/dist/static/images/login/logo.png +0 -0
- package/dist/static/images/login/password-active.png +0 -0
- package/dist/static/images/login/password-default.png +0 -0
- package/dist/static/images/login/signIn-img.png +0 -0
- package/dist/static/images/login/user-active.png +0 -0
- package/dist/static/images/login/user-default.png +0 -0
- package/dist/static/images/logo-dark.png +0 -0
- package/dist/static/images/logo-small.png +0 -0
- package/dist/static/images/logo.png +0 -0
- package/dist/static/images/logo.svg +510 -0
- package/dist/static/images/no-image.png +0 -0
- package/dist/style.css +4 -0
- package/index.html +18 -0
- package/other/pda.vue +28 -0
- package/package.json +59 -0
- package/public/favicon.ico +0 -0
- package/public/setting.js +31 -0
- package/public/static/images/app-barcode.png +0 -0
- package/public/static/images/login/bg.png +0 -0
- package/public/static/images/login/logo.png +0 -0
- package/public/static/images/login/password-active.png +0 -0
- package/public/static/images/login/password-default.png +0 -0
- package/public/static/images/login/signIn-img.png +0 -0
- package/public/static/images/login/user-active.png +0 -0
- package/public/static/images/login/user-default.png +0 -0
- package/public/static/images/logo-dark.png +0 -0
- package/public/static/images/logo-small.png +0 -0
- package/public/static/images/logo.png +0 -0
- package/public/static/images/logo.svg +510 -0
- package/public/static/images/no-image.png +0 -0
- package/src/App.vue +60 -0
- package/src/api/application.js +35 -0
- package/src/api/customModel.js +187 -0
- package/src/api/customPage.js +15 -0
- package/src/api/customTable.js +24 -0
- package/src/api/dataSource.js +93 -0
- package/src/api/dataView.js +199 -0
- package/src/api/dictType.js +23 -0
- package/src/api/entityView.js +13 -0
- package/src/api/enum.js +15 -0
- package/src/api/filterColumn.js +16 -0
- package/src/api/model.js +244 -0
- package/src/api/movePlan.js +29 -0
- package/src/api/notification.js +28 -0
- package/src/api/openApiPermission.js +25 -0
- package/src/api/permission.js +51 -0
- package/src/api/planJob.js +15 -0
- package/src/api/process.js +23 -0
- package/src/api/processDef.js +36 -0
- package/src/api/processInst.js +16 -0
- package/src/api/rolePermission.js +17 -0
- package/src/api/roleProperty.js +36 -0
- package/src/api/shortcut.js +20 -0
- package/src/api/system.js +23 -0
- package/src/api/task.js +56 -0
- package/src/api/taskQueue.js +24 -0
- package/src/api/user.js +45 -0
- package/src/api/viewColumn.js +16 -0
- package/src/assets/svg/body.svg +17 -0
- package/src/assets/svg/header-theme-dark.svg +40 -0
- package/src/assets/svg/header-theme-primary.svg +40 -0
- package/src/assets/svg/header-top.svg +40 -0
- package/src/assets/svg/icon-happy.svg +1 -0
- package/src/assets/svg/icon-sad.svg +1 -0
- package/src/assets/svg/icon-social-bilibili.svg +1 -0
- package/src/assets/svg/icon-social-dingding.svg +1 -0
- package/src/assets/svg/icon-social-facebook.svg +1 -0
- package/src/assets/svg/icon-social-juejin.svg +1 -0
- package/src/assets/svg/icon-social-qq.svg +1 -0
- package/src/assets/svg/icon-social-twitter.svg +1 -0
- package/src/assets/svg/icon-social-wechat.svg +1 -0
- package/src/assets/svg/icon-social-weibo.svg +1 -0
- package/src/assets/svg/icon-social-zhihu.svg +1 -0
- package/src/assets/svg/nav-theme-dark.svg +40 -0
- package/src/assets/svg/nav-theme-light.svg +40 -0
- package/src/components/copyright/index.vue +28 -0
- package/src/components/home/notice-list.vue +62 -0
- package/src/components/home/shortcut.vue +125 -0
- package/src/components/input/dialog-select.vue +301 -0
- package/src/components/input/item-select.vue +195 -0
- package/src/components/link/index.vue +54 -0
- package/src/components/richEditor/index.vue +86 -0
- package/src/components/upload/file-upload.vue +84 -0
- package/src/components/upload/upload-attachment.vue +119 -0
- package/src/components/upload/upload-image.vue +212 -0
- package/src/components/view/column-check.vue +223 -0
- package/src/components/view/column-edit.vue +850 -0
- package/src/components/view/column-select.vue +206 -0
- package/src/components/view/condition-edit.vue +164 -0
- package/src/components/view/filter-edit.vue +633 -0
- package/src/components/view/filter-setting.vue +126 -0
- package/src/components/view/form-setting-layout.vue +375 -0
- package/src/components/view/form-setting.vue +247 -0
- package/src/components/view/group-column.vue +104 -0
- package/src/components/view/group-method.vue +104 -0
- package/src/components/view/mixin.js +72 -0
- package/src/components/view/modal-form-filter.vue +319 -0
- package/src/components/view/modal-form-sort.vue +248 -0
- package/src/components/view/modal-form.vue +453 -0
- package/src/components/view/modal-table.vue +471 -0
- package/src/components/view/table-filter.vue +702 -0
- package/src/components/view/table-setting.vue +533 -0
- package/src/components/view/view-chart.vue +423 -0
- package/src/components/view/view-form-draggable.vue +837 -0
- package/src/components/view/view-form.vue +1444 -0
- package/src/components/view/view-table.vue +2261 -0
- package/src/components/workflow/flow-chart.vue +846 -0
- package/src/directive/focus.js +10 -0
- package/src/directive/tabHide.js +9 -0
- package/src/i18n/index.js +15 -0
- package/src/i18n/locale/en-US.js +1 -0
- package/src/i18n/locale/lang.js +1 -0
- package/src/i18n/locale/zh-CN.js +1 -0
- package/src/i18n/locale.js +102 -0
- package/src/index.js +222 -0
- package/src/layouts/basic-layout/header-breadcrumb/index.vue +122 -0
- package/src/layouts/basic-layout/header-collapse/index.vue +44 -0
- package/src/layouts/basic-layout/header-fullscreen/index.vue +19 -0
- package/src/layouts/basic-layout/header-i18n/index.vue +45 -0
- package/src/layouts/basic-layout/header-log/index.vue +41 -0
- package/src/layouts/basic-layout/header-logo/index.vue +23 -0
- package/src/layouts/basic-layout/header-notice/index.vue +218 -0
- package/src/layouts/basic-layout/header-reload/index.vue +21 -0
- package/src/layouts/basic-layout/header-search/index.vue +37 -0
- package/src/layouts/basic-layout/header-setting/index.vue +219 -0
- package/src/layouts/basic-layout/header-user/index.vue +175 -0
- package/src/layouts/basic-layout/i18n.js +50 -0
- package/src/layouts/basic-layout/index.vue +280 -0
- package/src/layouts/basic-layout/menu-head/index.vue +120 -0
- package/src/layouts/basic-layout/menu-head/title.vue +48 -0
- package/src/layouts/basic-layout/menu-side/index.vue +113 -0
- package/src/layouts/basic-layout/menu-side/menu-collapse.vue +76 -0
- package/src/layouts/basic-layout/menu-side/menu-item.vue +31 -0
- package/src/layouts/basic-layout/menu-side/menu-title.vue +56 -0
- package/src/layouts/basic-layout/menu-side/submenu.vue +31 -0
- package/src/layouts/basic-layout/mixins/click-item.js +21 -0
- package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -0
- package/src/layouts/basic-layout/mixins/translate-title.js +11 -0
- package/src/layouts/basic-layout/tabs/index.vue +192 -0
- package/src/layouts/basic-layout/water-mark/index.vue +29 -0
- package/src/libs/lodop/index.js +145 -0
- package/src/libs/random_str.js +10 -0
- package/src/libs/request/index.js +158 -0
- package/src/libs/system/index.js +234 -0
- package/src/libs/util.cookies.js +44 -0
- package/src/libs/util.db.js +13 -0
- package/src/libs/util.js +55 -0
- package/src/libs/util.log.js +88 -0
- package/src/libs/water-mark.js +44 -0
- package/src/menu/header.js +20 -0
- package/src/menu/modules/dashboard.js +23 -0
- package/src/menu/sider.js +12 -0
- package/src/mixins/app.js +9 -0
- package/src/mixins/page.js +643 -0
- package/src/pages/account/login.vue +101 -0
- package/src/pages/common/home.vue +169 -0
- package/src/pages/common/task-form.vue +350 -0
- package/src/pages/common/todo.vue +31 -0
- package/src/pages/system/apiLog.vue +79 -0
- package/src/pages/system/applicationType.vue +182 -0
- package/src/pages/system/customPage.vue +62 -0
- package/src/pages/system/customTable.vue +98 -0
- package/src/pages/system/dict.vue +36 -0
- package/src/pages/system/dictType.vue +58 -0
- package/src/pages/system/entityView.vue +38 -0
- package/src/pages/system/error/404.vue +6 -0
- package/src/pages/system/extendColumn.vue +99 -0
- package/src/pages/system/formView.vue +136 -0
- package/src/pages/system/log.vue +55 -0
- package/src/pages/system/notice.vue +26 -0
- package/src/pages/system/openApi.vue +26 -0
- package/src/pages/system/openUser.vue +66 -0
- package/src/pages/system/organization.vue +98 -0
- package/src/pages/system/organizationType.vue +26 -0
- package/src/pages/system/permission.vue +175 -0
- package/src/pages/system/planJob.vue +40 -0
- package/src/pages/system/printTemplate.vue +48 -0
- package/src/pages/system/process.vue +79 -0
- package/src/pages/system/processType.vue +26 -0
- package/src/pages/system/role.vue +395 -0
- package/src/pages/system/rolePropertyEdit.vue +480 -0
- package/src/pages/system/sequenceSetting.vue +26 -0
- package/src/pages/system/systemData.vue +52 -0
- package/src/pages/system/tableView.vue +386 -0
- package/src/pages/system/taskQueue.vue +48 -0
- package/src/pages/system/user.vue +250 -0
- package/src/pages/template/processPage.vue +243 -0
- package/src/pages/template/reportPage.vue +66 -0
- package/src/pages/template/viewPage.vue +139 -0
- package/src/plugins/auth/index.js +21 -0
- package/src/plugins/error/index.js +31 -0
- package/src/plugins/index.js +24 -0
- package/src/plugins/sweetalert2/index.js +20 -0
- package/src/router/dynamic.js +183 -0
- package/src/router/index.js +84 -0
- package/src/setting.js +202 -0
- package/src/store/index.js +9 -0
- package/src/store/modules/admin/index.js +16 -0
- package/src/store/modules/admin/modules/account.js +103 -0
- package/src/store/modules/admin/modules/cache.js +119 -0
- package/src/store/modules/admin/modules/dataView.js +112 -0
- package/src/store/modules/admin/modules/db.js +231 -0
- package/src/store/modules/admin/modules/i18n.js +87 -0
- package/src/store/modules/admin/modules/layout.js +115 -0
- package/src/store/modules/admin/modules/loader.js +44 -0
- package/src/store/modules/admin/modules/log.js +77 -0
- package/src/store/modules/admin/modules/menu.js +338 -0
- package/src/store/modules/admin/modules/page.js +466 -0
- package/src/store/modules/admin/modules/user.js +96 -0
- package/src/store/modules/admin/modules/viewPage.js +34 -0
- package/src/styles/common.less +47 -0
- package/src/styles/css/default.css +510 -0
- package/src/styles/css/login.css +1217 -0
- package/src/styles/default/index.less +6 -0
- package/src/styles/font/demo.css +539 -0
- package/src/styles/font/demo_index.html +372 -0
- package/src/styles/font/icon-demo/demo.css +539 -0
- package/src/styles/font/icon-demo/demo_index.html +423 -0
- package/src/styles/font/icon-demo/iconfont.css +61 -0
- package/src/styles/font/icon-demo/iconfont.eot +0 -0
- package/src/styles/font/icon-demo/iconfont.js +1 -0
- package/src/styles/font/icon-demo/iconfont.svg +59 -0
- package/src/styles/font/icon-demo/iconfont.ttf +0 -0
- package/src/styles/font/icon-demo/iconfont.woff +0 -0
- package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
- package/src/styles/font/iconfont.css +47 -0
- package/src/styles/font/iconfont.js +1 -0
- package/src/styles/font/iconfont.json +65 -0
- package/src/styles/font/iconfont.ttf +0 -0
- package/src/styles/font/iconfont.woff +0 -0
- package/src/styles/font/iconfont.woff2 +0 -0
- package/src/styles/font/ionicons.svg +870 -0
- package/src/styles/font/ionicons.ttf +0 -0
- package/src/styles/font/ionicons.woff +0 -0
- package/src/styles/font/ionicons.woff2 +0 -0
- package/src/styles/index.less +7 -0
- package/src/styles/layout/basic-layout/layout.less +527 -0
- package/src/styles/layout/basic-layout/menu.less +274 -0
- package/src/styles/layout/index.less +2 -0
- package/src/styles/setting.less +6 -0
- package/styleguide.config.js +22 -0
- package/test/api/barcode.js +50 -0
- package/test/api/inbound.js +47 -0
- package/test/api/interfaceLog.js +15 -0
- package/test/api/interfaceQueue.js +15 -0
- package/test/api/interfaceServer.js +29 -0
- package/test/api/movePlan.js +50 -0
- package/test/api/movePlanItem.js +13 -0
- package/test/api/moveType.js +22 -0
- package/test/api/openApiPermission.js +25 -0
- package/test/api/outbound.js +40 -0
- package/test/api/permission.js +34 -0
- package/test/api/rolePermission.js +17 -0
- package/test/api/user.js +40 -0
- package/test/api/viewColumn.js +16 -0
- package/test/api/warehouse.js +13 -0
- package/test/api/warehouseMoveType.js +18 -0
- package/test/main.js +55 -0
- package/test/package.js +33 -0
- package/test/pages/home/index.vue +22 -0
- package/test/pages/task/test.vue +28 -0
- package/test/pages/test/dataViewTest.vue +28 -0
- package/test/pages/test/logReport.vue +25 -0
- package/test/pages/test/testPage.vue +38 -0
- package/test/router/routes.js +88 -0
- package/test/setting.env.js +22 -0
- package/test/styles/css/custom.css +0 -0
- package/test/styles/css/login.css +1217 -0
- package/vite.config.js +72 -0
- package/vue.config.js +20 -0
|
@@ -0,0 +1,243 @@
|
|
|
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" v-if="page" @create="create">
|
|
8
|
+
<template #command="{ row }">
|
|
9
|
+
<Button
|
|
10
|
+
size="small"
|
|
11
|
+
v-if="row.application.status != 'Draft' && row.application.status != 'Rejected'"
|
|
12
|
+
title="详细"
|
|
13
|
+
type="info"
|
|
14
|
+
custom-icon="fa fa-file-alt"
|
|
15
|
+
@click="$refs.showForm.open(row)"
|
|
16
|
+
></Button>
|
|
17
|
+
<Button
|
|
18
|
+
size="small"
|
|
19
|
+
v-if="(row.application.status == 'Draft' || row.application.status == 'Rejected') && row.application.applicantID == info.id"
|
|
20
|
+
title="编辑"
|
|
21
|
+
type="primary"
|
|
22
|
+
custom-icon="fa fa-edit"
|
|
23
|
+
@click="$refs.form.open(row)"
|
|
24
|
+
></Button>
|
|
25
|
+
</template>
|
|
26
|
+
</view-table>
|
|
27
|
+
</Card>
|
|
28
|
+
<modal-form ref="form" v-if="page" @on-after-save="$refs.table.loadData()">
|
|
29
|
+
<template #footer>
|
|
30
|
+
<span></span>
|
|
31
|
+
<Button type="primary" custom-icon="fa fa-cloud-upload-alt" @click="submit">提交</Button>
|
|
32
|
+
<Button type="primary" custom-icon="fa fa-save" @click="save">保存</Button>
|
|
33
|
+
<Button
|
|
34
|
+
type="warning"
|
|
35
|
+
v-if="$refs.form && $refs.form.data && $refs.form.data.application && $refs.form.data.application.status == 'Rejected'"
|
|
36
|
+
custom-icon="fa fa-trash-alt"
|
|
37
|
+
@click="cancel"
|
|
38
|
+
>
|
|
39
|
+
撤销
|
|
40
|
+
</Button>
|
|
41
|
+
<Button
|
|
42
|
+
type="info"
|
|
43
|
+
v-if="$refs.form && $refs.form.data && $refs.form.data.applicationID"
|
|
44
|
+
custom-icon="fa fa-history"
|
|
45
|
+
@click="$refs.approvalHistoryTable.open({ processInstID: $refs.form.data.application.processInstID })"
|
|
46
|
+
>
|
|
47
|
+
历史
|
|
48
|
+
</Button>
|
|
49
|
+
</template>
|
|
50
|
+
</modal-form>
|
|
51
|
+
<modal-form ref="showForm" v-if="page" :readonly="page.showViewCode == null" @on-after-save="$refs.table.loadData()">
|
|
52
|
+
<template #footer>
|
|
53
|
+
<span></span>
|
|
54
|
+
<Button
|
|
55
|
+
type="primary"
|
|
56
|
+
v-if="
|
|
57
|
+
$refs.showForm &&
|
|
58
|
+
$refs.showForm.data &&
|
|
59
|
+
$refs.showForm.data.application &&
|
|
60
|
+
$refs.showForm.data.application.processInst &&
|
|
61
|
+
$refs.showForm.data.application.processInst.isMessageEnable
|
|
62
|
+
"
|
|
63
|
+
custom-icon="fa fa-comment-dots"
|
|
64
|
+
@click="openMessage()"
|
|
65
|
+
>
|
|
66
|
+
发表意见
|
|
67
|
+
</Button>
|
|
68
|
+
<Button type="info" custom-icon="fa fa-history" @click="$refs.approvalHistoryTable.open({ processInstID: $refs.showForm.data.application.processInstID })">历史</Button>
|
|
69
|
+
</template>
|
|
70
|
+
</modal-form>
|
|
71
|
+
<modal-table ref="approvalHistoryTable" view-code="ApprovalHistoryModal"></modal-table>
|
|
72
|
+
<Modal v-model="messageOpened" scrollable>
|
|
73
|
+
<template #header>
|
|
74
|
+
<div>
|
|
75
|
+
<span class="title">意见发表</span>
|
|
76
|
+
<span class="description">Message</span>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
<div class="ivu-ml-8 ivu-mr-8">
|
|
80
|
+
<Form ref="messageForm" :model="messageData" label-position="top" label-colon=":" class="ivu-mt" @submit.prevent>
|
|
81
|
+
<Row :gutter="24" type="flex">
|
|
82
|
+
<Col v-bind="grid24">
|
|
83
|
+
<FormItem
|
|
84
|
+
label="意见内容"
|
|
85
|
+
key="message"
|
|
86
|
+
prop="message"
|
|
87
|
+
:rules="{
|
|
88
|
+
required: true,
|
|
89
|
+
message: '请输入',
|
|
90
|
+
trigger: 'blur,change'
|
|
91
|
+
}"
|
|
92
|
+
>
|
|
93
|
+
<Input type="textarea" :rows="6" v-model="messageData.message" />
|
|
94
|
+
</FormItem>
|
|
95
|
+
</Col>
|
|
96
|
+
</Row>
|
|
97
|
+
</Form>
|
|
98
|
+
</div>
|
|
99
|
+
<template #footer>
|
|
100
|
+
<Button type="primary" custom-icon="fa fa-check" @click="submitMessage">提交</Button>
|
|
101
|
+
<Button type="default" custom-icon="fa fa-times" @click="messageOpened = false">关闭</Button>
|
|
102
|
+
</template>
|
|
103
|
+
</Modal>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
<script>
|
|
107
|
+
import applicationApi from '../../api/application';
|
|
108
|
+
import processInstApi from '../../api/processInst';
|
|
109
|
+
import mixinPage from '../../mixins/page';
|
|
110
|
+
import { mapActions } from 'vuex';
|
|
111
|
+
|
|
112
|
+
export default {
|
|
113
|
+
// name: this.$route.name,
|
|
114
|
+
mixins: [mixinPage],
|
|
115
|
+
components: {},
|
|
116
|
+
data() {
|
|
117
|
+
return {
|
|
118
|
+
applicationType: {},
|
|
119
|
+
page: {},
|
|
120
|
+
messageData: {
|
|
121
|
+
message: null
|
|
122
|
+
},
|
|
123
|
+
messageOpened: false
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
computed: {},
|
|
127
|
+
async created() {
|
|
128
|
+
this.init(this.$route.meta.data.id);
|
|
129
|
+
},
|
|
130
|
+
watch: {
|
|
131
|
+
$route() {
|
|
132
|
+
if (this.$route.meta.data.id) {
|
|
133
|
+
this.init(this.$route.meta.data.id);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
methods: {
|
|
138
|
+
...mapActions('admin/viewPage', { loadPage: 'load' }),
|
|
139
|
+
// 初始化
|
|
140
|
+
async init(pageID) {
|
|
141
|
+
let res = await this.loadPage(pageID);
|
|
142
|
+
this.page = res.customPage;
|
|
143
|
+
|
|
144
|
+
this.$refs.table.init(this.page.tableViewCode, () => {
|
|
145
|
+
this.$refs.table.loadData();
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (!!(this.page.formViewCode || '').trim()) {
|
|
149
|
+
this.$refs.form.init(this.page.formViewCode);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (!!(this.page.formViewCode || '').trim() || !!(this.page.showViewCode || '').trim()) {
|
|
153
|
+
this.$refs.showForm.init(!(this.page.showViewCode || '').trim() ? this.page.formViewCode : this.page.showViewCode);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
// 创建
|
|
157
|
+
create() {
|
|
158
|
+
let application = {
|
|
159
|
+
status: 'Draft',
|
|
160
|
+
applicantID: this.info.id,
|
|
161
|
+
createTime: new Date()
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
this.$refs.form.openDefault({ application });
|
|
165
|
+
},
|
|
166
|
+
// 提交
|
|
167
|
+
async submit() {
|
|
168
|
+
let isOK = await this.$refs.form.validate();
|
|
169
|
+
|
|
170
|
+
if (!isOK) {
|
|
171
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
172
|
+
} else {
|
|
173
|
+
let data = this.$refs.form.getFullData();
|
|
174
|
+
|
|
175
|
+
if (!data) {
|
|
176
|
+
// 表格验证失败
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
this.confirm('确定要提交吗?', async () => {
|
|
181
|
+
await applicationApi.submit(this.page.applicationTypeID, data);
|
|
182
|
+
|
|
183
|
+
this.success('提交成功!', () => {
|
|
184
|
+
this.$refs.table.loadData();
|
|
185
|
+
this.$refs.form.close();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
// 保存
|
|
191
|
+
async save() {
|
|
192
|
+
let data = this.$refs.form.getFullData();
|
|
193
|
+
|
|
194
|
+
if (!data) {
|
|
195
|
+
// 表格验证失败
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
this.confirm('确定要保存吗?', async () => {
|
|
200
|
+
let res = await applicationApi.save(this.page.applicationTypeID, data);
|
|
201
|
+
|
|
202
|
+
this.success('保存成功!', () => {
|
|
203
|
+
this.$refs.table.loadData();
|
|
204
|
+
this.$refs.form.setData(res);
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
// 打开意见输入
|
|
209
|
+
openMessage() {
|
|
210
|
+
this.messageData.message = null;
|
|
211
|
+
this.messageOpened = true;
|
|
212
|
+
},
|
|
213
|
+
// 提交意见
|
|
214
|
+
async submitMessage() {
|
|
215
|
+
let isOK = await this.$refs.messageForm.validate();
|
|
216
|
+
|
|
217
|
+
if (!isOK) {
|
|
218
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
219
|
+
} else {
|
|
220
|
+
this.confirm('确定要发表意见吗?', async () => {
|
|
221
|
+
await processInstApi.addMessage(this.$refs.showForm.data.application.processInstID, this.messageData.message);
|
|
222
|
+
|
|
223
|
+
this.success('操作成功!', () => {
|
|
224
|
+
this.messageData.message = null;
|
|
225
|
+
this.messageOpened = false;
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
// 撤销
|
|
231
|
+
async cancel() {
|
|
232
|
+
this.confirm('确定要撤销该申请吗?', async () => {
|
|
233
|
+
await applicationApi.cancel(this.$refs.form.data.applicationID);
|
|
234
|
+
|
|
235
|
+
this.success('操作成功!', () => {
|
|
236
|
+
this.$refs.table.loadData();
|
|
237
|
+
this.$refs.form.close();
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
</script>
|
|
@@ -0,0 +1,66 @@
|
|
|
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" v-if="page" @on-load-data="onLoadData">
|
|
8
|
+
<template #middle>
|
|
9
|
+
<div>
|
|
10
|
+
<view-chart ref="chart"></view-chart>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
</view-table>
|
|
14
|
+
</Card>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import mixinPage from '../../mixins/page';
|
|
19
|
+
import viewChart from '../../components/view/view-chart.vue';
|
|
20
|
+
import { mapActions } from 'vuex';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
// name: this.$route.name,
|
|
24
|
+
mixins: [mixinPage],
|
|
25
|
+
components: { viewChart },
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
page: {},
|
|
29
|
+
tableView: null
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
computed: {},
|
|
33
|
+
created() {
|
|
34
|
+
this.init(this.$route.meta.data.id);
|
|
35
|
+
},
|
|
36
|
+
watch: {
|
|
37
|
+
$route() {
|
|
38
|
+
if (this.$route.meta.data.id) {
|
|
39
|
+
this.init(this.$route.meta.data.id);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
...mapActions('admin/viewPage', { loadPage: 'load' }),
|
|
45
|
+
...mapActions('admin/dataView', { loadView: 'load' }),
|
|
46
|
+
// 初始化
|
|
47
|
+
async init(pageID) {
|
|
48
|
+
let res = await this.loadPage(pageID);
|
|
49
|
+
this.page = res.customPage;
|
|
50
|
+
|
|
51
|
+
res = await this.loadView(this.page.tableViewCode);
|
|
52
|
+
this.tableView = res.dataView;
|
|
53
|
+
|
|
54
|
+
this.$refs.table.init(this.page.tableViewCode, () => {
|
|
55
|
+
this.$refs.table.loadData();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
this.$refs.chart.initWithTable(this.tableView, this.$refs.table.data);
|
|
59
|
+
},
|
|
60
|
+
// 数据加载完成
|
|
61
|
+
onLoadData() {
|
|
62
|
+
this.$refs.chart.loadChart(this.$refs.table.data);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
|
8
|
+
ref="table"
|
|
9
|
+
v-if="page"
|
|
10
|
+
:createEnable="allow('create')"
|
|
11
|
+
:removeEnable="allow('remove')"
|
|
12
|
+
@create="$refs.form.open()"
|
|
13
|
+
@edit="({ row, index }) => $refs.form.open(row)"
|
|
14
|
+
>
|
|
15
|
+
<template #command="{ row }">
|
|
16
|
+
<Button
|
|
17
|
+
v-for="item in page.controls"
|
|
18
|
+
:key="item.id"
|
|
19
|
+
size="small"
|
|
20
|
+
:title="item.name"
|
|
21
|
+
:type="item.colorType.toLowerCase()"
|
|
22
|
+
:custom-icon="item.icon"
|
|
23
|
+
@click="controlClick(row, item.targetCode, item.param)"
|
|
24
|
+
></Button>
|
|
25
|
+
</template>
|
|
26
|
+
</view-table>
|
|
27
|
+
</Card>
|
|
28
|
+
<modal-form ref="form" :createEnable="allow('create')" :editEnable="allow('edit')" v-if="page" @on-after-save="$refs.table.loadData()" />
|
|
29
|
+
<template v-if="inited">
|
|
30
|
+
<modal-table
|
|
31
|
+
v-for="table in tables"
|
|
32
|
+
:key="table.id"
|
|
33
|
+
:ref="table.code"
|
|
34
|
+
:view-code="table.dataView.code"
|
|
35
|
+
@create="param => create(param, table.targetCode)"
|
|
36
|
+
@edit="({ row, index }) => edit(row, table.targetCode)"
|
|
37
|
+
>
|
|
38
|
+
<template command="{ row }">
|
|
39
|
+
<Button
|
|
40
|
+
v-for="item in table.controls"
|
|
41
|
+
:key="item.id"
|
|
42
|
+
size="small"
|
|
43
|
+
:title="item.name"
|
|
44
|
+
:type="item.colorType.toLowerCase()"
|
|
45
|
+
:custom-icon="item.icon"
|
|
46
|
+
@click="controlClick(row, item.targetCode, item.param)"
|
|
47
|
+
></Button>
|
|
48
|
+
</template>
|
|
49
|
+
</modal-table>
|
|
50
|
+
</template>
|
|
51
|
+
<template v-if="inited">
|
|
52
|
+
<modal-form v-for="form in forms" :key="form.id" :ref="form.code" :view-code="form.dataView.code" @on-after-save="aftersave(form.targetCode)" />
|
|
53
|
+
</template>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
<script>
|
|
57
|
+
import mixinPage from '../../mixins/page';
|
|
58
|
+
import { mapActions } from 'vuex';
|
|
59
|
+
|
|
60
|
+
export default {
|
|
61
|
+
// name: this.$route.name,
|
|
62
|
+
mixins: [mixinPage],
|
|
63
|
+
components: {},
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
inited: false,
|
|
67
|
+
page: {},
|
|
68
|
+
tables: [],
|
|
69
|
+
forms: []
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
computed: {},
|
|
73
|
+
mounted() {
|
|
74
|
+
this.init(this.$route.meta.data.id);
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
$route() {
|
|
78
|
+
if (this.$route.meta.data.id) {
|
|
79
|
+
this.init(this.$route.meta.data.id);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
methods: {
|
|
84
|
+
...mapActions('admin/viewPage', { loadPage: 'load' }),
|
|
85
|
+
// 初始化
|
|
86
|
+
async init(pageID) {
|
|
87
|
+
let res = await this.loadPage(pageID);
|
|
88
|
+
this.page = res.customPage;
|
|
89
|
+
|
|
90
|
+
this.$refs.table.init(this.page.tableViewCode, () => {
|
|
91
|
+
this.$refs.table.loadData();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
if (!!(this.page.formViewCode || '').trim()) {
|
|
95
|
+
this.$refs.form.init(this.page.formViewCode);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
this.page.controls = res.customPageControls.filter(item => {
|
|
99
|
+
return item.customPageComponentID == null;
|
|
100
|
+
});
|
|
101
|
+
this.tables = res.customPageComponents.filter(item => {
|
|
102
|
+
return item.componentType === 'Table';
|
|
103
|
+
});
|
|
104
|
+
this.tables.forEach(component => {
|
|
105
|
+
component.controls = res.customPageControls.filter(item => {
|
|
106
|
+
return item.customPageComponentID === component.id;
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
this.forms = res.customPageComponents.filter(item => {
|
|
110
|
+
return item.componentType === 'Form';
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
// 点击按钮
|
|
114
|
+
controlClick(data, targetCode, param) {
|
|
115
|
+
let model = null;
|
|
116
|
+
if (param) {
|
|
117
|
+
model = JSON.parse(param);
|
|
118
|
+
for (let key in model) {
|
|
119
|
+
model[key] = data[model[key]];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
this.$refs[targetCode][0].open(model);
|
|
124
|
+
},
|
|
125
|
+
// 点击新增
|
|
126
|
+
create(param, targetCode) {
|
|
127
|
+
this.$refs[targetCode][0].openDefault(param);
|
|
128
|
+
},
|
|
129
|
+
// 点击修改
|
|
130
|
+
edit(data, targetCode) {
|
|
131
|
+
this.$refs[targetCode][0].open(data);
|
|
132
|
+
},
|
|
133
|
+
// 新增、修改完成后事件
|
|
134
|
+
aftersave(targetCode) {
|
|
135
|
+
this.$refs[targetCode][0].loadData();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 鉴权指令
|
|
3
|
+
* 当传入的权限当前用户没有时,会移除该组件
|
|
4
|
+
* 用例:<Tag v-auth="['admin']">text</Tag>
|
|
5
|
+
* */
|
|
6
|
+
import store from '../../store';
|
|
7
|
+
import { includeArray } from '../../libs/system';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
inserted(el, binding) {
|
|
11
|
+
const { value } = binding;
|
|
12
|
+
const access = store.state.admin.user.info.access;
|
|
13
|
+
|
|
14
|
+
if (value && value instanceof Array && value.length && access && access.length) {
|
|
15
|
+
const isPermission = includeArray(value, access);
|
|
16
|
+
if (!isPermission) {
|
|
17
|
+
el.parentNode && el.parentNode.removeChild(el);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import store from '../../store';
|
|
3
|
+
import util from '../../libs/util';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
install(app) {
|
|
7
|
+
app.config.errorHandler = function (error, instance, info) {
|
|
8
|
+
nextTick(() => {
|
|
9
|
+
// store 追加 log
|
|
10
|
+
store.dispatch('admin/log/push', {
|
|
11
|
+
message: `${info}: ${error.message}`,
|
|
12
|
+
type: 'error',
|
|
13
|
+
meta: {
|
|
14
|
+
error
|
|
15
|
+
// instance
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
// 只在开发模式下打印 log
|
|
19
|
+
if (process.env.NODE_ENV === 'development') {
|
|
20
|
+
util.log.capsule('Admin Plus', 'ErrorHandler', 'error');
|
|
21
|
+
util.log.error('>>>>>> 错误信息 >>>>>>');
|
|
22
|
+
console.log(info);
|
|
23
|
+
util.log.error('>>>>>> Vue 实例 >>>>>>');
|
|
24
|
+
console.log(instance);
|
|
25
|
+
util.log.error('>>>>>> Error >>>>>>');
|
|
26
|
+
console.log(error);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件
|
|
3
|
+
* */
|
|
4
|
+
|
|
5
|
+
// 错误捕获
|
|
6
|
+
import pluginError from './error';
|
|
7
|
+
// 日志插件
|
|
8
|
+
//import pluginLog from './log';
|
|
9
|
+
// 鉴权指令
|
|
10
|
+
import directiveAuth from './auth';
|
|
11
|
+
// 对话框
|
|
12
|
+
import sweetalert2 from './sweetalert2';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
async install(app) {
|
|
16
|
+
// 插件
|
|
17
|
+
app.use(pluginError);
|
|
18
|
+
//app.use(pluginLog);
|
|
19
|
+
app.use(sweetalert2);
|
|
20
|
+
|
|
21
|
+
// 指令
|
|
22
|
+
app.directive('auth', directiveAuth);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import sweetalert2 from 'sweetalert2';
|
|
2
|
+
|
|
3
|
+
import 'sweetalert2/dist/sweetalert2.min.css';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
install: app => {
|
|
7
|
+
// sweetalert2 的设置默认配置的方法
|
|
8
|
+
const swal = sweetalert2.mixin({
|
|
9
|
+
confirmButtonText: '确定',
|
|
10
|
+
confirmButtonColor: '#2d8cf0',
|
|
11
|
+
cancelButtonText: '取消'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// 添加全局方法
|
|
15
|
+
//Vue.swal = swal;
|
|
16
|
+
|
|
17
|
+
// 添加实例方法
|
|
18
|
+
app.config.globalProperties.$swal = swal;
|
|
19
|
+
}
|
|
20
|
+
};
|