Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
eb77f52a
Commit
eb77f52a
authored
May 12, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok
parent
532b240f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
176 additions
and
40 deletions
+176
-40
error.vue
layouts/error.vue
+8
-8
resource.vue
pages/test/resource.vue
+124
-32
treeNode.vue
pages/test/treeNode.vue
+44
-0
No files found.
layouts/error.vue
View file @
eb77f52a
...
@@ -10,14 +10,14 @@
...
@@ -10,14 +10,14 @@
export
default
{
export
default
{
props
:
[
'error'
],
props
:
[
'error'
],
// layout: 'blog' // you can set a custom layout for the error page
// layout: 'blog' // you can set a custom layout for the error page
//
watch:{
watch
:{
//
error(v){
error
(
v
){
//
debugger;
debugger
;
//
if(v.statusCode==404){
if
(
v
.
statusCode
==
404
){
//
this.$router.push("/error/404");
this
.
$router
.
push
(
"/error/404"
);
//
}
}
//
}
}
//
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
pages/test/resource.vue
View file @
eb77f52a
<
template
>
<
template
>
<div>
<div>
<ResourceSelect
v-model=
"model"
@
on-change=
"change"
></ResourceSelect>
<ResourceSelect
v-model=
"model"
@
on-change=
"change"
></ResourceSelect>
<p>
{{
model
}}
</p>
<p>
{{
model
}}
</p>
<p>
{{
text
}}
</p>
<p>
{{
text
}}
</p>
<Button
@
click=
"set"
>
赋值
</Button>
<Button
@
click=
"set"
>
赋值
</Button>
<ProductSelect
v-model=
"product"
@
on-change=
"pchange"
></ProductSelect>
<ProductSelect
v-model=
"product"
@
on-change=
"pchange"
></ProductSelect>
<p>
{{
product
}}
</p>
<p>
{{
product
}}
</p>
<Button
@
click=
"setp"
>
赋值
</Button>
<Button
@
click=
"setp"
>
赋值
</Button>
</div>
<p>
<TreeNode
:data=
"result"
></TreeNode>
</p>
<p>
<Tree
:data=
"result"
></Tree>
</p>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
ResourceSelect
from
"@/components/page/resourceSelect"
import
ResourceSelect
from
"@/components/page/resourceSelect"
;
export
default
{
import
TreeNode
from
"./treeNode"
;
components
:{
ResourceSelect
},
export
default
{
name
:
''
,
components
:
{
TreeNode
},
data
()
{
name
:
""
,
return
{
data
()
{
model
:[],
return
{
text
:
""
,
model
:
[],
product
:
""
,
result
:
[
{
title
:
"五二九纵"
,
id
:
41
,
expand
:
false
,
selected
:
false
,
checked
:
false
,
upId
:
0
,
rootId
:
0
,
children
:
[
{
title
:
"气源分配器壳体"
,
id
:
82
,
expand
:
false
,
selected
:
false
,
checked
:
false
,
upId
:
0
,
rootId
:
0
,
children
:
[
{
title
:
"truio"
,
id
:
83
,
expand
:
false
,
selected
:
false
,
checked
:
false
,
upId
:
82
,
rootId
:
0
,
children
:
[],
isProduct
:
1
,
productId
:
83
,
classType
:
0
,
drawingNo
:
"34567"
},
{
title
:
"北京吉普"
,
id
:
84
,
expand
:
false
,
selected
:
false
,
checked
:
false
,
upId
:
82
,
rootId
:
0
,
children
:
[],
isProduct
:
1
,
productId
:
84
,
classType
:
0
,
drawingNo
:
"BJJP-0001"
}
],
isProduct
:
1
,
productId
:
82
,
classType
:
41
,
drawingNo
:
"TY9-06-0803"
}
}
],
isProduct
:
0
,
productId
:
0
,
classType
:
0
},
},
methods
:{
{
change
(
v
,
items
){
title
:
"北京汽车"
,
this
.
text
=
items
.
map
(
u
=>
u
.
label
).
join
(
'/'
);
id
:
45
,
},
expand
:
false
,
set
(){
selected
:
false
,
this
.
model
=
[
"1"
,
5
];
checked
:
false
,
},
upId
:
0
,
pchange
(
v
,
item
){
rootId
:
0
,
// this.text=items.map(u=>u.label).join('/');
children
:
[
if
(
item
.
isProduct
==
0
){
{
this
.
$Message
.
error
(
"层级不能选择"
)
title
:
"北京吉普"
,
this
.
product
=
""
id
:
85
,
expand
:
false
,
selected
:
false
,
checked
:
false
,
upId
:
0
,
rootId
:
0
,
children
:
[],
isProduct
:
1
,
productId
:
85
,
classType
:
45
,
drawingNo
:
"BJJP-0001"
}
}
}
,
]
,
setp
(){
isProduct
:
0
,
this
.
prodcut
=
8
;
productId
:
0
,
},
classType
:
0
}
}
],
text
:
""
,
product
:
""
};
},
methods
:
{
change
(
v
,
items
)
{
this
.
text
=
items
.
map
(
u
=>
u
.
label
).
join
(
"/"
);
},
set
()
{
this
.
model
=
[
"1"
,
5
];
},
pchange
(
v
,
item
)
{
// this.text=items.map(u=>u.label).join('/');
if
(
item
.
isProduct
==
0
)
{
this
.
$Message
.
error
(
"层级不能选择"
);
this
.
product
=
""
;
}
},
setp
()
{
this
.
prodcut
=
8
;
}
}
}
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
</
style
>
</
style
>
\ No newline at end of file
pages/test/treeNode.vue
0 → 100644
View file @
eb77f52a
<
template
>
<ul
class=
"treeNode"
>
<li
v-for=
"(li,i) in list"
:key=
"i"
>
<span>
{{
li
.
title
}}
</span>
<treeNode
v-if=
"li.children&&li.children.length>0"
:data=
"li.children"
></treeNode>
</li>
</ul>
</
template
>
<
script
>
export
default
{
name
:
"treeNode"
,
props
:
{
data
:
{
type
:
Array
,
default
:
()
=>
{
return
[];
}
}
},
data
()
{
return
{
list
:
[]
};
},
created
()
{
this
.
list
=
this
.
data
;
}
};
</
script
>
<
style
lang=
"less"
>
.treeNode {
li {
line-height: 35px;
span:hover {
background-color: royalblue;
}
}
li > ul {
padding-left: 20px;
}
}
</
style
>
\ No newline at end of file
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