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

70 lines
2.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;">占位</div>
<div style="height:10em;">占位</div>
<div style="height:10em;">占位</div>
<div class="row" style="background:#eeeeee;">
<div class="ciy-form col-24 col-sm-24">
<label>测试a</label>
<div><ciy-daterange hasmore type="date" com="a" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>测试b</label>
<div><ciy-daterange hasmore initevent type="datetime" com="b" value="2023-3-2 12:32~" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>测试c</label>
<div><ciy-daterange com="c" /></div>
</div>
</div>
<button type="submit" class="btn lg">提交</button>
<a class="btn" onclick="chg()">改变值</a>
<pre id="id_result"></pre>
<div style="height:30em;">占位</div>
<div style="height:30em;">占位</div>
<div style="height:30em;">占位</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="/ud/dict/ciy_arearpc.js"></script>
<script type="text/javascript" src="../../common.js"></script>
<script type="text/javascript">
'use strict';
var c;
ciyfn.pageload(function () {
c = ciycmp({ dom: '[com=a]', onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=b]', onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=c]', value:'2023-1-2~2024-6-3', 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('~1641936696');
}
</script>
</body>
</html>