NEZ-3363 fix:缩略显示内容补充 title 属性

This commit is contained in:
zyh
2023-12-13 10:21:21 +08:00
parent 97cae78bed
commit 0c596dd67c
11 changed files with 164 additions and 69 deletions

View File

@@ -373,25 +373,37 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
],

View File

@@ -62,22 +62,6 @@
<el-form-item :label='$t("config.assetType.sshCollectScript")' prop="sshCollectScript">
<el-input v-model="editAssetType.sshCollectScript" size="small" type="text"></el-input>
</el-form-item>
<!-- ChartTemplate -->
<!-- <el-form-item :label="$t('config.type.ChartTemplate')" prop="ChartTemplate">
<v-selectpage
:data="chartlList"
:tb-columns="ChartSearchShowFields"
:max-select-limit="3"
:multiple="true"
title="ChartSearch"
placeholder="Please select item"
key-field="id"
v-model="editAssetType.chartIds"
show-field="name"
class="form-control"
@values="(data) => {editAssetType.chartIds = data.map(d => d.id).join(',')}"
></v-selectpage>
</el-form-item> -->
</el-form>
</div>
</div>

View File

@@ -25,27 +25,6 @@
<el-option v-for="(item, index) in typeDataList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- ChartTemplate -->
<!-- <el-form-item :label="$t('overall.chartTemp')" prop="ChartTemplate">
<v-selectpage
:data="chartlList"
:tb-columns="ChartSearchShowFields"
:params="{
varType: 1, dashboardId: 0,
returnChildren:0,groupId:0,
}"
:multiple="true"
:language="language"
title="ChartSearch"
key-field="id"
:width="640"
v-model="editModel.chartIds"
show-field="name"
class="form-control"
@values="(data) => {editModel.chartIds = data.map(d => d.id).join(',')}"
:result-format="resultFormat"
></v-selectpage>
</el-form-item> -->
<!-- DashboardTemplate -->
<el-form-item :label="$t('model.dashboardtemplate')" prop="dashboardId" ref="dashboardTemplate">
<v-selectpage
@@ -121,16 +100,10 @@ export default {
typeDataList: [],
// chartlList: [], // chart 列表数据
dashboardList: [], // dashboard 列表数据
// ChartSearchShowFields: [ // ChartSearch 下拉搜索表头
// { title: 'ID', data: 'id' },
// { title: this.$t('overall.name'), data: 'name', key: 'name' },
// { title: this.$t('overall.type'), data: 'type', key: 'type' },
// { title: this.$t('overall.remark'), data: 'remark', key: 'remark' }
// ],
DashboardSearchShowFields: [ // DashboardSearch 下拉搜索表头
{ title: 'ID', data: 'id' },
{ title: this.$t('overall.name'), data: 'name', key: 'name' },
{ title: this.$t('overall.remark'), data: 'remark', key: 'remark' }
{ title: this.$t('overall.name'), data: 'name', tip: 'name' },
{ title: this.$t('overall.remark'), data: 'remark', tip: 'remark' }
],
url: 'asset/model',
brandUrl: 'asset/brand',

View File

@@ -192,7 +192,9 @@ export default {
}
return row.name
},
key: 'name'
tip: function (row) {
return row.name
}
},
{
title: this.$t('project.project.projectName'),
@@ -203,8 +205,9 @@ export default {
return row.project.name
}
},
deep: true,
orjinNME: 'project'
tip: function (row) {
return row.project.name
}
},
{
title: this.$t('overall.remark'),
@@ -212,9 +215,11 @@ export default {
if (row.remark && row.remark.length > 15) {
return row.remark.substring(0, 12) + '...'
}
return row.remark = row.remark ? row.remark : ''
return row.remark ? row.remark : ''
},
key: 'remark'
tip: function (row) {
return row.remark ? row.remark : ''
}
}
],
columns: [
@@ -227,32 +232,37 @@ export default {
}
return row.name
},
key: 'name'
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp', key: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
deep: true,
orjinNME: 'type'
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
deep: true,
orjinNME: 'model'
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
deep: true,
orjinNME: 'dc'
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
],
object: {},

View File

@@ -102,6 +102,9 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{
@@ -114,6 +117,15 @@ export default {
case 2 : str = 'Endpoint'; break
}
return str
},
tip: function (row) {
let str
switch (row.varType) {
case 0 : str = 'None'; break
case 1 : str = 'Asset'; break
case 2 : str = 'Endpoint'; break
}
return str
}
},
{
@@ -123,6 +135,9 @@ export default {
return row.remark.substring(0, 12) + '...'
}
return row.remark
},
tip: function (row) {
return row.remark
}
}
],
@@ -136,25 +151,37 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: function (row) {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
],
@@ -168,24 +195,36 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{
title: this.$t('overall.project'),
data: (row) => {
return row.project ? row.project.name : ''
},
tip: function (row) {
return row.project ? row.project.name : ''
}
},
{
title: this.$t('asset.asset'),
data: (row) => {
return row.asset ? row.asset.name : ''
},
tip: (row) => {
return row.asset ? row.asset.name : ''
}
},
{
title: this.$t('overall.module'),
data: (row) => {
return row.module ? row.module.name : ''
},
tip: (row) => {
return row.module ? row.module.name : ''
}
}
],

View File

@@ -820,9 +820,12 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('overall.type'), data: 'type' },
{ title: this.$t('overall.type'), data: 'type', tip: 'type' },
{
title: this.$t('overall.remark'),
data: function (row) {
@@ -830,6 +833,9 @@ export default {
return row.remark.substring(0, 12) + '...'
}
return row.remark
},
tip: function (row) {
return row.remark
}
}
],
@@ -958,25 +964,37 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
],
@@ -989,18 +1007,27 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{
title: this.$t('softwareType.category'),
data: (row) => {
return row.type ? row.type.category : ''
},
tip: (row) => {
return row.type ? row.type.category : ''
}
},
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
@@ -1010,6 +1037,9 @@ export default {
return row.remark.substring(0, 12) + '...'
}
return row.remark
},
tip: function (row) {
return row.remark
}
}
],

View File

@@ -210,25 +210,37 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
],

View File

@@ -755,7 +755,9 @@ export default {
}
return row.name
},
key: 'name'
tip: function (row) {
return row.name
}
},
{
title: this.$t('overall.remark'),
@@ -765,7 +767,9 @@ export default {
}
return row.remark
},
key: 'remark'
tip: function (row) {
return row.remark
}
}
],
showAllBasicOption: false,

View File

@@ -221,25 +221,37 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
]

View File

@@ -33,7 +33,7 @@ export default {
key: idx,
domProps: {
innerHTML: this.renderColumn(val, col),
title: col.deep ? val[col.orjinNME].name : val[col.key]
title: this.renderTip(val, col)
}
})
}))
@@ -47,6 +47,13 @@ export default {
case 'string': return row[col.data]
case 'function': return col.data(row)
}
},
renderTip (row, col) {
if (!row || !Object.keys(row).length || !col || !col.tip) return ''
switch (typeof col.tip) {
case 'string': return row[col.tip]
case 'function': return col.tip(row)
}
}
}
}

View File

@@ -58,25 +58,37 @@ export default {
return row.name.substring(0, 12) + '...'
}
return row.name
},
tip: function (row) {
return row.name
}
},
{ title: this.$t('asset.manageIp'), data: 'manageIp' },
{ title: this.$t('asset.manageIp'), data: 'manageIp', tip: 'manageIp' },
{
title: this.$t('overall.type'),
data: (row) => {
return row.type ? row.type.name : ''
},
tip: (row) => {
return row.type ? row.type.name : ''
}
},
{
title: this.$t('asset.model'),
data: (row) => {
return row.model ? row.model.name : ''
},
tip: (row) => {
return row.model ? row.model.name : ''
}
},
{
title: this.$t('overall.dc'),
data: (row) => {
return row.dc ? row.dc.name : ''
},
tip: (row) => {
return row.dc ? row.dc.name : ''
}
}
]