perf: 添加任务模板

This commit is contained in:
kuaifan 2024-12-01 23:50:01 +08:00
parent 74fecdd941
commit 153d26ffcd
2 changed files with 151 additions and 1 deletions

View File

@ -65,6 +65,14 @@
:placeholder="$L('请输入任务内容')"
:autosize="{ minRows: 4, maxRows: 12 }"/>
</FormItem>
<FormItem v-if="!editingTemplate.id">
<div class="project-task-template-system">
<div v-if="!systemTemplateShow" @click="systemTemplateShow=true" class="tip-title">{{$L('使用示例模板')}}</div>
<ul v-else>
<li v-for="(item, index) in systemTemplates" :key="index" @click="useSystemTemplate(item)">{{item.name}}</li>
</ul>
</div>
</FormItem>
</Form>
<div slot="footer" class="adaption">
<Button type="default" @click="showEditModal=false">{{$L('取消')}}</Button>
@ -97,7 +105,106 @@ export default {
name: [
{ required: true, message: this.$L('请输入模板名称'), trigger: 'blur' }
]
}
},
systemTemplateShow: false,
systemTemplates: [
{
"name": "通用任务",
"title": "xxxx 任务",
"content": "描述xxxx\n清单xxxx"
},
{
"name": "产品需求",
"title": "xxxx 功能需求/产品任务",
"content": "背景xxxx\n目标xxxx\n清单xxxx"
},
{
"name": "技术任务",
"title": "xxxx 开发任务/技术优化任务",
"content": "背景xxxx\n技术目标xxxx\n任务清单xxxx"
},
{
"name": "运营任务",
"title": "xxxx 活动策划/运营任务",
"content": "背景xxxx\n活动方案xxxx\n数据指标xxxx\n任务清单xxxx"
},
{
"name": "市场推广",
"title": "xxxx 推广任务/品牌活动",
"content": "背景xxxx\n推广方案xxxx\n数据指标xxxx\n任务清单xxxx"
},
{
"name": "设计任务",
"title": "xxxx 设计任务",
"content": "背景xxxx\n设计要求xxxx\n任务清单xxxx\n相关资源xxxx"
},
{
"name": "人力资源",
"title": "xxxx 招聘任务/培训任务",
"content": "目标xxxx\n内容xxxx\n任务清单xxxx"
},
{
"name": "财务任务",
"title": "xxxx 预算审批/报销任务",
"content": "背景xxxx\n审批流程xxxx\n报销清单xxxx"
},
{
"name": "销售任务",
"title": "xxxx 销售跟进任务",
"content": "客户信息xxxx\n销售目标xxxx\n任务清单xxxx"
},
{
"name": "客户支持",
"title": "xxxx 客户问题处理任务",
"content": "客户问题xxxx\n优先级xxxx\n解决方案xxxx\n任务清单xxxx"
},
{
"name": "内容创作",
"title": "xxxx 内容创作任务",
"content": "主题xxxx\n目标xxxx\n任务清单xxxx"
},
{
"name": "法律事务",
"title": "xxxx 合同审核/法律任务",
"content": "合同背景xxxx\n审核重点xxxx\n任务清单xxxx"
},
{
"name": "学习计划",
"title": "xxxx 学习计划任务",
"content": "学习目标xxxx\n学习资源xxxx\n任务清单xxxx"
},
{
"name": "项目管理",
"title": "xxxx 项目管理任务",
"content": "项目背景xxxx\n任务清单xxxx\n状态xxxx"
},
{
"name": "测试任务",
"title": "xxxx 测试任务",
"content": "测试目标xxxx\n测试范围xxxx\n测试用例xxxx\n问题记录xxxx"
},
{
"name": "数据分析",
"title": "xxxx 数据分析任务",
"content": "分析目标xxxx\n数据来源xxxx\n分析方法xxxx\n结论与建议xxxx"
},
{
"name": "供应链管理",
"title": "xxxx 供应链任务",
"content": "任务目标xxxx\n供应商信息xxxx\n任务清单xxxx"
},
{
"name": "安全检查",
"title": "xxxx 安全检查任务",
"content": "检查范围xxxx\n检查标准xxxx\n问题记录xxxx\n整改计划xxxx"
},
{
"name": "行政事务",
"title": "xxxx 行政任务",
"content": "任务描述xxxx\n负责人xxxx\n任务清单xxxx"
}
]
}
},
computed: {
@ -106,6 +213,14 @@ export default {
created() {
this.loadTemplates()
},
watch: {
showEditModal(val) {
if (!val) {
this.$refs.editForm.resetFields()
this.systemTemplateShow = false
}
}
},
methods: {
//
getEmptyTemplate() {
@ -210,6 +325,13 @@ export default {
} catch ({msg}) {
$A.messageError(msg || '设置失败')
}
},
// 使
useSystemTemplate(item) {
this.editingTemplate.name = item.name
this.editingTemplate.title = item.title
this.editingTemplate.content = item.content
}
}
}

View File

@ -99,3 +99,31 @@
}
}
}
.project-task-template-system {
.tip-title {
margin: -12px 0;
cursor: pointer;
color: $primary-color;
}
ul {
display: flex;
flex-wrap: wrap;
gap: 8px;
> li {
list-style: none;
padding: 0px 12px;
background-color: #f5f5f5;
border-radius: 18px;
transition: all 0.3s ease;
cursor: pointer;
line-height: 34px;
height: 34px;
&:hover {
background-color: #e0e0e0;
}
}
}
}