|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
<el-dialog title="数据汇聚" v-model="innerVisible" :modal-append-to-body='false' class="dialog-default" width="30%">
|
|
|
- <el-form :model="convergeItemForm" label-width="100px">
|
|
|
+ <el-form :model="convergeItemForm" label-width="100px" label-position="right">
|
|
|
<el-row>
|
|
|
- <el-form-item label="汇聚模式">
|
|
|
+ <el-form-item label="汇聚模式" required ="true">
|
|
|
<el-select v-model="convergeItemForm.type" placeholder="汇聚模式" @change="aggregateModelChange">
|
|
|
- <el-option v-for="item in dataTypeArr" :key="item.value" :label="item.label" :value="item.value"/>
|
|
|
+ <el-option v-for="item in dataTypeArr" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-form-item label="前置源">
|
|
|
+ <el-form-item label="前置源" required ="true">
|
|
|
<el-select v-model="convergeItemForm.sourceId" placeholder="前置源" @change="sourceIdChange">
|
|
|
- <el-option v-for="item in sourceArr" :key="item.value" :label="item.label" :value="item.value"/>
|
|
|
+ <el-option v-for="item in sourceArr" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
@@ -19,25 +19,39 @@
|
|
|
<el-row>
|
|
|
<el-form-item label="前置库">
|
|
|
<el-select v-model="convergeItemForm.database" placeholder="前置库" @change="databaseChange">
|
|
|
- <el-option v-for="item in sourceData" :key="item.SCHEMANAME" :label="item.SCHEMANAME" :value="item.SCHEMANAME"/>
|
|
|
+ <el-option v-for="item in sourceData" :key="item.SCHEMANAME" :label="item.SCHEMANAME"
|
|
|
+ :value="item.SCHEMANAME" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-form-item label="前置表">
|
|
|
<el-select v-model="convergeItemForm.table" placeholder="前置表">
|
|
|
- <el-option v-for="item in (((sourceData.find(item=>item.SCHEMANAME===convergeItemForm.database))||{}).CHILD)||[]" :key="item.TABLENAME" :label="item.TABLENAME" :value="item.TABLENAME"/>
|
|
|
+ <el-option
|
|
|
+ v-for="item in (((sourceData.find(item => item.SCHEMANAME === convergeItemForm.database)) || {}).CHILD) || []"
|
|
|
+ :key="item.TABLENAME" :label="item.TABLENAME" :value="item.TABLENAME" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
-<!-- <template v-if="convergeItemForm.type === '3'">-->
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-form-item label="文件名">-->
|
|
|
-<!-- <el-input class="width-80" v-model="convergeItemForm.fileName" label="文件名"/>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-<!-- </template>-->
|
|
|
+ <template v-if="convergeItemForm.type === '3'">
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="文件路径" required ="true" style="width: 59%">
|
|
|
+ <el-input v-model="convergeItemForm.fileName" label="文件名" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="读取规则" required ="true">
|
|
|
+ <el-radio-group v-model="convergeItemForm.fileType">
|
|
|
+ <el-radio :label="1">最新文件</el-radio>
|
|
|
+ <el-radio :label="2">最新文件+文件名关键词</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="关键词" style="width: 59%">
|
|
|
+ <el-input v-model="convergeItemForm.fileKeyword" label="关键词" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button class="btn-default" @click="innerVisible = false">取 消</el-button>
|
|
@@ -47,96 +61,96 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import vModelDialog from "../../../utils/vModelDialog";
|
|
|
- import { DataTypeArr } from "../../../utils/data/select-data";
|
|
|
- import { GetSourceArr, GetDatabase } from "../../../services/baseCata";
|
|
|
+import { GetDatabase, GetSourceArr } from "../../../services/baseCata";
|
|
|
+import { DataTypeArr } from "../../../utils/data/select-data";
|
|
|
+import vModelDialog from "../../../utils/vModelDialog";
|
|
|
|
|
|
- export default {
|
|
|
- name: "ConvergeAdd",
|
|
|
- mixins: [vModelDialog],
|
|
|
- props: ['convergeItemForm'],
|
|
|
- computed:{
|
|
|
- dataTypeArr() {
|
|
|
- return DataTypeArr
|
|
|
- }
|
|
|
+export default {
|
|
|
+ name: "ConvergeAdd",
|
|
|
+ mixins: [vModelDialog],
|
|
|
+ props: ['convergeItemForm'],
|
|
|
+ computed: {
|
|
|
+ dataTypeArr() {
|
|
|
+ return DataTypeArr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ sourceArr: [],
|
|
|
+ databaseArr: [],
|
|
|
+ fileArr: [],
|
|
|
+ webservicesArr: [],
|
|
|
+ sourceData: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getSourceArr()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getSourceArr() {
|
|
|
+ this.databaseArr = []
|
|
|
+ this.fileArr = []
|
|
|
+ this.webservicesArr = []
|
|
|
+ GetSourceArr().then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ res.data.databases.forEach(item => {
|
|
|
+ this.databaseArr.push({ value: item.sourceId, label: item.sourceName })
|
|
|
+ })
|
|
|
+ res.data.files.forEach(item => {
|
|
|
+ this.fileArr.push({ value: item.sourceId, label: item.sourceName })
|
|
|
+ })
|
|
|
+ res.data.webservices.forEach(item => {
|
|
|
+ this.webservicesArr.push({ value: item.sourceId, label: item.sourceName })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- data(){
|
|
|
- return {
|
|
|
- sourceArr: [],
|
|
|
- databaseArr: [],
|
|
|
- fileArr: [],
|
|
|
- webservicesArr: [],
|
|
|
- sourceData:[]
|
|
|
- }
|
|
|
+ saveConvergeData() {
|
|
|
+ this.innerVisible = false
|
|
|
+ this.convergeItemForm.sourceName = (this.sourceArr.find(item => item.value === this.convergeItemForm.sourceId) || {}).label
|
|
|
+ this.$emit("saveConvergeData", this.convergeItemForm)
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getSourceArr()
|
|
|
+ aggregateModelChange(value) {
|
|
|
+ if (value === '1') {
|
|
|
+ this.sourceArr = this.databaseArr
|
|
|
+ delete this.convergeItemForm.fileName
|
|
|
+ } else if (value === '2') {
|
|
|
+ this.sourceArr = this.webservicesArr
|
|
|
+ delete this.convergeItemForm.database
|
|
|
+ delete this.convergeItemForm.table
|
|
|
+ delete this.convergeItemForm.fileName
|
|
|
+ } else if (value === '3') {
|
|
|
+ this.sourceArr = this.fileArr
|
|
|
+ delete this.convergeItemForm.database
|
|
|
+ delete this.convergeItemForm.table
|
|
|
+ }
|
|
|
+ this.convergeItemForm.sourceId = ''
|
|
|
+ this.sourceData = []
|
|
|
},
|
|
|
- methods:{
|
|
|
- getSourceArr() {
|
|
|
- this.databaseArr = []
|
|
|
- this.fileArr = []
|
|
|
- this.webservicesArr = []
|
|
|
- GetSourceArr().then(res => {
|
|
|
+ sourceIdChange(value) {
|
|
|
+ delete this.convergeItemForm.database
|
|
|
+ delete this.convergeItemForm.table
|
|
|
+ if (this.convergeItemForm.type !== "1") {
|
|
|
+ this.sourceData = []
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (value !== undefined || value !== '') {
|
|
|
+ GetDatabase(value).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- res.data.databases.forEach(item => {
|
|
|
- this.databaseArr.push({value: item.sourceId, label: item.sourceName})
|
|
|
- })
|
|
|
- res.data.files.forEach(item => {
|
|
|
- this.fileArr.push({value: item.sourceId, label: item.sourceName})
|
|
|
- })
|
|
|
- res.data.webservices.forEach(item => {
|
|
|
- this.webservicesArr.push({value: item.sourceId, label: item.sourceName})
|
|
|
- })
|
|
|
+ this.sourceData = res.data || []
|
|
|
+ } else {
|
|
|
+ this.sourceData = []
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
- saveConvergeData(){
|
|
|
- this.innerVisible = false
|
|
|
- this.convergeItemForm.sourceName = (this.sourceArr.find(item => item.value === this.convergeItemForm.sourceId) || {}).label
|
|
|
- this.$emit("saveConvergeData", this.convergeItemForm)
|
|
|
- },
|
|
|
- aggregateModelChange(value) {
|
|
|
- if (value === '1') {
|
|
|
- this.sourceArr = this.databaseArr
|
|
|
- delete this.convergeItemForm.fileName
|
|
|
- } else if (value === '2') {
|
|
|
- this.sourceArr = this.webservicesArr
|
|
|
- delete this.convergeItemForm.database
|
|
|
- delete this.convergeItemForm.table
|
|
|
- delete this.convergeItemForm.fileName
|
|
|
- } else if (value === '3') {
|
|
|
- this.sourceArr = this.fileArr
|
|
|
- delete this.convergeItemForm.database
|
|
|
- delete this.convergeItemForm.table
|
|
|
- }
|
|
|
- this.convergeItemForm.sourceId = ''
|
|
|
- this.sourceData = []
|
|
|
- },
|
|
|
- sourceIdChange(value){
|
|
|
- delete this.convergeItemForm.database
|
|
|
- delete this.convergeItemForm.table
|
|
|
- if(this.convergeItemForm.type!=="1"){
|
|
|
- this.sourceData = []
|
|
|
- return
|
|
|
- }
|
|
|
- if (value!==undefined||value!==''){
|
|
|
- GetDatabase(value).then((res)=>{
|
|
|
- if (res.code===200){
|
|
|
- this.sourceData = res.data || []
|
|
|
- }else {
|
|
|
- this.sourceData = []
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- databaseChange(){
|
|
|
- delete this.convergeItemForm.table
|
|
|
}
|
|
|
+ },
|
|
|
+ databaseChange() {
|
|
|
+ delete this.convergeItemForm.table
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
|
-</style>
|
|
|
+</style>
|