|
@@ -22,18 +22,18 @@
|
|
|
<el-col :span="24">
|
|
|
<el-form-item prop="algorithmtype" label="算法类型">
|
|
|
<el-select size="small" v-model="tableForm.algorithmtype" @change="changeSelect('algorithmtype',tableForm.algorithmtype)" placeholder="请选择">
|
|
|
- <el-option v-for="(item,index) in selectType" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
+ <el-option v-for="(item,index) in selectType" :key="index" :label="item.name" :value="item.code"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-if="tableForm.algorithmtype == 1 || tableForm.algorithmtype == 2 || tableForm.algorithmtype == 3 || tableForm.algorithmtype == 6" :span="24">
|
|
|
+ <el-col v-if="formatData(tableForm.algorithmtype) == 'java' || formatData(tableForm.algorithmtype) == 'db' || formatData(tableForm.algorithmtype) == 'kafka'" :span="24">
|
|
|
<el-form-item prop="algorithmsourcelibraryid" label="算法模版">
|
|
|
<el-select size="small" v-model="tableForm.algorithmsourcelibraryid" placeholder="请选择">
|
|
|
<el-option v-for="(item,index) in selectAlgorithm" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-if=" tableForm.algorithmtype == 2 || tableForm.algorithmtype == 3 || tableForm.algorithmtype == 6" :span="24">
|
|
|
+ <el-col v-if="formatData(tableForm.algorithmtype) == 'java' || formatData(tableForm.algorithmtype) == 'db' || formatData(tableForm.algorithmtype) == 'kafka'" :span="24">
|
|
|
<el-form-item prop="datasourceid" label="数据源编号">
|
|
|
<el-select size="small" v-model="tableForm.datasourceid" placeholder="请选择">
|
|
|
<el-option v-for="(item,index) in selectSource" :key="index" :label="item.datasourcedescribe" :value="item.datasourceid"></el-option>
|
|
@@ -162,18 +162,21 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- formatData (returnData) {
|
|
|
- return typeof returnData == 'string' ? JSON.parse(returnData) : returnData
|
|
|
+ formatData (name) {
|
|
|
+ return typeof name == 'string' ? name.toLocaleLowerCase() : name
|
|
|
},
|
|
|
//获取表单下拉数据
|
|
|
changeSelect (name, code) {
|
|
|
switch (name) {
|
|
|
case 'algorithmtype':
|
|
|
- if (code == 1 || code == 2 || code == 3 || code == 6) {
|
|
|
+ const nstr = _.cloneDeep(code).toString().toLocaleLowerCase()
|
|
|
+ const item = this.selectType.filter(item => item.code == code)
|
|
|
+ const id = item[0].id
|
|
|
+ if (nstr == 'java' || nstr == 'db' || nstr == 'kafka') {
|
|
|
this.tableForm.algorithmname = ''
|
|
|
this.tableForm.datasourceid = ''
|
|
|
- this.getSelectData('algorithmname', 20, { superiorid: code })
|
|
|
- this.getSelectData('datasourceid', 12, { datasourcetype: code })
|
|
|
+ this.getSelectData('algorithmname', 20, { superiorid: id })
|
|
|
+ this.getSelectData('datasourceid', 12, { datasourcetype: id })
|
|
|
}
|
|
|
break;
|
|
|
default:
|