File tree Expand file tree Collapse file tree 6 files changed +23
-39
lines changed Expand file tree Collapse file tree 6 files changed +23
-39
lines changed Original file line number Diff line number Diff line change 46
46
</ style >
47
47
< body >
48
48
< div id ="app "> </ div >
49
+ < div id ="CanvasNest " style ="position:absolute;height:100%;width:100%;z-index:0;top:100px;left:17%;display:block; "> </ div >
49
50
<!-- built files will be auto injected -->
50
51
< div class ="ajax-loading " id ="ajaxLoading " style ="display: none; ">
51
52
< div class ="overlay "> </ div >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ Vue.prototype.$http = axios
11
11
12
12
router . beforeEach ( ( to , from , next ) => {
13
13
const token = sessionStorage . getItem ( 'demo-token' )
14
+ const el = document . querySelector ( '#CanvasNest' )
15
+ if ( to . name !== 'Index' ) {
16
+ el . style . display = 'none'
17
+ } else {
18
+ el . style . display = 'block'
19
+ }
14
20
if ( token !== 'null' && token != null ) {
15
21
Vue . prototype . $http . defaults . headers . common [ 'Authorization' ] = 'Bearer ' + token // 全局设定header的token验证,Bearer后面需要添加个空格
16
22
}
Original file line number Diff line number Diff line change 5
5
<p style =" font-size : 30px ; color :#f3b7b7 ;" >Author: redell</p >
6
6
<p style =" font-size : 30px ;" ><a style =" color :#f3b7b7 ;" href =" https://github.com/GongJS/vue-antd-management" >Github: GongJS</a ></p >
7
7
</div >
8
- <canvas-nest ></canvas-nest >
9
8
</div >
10
9
</template >
11
10
<script >
12
- import CanvasNest from ' @/components/CanvasNest/CanvasNest '
11
+ import CanvasNest from ' canvas-nest.js '
13
12
export default {
14
13
name: ' Index' ,
15
14
components: {
16
15
' canvas-nest' : CanvasNest
17
16
},
18
17
data () {
19
18
return {
19
+ config: {
20
+ count: 99
21
+ }
20
22
}
23
+ },
24
+ mounted () {
25
+ const el = document .querySelector (' #CanvasNest' )
26
+ el .style .display = ' block'
27
+ this .cn = new CanvasNest (el, this .config )
28
+ },
29
+ beforeDestroy () {
30
+ const el = document .querySelector (' #CanvasNest' )
31
+ el .style .display = ' none'
32
+ this .cn .destroy ()
21
33
}
22
34
}
23
35
</script >
Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ export default {
53
53
if (type === ' create' ) {
54
54
this .title = ' 创建员工'
55
55
this .visible = true
56
+ // 因为共用一个Form表单,当用户新建员工时,即使选中了table里面的某一行数据,打开的From表单应该只有默认值,所以这里要清空userInfo;通过selectItem来判断用户有没有选中table的数据
56
57
this .userInfo = null
57
58
} else if (type === ' edit' || type === ' detail' ) {
58
- if (! this .selectItem .id ) {
59
+ if (! this .selectIte .id ) {
59
60
Modal .info ({
60
61
title: ' 信息' ,
61
62
content: ' 请选择一个用户'
Original file line number Diff line number Diff line change @@ -146,7 +146,6 @@ export default {
146
146
if (err) {
147
147
return
148
148
}
149
- console .log (555 , _this .userInfo .id )
150
149
let params = {
151
150
username: values .username ,
152
151
sex: values .sex ,
You can’t perform that action at this time.
0 commit comments