<?
viewPlugins("qgGrid","layer");
viewLoad("public/header");
$menuItems = [
	'resetNumidxWarn'=> ['caption'=>lg('正式交叉号库').lg('重置 ! 提醒'), 'url'=>HOST.'/pro/numidx/resetNumidxWarn'],
	'carmodelresetWarn'=> ['caption'=>lg('国际通用库').lg('重置 ! 提醒'), 'url'=>HOST.'/pro/carmodel/resetWarn'],
	'mergeProModelPos'=> ['caption'=>lg('国际通用库').lg('位置合并'), 'url'=>HOST.'/pro/carmodel/mergeProModelPos'],
	'resetProCountryCache'=> ['caption'=>lg('适用国家').lg('缓存生成'), 'url'=>HOST.'/country/resetProCountryCache'],
];
?>
<style>
</style>
<table class="lay table table-bordered">
	<thead>
		<tr>
			<th width="200px"><lg>名称</lg></th>
			<th width=""><lg>操作</lg></th>
			<th><lg>链接</lg></th>
		</tr>
	</thead>
	<tbody>
		<?foreach($menuItems as $key=>$menu):?>
		<tr>
			<td><?=$menu['caption']?></td>
			<td><button type="button" id="btnSearch" onclick="executeUrl('<?=$key?>')" class="btn btn-outline-primary btn-search btn-sm fa"><lg>开始操作</lg></button></td>
			<td><?=$menu['url']?></td>
		</tr>
		<?endforeach;//menuItems?>
	</tbody>
</table>
<? viewLoad("public/footer") ?>
<script>
var menuItems = <?=json_encode($menuItems)?>;
$(document).ready(function () {
  
});
function executeUrl(impcode)
{
    layer.confirm(lg('确定要')+' [ '+menuItems[impcode]['caption']+' ] '+lg('吗?'), {icon: 3, title:lg('导入'),offset: 't'}, function(index){
        layer.close(index);
    	qg.ajax(menuItems[impcode]['url'], function(res){
    		if(res.hasError) return false;
    		qg.box.msg('服务端正在执行数据操作');
    	});
    });
}
</script>