Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
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
黄媛媛
ElectricitySheep
Commits
7ae68605
Commit
7ae68605
authored
Aug 20, 2020
by
Mac
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/huangyuanyuan/electricitysheep
parents
c9c84034
ac549b8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
2 deletions
+103
-2
shareFriend.vue
src/components/Share/shareFriend.vue
+23
-2
choiceMaterial.vue
src/components/common/choiceMaterial.vue
+80
-0
No files found.
src/components/Share/shareFriend.vue
View file @
7ae68605
...
...
@@ -153,6 +153,11 @@
<el-input
type=
"text"
size=
"small"
v-model=
"addMsg.SortNum"
@
keyup
.
native=
"checkInteger(addMsg,'SortNum')"
></el-input>
</el-form-item>
<el-form-item
label=
"分类编号"
>
<el-input
type=
"text"
size=
"small"
v-model=
"addMsg.CateId"
>
<el-button
slot=
"append"
@
click=
"CateDialog=true"
>
选择分类
</el-button>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
...
...
@@ -164,14 +169,24 @@
<el-dialog
title=
"选择文件"
:visible
.
sync=
"imgDialog"
width=
"1240px"
>
<ChooseImg
@
SelectId=
"SelectId"
:IsMultiple=
"true"
></ChooseImg>
</el-dialog>
<!-- 选择分类 -->
<el-dialog
title=
"选择分类"
:visible
.
sync=
"CateDialog"
width=
"600px"
>
<choiceMaterial
ref=
"choiceMater"
></choiceMaterial>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"CateDialog=false"
>
取消
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"getCkedMater"
>
确定
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
ChooseImg
from
"@/components/global/ChooseImg.vue"
;
import
choiceMaterial
from
"@/components/common/choiceMaterial.vue"
;
export
default
{
components
:
{
ChooseImg
ChooseImg
,
choiceMaterial
},
data
()
{
return
{
...
...
@@ -210,6 +225,7 @@
trigger
:
"change"
}]
},
CateDialog
:
false
,
//选择分类弹窗
};
},
methods
:
{
...
...
@@ -404,7 +420,12 @@
delImgArr
(
index
)
{
this
.
addMsg
.
ImgList
.
splice
(
index
,
1
);
},
//选择分类
getCkedMater
(){
var
obj
=
this
.
$refs
.
choiceMater
.
getMaterial
();
this
.
CateDialog
=
false
;
this
.
addMsg
.
CateId
=
obj
.
Id
;
}
},
mounted
()
{
this
.
getList
();
...
...
src/components/common/choiceMaterial.vue
0 → 100644
View file @
7ae68605
<
style
>
.other_Style
{
color
:
#409EFF
;
}
</
style
>
<
template
>
<div>
<el-input
placeholder=
"输入关键字进行过滤"
size=
"small"
style=
"width:99%;margin-bottom:10px;"
v-model=
"filterText"
>
</el-input>
<el-tree
:data=
"dataList"
node-key=
"Id"
ref=
"tree"
:props=
"defaultProps"
filter
:filter-node-method=
"filterNode"
@
check=
"handleCheck"
:check-strictly=
"true"
show-checkbox
:check-on-click-node=
"true"
>
<span
class=
"custom-tree-node"
slot-scope=
"
{ node, data }">
<span
:class=
"
{'other_Style':data.children
&&
data.children.length>0}">
{{
data
.
Name
}}
</span>
</span>
</el-tree>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
dataList
:
[],
activeName
:
"1"
,
filterText
:
''
,
msg
:
{
Name
:
""
,
//页面名称
pageIndex
:
1
,
pageSize
:
10
,
},
defaultProps
:
{
children
:
'children'
,
label
:
'Name'
},
checkedObj
:
{}
};
},
created
()
{},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
.
trim
());
}
},
methods
:
{
//获取所有菜单
getList
()
{
this
.
apipost
(
"/api/Share/GetShareCategoryList"
,
this
.
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
var
dataArray
=
res
.
data
.
data
;
this
.
dataList
=
dataArray
;
console
.
log
(
this
.
dataList
,
'dataList'
);
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
})
},
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
Name
.
indexOf
(
value
)
!==
-
1
;
},
//check单选
handleCheck
(
a
,
b
)
{
//a为传递给 data 属性的数组中该节点所对应的对象;b为树目前的选中状态对象
if
(
b
.
checkedKeys
.
length
>
0
)
{
this
.
$refs
.
tree
.
setCheckedKeys
([
a
.
Id
]);
this
.
checkedObj
=
a
;
}
},
//父组件调用方法
getMaterial
(){
return
this
.
checkedObj
;
},
},
mounted
()
{
this
.
getList
();
}
};
</
script
>
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