Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5c83f92f
authored
Nov 19, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加默认数据的解析
parent
0a332225
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
18 deletions
+128
-18
src/views/tempaltes/editMenu.vue
+41
-9
src/views/tempaltes/selectData.vue
+87
-9
No files found.
src/views/tempaltes/editMenu.vue
View file @
5c83f92f
...
@@ -26,7 +26,12 @@
...
@@ -26,7 +26,12 @@
/>
/>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label
v-if=
"item.enableDisplay"
>
<label
v-if=
"item.enableDisplay"
>
<input
type=
"checkbox"
style=
"display: inline;"
v-model=
"schemaData[item.dataKey].visbility"
@
change=
"checkboxChange"
/>
是否隐藏
<input
type=
"checkbox"
style=
"display: inline;"
v-model=
"schemaData[item.dataKey].visbility"
@
change=
"checkboxChange"
/>
是否隐藏
</label>
</label>
</div>
</div>
<input
<input
...
@@ -80,7 +85,10 @@
...
@@ -80,7 +85,10 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"create-btn-container"
v-if=
"!item.listLimit || (item.listLimit && schemaData[item.dataKey].length
<
!
item
.
listLimit
)"
>
<div
class=
"create-btn-container"
v-if=
"!item.listLimit || (item.listLimit && schemaData[item.dataKey].length
<
!
item
.
listLimit
)"
>
<van-button
class=
"create-btn"
type=
"info"
@
click=
"addItem(item)"
>
添加
</van-button>
<van-button
class=
"create-btn"
type=
"info"
@
click=
"addItem(item)"
>
添加
</van-button>
</div>
</div>
</div>
</div>
...
@@ -92,18 +100,20 @@
...
@@ -92,18 +100,20 @@
:after-read=
"uploadAfter"
:after-read=
"uploadAfter"
>
>
<van-button
icon=
"photo"
type=
"info"
>
上传
</van-button>
<van-button
icon=
"photo"
type=
"info"
>
上传
</van-button>
<br>
<br
/
>
</van-uploader>
</van-uploader>
<van-button
type=
"info"
v-if=
"
!item.selectList"
@
click=
"setSelectData(item
)"
>
选择默认数据
</van-button>
<van-button
type=
"info"
v-if=
"
item.selectList && item.type !== 'list'"
@
click=
"setSelectData(item, index
)"
>
选择默认数据
</van-button>
</div>
</div>
</van-collapse-item>
</van-collapse-item>
</van-collapse>
</van-collapse>
<selectDataCom
:selectList=
"selectData"
@
changeSelcetData=
"changeSelcetData"
v-if=
"selectData.show"
></selectDataCom>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
upload
}
from
"@/api/api"
;
import
{
upload
}
from
"@/api/api"
;
import
{
getHostUrl
}
from
"@/utils/index"
;
import
{
getHostUrl
}
from
"@/utils/index"
;
import
selectDataCom
from
"./selectData"
;
export
default
{
export
default
{
name
:
"editMenu"
,
name
:
"editMenu"
,
props
:
{
props
:
{
...
@@ -120,6 +130,9 @@ export default {
...
@@ -120,6 +130,9 @@ export default {
default
:
()
=>
{}
default
:
()
=>
{}
}
}
},
},
components
:
{
selectDataCom
},
created
()
{
created
()
{
console
.
log
(
this
.
schemaData
);
console
.
log
(
this
.
schemaData
);
},
},
...
@@ -129,7 +142,9 @@ export default {
...
@@ -129,7 +142,9 @@ export default {
dataKey
:
""
,
dataKey
:
""
,
listIndex
:
""
,
listIndex
:
""
,
itemKey
:
""
,
itemKey
:
""
,
selectData
:{}
selectData
:
{
show
:
false
}
};
};
},
},
methods
:
{
methods
:
{
...
@@ -148,7 +163,7 @@ export default {
...
@@ -148,7 +163,7 @@ export default {
console
.
log
(
key
,
index
,
itemKey
,
"dsadadsa"
);
console
.
log
(
key
,
index
,
itemKey
,
"dsadadsa"
);
},
},
isSchemaIndex
(
item
)
{
isSchemaIndex
(
item
)
{
console
.
log
(
item
);
//
console.log(item);
return
item
[
"schemaIndex"
]
?
item
[
"schemaIndex"
]
:
0
;
return
item
[
"schemaIndex"
]
?
item
[
"schemaIndex"
]
:
0
;
},
},
toObj
(
obj
)
{
toObj
(
obj
)
{
...
@@ -194,7 +209,7 @@ export default {
...
@@ -194,7 +209,7 @@ export default {
});
});
},
},
checkboxChange
(
value
)
{
checkboxChange
(
value
)
{
console
.
log
(
this
.
schemaData
,
value
)
console
.
log
(
this
.
schemaData
,
value
);
},
},
setSchemaData
(
value
)
{
setSchemaData
(
value
)
{
this
.
schemaData
[
this
.
dataKey
].
value
=
value
;
this
.
schemaData
[
this
.
dataKey
].
value
=
value
;
...
@@ -209,8 +224,25 @@ export default {
...
@@ -209,8 +224,25 @@ export default {
arr
.
splice
(
index
,
1
);
arr
.
splice
(
index
,
1
);
this
.
$emit
(
"setList"
,
this
.
schemaData
);
this
.
$emit
(
"setList"
,
this
.
schemaData
);
},
},
setSelectData
(
item
)
{
setSelectData
(
item
,
index
)
{
this
.
selectData
=
item
const
myItem
=
JSON
.
parse
(
JSON
.
stringify
(
item
))
this
.
selectData
.
show
=
true
;
this
.
selectData
.
item
=
myItem
;
this
.
selectData
.
index
=
index
;
this
.
selectData
.
item
.
selectList
=
[
"http://pic27.nipic.com/20130313/9252150_092049419327_2.jpg"
,
"http://pic27.nipic.com/20130313/9252150_092049419327_2.jpg"
,
"http://pic27.nipic.com/20130313/9252150_092049419327_2.jpg"
,
"http://pic27.nipic.com/20130313/9252150_092049419327_2.jpg"
];
console
.
log
(
this
.
selectData
)
},
changeSelcetData
(
data
)
{
console
.
log
(
data
);
this
.
dataKey
=
data
.
item
.
dataKey
this
.
setSchemaData
(
data
.
val
)
this
.
selectData
.
show
=
false
}
}
}
}
};
};
...
...
src/views/tempaltes/selectData.vue
View file @
5c83f92f
<
template
>
<
template
>
<div>
<div
v-if=
"selectList.item && selectList.show"
>
adsdsa
<van-popup
v-model=
"selectList.show"
position=
"bottom"
:style=
"
{ height: '300px' }"
v-if="selectList.item"
>
<div
class=
"select-container"
v-if=
"selectList.item.type === 'image'"
>
<img
class=
"selectImage"
v-for=
"(image, index) in selectList.item.selectList"
:key=
"index"
:src=
"image"
alt
@
click=
"ItemClick(image)"
/>
</div>
<div
class=
"select-container"
v-if=
"selectList.item.type === 'video'"
>
<video
class=
"selectVideo"
v-for=
"(image, index) in selectList.item.selectList"
:key=
"index"
:src=
"image"
alt
@
click=
"ItemClick(image)"
></video>
</div>
<div
class=
"select-container"
v-if=
"selectList.item.type === 'text'"
>
<div
class=
"selectText"
v-for=
"(image, index) in selectList.item.selectList"
:key=
"index"
:src=
"image"
@
click=
"ItemClick(image)"
>
{{
image
}}
</div>
</div>
</van-popup>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
show
:
false
};
},
created
()
{
// console.log(this.selectList);
},
methods
:
{
ItemClick
(
val
)
{
this
.
$emit
(
'changeSelcetData'
,
{
val
,
index
:
this
.
selectList
.
index
,
item
:
this
.
selectList
.
item
}
)
}
}
},
},
props
:
[
'selectList'
],
props
:
[
"selectList"
],
watch
:
{
}
selectList
:
function
(
val
)
{
console
.
log
(
val
);
}
}
};
</
script
>
</
script
>
<
style
lang=
"scc"
scoped
>
<
style
lang=
"scss"
scoped
>
.select-container
{
//
overflow
:
hidden
;
height
:
100%
;
overflow-y
:
auto
;
box-sizing
:
border-box
;
width
:
100%
;
padding
:
20px
;
//
display
:
flex
;
.selectImage
{
display
:
inline-block
;
//
height
:
calc
(
100%
-
20px
);
width
:
100%
;
margin-bottom
:
30px
;
}
.selectVideo
{
display
:
inline-block
;
//
height
:
calc
(
100%
-
20px
);
width
:
100%
;
margin-bottom
:
30px
;
}
.selectText
{
display
:
block
;
word-break
:
break-all
;
//
height
:
calc
(
100%
-
20px
);
width
:
100%
;
margin-bottom
:
30px
;
}
}
</
style
>
</
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