feat:按钮添加loading

main
liu.tao3 2 years ago
parent d7aeb50a65
commit 9d2d794448

@ -198,8 +198,9 @@
</el-button>
<el-button
class="bs-el-button-default"
:loading="scope.row.loading"
:disabled="scope.row.editable === 1 && !appCode"
@click="delDataset(scope.row.id)"
@click="delDataset(scope.row)"
>
删除
</el-button>
@ -445,9 +446,10 @@ export default {
this.curRow = currentRow
},
//
delDataset (id) {
datasetCheck(id).then((res)=>{
console.log(res)
delDataset (row) {
row.loading=true
datasetCheck(row.id).then((res)=>{
row.loading=false
if(res.canDelete){
this.$confirm('确定删除当前数据集吗?', '提示', {
confirmButtonText: '确定',
@ -455,7 +457,7 @@ export default {
type: 'warning',
customClass: 'bs-el-message-box'
}).then(() => {
datasetRemove(id).then(res => {
datasetRemove(row.id).then(res => {
this.init(false)
this.$message.success('删除成功')
})
@ -575,6 +577,9 @@ export default {
datasetType: this.queryForm.datasetType === '' ? [...this.allType] : [this.queryForm.datasetType]
}).then((data) => {
this.tableData = data.list
this.tableData.forEach(r => {
this.$set(r, 'loading', false)
})
if (this.isDialog) {
if (this.multiple && this.multipleSelection.length) {
this.toggleRowSelection()

@ -96,6 +96,7 @@
</el-button>
<el-button
class="bs-el-button-default"
:loading="scope.row.loading"
:disabled="scope.row.editable == 1 && !appCode"
@click="handleDelete(scope.row)"
>
@ -188,6 +189,7 @@ export default {
reasonList:[],
testBtnLoading: [],
loadingText: '',
deling:false,
searchLoading: false,
dataSourceList: [],
searchForm: {
@ -255,6 +257,7 @@ export default {
this.dataSourceList = data.list
this.dataSourceList.forEach(r => {
r.status = 0
this.$set(r, 'loading', false)
if (r.id === this.sourceId) {
this.curRow = r
}
@ -279,7 +282,9 @@ export default {
handleDelete (row) {
// eslint-disable-next-line eqeqeq
if (row.editable == 1 && !this.appCode) return
row.loading=true
dataSourceCheck(row.id).then((res)=>{
row.loading=false
if(res.canDelete){
this.$confirm('确定删除当前数据源吗?', '提示', {
confirmButtonText: '确定',

Loading…
Cancel
Save