152 lines
7.2 KiB
HTML
152 lines
7.2 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;">
|
|
<ul></ul>
|
|
<div>
|
|
<div class="sinps"></div>
|
|
<div class="sbtns">
|
|
<button class="lang btn" type="submit">查询</button>
|
|
<a class="lang btn" onclick="exportxls()">导出</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 id="id_chats" style="height: 25.5em;overflow-y: auto;width: 100%;padding: 1em;"></div>
|
|
<div class="px2" style="position: absolute;bottom: 0;left: 0;right:0;">
|
|
<ciy-textarea com="content" style="display: block;"></ciy-textarea>
|
|
</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/ciytable.js"></script>
|
|
<script type="text/javascript" src="../common.js"></script>
|
|
<script type="text/javascript">
|
|
'use strict';
|
|
var table;
|
|
var Glob = {};
|
|
ciyfn.pageload(function () {
|
|
//Glob.urlp = ciyfn.urlparam();
|
|
table = new ciyclass.table({
|
|
dom: '.table'
|
|
, url: 'list'
|
|
, pagecount: 10
|
|
, fn_beforedata: function (json) {
|
|
ciyfn.fillsearch({
|
|
searchdom: '.search'
|
|
, data: json
|
|
, lidata: [{ id: '', name: '全部' }, { id: '1', name: '待回复' }, { id: '2', name: '已回复' }, { id: '3', name: '已关闭' }]
|
|
, liclick: function (dom) {
|
|
table.search(dom, 'li');
|
|
}
|
|
});
|
|
return json;
|
|
}
|
|
, fn_tdcontent: function (key, datashow, field, data) {
|
|
if (key == '_btn') {
|
|
var html = '';
|
|
html += `<a class="lang btn" onclick="menubtn(this, 'chat')">回复</a>`;
|
|
return html;
|
|
}
|
|
}
|
|
, fn_done: function (json) {
|
|
// table.mergecol('auditstatus');
|
|
// table.mergefix('总计', 'center', 6, 0, 8, 1);
|
|
// table.footertotal();
|
|
}
|
|
});
|
|
table.callpage(1);
|
|
});
|
|
function menubtn(dom, btn) {
|
|
var id = $5(dom).parent('tr').attr('data-id');
|
|
if (btn == 'chat') {
|
|
edit(id);
|
|
}
|
|
}
|
|
function edit(id) {
|
|
ciyfn.callfunc('getchat', { id: id }, function (json) {
|
|
ciyfn.alert({
|
|
title: '工单答复'
|
|
, width: 'pc'
|
|
, contentstyle: 'height:30em;padding:0;'
|
|
, content: document.getElementById("alert_edit").innerHTML
|
|
, fn_showed: function (doc, dom) {
|
|
var dat = table.data[id];
|
|
var html = '';
|
|
for (var i in json.chats) {
|
|
if (json.chats[i].sendtype == 1) {
|
|
html += '<div><div style="font-size:0.7em;line-height: 1.2em;margin-top: 1em;">用户 ' + ciyfn.todatetime(json.chats[i].addtimes, 'm-d H:i') + '</div><div style="display:inline-block;background: #f7f7f7;padding: 0.5em 1em;border-radius: 7px;min-width: 5em;">' + json.chats[i].content.replace(/\n/g, '<br/>') + '</div></div>';
|
|
} else if (json.chats[i].sendtype == 2) {
|
|
html += '<div style="text-align: right;"><div style="font-size:0.7em;line-height: 1.2em;margin-top: 1em;">' + ciyfn.todatetime(json.chats[i].addtimes, 'm-d H:i') + ' 平台</div><div style="display:inline-block;background: #88f7af;padding: 0.5em 1em;border-radius: 7px;min-width: 5em;text-align:left;">' + json.chats[i].content.replace(/\n/g, '<br/>') + '</div></div>';
|
|
} else {
|
|
html += '<div style="text-align: center;"><div style="font-size:0.7em;line-height: 1.2em;margin-top: 1em;">AI助手 ' + ciyfn.todatetime(json.chats[i].addtimes, 'm-d H:i') + '</div><div style="display:inline-block;background: #a3d1f9;padding: 0.5em 1em;border-radius: 7px;min-width: 5em;text-align:left;">' + json.chats[i].content.replace(/\n/g, '<br/>') + '</div></div>';
|
|
}
|
|
}
|
|
if (html == '')
|
|
html = '无聊天记录';
|
|
$5('#id_chats', dom).html(html);
|
|
|
|
ciycmp({ dom: $5('[com=content]', dom) });
|
|
$5('#id_chats', dom).scroll({ top: 1000000 });
|
|
}
|
|
, cb: function (opn) {
|
|
if (opn.btn == "关闭")
|
|
return opn.close();
|
|
opn.inputs.id = id;
|
|
ciyfn.callfunc('repchat', opn.inputs, function (json) {
|
|
table.updateline(json);
|
|
opn.close();
|
|
ciyfn.toast('答复成功');
|
|
});
|
|
},
|
|
btns: ["平台答复", "*关闭"]
|
|
});
|
|
});
|
|
}
|
|
|
|
function getdata(id, act, cb) {
|
|
ciyfn.callfunc('getdata', { id: id, act: act }, function (json) {
|
|
cb(json);
|
|
});
|
|
// cb({ data: id == 0 ? {} : table.data[id] });
|
|
}
|
|
|
|
function exportxls() {
|
|
ciyfn.table_exportxls('exportxls', table, function (json) {
|
|
ciyfn.alert({
|
|
content: '<div style="text-align:center;"><span class="lang">导出数据已生成</span><br/><br/><a class="lang btn lg" href="' + json.url + '" target="_blank">下载数据</a></div>'
|
|
, btns: null
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |