Merge branch 'dev' into v1.18

This commit is contained in:
taojinlong 2023-01-30 16:09:57 +08:00
commit b548e1149a
9 changed files with 62 additions and 26 deletions

View File

@ -509,6 +509,9 @@ public class PanelGroupService {
if (dynamicDataMap == null) {
DataEaseException.throwException("Please use the template after v1.9");
}
//custom组件替换.tableId parentFieldId 追加识别标识
templateData = templateData.replaceAll("\"tableId\":\"", "\"tableId\":\"no_auth");
templateData = templateData.replaceAll("\"fieldsParent\":\\{\"id\":\"", "\"fieldsParent\":\\{\"id\":\"no_auth");
List<PanelViewInsertDTO> panelViews = new ArrayList<>();
List<PanelGroupExtendDataDTO> viewsData = new ArrayList<>();

View File

@ -138,6 +138,14 @@ export function fieldList(id, showLoading = true) {
}
export function fieldListWithPermission(id, showLoading = true) {
//初始模板中的过滤组件无需走后台
if (id.indexOf('no_auth') > -1) {
return new Promise(function(resolve) {
resolve({
data: []
})
})
}
return request({
url: '/dataset/field/listWithPermission/' + id,
loading: showLoading,

View File

@ -108,6 +108,7 @@ export default {
handler() {
this.$nextTick(() => {
this.$refs.table.doLayout()
this.$emit('columnsChange')
})
},
deep: true

View File

@ -152,11 +152,17 @@ export default {
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
if (!this.element.options.value) {
this.form.min = null
this.form.max = null
} else {
const values = this.element.options.value
this.form.min = values[0]
if (values.length > 1) {
this.form.max = values[1]
}
}
this.search()
}
},

View File

@ -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>

View File

@ -357,23 +357,7 @@ export default {
},
'activeName': {
handler(newName, oldName) {
if (this.activeName === 'assembly') {
this.allParams = JSON.parse(JSON.stringify(this.childViews.datasetParams))
} else {
if (this.datasetParams.length > 0) {
for (var j = 0; j < this.datasetParams.length; j++) {
var hasParam = false
for (var i = 0; i < this.childViews.datasetParams.length; i++) {
if (this.childViews.datasetParams[i].id === this.datasetParams[j].id) {
hasParam = true
}
}
if (!hasParam) {
this.allParams.push(this.datasetParams[j])
}
}
}
}
}
}
},

View File

@ -1302,16 +1302,16 @@ export default {
},
handleCheckAllChange(apiItem, row, ref) {
this.errMsg = []
this.handleCheckChange(apiItem, row)
apiItem.fields = []
this.handleFiledChange(apiItem, row)
this.handleCheckChange(this.apiItem, row)
this.apiItem.fields = []
this.handleFiledChange(this.apiItem, row)
if(ref === 'plxTable'){
this.$nextTick(() => {
this.$refs.plxTable?.reloadData(this.previewData(this.apiItem))
})
}else {
this.$nextTick(() => {
this.$refs.originPlxTable?.reloadData(this.previewData(this.originFieldItem))
this.$refs.originPlxTable?.reloadData(this.previewData(this.apiItem))
})
}

View File

@ -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 {

View File

@ -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),