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 >
87+ <el-form-item :label =" $t('views.deploy.openLog')" prop =" enable_log" >
88+ <el-select v-model =" submitForm.enable_log" clearable :placeholder =" $t('views.deploy.openLogPlaceholder')" >
89+ <el-option label =" yes" :value =" true" />
90+ <el-option label =" no" :value =" false" />
91+ </el-select >
92+ </el-form-item >
93+ <el-form-item :label =" $t('views.deploy.logLevel')" prop =" log_level" >
94+ <el-select v-model =" submitForm.log_level" clearable :placeholder =" $t('views.deploy.logLevelPlaceholder')" >
95+ <el-option label =" TRACE" value =" TRACE" />
96+ <el-option label =" INFO" value =" INFO" />
97+ <el-option label =" DEBUG" value =" DEBUG" />
98+ <el-option label =" WARN" value =" WARN" />
99+ <el-option label =" ERROR" value =" ERROR" />
100+ </el-select >
101+ </el-form-item >
69102 <template v-if =" ! advanced " >
70103 <el-form-item >
71104 <span class =" advancedSetting" @click =" advanced = true" >
@@ -242,6 +275,8 @@ import { Form } from 'element-ui'
242275export default class ProjectEdit extends VueBase {
243276 private advanced = false
244277 private departmentList = []
278+ private projectList = []
279+ private radio = ' '
245280 private submitForm: {
246281 name: string
247282 mode: string
@@ -253,7 +288,10 @@ export default class ProjectEdit extends VueBase {
253288 base_url: string
254289 test_req_header_key: string
255290 test_req_header_value: string
256- department_id: any
291+ department_id: any ,
292+ template_id: any ,
293+ log_level: any ,
294+ enable_log: any ,
257295 } = {
258296 name: ' ' ,
259297 mode: this .$t (' views.projectEdit.mode1' ) as string ,
@@ -266,6 +304,9 @@ export default class ProjectEdit extends VueBase {
266304 test_req_header_key: ' ' ,
267305 test_req_header_value: ' ' ,
268306 department_id: ' ' ,
307+ template_id: ' ' ,
308+ log_level: ' ' ,
309+ enable_log: ' ' ,
269310 }
270311 private engineList: Array <{
271312 id: number
@@ -309,6 +350,13 @@ export default class ProjectEdit extends VueBase {
309350 trigger: ' change' ,
310351 },
311352 ],
353+ template_id: [
354+ {
355+ required: true ,
356+ message: this .$t (' views.projectEdit.templatePlaceholder' ),
357+ trigger: ' change' ,
358+ },
359+ ],
312360 }
313361
314362 private scanAddDialogOpen = false
@@ -331,9 +379,21 @@ export default class ProjectEdit extends VueBase {
331379 }
332380 this .$message .error (res .msg )
333381 }
382+ private async getListProjecttemplat() {
383+ const res = await this .services .setting .listProjecttemplat ({
384+ page: 1 ,
385+ page_size: 100 ,
386+ })
387+ if (res .status === 201 ) {
388+ this .projectList = res .data
389+ return
390+ }
391+ this .$message .error (res .msg )
392+ }
334393 async created() {
335394 await this .getEngineList ()
336395 await this .getListDepartment ()
396+ await this .getListProjecttemplat ()
337397 await this .strategyUserList ()
338398 if (this .$route .params .pid ) {
339399 await this .projectDetail ()
@@ -381,7 +441,9 @@ export default class ProjectEdit extends VueBase {
381441 this .submitForm .test_req_header_key = data .test_req_header_key
382442 this .submitForm .test_req_header_value = data .test_req_header_value
383443 this .submitForm .department_id = data .department_id
384-
444+ this .submitForm .template_id = data .template_id
445+ this .submitForm .enable_log = data .enable_log
446+ this .submitForm .log_level = data .log_level
385447 this .agentChange ()
386448 }
387449
@@ -574,7 +636,10 @@ export default class ProjectEdit extends VueBase {
574636 base_url: string
575637 test_req_header_key: string
576638 test_req_header_value: string
577- department_id: any
639+ department_id: any ,
640+ template_id: any ,
641+ enable_log: any ,
642+ log_level: any
578643 } = {
579644 name: this .submitForm .name ,
580645 mode: this .submitForm .mode ,
@@ -591,6 +656,9 @@ export default class ProjectEdit extends VueBase {
591656 test_req_header_key: this .submitForm .test_req_header_key ,
592657 test_req_header_value: this .submitForm .test_req_header_value ,
593658 department_id: this .submitForm .department_id ,
659+ template_id: this .submitForm .template_id ,
660+ enable_log: this .submitForm .enable_log ,
661+ log_level: this .submitForm .log_level
594662 }
595663 if (this .$route .params .pid ) {
596664 params .pid = this .$route .params .pid
0 commit comments