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
cc2a9e59
authored
Aug 02, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
列表编辑,以及增加子项
parent
63069502
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
105 additions
and
35 deletions
+105
-35
.env.develop
+2
-2
src/App.vue
+1
-1
src/api/cookie.js
+4
-0
src/components/Sticky/index.vue
+1
-1
src/views/device/add.vue
+14
-7
src/views/device/device.vue
+14
-2
src/views/layout/navbar.vue
+1
-1
src/views/login/index.vue
+3
-3
src/views/tempaltes/editMenu.vue
+63
-13
src/views/tempaltes/editMore.vue
+1
-5
src/views/tempaltes/preview.vue
+1
-0
No files found.
.env.develop
View file @
cc2a9e59
NODE_ENV='development'
VUE_APP_BASE_API='http://server.bdideal.com'
\ No newline at end of file
VUE_APP_BASE_API='http://172.16.4.219:8090'
\ No newline at end of file
src/App.vue
View file @
cc2a9e59
...
...
@@ -10,6 +10,7 @@
</div>
</
template
>
<
script
>
// import { getCookie } from '@/api/cookie'
export
default
{
data
()
{
return
{
...
...
@@ -32,7 +33,6 @@ export default {
}
},
created
()
{
// var self = this
if
(
window
.
history
&&
window
.
history
.
pushState
)
{
history
.
pushState
(
null
,
null
,
document
.
URL
)
window
.
addEventListener
(
...
...
src/api/cookie.js
0 → 100644
View file @
cc2a9e59
import
{
get
}
from
'./index'
export
function
getCookie
()
{
return
get
(
'/test/get/cookie'
)
}
src/components/Sticky/index.vue
View file @
cc2a9e59
...
...
@@ -18,7 +18,7 @@ export default {
},
zIndex
:
{
type
:
Number
,
default
:
1
default
:
2
},
className
:
{
type
:
String
,
...
...
src/views/device/add.vue
View file @
cc2a9e59
...
...
@@ -18,7 +18,7 @@
<br
/>
<van-button
class=
"enter-btn"
type=
"info"
@
click=
"addDeviceToPin"
size=
"large"
>
确定
</van-button>
</div>
</van-tab>
-->
</van-tab>
-->
<!--
</van-tabs>
-->
</div>
</
template
>
...
...
@@ -45,24 +45,31 @@ export default {
callback
()
{},
addDeviceToPin
()
{
if
(
!
this
.
pinCode
)
{
this
.
$toast
(
'请输入要添加设备的PIN码'
)
return
this
.
$toast
(
"请输入要添加设备的PIN码"
);
return
;
}
this
.
$dialog
.
confirm
({
this
.
$dialog
.
confirm
({
title
:
"添加设备"
,
message
:
`是否将设备
${
this
.
pinCode
}
添加至我的设备`
})
.
then
(()
=>
{
// on confirm
addDeviceFromPin
(
this
.
pinCode
).
then
(()
=>
{
this
.
$toast
(
'添加成功'
)
this
.
$router
.
back
()
this
.
$toast
(
"添加成功"
);
this
.
$toast
.
loading
({
duration
:
2000
,
mask
:
true
,
message
:
"加载中..."
});
setTimeout
(()
=>
{
this
.
$router
.
back
();
},
2000
);
});
})
.
catch
(()
=>
{
// on cancel
});
}
}
};
...
...
src/views/device/device.vue
View file @
cc2a9e59
...
...
@@ -65,9 +65,14 @@
</template>
<
script
>
import
{
getDeviceList
,
deleteDevice
,
addDeviceFromToken
}
from
"@/api/device.js"
;
import
{
getDeviceList
,
deleteDevice
,
addDeviceFromToken
}
from
"@/api/device.js"
;
import
JSBridge
from
"@/utils/jssdk"
;
import
{
setTimeout
}
from
"timers"
;
export
default
{
name
:
"Films"
,
data
()
{
...
...
@@ -166,7 +171,14 @@ export default {
// on confirm
addDeviceFromToken
(
str
).
then
(()
=>
{
this
.
$toast
(
"添加成功"
);
this
.
onRefresh
()
this
.
$toast
.
loading
({
duration
:
2000
,
mask
:
true
,
message
:
"加载中..."
});
setTimeout
(()
=>
{
this
.
onRefresh
();
},
2000
);
});
})
.
catch
(()
=>
{
...
...
src/views/layout/navbar.vue
View file @
cc2a9e59
<
template
>
<Sticky>
<Sticky
style=
"z-index: 10;"
>
<van-nav-bar
:title=
"title"
:left-arrow=
"typeof leftArrow !== 'undefined' ? true : false"
...
...
src/views/login/index.vue
View file @
cc2a9e59
...
...
@@ -6,8 +6,8 @@
<div
class=
"name"
>
Vmatrix
</div>
<div
class=
"login-content"
>
<van-cell-group>
<van-field
complate
v-model
.
trim=
"loginForm.phone"
left-icon=
"phone-o"
placeholder=
"请输入手机号"
/>
<van-field
v-model
.
trim=
"loginForm.code"
left-icon=
"smile-comment-o"
placeholder=
"请输入验证码"
>
<van-field
type=
"number"
complate
v-model
.
trim=
"loginForm.phone"
left-icon=
"phone-o"
placeholder=
"请输入手机号"
/>
<van-field
type=
"number"
v-model
.
trim=
"loginForm.code"
left-icon=
"smile-comment-o"
placeholder=
"请输入验证码"
>
<span
slot=
"button"
class=
"code"
@
click=
"sendCode"
>
<span
v-if=
"time === 0"
>
获取验证码
</span>
<span
v-else
>
{{
time
}}
s
</span>
...
...
@@ -56,7 +56,7 @@ export default {
this
.
isload
=
false
;
window
.
localStorage
.
setItem
(
"login"
,
JSON
.
stringify
(
this
.
loginForm
));
this
.
$router
.
replace
({
path
:
"/"
path
:
"/
tempaltes
"
});
})
.
catch
(()
=>
{
...
...
src/views/tempaltes/editMenu.vue
View file @
cc2a9e59
...
...
@@ -32,27 +32,36 @@
:key=
"index2"
>
<div
class=
"btn-con"
>
<span>
序号
{{
index2
}}
</span>
<span
class=
"del-btn"
@
click=
"deleteItem(index2, schemaData[item.dataKey])"
>
删除
</span>
<span>
序号
{{
index2
}}
</span>
<span
class=
"del-btn"
@
click=
"deleteItem(index2, schemaData[item.dataKey])"
>
删除
</span>
</div>
<div
class=
"list-item-list"
v-for=
"(item3, index3) in item2"
:key=
"index3"
>
<div
v-if=
"(index3 != 'schemaIndex' && index3 != 'index')"
>
<input
v-if=
"index3 != 'index'"
v-if=
"item.modelSchema[isSchemaIndex(item2)][index3].type === 'text'"
:placeholder=
"item.modelSchema[isSchemaIndex(item2)][index3].description"
class=
"edit-input"
type=
"text"
v-model=
"item2[index3]"
@
keyup=
"valueChange2()"
/>
</div>
</div>
</div>
<div
class=
"create-btn-container"
>
<van-button
class=
"create-btn"
type=
"info"
@
click=
"addItem(item)"
>
添加
</van-button>
</div>
<button
v-if=
"item.type === 'image'"
>
上传
</button>
<button
v-if=
"item.type === 'video'"
>
上传
</button>
</div>
<van-uploader
result-type=
"dataUrl"
v-if=
"item.type == 'image'"
@
click
.
native=
"uploadItem(item.dataKey)"
:after-read=
"uploadAfter"
>
<van-button
icon=
"photo"
type=
"info"
>
上传图片
</van-button>
</van-uploader>
</div>
</van-collapse-item>
</van-collapse>
...
...
@@ -60,6 +69,8 @@
</
template
>
<
script
>
import
{
upload
}
from
"@/api/api"
;
export
default
{
name
:
"editMenu"
,
props
:
{
...
...
@@ -75,7 +86,8 @@ export default {
created
()
{},
data
()
{
return
{
activeName
:
""
activeName
:
""
,
dataKey
:
""
};
},
methods
:
{
...
...
@@ -83,8 +95,46 @@ export default {
console
.
log
(
this
.
schemaData
);
this
.
$emit
(
"setList"
,
this
.
schemaData
);
},
uploadItem
(
key
)
{
alert
(
key
);
this
.
dataKey
=
key
;
},
isSchemaIndex
(
item
)
{
return
item
[
"schemaIndex"
]
?
item
[
"schemaIndex"
]
:
0
;
},
toObj
(
obj
)
{
console
.
log
(
obj
)
return
JSON
.
parse
(
JSON
.
stringify
(
obj
));
},
addItem
(
item
)
{
if
(
item
.
modelSchema
&&
item
.
modelSchema
.
length
===
1
)
{
var
keys
=
Object
.
keys
(
item
.
modelSchema
[
0
]);
var
obj
=
{};
keys
.
map
(
function
(
item
)
{
obj
[
item
]
=
""
;
});
this
.
schemaData
[
item
.
dataKey
].
push
(
obj
);
}
else
{
alert
(
'选择类型添加,敬请期待!'
)
}
console
.
log
(
item
);
},
uploadAfter
(
file
)
{
// console.log(file, upload);
upload
(
file
.
file
)
.
then
(
res
=>
{
console
.
log
(
res
.
data
);
console
.
log
(
this
.
dataKey
);
this
.
schemaData
[
this
.
dataKey
].
value
=
res
.
data
.
data
;
this
.
valueChange2
();
})
.
catch
(
e
=>
{
console
.
log
(
e
);
this
.
$toast
(
"上传失败"
);
});
},
deleteItem
(
index
,
arr
)
{
arr
.
splice
(
index
,
1
)
arr
.
splice
(
index
,
1
)
;
this
.
$emit
(
"setList"
,
this
.
schemaData
);
}
}
...
...
@@ -135,7 +185,7 @@ input {
border
:
none
;
}
.edit-input
{
width
:
9
0
%
;
width
:
9
7
%
;
border
:
1px
solid
#d0d0d0
;
color
:
#333333
;
}
...
...
src/views/tempaltes/editMore.vue
View file @
cc2a9e59
...
...
@@ -289,8 +289,7 @@ export default {
vm
.
isEdited
=
true
;
}
if
(
typeof
e
.
data
===
"object"
&&
e
.
data
[
"type"
]
==
"getList"
)
{
console
.
log
(
e
.
data
.
pages
);
// vm.templateData.listData = e.data.pages;
vm
.
templateData
.
listData
=
e
.
data
.
pages
;
// console.log("12121321321");
}
// var color = e.data;
...
...
@@ -315,11 +314,8 @@ export default {
this
.
show
=
false
;
this
.
pageViews
=
false
;
}
else
{
var
a
=
confirm
(
"确认退出页面"
);
if
(
a
)
{
next
();
}
}
},
mounted
()
{},
methods
:
{
...
...
src/views/tempaltes/preview.vue
View file @
cc2a9e59
...
...
@@ -7,6 +7,7 @@
@
load=
"getData"
class=
"iframe"
v-show=
"loaded"
scrolling=
"no"
:src=
"templateData.frameUrl+'?isPreview=1'"
frameborder=
"0"
></iframe>
...
...
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