diff --git a/backend/global/regex.go b/backend/global/regex.go
index 056b118..074e73c 100644
--- a/backend/global/regex.go
+++ b/backend/global/regex.go
@@ -4,6 +4,8 @@ import (
"reflect"
"regexp"
"strconv"
+
+ sql "github.com/FloatTech/sqlite"
)
// Regex stores user's config of splitting docx file
@@ -73,10 +75,16 @@ func (u *UserDatabase) GetUserRegex(id int) (*Regex, error) {
if !user.IsFileManager() {
return nil, ErrInvalidRole
}
- reg := newRegex()
u.mu.RLock()
- _ = u.db.Find(UserTableRegex, ®, "WHERE ID="+strconv.Itoa(id))
+ reg, _ := sql.Find[Regex](&u.db, UserTableRegex, "WHERE ID="+strconv.Itoa(id))
u.mu.RUnlock()
reg.ID = *user.ID
+ rf := reflect.ValueOf(reg)
+ defaultrf := reflect.ValueOf(newRegex())
+ for i := 0; i < rf.NumField(); i++ {
+ if rf.Field(i).IsZero() {
+ rf.Field(i).Set(defaultrf.Field(i))
+ }
+ }
return ®, nil
}
diff --git a/frontend/vben/src/views/dashboard/regex/data.ts b/frontend/vben/src/views/dashboard/regex/data.ts
new file mode 100644
index 0000000..903b655
--- /dev/null
+++ b/frontend/vben/src/views/dashboard/regex/data.ts
@@ -0,0 +1,87 @@
+import { FormSchema } from '/@/components/Form'
+const colProps = {
+ span: 8,
+}
+
+export const schemas: FormSchema[] = [
+ {
+ field: 'title',
+ component: 'Input',
+ colProps,
+ label: '标题',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'class',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'opencl',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'date',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'time',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'rate',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'major',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+ {
+ field: 'sub',
+ component: 'Input',
+ colProps,
+ label: '客户',
+ helpMessage: '目标的服务对象',
+ componentProps: {
+ placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
+ },
+ },
+]
diff --git a/frontend/vben/src/views/dashboard/regex/index.vue b/frontend/vben/src/views/dashboard/regex/index.vue
new file mode 100644
index 0000000..42c89ed
--- /dev/null
+++ b/frontend/vben/src/views/dashboard/regex/index.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+