From aa15a48cf5a11f782aef6dc27f1efd7b2566523e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 15 Dec 2025 16:45:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20base=20=E6=A8=A1=E6=9D=BF=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=94=B9=E4=B8=BAtextfield?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wf/migrations/0006_auto_20251215_1645.py | 23 +++++++++++++++++++ apps/wf/models.py | 8 +++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 apps/wf/migrations/0006_auto_20251215_1645.py diff --git a/apps/wf/migrations/0006_auto_20251215_1645.py b/apps/wf/migrations/0006_auto_20251215_1645.py new file mode 100644 index 0000000..d3baf28 --- /dev/null +++ b/apps/wf/migrations/0006_auto_20251215_1645.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.12 on 2025-12-15 08:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wf', '0005_workflow_cate'), + ] + + operations = [ + migrations.AlterField( + model_name='workflow', + name='content_template', + field=models.TextField(blank=True, default='标题:{title}, 创建时间:{create_time}', help_text='工单字段的值可以作为参数写到模板中,格式如:标题:{title}, 创建时间:{create_time}', null=True, verbose_name='内容模板'), + ), + migrations.AlterField( + model_name='workflow', + name='title_template', + field=models.TextField(blank=True, default='{title}', help_text='工单字段的值可以作为参数写到模板中,格式如:你有一个待办工单:{title}', null=True, verbose_name='标题模板'), + ), + ] diff --git a/apps/wf/models.py b/apps/wf/models.py index b25d720..4b63ed2 100755 --- a/apps/wf/models.py +++ b/apps/wf/models.py @@ -18,10 +18,10 @@ class Workflow(CommonAModel): '限制表达式', default=dict, blank=True, help_text='限制周期({"period":24} 24小时), 限制次数({"count":1}在限制周期内只允许提交1次), 限制级别({"level":1} 针对(1单个用户 2全局)限制周期限制次数,默认特定用户);允许特定人员提交({"allow_persons":"zhangsan,lisi"}只允许张三提交工单,{"allow_depts":"1,2"}只允许部门id为1和2的用户提交工单,{"allow_roles":"1,2"}只允许角色id为1和2的用户提交工单)') display_form_str = models.JSONField('展现表单字段', default=list, blank=True, help_text='默认"[]",用于用户只有对应工单查看权限时显示哪些字段,field_key的list的json,如["days","sn"],内置特殊字段participant_info.participant_name:当前处理人信息(部门名称、角色名称),state.state_name:当前状态的状态名,workflow.workflow_name:工作流名称') - title_template = models.CharField( - '标题模板', max_length=50, default='{title}', null=True, blank=True, help_text='工单字段的值可以作为参数写到模板中,格式如:你有一个待办工单:{title}') - content_template = models.CharField( - '内容模板', max_length=1000, default='标题:{title}, 创建时间:{create_time}', null=True, blank=True, help_text='工单字段的值可以作为参数写到模板中,格式如:标题:{title}, 创建时间:{create_time}') + title_template = models.TextField( + '标题模板', default='{title}', null=True, blank=True, help_text='工单字段的值可以作为参数写到模板中,格式如:你有一个待办工单:{title}') + content_template = models.TextField( + '内容模板', default='标题:{title}, 创建时间:{create_time}', null=True, blank=True, help_text='工单字段的值可以作为参数写到模板中,格式如:标题:{title}, 创建时间:{create_time}') view_path = models.TextField('前端自定义页面路径', null=True, blank=True) class Meta: