fix 基础表同步修改
This commit is contained in:
@@ -31,6 +31,13 @@ export function getTableColumnNames(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getTableColumnNamesdata(params) {
|
||||
return request({
|
||||
url: 'api/externalFieldMapping/getTableColumnNamesdata/' + params,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllTableName() {
|
||||
return request({
|
||||
url: 'api/externalFieldMapping/getAllTableName',
|
||||
@@ -68,6 +75,20 @@ export function updateRows(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function tableColumns(params) {
|
||||
return request({
|
||||
url: '/api/bmFormStruc/tableColumns/' + params,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function syncAnalyse(data) {
|
||||
return request({
|
||||
url: 'api/externalFieldMapping/syncAnalyse',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
@@ -75,7 +96,10 @@ export default {
|
||||
addRows,
|
||||
updateRows,
|
||||
getAllTableName,
|
||||
tableColumns,
|
||||
getTableColumnNames,
|
||||
getExistTableName,
|
||||
getTableColumnNamesFromMapping
|
||||
getTableColumnNamesFromMapping,
|
||||
syncAnalyse,
|
||||
getTableColumnNamesdata
|
||||
}
|
||||
|
||||
@@ -117,6 +117,38 @@
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
title="表单同步测试"
|
||||
:visible.sync="syncShow"
|
||||
width="800px"
|
||||
@close="syncAnalyseCannel"
|
||||
>
|
||||
<el-form ref="form" :model="syncForm" :rules="rules" size="mini" label-width="50px">
|
||||
<el-form-item label="表单:" prop="occupystruct_qty">
|
||||
<el-input v-model="syncForm.local_table_name" disabled :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="测试数据" prop="analyseData">
|
||||
<el-input v-model="syncForm.analyseData" type="textarea" :precision="0" style="width: 650px;" />
|
||||
</el-form-item> </el-form>
|
||||
<el-table
|
||||
v-if="AAA"
|
||||
ref="table1"
|
||||
v-loading="crud.loading"
|
||||
:data="receivedData"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
|
||||
<el-table-column v-for="(item, index) in dataList" :key="item.COLUMN_NAME" :label="item.COLUMN_COMMENT" width="160">
|
||||
<template slot-scope="scope">{{ scope.row[item.COLUMN_NAME] }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="syncAnalyseSubmit">同步解析</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -139,6 +171,7 @@
|
||||
{{ dict.label.external_system[scope.row.external_system] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="mapping_json" label="映射关系" show-overflow-tooltip />
|
||||
<el-table-column prop="last_update_name" label="更新人" />
|
||||
<el-table-column prop="last_update_time" label="更新时间" width="150" />
|
||||
@@ -148,6 +181,14 @@
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="syncTest(scope.row)"
|
||||
>同步测试</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -168,6 +209,7 @@ import udOperation from '@crud/UD.operation.vue'
|
||||
import pagination from '@crud/Pagination.vue'
|
||||
import AddDialog from './AddDialog'
|
||||
import EditDialog from './EditDialog'
|
||||
import fieldMapping from './fieldMapping'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
@@ -203,15 +245,21 @@ export default {
|
||||
return {
|
||||
tableNameList: [],
|
||||
fieldNameList: [],
|
||||
dataList: [],
|
||||
dataTypeList: [],
|
||||
syncForm: {},
|
||||
addShow: false,
|
||||
editShow: false,
|
||||
permission: {},
|
||||
receivedData: [],
|
||||
AAA: false,
|
||||
|
||||
rules: {
|
||||
position_code: [
|
||||
{ required: true, message: '缓存线位置编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
syncShow: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -241,11 +289,42 @@ export default {
|
||||
this.$refs.editRef.setForm(row)
|
||||
this.editShow = true
|
||||
},
|
||||
syncTest(row) {
|
||||
this.syncShow = true
|
||||
this.syncForm = row
|
||||
fieldMapping.getTableColumnNamesFromMapping(row.local_table_name).then(res => {
|
||||
this.viewMstCols = res.item
|
||||
if (res.dtl_item != null) {
|
||||
this.hasDtl = true
|
||||
this.viewDtlCols = res.dtl_item
|
||||
}
|
||||
})
|
||||
},
|
||||
syncAnalyseSubmit() {
|
||||
this.AAA = true
|
||||
console.log(this.syncForm)
|
||||
crudFieldMapping.getTableColumnNamesdata(this.syncForm.local_table_name).then(res => {
|
||||
this.dataList = res
|
||||
console.log(this.dataList)
|
||||
})
|
||||
fieldMapping.syncAnalyse(this.syncForm).then(res => {
|
||||
this.crud.notify('解析成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.receivedData = res
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
querytable1() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
syncAnalyseCannel() {
|
||||
this.syncForm = {}
|
||||
this.viewMst = [],
|
||||
this.viewDtl = [],
|
||||
this.hasDtl = false,
|
||||
this.viewMstCols = {},
|
||||
this.viewDtlCols = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user