添加两个新的数据接引

This commit is contained in:
RenCheng 2025-06-21 14:15:23 +08:00
parent f89c52e0b9
commit 445d8c40b3
5 changed files with 510 additions and 2 deletions

3
public/config.js vendored
View File

@ -1,3 +1,4 @@
window.AppConfig = {
systemTitle: '末端数据接入处理系统'
systemTitle: '末端数据接入处理系统',
apiUrl: 'http://pbl1.natapp1.cc/jeecg-boot'
}

View File

@ -120,6 +120,7 @@ export default {
},
created() {
this.sysTitle = window.AppConfig.systemTitle
this.apiUrl = window.AppConfig.apiUrl
},
methods: {
handleScroll() {

View File

@ -2,7 +2,7 @@
import Vue from 'vue'
//设置全局API_BASE_URL
Vue.prototype.API_BASE_URL = process.env.VUE_APP_API_BASE_URL
window._CONFIG['domianURL'] = Vue.prototype.API_BASE_URL
window._CONFIG['domianURL'] = window.AppConfig.apiUrl
//单点登录地址
window._CONFIG['casPrefixUrl'] = process.env.VUE_APP_CAS_BASE_URL
window._CONFIG['onlinePreviewDomainURL'] = process.env.VUE_APP_ONLINE_BASE_URL

View File

@ -0,0 +1,253 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="模式名称">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.schemaName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.tableName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24" >
<a-button type="primary" style="left: 10px" @click="loadData" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
<a-button type="primary" @click="handleAdd" icon="upload" style="margin-left: 8px;left: 10px">上传</a-button>
<a-button type="primary" @click="allprocess" icon="upload" style="margin-left: 8px;left: 10px">全部解析</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<div style="height:900px;overflow-y:auto;background: #e6e9f1;">
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
@change="handleTableChange">
<!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示-->
<template slot="parseStatus" slot-scope="text">
<span style="color:black;" v-if="text === 0" >未解析</span>
<span style="color:darkorange;" v-if="text === 1">解析中</span>
<span style="color:#87d068;" v-if="text === 2">解析完成</span>
<span style="color:red;" v-if="text === 3">解析失败</span>
<span style="color:royalblue;" v-if="text === 4">等待中</span>
</template>
<span slot="action" slot-scope="text, record">
<a @click="processFile(record)" >解析</a>
<a-divider type="vertical"/>
<a @click="clearTableData(record.id)">卸载</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<uploadModal ref="modalForm" @ok="loadData"></uploadModal>
</a-card>
</template>
<script>
import uploadModal from './modules/uploadModal'
import { getFileLinkInfo,processFile,fileDataLinkDelete,isDataLinkFileParsed } from '@/api/fileDataLink'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from "@/components/jeecg/JEllipsis";
import {deleteAction, postAction,getAction} from '@/api/manage'
export default {
name: "waterDocuments",
mixins:[JeecgListMixin],
components: {
uploadModal,
JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
},
},
data () {
return {
description: '文件接引',
dataSources: [],
queryParam: {
pageNum :1,
pageSize:20,
schemaName:'',
tableName:'',
dataLinkType:'5'
},
schemaName:"",
columns: [
{
title: '#',
dataIndex: '',
key:'id',
width:60,
align:"id",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '文件名称',
align:"fileName",
dataIndex: 'fileName',
},
{
title: '模式名称',
align:"schemaName",
dataIndex: 'schemaName'
},
{
title: '表名',
align:"tableName",
dataIndex: 'tableName',
},
{
title: '创建时间',
align:"createTime",
dataIndex: 'createTime'
},
{
title: '状态',
align:"center",
dataIndex: 'parseStatus',
scopedSlots: { customRender: 'parseStatus' },
},
{
title: '解析进度',
align:"center",
dataIndex: 'percent',
},
{
title: '解析时间开始',
align:"analyzeStartTime",
dataIndex: 'analyzeStartTime',
},
{
title: '解析时间完成',
align:"analyzeEndTime",
dataIndex: 'analyzeEndTime',
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width:180,
scopedSlots: { customRender: 'action' },
}
]
}
},
computed: {
},
created () {
this.loadData();
},
methods: {
//handleTableChange
handleTableChange(pagination, filters, sorter) {
//
//TODO
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
this.loadData();
},
loadData() {
getFileLinkInfo(this.queryParam).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
setTimeout(()=>{
this.loadData();
},5000)
if(res.result.total)
{
this.ipagination.total = res.result.total;
}
} else {
this.$message.warning(res.message);
}
});
},
allprocess:function(){
postAction("/fileDataLink/processAllFile?dataLinkType=1",{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
} else {
this.$message.warning(res.message);
}
});
},
clearTableData:function (id){
var that = this;
deleteAction("/fileDataLink/clearTableData?id="+id,{}).then((res) => {
if (res.code == 200) {
this.$message.success(res.result);
}else{
this.$message.warning(res.message)
}
that.loadData();
});
},
handleDelete: function (id) {
var that = this;
deleteAction("/fileDataLink/delete?id="+id,{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
that.loadData();
} else {
this.$message.warning(res.message);
}
});
},
processFile: function (record) {
var that = this;
isDataLinkFileParsed({fileId:record.fileId}).then((res) => {
if (res) {
postAction("/fileDataLink/processFile?dataLinkId="+record.id,{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
that.loadData();
} else {
this.$message.warning(res.message);
}
});
} else {
this.$message.warning("解析中请勿重复点击");
}
});
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "文件上传";
this.$refs.modalForm.dataLinkType=this.queryParam.dataLinkType;
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,253 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="模式名称">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.schemaName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.tableName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24" >
<a-button type="primary" style="left: 10px" @click="loadData" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
<a-button type="primary" @click="handleAdd" icon="upload" style="margin-left: 8px;left: 10px">上传</a-button>
<a-button type="primary" @click="allprocess" icon="upload" style="margin-left: 8px;left: 10px">全部解析</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<div style="height:900px;overflow-y:auto;background: #e6e9f1;">
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
@change="handleTableChange">
<!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示-->
<template slot="parseStatus" slot-scope="text">
<span style="color:black;" v-if="text === 0" >未解析</span>
<span style="color:darkorange;" v-if="text === 1">解析中</span>
<span style="color:#87d068;" v-if="text === 2">解析完成</span>
<span style="color:red;" v-if="text === 3">解析失败</span>
<span style="color:royalblue;" v-if="text === 4">等待中</span>
</template>
<span slot="action" slot-scope="text, record">
<a @click="processFile(record)" >解析</a>
<a-divider type="vertical"/>
<a @click="clearTableData(record.id)">卸载</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<uploadModal ref="modalForm" @ok="loadData"></uploadModal>
</a-card>
</template>
<script>
import uploadModal from './modules/uploadModal'
import { getFileLinkInfo,processFile,fileDataLinkDelete,isDataLinkFileParsed } from '@/api/fileDataLink'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from "@/components/jeecg/JEllipsis";
import {deleteAction, postAction,getAction} from '@/api/manage'
export default {
name: "waterDocuments",
mixins:[JeecgListMixin],
components: {
uploadModal,
JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
},
},
data () {
return {
description: '文件接引',
dataSources: [],
queryParam: {
pageNum :1,
pageSize:20,
schemaName:'',
tableName:'',
dataLinkType:'4'
},
schemaName:"",
columns: [
{
title: '#',
dataIndex: '',
key:'id',
width:60,
align:"id",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '文件名称',
align:"fileName",
dataIndex: 'fileName',
},
{
title: '模式名称',
align:"schemaName",
dataIndex: 'schemaName'
},
{
title: '表名',
align:"tableName",
dataIndex: 'tableName',
},
{
title: '创建时间',
align:"createTime",
dataIndex: 'createTime'
},
{
title: '状态',
align:"center",
dataIndex: 'parseStatus',
scopedSlots: { customRender: 'parseStatus' },
},
{
title: '解析进度',
align:"center",
dataIndex: 'percent',
},
{
title: '解析时间开始',
align:"analyzeStartTime",
dataIndex: 'analyzeStartTime',
},
{
title: '解析时间完成',
align:"analyzeEndTime",
dataIndex: 'analyzeEndTime',
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width:180,
scopedSlots: { customRender: 'action' },
}
]
}
},
computed: {
},
created () {
this.loadData();
},
methods: {
//handleTableChange
handleTableChange(pagination, filters, sorter) {
//
//TODO
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
this.loadData();
},
loadData() {
getFileLinkInfo(this.queryParam).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
setTimeout(()=>{
this.loadData();
},5000)
if(res.result.total)
{
this.ipagination.total = res.result.total;
}
} else {
this.$message.warning(res.message);
}
});
},
allprocess:function(){
postAction("/fileDataLink/processAllFile?dataLinkType=1",{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
} else {
this.$message.warning(res.message);
}
});
},
clearTableData:function (id){
var that = this;
deleteAction("/fileDataLink/clearTableData?id="+id,{}).then((res) => {
if (res.code == 200) {
this.$message.success(res.result);
}else{
this.$message.warning(res.message)
}
that.loadData();
});
},
handleDelete: function (id) {
var that = this;
deleteAction("/fileDataLink/delete?id="+id,{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
that.loadData();
} else {
this.$message.warning(res.message);
}
});
},
processFile: function (record) {
var that = this;
isDataLinkFileParsed({fileId:record.fileId}).then((res) => {
if (res) {
postAction("/fileDataLink/processFile?dataLinkId="+record.id,{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
that.loadData();
} else {
this.$message.warning(res.message);
}
});
} else {
this.$message.warning("解析中请勿重复点击");
}
});
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "文件上传";
this.$refs.modalForm.dataLinkType=this.queryParam.dataLinkType;
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>