添加文件接引
This commit is contained in:
parent
4a9d110400
commit
f17db170f4
|
@ -10,6 +10,7 @@ const updateIndexSafe = (params)=>postAction("/tableIndex/updateIndexSafe",param
|
||||||
const dropIndex = (params)=>postAction("/tableIndex/dropIndex",params);
|
const dropIndex = (params)=>postAction("/tableIndex/dropIndex",params);
|
||||||
const DmExportTool = (params)=>postAction("/dataManager/DmExportTool",params);
|
const DmExportTool = (params)=>postAction("/dataManager/DmExportTool",params);
|
||||||
const getExportLog = (params)=>getAction("/dataManager/getExportLog",params);
|
const getExportLog = (params)=>getAction("/dataManager/getExportLog",params);
|
||||||
|
const updateDmTableBySeqNo = (params)=>postAction("/dataManager/updateDmTableBySeqNo",params);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getDataManagerInfo,
|
getDataManagerInfo,
|
||||||
|
@ -21,7 +22,8 @@ export {
|
||||||
updateIndexSafe,
|
updateIndexSafe,
|
||||||
dropIndex,
|
dropIndex,
|
||||||
DmExportTool,
|
DmExportTool,
|
||||||
getExportLog
|
getExportLog,
|
||||||
|
updateDmTableBySeqNo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,17 @@ 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);
|
const updateDmTableBySeqNo = (params)=>postAction("/fileDataLink/updateDmTableBySeqNo",params);
|
||||||
|
const getSuccessTableInfo = (params)=>getAction("/fileDataLink/getSuccessTableInfo",params);
|
||||||
|
const getTableDataByOri = (params)=>getAction("/fileDataLink/getTableDataByOri",params);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getFileLinkInfo,
|
getFileLinkInfo,
|
||||||
processFile,
|
processFile,
|
||||||
fileDataLinkDelete,
|
fileDataLinkDelete,
|
||||||
isDataLinkFileParsed,
|
isDataLinkFileParsed,
|
||||||
updateDmTableBySeqNo
|
updateDmTableBySeqNo,
|
||||||
|
getSuccessTableInfo,
|
||||||
|
getTableDataByOri
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,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"
|
<a-range-picker :default-value="defaultTime" show-time :show-time="{ format: 'HH:mm:ss' }"
|
||||||
@change="onChangeTime" />
|
: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">
|
||||||
|
@ -272,7 +272,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handelEdit(record) {
|
handelEdit(record) {
|
||||||
const filteredColumn = this.columns.filter(item => item.dataIndex != 'operation');
|
const filteredColumn = this.columns.filter(item => item.dataIndex != 'operation' && item.dataIndex != 'ROW_ID');
|
||||||
|
delete record['ROW_ID'];
|
||||||
this.$refs.editdataseachForm.initForm(this.tableParams.schemaMass, this.tableParams.tableName, filteredColumn, record);
|
this.$refs.editdataseachForm.initForm(this.tableParams.schemaMass, this.tableParams.tableName, filteredColumn, record);
|
||||||
},
|
},
|
||||||
getTableDataList() {
|
getTableDataList() {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateDmTableBySeqNo } from '@/api/fileDataLink'
|
import { updateDmTableBySeqNo } from '@/api/dataManage'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "editdataseach",
|
name: "editdataseach",
|
||||||
|
|
214
src/views/datalink/files.vue
Normal file
214
src/views/datalink/files.vue
Normal file
|
@ -0,0 +1,214 @@
|
||||||
|
<template>
|
||||||
|
<a-card :bordered="false">
|
||||||
|
|
||||||
|
<!-- 查询区域 -->
|
||||||
|
<div class="table-page-search-wrapper">
|
||||||
|
<a-form layout="inline">
|
||||||
|
<a-row :gutter="30">
|
||||||
|
<a-col :md="20">
|
||||||
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :md="6" :sm="6">
|
||||||
|
<a-form-item label="模式名称">
|
||||||
|
<a-select placeholder="选择模式" option-filter-prop="children" v-model="queryParam.schemaMass"
|
||||||
|
@change="handleTypeChange">
|
||||||
|
<a-select-option v-for="d in modeList" :key="d.id">
|
||||||
|
{{ d.value }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :md="6" :sm="6">
|
||||||
|
<a-form-item label="表名称">
|
||||||
|
<a-select placeholder="选择表" option-filter-prop="children" v-model="queryParam.tableName">
|
||||||
|
<a-select-option v-for="d in tableNameList" :key="d.id">
|
||||||
|
{{ d.value }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</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-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :md="4" :sm="24">
|
||||||
|
<a-button type="primary" style="left: 10px" @click="getTableDataList"
|
||||||
|
icon="search">查询</a-button>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- table区域-begin -->
|
||||||
|
<div style="height:calc(100vh - 316px);overflow:hidden; background: #e6e9f1 !important;">
|
||||||
|
<div class="linese"></div>
|
||||||
|
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
|
||||||
|
:pagination="pagination" :scroll="{ x: 1200, y: 'calc(100vh - 310px)' }" rowKey="序号"
|
||||||
|
@change="handleTableChange">
|
||||||
|
<template slot="operation" slot-scope="text, record">
|
||||||
|
<a-button type="primary" @click="handelEdit(record)">编辑</a-button>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
<div class="linese"></div>
|
||||||
|
</div>
|
||||||
|
<!-- table区域-end -->
|
||||||
|
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<filesModel ref="modalForm"></filesModel>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import filesModel from './modules/filesModel'
|
||||||
|
|
||||||
|
import {
|
||||||
|
getSuccessTableInfo,
|
||||||
|
getTableDataByOri,
|
||||||
|
} from '@/api/fileDataLink'
|
||||||
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||||
|
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||||
|
import guaz from '@assets/guaz.png'
|
||||||
|
import moment from 'moment';
|
||||||
|
export default {
|
||||||
|
name: "filesList",
|
||||||
|
mixins: [JeecgListMixin],
|
||||||
|
components: {
|
||||||
|
filesModel,
|
||||||
|
JEllipsis,
|
||||||
|
VNodes: {
|
||||||
|
functional: true,
|
||||||
|
render: (h, ctx) => ctx.props.vnodes,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
moment,
|
||||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
defaultTime: [],
|
||||||
|
modeList: [],
|
||||||
|
tableNameList: [],
|
||||||
|
dataSources: [],
|
||||||
|
guaz,
|
||||||
|
pagination: {
|
||||||
|
defaultCurrent: 1, // 默认当前页数
|
||||||
|
defaultPageSize: 10, // 默认当前页显示数据的大小total: 0, // 总数,必须先有
|
||||||
|
showSizeChanger: true,
|
||||||
|
showQuickJumper: false,
|
||||||
|
pageSizeOptions: ['10', '20', '30'],
|
||||||
|
showTotal: total => `总共 ${total} 个项目`, // 显示总数
|
||||||
|
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
|
||||||
|
},
|
||||||
|
queryParam: {
|
||||||
|
schemaMass: null,
|
||||||
|
tableName: null,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
pageSize: 10,
|
||||||
|
pageNum: 1
|
||||||
|
},
|
||||||
|
columns: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.queryFiles();
|
||||||
|
this.initDate();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initDate() {
|
||||||
|
const start = moment().subtract(1, 'days').set({ hour: 0, minute: 0, second: 0 });
|
||||||
|
const end = moment().set({ hour: 23, minute: 59, second: 59 });
|
||||||
|
this.defaultTime = [start, end];
|
||||||
|
this.queryParam.startTime = start.format(this.dateFormat);
|
||||||
|
this.queryParam.endTime = end.format(this.dateFormat);
|
||||||
|
},
|
||||||
|
queryFiles() {
|
||||||
|
getSuccessTableInfo().then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.modeList = []
|
||||||
|
for (let key in res.result) {
|
||||||
|
this.modeList.push({ id: key, value: key, children: res.result[key] })
|
||||||
|
}
|
||||||
|
console.log('sfaf', this.modeList)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleTypeChange(value) {
|
||||||
|
this.queryParam.schemaMass = value
|
||||||
|
this.showTableName(value)
|
||||||
|
},
|
||||||
|
showTableName(value) {
|
||||||
|
this.tableNameList = []
|
||||||
|
var tableArr = this.modeList.filter(model => model.id == value)[0]
|
||||||
|
for (let key in tableArr.children) {
|
||||||
|
this.tableNameList.push({ id: tableArr.children[key], value: tableArr.children[key] })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onChangeTime(date, dateString) {
|
||||||
|
if (date.length == 0) {
|
||||||
|
this.queryParam.startTime = null
|
||||||
|
this.queryParam.endTime = null
|
||||||
|
this.queryParam.pageNum = 1
|
||||||
|
} else {
|
||||||
|
this.queryParam.startTime = moment(date[0]).format(this.dateFormat);
|
||||||
|
this.queryParam.endTime = moment(date[1]).format(this.dateFormat);
|
||||||
|
this.queryParam.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getTableDataList() {
|
||||||
|
console.log(this.queryParam)
|
||||||
|
if (this.queryParam.schemaMass == null || this.queryParam.tableName == null) {
|
||||||
|
this.$message.warning('必须选择查询的表')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getTableDataByOri(this.queryParam).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.columns = []
|
||||||
|
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
|
||||||
|
this.dataSource = res.result.rows
|
||||||
|
this.pagination = pagination
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleTableChange(pagination, filters, sorter) {
|
||||||
|
this.pagination = pagination
|
||||||
|
this.queryParam.pageNum = pagination.current
|
||||||
|
this.queryParam.pageSize = pagination.pageSize
|
||||||
|
this.getTableDataList()
|
||||||
|
},
|
||||||
|
handelEdit(record) {
|
||||||
|
const filteredColumn = this.columns.filter(item => item.dataIndex != 'operation' && item.dataIndex != '数据');
|
||||||
|
delete record['数据'];
|
||||||
|
this.$refs.modalForm.initForm(this.queryParam.schemaMass, this.queryParam.tableName, filteredColumn, record);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
88
src/views/datalink/modules/filesModel.vue
Normal file
88
src/views/datalink/modules/filesModel.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