Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
d2298748
提交
d2298748
编写于
6月 23, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
裁剪问题等
上级
e464163b
变更
11
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
5116 行增加
和
86 行删除
+5116
-86
index.html
index.html
+1
-0
cropper.two copy.vue
src/components/common/cropper.two copy.vue
+138
-0
cropper.two.vue
src/components/common/cropper.two.vue
+5
-5
edit-course-dialog copy 10.vue
.../education/custom-resource/edit-course-dialog copy 10.vue
+1224
-0
edit-course-dialog copy 11.vue
.../education/custom-resource/edit-course-dialog copy 11.vue
+1223
-0
edit-course-dialog copy 8.vue
...s/education/custom-resource/edit-course-dialog copy 8.vue
+1194
-0
edit-course-dialog copy 9.vue
...s/education/custom-resource/edit-course-dialog copy 9.vue
+1196
-0
edit-course-dialog.vue
...mponents/education/custom-resource/edit-course-dialog.vue
+117
-74
global.scss
src/style/global.scss
+6
-0
fetch.js
src/utils/fetch.js
+1
-1
ossUtil.js
src/utils/oss/ossUtil.js
+11
-6
未找到文件。
index.html
浏览文件 @
d2298748
...
...
@@ -20,5 +20,6 @@
<script
src=
"https://unpkg.com/qiniu-js@2.2.0/dist/qiniu.min.js"
></script>
<script
src=
"https://cdn.bootcss.com/downloadjs/1.4.8/download.min.js"
></script>
<script
src=
"https://pv.sohu.com/cityjson?ie=utf-8"
></script>
<script
src=
"https://gosspublic.alicdn.com/aliyun-oss-sdk-5.1.1.min.js"
></script>
</body>
</html>
src/components/common/cropper.two copy.vue
0 → 100755
浏览文件 @
d2298748
<
template
>
<div
class=
"rc-cropper"
v-if=
"originImg"
>
<el-row>
<el-col
:span=
"12"
>
<div
class=
"rc-cropper__canvasCrop2"
>
<img
:src=
"originImg"
v-if=
"!cropper"
>
<canvas
:id=
"originImg"
ref=
"canvas"
/>
<div
class=
"rc-cropper__iconCrop"
>
<el-tooltip
content=
"确认裁剪"
placement=
"right"
v-if=
"cropper"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"sureCropper()"
><i
class=
"el-icon-check"
></i></el-button>
</el-tooltip>
</div>
</div>
</el-col>
<el-col
:span=
"10"
>
<div
class=
"rc-cropper__previewImg"
>
<img
:src=
"previewImg"
id=
"previewImg"
/>
</div>
</el-col>
</el-row>
</div>
</
template
>
<
script
>
import
Cropper
from
'cropperjs'
import
'cropperjs/dist/cropper.min.css'
export
default
{
name
:
'rc-cropper2'
,
props
:
{
cropOption
:
{
type
:
Object
,
required
:
true
,
default
:
()
=>
{}
},
originImg
:
{
required
:
true
},
previewImg
:
{
type
:
String
}
},
data
()
{
return
{
cropper
:
null
,
croppShow
:
false
}
},
mounted
()
{
this
.
drawImg
()
},
methods
:
{
// 在canvas上绘制图片
drawImg
()
{
const
_this
=
this
this
.
$nextTick
(()
=>
{
let
canvas
=
document
.
getElementById
(
this
.
originImg
)
if
(
canvas
)
{
canvas
.
width
=
720
canvas
.
height
=
480
let
ctx
=
canvas
.
getContext
(
'2d'
)
ctx
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
let
img
=
new
Image
()
img
.
crossOrigin
=
'Anonymous'
img
.
src
=
this
.
originImg
img
.
onload
=
function
()
{
ctx
.
drawImage
(
img
,
0
,
0
,
canvas
.
width
,
canvas
.
height
)
_this
.
initCropper
()
}
}
})
},
// 显示裁剪框
initCropper
()
{
this
.
croppShow
=
true
this
.
cropper
=
new
Cropper
(
this
.
$refs
.
canvas
,
{
checkCrossOrigin
:
true
,
viewMode
:
3
,
zoomOnWheel
:
false
,
// 是否可以通过移动鼠标来放大图像
aspectRatio
:
3
/
2
,
ready
:
()
=>
{
this
.
cropper
.
setData
({
x
:
this
.
cropOption
.
offset_x
,
y
:
this
.
cropOption
.
offset_y
,
width
:
this
.
cropOption
.
width
,
height
:
this
.
cropOption
.
height
})
}
})
// this.cropper = cropper
},
// 确认裁剪
sureCropper
()
{
let
_this
=
this
const
cropParam
=
this
.
cropper
.
getData
()
this
.
cropper
.
getCroppedCanvas
().
toBlob
(
function
(
blob
)
{
let
oFileReader
=
new
FileReader
()
oFileReader
.
onloadend
=
function
(
e
)
{
let
base64
=
e
.
target
.
result
_this
.
$emit
(
'getCropImg'
,
base64
,
cropParam
)
}
oFileReader
.
readAsDataURL
(
blob
)
},
'image/jpeg'
)
}
}
}
</
script
>
<
style
>
.rc-cropper
{
position
:
relative
;
margin-top
:
20px
;
}
/* img {
width: 100%;
height: 100%;
} */
.rc-cropper__canvasCrop2
{
width
:
720px
;
height
:
480px
;
}
.rc-cropper__iconCrop
{
position
:
absolute
;
left
:
45%
;
top
:
0%
;
}
.el-tooltip
{
margin
:
20px
4px
;
display
:
block
;
z-index
:
10000
;
}
.rc-cropper__previewImg
{
width
:
600px
;
height
:
400px
;
}
</
style
>
src/components/common/cropper.two.vue
浏览文件 @
d2298748
<
template
>
<div
class=
"rc-cropper"
v-if=
"originImg"
>
<el-row>
<el-col
:span=
"12"
>
<el-col>
<div
class=
"rc-cropper__canvasCrop2"
>
<img
:src=
"originImg"
v-if=
"!cropper"
>
<canvas
:id=
"originImg"
ref=
"canvas"
/>
...
...
@@ -12,11 +12,11 @@
</div>
</div>
</el-col>
<el-col
:span=
"10"
>
<
!--
<
el-col
:span=
"10"
>
<div
class=
"rc-cropper__previewImg"
>
<img
:src=
"previewImg"
id=
"previewImg"
/>
</div>
</el-col>
</el-col>
-->
</el-row>
</div>
</
template
>
...
...
@@ -115,8 +115,8 @@ export default {
} */
.rc-cropper__canvasCrop2
{
width
:
72
0px
;
height
:
48
0px
;
width
:
90
0px
;
height
:
76
0px
;
}
.rc-cropper__iconCrop
{
...
...
src/components/education/custom-resource/edit-course-dialog copy 10.vue
0 → 100644
浏览文件 @
d2298748
此差异已折叠。
点击以展开。
src/components/education/custom-resource/edit-course-dialog copy 11.vue
0 → 100644
浏览文件 @
d2298748
此差异已折叠。
点击以展开。
src/components/education/custom-resource/edit-course-dialog copy 8.vue
0 → 100644
浏览文件 @
d2298748
此差异已折叠。
点击以展开。
src/components/education/custom-resource/edit-course-dialog copy 9.vue
0 → 100644
浏览文件 @
d2298748
此差异已折叠。
点击以展开。
src/components/education/custom-resource/edit-course-dialog.vue
浏览文件 @
d2298748
此差异已折叠。
点击以展开。
src/style/global.scss
浏览文件 @
d2298748
...
...
@@ -189,4 +189,10 @@
}
}
}
.el-cascader
.el-input
.el-input__inner
:focus
,
.el-cascader
.el-input.is-focus
.el-input__inner
{
border-color
:
#449284
!
important
;
}
.el-input__inner
:focus
,
.el-textarea__inner
:focus
{
border-color
:
#449284
!
important
;
}
src/utils/fetch.js
浏览文件 @
d2298748
...
...
@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
}
if
(
process
.
env
.
BUILD_ENV
==
"development"
){
// 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
config
.
headers
[
'token'
]
=
'3
77D063C4A8448B2847E05074648E77F
'
;
config
.
headers
[
'token'
]
=
'3
F5F01DF814C46E59FF09F3E63A55D18
'
;
// config.headers['token'] = localStorage.getItem('storageToken')
}
else
{
config
.
headers
[
'token'
]
=
localStorage
.
getItem
(
'storageToken'
)
...
...
src/utils/oss/ossUtil.js
浏览文件 @
d2298748
...
...
@@ -12,8 +12,13 @@ contentTypeMap.set("xlsx", "application/vnd.openxmlformats-officedocument.spread
// PICA_DEV_APP.service('ossUtil', function ($rootScope, $q) {
//获取OSS客户端
let
bucketName
=
localStorage
.
getItem
(
"bucketName"
);
let
endpoint
=
localStorage
.
getItem
(
"endpoint"
);
// let bucketName = localStorage.getItem("bucketName");
// let endpoint = localStorage.getItem("endpoint");
let
bucketName
=
'pica-test-huabei2'
;
let
endpoint
=
'oss-cn-beijing.aliyuncs.com'
;
console
.
log
(
bucketName
,
endpoint
);
// //上传状态
// let status = false;
...
...
@@ -34,8 +39,8 @@ const doOSSAction = () => {
//sts服务器
// let stsUrl = localStorage.getItem("stsUrl") + "/" + localStorage.getItem("token");
// let stsUrl = 'https://dev-api.yunqueyi.com/middle/oss/token/' + localStorage.getItem("token");
// let stsUrl = 'https://dev-api.yunqueyi.com/middle/oss/token/377D063C4A8448B2847E05074648E77F
'
let
stsUrl
=
'https://dev-api.yunqueyi.com/middle/oss/token/'
+
localStorage
.
getItem
(
"token"
);
let
stsUrl
=
'https://dev-api.yunqueyi.com/middle/oss/token/D1AA498C1C1C4298B712B3678EF9BD07
'
//
let stsUrl = 'https://dev-api.yunqueyi.com/middle/oss/token/' + localStorage.getItem("token");
return
new
Promise
(
function
(
resolve
,
reject
)
{
fetch
(
stsUrl
,
{},
'GET'
).
then
(
function
(
result
)
{
...
...
@@ -53,11 +58,11 @@ const doOSSAction = () => {
console
.
log
(
'STS临时授权成功'
);
}
else
{
reject
(
result
);
console
.
error
(
'STS临时授权失败:'
,
result
);
console
.
error
(
'STS临时授权失败
222
:'
,
result
);
}
}).
catch
(
function
(
error
)
{
reject
();
console
.
error
(
'STS临时授权失败:'
,
error
);
console
.
error
(
'STS临时授权失败
111
:'
,
error
);
});
});
};
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录