Compare commits

...

3 Commits

4 changed files with 20 additions and 18 deletions

View File

@ -23,7 +23,7 @@
style="width: 100%" :height="qp ? '810px' : '650px'"> style="width: 100%" :height="qp ? '810px' : '650px'">
<el-table-column v-for="(item) in Object.keys(tableColumns)" :key="item" :prop="item" label="融合服务名称" <el-table-column v-for="(item) in Object.keys(tableColumns)" :key="item" :prop="item" label="融合服务名称"
header-align="center" align="center"></el-table-column> header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="94" right="0"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="240" right="0">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="$hasPermission('ability:bsabilityai:update')" type="text" size="small" <el-button v-if="$hasPermission('ability:bsabilityai:update')" type="text" size="small"
@click="handleUpdate(scope.row)">{{ $t("update") }}</el-button> @click="handleUpdate(scope.row)">{{ $t("update") }}</el-button>

View File

@ -14,7 +14,7 @@
v-if="dataInfo.length > 1">删除 v-if="dataInfo.length > 1">删除
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-button style="margin-left:120px" size="small" v-if="index == dataInfo.length - 1" @click="addItem" <el-button style="margin-left:70px" size="small" v-if="index == dataInfo.length - 1" @click="addItem"
type="primary">添加 type="primary">添加
</el-button> </el-button>
</div> </div>

View File

@ -9,24 +9,24 @@
<div v-if="!loading"> <div v-if="!loading">
<div v-for="(item, index) in dataInfo" :key="index"> <div v-for="(item, index) in dataInfo" :key="index">
<el-form-item label="能力类别" prop=""> <el-form-item label="能力类别" prop="">
<el-select v-model="item.type" placeholder="请选择能力类别" <el-select v-model="item.type" placeholder="请选择能力类别" @change="(data) => filterSelect(data, item)"
@change="(data) => filterSelect(data, item)" :disabled="disabledType"> :disabled="disabledType">
<el-option v-for="val in typeOptions" :key="val.value" :label="val.value" :value="val.value"> <el-option v-for="val in typeOptions" :key="val.value" :label="val.value" :value="val.value">
</el-option> </el-option>
</el-select> </el-select>
<el-select style="margin-left: 20px" v-model="item.resourceId" placeholder="请选择能力" <el-select class="ability-input" style="margin-left: 20px;max-width:530px" v-model="item.resourceId"
:disabled="disabledType"> placeholder="请选择能力" filterable :disabled="disabledType">
<el-option v-for="val in item.abilityOptions" :key="val.id" :label="val.name" :value="val.id"> <el-option style="max-width:530px" v-for="val in item.abilityOptions" :key="val.id"
:label="val.name || '--'" :value="val.id">
</el-option> </el-option>
</el-select> </el-select>
<el-button style="margin-left:10px" @click="deleteItem(dataInfo, index)" type="danger" size="small" <el-button style="margin-left:10px" @click="deleteItem(dataInfo, index)" type="danger" size="small"
v-if="!disabledType && dataInfo.length > 1">删除 v-if="!disabledType && dataInfo.length > 1">删除
</el-button> </el-button>
<el-button style="margin-left:10px" size="small"
v-if="!disabledType && index == dataInfo.length - 1" @click="addItem(dataInfo, 0)"
type="primary">添加
</el-button>
</el-form-item> </el-form-item>
<el-button style="margin-left:70px" size="small" v-if="!disabledType && index == dataInfo.length - 1"
@click="addItem(dataInfo, 0)" type="primary">添加
</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -51,9 +51,6 @@ export default {
data() { data() {
return { return {
typeOptions: [ typeOptions: [
{
value: '',
},
{ {
value: '数据资源', value: '数据资源',
}, },
@ -71,7 +68,6 @@ export default {
}, },
], ],
dataInfo: [], dataInfo: [],
abilityArray: [],
abilityArrayCopy: [], abilityArrayCopy: [],
loading: false, loading: false,
} }
@ -139,13 +135,13 @@ export default {
// //
getAbility() { getAbility() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.abilityArrayCopy = []
this.loading = true; this.loading = true;
this.$http.get(`/resource/list`, {}).then(({ data: res }) => { this.$http.get(`/resource/list`, {}).then(({ data: res }) => {
this.loading = false; this.loading = false;
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.abilityArray = res.data || []
this.abilityArrayCopy = res.data || [] this.abilityArrayCopy = res.data || []
resolve(res) resolve(res)
}).catch((err) => { }).catch((err) => {
@ -160,6 +156,8 @@ export default {
let selectArray = this.dataInfo.map(v => v.resourceId) || []; let selectArray = this.dataInfo.map(v => v.resourceId) || [];
// //
item.abilityOptions = arr.filter(v => !selectArray.includes(v.id)) item.abilityOptions = arr.filter(v => !selectArray.includes(v.id))
console.log('abilityOptions------------>', item.abilityOptions);
}, },
} }
} }
@ -180,4 +178,8 @@ export default {
width: 100%; width: 100%;
height: 100px; height: 100px;
} }
.ability-input {
width: calc(100% - 300px);
}
</style> </style>

View File

@ -16,7 +16,7 @@
v-if="!disabledType && dataInfo.length > 1">删除 v-if="!disabledType && dataInfo.length > 1">删除
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-button style="margin-left:120px" size="small" v-if="!disabledType && index == dataInfo.length - 1" <el-button style="margin-left:70px" size="small" v-if="!disabledType && index == dataInfo.length - 1"
@click="addItem" type="primary">添加 @click="addItem" type="primary">添加
</el-button> </el-button>
</div> </div>