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,206 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" :width="800">
|
|
3
|
+
<template #header>
|
|
4
|
+
<div>
|
|
5
|
+
<span class="title">字段选择</span>
|
|
6
|
+
<span class="description">Column Select</span>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<div class="ivu-ml-8 ivu-mr-8">
|
|
10
|
+
<Tree :data="data" show-checkbox></Tree>
|
|
11
|
+
</div>
|
|
12
|
+
<template #footer>
|
|
13
|
+
<div>
|
|
14
|
+
<Button type="primary" custom-icon="fa fa-save" @click="finish">确定</Button>
|
|
15
|
+
<Button type="default" custom-icon="fa fa-times" @click="close">关闭</Button>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
</Modal>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
import mixinPage from '../../mixins/page';
|
|
22
|
+
import dataViewApi from '../../api/dataView';
|
|
23
|
+
|
|
24
|
+
// 转换为tree列表对象
|
|
25
|
+
var convertList = (nodes, columns) => {
|
|
26
|
+
if (!nodes) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return nodes.map(item => {
|
|
31
|
+
return {
|
|
32
|
+
column: {
|
|
33
|
+
code: item.code,
|
|
34
|
+
name: item.name,
|
|
35
|
+
dataType: item.dataType,
|
|
36
|
+
columns: item.columns
|
|
37
|
+
},
|
|
38
|
+
title: item.name + ' (' + item.code + ')',
|
|
39
|
+
checked: columns.some(column => {
|
|
40
|
+
return column.code === item.code;
|
|
41
|
+
}),
|
|
42
|
+
children: convertList(item.columns, columns)
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// 聚合属性列表对象
|
|
48
|
+
var convertGroup = (nodes, columns, groupColumns) => {
|
|
49
|
+
let results = [];
|
|
50
|
+
|
|
51
|
+
groupColumns.forEach(groupColumn => {
|
|
52
|
+
results.push({
|
|
53
|
+
column: {
|
|
54
|
+
code: groupColumn.property,
|
|
55
|
+
name: groupColumn.property,
|
|
56
|
+
dataType: groupColumn.dataType == 'DateTime' && groupColumn.dateTimeGroupType != 'Day' ? 'Integer' : groupColumn.dataType,
|
|
57
|
+
columns: []
|
|
58
|
+
},
|
|
59
|
+
title: groupColumn.property + ' (' + groupColumn.property + ')',
|
|
60
|
+
checked: columns.some(column => {
|
|
61
|
+
return column.code === groupColumn.property;
|
|
62
|
+
})
|
|
63
|
+
// children: convertGroup(item.columns, columns, isGroupBy, groupColumns)
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (groupColumn.property.endsWith('ID')) {
|
|
67
|
+
// 外键
|
|
68
|
+
let objColumnExp = groupColumn.columnExp.substr(0, groupColumn.columnExp.length - 2);
|
|
69
|
+
let objProperty = groupColumn.property.substr(0, groupColumn.property.length - 2);
|
|
70
|
+
let node = findNode(nodes, objColumnExp);
|
|
71
|
+
|
|
72
|
+
if (node != null) {
|
|
73
|
+
// 找到外键节点
|
|
74
|
+
results.push({
|
|
75
|
+
column: {
|
|
76
|
+
code: objProperty,
|
|
77
|
+
name: node.name,
|
|
78
|
+
dataType: node.dataType,
|
|
79
|
+
columns: node.columns
|
|
80
|
+
},
|
|
81
|
+
title: node.name + ' (' + objProperty + ')',
|
|
82
|
+
checked: columns.some(column => {
|
|
83
|
+
return column.code === objProperty;
|
|
84
|
+
}),
|
|
85
|
+
children: convertList(node.columns, columns)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return results;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// 获取选中项目
|
|
95
|
+
var getChecked = data => {
|
|
96
|
+
let checked = [];
|
|
97
|
+
|
|
98
|
+
data.forEach(item => {
|
|
99
|
+
if (item.checked) {
|
|
100
|
+
// 外键字段
|
|
101
|
+
if (item.column.dataType === 'BigInteger') {
|
|
102
|
+
let obj = data.find(x => {
|
|
103
|
+
return x.column.code + 'ID' === item.column.code;
|
|
104
|
+
});
|
|
105
|
+
if (obj) {
|
|
106
|
+
item.column.objColumn = obj.column;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
checked.push({
|
|
111
|
+
...item.column
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (item.children) {
|
|
116
|
+
checked = checked.concat(getChecked(item.children));
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
return checked;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var findNode = (nodes, columnExp) => {
|
|
124
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
125
|
+
if (nodes[i].code == columnExp) {
|
|
126
|
+
return nodes[i];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (nodes[i].columns) {
|
|
130
|
+
let node = findNode(nodes[i].columns, columnExp);
|
|
131
|
+
if (node) {
|
|
132
|
+
return node;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return null;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export default {
|
|
141
|
+
mixins: [mixinPage],
|
|
142
|
+
components: {},
|
|
143
|
+
data() {
|
|
144
|
+
return {
|
|
145
|
+
data: [],
|
|
146
|
+
columns: null,
|
|
147
|
+
opened: false,
|
|
148
|
+
callback: null
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
props: {},
|
|
152
|
+
computed: {},
|
|
153
|
+
methods: {
|
|
154
|
+
async open(dataView, columns, callback) {
|
|
155
|
+
if (!dataView.isDataSource) {
|
|
156
|
+
// 对象
|
|
157
|
+
let res = await dataViewApi.queryColumnByModel(dataView.model);
|
|
158
|
+
let groupColumns = [];
|
|
159
|
+
let groupMethods = [];
|
|
160
|
+
|
|
161
|
+
if (dataView.isGroupBy) {
|
|
162
|
+
groupColumns = JSON.parse(dataView.groupColumn);
|
|
163
|
+
groupMethods = JSON.parse(dataView.groupMethod);
|
|
164
|
+
|
|
165
|
+
this.data = convertGroup(res, columns, groupColumns);
|
|
166
|
+
} else {
|
|
167
|
+
this.data = convertList(res, columns);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// 聚合函数生成的字段
|
|
171
|
+
groupMethods.forEach(groupMethod => {
|
|
172
|
+
this.data.push({
|
|
173
|
+
column: {
|
|
174
|
+
code: groupMethod.property,
|
|
175
|
+
name: groupMethod.property,
|
|
176
|
+
dataType: groupMethod.aggregateType == 'Count' ? 'Integer' : groupMethod.dataType
|
|
177
|
+
},
|
|
178
|
+
title: groupMethod.aggregateType + (groupMethod.aggregateType == 'Count' ? '' : ' - ' + groupMethod.columnExp) + ' (' + groupMethod.property + ')',
|
|
179
|
+
checked: columns.some(column => {
|
|
180
|
+
return column.code === groupMethod.property;
|
|
181
|
+
})
|
|
182
|
+
// children: convertList(item.columns, columns, isGroupBy, groupColumns)
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
// 数据源
|
|
187
|
+
let res = await dataViewApi.queryColumnByDataSource(dataView.dataSource);
|
|
188
|
+
this.data = convertList(res, columns);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
this.opened = true;
|
|
192
|
+
this.columns = columns;
|
|
193
|
+
this.callback = callback;
|
|
194
|
+
},
|
|
195
|
+
finish() {
|
|
196
|
+
let checked = getChecked(this.data);
|
|
197
|
+
|
|
198
|
+
this.callback(checked);
|
|
199
|
+
this.opened = false;
|
|
200
|
+
},
|
|
201
|
+
close() {
|
|
202
|
+
this.opened = false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
</script>
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
|
|
4
|
+
<template #header>
|
|
5
|
+
<div>
|
|
6
|
+
<span class="title">条件设置</span>
|
|
7
|
+
<span class="description">Condition Setting</span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<div class="ivu-ml-8 ivu-mr-8">
|
|
11
|
+
<Form ref="form" :model="data" label-position="top" label-colon=":" class="ivu-mt" :rules="rules" @submit.prevent>
|
|
12
|
+
<Row :gutter="24" type="flex">
|
|
13
|
+
<Col v-bind="grid24">
|
|
14
|
+
<FormItem label="判断条件" key="type" prop="type">
|
|
15
|
+
<RadioGroup v-model="data.type" @on-change="onTypeChange">
|
|
16
|
+
<Radio v-for="item in getEnumList('ConditionType')" :key="item.id" :label="item.id">{{ item.name }}</Radio>
|
|
17
|
+
</RadioGroup>
|
|
18
|
+
</FormItem>
|
|
19
|
+
</Col>
|
|
20
|
+
<Col v-bind="grid24" v-if="data.type == 'Expression'">
|
|
21
|
+
<FormItem label="表达式" key="expression" prop="expression">
|
|
22
|
+
<Input type="text" v-model="data.expression" maxlength="500" />
|
|
23
|
+
</FormItem>
|
|
24
|
+
</Col>
|
|
25
|
+
</Row>
|
|
26
|
+
</Form>
|
|
27
|
+
<div v-show="data.type == 'Condition'">
|
|
28
|
+
<Divider :plain="true" dashed orientation="left" size="small">
|
|
29
|
+
<span class="title">条件</span>
|
|
30
|
+
</Divider>
|
|
31
|
+
<view-table ref="conditionTable" :static="true" view-code="ColumnCondition" :pageEnable="false" :embedded="true">
|
|
32
|
+
<template #column="{ row, code }">
|
|
33
|
+
<template v-if="code == 'code'">
|
|
34
|
+
<Input type="text" size="small" v-model="row.code">
|
|
35
|
+
<template #prepend>
|
|
36
|
+
<Button size="small" custom-icon="fa fa-search" @click="openColumnSelect(row)"></Button>
|
|
37
|
+
</template>
|
|
38
|
+
</Input>
|
|
39
|
+
</template>
|
|
40
|
+
</template>
|
|
41
|
+
</view-table>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<template #footer>
|
|
45
|
+
<div>
|
|
46
|
+
<Button type="primary" custom-icon="fa fa-check" @click="save">确定</Button>
|
|
47
|
+
<Button type="default" custom-icon="fa fa-times" @click="opened = false">关闭</Button>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
</Modal>
|
|
51
|
+
<column-check ref="columnCheck" />
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
<script>
|
|
55
|
+
import mixinPage from '../../mixins/page';
|
|
56
|
+
import columnCheck from './column-check';
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
mixins: [mixinPage],
|
|
60
|
+
components: { columnCheck },
|
|
61
|
+
data() {
|
|
62
|
+
return {
|
|
63
|
+
parentData: null,
|
|
64
|
+
jsonKey: null,
|
|
65
|
+
checkKey: null,
|
|
66
|
+
json: null,
|
|
67
|
+
model: null,
|
|
68
|
+
data: {},
|
|
69
|
+
opened: false,
|
|
70
|
+
rules: {
|
|
71
|
+
expression: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
required: true,
|
|
74
|
+
message: '请输入表达式',
|
|
75
|
+
trigger: 'blur,change'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
async created() {},
|
|
81
|
+
props: {},
|
|
82
|
+
computed: {},
|
|
83
|
+
methods: {
|
|
84
|
+
// 打开
|
|
85
|
+
open(parentData, jsonKey, checkKey, model) {
|
|
86
|
+
this.parentData = parentData;
|
|
87
|
+
this.jsonKey = jsonKey;
|
|
88
|
+
this.checkKey = checkKey;
|
|
89
|
+
let json = parentData[jsonKey];
|
|
90
|
+
if (!!(json || '').trim()) {
|
|
91
|
+
this.data = JSON.parse(json);
|
|
92
|
+
} else {
|
|
93
|
+
this.data = {
|
|
94
|
+
type: parentData[checkKey] ? 'True' : 'False'
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
this.model = model;
|
|
99
|
+
this.onTypeChange();
|
|
100
|
+
this.opened = true;
|
|
101
|
+
this.$refs.form.resetFields();
|
|
102
|
+
},
|
|
103
|
+
// 类型变更
|
|
104
|
+
onTypeChange() {
|
|
105
|
+
if (this.data.type == 'Condition') {
|
|
106
|
+
if (!this.data.condition) {
|
|
107
|
+
this.data.condition = [];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this.$refs.conditionTable.loadData(this.data.condition);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//this.$forceUpdate();
|
|
114
|
+
},
|
|
115
|
+
// 打开变量字段选择界面
|
|
116
|
+
openColumnSelect(row) {
|
|
117
|
+
if (this.model != null) {
|
|
118
|
+
this.$refs.columnCheck.open(this.model, checked => {
|
|
119
|
+
row.code = checked.code;
|
|
120
|
+
//this.$forceUpdate();
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
// 保存
|
|
125
|
+
async save() {
|
|
126
|
+
let isOK = await this.$refs.form.validate();
|
|
127
|
+
|
|
128
|
+
if (!isOK) {
|
|
129
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (this.data.type == 'Condition') {
|
|
134
|
+
if (!this.$refs.conditionTable.validate()) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let condition = this.$refs.conditionTable.getData();
|
|
139
|
+
|
|
140
|
+
if (condition.length == 0) {
|
|
141
|
+
this.error('至少需要包含一项条件!');
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
this.data.condition = this.$refs.conditionTable.getData();
|
|
146
|
+
} else {
|
|
147
|
+
this.data.condition = [];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.parentData[this.jsonKey] = JSON.stringify(this.data);
|
|
151
|
+
|
|
152
|
+
if (this.data.type == 'True') {
|
|
153
|
+
this.parentData[this.checkKey] = true;
|
|
154
|
+
} else if (this.data.type == 'False') {
|
|
155
|
+
this.parentData[this.checkKey] = false;
|
|
156
|
+
} else {
|
|
157
|
+
this.parentData[this.checkKey] = null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
this.opened = false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
</script>
|