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
68f13acc
authored
Dec 07, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能新增】IoT:产品导出功能
parent
48907bde
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
10 deletions
+59
-10
src/views/iot/product/product/index.vue
+59
-10
No files found.
src/views/iot/product/product/index.vue
View file @
68f13acc
...
@@ -37,6 +37,15 @@
...
@@ -37,6 +37,15 @@
>
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增
</el-button>
</el-button>
<el-button
type=
"success"
plain
@
click=
"handleExport"
:loading=
"exportLoading"
v-hasPermi=
"['iot:product:export']"
>
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</ContentWrap>
</ContentWrap>
...
@@ -44,17 +53,36 @@
...
@@ -44,17 +53,36 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"产品名称"
align=
"center"
prop=
"name"
>
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
<template
#
default=
"scope"
>
<el-link
@
click=
"openDetail(scope.row.id)"
>
{{
scope
.
row
.
name
}}
</el-link>
</
template
>
</el-table-column>
<el-table-column
label=
"ProductKey"
align=
"center"
prop=
"productKey"
/>
<el-table-column
label=
"ProductKey"
align=
"center"
prop=
"productKey"
/>
<el-table-column
label=
"品类"
align=
"center"
prop=
"categoryName"
/>
<el-table-column
label=
"设备类型"
align=
"center"
prop=
"deviceType"
>
<el-table-column
label=
"设备类型"
align=
"center"
prop=
"deviceType"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.IOT_PRODUCT_DEVICE_TYPE"
:value=
"scope.row.deviceType"
/>
<dict-tag
:type=
"DICT_TYPE.IOT_PRODUCT_DEVICE_TYPE"
:value=
"scope.row.deviceType"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"产品图标"
align=
"center"
prop=
"icon"
>
<
template
#
default=
"scope"
>
<el-image
v-if=
"scope.row.icon"
:src=
"scope.row.icon"
class=
"w-40px h-40px"
:preview-src-list=
"[scope.row.icon]"
/>
<span
v-else
>
-
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"产品图片"
align=
"center"
prop=
"picture"
>
<
template
#
default=
"scope"
>
<el-image
v-if=
"scope.row.picUrl"
:src=
"scope.row.picUrl"
class=
"w-40px h-40px"
:preview-src-list=
"[scope.row.picture]"
/>
<span
v-else
>
-
</span>
</
template
>
</el-table-column>
<el-table-column
<el-table-column
label=
"创建时间"
label=
"创建时间"
align=
"center"
align=
"center"
...
@@ -62,11 +90,6 @@
...
@@ -62,11 +90,6 @@
:formatter=
"dateFormatter"
:formatter=
"dateFormatter"
width=
"180px"
width=
"180px"
/>
/>
<el-table-column
label=
"产品状态"
align=
"center"
prop=
"status"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.IOT_PRODUCT_STATUS"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
<el-button
...
@@ -79,6 +102,14 @@
...
@@ -79,6 +102,14 @@
</el-button>
</el-button>
<el-button
<el-button
link
link
type=
"primary"
@
click=
"openForm('update', scope.row.id)"
v-hasPermi=
"['iot:product:update']"
>
编辑
</el-button>
<el-button
link
type=
"danger"
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
@
click=
"handleDelete(scope.row.id)"
v-hasPermi=
"['iot:product:delete']"
v-hasPermi=
"['iot:product:delete']"
...
@@ -107,6 +138,7 @@ import { dateFormatter } from '@/utils/formatTime'
...
@@ -107,6 +138,7 @@ import { dateFormatter } from '@/utils/formatTime'
import
{
ProductApi
,
ProductVO
}
from
'@/api/iot/product/product'
import
{
ProductApi
,
ProductVO
}
from
'@/api/iot/product/product'
import
ProductForm
from
'./ProductForm.vue'
import
ProductForm
from
'./ProductForm.vue'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
download
from
'@/utils/download'
/** iot 产品 列表 */
/** iot 产品 列表 */
defineOptions
({
name
:
'IoTProduct'
})
defineOptions
({
name
:
'IoTProduct'
})
...
@@ -135,6 +167,8 @@ const queryParams = reactive({
...
@@ -135,6 +167,8 @@ const queryParams = reactive({
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
const
exportLoading
=
ref
(
false
)
// 导出的加载中
/** 查询列表 */
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
...
@@ -184,6 +218,21 @@ const handleDelete = async (id: number) => {
...
@@ -184,6 +218,21 @@ const handleDelete = async (id: number) => {
}
catch
{}
}
catch
{}
}
}
/** 导出按钮操作 */
const
handleExport
=
async
()
=>
{
try
{
// 导出的二次确认
await
message
.
exportConfirm
()
// 发起导出
exportLoading
.
value
=
true
const
data
=
await
ProductApi
.
exportProduct
(
queryParams
)
download
.
excel
(
data
,
'物联网产品.xls'
)
}
catch
{
}
finally
{
exportLoading
.
value
=
false
}
}
/** 初始化 **/
/** 初始化 **/
onMounted
(()
=>
{
onMounted
(()
=>
{
getList
()
getList
()
...
...
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