Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setup-project-manager-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
setup-project-manager-ui
Commits
acb68ab5
Commit
acb68ab5
authored
Dec 19, 2024
by
王晓旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改功能
parent
8017fd3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
200 additions
and
8 deletions
+200
-8
admin/src/views/Step.vue
admin/src/views/Step.vue
+200
-8
No files found.
admin/src/views/Step.vue
View file @
acb68ab5
...
...
@@ -60,6 +60,35 @@
</div>
<!-- 第三步 -->
<div
v-show=
"active == 2"
>
<div
style=
"height: 500px; overflow: auto; margin-bottom:20px"
>
<div
class=
"layout-table"
>
<div
class=
"table-body"
>
<el-table
size=
'small'
ref=
"steptable"
:data=
"tableData.data"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
v-for=
'column in config.columns'
:key=
'column.prop'
:type=
"column.type"
:prop=
"column.prop"
:label=
"column.label"
:width=
"column.width"
:formatter=
'column.formatter'
:selectable=
"handleSelectableMethod"
>
</el-table-column>
</el-table>
</div>
</div>
</div>
<el-button
type=
"primary"
@
click=
"batchDistribute"
>
下一步
</el-button>
</div>
<!-- 第四步 -->
<div
v-show=
"active == 3"
>
<div
class=
"label"
>
完成
</div>
<div
class=
"line"
></div>
<div
class=
"wancheng"
>
...
...
@@ -72,7 +101,7 @@
</div>
<div
class=
"line"
></div>
<el-button
type=
"primary"
@
click=
"gotoMh"
>
门户网站
</el-button>
<
el-button
type=
"primary"
@
click=
"gotoSet"
>
项目部署管理
</el-button
>
<
!-- <el-button type="primary" @click="gotoSet">项目部署管理</el-button> --
>
</div>
</div>
...
...
@@ -81,7 +110,13 @@
<
script
>
import
tree
from
"
@/assets/mixins/tree
"
;
import
axios
from
"
axios
"
;
import
{
formatter
}
from
"
@/assets/utils/table
"
;
// import table from "@/assets/mixins/table";
export
default
{
// mixins: [table,tree],
mixins
:
[
tree
],
data
()
{
return
{
...
...
@@ -107,14 +142,42 @@ export default {
tabList
:
[
"
1、项目文件包导入
"
,
"
2、创建站点
"
,
"
3、完成
"
"
3、部署
"
,
"
4、完成
"
],
loading
:
false
,
fileList
:
[],
}
// timer: "",
config
:
{
columns
:
[
{
type
:
"
selection
"
,
align
:
"
center
"
,
reserveSelection
:
true
,
width
:
60
,
props
:
"
gouxuan
"
},
created
()
{
this
.
objInstall
()
{
type
:
"
index
"
,
prop
:
"
xuhao
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
所属站点
"
,
prop
:
"
siteName
"
,
width
:
120
},
{
label
:
"
项目产品名称
"
,
prop
:
"
name
"
},
{
label
:
"
项目产品编码
"
,
prop
:
"
projectCode
"
},
{
label
:
"
项目类型
"
,
prop
:
"
projectType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
项目状态
"
,
prop
:
"
projectStatus
"
,
formatter
:
this
.
formatterStatus
},
{
label
:
"
备注
"
,
width
:
200
,
prop
:
"
remark
"
}
],
},
source
:
axios
.
CancelToken
.
source
(),
tableData
:
{
// 表格数据
loading
:
true
,
// ajax请求状态
dict
:
{},
result
:
[],
pageInfo
:
{},
},
loadingTimer
:
null
,
selection
:
[],
// 表格内置的多选
nowTabdataStatus
:
1
}
},
methods
:
{
objInstall
()
{
...
...
@@ -149,6 +212,120 @@ export default {
this
.
$message
.
error
(
error
.
message
);
});
},
// 以下第三部分
// 默认拉取数据
async
getData
()
{
this
.
tableData
.
loading
=
true
;
this
.
$post
(
'
/setup/project/list
'
,
{},
{
cancelToken
:
this
.
source
.
token
,
})
.
then
(({
data
})
=>
{
this
.
tableData
=
Object
.
assign
({},
this
.
tableData
,
data
)
this
.
nowTabdataStatus
=
1
})
.
catch
((
error
)
=>
{
if
(
error
.
message
==
"
自动取消ajax操作
"
)
return
;
this
.
$message
.
error
(
error
.
message
);
})
.
then
((
data
)
=>
{
clearTimeout
(
this
.
loadingTimer
);
this
.
loadingTimer
=
setTimeout
(()
=>
{
this
.
tableData
.
loading
=
false
;
},
300
);
});
},
syncProjectStatus
()
{
this
.
$post
(
"
/setup/project/projectStatusUpdate
"
,
{
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
getData
()
}
})
},
formatterStatus
(
row
,
column
,
val
)
{
const
content
=
formatter
(
this
.
tableData
,
column
,
val
);
if
(
content
)
{
if
(
val
==
"
0
"
)
{
return
(
<
el
-
tag
type
=
{
"
warning
"
}
size
=
"
mini
"
>
{
content
}
<
/el-tag
>
);
}
else
if
(
val
==
"
1
"
)
{
return
(
<
el
-
tag
type
=
{
"
danger
"
}
size
=
"
mini
"
>
{
content
}
<
/el-tag
>
);
}
else
if
(
val
==
"
2
"
)
{
return
(
<
el
-
tag
type
=
{
"
success
"
}
size
=
"
mini
"
>
{
content
}
<
/el-tag
>
);
}
else
{
return
<
el
-
tag
size
=
"
mini
"
>
{
content
}
<
/el-tag>
;
}
}
else
{
return
val
;
}
},
// 格式化单元格数据
formatter
(
row
,
column
,
val
)
{
const
content
=
formatter
(
this
.
tableData
,
column
,
val
);
return
content
?
(
<
el
-
tag
type
=
{
"
info
"
}
size
=
"
mini
"
>
{
content
}
<
/el-tag
>
)
:
val
?
(
val
)
:
(
"
--
"
);
},
// 多选表格行
handleSelectionChange
(
val
)
{
this
.
selection
=
val
.
map
((
i
)
=>
i
.
id
);
},
handleSelectableMethod
(
row
,
index
)
{
if
(
row
.
projectStatus
==
1
){
return
true
;
}
else
{
if
(
this
.
nowTabdataStatus
){
this
.
$refs
.
steptable
.
toggleRowSelection
(
row
,
true
)
if
(
index
==
this
.
tableData
.
data
.
length
-
1
){
this
.
nowTabdataStatus
=
0
}
}
return
false
;
}
},
batchDistribute
(){
let
setlist
=
this
.
tableData
.
data
.
filter
((
item
)
=>
{
return
item
.
projectStatus
!=
1
}).
map
((
item
)
=>
{
return
item
.
id
})
let
arr
=
this
.
selection
.
filter
((
item
)
=>
{
return
setlist
.
indexOf
(
item
)
===
-
1
})
this
.
$post
(
"
/setup/project/batchDistribute
"
,
{
idList
:
arr
,
},{
isLoading
:
true
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
批量部署成功!
"
);
this
.
active
=
3
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
// 以下第四部分
gotoMh
()
{
window
.
location
.
href
=
process
.
env
.
VUE_APP_PORTAL_URL
},
...
...
@@ -175,6 +352,7 @@ export default {
this
.
loading
=
false
;
if
(
res
.
code
==
1
)
{
this
.
active
=
2
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
...
...
@@ -213,7 +391,6 @@ export default {
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
console
.
log
(
response
);
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
nowupload
.
clearFiles
();
...
...
@@ -234,7 +411,18 @@ export default {
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
}
},
}
},
created
()
{
// this.objInstall()
// this.changePath()
},
mounted
()
{
this
.
timer
=
setInterval
(
this
.
syncProjectStatus
,
1000
*
60
);
this
.
getData
();
},
}
</
script
>
...
...
@@ -244,6 +432,10 @@ export default {
}
// 第三部分
/deep/ .table-body{
margin-left:0 !important;
}
// 第四部分
.wancheng {
margin-bottom: 350px;
...
...
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