Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyi.chen
data-collect
Commits
6565999d
Commit
6565999d
authored
Apr 02, 2024
by
wenyi.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线上更新
parent
8b5b0dc9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
4 deletions
+77
-4
src/api/excelFile/index.js
+27
-0
src/views/claimTasks/user/incomplete/details.vue
+1
-1
src/views/norm/list/index.vue
+23
-1
src/views/taskPackage/list/index.vue
+24
-1
vite.config.js
+2
-1
No files found.
src/api/excelFile/index.js
0 → 100644
View file @
6565999d
import
request
from
'/@/utils/request'
;
/**
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
*
*/
export
function
excelFileApi
()
{
return
{
taskExportFile
:
(
data
)
=>
{
return
request
({
url
:
'/api/taskExportFile'
,
method
:
'post'
,
data
,
});
},
normExportFile
:
(
data
)
=>
{
return
request
({
url
:
'/api/normExportFile'
,
method
:
'post'
,
data
,
});
},
};
}
src/views/claimTasks/user/incomplete/details.vue
View file @
6565999d
...
...
@@ -25,7 +25,7 @@
<el-select
v-model=
"state.formItem.addItem.refer_type"
placeholder=
"请选择信源等级"
>
<el-option
label=
"官网/政府"
value=
"1"
></el-option>
<el-option
label=
"权威媒体"
value=
"2"
></el-option>
<el-option
label=
"
"
value=
"3"
></el-option>
<el-option
label=
"
其他信源
"
value=
"3"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"标题"
:prop=
"'userFilled.' + index+ '.name'"
v-for=
"(item, index) in state.formItem.userFilled"
:key=
"index"
>
...
...
src/views/norm/list/index.vue
View file @
6565999d
...
...
@@ -53,10 +53,11 @@
<span
style=
"color:#F56C6C"
>
{{
scope
.
row
.
collectsQuantity
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"
2
80"
fixed=
"right"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"
3
80"
fixed=
"right"
align=
"center"
>
<
template
#
default=
"scope"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"details(scope.row.id)"
>
查看详情
</el-button>
<el-button
size=
"small"
type=
"danger"
@
click=
"edit(scope.row.id)"
>
修改指标
</el-button>
<el-button
size=
"small"
type=
"warning"
@
click=
"exportFile(scope.row.id)"
>
导出数据
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -80,6 +81,7 @@
import
{
getCurrentInstance
}
from
'vue'
;
import
{
normApi
}
from
'/@/api/norm/index'
;
import
{
taskPackageApi
}
from
'/@/api/taskPackage/index'
;
import
{
excelFileApi
}
from
'/@/api/excelFile/index'
;
import
{
ElMessageBox
,
ElMessage
}
from
'element-plus'
;
// 引入组件
...
...
@@ -190,6 +192,26 @@ const details= (norm_id) => {
const
edit
=
(
norm_id
)
=>
{
EditDialogRef
.
value
.
openDialog
(
norm_id
);
}
// 导出文件
const
exportFile
=
(
id
)
=>
{
let
query
=
{
id
:
id
}
excelFileApi
().
normExportFile
(
query
).
then
(
res
=>
{
if
(
res
.
data
){
let
url
=
res
.
data
;
const
iframe
=
document
.
createElement
(
'iframe'
);
// 创建一个HTML 元素
iframe
.
style
.
display
=
'none'
;
// 隐藏iframe 防止影响页面
iframe
.
style
.
height
=
0
;
// 高度设置0 防止影响页面
iframe
.
src
=
url
;
// 下载链接
document
.
body
.
appendChild
(
iframe
);
// 这一行必须,iframe挂在到dom树上才会发请求 // 5分钟之后删除
setTimeout
(()
=>
{
iframe
.
remove
();
},
5
*
60
*
1000
);
ElMessage
.
success
(
'导出成功,请点击下载列表查看!'
);
}
else
{
ElMessage
.
error
(
'导出失败!'
);
}
}).
catch
(()
=>
{
})
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/taskPackage/list/index.vue
View file @
6565999d
...
...
@@ -40,11 +40,12 @@
<span
style=
"color:#F56C6C"
>
{{
scope
.
row
.
collectsQuantity
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"
2
50"
fixed=
"right"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"
3
50"
fixed=
"right"
align=
"center"
>
<
template
#
default=
"scope"
>
<!--
<el-button
size=
"small"
link
type=
"primary"
@
click=
"details(scope.row.id)"
>
发布指标
</el-button>
-->
<el-button
size=
"small"
type=
"primary"
@
click=
"details(scope.row.id)"
>
详情与发布
</el-button>
<el-button
size=
"small"
type=
"danger"
@
click=
"edit(scope.row)"
>
修改任务
</el-button>
<el-button
size=
"small"
type=
"warning"
@
click=
"exportFile(scope.row.id)"
>
导出数据
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -66,6 +67,7 @@
<
script
setup
name=
"taskPackage-list"
>
import
{
getCurrentInstance
}
from
'vue'
;
import
{
taskPackageApi
}
from
'/@/api/taskPackage/index'
;
import
{
excelFileApi
}
from
'/@/api/excelFile/index'
;
import
{
ElMessageBox
,
ElMessage
}
from
'element-plus'
;
// 引入组件
...
...
@@ -152,6 +154,27 @@ const edit= (row) => {
AddDialogRef
.
value
.
openDialog
(
row
);
}
// 导出文件
const
exportFile
=
(
id
)
=>
{
let
query
=
{
id
:
id
}
excelFileApi
().
taskExportFile
(
query
).
then
(
res
=>
{
if
(
res
.
data
){
let
url
=
res
.
data
;
const
iframe
=
document
.
createElement
(
'iframe'
);
// 创建一个HTML 元素
iframe
.
style
.
display
=
'none'
;
// 隐藏iframe 防止影响页面
iframe
.
style
.
height
=
0
;
// 高度设置0 防止影响页面
iframe
.
src
=
url
;
// 下载链接
document
.
body
.
appendChild
(
iframe
);
// 这一行必须,iframe挂在到dom树上才会发请求 // 5分钟之后删除
setTimeout
(()
=>
{
iframe
.
remove
();
},
5
*
60
*
1000
);
ElMessage
.
success
(
'导出成功,请点击下载列表查看!'
);
}
else
{
ElMessage
.
error
(
'导出失败!'
);
}
}).
catch
(()
=>
{
})
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
vite.config.js
View file @
6565999d
...
...
@@ -37,7 +37,8 @@ const viteConfig = defineConfig((mode) => {
hmr
:
true
,
proxy
:
{
'/dev'
:
{
target
:
'https://data-collect.raisound.com/smart-detection'
,
target
:
'http://gcspider.raisound.com:81/data-collect-api'
,
// target: 'https://data-collect.raisound.com/smart-detection',
// target: 'http://192.168.10.168/data-collect-api',
ws
:
true
,
changeOrigin
:
true
,
...
...
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