Skip to content

Commit e2332df

Browse files
committed
feat: rebuild filter
1 parent 8986524 commit e2332df

7 files changed

Lines changed: 12 additions & 64 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"lint-staged": {
9090
"*.{js,vue}": [
9191
"prettier --write",
92+
"vue-cli-service list",
9293
"git add"
9394
]
9495
}

src/component/base/table/lin-table.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
:width="item.width ? item.width : ''"
3535
></el-table-column>
3636
<el-table-column v-if="operate.length > 0" label="操作" fixed="right" width="275">
37-
<template slot-scope="scope">
37+
<template v-solt:scope>
3838
<el-button
3939
v-for="(item, index) in operate"
4040
:type="item.type"
4141
plain
4242
:key="index"
4343
size="mini"
4444
v-permission="{ permission: item.permission ? item.permission : '', type: 'disabled' }"
45-
@click.native.prevent.stop="buttonMethods(item.func, scope.$index, scope.row)"
45+
@click.prevent.stop="buttonMethods(item.func, scope.$index, scope.row)"
4646
>{{ item.name }}</el-button
4747
>
4848
</template>
@@ -214,7 +214,10 @@ export default {
214214
this.oldKey = this.oldKey.filter(item => item !== row.key)
215215
const data = this.oldVal.filter(item => item.key !== row.key)
216216
this.handleSelectionChange(data)
217-
this.toggleSelection(this.currentData.filter(item => item.key === row.key), false)
217+
this.toggleSelection(
218+
this.currentData.filter(item => item.key === row.key),
219+
false,
220+
)
218221
}
219222
// 选中-单选
220223
if (this.currentOldRow && this.currentOldRow.key === row.key) {

src/lin/filter/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/lin/filter/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import Vue from 'vue'
21
import Utils from '../util/util'
32
/*
43
* 全局的过滤函数
54
* */
6-
function checkAddZone(num) {
5+
export function checkAddZone(num) {
76
return num < 10 ? `0${num.toString()}` : num
87
}
98

@@ -100,7 +99,7 @@ const globalFilter = {
10099
},
101100
}
102101

103-
// 全局过滤器
104-
Object.keys(globalFilter).forEach(k => Vue.filter(k, globalFilter[k]))
105-
106-
export default globalFilter
102+
export const filters = Object.keys(globalFilter).reduce((pre, cur) => {
103+
pre[cur] = cur
104+
return pre
105+
}, {})

src/lin/mixin/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/lin/mixin/index.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import VueCompositionApi from '@vue/composition-api'
33
import ElementUI from 'element-ui'
44

55
import '@/config/global'
6-
import '@/lin/mixin'
7-
import '@/lin/filter'
86
import '@/lin/plugin'
97
import '@/lin/directive'
108

0 commit comments

Comments
 (0)