forked from github/dataease
fix: APi数据源校验完成后状态没有刷新 用户管理页面只读权限查看修改列表项显示数据异常
This commit is contained in:
parent
930c57ad2d
commit
ff6b477586
@ -108,6 +108,7 @@ export default {
|
||||
handler() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.table.doLayout()
|
||||
this.$emit('columnsChange')
|
||||
})
|
||||
},
|
||||
deep: true
|
||||
|
@ -138,7 +138,7 @@
|
||||
<svg-icon
|
||||
:icon-class="showTable ? 'reference-table' : 'reference-field'"
|
||||
/>
|
||||
{{ (showTable && fieldData.length) || tableData.length }}
|
||||
{{ (showTable && fieldDataCopy.length) || tableDataCopy.length }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -1114,6 +1114,25 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
reloadStatus(apiConfiguration = []) {
|
||||
let arr = []
|
||||
let arrError = []
|
||||
let arrSuccess = []
|
||||
if (!Array.isArray(apiConfiguration)) {
|
||||
arr = JSON.parse(apiConfiguration)
|
||||
if (!Array.isArray(arr)) return
|
||||
}
|
||||
arrError = arr.filter(ele => ele.status === 'Error').map(ele => ele.name)
|
||||
arrSuccess = arr.filter(ele => ele.status === 'Success').map(ele => ele.name)
|
||||
this.form.apiConfiguration.forEach(ele => {
|
||||
if (arrError.includes(ele.name)) {
|
||||
ele.status = 'Error'
|
||||
}
|
||||
if (arrSuccess.includes(ele.name)) {
|
||||
ele.status = 'Success'
|
||||
}
|
||||
})
|
||||
},
|
||||
validaDatasource() {
|
||||
if (!this.form.configuration.schema && this.form.type === 'oracle') {
|
||||
this.openMessageSuccess('datasource.please_choose_schema', 'error')
|
||||
@ -1167,6 +1186,9 @@ export default {
|
||||
if (res.success) {
|
||||
this.openMessageSuccess('datasource.validate_success')
|
||||
} else {
|
||||
if (data.type === 'api') {
|
||||
this.reloadStatus(res.data?.configuration)
|
||||
}
|
||||
if (res.message.length < 2500) {
|
||||
this.openMessageSuccess(res.message, 'error')
|
||||
} else {
|
||||
|
@ -118,13 +118,16 @@
|
||||
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
|
||||
:table-data="data"
|
||||
:columns="checkedColumnNames"
|
||||
current-row-key="email"
|
||||
:pagination="paginationConfig"
|
||||
@columnsChange="columnsChange"
|
||||
@sort-change="sortChange"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
key="username"
|
||||
label="ID"
|
||||
/>
|
||||
<el-table-column
|
||||
@ -137,6 +140,7 @@
|
||||
<!-- <el-table-column prop="gender" :label="$t('commons.gender')" width="60" /> -->
|
||||
<el-table-column
|
||||
prop="from"
|
||||
key="from"
|
||||
:label="$t('user.source')"
|
||||
width="80"
|
||||
>
|
||||
@ -237,6 +241,7 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
key="__operation"
|
||||
slot="__operation"
|
||||
:label="$t('commons.operating')"
|
||||
fixed="right"
|
||||
@ -554,6 +559,13 @@ export default {
|
||||
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth
|
||||
})
|
||||
},
|
||||
columnsChange() {
|
||||
const arr = this.data
|
||||
this.data = []
|
||||
this.$nextTick(() => {
|
||||
this.data = arr
|
||||
})
|
||||
},
|
||||
search() {
|
||||
const param = {
|
||||
orders: formatOrders(this.orderConditions),
|
||||
|
Loading…
Reference in New Issue
Block a user