|
@@ -81,25 +81,27 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row v-if="this.type === 1">
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" v-if="type === 1">
|
|
<el-divider>配置模板</el-divider>
|
|
<el-divider>配置模板</el-divider>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row v-for="(category, index) in Object.keys(mapData)" :key="category" v-if="this.type === 1">
|
|
|
|
- <el-col :span="24">
|
|
|
|
- <el-form-item :label="category">
|
|
|
|
- <el-select v-model="form.templateIds[index]">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in mapData[category]"
|
|
|
|
- :key="item.repoId"
|
|
|
|
- :label="item.repoName"
|
|
|
|
- :value="item.repoId"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
|
|
+ <template v-if="type === 1">
|
|
|
|
+ <el-row v-for="(category, index) in Object.keys(mapData)" :key="category">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item :label="category">
|
|
|
|
+ <el-select v-model="form.templateIds[index]">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in mapData[category]"
|
|
|
|
+ :key="item.repoId"
|
|
|
|
+ :label="item.repoName"
|
|
|
|
+ :value="item.repoId"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </template>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submit">确 定</el-button>
|
|
<el-button type="primary" @click="submit">确 定</el-button>
|
|
@@ -135,7 +137,7 @@ export default {
|
|
title: '',
|
|
title: '',
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
- // 判断按钮
|
|
|
|
|
|
+ // 判断按钮(0:新增,1:配置)
|
|
type: 0,
|
|
type: 0,
|
|
// 重新渲染表格状态
|
|
// 重新渲染表格状态
|
|
refreshTable: true,
|
|
refreshTable: true,
|
|
@@ -237,17 +239,18 @@ export default {
|
|
/** 企业配置 */
|
|
/** 企业配置 */
|
|
handleConfig(row) {
|
|
handleConfig(row) {
|
|
this.reset()
|
|
this.reset()
|
|
|
|
+ this.type = 1
|
|
getTemplate().then(response => {
|
|
getTemplate().then(response => {
|
|
this.mapData = response.data
|
|
this.mapData = response.data
|
|
})
|
|
})
|
|
getInfo(row.id).then(response => {
|
|
getInfo(row.id).then(response => {
|
|
this.form = response.data
|
|
this.form = response.data
|
|
- const categoriesLength = Object.keys(this.mapData).length;
|
|
|
|
|
|
+ const categoriesLength = Object.keys(this.mapData).length
|
|
if (this.form.templateIds === null || this.form.templateIds.length === 0) {
|
|
if (this.form.templateIds === null || this.form.templateIds.length === 0) {
|
|
- this.form.templateIds = Array(categoriesLength).fill(0);
|
|
|
|
|
|
+ this.form.templateIds = Array(categoriesLength).fill(0)
|
|
} else if (this.form.templateIds.length < categoriesLength) {
|
|
} else if (this.form.templateIds.length < categoriesLength) {
|
|
- const diff = categoriesLength - this.form.templateIds.length;
|
|
|
|
- this.form.templateIds = this.form.templateIds.concat(Array(diff).fill(0));
|
|
|
|
|
|
+ const diff = categoriesLength - this.form.templateIds.length
|
|
|
|
+ this.form.templateIds = this.form.templateIds.concat(Array(diff).fill(0))
|
|
}
|
|
}
|
|
this.form.templateIds.forEach((item, index) => {
|
|
this.form.templateIds.forEach((item, index) => {
|
|
if (item === 0) {
|
|
if (item === 0) {
|
|
@@ -257,8 +260,7 @@ export default {
|
|
})
|
|
})
|
|
this.open = true
|
|
this.open = true
|
|
this.title = '企业配置'
|
|
this.title = '企业配置'
|
|
- this.type = 1
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|