Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center-ui
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center-ui
Commits
25312e45
Commit
25312e45
authored
Mar 18, 2020
by
张宸
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6b463d17
15d232ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
63 deletions
+79
-63
src/views/poster/PosterList.vue
+74
-60
src/views/poster/newPoster.vue
+5
-3
No files found.
src/views/poster/PosterList.vue
View file @
25312e45
<
template
>
<
template
>
<div
class=
"flex-container"
>
<div
class=
"flex-container"
>
<!-- <!– 查询区域 –>
<div
class=
"table-page-search-wrapper"
>
<a-upload
action=
"https://www.mocky.io/v2/5cc8019d300000980a055e76"
listType=
"picture"
@
change=
"transformFile"
:beforeUpload=
"beforeUpload"
:showUploadList=
"false"
>
<a-button>
<a-icon
type=
"upload"
/>
上传图片
</a-button>
</a-upload>
-->
<a-upload
action=
"https://www.mocky.io/v2/5cc8019d300000980a055e76"
:beforeUpload=
"transformFile"
>
<a-button>
<a-icon
type=
"upload"
/>
上传图片
</a-button>
</a-upload>
<div
class=
"table-page-search-wrapper"
>
<!-- 搜索区域 -->
<!-- 搜索区域 -->
<a-form
layout=
"inline"
>
<a-row
:gutter=
"24"
>
<a-col
:md=
"4"
:sm=
"12"
>
<a-form-item
label=
"是否启用:"
>
<a-select
v-model=
"queryParam.enable"
style=
"width: 120px"
>
<a-select-option
value
>
全部
</a-select-option>
<a-select-option
value=
"0"
>
不启用
</a-select-option>
<a-select-option
value=
"1"
>
启用
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:md=
"4"
:sm=
"12"
>
<a-button
@
click=
"search()"
type=
"primary"
>
查询
</a-button>
<a-divider
type=
"vertical"
/>
<a-upload
action=
"https://www.mocky.io/v2/5cc8019d300000980a055e76"
:beforeUpload=
"uploadPicture"
>
<a-button>
<a-icon
type=
"upload"
/>
上传图片
</a-button>
</a-upload>
</a-col>
</a-row>
</a-form>
</div>
</div>
<new-poster
ref=
"model1"
></new-poster>
<new-poster
ref=
"model1"
></new-poster>
...
@@ -30,24 +34,25 @@
...
@@ -30,24 +34,25 @@
{{
text
|
dayjs
}}
{{
text
|
dayjs
}}
</
template
>
</
template
>
<
template
slot=
"picture"
slot-scope=
"text"
>
<
template
slot=
"picture"
slot-scope=
"text"
>
<img
src=
""
>
<!--
<img
:src=
"text"
>
-->
<img
style=
"height: 50px"
src=
"http://yrym.winsun-aly.com/gdtel-xyzx-hhr/images/yrym-ruanyan-logo.png"
>
</
template
>
</
template
>
<
template
slot=
"enable"
slot-scope=
"text"
>
<
template
slot=
"enable"
slot-scope=
"text"
>
<span
v-if=
"text == 0"
>
不启用
</span>
<span
v-if=
"text == 0"
>
不启用
</span>
<span
v-if=
"text == 1"
>
启用
</span>
<span
v-if=
"text == 1"
>
启用
</span>
</
template
>
</
template
>
<
template
slot=
"operation"
slot-scope=
"text"
>
<
template
slot=
"operation"
slot-scope=
"text, record"
>
<!--
<a-form
layout=
"inline"
>
<a-row
:gutter=
"24"
>
<span
class=
"table-page-search-submitButtons"
style=
"float: left; overflow: hidden;"
>
<a-col
:md=
"6"
:sm=
"24"
>
<a-button
@
click=
"addPoster()"
type=
"primary"
>
新建海报
</a-button>
</a-col>
</span>
</a-row>
</a-form>
-->
<span>
<span>
<a
@
click=
"addPoster()"
>
新建海报
</a>
<a
@
click=
"addPoster(record.picture)"
>
新建海报
</a>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"remove(record.id)"
>
<a>
删除
</a>
</a-popconfirm>
<a-divider
type=
"vertical"
/>
<a
v-show=
"record.enable == '0'"
@
click=
"updateEnable(record.id,'1')"
>
启用
</a>
<a
v-show=
"record.enable == '1'"
@
click=
"updateEnable(record.id,'0')"
>
不启用
</a>
</span>
</span>
</
template
>
</
template
>
</s-table>
</s-table>
...
@@ -60,8 +65,8 @@
...
@@ -60,8 +65,8 @@
<
script
>
<
script
>
import
STable
from
'@/components/table'
;
import
STable
from
'@/components/table'
;
import
{
university
List
,
university
Delete
,
universityInsert
,
universityUpdate
}
from
"@/api/school-center/productAPI"
import
{
universityDelete
,
universityInsert
,
universityUpdate
}
from
"@/api/school-center/productAPI"
import
{
uploadPictur
e
}
from
"@/api/school-center/qrCode"
import
{
listPicture
,
uploadPicture
,
deletePicture
,
updateEnabl
e
}
from
"@/api/school-center/qrCode"
import
{
cloneObject
}
from
'@/utils/util'
;
import
{
cloneObject
}
from
'@/utils/util'
;
import
newPoster
from
'./newPoster'
import
newPoster
from
'./newPoster'
function
getBase64
(
img
,
callback
)
{
function
getBase64
(
img
,
callback
)
{
...
@@ -82,8 +87,7 @@
...
@@ -82,8 +87,7 @@
modifyvisible
:
false
,
modifyvisible
:
false
,
add
:
true
,
add
:
true
,
queryParam
:
{
queryParam
:
{
universityName
:
''
,
//学校
enable
:
''
,
//是否启用
universityRegion
:
''
,
// 区域
},
},
modelData
:{
modelData
:{
universityName
:
''
,
universityName
:
''
,
...
@@ -103,8 +107,8 @@
...
@@ -103,8 +107,8 @@
},
},
columns
:
[
columns
:
[
{
dataIndex
:
'picture'
,
title
:
'图片 '
,
scopedSlots
:
{
customRender
:
'picture'
}},
{
dataIndex
:
'picture'
,
title
:
'图片 '
,
scopedSlots
:
{
customRender
:
'picture'
}},
{
dataIndex
:
'createTime'
,
width
:
1
5
0
,
title
:
'创建时间 '
,
scopedSlots
:
{
customRender
:
'createTime'
}},
{
dataIndex
:
'createTime'
,
width
:
1
0
0
,
title
:
'创建时间 '
,
scopedSlots
:
{
customRender
:
'createTime'
}},
{
dataIndex
:
'enable'
,
width
:
50
,
title
:
'
是否启用
'
,
scopedSlots
:
{
customRender
:
'enable'
}},
{
dataIndex
:
'enable'
,
width
:
50
,
title
:
'
启用状态
'
,
scopedSlots
:
{
customRender
:
'enable'
}},
{
{
dataIndex
:
'operation'
,
dataIndex
:
'operation'
,
width
:
100
,
width
:
100
,
...
@@ -116,11 +120,10 @@
...
@@ -116,11 +120,10 @@
rowdata
:
parameter
=>
{
rowdata
:
parameter
=>
{
let
params
=
{
let
params
=
{
pageNo
:
parameter
.
pageNo
,
pageNo
:
parameter
.
pageNo
,
pageSize
:
parameter
.
pageSize
pageSize
:
parameter
.
pageSize
,
enable
:
this
.
queryParam
.
enable
}
}
let
obj
=
cloneObject
(
this
.
queryParam
)
return
listPicture
(
params
).
then
(
res
=>
{
//表示
return
universityList
(
Object
.
assign
(
params
,
obj
)).
then
(
res
=>
{
let
data
=
{}
let
data
=
{}
if
(
res
.
state
!==
'success'
)
{
if
(
res
.
state
!==
'success'
)
{
data
=
{
data
=
{
...
@@ -143,7 +146,7 @@
...
@@ -143,7 +146,7 @@
}
}
},
},
methods
:{
methods
:{
transformFil
e
(
file
)
{
uploadPictur
e
(
file
)
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
const
reader
=
new
FileReader
();
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
readAsDataURL
(
file
);
...
@@ -162,12 +165,12 @@
...
@@ -162,12 +165,12 @@
ctx
.
fillRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
ctx
.
fillRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
ctx
.
drawImage
(
img
,
0
,
0
,
width
,
height
)
ctx
.
drawImage
(
img
,
0
,
0
,
width
,
height
)
const
picture
=
canvas
.
toDataURL
(
'image/jpeg'
)
const
picture
=
canvas
.
toDataURL
(
'image/jpeg'
)
console
.
log
(
picture
)
return
uploadPicture
({
picture
}).
then
(
res
=>
{
return
uploadPicture
({
picture
}).
then
(
res
=>
{
if
(
res
.
state
==
'error'
){
if
(
res
==
'error'
){
this
.
$message
.
error
(
res
.
msg
,
5
);
this
.
$message
.
error
(
'删除失败!'
,
5
);
}
}
if
(
res
.
state
==
'success'
){
if
(
res
.
state
==
'success'
){
this
.
search
()
this
.
$message
.
success
(
res
.
data
,
5
);
this
.
$message
.
success
(
res
.
data
,
5
);
}
}
})
})
...
@@ -175,31 +178,42 @@
...
@@ -175,31 +178,42 @@
};
};
});
});
},
},
addPoster
(){
addPoster
(
picture
){
this
.
$refs
.
model1
.
showModal
();
picture
=
'http://yrym.winsun-aly.com/gdtel-xyzx-hhr/images/yrym-ruanyan-logo.png'
this
.
$refs
.
model1
.
showModal
(
picture
);
},
},
search
()
{
search
()
{
this
.
$refs
.
table
.
refresh
({
search
:
true
})
this
.
$refs
.
table
.
refresh
({
search
:
true
})
},
},
uploadPicture
(){
remove
(
id
)
{
deletePicture
(
id
).
then
((
res
)
=>
{
if
(
res
.
state
==
"success"
){
this
.
$notification
.
success
({
message
:
res
.
data
,
description
:
''
,
duration
:
4
})
this
.
search
()
}
if
(
res
.
state
==
"error"
){
this
.
$notification
.
error
({
message
:
res
.
msg
,
description
:
''
,
duration
:
4
})
}
})
},
},
beforeUpload
(
file
)
{
updateEnable
(
id
,
enable
)
{
updateEnable
(
id
,{
enable
}).
then
((
res
)
=>
{
if
(
res
.
state
==
"success"
){
this
.
$notification
.
success
({
message
:
res
.
data
,
description
:
''
,
duration
:
4
})
this
.
search
()
}
if
(
res
.
state
==
"error"
){
this
.
$notification
.
error
({
message
:
res
.
msg
,
description
:
''
,
duration
:
4
})
}
})
},
},
remove
(
id
)
{
universityDelete
(
id
).
then
((
res
)
=>
{
if
(
res
.
state
==
"success"
){
this
.
$notification
.
success
({
message
:
res
.
data
,
description
:
''
,
duration
:
4
})
}
this
.
$refs
.
table
.
refresh
({
search
:
true
})
})
},
modifyfunction
(
data
){
modifyfunction
(
data
){
if
(
data
!=
undefined
){
if
(
data
!=
undefined
){
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
src/views/poster/newPoster.vue
View file @
25312e45
...
@@ -12,10 +12,10 @@
...
@@ -12,10 +12,10 @@
<div
class=
"meun-box"
>
<div
class=
"meun-box"
>
<a-row>
<a-row>
<a-col
:span=
"6"
>
<a-col
:span=
"6"
>
<div
class=
"select-btn"
>
<!--
<div
class=
"select-btn"
>
<span>
选择图片
</span>
<span>
选择图片
</span>
<input
ref=
"selectImgae"
class=
"seletImg"
type=
"file"
@
change=
"selectImage"
/>
<input
ref=
"selectImgae"
class=
"seletImg"
type=
"file"
@
change=
"selectImage"
/>
</div>
</div>
-->
<a-button
@
click=
"toImage"
v-if=
"images != ''"
>
生成图片
</a-button>
<a-button
@
click=
"toImage"
v-if=
"images != ''"
>
生成图片
</a-button>
</a-col>
</a-col>
<a-col
:span=
"6"
v-if=
"images!=''"
>
<a-col
:span=
"6"
v-if=
"images!=''"
>
...
@@ -50,7 +50,8 @@ export default {
...
@@ -50,7 +50,8 @@ export default {
};
};
},
},
methods
:
{
methods
:
{
showModal
()
{
showModal
(
picture
)
{
this
.
images
=
picture
this
.
visible
=
true
;
this
.
visible
=
true
;
},
},
onClose
()
{
onClose
()
{
...
@@ -64,6 +65,7 @@ export default {
...
@@ -64,6 +65,7 @@ export default {
var
reader
=
new
FileReader
();
var
reader
=
new
FileReader
();
reader
.
onload
=
evt
=>
{
reader
.
onload
=
evt
=>
{
let
result
=
evt
.
target
.
result
;
let
result
=
evt
.
target
.
result
;
debugger
this
.
images
=
result
;
this
.
images
=
result
;
};
};
reader
.
readAsDataURL
(
file
.
files
[
0
]);
reader
.
readAsDataURL
(
file
.
files
[
0
]);
...
...
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