30869d5a by fanguang

fix

1 parent 1eaa62f4
...@@ -337,8 +337,7 @@ function inputTypeChange (val, item) { ...@@ -337,8 +337,7 @@ function inputTypeChange (val, item) {
337 337
338 const loading = ref(false) 338 const loading = ref(false)
339 function getDetail () { 339 function getDetail () {
340 loading.value = true 340 loading.value = true
341
342 return getMetaStandardDetail(props.guid).then((res:any) => { 341 return getMetaStandardDetail(props.guid).then((res:any) => {
343 if (res.code === proxy.$passCode) { 342 if (res.code === proxy.$passCode) {
344 const data = res.data 343 const data = res.data
...@@ -366,7 +365,9 @@ function confirm () { ...@@ -366,7 +365,9 @@ function confirm () {
366 formEl.value.validate(valid => { 365 formEl.value.validate(valid => {
367 if (!valid) return 366 if (!valid) return
368 let body = { ...form.value } 367 let body = { ...form.value }
369 console.log(body) 368 if (!body.parentGuid) {
369 body.parentGuid = null
370 }
370 delete body.fieldRSVOS 371 delete body.fieldRSVOS
371 // return 372 // return
372 const request = props.type === 'add' ? saveMetaStandard : updateMetaStandard 373 const request = props.type === 'add' ? saveMetaStandard : updateMetaStandard
......
...@@ -923,6 +923,9 @@ const tableBtnClick = (scope, btn) => { ...@@ -923,6 +923,9 @@ const tableBtnClick = (scope, btn) => {
923 923
924 } else if (type === 'remove') { 924 } else if (type === 'remove') {
925 let removeRows = () => { 925 let removeRows = () => {
926 console.log('formTableData.value', formTableData.value)
927 console.log('row', row)
928 // return
926 const existIndex = formTableData.value.findIndex(s => s.ROWID == row.ROWID) 929 const existIndex = formTableData.value.findIndex(s => s.ROWID == row.ROWID)
927 existIndex > -1 && formTableData.value.splice(existIndex, 1) 930 existIndex > -1 && formTableData.value.splice(existIndex, 1)
928 } 931 }
......
...@@ -417,12 +417,7 @@ function importData () { ...@@ -417,12 +417,7 @@ function importData () {
417 console.log('currentTree', currentTreeObj) 417 console.log('currentTree', currentTreeObj)
418 let uploadSetting:any = [] 418 let uploadSetting:any = []
419 if (currentTreeObj.children) { 419 if (currentTreeObj.children) {
420 uploadSetting = currentTreeObj.children.map((item:any) => { 420 formatChildrenLastItem(currentTreeObj.children, uploadSetting)
421 return {
422 standardName: item.standardName,
423 standardGuid: item.guid
424 }
425 })
426 } else { 421 } else {
427 uploadSetting = [{ 422 uploadSetting = [{
428 standardName: currentTreeObj.standardName, 423 standardName: currentTreeObj.standardName,
...@@ -434,6 +429,18 @@ function importData () { ...@@ -434,6 +429,18 @@ function importData () {
434 path: '/data-meta/metadata-standard/standard-meta-import', 429 path: '/data-meta/metadata-standard/standard-meta-import',
435 }); 430 });
436 } 431 }
432 function formatChildrenLastItem (list, returnList = []) {
433 list.forEach((item:any) => {
434 if (!item.children) {
435 returnList.push({
436 standardName: item.standardName,
437 standardGuid: item.guid
438 })
439 } else {
440 formatChildrenLastItem(item.children, returnList)
441 }
442 })
443 }
437 444
438 function exportData () { 445 function exportData () {
439 let body = [treeInfo.value.currentObj.guid] 446 let body = [treeInfo.value.currentObj.guid]
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!