|
|
@ -20,7 +20,7 @@ Complex animated column editor for the table edit page |
|
|
|
<th :style="tdWidthStyle('type')">Type</th> |
|
|
|
<th :style="tdWidthStyle('type')">Type</th> |
|
|
|
<th :style="tdWidthStyle('title')">Title</th> |
|
|
|
<th :style="tdWidthStyle('title')">Title</th> |
|
|
|
<th> |
|
|
|
<th> |
|
|
|
<a href="" type="button" v-if="!newTable" |
|
|
|
<a href="" type="button" v-if="!newTable && orderChanged" |
|
|
|
@click.prevent="resetOrder()" |
|
|
|
@click.prevent="resetOrder()" |
|
|
|
class="text-danger no-decoration"> |
|
|
|
class="text-danger no-decoration"> |
|
|
|
Reset Order |
|
|
|
Reset Order |
|
|
@ -205,10 +205,12 @@ export default { |
|
|
|
newTable: { type: Boolean, default: false }, |
|
|
|
newTable: { type: Boolean, default: false }, |
|
|
|
name: { type: String, required: true }, |
|
|
|
name: { type: String, required: true }, |
|
|
|
xColumns: { type: Array, required: true }, |
|
|
|
xColumns: { type: Array, required: true }, |
|
|
|
|
|
|
|
orderChanged: { type: Boolean, default: false }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
newColNum: 0, |
|
|
|
newColNum: 0, |
|
|
|
|
|
|
|
orderChanged: this.orderChanged, |
|
|
|
columns: this.xColumns, |
|
|
|
columns: this.xColumns, |
|
|
|
colTypes: ['string', 'int', 'float', 'bool'], |
|
|
|
colTypes: ['string', 'int', 'float', 'bool'], |
|
|
|
debouncedSortUpdate: _.debounce(() => this.submitColOrder(), 350) |
|
|
|
debouncedSortUpdate: _.debounce(() => this.submitColOrder(), 350) |
|
|
@ -225,6 +227,8 @@ export default { |
|
|
|
this.query ({ |
|
|
|
this.query ({ |
|
|
|
action: 'col.sort', |
|
|
|
action: 'col.sort', |
|
|
|
order: ids, |
|
|
|
order: ids, |
|
|
|
|
|
|
|
}, (resp) => { |
|
|
|
|
|
|
|
this.orderChanged = resp.data; |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -417,7 +421,8 @@ export default { |
|
|
|
this.query({ |
|
|
|
this.query({ |
|
|
|
action: 'reset.col-order' |
|
|
|
action: 'reset.col-order' |
|
|
|
}, (resp) => { |
|
|
|
}, (resp) => { |
|
|
|
this.columns = resp.data; |
|
|
|
this.columns = resp.data |
|
|
|
|
|
|
|
this.orderChanged = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|