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() { data() {
return { return {
asideHidden: false asideHidden: false,
currentWidth: '',
} }
}, },
computed: { computed: {
@ -57,6 +58,17 @@ export default {
// //
return this.isTemplate || (!this.$route.fullPath.includes('system') && this.showDragBar) 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> </script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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