Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
90cd8297
authored
Mar 18, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vue3 重构:邮件模版的列表
parent
e42a9aa6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
84 deletions
+89
-84
src/views/infra/dataSourceConfig/form.vue
+1
-2
src/views/system/mail/account/account.data.ts
+1
-3
src/views/system/mail/template/index.vue
+0
-0
src/views/system/mail/template/template.data.ts
+87
-79
No files found.
src/views/infra/dataSourceConfig/form.vue
View file @
90cd8297
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
*
as
DataSourceConfigApi
from
'@/api/infra/dataSourceConfig'
import
*
as
DataSourceConfigApi
from
'@/api/infra/dataSourceConfig'
import
{
DataSourceConfigVO
}
from
'@/api/infra/dataSourceConfig'
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
@@ -39,7 +38,7 @@ const modelVisible = ref(false) // 弹窗的是否展示
...
@@ -39,7 +38,7 @@ const modelVisible = ref(false) // 弹窗的是否展示
const
modelTitle
=
ref
(
''
)
// 弹窗的标题
const
modelTitle
=
ref
(
''
)
// 弹窗的标题
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
formData
=
ref
<
DataSourceConfigVO
>
({
const
formData
=
ref
<
DataSourceConfig
Api
.
DataSourceConfig
VO
>
({
id
:
undefined
,
id
:
undefined
,
name
:
''
,
name
:
''
,
url
:
''
,
url
:
''
,
...
...
src/views/system/mail/account/account.data.ts
View file @
90cd8297
...
@@ -77,9 +77,7 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -77,9 +77,7 @@ const crudSchemas = reactive<CrudSchema[]>([
{
{
label
:
'操作'
,
label
:
'操作'
,
field
:
'action'
,
field
:
'action'
,
form
:
{
isForm
:
false
show
:
false
}
}
}
])
])
export
const
{
allSchemas
}
=
useCrudSchemas
(
crudSchemas
)
export
const
{
allSchemas
}
=
useCrudSchemas
(
crudSchemas
)
src/views/system/mail/template/index.vue
View file @
90cd8297
This diff is collapsed.
Click to expand it.
src/views/system/mail/template/template.data.ts
View file @
90cd8297
import
type
{
VxeCrudSchema
}
from
'@/hooks/web/useVxeCrudSchemas'
import
type
{
CrudSchema
}
from
'@/hooks/web/useCrudSchemas'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
TableColumn
}
from
'@/types/table'
import
{
DictTag
}
from
'@/components/DictTag'
import
*
as
MailAccountApi
from
'@/api/system/mail/account'
const
accounts
=
await
MailAccountApi
.
getSimpleMailAccountList
()
// 表单校验
// 表单校验
export
const
rules
=
reactive
({
export
const
rules
=
reactive
({
name
:
[
required
],
name
:
[
required
],
code
:
[
required
],
code
:
[
required
],
accountId
:
[
required
],
accountId
:
[
required
],
title
:
[
required
],
label
:
[
required
],
content
:
[
required
],
content
:
[
required
],
params
:
[
required
],
params
:
[
required
],
status
:
[
required
]
status
:
[
required
]
})
})
// CrudSchema
// CrudSchema:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/hooks/useCrudSchemas.html
const
crudSchemas
=
reactive
<
VxeCrudSchema
>
({
const
crudSchemas
=
reactive
<
CrudSchema
[]
>
([
primaryKey
:
'id'
,
// 默认的主键ID
{
primaryTitle
:
'编号'
,
// 默认显示的值
label
:
'模板编码'
,
primaryType
:
null
,
field
:
'code'
,
action
:
true
,
isSearch
:
true
actionWidth
:
'260'
,
},
columns
:
[
{
{
label
:
'模板名称'
,
title
:
'模板编码'
,
field
:
'name'
,
field
:
'code'
,
isSearch
:
true
isSearch
:
true
},
},
{
{
label
:
'模板标题'
,
title
:
'模板名称'
,
field
:
'title'
field
:
'name'
,
},
isSearch
:
true
{
},
label
:
'模板内容'
,
{
field
:
'content'
,
title
:
'模板标题'
,
form
:
{
field
:
'title'
component
:
'Editor'
,
},
colProps
:
{
{
span
:
24
title
:
'模板内容'
,
},
field
:
'content'
,
componentProps
:
{
form
:
{
valueHtml
:
''
component
:
'Editor'
,
colProps
:
{
span
:
24
},
componentProps
:
{
valueHtml
:
''
}
}
}
}
},
{
label
:
'邮箱账号'
,
field
:
'accountId'
,
isSearch
:
true
,
width
:
'200px'
,
formatter
:
(
_
:
Recordable
,
__
:
TableColumn
,
cellValue
:
number
)
=>
{
return
accounts
.
find
((
account
)
=>
account
.
id
===
cellValue
)?.
mail
},
},
{
search
:
{
title
:
'邮箱账号'
,
show
:
true
,
field
:
'accountId'
,
component
:
'Select'
,
isSearch
:
true
,
api
:
()
=>
{
table
:
{
return
accounts
width
:
200
,
slots
:
{
default
:
'accountId_default'
}
},
},
search
:
{
componentProps
:
{
slots
:
{
optionsAlias
:
{
default
:
'accountId_search'
labelField
:
'mail'
,
valueField
:
'id'
}
}
}
}
}
},
{
label
:
'发送人名称'
,
field
:
'nickname'
},
{
label
:
'开启状态'
,
field
:
'status'
,
isSearch
:
true
,
formatter
:
(
_
:
Recordable
,
__
:
TableColumn
,
cellValue
:
number
)
=>
{
return
h
(
DictTag
,
{
type
:
DICT_TYPE
.
COMMON_STATUS
,
value
:
cellValue
})
},
},
{
dictType
:
DICT_TYPE
.
COMMON_STATUS
,
title
:
'发送人名称'
,
dictClass
:
'number'
field
:
'nickname'
},
},
{
{
label
:
'备注'
,
title
:
'开启状态'
,
field
:
'remark'
,
field
:
'status'
,
isTable
:
false
isSearch
:
true
,
},
dictType
:
DICT_TYPE
.
COMMON_STATUS
,
{
dictClass
:
'number'
label
:
'创建时间'
,
},
field
:
'createTime'
,
{
isForm
:
false
,
title
:
'备注'
,
formatter
:
dateFormatter
,
field
:
'remark'
,
search
:
{
isTable
:
false
show
:
true
,
},
itemRender
:
{
{
name
:
'XDataTimePicker'
title
:
'创建时间'
,
field
:
'createTime'
,
isForm
:
false
,
formatter
:
'formatDate'
,
table
:
{
width
:
180
},
search
:
{
show
:
true
,
itemRender
:
{
name
:
'XDataTimePicker'
}
}
}
}
}
]
}
}
)
]
)
export
const
{
allSchemas
}
=
use
Vxe
CrudSchemas
(
crudSchemas
)
export
const
{
allSchemas
}
=
useCrudSchemas
(
crudSchemas
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment