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,533 @@
|
|
|
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" v-if="!dataView.isVirtual" ghost custom-icon="fa fa-indent" @click="openColumnSelect">选择字段</Button>
|
|
12
|
+
<!-- <Button type="primary"
|
|
13
|
+
ghost
|
|
14
|
+
custom-icon="fa fa-redo"
|
|
15
|
+
v-if="isSetting"
|
|
16
|
+
@click="reset">
|
|
17
|
+
重置
|
|
18
|
+
</Button> -->
|
|
19
|
+
<Button type="primary" custom-icon="fa fa-bookmark" @click="createVirtual">虚拟字段</Button>
|
|
20
|
+
<!-- <Button type="primary"
|
|
21
|
+
ghost
|
|
22
|
+
custom-icon="fa fa-save"
|
|
23
|
+
v-if="isSetting"
|
|
24
|
+
@click="userSave">
|
|
25
|
+
保存
|
|
26
|
+
</Button> -->
|
|
27
|
+
<Button type="primary" custom-icon="fa fa-save" v-if="!isSetting" @click="save">保存</Button>
|
|
28
|
+
<Button type="error" custom-icon="fa fa-save" v-if="isSetting" @click="globalSave">全局保存</Button>
|
|
29
|
+
<Button type="error" custom-icon="fa fa-cog" v-if="isSetting" @click="setting">表格设置</Button>
|
|
30
|
+
</template>
|
|
31
|
+
</modal-table>
|
|
32
|
+
<column-select ref="columnSelect" />
|
|
33
|
+
<column-edit ref="columnEdit" view-type="TableView" />
|
|
34
|
+
<modal-form ref="setting" view-code="TableViewSetting" v-if="isSetting">
|
|
35
|
+
<template #column="{ data, code }">
|
|
36
|
+
<div v-if="code == 'keywordColumn'">
|
|
37
|
+
<Input type="text" :readonly="true" v-model="data.keywordColumn" @click="keywordColumnOpen()"></Input>
|
|
38
|
+
</div>
|
|
39
|
+
<div v-if="code == 'sorting'">
|
|
40
|
+
<Input type="text" :readonly="true" v-model="sort" @click="$refs.modal_sort.open()">
|
|
41
|
+
<template #prepend></template>
|
|
42
|
+
<Button custom-icon="fa fa-edit" @click="$refs.modal_sort.open()"></Button>
|
|
43
|
+
</Input>
|
|
44
|
+
</div>
|
|
45
|
+
<div v-if="code == 'filtering'">
|
|
46
|
+
<Input type="text" :readonly="true" v-model="filter" @click="$refs.modal_filter.open()">
|
|
47
|
+
<template #prepend>
|
|
48
|
+
<Button custom-icon="fa fa-edit" @click="$refs.modal_filter.open()"></Button>
|
|
49
|
+
</template>
|
|
50
|
+
</Input>
|
|
51
|
+
</div>
|
|
52
|
+
<div v-if="code == 'batchSelectDataCode'">
|
|
53
|
+
<Input type="text" :readonly="true" v-model="$refs.setting.data.batchSelectDataCode" @click="openColumnCheck($refs.setting.data, 'batchSelectDataCode')">
|
|
54
|
+
<template #prepend>
|
|
55
|
+
<Button custom-icon="fa fa-search" @click="openColumnCheck($refs.setting.data, 'batchSelectDataCode')"></Button>
|
|
56
|
+
</template>
|
|
57
|
+
</Input>
|
|
58
|
+
</div>
|
|
59
|
+
<div v-if="code == 'groupColumn'">
|
|
60
|
+
<Input
|
|
61
|
+
type="text"
|
|
62
|
+
:readonly="true"
|
|
63
|
+
v-model="$refs.setting.data.groupColumn"
|
|
64
|
+
@click="
|
|
65
|
+
$refs.groupColumn.open(dataView.model, $refs.setting.data.groupColumn, json => {
|
|
66
|
+
$refs.setting.data.groupColumn = json;
|
|
67
|
+
})
|
|
68
|
+
"
|
|
69
|
+
>
|
|
70
|
+
<template #prepend>
|
|
71
|
+
<Button
|
|
72
|
+
custom-icon="fa fa-edit"
|
|
73
|
+
@click="
|
|
74
|
+
$refs.groupColumn.open(dataView.model, $refs.setting.data.groupColumn, json => {
|
|
75
|
+
$refs.setting.data.groupColumn = json;
|
|
76
|
+
})
|
|
77
|
+
"
|
|
78
|
+
></Button>
|
|
79
|
+
</template>
|
|
80
|
+
</Input>
|
|
81
|
+
</div>
|
|
82
|
+
<div v-if="code == 'groupMethod'">
|
|
83
|
+
<Input
|
|
84
|
+
type="text"
|
|
85
|
+
:readonly="true"
|
|
86
|
+
v-model="$refs.setting.data.groupMethod"
|
|
87
|
+
@click="
|
|
88
|
+
$refs.groupMethod.open(dataView.model, $refs.setting.data.groupMethod, json => {
|
|
89
|
+
$refs.setting.data.groupMethod = json;
|
|
90
|
+
})
|
|
91
|
+
"
|
|
92
|
+
>
|
|
93
|
+
<template #prepend>
|
|
94
|
+
<Button
|
|
95
|
+
custom-icon="fa fa-edit"
|
|
96
|
+
@click="
|
|
97
|
+
$refs.groupMethod.open(dataView.model, $refs.setting.data.groupMethod, json => {
|
|
98
|
+
$refs.setting.data.groupMethod = json;
|
|
99
|
+
})
|
|
100
|
+
"
|
|
101
|
+
></Button>
|
|
102
|
+
</template>
|
|
103
|
+
</Input>
|
|
104
|
+
</div>
|
|
105
|
+
<div v-if="code == 'editEnable'">
|
|
106
|
+
<Switch
|
|
107
|
+
:model-value="!!data.editEnable"
|
|
108
|
+
v-if="showCheck(data.editEnableJson)"
|
|
109
|
+
@update:model-value="
|
|
110
|
+
$event => {
|
|
111
|
+
data.editEnable = $event;
|
|
112
|
+
//$forceUpdate();
|
|
113
|
+
}
|
|
114
|
+
"
|
|
115
|
+
@on-change="checkChange('editEnableJson', 'editEnable')"
|
|
116
|
+
/>
|
|
117
|
+
<Button style="margin-left: 8px" @click="$refs.conditionEdit.open(data, 'editEnableJson', 'editEnable', dataView.model)" type="primary" size="small" icon="ios-settings">
|
|
118
|
+
条件
|
|
119
|
+
</Button>
|
|
120
|
+
</div>
|
|
121
|
+
<div v-if="code == 'removeEnable'">
|
|
122
|
+
<Switch
|
|
123
|
+
:model-value="!!data.removeEnable"
|
|
124
|
+
v-if="showCheck(data.removeEnableJson)"
|
|
125
|
+
@update:model-value="
|
|
126
|
+
$event => {
|
|
127
|
+
data.removeEnable = $event;
|
|
128
|
+
//$forceUpdate();
|
|
129
|
+
}
|
|
130
|
+
"
|
|
131
|
+
@on-change="checkChange('removeEnableJson', 'removeEnable')"
|
|
132
|
+
/>
|
|
133
|
+
<Button
|
|
134
|
+
style="margin-left: 8px"
|
|
135
|
+
@click="$refs.conditionEdit.open(data, 'removeEnableJson', 'removeEnable', dataView.model)"
|
|
136
|
+
type="primary"
|
|
137
|
+
size="small"
|
|
138
|
+
icon="ios-settings"
|
|
139
|
+
>
|
|
140
|
+
条件
|
|
141
|
+
</Button>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
<template #bottom>
|
|
145
|
+
<Divider :plain="true" dashed orientation="left" size="small">
|
|
146
|
+
<span class="title">操作栏按钮</span>
|
|
147
|
+
</Divider>
|
|
148
|
+
<view-table ref="commandButton" view-code="CommandButton" :static="true" :embedded="true">
|
|
149
|
+
<template #column="{ row, code }">
|
|
150
|
+
<template v-if="code == 'params'">
|
|
151
|
+
<Button type="primary" v-if="row.viewCode && row.viewType == 'TableView'" size="small" custom-icon="fa fa-list" @click="openParams(row)">参数</Button>
|
|
152
|
+
</template>
|
|
153
|
+
</template>
|
|
154
|
+
</view-table>
|
|
155
|
+
</template>
|
|
156
|
+
<template #footer>
|
|
157
|
+
<Button type="primary" custom-icon="fa fa-save" @click="saveSetting">保存</Button>
|
|
158
|
+
</template>
|
|
159
|
+
</modal-form>
|
|
160
|
+
<modal-table ref="commandButtonParams" view-code="CommandButtonParams" :static="true" :embedded="true" :footerEnable="true">
|
|
161
|
+
<template #column="{ row, code }">
|
|
162
|
+
<template v-if="code == 'param'">
|
|
163
|
+
<Input type="text" size="small" v-model="row.param">
|
|
164
|
+
<template #prepend>
|
|
165
|
+
<Button size="small" custom-icon="fa fa-search" @click="$refs.columnCheck.openViewCode(commandButton.viewCode, column => (row.param = column.code))"></Button>
|
|
166
|
+
</template>
|
|
167
|
+
</Input>
|
|
168
|
+
</template>
|
|
169
|
+
<template v-if="code == 'value'">
|
|
170
|
+
<Input type="text" size="small" v-model="row.value">
|
|
171
|
+
<template #prepend>
|
|
172
|
+
<Button size="small" custom-icon="fa fa-search" @click="$refs.columnCheck.open(dataView.model, column => (row.value = column.code))"></Button>
|
|
173
|
+
</template>
|
|
174
|
+
</Input>
|
|
175
|
+
</template>
|
|
176
|
+
</template>
|
|
177
|
+
<template #footer>
|
|
178
|
+
<Button type="primary" custom-icon="fa fa-save" @click="saveParams">保存</Button>
|
|
179
|
+
</template>
|
|
180
|
+
</modal-table>
|
|
181
|
+
<modal-form-sort ref="modal_sort" :sort="sort" :dataView="dataView" @bindSort="bindSort" />
|
|
182
|
+
<modal-form-filter ref="modal_filter" :filter="filter" :dataView="dataView" @bindFilter="bindFilter" />
|
|
183
|
+
<column-check ref="columnCheck" />
|
|
184
|
+
<group-method ref="groupMethod" />
|
|
185
|
+
<group-column ref="groupColumn" />
|
|
186
|
+
<condition-edit ref="conditionEdit" />
|
|
187
|
+
</div>
|
|
188
|
+
</template>
|
|
189
|
+
<script>
|
|
190
|
+
import mixinPage from '../../mixins/page';
|
|
191
|
+
import columnCheck from './column-check';
|
|
192
|
+
import columnSelect from './column-select';
|
|
193
|
+
import columnEdit from './column-edit';
|
|
194
|
+
import { mapActions } from 'vuex';
|
|
195
|
+
import modalFormSort from './modal-form-sort';
|
|
196
|
+
import modalFormFilter from './modal-form-filter';
|
|
197
|
+
import groupMethod from './group-method';
|
|
198
|
+
import groupColumn from './group-column';
|
|
199
|
+
import conditionEdit from './condition-edit';
|
|
200
|
+
|
|
201
|
+
export default {
|
|
202
|
+
mixins: [mixinPage],
|
|
203
|
+
components: { columnCheck, columnSelect, columnEdit, modalFormSort, modalFormFilter, groupMethod, groupColumn, conditionEdit },
|
|
204
|
+
data() {
|
|
205
|
+
return {
|
|
206
|
+
active: false,
|
|
207
|
+
dataView: {},
|
|
208
|
+
data: {},
|
|
209
|
+
tablename: '',
|
|
210
|
+
sort: '',
|
|
211
|
+
filter: '',
|
|
212
|
+
tableid: '',
|
|
213
|
+
commandButton: {}
|
|
214
|
+
};
|
|
215
|
+
},
|
|
216
|
+
created() {},
|
|
217
|
+
props: {
|
|
218
|
+
// 是否公共配置界面
|
|
219
|
+
isSetting: {
|
|
220
|
+
type: Boolean,
|
|
221
|
+
default: false
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
computed: {},
|
|
225
|
+
methods: {
|
|
226
|
+
...mapActions('admin/dataView', {
|
|
227
|
+
resetDataView: 'reset',
|
|
228
|
+
saveDataView: 'save',
|
|
229
|
+
saveUserView: 'saveUserView',
|
|
230
|
+
saveDataViewSetting: 'saveSetting'
|
|
231
|
+
}),
|
|
232
|
+
// 打开
|
|
233
|
+
open(dataView, columns) {
|
|
234
|
+
this.dataView = dataView;
|
|
235
|
+
this.active = true;
|
|
236
|
+
let code;
|
|
237
|
+
|
|
238
|
+
if (this.isSetting) {
|
|
239
|
+
code = 'TableViewColumnSimple';
|
|
240
|
+
} else {
|
|
241
|
+
code = 'TableViewColumn';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
setTimeout(async () => {
|
|
245
|
+
await this.$refs.table.init(code, () => {
|
|
246
|
+
this.$refs.table.loadData(columns);
|
|
247
|
+
this.$refs.table.open();
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
// 打开字段设置界面
|
|
252
|
+
edit(row, index) {
|
|
253
|
+
this.$refs.columnEdit.open(row, index, this.$refs.table.data, data => {
|
|
254
|
+
let columns = this.$refs.table.data;
|
|
255
|
+
columns.splice(index, 1, data);
|
|
256
|
+
|
|
257
|
+
this.$refs.table.loadData(columns);
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
// 打开字段选择界面
|
|
261
|
+
openColumnCheck(data, code) {
|
|
262
|
+
if (data.model == null) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
this.$refs.columnCheck.open(data.model, checked => {
|
|
267
|
+
data[code] = checked.code;
|
|
268
|
+
//this.$forceUpdate();
|
|
269
|
+
});
|
|
270
|
+
},
|
|
271
|
+
// 上移
|
|
272
|
+
up(row, index) {
|
|
273
|
+
let columns = this.$refs.table.data;
|
|
274
|
+
if (index > 0) {
|
|
275
|
+
columns.splice(index, 1);
|
|
276
|
+
columns.splice(index - 1, 0, row);
|
|
277
|
+
|
|
278
|
+
this.$refs.table.loadData(columns);
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
// 下移
|
|
282
|
+
down(row, index) {
|
|
283
|
+
let columns = this.$refs.table.data;
|
|
284
|
+
if (index < columns.length - 1) {
|
|
285
|
+
columns.splice(index, 1);
|
|
286
|
+
columns.splice(index + 1, 0, row);
|
|
287
|
+
|
|
288
|
+
this.$refs.table.loadData(columns);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
// 拖动完成
|
|
292
|
+
dragDrop({ index1, index2 }) {
|
|
293
|
+
if (index1 != index2) {
|
|
294
|
+
let columns = this.$refs.table.data;
|
|
295
|
+
let row = columns[index1];
|
|
296
|
+
|
|
297
|
+
columns.splice(index1, 1);
|
|
298
|
+
columns.splice(index2, 0, row);
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
// 移除
|
|
302
|
+
remove(row, index) {
|
|
303
|
+
let columns = this.$refs.table.data;
|
|
304
|
+
columns.splice(index, 1);
|
|
305
|
+
|
|
306
|
+
this.$refs.table.loadData(columns);
|
|
307
|
+
},
|
|
308
|
+
// 打开字段选择界面
|
|
309
|
+
openColumnSelect() {
|
|
310
|
+
let columns = this.$refs.table.data;
|
|
311
|
+
this.$refs.columnSelect.open(this.dataView, columns, checked => {
|
|
312
|
+
// 移除未勾选的
|
|
313
|
+
columns = columns.filter(column => {
|
|
314
|
+
return (
|
|
315
|
+
checked.some(item => {
|
|
316
|
+
return column.code === item.code;
|
|
317
|
+
}) || column.isVirtual
|
|
318
|
+
);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// 添加新勾选的
|
|
322
|
+
checked.forEach(item => {
|
|
323
|
+
if (
|
|
324
|
+
!columns.some(column => {
|
|
325
|
+
return column.code === item.code;
|
|
326
|
+
})
|
|
327
|
+
) {
|
|
328
|
+
columns.push({
|
|
329
|
+
code: item.code,
|
|
330
|
+
name: item.name,
|
|
331
|
+
dataType: item.dataType,
|
|
332
|
+
dataView: this.dataView,
|
|
333
|
+
isShow: true,
|
|
334
|
+
controlType: 'Label', // 默认只读文本
|
|
335
|
+
align: 'Center' // 默认居中
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
setTimeout(() => {
|
|
341
|
+
this.$refs.table.loadData(columns);
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
// 创建虚拟字段
|
|
346
|
+
createVirtual() {
|
|
347
|
+
let columns = this.$refs.table.data;
|
|
348
|
+
|
|
349
|
+
let row = {
|
|
350
|
+
isShow: true,
|
|
351
|
+
isVirtual: true,
|
|
352
|
+
dataType: 'String'
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
this.$refs.columnEdit.open(row, -1, this.$refs.table.data, data => {
|
|
356
|
+
columns.push(data);
|
|
357
|
+
this.$refs.table.loadData(columns);
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
// 全局保存
|
|
361
|
+
globalSave() {
|
|
362
|
+
this.confirm('确定要保存全局设置吗?', () => {
|
|
363
|
+
this.confirm('本次操作将修改全局设置,确认要保存吗?', async () => {
|
|
364
|
+
await this.saveDataView({
|
|
365
|
+
code: this.dataView.code,
|
|
366
|
+
columns: this.$refs.table.data
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
this.$emit('on-change', this.dataView.code);
|
|
370
|
+
this.success('保存成功!', () => {
|
|
371
|
+
this.$refs.table.close();
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
},
|
|
376
|
+
// 重置
|
|
377
|
+
reset() {
|
|
378
|
+
this.confirm('确定要恢复默认设置吗?', async () => {
|
|
379
|
+
await this.resetDataView(this.dataView.code);
|
|
380
|
+
|
|
381
|
+
this.$emit('on-change', this.dataView.code);
|
|
382
|
+
this.success('重置成功!', () => {
|
|
383
|
+
this.$refs.table.close();
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
},
|
|
387
|
+
// 用户保存
|
|
388
|
+
userSave() {
|
|
389
|
+
this.confirm('确定要保存设置吗?', async () => {
|
|
390
|
+
await this.saveUserView({
|
|
391
|
+
code: this.dataView.code,
|
|
392
|
+
columns: this.$refs.table.data
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
this.$emit('on-change', this.dataView.code);
|
|
396
|
+
this.success('保存成功!', () => {
|
|
397
|
+
this.$refs.table.close();
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
},
|
|
401
|
+
// 保存
|
|
402
|
+
save() {
|
|
403
|
+
this.confirm('确定要保存设置吗?', async () => {
|
|
404
|
+
await this.saveDataView({
|
|
405
|
+
code: this.dataView.code,
|
|
406
|
+
columns: this.$refs.table.data
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
this.success('保存成功!', () => {
|
|
410
|
+
this.$refs.table.close();
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
},
|
|
414
|
+
// 设置
|
|
415
|
+
setting() {
|
|
416
|
+
// 排序字段参数赋值
|
|
417
|
+
this.sort = this.dataView.sorting;
|
|
418
|
+
this.filter = this.dataView.filtering;
|
|
419
|
+
|
|
420
|
+
if (!!(this.dataView.commandButton || '').trim()) {
|
|
421
|
+
this.$refs.commandButton.loadData(JSON.parse(this.dataView.commandButton));
|
|
422
|
+
} else {
|
|
423
|
+
this.$refs.commandButton.loadData([]);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
this.$refs.setting.open(this.copy(this.dataView));
|
|
427
|
+
},
|
|
428
|
+
// 保存设置
|
|
429
|
+
async saveSetting() {
|
|
430
|
+
let isOK = await this.$refs.setting.validate();
|
|
431
|
+
|
|
432
|
+
if (!isOK) {
|
|
433
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
434
|
+
} else {
|
|
435
|
+
if (!this.$refs.commandButton.validate()) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// 操作栏按钮
|
|
440
|
+
this.$refs.setting.data.commandButton = JSON.stringify(this.$refs.commandButton.getData());
|
|
441
|
+
|
|
442
|
+
this.confirm('确定要保存设置吗?', async () => {
|
|
443
|
+
let res = await this.saveDataViewSetting(this.$refs.setting.data);
|
|
444
|
+
this.dataView = res.dataView;
|
|
445
|
+
|
|
446
|
+
this.$emit('on-change', this.dataView.code);
|
|
447
|
+
this.success('保存成功!', () => {
|
|
448
|
+
this.$refs.setting.close();
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
//绑定排序组件返回的排序json
|
|
454
|
+
bindSort(value) {
|
|
455
|
+
this.sort = value;
|
|
456
|
+
this.$refs.setting.data.sorting = value;
|
|
457
|
+
},
|
|
458
|
+
//绑定筛选组件返回的排序json
|
|
459
|
+
bindFilter(value) {
|
|
460
|
+
this.filter = value;
|
|
461
|
+
this.$refs.setting.data.filtering = value;
|
|
462
|
+
},
|
|
463
|
+
// 打开操作栏按钮参数设置界面
|
|
464
|
+
openParams(row) {
|
|
465
|
+
this.commandButton = row;
|
|
466
|
+
|
|
467
|
+
let params = [];
|
|
468
|
+
if (!!(row.params || '').trim()) {
|
|
469
|
+
params = JSON.parse(row.params);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
this.$refs.commandButtonParams.loadData(params);
|
|
473
|
+
this.$refs.commandButtonParams.open();
|
|
474
|
+
},
|
|
475
|
+
// 保存操作栏按钮参数
|
|
476
|
+
saveParams() {
|
|
477
|
+
let params = this.$refs.commandButtonParams.getData();
|
|
478
|
+
this.commandButton.params = JSON.stringify(params);
|
|
479
|
+
|
|
480
|
+
this.$refs.commandButtonParams.close();
|
|
481
|
+
},
|
|
482
|
+
// 打开筛选字段选择
|
|
483
|
+
keywordColumnOpen() {
|
|
484
|
+
if (!(this.dataView.model || '').trim()) {
|
|
485
|
+
this.error('请先选择模型!');
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
let data = this.$refs.setting.data;
|
|
490
|
+
let keywordColumn = data.keywordColumn;
|
|
491
|
+
let columns = [];
|
|
492
|
+
|
|
493
|
+
if (!!(keywordColumn || '').trim()) {
|
|
494
|
+
columns = keywordColumn.split(',').map(item => {
|
|
495
|
+
return { code: item };
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
this.$refs.columnSelect.open(this.dataView, columns, checked => {
|
|
500
|
+
this.$refs.setting.data.keywordColumn = checked
|
|
501
|
+
.map(item => {
|
|
502
|
+
return item.code;
|
|
503
|
+
})
|
|
504
|
+
.join();
|
|
505
|
+
|
|
506
|
+
//this.$forceUpdate();
|
|
507
|
+
});
|
|
508
|
+
},
|
|
509
|
+
// 是否显示选择框
|
|
510
|
+
showCheck(json) {
|
|
511
|
+
if (!(json || '').trim()) {
|
|
512
|
+
return true;
|
|
513
|
+
} else {
|
|
514
|
+
let setting = JSON.parse(json);
|
|
515
|
+
|
|
516
|
+
return setting.type == 'True' || setting.type == 'False';
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
// 选择框变化
|
|
520
|
+
checkChange(jsonKey, checkKey) {
|
|
521
|
+
if (!!(this.data[jsonKey] || '').trim()) {
|
|
522
|
+
let setting = JSON.parse(this.data[jsonKey]);
|
|
523
|
+
if (this.data[checkKey]) {
|
|
524
|
+
setting.type = 'True';
|
|
525
|
+
} else {
|
|
526
|
+
setting.type = 'False';
|
|
527
|
+
}
|
|
528
|
+
this.data[jsonKey] = JSON.stringify(setting);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
</script>
|