|
@@ -187,6 +187,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+// const signalR=require('@microsoft/signalr')
|
|
// import * as signalR from "@microsoft/signalr";
|
|
// import * as signalR from "@microsoft/signalr";
|
|
// import * as signalR from "../../node_modules/microso";
|
|
// import * as signalR from "../../node_modules/microso";
|
|
// import child from '~/components/Finance/FeesPage';
|
|
// import child from '~/components/Finance/FeesPage';
|
|
@@ -309,6 +310,32 @@ export default {
|
|
console.log('测试');
|
|
console.log('测试');
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ //消息通知
|
|
|
|
+ PostTaskAllocationInit(){
|
|
|
|
+ var url = "/api/PersonnelModule/PostTaskAllocationInit"
|
|
|
|
+ var that = this
|
|
|
|
+ this.$axios({
|
|
|
|
+ method: 'post',
|
|
|
|
+ url: url,
|
|
|
|
+ headers: {
|
|
|
|
+ Authorization: 'Bearer ' + that.userId
|
|
|
|
+ },
|
|
|
|
+ data:{
|
|
|
|
+ portType:1,
|
|
|
|
+ userId: 5
|
|
|
|
+ }
|
|
|
|
+ }).then(function (res) {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if(res.data.code==200){
|
|
|
|
+ that.persolist=res.data.data.executeTaskUserInfos;
|
|
|
|
+ that.PostTaskAllocationDetails()
|
|
|
|
+ }else{
|
|
|
|
+ that.$message.error(res.data.msg);
|
|
|
|
+ }
|
|
|
|
+ }).catch(function (error) {
|
|
|
|
+ that.$message.error("获取数据源失败!");
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
|
|
//实时通讯
|
|
//实时通讯
|
|
// async startConnection() {
|
|
// async startConnection() {
|
|
@@ -342,12 +369,17 @@ export default {
|
|
this.radioChange(false);
|
|
this.radioChange(false);
|
|
this.ifIndexValue();
|
|
this.ifIndexValue();
|
|
this.getmenu();
|
|
this.getmenu();
|
|
|
|
+ console.log(this.$store.state.webSocketMsg)
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.userinif = JSON.parse(localStorage.getItem('userinif'));
|
|
this.userinif = JSON.parse(localStorage.getItem('userinif'));
|
|
|
|
+
|
|
// this.startConnection();
|
|
// this.startConnection();
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ getWsMsg (){
|
|
|
|
+ return this.$store.state.webSocketMsg
|
|
|
|
+ },
|
|
filmenuList: function () {
|
|
filmenuList: function () {
|
|
return this.menuList.filter(function (item) {
|
|
return this.menuList.filter(function (item) {
|
|
if (item.modulName == '主页') {
|
|
if (item.modulName == '主页') {
|
|
@@ -362,6 +394,14 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ watch:{
|
|
|
|
+ getWsMsg:{
|
|
|
|
+ handler: function(newVal) {
|
|
|
|
+ console.log(newVal)
|
|
|
|
+ alert('接收到webSocket推送'+ newVal)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|