|
|
@@ -3700,6 +3700,37 @@ function initVueEditAbout() { |
|
|
|
} |
|
|
|
|
|
|
|
function initVueDataset() { |
|
|
|
if($('#dataset_check').length){ |
|
|
|
if(location.search.indexOf('recommend=true')!==-1){ |
|
|
|
$('#dataset_check').checkbox('set checked') |
|
|
|
}else{ |
|
|
|
$('#dataset_check').checkbox('set unchecked') |
|
|
|
} |
|
|
|
$('#dataset_check').checkbox({ |
|
|
|
onChecked: function() { |
|
|
|
if(location.search){ |
|
|
|
const params = new URLSearchParams(location.search) |
|
|
|
if(params.has('recommend')){ |
|
|
|
params.delete('recommend') |
|
|
|
location.href = AppSubUrl + location.pathname + '?' + params.toString() + '&recommend=true' |
|
|
|
}else{ |
|
|
|
location.href = `${window.config.AppSubUrl}/admin/datasets${location.search}&recommend=true` |
|
|
|
} |
|
|
|
}else{ |
|
|
|
location.href = `${window.config.AppSubUrl}/admin/datasets?recommend=true` |
|
|
|
} |
|
|
|
}, |
|
|
|
onUnchecked: function() { |
|
|
|
if(location.search=='?recommend=true'){ |
|
|
|
location.href = AppSubUrl + location.pathname |
|
|
|
}else{ |
|
|
|
const params = new URLSearchParams(location.search) |
|
|
|
params.delete('recommend') |
|
|
|
location.href = AppSubUrl + location.pathname + '?' + params.toString() |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
$('.set_dataset').on('click', function(){ |
|
|
|
const $this = $(this); |
|
|
|
let link = $this.data('url') |
|
|
@@ -3783,24 +3814,13 @@ function initVueDataset() { |
|
|
|
if(document.getElementById('dataset-file-desc')){ |
|
|
|
dataset_file_desc = document.getElementById('dataset-file-desc').value |
|
|
|
} |
|
|
|
|
|
|
|
// getEditInit(){ |
|
|
|
// if($('#dataset-edit-value')){ |
|
|
|
// $this = $('#dataset-edit-value') |
|
|
|
// this.ruleForm.title = $this.data('edit-title') || '' |
|
|
|
// this.ruleForm.description = $this.data('edit-description') || '' |
|
|
|
// this.ruleForm.category = $this.data('edit-category') || '' |
|
|
|
// this.ruleForm.task = $this.data('edit-task') || '' |
|
|
|
// this.ruleForm.license = $this.data('edit-license') || '' |
|
|
|
// this.ruleForm.id = $this.data('edit-id')|| '' |
|
|
|
// } |
|
|
|
// }, |
|
|
|
new Vue({ |
|
|
|
delimiters: ['${', '}'], |
|
|
|
el, |
|
|
|
data: { |
|
|
|
suburl: AppSubUrl, |
|
|
|
url:'', |
|
|
|
checked:false, |
|
|
|
type:0, |
|
|
|
desc:'', |
|
|
|
descfile:'', |
|
|
@@ -3897,6 +3917,12 @@ function initVueDataset() { |
|
|
|
this.getCurrentRepoDataset(this.repolink,this.cloudbrainType) |
|
|
|
} |
|
|
|
|
|
|
|
const params = new URLSearchParams(location.search) |
|
|
|
if (params.has('recommend') && params.get('recommend')=='true'){ |
|
|
|
this.checked = true |
|
|
|
}else{ |
|
|
|
this.checked = false |
|
|
|
} |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
if(document.getElementById('postPath')){ |
|
|
@@ -3937,6 +3963,30 @@ function initVueDataset() { |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
handleCheckedChange(val){ |
|
|
|
if(val){ |
|
|
|
if(location.search){ |
|
|
|
const params = new URLSearchParams(location.search) |
|
|
|
if(params.has('recommend')){ |
|
|
|
params.delete('recommend') |
|
|
|
let search = params.toString() |
|
|
|
location.href = `${AppSubUrl}/explore/datasets?${search}&recommend=${val}` |
|
|
|
}else{ |
|
|
|
location.href = `${AppSubUrl}/explore/datasets${location.search}&recommend=${val}` |
|
|
|
} |
|
|
|
}else{ |
|
|
|
location.href = `${AppSubUrl}/explore/datasets?recommend=${val}` |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(location.search=='?recommend=true'){ |
|
|
|
location.href = AppSubUrl + location.pathname |
|
|
|
}else{ |
|
|
|
const params = new URLSearchParams(location.search) |
|
|
|
params.delete('recommend') |
|
|
|
location.href = AppSubUrl + location.pathname + '?' + params.toString() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
createDataset(formName){ |
|
|
|
let _this = this |
|
|
|
this.$refs[formName].validate((valid)=>{ |
|
|
|