Skip to content

Commit

Permalink
build v3.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
smallweis committed Jun 12, 2024
1 parent 6b422a0 commit 9cc63b1
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 42 deletions.
12 changes: 6 additions & 6 deletions lib/avue.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/avue.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smallwei/avue",
"version": "3.4.5",
"version": "3.4.6",
"description": "A Magic Configurable Web Framework",
"main": "lib/avue.min.js",
"unpkg": "lib/avue.min.js",
Expand Down
72 changes: 46 additions & 26 deletions packages/element-ui/crud/column/column-default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,30 @@ export default create({
data () {
return {
config: config,
rowSortable: null,
columnSortable: null,
}
},
components: {
tableItemCard
},
mixins: [locale],
inject: ["crud"],
watch: {
'crud.isSortable' (val) {
this.rowDrop(val)
this.columnDrop(val)
},
'crud.isRowSort' (val) {
this.rowDrop(val)
},
'crud.isColumnSort' (val) {
this.columnDrop(val)
}
},
mounted () {
this.setSort()
this.rowDrop()
this.columnDrop()
},
methods: {
indexMethod (index) {
Expand All @@ -73,33 +88,38 @@ export default create({
(this.crud.page.pageSize || 10)
);
},
setSort () {
this.rowDrop()
this.columnDrop()
},
rowDrop () {
if (!this.crud.$refs.table.$el) return
const el = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0]
this.crud.tableDrop('row', el, evt => {
const oldIndex = evt.oldIndex;
const newIndex = evt.newIndex;
const targetRow = this.crud.list.splice(oldIndex, 1)[0]
this.crud.list.splice(newIndex, 0, targetRow)
this.crud.$emit('sortable-change', oldIndex, newIndex)
this.crud.refreshTable(() => this.rowDrop())
rowDrop (flag) {
this.$nextTick(() => {
if (flag == false) {
this.rowSortable && this.rowSortable.destroy();
return
}
if (!this.crud.$refs.table.$el) return
const el = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0]
this.rowSortable = this.crud.tableDrop('row', el, evt => {
const oldIndex = evt.oldIndex;
const newIndex = evt.newIndex;
const targetRow = this.crud.list.splice(oldIndex, 1)[0]
this.crud.list.splice(newIndex, 0, targetRow)
this.crud.$emit('sortable-change', oldIndex, newIndex)
})
})
},
columnDrop () {
if (!this.crud.$refs.table.$el) return
const el = this.crud.$refs.table.$el.querySelector(this.config.dropColClass);
let noIndexCount = 0;
['selection', 'index', 'expand'].forEach(ele => {
if (this.crud.tableOption[ele]) { noIndexCount += 1 }
})
this.crud.tableDrop('column', el, evt => {
this.crud.headerSort(evt.oldIndex - noIndexCount, evt.newIndex - noIndexCount)
this.columnDrop()
columnDrop (flag) {
this.$nextTick(() => {
if (flag == false) {
this.columnSortable && this.columnSortable.destroy();
return
}
if (!this.crud.$refs.table.$el) return
const el = this.crud.$refs.table.$el.querySelector(this.config.dropColClass);
let noIndexCount = 0;
['selection', 'index', 'expand'].forEach(ele => {
if (this.crud.tableOption[ele]) { noIndexCount += 1 }
})
this.columnSortable = this.crud.tableDrop('column', el, evt => {
this.crud.headerSort(evt.oldIndex - noIndexCount, evt.newIndex - noIndexCount)
})
})
},
}
Expand Down
3 changes: 1 addition & 2 deletions packages/element-ui/crud/dialog/dialog-column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default create({
},
handleChange (prop) {
if (['hide', 'filters'].includes(prop)) {
this.crud.refreshTable()
this.crud.doLayout()
}
},
rowDrop () {
Expand All @@ -92,7 +92,6 @@ export default create({
const oldIndex = evt.oldIndex;
const newIndex = evt.newIndex;
this.crud.headerSort(oldIndex, newIndex)
this.crud.refreshTable(() => this.rowDrop())
})
},
}
Expand Down
6 changes: 3 additions & 3 deletions packages/element-ui/crud/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ export default create({
} else {
this.tableHeight = this.tableOption.height;
}
this.refreshTable()
this.doLayout();
});
},
doLayout () {
Expand Down Expand Up @@ -605,7 +605,7 @@ export default create({
let column = this.columnOption;
let targetRow = column.splice(oldIndex, 1)[0]
column.splice(newIndex, 0, targetRow)
this.refreshTable()
this.doLayout()
},
clearFilter (name) {
this.$refs.table.clearFilter(name);
Expand Down Expand Up @@ -908,7 +908,7 @@ export default create({
packages.logs("Sortable")
return
}
window.Sortable.create(el, {
return window.Sortable.create(el, {
ghostClass: config.ghostClass,
chosenClass: config.ghostClass,
animation: 100,
Expand Down
5 changes: 4 additions & 1 deletion packages/element-ui/select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export default create({
props: {
virtualize: Boolean,
emptyValues: Array,
valueOnClear: [String, Number, Boolean, Function],
valueOnClear: {
type: [String, Number, Boolean, Function],
default: undefined,
},
loadingText: {
type: String,
},
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '3.4.5'
export const version = '3.4.6'

0 comments on commit 9cc63b1

Please sign in to comment.