186 lines
7.8 KiB
HTML
186 lines
7.8 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>
|
|
<div class="container">
|
|
<form class="search" onsubmit="table.search(this,'btn');return false;">
|
|
<div>
|
|
<div class="sinps"></div>
|
|
<div class="sbtns">
|
|
<button class="lang btn" type="submit">查询</button>
|
|
<a class="lang btn" onclick="edit(0)">添加</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="table">
|
|
<div class="loading col-24">Loading...</div>
|
|
<div class="list"></div>
|
|
<div>
|
|
<div class="btmbtn">
|
|
<a class="lang btn def" onclick="ciyfn.select_all(table)">全选</a>
|
|
<a class="lang btn def" onclick="ciyfn.select_diff(table)">反选</a>
|
|
|
|
|
<a class="lang btn dag" onclick="ciyfn.select_callfunc(table, this,'del','已选{n}条,是否批量删除?',{},function(json){table.delline(json)})">批量删除</a>
|
|
</div>
|
|
<div class="page"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="alert_edit" style="display:none;">
|
|
<div class="char4 row">
|
|
<div class="ciy-form col-24 col-sm-12">
|
|
<label class="lang imp">名称</label>
|
|
<div>
|
|
<input type="text" name="name" style="width:100%;" />
|
|
</div>
|
|
</div>
|
|
<div class="ciy-form col-24 col-sm-12">
|
|
<label class="lang" title="不填写则为全屏效果">显示标题</label>
|
|
<div>
|
|
<input type="text" name="title" style="width:100%;" />
|
|
</div>
|
|
</div>
|
|
<div class="col-24">
|
|
<ciy-markdown com="content" imgwidth="1000" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp2.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciytable.js"></script>
|
|
<script type="text/javascript" src="../common.js"></script>
|
|
<script type="text/javascript">
|
|
'use strict';
|
|
var table;
|
|
var Glob = {};
|
|
ciyfn.pageload(function () {
|
|
table = new ciyclass.table({
|
|
dom: '.table'
|
|
, url: 'init'
|
|
, pagecount: 10
|
|
, fn_beforedata: function (json) {
|
|
ciyfn.fillsearch({
|
|
searchdom: '.search'
|
|
, data: json
|
|
});
|
|
return json;
|
|
}
|
|
, fn_tdcontent: function (key, datashow, field, data) {
|
|
if (key == '_btn') {
|
|
var html = '';
|
|
html += '<a class="lang btn def" onclick="menubtn(this, \'view\')">查看</a>';
|
|
html += '<a class="lang btn" onclick="menubtn(this, \'edit\')">修改</a>';
|
|
return html;
|
|
}
|
|
}
|
|
});
|
|
table.callpage(1);
|
|
|
|
});
|
|
function menubtn(dom, btn) {
|
|
var id = $5(dom).parent('tr').attr('data-id');
|
|
if (btn == 'view') {
|
|
view(id);
|
|
}
|
|
if (btn == 'edit') {
|
|
edit(id);
|
|
}
|
|
}
|
|
function edit(id) {
|
|
ciyfn.alert({
|
|
title: id == 0 ? '新建' : '修改'
|
|
, width: 'pc'
|
|
, content: document.getElementById("alert_edit").innerHTML
|
|
//, noparent:true
|
|
, fn_showed: function (doc, dom) {
|
|
Glob.edit = id;
|
|
if (id == 0 && !table.data[0])
|
|
table.data[0] = {};
|
|
var postparam = { id: id, data: true };
|
|
ciyfn.callfunc('getdata', postparam, function (json) {
|
|
if (json.data)
|
|
table.data[id] = json.data;
|
|
$5('[name=id]', dom).val(table.data[id].id);
|
|
$5('[name=name]', dom).val(table.data[id].name);
|
|
$5('[name=title]', dom).val(table.data[id].title);
|
|
ciycmp({ dom: $5('[com=content]', dom), path: '{Y}/{m}{d}/paper', value: table.data[id].content });
|
|
});
|
|
}
|
|
, btns: ["提交", "*关闭"]
|
|
, cb: function (opn) {
|
|
if (opn.btn == "关闭")
|
|
return opn.close();
|
|
opn.inputs.id = id;
|
|
if (ciyfn.throttle(opn.dombtn)) return;
|
|
ciyfn.callfunc('update', opn.inputs, function (json) {
|
|
table.updateline(json);
|
|
opn.close();
|
|
ciyfn.toast('提交成功');
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function view(id) {
|
|
ciyfn.callfunc('getdata', { id: id, data: true }, function (json) {
|
|
table.data[id] = json.data;
|
|
var html = '<div class="char4 row gridline">';
|
|
var dat = table.data[id];
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label class="lang">名称</label>';
|
|
html += '<div>';
|
|
html += ciyfn.tdshow('name', dat.name, table.field.name.ext, dat, table.json, true);
|
|
html += '</div>';
|
|
html += '</div>';
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label class="lang">显示标题</label>';
|
|
html += '<div>';
|
|
html += ciyfn.tdshow('title', dat.title, table.field.title.ext, dat, table.json, true);
|
|
html += '</div>';
|
|
html += '</div>';
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label class="lang">阅读数</label>';
|
|
html += '<div>';
|
|
html += ciyfn.tdshow('readcnt', dat.readcnt, table.field.readcnt.ext, dat, table.json, true);
|
|
html += '</div>';
|
|
html += '</div>';
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label class="lang">撰写人</label>';
|
|
html += '<div>';
|
|
html += ciyfn.tdshow('inputuser', dat.inputuser, table.field.inputuser.ext, dat, table.json, true);
|
|
html += '</div>';
|
|
html += '</div>';
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label class="lang">更新时间</label>';
|
|
html += '<div>';
|
|
html += ciyfn.tdshow('uptimes', dat.uptimes, table.field.uptimes.ext, dat, table.json, true);
|
|
html += '</div>';
|
|
html += '</div>';
|
|
html += '<div class="ciy-form col-24 col-sm-24">';
|
|
html += '<label class="lang">内容</label>';
|
|
html += '<div>';
|
|
html += ciyfn.markdown(dat.content);
|
|
html += '</div>';
|
|
html += '</div>';
|
|
html += '</div>';
|
|
|
|
ciyfn.alert({
|
|
title: '查看'
|
|
, width: 'pc'
|
|
, content: html
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |