CN-1016 根据接口修改,进行相应调整
This commit is contained in:
@@ -71,9 +71,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'status'">
|
<template v-else-if="item.prop === 'status'">
|
||||||
<el-switch class="card-enable"
|
<el-switch class="card-enable"
|
||||||
v-model="scope.row['status']"
|
v-model="scope.row.status"
|
||||||
active-color="#38ACD2"
|
active-color="#38ACD2"
|
||||||
inactive-color="#C0CEDB"
|
inactive-color="#C0CEDB"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
@change="changeStatus($event,scope.row.knowledgeId)"
|
@change="changeStatus($event,scope.row.knowledgeId)"
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
v-model="data.status"
|
v-model="data.status"
|
||||||
active-color="#38ACD2"
|
active-color="#38ACD2"
|
||||||
inactive-color="#C0CEDB"
|
inactive-color="#C0CEDB"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
@change="changeStatus($event,data.knowledgeId)"
|
@change="changeStatus($event,data.knowledgeId)"
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
@@ -51,17 +53,6 @@ export default {
|
|||||||
checkList: []
|
checkList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
tableData: {
|
|
||||||
handler (n) {
|
|
||||||
if (this.tableData && this.tableData.length > 0) {
|
|
||||||
this.tableData.forEach(item => {
|
|
||||||
// item.status = true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
clickCard (data, event) {
|
clickCard (data, event) {
|
||||||
if (data.isSelected) { // 原来为选中,当前点击后未选中
|
if (data.isSelected) { // 原来为选中,当前点击后未选中
|
||||||
@@ -149,7 +140,6 @@ export default {
|
|||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
item.showMore = false
|
item.showMore = false
|
||||||
item.moreOptions = false
|
item.moreOptions = false
|
||||||
// item.status = true
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -113,12 +113,8 @@ export default {
|
|||||||
get(listUrl, this.searchLabel).then(response => {
|
get(listUrl, this.searchLabel).then(response => {
|
||||||
this.tools.loading = false
|
this.tools.loading = false
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
for (let i = 0; i < response.data.list.length; i++) {
|
|
||||||
response.data.list[i].status = response.data.list[i].status === 1
|
|
||||||
}
|
|
||||||
this.tableData = response.data.list
|
this.tableData = response.data.list
|
||||||
this.pageObj.total = response.data.total
|
this.pageObj.total = response.data.total
|
||||||
// TODO 回到顶部
|
|
||||||
} else {
|
} else {
|
||||||
console.error(response)
|
console.error(response)
|
||||||
if (response.message) {
|
if (response.message) {
|
||||||
@@ -177,12 +173,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.tools.loading = false
|
this.tools.loading = false
|
||||||
/*
|
|
||||||
if(this.isSelectedStatus != undefined){
|
|
||||||
this.isSelectedStatus = false
|
|
||||||
this.disableDelete = true
|
|
||||||
this.batchDeleteObjs = []
|
|
||||||
} */
|
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -40,12 +40,20 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
handler (n) {
|
||||||
|
if (this.tableData && this.tableData.length > 0) {
|
||||||
|
this.isInit = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
operationWidth: '165', // 操作列宽
|
operationWidth: '165', // 操作列宽
|
||||||
show: true
|
show: true,
|
||||||
|
isInit: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -102,8 +110,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeStatus (status, id) {
|
changeStatus (status, id) {
|
||||||
const statusNum = status ? 1 : 0
|
if (!this.isInit) {
|
||||||
patch(api.knowledgeBaseEnable, { list: [{ knowledgeId: id, status: 0 }] }).then(response => {
|
patch(api.knowledgeBaseEnable, { list: [{ knowledgeId: id, status: status }] }).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -115,6 +123,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tableOperation ([command, row]) {
|
tableOperation ([command, row]) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ export default {
|
|||||||
this.isSelectedStatus = false
|
this.isSelectedStatus = false
|
||||||
this.batchDeleteObjs = []
|
this.batchDeleteObjs = []
|
||||||
this.secondBatchDeleteObjs = []
|
this.secondBatchDeleteObjs = []
|
||||||
this.tableData = 0
|
this.tableData = []
|
||||||
this.pageObj.total = 0
|
this.pageObj.total = 0
|
||||||
},
|
},
|
||||||
toSelect () {
|
toSelect () {
|
||||||
|
|||||||
@@ -174,9 +174,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-switch class="card-enable"
|
<el-switch class="card-enable"
|
||||||
v-model="status"
|
v-model="editObject.status"
|
||||||
active-color="#38ACD2"
|
active-color="#38ACD2"
|
||||||
inactive-color="#C0CEDB"
|
inactive-color="#C0CEDB"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
@@ -426,7 +428,8 @@ export default {
|
|||||||
isClick: false,
|
isClick: false,
|
||||||
pageNoForTable: 1,
|
pageNoForTable: 1,
|
||||||
listMode: 'list',
|
listMode: 'list',
|
||||||
status: true
|
status: 1,
|
||||||
|
oldItemIds: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -451,16 +454,20 @@ export default {
|
|||||||
},
|
},
|
||||||
handleSpeticalTypeData (originalImportedData) {
|
handleSpeticalTypeData (originalImportedData) {
|
||||||
originalImportedData.forEach(item => {
|
originalImportedData.forEach(item => {
|
||||||
const names = item.tagNames
|
// const names = item.tagNames
|
||||||
if (this.editObject.source === knowledgeSourceValue.ipTag && names) {
|
if (this.editObject.source === knowledgeSourceValue.ipTag) {
|
||||||
const format = names.addrFormat
|
const format = item.addrFormat
|
||||||
if (format === 'Single') {
|
if (format === 'Single') {
|
||||||
item.tagName = names.ip1
|
item.tagName = item.ip1
|
||||||
} else if (format === 'CIDR') {
|
} else if (format === 'CIDR') {
|
||||||
item.tagName = names.ip1 + '/' + names.ip2
|
item.tagName = item.ip1 + '/' + item.ip2
|
||||||
} else if (format === 'Range') {
|
} else if (format === 'Range') {
|
||||||
item.tagName = names.ip1 + '~' + names.ip2
|
item.tagName = item.ip1 + '~' + item.ip2
|
||||||
}
|
}
|
||||||
|
} else if (this.editObject.source === knowledgeSourceValue.domainTag) {
|
||||||
|
item.tagName = item.domain
|
||||||
|
} else if (this.editObject.source === knowledgeSourceValue.appTag) {
|
||||||
|
item.tagName = item.appName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return originalImportedData
|
return originalImportedData
|
||||||
@@ -482,6 +489,9 @@ export default {
|
|||||||
this.isLoad = false
|
this.isLoad = false
|
||||||
originalImportedData.sort((a, b) => b.isValid - a.isValid)
|
originalImportedData.sort((a, b) => b.isValid - a.isValid)
|
||||||
this.importedData = this.handleSpeticalTypeData(originalImportedData)
|
this.importedData = this.handleSpeticalTypeData(originalImportedData)
|
||||||
|
this.addItemList = _.cloneDeep(this.importedData)
|
||||||
|
this.updateItemList = []
|
||||||
|
this.deleteItemIds = this.oldItemIds
|
||||||
|
|
||||||
this.handleShowImportedData()
|
this.handleShowImportedData()
|
||||||
this.addEditFlag = false
|
this.addEditFlag = false
|
||||||
@@ -499,6 +509,16 @@ export default {
|
|||||||
if (files && files.status === 'success') {
|
if (files && files.status === 'success') {
|
||||||
this.uploaded = false
|
this.uploaded = false
|
||||||
this.typeSelectDisable = false
|
this.typeSelectDisable = false
|
||||||
|
this.importedData.forEach(item => {
|
||||||
|
if (item.id) {
|
||||||
|
const delIndex = this.deleteItemIds.indexOf(item.id)
|
||||||
|
if (delIndex === -1) {
|
||||||
|
this.deleteItemIds.push(item.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.addItemList = []
|
||||||
|
this.updateItemList = []
|
||||||
this.importedData = []
|
this.importedData = []
|
||||||
this.showImportedData = []
|
this.showImportedData = []
|
||||||
this.originalImportInfo = {
|
this.originalImportInfo = {
|
||||||
@@ -615,6 +635,21 @@ export default {
|
|||||||
this.editTagErrorTip = ''
|
this.editTagErrorTip = ''
|
||||||
|
|
||||||
const toRemoveIndex = (this.importedPageObj.pageNo - 1) * this.importedPageObj.pageSize + index
|
const toRemoveIndex = (this.importedPageObj.pageNo - 1) * this.importedPageObj.pageSize + index
|
||||||
|
const delItem = this.importedData[toRemoveIndex]
|
||||||
|
if (delItem.id) {
|
||||||
|
if (this.deleteItemIds.indexOf(delItem.id) === -1) {
|
||||||
|
this.deleteItemIds.push(delItem.id)
|
||||||
|
}
|
||||||
|
const delIndex = this.updateItemList.findIndex(item => item.id === delItem.id)
|
||||||
|
if (delIndex > -1) {
|
||||||
|
this.updateItemList.splice(delIndex, 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const delIndex = this.addItemList.findIndex(item => item.tagName === delItem.tagName && item.tagValue === delItem.tagValue)
|
||||||
|
if (delIndex > -1) {
|
||||||
|
this.addItemList.splice(delIndex, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
this.importedData.splice(toRemoveIndex, 1)
|
this.importedData.splice(toRemoveIndex, 1)
|
||||||
// 删除内容为空的新增记录
|
// 删除内容为空的新增记录
|
||||||
const lastIndex = this.importedData.length - 1
|
const lastIndex = this.importedData.length - 1
|
||||||
@@ -700,13 +735,16 @@ export default {
|
|||||||
if (this.importedData.length === 1 && this.importedData[0].tagName === '') {
|
if (this.importedData.length === 1 && this.importedData[0].tagName === '') {
|
||||||
// this.blockOperation.save = false
|
// this.blockOperation.save = false
|
||||||
} else {
|
} else {
|
||||||
const t = this.knowledgeBaseType.find(t => t.value === this.editObject.source)
|
const userId = localStorage.getItem(storageKey.userId)
|
||||||
const postData = {
|
const postData = {
|
||||||
name: this.editObject.name,
|
name: this.editObject.name,
|
||||||
category: 'user_defined',
|
category: 'user_defined',
|
||||||
type: t ? t.name : '',
|
source: this.editObject.source,
|
||||||
description: this.editObject.description,
|
description: this.editObject.description,
|
||||||
status: this.status ? 1 : 0
|
status: this.editObject.status,
|
||||||
|
user: {
|
||||||
|
id: userId ? Number(userId) : 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 避免点击新增后,并没有保存新增项就点击了save,此时删除新增的空白项
|
// 避免点击新增后,并没有保存新增项就点击了save,此时删除新增的空白项
|
||||||
if (this.importedData[this.importedData.length - 1].tagName === '') {
|
if (this.importedData[this.importedData.length - 1].tagName === '') {
|
||||||
@@ -715,36 +753,7 @@ export default {
|
|||||||
|
|
||||||
const self = this
|
const self = this
|
||||||
if (!this.editObject.knowledgeId) {
|
if (!this.editObject.knowledgeId) {
|
||||||
postData.addItemList = []
|
postData.addItemList = this.addItemList
|
||||||
this.importedData.forEach(d => {
|
|
||||||
if (this.editObject.source === knowledgeSourceValue.ipTag) {
|
|
||||||
const sepIndex = d.tagName.indexOf('/')
|
|
||||||
if (sepIndex > -1) { // CIDR
|
|
||||||
postData.addItemList.push({
|
|
||||||
tagValue: d.tagValue,
|
|
||||||
tagNames: {
|
|
||||||
addrFormat: 'CIDR',
|
|
||||||
ip1: d.tagName.substring(0, sepIndex),
|
|
||||||
ip2: d.tagName.substring(sepIndex + 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else { // Single
|
|
||||||
postData.addItemList.push({
|
|
||||||
tagValue: d.tagValue,
|
|
||||||
tagNames: {
|
|
||||||
addrFormat: 'Single',
|
|
||||||
ip1: d.tagName,
|
|
||||||
ip2: ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
postData.addItemList.push({
|
|
||||||
tagValue: d.tagValue,
|
|
||||||
tagName: d.tagName
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
axios.post(this.url, postData).then(response => {
|
axios.post(this.url, postData).then(response => {
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@@ -770,36 +779,9 @@ export default {
|
|||||||
this.blockOperation.save = false
|
this.blockOperation.save = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
postData.updateItemList = []
|
postData.updateItemList = this.updateItemList
|
||||||
this.importedData.forEach(d => {
|
postData.addItemList = this.addItemList
|
||||||
if (this.editObject.source === knowledgeSourceValue.ipTag) {
|
postData.deleteItemIds = this.deleteItemIds
|
||||||
const sepIndex = d.tagName.indexOf('/')
|
|
||||||
if (sepIndex > -1) { // CIDR
|
|
||||||
postData.updateItemList.push({
|
|
||||||
tagValue: d.tagValue,
|
|
||||||
tagNames: {
|
|
||||||
addrFormat: 'CIDR',
|
|
||||||
ip1: d.tagName.substring(0, sepIndex),
|
|
||||||
ip2: d.tagName.substring(sepIndex + 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else { // Single
|
|
||||||
postData.updateItemList.push({
|
|
||||||
tagValue: d.tagValue,
|
|
||||||
tagNames: {
|
|
||||||
addrFormat: 'Single',
|
|
||||||
ip1: d.tagName,
|
|
||||||
ip2: ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
postData.updateItemList.push({
|
|
||||||
tagValue: d.tagValue,
|
|
||||||
tagName: d.tagName
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
postData.knowledgeId = this.editObject.knowledgeId
|
postData.knowledgeId = this.editObject.knowledgeId
|
||||||
axios.put(this.url, postData).then(response => {
|
axios.put(this.url, postData).then(response => {
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
@@ -880,6 +862,87 @@ export default {
|
|||||||
this.backEditFlag = false
|
this.backEditFlag = false
|
||||||
this.editTagErrorTip = ''
|
this.editTagErrorTip = ''
|
||||||
},
|
},
|
||||||
|
updateData (data) {
|
||||||
|
if (data) {
|
||||||
|
const updateItemIndex = this.updateItemList.findIndex(item => item.id === data.id)
|
||||||
|
if (updateItemIndex > -1) {
|
||||||
|
this.updateItemList.splice(updateItemIndex, 1, data)
|
||||||
|
} else {
|
||||||
|
let updateItemData = {
|
||||||
|
id: data.id,
|
||||||
|
tagValue: data.tagValue,
|
||||||
|
isValid: 1
|
||||||
|
}
|
||||||
|
if (this.editObject.source === knowledgeSourceValue.ipTag) {
|
||||||
|
const sepIndex = data.tagName.indexOf('/')
|
||||||
|
if (sepIndex > -1) { // CIDR
|
||||||
|
updateItemData = {
|
||||||
|
...updateItemData,
|
||||||
|
addrFormat: 'CIDR',
|
||||||
|
ip1: data.tagName.substring(0, sepIndex),
|
||||||
|
ip2: data.tagName.substring(sepIndex + 1)
|
||||||
|
}
|
||||||
|
} else { // Single
|
||||||
|
updateItemData = {
|
||||||
|
...updateItemData,
|
||||||
|
addrFormat: 'Single',
|
||||||
|
ip1: data.tagName,
|
||||||
|
ip2: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.editObject.source === knowledgeSourceValue.domainTag) {
|
||||||
|
updateItemData = {
|
||||||
|
...updateItemData,
|
||||||
|
domain: data.tagName
|
||||||
|
}
|
||||||
|
} else if (this.editObject.source === knowledgeSourceValue.appTag) {
|
||||||
|
updateItemData = {
|
||||||
|
...updateItemData,
|
||||||
|
appName: data.tagName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.updateItemList.push(updateItemData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addData (data) {
|
||||||
|
if (data) {
|
||||||
|
const addItemIndex = this.addItemList.findIndex(item => item.tagName === data.tagName && item.tagValue === data.tagValue)
|
||||||
|
if (addItemIndex === -1) {
|
||||||
|
let addItem = data
|
||||||
|
if (this.editObject.source === knowledgeSourceValue.ipTag) {
|
||||||
|
const sepIndex = data.tagName.indexOf('/')
|
||||||
|
if (sepIndex > -1) { // CIDR
|
||||||
|
addItem = {
|
||||||
|
...addItem,
|
||||||
|
addrFormat: 'CIDR',
|
||||||
|
ip1: data.tagName.substring(0, sepIndex),
|
||||||
|
ip2: data.tagName.substring(sepIndex + 1)
|
||||||
|
}
|
||||||
|
} else { // Single
|
||||||
|
addItem = {
|
||||||
|
...addItem,
|
||||||
|
addrFormat: 'Single',
|
||||||
|
ip1: data.tagName,
|
||||||
|
ip2: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.editObject.source === knowledgeSourceValue.domainTag) {
|
||||||
|
addItem = {
|
||||||
|
...addItem,
|
||||||
|
domain: data.tagName
|
||||||
|
}
|
||||||
|
} else if (this.editObject.source === knowledgeSourceValue.appTag) {
|
||||||
|
addItem = {
|
||||||
|
...addItem,
|
||||||
|
appName: data.tagName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addItemList.push(addItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
saveImportedData (index) {
|
saveImportedData (index) {
|
||||||
this.$refs.editForm.validate(valid => {
|
this.$refs.editForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -895,6 +958,13 @@ export default {
|
|||||||
this.importedData[num].tagName = this.editTagForm.tagName
|
this.importedData[num].tagName = this.editTagForm.tagName
|
||||||
this.importedData[num].tagValue = this.editTagForm.tagValue
|
this.importedData[num].tagValue = this.editTagForm.tagValue
|
||||||
this.importedData[num].isValid = 1
|
this.importedData[num].isValid = 1
|
||||||
|
this.addData(this.importedData[num])
|
||||||
|
} else {
|
||||||
|
if (findData.id) {
|
||||||
|
this.updateData(findData)
|
||||||
|
} else {
|
||||||
|
this.addData(findData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addEditFlag = false
|
this.addEditFlag = false
|
||||||
@@ -935,9 +1005,8 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
uploadParams () {
|
uploadParams () {
|
||||||
const t = this.knowledgeBaseType.find(t => t.value === this.editObject.source)
|
|
||||||
return {
|
return {
|
||||||
type: t ? t.name : ''
|
source: this.editObject.source
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importedTableFirstColumn () {
|
importedTableFirstColumn () {
|
||||||
@@ -972,16 +1041,16 @@ export default {
|
|||||||
this.stepHeights[2] = itemListHeight.hasData// 修改的时候一直是478
|
this.stepHeights[2] = itemListHeight.hasData// 修改的时候一直是478
|
||||||
this.stepHeightConstant.third = itemListHeight.hasData// 修改的时候一直是478
|
this.stepHeightConstant.third = itemListHeight.hasData// 修改的时候一直是478
|
||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
axios.get(`${api.knowledgeBase}/${this.knowledgeBaseId}`).then(response => {
|
axios.get(`${api.knowledgeBase}/${this.knowledgeBaseId}`, { params: { pageSize: -1 } }).then(response => {
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
if (!response.data.data) {
|
if (!response.data.data) {
|
||||||
throw new Error('No data found, id: ' + this.knowledgeBaseId)
|
throw new Error('No data found, id: ' + this.knowledgeBaseId)
|
||||||
}
|
}
|
||||||
this.editObject = response.data.data
|
this.editObject = response.data.data
|
||||||
this.status = this.editObject.isValid === 1
|
this.importedData = this.handleSpeticalTypeData(this.editObject.itemList)
|
||||||
// this.importedData = this.revertImportedData(this.editObject.data)
|
this.importedData.forEach(item => {
|
||||||
this.importedData = this.handleSpeticalTypeData(this.editObject.list)
|
this.oldItemIds.push(item.id)
|
||||||
|
})
|
||||||
this.handleShowImportedData()
|
this.handleShowImportedData()
|
||||||
this.originalImportInfo = {
|
this.originalImportInfo = {
|
||||||
total: this.importedData.length,
|
total: this.importedData.length,
|
||||||
@@ -1074,7 +1143,7 @@ export default {
|
|||||||
source: 'cn_ip_tag_user_defined',
|
source: 'cn_ip_tag_user_defined',
|
||||||
description: '',
|
description: '',
|
||||||
updateTime: '',
|
updateTime: '',
|
||||||
status: true
|
status: 1
|
||||||
}
|
}
|
||||||
/* 将组织后的数据还原拉平 */
|
/* 将组织后的数据还原拉平 */
|
||||||
const revertImportedData = (data) => {
|
const revertImportedData = (data) => {
|
||||||
@@ -1102,6 +1171,12 @@ export default {
|
|||||||
})
|
})
|
||||||
// table中显示的导入的数据
|
// table中显示的导入的数据
|
||||||
const showImportedData = ref([])
|
const showImportedData = ref([])
|
||||||
|
// 新增数据
|
||||||
|
const addItemList = ref([])
|
||||||
|
// 修改的数据
|
||||||
|
const updateItemList = ref([])
|
||||||
|
// 删除的数据
|
||||||
|
const deleteItemIds = ref([])
|
||||||
// table分页对象
|
// table分页对象
|
||||||
const importedPageObj = ref({
|
const importedPageObj = ref({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -1153,6 +1228,9 @@ export default {
|
|||||||
knowledgeBaseType,
|
knowledgeBaseType,
|
||||||
importedData,
|
importedData,
|
||||||
showImportedData,
|
showImportedData,
|
||||||
|
addItemList,
|
||||||
|
updateItemList,
|
||||||
|
deleteItemIds,
|
||||||
importedPageObj,
|
importedPageObj,
|
||||||
importedType,
|
importedType,
|
||||||
revertImportedData,
|
revertImportedData,
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
{{ $t('knowledge.filters') }}
|
{{ $t('knowledge.filters') }}
|
||||||
</div>
|
</div>
|
||||||
<template v-for="(filter, index) in filterData" :key="index">
|
<template v-for="(filter, index) in filterData" :key="index">
|
||||||
<div class="knowledge-filter" v-show="filter.data.length > 0">
|
<div class="knowledge-filter" v-if="filter.data.length > 0">
|
||||||
<div class="filter__header" @click="filter.collapse = !filter.collapse">
|
<div class="filter__header" @click="filter.collapse = !filter.collapse">
|
||||||
<span class="new-knowledge-filter-header-title">{{filter.title}}</span>
|
<span class="new-knowledge-filter-header-title">{{filter.title}}</span>
|
||||||
<i class="el-icon-arrow-right new-knowledge-filter-icon" :class="{ 'arrow-rotate': !filter.collapse }"></i>
|
<i class="el-icon-arrow-right new-knowledge-filter-icon" :class="{ 'arrow-rotate': !filter.collapse }"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-collapse-transition>
|
<el-collapse-transition>
|
||||||
<div class="filter__body" v-show="!filter.collapse">
|
<div class="filter__body" v-if="!filter.collapse">
|
||||||
<el-tree
|
<el-tree
|
||||||
:ref="`knowledgeTree${index}`"
|
:ref="`knowledgeTree${index}`"
|
||||||
:data="filter.data"
|
:data="filter.data"
|
||||||
@@ -75,6 +75,7 @@ export default {
|
|||||||
])
|
])
|
||||||
},
|
},
|
||||||
handleCheckedItemChange (data, checkinfo, index) {
|
handleCheckedItemChange (data, checkinfo, index) {
|
||||||
|
this.$nextTick(() => {
|
||||||
let typeCheckedNodes = this.$refs.knowledgeTree0.getCheckedNodes()
|
let typeCheckedNodes = this.$refs.knowledgeTree0.getCheckedNodes()
|
||||||
const typeHalfCheckedNodes = checkinfo.halfCheckedNodes
|
const typeHalfCheckedNodes = checkinfo.halfCheckedNodes
|
||||||
typeCheckedNodes = typeCheckedNodes.concat(typeHalfCheckedNodes)
|
typeCheckedNodes = typeCheckedNodes.concat(typeHalfCheckedNodes)
|
||||||
@@ -106,6 +107,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$emit('reload', params, true)
|
this.$emit('reload', params, true)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getAllTableData (params) {
|
getAllTableData (params) {
|
||||||
let searchParams = { pageSize: -1 }
|
let searchParams = { pageSize: -1 }
|
||||||
|
|||||||
Reference in New Issue
Block a user