Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a9d4f9a2
authored
Dec 01, 2021
by
test
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
朋友圈发表动态添加校验
1 parent
7d11f964
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
linkwe-ui/src/views/friendCircle/enterprise.vue
linkwe-ui/src/views/friendCircle/publish.vue
linkwe-ui/src/views/friendCircle/enterprise.vue
View file @
a9d4f9a
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div
style=
"margin:10px 0;display:flex;"
>
<div
style=
"margin:10px 0;display:flex;"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"gotoRoute"
>
发表动态
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"gotoRoute"
>
发表动态
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"syncFn"
>
同步朋友圈
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"syncFn"
>
同步朋友圈
</el-button>
<div
class=
"time"
v-if=
"lastSyncTime"
>
{{
lastSyncTime
}}
</div>
<div
class=
"time"
v-if=
"lastSyncTime"
>
最近同步:
{{
lastSyncTime
}}
</div>
<div
class=
"time"
v-else
>
暂无记录,请手动点击同步
</div>
<div
class=
"time"
v-else
>
暂无记录,请手动点击同步
</div>
</div>
</div>
</div>
</div>
...
...
linkwe-ui/src/views/friendCircle/publish.vue
View file @
a9d4f9a
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<img
style=
"margin-right: 3px; height: 12px; width: 12px"
:src=
"require('@/assets/drainageCode/delete.png')"
alt=
""
/>
删除
<img
style=
"margin-right: 3px; height: 12px; width: 12px"
:src=
"require('@/assets/drainageCode/delete.png')"
alt=
""
/>
删除
</div>
</div>
</div>
</div>
<el-form-item
label=
"图片上传"
required
>
<el-form-item
label=
"图片上传"
required
:error=
"item.contentError"
>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"item.annexUrl"
type=
"0"
></upload>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"item.annexUrl"
type=
"0"
></upload>
</el-form-item>
</el-form-item>
</div>
</div>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<img
style=
"margin-right: 3px; height: 12px; width: 12px"
:src=
"require('@/assets/drainageCode/delete.png')"
alt=
""
/>
删除
<img
style=
"margin-right: 3px; height: 12px; width: 12px"
:src=
"require('@/assets/drainageCode/delete.png')"
alt=
""
/>
删除
</div>
</div>
</div>
</div>
<el-form-item
label=
"图文链接"
style=
"width: 50%"
required
>
<el-form-item
label=
"图文链接"
style=
"width: 50%"
required
:error=
"item.contentError"
>
<el-input
v-model=
"item.annexUrl"
placeholder=
"请输入图文链接"
></el-input>
<el-input
v-model=
"item.annexUrl"
placeholder=
"请输入图文链接"
></el-input>
<div
class=
"sub-des"
>
<div
class=
"sub-des"
>
仅支持公众号图文链接,且必须以 http://或 https://开头
仅支持公众号图文链接,且必须以 http://或 https://开头
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
<img
style=
"margin-right: 3px; height: 12px; width: 12px"
:src=
"require('@/assets/drainageCode/delete.png')"
alt=
""
/>
删除
<img
style=
"margin-right: 3px; height: 12px; width: 12px"
:src=
"require('@/assets/drainageCode/delete.png')"
alt=
""
/>
删除
</div>
</div>
</div>
</div>
<el-form-item
label=
"视频上传"
required
>
<el-form-item
label=
"视频上传"
required
:error=
"item.contentError"
>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"item.annexUrl"
type=
"2"
></upload>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"item.annexUrl"
type=
"2"
></upload>
</el-form-item>
</el-form-item>
</div>
</div>
...
@@ -108,10 +108,6 @@ import { gotoPublish } from '@/api/circle'
...
@@ -108,10 +108,6 @@ import { gotoPublish } from '@/api/circle'
import
SelectTag
from
'@/components/SelectTag'
import
SelectTag
from
'@/components/SelectTag'
import
SelectUser
from
'@/components/SelectUser'
import
SelectUser
from
'@/components/SelectUser'
import
upload
from
'@/components/Upload'
import
upload
from
'@/components/Upload'
const
materialField
=
{
annexType
:
""
,
annexUrl
:
""
}
export
default
{
export
default
{
name
:
'publish-detail'
,
name
:
'publish-detail'
,
components
:
{
components
:
{
...
@@ -158,7 +154,8 @@ import { gotoPublish } from '@/api/circle'
...
@@ -158,7 +154,8 @@ import { gotoPublish } from '@/api/circle'
this
.
form
.
contentType
=
e
this
.
form
.
contentType
=
e
this
.
form
.
otherContent
.
push
({
this
.
form
.
otherContent
.
push
({
annexType
:
e
,
annexType
:
e
,
annexUrl
:
''
annexUrl
:
''
,
contentError
:
''
})
})
},
},
onRemoveMaterial
(
index
)
{
onRemoveMaterial
(
index
)
{
...
@@ -171,7 +168,18 @@ import { gotoPublish } from '@/api/circle'
...
@@ -171,7 +168,18 @@ import { gotoPublish } from '@/api/circle'
onBackStep
()
{
onBackStep
()
{
this
.
$router
.
go
(
-
1
)
this
.
$router
.
go
(
-
1
)
},
},
validateMaterial
()
{
let
goto
=
true
this
.
form
.
otherContent
.
forEach
(
dd
=>
{
if
(
!
dd
.
annexUrl
)
{
dd
.
contentError
=
'内容不能为空'
goto
=
false
}
else
{
dd
.
contentError
=
''
}
})
return
goto
},
submit
()
{
submit
()
{
if
(
!
this
.
form
.
content
)
{
if
(
!
this
.
form
.
content
)
{
this
.
welcomeMsgError
=
'请输入动态内容'
this
.
welcomeMsgError
=
'请输入动态内容'
...
@@ -187,8 +195,11 @@ import { gotoPublish } from '@/api/circle'
...
@@ -187,8 +195,11 @@ import { gotoPublish } from '@/api/circle'
return
dd
.
userId
return
dd
.
userId
}).
join
(
','
)
}).
join
(
','
)
}
}
const
checkMaterialResult
=
this
.
validateMaterial
()
if
(
checkMaterialResult
)
{
let
goto
=
true
let
goto
=
true
this
.
form
.
otherContent
.
forEach
((
dd
)
=>
{
this
.
form
.
otherContent
.
forEach
((
dd
)
=>
{
delete
dd
.
contentError
if
(
dd
.
annexType
===
'link'
)
{
if
(
dd
.
annexType
===
'link'
)
{
let
reUrl
=
/
(
http|https
)
:
\/\/([\w
.
]
+
\/?)\S
*/
let
reUrl
=
/
(
http|https
)
:
\/\/([\w
.
]
+
\/?)\S
*/
if
(
!
reUrl
.
test
(
dd
.
content
))
{
if
(
!
reUrl
.
test
(
dd
.
content
))
{
...
@@ -206,6 +217,7 @@ import { gotoPublish } from '@/api/circle'
...
@@ -206,6 +217,7 @@ import { gotoPublish } from '@/api/circle'
}
}
})
})
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment