Commit 0f7fd213 authored by Mac's avatar Mac

1

parent 5073d754
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
</q-item> </q-item>
</q-list> </q-list>
</q-btn-dropdown> </q-btn-dropdown>
<q-btn push label="视频" /> <q-btn push label="视频" @click="getavideo"/>
<q-btn push label="音频" /> <q-btn push label="音频" />
<q-btn push label="超链接" /> <q-btn push label="超链接" />
<q-btn push label="小程序" /> <q-btn push label="小程序" />
...@@ -95,12 +95,8 @@ ...@@ -95,12 +95,8 @@
<q-input clearable standout="bg-primary text-white" v-model="Name" label="标题" maxlength="64" /> <q-input clearable standout="bg-primary text-white" v-model="Name" label="标题" maxlength="64" />
<q-input clearable standout="bg-primary text-white" v-model="author" label="作者" maxlength="8" <q-input clearable standout="bg-primary text-white" v-model="author" label="作者" maxlength="8"
style="margin-top: 20px;" /> style="margin-top: 20px;" />
<contributionUE :config="config" ref="UE_Title"></contributionUE> <contributionUE :config="config" ref="UE_cb"></contributionUE>
<!-- <template id="app-rich-text">
<div class="app-rich-text">
<textarea style="width: 100%" :id="id"></textarea>
</div>
</template> -->
</div> </div>
...@@ -139,6 +135,19 @@ ...@@ -139,6 +135,19 @@
methods: { methods: {
onItemClick() { onItemClick() {
},
getavideo(){
let datas= {"title":"测试视频文件","description":"","down_url":"http:\/\/203.205.137.159\/vweixinp.tc.qq.com\/1007_07ec2b9f113343d1985494ee31688230.f10.mp4?vkey=526C5946588325C4891A7B7233587BF890ED42DF7CE4A9EB82BBC62938B42CA9F8130A70CC44823A0EDFF57397FEDD256F881D2C7271D83DEE8C880DFEE72892FF1B5171EAA20502369AECC8201160A37CFE16A9D855F34F&sha=0&save=1","newcat":"","newsubcat":"","tags":[],"cover_url":"","vid":"1007_07ec2b9f113343d1985494ee31688230"}
let url = datas.down_url
console.log(url,'1111111')
// url='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/EduSystem/Test/Upload/wechatcatalogue/1629369734000_377.mp4'
url='https://v.qq.com/txp/iframe/player.html?vid=c0870mnzyms'
let data = [{
fileName:datas.title,
fileUrl: url
}]
this.$refs.UE_cb.attachmentSelected2(data)
} }
} }
} }
......
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
var obj = this.getIcon(item.fileName); var obj = this.getIcon(item.fileName);
if (obj.fileType == 4) { if (obj.fileType == 4) {
html += this.audioIframeStr(item); html += this.audioIframeStr(item);
console.log(this.audioIframeStr(item))
} else { } else {
html += this.getIconContent(item); html += this.getIconContent(item);
} }
...@@ -133,6 +134,30 @@ ...@@ -133,6 +134,30 @@
} }
this.attachmentDialogVisible = false; this.attachmentDialogVisible = false;
}, },
attachmentSelected2(fileArray){
if (fileArray && fileArray.length) {
let html = '';
//s视频
fileArray.forEach(item => {
html += '<p style="text-align:center"><iframe frameborder="0" src="' + item.fileUrl + '" allowFullScreen="true" align="center" height="280" width="420"></iframe></p>';
// html += '<p><iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=c0870mnzyms" allowFullScreen="true"></iframe></p>';
// html+= '<video' +
// ' src="' + item.fileUrl + '"' +
// ' width="' + 420 + '"' +
// ' height="' + 280 + '"' +
// ' autoplay' +
// ' controls="controls">'
// '</video>';
})
console.log(html)
if (html && html != '') {
// html.setAttr('style','display:block;margin:0 auto;');
this.ue.execCommand('inserthtml', html);
}
}
},
//获取图标配置内容 //获取图标配置内容
getIconContent(item) { getIconContent(item) {
var iconObj = this.getIcon(item.fileName); var iconObj = this.getIcon(item.fileName);
...@@ -201,11 +226,12 @@ ...@@ -201,11 +226,12 @@
} }
return obj; return obj;
}, },
//音频[MP3] //音频[MP3]
audioIframeStr(data) { audioIframeStr(data) {
var fileUrl = encodeURIComponent(data.fileUrl); var fileUrl = encodeURIComponent(data.fileUrl);
return '<p><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" ' + return '<p><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" ' +
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" ' + ' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;margin-top:20px" scrolling="no" ' +
' src="' + this.ViewDomain + '/index.html?fileName=' + data.fileName + '&url=' + fileUrl + ' src="' + this.ViewDomain + '/index.html?fileName=' + data.fileName + '&url=' + fileUrl +
'" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>'; '" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>';
}, },
...@@ -285,7 +311,6 @@ ...@@ -285,7 +311,6 @@
}); });
this.ue.addListener('contentChange', (editor,e) => { this.ue.addListener('contentChange', (editor,e) => {
this.isInputChange = true; this.isInputChange = true;
console.log(editor,e)
this.$emit('input', this.ue.getContent()); this.$emit('input', this.ue.getContent());
}); });
this.ue.addListener('blur', editor => { this.ue.addListener('blur', editor => {
...@@ -299,8 +324,7 @@ ...@@ -299,8 +324,7 @@
// console.log(this.ue.selection.getStart() ) // console.log(this.ue.selection.getStart() )
}) })
this.ue.addListener('click',(editor,a)=>{ this.ue.addListener('click',(editor,a)=>{
var state = editor.queryCommandState()
console.log(state)
// console.log(editor,a) // console.log(editor,a)
// console.log(this.ue.getContent()) // console.log(this.ue.getContent())
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment