设置数据源

Raod 3 years ago
parent b78033c22d
commit 0eb7c88eb6

@ -198,78 +198,6 @@ export default {
} }
}) })
}, },
//
search() {
this.params.pageNumber = 1
this.queryByPage()
},
//
reset(formName) {
// this.$refs[formName].resetFields()
this.params.sourceName = ''
this.params.sourceCode = ''
this.params.pageNumber = 1
this.params.sourceType = ''
this.queryByPage()
},
async queryByPage() {
const res = await pageList(this.params)
if (res.code != '200') return
this.listLoading = true
this.list = res.data.records
this.list.forEach((value) => {
value['sourceNameCode'] =
value.sourceName + '[' + value.sourceCode + ']'
})
this.totalCount = res.data.total
this.totalPage = res.data.pages
this.listLoading = false
},
handleSizeChange(val) {
this.params.pageSize = val
this.queryByPage()
},
handleCurrentChange(val) {
this.params.pageNumber = val
this.queryByPage()
},
//
showAddLogModel(val) {
this.basicDialog = true
if (val == undefined) {
this.updataDisabled = false
this.getSystem()
this.dialogForm = {
sourceName: '',
sourceCode: '',
sourceType: '',
sourceDesc: '',
sourceConfig: '',
}
} else {
this.updataDisabled = true
this.dialogForm = val
const newSourceType = this.dialogForm
let newDataLink = []
this.dictionaryOptions.map((item) => {
if (item.id == newSourceType.sourceType) {
newDataLink = JSON.parse(item.extend)
var sourceConfigJson = JSON.parse(newSourceType.sourceConfig)
for (var i = 0; i < newDataLink.length; i++) {
newDataLink[i].value = sourceConfigJson[newDataLink[i].label]
}
}
})
this.dataLink = newDataLink
}
},
selectChange(val) { selectChange(val) {
this.dataLink = [] this.dataLink = []
const extendJSON = this.dictionaryOptions.find(function (obj) { const extendJSON = this.dictionaryOptions.find(function (obj) {
@ -296,30 +224,6 @@ export default {
} }
}) })
}, },
async delData(val) {
this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
this.$emit('deletelayer')
this.visible = false
const { code, data } = await deleteDataSource(val)
if (code != '200') return
this.queryByPage()
this.$message({
type: 'success',
message: '删除成功!',
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
})
})
},
}, },
} }

Loading…
Cancel
Save