Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saas-manage
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
chehuidong
saas-manage
Commits
2859c83b
Commit
2859c83b
authored
Aug 20, 2024
by
hanxuehong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 应用版本管理接口联调
parent
0eaf30c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
31 deletions
+114
-31
src/common/api/production/assistantManage.js
+14
-2
src/views/production/AssistantManage.vue
+97
-26
vue.config.js
+3
-3
No files found.
src/common/api/production/assistantManage.js
View file @
2859c83b
// api/erpProductionAssistantManage/uploadToLocal
import
axios
from
'../axios'
export
function
erpProductionAssistantManage
(
data
)
{
return
axios
.
post
(
'/erpProductionAssistantManage/uploadToLocal'
,
data
)
return
axios
.
post
(
'/erpProductionAssistantManage/uploadToLocal'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
export
function
erpProductionAssistantManageListPage
(
data
)
{
return
axios
.
post
(
'/erpProductionAssistantManage/list_page'
,
data
)
}
export
function
deleteErpProductionAssistantManage
(
data
)
{
return
axios
.
get
(
'/erpProductionAssistantManage/delete?ids='
+
data
)
}
\ No newline at end of file
src/views/production/AssistantManage.vue
View file @
2859c83b
...
...
@@ -28,7 +28,18 @@
:sourceData='sourceData'
>
</table-view>
</div>
<div
class=
"pagination"
>
<el-pagination
layout=
"sizes, total, prev, pager, next, jumper"
background
:total=
"total"
:page-size=
"pageSize"
:current-page=
"currentPage"
@
size-change=
"sizeChange"
@
current-change=
"onCurrentChange"
>
</el-pagination>
</div>
<el-dialog
title=
"新增"
:visible
.
sync=
'dialogVisible'
...
...
@@ -60,14 +71,14 @@
</el-radio-group>
</el-form-item>
<!-- 上传多个app文件 -->
<el-form-item
class=
"title_width"
label=
"上传文件"
>
<el-form-item
label=
"上传文件"
>
<!-- accept=".apk,.ipa" -->
<el-upload
action
:http-request=
"handleCustom"
:on-change=
"handleChange"
:on-remove=
"handleRemove"
:
auto-upload=
"false
"
:
before-upload=
"beforeUpload
"
:file-list=
"fileList"
list-type=
"text"
>
...
...
@@ -97,7 +108,7 @@
</
template
>
<
script
>
import
tableView
from
'@/common/components/base/tableView.vue'
import
{
erpProductionAssistantManage
}
from
'../../common/api/production/assistantManage'
import
{
erpProductionAssistantManage
,
erpProductionAssistantManageListPage
,
deleteErpProductionAssistantManage
}
from
'../../common/api/production/assistantManage'
export
default
{
name
:
'saasMenu'
,
...
...
@@ -141,7 +152,10 @@ export default {
content
:
[
{
required
:
true
,
message
:
'请输入更新内容'
,
trigger
:
'blur'
},
],
}
},
total
:
1
,
currentPage
:
1
,
pageSize
:
10
,
}
},
computed
:
{
...
...
@@ -199,9 +213,50 @@ export default {
]
},
},
mounted
()
{
created
()
{
this
.
getProductionAssistantList
()
},
methods
:
{
async
getProductionAssistantList
()
{
this
.
loading
=
true
try
{
const
{
data
:
erpProductionAssistantManageRes
,
code
}
=
await
erpProductionAssistantManageListPage
({
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
})
if
(
code
===
200
)
{
console
.
log
(
'erpProductionAssistantManageRes:>>'
,
erpProductionAssistantManageRes
)
this
.
sourceData
=
erpProductionAssistantManageRes
.
records
this
.
total
=
erpProductionAssistantManageRes
.
total
}
}
catch
(
error
)
{
console
.
log
(
'error:>>'
,
error
)
}
finally
{
this
.
loading
=
false
}
},
async
deleteProductionAssistant
(
ids
)
{
const
deleteProductionRes
=
await
deleteErpProductionAssistantManage
(
ids
)
if
(
deleteProductionRes
.
code
===
200
)
{
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
,
})
setTimeout
(()
=>
{
this
.
getProductionAssistantList
()
},
1000
)
}
},
formFile
(
fileList
,
reset
)
{
const
formData
=
new
FormData
()
fileList
.
forEach
(
file
=>
{
formData
.
append
(
'fileList'
,
file
.
raw
)
})
for
(
const
key
in
reset
)
{
formData
.
append
(
key
,
reset
[
key
])
}
return
formData
},
showDialog
()
{
this
.
dialogVisible
=
true
},
...
...
@@ -223,30 +278,33 @@ export default {
this
.
resetForm
()
this
.
dialogVisible
=
false
},
async
submit
()
{
submit
()
{
// 验证表单
this
.
$refs
.
editForm
.
validate
(
valid
=>
{
this
.
$refs
.
editForm
.
validate
(
async
valid
=>
{
if
(
valid
)
{
// 提交表单
console
.
log
(
'验证表单:>>> '
,
this
.
editForm
,
'
\
n上传的文件列表:>>> '
,
this
.
fileList
)
if
(
this
.
fileList
?.
length
===
0
)
{
return
this
.
$message
({
type
:
'warning'
,
message
:
'请上传文件!'
,
})
}
const
productionAssistantParams
=
{
...
this
.
editForm
,
fileList
:
this
.
fileList
const
productionAssistantParams
=
this
.
formFile
(
this
.
fileList
,
{
...
this
.
editForm
,
businessType
:
'production_assistant'
})
try
{
const
res
=
await
erpProductionAssistantManage
(
productionAssistantParams
)
console
.
log
(
'提交表单:>>> '
,
res
,
'
\
nproductionAssistantParams:>>'
,
productionAssistantParams
)
if
(
res
.
code
===
200
)
{
this
.
$message
({
type
:
'success'
,
message
:
'保存成功!'
,
})
this
.
resetForm
()
this
.
getProductionAssistantList
()
this
.
dialogVisible
=
false
}
}
catch
(
error
)
{
console
.
log
(
'error:>>'
,
error
)
}
const
res
=
erpProductionAssistantManage
(
productionAssistantParams
)
console
.
log
(
'提交表单:>>> '
,
res
)
this
.
$message
({
type
:
'success'
,
message
:
'保存成功!'
,
})
// this.resetForm()
// this.dialogVisible = false
}
})
},
...
...
@@ -260,12 +318,7 @@ export default {
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
// 删除的相关操作
this
.
sourceData
=
this
.
sourceData
.
filter
(
item
=>
item
.
id
!==
id
)
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
,
})
this
.
deleteProductionAssistant
(
id
)
})
},
handleCustom
(
file
)
{
...
...
@@ -277,9 +330,25 @@ export default {
handleChange
(
file
,
fileList
)
{
this
.
fileList
=
fileList
},
beforeUpload
(
file
)
{
const
isLt2M
=
file
.
size
/
1024
/
1024
<
50
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传文件大小不能超过 50MB!'
)
return
false
}
return
isLt2M
},
handleRemove
(
file
,
fileList
)
{
this
.
fileList
=
fileList
},
sizeChange
(
pageSize
)
{
this
.
pageSize
=
pageSize
this
.
getProductionAssistantList
()
},
onCurrentChange
(
currentPage
)
{
this
.
currentPage
=
currentPage
this
.
getProductionAssistantList
()
},
},
}
</
script
>
...
...
@@ -298,7 +367,9 @@ export default {
}
}
.table-wrap
{
background
:
#fff
;
flex
:
1
;
overflow
:
hidden
;
}
.system-menu
:deep
()
.el-form-item__content
{
...
...
vue.config.js
View file @
2859c83b
...
...
@@ -8,9 +8,9 @@ module.exports = defineConfig({
'/api'
:
{
target
:
'http://10.168.31.188:8096'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/api'
:
''
,
},
//
pathRewrite: {
//
'^/api': '',
//
},
},
},
},
...
...
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