Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
61ab6382
Commit
61ab6382
authored
Oct 15, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统模板vuex化
parent
e6ef3384
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
17 deletions
+59
-17
Index.ts
src/mixins/Index.ts
+2
-1
index.ts
src/store/index.ts
+4
-11
proof.ts
src/store/modules/proof.ts
+23
-0
template.ts
src/store/modules/template.ts
+29
-0
Index-cs.vue
src/views/index/Index-cs.vue
+0
-1
Index-sy.vue
src/views/index/Index-sy.vue
+0
-1
SelectTemplate.vue
src/views/template/components/SelectTemplate.vue
+1
-3
No files found.
src/mixins/Index.ts
View file @
61ab6382
...
@@ -2,6 +2,7 @@ import { Component, Vue } from 'vue-property-decorator';
...
@@ -2,6 +2,7 @@ import { Component, Vue } from 'vue-property-decorator';
import
{
State
,
Action
}
from
'vuex-class'
;
import
{
State
,
Action
}
from
'vuex-class'
;
@
Component
@
Component
export
default
class
Index
extends
Vue
{
export
default
class
Index
extends
Vue
{
@
State
(
'sysTemplateList'
,
{
namespace
:
'template'
})
protected
systemList
!
:
[];
protected
ActionList
:
any
=
{
protected
ActionList
:
any
=
{
rename
:
{
rename
:
{
key
:
'rename'
,
key
:
'rename'
,
...
@@ -16,7 +17,7 @@ export default class Index extends Vue {
...
@@ -16,7 +17,7 @@ export default class Index extends Vue {
callback
:
this
.
delFolder
,
callback
:
this
.
delFolder
,
},
},
};
};
@
Action
(
'getSysTemplateList'
)
private
getSysTemplateList
!
:
()
=>
void
;
@
Action
(
'getSysTemplateList'
,
{
namespace
:
'template'
}
)
private
getSysTemplateList
!
:
()
=>
void
;
protected
mounted
()
{
protected
mounted
()
{
this
.
getSysTemplateList
();
this
.
getSysTemplateList
();
}
}
...
...
src/store/index.ts
View file @
61ab6382
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
Vuex
from
'vuex'
;
import
Vuex
from
'vuex'
;
Vue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
import
{
proof
}
from
'./modules/proof'
;
import
{
template
}
from
'./modules/template'
;
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
state
:
{
state
:
{
isLogin
:
false
,
isLogin
:
false
,
...
@@ -14,7 +16,6 @@ export default new Vuex.Store({
...
@@ -14,7 +16,6 @@ export default new Vuex.Store({
authInfo
:
{},
// 个人认证信息
authInfo
:
{},
// 个人认证信息
companyAuthInfo
:
{},
// 企业认证信息
companyAuthInfo
:
{},
// 企业认证信息
proofCount
:
0
,
proofCount
:
0
,
sysTemplateList
:
[],
},
},
getters
:
{
getters
:
{
isPhone
(
{
userInfo
})
{
isPhone
(
{
userInfo
})
{
...
@@ -49,9 +50,6 @@ export default new Vuex.Store({
...
@@ -49,9 +50,6 @@ export default new Vuex.Store({
updateProofCount
(
state
:
any
,
payload
:
any
)
{
updateProofCount
(
state
:
any
,
payload
:
any
)
{
state
.
proofCount
=
payload
;
state
.
proofCount
=
payload
;
},
},
updateSysTemplateList
(
state
:
any
,
payload
:
any
)
{
state
.
sysTemplateList
=
payload
||
[];
},
},
},
actions
:
{
actions
:
{
getUserInfo
({
commit
})
{
getUserInfo
({
commit
})
{
...
@@ -91,14 +89,9 @@ export default new Vuex.Store({
...
@@ -91,14 +89,9 @@ export default new Vuex.Store({
commit
(
'updateCompanyAuthInfo'
,
res
);
commit
(
'updateCompanyAuthInfo'
,
res
);
});
});
},
},
getSysTemplateList
({
commit
,
state
})
{
if
(
state
.
sysTemplateList
.
length
<=
0
)
{
Vue
.
prototype
.
$api
.
template
.
systemList
().
then
(({
results
=
[]})
=>
{
commit
(
'updateSysTemplateList'
,
results
||
[]);
});
}
},
},
},
modules
:
{
modules
:
{
proof
,
template
,
},
},
});
});
src/store/modules/proof.ts
0 → 100644
View file @
61ab6382
import
Vue
from
'vue'
;
const
$api
=
Vue
.
prototype
.
$api
;
const
state
=
{
};
const
getters
=
{
};
const
mutations
=
{
};
const
actions
=
{
getProofList
()
{
$api
.
list
();
},
};
const
namespaced
:
boolean
=
true
;
export
const
proof
=
{
namespaced
,
state
,
getters
,
mutations
,
actions
,
};
src/store/modules/template.ts
0 → 100644
View file @
61ab6382
import
Vue
from
'vue'
;
const
state
=
{
sysTemplateList
:
[]
=
[],
};
const
getters
=
{
};
const
mutations
=
{
updateSysTemplateList
(
state
:
any
,
payload
:
any
)
{
state
.
sysTemplateList
=
payload
||
[];
},
};
const
actions
=
{
getSysTemplateList
({
commit
,
state
}:
any
)
{
if
(
state
.
sysTemplateList
.
length
<=
0
)
{
Vue
.
prototype
.
$api
.
template
.
systemList
().
then
(({
results
=
[]})
=>
{
commit
(
'updateSysTemplateList'
,
results
||
[]);
});
}
},
};
const
namespaced
:
boolean
=
true
;
export
const
template
=
{
namespaced
,
state
,
getters
,
mutations
,
actions
,
};
src/views/index/Index-cs.vue
View file @
61ab6382
...
@@ -29,7 +29,6 @@ import IndexMixin from '@/mixins/Index';
...
@@ -29,7 +29,6 @@ import IndexMixin from '@/mixins/Index';
},
},
})
})
export
default
class
IndexCs
extends
Mixins
(
IndexMixin
)
{
export
default
class
IndexCs
extends
Mixins
(
IndexMixin
)
{
@
State
(
'sysTemplateList'
)
private
systemList
!
:
[];
private
charityType
:
any
[]
=
[];
private
charityType
:
any
[]
=
[];
@
Watch
(
'systemList'
,
{
immediate
:
true
,
deep
:
true
})
@
Watch
(
'systemList'
,
{
immediate
:
true
,
deep
:
true
})
private
async
onChange
(
newVal
:
any
[],
oldVal
:
any
[])
{
private
async
onChange
(
newVal
:
any
[],
oldVal
:
any
[])
{
...
...
src/views/index/Index-sy.vue
View file @
61ab6382
...
@@ -81,7 +81,6 @@ export default class IndexSy extends Mixins(IndexMixin) {
...
@@ -81,7 +81,6 @@ export default class IndexSy extends Mixins(IndexMixin) {
@
Inject
(
'APP-NAME'
)
private
APP_NAME
!
:
string
;
@
Inject
(
'APP-NAME'
)
private
APP_NAME
!
:
string
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
State
(
'sysTemplateList'
)
private
systemList
!
:
[];
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
private
list
:
any
[]
=
[];
private
list
:
any
[]
=
[];
private
currentFolder
:
object
=
{};
private
currentFolder
:
object
=
{};
...
...
src/views/template/components/SelectTemplate.vue
View file @
61ab6382
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
<van-tabs
v-model=
"active"
>
<van-tabs
v-model=
"active"
>
<van-tab
title=
"系统模板"
>
<van-tab
title=
"系统模板"
>
<div
<div
v-for=
"(folder,index) in system
Folder
List"
v-for=
"(folder,index) in systemList"
:key=
"index"
:key=
"index"
class=
"item"
class=
"item"
@
click=
"selectFolder(folder)"
>
@
click=
"selectFolder(folder)"
>
...
@@ -129,8 +129,6 @@ import PreviewTemplate from './PreviewTemplate.vue';
...
@@ -129,8 +129,6 @@ import PreviewTemplate from './PreviewTemplate.vue';
export
default
class
SelectTemplate
extends
Mixins
(
IndexMixin
)
{
export
default
class
SelectTemplate
extends
Mixins
(
IndexMixin
)
{
@
Inject
(
'isSy'
)
private
isSy
!
:
boolean
;
@
Inject
(
'isSy'
)
private
isSy
!
:
boolean
;
private
active
:
number
=
0
;
private
active
:
number
=
0
;
@
State
(
'sysTemplateList'
)
private
systemFolderList
!
:
[];
private
userFolderList
:
any
[]
=
[];
private
userFolderList
:
any
[]
=
[];
private
currentFolder
:
any
=
{};
private
currentFolder
:
any
=
{};
private
currentTemplate
:
any
=
{};
private
currentTemplate
:
any
=
{};
...
...
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