Commit d0fed9dc authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents b543d5d8 e3f5caeb
<template>
<span class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in">
<Notification
:wide="isMobile"
:badge-props="badgeProps"
class="i-layout-header-notice"
:class="{ 'i-layout-header-notice-mobile': isMobile }">
<Icon slot="icon" custom="i-icon i-icon-notification" />
<NotificationTab title="消息">
fdsafafafsafafd
</NotificationTab>
<!-- <NotificationTab title="待办">
</NotificationTab>
<NotificationTab title="通知">
</NotificationTab> -->
</Notification>
<Modal
v-model="modal"
title="msg.title"
>
<div>
<Row>
<Col :span="12">
发送时间:{{msg.time}}
</Col>
</Row>
<div class="content">
{{msg.content}}
</div>
</div>
</Modal>
</span>
<span
class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-con"
>
<Notification auto-count @on-load-more="handleLoadMore" @on-clear="handleClear">
<NotificationTab title="通知" name="message" :count="unreadMessage" :loading="messageLoading">
<NotificationItem
v-for="(item, index) in messages"
:key="index"
:class="item.msg?'con_bord':''"
:title="item.title"
:icon="item.icon||'md-mail'"
:icon-color="item.iconColor||'#2680eb'"
:time="item.creationTime"
@click.native="clickItem(item,index)"
/>
<!-- :read="item.content" -->
<div slot="clear">历史消息</div>
</NotificationTab>
</Notification>
<Modal v-model="modal1" :title="msg.title">
<p class="content-in">发送时间:{{msg.creationTime}}</p>
<p class="content-in">{{msg.content}}</p>
<div slot="footer">
<Button type="primary" @click="modal1=false">取消</Button>
</div>
</Modal>
</span>
</template>
<script>
import { mapState } from 'vuex';
import { mapState } from "vuex";
export default {
name: 'iHeaderNotice',
data () {
return {
badgeProps: {
offset: [20, 0]
},
modal:false,
msg:{}
}
},
computed: {
...mapState('admin/layout', [
'isMobile'
])
},
mounted(){
setInterval(()=>{
this.$store.dispatch("loadMessages");
},30*1000)
}
}
export default {
name: "iHeaderNotice",
data() {
return {
messageList: [],
messageLoading: false,
badgeProps: {
offset: [20, 0],
},
modal1: false,
msg: {},
};
},
computed: {
// ...mapState("admin/layout", ["isMobile"]),
...mapState({ messages: "messages" }),
unreadMessage() {
let unread = 0;
this.messages.forEach((item) => {
if (!item.read) unread++;
});
return unread;
},
},
async fetch({ store, params }) {
await store.dispatch("loadMessages"); // 加载数据字典
},
mounted() {
// this.messageList = [...this.messages];
// console.log(this.messages);
},
methods: {
handleLoadMore(tab) {
this.loadMore(tab.name);
},
loadMore(type) {
if (this[`${type}Loading`]) return;
this[`${type}Loading`] = true;
setTimeout(() => {
this[`${type}List`] = this[`${type}List`].concat([
...this[`${type}BaseList`],
]);
this[`${type}Loading`] = false;
}, 1000);
},
handleClear(tab) {
this.$router.push("/home/msgRecord");
},
clickItem(item, i) {
this.modal1 = true;
this.msg = item;
item.iconColor = "#ccc";
item.msg = true;
let url = `${systemUrl}/usermessage/read`;
this.$api.post(url, item).then((r) => {
//消息转为已读
// this.msg = r.result;
setInterval(() => {
this.$store.dispatch("loadMessages");
}, 30 * 1000);
});
},
},
};
</script>
<style lang="less">
.i-con .ivu-badge-count {
top: 0 !important;
}
.content-in {
height: 30px;
}
.con_bord {
.ivu-time {
color: #ccc;
}
h4 {
color: #ccc;
}
}
</style>
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入消息标题" v-model="easySearch.keys.value" v-width="260" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component
:is="detail"
:eid="curId"
:cartList="this.$u.clone(this.$store.state.cart)"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</div>
</template>
<script>
// import Api from "./api";
export default {
name: "Add",
data() {
return {
action: "", //Api.index1
easySearch: {
keys: { op: "serialNumber,customer", value: null },
},
detail: null,
dataList: [],
curId: 0,
modal: false,
title: "归还",
columns: [
{
type: "index",
width: 70,
align: "center",
},
{
title: "标题",
key: "serialNumber",
},
{
key: "creationTime",
title: "接受时间",
},
{
title: "接受人",
key: "libraryTube",
},
{
title: "发送人",
key: "customer",
},
{
title: "状态",
key: "status",
code: "resource.record.status",
},
// {
// title: this.l("action"),
// key: "action",
// width: 150,
// align: "center",
// render: (h, params) => {
// return h("div", { class: "action" }, [
// h(
// "a",
// {
// class: "details",
// on: { click: () => this.details(params.row.id) },
// },
// params.row.status == 0 ? "归还" : ""
// ),
// ]);
// },
// },
],
name: "",
resource: [],
selectList: [],
libraryTube: this.$store.state.userInfo.userName, //库管员
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
props: {},
mounted() {},
methods: {
details(id) {
this.curId = id;
// this.detail = () => import("./return");
this.modal = true;
},
handleClose() {
this.$emit("on-close");
},
selectInfo(value) {
this.selectList = [];
this.selectList = value;
},
l(key) {
let vkey = "resource" + "." + key;
return this.$t(vkey) || key;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
cancel() {
this.curId = 0;
this.modal = false;
},
},
watch: {},
};
</script>
<style>
</style>
\ No newline at end of file
......@@ -24,17 +24,17 @@
<Col :span="12">
<FormItem :label="l('levelNum')" prop="levelNum">
<InputNumber v-model="entity.levelNum" disabled :max="10" :min="1"></InputNumber>
<InputNumber v-model="entity.levelNum" :max="10" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('codeLength')" prop="codeLength">
<InputNumber v-model="entity.codeLength" disabled :max="5" :min="1"></InputNumber>
<InputNumber v-model="entity.codeLength" :max="5" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialCodeLength')" prop="materialCodeLength">
<InputNumber v-model="entity.materialCodeLength" disabled :max="10" :min="1"></InputNumber>
<InputNumber v-model="entity.materialCodeLength" :max="10" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
......
This diff is collapsed.
import createVuexAlong from 'vuex-along'
import Api from '@/plugins/request'
import Mock from 'mockjs'
// import Mock from 'mockjs'
export const state = () => ({
counter: 0,
dictionary: new Map(), //所有字典项
......@@ -104,16 +104,22 @@ export const mutations = {
export const actions = {
async loadMessages({commit}){
let data=Mock.mock({
"result|1-30":[{
id:"@guid",
title:"@csentence",
content:"@cparagraph(2,8)",
read:"@boolean",
time:"@datetime"
}]
})
commit("setMessages", data.result);
let {
result
} = await Api.get(`${systemUrl}/usermessage/getusermesssage`, {
status: 0
});
commit("setMessages", result);
// let data=Mock.mock({
// "result|1-30":[{
// id:"@guid",
// title:"@csentence",
// content:"@cparagraph(2,8)",
// read:"@boolean",
// time:"@datetime"
// }]
// })
// commit("setMessages", data.result);
},
async collectList({
commit
......@@ -122,7 +128,7 @@ export const actions = {
let {
result
} = await Api.post(`${systemUrl}/favorite/listbyuser`);
console.warn("result", result)
commit("setCollect", result);
},
async loadUser({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment