数据检索添加编辑功能
This commit is contained in:
parent
96c3a7b0a7
commit
bfb4428b44
|
@ -4,11 +4,13 @@ const getFileLinkInfo = (params)=>getAction("/fileDataLink/getFileLinkInfo",para
|
||||||
const processFile = (params)=>postAction("/fileDataLink/processFile",params);
|
const processFile = (params)=>postAction("/fileDataLink/processFile",params);
|
||||||
const fileDataLinkDelete = (params)=>deleteAction("/fileDataLink/delete",params);
|
const fileDataLinkDelete = (params)=>deleteAction("/fileDataLink/delete",params);
|
||||||
const isDataLinkFileParsed = (params)=>getAction("/fileDataLink/isDataLinkFileParsed",params);
|
const isDataLinkFileParsed = (params)=>getAction("/fileDataLink/isDataLinkFileParsed",params);
|
||||||
|
const updateDmTableBySeqNo = (params)=>postAction("/fileDataLink/updateDmTableBySeqNo",params);
|
||||||
export {
|
export {
|
||||||
getFileLinkInfo,
|
getFileLinkInfo,
|
||||||
processFile,
|
processFile,
|
||||||
fileDataLinkDelete,
|
fileDataLinkDelete,
|
||||||
isDataLinkFileParsed
|
isDataLinkFileParsed,
|
||||||
|
updateDmTableBySeqNo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :md="4" :sm="4">
|
<a-col :md="4" :sm="4">
|
||||||
<a-form-item label="数据类型">
|
<a-form-item label="数据类型">
|
||||||
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.schemaMass" @change="handleTypeChange">
|
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.schemaMass"
|
||||||
|
@change="handleTypeChange">
|
||||||
<a-select-option v-for="d in dataTypedataSources" :key="d.cnName">
|
<a-select-option v-for="d in dataTypedataSources" :key="d.cnName">
|
||||||
{{ d.cnName }}
|
{{ d.cnName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
|
@ -21,7 +22,8 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="8" :sm="8">
|
<a-col :md="8" :sm="8">
|
||||||
<a-form-item label="时间范围">
|
<a-form-item label="时间范围">
|
||||||
<a-range-picker :default-value="defaultTime" show-time :show-time="{ format: 'HH:mm:ss' }" :format="dateFormat" @change="onChangeTime" />
|
<a-range-picker :default-value="defaultTime" show-time :show-time="{ format: 'HH:mm:ss' }"
|
||||||
|
:format="dateFormat" @change="onChangeTime" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="5" :sm="5">
|
<a-col :md="5" :sm="5">
|
||||||
|
@ -54,27 +56,34 @@
|
||||||
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
|
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
|
||||||
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
|
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
|
||||||
:pagination="pagination" :scroll="{ x: 1200, y: 'calc(100vh - 450px)' }" rowKey="序号"
|
:pagination="pagination" :scroll="{ x: 1200, y: 'calc(100vh - 450px)' }" rowKey="序号"
|
||||||
@change="handleTableChange"></a-table>
|
@change="handleTableChange">
|
||||||
|
<template slot="operation" slot-scope="text, record">
|
||||||
|
<a-button type="primary" @click="handelEdit(record)">编辑</a-button>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="linese"></div>
|
<div class="linese"></div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<tablelist ref="modalForm" ></tablelist>
|
<tablelist ref="modalForm"></tablelist>
|
||||||
<exptable ref="exptable" ></exptable>
|
<exptable ref="exptable"></exptable>
|
||||||
|
<editdataseach ref="editdataseachForm" @ok="getTableDataList" />
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { metaDataTypeTree, tableDataList,DmExportTool } from '@/api/metaData'
|
import { metaDataTypeTree, tableDataList, DmExportTool } from '@/api/metaData'
|
||||||
import { getAction, deleteAction, putAction, postAction,downFile } from '@/api/manage'
|
import { getAction, deleteAction, putAction, postAction, downFile } from '@/api/manage'
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import tablelist from './modules/tablelist'
|
import tablelist from './modules/tablelist'
|
||||||
import exptable from './modules/exptable'
|
import exptable from './modules/exptable'
|
||||||
|
import editdataseach from './modules/editdataseach'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "metadata",
|
name: "metadata",
|
||||||
components: {
|
components: {
|
||||||
tablelist,
|
tablelist,
|
||||||
exptable
|
exptable,
|
||||||
|
editdataseach
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -108,8 +117,8 @@ export default {
|
||||||
treeDate: [],
|
treeDate: [],
|
||||||
dataSource: [],
|
dataSource: [],
|
||||||
columns: [],
|
columns: [],
|
||||||
dataTypedataSources:[],
|
dataTypedataSources: [],
|
||||||
treeHeight:0
|
treeHeight: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -141,11 +150,11 @@ export default {
|
||||||
const container = this.$refs.treeContainer;
|
const container = this.$refs.treeContainer;
|
||||||
this.treeHeight = container.clientHeight;
|
this.treeHeight = container.clientHeight;
|
||||||
},
|
},
|
||||||
getselect(){
|
getselect() {
|
||||||
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
|
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.dataTypedataSources = res.result.result.DATA_CONN_STANDARD
|
this.dataTypedataSources = res.result.result.DATA_CONN_STANDARD
|
||||||
if(res.result.result.DATA_CONN_STANDARD.length > 0){
|
if (res.result.result.DATA_CONN_STANDARD.length > 0) {
|
||||||
this.queryParam.schemaMass = res.result.result.DATA_CONN_STANDARD[0].cnName
|
this.queryParam.schemaMass = res.result.result.DATA_CONN_STANDARD[0].cnName
|
||||||
}
|
}
|
||||||
this.getMetaDataTypeTree();
|
this.getMetaDataTypeTree();
|
||||||
|
@ -154,15 +163,15 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAdd(){
|
handleAdd() {
|
||||||
if(this.queryParam.schemaMass == ""){
|
if (this.queryParam.schemaMass == "") {
|
||||||
this.$message.warning("请选择导出的数据类型");
|
this.$message.warning("请选择导出的数据类型");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$refs.modalForm.add(this.queryParam.schemaMass);
|
this.$refs.modalForm.add(this.queryParam.schemaMass);
|
||||||
},
|
},
|
||||||
openexptable(){
|
openexptable() {
|
||||||
if(this.queryParam.schemaMass == ""){
|
if (this.queryParam.schemaMass == "") {
|
||||||
this.$message.warning("请选择查询的导出的数据类型");
|
this.$message.warning("请选择查询的导出的数据类型");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -221,6 +230,10 @@ export default {
|
||||||
this.tableParams.pageNum = 1
|
this.tableParams.pageNum = 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handelEdit(record) {
|
||||||
|
const filteredColumn = this.columns.filter(item => item.dataIndex != 'operation');
|
||||||
|
this.$refs.editdataseachForm.initForm(this.tableParams.schemaMass, this.tableParams.tableName, filteredColumn ,record);
|
||||||
|
},
|
||||||
getTableDataList() {
|
getTableDataList() {
|
||||||
console.log(this.tableParams)
|
console.log(this.tableParams)
|
||||||
if (this.tableParams.schemaMass == null || this.tableParams.tableName == null) {
|
if (this.tableParams.schemaMass == null || this.tableParams.tableName == null) {
|
||||||
|
@ -230,6 +243,7 @@ export default {
|
||||||
tableDataList(this.tableParams).then(res => {
|
tableDataList(this.tableParams).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.columns = []
|
this.columns = []
|
||||||
|
if (res.result.columnNames.length > 0) {
|
||||||
res.result.columnNames.forEach(columns => {
|
res.result.columnNames.forEach(columns => {
|
||||||
this.columns.push({
|
this.columns.push({
|
||||||
title: columns,
|
title: columns,
|
||||||
|
@ -238,6 +252,15 @@ export default {
|
||||||
width: 180
|
width: 180
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
this.columns.push({
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
width: 100,
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'operation',
|
||||||
|
scopedSlots: { customRender: 'operation' },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const pagination = { ...this.pagination }
|
const pagination = { ...this.pagination }
|
||||||
pagination.total = res.result.total
|
pagination.total = res.result.total
|
||||||
|
@ -247,15 +270,15 @@ export default {
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
exportTool(){
|
exportTool() {
|
||||||
if(this.queryParam.schemaMass == ""){
|
if (this.queryParam.schemaMass == "") {
|
||||||
this.$message.warning("请选择导出的数据类型");
|
this.$message.warning("请选择导出的数据类型");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
postAction("/dataManager/DmExportTool?schemaMass="+this.queryParam.schemaMass+"&tableNames="+""+"&exportType=0",{}).then(res => {
|
postAction("/dataManager/DmExportTool?schemaMass=" + this.queryParam.schemaMass + "&tableNames=" + "" + "&exportType=0", {}).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message.success(res.result);
|
this.$message.success(res.result);
|
||||||
}else{
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
88
src/views/data/modules/editdataseach.vue
Normal file
88
src/views/data/modules/editdataseach.vue
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
<template>
|
||||||
|
<a-modal :title="title" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form-model ref="ruleForm" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col class="gutter-row" :span="12" v-for="itemNode in nodes">
|
||||||
|
<a-form-model-item :label="itemNode.dataIndex" prop="name">
|
||||||
|
<a-input v-model="form[itemNode.dataIndex]"
|
||||||
|
:disabled="itemNode.dataIndex == '序号' ? true : false" />
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
|
</a-form-model>
|
||||||
|
</a-spin>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { updateDmTableBySeqNo } from '@/api/fileDataLink'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "editdataseach",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: "编辑",
|
||||||
|
visible: false,
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 10 },
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 14 },
|
||||||
|
},
|
||||||
|
confirmLoading: false,
|
||||||
|
form: null,
|
||||||
|
nodes: [],
|
||||||
|
submitForm: {
|
||||||
|
schemaMass: null,
|
||||||
|
tableName: null,
|
||||||
|
fieldValues: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initForm(schemaMass, tableName, columns, record) {
|
||||||
|
this.visible = true;
|
||||||
|
this.nodes = columns
|
||||||
|
this.submitForm.schemaMass = schemaMass
|
||||||
|
this.submitForm.tableName = tableName
|
||||||
|
this.form = record
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
const that = this;
|
||||||
|
// 触发表单验证
|
||||||
|
this.$refs.ruleForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
that.confirmLoading = true;
|
||||||
|
that.submitForm.fieldValues = that.form
|
||||||
|
updateDmTableBySeqNo(that.submitForm).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message);
|
||||||
|
that.$emit('ok');
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message);
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
that.confirmLoading = false;
|
||||||
|
that.close();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
Loading…
Reference in New Issue
Block a user