@lambo-design/schema-paging-table 1.0.0-beta.1 → 1.0.0-beta.10
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/package.json +5 -5
- package/src/index.vue +28 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/schema-paging-table",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@lambo-design/core": "^4.7.1-beta.
|
|
14
|
-
"@lambo-design/
|
|
15
|
-
"@lambo-design/
|
|
16
|
-
"@lambo-design/paging-table": "^1.0.0-beta.
|
|
13
|
+
"@lambo-design/core": "^4.7.1-beta.105",
|
|
14
|
+
"@lambo-design/schema-form": "^1.0.0-beta.27",
|
|
15
|
+
"@lambo-design/shared": "^1.0.0-beta.97",
|
|
16
|
+
"@lambo-design/paging-table": "^1.0.0-beta.71"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {}
|
|
19
19
|
}
|
package/src/index.vue
CHANGED
|
@@ -12,7 +12,17 @@
|
|
|
12
12
|
@on-select-all="onSelectAll"
|
|
13
13
|
@on-select-all-cancel="onSelectAllCancel">
|
|
14
14
|
<div slot="search">
|
|
15
|
-
<LamboSchemaForm
|
|
15
|
+
<LamboSchemaForm
|
|
16
|
+
ref="lamboSchemaForm"
|
|
17
|
+
v-model="queryForm"
|
|
18
|
+
:form-type="'search'"
|
|
19
|
+
:fieldList="formFields"
|
|
20
|
+
:labelWidth="100"
|
|
21
|
+
:default-rows="2"
|
|
22
|
+
:grid-columns="4"
|
|
23
|
+
:customComponents="customComponents"
|
|
24
|
+
:customValidates="customValidates"
|
|
25
|
+
@doSearch="doSearch" @reset="onReset"/>
|
|
16
26
|
<div v-if="rowName" class="tags">
|
|
17
27
|
<Tag v-for="item in selectTags" :key="item.key" :name="item.key" closable @on-close="tagClose">
|
|
18
28
|
{{ item.value }}
|
|
@@ -55,17 +65,17 @@
|
|
|
55
65
|
import ajax from '@lambo-design/shared/utils/ajax'
|
|
56
66
|
import { operateBtn, operateHref } from '@lambo-design/shared/utils/assist'
|
|
57
67
|
import LamboPagingTable from '@lambo-design/paging-table'
|
|
58
|
-
import LamboSchemaForm from '@lambo-design/schema-form'
|
|
59
|
-
|
|
68
|
+
// import LamboSchemaForm from '@lambo-design/schema-form'
|
|
69
|
+
// const LamboSchemaForm = ()=> import('@lambo-design/schema-form')
|
|
60
70
|
export default {
|
|
61
71
|
name:"schema-paging-table",
|
|
62
72
|
components: {
|
|
63
|
-
LamboSchemaForm,
|
|
73
|
+
LamboSchemaForm: () => import('@lambo-design/schema-form'),
|
|
64
74
|
LamboPagingTable,
|
|
65
75
|
},
|
|
66
76
|
data() {
|
|
67
77
|
return {
|
|
68
|
-
queryForm:
|
|
78
|
+
queryForm: {},
|
|
69
79
|
tableSearchParams: {},
|
|
70
80
|
selection: [],
|
|
71
81
|
selectStore: [],
|
|
@@ -118,6 +128,8 @@ export default {
|
|
|
118
128
|
return []
|
|
119
129
|
}
|
|
120
130
|
},
|
|
131
|
+
customComponents: Object,
|
|
132
|
+
customValidates: Object
|
|
121
133
|
},
|
|
122
134
|
computed: {
|
|
123
135
|
tableColumn: function () {
|
|
@@ -134,7 +146,7 @@ export default {
|
|
|
134
146
|
obj.render = (h, param) => {
|
|
135
147
|
return h('div',
|
|
136
148
|
obj.button.map((item,index)=>{
|
|
137
|
-
|
|
149
|
+
let doms = operateHref(self, h, param.row, item.name || param.row[obj.key], (vm, currentRow) => {
|
|
138
150
|
if(item.clickEvent?.type==="route"){
|
|
139
151
|
// self.$Message.info(item.clickEvent.name)
|
|
140
152
|
let query = item.clickEvent?.route?.keys?.reduce((acc,sourceItem)=>{
|
|
@@ -165,6 +177,14 @@ export default {
|
|
|
165
177
|
self.$Message.info(item.clickEvent.name)
|
|
166
178
|
}
|
|
167
179
|
},item.permission)
|
|
180
|
+
|
|
181
|
+
if(item && typeof item.condition == "function"){
|
|
182
|
+
if(item.condition(param)){
|
|
183
|
+
return doms
|
|
184
|
+
}
|
|
185
|
+
}else{
|
|
186
|
+
return doms
|
|
187
|
+
}
|
|
168
188
|
})
|
|
169
189
|
)
|
|
170
190
|
}
|
|
@@ -213,6 +233,7 @@ export default {
|
|
|
213
233
|
this.tableSearchParams = Object.assign({}, this.queryForm)
|
|
214
234
|
},
|
|
215
235
|
onReset() {
|
|
236
|
+
Object.assign(this.queryForm, this.$options.propsData.form)
|
|
216
237
|
this.doSearch()
|
|
217
238
|
},
|
|
218
239
|
fetch: function (request,response) {
|
|
@@ -347,7 +368,7 @@ export default {
|
|
|
347
368
|
.lambo-grid-table {
|
|
348
369
|
/deep/.ivu-form {
|
|
349
370
|
.ivu-form-item {
|
|
350
|
-
display: block
|
|
371
|
+
display: block;
|
|
351
372
|
}
|
|
352
373
|
}
|
|
353
374
|
}
|