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 1916d083
authored
Jun 15, 2023
by
怪兽?别跑
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
智能短链优化
1 parent
19e07f8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
179 additions
and
123 deletions
vue3-lw-pc/src/views/intelligentShortLink/index.vue
vue3-lw-pc/src/views/intelligentShortLink/index.vue
View file @
1916d08
<
script
>
import
{
getList
,
getAnalysis
,
remove
}
from
'@/api/intelligentShortLink'
import
{
touchTypeDict
}
from
'./components/mixin'
export
default
{
name
:
''
,
components
:
{},
data
()
{
return
{
loading
:
false
,
cardData
:
[],
total
:
0
,
query
:
{
pageSize
:
10
,
pageNum
:
1
,
},
touchTypeDict
,
// dictStatus: Object.freeze({
// 1: '启用',
// 2: '关闭',
// }),
import
{
getList
,
getAnalysis
,
remove
}
from
'@/api/intelligentShortLink'
import
*
as
api
from
'@/api/enterpriseId'
import
{
touchTypeDict
}
from
'./components/mixin'
export
default
{
name
:
''
,
components
:
{},
data
()
{
return
{
loading
:
false
,
cardData
:
[],
total
:
0
,
query
:
{
pageSize
:
10
,
pageNum
:
1
},
touchTypeDict
,
// dictStatus: Object.freeze({
// 1: '启用',
// 2: '关闭',
// }),
list
:
[],
ids
:
[],
}
},
computed
:
{},
watch
:
{},
created
()
{
this
.
getList
()
this
.
getAnalysis
()
this
.
$store
.
setBusininessDesc
(
` <div>生成智能短链,一键跳转公众号、小程序、企业微信</div> `
)
},
mounted
()
{
this
.
clipboard
=
new
this
.
ClipboardJS
(
'.copy-btn'
)
},
unmounted
()
{
this
.
clipboard
.
destroy
()
},
methods
:
{
getAnalysis
()
{
this
.
loading
=
true
getAnalysis
()
.
then
(({
data
})
=>
{
this
.
cardData
=
[
{
title
:
'访问总数(pv)'
,
tips
:
'短链页面访问的总次数'
,
value
:
data
.
pvTotalCount
,
},
{
title
:
'访问总人数(uv)'
,
tips
:
'短链页面访问的独立IP数'
,
value
:
data
.
uvTotalCount
,
},
{
title
:
'小程序打开数'
,
tips
:
'小程序成功打开的总次数'
,
value
:
data
.
openTotalCount
,
},
{
title
:
'今日访问总数(pv)'
,
tips
:
'今日短链页面访问的总次数'
,
value
:
data
.
pvTodayCount
,
title1
:
'较昨日'
,
value1
:
data
.
pvDiff
,
},
{
title
:
'今日访问总人数(uv)'
,
tips
:
'今日短链页面访问的独立IP数'
,
value
:
data
.
uvTodayCount
,
title1
:
'较昨日'
,
value1
:
data
.
uvDiff
,
},
{
title
:
'今日小程序打开数'
,
tips
:
'今日小程序成功打开的总次数'
,
value
:
data
.
openTodayCount
,
title1
:
'较昨日'
,
value1
:
data
.
openDiff
,
},
]
})
.
catch
((
e
)
=>
{
console
.
log
(
e
)
})
.
finally
(()
=>
{
this
.
loading
=
false
})
list
:
[],
ids
:
[],
needMoreInfo
:
false
,
dialogVisible
:
false
}
},
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
getList
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
total
=
+
total
})
.
catch
(()
=>
{})
.
finally
(()
=>
{
this
.
loading
=
false
})
computed
:
{},
watch
:
{},
created
()
{
this
.
setState
()
this
.
getList
()
this
.
getAnalysis
()
this
.
$store
.
setBusininessDesc
(
` <div>生成智能短链,一键跳转公众号、小程序、企业微信</div> `
)
},
resetForm
()
{
this
.
$refs
[
'queryForm'
].
resetFields
()
this
.
getList
(
1
)
mounted
()
{
this
.
clipboard
=
new
this
.
ClipboardJS
(
'.copy-btn'
)
},
goRoute
(
row
=
{},
detail
)
{
let
{
id
}
=
row
this
.
$router
.
push
({
path
:
'./'
+
(
detail
||
'addEdit'
),
query
:
{
id
},
})
unmounted
()
{
this
.
clipboard
.
destroy
()
},
remove
(
id
)
{
const
ids
=
id
||
this
.
ids
+
''
this
.
$confirm
(
'是否确认删除吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(
function
()
{
return
remove
(
ids
)
methods
:
{
cancelFn
()
{
this
.
needMoreInfo
=
false
this
.
dialogVisible
=
false
this
.
goRoute
()
},
gotoSetting
()
{
this
.
$router
.
push
({
path
:
'/enterpriseManage/enterpriseWechat'
})
.
then
(()
=>
{
this
.
getList
()
this
.
msgSuccess
(
'删除成功'
)
},
setState
()
{
api
.
getDetail
().
then
((
res
)
=>
{
if
(
!
res
.
data
.
wxAppletOriginalId
||
!
res
.
data
.
miniAppId
||
!
res
.
data
.
miniSecret
)
{
this
.
needMoreInfo
=
true
}
})
},
},
}
},
getAnalysis
()
{
this
.
loading
=
true
getAnalysis
()
.
then
(({
data
})
=>
{
this
.
cardData
=
[
{
title
:
'访问总数(pv)'
,
tips
:
'短链页面访问的总次数'
,
value
:
data
.
pvTotalCount
},
{
title
:
'访问总人数(uv)'
,
tips
:
'短链页面访问的独立IP数'
,
value
:
data
.
uvTotalCount
},
{
title
:
'小程序打开数'
,
tips
:
'小程序成功打开的总次数'
,
value
:
data
.
openTotalCount
},
{
title
:
'今日访问总数(pv)'
,
tips
:
'今日短链页面访问的总次数'
,
value
:
data
.
pvTodayCount
,
title1
:
'较昨日'
,
value1
:
data
.
pvDiff
},
{
title
:
'今日访问总人数(uv)'
,
tips
:
'今日短链页面访问的独立IP数'
,
value
:
data
.
uvTodayCount
,
title1
:
'较昨日'
,
value1
:
data
.
uvDiff
},
{
title
:
'今日小程序打开数'
,
tips
:
'今日小程序成功打开的总次数'
,
value
:
data
.
openTodayCount
,
title1
:
'较昨日'
,
value1
:
data
.
openDiff
}
]
})
.
catch
((
e
)
=>
{
console
.
log
(
e
)
})
.
finally
(()
=>
{
this
.
loading
=
false
})
},
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
getList
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
total
=
+
total
})
.
catch
(()
=>
{})
.
finally
(()
=>
{
this
.
loading
=
false
})
},
resetForm
()
{
this
.
$refs
[
'queryForm'
].
resetFields
()
this
.
getList
(
1
)
},
goRoute
(
row
=
{},
detail
)
{
if
(
this
.
needMoreInfo
)
{
this
.
dialogVisible
=
true
return
}
let
{
id
}
=
row
this
.
$router
.
push
({
path
:
'./'
+
(
detail
||
'addEdit'
),
query
:
{
id
}
})
},
remove
(
id
)
{
const
ids
=
id
||
this
.
ids
+
''
this
.
$confirm
(
'是否确认删除吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(
function
()
{
return
remove
(
ids
)
})
.
then
(()
=>
{
this
.
getList
()
this
.
msgSuccess
(
'删除成功'
)
})
}
}
}
</
script
>
<
template
>
...
...
@@ -140,7 +169,8 @@ export default {
v-for=
"(item, index) in touchTypeDict"
:key=
"index"
:label=
"item.allName"
:value=
"+index"
></el-option>
:value=
"+index"
></el-option>
</el-select>
</el-form-item>
<!--
<el-form-item
label=
""
prop=
"status"
>
...
...
@@ -172,7 +202,8 @@ export default {
<el-icon-copy-document
class=
"el-icon-copy-document copy-btn cp ml20"
title=
"复制"
:data-clipboard-text=
"row.shortLink"
></el-icon-copy-document>
:data-clipboard-text=
"row.shortLink"
></el-icon-copy-document>
</
template
>
</el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status">
...
...
@@ -188,14 +219,39 @@ export default {
</el-table-column>
</el-table>
<pagination
:total=
"total"
v-model:page=
"query.pageNum"
v-model:limit=
"query.pageSize"
@
pagination=
"getList()"
/>
<
template
v-if=
"!list.length"
>
<div
class=
"tips"
>
智能短链需要先配置短链小程序,否则无法正常使用,
<a
class=
"link"
@
click=
"gotoSetting"
>
去配置
</a>
</div>
</
template
>
</div>
<el-dialog
title=
"提示"
:close-on-click-modal=
"false"
:show-close=
"false"
v-model=
"dialogVisible"
width=
"auto"
>
<div
style=
"text-align: center;"
>
智能短链需要先配置短链小程序,否则无法正常使用。
</div>
<
template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"cancelFn"
>
继续新建
</el-button>
<el-button
type=
"primary"
@
click=
"gotoSetting"
>
去配置
</el-button>
</span>
</
template
>
</el-dialog>
</div>
</template>
<
style
lang=
"scss"
scoped
>
.el-icon-copy-document
{
&:hover
{
.tips
{
margin-top
:
30px
;
text-align
:
center
;
color
:
#999999
;
}
.link
{
color
:
var
(
--color
);
border-bottom
:
1px
solid
var
(
--color
);
}
.el-icon-copy-document
{
&:hover
{
color
:
var
(
--color
);
}
}
}
</
style
>
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