|
|
@@ -225,40 +225,41 @@ export default {
|
|
|
* @param {string} id - 课件ID
|
|
|
*/
|
|
|
getCoursewareComponentContent_View(id) {
|
|
|
- ContentGetCoursewareContent_View({ id }).then(({ content, component_list, content_group_row_list }) => {
|
|
|
- if (content) {
|
|
|
- const _content = JSON.parse(content);
|
|
|
- this.data = _content;
|
|
|
- this.background = {
|
|
|
- background_image_url: _content.background_image_url,
|
|
|
- background_position: _content.background_position,
|
|
|
- };
|
|
|
- } else {
|
|
|
- this.data = { row_list: [] };
|
|
|
- }
|
|
|
+ ContentGetCoursewareContent_View({ id }).then(
|
|
|
+ ({ content, component_list, content_group_row_list, background }) => {
|
|
|
+ if (background) {
|
|
|
+ this.background = JSON.parse(background);
|
|
|
+ }
|
|
|
+ if (content) {
|
|
|
+ const _content = JSON.parse(content);
|
|
|
+ this.data = _content;
|
|
|
+ } else {
|
|
|
+ this.data = { row_list: [] };
|
|
|
+ }
|
|
|
|
|
|
- if (component_list) this.component_list = component_list;
|
|
|
- this.component_list.forEach((x) => {
|
|
|
- if (x.component_type === 'audio') {
|
|
|
- let _c = JSON.parse(x.content);
|
|
|
- let p = _c.property || {};
|
|
|
- if (!p.file_name_display_mode) p.file_name_display_mode = 'true';
|
|
|
- if (p.view_method === 'independent' && !p.style_mode) {
|
|
|
- p.style_mode = 'middle';
|
|
|
- }
|
|
|
- if (!p.style_mode) p.style_mode = 'big';
|
|
|
- if (p.view_method === 'icon') {
|
|
|
- p.file_name_display_mode = 'false';
|
|
|
- p.view_method = 'independent';
|
|
|
- p.style_mode = 'small';
|
|
|
+ if (component_list) this.component_list = component_list;
|
|
|
+ this.component_list.forEach((x) => {
|
|
|
+ if (x.component_type === 'audio') {
|
|
|
+ let _c = JSON.parse(x.content);
|
|
|
+ let p = _c.property || {};
|
|
|
+ if (!p.file_name_display_mode) p.file_name_display_mode = 'true';
|
|
|
+ if (p.view_method === 'independent' && !p.style_mode) {
|
|
|
+ p.style_mode = 'middle';
|
|
|
+ }
|
|
|
+ if (!p.style_mode) p.style_mode = 'big';
|
|
|
+ if (p.view_method === 'icon') {
|
|
|
+ p.file_name_display_mode = 'false';
|
|
|
+ p.view_method = 'independent';
|
|
|
+ p.style_mode = 'small';
|
|
|
+ }
|
|
|
+
|
|
|
+ x.content = JSON.stringify(_c);
|
|
|
}
|
|
|
+ });
|
|
|
|
|
|
- x.content = JSON.stringify(_c);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
|
|
|
- });
|
|
|
+ if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
|
|
|
+ },
|
|
|
+ );
|
|
|
},
|
|
|
|
|
|
getLangList() {
|