|
@@ -118,6 +118,49 @@
|
|
|
$.operate.save(prefix + "/add", $('#form-center-add').serialize());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // function upBg() {
|
|
|
+ // console.log('this',this)
|
|
|
+ // var formdata = new FormData();
|
|
|
+ // formdata.append("file", img);
|
|
|
+ // $.ajax({
|
|
|
+ // url: ctx + "common/upload",
|
|
|
+ // data: formdata,
|
|
|
+ // type: "post",
|
|
|
+ // processData: false,
|
|
|
+ // contentType: false,
|
|
|
+ // success: function (result) {
|
|
|
+ // if (result.code == 0) {
|
|
|
+ // $("#submitbuttonFile").val(result.data.fileName);
|
|
|
+ // } else {
|
|
|
+ // $.modal.alertWarning(result.msg);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ $("#submitbuttonFile").fileinput({
|
|
|
+ 'theme': 'explorer-fas',
|
|
|
+ 'uploadUrl':ctx + "common/upload",
|
|
|
+ overwriteInitial: false,
|
|
|
+ initialPreviewAsData: true
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#submitbuttonFile").on("fileuploaded", function (event, data, previewId, index) {
|
|
|
+ alert('上传成功')
|
|
|
+ console.log('event--------',event)
|
|
|
+ console.log('data--------',data)
|
|
|
+ console.log('previewId--------',previewId)
|
|
|
+ console.log('index--------',index)
|
|
|
+ })
|
|
|
+
|
|
|
+ $('#submitbuttonFile').on('fileerror', function(event, data, msg) {
|
|
|
+ alert('上传失败')
|
|
|
+ console.log('data--------',data)
|
|
|
+ console.log('event--------',event)
|
|
|
+ console.log('msg--------',msg)
|
|
|
+ });
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|