Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhouqian
vue-gjjs
Commits
878ed045
Commit
878ed045
authored
Jun 01, 2021
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
f703822e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
111 additions
and
26 deletions
+111
-26
BusinessButton.vue
src/components/BusinessButton.vue
+26
-12
main.js
src/main.js
+1
-1
commonApi.js
src/mixin/commonApi.js
+47
-0
commonDeclare.js
src/mixin/commonDeclare.js
+17
-0
commonProcess.js
src/mixin/commonProcess.js
+3
-1
Api.js
src/service/Api.js
+9
-6
index.vue
src/views/Business/Ditopn/index.vue
+7
-5
webpack.config.js
webpack.config.js
+1
-1
No files found.
src/components/BusinessButton.vue
View file @
878ed045
<
template
>
<div
class=
"bus-button"
>
<c-button
type=
"primary"
v-onclick=
"save"
>
提交
</c-button>
<c-button
type=
"primary"
v-onclick=
"pedding"
>
暂存
</c-button>
<c-button
type=
"primary"
v-onclick=
"check"
>
校核
</c-button>
<c-button
v-onclick=
"exit"
>
退出
</c-button>
<c-button
type=
"primary"
v-on
:
click=
"save"
>
提交
</c-button>
<c-button
type=
"primary"
v-on
:
click=
"pedding"
>
暂存
</c-button>
<c-button
type=
"primary"
v-on
:
click=
"check"
>
校核
</c-button>
<c-button
v-on
:
click=
"exit"
>
退出
</c-button>
</div>
</
template
>
<
script
>
import
commonApi
from
"~/mixin/commonApi"
export
default
{
props
:[
"
parent
"
],
props
:[
"
$pntvm
"
],
data
(){
return
{
}
},
methods
:{
save
(){
async
save
(){
console
.
log
(
123
)
let
vm
=
this
.
getVM
();
let
result
=
await
vm
.
save
()
console
.
log
(
result
)
},
pedding
(){
async
pedding
(){
let
result
=
await
this
.
getVM
().
pedding
()
console
.
log
(
result
)
},
check
(){
async
check
(){
let
result
=
await
this
.
getVM
().
checkAll
()
if
(
result
.
respCode
!=
SUCCESS
)
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
result
.
respMsg
});
}
},
exit
(){
this
.
$history
.
push
(
"/home"
)
},
getVM
(){
return
this
.
$pntvm
}
}
}
...
...
src/main.js
View file @
878ed045
...
...
@@ -13,7 +13,7 @@ import store from "./store"
import
CustomComponent
from
"./components"
import
VueFunc
from
"./utils/vuefunc"
window
.
SUCCESS
=
"
00000
"
window
.
SUCCESS
=
"
AAAAAA
"
Vue
.
use
(
ElementUI
)
Vue
.
use
(
CustomComponent
)
...
...
src/mixin/commonApi.js
0 → 100644
View file @
878ed045
import
Api
from
"~/service/Api"
import
Utils
from
"../utils"
export
default
{
data
(){
return
{}
},
methods
:{
init
(
params
){
params
=
params
||
{}
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/init"
,{
params
})
},
save
(
params
){
params
=
params
||
{}
let
data
=
Utils
.
flatObject
(
this
.
model
)
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/saveData"
,{...
data
,
params
})
},
exeuteCheck
(
rulePath
,
params
){
params
=
params
||
{}
let
data
=
Utils
.
flatObject
(
this
.
model
)
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeCheck/"
+
rulePath
,{...
data
,
params
})
},
executeDefault
(
rulePath
,
params
)
{
params
=
params
||
{}
let
data
=
Utils
.
flatObject
(
this
.
model
)
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/default/"
+
rulePath
,{...
data
,
params
})
},
executeRule
(
rulePath
,
params
)
{
params
=
params
||
{}
let
data
=
Utils
.
flatObject
(
this
.
model
)
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeRule/"
+
rulePath
,{...
data
,
params
})
},
checkAll
(
params
){
params
=
params
||
{}
let
data
=
Utils
.
flatObject
(
this
.
model
)
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/checkAll"
,{...
data
,
params
})
},
pedding
(
params
){
params
=
params
||
{}
let
data
=
Utils
.
flatObject
(
this
.
model
)
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/pending"
,{...
data
,
params
})
}
}
}
\ No newline at end of file
src/mixin/commonDeclare.js
0 → 100644
View file @
878ed045
export
default
{
data
(){
return
{
version
:
"1.0"
,
trnName
:
""
,
}
},
computed
:{
declareParams
(){
return
{
version
:
this
.
version
,
trnName
:
this
.
trnName
,
}
}
}
}
\ No newline at end of file
src/mixin/commonProcess.js
View file @
878ed045
import
commonDeclare
from
"./commonDeclare"
import
commonApi
from
"./commonApi"
export
default
{
mixins
:
[],
mixins
:
[
commonApi
,
commonDeclare
],
data
:
function
()
{
return
{
}
...
...
src/service/Api.js
View file @
878ed045
...
...
@@ -10,6 +10,9 @@ const instance = axios.create({
method
:
'post'
,
});
const
CODE_KEY
=
"respCode"
const
MESSAGE_KEY
=
"respMsg"
export
default
class
Api
{
static
pget
(
url
,
data
)
...
...
@@ -72,11 +75,11 @@ export default class Api
})
.
then
(
response
=>
{
const
{
data
}
=
response
;
if
(
data
&&
data
.
code
!=
SUCCESS
)
if
(
data
&&
data
[
CODE_KEY
]
!=
SUCCESS
)
{
console
.
log
(
"错误码:"
+
data
.
code
+
" 错误信息:"
+
data
.
message
)
console
.
log
(
"错误码:"
+
data
[
CODE_KEY
]
+
" 错误信息:"
+
data
[
MESSAGE_KEY
]
)
}
if
(
data
&&
data
.
code
==
'L0003'
){
if
(
data
&&
data
[
CODE_KEY
]
==
'L0003'
){
window
.
sessionStorage
.
removeItem
(
"token"
)
window
.
sessionStorage
.
removeItem
(
"userId"
)
MessageBox
.
alert
({
...
...
@@ -98,17 +101,17 @@ export default class Api
console
.
log
(
error
.
response
.
data
);
console
.
log
(
error
.
response
.
status
);
console
.
log
(
error
.
response
.
headers
);
resolve
({
retcod
:
'500'
,
retmsg
:
error
.
response
.
status
});
resolve
({
[
CODE_KEY
]:
'500'
,[
MESSAGE_KEY
]
:
error
.
response
.
status
});
}
else
if
(
error
.
request
)
{
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console
.
log
(
error
.
request
);
resolve
({
retcod
:
'501'
});
resolve
({
[
CODE_KEY
]
:
'501'
});
}
else
{
// Something happened in setting up the request that triggered an Error
console
.
log
(
'Error'
,
error
.
message
);
resolve
({
retcod
:
'502'
,
retmsg
:
error
.
message
});
resolve
({
[
CODE_KEY
]:
'502'
,[
MESSAGE_KEY
]
:
error
.
message
});
}
console
.
log
(
error
.
config
);
});
...
...
src/views/Business/Ditopn/index.vue
View file @
878ed045
...
...
@@ -85,13 +85,14 @@
</el-tabs>
<c-bus-button></c-bus-button>
<c-bus-button
:
$
pntvm=
"this"
></c-bus-button>
</el-form>
</div>
</c-page>
</
template
>
<
script
>
import
Api
from
"~/service/Api"
import
Utils
from
"~/utils/index"
import
CodeTable
from
"~/config/CodeTable"
import
Ditopn
from
"~/model/Ditopn"
import
CommonProcess
from
"~/mixin/CommonProcess"
...
...
@@ -142,6 +143,7 @@ export default {
},
data
(){
return
{
trnName
:
"ditopn"
,
model
:
new
Ditopn
().
data
,
checkRules
:
Check
,
defaultRules
:
Default
,
...
...
@@ -164,11 +166,11 @@ export default {
},
created
:
async
function
(){
console
.
log
(
"进入ditopn交易"
);
let
rtnmsg
=
await
Api
.
post
(
"ditopn/init"
,{
params
:{}}
)
if
(
rtnmsg
.
re
tcod
==
SUCCESS
)
let
rtnmsg
=
await
this
.
init
(
)
if
(
rtnmsg
.
re
spCode
==
SUCCESS
)
{
//TODO 处理数据逻辑
//更新数据
Utils
.
copyValueFromVO
(
this
.
model
,
rtnmsg
.
data
)
}
else
{
...
...
webpack.config.js
View file @
878ed045
...
...
@@ -59,7 +59,7 @@ module.exports = (options = {}) => ({
port
:
8010
,
proxy
:
{
'/gjjs/'
:
{
target
:
'http://127.0.0.1:80
70
'
,
target
:
'http://127.0.0.1:80
81
'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/gjjs'
:
'/gjjs'
...
...
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