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
a30aec8f
Commit
a30aec8f
authored
Nov 19, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加检测是否首次安装
parent
36ec01f3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
146 additions
and
98 deletions
+146
-98
admin/setup-project-manager-ui.tar.gz
admin/setup-project-manager-ui.tar.gz
+0
-0
admin/src/assets/utils/ajax.js
admin/src/assets/utils/ajax.js
+48
-2
admin/src/assets/utils/httpErrorHandler.js
admin/src/assets/utils/httpErrorHandler.js
+3
-3
admin/src/views/setup/project/list.vue
admin/src/views/setup/project/list.vue
+93
-91
admin/vue.config.js
admin/vue.config.js
+2
-2
No files found.
admin/setup-project-manager-ui.tar.gz
View file @
a30aec8f
No preview for this file type
admin/src/assets/utils/ajax.js
View file @
a30aec8f
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
Vue
from
'
vue
'
import
ElementUI
from
'
element-ui
'
import
'
element-ui/lib/theme-chalk/index.css
'
import
Qs
from
"
qs
"
;
import
Qs
from
"
qs
"
;
const
JSONbig
=
require
(
"
json-bigint
"
)({
storeAsString
:
true
});
const
JSONbig
=
require
(
"
json-bigint
"
)({
storeAsString
:
true
});
import
cookie
from
"
./cookie
"
;
import
cookie
from
"
./cookie
"
;
import
httpErrorHandler
from
"
./httpErrorHandler
"
;
import
httpErrorHandler
from
"
./httpErrorHandler
"
;
// loading框设置局部刷新,且所有请求完成后关闭loading框
let
loading
let
needLoadingRequestCount
=
0
// 声明一个对象用于存储请求个数
function
startLoading
()
{
loading
=
Vue
.
prototype
.
$loading
({
lock
:
true
,
customClass
:
'
createLoading
'
,
// 局部class名称
text
:
'
服务加载中...
'
,
background
:
'
rgba(0,0,0,0.5)
'
,
target
:
document
.
querySelector
(
'
.loading-area
'
)
// 设置加载动画区域
})
}
function
endLoading
()
{
loading
.
close
()
}
function
showFullScreenLoading
()
{
if
(
needLoadingRequestCount
===
0
)
{
startLoading
()
}
needLoadingRequestCount
++
}
function
hideFullScreenLoading
()
{
if
(
needLoadingRequestCount
<=
0
)
return
needLoadingRequestCount
--
if
(
needLoadingRequestCount
===
0
)
{
endLoading
()
}
}
const
instance
=
axios
.
create
({
const
instance
=
axios
.
create
({
baseURL
:
"
/m
"
,
baseURL
:
"
/m
"
,
//baseURL: process.env.VUE_APP_BASE_API,
//baseURL: process.env.VUE_APP_BASE_API,
...
@@ -24,18 +56,30 @@ const instance = axios.create({
...
@@ -24,18 +56,30 @@ const instance = axios.create({
},
},
],
],
});
});
/**
* 请求拦截器
*/
instance
.
interceptors
.
request
.
use
(
instance
.
interceptors
.
request
.
use
(
(
config
)
=>
{
(
config
)
=>
{
config
.
headers
.
Authorization
=
window
.
sessionStorage
.
getItem
(
"
token
"
)
||
""
;
config
.
headers
.
Authorization
=
window
.
sessionStorage
.
getItem
(
"
token
"
)
||
""
;
if
(
config
.
isLoading
==
true
)
{
// 如果配置了isLoading: false,则不显示loading
showFullScreenLoading
()
}
return
config
;
return
config
;
},
},
(
err
)
=>
{
(
err
)
=>
{
hideFullScreenLoading
()
return
Promise
.
reject
(
err
);
return
Promise
.
reject
(
err
);
}
}
);
);
/**
* 响应拦截器
*/
instance
.
interceptors
.
response
.
use
((
response
)
=>
{
instance
.
interceptors
.
response
.
use
((
response
)
=>
{
hideFullScreenLoading
()
// 响应成功关闭loading
return
response
.
data
;
return
response
.
data
;
},
httpErrorHandler
);
},
httpErrorHandler
);
...
@@ -98,3 +142,5 @@ export function upload(url, option, config = {}) {
...
@@ -98,3 +142,5 @@ export function upload(url, option, config = {}) {
});
});
return
uploadInstance
.
post
(
url
,
formdata
,
config
);
return
uploadInstance
.
post
(
url
,
formdata
,
config
);
}
}
admin/src/assets/utils/httpErrorHandler.js
View file @
a30aec8f
export
default
(
error
)
=>
{
export
default
(
error
)
=>
{
if
(
error
.
message
===
'
自动取消ajax操作
'
)
return
Promise
.
reject
(
error
);
if
(
error
.
message
===
'
自动取消ajax操作
'
)
return
Promise
.
reject
(
error
);
if
(
!
error
.
response
)
{
if
(
!
error
.
response
)
{
console
.
error
(
error
);
console
.
error
(
error
);
...
@@ -50,4 +51,3 @@ export default (error) => {
...
@@ -50,4 +51,3 @@ export default (error) => {
status
,
status
,
});
});
}
}
\ No newline at end of file
admin/src/views/setup/project/list.vue
View file @
a30aec8f
...
@@ -12,9 +12,19 @@
...
@@ -12,9 +12,19 @@
>
导入项目文件包
>
导入项目文件包
</el-button>
</el-button>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
type=
"primary"
class=
"addclass"
size=
"mini"
@
click=
"batchDistribute"
>
批量部署
</el-button>
</LayoutTable>
</LayoutTable>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
...
@@ -42,7 +52,7 @@
...
@@ -42,7 +52,7 @@
将文件拖到此处,或
将文件拖到此处,或
<em>
点击上传
</em>
<em>
点击上传
</em>
</div>
</div>
<div
class=
"el-upload_
_
tip"
style=
"color: red"
slot=
"tip"
>
<div
class=
"el-upload_tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“zip”或“.tar.gz”格式压缩文件!
提示:仅允许导入“zip”或“.tar.gz”格式压缩文件!
</div>
</div>
</el-upload>
</el-upload>
...
@@ -80,7 +90,7 @@
...
@@ -80,7 +90,7 @@
将文件拖到此处,或
将文件拖到此处,或
<em>
点击上传
</em>
<em>
点击上传
</em>
</div>
</div>
<div
class=
"el-upload_
_
tip"
style=
"color: red"
slot=
"tip"
>
<div
class=
"el-upload_tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“zip”或“.tar.gz”格式压缩文件!
提示:仅允许导入“zip”或“.tar.gz”格式压缩文件!
</div>
</div>
</el-upload>
</el-upload>
...
@@ -109,7 +119,6 @@
...
@@ -109,7 +119,6 @@
>
{{
areaName
}}
</el-link
>
{{
areaName
}}
</el-link
>
>
区域编码:
{{
areaCode
}}
)
</span
区域编码:
{{
areaCode
}}
)
</span
>
>
<el-divider></el-divider>
<el-divider></el-divider>
...
@@ -170,16 +179,35 @@
...
@@ -170,16 +179,35 @@
console
.
log
(
res
)
console
.
log
(
res
)
let
reBool
=
res
.
data
.
resource
let
reBool
=
res
.
data
.
resource
let
projectBool
=
res
.
data
.
project
let
projectBool
=
res
.
data
.
project
let
siteCode
=
res
.
data
.
siteCode
if
(
reBool
){
if
(
reBool
){
if
(
projectBool
){
if
(
projectBool
){
console
.
log
(
"
项目部署成功!
"
)
console
.
log
(
"
项目部署成功!
"
)
if
(
!
siteCode
||
siteCode
===
''
||
siteCode
===
'
undefined
'
){
//弹出树页面
this
.
tree
.
open
=
true
;
}
else
{
}
else
{
console
.
log
(
"
弹出项目初始引导页
"
)
}
}
else
{
console
.
log
(
"
初始化基础项目!
"
)
this
.
$post
(
"
/setup/project/projectDataInit
"
,
{},{
isLoading
:
true
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
基础项目应用部署启动成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
//判断是否已经更新站点等信息
}
}
}
else
{
}
else
{
//弹框引导页面
//弹框引导页面
this
.
guide
.
open
=
true
;
this
.
guide
.
open
=
true
;
console
.
log
(
"
弹出
资源
引导页
"
)
console
.
log
(
"
弹出
项目初始
引导页
"
)
}
}
}
}
})
})
...
@@ -188,7 +216,7 @@
...
@@ -188,7 +216,7 @@
});
});
//获取区域树
/*
//获取区域树
this.$get("/base/area/getListByParentId", {
this.$get("/base/area/getListByParentId", {
parentId: "0",
parentId: "0",
})
})
...
@@ -203,7 +231,7 @@
...
@@ -203,7 +231,7 @@
})
})
.catch((error) => {
.catch((error) => {
this.$message.error(error.message);
this.$message.error(error.message);
});
});
*/
},
},
methods
:
{
methods
:
{
...
@@ -215,29 +243,25 @@
...
@@ -215,29 +243,25 @@
},
},
updateSiteConform
()
{
updateSiteConform
()
{
if
(
this
.
areaCode
===
''
||
this
.
areaCode
===
'
undefined
'
){
if
(
this
.
areaCode
===
''
||
this
.
areaCode
===
'
undefined
'
){
this
.
$message
.
error
(
"
请选择需要创建站点的区域!
"
);
this
.
$message
.
error
(
"
请选择需要创建站点的区域!
"
);
return
;
return
;
}
}
if
(
this
.
siteName
===
''
||
this
.
siteName
===
'
undefined
'
){
if
(
this
.
siteName
===
''
||
this
.
siteName
===
'
undefined
'
){
this
.
$message
.
error
(
"
请选择需要创建站点的名称!
"
);
this
.
$message
.
error
(
"
请选择需要创建站点的名称!
"
);
return
;
return
;
}
}
return
;
//todo
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
$post
(
"
/setup/project/site/updateSite
"
,
{
this
.
$post
(
"
/setup/project/site/updateSite
"
,
{
areaCode
:
this
.
areaCode
,
areaCode
:
this
.
areaCode
,
siteName
:
this
.
siteName
,
siteName
:
this
.
siteName
,
})
}
,{
isLoading
:
true
}
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
创建站点成功!
"
);
this
.
$message
.
success
(
"
创建站点成功!
"
);
this
.
getData
();
this
.
tree
.
open
=
false
;
this
.
tree
.
open
=
false
;
//todo
// this.getData();
}
}
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
...
@@ -249,8 +273,8 @@
...
@@ -249,8 +273,8 @@
/** 导入 */
/** 导入 */
handleImport
()
{
handleImport
()
{
this
.
upload
.
title
=
"
项目文件包导入
"
;
this
.
upload
.
title
=
"
项目文件包导入
"
;
//
this.upload.open = true;
this
.
upload
.
open
=
true
;
this
.
tree
.
open
=
true
//
this.tree.open=true
console
.
log
(
this
.
areaData
)
console
.
log
(
this
.
areaData
)
},
},
/** 重写新增方法 */
/** 重写新增方法 */
...
@@ -266,10 +290,10 @@
...
@@ -266,10 +290,10 @@
this
.
$refs
.
drawerform
.
view
(
row
);
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
distribute
(
row
)
{
distribute
(
row
)
{
this
.
$post
(
"
/setup/project/distribute
"
,
row
)
this
.
$post
(
"
/setup/project/distribute
"
,
row
,{
isLoading
:
true
}
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
项目部署成功!
"
);
//
this.$message.success("项目部署成功!");
this
.
getData
();
this
.
getData
();
}
}
})
})
...
@@ -278,11 +302,20 @@
...
@@ -278,11 +302,20 @@
});
});
},
},
dbConnect
(
row
)
{
this
.
$post
(
"
/setup/project/dbConnect
"
,
row
)
batchDistribute
(
row
)
{
if
(
this
.
selection
.
length
==
0
){
this
.
$message
.
error
(
"
请勾选需要部署的项目!
"
);
return
;
}
this
.
$post
(
"
/setup/project/batchDistribute
"
,
{
idList
:
this
.
selection
,
},{
isLoading
:
true
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
数据库连接
成功!
"
);
this
.
$message
.
success
(
"
批量部署
成功!
"
);
this
.
getData
();
this
.
getData
();
}
}
})
})
...
@@ -357,32 +390,7 @@
...
@@ -357,32 +390,7 @@
updateSite
(
row
)
{
updateSite
(
row
)
{
//todo 更新站点区域信息 前提条件 是基础服务与门户服务已经运行
//todo 更新站点区域信息 前提条件 是基础服务与门户服务已经运行
// this.$message.info("更新站点区域信息 前提条件 是基础服务与门户服务已经运行");
// this.$message.info("更新站点区域信息 前提条件 是基础服务与门户服务已经运行");
this
.
tree
.
open
=
true
this
.
$prompt
(
'
请输入站点名称
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
}).
then
(({
value
})
=>
{
let
param
=
{};
param
[
'
siteName
'
]
=
value
;
param
[
'
id
'
]
=
row
.
id
;
this
.
$post
(
"
/setup/project/site/add
"
,
param
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
站点添加成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
}).
catch
(()
=>
{
this
.
$message
({
type
:
'
info
'
,
message
:
'
取消输入
'
});
});
},
},
updateSiteApp
(
row
)
{
updateSiteApp
(
row
)
{
...
@@ -402,22 +410,25 @@
...
@@ -402,22 +410,25 @@
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
this
.
$message
.
error
(
error
.
message
);
});
});
},
},
updateSiteMatter
(
row
)
{
updateSiteMatter
(
row
)
{
this
.
$confirm
(
'
更新站点事项,需要服务器可访问外网?
'
,
'
提示
'
,
{
// this.$message.info("更新站点应用,前提条件需要提交站点id");
this
.
$confirm
(
'
更新站点事项,前提条件需要服务器可访问外网?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
type
:
'
warning
'
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
$message
({
type
:
'
success
'
,
let
param
=
{};
message
:
'
更新成功!
'
param
[
'
id
'
]
=
row
.
id
;
this
.
$post
(
"
/setup/project/matter/update
"
,
param
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
});
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
$message
({
this
.
$message
({
...
@@ -455,6 +466,20 @@
...
@@ -455,6 +466,20 @@
this
.
guide
.
isUploading
=
false
;
this
.
guide
.
isUploading
=
false
;
this
.
$refs
.
guide
.
clearFiles
();
this
.
$refs
.
guide
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
console
.
log
(
"
response
"
,
response
)
//todo进行项目初始化安装
if
(
response
.
code
==
1
){
this
.
$post
(
"
/setup/project/projectDataInit
"
,
{},{
isLoading
:
true
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
基础项目应用部署启动成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
}
},
},
/** 提交上传文件 */
/** 提交上传文件 */
...
@@ -463,7 +488,6 @@
...
@@ -463,7 +488,6 @@
},
},
async
loadNode
(
node
,
resolve
)
{
async
loadNode
(
node
,
resolve
)
{
console
.
log
(
11111111111
,
node
)
if
(
node
.
areaLevel
===
0
)
{
if
(
node
.
areaLevel
===
0
)
{
return
;
return
;
}
}
...
@@ -501,7 +525,7 @@
...
@@ -501,7 +525,7 @@
// 是否禁用上传
// 是否禁用上传
isUploading
:
false
,
isUploading
:
false
,
// 上传的地址
// 上传的地址
url
:
"
/m/setup/project/importProjectData
"
,
url
:
"
/m/setup/project/importProjectData
Init
"
,
},
},
tree
:
{
tree
:
{
// 是否显示弹出层(设备导入)
// 是否显示弹出层(设备导入)
...
@@ -522,8 +546,16 @@
...
@@ -522,8 +546,16 @@
search
:
[
search
:
[
],
],
columns
:
[
columns
:
[
{
type
:
"
selection
"
,
align
:
"
center
"
,
reserveSelection
:
true
,
width
:
60
,
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
所属站点
"
,
prop
:
"
siteName
"
,
width
:
120
},
{
label
:
"
项目产品名称
"
,
prop
:
"
name
"
},
{
label
:
"
项目产品名称
"
,
prop
:
"
name
"
},
{
label
:
"
项目产品编码
"
,
prop
:
"
projectCode
"
},
{
label
:
"
项目产品编码
"
,
prop
:
"
projectCode
"
},
...
@@ -547,7 +579,7 @@
...
@@ -547,7 +579,7 @@
{
label
:
"
项目类型
"
,
prop
:
"
projectType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
项目类型
"
,
prop
:
"
projectType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
项目状态
"
,
prop
:
"
projectStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
项目状态
"
,
prop
:
"
projectStatus
"
,
formatter
:
this
.
formatter
Status
},
{
label
:
"
备注
"
,
width
:
200
,
prop
:
"
remark
"
},
{
label
:
"
备注
"
,
width
:
200
,
prop
:
"
remark
"
},
{
{
...
@@ -577,25 +609,10 @@
...
@@ -577,25 +609,10 @@
>
>
部署
部署
<
/el-button
>
<
/el-button
>
<
span
>
<
/span
>
{
row
.
projectType
===
1
?
(
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-open
"
onClick
=
{()
=>
{
this
.
dbConnect
(
row
);
}}
>
数据库连接
<
/el-button
>
)
:
(
""
)}
<
span
>
<
/span
>
<
span
>
<
/span
>
{
row
.
projectCode
===
'
base-manager
'
?
(
{
row
.
projectCode
===
'
base-manager
'
&&
row
.
projectCode
===
'
base-manager
'
?
(
<
el
-
button
<
el
-
button
size
=
"
mini
"
size
=
"
mini
"
type
=
"
text
"
type
=
"
text
"
...
@@ -629,21 +646,6 @@
...
@@ -629,21 +646,6 @@
<
span
>
<
/span
>
<
span
>
<
/span
>
{
row
.
projectCode
===
'
base-manager
'
?
(
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-open
"
onClick
=
{()
=>
{
this
.
updateSiteApp
(
row
);
}}
>
站点应用部署
<
/el-button
>
)
:
(
""
)}
{
row
.
projectCode
===
'
base-manager
'
?
(
{
row
.
projectCode
===
'
base-manager
'
?
(
<
el
-
button
<
el
-
button
size
=
"
mini
"
size
=
"
mini
"
...
...
admin/vue.config.js
View file @
a30aec8f
...
@@ -39,8 +39,8 @@ module.exports = {
...
@@ -39,8 +39,8 @@ module.exports = {
proxy
:
{
proxy
:
{
"
/m
"
:
{
"
/m
"
:
{
// target: "http://192.168.0.98:11019",
// target: "http://192.168.0.98:11019",
target
:
'
http://127.0.0.1:18000
'
,
//
target: 'http://127.0.0.1:18000',
// target: 'http://192.168.0.98:8081
',
target
:
'
http://192.168.0.250:18000
'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
secure
:
false
secure
:
false
}
}
...
...
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