From 4786375ab93285bb79c38f32f809af9c770fa9f9 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 10 Mar 2022 17:34:32 +0800 Subject: [PATCH] fix issue --- web_src/js/index.js | 50 +++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index fdcc617c2..5c595b47a 100755 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -3669,6 +3669,28 @@ function initVueDataset() { items.push($(this).data('private')) }) let num_stars = $('#dataset-range-value').data('num-stars') + const ruleForm = {} + if(document.getElementById('dataset-edit-value')){ + let $this = $('#dataset-edit-value') + ruleForm.title = $this.data('edit-title') || '' + ruleForm.description = $this.data('edit-description') || '' + ruleForm.category = $this.data('edit-category') || '' + ruleForm.task = $this.data('edit-task') || '' + ruleForm.license = $this.data('edit-license') || '' + ruleForm.id = $this.data('edit-id')|| '' + } + console.log(ruleForm) + // 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, @@ -3727,7 +3749,8 @@ function initVueDataset() { } this.privates = items this.num_stars = num_stars - this.getEditInit() + this.ruleForm = ruleForm + // this.getEditInit() }, methods:{ @@ -3798,20 +3821,17 @@ function initVueDataset() { }) .modal('show'); }, - getEditInit(){ - console.log(this.ruleForm) - if($('#dataset-edit-value')){ - console.log("==========") - let $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') || '' - } - console.log(this.ruleForm) - }, + // 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')|| '' + // } + // }, editDataset(formName,id){ let _this = this console.log(this.url)