50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<button class="mac-btn-secondary text-secondary mac-input-medium js-list-add-trigger">添加</button>
|
|
<button class="mac-btn-secondary text-secondary mac-input-medium js-art-sync">同步</button>
|
|
|
|
<script type="module">
|
|
|
|
$(function() {
|
|
$(document).on('click', '.js-art-sync', function(oEvent){
|
|
tomModalShow("art-sync");
|
|
});
|
|
|
|
$(document).on('click', '.js-art-sync-save', function(oEvent){
|
|
let sPathWww = $("#nasa_site_www").val();
|
|
let iId = $(".art-sync-id").val();
|
|
let sType = $(".art-sync-type").val();
|
|
let sSiteGroupCode = $(".art-sync-sitegroupcode").val();
|
|
|
|
$.ajax({
|
|
url: "/nasa/master/article/artsync/save",
|
|
type: 'GET',
|
|
dataType: 'json',
|
|
data: {
|
|
'nasa_site_www': sPathWww,
|
|
'id': iId,
|
|
'type': sType,
|
|
'siteGroupCode': sSiteGroupCode
|
|
},
|
|
success: function(j) {
|
|
TomAlert.show({
|
|
sMsg: j.sMsg,
|
|
sType: 'success',
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
$(document).on('keydown', '.tom-modal', function(oEvent) {
|
|
if (oEvent.which === 13) {
|
|
let bHasCommandKey = oEvent.metaKey || oEvent.ctrlKey;
|
|
if (bHasCommandKey) {
|
|
// oEvent.preventDefault();
|
|
$(".js-art-sync-save").trigger('click');
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|