fix:保存时 必填项的选项卡的切换的问题

This commit is contained in:
zhangyu
2021-08-05 16:11:46 +08:00
parent d829cb432e
commit cea63d4743
7 changed files with 20 additions and 8 deletions

View File

@@ -1356,7 +1356,8 @@ const cn = {
status: 'Endpoint 状态', status: 'Endpoint 状态',
basicTypeFile: '路径', basicTypeFile: '路径',
basicTypeJournal: '单位', basicTypeJournal: '单位',
basicTypeSyslog: '监听地址' basicTypeSyslog: '监听地址',
basicAppName: '应用名称'
}, },
metrics: { metrics: {
metrics: '指标', metrics: '指标',

View File

@@ -1358,7 +1358,8 @@ const en = {
status: 'Endpoint status', status: 'Endpoint status',
basicTypeFile: 'Path', basicTypeFile: 'Path',
basicTypeJournal: 'Unit', basicTypeJournal: 'Unit',
basicTypeSyslog: 'Listen address' basicTypeSyslog: 'Listen address',
basicAppName: 'App name'
}, },
metrics: { metrics: {
metrics: 'Metrics', // "指标" metrics: 'Metrics', // "指标"

View File

@@ -143,6 +143,7 @@
<script> <script>
import editEndpointBoxNew from './editEndpointBoxNew' import editEndpointBoxNew from './editEndpointBoxNew'
import editRigthBox from '@/components/common/mixin/editRigthBox'
export default { export default {
name: 'batchAddEndpointBox', name: 'batchAddEndpointBox',
props: { props: {
@@ -150,6 +151,7 @@ export default {
currentModule: Object, currentModule: Object,
selectEndpointList: Array selectEndpointList: Array
}, },
mixins: [editRigthBox],
components: { components: {
'edit-endpoint-box-new': editEndpointBoxNew 'edit-endpoint-box-new': editEndpointBoxNew
}, },
@@ -440,6 +442,7 @@ export default {
} }
}, },
created () { created () {
this.isEdit = true
this.getModuleList() this.getModuleList()
this.getAssetList() this.getAssetList()
}, },

View File

@@ -232,7 +232,7 @@
</el-form-item> </el-form-item>
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]"> <el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-input id="module-box-input-password" v-model.number="editEndpoint.configs[0].config.basic_auth.pin" placeholder='' size="small"></el-input> <el-input id="module-box-input-password" v-model.number="editEndpoint.configs[0].config.basic_auth.pin" type="password" autocomplete="new-password" placeholder='' size="small"></el-input>
</el-form-item> </el-form-item>
<!--authtype 2--> <!--authtype 2-->

View File

@@ -229,7 +229,7 @@
</el-form-item> </el-form-item>
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]"> <el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-input id="module-box-input-password" v-model.number="editModule.configs[0].config.basic_auth.pin" placeholder='' size="small"></el-input> <el-input id="module-box-input-password" v-model.number="editModule.configs[0].config.basic_auth.pin" type="password" autocomplete="new-password" placeholder='' size="small"></el-input>
</el-form-item> </el-form-item>
<!--authtype 2--> <!--authtype 2-->
@@ -774,7 +774,14 @@ export default {
} }
} else if (key.indexOf('configs.1') !== -1) { } else if (key.indexOf('configs.1') !== -1) {
const keyArr = key.split('.') const keyArr = key.split('.')
this.activeNameLogs[keyArr[3]] = keyArr[4].trim().toLowerCase().replace(keyArr[4][0], keyArr[4][0].toUpperCase()) const str = keyArr[4]
if (str === 'fileName' || str === 'unit' || str === 'listenAddress' || str === 'appName') {
this.activeNameLogs[keyArr[3]] = 'Basic'
} else if (str === 'labels') {
this.activeNameLogs[keyArr[3]] = 'Labels'
} else if (str === 'pipeline') {
this.activeNameLogs[keyArr[3]] = 'Pipeline'
}
this.activeNameLogs = [...this.activeNameLogs] this.activeNameLogs = [...this.activeNameLogs]
} }
} }

View File

@@ -60,14 +60,14 @@
</span> </span>
</template> </template>
<template v-else-if="item.prop === 'configs'"> <template v-else-if="item.prop === 'configs'">
<el-tooltip placement="left" effect="light" :popper-class="'endpointConfigsTips'"> <el-tooltip placement="left" effect="light" :popper-class="'endpointConfigsTips'" v-if="scope.row.configs[0].enable">
<span class="configs-endpoint metrics">{ Metrics }</span> <span class="configs-endpoint metrics">{ Metrics }</span>
<div class="endpointConfigsTips" slot="content"> <div class="endpointConfigsTips" slot="content">
<span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue(scope.row.configs[0].config)"></i></span> <span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue(scope.row.configs[0].config)"></i></span>
<pre >{{JSON.stringify(scope.row.configs[0].config,null,2)}}</pre> <pre >{{JSON.stringify(scope.row.configs[0].config,null,2)}}</pre>
</div> </div>
</el-tooltip> </el-tooltip>
<el-tooltip placement="right" effect="light" :popper-class="'endpointConfigsTips'"> <el-tooltip placement="right" effect="light" :popper-class="'endpointConfigsTips'" v-if="scope.row.configs[1].enable">
<span class="configs-endpoint logs">{ Logs }</span> <span class="configs-endpoint logs">{ Logs }</span>
<div class="endpointConfigsTips" slot="content"> <div class="endpointConfigsTips" slot="content">
<span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue(scope.row.configs[1].config)"></i></span> <span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue(scope.row.configs[1].config)"></i></span>

View File

@@ -228,7 +228,7 @@ export default {
silenceBoxShow: false, silenceBoxShow: false,
tableId: 'endpointTable', tableId: 'endpointTable',
queryPermission: 'account_view', queryPermission: 'account_view',
endpointTableHeight: 'calc(100% - 193px)', // 主列表table高度 endpointTableHeight: 'calc(100% - 224px)', // 主列表table高度
dataListLayout: ['searchInput', 'elementSet', 'clickSearch'], dataListLayout: ['searchInput', 'elementSet', 'clickSearch'],
searchMsg: { // 给搜索框子组件传递的信息 searchMsg: { // 给搜索框子组件传递的信息
zheze_none: true, zheze_none: true,