c5_labsci/web/admin/demo/front/form_upload.html

103 lines
4.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="/jscss/theme.js"></script>
</head>
<body>
<form onsubmit="formsubmit(event);">
<div style="height:10em;">占位123</div>
<div class="row" style="background:#eeeeee;">
<div class="ciy-form col-24 col-sm-24">
<label>头像</label>
<div><ciy-upload com="a" type="jpg,png" zipjpg="0.7" showwh="250px" imgwidth="100" imgheight="100" zipext="jpg" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>多图</label>
<div><ciy-upload com="b" initevent hasmore num="10" type="jpg,png" zipjpg="0.7" imgwidth="800" zipext="jpg" valname="asfs~水电费.png" value="/img/face.png~/img/maskcamera.png~/img/music1.mp3" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>文档</label>
<div><ciy-upload com="c" hasmore num="10" zipjpg="0.7" imgwidth="800" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>限大小</label>
<div><ciy-upload com="d" hasmore num="10" maxkb="1024" showwh="50px" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>水印字</label>
<div><ciy-upload com="e" hasmore num="10" imgwidth="1200" waterfont="18px Arial" watertext="第一行:阿斯顿发|第二行:adadf fddf" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>绘制</label>
<div><ciy-upload com="f" hasmore num="10" imgwidth="1200" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>原图</label>
<div><ciy-upload com="g" num="10" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>本地</label>
<div><ciy-upload com="h" num="10" stor="/" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>A.s3</label>
<div><ciy-upload com="i" num="10" stor="A" /></div>
</div>
</div>
<button type="submit" class="btn lg">提交</button>
<a class="btn" onclick="chg()">改变值</a>
<pre id="id_result"></pre>
<div style="height:10em;">占位</div>
</form>
<script type="text/javascript" src="/jscss/ciy.js"></script>
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
<script type="text/javascript" src="../../common.js"></script>
<script type="text/javascript">
'use strict';
var c;
ciyfn.pageload(function () {
var path = ciyfn.makeuploadpath('demo', ciyfn.getstorage(ciy_vars.tokenfield));
c = ciycmp({ dom: '[com=a]', path: path });
c.onchange = function (d) { showlog(d) };
ciycmp({ dom: '[com=b]', path: path, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=c]', path: path, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=d]', path: path, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=e]', path: path, onchange: function (d) { showlog(d) } });
var f = ciycmp({
dom: '[com=f]', path: path, onchange: function (d) { showlog(d) }, fn_imgdraw: function (canvas, ctx, img) {
ctx.font = '40px Arial';
ctx.fillStyle = '#cc0000';
ctx.fillText('测试测试测试测试测试', 10, 60);
}
});
ciycmp({ dom: '[com=g]', path: path, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=h]', path: path, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=i]', path: path, onchange: function (d) { showlog(d) } });
});
function formsubmit(event) {
event.preventDefault();
var postparam = ciyfn.getform(event.target);
showlog(postparam);
}
function showlog(dat) {
console.log(dat);
delete dat.dom;
$5('#id_result').html(JSON.stringify(dat, null, 2));
}
function chg() {
console.log(c);
c.setvalue('/img/face.png');
}
</script>
</body>
</html>