6666 </el-select >
6767 </div >
6868 </el-form-item >
69+ <el-form-item
70+ :label =" $t('views.deploy.projectTemplate')"
71+ prop =" template_id"
72+ >
73+ <el-select
74+ v-model =" submitForm.template_id"
75+ class =" addUserInput"
76+ clearable
77+ style =" width : 390px "
78+ >
79+ <el-option
80+ v-for =" (item, index) in projectList"
81+ :key =" index"
82+ :label =" item.template_name"
83+ :value =" item.id"
84+ ></el-option >
85+ </el-select >
86+ </el-form-item >
6987 <template v-if =" ! advanced " >
7088 <el-form-item >
7189 <span class =" advancedSetting" @click =" advanced = true" >
@@ -242,6 +260,7 @@ import { Form } from 'element-ui'
242260export default class ProjectEdit extends VueBase {
243261 private advanced = false
244262 private departmentList = []
263+ private projectList = []
245264 private submitForm: {
246265 name: string
247266 mode: string
@@ -253,7 +272,8 @@ export default class ProjectEdit extends VueBase {
253272 base_url: string
254273 test_req_header_key: string
255274 test_req_header_value: string
256- department_id: any
275+ department_id: any ,
276+ template_id: any
257277 } = {
258278 name: ' ' ,
259279 mode: this .$t (' views.projectEdit.mode1' ) as string ,
@@ -266,6 +286,7 @@ export default class ProjectEdit extends VueBase {
266286 test_req_header_key: ' ' ,
267287 test_req_header_value: ' ' ,
268288 department_id: ' ' ,
289+ template_id: ' '
269290 }
270291 private engineList: Array <{
271292 id: number
@@ -309,6 +330,13 @@ export default class ProjectEdit extends VueBase {
309330 trigger: ' change' ,
310331 },
311332 ],
333+ template_id: [
334+ {
335+ required: true ,
336+ message: this .$t (' views.projectEdit.templatePlaceholder' ),
337+ trigger: ' change' ,
338+ },
339+ ],
312340 }
313341
314342 private scanAddDialogOpen = false
@@ -331,9 +359,21 @@ export default class ProjectEdit extends VueBase {
331359 }
332360 this .$message .error (res .msg )
333361 }
362+ private async getListProjecttemplat() {
363+ const res = await this .services .setting .listProjecttemplat ({
364+ page: 1 ,
365+ page_size: 100 ,
366+ })
367+ if (res .status === 201 ) {
368+ this .projectList = res .data
369+ return
370+ }
371+ this .$message .error (res .msg )
372+ }
334373 async created() {
335374 await this .getEngineList ()
336375 await this .getListDepartment ()
376+ await this .getListProjecttemplat ()
337377 await this .strategyUserList ()
338378 if (this .$route .params .pid ) {
339379 await this .projectDetail ()
@@ -381,7 +421,7 @@ export default class ProjectEdit extends VueBase {
381421 this .submitForm .test_req_header_key = data .test_req_header_key
382422 this .submitForm .test_req_header_value = data .test_req_header_value
383423 this .submitForm .department_id = data .department_id
384-
424+ this . submitForm . template_id = data . template_id
385425 this .agentChange ()
386426 }
387427
@@ -574,7 +614,8 @@ export default class ProjectEdit extends VueBase {
574614 base_url: string
575615 test_req_header_key: string
576616 test_req_header_value: string
577- department_id: any
617+ department_id: any ,
618+ template_id: any
578619 } = {
579620 name: this .submitForm .name ,
580621 mode: this .submitForm .mode ,
@@ -591,6 +632,7 @@ export default class ProjectEdit extends VueBase {
591632 test_req_header_key: this .submitForm .test_req_header_key ,
592633 test_req_header_value: this .submitForm .test_req_header_value ,
593634 department_id: this .submitForm .department_id ,
635+ template_id: this .submitForm .template_id ,
594636 }
595637 if (this .$route .params .pid ) {
596638 params .pid = this .$route .params .pid
0 commit comments