Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
王刘锁
/
jianlin-tms-view
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a4bb2538
authored
Sep 19, 2022
by
郑艺斌
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 修复字典显示不全
parent
3df3b002
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
9 deletions
src/api/siteAdmin/SiteConfig.js
src/views/modules/siteAdmin/siteConfig/index.vue
src/views/modules/taskPlan/taskChainList/index.vue
src/api/siteAdmin/SiteConfig.js
View file @
a4bb2538
...
...
@@ -57,4 +57,13 @@ export default class SiteConfig {
data
,
});
}
// 站点配置导出
exportExcel
(
params
)
{
return
request
({
url
:
"/site/config/export"
,
method
:
"get"
,
params
:
params
,
responseType
:
"blob"
,
});
}
}
src/views/modules/siteAdmin/siteConfig/index.vue
View file @
a4bb2538
...
...
@@ -16,8 +16,8 @@
</el-form-item>
<el-form-item
label=
"站点类型:"
prop=
"siteType"
>
<el-select
v-model=
"searchForm.siteType"
placeholder=
"请选择模板状态"
clearable
>
<el-option
v-for=
"item in $dictUtils.getDictList('tms_site_type')
.splice(1)"
:key=
"item.value
"
:
label=
"item.label"
:
value=
"item.value"
>
<el-option
v-for=
"item in $dictUtils.getDictList('tms_site_type')
"
:key=
"item.value"
:label=
"item.label
"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -48,22 +48,35 @@
<div
class=
"bg-white top"
style=
"height: calc(100% - 120px);"
>
<div
style=
"height: calc(100% - 80px);"
>
<el-row
type=
"flex"
>
<el-col
:span=
"
22
"
class=
"rowTabs"
>
<el-col
:span=
"
19
"
class=
"rowTabs"
>
<div
v-for=
"item in $dictUtils.getDictList('tms_site_type')"
:class=
"
{ rowItem: true, rowActive: item.value == tabsActive }" :key="item.value"
@click="clickTabsItem(item)">
{{
item
.
label
}}
</div>
</el-col>
<el-col
:span=
"2"
class=
"rowBtn"
>
<el-col
:span=
"5"
class=
"rowBtn"
>
<el-button
type=
"primary"
icon=
"el-icon-upload2"
size=
"small"
@
click=
"openExportEvent"
>
导出
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-download"
size=
"small"
@
click=
"importDataEvent"
>
导入
</el-button>
<el-button
v-if=
"hasPermission('siteConfig:add')"
type=
"primary"
icon=
"el-icon-plus"
size=
"small"
@
click=
"configAdd"
>
新增
</el-button>
</el-col>
</el-row>
<vxe-table
border=
"full"
ref=
"xTable"
show-overflow
auto-resize
resizable
height=
"auto"
:loading=
"loading"
:scroll-y=
"
{ enabled: false }" :span-method="mergeRowMethod" :data="tableData" header-align="center"
:seq-config="{ seqMethod: seqMethod }" :column-config="{ width: '130px' }">
:seq-config="{ seqMethod: seqMethod }" :column-config="{ width: '130px' }" :export-config="{
remote: true,
filename: `用户数据${moment(new Date()).format('YYYY-MM-DD')}`,
sheetName: '用户数据',
exportMethod: exportMethod,
types: ['xlsx'],
modes: ['current', 'selected', 'all']
}" :import-config="{
importMethod: importMethod,
types: ['csv', 'xls', 'xlsx'],
remote: true}">
<!--
<vxe-column
type=
"seq"
width=
"60"
title=
"序号"
align=
"center"
></vxe-column>
-->
<vxe-column
type=
"checkbox"
width=
"40px"
align=
"center"
></vxe-column>
<vxe-column
field=
"company_dictText"
title=
"公司"
align=
"center"
width=
"130px"
></vxe-column>
<vxe-column
field=
"factoryId_dictText"
title=
"厂区"
align=
"center"
width=
"130px"
></vxe-column>
<vxe-column
field=
"floorNum"
title=
"楼层"
align=
"center"
width=
"130px"
></vxe-column>
...
...
@@ -349,6 +362,47 @@ export default {
this
.
tablePage
.
pageSize
=
pageSize
this
.
getConfigPage
()
},
// 打开导出弹窗
openExportEvent
()
{
this
.
$refs
.
xTable
.
openExport
()
},
// 自定义服务端导出
exportMethod
({
options
})
{
// 传给服务端的参数
const
params
=
{
'current'
:
this
.
tablePage
.
currentPage
,
'size'
:
this
.
tablePage
.
pageSize
,
'orders'
:
this
.
tablePage
.
orders
,
...
this
.
searchForm
,
filename
:
options
.
filename
,
sheetName
:
options
.
sheetName
,
isHeader
:
options
.
isHeader
,
original
:
options
.
original
,
mode
:
options
.
mode
,
selectIds
:
options
.
mode
===
'selected'
?
options
.
data
.
map
(
item
=>
item
.
id
)
:
[],
exportFields
:
options
.
columns
.
map
(
column
=>
column
.
property
)
}
return
this
.
SiteConfig
.
exportExcel
(
params
).
then
((
res
)
=>
{
// 将二进制流文件写入excel表,以下为重要步骤
this
.
$utils
.
downloadExcel
(
res
.
data
,
options
.
filename
)
}).
catch
(
function
(
err
)
{
if
(
err
.
response
)
{
console
.
log
(
err
.
response
)
}
})
},
importDataEvent
()
{
this
.
$refs
.
xTable
.
importData
()
},
// 自定义服务端导入
importMethod
({
file
})
{
// 处理表单
const
formBody
=
new
FormData
()
formBody
.
append
(
'file'
,
file
)
this
.
userService
.
importExcel
(
formBody
).
then
(
result
=>
{
this
.
$message
.
success
(
result
)
})
},
},
created
()
{
this
.
SiteConfig
=
new
SiteConfig
()
...
...
src/views/modules/taskPlan/taskChainList/index.vue
View file @
a4bb2538
...
...
@@ -88,8 +88,9 @@
<vxe-column
field=
"taskSubState"
title=
"子任务状态"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.taskSubState === '3'"
style=
"color: #249601;"
>
已完成
</span>
<span
v-else-if=
"scope.row.taskStatus === '1'"
style=
"color: #E1750F;"
>
执行中
</span>
<span
v-else-if=
"scope.row.taskStatus === '5'"
style=
"color: #999999;"
>
未执行
</span>
<span
v-else-if=
"scope.row.taskSubState === '1'"
style=
"color: #E1750F;"
>
执行中
</span>
<span
v-else-if=
"scope.row.taskSubState === '5'"
style=
"color: #999999;"
>
未执行
</span>
<span
v-else-if=
"scope.row.taskSubState === '4'"
style=
"color: #000000;"
>
已取消
</span>
</
template
>
</vxe-column>
<vxe-column
field=
"beginAt"
title=
"执行开始时间"
width=
"180px"
></vxe-column>
...
...
@@ -209,13 +210,19 @@ export default {
})
},
// 设置任务状态
setTaskStatus
(
row
,
taskStatus
)
{
async
setTaskStatus
(
row
,
taskStatus
)
{
const
can
=
{
id
:
row
.
id
,
taskStatus
}
this
.
TaskChainList
.
setUpdateStatus
(
can
).
then
(({
data
})
=>
{
this
.
$set
(
row
,
'taskStatus'
,
taskStatus
)
if
(
data
.
code
===
200
)
{
this
.
$set
(
row
,
'taskStatus'
,
taskStatus
)
this
.
$message
({
type
:
'success'
,
message
:
data
.
msg
});
}
})
},
},
...
...
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