Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
|
3a10d48c4d | |
|
9a36033ac3 | |
|
940c85a06d | |
|
81684ffcef | |
|
81910ee3f4 | |
|
a888509aab | |
|
e1ba5ff491 | |
|
bf004376de | |
|
2a0a069d38 | |
|
d6c9ee2580 |
|
@ -145,4 +145,3 @@ dmypy.json
|
|||
.pyre/
|
||||
|
||||
.vs/
|
||||
log/
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.8 on 2022-10-31 16:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('enp', '0027_auto_20220902_1005'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='drain',
|
||||
name='need_predict',
|
||||
field=models.BooleanField(default=True, verbose_name='是否需要预测'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.8 on 2022-10-31 17:07
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('enp', '0028_drain_need_predict'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='drain',
|
||||
name='need_predict',
|
||||
field=models.IntegerField(default=1, verbose_name='是否需要预测'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,36 @@
|
|||
# Generated by Django 2.2.8 on 2022-11-01 12:51
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0396_auto_20220304_1648'),
|
||||
('enp', '0029_auto_20221031_1707'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='GasTestEquipment',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
|
||||
('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
|
||||
('contaminant', models.CharField(max_length=100, verbose_name='污染物')),
|
||||
('model', models.CharField(max_length=100, verbose_name='仪器型号')),
|
||||
('state', models.CharField(default='正常', max_length=100, verbose_name='设备状态')),
|
||||
('remark', models.CharField(max_length=200, verbose_name='备注')),
|
||||
('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='gastestequipment_create_by', to='safesite.User', verbose_name='创建人')),
|
||||
('drain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='enp.Drain', verbose_name='关联排放口')),
|
||||
('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='gastestequipment_update_by', to='safesite.User', verbose_name='最后编辑人')),
|
||||
('usecomp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.Partment', verbose_name='所属公司')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.8 on 2023-12-26 08:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('enp', '0030_gastestequipment'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='prevention',
|
||||
name='preventiontype',
|
||||
field=models.IntegerField(blank=True, choices=[(1, '废水'), (2, '废气'), (3, '噪声'), (4, '废水治理')], default=1, null=True, verbose_name='防治类型'),
|
||||
),
|
||||
]
|
|
@ -106,6 +106,7 @@ class Drain(CommonModel):
|
|||
number = models.CharField('编号', max_length=100,null=True, blank=True)
|
||||
name = models.CharField('名称', max_length=100,null=True, blank=True)
|
||||
location = JSONField('点位坐标', null=True, blank=True)
|
||||
need_predict = models.IntegerField('是否需要预测', default=1)
|
||||
usecomp = models.ForeignKey(Partment, on_delete=models.CASCADE, verbose_name='所属公司')
|
||||
|
||||
class GasEmit(CommonModel):
|
||||
|
@ -166,7 +167,8 @@ class Prevention(CommonModel):
|
|||
type_choices = (
|
||||
(1, '废水'),
|
||||
(2, '废气'),
|
||||
(3, '噪声')
|
||||
(3, '噪声'),
|
||||
(4, '废水治理'),
|
||||
)
|
||||
clfs_choices = (
|
||||
('1', '自行利用'),
|
||||
|
@ -265,6 +267,18 @@ class Waterequipment(CommonModel):
|
|||
jcyqmodel = models.CharField('监测仪器型号', max_length=100, null=True, blank=True)
|
||||
note = models.CharField('备注', max_length=500, null=True, blank=True)
|
||||
usecomp = models.ForeignKey(Partment, on_delete=models.CASCADE, verbose_name='所属公司')
|
||||
|
||||
class GasTestEquipment(CommonModel):
|
||||
"""
|
||||
废气检测仪器
|
||||
"""
|
||||
drain = models.ForeignKey(Drain, verbose_name='关联排放口', on_delete=models.CASCADE)
|
||||
contaminant = models.CharField('污染物', max_length=100)
|
||||
model = models.CharField('仪器型号', max_length=100)
|
||||
state = models.CharField('设备状态', default='正常', max_length=100)
|
||||
remark = models.CharField('备注', max_length=200)
|
||||
usecomp = models.ForeignKey(Partment, on_delete=models.CASCADE, verbose_name='所属公司')
|
||||
|
||||
class Archives(CommonModel):
|
||||
"""
|
||||
档案管理
|
||||
|
@ -279,3 +293,4 @@ class Archives(CommonModel):
|
|||
note = models.CharField('备注', max_length=500, null=True, blank=True)
|
||||
usecomp = models.ForeignKey(Partment, on_delete=models.CASCADE, null=True, blank=True,verbose_name='所属公司')
|
||||
|
||||
|
|
@ -331,6 +331,8 @@
|
|||
function saveArchives(){
|
||||
var data = $('#arechivesForm').serializeJSON();
|
||||
data['filepath'] = document.getElementById('url').innerHTML;
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: waste_action_url,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div style="padding: 10px;" id="fulldiv">
|
||||
</div>
|
||||
<script>
|
||||
$.get('/api/enp/drain/combobox/', function (res) {
|
||||
$.get('/api/enp/drain/combobox/?need_predict=1', function (res) {
|
||||
for (var i = 0; i < res.length; i++) {
|
||||
var drain = res[i]
|
||||
var panelId = 'panel' + res[i]['id']
|
||||
|
@ -11,17 +11,17 @@
|
|||
height: 360,
|
||||
title: panelTitle,
|
||||
});
|
||||
var div1 = panelId + 'out_smoke';
|
||||
// var div1 = panelId + 'out_smoke';
|
||||
var div2 = panelId + 'out_so2';
|
||||
var div3 = panelId + 'out_particle';
|
||||
var div4 = panelId + 'out_nox';
|
||||
$('#' + panelId).append(
|
||||
'<div style="float:left;width:25%;height:100%" id="' + div1 + '"></div>' +
|
||||
'<div style="float:left;width:25%;height:100%" id="' + div2 + '"></div>' +
|
||||
'<div style="float:left;width:25%;height:100%" id="' + div3 + '"></div>' +
|
||||
'<div style="float:left;width:25%;height:100%" id="' + div4 + '"></div>'
|
||||
// '<div style="float:left;width:25%;height:100%" id="' + div1 + '"></div>' +
|
||||
'<div style="float:left;width:33%;height:100%" id="' + div2 + '"></div>' +
|
||||
'<div style="float:left;width:33%;height:100%" id="' + div3 + '"></div>' +
|
||||
'<div style="float:left;width:33%;height:100%" id="' + div4 + '"></div>'
|
||||
)
|
||||
initMap(div1, 'out_smoke', res[i]['id'], '标态干烟气量', 'Nm3/h');
|
||||
// initMap(div1, 'out_smoke', res[i]['id'], '标态干烟气量', 'Nm3/h');
|
||||
initMap(div2, 'out_so2', res[i]['id'], '二氧化硫', 'mg/m3');
|
||||
initMap(div3, 'out_particle', res[i]['id'], '颗粒物', 'mg/m3');
|
||||
initMap(div4, 'out_nox', res[i]['id'], '氮氧化物', 'mg/m3');
|
||||
|
@ -111,7 +111,7 @@
|
|||
option.series[0].data = ydata
|
||||
option.series[0].markArea.data = [ [{
|
||||
name: '预测区',
|
||||
xAxis: leng-3
|
||||
xAxis: leng-2
|
||||
}, {
|
||||
xAxis: leng-1
|
||||
}] ]
|
||||
|
@ -121,7 +121,7 @@
|
|||
}, {
|
||||
gt: leng-3,
|
||||
lte: leng-2,
|
||||
color: 'red'
|
||||
color: 'green'
|
||||
}, {
|
||||
gt: leng-2,
|
||||
color: 'red'
|
||||
|
|
|
@ -0,0 +1,202 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%;">
|
||||
|
||||
|
||||
<div data-options="region:'center',title:'废气治理设备表',split:true,border:false" style="height:100%;">
|
||||
<div id="wpreventionTableBar">
|
||||
<a onclick="addwprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
|
||||
<a onclick="ediwprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
|
||||
<a onclick="delwprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
|
||||
</div>
|
||||
<table id="wpreventionTable" style="height:100%"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="wpreventionDialog" class="easyui-dialog" style="width:800px;height:600px;padding:20px 25px;"
|
||||
data-options="resizable:true,modal:true,closed:true,border:false">
|
||||
<form method="post" id="wpreventionForm">
|
||||
<input name="id" type="hidden">
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="name" data-options="label:'治理设备名称', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
<input name="number" data-options="label:'编码', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="type" data-options="label:'设备型号',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
<input name="cs_name" data-options="label:'参数名称', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="desig_nnumber" data-options="label:'设计值',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="em_unit" data-options="label:'单位',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="start_time" data-options="label:'运行开始时间', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
|
||||
|
||||
<input name="end_time" data-options="label:'运行结束日期', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="state" data-options="label:'运行状态',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
<input name="ckll" data-options="label:'出口流量', labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="wryz" data-options="label:'污染因子',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
<input name="zlxl" data-options="label:'治理效率', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="sjly" data-options="label:'数据来源',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
<input name="pqfx" data-options="label:'排放去向',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="wncsl" data-options="label:'污泥产生量', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
<select class="easyui-combobox" data-options="label:'处理方式' " name="clfs" style="width:300px;">
|
||||
<option value="1">自行利用</option>
|
||||
<option value="2">委托处置</option>
|
||||
<option value="3">自行处置</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="hdl" data-options="label:'耗电量kWh', labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="yjname" data-options="label:'药剂名称',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="tjtime" data-options="label:'添加时间', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
|
||||
<input name="tjl" data-options="label:'添加量',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="savewprevention()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var wprevention_action_url = '/api/enp/wtequipment/create/';
|
||||
|
||||
$('#wpreventionTable').datagrid({
|
||||
url: '/api/enp/wtequipment/list/',
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
method: 'get',
|
||||
toolbar: '#wpreventionTableBar',
|
||||
border: false,
|
||||
columns: [[
|
||||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'name', title: '治理设备名称', width: 200 },
|
||||
{ field: 'number', title: '编码', width: 200 },
|
||||
{ field: 'type', title: '治理设备型号', width: 200 },
|
||||
{ field: 'cs_name', title: '参数名', width: 200 },
|
||||
{ field: 'desig_nnumber', title: '设计值', width: 200 },
|
||||
{ field: 'em_unit', title: '单位', width: 200 },
|
||||
{ field: 'start_time', title: '运行开始时间', width: 200 },
|
||||
{ field: 'end_time', title: '运行结束时间', width: 200 },
|
||||
{ field: 'state', title: '运行状态', width: 200 },
|
||||
{ field: 'ckll', title: '出口流量', width: 200 },
|
||||
{ field: 'wryz', title: '污染因子', width: 200 },
|
||||
{ field: 'zlxl', title: '治理效率', width: 200 },
|
||||
{ field: 'sjly', title: '数据来源', width: 200 },
|
||||
{ field: 'pqfx', title: '排放去向', width: 200 },
|
||||
{ field: 'wncsl', title: '污泥产生量', width: 200 },
|
||||
{field:'clfs',title:'处理方式', width:200,
|
||||
formatter: function(value,row,index){
|
||||
if (value=='1'){
|
||||
return '自行利用';
|
||||
}
|
||||
else if (value=='2') {
|
||||
return '委托处置';
|
||||
}
|
||||
else{
|
||||
return '自行处置';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'hdl', title: '耗电量kWh', width: 200 },
|
||||
{ field: 'yjname', title: '药剂名称', width: 200 },
|
||||
{ field: 'tjtime', title: '添加时间', width: 200 },
|
||||
{ field: 'tjl', title: '添加量', width: 200 },
|
||||
|
||||
|
||||
]],
|
||||
onClickRow: function (index, row) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//新增
|
||||
function addwprevention() {
|
||||
$('#wpreventionDialog').dialog('open').dialog('setTitle', '新增治理设备表').window('center');
|
||||
$('#wpreventionForm').form('clear');
|
||||
wprevention_action_url = '/api/enp/wtequipment/create/'
|
||||
}
|
||||
//保存数据
|
||||
function savewprevention() {
|
||||
var data = $('#wpreventionForm').serializeJSON();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: wprevention_action_url,
|
||||
data: JSON.stringify(data),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
return $('#wpreventionForm').form('validate')
|
||||
},
|
||||
success: function (data) {
|
||||
$("#wpreventionTable").datagrid('reload');
|
||||
$("#wpreventionDialog").dialog("close");
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
//编辑数据
|
||||
function ediwprevention(){
|
||||
var row = $('#wpreventionTable').datagrid('getSelected');
|
||||
if(row){
|
||||
$('#wpreventionDialog').dialog('open').dialog('setTitle', '编辑治理设备表').window('center');
|
||||
$('#wpreventionForm').form('load', row);
|
||||
wprevention_action_url = '/api/enp/wtequipment/update/'}
|
||||
else{
|
||||
$.messager.alert('提示', '请选择一条数据!');
|
||||
}
|
||||
}
|
||||
//删除数据
|
||||
function delwprevention(){
|
||||
var row = $('#wpreventionTable').datagrid('getSelected');
|
||||
if (row) {
|
||||
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
||||
if (r) {
|
||||
var data = { id: row.id }
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/api/enp/wtequipment/delete/',
|
||||
data: JSON.stringify(data),
|
||||
datatype: "json",
|
||||
beforeSend: function () { },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#wpreventionTable").datagrid('reload');
|
||||
$("#wpreventionTable").datagrid('reload');
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '操作失败!');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一条数据!'); }
|
||||
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,138 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%;">
|
||||
|
||||
|
||||
<div data-options="region:'center',split:true,border:false" style="height:100%;">
|
||||
<div id="gastestequipTableBar">
|
||||
<a onclick="addwaterequipment()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
|
||||
<a onclick="ediwaterequipment()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
|
||||
<a onclick="delwaterequipment()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
|
||||
</div>
|
||||
<table id="gastestequipTable" style="height:100%"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="gastestequipDialog" class="easyui-dialog" style="width:700px;height:600px;padding:20px 25px;"
|
||||
data-options="resizable:true,modal:true,closed:true,border:false">
|
||||
<form method="post" id="gastestequipForm">
|
||||
<input name="id" type="hidden">
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="drain" data-options="label:'排放口', labelWidth:100" class="easyui-textbox" style="width:600px;" ></input>
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="contaminant" data-options="label:'污染物',labelWidth:100" class="easyui-textbox" style="width:600px;" ></input>
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="model" data-options="label:'仪器型号',labelWidth:100" class="easyui-textbox" style="width:600px;" ></input>
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<select name='state' data-options="label:'设备状态',labelWidth:100" class="easyui-combobox" style="width:600px;"
|
||||
editable=false>
|
||||
<option value="">请选择</option>
|
||||
<option value="1">正常</option>
|
||||
<option value="0">异常</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="remark" data-options="label:'备注',labelWidth:100" class="easyui-textbox" style="width:600px;" ></input>
|
||||
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="savegastestequip()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var gastestequip_action_url = '/api/enp/gastestequipment/create/';
|
||||
|
||||
$('#gastestequipTable').datagrid({
|
||||
url: '/api/enp/gastestequipment/list/',
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
method: 'get',
|
||||
toolbar: '#gastestequipTableBar',
|
||||
border: false,
|
||||
columns: [[
|
||||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'drain__name', title: '排放口', width: 200 },
|
||||
{ field: 'contaminant', title: '污染物', width: 200 },
|
||||
{ field: 'model', title: '仪器型号', width: 200 },
|
||||
{ field: 'state', title: '设备状态', width: 200 },
|
||||
{ field: 'remark', title: '备注', width: 200 },
|
||||
]],
|
||||
onClickRow: function (index, row) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//新增
|
||||
function addwaterequipment() {
|
||||
$('#gastestequipDialog').dialog('open').dialog('setTitle', '新增').window('center');
|
||||
$('#gastestequipForm').form('clear');
|
||||
gastestequip_action_url = '/api/enp/gastestequipment/create/'
|
||||
}
|
||||
//保存数据
|
||||
function savegastestequip() {
|
||||
var data = $('#gastestequipForm').serializeJSON();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: gastestequip_action_url,
|
||||
data: JSON.stringify(data),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
return $('#gastestequipForm').form('validate')
|
||||
},
|
||||
success: function (data) {
|
||||
$("#gastestequipTable").datagrid('reload');
|
||||
$("#gastestequipDialog").dialog("close");
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
//编辑数据
|
||||
function ediwaterequipment(){
|
||||
var row = $('#gastestequipTable').datagrid('getSelected');
|
||||
if(row){
|
||||
$('#gastestequipDialog').dialog('open').dialog('setTitle', '编辑').window('center');
|
||||
$('#gastestequipForm').form('load', row);
|
||||
gastestequip_action_url = '/api/enp/gastestequipment/update/'}
|
||||
else{
|
||||
$.messager.alert('提示', '请选择一条数据!');
|
||||
}
|
||||
}
|
||||
//删除数据
|
||||
function delwaterequipment(){
|
||||
var row = $('#gastestequipTable').datagrid('getSelected');
|
||||
if (row) {
|
||||
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
||||
if (r) {
|
||||
var data = { id: row.id }
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/api/enp/gastestequipment/delete/',
|
||||
data: JSON.stringify(data),
|
||||
datatype: "json",
|
||||
beforeSend: function () { },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#gastestequipTable").datagrid('reload');
|
||||
$("#gastestequipTable").datagrid('reload');
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '操作失败!');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一条数据!'); }
|
||||
|
||||
}
|
||||
</script>
|
|
@ -29,63 +29,73 @@
|
|||
<input name="name" data-options="label:'排放口名称'" class="easyui-textbox" style="width:300px;"
|
||||
required></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<select class="easyui-combobox" name="need_predict" label="是否预测" style="width:300px;">
|
||||
<option value=1>是</option>
|
||||
<option value=0>否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="saveDrain()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="gasEmitDialog" class="easyui-dialog" style="width:400px;height:800px;padding:5px 15px;"
|
||||
<div id="gasEmitDialog" class="easyui-dialog" style="width:700px;height:500px;padding:5px 15px;"
|
||||
data-options="resizable:true,modal:true,closed:true,border:false">
|
||||
<form method="post" id="gasEmitForm">
|
||||
<input name="id" type="hidden">
|
||||
<input name="drain" type="hidden" id="gasEmitForm_drain">
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="watch_time" data-options="label:'监测时间', editable:false, labelWidth:120" class="easyui-datetimebox" style="width:300px;" ></input>
|
||||
<input name="watch_time" data-options="label:'监测时间', editable:false, labelWidth:120" class="easyui-datetimebox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="out_smoke" data-options="label:'出:标态干烟气量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_smoke" data-options="label:'出:标态干烟气量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="out_o2" data-options="label:'出:氧含量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="out_so2" data-options="label:'出:二氧化硫', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_o2" data-options="label:'出:氧含量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="out_so2_s" data-options="label:'出:二氧化硫:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="out_particle" data-options="label:'出:颗粒物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_so2" data-options="label:'出:二氧化硫', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="out_particle_s" data-options="label:'出:颗粒物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="out_nox" data-options="label:'出:氮氧化物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_so2_s" data-options="label:'出:二氧化硫:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="out_nox_s" data-options="label:'出:氮氧化物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="in_smoke" data-options="label:'入:标态干烟气量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_particle" data-options="label:'出:颗粒物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="in_o2" data-options="label:'入:氧含量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="in_so2" data-options="label:'入:二氧化硫', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_particle_s" data-options="label:'出:颗粒物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="in_so2_s" data-options="label:'入:二氧化硫:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="in_particle" data-options="label:'入:颗粒物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_nox" data-options="label:'出:氮氧化物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="out_nox_s" data-options="label:'出:氮氧化物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_smoke" data-options="label:'入:标态干烟气量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_o2" data-options="label:'入:氧含量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_so2" data-options="label:'入:二氧化硫', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_so2_s" data-options="label:'入:二氧化硫:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_particle" data-options="label:'入:颗粒物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_particle_s" data-options="label:'入:颗粒物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_nox" data-options="label:'入:氮氧化物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
<input name="in_particle_s" data-options="label:'入:颗粒物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:left" ></input>
|
||||
|
||||
<input name="in_nox" data-options="label:'入:氮氧化物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;float:right" ></input>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input name="in_nox_s" data-options="label:'入:氮氧化物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" ></input>
|
||||
|
@ -117,6 +127,7 @@
|
|||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'number', title: '排放口编号', width: 100 },
|
||||
{ field: 'name', title: '排放口名称', width: 100 },
|
||||
{ field: 'need_predict', title: '是否预测', width: 80 },
|
||||
]],
|
||||
onClickRow: function (index, row) {
|
||||
$('#gasEmitTable').datagrid({
|
||||
|
@ -170,7 +181,7 @@
|
|||
|
||||
}
|
||||
function editDrain(){
|
||||
var row = $('#draineTable').datagrid('getSelected');
|
||||
var row = $('#drainTable').datagrid('getSelected');
|
||||
if(row){
|
||||
$('#drainDialog').dialog('open').dialog('setTitle', '编辑排放口').window('center');
|
||||
$('#drainForm').form('load', row);
|
||||
|
|
|
@ -13,8 +13,11 @@ urlpatterns = [
|
|||
path('detection/', views.HtmlDetection),
|
||||
path('fuel/', views.HtmlFuel),
|
||||
path('waterequipment/', views.HtmlWaterequipment),
|
||||
path('gastestequipment/', views.HtmlGasTestEquipment),
|
||||
path('archives/', views.HtmlArchives),
|
||||
path('zprevention/', views.HtmlZprevention),
|
||||
path('gastequipment/', views.Htmlgastequipment),
|
||||
|
||||
|
||||
|
||||
]
|
|
@ -17,15 +17,13 @@ urlpatterns = [
|
|||
path('facilities/<str:action>/', views.ApiFacilities),#环境设施,生产设施
|
||||
path('wprevention/<str:action>/', views.ApiWprevention),#废水防治设施
|
||||
path('gprevention/<str:action>/', views.ApiGprevention),#废水防治设施
|
||||
path('wtequipment/<str:action>/', views.ApiWpreventionequipment),#废气治理设备
|
||||
path('abnormal/<str:action>/', views.ApiAbnormal),#防治设施异常
|
||||
path('detection/<str:action>/', views.ApiDetection),#废水污染物检测
|
||||
path('fuel/<str:action>/', views.ApiFuel),#燃料信息表
|
||||
path('waterequipment/<str:action>/', views.ApiWaterequipment),#废水监测仪器信息表
|
||||
path('gastestequipment/<str:action>/', views.ApiGasTestEquipment),#废气监测仪器信息表
|
||||
path('archives/<str:action>/', views.ApiArchives),#档案管理表
|
||||
path('zprevention/<str:action>/', views.ApiZprevention),#噪声防治设施
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
136
enp/views.py
136
enp/views.py
|
@ -5,7 +5,7 @@ from rest_framework.views import APIView
|
|||
from rest_framework.authentication import BaseAuthentication
|
||||
from safesite.models import User,Dickey,Partment
|
||||
from rest_framework.exceptions import AuthenticationFailed
|
||||
from .models import DWasteHandleRecord, DWasteKeepRecord, DWasteMakeList, DWasteMakeRecord, Drain, GasEmit, NormalWasteRecord, Waste, Facilities,Prevention,abnormal,Detection,Fuel,Waterequipment,Archives
|
||||
from .models import DWasteHandleRecord, DWasteKeepRecord, DWasteMakeList, DWasteMakeRecord, Drain, GasEmit, GasTestEquipment, NormalWasteRecord, Waste, Facilities,Prevention,abnormal,Detection,Fuel,Waterequipment,Archives
|
||||
from safesite.views import transjson, fenye, MyEncoder
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
import json
|
||||
|
@ -44,12 +44,18 @@ def HtmlFuel(request):
|
|||
return render(request, 'fuel.html')
|
||||
def HtmlWaterequipment(request):
|
||||
return render(request, 'waterequipment.html')
|
||||
def HtmlGasTestEquipment(request):
|
||||
return render(request, 'gastestequipment.html')
|
||||
def HtmlGprevention(request):
|
||||
return render(request, 'gprevention.html')
|
||||
def HtmlArchives(request):
|
||||
return render(request, 'archives.html')
|
||||
def HtmlZprevention(request):
|
||||
return render(request, 'zprevention.html')
|
||||
|
||||
def Htmlgastequipment(request):
|
||||
return render(request, 'gastequipment.html')
|
||||
|
||||
# 转换为combobox所用string
|
||||
|
||||
|
||||
|
@ -296,6 +302,9 @@ def ApiGprevention(request, action):
|
|||
obj = Prevention.objects.get(id=data['id'])
|
||||
obj.delete()
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
|
||||
|
||||
#废水防治设施
|
||||
def ApiWprevention(request, action):
|
||||
user = User.objects.get(userid=request.session['userid'])
|
||||
|
@ -370,6 +379,80 @@ def ApiWprevention(request, action):
|
|||
obj = Prevention.objects.get(id=data['id'])
|
||||
obj.delete()
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
def ApiWpreventionequipment(request, action):
|
||||
user = User.objects.get(userid=request.session['userid'])
|
||||
if action == 'list':
|
||||
objs = Prevention.objects.filter(usecomp=user.usecomp, is_deleted=False,preventiontype=4)
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(request)
|
||||
objs = objs.order_by('-create_time')[startnum:endnum].values('id', 'name', 'number', 'type', 'preventiontype', 'cs_name',
|
||||
'desig_nnumber', 'em_unit', 'start_time', 'end_time', 'state', 'ckll', 'wryz', 'zlxl',
|
||||
'sjly', 'pqfx', 'wncsl', 'clfs','hdl','yjname', 'tjtime', 'tjl')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif action == 'create':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
obj = Prevention()
|
||||
obj.create_by = user
|
||||
obj.update_by = user
|
||||
obj.usecomp = user.usecomp
|
||||
obj.name = data['name']
|
||||
obj.number = data['number']
|
||||
obj.preventiontype=4
|
||||
obj.type = data['type']
|
||||
obj.cs_name = data['cs_name']
|
||||
obj.desig_nnumber = data['desig_nnumber']
|
||||
obj.em_unit = data['em_unit']
|
||||
obj.start_time = data['start_time']
|
||||
obj.end_time = data['end_time']
|
||||
obj.state = data['state']
|
||||
obj.ckll = data['ckll']
|
||||
obj.wryz = data['wryz']
|
||||
obj.zlxl = data['zlxl']
|
||||
obj.sjly = data['sjly']
|
||||
obj.pqfx = data['pqfx']
|
||||
obj.wncsl = data['wncsl']
|
||||
obj.clfs = data['clfs']
|
||||
obj.hdl = data['hdl']
|
||||
obj.yjname = data['yjname']
|
||||
obj.tjtime = data['tjtime']
|
||||
obj.tjl = data['tjl']
|
||||
obj.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif action == 'update':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
obj = Prevention.objects.get(id=data['id'])
|
||||
obj.create_by = user
|
||||
obj.update_by = user
|
||||
obj.usecomp = user.usecomp
|
||||
obj.name = data['name']
|
||||
obj.number = data['number']
|
||||
obj.preventiontype=4
|
||||
obj.type = data['type']
|
||||
obj.cs_name = data['cs_name']
|
||||
obj.desig_nnumber = data['desig_nnumber']
|
||||
obj.em_unit = data['em_unit']
|
||||
obj.start_time = data['start_time']
|
||||
obj.end_time = data['end_time']
|
||||
obj.state = data['state']
|
||||
obj.ckll = data['ckll']
|
||||
obj.wryz = data['wryz']
|
||||
obj.zlxl = data['zlxl']
|
||||
obj.sjly = data['sjly']
|
||||
obj.pqfx = data['pqfx']
|
||||
obj.wncsl = data['wncsl']
|
||||
obj.clfs = data['clfs']
|
||||
obj.hdl = data['hdl']
|
||||
obj.yjname = data['yjname']
|
||||
obj.tjtime = data['tjtime']
|
||||
obj.tjl = data['tjl']
|
||||
obj.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif action == 'delete':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
obj = Prevention.objects.get(id=data['id'])
|
||||
obj.delete()
|
||||
return JsonResponse({"code":1})
|
||||
#防治设施异常
|
||||
def ApiAbnormal(request, action):
|
||||
user = User.objects.get(userid=request.session['userid'])
|
||||
|
@ -757,11 +840,14 @@ def ApiDrainq(request, action):
|
|||
objs = Drain.objects.filter(usecomp=user.usecomp, is_deleted=False,type=20)
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(request)
|
||||
objs = objs.order_by('id')[startnum:endnum].values('id', 'number', 'name')
|
||||
objs = objs.order_by('id')[startnum:endnum].values('id', 'number', 'name', 'need_predict')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif action == 'combobox':
|
||||
objs = Drain.objects.filter(usecomp=user.usecomp, is_deleted=False).order_by('id')
|
||||
data = objs.values('id', 'number', 'name')
|
||||
objs = Drain.objects.filter(usecomp=user.usecomp, is_deleted=False, type=20).order_by('id')
|
||||
need_predict = request.GET.get('need_predict', False)
|
||||
if need_predict:
|
||||
objs = objs.filter(need_predict=need_predict)
|
||||
data = objs.values('id', 'number', 'name', 'need_predict')
|
||||
return JsonResponse(list(data), safe=False)
|
||||
elif action == 'create':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
|
@ -769,6 +855,7 @@ def ApiDrainq(request, action):
|
|||
obj.number = data['number']
|
||||
obj.type = 20
|
||||
obj.name = data['name']
|
||||
obj.need_predict = data['need_predict']
|
||||
obj.create_by = user
|
||||
obj.update_by = user
|
||||
obj.usecomp = user.usecomp
|
||||
|
@ -785,6 +872,7 @@ def ApiDrainq(request, action):
|
|||
obj.number = data['number']
|
||||
obj.type = 20
|
||||
obj.name = data['name']
|
||||
obj.need_predict = data['need_predict']
|
||||
obj.update_by=user
|
||||
obj.save()
|
||||
return JsonResponse({"code":1})
|
||||
|
@ -970,4 +1058,42 @@ def ApiGasPredict(request, element, drainId):
|
|||
return JsonResponse(ret)
|
||||
else:
|
||||
return JsonResponse({"code":0, "msg":'至少需要三条记录'})
|
||||
|
||||
|
||||
|
||||
def ApiGasTestEquipment(request, action):
|
||||
user = User.objects.get(userid=request.session['userid'])
|
||||
if action == 'list':
|
||||
objs = GasTestEquipment.objects.filter(usecomp=user.usecomp, is_deleted=False)
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(request)
|
||||
objs = objs.order_by('id')[startnum:endnum].values('id', 'drain', 'drain__name', 'contaminant', 'model', 'state', 'remark')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif action == 'create':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
obj= GasTestEquipment()
|
||||
obj.drain = Drain.objects.get(id=data['drain'])
|
||||
obj.contaminant = data['contaminant']
|
||||
obj.model = data['model']
|
||||
obj.state = data['state']
|
||||
obj.remark = data['remark']
|
||||
obj.create_by = user
|
||||
obj.update_by = user
|
||||
obj.usecomp = user.usecomp
|
||||
obj.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif action == 'delete':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
obj = GasTestEquipment.objects.get(id=data['id'])
|
||||
obj.delete()
|
||||
return JsonResponse({"code":1})
|
||||
elif action == 'update':
|
||||
data = json.loads(request.body.decode('utf-8'))
|
||||
obj = GasTestEquipment.objects.get(id=data['id'])
|
||||
obj.contaminant = data['contaminant']
|
||||
obj.model = data['model']
|
||||
obj.state = data['state']
|
||||
obj.remark = data['remark']
|
||||
obj.update_by=user
|
||||
obj.save()
|
||||
return JsonResponse({"code":1})
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (C) 2012-present SheetJS LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -1,118 +0,0 @@
|
|||
/*
|
||||
tableExport.jquery.plugin
|
||||
|
||||
Version 1.30.0
|
||||
|
||||
Copyright (c) 2015-2024 hhurz,
|
||||
https://github.com/hhurz/tableExport.jquery.plugin
|
||||
|
||||
Based on https://github.com/kayalshri/tableExport.jquery.plugin
|
||||
|
||||
Licensed under the MIT License
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,F,t){d instanceof String&&(d=String(d));for(var D=d.length,K=0;K<D;K++){var wa=d[K];if(F.call(t,wa,K,d))return{i:K,v:wa}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,F,t){d!=Array.prototype&&d!=Object.prototype&&(d[F]=t.value)};
|
||||
$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(d,F,t,D){if(F){t=$jscomp.global;d=d.split(".");for(D=0;D<d.length-1;D++){var K=d[D];K in t||(t[K]={});t=t[K]}d=d[d.length-1];D=t[d];F=F(D);F!=D&&null!=F&&$jscomp.defineProperty(t,d,{configurable:!0,writable:!0,value:F})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,t){return $jscomp.findInternal(this,d,t).v}},"es6","es3");$jscomp.polyfill("Object.is",function(d){return d?d:function(d,t){return d===t?0!==d||1/d===1/t:d!==d&&t!==t}},"es6","es3");$jscomp.polyfill("Array.prototype.includes",function(d){return d?d:function(d,t){var D=this;D instanceof String&&(D=String(D));var F=D.length;for(t=t||0;t<F;t++)if(D[t]==d||Object.is(D[t],d))return!0;return!1}},"es7","es3");
|
||||
$jscomp.checkStringArgs=function(d,F,t){if(null==d)throw new TypeError("The 'this' value for String.prototype."+t+" must not be null or undefined");if(F instanceof RegExp)throw new TypeError("First argument to String.prototype."+t+" must not be a regular expression");return d+""};$jscomp.polyfill("String.prototype.includes",function(d){return d?d:function(d,t){return-1!==$jscomp.checkStringArgs(this,d,"includes").indexOf(d,t||0)}},"es6","es3");
|
||||
(function(d){function F(){return{theme:"striped",styles:{},headerStyles:{},bodyStyles:{},alternateRowStyles:{},columnStyles:{},startY:!1,margin:40,pageBreak:"auto",tableWidth:"auto",createdHeaderCell:function(d,t){},createdCell:function(d,t){},drawHeaderRow:function(d,t){},drawRow:function(d,t){},drawHeaderCell:function(d,t){},drawCell:function(d,t){},beforePageContent:function(d){},afterPageContent:function(d){}}}d.fn.tableExport=function(lb){function W(a){var c=[];P(a,"thead").each(function(){c.push.apply(c,
|
||||
P(d(this),b.theadSelector).toArray())});return c}function X(a){var c=[];P(a,"tbody").each(function(){c.push.apply(c,P(d(this),b.tbodySelector).toArray())});b.tfootSelector.length&&P(a,"tfoot").each(function(){c.push.apply(c,P(d(this),b.tfootSelector).toArray())});return c}function P(a,c){var b=a[0].tagName,h=a.parents(b).length;return a.find(c).filter(function(){return h===d(this).closest(b).parents(b).length})}function xa(a){var c=[],b=0,h=0,f=0;d(a).find("thead").first().find("th").each(function(a,
|
||||
e){a=void 0!==d(e).attr("data-field");"undefined"!==typeof e.parentNode.rowIndex&&h!==e.parentNode.rowIndex&&(h=e.parentNode.rowIndex,b=f=0);var g=Y(e);for(b+=g?g:1;f<b;)c[f]=a?d(e).attr("data-field"):f.toString(),f++});return c}function O(a){var c="undefined"!==typeof a[0].rowIndex,b=!1===c&&"undefined"!==typeof a[0].cellIndex,h=b||c?mb(a):a.is(":visible"),f=a.attr("data-tableexport-display");b&&"none"!==f&&"always"!==f&&(a=d(a[0].parentNode),c="undefined"!==typeof a[0].rowIndex,f=a.attr("data-tableexport-display"));
|
||||
c&&"none"!==f&&"always"!==f&&(f=a.closest("table").attr("data-tableexport-display"));return"none"!==f&&(!0===h||"always"===f)}function mb(a){var c=[];ja&&(c=Q.filter(function(){var c=!1;this.nodeType===a[0].nodeType&&("undefined"!==typeof this.rowIndex&&this.rowIndex===a[0].rowIndex?c=!0:"undefined"!==typeof this.cellIndex&&this.cellIndex===a[0].cellIndex&&"undefined"!==typeof this.parentNode.rowIndex&&"undefined"!==typeof a[0].parentNode.rowIndex&&this.parentNode.rowIndex===a[0].parentNode.rowIndex&&
|
||||
(c=!0));return c}));return!1===ja||0===c.length}function Wa(a,c,e){var h=!1;O(a)?0<b.ignoreColumn.length&&(-1!==d.inArray(e,b.ignoreColumn)||-1!==d.inArray(e-c,b.ignoreColumn)||fa.length>e&&"undefined"!==typeof fa[e]&&-1!==d.inArray(fa[e],b.ignoreColumn))&&(h=!0):h=!0;return h}function I(a,c,e,h,f){if("function"===typeof f){var w=!1;"function"===typeof b.onIgnoreRow&&(w=b.onIgnoreRow(d(a),e));if(!1===w&&(0===b.ignoreRow.length||-1===d.inArray(e,b.ignoreRow)&&-1===d.inArray(e-h,b.ignoreRow))&&O(d(a))){a=
|
||||
P(d(a),c);var m=a.length,g=0,p=0;a.each(function(){var a=d(this),c=Y(this),b=ka(this),h;d.each(N,function(){if(e>this.s.r&&e<=this.e.r&&g>=this.s.c&&g<=this.e.c)for(h=0;h<=this.e.c-this.s.c;++h)m++,p++,f(null,e,g++)});if(b||c)c=c||1,N.push({s:{r:e,c:g},e:{r:e+(b||1)-1,c:g+c-1}});!1===Wa(a,m,p++)&&f(this,e,g++);if(1<c)for(h=0;h<c-1;++h)p++,f(null,e,g++)});d.each(N,function(){if(e>=this.s.r&&e<=this.e.r&&g>=this.s.c&&g<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f(null,e,g++)})}}}function Xa(a,c,
|
||||
b,h){if("undefined"!==typeof h.images&&(b=h.images[b],"undefined"!==typeof b)){c=c.getBoundingClientRect();var e=a.width/a.height,d=c.width/c.height,m=a.width,g=a.height,p=19.049976/25.4,B=0;d<=e?(g=Math.min(a.height,c.height),m=c.width*g/c.height):d>e&&(m=Math.min(a.width,c.width),g=c.height*m/c.width);m*=p;g*=p;g<a.height&&(B=(a.height-g)/2);try{h.doc.addImage(b.src,a.textPos.x,a.y+B,m,g)}catch(A){}a.textPos.x+=m}}function Ya(a,c){if("string"===b.outputMode)return a.output();if("base64"===b.outputMode)return R(a.output());
|
||||
if("window"===b.outputMode)window.URL=window.URL||window.webkitURL,window.open(window.URL.createObjectURL(a.output("blob")));else{var e=b.fileName+".pdf";try{var d=a.output("blob");saveAs(d,e);if("function"===typeof b.onAfterSaveToFile)b.onAfterSaveToFile(d,e)}catch(f){Ga(e,"data:application/pdf"+(c?"":";base64")+",",c?a.output("blob"):a.output())}}}function Za(a,c,b){var e=0;"undefined"!==typeof b&&(e=b.colspan);if(0<=e){for(var d=a.width,w=a.textPos.x,m=c.table.columns.indexOf(c.column),g=1;g<e;g++)d+=
|
||||
c.table.columns[m+g].width;1<e&&("right"===a.styles.halign?w=a.textPos.x+d-a.width:"center"===a.styles.halign&&(w=a.textPos.x+(d-a.width)/2));a.width=d;a.textPos.x=w;"undefined"!==typeof b&&1<b.rowspan&&(a.height*=b.rowspan);if("middle"===a.styles.valign||"bottom"===a.styles.valign)b=("string"===typeof a.text?a.text.split(/\r\n|\r|\n/g):a.text).length||1,2<b&&(a.textPos.y-=(2-1.15)/2*c.row.styles.fontSize*(b-2)/3);return!0}return!1}function $a(a,c,b){"undefined"!==typeof a&&null!==a&&(a.hasAttribute("data-tableexport-canvas")?
|
||||
(c=(new Date).getTime(),d(a).attr("data-tableexport-canvas",c),b.images[c]={url:'[data-tableexport-canvas="'+c+'"]',src:null}):"undefined"!==c&&null!=c&&c.each(function(){if(d(this).is("img")){var c=ab(this.src);b.images[c]={url:this.src,src:this.src}}$a(a,d(this).children(),b)}))}function nb(a,c){function b(a){if(a.url)if(a.src){var b=new Image;h=++f;b.crossOrigin="Anonymous";b.onerror=b.onload=function(){if(b.complete&&(0===b.src.indexOf("data:image/")&&(b.width=a.width||b.width||0,b.height=a.height||
|
||||
b.height||0),b.width+b.height)){var e=document.createElement("canvas"),d=e.getContext("2d");e.width=b.width;e.height=b.height;d.drawImage(b,0,0);a.src=e.toDataURL("image/png")}--f||c(h)};b.src=a.url}else{var e=d(a.url);e.length&&(h=++f,html2canvas(e[0]).then(function(b){a.src=b.toDataURL("image/png");--f||c(h)}))}}var h=0,f=0;if("undefined"!==typeof a.images)for(var w in a.images)a.images.hasOwnProperty(w)&&b(a.images[w]);(a=f)||(c(h),a=void 0);return a}function bb(a,c,e){c.each(function(){if(d(this).is("div")){var c=
|
||||
ya(J(this,"background-color"),[255,255,255]),f=ya(J(this,"border-top-color"),[0,0,0]),w=cb(this,"border-top-width",b.jspdf.unit),m=this.getBoundingClientRect(),g=this.offsetLeft*e.wScaleFactor,p=this.offsetTop*e.hScaleFactor,B=m.width*e.wScaleFactor;m=m.height*e.hScaleFactor;e.doc.setDrawColor.apply(void 0,f);e.doc.setFillColor.apply(void 0,c);e.doc.setLineWidth(w);e.doc.rect(a.x+g,a.y+p,B,m,w?"FD":"F")}else d(this).is("img")&&(c=ab(this.src),Xa(a,this,c,e));bb(a,d(this).children(),e)})}function db(a,
|
||||
c,e){if("function"===typeof e.onAutotableText)e.onAutotableText(e.doc,a,c);else{var h=a.textPos.x,f=a.textPos.y,w={halign:a.styles.halign,valign:a.styles.valign};if(c.length){for(c=c[0];c.previousSibling;)c=c.previousSibling;for(var m=!1,g=!1;c;){var p=c.innerText||c.textContent||"",B=p.length&&" "===p[0]?" ":"",A=1<p.length&&" "===p[p.length-1]?" ":"";!0!==b.preserve.leadingWS&&(p=B+Ha(p));!0!==b.preserve.trailingWS&&(p=Ia(p)+A);d(c).is("br")&&(h=a.textPos.x,f+=e.doc.internal.getFontSize());d(c).is("b")?
|
||||
m=!0:d(c).is("i")&&(g=!0);(m||g)&&e.doc.setFont("undefined ",m&&g?"bolditalic":m?"bold":"italic");if(B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize()){"linebreak"===a.styles.overflow&&h>a.textPos.x&&h+B>a.textPos.x+a.width&&(0<=".,!%*;:=-".indexOf(p.charAt(0))&&(A=p.charAt(0),B=e.doc.getStringUnitWidth(A)*e.doc.internal.getFontSize(),h+B<=a.textPos.x+a.width&&(za(A,h,f,w),p=p.substring(1,p.length)),B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize()),h=a.textPos.x,f+=e.doc.internal.getFontSize());
|
||||
if("visible"!==a.styles.overflow)for(;p.length&&h+B>a.textPos.x+a.width;)p=p.substring(0,p.length-1),B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize();za(p,h,f,w);h+=B}if(m||g)d(c).is("b")?m=!1:d(c).is("i")&&(g=!1),e.doc.setFont("undefined ",m||g?m?"bold":"italic":"normal");c=c.nextSibling}a.textPos.x=h;a.textPos.y=f}else za(a.text,a.textPos.x,a.textPos.y,w)}}function la(a,c,b){return null==a?"":a.toString().replace(new RegExp(null==c?"":c.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g,
|
||||
"\\$1"),"g"),b)}function Ha(a){return null==a?"":a.toString().replace(/^\s+/,"")}function Ia(a){return null==a?"":a.toString().replace(/\s+$/,"")}function ob(a){if(0===b.date.html.length)return!1;b.date.pattern.lastIndex=0;var c=b.date.pattern.exec(a);if(null==c)return!1;a=+c[b.date.match_y];if(0>a||8099<a)return!1;var e=1*c[b.date.match_m];c=1*c[b.date.match_d];if(!isFinite(c))return!1;var d=new Date(a,e-1,c,0,0,0);return d.getFullYear()===a&&d.getMonth()===e-1&&d.getDate()===c?new Date(Date.UTC(a,
|
||||
e-1,c,0,0,0)):!1}function Ja(a){a=a||"0";""!==b.numbers.html.thousandsSeparator&&(a=la(a,b.numbers.html.thousandsSeparator,""));"."!==b.numbers.html.decimalMark&&(a=la(a,b.numbers.html.decimalMark,"."));return"number"===typeof a||!1!==jQuery.isNumeric(a)?a:!1}function pb(a){-1<a.indexOf("%")?(a=Ja(a.replace(/%/g,"")),!1!==a&&(a/=100)):a=!1;return a}function G(a,c,e,h){var f="",w="text";if(null!==a){var m=d(a);m.removeData("teUserDefText");if(m[0].hasAttribute("data-tableexport-canvas"))var g="";else if(m[0].hasAttribute("data-tableexport-value"))g=
|
||||
(g=m.attr("data-tableexport-value"))?g+"":"",m.data("teUserDefText",1);else if(g=m.html(),"function"===typeof b.onCellHtmlData)g=b.onCellHtmlData(m,c,e,g),m.data("teUserDefText",1);else if(""!==g){a=d.parseHTML("<div>"+g+"</div>",null,!1);var p=0,B=0;g="";d.each(a,function(){if(d(this).is("input"))g+=m.find("input").eq(p++).val();else if(d(this).is("select"))g+=m.find("select option:selected").eq(B++).text();else if(d(this).is("br"))g+="<br>";else{if("undefined"===typeof d(this).html())g+=d(this).text();
|
||||
else if(void 0===jQuery().bootstrapTable||!1===d(this).hasClass("fht-cell")&&!1===d(this).hasClass("filterControl")&&0===m.parents(".detail-view").length)g+=d(this).html();if(d(this).is("a")){var a=m.find("a").attr("href")||"";f="function"===typeof b.onCellHtmlHyperlink?f+b.onCellHtmlHyperlink(m,c,e,a,g):"href"===b.htmlHyperlink?f+a:f+g;g=""}}})}if(g&&""!==g&&!0===b.htmlContent)f=d.trim(g);else if(g&&""!==g)if(""!==m.attr("data-tableexport-cellformat")){var A=g.replace(/\n/g,"\u2028").replace(/(<\s*br([^>]*)>)/gi,
|
||||
"\u2060"),k=d("<div/>").html(A).contents();a=!1;A="";d.each(k.text().split("\u2028"),function(a,c){0<a&&(A+=" ");!0!==b.preserve.leadingWS&&(c=Ha(c));A+=!0!==b.preserve.trailingWS?Ia(c):c});d.each(A.split("\u2060"),function(a,c){0<a&&(f+="\n");!0!==b.preserve.leadingWS&&(c=Ha(c));!0!==b.preserve.trailingWS&&(c=Ia(c));f+=c.replace(/\u00AD/g,"")});f=f.replace(/\u00A0/g," ");if("json"===b.type||"excel"===b.type&&"xmlss"===b.mso.fileFormat||!1===b.numbers.output)a=Ja(f),!1!==a&&(w="number",f=Number(a));
|
||||
else if(b.numbers.html.decimalMark!==b.numbers.output.decimalMark||b.numbers.html.thousandsSeparator!==b.numbers.output.thousandsSeparator)if(a=Ja(f),!1!==a){k=(""+a.substr(0>a?1:0)).split(".");1===k.length&&(k[1]="");var l=3<k[0].length?k[0].length%3:0;w="number";f=(0>a?"-":"")+(b.numbers.output.thousandsSeparator?(l?k[0].substr(0,l)+b.numbers.output.thousandsSeparator:"")+k[0].substr(l).replace(/(\d{3})(?=\d)/g,"$1"+b.numbers.output.thousandsSeparator):k[0])+(k[1].length?b.numbers.output.decimalMark+
|
||||
k[1]:"")}}else f=g;!0===b.escape&&(f=escape(f));"function"===typeof b.onCellData&&(f=b.onCellData(m,c,e,f,w),m.data("teUserDefText",1))}void 0!==h&&(h.type=w);return f}function eb(a){return 0<a.length&&!0===b.preventInjection&&0<="=+-@".indexOf(a.charAt(0))?"'"+a:a}function qb(a,c,b){return c+"-"+b.toLowerCase()}function ya(a,c){(a=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(a))&&(c=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]);return c}function Ka(a){var c=J(a,"text-align"),b=J(a,"font-weight"),
|
||||
d=J(a,"font-style"),f="";"start"===c&&(c="rtl"===J(a,"direction")?"right":"left");700<=b&&(f="bold");"italic"===d&&(f+=d);""===f&&(f="normal");c={style:{align:c,bcolor:ya(J(a,"background-color"),[255,255,255]),color:ya(J(a,"color"),[0,0,0]),fstyle:f},colspan:Y(a),rowspan:ka(a)};null!==a&&(a=a.getBoundingClientRect(),c.rect={width:a.width,height:a.height});return c}function Y(a){var c=d(a).attr("data-tableexport-colspan");"undefined"===typeof c&&d(a).is("[colspan]")&&(c=d(a).attr("colspan"));return parseInt(c)||
|
||||
0}function ka(a){var c=d(a).attr("data-tableexport-rowspan");"undefined"===typeof c&&d(a).is("[rowspan]")&&(c=d(a).attr("rowspan"));return parseInt(c)||0}function J(a,c){try{return window.getComputedStyle?(c=c.replace(/([a-z])([A-Z])/,qb),"object"===typeof a&&void 0!==a.nodeType?window.getComputedStyle(a,null).getPropertyValue(c):"object"===typeof a&&a.length?a.getPropertyValue(c):""):a.currentStyle?a.currentStyle[c]:a.style[c]}catch(e){}return""}function cb(a,c,b){c=J(a,c).match(/\d+/);if(null!==
|
||||
c){c=c[0];a=a.parentElement;var e=document.createElement("div");e.style.overflow="hidden";e.style.visibility="hidden";a.appendChild(e);e.style.width=100+b;b=100/e.offsetWidth;a.removeChild(e);return c*b}return 0}function rb(a){for(var c=new ArrayBuffer(a.length),b=new Uint8Array(c),d=0;d!==a.length;++d)b[d]=a.charCodeAt(d)&255;return c}function La(a){var c=a.c,b="";for(++c;c;c=Math.floor((c-1)/26))b=String.fromCharCode((c-1)%26+65)+b;return b+(""+(a.r+1))}function Ma(a,c){if("undefined"===typeof c||
|
||||
"number"===typeof c)return Ma(a.s,a.e);"string"!==typeof a&&(a=La(a));"string"!==typeof c&&(c=La(c));return a===c?a:a+":"+c}function fb(a,c){var b=Number(a);if(isFinite(b))return b;var d=1;""!==c.thousandsSeparator&&(a=a.replace(new RegExp("([\\d])"+c.thousandsSeparator+"([\\d])","g"),"$1$2"));"."!==c.decimalMark&&(a=a.replace(new RegExp("([\\d])"+c.decimalMark+"([\\d])","g"),"$1.$2"));a=a.replace(/[$]/g,"").replace(/[%]/g,function(){d*=100;return""});if(isFinite(b=Number(a)))return b/d;a=a.replace(/[(](.*)[)]/,
|
||||
function(a,c){d=-d;return c});return isFinite(b=Number(a))?b/d:b}function ab(a){var c=0,b;if(0===a.length)return c;var d=0;for(b=a.length;d<b;d++){var f=a.charCodeAt(d);c=(c<<5)-c+f;c|=0}return c}function S(a,c,d,h,f,w){var e=!0;"function"===typeof b.onBeforeSaveToFile&&(e=b.onBeforeSaveToFile(a,c,d,h,f),"boolean"!==typeof e&&(e=!0));if(e)try{if(gb=w?new Blob([String.fromCharCode(65279),[a]],{type:d+";charset="+h}):new Blob([a],{type:d+";charset="+h}),saveAs(gb,c,{autoBom:!1}),"function"===typeof b.onAfterSaveToFile)b.onAfterSaveToFile(a,
|
||||
c)}catch(g){Ga(c,"data:"+d+(h.length?";charset="+h:"")+(f.length?";"+f:"")+",",w?"\ufeff"+a:a)}}function Ga(a,c,d){var e=window.navigator.userAgent;if(!1!==a&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(new Blob([d]),a);else if(!1!==a&&(0<e.indexOf("MSIE ")||e.match(/Trident.*rv\:11\./))){if(c=document.createElement("iframe")){document.body.appendChild(c);c.setAttribute("style","display:none");c.contentDocument.open("txt/plain","replace");c.contentDocument.write(d);c.contentDocument.close();
|
||||
c.contentWindow.focus();switch(a.substr(a.lastIndexOf(".")+1)){case "doc":case "json":case "png":case "pdf":case "xls":case "xlsx":a+=".txt"}c.contentDocument.execCommand("SaveAs",!0,a);document.body.removeChild(c)}}else{var f=document.createElement("a");if(f){var w=null;f.style.display="none";!1!==a?f.download=a:f.target="_blank";"object"===typeof d?(window.URL=window.URL||window.webkitURL,e=[],e.push(d),w=window.URL.createObjectURL(new Blob(e,{type:c})),f.href=w):0<=c.toLowerCase().indexOf("base64,")?
|
||||
f.href=c+R(d):f.href=c+encodeURIComponent(d);document.body.appendChild(f);if(document.createEvent)null===Aa&&(Aa=document.createEvent("MouseEvents")),Aa.initEvent("click",!0,!1),f.dispatchEvent(Aa);else if(document.createEventObject)f.fireEvent("onclick");else if("function"===typeof f.onclick)f.onclick();setTimeout(function(){w&&window.URL.revokeObjectURL(w);document.body.removeChild(f);if("function"===typeof b.onAfterSaveToFile)b.onAfterSaveToFile(d,a)},100)}}}function R(a){var c,b="",d=0;if("string"===
|
||||
typeof a){a=a.replace(/\x0d\x0a/g,"\n");var f="";for(c=0;c<a.length;c++){var w=a.charCodeAt(c);128>w?f+=String.fromCharCode(w):(127<w&&2048>w?f+=String.fromCharCode(w>>6|192):(f+=String.fromCharCode(w>>12|224),f+=String.fromCharCode(w>>6&63|128)),f+=String.fromCharCode(w&63|128))}a=f}for(;d<a.length;){var m=a.charCodeAt(d++);f=a.charCodeAt(d++);c=a.charCodeAt(d++);w=m>>2;m=(m&3)<<4|f>>4;var g=(f&15)<<2|c>>6;var p=c&63;isNaN(f)?g=p=64:isNaN(c)&&(p=64);b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(w)+
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(p)}return b}function sb(a,c,b,d){c&&"object"===typeof c||console.error("The headers should be an object or array, is: "+typeof c);b&&"object"===typeof b||console.error("The data should be an object or array, is: "+typeof b);d&&"object"!==typeof d&&console.error("The data should be an object or array, is: "+
|
||||
typeof b);Array.prototype.forEach||console.error("The current browser does not support Array.prototype.forEach which is required for jsPDF-AutoTable");x=a;l=tb(d||{});Na=1;H={y:!1===l.startY?l.margin.top:l.startY};a={textColor:30,fontSize:x.internal.getFontSize(),fontStyle:x.internal.getFont().fontStyle,fontName:x.internal.getFont().fontName};ub(c,b);vb();c=l.startY+l.margin.bottom+q.headerRow.height+(q.rows[0]&&"auto"===l.pageBreak?q.rows[0].height:0);"avoid"===l.pageBreak&&(c+=q.height);if("always"===
|
||||
l.pageBreak&&!1!==l.startY||!1!==l.startY&&c>x.internal.pageSize.height)x.addPage(),H.y=l.margin.top;ma(a);l.beforePageContent(T());!1!==l.drawHeaderRow(q.headerRow,T({row:q.headerRow}))&&Oa(q.headerRow,l.drawHeaderCell);ma(a);wb();l.afterPageContent(T());ma(a);return x}function za(a,c,b,d){"number"===typeof c&&"number"===typeof b||console.error("The x and y parameters are required. Missing for the text: ",a);var e=x.internal.getFontSize()/x.internal.scaleFactor,h=/\r\n|\r|\n/g,m=null,g=1;if("middle"===
|
||||
d.valign||"bottom"===d.valign||"center"===d.halign||"right"===d.halign)m="string"===typeof a?a.split(h):a,g=m.length||1;b+=e*(2-1.15);"middle"===d.valign?b-=g/2*e:"bottom"===d.valign&&(b-=g*e);if("center"===d.halign||"right"===d.halign){h=e;"center"===d.halign&&(h*=.5);if(m&&1<=g){for(a=0;a<m.length;a++)x.text(m[a],c-x.getStringUnitWidth(m[a])*h,b),b+=e;return x}c-=x.getStringUnitWidth(a)*h}x.text(a,c,b);return x}function tb(a){var c=Z(F(),a);"undefined"!==typeof c.extendWidth&&(c.tableWidth=c.extendWidth?
|
||||
"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead."));"undefined"!==typeof c.margins&&("undefined"===typeof c.margin&&(c.margin=c.margins),console.error("Use of deprecated option: margins, use margin instead."));[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach(function(a){var b="string"===typeof a?a:a[0];a="string"===typeof a?a:a[1];"undefined"!==typeof c[b]&&("undefined"===typeof c.styles[a]&&(c.styles[a]=c[b]),console.error("Use of deprecated option: "+
|
||||
b+", use the style "+a+" instead."))});var b=c.margin;c.margin={};"number"===typeof b.horizontal&&(b.right=b.horizontal,b.left=b.horizontal);"number"===typeof b.vertical&&(b.top=b.vertical,b.bottom=b.vertical);["top","right","bottom","left"].forEach(function(a,d){"number"===typeof b?c.margin[a]=b:(d=Array.isArray(b)?d:a,c.margin[a]="number"===typeof b[d]?b[d]:40)});return c}function ub(a,b){q=new t;q.x=l.margin.left;var c=/\r\n|\r|\n/g,h=new D(a);h.index=-1;var f=Z(Ba,pa[l.theme].table,pa[l.theme].header);
|
||||
h.styles=Z(f,l.styles,l.headerStyles);a.forEach(function(a,b){"object"===typeof a&&(b="undefined"!==typeof a.dataKey?a.dataKey:a.key);"undefined"!==typeof a.width&&console.error("Use of deprecated option: column.width, use column.styles.columnWidth instead.");var g=new wa(b);g.styles=l.columnStyles[g.dataKey]||{};q.columns.push(g);var e=new K;e.raw="object"===typeof a?a.title:a;e.styles=d.extend({},h.styles);e.text=""+e.raw;e.contentWidth=2*e.styles.cellPadding+Ca(e.text,e.styles);e.text=e.text.split(c);
|
||||
h.cells[b]=e;l.createdHeaderCell(e,{column:g,row:h,settings:l})});q.headerRow=h;b.forEach(function(a,b){var d=new D(a),e=0===b%2,f=Z(Ba,pa[l.theme].table,e?pa[l.theme].alternateRow:{});e=Z(l.styles,l.bodyStyles,e?l.alternateRowStyles:{});d.styles=Z(f,e);d.index=b;q.columns.forEach(function(b){var g=new K;g.raw=a[b.dataKey];g.styles=Z(d.styles,b.styles);g.text="undefined"!==typeof g.raw?""+g.raw:"";d.cells[b.dataKey]=g;l.createdCell(g,T({column:b,row:d}));g.contentWidth=2*g.styles.cellPadding+Ca(g.text,
|
||||
g.styles);g.text=g.text.split(c)});q.rows.push(d)})}function vb(){var a=0;q.columns.forEach(function(b){b.contentWidth=q.headerRow.cells[b.dataKey].contentWidth;q.rows.forEach(function(a){a=a.cells[b.dataKey].contentWidth;a>b.contentWidth&&(b.contentWidth=a)});b.width=b.contentWidth;a+=b.contentWidth});q.contentWidth=a;var b=x.internal.pageSize.width-l.margin.left-l.margin.right,d=b;"number"===typeof l.tableWidth?d=l.tableWidth:"wrap"===l.tableWidth&&(d=q.contentWidth);q.width=d<b?d:b;var h=[],f=
|
||||
0,k=q.width/q.columns.length,m=0;q.columns.forEach(function(a){var b=Z(Ba,pa[l.theme].table,l.styles,a.styles);"wrap"===b.columnWidth?a.width=a.contentWidth:"number"===typeof b.columnWidth?a.width=b.columnWidth:a.contentWidth<=k&&q.contentWidth>q.width?a.width=a.contentWidth:(h.push(a),f+=a.contentWidth,a.width=0);m+=a.width});hb(h,m,f,k);q.height=0;q.rows.concat(q.headerRow).forEach(function(a,b){var c=0,d=q.x;q.columns.forEach(function(b){var e=a.cells[b.dataKey];b.x=d;ma(e.styles);var g=b.width-
|
||||
2*e.styles.cellPadding;"linebreak"===e.styles.overflow?e.text=x.splitTextToSize(e.text,g+1,{fontSize:e.styles.fontSize}):"ellipsize"===e.styles.overflow?e.text=Pa(e.text,g,e.styles):"visible"!==e.styles.overflow&&("hidden"===e.styles.overflow?e.text=Pa(e.text,g,e.styles,""):"function"===typeof e.styles.overflow?e.text=e.styles.overflow(e.text,g):console.error("Unrecognized overflow type: "+e.styles.overflow));e=Array.isArray(e.text)?e.text.length-1:0;e>c&&(c=e);d+=b.width});a.heightStyle=a.styles.rowHeight;
|
||||
a.height=a.heightStyle+c*a.styles.fontSize*1.15+(2-1.15)/2*a.styles.fontSize;q.height+=a.height})}function hb(a,b,d,h){for(var c=q.width-b-d,e=0;e<a.length;e++){var m=a[e],g=m.contentWidth/d,p=m.contentWidth+c*g<h;if(0>c&&p){a.splice(e,1);d-=m.contentWidth;m.width=h;b+=m.width;hb(a,b,d,h);break}else m.width=m.contentWidth+c*g}}function wb(){q.rows.forEach(function(a,b){H.y+a.height+l.margin.bottom>=x.internal.pageSize.height&&(l.afterPageContent(T()),x.addPage(),Na++,H={x:l.margin.left,y:l.margin.top},
|
||||
l.beforePageContent(T()),!1!==l.drawHeaderRow(q.headerRow,T({row:q.headerRow}))&&Oa(q.headerRow,l.drawHeaderCell));a.y=H.y;!1!==l.drawRow(a,T({row:a}))&&Oa(a,l.drawCell)})}function Oa(a,b){for(var c=0;c<q.columns.length;c++){var d=q.columns[c],f=a.cells[d.dataKey];f&&(ma(f.styles),f.x=d.x,f.y=H.y,f.height=a.height,f.width=d.width,f.textPos.y="top"===f.styles.valign?H.y+f.styles.cellPadding:"bottom"===f.styles.valign?H.y+a.height-f.styles.cellPadding:H.y+a.height/2,f.textPos.x="right"===f.styles.halign?
|
||||
f.x+f.width-f.styles.cellPadding:"center"===f.styles.halign?f.x+f.width/2:f.x+f.styles.cellPadding,d=T({column:d,row:a}),!1!==b(f,d)&&(x.rect(f.x,f.y,f.width,f.height,f.styles.fillStyle),za(f.text,f.textPos.x,f.textPos.y,{halign:f.styles.halign,valign:f.styles.valign})))}H.y+=a.height}function ma(a){[{func:x.setFillColor,value:a.fillColor},{func:x.setTextColor,value:a.textColor},{func:x.setFont,value:a.font,style:a.fontStyle},{func:x.setDrawColor,value:a.lineColor},{func:x.setLineWidth,value:a.lineWidth},
|
||||
{func:x.setFont,value:a.font},{func:x.setFontSize,value:a.fontSize}].forEach(function(a){"undefined"!==typeof a.value&&(a.value.constructor===Array?a.func.apply(x,a.value):"undefined"!==typeof a.style?a.func(a.value,a.style):a.func(a.value))})}function T(a){a=a||{};var b={pageCount:Na,settings:l,table:q,cursor:H},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);return b}function Pa(a,b,d,h){h="undefined"!==typeof h?h:"...";if(Array.isArray(a))return a.forEach(function(c,e){a[e]=Pa(c,b,d,h)}),a;if(b>=
|
||||
Ca(a,d))return a;for(;b<Ca(a+h,d)&&!(2>a.length);)a=a.substring(0,a.length-1);return a.trim()+h}function Ca(a,b){ma(b);return x.getStringUnitWidth(a)*b.fontSize}function Z(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);for(var h=1;h<arguments.length;h++){var f=arguments[h];for(d in f)f.hasOwnProperty(d)&&(b[d]=f[d])}return b}var L,b={csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,date:{html:"dd/mm/yyyy"},displayTableName:!1,escape:!1,exportHiddenCells:!1,fileName:"tableExport",htmlContent:!1,
|
||||
htmlHyperlink:"content",ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},onDocCreated:null,autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"inherit",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"inherit",valign:"middle"},alternateRowStyles:{fillColor:245},tableExport:{doc:null,onAfterAutotable:null,
|
||||
onBeforeAutotable:null,onAutotableText:null,onTable:null,outputImages:!0}}},mso:{fileFormat:"xlshtml",onMsoNumberFormat:null,pageFormat:"a4",pageOrientation:"portrait",rtl:!1,styles:[],worksheetName:"",xlsx:{formatId:{date:14,numbers:2,currency:164},format:{currency:"$#,##0.00;[Red]-$#,##0.00"},onHyperlink:null}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onAfterSaveToFile:null,onBeforeSaveToFile:null,onCellData:null,onCellHtmlData:null,
|
||||
onCellHtmlHyperlink:null,onIgnoreRow:null,onTableExportBegin:null,onTableExportEnd:null,outputMode:"file",pdfmake:{enabled:!1,docDefinition:{pageSize:"A4",pageOrientation:"portrait",styles:{header:{background:"#34495E",color:"#FFFFFF",bold:!0,alignment:"center",fillColor:"#34495E"},alternateRow:{fillColor:"#f5f5f5"}},defaultStyle:{color:"#000000",fontSize:8,font:"Roboto"}},fonts:{},widths:"*"},preserve:{leadingWS:!1,trailingWS:!1},preventInjection:!0,sql:{tableEnclosure:"`",columnEnclosure:"`"},tbodySelector:"tr",
|
||||
tfootSelector:"tr",theadSelector:"tr",tableName:"Table",type:"csv"},U={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,
|
||||
3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]},pa={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal",fillStyle:"F"},header:{textColor:255,fillColor:[41,128,185],rowHeight:23,
|
||||
fontStyle:"bold"},body:{},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1,fillStyle:"DF"},header:{textColor:255,fillColor:[26,188,156],rowHeight:23,fillStyle:"F",fontStyle:"bold"},body:{},alternateRow:{}},plain:{header:{fontStyle:"bold"}}},Ba={cellPadding:5,fontSize:10,fontName:"helvetica",lineColor:200,lineWidth:.1,fontStyle:"normal",overflow:"ellipsize",fillColor:255,textColor:20,halign:"left",valign:"top",fillStyle:"F",rowHeight:20,columnWidth:"auto"},
|
||||
v=this,Aa=null,z=[],y=[],r=0,u="",fa=[],N=[],gb,Q=[],ja=!1;d.extend(!0,b,lb);"xlsx"===b.type&&(b.mso.fileFormat=b.type,b.type="excel");"undefined"!==typeof b.excelFileFormat&&"undefined"===typeof b.mso.fileFormat&&(b.mso.fileFormat=b.excelFileFormat);"undefined"!==typeof b.excelPageFormat&&"undefined"===typeof b.mso.pageFormat&&(b.mso.pageFormat=b.excelPageFormat);"undefined"!==typeof b.excelPageOrientation&&"undefined"===typeof b.mso.pageOrientation&&(b.mso.pageOrientation=b.excelPageOrientation);
|
||||
"undefined"!==typeof b.excelRTL&&"undefined"===typeof b.mso.rtl&&(b.mso.rtl=b.excelRTL);"undefined"!==typeof b.excelstyles&&"undefined"===typeof b.mso.styles&&(b.mso.styles=b.excelstyles);"undefined"!==typeof b.onMsoNumberFormat&&"undefined"===typeof b.mso.onMsoNumberFormat&&(b.mso.onMsoNumberFormat=b.onMsoNumberFormat);"undefined"!==typeof b.worksheetName&&"undefined"===typeof b.mso.worksheetName&&(b.mso.worksheetName=b.worksheetName);"undefined"!==typeof b.mso.xslx&&"undefined"===typeof b.mso.xlsx&&
|
||||
(b.mso.xlsx=b.mso.xslx);b.mso.pageOrientation="l"===b.mso.pageOrientation.substr(0,1)?"landscape":"portrait";b.date.html=b.date.html||"";if(b.date.html.length){var ha=[];ha.dd="(3[01]|[12][0-9]|0?[1-9])";ha.mm="(1[012]|0?[1-9])";ha.yyyy="((?:1[6-9]|2[0-2])\\d{2})";ha.yy="(\\d{2})";var xb=b.date.html.match(/[^a-zA-Z0-9]/)[0],aa=b.date.html.toLowerCase().split(xb);b.date.regex="^\\s*";b.date.regex+=ha[aa[0]];b.date.regex+="(.)";b.date.regex+=ha[aa[1]];b.date.regex+="\\2";b.date.regex+=ha[aa[2]];b.date.regex+=
|
||||
"\\s*$";b.date.pattern=new RegExp(b.date.regex,"g");var ba=aa.indexOf("dd")+1;b.date.match_d=ba+(1<ba?1:0);ba=aa.indexOf("mm")+1;b.date.match_m=ba+(1<ba?1:0);ba=(0<=aa.indexOf("yyyy")?aa.indexOf("yyyy"):aa.indexOf("yy"))+1;b.date.match_y=ba+(1<ba?1:0)}fa=xa(v);if("function"===typeof b.onTableExportBegin)b.onTableExportBegin();if("csv"===b.type||"tsv"===b.type||"txt"===b.type){var ca="",qa=0;N=[];r=0;var Qa=function(a,c,e){a.each(function(){u="";I(this,c,r,e+a.length,function(a,c,d){var e=u,g="";if(null!==
|
||||
a)if(a=G(a,c,d),c=null===a||""===a?"":a.toString(),"tsv"===b.type)a instanceof Date&&a.toLocaleString(),g=la(c,"\t"," ");else if(a instanceof Date)g=b.csvEnclosure+a.toLocaleString()+b.csvEnclosure;else if(g=eb(c),g=la(g,b.csvEnclosure,b.csvEnclosure+b.csvEnclosure),0<=g.indexOf(b.csvSeparator)||/[\r\n ]/g.test(g))g=b.csvEnclosure+g+b.csvEnclosure;u=e+(g+("tsv"===b.type?"\t":b.csvSeparator))});u=d.trim(u).substring(0,u.length-1);0<u.length&&(0<ca.length&&(ca+="\n"),ca+=u);r++});return a.length};qa+=
|
||||
Qa(d(v).find("thead").first().find(b.theadSelector),"th,td",qa);P(d(v),"tbody").each(function(){qa+=Qa(P(d(this),b.tbodySelector),"td,th",qa)});b.tfootSelector.length&&Qa(d(v).find("tfoot").first().find(b.tfootSelector),"td,th",qa);ca+="\n";if("string"===b.outputMode)return ca;if("base64"===b.outputMode)return R(ca);if("window"===b.outputMode){Ga(!1,"data:text/"+("csv"===b.type?"csv":"plain")+";charset=utf-8,",ca);return}S(ca,b.fileName+"."+b.type,"text/"+("csv"===b.type?"csv":"plain"),"utf-8","",
|
||||
"csv"===b.type&&b.csvUseBOM)}else if("sql"===b.type){r=0;N=[];var E="INSERT INTO "+b.sql.tableEnclosure+b.tableName+b.sql.tableEnclosure+" (";z=W(d(v));d(z).each(function(){I(this,"th,td",r,z.length,function(a,c,d){a=G(a,c,d)||"";-1<a.indexOf(b.sql.columnEnclosure)&&(a=la(a.toString(),b.sql.columnEnclosure,b.sql.columnEnclosure+b.sql.columnEnclosure));E+=b.sql.columnEnclosure+a+b.sql.columnEnclosure+","});r++;E=d.trim(E).substring(0,E.length-1)});E+=") VALUES ";y=X(d(v));d(y).each(function(){u="";
|
||||
I(this,"td,th",r,z.length+y.length,function(a,b,d){a=G(a,b,d)||"";-1<a.indexOf("'")&&(a=la(a.toString(),"'","''"));u+="'"+a+"',"});3<u.length&&(E+="("+u,E=d.trim(E).substring(0,E.length-1),E+="),");r++});E=d.trim(E).substring(0,E.length-1);E+=";";if("string"===b.outputMode)return E;if("base64"===b.outputMode)return R(E);S(E,b.fileName+".sql","application/sql","utf-8","",!1)}else if("json"===b.type){var na=[];N=[];z=W(d(v));d(z).each(function(){var a=[];I(this,"th,td",r,z.length,function(b,d,h){a.push(G(b,
|
||||
d,h))});na.push(a)});var Ra=[];y=X(d(v));d(y).each(function(){var a={},b=0;I(this,"td,th",r,z.length+y.length,function(c,d,f){na.length?a[na[na.length-1][b]]=G(c,d,f):a[b]=G(c,d,f);b++});!1===d.isEmptyObject(a)&&Ra.push(a);r++});var Sa="head"===b.jsonScope?JSON.stringify(na):"data"===b.jsonScope?JSON.stringify(Ra):JSON.stringify({header:na,data:Ra});if("string"===b.outputMode)return Sa;if("base64"===b.outputMode)return R(Sa);S(Sa,b.fileName+".json","application/json","utf-8","base64",!1)}else if("xml"===
|
||||
b.type){r=0;N=[];var da='<?xml version="1.0" encoding="utf-8"?>';da+="<tabledata><fields>";z=W(d(v));d(z).each(function(){I(this,"th,td",r,z.length,function(a,b,d){da+="<field>"+G(a,b,d)+"</field>"});r++});da+="</fields><data>";var ib=1;y=X(d(v));d(y).each(function(){var a=1;u="";I(this,"td,th",r,z.length+y.length,function(b,d,h){u+="<column-"+a+">"+G(b,d,h)+"</column-"+a+">";a++});0<u.length&&"<column-1></column-1>"!==u&&(da+='<row id="'+ib+'">'+u+"</row>",ib++);r++});da+="</data></tabledata>";if("string"===
|
||||
b.outputMode)return da;if("base64"===b.outputMode)return R(da);S(da,b.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===b.type&&"xmlss"===b.mso.fileFormat){var Ta=[],M=[];d(v).filter(function(){return O(d(this))}).each(function(){function a(a,b,c){var e=[];d(a).each(function(){var b=0,f=0;u="";I(this,"td,th",r,c+a.length,function(a,c,g){if(null!==a){var m="";c=G(a,c,g);g="String";if(!1!==jQuery.isNumeric(c))g="Number";else{var h=pb(c);!1!==h&&(c=h,g="Number",m+=' ss:StyleID="pct1"')}"Number"!==
|
||||
g&&(c=c.replace(/\n/g,"<br>"));h=Y(a);a=ka(a);d.each(e,function(){if(r>=this.s.r&&r<=this.e.r&&f>=this.s.c&&f<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f++,b++});if(a||h)a=a||1,h=h||1,e.push({s:{r:r,c:f},e:{r:r+a-1,c:f+h-1}});1<h&&(m+=' ss:MergeAcross="'+(h-1)+'"',f+=h-1);1<a&&(m+=' ss:MergeDown="'+(a-1)+'" ss:StyleID="rsp1"');0<b&&(m+=' ss:Index="'+(f+1)+'"',b=0);u+="<Cell"+m+'><Data ss:Type="'+g+'">'+d("<div />").text(c).html()+"</Data></Cell>\r";f++}});0<u.length&&(L+='<Row ss:AutoFitHeight="0">\r'+
|
||||
u+"</Row>\r");r++});return a.length}var c=d(this),e="";"string"===typeof b.mso.worksheetName&&b.mso.worksheetName.length?e=b.mso.worksheetName+" "+(M.length+1):"undefined"!==typeof b.mso.worksheetName[M.length]&&(e=b.mso.worksheetName[M.length]);e.length||(e=c.find("caption").text()||"");e.length||(e="Table "+(M.length+1));e=d.trim(e.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));M.push(d("<div />").text(e).html());!1===b.exportHiddenCells&&(Q=c.find("tr, th, td").filter(":hidden"),ja=0<Q.length);
|
||||
r=0;fa=xa(this);L="<Table>\r";e=a(W(c),"th,td",0);a(X(c),"td,th",e);L+="</Table>\r";Ta.push(L)});for(var Da={},Ua={},ea,ra,oa=0,yb=M.length;oa<yb;oa++)ea=M[oa],ra=Da[ea],ra=Da[ea]=null==ra?1:ra+1,2===ra&&(M[Ua[ea]]=M[Ua[ea]].substring(0,29)+"-1"),1<Da[ea]?M[oa]=M[oa].substring(0,29)+"-"+Da[ea]:Ua[ea]=oa;for(var V='<?xml version="1.0" encoding="UTF-8"?>\r<?mso-application progid="Excel.Sheet"?>\r<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"\r xmlns:o="urn:schemas-microsoft-com:office:office"\r xmlns:x="urn:schemas-microsoft-com:office:excel"\r xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"\r xmlns:html="http://www.w3.org/TR/REC-html40">\r<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">\r <Created>'+
|
||||
(new Date).toISOString()+'</Created>\r</DocumentProperties>\r<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">\r <AllowPNG/>\r</OfficeDocumentSettings>\r<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">\r <WindowHeight>9000</WindowHeight>\r <WindowWidth>13860</WindowWidth>\r <WindowTopX>0</WindowTopX>\r <WindowTopY>0</WindowTopY>\r <ProtectStructure>False</ProtectStructure>\r <ProtectWindows>False</ProtectWindows>\r</ExcelWorkbook>\r<Styles>\r <Style ss:ID="Default" ss:Name="Normal">\r <Alignment ss:Vertical="Bottom"/>\r <Borders/>\r <Font/>\r <Interior/>\r <NumberFormat/>\r <Protection/>\r </Style>\r <Style ss:ID="rsp1">\r <Alignment ss:Vertical="Center"/>\r </Style>\r <Style ss:ID="pct1">\r <NumberFormat ss:Format="Percent"/>\r </Style>\r</Styles>\r',
|
||||
Ea=0;Ea<Ta.length;Ea++)V+='<Worksheet ss:Name="'+M[Ea]+'" ss:RightToLeft="'+(b.mso.rtl?"1":"0")+'">\r'+Ta[Ea],V=b.mso.rtl?V+'<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">\r<DisplayRightToLeft/>\r</WorksheetOptions>\r':V+'<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"/>\r',V+="</Worksheet>\r";V+="</Workbook>\r";if("string"===b.outputMode)return V;if("base64"===b.outputMode)return R(V);S(V,b.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===
|
||||
b.type&&"xlsx"===b.mso.fileFormat){var sa=[],jb=XLSX.utils.book_new();d(v).filter(function(){return O(d(this))}).each(function(){for(var a=d(this),c,e={},h=this.getElementsByTagName("tr"),f=Math.min(1E7,h.length),k={s:{r:0,c:0},e:{r:0,c:0}},m=[],g,p=0,B=0,A,l,r,q,n,t=XLSX.SSF.get_table();p<h.length&&B<f;++p)if(A=h[p],l=!1,"function"===typeof b.onIgnoreRow&&(l=b.onIgnoreRow(d(A),p)),!0!==l&&(0===b.ignoreRow.length||-1===d.inArray(p,b.ignoreRow)&&-1===d.inArray(p-h.length,b.ignoreRow))&&!1!==O(d(A))){var u=
|
||||
A.children,z=0;for(A=0;A<u.length;++A)n=u[A],q=+Y(n)||1,z+=q;var x=0;for(A=l=0;A<u.length;++A)if(n=u[A],q=+Y(n)||1,g=A+x,!Wa(d(n),z,g+(g<l?l-g:0))){x+=q-1;for(g=0;g<m.length;++g){var C=m[g];C.s.c==l&&C.s.r<=B&&B<=C.e.r&&(l=C.e.c+1,g=-1)}(0<(r=+ka(n))||1<q)&&m.push({s:{r:B,c:l},e:{r:B+(r||1)-1,c:l+q-1}});var y={type:""};C=G(n,p,A+x,y);g={t:"s",v:C};var v="";if(""!==(d(n).attr("data-tableexport-cellformat")||void 0))if(c=parseInt(d(n).attr("data-tableexport-xlsxformatid")||0),0===c&&"function"===typeof b.mso.xlsx.formatId.numbers&&
|
||||
(c=b.mso.xlsx.formatId.numbers(d(n),p,A+x)),0===c&&"function"===typeof b.mso.xlsx.formatId.date&&(c=b.mso.xlsx.formatId.date(d(n),p,A+x)),49===c||"@"===c)v="s";else if("number"===y.type||0<c&&14>c||36<c&&41>c||48===c)v="n";else{if("date"===y.type||13<c&&37>c||44<c&&48>c||56===c)v="d"}else v="s";if(null!=C){if(0===C.length)g.t="z";else if(0!==C.trim().length&&"s"!==v)if("function"===y.type)g={f:C};else if("TRUE"===C)g={t:"b",v:!0};else if("FALSE"===C)g={t:"b",v:!1};else if("n"===v||isFinite(fb(C,b.numbers.output))){if(v=
|
||||
fb(C,b.numbers.output),0===c&&"function"!==typeof b.mso.xlsx.formatId.numbers&&(c=b.mso.xlsx.formatId.numbers),isFinite(v)||isFinite(C))g={t:"n",v:isFinite(v)?v:C,z:"string"===typeof c?c:c in t?t[c]:c===b.mso.xlsx.formatId.currency?b.mso.xlsx.format.currency:"0.00"}}else if(!1!==(y=ob(C))||"d"===v)0===c&&"function"!==typeof b.mso.xlsx.formatId.date&&(c=b.mso.xlsx.formatId.date),g={t:"d",v:!1!==y?y:C,z:"string"===typeof c?c:c in t?t[c]:"m/d/yy"};(v=d(n).find("a"))&&v.length&&(v=v[0].hasAttribute("href")?
|
||||
v.attr("href"):"",C="href"!==b.htmlHyperlink||""===v?C:"",y=""!==v?'=HYPERLINK("'+v+(C.length?'","'+C:"")+'")':"",""!==y&&("function"===typeof b.mso.xlsx.onHyperlink?(C=b.mso.xlsx.onHyperlink(d(n),p,A,v,C,y),g=0!==C.indexOf("=HYPERLINK")?{t:"s",v:C}:{f:C}):g={f:y}))}e[La({c:l,r:B})]=g;k.e.c<l&&(k.e.c=l);l+=q}++B}m.length&&(e["!merges"]=(e["!merges"]||[]).concat(m));k.e.r=Math.max(k.e.r,B-1);e["!ref"]=Ma(k);B>=f&&(e["!fullref"]=Ma((k.e.r=h.length-p+B-1,k)));c="";"string"===typeof b.mso.worksheetName&&
|
||||
b.mso.worksheetName.length?c=b.mso.worksheetName+" "+(sa.length+1):"undefined"!==typeof b.mso.worksheetName[sa.length]&&(c=b.mso.worksheetName[sa.length]);c.length||(c=a.find("caption").text()||"");c.length||(c="Table "+(sa.length+1));c=d.trim(c.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));sa.push(c);XLSX.utils.book_append_sheet(jb,e,c)});var zb=XLSX.write(jb,{type:"binary",bookType:b.mso.fileFormat,bookSST:!1});S(rb(zb),b.fileName+"."+b.mso.fileFormat,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"UTF-8","",!1)}else if("excel"===b.type||"xls"===b.type||"word"===b.type||"doc"===b.type){var ta="excel"===b.type||"xls"===b.type?"excel":"word",Ab="excel"===ta?"xls":"doc",Bb='xmlns:x="urn:schemas-microsoft-com:office:'+ta+'"',ua=L="";d(v).filter(function(){return O(d(this))}).each(function(){var a=d(this);""===ua&&(ua=b.mso.worksheetName||a.find("caption").text()||"Table",ua=d.trim(ua.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31)));!1===b.exportHiddenCells&&(Q=a.find("tr, th, td").filter(":hidden"),
|
||||
ja=0<Q.length);r=0;N=[];fa=xa(this);L+="<table><thead>";z=W(a);d(z).each(function(){var a=d(this),e=document.defaultView.getComputedStyle(a[0],null);u="";I(this,"th,td",r,z.length,function(a,c,d){if(null!==a){var f="";u+="<th";if(b.mso.styles.length){var g=document.defaultView.getComputedStyle(a,null),h;for(h in b.mso.styles){var k=b.mso.styles[h],l=J(g,k);""===l&&(l=J(e,k));""!==l&&"0px none rgb(0, 0, 0)"!==l&&"rgba(0, 0, 0, 0)"!==l&&(f+=""===f?'style="':";",f+=k+":"+l)}}""!==f&&(u+=" "+f+'"');f=
|
||||
Y(a);0<f&&(u+=' colspan="'+f+'"');f=ka(a);0<f&&(u+=' rowspan="'+f+'"');u+=">"+G(a,c,d)+"</th>"}});0<u.length&&(L+="<tr>"+u+"</tr>");r++});L+="</thead><tbody>";y=X(a);d(y).each(function(){var a=d(this),e=null,h=null;u="";I(this,"td,th",r,z.length+y.length,function(c,k,m){if(null!==c){var g=G(c,k,m),f="",l=d(c).attr("data-tableexport-msonumberformat");"undefined"===typeof l&&"function"===typeof b.mso.onMsoNumberFormat&&(l=b.mso.onMsoNumberFormat(c,k,m));"undefined"!==typeof l&&""!==l&&(f="style=\"mso-number-format:'"+
|
||||
l+"'");if(b.mso.styles.length){e=document.defaultView.getComputedStyle(c,null);h=null;for(var n in b.mso.styles)k=b.mso.styles[n],l=J(e,k),""===l&&(null===h&&(h=document.defaultView.getComputedStyle(a[0],null)),l=J(h,k)),""!==l&&"0px none rgb(0, 0, 0)"!==l&&"rgba(0, 0, 0, 0)"!==l&&(f+=""===f?'style="':";",f+=k+":"+l)}u+="<td";""!==f&&(u+=" "+f+'"');f=Y(c);0<f&&(u+=' colspan="'+f+'"');c=ka(c);0<c&&(u+=' rowspan="'+c+'"');"string"===typeof g&&""!==g&&(g=eb(g),g=g.replace(/\n/g,"<br>"));u+=">"+g+"</td>"}});
|
||||
0<u.length&&(L+="<tr>"+u+"</tr>");r++});b.displayTableName&&(L+="<tr><td></td></tr><tr><td></td></tr><tr><td>"+G(d("<p>"+b.tableName+"</p>"))+"</td></tr>");L+="</tbody></table>"});var n='<html xmlns:o="urn:schemas-microsoft-com:office:office" '+Bb+' xmlns="http://www.w3.org/TR/REC-html40">';n+="<head>";n+='<meta http-equiv="content-type" content="application/vnd.ms-'+ta+'; charset=UTF-8">';"excel"===ta&&(n+="\x3c!--[if gte mso 9]>",n+="<xml>",n+="<x:ExcelWorkbook>",n+="<x:ExcelWorksheets>",n+="<x:ExcelWorksheet>",
|
||||
n+="<x:Name>",n+=ua,n+="</x:Name>",n+="<x:WorksheetOptions>",n+="<x:DisplayGridlines/>",b.mso.rtl&&(n+="<x:DisplayRightToLeft/>"),n+="</x:WorksheetOptions>",n+="</x:ExcelWorksheet>",n+="</x:ExcelWorksheets>",n+="</x:ExcelWorkbook>",n+="</xml>",n+="<![endif]--\x3e");n+="<style>";n+="@page { size:"+b.mso.pageOrientation+"; mso-page-orientation:"+b.mso.pageOrientation+"; }";n+="@page Section1 {size:"+U[b.mso.pageFormat][0]+"pt "+U[b.mso.pageFormat][1]+"pt";n+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";
|
||||
n+="div.Section1 {page:Section1;}";n+="@page Section2 {size:"+U[b.mso.pageFormat][1]+"pt "+U[b.mso.pageFormat][0]+"pt";n+=";mso-page-orientation:"+b.mso.pageOrientation+";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";n+="div.Section2 {page:Section2;}";n+="br {mso-data-placement:same-cell;}";n+="</style>";n+="</head>";n+="<body>";n+='<div class="Section'+("landscape"===b.mso.pageOrientation?"2":"1")+'">';n+=L;n+="</div>";n+="</body>";n+="</html>";
|
||||
if("string"===b.outputMode)return n;if("base64"===b.outputMode)return R(n);S(n,b.fileName+"."+Ab,"application/vnd.ms-"+ta,"","base64",!1)}else if("png"===b.type)html2canvas(d(v)[0]).then(function(a){a=a.toDataURL();for(var c=atob(a.substring(22)),d=new ArrayBuffer(c.length),h=new Uint8Array(d),f=0;f<c.length;f++)h[f]=c.charCodeAt(f);if("string"===b.outputMode)return c;if("base64"===b.outputMode)return R(a);"window"===b.outputMode?window.open(a):S(d,b.fileName+".png","image/png","","",!1)});else if("pdf"===
|
||||
b.type)if(!0===b.pdfmake.enabled){var ia={content:[]};d.extend(!0,ia,b.pdfmake.docDefinition);N=[];d(v).filter(function(){return O(d(this))}).each(function(){var a=d(this),c=[],e="*",h=[];r=0;"string"!==typeof b.pdfmake.widths||"*"!==b.pdfmake.widths.trim()&&"auto"!==b.pdfmake.widths.trim()?Array.isArray(b.pdfmake.widths)&&(c=b.pdfmake.widths):e=b.pdfmake.widths.trim();var f=function(a,b,c){var e=0;d(a).each(function(){var a=[];I(this,b,r,c,function(c,d,e){if("undefined"!==typeof c&&null!==c){var g=
|
||||
Ka(c),f=function(a){a=Math.min(255,Math.max(0,a)).toString(16);return 1===a.length?"0"+a:a};c={text:G(c,d,e)||" ",alignment:g.style.align,backgroundColor:"#"+f(g.style.bcolor[0])+f(g.style.bcolor[1])+f(g.style.bcolor[2]),color:"#"+f(g.style.color[0])+f(g.style.color[1])+f(g.style.color[2])};g.style.fstyle.includes("italic")&&(c.fontStyle="italic");g.style.fstyle.includes("bold")&&(c.bold=!0);if(1<g.colspan||1<g.rowspan)c.colSpan=g.colspan||1,c.rowSpan=g.rowspan||1}else c={text:" "};0<=b.indexOf("th")&&
|
||||
(c.style="header");a.push(c)});a.length&&h.push(a);e<a.length&&(e=a.length);r++});return e};z=W(a);var k=f(z,"th,td",z.length);y=X(a);a=f(y,"td",z.length+y.length);k=k>a?k:a;for(a=c.length;a<k;a++)c.push(e);ia.content.push({table:{headerRows:z.length?z.length:null,widths:c,body:h},layout:{layout:"noBorders",hLineStyle:function(a,b){return 0},vLineWidth:function(a,b){return 0},hLineColor:function(a,c){return a<c.table.headerRows?b.pdfmake.docDefinition.styles.header.background:b.pdfmake.docDefinition.styles.alternateRow.fillColor},
|
||||
vLineColor:function(a,c){return a<c.table.headerRows?b.pdfmake.docDefinition.styles.header.background:b.pdfmake.docDefinition.styles.alternateRow.fillColor},fillColor:function(a,c,d){return 0===a%2?b.pdfmake.docDefinition.styles.alternateRow.fillColor:null}},pageBreak:ia.content.length?"before":void 0})});"undefined"!==typeof pdfMake&&"undefined"!==typeof pdfMake.createPdf&&(pdfMake.fonts={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-MediumItalic.ttf"}},
|
||||
pdfMake.vfs.hasOwnProperty("Mirza-Regular.ttf")?(ia.defaultStyle.font="Mirza",d.extend(!0,pdfMake.fonts,{Mirza:{normal:"Mirza-Regular.ttf",bold:"Mirza-Bold.ttf",italics:"Mirza-Medium.ttf",bolditalics:"Mirza-SemiBold.ttf"}})):pdfMake.vfs.hasOwnProperty("gbsn00lp.ttf")?(ia.defaultStyle.font="gbsn00lp",d.extend(!0,pdfMake.fonts,{gbsn00lp:{normal:"gbsn00lp.ttf",bold:"gbsn00lp.ttf",italics:"gbsn00lp.ttf",bolditalics:"gbsn00lp.ttf"}})):pdfMake.vfs.hasOwnProperty("ZCOOLXiaoWei-Regular.ttf")&&(ia.defaultStyle.font=
|
||||
"ZCOOLXiaoWei",d.extend(!0,pdfMake.fonts,{ZCOOLXiaoWei:{normal:"ZCOOLXiaoWei-Regular.ttf",bold:"ZCOOLXiaoWei-Regular.ttf",italics:"ZCOOLXiaoWei-Regular.ttf",bolditalics:"ZCOOLXiaoWei-Regular.ttf"}})),d.extend(!0,pdfMake.fonts,b.pdfmake.fonts),pdfMake.createPdf(ia).getBuffer(function(a){S(a,b.fileName+".pdf","application/pdf","","",!1)}))}else if(!1===b.jspdf.autotable){var Va=new jspdf.jsPDF({orientation:b.jspdf.orientation,unit:b.jspdf.unit,format:b.jspdf.format});Va.html(v[0],{callback:function(){Ya(Va,
|
||||
!1)},html2canvas:{scale:(Va.internal.pageSize.width-2*b.jspdf.margins.left)/v[0].scrollWidth},x:b.jspdf.margins.left,y:b.jspdf.margins.top})}else{var k=b.jspdf.autotable.tableExport;if("string"===typeof b.jspdf.format&&"bestfit"===b.jspdf.format.toLowerCase()){var Fa="",va="",kb=0;d(v).each(function(){if(O(d(this))){var a=cb(d(this).get(0),"width","pt");if(a>kb){a>U.a0[0]&&(Fa="a0",va="l");for(var b in U)U.hasOwnProperty(b)&&U[b][1]>a&&(Fa=b,va="l",U[b][0]>a&&(va="p"));kb=a}}});b.jspdf.format=""===
|
||||
Fa?"a4":Fa;b.jspdf.orientation=""===va?"w":va}if(null==k.doc&&(k.doc=new jspdf.jsPDF(b.jspdf.orientation,b.jspdf.unit,b.jspdf.format),k.wScaleFactor=1,k.hScaleFactor=1,"function"===typeof b.jspdf.onDocCreated))b.jspdf.onDocCreated(k.doc);Ba.fontName=k.doc.getFont().fontName;!0===k.outputImages&&(k.images={});"undefined"!==typeof k.images&&(d(v).filter(function(){return O(d(this))}).each(function(){var a=0;N=[];!1===b.exportHiddenCells&&(Q=d(this).find("tr, th, td").filter(":hidden"),ja=0<Q.length);
|
||||
z=W(d(this));y=X(d(this));d(y).each(function(){I(this,"td,th",z.length+a,z.length+y.length,function(a){$a(a,d(a).children(),k)});a++})}),z=[],y=[]);nb(k,function(){d(v).filter(function(){return O(d(this))}).each(function(){var a;r=0;N=[];!1===b.exportHiddenCells&&(Q=d(this).find("tr, th, td").filter(":hidden"),ja=0<Q.length);fa=xa(this);k.columns=[];k.rows=[];k.teCells={};if("function"===typeof k.onTable&&!1===k.onTable(d(this),b))return!0;b.jspdf.autotable.tableExport=null;var c=d.extend(!0,{},b.jspdf.autotable);
|
||||
b.jspdf.autotable.tableExport=k;c.margin={};d.extend(!0,c.margin,b.jspdf.margins);c.tableExport=k;"function"!==typeof c.createdHeaderCell&&(c.createdHeaderCell=function(a,b){if("undefined"!==typeof k.columns[b.column.dataKey]){var d=k.columns[b.column.dataKey];if("undefined"!==typeof d.rect){a.contentWidth=d.rect.width;if("undefined"===typeof k.heightRatio||0===k.heightRatio){var e=b.row.raw[b.column.dataKey].rowspan?b.row.raw[b.column.dataKey].rect.height/b.row.raw[b.column.dataKey].rowspan:b.row.raw[b.column.dataKey].rect.height;
|
||||
k.heightRatio=a.styles.rowHeight/e}e=b.row.raw[b.column.dataKey].rect.height*k.heightRatio;e>a.styles.rowHeight&&(a.styles.rowHeight=e)}a.styles.halign="inherit"===c.headerStyles.halign?"center":c.headerStyles.halign;a.styles.valign=c.headerStyles.valign;"undefined"!==typeof d.style&&!0!==d.style.hidden&&("inherit"===c.headerStyles.halign&&(a.styles.halign=d.style.align),"inherit"===c.styles.fillColor&&(a.styles.fillColor=d.style.bcolor),"inherit"===c.styles.textColor&&(a.styles.textColor=d.style.color),
|
||||
"inherit"===c.styles.fontStyle&&(a.styles.fontStyle=d.style.fstyle))}});"function"!==typeof c.createdCell&&(c.createdCell=function(a,b){b=k.teCells[b.row.index+":"+b.column.dataKey];a.styles.halign="inherit"===c.styles.halign?"center":c.styles.halign;a.styles.valign=c.styles.valign;"undefined"!==typeof b&&"undefined"!==typeof b.style&&!0!==b.style.hidden&&("inherit"===c.styles.halign&&(a.styles.halign=b.style.align),"inherit"===c.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===c.styles.textColor&&
|
||||
(a.styles.textColor=b.style.color),"inherit"===c.styles.fontStyle&&(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof c.drawHeaderCell&&(c.drawHeaderCell=function(a,b){var c=k.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?Za(a,b,c):!1});"function"!==typeof c.drawCell&&(c.drawCell=function(a,b){var c=k.teCells[b.row.index+":"+b.column.dataKey];if(!0!==("undefined"!==typeof c&&c.isCanvas))Za(a,b,c)&&(k.doc.rect(a.x,a.y,a.width,a.height,
|
||||
a.styles.fillStyle),"undefined"===typeof c||"undefined"!==typeof c.hasUserDefText&&!0===c.hasUserDefText||"undefined"===typeof c.elements||!c.elements.length?db(a,{},k):(b=a.height/c.rect.height,b>k.hScaleFactor&&(k.hScaleFactor=b),k.wScaleFactor=a.width/c.rect.width,b=a.textPos.y,bb(a,c.elements,k),a.textPos.y=b,db(a,c.elements,k)));else{c=c.elements[0];var e=d(c).attr("data-tableexport-canvas"),f=c.getBoundingClientRect();a.width=f.width*k.wScaleFactor;a.height=f.height*k.hScaleFactor;b.row.height=
|
||||
a.height;Xa(a,c,e,k)}return!1});k.headerrows=[];z=W(d(this));d(z).each(function(){a=0;k.headerrows[r]=[];I(this,"th,td",r,z.length,function(b,c,d){var e=Ka(b);e.title=G(b,c,d);e.key=a++;e.rowIndex=r;k.headerrows[r].push(e)});r++});if(0<r)for(var e=r-1;0<=e;)d.each(k.headerrows[e],function(){var a=this;0<e&&null===this.rect&&(a=k.headerrows[e-1][this.key]);null!==a&&0<=a.rowIndex&&(!0!==a.style.hasOwnProperty("hidden")||!0!==a.style.hidden)&&k.columns.push(a)}),e=0<k.columns.length?-1:e-1;var h=0;
|
||||
y=[];y=X(d(this));d(y).each(function(){var b=[];a=0;I(this,"td,th",r,z.length+y.length,function(c,e,f){if("undefined"===typeof k.columns[a]){var g={title:"",key:a,style:{hidden:!0}};k.columns.push(g)}b.push(G(c,e,f));"undefined"!==typeof c&&null!==c?(g=Ka(c),g.isCanvas=c.hasAttribute("data-tableexport-canvas"),g.elements=g.isCanvas?d(c):d(c).children(),"undefined"!==typeof d(c).data("teUserDefText")&&(g.hasUserDefText=!0)):(g=d.extend(!0,{},k.teCells[h+":"+(a-1)]),g.colspan=-1);k.teCells[h+":"+a++]=
|
||||
g});b.length&&(k.rows.push(b),h++);r++});if("function"===typeof k.onBeforeAutotable)k.onBeforeAutotable(d(this),k.columns,k.rows,c);sb(c.tableExport.doc,k.columns,k.rows,c);if("function"===typeof k.onAfterAutotable)k.onAfterAutotable(d(this),c);var f=b.jspdf.autotable;var l="undefined"===typeof H||"undefined"===typeof H.y?0:H.y;f.startY=l+c.margin.top});Ya(k.doc,"undefined"!==typeof k.images&&!1===jQuery.isEmptyObject(k.images));"undefined"!==typeof k.headerrows&&(k.headerrows.length=0);"undefined"!==
|
||||
typeof k.columns&&(k.columns.length=0);"undefined"!==typeof k.rows&&(k.rows.length=0);delete k.doc;k.doc=null})}var x,H,l,Na,q;if("function"===typeof b.onTableExportEnd)b.onTableExportEnd();return this};var t=function(){return function(){this.contentWidth=this.y=this.x=this.width=this.height=0;this.rows=[];this.columns=[];this.headerRow=null;this.settings={}}}(),D=function(){return function(d){this.raw=d||{};this.index=0;this.styles={};this.cells={};this.y=this.height=0}}(),K=function(){return function(d){this.raw=
|
||||
d;this.styles={};this.text="";this.contentWidth=0;this.textPos={};this.y=this.x=this.width=this.height=0}}(),wa=function(){return function(d){this.dataKey=d;this.options={};this.styles={};this.x=this.width=this.contentWidth=0}}()})(jQuery);
|
File diff suppressed because one or more lines are too long
|
@ -233,7 +233,7 @@ desired effect
|
|||
<footer class="main-footer">
|
||||
<!-- To the right -->
|
||||
<div class="pull-right hidden-xs">
|
||||
企业安全生产管理系统集团后台
|
||||
企业环保管理系统集团后台
|
||||
</div>
|
||||
<!-- Default to the left -->
|
||||
<strong>Copyright © 2019 <a href="https://ctc.ac.cn">国检集团</a>.</strong> 版权所有.
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
|
||||
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
|
||||
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
|
||||
<script src="{% static 'groups/js-xlsx/xlsx.core.min.js' %}"></script>
|
||||
<script src="{% static 'groups/js-xlsx/tableExport.min.js' %}"></script>
|
||||
<script src="{% static 'groups/bower_components/bootstrap-table/extensions/export/bootstrap-table-export.min.js' %}"></script>
|
||||
{% endblock %}
|
||||
{% block title %}在线考试统计{% endblock %}
|
||||
{% block pagehead %}
|
||||
|
@ -279,13 +276,6 @@
|
|||
showToggle: true, //是否显示详细视图和列表视图的切换按钮
|
||||
cardView: false, //是否显示详细视图
|
||||
detailView: false, //是否显示父子表
|
||||
showExport: true, //是否显示导出
|
||||
buttonsAlign: "right", //按钮位置
|
||||
exportDataType:"basic",
|
||||
exportTypes:['excel'],
|
||||
exportOptions:{
|
||||
fileName: '考试统计', //文件名称设置
|
||||
},
|
||||
responseHandler: function (res) {
|
||||
if(res.code){
|
||||
exam2(res.data[0]);
|
||||
|
@ -305,12 +295,6 @@
|
|||
align: 'center',
|
||||
searchable: false,
|
||||
}, {
|
||||
field: 'answer_count',
|
||||
title: '答题次数',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
searchable: false,
|
||||
},{
|
||||
field: 'user_count',
|
||||
title: '员工数',
|
||||
sortable: true,
|
||||
|
@ -331,35 +315,14 @@
|
|||
searchable: false,
|
||||
},{
|
||||
field: 'rate3',
|
||||
title: '优秀率(按人>90)',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
searchable: false,
|
||||
},
|
||||
{
|
||||
field: 'rate3_',
|
||||
title: '优秀率(按次>90)',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
searchable: false,
|
||||
},
|
||||
{
|
||||
field: 'rate4_',
|
||||
title: '优秀率(按次>80)',
|
||||
title: '优秀率',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
searchable: false,
|
||||
},
|
||||
{
|
||||
field: 'rate2',
|
||||
title: '满分率(按人)',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
searchable: false,
|
||||
},
|
||||
{
|
||||
field: 'rate2_',
|
||||
title: '满分率(按次)',
|
||||
title: '满分率',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
searchable: false,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</div>
|
||||
<!-- /.login-logo -->
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg">企业安全生产管理系统</p>
|
||||
<p class="login-box-msg">企业环保管理系统</p>
|
||||
|
||||
<form action="{% url 'groups_login' %}" method="post">
|
||||
{% if groups_form.captcha.errors %}
|
||||
|
|
|
@ -487,14 +487,10 @@ def exam_rate(request):
|
|||
ret = {'x':{'name':'所属公司', 'data':[]}, 's':[{'name':'参考率', 'data':[]},{'name':'优秀率', 'data':[]}, {'name':'满分率', 'data':[]}], 't':'各公司考试比例统计'}
|
||||
ret_ = []
|
||||
test_count_t = 0
|
||||
answer_count_t = 0
|
||||
user_count_t = 0
|
||||
testuser_count_t = 0
|
||||
full_count_t = 0
|
||||
full_count_t_= 0
|
||||
ninety_count_t = 0
|
||||
ninety_count_t_ = 0
|
||||
e_count_t_ = 0
|
||||
for i in companys:
|
||||
# 员工数
|
||||
user_count = s_models.User.objects.filter(usecomp=i, deletemark=1, issuper=0).count()
|
||||
|
@ -513,36 +509,21 @@ def exam_rate(request):
|
|||
# 参加考试员工数
|
||||
testuser_count = base.values('user').distinct().count()
|
||||
# 参考率
|
||||
rate1 = testuser_count/user_count if user_count else 0
|
||||
# 答题总数
|
||||
answer_count = base.count()
|
||||
rate1 = testuser_count/user_count
|
||||
# 考试总数
|
||||
# test_count = base.count()
|
||||
# 满分人数
|
||||
full_count = base.filter(score__gte= F('examtest__totalscore')).values('user').distinct().count()
|
||||
# 满分次数
|
||||
full_count_ = base.filter(score__gte= F('examtest__totalscore')).count()
|
||||
# 满分率
|
||||
rate2 = full_count/user_count if user_count else 0
|
||||
# 满分率
|
||||
rate2_ = full_count_/answer_count if answer_count else 0
|
||||
# 90分数人数
|
||||
ninety_count = base.filter(score__gte = F('examtest__totalscore')*0.9).values('user').distinct().count()
|
||||
# 80分数次数
|
||||
e_count_= base.filter(score__gte = F('examtest__totalscore')*0.8).count()
|
||||
# 90分数次数
|
||||
ninety_count_ = base.filter(score__gte = F('examtest__totalscore')*0.9).count()
|
||||
# 90以上得分率
|
||||
rate3 = ninety_count/user_count if user_count else 0
|
||||
# 90以上得分率
|
||||
rate3_ = ninety_count_/answer_count if answer_count else 0
|
||||
# 80以上得分率
|
||||
rate4_ = e_count_/answer_count if answer_count else 0
|
||||
# rate1 = '%.2f' % (rate1*100)
|
||||
rate1 = int(rate1*100+0.5) if int(rate1*100+0.5)<101 else 100
|
||||
rate2 = int(rate2*100+0.5) if int(rate2*100+0.5)<101 else 100
|
||||
rate2_ = int(rate2_*100+0.5) if int(rate2_*100+0.5)<101 else 100
|
||||
rate3 = int(rate3*100+0.5) if int(rate3*100+0.5)<101 else 100
|
||||
rate3_ = int(rate3_*100+0.5) if int(rate3_*100+0.5)<101 else 100
|
||||
rate4_ = int(rate4_*100+0.5) if int(rate4_*100+0.5)<101 else 100
|
||||
ret['x']['data'].append(i.partname)
|
||||
ret['s'][0]['data'].append(rate1)
|
||||
ret['s'][1]['data'].append(rate3)
|
||||
|
@ -550,32 +531,22 @@ def exam_rate(request):
|
|||
user_count_t = user_count_t + user_count
|
||||
testuser_count_t = testuser_count_t + testuser_count
|
||||
full_count_t = full_count_t + full_count
|
||||
full_count_t_ = full_count_t_ + full_count_
|
||||
ninety_count_t = ninety_count_t + ninety_count
|
||||
ninety_count_t_ = ninety_count_t_ + ninety_count_
|
||||
e_count_t_ = e_count_t_ + e_count_
|
||||
test_count_t = test_count_t + test_count
|
||||
answer_count_t = answer_count_t + answer_count
|
||||
ret_.append({'company':i.partname,'test_count':test_count, 'user_count':user_count, 'testuser_count':testuser_count, 'ninety_count':ninety_count, 'full_count':full_count,
|
||||
'rate1':rate1, 'rate2':rate2, 'rate3':rate3, 'answer_count': answer_count, 'rate2_':rate2_, 'rate3_':rate3_, 'rate4_':rate4_, 'full_count_':full_count_, 'ninty_count_':ninety_count_, 'e_count_':e_count_})
|
||||
'rate1':rate1, 'rate2':rate2, 'rate3':rate3})
|
||||
rate1_t = testuser_count_t/user_count_t
|
||||
rate2_t = full_count_t/user_count_t if user_count_t else 0
|
||||
rate2_t_ = full_count_t_/answer_count_t if answer_count_t else 0
|
||||
rate3_t = ninety_count_t/user_count_t if user_count_t else 0
|
||||
rate3_t_ = ninety_count_t_/answer_count_t if answer_count_t else 0
|
||||
rate4_t_ = e_count_t_/answer_count_t if answer_count_t else 0
|
||||
rate1_t = int(rate1_t*100+0.5) if int(rate1_t*100+0.5)<101 else 100
|
||||
rate2_t = int(rate2_t*100+0.5) if int(rate2_t*100+0.5)<101 else 100
|
||||
rate2_t_ = int(rate2_t_*100+0.5) if int(rate2_t_*100+0.5)<101 else 100
|
||||
rate3_t = int(rate3_t*100+0.5) if int(rate3_t*100+0.5)<101 else 100
|
||||
rate3_t_ = int(rate3_t_*100+0.5) if int(rate3_t_*100+0.5)<101 else 100
|
||||
rate4_t_ = int(rate4_t_*100+0.5) if int(rate4_t_*100+0.5)<101 else 100
|
||||
ret['x']['data'].insert(0, groupuser.group.groupname)
|
||||
ret['s'][0]['data'].insert(0, rate1_t)
|
||||
ret['s'][1]['data'].insert(0, rate3_t)
|
||||
ret['s'][2]['data'].insert(0, rate2_t)
|
||||
ret_.insert(0,{'company':groupuser.group.groupname,'test_count':test_count_t, 'user_count':user_count_t, 'testuser_count':testuser_count_t, 'ninety_count':ninety_count_t, 'full_count':full_count_t,
|
||||
'rate1':rate1_t, 'rate2':rate2_t, 'rate3':rate3_t, 'answer_count': answer_count_t, 'rate2_':rate2_t_, 'rate3_':rate3_t_, 'rate4_':rate4_t_, 'full_count_':full_count_t_, 'ninty_count_':ninety_count_t_, 'e_count_':e_count_t_})
|
||||
'rate1':rate1_t, 'rate2':rate2_t, 'rate3':rate3_t})
|
||||
return HttpResponse(json.dumps({'code':200,'data':[ret, {'total':len(ret_),'rows':ret_}]}), content_type='application/json')
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
|
@ -1,5 +1,4 @@
|
|||
@echo off
|
||||
title c_beat
|
||||
call venv\scripts\activate.bat
|
||||
celery -A mysite beat -l info
|
||||
pause
|
|
@ -1,5 +1,4 @@
|
|||
@echo off
|
||||
title c_worker
|
||||
call venv\scripts\activate.bat
|
||||
celery -A mysite worker -l info -P eventlet
|
||||
pause
|
|
@ -1,3 +1,2 @@
|
|||
title redis
|
||||
c:\redis\redis-server.exe c:\redis\redis.windows.conf
|
||||
pause
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 2.2.8 on 2024-07-27 22:01
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0396_auto_20220304_1648'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='riskacttask',
|
||||
name='imgs',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='现场图片'),
|
||||
),
|
||||
]
|
|
@ -1169,7 +1169,6 @@ class RiskActTask(models.Model): # 风险点排查执行记录
|
|||
istask = models.IntegerField(default=0) # 是否是任务
|
||||
tasknote = models.TextField('任务检查说明', null=True, blank=True)
|
||||
taskset = models.ForeignKey(GridTaskSet, null=True, blank=True, verbose_name='由哪个设置派发', on_delete=models.SET_NULL)
|
||||
imgs = models.TextField('现场图片', null=True, blank=True)
|
||||
|
||||
class Risktask(models.Model): # 风险排查任务清单
|
||||
id = models.AutoField(primary_key=True)
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
import locale
|
||||
from croniter import croniter
|
||||
from cron_descriptor import get_description
|
||||
from safesite.models import MySchedule, GridTaskSet, PeriodicTask, CrontabSchedule, IntervalSchedule
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
period_dict = {
|
||||
"days": "天",
|
||||
"hours": "小时",
|
||||
"minutes": "分钟",
|
||||
"seconds": "秒",
|
||||
"microseconds": "毫秒"
|
||||
}
|
||||
def get_chinese_description(type:str = 'interval', data: dict = {}):
|
||||
"""转换为汉语描述
|
||||
"""
|
||||
if type == 'interval':
|
||||
try:
|
||||
return f"每隔{data['every']}{period_dict[data['period']]}"
|
||||
except KeyError:
|
||||
return ''
|
||||
elif type == 'crontab':
|
||||
exp = f"{data['minute']} {data['hour']} {data['day_of_month']} {data['month_of_year']} {data['day_of_week']}"
|
||||
try:
|
||||
croniter(exp)
|
||||
except ValueError:
|
||||
return ''
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
return get_description(exp)
|
||||
return ''
|
||||
|
||||
def correct_myschedule():
|
||||
cs = CrontabSchedule.objects.all()
|
||||
for crontab in cs:
|
||||
name = get_chinese_description('crontab',
|
||||
{"minute": crontab.minute, "hour": crontab.hour, "day_of_month": crontab.day_of_month,
|
||||
"month_of_year": crontab.month_of_year, "day_of_week": crontab.day_of_week})
|
||||
if name == '':
|
||||
MySchedule.objects.filter(crontab=crontab).delete()
|
||||
crontab.delete()
|
||||
else:
|
||||
MySchedule.objects.filter(crontab=crontab).update(name=name, typeset='crontab')
|
||||
|
||||
ints = IntervalSchedule.objects.all()
|
||||
for interval in ints:
|
||||
name = get_chinese_description('interval', {'every': interval.every, 'period': interval.period})
|
||||
if name == '':
|
||||
MySchedule.objects.filter(interval=interval).delete()
|
||||
interval.delete()
|
||||
else:
|
||||
MySchedule.objects.filter(interval=interval).update(name=name, typeset='interval')
|
Binary file not shown.
|
@ -37,7 +37,7 @@ ul { margin: 0; padding: 0;}
|
|||
*zoom: 1;
|
||||
}
|
||||
header{width:100%; height: 90px; background: url(../../images/bigdata/bg_top.png) center no-repeat ; text-align: center; font-size: 36px; color: #00f6ff; line-height: 90px; margin: 0 auto;}
|
||||
#content{width: 1860px; height: 100%; margin: 20px auto 0 auto;}
|
||||
#content{width: 1460px; height: 100%; margin: 20px auto 0 auto;}
|
||||
#content .content_left{width: 385px; height: 100%; float: left;}
|
||||
.content_left .dtuplc{width: 355px; height: 180px; padding: 15px 15px 0 15px; background: url(../../images/bigdata/zuoyi.png) top no-repeat;}
|
||||
.dtu{width: 177px; height: 180px; float: left;}
|
||||
|
|
|
@ -1466,7 +1466,7 @@ function bindmap9(x) {
|
|||
myChart9 = echarts.init(document.getElementById(x));
|
||||
myChart9.setOption(option = {
|
||||
legend: {
|
||||
data: ['隐患', '培训', '演练', '观察', '事件']
|
||||
data: ['隐患', '培训', '演练']
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
|
@ -1516,17 +1516,7 @@ function bindmap9(x) {
|
|||
name: '演练',
|
||||
type:'bar',
|
||||
data: data.演练
|
||||
},
|
||||
{
|
||||
name: '观察',
|
||||
type:'bar',
|
||||
data: data.观察
|
||||
},
|
||||
{
|
||||
name: '事件',
|
||||
type:'bar',
|
||||
data: data.事件
|
||||
},
|
||||
}
|
||||
|
||||
]
|
||||
});
|
||||
|
|
|
@ -596,49 +596,49 @@ function jsonSort(jsonObj) {
|
|||
function mapupdate() {
|
||||
if ($('#mapshowinput').length) {
|
||||
source.clear()
|
||||
$.get('/api/mapshow?a=risk', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
setPolygon(res[i])
|
||||
}
|
||||
})
|
||||
$.get('/api/mapshow?a=trouble', function (res) {
|
||||
// $.get('/api/mapshow?a=risk', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// setPolygon(res[i])
|
||||
// }
|
||||
// })
|
||||
// $.get('/api/mapshow?a=trouble', function (res) {
|
||||
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
var data = res[i]
|
||||
data.id = data.yhqy__id
|
||||
data.num = data.num
|
||||
data.polygon = data.yhqy__polygon
|
||||
data.name = data.yhqy__name
|
||||
data.type = 'yh'
|
||||
setPoint(data)
|
||||
}
|
||||
})
|
||||
$.get('/api/mapshow?a=miss', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
var data = res[i]
|
||||
data.id = data.missqy__id
|
||||
data.num = data.num
|
||||
data.polygon = data.missqy__polygon
|
||||
data.name = data.missqy__name
|
||||
data.type = 'ws'
|
||||
setPoint(data)
|
||||
}
|
||||
})
|
||||
$.get('/api/mapshow?a=operation', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
var data = res[i]
|
||||
data.id = data.zyqy__id
|
||||
data.num = data.num
|
||||
data.polygon = data.zyqy__polygon
|
||||
data.name = data.zyqy__name
|
||||
data.type = 'zy'
|
||||
data.list = data.zylist
|
||||
setPoint(data)
|
||||
}
|
||||
})
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// var data = res[i]
|
||||
// data.id = data.yhqy__id
|
||||
// data.num = data.num
|
||||
// data.polygon = data.yhqy__polygon
|
||||
// data.name = data.yhqy__name
|
||||
// data.type = 'yh'
|
||||
// setPoint(data)
|
||||
// }
|
||||
// })
|
||||
// $.get('/api/mapshow?a=miss', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// var data = res[i]
|
||||
// data.id = data.missqy__id
|
||||
// data.num = data.num
|
||||
// data.polygon = data.missqy__polygon
|
||||
// data.name = data.missqy__name
|
||||
// data.type = 'ws'
|
||||
// setPoint(data)
|
||||
// }
|
||||
// })
|
||||
// $.get('/api/mapshow?a=operation', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// var data = res[i]
|
||||
// data.id = data.zyqy__id
|
||||
// data.num = data.num
|
||||
// data.polygon = data.zyqy__polygon
|
||||
// data.name = data.zyqy__name
|
||||
// data.type = 'zy'
|
||||
// data.list = data.zylist
|
||||
// setPoint(data)
|
||||
// }
|
||||
// })
|
||||
//监测地图,排口获取
|
||||
$.get('/api/enp/draindt/allmap', function (res) {
|
||||
console.log(res);
|
||||
console.log(res)
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
|
||||
var data = res[i]
|
||||
|
@ -646,8 +646,8 @@ function mapupdate() {
|
|||
data.number = data.number
|
||||
data.location = data.location
|
||||
data.name = data.name
|
||||
data.type = 'pk'
|
||||
setPoint(data)
|
||||
data.type2 = 'pk'
|
||||
setPointOnly(data)
|
||||
|
||||
}
|
||||
})
|
||||
|
|
|
@ -18,46 +18,20 @@ dirname = settings.BASE_DIR + "/safesite/"
|
|||
|
||||
|
||||
def getcs(companyid): # 获取公司相关参数设置
|
||||
qs = Yjsetup.objects.filter(usecomp__partid=companyid)
|
||||
if qs.exists():
|
||||
pass
|
||||
else:
|
||||
Yjsetup.objects.create(
|
||||
monthyhavg=100,
|
||||
safev=50,
|
||||
warnv=75,
|
||||
alertv=100,
|
||||
maxv=200,
|
||||
yhpgqz=4,
|
||||
yhdjqz=4,
|
||||
yhsblqz=1,
|
||||
yhzglqz=4,
|
||||
pxdjqz=3,
|
||||
pxxgqz=4,
|
||||
yldjqz=3,
|
||||
ylxgqz=3,
|
||||
usecomp=Partment.objects.get(partid=companyid)
|
||||
)
|
||||
return Yjsetup.objects.filter(usecomp__partid=companyid).values()[0]
|
||||
|
||||
|
||||
def gettime(x=datetime.datetime.now()):
|
||||
if x:
|
||||
pass
|
||||
else:
|
||||
x = datetime.datetime.now()
|
||||
days_num = calendar.monthrange(x.year, x.month)[1]
|
||||
first_day = datetime.date(x.year, x.month, 1)
|
||||
first_day_of_next_month = first_day + datetime.timedelta(days=days_num)
|
||||
return first_day, first_day_of_next_month
|
||||
|
||||
|
||||
@shared_task
|
||||
def get_wtoken():
|
||||
r = requests.get(
|
||||
"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx4d75244c1b980b5b&secret=edf7d23a457fb4df5ad47eeb9d4b7a39"
|
||||
).text
|
||||
token = json.loads(r)["access_token"]
|
||||
with open("D:/safesite/safesite/token.txt", "w") as f:
|
||||
f.write(token)
|
||||
|
||||
|
||||
@shared_task
|
||||
def send_wechatmsgs(postdict, tolist):
|
||||
with open(dirname + "token.txt", "r", encoding="utf-8") as f:
|
||||
|
@ -74,6 +48,18 @@ def send_wechatmsgs(postdict, tolist):
|
|||
pass
|
||||
|
||||
|
||||
def recal_yjjs(year, month):
|
||||
cal_time = datetime.datetime(year, month, 1)
|
||||
companys = Partment.objects.filter(iscompany=1).order_by("-creattime")
|
||||
for i in companys:
|
||||
yjjs(i.partid, cal_time)
|
||||
yjjs_gc(i.partid, cal_time)
|
||||
yjjs_px(i.partid, cal_time)
|
||||
yjjs_ws(i.partid, cal_time)
|
||||
yjjs_yl(i.partid, cal_time)
|
||||
ycjs(year, month)
|
||||
|
||||
|
||||
@shared_task
|
||||
def send_wechatmsg(postdict):
|
||||
with open(dirname + "token.txt", "r", encoding="utf-8") as f:
|
||||
|
@ -90,7 +76,8 @@ def send_wechatmsg(postdict):
|
|||
|
||||
|
||||
@shared_task
|
||||
def yjjs(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()[1]):
|
||||
def yjjs(companyid, cal_time=None):
|
||||
first_day, first_day_of_next_month = gettime(cal_time)
|
||||
# 隐患算分
|
||||
a = Trouble.objects.filter(
|
||||
fxsj__range=(first_day, first_day_of_next_month),
|
||||
|
@ -163,7 +150,8 @@ def yjjs(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()[1]
|
|||
|
||||
|
||||
@shared_task
|
||||
def yjjs_px(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()[1]):
|
||||
def yjjs_px(companyid, cal_time=None):
|
||||
first_day, first_day_of_next_month = gettime(cal_time)
|
||||
# 培训算分
|
||||
a = Train.objects.filter(
|
||||
starttime__range=(first_day, first_day_of_next_month),
|
||||
|
@ -219,7 +207,8 @@ def yjjs_px(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()
|
|||
|
||||
|
||||
@shared_task
|
||||
def yjjs_gc(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()[1]):
|
||||
def yjjs_gc(companyid, cal_time=None):
|
||||
first_day, first_day_of_next_month = gettime(cal_time)
|
||||
# 观察算分
|
||||
a = Observe.objects.filter(
|
||||
looktime__range=(first_day, first_day_of_next_month),
|
||||
|
@ -256,8 +245,9 @@ def yjjs_gc(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()
|
|||
|
||||
|
||||
@shared_task
|
||||
def yjjs_ws(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()[1]):
|
||||
def yjjs_ws(companyid, cal_time=None):
|
||||
# 未遂算分
|
||||
first_day, first_day_of_next_month = gettime(cal_time)
|
||||
a = Miss.objects.filter(
|
||||
misstime__range=(first_day, first_day_of_next_month),
|
||||
usecomp__partid=companyid,
|
||||
|
@ -289,7 +279,8 @@ def yjjs_ws(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()
|
|||
|
||||
|
||||
@shared_task
|
||||
def yjjs_yl(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()[1]):
|
||||
def yjjs_yl(companyid, cal_time=None):
|
||||
first_day, first_day_of_next_month = gettime(cal_time)
|
||||
a = Drill.objects.filter(
|
||||
starttime__range=(first_day, first_day_of_next_month),
|
||||
usecomp__partid=companyid,
|
||||
|
@ -336,39 +327,13 @@ def yjjs_yl(companyid, first_day=gettime()[0], first_day_of_next_month=gettime()
|
|||
obj.save()
|
||||
|
||||
|
||||
@shared_task
|
||||
def correct_yjz(year: int = 0, month: int = 0, companyid: int = 0):
|
||||
# 重新更新某个月的预警值
|
||||
if year and month:
|
||||
pass
|
||||
else:
|
||||
now = datetime.datetime.now()
|
||||
now_1_month_before = now - datetime.timedelta(days=now.day + 1)
|
||||
year = now_1_month_before.year
|
||||
month = now_1_month_before.month
|
||||
days_num = calendar.monthrange(year, month)[1]
|
||||
first_day = datetime.date(year, month, 1)
|
||||
first_day_of_next_month = first_day + datetime.timedelta(days=days_num)
|
||||
if companyid == 0:
|
||||
companys = Partment.objects.filter(iscompany=1)
|
||||
else:
|
||||
companys = Partment.objects.filter(partid=companyid)
|
||||
for i in companys:
|
||||
yjjs(i.partid, first_day, first_day_of_next_month)
|
||||
yjjs_px(i.partid, first_day, first_day_of_next_month)
|
||||
yjjs_gc(i.partid, first_day, first_day_of_next_month)
|
||||
yjjs_ws(i.partid, first_day, first_day_of_next_month)
|
||||
yjjs_yl(i.partid, first_day, first_day_of_next_month)
|
||||
ycjs(first_day.year, first_day.month)
|
||||
|
||||
|
||||
@shared_task
|
||||
def ycjs(nowyear=datetime.datetime.now().year, nowmonth=datetime.datetime.now().month):
|
||||
# print('正在执行预测计算。。。')
|
||||
companys = Partment.objects.filter(iscompany=1)
|
||||
objs = Yjyc.objects.exclude(yjz=0, year=nowyear, month=nowmonth)
|
||||
for x in companys:
|
||||
obj = objs.filter(usecomp=x).order_by("-yjycid")[0:5] # 只取半年内的
|
||||
obj = objs.filter(usecomp=x).order_by("-yjycid")
|
||||
objv = obj.values("yjycid", "yjz")
|
||||
# print(objv)
|
||||
if len(obj) > 1:
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
企业安全管理数据统计
|
||||
企业环保管理数据统计
|
||||
<span id=localtime style=" font-size:14px; position: absolute; right: 30px; top:-20px; "></span>
|
||||
</header>
|
||||
<div id="content">
|
||||
|
@ -99,27 +99,7 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_right">
|
||||
<div class="report">
|
||||
<div class="report1">
|
||||
<p>线下培训</p>
|
||||
<small>{{px}}条</small>
|
||||
</div>
|
||||
<div class="report2">
|
||||
<p>行为观察</p>
|
||||
<small>{{xw}} 条</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_report">
|
||||
<div class="title"><img src="/static/safesite/mystatic/images/bigdata/icon05.png" /> 本月安全状态</div>
|
||||
<div id="map1div" style="width: 100%; height:100%;float:left;"></div>
|
||||
</div>
|
||||
<div class="data_box">
|
||||
<div class="title"><img src="/static/safesite/mystatic/images/bigdata/icon06.png" /> 预警预测趋势图</div>
|
||||
<div id="map2div" style="width:100%; height:80%;float:left;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--遮罩层-->
|
||||
<div class="bgPop"></div>
|
||||
<!--弹出框-->
|
||||
|
@ -485,6 +465,7 @@
|
|||
}
|
||||
else {
|
||||
src = '/static/safesite/mystatic/images/icon1.png'
|
||||
anchor = [0.9, 50]
|
||||
}
|
||||
return new ol.style.Style({
|
||||
/**{olx.style.IconOptions}类型*/
|
||||
|
@ -527,6 +508,17 @@
|
|||
pointFeature.setStyle(createPointStyle(pointFeature));
|
||||
source.addFeature(pointFeature)
|
||||
}
|
||||
function setPointOnly(i) {
|
||||
var pointFeature = new ol.Feature({
|
||||
geometry: new ol.geom.Point(i.location),
|
||||
id: i.id,
|
||||
name: i.name,
|
||||
type: i.type2,
|
||||
num: i.number
|
||||
});
|
||||
pointFeature.setStyle(createPointStyle(pointFeature));
|
||||
source.addFeature(pointFeature)
|
||||
}
|
||||
function setPolygon(i) {
|
||||
var polygonFeature = new ol.Feature({
|
||||
geometry: new ol.geom.Polygon(i.polygon),
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<body>
|
||||
|
||||
<header>
|
||||
企业安全数据显示大屏
|
||||
企业环保数据显示大屏
|
||||
</header>
|
||||
<div class="center_top">
|
||||
<div id="map" class="map" style="width:100%;height:100%;outline: #4A74A8 solid 0.15em;">
|
||||
|
@ -386,46 +386,46 @@
|
|||
function updatepo() {
|
||||
if ($('#mapshowinput').length) {
|
||||
source.clear()
|
||||
$.get('/api/mapshow?a=risk', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
setPolygon(res[i])
|
||||
}
|
||||
})
|
||||
$.get('/api/mapshow?a=trouble', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
var data = res[i]
|
||||
data.id = data.yhqy__id
|
||||
data.num = data.num
|
||||
data.polygon = data.yhqy__polygon
|
||||
data.name = data.yhqy__name
|
||||
data.type = 'yh'
|
||||
setPoint(data)
|
||||
}
|
||||
})
|
||||
$.get('/api/mapshow?a=miss', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
var data = res[i]
|
||||
data.id = data.missqy__id
|
||||
data.num = data.num
|
||||
data.polygon = data.missqy__polygon
|
||||
data.name = data.missqy__name
|
||||
data.type = 'ws'
|
||||
setPoint(data)
|
||||
}
|
||||
})
|
||||
$.get('/api/mapshow?a=operation', function (res) {
|
||||
for (let i = 0, len = res.length; i < len; i++) {
|
||||
var data = res[i]
|
||||
data.id = data.zyqy__id
|
||||
data.num = data.num
|
||||
data.polygon = data.zyqy__polygon
|
||||
data.name = data.zyqy__name
|
||||
data.type = 'zy'
|
||||
data.list = data.zylist
|
||||
popuplist.push(data)
|
||||
setPoint(data)
|
||||
}
|
||||
})
|
||||
// $.get('/api/mapshow?a=risk', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// setPolygon(res[i])
|
||||
// }
|
||||
// })
|
||||
// $.get('/api/mapshow?a=trouble', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// var data = res[i]
|
||||
// data.id = data.yhqy__id
|
||||
// data.num = data.num
|
||||
// data.polygon = data.yhqy__polygon
|
||||
// data.name = data.yhqy__name
|
||||
// data.type = 'yh'
|
||||
// setPoint(data)
|
||||
// }
|
||||
// })
|
||||
// $.get('/api/mapshow?a=miss', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// var data = res[i]
|
||||
// data.id = data.missqy__id
|
||||
// data.num = data.num
|
||||
// data.polygon = data.missqy__polygon
|
||||
// data.name = data.missqy__name
|
||||
// data.type = 'ws'
|
||||
// setPoint(data)
|
||||
// }
|
||||
// })
|
||||
// $.get('/api/mapshow?a=operation', function (res) {
|
||||
// for (let i = 0, len = res.length; i < len; i++) {
|
||||
// var data = res[i]
|
||||
// data.id = data.zyqy__id
|
||||
// data.num = data.num
|
||||
// data.polygon = data.zyqy__polygon
|
||||
// data.name = data.zyqy__name
|
||||
// data.type = 'zy'
|
||||
// data.list = data.zylist
|
||||
// popuplist.push(data)
|
||||
// setPoint(data)
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
Updatepoint = setInterval(updatepo, 1000 * 60 * 5)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
required=true />
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
<input id="aqcs" class="easyui-textbox" name="aqcs" style="width:480px;height:100px" data-options="label:'安全措施',multiline:true"
|
||||
<input id="aqcs" class="easyui-textbox" name="aqcs" style="width:480px;height:100px" data-options="label:'环保措施',multiline:true"
|
||||
required=true />
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
required=true />
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
<input id="aqcs" class="easyui-textbox" name="aqcs" style="width:480px;height:100px" data-options="label:'安全措施',multiline:true"
|
||||
<input id="aqcs" class="easyui-textbox" name="aqcs" style="width:480px;height:100px" data-options="label:'环保措施',multiline:true"
|
||||
required=true />
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>ctc安全生产管理系统</title>
|
||||
<title>ctc环保管理系统</title>
|
||||
<link rel="icon" href="/media/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/safesite/mystatic/css/loading.css">
|
||||
<link rel="stylesheet" type="text/css" href="/static/safesite/easyui/themes/default/easyui.css">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>ctc安全生产管理系统</title>
|
||||
<title>ctc环保管理系统</title>
|
||||
<link rel="icon" href="/static/safesite/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/safesite/mystatic/css/loading.css">
|
||||
<link rel="stylesheet" type="text/css" href="/static/safesite/easyui/themes/default/easyui.css">
|
||||
|
@ -116,12 +116,12 @@
|
|||
<button style="margin: 15px;background-color: transparent;border: 0;color: white;cursor: pointer;"
|
||||
onclick="javascript:$('#tt').tabs('select',0)"><span
|
||||
style="font-size:24px">{{companyname}}</span><br /><span
|
||||
style="font-size:20px">安全生产管理系统</span></button>
|
||||
style="font-size:20px">环保管理系统</span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="menuTreediv" data-options="region:'west'" style="width: 150px; background-color: #ffffff;">
|
||||
<div id="menuTreediv" data-options="region:'west'" style="width: 180px; background-color: #ffffff;">
|
||||
<!-- <div class="divMune">
|
||||
<img src="/static/safesite/mystatic/images/fanhuiBut.png"
|
||||
style="float: right;width:20px;height:20px;text-align: center;margin-top: 10px;margin-right: 10px;"
|
||||
|
@ -249,7 +249,9 @@
|
|||
var headimgurl = $('#userindex').attr('headimgurl');
|
||||
var issuper = {{ issuper }};
|
||||
if (issuper == 1) { $('#setupb').show(); $('#bindwx').hide() }
|
||||
if ((openid == 0 || openid == 'None') && issuper != 1) { $('#wxdg').dialog(); } else { $('#bindwx').text('解绑微信'); };
|
||||
if ((openid == 0 || openid == 'None') && issuper != 1) {
|
||||
//$('#wxdg').dialog();
|
||||
} else { $('#bindwx').text('解绑微信'); };
|
||||
if (headimgurl != 0 && headimgurl != 'None' && issuper != 1) { $('#headimg').attr('src', headimgurl); }
|
||||
function logout() {
|
||||
$.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
|
||||
|
@ -334,7 +336,7 @@
|
|||
}
|
||||
$.get('menutree', function (data) {
|
||||
var data = convertmenu(data)
|
||||
data[0]['state'] = 'open'
|
||||
// data[0]['state'] = 'open'
|
||||
$('#menuTree').sidemenu({
|
||||
data: data,
|
||||
border: false,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>安全生产管理系统</title>
|
||||
<title>环保管理系统</title>
|
||||
<link rel="icon" href="/static/safesite/favicon.ico" type="image/x-icon" />
|
||||
<meta name="description" content="particles.js is a lightweight JavaScript library for creating particles.">
|
||||
<meta name="author" content="Vincent Garreau" />
|
||||
|
@ -122,7 +122,7 @@
|
|||
|
||||
<div class="login" style="right:10%">
|
||||
<div class="login-top">
|
||||
企业安全生产管理系统
|
||||
企业环保管理系统
|
||||
</div>
|
||||
<form id="dlform" action="{% url 'login' %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<div style="margin-left: 10px;margin-right:10px;overflow: hidden;">
|
||||
<div style="width:100%;height:300px;padding: 20px;">
|
||||
<!-- <div style="width:100%;height:300px;padding: 20px;">
|
||||
<div id="map1div" style="width: 33%; height:100%;float:left;"></div>
|
||||
<div id="map2div" style="width: 66%; height:100%;float:left;"></div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div style="width:100%">
|
||||
|
||||
<div style="width:100%;height:160px;">
|
||||
<div style="width: 19.5%;
|
||||
<div style="width:100%;height:140px;">
|
||||
<div style="width: 30%;
|
||||
position: relative;
|
||||
margin-left: 0.5%;
|
||||
float: left;">
|
||||
|
@ -56,7 +56,7 @@ float: left;">
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 19.5%;
|
||||
<div style="width: 30%;
|
||||
position: relative;
|
||||
margin-left: 0.5%;
|
||||
float: left;">
|
||||
|
@ -105,7 +105,7 @@ float: left;">
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 19.5%;
|
||||
<div style="width: 30%;
|
||||
position: relative;
|
||||
margin-left: 0.5%;
|
||||
float: left;">
|
||||
|
@ -155,113 +155,12 @@ float: left;">
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 19.5%;
|
||||
position: relative;
|
||||
margin-left: 0.5%;
|
||||
float: left;">
|
||||
<div style="border-radius: 5px; display: block; margin: 10px; overflow:hidden;color: #FFFFFF; background-color: #ffb848;">
|
||||
<div style="width: 80px;
|
||||
height: 50px;
|
||||
display: block;
|
||||
float: left;
|
||||
padding-top: 10px;
|
||||
padding-left: 5px;
|
||||
margin-bottom: 18px;
|
||||
font-size: 35px;
|
||||
line-height: 35px;">
|
||||
<img src="/static/safesite/mystatic/images/xwgc.png" style="width:80%;text-align: center;height:90%"
|
||||
id="headimg" />
|
||||
</div>
|
||||
<div style=" position: absolute;
|
||||
right: 10px;
|
||||
padding-right: 15px;">
|
||||
<div style="padding-top: 10px;
|
||||
text-align: right;
|
||||
font-size: 32px;
|
||||
line-height: 36px;
|
||||
letter-spacing: -1px;
|
||||
margin-bottom: 0px;
|
||||
font-weight: 300;" id="xwData">
|
||||
|
||||
</div>
|
||||
<div style="text-align: right;
|
||||
font-size: 15px;
|
||||
padding-top: 5px;">
|
||||
本月行为观察
|
||||
</div>
|
||||
</div>
|
||||
<a url="observehtml" value="listall" style="background-color: #cb871b; clear: both;
|
||||
display: block;
|
||||
padding: 5px 10px 5px 10px;
|
||||
text-transform: uppercase;
|
||||
font-weight: 300;
|
||||
font-size: 11px;
|
||||
color: #fff;
|
||||
opacity: 0.7;height: 20px;cursor: pointer;" title="行为观察" onclick="changehref(this)">
|
||||
点击查看全部
|
||||
<i style="background-position: -27px -10px;width: 14px;
|
||||
height: 14px; vertical-align: top;background-repeat: no-repeat;margin-top: 4px;
|
||||
float: right;background-image: url(/static/safesite/mystatic/images/syncfusion-icons-white.png);"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="width: 19.5%;
|
||||
position: relative;
|
||||
margin-left: 0.5%;
|
||||
float: left;">
|
||||
<div style="border-radius: 5px; display: block; margin: 10px; overflow:hidden;color: #FFFFFF; background-color: #ec2a3b;">
|
||||
<div style="width: 80px;
|
||||
height: 50px;
|
||||
display: block;
|
||||
float: left;
|
||||
padding-top: 10px;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 18px;
|
||||
font-size: 35px;
|
||||
line-height: 35px;">
|
||||
<img src="/static/safesite/mystatic/images/wssj.png" style="width:80%;text-align: center;height:90%"
|
||||
id="headimg" />
|
||||
</div>
|
||||
<div style=" position: absolute;
|
||||
right: 10px;
|
||||
padding-right: 15px;">
|
||||
<div style="padding-top: 10px;
|
||||
text-align: right;
|
||||
font-size: 32px;
|
||||
line-height: 36px;
|
||||
letter-spacing: -1px;
|
||||
margin-bottom: 0px;
|
||||
font-weight: 300;" id="wsData">
|
||||
|
||||
</div>
|
||||
<div style="text-align: right;
|
||||
font-size: 15px;
|
||||
padding-top: 5px;">
|
||||
本月未遂事件
|
||||
</div>
|
||||
</div>
|
||||
<a url="misshtml" value="listall" style="background-color: #cb1b1b; clear: both;
|
||||
display: block;
|
||||
padding: 5px 10px 5px 10px;
|
||||
text-transform: uppercase;
|
||||
font-weight: 300;
|
||||
font-size: 11px;
|
||||
color: #fff;
|
||||
opacity: 0.7;height: 20px;" title="未遂事件" onclick="changehref(this)">
|
||||
点击查看全部
|
||||
<i style="background-position: -27px -10px;width: 14px;
|
||||
height: 14px; vertical-align: top;background-repeat: no-repeat;margin-top: 4px;
|
||||
float: right;background-image: url(/static/safesite/mystatic/images/syncfusion-icons-white.png);"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id = 'panelxdiv' style="width:98%;margin-left:1%;height:800px;" hidden=true>
|
||||
<div id="panelx" class="easyui-panel" data-options="iconCls:'fa-bar-chart'" >
|
||||
</div>
|
||||
|
||||
<div style="width:100%;height:600px">
|
||||
|
||||
|
@ -330,10 +229,7 @@ float: left;">
|
|||
|
||||
</div>
|
||||
|
||||
<div id = 'panelxdiv' style="width:98%;margin-left:1%;height:800px;" hidden=true>
|
||||
<div id="panelx" class="easyui-panel" data-options="iconCls:'fa-bar-chart'" >
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -350,8 +246,8 @@ float: left;">
|
|||
document.getElementById("yhData").innerHTML = data.yhnum;
|
||||
document.getElementById("pxData").innerHTML = data.monthpx;
|
||||
document.getElementById("ylData").innerHTML = data.ylnum;
|
||||
document.getElementById("xwData").innerHTML = data.xwnum;
|
||||
document.getElementById("wsData").innerHTML = data.wsnum;
|
||||
// document.getElementById("xwData").innerHTML = data.xwnum;
|
||||
// document.getElementById("wsData").innerHTML = data.wsnum;
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -363,22 +259,22 @@ float: left;">
|
|||
});
|
||||
|
||||
//获取相关参数并绘图
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: 'setup?a=setup',
|
||||
datatype: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function () { },
|
||||
success: function (data) {
|
||||
$.get('api/tool?a=servertime',function(res){
|
||||
if(res.code==1){
|
||||
bindmap1('map1div', data,res.year,res.month);
|
||||
}
|
||||
})
|
||||
bindmap2('map2div', data);
|
||||
},
|
||||
});
|
||||
// $.ajax({
|
||||
// type: "GET",
|
||||
// url: 'setup?a=setup',
|
||||
// datatype: 'json',
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// beforeSend: function () { },
|
||||
// success: function (data) {
|
||||
// $.get('api/tool?a=servertime',function(res){
|
||||
// if(res.code==1){
|
||||
// bindmap1('map1div', data,res.year,res.month);
|
||||
// }
|
||||
// })
|
||||
// bindmap2('map2div', data);
|
||||
// },
|
||||
// });
|
||||
</script>
|
||||
|
||||
{% load myfilter %}
|
||||
|
|
|
@ -130,6 +130,9 @@
|
|||
else if (data.type == 'zy') {
|
||||
html = html + "<p>危险作业数量:" + data.num.toString() + "</p>" + "<p><a href='#' onclick='opendetail(" + data.id.toString() + ")'>查看详情</a></p>"
|
||||
}
|
||||
else if (data.type == 'pk') {
|
||||
html = html + "<p>排口编号:" + data.number+ "</p>" + "<p><a href='#' onclick='opendetail(" + data.id.toString() + ")'>查看详情</a></p>"
|
||||
}
|
||||
content.innerHTML = html;
|
||||
//设置overlay的显示位置
|
||||
overlay.setPosition(e.coordinate);
|
||||
|
@ -208,6 +211,7 @@
|
|||
}
|
||||
else {
|
||||
src = '/static/safesite/mystatic/images/icon1.png'
|
||||
anchor = [0.9, 50]
|
||||
}
|
||||
return new ol.style.Style({
|
||||
/**{olx.style.IconOptions}类型*/
|
||||
|
@ -249,6 +253,17 @@
|
|||
pointFeature.setStyle(createPointStyle(pointFeature));
|
||||
source.addFeature(pointFeature)
|
||||
}
|
||||
function setPointOnly(i) {
|
||||
var pointFeature = new ol.Feature({
|
||||
geometry: new ol.geom.Point(i.location),
|
||||
id: i.id,
|
||||
name: i.name,
|
||||
type: i.type2,
|
||||
number: i.number
|
||||
});
|
||||
pointFeature.setStyle(createPointStyle(pointFeature));
|
||||
source.addFeature(pointFeature)
|
||||
}
|
||||
function setPolygon(i) {
|
||||
var polygonFeature = new ol.Feature({
|
||||
geometry: new ol.geom.Polygon(i.polygon),
|
||||
|
@ -261,9 +276,9 @@
|
|||
source.addFeature(polygonFeature)
|
||||
}
|
||||
function opendetail(id) {
|
||||
closepopup()
|
||||
var myw = screen.availWidth * 0.5;
|
||||
opendg('区域详情', 'html/areadetail?id=' + id, myw)
|
||||
//closepopup()
|
||||
//var myw = screen.availWidth * 0.5;
|
||||
//opendg('区域详情', 'html/areadetail?id=' + id, myw)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -112,12 +112,12 @@
|
|||
<ul id="addImage" class="imgul"></ul>
|
||||
<HR width="480px" color='blue' SIZE=1 align='left'>
|
||||
</div>
|
||||
<div class='labeldiv'>请确认以下风险分析和安全措施是否就绪</div>
|
||||
<div class='labeldiv'>请确认以下风险分析和环保措施是否就绪</div>
|
||||
<div>
|
||||
<input type="checkbox" name="fxcs" value={{x.id}}><input>
|
||||
<div>
|
||||
<p>风险分析:{{x.fxfx}}</p>
|
||||
<p>安全措施:{{x.aqcs}}</p>
|
||||
<p>环保措施:{{x.aqcs}}</p>
|
||||
<p>措施类型:{{x.cslx}}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
<div class="labeldiv">风险分析和安全措施</div>
|
||||
<div class="labeldiv">风险分析和环保措施</div>
|
||||
<table class='detailtable'>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table name="" id="partaqytable" class='easyui-datagrid' title="安全员" data-options="
|
||||
<table name="" id="partaqytable" class='easyui-datagrid' title="环保员" data-options="
|
||||
rownumbers:true,
|
||||
singleSelect:true,
|
||||
method:'get',
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
var now = new Date();
|
||||
var _year;
|
||||
var _month;
|
||||
var part='';
|
||||
var part = '';
|
||||
var table1v;
|
||||
var table2v;
|
||||
var table3v;
|
||||
|
@ -239,19 +239,19 @@
|
|||
$('#month').combobox().combobox('setValue', res.month);
|
||||
BindZt();
|
||||
})
|
||||
|
||||
});
|
||||
function getDetail(year,month,part){
|
||||
$.get('api/report?a=detail&year='+year+'&month='+month+'&part='+part,function(res){
|
||||
if(res.code==1){
|
||||
$('#yyfxdiv').html(res.data.cause)
|
||||
$('#jydiv').html(res.data.suggest)
|
||||
}else{
|
||||
$('#yyfxdiv').empty()
|
||||
$('#jydiv').empty()
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
function getDetail(year, month, part) {
|
||||
$.get('api/report?a=detail&year=' + year + '&month=' + month + '&part=' + part, function (res) {
|
||||
if (res.code == 1) {
|
||||
$('#yyfxdiv').html(res.data.cause)
|
||||
$('#jydiv').html(res.data.suggest)
|
||||
} else {
|
||||
$('#yyfxdiv').empty()
|
||||
$('#jydiv').empty()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
//编辑分析报告
|
||||
function reportEdit() {
|
||||
|
@ -281,7 +281,7 @@
|
|||
//bindmap3('map3', _year, _month);
|
||||
bindmap3_o('map3', { 'year': _year, 'month': _month, 'part': part })
|
||||
//bindmap4('map4', _year, _month);
|
||||
bindmap4_o('map4', { 'year': _year, 'month': _month, 'part': part })
|
||||
// bindmap4_o('map4', { 'year': _year, 'month': _month, 'part': part })
|
||||
bindmap5('map5', { 'year': _year, 'month': _month, 'part': part });
|
||||
bindmap6('map6', { 'year': _year, 'month': _month, 'part': part });
|
||||
bindmapgclx('map7', { 'year': _year, 'month': _month, 'part': part });
|
||||
|
@ -293,7 +293,7 @@
|
|||
bindTable5(part); // 下一级部门应急演练次数
|
||||
bindTable6(part); // 下一级部门行为观察次数
|
||||
bindTable7(part); // 下一级部门未遂事件次数
|
||||
getDetail(_year,_month,part)
|
||||
getDetail(_year, _month, part)
|
||||
$('#createdate').html('报告生成时间:' + now.getFullYear() + '年' + (now.getMonth() + 1) + '月' + now.getDate() + '日');
|
||||
}
|
||||
// function getDates() {
|
||||
|
|
|
@ -10,26 +10,15 @@
|
|||
<label>排查部门</label>
|
||||
<input id="spcbm" name="pcbm" style="width:180px;"
|
||||
editable=false />
|
||||
<label>排查人</label>
|
||||
<input id="pcr" name="user__name" style="width:180px;" class="easyui-textbox"/>
|
||||
<label>起始时间</label><input name='qssj' style="width:180px"
|
||||
class="easyui-datebox" editable=false>
|
||||
<label>结束时间</label><input name='jssj' style="width:180px"
|
||||
class="easyui-datebox" editable=false>
|
||||
<a onclick="searchriskcheck()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a>
|
||||
<a id="checkdetail" onclick="checkdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function checkdetail(){
|
||||
var row = $('#riskactchecktable').datagrid('getSelected');
|
||||
if (row) {
|
||||
var url = `html/riskacttask/${row.id}/`
|
||||
opendg('查看详情',url,1000)
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||
}
|
||||
$("#spcbm").combotree({
|
||||
url: 'parthandle?a=tree',
|
||||
editable: false,
|
||||
|
|
|
@ -1,143 +0,0 @@
|
|||
<div class="easyui-layout" id="result" style="width:100%;height:100%"></div>
|
||||
<script type="text/html" id="text">
|
||||
{% verbatim %}
|
||||
<div data-options="region:'south'" id='southdiv' style="height:50px;text-align:center;padding:5px">
|
||||
<!-- <a id="exportword" onclick="exportword()" class="easyui-linkbutton" data-options="iconCls: 'fa-download'">导出</a> -->
|
||||
<a iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">关闭</a>
|
||||
</div>
|
||||
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
|
||||
<div class="labeldiv">风险点信息</div>
|
||||
<table class='detailtable'>
|
||||
<tr>
|
||||
<td>风险区域:{{riskact__area__name}}</td>
|
||||
<td>风险名称:{{riskact__name}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="labeldiv">风险点检查</div>
|
||||
<table class='detailtable'>
|
||||
<tr>
|
||||
<td>是否任务派发:{{if istask==1}}
|
||||
<span style="color:green">是</span>
|
||||
{{else}}
|
||||
<span style="color:red">否</span>
|
||||
{{/if}}</td>
|
||||
<td>任务备注:{{tasknote}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>执行时间: {{taskdo}}</td>
|
||||
<td>任务时间: {{taskadd}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:50%">执行部门:{{user__ubelongpart__partname}}</td>
|
||||
<td>执行人:{{user__name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>检查结果:{{if state==1}}
|
||||
<span style="color:green">正常</span>
|
||||
{{else}}
|
||||
<span style="color:red">异常</span>
|
||||
{{/if}}</td>
|
||||
<td>检查备注: {{note}}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="labeldiv">检查图片</div>
|
||||
<table class='detailtable'>
|
||||
|
||||
<tr>
|
||||
{{each imgs value index}}
|
||||
<td><img onclick='bigger(this)' class='tp' width="180" height="180" src='{{value}}' /></td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="labeldiv">具体记录</div>
|
||||
<table class='detailtable'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:20%">
|
||||
风险(检查项)
|
||||
</th>
|
||||
<th style="width:40%">
|
||||
具体内容
|
||||
</th>
|
||||
<th style="width:20%">
|
||||
风险等级
|
||||
</th>
|
||||
<th style="width:20%">
|
||||
隐患编号
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{each items}}
|
||||
<tr>
|
||||
<td>{{$value.risk__step}}</td>
|
||||
<td>{{$value.risk__hazard}}</td>
|
||||
<td>{{$value.risk__level}}</td>
|
||||
<td>{{$value.trouble__yhnum}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
<script type="text/javascript" src="/static/safesite/mystatic/js/template-web.js"></script>
|
||||
<script>
|
||||
var html;
|
||||
var formid = {{ id }};
|
||||
var formdata
|
||||
template.defaults.imports.dateFormat = function (date, format) {
|
||||
date = new Date(date);
|
||||
var map = {
|
||||
"M": date.getMonth() + 1, //月份
|
||||
"d": date.getDate(), //日
|
||||
"h": date.getHours(), //小时
|
||||
"m": date.getMinutes(), //分
|
||||
"s": date.getSeconds(), //秒
|
||||
"q": Math.floor((date.getMonth() + 3) / 3), //季度
|
||||
"S": date.getMilliseconds() //毫秒
|
||||
};
|
||||
format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
|
||||
var v = map[t];
|
||||
if (v !== undefined) {
|
||||
if (all.length > 1) {
|
||||
v = '0' + v;
|
||||
v = v.substr(v.length - 2);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
else if (t === 'y') {
|
||||
return (date.getFullYear() + '').substr(4 - all.length);
|
||||
}
|
||||
return all;
|
||||
});
|
||||
return format;
|
||||
};
|
||||
template.defaults.imports.gfilename = function(value){
|
||||
x = value.split('/').pop();
|
||||
return x;
|
||||
}
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "api/riskacttask?a=detail",
|
||||
data: { id: formid },
|
||||
async: false, // ajax同步使用false
|
||||
success: function (data) {
|
||||
|
||||
formdata = data.data
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "api/riskcheck2?a=listall",
|
||||
data: { pageoff:1, riskacttask: formid },
|
||||
async: false, // ajax同步使用false
|
||||
success: function (data) {
|
||||
formdata.items = data.rows
|
||||
html = template('text', formdata);
|
||||
$('#result').html(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
|
@ -10,26 +10,15 @@
|
|||
<label>排查部门</label>
|
||||
<input id="spcbm" name="pcbm" style="width:180px;"
|
||||
editable=false />
|
||||
<label>排查人</label>
|
||||
<input id="pcr" name="user__name" style="width:180px;" class="easyui-textbox"/>
|
||||
<label>起始时间</label><input name='qssj' style="width:180px"
|
||||
class="easyui-datebox" editable=false>
|
||||
<label>结束时间</label><input name='jssj' style="width:180px"
|
||||
class="easyui-datebox" editable=false>
|
||||
<a onclick="searchriskcheck()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a>
|
||||
<a id="checkdetail" onclick="checkdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function checkdetail(){
|
||||
var row = $('#riskchecktable').datagrid('getSelected');
|
||||
if (row) {
|
||||
var url = `html/riskacttask/${row.id}/`
|
||||
opendg('查看详情',url,1000)
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||
}
|
||||
$("#spcbm").combotree({
|
||||
url: 'parthandle?a=tree',
|
||||
editable: false,
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
</div>
|
||||
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
|
||||
<form method="post" id="schedulesetff">
|
||||
{% comment %} <div style="margin-bottom:10px">
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="name" class="easyui-textbox" name="name" style="width:480px" data-options="
|
||||
label:'名称'"
|
||||
required=true>
|
||||
</div> {% endcomment %}
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
<select id="set" class="easyui-combobox" name="set" style="width:200px" data-options="
|
||||
label:'配置方案',
|
||||
|
@ -87,7 +87,7 @@
|
|||
if (data.code == 1) {
|
||||
$("#schedulesettable").datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', data.msg); }
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,41 +1,14 @@
|
|||
{% comment %} <div class="easyui-layout" style="width:100%;height:100%;" title="任务列表"> {% endcomment %}
|
||||
<div class="easyui-layout" style="width:100%;height:100%;" title="任务列表">
|
||||
<!-- <div data-options="region:'west',split:true,border:false" style="width:50%;height:100%;" title="任务列表"> -->
|
||||
|
||||
<table id="risktasktable" style="height:100%;"></table>
|
||||
<!-- </div> -->
|
||||
<!-- <div data-options="region:'center',title:'执行情况',split:true,border:false" style="width:50%;height:100%;">
|
||||
|
||||
<table id="tasktable" style="height:100%;"></table>
|
||||
|
||||
</div> -->
|
||||
{% comment %} </div> {% endcomment %}
|
||||
<table id="risktasktable" style="height:100%;"></table>
|
||||
<div id="risktasktablebar" style="padding:6px;height:auto">
|
||||
<div>
|
||||
<form id='searchrisktaskff'>
|
||||
<label>执行人</label>
|
||||
<input id="zxr" name="user__name" style="width:180px;" class="easyui-textbox"/>
|
||||
<label>起始时间</label><input name='qssj' style="width:180px"
|
||||
class="easyui-datebox" editable=false>
|
||||
<label>结束时间</label><input name='jssj' style="width:180px"
|
||||
class="easyui-datebox" editable=false>
|
||||
<a onclick="searchrisktask()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a>
|
||||
<a id="taskdodetail" onclick="taskdodetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function taskdodetail(){
|
||||
var row = $('#risktasktable').datagrid('getSelected');
|
||||
if (row) {
|
||||
var url = `html/riskacttask/${row.id}/`
|
||||
opendg('查看详情',url,1000)
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||
}
|
||||
function searchrisktask() {
|
||||
var querydata = $('#searchrisktaskff').serializeJSON();
|
||||
$('#risktasktable').datagrid('load',querydata);
|
||||
}
|
||||
$('#risktasktable').datagrid({
|
||||
url: 'api/riskacttask?a=listalltask',
|
||||
singleSelect:true,
|
||||
|
@ -45,15 +18,14 @@
|
|||
method: 'get',
|
||||
pagination: 'true',
|
||||
pageSize: 20,
|
||||
toolbar: '#risktasktablebar',
|
||||
columns: [[
|
||||
{ field: 'riskact__name', title: '风险点名称', width: 80 },
|
||||
{ field: 'user__name', title: '任务执行人', width: 50 },
|
||||
{ field: 'riskact__area__name', title: '区域', width: 60 },
|
||||
{ field: 'user__name', title: '任务执行人', width: 80 },
|
||||
{ field: 'riskact__area__name', title: '区域', width: 100 },
|
||||
//{ field: 'num', title: '风险数量', width: 80 },
|
||||
{ field: 'taskadd', title: '任务开始时间', width: 80 },
|
||||
{ field: 'taskexpire', title: '任务过期时间', width: 80 },
|
||||
{ field: 'usable', title: '任务状态', width: 50, formatter: function (value, row, index) {
|
||||
{ field: 'usable', title: '任务状态', width: 80, formatter: function (value, row, index) {
|
||||
if(value==1){
|
||||
return '可用'
|
||||
}else if (value==0&&row.taskdo==null){
|
||||
|
@ -67,7 +39,7 @@
|
|||
switch (value) {
|
||||
case 1: return 'color:white;background-color:green'; break;
|
||||
}}},
|
||||
{ field: 'taskdo', title: '执行时间', width: 100, formatter: function (value, row, index) {
|
||||
{ field: 'taskdo', title: '执行时间', width: 80, formatter: function (value, row, index) {
|
||||
if(row.taskdo==null){
|
||||
return '未执行';
|
||||
}else{
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox" style="width:110px;height:22px" />
|
||||
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox" style="width:110px;height:22px" />
|
||||
<label>发现部门</label><input id="sfxbm" name="fxbm" style="width:200px;height:22px" />
|
||||
<a onclick="yhbztsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a></form>
|
||||
<a onclick="yhbztsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:100%;height:500px;padding: 20px">
|
||||
|
@ -26,69 +27,74 @@
|
|||
<div id="yhqst" style="width:100%;height:400px;padding: 20px">
|
||||
</div>
|
||||
<div style="width: 60%; margin: 0px auto; ">
|
||||
<table name="" id="fxrpmtable" class='easyui-datagrid' title="隐患发现人排名" data-options="
|
||||
<table name="" id="fxrpmtable" class='easyui-datagrid' title="隐患发现人排名" data-options="
|
||||
rownumbers:true,
|
||||
singleSelect:true,
|
||||
striped: true,
|
||||
method:'get',
|
||||
url: 'fxhandle?a=yhfxpm',
|
||||
toolbar:'#fxrpmbar'" style="height:400px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'fxr__userid',hidden:true">用户ID</th>
|
||||
<th data-options="field:'fxr__name',align:'right'" width="30%">姓名</th>
|
||||
<th data-options="field:'fxbm__partname',align:'right'" width="40%">所属部门</th>
|
||||
<th data-options="field:'number',align:'right'" width="20%">填报隐患数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div id='fxrpmbar'>
|
||||
<form id="fxrpms">
|
||||
<a onclick="fxrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
|
||||
<a onclick="fxrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
|
||||
<div>
|
||||
<label>发现部门</label><input id="sfxbm2" name="fxbm" style="width:180px;height:22px" />
|
||||
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox" style="width:80px;height:22px" />
|
||||
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox" style="width:80px;height:22px" />
|
||||
<label>检查类型</label><input id="sjclx" name="jclx" class="easyui-combobox" style="width:100px;height:22px" data-options="
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'fxr__userid',hidden:true">用户ID</th>
|
||||
<th data-options="field:'fxr__name',align:'right'" width="30%">姓名</th>
|
||||
<th data-options="field:'fxbm__partname',align:'right'" width="40%">所属部门</th>
|
||||
<th data-options="field:'number',align:'right'" width="20%">填报隐患数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div id='fxrpmbar'>
|
||||
<form id="fxrpms">
|
||||
<a onclick="fxrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
|
||||
<a onclick="fxrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
|
||||
<div>
|
||||
<label>发现部门</label><input id="sfxbm2" name="fxbm" style="width:180px;height:22px" />
|
||||
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox"
|
||||
style="width:80px;height:22px" />
|
||||
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox"
|
||||
style="width:80px;height:22px" />
|
||||
<label>检查类型</label><input id="sjclx" name="jclx" class="easyui-combobox" style="width:100px;height:22px"
|
||||
data-options="
|
||||
method: 'get',
|
||||
valueField:'value',
|
||||
textField:'text',
|
||||
url:'getdickey?dicclass=14&a=combobox'
|
||||
"/>
|
||||
</div>
|
||||
" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div style="height:20px"></div>
|
||||
<table name="" id="zgrpmtable" class='easyui-datagrid' title="隐患整改人排名" data-options="
|
||||
</form>
|
||||
</div>
|
||||
<div style="height:20px"></div>
|
||||
<table name="" id="zgrpmtable" class='easyui-datagrid' title="隐患整改人排名" data-options="
|
||||
rownumbers:true,
|
||||
singleSelect:true,
|
||||
striped: true,
|
||||
method:'get',
|
||||
url: 'fxhandle?a=yhzgpm',
|
||||
toolbar:'#zgrpmbar'" style="height:400px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'zgr__userid',hidden:true">用户ID</th>
|
||||
<th data-options="field:'zgr__name',align:'right'" width="30%">姓名</th>
|
||||
<th data-options="field:'zgbm__partname',align:'right'" width="40%">所属部门</th>
|
||||
<th data-options="field:'number',align:'right'" width="20%">整改隐患数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-options="field:'zgr__userid',hidden:true">用户ID</th>
|
||||
<th data-options="field:'zgr__name',align:'right'" width="30%">姓名</th>
|
||||
<th data-options="field:'zgbm__partname',align:'right'" width="40%">所属部门</th>
|
||||
<th data-options="field:'number',align:'right'" width="20%">整改隐患数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div id='zgrpmbar'>
|
||||
<form id="zgrpms">
|
||||
<a onclick="zgrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
|
||||
<a onclick="zgrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
|
||||
<div>
|
||||
<label>整改人</label><input class="easyui-textbox" name="zgr" style="width:80px;height:22px" />
|
||||
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox" style="width:80px;height:22px" />
|
||||
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox" style="width:80px;height:22px" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id='zgrpmbar'>
|
||||
<form id="zgrpms">
|
||||
<a onclick="zgrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
|
||||
<a onclick="zgrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
|
||||
<div>
|
||||
<label>整改人</label><input class="easyui-textbox" name="zgr" style="width:80px;height:22px" />
|
||||
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox"
|
||||
style="width:80px;height:22px" />
|
||||
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox"
|
||||
style="width:80px;height:22px" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -125,15 +131,15 @@
|
|||
function yhbztsearch() {
|
||||
var querydata = $('#yhbztf').serializeJSON();
|
||||
bindmap3_o('yhlbt', querydata)
|
||||
bindmap4_o('yhpgt', querydata)
|
||||
// bindmap4_o('yhpgt', querydata)
|
||||
bindmap8('yhztt', querydata)
|
||||
bindmap7('yhqst',querydata);
|
||||
bindmap7('yhqst', querydata);
|
||||
}
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth() + 1;
|
||||
bindmap3_o('yhlbt', { 'year': year, 'month': month });
|
||||
bindmap4_o('yhpgt', { 'year': year, 'month': month });
|
||||
// bindmap4_o('yhpgt', { 'year': year, 'month': month });
|
||||
bindmap7('yhqst');
|
||||
bindmap8('yhztt');
|
||||
function fxrpmexport() {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</div>
|
||||
<div data-options="region:'center',border:false" style="height:100%;">
|
||||
<div style="height:50%">
|
||||
<table id="fxcstable" style="width:auto;height:100%;" title='风险分析和安全措施'></table>
|
||||
<table id="fxcstable" style="width:auto;height:100%;" title='风险分析和环保措施'></table>
|
||||
<div id="fxcsbar" style="padding:6px;height:auto">
|
||||
|
||||
{% load myfilter %}
|
||||
|
@ -83,7 +83,7 @@
|
|||
columns: [[
|
||||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'fxfx', title: '风险分析', width: 40 },
|
||||
{ field: 'aqcs', title: '安全措施', width: 120 },
|
||||
{ field: 'aqcs', title: '环保措施', width: 120 },
|
||||
{ field: 'cslx', title: '措施类型', width: 80 },
|
||||
]]
|
||||
});
|
||||
|
|
|
@ -96,7 +96,6 @@ urlpatterns = [
|
|||
path('html/task',views.task),
|
||||
path('html/taskdo',views.taskdo),
|
||||
path('html/riskcheck',views.riskcheck),#风险点排查记录
|
||||
path('html/riskacttask/<int:id>/', views.riskacttask_detail_html),
|
||||
path('html/risk/edit/<int:id>/',views.riskedit),
|
||||
path('html/report/edit',views.reportedit),
|
||||
path('html/bhr',views.bhrhtml),
|
||||
|
|
|
@ -626,9 +626,6 @@ def updchecktable(req,id):
|
|||
|
||||
def checklisthtml(req):
|
||||
return render(req, 'checklist_new.html')
|
||||
|
||||
def riskacttask_detail_html(req, id):
|
||||
return render(req, 'riskacttask_detail.html', {'id': id})
|
||||
|
||||
def mainhtml(req):
|
||||
# 计算一些数据
|
||||
|
@ -3952,7 +3949,7 @@ def mplogin(req):
|
|||
info = json.loads(info)
|
||||
mpopenid = info['openid']
|
||||
session_key = info['session_key']
|
||||
objs = User.objects.filter(mpopenid=mpopenid, deletemark=1, usecomp__enabled=True)
|
||||
objs = User.objects.filter(mpopenid=mpopenid, deletemark=1)
|
||||
if objs.exists():
|
||||
a = objs[0]
|
||||
userid = a.userid
|
||||
|
@ -5362,11 +5359,6 @@ def apitool(req):
|
|||
print(partlink)
|
||||
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'correct_myschedule':
|
||||
from safesite.services import correct_myschedule
|
||||
correct_myschedule()
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -7921,7 +7913,6 @@ def apiriskact(req):
|
|||
|
||||
@apicheck_login
|
||||
def apimyschedule(req):
|
||||
from safesite.services import get_chinese_description
|
||||
a = req.GET.get('a')
|
||||
userid = req.session['userid']
|
||||
companyid = getcompany(userid)
|
||||
|
@ -7939,9 +7930,8 @@ def apimyschedule(req):
|
|||
elif a == 'add':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
if data['set'] == 'interval':
|
||||
name = get_chinese_description('interval', data)
|
||||
iobj, b = IntervalSchedule.objects.get_or_create(every=data['every'], period=data['period'], defaults={'every':data['every'], 'period':data['period']})
|
||||
MySchedule.objects.create(name=name, typeset=data['set'], interval=iobj, usecomp=Partment.objects.get(partid=companyid))
|
||||
MySchedule.objects.create(name=data['name'], typeset=data['set'], interval=iobj, usecomp=Partment.objects.get(partid=companyid))
|
||||
elif data['set'] == 'crontab':
|
||||
cron = {
|
||||
'minute' : data['minute'],
|
||||
|
@ -7951,12 +7941,8 @@ def apimyschedule(req):
|
|||
'month_of_year': data['month_of_year'],
|
||||
'timezone': 'Asia/Shanghai'
|
||||
}
|
||||
# name = '测试'
|
||||
name = get_chinese_description('crontab', cron)
|
||||
if name == '':
|
||||
return JsonResponse({'code': 0, 'msg': '时间配置格式错误'})
|
||||
iobj, b = CrontabSchedule.objects.get_or_create(**cron, defaults=cron)
|
||||
MySchedule.objects.create(name=name, typeset=data['set'], crontab=iobj, usecomp=Partment.objects.get(partid=companyid))
|
||||
MySchedule.objects.create(name=data['name'], typeset=data['set'], crontab=iobj, usecomp=Partment.objects.get(partid=companyid))
|
||||
return JsonResponse({'code': 1})
|
||||
elif a == 'del':
|
||||
user = User.objects.get(userid=userid)
|
||||
|
@ -8080,18 +8066,6 @@ def apirisk(req):
|
|||
a = a.values('id', 'step', 'hazard', 'result', 'level', 'riskl', 'riske', 'riskc', 'riskd', 'measure1', 'measure2',
|
||||
'measure3', 'measure4', 'measure5', 'riskact__name', 'riskact__area__name',
|
||||
'riskact__area__id', 'riskact__place', 'content', 'createtime')
|
||||
if req.GET.get('riskacttask', None):
|
||||
riskids = []
|
||||
taskdo_dict = {}
|
||||
for i in a:
|
||||
riskids.append(i.id)
|
||||
checks = Riskcheck2.objects.filter(riskacttask__id=req.GET.get('riskacttask')).values('risk__id', 'trouble__troubleid', 'trouble__yhnum')
|
||||
for m in checks:
|
||||
taskdo_dict[str(m.risk__id)] = m
|
||||
for n in a:
|
||||
if str(n.id) in taskdo_dict:
|
||||
n.trouble = taskdo_dict[str(n.id)].trouble__troubleid
|
||||
n.yhnum = taskdo_dict[str(n.id)].trouble__yhnum
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
elif a == 'listall2': # 按风险点聚合
|
||||
a = Risk.objects.filter(usecomp__partid=companyid,
|
||||
|
@ -8381,28 +8355,16 @@ def apiriskacttask(req):
|
|||
if a == 'listalltask': # 全厂任务
|
||||
objs = RiskActTask.objects.filter(riskact__usecomp__partid=companyid, istask=1).order_by('-pk','-usable', 'riskact__group__groupid')
|
||||
objs = objs.filter(riskact__table_type=req.GET.get('table_type', 1))
|
||||
if req.GET.get('user__name'):
|
||||
objs = objs.filter(user__name__contains=req.GET.get('user__name'))
|
||||
if req.GET.get('riskact'):
|
||||
objs = objs.filter(riskact=req.GET.get('riskact'))
|
||||
if req.GET.get('taskset'):
|
||||
objs = objs.filter(taskset=req.GET.get('taskset'))
|
||||
if req.GET.get('qssj'):
|
||||
objs = objs.filter(taskdo_gte=req.GET.get('qssj'))
|
||||
if req.GET.get('jssj'):
|
||||
objs = objs.filter(taskdo__lte=req.GET.get('jssj'))
|
||||
objs = objs.values('id', 'riskact__group__groupname', 'riskact__area__name',
|
||||
objs = objs.values('riskact__group__groupname', 'riskact__area__name',
|
||||
'riskact__type__dickeyname', 'riskact__id', 'riskact__group__groupid',
|
||||
'riskact__name', 'riskact__level', 'riskact__tasktype', 'taskadd', 'taskexpire',
|
||||
'user__userid', 'usable', 'taskdo', 'user__name', 'imgs')
|
||||
'user__userid', 'usable', 'taskdo', 'user__name')
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(req)
|
||||
objs = objs[startnum:endnum]
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif a == 'listall': # 全厂排查记录
|
||||
objs = RiskActTask.objects.filter(riskact__usecomp__partid=companyid).exclude(taskdo=None)
|
||||
if req.GET.get('user__name'):
|
||||
objs = objs.filter(user__name__contains=req.GET.get('user__name'))
|
||||
if req.GET.get('pcbm'):
|
||||
parts = getparts(req.GET.get('pcbm'))
|
||||
objs = objs.filter(user__ubelongpart__in=parts)
|
||||
|
@ -8463,13 +8425,8 @@ def apiriskacttask(req):
|
|||
total = objs.count()
|
||||
return JsonResponse({"code": 1, "todonum": total})
|
||||
elif a == 'detail':
|
||||
res = RiskActTask.objects.filter(pk=req.GET.get('id')).values('id', 'tasknote', 'note', 'taskadd', 'taskdo', 'taskdo2', 'imgs', 'riskact', 'istask',
|
||||
'riskact__name', 'riskact__area__name', 'riskact__place', 'state', 'user__ubelongpart__partname', 'user__name')[0]
|
||||
if res['imgs']:
|
||||
res['imgs'] = res['imgs'].split('?')
|
||||
else:
|
||||
res['imgs'] = []
|
||||
return HttpResponse(json.dumps({'code':1, 'data':res}, cls=MyEncoder), content_type="application/json")
|
||||
obj = RiskActTask.objects.filter(pk=req.GET.get('id'))
|
||||
return JsonResponse({'code':1, 'data':obj.values('id', 'tasknote', 'note')[0]})
|
||||
# elif a == 'listmydone':
|
||||
# groups = Group.objects.filter(users__userid=userid)
|
||||
# objs = Risktask.objects.filter(Q(group__in=groups)|Q(user__userid=userid),usable__in=[0,2]).values('risk__group__groupname','risk__riskact__area__name','risk__riskact__type__dickeyname','risk__riskact__id','risk__tasktype','taskadd','taskexpire','user__userid','usable').annotate(num = Count('risk__group'))
|
||||
|
@ -8498,8 +8455,6 @@ def apiriskcheck2(req):
|
|||
obj.taskdo = nowtime
|
||||
obj.usable = 0
|
||||
obj.note = data['note'] if 'note' in data else None
|
||||
if 'imgs' in data and data['imgs']:
|
||||
obj.imgs = '?'.join(data['imgs'])
|
||||
obj.save()
|
||||
else:
|
||||
obj = RiskActTask()
|
||||
|
@ -8508,21 +8463,17 @@ def apiriskcheck2(req):
|
|||
obj.istask = 0
|
||||
obj.taskdo = nowtime
|
||||
obj.note = data['note'] if 'note' in data else None
|
||||
if 'imgs' in data and data['imgs']:
|
||||
obj.imgs = '?'.join(data['imgs'])
|
||||
obj.save()
|
||||
has_trouble = False
|
||||
for i in checkrisks:
|
||||
risk = Risk.objects.get(id=i['id'])
|
||||
if 'trouble' in i:
|
||||
trouble = Trouble.objects.get(troubleid=i['trouble'])
|
||||
Riskcheck2.objects.get_or_create(risk=risk, riskacttask=obj, defaults={'risk': risk, 'riskacttask': obj, 'trouble': trouble, 'dotime': nowtime})
|
||||
has_trouble = True
|
||||
Riskcheck2.objects.create(risk=risk, riskacttask=obj, trouble=Trouble.objects.get(
|
||||
troubleid=i['trouble']), dotime=nowtime)
|
||||
obj.state = 0
|
||||
obj.save()
|
||||
else:
|
||||
Riskcheck2.objects.get_or_create(risk=risk, riskacttask=obj, defaults={'risk': risk, 'riskacttask': obj, 'dotime': nowtime})
|
||||
if has_trouble:
|
||||
obj.state = 0
|
||||
obj.save()
|
||||
Riskcheck2.objects.create(
|
||||
risk=risk, riskacttask=obj, dotime=nowtime)
|
||||
return JsonResponse({'code': 1})
|
||||
elif a == 'listall':
|
||||
objs = Riskcheck2.objects.filter(risk__usecomp__partid=companyid)
|
||||
|
@ -8533,13 +8484,6 @@ def apiriskcheck2(req):
|
|||
objs = objs.order_by('trouble')[startnum:endnum].values('id','risk', 'risk__step', 'risk__level','trouble', 'trouble__yhnum', 'risk__hazard',
|
||||
'risk__result', 'risk__measure1', 'risk__measure2', 'risk__measure3', 'risk__measure4', 'risk__measure5', 'riskacttask', 'riskacttask__taskdo')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif a == 'check': # 发现隐患2
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
trouble = Trouble.objects.get(troubleid=data['trouble'])
|
||||
risk = Risk.objects.get(id=data['risk'])
|
||||
riskacttask = RiskActTask.objects.get(id=data['riskacttask'])
|
||||
Riskcheck2.objects.get_or_create(risk=risk, riskacttask=riskacttask, defaults={'risk':risk, 'riskacttask': riskacttask, 'trouble': trouble, 'dotime': datetime.now()})
|
||||
return JsonResponse({'code': 1})
|
||||
|
||||
@apicheck_login
|
||||
def apiriskcheck(req):
|
||||
|
|
Loading…
Reference in New Issue