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,301 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Input
|
|
4
|
+
type="text"
|
|
5
|
+
:size="size"
|
|
6
|
+
readonly
|
|
7
|
+
:clearable="!readonly"
|
|
8
|
+
v-model="selected"
|
|
9
|
+
:style="{ width: controlWidth == null ? null : controlWidth + 'px' }"
|
|
10
|
+
@on-focus="dialogSelectOpen()"
|
|
11
|
+
@on-clear="dialogSelectRemove()"
|
|
12
|
+
>
|
|
13
|
+
<template #prepend>
|
|
14
|
+
<Button :size="size" custom-icon="fa fa-search" @click="dialogSelectOpen()"></Button>
|
|
15
|
+
</template>
|
|
16
|
+
</Input>
|
|
17
|
+
<modal-table ref="dialogTable" :view-code="source" :selectEnable="multi" :footerEnable="multi" v-if="dialogActive">
|
|
18
|
+
<template #command="{ row }">
|
|
19
|
+
<Button size="small" v-if="!multi" type="primary" custom-icon="fa fa-check" @click="dialogCheck(row)">选择</Button>
|
|
20
|
+
</template>
|
|
21
|
+
<template #footer>
|
|
22
|
+
<Button type="primary" custom-icon="fa fa-save" @click="multiSave">确定</Button>
|
|
23
|
+
<Button type="default" custom-icon="fa fa-times" @click="close()">关闭</Button>
|
|
24
|
+
</template>
|
|
25
|
+
</modal-table>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<script>
|
|
29
|
+
import mixinPage from '../../mixins/page';
|
|
30
|
+
import { mapActions } from 'vuex';
|
|
31
|
+
import modelApi from '../../api/model';
|
|
32
|
+
import customModelApi from '../../api/customModel';
|
|
33
|
+
import dataSourceApi from '../../api/dataSource';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @displayName dialog-select 弹出选择
|
|
37
|
+
*/
|
|
38
|
+
export default {
|
|
39
|
+
mixins: [mixinPage],
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
//changed: false,
|
|
43
|
+
selected: null,
|
|
44
|
+
selectedData: null,
|
|
45
|
+
dialogActive: false
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
props: {
|
|
49
|
+
/**
|
|
50
|
+
* @model
|
|
51
|
+
*/
|
|
52
|
+
value: {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* 数据源
|
|
57
|
+
*/
|
|
58
|
+
source: {
|
|
59
|
+
type: String
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* 大小
|
|
63
|
+
* @values small, default, large
|
|
64
|
+
*/
|
|
65
|
+
size: {
|
|
66
|
+
type: String
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* 数据源数据列名
|
|
70
|
+
*/
|
|
71
|
+
sourceDataCode: {
|
|
72
|
+
type: String
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* 数据源显示列名
|
|
76
|
+
*/
|
|
77
|
+
sourceDisplayCode: {
|
|
78
|
+
type: String
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* 参数
|
|
82
|
+
*/
|
|
83
|
+
param: {
|
|
84
|
+
type: Object
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* 只读
|
|
88
|
+
*/
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* 控件宽度
|
|
95
|
+
*/
|
|
96
|
+
controlWidth: {
|
|
97
|
+
type: Number
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* 能否多选
|
|
101
|
+
*/
|
|
102
|
+
multi: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
computed: {},
|
|
108
|
+
watch: {
|
|
109
|
+
value() {
|
|
110
|
+
this.showSelected();
|
|
111
|
+
|
|
112
|
+
//this.changed = false;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
mounted() {
|
|
116
|
+
this.showSelected();
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
...mapActions('admin/dataView', { loadDataView: 'load' }),
|
|
120
|
+
// 显示选择项
|
|
121
|
+
showSelected() {
|
|
122
|
+
if (this.value == null) {
|
|
123
|
+
this.selected = null;
|
|
124
|
+
this.selectedData = null;
|
|
125
|
+
return;
|
|
126
|
+
} else if (this.multi) {
|
|
127
|
+
let filter = {
|
|
128
|
+
page: 1,
|
|
129
|
+
per: 999
|
|
130
|
+
};
|
|
131
|
+
filter[this.sourceDataCode] = JSON.parse(this.value).join(',');
|
|
132
|
+
|
|
133
|
+
this.loadDataView(this.source).then(async view => {
|
|
134
|
+
if (view.dataView.isCustom) {
|
|
135
|
+
let res = await customModelApi.query(view.dataView.model, filter);
|
|
136
|
+
if (res.data.length > 0) {
|
|
137
|
+
this.selected = res.data
|
|
138
|
+
.map(item => {
|
|
139
|
+
return this.parseData(item, this.sourceDisplayCode);
|
|
140
|
+
})
|
|
141
|
+
.join(',');
|
|
142
|
+
this.selectedData = res.data;
|
|
143
|
+
|
|
144
|
+
//this.$forceUpdate();
|
|
145
|
+
}
|
|
146
|
+
} else if (view.dataView.isDataSource) {
|
|
147
|
+
let res = await dataSourceApi.query(view.dataView.dataSource, filter);
|
|
148
|
+
if (res.table.length > 0) {
|
|
149
|
+
this.selected = res.table
|
|
150
|
+
.map(item => {
|
|
151
|
+
return this.parseData(item, this.sourceDisplayCode);
|
|
152
|
+
})
|
|
153
|
+
.join(',');
|
|
154
|
+
this.selectedData = res.table;
|
|
155
|
+
|
|
156
|
+
//this.$forceUpdate();
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
let res = await modelApi.query(view.dataView.model, filter);
|
|
160
|
+
if (res.data.length > 0) {
|
|
161
|
+
this.selected = res.data
|
|
162
|
+
.map(item => {
|
|
163
|
+
return this.parseData(item, this.sourceDisplayCode);
|
|
164
|
+
})
|
|
165
|
+
.join(',');
|
|
166
|
+
this.selectedData = res.data;
|
|
167
|
+
|
|
168
|
+
//this.$forceUpdate();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
} else {
|
|
173
|
+
let filter = {
|
|
174
|
+
page: 1,
|
|
175
|
+
per: 1
|
|
176
|
+
};
|
|
177
|
+
filter[this.sourceDataCode] = this.value;
|
|
178
|
+
|
|
179
|
+
this.loadDataView(this.source).then(async view => {
|
|
180
|
+
if (view.dataView.isCustom) {
|
|
181
|
+
let res = await customModelApi.query(view.dataView.model, filter);
|
|
182
|
+
if (res.data.length > 0) {
|
|
183
|
+
this.selected = this.parseData(res.data[0], this.sourceDisplayCode);
|
|
184
|
+
this.selectedData = res.data[0];
|
|
185
|
+
|
|
186
|
+
//this.$forceUpdate();
|
|
187
|
+
}
|
|
188
|
+
} else if (view.dataView.isDataSource) {
|
|
189
|
+
let res = await dataSourceApi.query(view.dataView.dataSource, filter);
|
|
190
|
+
if (res.table.length > 0) {
|
|
191
|
+
this.selected = this.parseData(res.table[0], this.sourceDisplayCode);
|
|
192
|
+
this.selectedData = res.table[0];
|
|
193
|
+
|
|
194
|
+
//this.$forceUpdate();
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
let res = await modelApi.query(view.dataView.model, filter);
|
|
198
|
+
if (res.data.length > 0) {
|
|
199
|
+
this.selected = this.parseData(res.data[0], this.sourceDisplayCode);
|
|
200
|
+
this.selectedData = res.data[0];
|
|
201
|
+
|
|
202
|
+
//this.$forceUpdate();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
// 弹出选择框
|
|
209
|
+
dialogSelectOpen() {
|
|
210
|
+
if (!this.readonly && this.source) {
|
|
211
|
+
this.dialogActive = true;
|
|
212
|
+
|
|
213
|
+
setTimeout(async () => {
|
|
214
|
+
if (this.multi) {
|
|
215
|
+
if (this.selectedData != null) {
|
|
216
|
+
this.$refs.dialogTable.setSelected(this.selectedData);
|
|
217
|
+
} else {
|
|
218
|
+
this.$refs.dialogTable.setSelected([]);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
this.$refs.dialogTable.open(this.param);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
// 弹出选择框选中
|
|
227
|
+
dialogCheck(row) {
|
|
228
|
+
/**
|
|
229
|
+
* 输入事件
|
|
230
|
+
* @property {object} value 选中的值 }
|
|
231
|
+
*/
|
|
232
|
+
this.$emit('input', this.parseData(row, this.sourceDataCode));
|
|
233
|
+
this.selected = this.parseData(row, this.sourceDisplayCode);
|
|
234
|
+
this.selectedData = row;
|
|
235
|
+
|
|
236
|
+
//this.$forceUpdate();
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* 选中项变化事件
|
|
240
|
+
* @property {object} row 选中行 }
|
|
241
|
+
*/
|
|
242
|
+
this.$emit('on-change', row);
|
|
243
|
+
|
|
244
|
+
this.$refs.dialogTable.close();
|
|
245
|
+
},
|
|
246
|
+
// 弹出选择框移除内容
|
|
247
|
+
dialogSelectRemove() {
|
|
248
|
+
/**
|
|
249
|
+
* 拖动完成事件
|
|
250
|
+
* @property {object} args { index1 来源行序号, index2 目标行序号 }
|
|
251
|
+
*/
|
|
252
|
+
this.$emit('input', null);
|
|
253
|
+
this.selected = null;
|
|
254
|
+
this.selectedData = null;
|
|
255
|
+
|
|
256
|
+
this.$emit('on-change');
|
|
257
|
+
},
|
|
258
|
+
// 多选保存
|
|
259
|
+
multiSave() {
|
|
260
|
+
let selectedData = this.$refs.dialogTable.getSelected();
|
|
261
|
+
let data =
|
|
262
|
+
selectedData.length == 0
|
|
263
|
+
? null
|
|
264
|
+
: selectedData.map(item => {
|
|
265
|
+
return this.parseData(item, this.sourceDataCode);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
let displayData =
|
|
269
|
+
selectedData.length == 0
|
|
270
|
+
? null
|
|
271
|
+
: selectedData
|
|
272
|
+
.map(item => {
|
|
273
|
+
return this.parseData(item, this.sourceDisplayCode);
|
|
274
|
+
})
|
|
275
|
+
.join(',');
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* 输入事件
|
|
279
|
+
* @property {object} value 选中的值 }
|
|
280
|
+
*/
|
|
281
|
+
this.$emit('input', JSON.stringify(data));
|
|
282
|
+
this.selected = displayData;
|
|
283
|
+
this.selectedData = data;
|
|
284
|
+
|
|
285
|
+
//this.$forceUpdate();
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 选中项变化事件
|
|
289
|
+
* @property {object} row 选中行 }
|
|
290
|
+
*/
|
|
291
|
+
this.$emit('on-change', data);
|
|
292
|
+
|
|
293
|
+
this.$refs.dialogTable.close();
|
|
294
|
+
},
|
|
295
|
+
// 关闭
|
|
296
|
+
close() {
|
|
297
|
+
this.$refs.dialogTable.close();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
</script>
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="1500">
|
|
4
|
+
<template #header>
|
|
5
|
+
<div>
|
|
6
|
+
<span class="title">{{ title }}</span>
|
|
7
|
+
<span class="description">{{ description }}</span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<Row :gutter="24">
|
|
11
|
+
<Col span="14">
|
|
12
|
+
<Card :bordered="false" dis-hover>
|
|
13
|
+
<template #title>
|
|
14
|
+
<div>
|
|
15
|
+
<Avatar icon="md-apps" size="small" v-color="'#1890ff'" v-bg-color="'#e6f7ff'" />
|
|
16
|
+
<span class="ivu-pl-8">待选择</span>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<view-table
|
|
20
|
+
ref="selectSourceTable"
|
|
21
|
+
:view-code="sourceViewCode"
|
|
22
|
+
:selectEnable="true"
|
|
23
|
+
:autoLoad="false"
|
|
24
|
+
:filter="sourceFilter"
|
|
25
|
+
:height="480"
|
|
26
|
+
@on-select-change="selectedChange"
|
|
27
|
+
></view-table>
|
|
28
|
+
</Card>
|
|
29
|
+
</Col>
|
|
30
|
+
<Col span="10">
|
|
31
|
+
<Card :bordered="false" dis-hover>
|
|
32
|
+
<template #title>
|
|
33
|
+
<div>
|
|
34
|
+
<Avatar icon="md-checkmark" size="small" v-color="'#1890ff'" v-bg-color="'#e6f7ff'" />
|
|
35
|
+
<span class="ivu-pl-8">已选择</span>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<view-table ref="selectTargetTable" :view-code="targetViewCode" :static="true" :height="480">
|
|
40
|
+
<template #command="{ index }">
|
|
41
|
+
<Button size="small" title="删除" type="warning" custom-icon="fa fa-trash-alt" @click="selectedRemove(index)"></Button>
|
|
42
|
+
</template>
|
|
43
|
+
</view-table>
|
|
44
|
+
</Card>
|
|
45
|
+
</Col>
|
|
46
|
+
</Row>
|
|
47
|
+
<template #footer>
|
|
48
|
+
<div>
|
|
49
|
+
<Button type="primary" custom-icon="fa fa-save" @click="seve">确定</Button>
|
|
50
|
+
<Button type="default" custom-icon="fa fa-times" @click="opened = false">关闭</Button>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
</Modal>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
<script>
|
|
57
|
+
import mixinPage from '../../mixins/page';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @displayName item-select 项目选择
|
|
61
|
+
*/
|
|
62
|
+
export default {
|
|
63
|
+
mixins: [mixinPage],
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
opened: false, // 是否打开
|
|
67
|
+
sourceFilter: {} // 来源筛选
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
created() {},
|
|
71
|
+
props: {
|
|
72
|
+
/**
|
|
73
|
+
* 来源视图代码
|
|
74
|
+
*/
|
|
75
|
+
sourceViewCode: {
|
|
76
|
+
type: String
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* 目标视图代码
|
|
80
|
+
*/
|
|
81
|
+
targetViewCode: {
|
|
82
|
+
type: String
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* 标题
|
|
86
|
+
*/
|
|
87
|
+
title: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: '明细选择'
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* 描述
|
|
93
|
+
*/
|
|
94
|
+
description: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: 'Item Select'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
computed: {},
|
|
100
|
+
methods: {
|
|
101
|
+
/**
|
|
102
|
+
* 初始化
|
|
103
|
+
*
|
|
104
|
+
* @param {string} sourceViewCode 来源视图代码
|
|
105
|
+
* @param {string} targetViewCode 目标视图代码
|
|
106
|
+
* @param {function} callback 完成后回调方法
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
init(sourceViewCode, targetViewCode, callback) {
|
|
110
|
+
this.$refs.selectSourceTable.init(sourceViewCode, () => {
|
|
111
|
+
this.$refs.selectSourceTable.loadData();
|
|
112
|
+
|
|
113
|
+
this.$refs.selectTargetTable.init(targetViewCode, () => {
|
|
114
|
+
this.setSelected([]);
|
|
115
|
+
|
|
116
|
+
if (typeof callback === 'function') {
|
|
117
|
+
callback();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* 打开
|
|
124
|
+
*
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
127
|
+
open() {
|
|
128
|
+
this.opened = true;
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* 关闭
|
|
132
|
+
*
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
close() {
|
|
136
|
+
this.opened = false;
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* 获取已选项
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
getSelected() {
|
|
144
|
+
return this.$refs.selectTargetTable.data;
|
|
145
|
+
},
|
|
146
|
+
/**
|
|
147
|
+
* 设置已选项
|
|
148
|
+
*
|
|
149
|
+
* @param {object} data 已选项
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
setSelected(data) {
|
|
153
|
+
this.$refs.selectTargetTable.loadData(data);
|
|
154
|
+
this.$refs.selectSourceTable.setSelected(data);
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* 刷新来源数据
|
|
158
|
+
*
|
|
159
|
+
* @param {object} filter 筛选项
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
loadSource(filter) {
|
|
163
|
+
for (let key in this.sourceFilter) {
|
|
164
|
+
delete this.sourceFilter[key];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (filter) {
|
|
168
|
+
for (let key in filter) {
|
|
169
|
+
this.sourceFilter[key] = filter[key];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
this.$refs.selectSourceTable.loadData();
|
|
174
|
+
},
|
|
175
|
+
selectedChange() {
|
|
176
|
+
let selected = this.$refs.selectSourceTable.getSelected();
|
|
177
|
+
|
|
178
|
+
this.$refs.selectTargetTable.loadData(selected);
|
|
179
|
+
},
|
|
180
|
+
selectedRemove(index) {
|
|
181
|
+
let selectedSource = this.$refs.selectTargetTable.data;
|
|
182
|
+
selectedSource.splice(index, 1);
|
|
183
|
+
this.$refs.selectTargetTable.loadData(selectedSource);
|
|
184
|
+
|
|
185
|
+
this.$refs.selectSourceTable.setSelected(selectedSource);
|
|
186
|
+
},
|
|
187
|
+
seve() {
|
|
188
|
+
/**
|
|
189
|
+
* 保存
|
|
190
|
+
*/
|
|
191
|
+
this.$emit('save');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
:href="linkUrl"
|
|
4
|
+
:target="target"
|
|
5
|
+
class="i-link"
|
|
6
|
+
:class="{ 'i-link-color': !linkColor }"
|
|
7
|
+
@click.exact="handleClickItem($event, false)"
|
|
8
|
+
@click.ctrl="handleClickItem($event, true)"
|
|
9
|
+
@click.meta="handleClickItem($event, true)"
|
|
10
|
+
>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</a>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import mixinsLink from 'view-ui-plus/src/mixins/link';
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'i-link',
|
|
19
|
+
mixins: [mixinsLink],
|
|
20
|
+
props: {
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
// 开启后,链接颜色为默认的蓝色,默认关闭为继承效果
|
|
26
|
+
linkColor: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
handleClickItem(event, new_window = false) {
|
|
33
|
+
if (this.disabled) {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
this.handleCheckClick(event, new_window);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
<style lang="less">
|
|
44
|
+
.i-link {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
&-color {
|
|
47
|
+
&,
|
|
48
|
+
&:hover,
|
|
49
|
+
&:active {
|
|
50
|
+
color: inherit;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ckeditor
|
|
3
|
+
:model-value="value"
|
|
4
|
+
@update:model-value="$event => $emit('input', $event)"
|
|
5
|
+
:readOnly="readonly"
|
|
6
|
+
:style="{ width: width == null ? null : width + 'px' }"
|
|
7
|
+
:editorUrl="editorUrl"
|
|
8
|
+
:config="config"
|
|
9
|
+
></ckeditor>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
import mixinPage from '../../mixins/page';
|
|
13
|
+
import util from '../../libs/util';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
mixins: [mixinPage],
|
|
17
|
+
props: {
|
|
18
|
+
value: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
21
|
+
// 只读
|
|
22
|
+
readonly: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
width: {
|
|
27
|
+
type: Number
|
|
28
|
+
},
|
|
29
|
+
height: {
|
|
30
|
+
type: Number
|
|
31
|
+
},
|
|
32
|
+
editorUrl: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'https://cdn.ckeditor.com/4.13.0/full/ckeditor.js'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
computed: {
|
|
38
|
+
config() {
|
|
39
|
+
const token = util.cookies.get('token');
|
|
40
|
+
return {
|
|
41
|
+
height: this.height == null ? 500 : this.height,
|
|
42
|
+
fileTools_requestHeaders: {
|
|
43
|
+
Authorization: 'Bearer ' + token
|
|
44
|
+
},
|
|
45
|
+
toolbar: [
|
|
46
|
+
{ name: 'document', items: ['Preview', 'Print'] },
|
|
47
|
+
{ name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
|
|
48
|
+
{ name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'Scayt'] },
|
|
49
|
+
{
|
|
50
|
+
name: 'basicstyles',
|
|
51
|
+
items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat']
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'paragraph',
|
|
55
|
+
items: [
|
|
56
|
+
'NumberedList',
|
|
57
|
+
'BulletedList',
|
|
58
|
+
'-',
|
|
59
|
+
'Outdent',
|
|
60
|
+
'Indent',
|
|
61
|
+
'-',
|
|
62
|
+
'Blockquote',
|
|
63
|
+
'CreateDiv',
|
|
64
|
+
'-',
|
|
65
|
+
'JustifyLeft',
|
|
66
|
+
'JustifyCenter',
|
|
67
|
+
'JustifyRight',
|
|
68
|
+
'JustifyBlock',
|
|
69
|
+
'-',
|
|
70
|
+
'BidiLtr',
|
|
71
|
+
'BidiRtl'
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
|
|
75
|
+
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'] },
|
|
76
|
+
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
|
|
77
|
+
{ name: 'colors', items: ['TextColor', 'BGColor'] },
|
|
78
|
+
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] }
|
|
79
|
+
],
|
|
80
|
+
filebrowserUploadUrl: this.apiBaseURL + 'api/CKEditor?r=1'
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {}
|
|
85
|
+
};
|
|
86
|
+
</script>
|