doway-coms 3.0.0 → 3.0.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doway-coms",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "doway组件库",
|
|
5
5
|
"author": "dowaysoft",
|
|
6
6
|
"main": "packages/index.js",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"vuedraggable": "^2.24.3",
|
|
27
27
|
"vuex": "3.6.2",
|
|
28
28
|
"vxe-table": "3.12.9",
|
|
29
|
+
"vxe-pc-ui": "3.3.83",
|
|
29
30
|
"xe-clipboard": "1.10.2",
|
|
30
31
|
"xe-utils": "3.5.4"
|
|
31
32
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<a-button v-if="showFold===true"
|
|
4
4
|
class="collapse-btn"
|
|
5
5
|
type="link"
|
|
6
|
-
@click="
|
|
6
|
+
@click="collapseChange()"
|
|
7
7
|
>
|
|
8
8
|
<a-icon :type="hiddenDetail ? 'down' : 'up'" class="collapse-icon" />
|
|
9
9
|
<!-- {{ hiddenDetail ? '展开' : '收起' }} -->
|
|
@@ -611,6 +611,10 @@ export default {
|
|
|
611
611
|
},
|
|
612
612
|
activated() {},
|
|
613
613
|
methods: {
|
|
614
|
+
collapseChange(){
|
|
615
|
+
this.hiddenDetail = !this.hiddenDetail
|
|
616
|
+
this.$emit('collapseChange',this.hiddenDetail)
|
|
617
|
+
},
|
|
614
618
|
getFieldStyle(colInfo){
|
|
615
619
|
// console.debug('0 0 calc('+colInfo.colSpan*250+'px -'+(colInfo.colSpan-1)*this.flexGap +'px)')
|
|
616
620
|
let fieldStyle ={
|
|
@@ -250,6 +250,7 @@
|
|
|
250
250
|
<a-select
|
|
251
251
|
:style="{color:scope.column.params.fontColor?scope.column.params.fontColor:null}"
|
|
252
252
|
:allowClear="scope.column.params.allowClear"
|
|
253
|
+
v-if="getCellEditExp(scope)"
|
|
253
254
|
show-search
|
|
254
255
|
option-filter-prop="children"
|
|
255
256
|
v-model="scope.row[scope.column.property]"
|
|
@@ -264,6 +265,9 @@
|
|
|
264
265
|
>{{ loopSource.caption }}</a-select-option
|
|
265
266
|
>
|
|
266
267
|
</a-select>
|
|
268
|
+
<div v-else>
|
|
269
|
+
{{ gridDefaultValueDisplay(scope.row, scope.column) }}
|
|
270
|
+
</div>
|
|
267
271
|
</div>
|
|
268
272
|
</template>
|
|
269
273
|
<template #multiSelect_edit="scope">
|
|
@@ -271,6 +275,7 @@
|
|
|
271
275
|
<a-select
|
|
272
276
|
:style="{color:scope.column.params.fontColor?scope.column.params.fontColor:null}"
|
|
273
277
|
v-model="scope.row[scope.column.property]"
|
|
278
|
+
v-if="getCellEditExp(scope)"
|
|
274
279
|
@change="cellValueChange(scope)"
|
|
275
280
|
mode="multiple"
|
|
276
281
|
size="small"
|
|
@@ -284,6 +289,9 @@
|
|
|
284
289
|
>{{ loopSource.caption }}</a-select-option
|
|
285
290
|
>
|
|
286
291
|
</a-select>
|
|
292
|
+
<div v-else>
|
|
293
|
+
{{ gridDefaultValueDisplay(scope.row, scope.column) }}
|
|
294
|
+
</div>
|
|
287
295
|
</div>
|
|
288
296
|
</template>
|
|
289
297
|
<template #time_edit="scope" class="interceptor-class">
|
|
@@ -1346,10 +1354,19 @@ export default {
|
|
|
1346
1354
|
if(scope.column.params.editExp){
|
|
1347
1355
|
for(let i=0;i<scope.column.params.editExp.length;i++){
|
|
1348
1356
|
let exp = scope.column.params.editExp[i]
|
|
1349
|
-
if(
|
|
1350
|
-
|
|
1351
|
-
|
|
1357
|
+
if(exp.operator==='NE'){
|
|
1358
|
+
//不等于
|
|
1359
|
+
if(scope.row[exp.field]===exp.value){
|
|
1360
|
+
editExpResult = false
|
|
1361
|
+
break
|
|
1362
|
+
}
|
|
1363
|
+
}else{
|
|
1364
|
+
if(scope.row[exp.field]!==exp.value){
|
|
1365
|
+
editExpResult = false
|
|
1366
|
+
break
|
|
1367
|
+
}
|
|
1352
1368
|
}
|
|
1369
|
+
|
|
1353
1370
|
}
|
|
1354
1371
|
}
|
|
1355
1372
|
return scope.column.params.controlEdit === true && editExpResult
|
|
@@ -2892,6 +2909,9 @@ export default {
|
|
|
2892
2909
|
getVisibleData() {
|
|
2893
2910
|
return this.$refs.baseGrid.getTableData().visibleData
|
|
2894
2911
|
},
|
|
2912
|
+
getVisibleDataLength(){
|
|
2913
|
+
return this.$refs.baseGrid.getTableData().visibleData.length
|
|
2914
|
+
},
|
|
2895
2915
|
/**
|
|
2896
2916
|
* 获取更新的行
|
|
2897
2917
|
*/
|
|
@@ -3095,6 +3115,12 @@ export default {
|
|
|
3095
3115
|
},
|
|
3096
3116
|
async cellClick({ row, column }) {
|
|
3097
3117
|
this.$emit('cellClick', { row, column })
|
|
3118
|
+
|
|
3119
|
+
if(column.field==='operation'){
|
|
3120
|
+
//点击操作栏按钮无需开启编辑,要不然数据多的情况下,连续点击删除按钮会照成卡顿
|
|
3121
|
+
return
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3098
3124
|
//判断是否可以跳转
|
|
3099
3125
|
// if (
|
|
3100
3126
|
// this.gridEdit != true ||
|
|
@@ -478,6 +478,9 @@ export default {
|
|
|
478
478
|
}
|
|
479
479
|
if (this.columns[i].dataSource) {
|
|
480
480
|
this.columns[i]['params'].dataSource = this.columns[i].dataSource
|
|
481
|
+
if(this.columns[i].controlType===controlType.select){
|
|
482
|
+
this.columns[i]['formatter'] = 'formatSelect'
|
|
483
|
+
}
|
|
481
484
|
}
|
|
482
485
|
if (!this.columns[i].width) {
|
|
483
486
|
this.columns[i]['width'] = 100
|
package/packages/index.js
CHANGED
|
@@ -66,7 +66,10 @@ const components = [
|
|
|
66
66
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
67
67
|
|
|
68
68
|
import 'vxe-table/lib/style.css'
|
|
69
|
-
import
|
|
69
|
+
import VXETable from 'vxe-table'
|
|
70
|
+
|
|
71
|
+
import VxeUI from 'vxe-pc-ui'
|
|
72
|
+
import 'vxe-pc-ui/lib/style.css'
|
|
70
73
|
|
|
71
74
|
const popupInterceptor = (params) => {
|
|
72
75
|
// 比如点击了某个组件的弹出层面板之后,此时被激活单元格不应该被自动关闭,通过返回 false 可以阻止默认的行为。
|
|
@@ -96,11 +99,11 @@ const popupInterceptor = (params) => {
|
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
//网格弹出点击拦截器
|
|
99
|
-
|
|
102
|
+
VXETable.interceptor.add('event.clearEdit', (params) => {
|
|
100
103
|
return popupInterceptor(params)
|
|
101
104
|
})
|
|
102
105
|
//网格筛选点击拦截器
|
|
103
|
-
|
|
106
|
+
VXETable.interceptor.add('event.clearFilter', (params) => {
|
|
104
107
|
return popupInterceptor(params)
|
|
105
108
|
})
|
|
106
109
|
|
|
@@ -113,7 +116,8 @@ Vue.use(Contextmenu)
|
|
|
113
116
|
|
|
114
117
|
const install = function (Vue) {
|
|
115
118
|
//注册grid组件
|
|
116
|
-
Vue.use(
|
|
119
|
+
Vue.use(VXETable)
|
|
120
|
+
Vue.use(VxeUI)
|
|
117
121
|
// 遍历注册全局组件
|
|
118
122
|
components.forEach((component) => {
|
|
119
123
|
Vue.component(component.name, component)
|