Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
e407781b
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e407781b
编写于
3月 15, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zentao site admin
上级
6381d49e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
17 deletion
+16
-17
ui/src/views/site/edit.vue
ui/src/views/site/edit.vue
+15
-16
ui/src/views/site/store.ts
ui/src/views/site/store.ts
+1
-1
未找到文件。
ui/src/views/site/edit.vue
浏览文件 @
e407781b
...
...
@@ -2,20 +2,20 @@
<a-card
:title=
"t('edit_site')"
>
<a-form
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-form-item
:label=
"t('name')"
v-bind=
"validateInfos.name"
>
<a-input
v-model:value=
"model.name"
<a-input
v-model:value=
"model
Ref
.name"
@
blur=
"validate('name',
{ trigger: 'blur' }).catch(() => {})" />
</a-form-item>
<a-form-item
:label=
"t('zentao_url')"
v-bind=
"validateInfos.url"
>
<a-input
v-model:value=
"model.url"
<a-input
v-model:value=
"model
Ref
.url"
@
blur=
"validate('url',
{ trigger: 'blur' }).catch(() => {})" placeholder="https://zentao.site.com" />
</a-form-item>
<a-form-item
:label=
"t('username')"
v-bind=
"validateInfos.username"
>
<a-input
v-model:value=
"model.username"
<a-input
v-model:value=
"model
Ref
.username"
@
blur=
"validate('username',
{ trigger: 'blur' }).catch(() => {})" placeholder="" />
</a-form-item>
<a-form-item
:label=
"t('password')"
v-bind=
"validateInfos.password"
>
<a-input-password
v-model:value=
"model.password"
<a-input-password
v-model:value=
"model
Ref
.password"
@
blur=
"validate('password',
{ trigger: 'blur' }).catch(() => {})" placeholder="" />
</a-form-item>
...
...
@@ -29,7 +29,7 @@
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
reactive
,
computed
,
Ref
,
toRaw
,
to
Ref
}
from
"
vue
"
;
import
{
defineComponent
,
ref
,
reactive
,
computed
,
Ref
,
watch
,
Computed
Ref
}
from
"
vue
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
...
...
@@ -39,11 +39,11 @@ const useForm = Form.useForm;
import
{
useStore
}
from
"
vuex
"
;
import
{
StateType
}
from
"
@/views/site/store
"
;
import
_
from
"
lodash
"
;
interface
SiteFormSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
model
:
Ref
rules
:
any
modelRef
:
ComputedRef
;
labelCol
:
any
wrapperCol
:
any
validate
:
any
...
...
@@ -61,7 +61,7 @@ export default defineComponent({
const
router
=
useRouter
();
const
store
=
useStore
<
{
Site
:
StateType
}
>
();
const
model
=
computed
(()
=>
store
.
state
.
Site
.
detailResult
);
const
model
Ref
=
computed
(()
=>
store
.
state
.
Site
.
detailResult
);
const
get
=
async
(
id
:
number
):
Promise
<
void
>
=>
{
await
store
.
dispatch
(
'
Site/get
'
,
id
);
...
...
@@ -97,28 +97,27 @@ export default defineComponent({
],
});
const
{
resetFields
,
validate
,
validateInfos
}
=
useForm
(
model
,
rules
);
const
{
resetFields
,
validate
,
validateInfos
}
=
useForm
(
model
Ref
,
rules
);
const
submitForm
=
()
=>
{
validate
()
.
then
(()
=>
{
console
.
log
(
model
);
store
.
dispatch
(
'
Site/save
'
,
model
.
value
).
then
((
success
)
=>
{
console
.
log
(
model
Ref
.
value
);
store
.
dispatch
(
'
Site/save
'
,
model
Ref
.
value
).
then
((
success
)
=>
{
if
(
success
)
{
notification
.
success
({
message
:
t
(
'
save_success
'
),
});
notification
.
success
({
message
:
t
(
'
save_success
'
)
});
router
.
push
(
`/site/list`
)
}
})
})
.
catch
((
e
)
=>
{
console
.
log
(
''
)})
};
return
{
t
,
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
14
},
model
,
model
Ref
,
rules
,
resetFields
,
validate
,
validateInfos
,
...
...
ui/src/views/site/store.ts
浏览文件 @
e407781b
...
...
@@ -66,7 +66,7 @@ const StoreModel: ModuleType = {
}
},
async
get
({
commit
},
id
:
number
)
{
let
data
=
{}
let
data
=
{
name
:
''
,
url
:
''
,
username
:
''
,
password
:
''
}
if
(
id
)
{
const
response
:
ResponseData
=
await
get
(
id
);
data
=
response
.
data
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录