数据架构导入表及产品添加uuid等

dev_2022-03-03
yujialong 3 years ago
parent b882a9bc37
commit 3be54099e4
  1. 21
      package-lock.json
  2. 1
      package.json
  3. 44
      src/views/data/Framework.vue
  4. 6
      src/views/data/Product.vue

21
package-lock.json generated

@ -1047,6 +1047,11 @@
"integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==",
"dev": true
},
"@types/uuid": {
"version": "8.3.3",
"resolved": "https://registry.npmmirror.com/@types/uuid/download/@types/uuid-8.3.3.tgz?cache=0&sync_timestamp=1637271089246&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fuuid%2Fdownload%2F%40types%2Fuuid-8.3.3.tgz",
"integrity": "sha512-0LbEEx1zxrYB3pgpd1M5lEhLcXjKJnYghvhTRgaBeUivLHMDM1TzF3IJ6hXU2+8uA4Xz+5BA63mtZo5DjVT8iA=="
},
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0.tgz",
@ -12728,6 +12733,22 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vue-uuid": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/vue-uuid/download/vue-uuid-2.0.2.tgz",
"integrity": "sha1-DPtznmYKOvHU4zQnQ1eBFPebJDg=",
"requires": {
"@types/uuid": "^8.0.0",
"uuid": "^8.1.0"
},
"dependencies": {
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmmirror.com/uuid/download/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}
}
},
"vuedraggable": {
"version": "2.23.2",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.23.2.tgz",

@ -22,6 +22,7 @@
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.5.1",
"vue-schart": "^2.0.0",
"vue-uuid": "^2.0.2",
"vuedraggable": "^2.17.0",
"vuex": "^3.1.2"
},

@ -154,6 +154,8 @@
</div>
</template>
<script>
import { uuid } from 'vue-uuid'
import { Loading } from 'element-ui'
export default {
data() {
return {
@ -179,8 +181,9 @@ export default {
pageSize: 10,
total: 0,
multipleSelection: [],
importLoading: null,
tablePromises: [],
importTypeList: [],
importTypeIndex: 100000,
fieldData: [],
fieldHead: [],
tableName: '',
@ -489,6 +492,7 @@ export default {
},
//
getTable(n,isConcat){
this.tablePromises.push(new Promise((resolve,reject) => {
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&pageNum=${n.typeTreePage ? n.typeTreePage : 1}&pageSize=${this.typeTreeUnit}`).then(res => {
let list = res.list.records
list.map(n => {
@ -508,20 +512,25 @@ export default {
}
// ,+1
n.typeTreePage++
}).catch(res => {})
resolve()
}).catch(res => {
reject()
})
}))
},
//
batchImport(){
this.importLoading = Loading.service({
background: 'rgba(255, 255, 255, .5)'
})
//
this.$post(this.api.originalList).then(res => {
const that = this
// idlabelnamekeylabelnamekey
function handleId(data){
data.map(n => {
that.importTypeIndex++
n.realId = n.id
// idid,
n.id = String(that.importTypeIndex + n.id)
// ididuuid
n.id = uuid.v4()
n.label = n.categoryName
if(n.children.length){
handleId(n.children)
@ -529,20 +538,19 @@ export default {
})
}
handleId(res)
// pageSize3000
// pageSize300020
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=3000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => {
let list = res1.pageList.records
this.defaultTypeChecked = list.map(n => n.copyId) // copyIdidid
const that = this
//
function handleId(data){
const handleId = data => {
data.map(n => {
if(n.children.length){
handleId(n.children)
}else{
// 1
n.typeTreePage = 1
that.getTable(n)
this.getTable(n)
}
})
}
@ -556,14 +564,20 @@ export default {
}
})
}
setTimeout(() => {
Promise.all(this.tablePromises).then(_ => {
handleDisabled(res)
this.importTypeList = res
},500)
}).catch(res => {})
this.importLoading.close()
this.importVisible = true
}).catch(res => {})
console.log('全部分类:', res)
console.log('该分类下已选的表id:', this.defaultTypeChecked)
})
}).catch(res => {
this.importLoading.close()
})
}).catch(res => {
this.importLoading.close()
})
},
//
getFields(){

@ -151,6 +151,7 @@
</template>
<script>
import { uuid } from 'vue-uuid'
export default {
data() {
return {
@ -189,7 +190,6 @@ export default {
},
checkedIds: [],
isDetail: false,
typeIndex: 100000,
curExpand: '',
typeUnit: 20,
typeScrollTop: 0,
@ -287,7 +287,8 @@ export default {
function handleId(data){
data.map(n => {
n.originId = n.id
n.id = String(++that.typeIndex) // idididoriginIdid
// ididuuidoriginIdid
n.id = uuid.v4()
n.label = n.categoryName
n.disabled = true //
if(n.children.length){
@ -466,7 +467,6 @@ export default {
this.productName = ''
this.market = ''
this.isDetail = false
this.typeIndex = 100000
this.typeList = []
this.configIds = []
},

Loading…
Cancel
Save