refactor(缺陷管理): 默认模版
This commit is contained in:
parent
939730166d
commit
d9f911f76a
|
@ -164,10 +164,11 @@ public class IssueTemplateService extends TemplateBaseService {
|
||||||
public List<IssueTemplate> getOption(String workspaceId) {
|
public List<IssueTemplate> getOption(String workspaceId) {
|
||||||
IssueTemplateExample example = new IssueTemplateExample();
|
IssueTemplateExample example = new IssueTemplateExample();
|
||||||
example.createCriteria()
|
example.createCriteria()
|
||||||
.andWorkspaceIdEqualTo(workspaceId)
|
.andWorkspaceIdEqualTo(workspaceId);
|
||||||
.andSystemEqualTo(false);
|
example.or().andGlobalEqualTo(true);
|
||||||
|
// .andSystemEqualTo(false);
|
||||||
List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example);
|
List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example);
|
||||||
issueTemplates.add(getDefaultTemplate(workspaceId));
|
// issueTemplates.add(getDefaultTemplate(workspaceId));
|
||||||
return issueTemplates;
|
return issueTemplates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,16 @@ CREATE TABLE IF NOT EXISTS `issue_template` (
|
||||||
INSERT INTO issue_template (id,`name`,platform,description,title,`global`,`system`,workspace_id,content,create_time,update_time)
|
INSERT INTO issue_template (id,`name`,platform,description,title,`global`,`system`,workspace_id,content,create_time,update_time)
|
||||||
VALUES ('5d7c87d2-f405-4ec1-9a3d-71b514cdfda3','default','metersphere','','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000);
|
VALUES ('5d7c87d2-f405-4ec1-9a3d-71b514cdfda3','default','metersphere','','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000);
|
||||||
|
|
||||||
|
insert into issue_template (id,name,platform,description,title,`system`,`global`,workspace_id,content,create_time,update_time)
|
||||||
|
values ('c7f26296-cf62-4149-a4d2-ce2492729e41','JIRA-默认模版','Jira','JIRA默认模版','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000);
|
||||||
|
|
||||||
|
insert into issue_template (id,name,platform,description,title,`system`,`global`,workspace_id,content,create_time,update_time)
|
||||||
|
values ('f2b70824-471e-426e-9219-f82aba6dd560','禅道-默认模版','Zentao','禅道默认模版','',1,1,'global','', unix_timestamp() * 1000,unix_timestamp() * 1000);
|
||||||
|
|
||||||
|
insert into issue_template (id,name,platform,description,title,`system`,`global`,workspace_id,content,create_time,update_time)
|
||||||
|
values ('f2cd9e48-f136-4528-8249-a649c15aa3a4','TAPD-默认模版','Tapd','TAPD默认模版','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000);
|
||||||
|
|
||||||
|
|
||||||
-- 字段模板关联表
|
-- 字段模板关联表
|
||||||
CREATE TABLE IF NOT EXISTS `custom_field_template` (
|
CREATE TABLE IF NOT EXISTS `custom_field_template` (
|
||||||
`id` varchar(50) NOT NULL COMMENT 'Custom field field template related id',
|
`id` varchar(50) NOT NULL COMMENT 'Custom field field template related id',
|
||||||
|
|
|
@ -44,11 +44,12 @@ export default {
|
||||||
this.$get(url + getCurrentWorkspaceId(), (response) => {
|
this.$get(url + getCurrentWorkspaceId(), (response) => {
|
||||||
this.templateOptions = response.data;
|
this.templateOptions = response.data;
|
||||||
if (!this.data[this.prop]) {
|
if (!this.data[this.prop]) {
|
||||||
this.templateOptions.forEach(item => {
|
for(let item of this.templateOptions) {
|
||||||
if (item.system) {
|
if (item.system) {
|
||||||
this.data[this.prop] = item.id;
|
this.$set(this.data, this.prop, item.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue