dever hace 6 años
padre
commit
705ca51b7f
Se han modificado 2 ficheros con 28 adiciones y 3 borrados
  1. 14 2
      assets/lib/layui/upload.js
  2. 14 1
      assets/lib/manage/main.js

+ 14 - 2
assets/lib/layui/upload.js

@@ -25,7 +25,7 @@ var showUploadIndex = false;
      }
  }
 
-function showUpload(i,e,key,url,assets)
+function showUpload(i,e,key,url,assets,type)
 {
 	layui.use(['upload','layer','element'], function() {
 		var html = '';
@@ -42,7 +42,10 @@ function showUpload(i,e,key,url,assets)
 		{
 			url = url.replace('save', 'view');
 			showUploadE = e;
-			showUploadType = 1;
+			if (!type) {
+				type = 1;
+			}
+			showUploadType = type;
 			showUploadUrl = url;
 			var cur = $('#' + showUploadE.attr('v')).val();
 			$.getJSON(url, {json:1,key:key,cur:cur}, function(t)
@@ -99,6 +102,15 @@ function showUploadFilesSet(e, name, url, id)
 		} else {
 			layer.closeAll();
 		}
+	} else if (showUploadType == 3) {
+		var value = showUploadE.attr('editor_id');
+		KindEditor.insertHtml('#' + value, '<div class="dever-video"><embed src="'+url+'" type="video/x-ms-asf-plugin" width="450" height="300" autostart="false" loop="true" data-id="'+id+'"/><div style="width:450px;height:20px;border:1px solid #bababa;">'+name+':'+id+'(无法修改)</div></div>');
+		if (showUploadIndex) {
+			layer.close(showUploadIndex);
+			showUploadIndex = false;
+		} else {
+			layer.closeAll();
+		}
 	}
 }
 

+ 14 - 1
assets/lib/manage/main.js

@@ -1585,7 +1585,20 @@ function image()
 			{
 				return;
 			}
-			showUpload(i,$(this),$(this).attr('key'),config.upload + '.files', config.lib + 'upload/');//三个参数说明1:第几个上传框2:文件对象3:图片的基本配置标题
+			showUpload(i,$(this),$(this).attr('key'),config.upload + '.files', config.lib + 'upload/', 1);//三个参数说明1:第几个上传框2:文件对象3:图片的基本配置标题
+		})
+	}
+
+	if($(".upload_show_editor").length)
+	{
+		$(".upload_show_editor").each(function(i)
+		{
+			var parent = $(this).parent().parent();
+			if(parent.attr('id') && parent.attr('id').indexOf('-child-0') != -1)
+			{
+				return;
+			}
+			showUpload(i,$(this),$(this).attr('key'),config.upload + '.files', config.lib + 'upload/', 3);//三个参数说明1:第几个上传框2:文件对象3:图片的基本配置标题
 		})
 	}
 }