Commit 1af97f8c authored by 李维's avatar 李维

feat: 完成

parent c71b356e
No preview for this file type
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import { asyncDelay, onHomeworkFinish } from "../script/util_dpe_audio_editor";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_dpe_audio_editor";
const { ccclass, property } = cc._decorator;
......
import { defaultData } from "../script/defaultData";
import { defaultData } from "../script/defaultData_dpe_audio_editor";
export class MyCocosSceneComponent extends cc.Component {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(s,i),t.JsonHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./behaviour/cstyle").CstyleBehaviour,a=e("./folding/cstyle").FoldMode,f=e("../worker/worker_client").WorkerClient,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start"){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(l.prototype),t.Mode=l}); (function() {
window.require(["ace/mode/json"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(s,i),t.JsonHighlightRules=s}),define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./json_highlight_rules").JsonHighlightRules,s=function(){i.call(this);var e=[{token:"variable",regex:/[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/},{token:"variable",regex:/['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/},{token:"constant.language.boolean",regex:/(?:null)\b/},{token:"string",regex:/'/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/'|$/,next:"start"},{defaultToken:"string"}]},{token:"string",regex:/"(?![^"]*":)/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/"|$/,next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:/[+-]?(?:Infinity|NaN)\b/}];for(var t in this.$rules)this.$rules[t].unshift.apply(this.$rules[t],e);this.normalizeRules()};r.inherits(s,i),t.Json5HighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json5_highlight_rules").Json5HighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./behaviour/cstyle").CstyleBehaviour,a=e("./folding/cstyle").FoldMode,f=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/json5"}.call(f.prototype),t.Mode=f}); (function() {
window.require(["ace/mode/json5"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
define("ace/snippets/javascript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# Get Elements\nsnippet gett\n getElementsBy${1:TagName}(\'${2}\')${3}\n# Get Element\nsnippet get\n getElementBy${1:Id}(\'${2}\')${3}\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# singleton\nsnippet sing\n function ${1:Singleton} (${2:argument}) {\n // the cached instance\n var instance;\n\n // rewrite the constructor\n $1 = function $1($2) {\n return instance;\n };\n \n // carry over the prototype properties\n $1.prototype = this;\n\n // the instance\n instance = new $1();\n\n // reset the constructor pointer\n instance.constructor = $1;\n\n ${3:// code ...}\n\n return instance;\n }\n# class\nsnippet class\nregex /^\\s*/clas{0,2}/\n var ${1:class} = function(${20}) {\n $40$0\n };\n \n (function() {\n ${60:this.prop = ""}\n }).call(${1:class}.prototype);\n \n exports.${1:class} = ${1:class};\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n\n\n#modules\nsnippet def\n define(function(require, exports, module) {\n "use strict";\n var ${1/.*\\///} = require("${1}");\n \n $TM_SELECTED_TEXT\n });\nsnippet req\nguard ^\\s*\n var ${1/.*\\///} = require("${1}");\n $0\nsnippet requ\nguard ^\\s*\n var ${1/.*\\/(.)/\\u$1/} = require("${1}").${1/.*\\/(.)/\\u$1/};\n $0\n',t.scope="javascript"}); (function() {
window.require(["ace/snippets/javascript"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
; (function() {
window.require(["ace/snippets/json"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
; (function() {
window.require(["ace/snippets/json5"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-chrome",t.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome {background-color: #FFFFFF;color: black;}.ace-chrome .ace_cursor {color: black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass,!1)}); (function() {
window.require(["ace/theme/chrome"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
[data-v-5c385f59] .el-upload{height:80px}[data-v-5c385f59] .el-upload-dragger{height:80px;border:1px dashed #d9d9d9;border-radius:6px;color:#8c939d;font-size:14px;display:flex;justify-content:center;align-items:center}[data-v-5c385f59] .el-icon-upload{font-size:36px;color:#c0c4cc;margin:0 10px}.buttons[data-v-5c385f59]{text-align:center;position:absolute;right:0;top:0}.el-button[data-v-5c385f59]{padding:4px 12px;font-size:18px;margin:0;border-radius:0 0 0 20px}body,html{margin:0;padding:0;height:100%;overflow:hidden;background-color:#fff}#app{padding:10px}.btn{margin-left:10px;font-size:14px}.warn .el-form-item__label{background-color:#f56c6c;color:#fff}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>NgOne</title>
<!-- <base href="/"> -->
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="//staging-teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script>
<style>
#saveDataTextarea {
margin: 0;
position: absolute;
top: 0;
left: 0;
right: 180px;
height: 100%;
}
.upload-container {
width: 100px;
height: 40px;
position: absolute;
right: 40px;
border-radius: 2px;
border: 1px solid #dcdfe6;
line-height: 100px;
margin: 10px;
text-align: center;
display:flex;
align-items:center;
justify-content:center;
}
.hide-fileinput {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
}
</style>
</head>
<body onload="loadData();" style="background-color: white;">
<pre id="saveDataTextarea"></pre>
<div class="upload-container">
<div class="upload-file">上传文件</div>
<input class="hide-fileinput" type="file" name="file" onchange="uploadFile()">
</div>
</body>
<script>
var editor = ace.edit("saveDataTextarea");
editor.setTheme("ace/theme/chrome");
editor.session.setMode("ace/mode/json");
editor.session.on('change', function(delta) {
try {
const data = JSON.parse(editor.getValue());
window.courseware.setData(data, null, "cocos_001");
} catch (error) {}
});
let saveDataStr = '';
function loadData() {
window.courseware.getData((data) => {
try {
editor.setValue(JSON.stringify(data, null, 2));
editor.gotoLine(editor.session.getLength());
} catch (error) {}
}, "cocos_001");
}
function uploadFile(){
const dom = document.querySelector(".hide-fileinput");
const file = dom.files[0];
dom.setAttribute("disabled", true);
document.querySelector(".upload-file").innerHTML = "上传中...";
commonUploadFile(file, (data) => {
try {
const d = JSON.parse(data);
const protocolStr = document.location.protocol;
const url = d.url
.replace(/http:/g, protocolStr)
.replace(/https:/g, protocolStr);
editor.insert(url);
} catch (error) {}
dom.removeAttribute("disabled");
document.querySelector(".upload-file").innerHTML = "上传文件";
});
}
function commonUploadFile(file, callback) {
const uploadUrl = window.courseware.uploadUrl(); //上传文件的路径
const uploadData = window.courseware.uploadData(); //上传文件必须要的参数
const formData = new FormData();
formData.append("file", file);
for (const key in uploadData) {
formData.append(key, uploadData[key]);
}
var xhr = new XMLHttpRequest();
xhr.open("post",uploadUrl);
//回调
xhr.onreadystatechange = function () {
if (xhr.readyState==4 && xhr.status==200){
callback && callback(xhr.responseText);
}
}
//获取上传的进度
xhr.upload.onprogress = function (event) {
if(event.lengthComputable){
var percent = event.loaded/event.total *100;
document.querySelector(".upload-file").innerHTML = Math.floor(percent)+"%";
}
}
//将formdata上传
xhr.send(formData);
}
</script>
</html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>form_vue</title><script defer="defer" src="js/chunk-vendors.1cfae6a9.js"></script><script defer="defer" src="js/app.47a798ce.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.328601d9.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but form_vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script src="https://staging-teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script><script>if (document.domain.indexOf("iteachabc.com") > 0) {
document.domain = "iteachabc.com";
}</script><div id="app"></div></body></html>
\ No newline at end of file
(function(){"use strict";var t={4878:function(t,e,i){var a=i(5471),n=i(1052),o=i.n(n),r=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"app"}},[e("div",{staticStyle:{width:"500px"}},[e("el-form",{attrs:{"label-width":"80px"}},[e("el-form-item",{attrs:{label:"音频"}},[e("AudioUploader",{ref:"refAudioUploader",on:{change:t.save},model:{value:t.itemData.url,callback:function(e){t.$set(t.itemData,"url",e)},expression:"itemData.url"}})],1),e("el-form-item",{attrs:{label:"时长(秒)"}},[e("div",{staticStyle:{display:"flex"}},[e("el-input",{model:{value:t.itemData.duration,callback:function(e){t.$set(t.itemData,"duration",e)},expression:"itemData.duration"}}),e("el-button",{staticClass:"btn",attrs:{type:"ghost",size:"mini"},on:{click:function(e){return t.updateDuration()}}},[t._v("更新")])],1)]),e("el-form-item",{attrs:{label:"大小"}},[e("el-input",{model:{value:t.itemData.size,callback:function(e){t.$set(t.itemData,"size",e)},expression:"itemData.size"}})],1),t._l(t.configArr,(function(i,a){return[e("el-form-item",{class:{warn:t.configArr[a]>t.itemData.duration},attrs:{label:`第${a+1}页`}},[e("div",{staticStyle:{display:"flex"}},[e("el-input",{model:{value:t.configArr[a],callback:function(e){t.$set(t.configArr,a,e)},expression:"configArr[index]"}}),e("el-button",{staticClass:"btn",attrs:{type:"ghost",size:"mini",icon:"el-icon-video-play"},on:{click:function(e){return t.playIndex(a)}}},[t._v("播放")]),e("el-button",{staticClass:"btn",attrs:{type:"primary",size:"mini",icon:"el-icon-place"},on:{click:function(e){return t.setTag(a)}}},[t._v("打点")]),e("el-button",{staticClass:"btn",attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:function(e){return t.deleteConf(a)}}},[t._v("删除")])],1)])]}))],2),e("el-button",{staticClass:"btn",attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:function(e){return t.addConfig()}}},[t._v("新建")])],1)])},s=[],l=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{position:"relative",width:"360px",height:"80px"}},[e("el-upload",{staticStyle:{height:"100px"},attrs:{data:t.uploadData,action:t.uploadUrl,drag:"",accept:".mp3","show-file-list":!1,"on-success":t.handleUploadSuccess}},[e("i",{directives:[{name:"show",rawName:"v-show",value:!t.audioUrl,expression:"!audioUrl"}],staticClass:"el-icon-upload"}),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.audioUrl,expression:"!audioUrl"}],staticClass:"el-upload__text"},[t._v("将MP3文件拖到此处,或"),e("em",[t._v("点击上传")])]),t.audioUrl?e("div",[e("audio",{attrs:{src:t.audioUrl,controls:""}})]):t._e()]),t.audioUrl?e("div",{staticClass:"buttons"},[e("el-button",{attrs:{type:"ghost",size:"mini",icon:"el-icon-delete"},on:{click:t.deleteAudio}})],1):t._e()],1)},u=[],c=(i(5735),{name:"ImageUploader",props:{value:{type:String,default:""}},watch:{value:function(t,e){this.audioUrl=t}},data(){return{uploadUrl:"",uploadData:"",audioUrl:""}},created(){this.uploadUrl=window.courseware.uploadUrl(),this.uploadData=window.courseware.uploadData(),window["air"].getUploadCallback=(t,e)=>{this.uploadUrl=t,this.uploadData=e}},methods:{handleUploadSuccess(t){this.audioUrl=t.url,this.$emit("input",this.audioUrl),this.$emit("change",{url:this.audioUrl})},async download(){const t=this.audioUrl,e=t.split("/").pop(),i=await fetch(t);if(i.ok){const t=await i.blob(),a=window.URL.createObjectURL(t),n=document.createElement("a");n.href=a,n.download=e,document.body.appendChild(n),n.click(),this.$message({type:"success",message:"下载完成"})}else this.$message({type:"error",message:"下载失败"})},deleteAudio(){this.$confirm("确定要删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.audioUrl="",this.$emit("input",""),this.$emit("change",{url:this.audioUrl})})).catch((()=>{}))}}}),d=c,f=i(1656),p=(0,f.A)(d,l,u,!1,null,"5c385f59",null),h=p.exports,m={name:"App",components:{AudioUploader:h},data(){return{itemData:{url:"",duration:0,size:0,splitConfig:""},configArr:[],endConf:0}},async mounted(){this.getData()},methods:{async getData(){const t=await this.$getData();t?(this.itemData=t,this.itemData.splitConfig&&(this.configArr=this.itemData.splitConfig.split(","))):(this.itemData={url:"https://teach.cdn.ireadabc.com/066e70f0278240e000fd0b4e39d12ef9.mp3",duration:127.08,size:2033900,splitConfig:"23.361281,31.816778,40.853425,49.199478,57.893614,66.694963,75.30565,84.465703,93.306864,127.08"},this.itemData.splitConfig&&(this.configArr=this.itemData.splitConfig.split(",")))},playScopeCallback(){const t=this.$refs.refAudioUploader.getAudioRef(),e=t.currentTime;e>=this.endConf&&(console.log("end"),t.pause(),t.removeEventListener("timeupdate",this.playScopeCallback))},playIndex(t){const e=t-1<0?0:this.configArr[t-1],i=this.configArr[t],a=this.$refs.refAudioUploader.getAudioRef();a.currentTime=e,this.endConf=i,a.removeEventListener("timeupdate",this.playScopeCallback),a.addEventListener("timeupdate",this.playScopeCallback),a.play()},setTag(t){const e=this.$refs.refAudioUploader.getAudioRef();this.configArr[t]=e.currentTime,this.save()},deleteConf(t){this.$confirm("确认删除该页吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.configArr.splice(t,1),this.save()})).catch((()=>{this.$message({type:"info",message:"已取消删除"})}))},updateDuration(){this.itemData.duration=this.$refs.refAudioUploader.getAudioRef().duration,this.save()},addConfig(){const t=this.$refs.refAudioUploader.getAudioRef();this.configArr.push(t.currentTime),this.save()},save(){this.itemData.splitConfig=this.configArr.join(","),this.$setData(this.itemData)},handleUploading(t){}}},g=m,v=(0,f.A)(g,r,s,!1,null,null,null),w=v.exports,y=i(9393);const b="getDPEData",D=function(t){const e={...t,urlParams:window.location.search,origin:"template"};window.parent.postMessage(e,"*")},U=async function(){return new Promise(((t,e)=>{let i=!1,a=setTimeout((()=>{i||(window.removeEventListener("message",n),e("timeout"))}),5e3);const n=e=>{if(e.data.action===b){i=!0,window.removeEventListener("message",n),clearTimeout(a);try{const i=JSON.parse(e.data.data);t(i.data)}catch(o){console.error("Error parsing DPE data",o),t(null)}}};D({action:b,data:window.location.search}),window.addEventListener("message",n)}))};a["default"].use(o()),a["default"].config.productionTip=!1,a["default"].prototype.$getData=()=>(console.log("===== getData ====="),new Promise(((t,e)=>{window.courseware.getData((e=>{console.log(e),t(e)}),"default_key")}))),a["default"].prototype.$getDPEData=U,a["default"].prototype.$setData=t=>{console.log("===== setData ====="),console.log(t),window.courseware.setData(t,null,"default_key")},a["default"].prototype.$echarts=y,new a["default"]({render:function(t){return t(w)}}).$mount("#app")}},e={};function i(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={id:a,loaded:!1,exports:{}};return t[a](o,o.exports,i),o.loaded=!0,o.exports}i.m=t,function(){i.amdO={}}(),function(){var t=[];i.O=function(e,a,n,o){if(!a){var r=1/0;for(c=0;c<t.length;c++){a=t[c][0],n=t[c][1],o=t[c][2];for(var s=!0,l=0;l<a.length;l++)(!1&o||r>=o)&&Object.keys(i.O).every((function(t){return i.O[t](a[l])}))?a.splice(l--,1):(s=!1,o<r&&(r=o));if(s){t.splice(c--,1);var u=n();void 0!==u&&(e=u)}}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[a,n,o]}}(),function(){i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,{a:e}),e}}(),function(){i.d=function(t,e){for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){i.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}(),function(){var t={524:0};i.O.j=function(e){return 0===t[e]};var e=function(e,a){var n,o,r=a[0],s=a[1],l=a[2],u=0;if(r.some((function(e){return 0!==t[e]}))){for(n in s)i.o(s,n)&&(i.m[n]=s[n]);if(l)var c=l(i)}for(e&&e(a);u<r.length;u++)o=r[u],i.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return i.O(c)},a=self["webpackChunkform_vue"]=self["webpackChunkform_vue"]||[];a.forEach(e.bind(null,0)),a.push=e.bind(null,a.push.bind(a))}();var a=i.O(void 0,[504],(function(){return i(4878)}));a=i.O(a)})();
//# sourceMappingURL=app.47a798ce.js.map
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# form_vue
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
This diff is collapsed.
{
"name": "form_vue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^1.7.2",
"crypto-js": "^4.2.0",
"echarts": "^5.5.0",
"element-ui": "^2.15.14",
"spark-md5": "^3.0.2",
"uuid": "^10.0.0",
"vue": "^2.6.14"
},
"devDependencies": {
"@vue/cli-service": "~5.0.0",
"vue-template-compiler": "^2.6.14"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<script type="text/javascript" src="https://staging-teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script>
<script>
if (document.domain.indexOf("iteachabc.com") > 0) {
document.domain = "iteachabc.com";
}
</script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<div style="width: 500px;">
<el-form label-width="80px">
<el-form-item label="音频">
<AudioUploader ref="refAudioUploader" v-model="itemData.url" @change="save"/>
</el-form-item>
<el-form-item label="时长(秒)">
<div style="display: flex;">
<el-input v-model="itemData.duration"></el-input>
<el-button class="btn" type="ghost" size="mini" @click="updateDuration()">更新</el-button>
</div>
</el-form-item>
<el-form-item label="大小">
<el-input v-model="itemData.size"></el-input>
</el-form-item>
<template v-for="conf,index in configArr">
<el-form-item :class="{'warn': configArr[index] > itemData.duration}" :label="`第${index+1}页`">
<div style="display: flex;">
<el-input v-model="configArr[index]"></el-input>
<el-button class="btn" type="ghost" size="mini" @click="playIndex(index)" icon="el-icon-video-play">播放</el-button>
<el-button class="btn" type="primary" size="mini" @click="setTag(index)" icon="el-icon-place">打点</el-button>
<el-button class="btn" type="danger" size="mini" @click="deleteConf(index)" icon="el-icon-delete">删除</el-button>
</div>
</el-form-item>
</template>
</el-form>
<el-button class="btn" type="danger" size="mini" @click="addConfig()" icon="el-icon-delete">新建</el-button>
</div>
</div>
</template>
<script>
import AudioUploader from './components/AudioUploader.vue'
export default {
name: 'App',
components: {
AudioUploader
},
data() {
return {
itemData: {
"url": "",
"duration": 0,
"size": 0,
"splitConfig": ""
},
configArr: [],
// 结束时间点
endConf: 0
};
},
async mounted() {
this.getData();
},
methods: {
async getData() {
const res = await this.$getData();
if(!res) {
// 默认数据
this.itemData = {
"url": "https://teach.cdn.ireadabc.com/066e70f0278240e000fd0b4e39d12ef9.mp3",
"duration": 127.08,
"size": 2033900,
"splitConfig": "23.361281,31.816778,40.853425,49.199478,57.893614,66.694963,75.30565,84.465703,93.306864,127.08"
}
if(this.itemData.splitConfig) {
this.configArr = this.itemData.splitConfig.split(',')
}
} else {
this.itemData = res
if(this.itemData.splitConfig) {
this.configArr = this.itemData.splitConfig.split(',')
}
}
},
// 播放区间
playScopeCallback() {
const refAudio = this.$refs.refAudioUploader.getAudioRef();
const currentTime = refAudio.currentTime;
if (currentTime >= this.endConf) {
console.log("end")
refAudio.pause();
refAudio.removeEventListener("timeupdate", this.playScopeCallback);
}
},
// 播放单页音频
playIndex(index) {
const strConf = index - 1 < 0 ? 0 : this.configArr[index - 1]
const endConf = this.configArr[index]
const refAudio = this.$refs.refAudioUploader.getAudioRef();
refAudio.currentTime = strConf;
this.endConf = endConf;
refAudio.removeEventListener("timeupdate", this.playScopeCallback);
refAudio.addEventListener("timeupdate", this.playScopeCallback);
refAudio.play();
},
// 打点
setTag(index) {
const refAudio = this.$refs.refAudioUploader.getAudioRef();
this.configArr[index] = refAudio.currentTime;
this.save()
},
// 删除
deleteConf(index) {
this.$confirm('确认删除该页吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.configArr.splice(index, 1)
this.save()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
// 更新时长
updateDuration() {
this.itemData.duration = this.$refs.refAudioUploader.getAudioRef().duration
this.save()
},
// 添加新的配置
addConfig() {
const refAudio = this.$refs.refAudioUploader.getAudioRef();
this.configArr.push(refAudio.currentTime)
this.save()
},
// 保存数据
save() {
this.itemData.splitConfig = this.configArr.join(',')
this.$setData(this.itemData)
},
handleUploading(progress) {
}
}
}
</script>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
background-color: #FFFFFF;
}
#app {
padding: 10px;
}
.btn {
margin-left: 10px;
font-size: 14px;
}
.warn .el-form-item__label {
background-color: #F56C6C;
color: #FFFFFF;
}
</style>
const actionName = "getDPEData";
const commonPostMessage = function (messageObj) {
const obj = { ...messageObj, urlParams: window.location.search, origin: "template" }
window.parent.postMessage(obj, '*');
};
export const getDPEData = async function () {
return new Promise((resolve, reject) => {
let processed = false;
let timeoutId = setTimeout(() => {
if (!processed) {
window.removeEventListener("message", eventCallback);
reject("timeout")
}
}, 5000);
const eventCallback = (e) => {
if(e.data.action !== actionName) {
return;
}
processed = true;
window.removeEventListener("message", eventCallback);
clearTimeout(timeoutId);
try {
const data = JSON.parse(e.data.data);
resolve(data.data)
} catch (error) {
console.error("Error parsing DPE data", error);
resolve(null)
}
}
commonPostMessage({ action: actionName, data: window.location.search });
window.addEventListener("message", eventCallback)
})
}
\ No newline at end of file
import axios from "axios";
const org = 523;
const dpe_root = 275931;
const base_url = "https://ema.iteachabc.com/api/syllabus/v1";
export const getSyllabusListById = (syllabus_id) => {
return new Promise(async (resolve, reject) => {
const res = await axios.get(`${base_url}/list?orgid=${org}&pid=${syllabus_id?syllabus_id:dpe_root}`);
resolve(res.data);
})
}
export const getFirstCoursewareBySyllId = (syllabus_id) => {
return new Promise(async (resolve, reject) => {
const res = await axios.get(`${base_url}/getdata?syllabusid=${syllabus_id}`);
resolve(res.data);
})
}
export const getCoursewarePageBySyllId = (syllabus_id, page) => {
return new Promise(async (resolve, reject) => {
const res = await axios.get(`${base_url}/getpagedata?syllabusid=${syllabus_id}&page=${page}`);
resolve(res.data);
})
}
export const getAllCoursewareBySyllId = (syllabus_id) => {
return new Promise(async (resolve, reject) => {
const res = await axios.get(`${base_url}/getdatalist?syllabusids=${syllabus_id}`);
resolve(res.data);
})
}
export const getPidPathName = (pid_path) => {
return new Promise(async (resolve, reject) => {
const res = await axios.get(`${base_url}/pathname?pid_path=${pid_path}`);
resolve(res.data);
})
}
\ No newline at end of file
<!-- 视频上传组件 -->
<template>
<div style="position: relative; width: 360px; height: 80px;">
<el-upload style="height: 100px;" :data="uploadData" :action="uploadUrl" drag accept=".mp3" :show-file-list="false" :on-success="handleUploadSuccess">
<!-- 上传提示 -->
<i v-show="!audioUrl" class="el-icon-upload"></i>
<div v-show="!audioUrl" class="el-upload__text">将MP3文件拖到此处,或<em>点击上传</em></div>
<!-- 音频预览 -->
<div v-if="audioUrl" >
<audio :src="audioUrl" controls></audio>
</div>
</el-upload>
<!-- 下载 删除按钮 -->
<div v-if="audioUrl" class="buttons">
<!-- <el-button type="ghost" size="mini" icon="el-icon-download" @click="download"></el-button> -->
<el-button type="ghost" size="mini" icon="el-icon-delete" @click="deleteAudio"></el-button>
</div>
</div>
</template>
<script>
import SparkMD5 from 'spark-md5';
export default {
name: 'ImageUploader',
props: {
value: {
type: String,
default: ''
},
},
watch: {
value: function (val, oldVal) {
this.audioUrl = val
}
},
data() {
return {
// 上传地址
uploadUrl: "",
// 上传附带的DATA
uploadData: "",
// 图片地址
audioUrl: "",
}
},
created() {
// 获取上传地址
this.uploadUrl = window.courseware.uploadUrl();
this.uploadData = window.courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
};
},
methods: {
handleUploadSuccess(e) {
this.audioUrl = e.url;
this.$emit("input", this.audioUrl);
this.$emit('change', { url: this.audioUrl});
},
async download() {
const url = this.audioUrl
const fileName = url.split('/').pop()
const response = await fetch(url) //发送GET请求
if (response.ok) {
const blob = await response.blob() //获取Blob对象
const url = window.URL.createObjectURL(blob) //创建Blob对象的URL
const link = document.createElement('a') //创建一个新的<a>元素
link.href = url //设置<a>元素的href属性为Blob对象的URL
link.download = fileName //设置下载文件的文件名
document.body.appendChild(link) //将<a>元素添加到文档中
link.click() //模拟点击<a>元素以触发文件下载
this.$message({
type: 'success',
message: '下载完成'
});
} else {
//处理API响应失败的情况,例如显示错误消息
this.$message({
type: 'error',
message: '下载失败'
});
}
},
deleteAudio() {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.audioUrl = "";
this.$emit("input", "");
this.$emit('change', { url: this.audioUrl});
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
});
},
},
}
</script>
<style scoped>
::v-deep .el-upload {
height: 80px;
}
::v-deep .el-upload-dragger {
height: 80px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
/* background-color: #f7f7f7; */
color: #8c939d;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
}
::v-deep .el-icon-upload {
font-size: 36px;
color: #c0c4cc;
margin: 0 10px;
}
.buttons {
text-align: center;
position: absolute;
right: 0;
top: 0;
}
.el-button {
padding: 4px 12px;
font-size: 18px;
margin: 0;
border-radius: 0 0 0 20px;
}
</style>
\ No newline at end of file
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
<!-- 视频上传组件 -->
<template>
<div style="position: relative; width: 360px; height: 180px;">
<el-upload :data="uploadData" :action="uploadUrl" drag accept=".png,.jpg,.jpeg,.bmp,.gif" :show-file-list="false" :on-success="handleUploadSuccess">
<!-- 上传提示 -->
<i v-show="!imageUrl" class="el-icon-upload"></i>
<div v-show="!imageUrl" class="el-upload__text">将文件拖到此处,或<em>点击上传</em><br/><span style="font-size: 14px;">只能上传 <strong>jpg、png、jpeg、gif、bmp</strong> 文件</span></div>
<!-- 预览图片 -->
<div v-if="imageUrl" style="width: 100%; height: 100%;">
<el-image style="width: 100%; height: 100%" :src="imageUrl" fit="contain"></el-image>
</div>
</el-upload>
<!-- 下载 删除按钮 -->
<el-button-group v-if="imageUrl" class="buttons">
<el-button type="ghost" size="mini" icon="el-icon-download" @click="download"></el-button>
<el-button type="ghost" size="mini" icon="el-icon-delete" @click="deleteImg"></el-button>
</el-button-group>
</div>
</template>
<script>
import SparkMD5 from 'spark-md5';
export default {
name: 'ImageUploader',
props: {
value: {
type: String,
default: ''
},
},
watch: {
value: function (val, oldVal) {
this.imageUrl = val
}
},
data() {
return {
// 上传地址
uploadUrl: "",
// 上传附带的DATA
uploadData: "",
// 图片地址
imageUrl: "",
}
},
created() {
// 获取上传地址
this.uploadUrl = window.courseware.uploadUrl();
this.uploadData = window.courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
};
},
methods: {
handleUploadSuccess(e) {
this.imageUrl = e.url;
this.$emit("input", this.imageUrl);
this.$emit('change', { url: this.imageUrl});
},
async download() {
const url = this.imageUrl
const fileName = url.split('/').pop()
const response = await fetch(url) //发送GET请求
if (response.ok) {
const blob = await response.blob() //获取Blob对象
const url = window.URL.createObjectURL(blob) //创建Blob对象的URL
const link = document.createElement('a') //创建一个新的<a>元素
link.href = url //设置<a>元素的href属性为Blob对象的URL
link.download = fileName //设置下载文件的文件名
document.body.appendChild(link) //将<a>元素添加到文档中
link.click() //模拟点击<a>元素以触发文件下载
this.$message({
type: 'success',
message: '下载完成'
});
} else {
//处理API响应失败的情况,例如显示错误消息
this.$message({
type: 'error',
message: '下载失败'
});
}
},
deleteImg() {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.imageUrl = "";
this.$emit("input", "");
this.$emit('change', { url: this.imageUrl});
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
});
},
},
}
</script>
<style scoped>
.buttons {
text-align: center;
position: absolute;
right: 0;
top: 0;
}
.buttons .el-button {
padding: 4px 12px;
font-size: 18px;
margin: 0;
border-radius: initial;
}
</style>
\ No newline at end of file
<template>
<div class="com-trs">
<div ref="refEcharts" class="chart-slider"></div>
</div>
</template>
<script>
export default {
name: 'TimeRangeSelector',
props: {
value: {
type: Object,
default: () => {
return {
start: 0,
end: 100
}
}
}
},
watch: {
value: {
handler(val) {
this.parentValueChange = true;
this.setTimeRange(val.start * 100, val.end * 100);
},
deep: true
}
},
data() {
return {
insECharts: null,
parentValueChange: false
}
},
mounted() {
this.initEcharts();
},
methods: {
initEcharts() {
if(!this.insECharts) {
this.insECharts = this.$echarts.init(this.$refs.refEcharts);
}
const option = {
grid: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
tooltip: {},
dataZoom: [
{
type: 'slider'
},
],
xAxis: { show: false } ,
yAxis: { show: false },
};
this.insECharts.on('dataZoom', (evt) => {
if(this.parentValueChange) {
this.parentValueChange = false;
return;
}
this.$emit('change', {
start: evt.start / 100,
end: evt.end / 100
})
this.$emit('input', {
start: evt.start / 100,
end: evt.end / 100
})
})
this.insECharts.setOption(option);
},
setTimeRange(start, end) {
this.insECharts.dispatchAction({
type: 'dataZoom',
// 可选,dataZoom 组件的 index,多个 dataZoom 组件时有用,默认为 0
dataZoomIndex: 0,
// 开始位置的百分比,0 - 100
start: start,
// 结束位置的百分比,0 - 100
end: end,
// // 开始位置的数值
// startValue: number,
// // 结束位置的数值
// endValue: number
});
}
},
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.com-trs {
width: 100%;
height: 50px;
}
.chart-slider {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
This diff is collapsed.
import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import * as echarts from 'echarts';
import { getDPEData } from './api/dep'
Vue.use(ElementUI);
Vue.config.productionTip = false
Vue.prototype.$getData = () => {
console.log("===== getData =====");
return new Promise((resolve, reject) => {
(window).courseware.getData((data) => {
console.log(data);
resolve(data)
}, "default_key")
})
}
Vue.prototype.$getDPEData = getDPEData;
Vue.prototype.$setData = (data) => {
console.log("===== setData =====");
console.log(data);
(window).courseware.setData(data, null, "default_key")
}
Vue.prototype.$echarts = echarts
new Vue({
render: function (h) { return h(App) },
}).$mount('#app')
module.exports = {
publicPath: './',
// 其他配置...
};
\ No newline at end of file
......@@ -4,5 +4,6 @@
"name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.5",
"isNew": false
"isNew": false,
"description": ""
}
\ No newline at end of file
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