添加发布到专题库页面
This commit is contained in:
parent
e3ffcfc9d1
commit
5f901b9536
|
@ -31,7 +31,7 @@
|
||||||
<div class="header-nowTime" :style="topMenuStyle.headerIndexLeft">末端数据接入处理系统</div>
|
<div class="header-nowTime" :style="topMenuStyle.headerIndexLeft">末端数据接入处理系统</div>
|
||||||
<div class="header-index-center" :style="topMenuStyle.headerIndexCenter">
|
<div class="header-index-center" :style="topMenuStyle.headerIndexCenter">
|
||||||
<div class="header-index-wide">
|
<div class="header-index-wide">
|
||||||
<div class="header-index-center" :style="topMenuStyle.headerIndexLeft">
|
<div class="header-index-center" :style="topMenuStyle.topmenuCenter">
|
||||||
<s-menu mode="horizontal" :menu="menus" :theme="theme"></s-menu>
|
<s-menu mode="horizontal" :menu="menus" :theme="theme"></s-menu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
123
src/views/data/dataManage.vue
Normal file
123
src/views/data/dataManage.vue
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
<template>
|
||||||
|
<a-card :bordered="false">
|
||||||
|
|
||||||
|
<!-- 查询区域 -->
|
||||||
|
<div class="table-page-search-wrapper">
|
||||||
|
<a-form layout="inline">
|
||||||
|
<a-row :gutter="30">
|
||||||
|
|
||||||
|
<a-col :md="6" :sm="10" >
|
||||||
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||||
|
<a-button @click="dataAdd" type="primary" v-has="'cont:btn'" icon="plus">发布到专题库</a-button>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- table区域-begin -->
|
||||||
|
<div style="height:900px;overflow-y:auto;">
|
||||||
|
<a-progress :percent="percent" status="active" />
|
||||||
|
<a-list bordered :data-source="contentList">
|
||||||
|
<template #renderItem="{ item }">
|
||||||
|
<a-list-item>{{ item }}</a-list-item>
|
||||||
|
</template>
|
||||||
|
</a-list>
|
||||||
|
</div>
|
||||||
|
<!-- table区域-end -->
|
||||||
|
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||||
|
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||||
|
import {getAction} from '@/api/manage'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "dataManage",
|
||||||
|
mixins:[JeecgListMixin],
|
||||||
|
components: {
|
||||||
|
taskModal,
|
||||||
|
JEllipsis,
|
||||||
|
contentList:[],
|
||||||
|
percent:0,
|
||||||
|
VNodes: {
|
||||||
|
functional: true,
|
||||||
|
render: (h, ctx) => ctx.props.vnodes,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
description: '数据发布',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
//初始化websocket
|
||||||
|
this.initWebSocket()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
destroyed: function () { // 离开页面生命周期函数
|
||||||
|
this.websocketclose();
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initWebSocket: function () {
|
||||||
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
|
var userId = store.getters.userInfo.id;
|
||||||
|
var url = window._CONFIG['domianURL'].replace("https://","ws://").replace("http://","ws://")+"/websocket/1/data_distribute";
|
||||||
|
this.websock = new WebSocket(url);
|
||||||
|
this.websock.onopen = this.websocketonopen;
|
||||||
|
this.websock.onerror = this.websocketonerror;
|
||||||
|
this.websock.onmessage = this.websocketonmessage;
|
||||||
|
this.websock.onclose = this.websocketclose;
|
||||||
|
},
|
||||||
|
websocketonopen: function () {
|
||||||
|
console.log("WebSocket连接成功");
|
||||||
|
},
|
||||||
|
websocketonerror: function (e) {
|
||||||
|
console.log("WebSocket连接发生错误");
|
||||||
|
},
|
||||||
|
websocketonmessage: function (e) {
|
||||||
|
var data = eval("(" + e.data + ")");
|
||||||
|
console.log(e);
|
||||||
|
//处理订阅信息
|
||||||
|
this.contentList.push(data.content);
|
||||||
|
this.percent = data.currProgress
|
||||||
|
},
|
||||||
|
websocketclose: function (e) {
|
||||||
|
console.log("connection closed (" + e.code + ")");
|
||||||
|
},
|
||||||
|
dataAdd(){
|
||||||
|
getAction("/dataSpecial/special").then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadData() {
|
||||||
|
taskPageList(this.queryParam).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.dataSource = res.result.rows||res.result;
|
||||||
|
if(res.result.total)
|
||||||
|
{
|
||||||
|
this.ipagination.total = res.result.total;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user