imatrix-ui 0.0.15 → 0.1.1-up
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/.vscode/extensions.json +3 -0
- package/README.md +7 -0
- package/components/dynamic-source-select/dynamic-source-select-service.js +106 -0
- package/components/dynamic-source-select/dynamic-source-select.vue +673 -0
- package/components/dynamic-source-select/events.js +77 -0
- package/components/fs-preview/fs-preview.vue +287 -0
- package/components/index.js +26 -0
- package/components/plugins/export-data-new.js +623 -0
- package/components/plugins/export-data.js +431 -0
- package/components/plugins/index.js +15 -0
- package/components/plugins/public-method.js +47 -0
- package/components/rich-editor/index-bak.vue +306 -0
- package/components/rich-editor/index.vue +236 -0
- package/components/rich-editor/langs/zh-Hans.js +438 -0
- package/components/rich-editor/viewer.vue +105 -0
- package/components/super-grid/apis.js +1065 -0
- package/components/super-grid/columns-config.vue +430 -0
- package/components/super-grid/custom-formatter.js +330 -0
- package/components/super-grid/dynamic-input.vue +1706 -0
- package/components/super-grid/eventBus.js +2 -0
- package/components/super-grid/events.js +56 -0
- package/components/super-grid/formValidatorUtil.js +300 -0
- package/components/super-grid/formatter.js +190 -0
- package/components/super-grid/group-column.vue +100 -0
- package/components/super-grid/header-context-menu.vue +82 -0
- package/components/super-grid/index-column.vue +69 -0
- package/components/super-grid/normal-column.vue +1148 -0
- package/components/super-grid/public-methods.js +30 -0
- package/components/super-grid/row-operation.vue +193 -0
- package/components/super-grid/search-button.vue +74 -0
- package/components/super-grid/search-condition-input.vue +73 -0
- package/components/super-grid/search-condition-list.vue +68 -0
- package/components/super-grid/search-form-advancedQuery.vue +820 -0
- package/components/super-grid/search-form-dialog.vue +77 -0
- package/components/super-grid/search-form-item.vue +470 -0
- package/components/super-grid/search-form-number.vue +111 -0
- package/components/super-grid/search-form-open.vue +178 -0
- package/components/super-grid/search-form-ordinarySearch.vue +218 -0
- package/components/super-grid/search-form.vue +756 -0
- package/components/super-grid/search-methods.js +484 -0
- package/components/super-grid/selection-column.vue +46 -0
- package/components/super-grid/store.js +3 -0
- package/components/super-grid/super-grid-service.js +682 -0
- package/components/super-grid/super-grid.vue +2893 -0
- package/components/super-grid/utils.js +851 -0
- package/components/super-grid/view-image-dialog.vue +173 -0
- package/components/utils/gogocodeTransfer.js +59 -0
- package/components/utils/utils.js +180 -0
- package/components/utils/value-set.js +98 -0
- package/components/z-test-utton/index.vue +82 -0
- package/package.json +29 -40
- package/public/index.html +13 -0
- package/public/vite.svg +1 -0
- package/src/api/sso-service.js +172 -19
- package/src/api/tab.js +36 -0
- package/src/api/user-service.js +11 -11
- package/src/assets/401/401.gif +0 -0
- package/src/assets/404/404-cloud.png +0 -0
- package/src/assets/404/404.png +0 -0
- package/src/assets/cloud.png +0 -0
- package/src/directives/permission/index.js +13 -13
- package/src/directives/permission/permission.js +20 -15
- package/src/i18n/i18n.js +16 -0
- package/src/i18n/langs/cn.js +254 -0
- package/src/i18n/langs/en.js +264 -0
- package/src/permission.js +157 -71
- package/src/plugins.js +18 -18
- package/src/router/index.js +96 -69
- package/src/store/getters.js +15 -10
- package/src/store/index.js +19 -19
- package/src/store/modules/app.js +54 -42
- package/src/store/modules/permission.js +137 -73
- package/src/store/modules/tab-content.js +36 -0
- package/src/store/modules/user.js +293 -80
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/element-ui.scss +29 -29
- package/src/styles/index.scss +157 -78
- package/src/styles/mixin.scss +27 -27
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +306 -0
- package/src/styles/theme/black/sidebar.scss +189 -0
- package/src/styles/theme/blue/font-style.scss +46 -0
- package/src/styles/theme/blue/index.scss +172 -0
- package/src/styles/{sidebar.scss → theme/blue/sidebar.scss} +171 -141
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +188 -0
- package/src/styles/theme/blue2/sidebar.scss +201 -0
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +62 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +269 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +266 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/card-style.scss +54 -0
- package/src/styles/theme/gray/font-style.scss +70 -0
- package/src/styles/theme/gray/index.scss +172 -0
- package/src/styles/theme/gray/input-style.scss +19 -0
- package/src/styles/theme/gray/scrollbar-style.scss +32 -0
- package/src/styles/theme/gray/sidebar.scss +231 -0
- package/src/styles/theme/gray/tab-style.scss +81 -0
- package/src/styles/transition.scss +47 -46
- package/src/utils/auth-api.js +159 -0
- package/src/utils/auth.js +61 -15
- package/src/utils/calculator/calculator-factory-wf.js +558 -0
- package/src/utils/calculator/calculator-factory.js +145 -0
- package/src/utils/calculator/calculator-util.js +166 -0
- package/src/utils/common-util.js +305 -0
- package/src/utils/eventBus.js +2 -0
- package/src/utils/iconUtils.js +28 -0
- package/src/utils/index.js +102 -86
- package/src/utils/jump-page-utils.js +814 -0
- package/src/utils/local-storage.js +33 -31
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +31 -26
- package/src/utils/permissionAuth.js +90 -0
- package/src/utils/range-selector.js +188 -0
- package/src/utils/request.js +270 -116
- package/src/utils/restful-interface-utils.js +57 -0
- package/src/utils/util.js +698 -0
- package/src/utils/validate.js +34 -33
- package/src/utils/watermark.js +108 -0
- package/src/utils/workflow-util.js +93 -0
- package/src/views/404.vue +248 -228
- package/src/views/dsc-component/Sidebar/Item.vue +84 -0
- package/src/views/dsc-component/Sidebar/Link.vue +38 -0
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +196 -0
- package/src/views/dsc-component/Sidebar/index.vue +220 -0
- package/src/views/dsc-component/tabs/tab-content.vue +199 -0
- package/src/views/error-page/401.vue +106 -91
- package/src/views/error-page/404.vue +248 -228
- package/src/views/layout/EmptyLayout.vue +3 -0
- package/src/views/layout/Layout.vue +81 -68
- package/src/views/layout/NewLayout.vue +18 -0
- package/src/views/layout/components/AppMain.vue +39 -29
- package/src/views/layout/components/Breadcrumb/index.vue +156 -0
- package/src/views/layout/components/Menubar/Item.vue +57 -0
- package/src/views/layout/components/Menubar/Link.vue +38 -0
- package/src/views/layout/components/Menubar/SidebarItem.vue +164 -0
- package/src/views/layout/components/Menubar/index.vue +210 -0
- package/src/views/layout/components/Sidebar/Item.vue +53 -29
- package/src/views/layout/components/Sidebar/Link.vue +38 -39
- package/src/views/layout/components/Sidebar/SidebarItem.vue +135 -100
- package/src/views/layout/components/Sidebar/index.vue +141 -48
- package/src/views/layout/components/iframe-page.vue +38 -0
- package/src/views/layout/components/index.js +4 -3
- package/src/views/layout/components/tabs/tab-content.vue +207 -0
- package/src/views/layout/mixin/ResizeHandler.js +41 -41
- package/src/views/layout/tab-content-iframe-index.vue +38 -0
- package/src/views/layout/tab-content-index.vue +93 -0
- package/src/views/login/authredirect.vue +10 -10
- package/src/views/login/index.vue +296 -203
- package/src/views/login/update-password.vue +243 -0
- package/src/views/redirect/index.vue +14 -12
- package/src/views/wf-history/tache-subprocess-history.vue +45 -0
- package/vite.config.js +31 -0
- package/lib/super-ui.css +0 -1
- package/lib/super-ui.umd.min.js +0 -2
- package/src/styles/variables.scss +0 -4
- package/src/views/layout/components/Navbar.vue +0 -92
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const publicMethods = {
|
|
2
|
+
clearSelection: function () {
|
|
3
|
+
this.$refs.superGrid.clearSelection()
|
|
4
|
+
},
|
|
5
|
+
toggleRowSelection: function (row, selected) {
|
|
6
|
+
this.$refs.superGrid.toggleRowSelection(row, selected)
|
|
7
|
+
},
|
|
8
|
+
toggleAllSelection: function () {
|
|
9
|
+
this.$refs.superGrid.toggleAllSelection()
|
|
10
|
+
},
|
|
11
|
+
toggleRowExpansion: function (row, expanded) {
|
|
12
|
+
this.$refs.superGrid.toggleRowExpansion(row, expanded)
|
|
13
|
+
},
|
|
14
|
+
setCurrentRow: function (row) {
|
|
15
|
+
this.$refs.superGrid.setCurrentRow(row)
|
|
16
|
+
},
|
|
17
|
+
clearSort: function () {
|
|
18
|
+
this.$refs.superGrid.clearSort()
|
|
19
|
+
},
|
|
20
|
+
clearFilter: function (columnKey) {
|
|
21
|
+
this.$refs.superGrid.clearFilter(columnKey)
|
|
22
|
+
},
|
|
23
|
+
doLayout: function () {
|
|
24
|
+
this.$refs.superGrid.doLayout()
|
|
25
|
+
},
|
|
26
|
+
sort: function (prop, order) {
|
|
27
|
+
this.$refs.superGrid.sort(prop, order)
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
export default publicMethods
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!--将@click改为@mousedown.native是因为操作列保存按钮时事件和input等组件的@blur冲突,导致保存需要保存两次,因为
|
|
3
|
+
@blur先于@click执行的,所以只会执行@blur,@click就失效了,@mousedown是先于@blur执行的-->
|
|
4
|
+
<span :style="myStyle">
|
|
5
|
+
<span v-if="isShowButton()">
|
|
6
|
+
<span v-if="label">
|
|
7
|
+
<!-- <el-tooltip :content="label" class="item" effect="dark" placement="top-start"> -->
|
|
8
|
+
<component
|
|
9
|
+
v-bind="operationSetting"
|
|
10
|
+
:is="elementType"
|
|
11
|
+
v-if="operationSetting.permission"
|
|
12
|
+
v-permission="operationSetting.permission"
|
|
13
|
+
:disabled="preventReclick"
|
|
14
|
+
@mousedown="onClickFun(operationSetting)"
|
|
15
|
+
>{{ label }}</component
|
|
16
|
+
>
|
|
17
|
+
<component
|
|
18
|
+
v-bind="operationSetting"
|
|
19
|
+
:is="elementType"
|
|
20
|
+
v-else
|
|
21
|
+
:disabled="preventReclick"
|
|
22
|
+
@mousedown="onClickFun(operationSetting)"
|
|
23
|
+
>{{ label }}</component
|
|
24
|
+
>
|
|
25
|
+
<!-- </el-tooltip> -->
|
|
26
|
+
</span>
|
|
27
|
+
<span v-else>
|
|
28
|
+
<component
|
|
29
|
+
v-bind="operationSetting"
|
|
30
|
+
:is="elementType"
|
|
31
|
+
v-if="operationSetting.permission"
|
|
32
|
+
v-permission="operationSetting.permission"
|
|
33
|
+
:disabled="preventReclick"
|
|
34
|
+
@mousedown="onClickFun(operationSetting)"
|
|
35
|
+
/>
|
|
36
|
+
<component
|
|
37
|
+
v-bind="operationSetting"
|
|
38
|
+
:is="elementType"
|
|
39
|
+
v-else
|
|
40
|
+
:disabled="preventReclick"
|
|
41
|
+
@mousedown="onClickFun(operationSetting)"
|
|
42
|
+
/>
|
|
43
|
+
</span>
|
|
44
|
+
</span>
|
|
45
|
+
</span>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { mapGetters } from 'vuex'
|
|
50
|
+
import customFormatter from './custom-formatter'
|
|
51
|
+
import { analysisCondition } from '../../src/utils/util'
|
|
52
|
+
export default {
|
|
53
|
+
name: 'RowOperation',
|
|
54
|
+
props: {
|
|
55
|
+
editing: {
|
|
56
|
+
// 当前行是否是编辑行
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
isShow: {
|
|
61
|
+
type: [Boolean, Function],
|
|
62
|
+
default: true,
|
|
63
|
+
},
|
|
64
|
+
onClick: {
|
|
65
|
+
type: Function,
|
|
66
|
+
default: function () {},
|
|
67
|
+
},
|
|
68
|
+
entity: {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
column: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: null,
|
|
75
|
+
},
|
|
76
|
+
rowIndex: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: null,
|
|
79
|
+
},
|
|
80
|
+
label: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: null,
|
|
83
|
+
},
|
|
84
|
+
operationSetting: {
|
|
85
|
+
type: Object,
|
|
86
|
+
default: null,
|
|
87
|
+
},
|
|
88
|
+
operationIndex: {
|
|
89
|
+
type: Number,
|
|
90
|
+
default: null,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
data() {
|
|
94
|
+
return {
|
|
95
|
+
elementType: 'el-button', // 组件标签,默认是按钮
|
|
96
|
+
myStyle: null, // 组件样式
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
...mapGetters(['preventReclick']),
|
|
101
|
+
},
|
|
102
|
+
created() {
|
|
103
|
+
if (
|
|
104
|
+
this.operationSetting.elementType &&
|
|
105
|
+
this.operationSetting.elementType === 'el-link'
|
|
106
|
+
) {
|
|
107
|
+
this.operationSetting.type = 'primary'
|
|
108
|
+
}
|
|
109
|
+
if (
|
|
110
|
+
!this.operationSetting.elementType ||
|
|
111
|
+
this.operationSetting.elementType === 'el-button'
|
|
112
|
+
) {
|
|
113
|
+
this.operationSetting.size = 'mini'
|
|
114
|
+
}
|
|
115
|
+
if (this.operationSetting.style) {
|
|
116
|
+
// 等于配置的样式
|
|
117
|
+
this.myStyle = this.operationSetting.style
|
|
118
|
+
} else if (
|
|
119
|
+
this.operationIndex !== 0 &&
|
|
120
|
+
(this.operationSetting.elementType === undefined ||
|
|
121
|
+
this.operationSetting.elementType === 'el-button')
|
|
122
|
+
) {
|
|
123
|
+
// 如果不是第0个元素,且是按钮时,添加左边距10px,使按钮不紧挨着
|
|
124
|
+
this.myStyle = { marginLeft: '10px' }
|
|
125
|
+
}
|
|
126
|
+
if (this.operationSetting.elementType) {
|
|
127
|
+
this.elementType = this.operationSetting.elementType
|
|
128
|
+
}
|
|
129
|
+
// if (!this.operationSetting.icon) {
|
|
130
|
+
// if (this.operationSetting.code === 'lineEditUpdate') {
|
|
131
|
+
// this.operationSetting.icon = 'el-icon-edit'
|
|
132
|
+
// } else if (this.operationSetting.code === 'lineEditSave') {
|
|
133
|
+
// this.operationSetting.icon = 'el-icon-check'
|
|
134
|
+
// } else if (this.operationSetting.code === 'lineEditDelete') {
|
|
135
|
+
// this.operationSetting.icon = 'el-icon-delete'
|
|
136
|
+
// } else if (this.operationSetting.code === 'restoreEdit') {
|
|
137
|
+
// this.operationSetting.icon = 'el-icon-circle-close'
|
|
138
|
+
// } else if (this.operationSetting.code === 'viewDetail') {
|
|
139
|
+
// this.operationSetting.icon = 'el-icon-view'
|
|
140
|
+
// }
|
|
141
|
+
// }
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
onClickFun(button) {
|
|
145
|
+
customFormatter.onClickFun(
|
|
146
|
+
this.entity,
|
|
147
|
+
this.column,
|
|
148
|
+
this.onClick,
|
|
149
|
+
this.rowIndex,
|
|
150
|
+
button
|
|
151
|
+
)
|
|
152
|
+
},
|
|
153
|
+
isShowButton() {
|
|
154
|
+
// const start = new Date().getTime()
|
|
155
|
+
const val = customFormatter.isShowButtonFun(
|
|
156
|
+
this.entity,
|
|
157
|
+
this.column,
|
|
158
|
+
this.isShow,
|
|
159
|
+
this.rowIndex
|
|
160
|
+
)
|
|
161
|
+
if (this.operationSetting.buttonDisplayConditionsList) {
|
|
162
|
+
const displayJudgment = JSON.stringify(
|
|
163
|
+
this.operationSetting.buttonDisplayConditionsList
|
|
164
|
+
)
|
|
165
|
+
return analysisCondition(
|
|
166
|
+
displayJudgment,
|
|
167
|
+
this.entity,
|
|
168
|
+
{},
|
|
169
|
+
{},
|
|
170
|
+
true,
|
|
171
|
+
null,
|
|
172
|
+
null
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (val) {
|
|
177
|
+
if (this.editing) {
|
|
178
|
+
if (this.operationSetting.code === 'lineEditUpdate') {
|
|
179
|
+
return false
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
if (this.operationSetting.code === 'restoreEdit') {
|
|
183
|
+
return false
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// const end = new Date().getTime()
|
|
188
|
+
// console.log('---super-grid--isShowButtonFun--time1=', (end - start))
|
|
189
|
+
return val
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
}
|
|
193
|
+
</script>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="text-align: right" class="search-button">
|
|
3
|
+
<!-- :loading="loading" -->
|
|
4
|
+
<el-button size="small" @click="$emit('save-condition')">
|
|
5
|
+
{{ $t('superGrid.saveCondition') }}
|
|
6
|
+
</el-button>
|
|
7
|
+
<el-button :loading="loading" size="small" @click="resetForm">
|
|
8
|
+
{{ $t('imatrixUIPublicModel.reset') }}
|
|
9
|
+
</el-button>
|
|
10
|
+
<el-button
|
|
11
|
+
:loading="loading"
|
|
12
|
+
type="primary"
|
|
13
|
+
size="small"
|
|
14
|
+
@click="submitForm"
|
|
15
|
+
>
|
|
16
|
+
{{ $t('imatrixUIMessage.search') }}
|
|
17
|
+
</el-button>
|
|
18
|
+
<el-button
|
|
19
|
+
size="small"
|
|
20
|
+
type="text"
|
|
21
|
+
:icon="isMyOpen ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
|
|
22
|
+
@click="openFold"
|
|
23
|
+
>
|
|
24
|
+
{{ isMyOpen ? $t('superGrid.fold') : $t('superGrid.open') }}
|
|
25
|
+
</el-button>
|
|
26
|
+
<!-- <span v-if="advancedQuery !== null && advancedQuery!== undefined && advancedQuery === true && normalQuery !== null && normalQuery!== undefined && normalQuery === true" style="margin-left:10px">
|
|
27
|
+
<el-button v-if="searchType === 'advanced'" size="mini" @click="searchType = 'normal'">
|
|
28
|
+
{{ $t('imatrixUIPublicModel.switchToNormalQuery') }}
|
|
29
|
+
</el-button>
|
|
30
|
+
<el-button v-if="searchType === 'normal'" size="mini" @click="searchType = 'advanced'">
|
|
31
|
+
{{ $t('imatrixUIPublicModel.switchToAdvancedQuery') }}
|
|
32
|
+
</el-button>
|
|
33
|
+
</span> -->
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { $on, $off, $once, $emit } from '../utils/gogocodeTransfer'
|
|
39
|
+
export default {
|
|
40
|
+
name: 'SearchButton',
|
|
41
|
+
props: {
|
|
42
|
+
isOpen: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
const isMyOpen = this.isOpen
|
|
49
|
+
return {
|
|
50
|
+
isMyOpen, // false表示折叠状态,应该显示“展开”,true表示当前是展开状态,应该显示“折叠”
|
|
51
|
+
loading: false,
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
openFold() {
|
|
56
|
+
this.isMyOpen = !this.isMyOpen
|
|
57
|
+
$emit(this, 'open-fold', this.isMyOpen)
|
|
58
|
+
},
|
|
59
|
+
submitForm() {
|
|
60
|
+
this.loading = true
|
|
61
|
+
$emit(this, 'submit-form')
|
|
62
|
+
},
|
|
63
|
+
resetForm() {
|
|
64
|
+
this.loading = true
|
|
65
|
+
$emit(this, 'reset-form')
|
|
66
|
+
},
|
|
67
|
+
// 加载完毕
|
|
68
|
+
searchComplete() {
|
|
69
|
+
this.loading = false
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
emits: ['save-condition', 'open-fold', 'submit-form', 'reset-form'],
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-dialog
|
|
4
|
+
model-value
|
|
5
|
+
:title="$t('superGrid.saveConditionTitle')"
|
|
6
|
+
:close-on-click-modal="false"
|
|
7
|
+
append-to-body
|
|
8
|
+
@open="$emit('open')"
|
|
9
|
+
@opend="$emit('opend')"
|
|
10
|
+
@close="$emit('close')"
|
|
11
|
+
@closed="$emit('closed')"
|
|
12
|
+
>
|
|
13
|
+
<el-form
|
|
14
|
+
ref="conditionForm"
|
|
15
|
+
:model="searchCondition"
|
|
16
|
+
size="mini"
|
|
17
|
+
label-position="left"
|
|
18
|
+
label-width="120px"
|
|
19
|
+
>
|
|
20
|
+
<el-form-item
|
|
21
|
+
prop="conditionName"
|
|
22
|
+
:label="$t('superGrid.searchConditionName')"
|
|
23
|
+
:rules="[
|
|
24
|
+
{
|
|
25
|
+
required: true,
|
|
26
|
+
message: this.$t('superGrid.pleaseInputSearchConditionName'),
|
|
27
|
+
trigger: 'blur',
|
|
28
|
+
},
|
|
29
|
+
]"
|
|
30
|
+
>
|
|
31
|
+
<el-input v-model="searchCondition.conditionName" size="mini" />
|
|
32
|
+
</el-form-item>
|
|
33
|
+
</el-form>
|
|
34
|
+
<template v-slot:footer>
|
|
35
|
+
<div class="dialog-footer" style="padding-bottom: 10px">
|
|
36
|
+
<el-button size="small" @click="$emit('close')">
|
|
37
|
+
{{ $t('imatrixUIPublicModel.cancel') }}
|
|
38
|
+
</el-button>
|
|
39
|
+
<el-button size="small" type="primary" @click="saveCondition">
|
|
40
|
+
{{ $t('imatrixUIPublicModel.sure') }}
|
|
41
|
+
</el-button>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
</el-dialog>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { $on, $off, $once, $emit } from '../utils/gogocodeTransfer'
|
|
50
|
+
export default {
|
|
51
|
+
name: 'SearchConditionInput',
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
searchCondition: {
|
|
55
|
+
conditionName: null,
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
saveCondition() {
|
|
61
|
+
this.$refs['conditionForm'].validate((valid) => {
|
|
62
|
+
if (valid) {
|
|
63
|
+
$emit(this, 'close', this.searchCondition.conditionName)
|
|
64
|
+
} else {
|
|
65
|
+
// console.log('error submit!!')
|
|
66
|
+
return false
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
emits: ['open', 'opend', 'close', 'closed', 'opend', 'close', 'closed'],
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-tabs
|
|
3
|
+
v-model="editConditionId"
|
|
4
|
+
type="card"
|
|
5
|
+
@tab-remove="removeCondition"
|
|
6
|
+
@tab-click="selectCondition"
|
|
7
|
+
>
|
|
8
|
+
<el-tab-pane
|
|
9
|
+
v-for="item in searchConditions"
|
|
10
|
+
:key="item.id"
|
|
11
|
+
:label="item.name"
|
|
12
|
+
:disabled="item.queryType !== pageQueryType"
|
|
13
|
+
:closable="item.queryType === pageQueryType"
|
|
14
|
+
:name="item.id + ''"
|
|
15
|
+
/>
|
|
16
|
+
</el-tabs>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import { $on, $off, $once, $emit } from '../utils/gogocodeTransfer'
|
|
21
|
+
export default {
|
|
22
|
+
name: 'SearchConditionList',
|
|
23
|
+
components: {},
|
|
24
|
+
props: {
|
|
25
|
+
searchConditions: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
searchType: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
let pageQueryType = 'FIXED'
|
|
36
|
+
if (this.searchType && this.searchType === 'advanced') {
|
|
37
|
+
pageQueryType = 'CUSTOM'
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
pageQueryType,
|
|
41
|
+
editConditionId: null, // 当前选择的条件id
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
watch: {
|
|
45
|
+
searchType: {
|
|
46
|
+
deep: true,
|
|
47
|
+
|
|
48
|
+
handler(newValue, oldValue) {
|
|
49
|
+
this.searchType = newValue
|
|
50
|
+
this.pageQueryType = 'FIXED'
|
|
51
|
+
if (newValue && newValue === 'advanced') {
|
|
52
|
+
this.pageQueryType = 'CUSTOM'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
methods: {
|
|
58
|
+
removeCondition(conditionId) {
|
|
59
|
+
$emit(this, 'remove-condition', conditionId)
|
|
60
|
+
},
|
|
61
|
+
selectCondition(tab, event) {
|
|
62
|
+
const conditionId = tab.name
|
|
63
|
+
$emit(this, 'select-condition', conditionId)
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
emits: ['remove-condition', 'select-condition'],
|
|
67
|
+
}
|
|
68
|
+
</script>
|