fix: simple模式下,创建SQL数据集的定时同步去掉 在未编辑状态API数据源禁止复制和删除 数据源请求方式统一 数据源编辑后保存输入框变为不可编辑状态 数据集左侧列表栏调整宽度后需要切换模块后才生效 #4016

This commit is contained in:
dataeaseShu 2022-12-26 16:05:09 +08:00
parent 8e37d7e69e
commit f35f33725a
7 changed files with 64 additions and 13 deletions

View File

@ -46,7 +46,8 @@ export default {
},
data() {
return {
asideHidden: false
asideHidden: false,
currentWidth: '',
}
},
computed: {
@ -57,6 +58,17 @@ export default {
//
return this.isTemplate || (!this.$route.fullPath.includes('system') && this.showDragBar)
}
},
mounted() {
this.setCurrentWidth()
},
beforeUpdate() {
this.setCurrentWidth()
},
methods: {
setCurrentWidth() {
this.currentWidth = this.isCollapseWidth || this.type && getLayout(this.type) || this.width
}
}
}
</script>

View File

@ -17,7 +17,10 @@ export default {
count: {
update: function(el, binding) {
const { value, maxlength, buttonDisabled } = binding.value
if (buttonDisabled) return
if (buttonDisabled) {
el.removeChild(el.querySelector('.el-input__count'))
return
}
const lg = value?.length || 0
const count = el.querySelector('.el-input__count')
if (!count) return

View File

@ -37,6 +37,7 @@
<el-option
:label="$t('dataset.sync_data')"
value="1"
v-if="engineMode !== 'simple'"
:disabled="disabledSync"
/>
</el-select>
@ -49,7 +50,6 @@
size="small"
>
<el-option
v-if="engineMode !== 'simple'"
:label="$t('dataset.sync_now')"
value="sync_now"
:disabled="engineMode === 'simple'"

View File

@ -57,6 +57,7 @@
>
<svg-icon
icon-class="de-copy"
:disabled="disabled"
class="de-copy-icon"
@click.stop="copyItem(api)"
/>
@ -66,10 +67,11 @@
:ref="`apiTable${api.name}`"
placement="top"
width="200"
:disabled="disabled"
popper-class="api-table-delete"
trigger="click"
>
<i class="el-icon-warning" />
<i :disabled="disabled" class="el-icon-warning" />
<div class="tips">
{{ $t('datasource.delete_this_item') }}
</div>
@ -1140,6 +1142,9 @@ export default {
}
},
copyItem(item) {
if (this.disabled) {
return
}
var newItem = JSON.parse(JSON.stringify(item))
newItem.serialNumber =
this.form.apiConfiguration[this.form.apiConfiguration.length - 1]

View File

@ -660,8 +660,9 @@ export default {
})
},
methods: {
editDatasource() {
this.disabled = false
editDatasource(type) {
this.canEdit = type
this.disabled = !type
},
baseInfoDisabledCheck(privileges) {
return !(this.formType === 'add' ? true : hasDataPermission('manage', privileges))
@ -1190,7 +1191,7 @@ export default {
}
},
backToList() {
this.$router.push('/datasource/index')
this.$emit('editeTodisable', false)
},
closeDraw() {

View File

@ -21,9 +21,15 @@
<template v-else>
<div class="ds-top">
<deBtn
v-if="privileges"
v-if="privileges && canEdit"
secondary
@click="editDatasource"
@click="editDatasource(false)"
>{{ $t('commons.cancel') }}
</deBtn>
<deBtn
v-if="privileges && !canEdit"
secondary
@click="editDatasource(true)"
>{{ $t('commons.edit') }}
</deBtn>
<el-tooltip
@ -56,6 +62,7 @@
</div>
<div style="height: calc(100% - 36px)">
<ds-form-content
@editeTodisable="editDatasource(false)"
ref="DsFormContent"
:config-from-tabs="configFromTabs"
/>
@ -78,7 +85,8 @@ export default {
},
data() {
return {
activeName: 'detail'
activeName: 'detail',
canEdit: false,
}
},
computed: {
@ -90,8 +98,9 @@ export default {
}
},
methods: {
editDatasource() {
this.$refs.DsFormContent.editDatasource()
editDatasource(type = false) {
this.$refs.DsFormContent.editDatasource(type)
this.canEdit = type
},
validaDatasource() {
this.$refs.DsFormContent.validaDatasource()

View File

@ -543,6 +543,11 @@ export default {
this.tData.push(typeData[0])
}
}
if (!this.key) return
this.$nextTick(() => {
this.$refs.myDsTree.filter(this.key)
})
})
},
buildTree(array = []) {
@ -671,7 +676,7 @@ export default {
_handleEditer(row) {
if (this.showView === 'Datasource') {
const param = { ...row, ...{ showModel: 'show' }}
this.switchMain('DsForm', param, this.tData, this.dsTypes)
this.switchMain('dsTable', param, this.tData, this.dsTypes)
this.currentNodeId && sessionStorage.setItem('datasource-current-node', this.currentNodeId)
return
}
@ -720,6 +725,22 @@ export default {
this.handlerConfirm(params)
},
switchMain(component, componentParam, tData, dsTypes) {
if (component === 'dsTable') {
const { id, type, showModel } = componentParam
this.$emit('switch-main', {
component,
componentParam: {
id,
type,
showModel,
msgNodeId: this.msgNodeId
},
tData,
dsTypes
})
return
}
if (component === 'DsForm') {
const { id, type, showModel } = componentParam
this.$router.push({