数据检索添加编辑功能
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 fileDataLinkDelete = (params)=>deleteAction("/fileDataLink/delete",params);
|
||||
const isDataLinkFileParsed = (params)=>getAction("/fileDataLink/isDataLinkFileParsed",params);
|
||||
const updateDmTableBySeqNo = (params)=>postAction("/fileDataLink/updateDmTableBySeqNo",params);
|
||||
export {
|
||||
getFileLinkInfo,
|
||||
processFile,
|
||||
fileDataLinkDelete,
|
||||
isDataLinkFileParsed
|
||||
isDataLinkFileParsed,
|
||||
updateDmTableBySeqNo
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :md="4" :sm="4">
|
||||
<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">
|
||||
{{ d.cnName }}
|
||||
</a-select-option>
|
||||
|
@ -21,7 +22,8 @@
|
|||
</a-col>
|
||||
<a-col :md="8" :sm="8">
|
||||
<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-col>
|
||||
<a-col :md="5" :sm="5">
|
||||
|
@ -54,27 +56,34 @@
|
|||
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
|
||||
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
|
||||
: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 class="linese"></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<tablelist ref="modalForm" ></tablelist>
|
||||
<exptable ref="exptable" ></exptable>
|
||||
<tablelist ref="modalForm"></tablelist>
|
||||
<exptable ref="exptable"></exptable>
|
||||
<editdataseach ref="editdataseachForm" @ok="getTableDataList" />
|
||||
</a-card>
|
||||
</template>
|
||||
<script>
|
||||
import { metaDataTypeTree, tableDataList,DmExportTool } from '@/api/metaData'
|
||||
import { getAction, deleteAction, putAction, postAction,downFile } from '@/api/manage'
|
||||
import { metaDataTypeTree, tableDataList, DmExportTool } from '@/api/metaData'
|
||||
import { getAction, deleteAction, putAction, postAction, downFile } from '@/api/manage'
|
||||
import moment from 'moment';
|
||||
import tablelist from './modules/tablelist'
|
||||
import exptable from './modules/exptable'
|
||||
|
||||
import exptable from './modules/exptable'
|
||||
import editdataseach from './modules/editdataseach'
|
||||
|
||||
export default {
|
||||
name: "metadata",
|
||||
components: {
|
||||
tablelist,
|
||||
exptable
|
||||
exptable,
|
||||
editdataseach
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -108,8 +117,8 @@ export default {
|
|||
treeDate: [],
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
dataTypedataSources:[],
|
||||
treeHeight:0
|
||||
dataTypedataSources: [],
|
||||
treeHeight: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -137,15 +146,15 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
calculateScrollY() {
|
||||
// 获取父容器高度(需减去表格内其他元素的高度,如分页栏)
|
||||
// 获取父容器高度(需减去表格内其他元素的高度,如分页栏)
|
||||
const container = this.$refs.treeContainer;
|
||||
this.treeHeight = container.clientHeight;
|
||||
},
|
||||
getselect(){
|
||||
getselect() {
|
||||
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
|
||||
if (res.success) {
|
||||
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.getMetaDataTypeTree();
|
||||
|
@ -154,17 +163,17 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
handleAdd(){
|
||||
if(this.queryParam.schemaMass == ""){
|
||||
this.$message.warning("请选择导出的数据类型");
|
||||
return;
|
||||
handleAdd() {
|
||||
if (this.queryParam.schemaMass == "") {
|
||||
this.$message.warning("请选择导出的数据类型");
|
||||
return;
|
||||
}
|
||||
this.$refs.modalForm.add(this.queryParam.schemaMass);
|
||||
},
|
||||
openexptable(){
|
||||
if(this.queryParam.schemaMass == ""){
|
||||
this.$message.warning("请选择查询的导出的数据类型");
|
||||
return;
|
||||
openexptable() {
|
||||
if (this.queryParam.schemaMass == "") {
|
||||
this.$message.warning("请选择查询的导出的数据类型");
|
||||
return;
|
||||
}
|
||||
this.$refs.exptable.add(this.queryParam.schemaMass);
|
||||
},
|
||||
|
@ -221,6 +230,10 @@ export default {
|
|||
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() {
|
||||
console.log(this.tableParams)
|
||||
if (this.tableParams.schemaMass == null || this.tableParams.tableName == null) {
|
||||
|
@ -228,16 +241,26 @@ export default {
|
|||
return
|
||||
}
|
||||
tableDataList(this.tableParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.code == 200) {
|
||||
this.columns = []
|
||||
res.result.columnNames.forEach(columns => {
|
||||
this.columns.push({
|
||||
title: columns,
|
||||
dataIndex: columns,
|
||||
ellipsis: true,
|
||||
width: 180
|
||||
if (res.result.columnNames.length > 0) {
|
||||
res.result.columnNames.forEach(columns => {
|
||||
this.columns.push({
|
||||
title: columns,
|
||||
dataIndex: columns,
|
||||
ellipsis: true,
|
||||
width: 180
|
||||
})
|
||||
})
|
||||
})
|
||||
this.columns.push({
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
title: '操作',
|
||||
dataIndex: 'operation',
|
||||
scopedSlots: { customRender: 'operation' },
|
||||
})
|
||||
}
|
||||
|
||||
const pagination = { ...this.pagination }
|
||||
pagination.total = res.result.total
|
||||
|
@ -247,18 +270,18 @@ export default {
|
|||
|
||||
})
|
||||
},
|
||||
exportTool(){
|
||||
if(this.queryParam.schemaMass == ""){
|
||||
this.$message.warning("请选择导出的数据类型");
|
||||
return;
|
||||
exportTool() {
|
||||
if (this.queryParam.schemaMass == "") {
|
||||
this.$message.warning("请选择导出的数据类型");
|
||||
return;
|
||||
}
|
||||
postAction("/dataManager/DmExportTool?schemaMass=" + this.queryParam.schemaMass + "&tableNames=" + "" + "&exportType=0", {}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success(res.result);
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
postAction("/dataManager/DmExportTool?schemaMass="+this.queryParam.schemaMass+"&tableNames="+""+"&exportType=0",{}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success(res.result);
|
||||
}else{
|
||||
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