mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-17 06:32:51 +00:00
perf: 添加任务模板
This commit is contained in:
parent
74fecdd941
commit
153d26ffcd
@ -65,6 +65,14 @@
|
|||||||
:placeholder="$L('请输入任务内容')"
|
:placeholder="$L('请输入任务内容')"
|
||||||
:autosize="{ minRows: 4, maxRows: 12 }"/>
|
:autosize="{ minRows: 4, maxRows: 12 }"/>
|
||||||
</FormItem>
|
</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>
|
</Form>
|
||||||
<div slot="footer" class="adaption">
|
<div slot="footer" class="adaption">
|
||||||
<Button type="default" @click="showEditModal=false">{{$L('取消')}}</Button>
|
<Button type="default" @click="showEditModal=false">{{$L('取消')}}</Button>
|
||||||
@ -97,7 +105,106 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$L('请输入模板名称'), trigger: 'blur' }
|
{ 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: {
|
computed: {
|
||||||
@ -106,6 +213,14 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.loadTemplates()
|
this.loadTemplates()
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
showEditModal(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.$refs.editForm.resetFields()
|
||||||
|
this.systemTemplateShow = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取空模板对象
|
// 获取空模板对象
|
||||||
getEmptyTemplate() {
|
getEmptyTemplate() {
|
||||||
@ -210,6 +325,13 @@ export default {
|
|||||||
} catch ({msg}) {
|
} catch ({msg}) {
|
||||||
$A.messageError(msg || '设置失败')
|
$A.messageError(msg || '设置失败')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 使用系统模板
|
||||||
|
useSystemTemplate(item) {
|
||||||
|
this.editingTemplate.name = item.name
|
||||||
|
this.editingTemplate.title = item.title
|
||||||
|
this.editingTemplate.content = item.content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user