fix: 1.首次添加API数据源输入名称-点击添加时页面未正常跳转 2. api数据集,新建数据表的时候,提示会重叠 3.更换数据源图标

This commit is contained in:
dataeaseShu 2022-09-30 15:52:10 +08:00
parent c5d76247f0
commit 00b097dde4
6 changed files with 46 additions and 15 deletions

View File

@ -27,8 +27,9 @@ export default {
update: function (el, binding) {
const lg = binding.value?.length || 0;
const count = el.querySelector(".el-input__count");
if (!count) return
if (!lg) {
if (count.classList.contains("no-zore")) {
if (count?.classList?.contains("no-zore")) {
count.classList.remove("no-zore");
}
count.innerHTML = "0/200";
@ -44,6 +45,7 @@ export default {
num.style.color = "#1F2329";
total.innerHTML = "/200";
num.innerHTML = lg;
if (!newCount) return
newCount.classList.add("el-input__count", "no-zore");
newCount.appendChild(num);
newCount.appendChild(total);

View File

@ -0,0 +1,13 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 1.5C7.07786 1.5 5.30656 1.7586 3.98986 2.1975C3.33543 2.41564 2.75172 2.69192 2.31622 3.03514C1.88917 3.37169 1.5 3.86104 1.5 4.5V13.5C1.5 14.139 1.88917 14.6283 2.31622 14.9649C2.75172 15.3081 3.33543 15.5844 3.98986 15.8025C5.30656 16.2414 7.07786 16.5 9 16.5C10.9221 16.5 12.6934 16.2414 14.0101 15.8025C14.6646 15.5844 15.2483 15.3081 15.6838 14.9649C16.1108 14.6283 16.5 14.139 16.5 13.5V4.5C16.5 3.86104 16.1108 3.37169 15.6838 3.03514C15.2483 2.69192 14.6646 2.41564 14.0101 2.1975C12.6934 1.7586 10.9221 1.5 9 1.5ZM15 6.39495C14.6991 6.54883 14.365 6.68421 14.0101 6.8025C12.6934 7.2414 10.9221 7.5 9 7.5C7.07786 7.5 5.30656 7.2414 3.98986 6.8025C3.63499 6.68421 3.30092 6.54883 3 6.39495V9C3 9.00091 3.00012 9.00435 3.00229 9.01147C3.00484 9.01983 3.01112 9.03634 3.02631 9.06107C3.05814 9.11293 3.12306 9.1909 3.24468 9.28674C3.49231 9.4819 3.89712 9.69045 4.4642 9.87948C5.59052 10.2549 7.19422 10.5 9 10.5C10.8058 10.5 12.4095 10.2549 13.5358 9.87948C14.1029 9.69045 14.5077 9.4819 14.7553 9.28674C14.8769 9.1909 14.9419 9.11293 14.9737 9.06107C14.9889 9.03634 14.9952 9.01983 14.9977 9.01147C14.9999 9.00429 15 9.00105 15 9.00017C15 9.0002 15 9.00012 15 9.00017V6.39495ZM15 10.8949C14.6991 11.0488 14.365 11.1842 14.0101 11.3025C12.6934 11.7414 10.9221 12 9 12C7.07786 12 5.30656 11.7414 3.98986 11.3025C3.63499 11.1842 3.30092 11.0488 3 10.8949V13.5C3 13.5007 2.99999 13.5039 3.00229 13.5115C3.00484 13.5198 3.01112 13.5363 3.02631 13.5611C3.05814 13.6129 3.12306 13.6909 3.24468 13.7867C3.49231 13.9819 3.89712 14.1905 4.4642 14.3795C5.59052 14.7549 7.19422 15 9 15C10.8058 15 12.4095 14.7549 13.5358 14.3795C14.1029 14.1905 14.5077 13.9819 14.7553 13.7867C14.8769 13.6909 14.9419 13.6129 14.9737 13.5611C14.9889 13.5363 14.9952 13.5198 14.9977 13.5115C15 13.5039 15 13.5007 15 13.5V10.8949Z" fill="#1F2329"/>
<g clip-path="url(#clip0_4341_151945)">
<path d="M14 19.5C17.0376 19.5 19.5 17.0376 19.5 14C19.5 10.9624 17.0376 8.5 14 8.5C10.9624 8.5 8.5 10.9624 8.5 14C8.5 17.0376 10.9624 19.5 14 19.5Z" fill="#FF8800"/>
<path d="M13.75 11.5C13.6119 11.5 13.5 11.6119 13.5 11.75V14.75C13.5 14.8881 13.6119 15 13.75 15H14.25C14.3881 15 14.5 14.8881 14.5 14.75V11.75C14.5 11.6119 14.3881 11.5 14.25 11.5H13.75Z" fill="white"/>
<path d="M13.75 15.5C13.6119 15.5 13.5 15.6119 13.5 15.75V16.25C13.5 16.3881 13.6119 16.5 13.75 16.5H14.25C14.3881 16.5 14.5 16.3881 14.5 16.25V15.75C14.5 15.6119 14.3881 15.5 14.25 15.5H13.75Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_4341_151945">
<rect width="12" height="12" fill="white" transform="translate(8 8)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -1581,3 +1581,9 @@ div:focus {
cursor: pointer;
}
}
.de-icon-sence {
margin-right: 9px;
width: 16px !important;
height: 12px !important;
}

View File

@ -26,8 +26,8 @@
v-for="ele in templateListComputed"
:key="ele.name"
>
<svg-icon icon-class="scene"/>
<span>{{ ele.name }}</span>
<svg-icon icon-class="scene" class="de-icon-sence"/>
<span class="text-template-overflow" :title="ele.name">{{ ele.name }}</span>
<span @click.stop class="more">
<el-dropdown
trigger="click"
@ -176,6 +176,14 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
.text-template-overflow{
display: inline-block;
max-width: 87%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.folder {
color: #8f959e;
margin-right: 9px;

View File

@ -12,11 +12,8 @@
<template v-if="form.type == 'api'">
<div class="de-row-rules flex-space">
<span>{{ $t('datasource.data_table') }}</span>
<deBtn
icon="el-icon-plus"
type="primary"
@click="addApiItem(undefined)"
>{{ $t('commons.add') }}</deBtn>
<el-button style="min-width: 80px;
font-size: 14px;padding: 8px 15px;" icon="el-icon-plus" size="small" @click="() => addApiItem()" type="primary">{{ $t('commons.add') }}</el-button>
</div>
<el-empty
v-if="!form.apiConfiguration.length"
@ -929,6 +926,7 @@ export default {
},
{ label: this.$t('dataset.location'), value: 5 }
],
errMsg: [],
height: 500,
disabledNext: false,
authMethodList: [
@ -1128,10 +1126,18 @@ export default {
this.$refs[`apiTable${name}`][0].doClose()
},
handleCheckAllChange(row) {
this.errMsg = []
this.handleCheckChange(row)
this.apiItem.fields = []
this.handleFiledChange(row)
this.previewData()
if (this.errMsg.length) {
this.$message.error(
[...new Set(this.errMsg)].join(',') +
', ' +
i18n.t('datasource.has_repeat_field_name')
)
}
},
handleFiledChange() {
for (var i = 0; i < this.apiItem.jsonFields.length; i++) {
@ -1151,15 +1157,11 @@ export default {
if (jsonFields[i].checked && jsonFields[i].children === undefined) {
for (var j = 0; j < this.apiItem.fields.length; j++) {
if (this.apiItem.fields[j].name === jsonFields[i].name) {
jsonFields[i].checked = false
this.$nextTick(() => {
jsonFields[i].checked = false
})
this.$message.error(
jsonFields[i].name +
', ' +
i18n.t('datasource.has_repeat_field_name')
)
return
this.errMsg.push(jsonFields[i].name)
}
}
this.apiItem.fields.push(jsonFields[i])

View File

@ -77,7 +77,7 @@
</span>
<span v-if="data.status === 'Warning'">
<svg-icon
icon-class="exclamationmark2"
icon-class="de-ds-warning"
class="ds-icon-scene"
/>
</span>