|
|
|
|
@ -8,25 +8,38 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<Table :height="tableHeight" :loading="loading" size="small" :data="/^\/system/.test(this.$route.path) ? example : list" :columns="table"></Table>
|
|
|
|
|
<Table
|
|
|
|
|
:height="tableHeight"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
size="small"
|
|
|
|
|
:data="/^\/system/.test(this.$route.path) ? example : list"
|
|
|
|
|
:columns="table"
|
|
|
|
|
></Table>
|
|
|
|
|
|
|
|
|
|
<div ref="todo-page" style="display: flex; justify-content: center; margin: 10px 0">
|
|
|
|
|
<Page :total="/^\/system/.test(this.$route.path) ? example.length : total"
|
|
|
|
|
size="small"
|
|
|
|
|
show-elevator
|
|
|
|
|
show-total
|
|
|
|
|
@on-change="e => {
|
|
|
|
|
select.page = e;
|
|
|
|
|
getNotices();
|
|
|
|
|
}"/>
|
|
|
|
|
<div
|
|
|
|
|
ref="todo-page"
|
|
|
|
|
style="display: flex; justify-content: center; margin: 10px 0"
|
|
|
|
|
>
|
|
|
|
|
<Page
|
|
|
|
|
:total="/^\/system/.test(this.$route.path) ? example.length : total"
|
|
|
|
|
size="small"
|
|
|
|
|
show-elevator
|
|
|
|
|
show-total
|
|
|
|
|
@on-change="
|
|
|
|
|
(e) => {
|
|
|
|
|
select.page = e;
|
|
|
|
|
getNotices();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getNotice, readNotice } from '@/api/dashboard/notice'
|
|
|
|
|
import ElementResize from 'element-resize-detector'
|
|
|
|
|
import { getNotice2, readNotice } from "@/api/dashboard/notice";
|
|
|
|
|
import ElementResize from "element-resize-detector";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "card2",
|
|
|
|
|
@ -40,23 +53,29 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
example:[
|
|
|
|
|
window: {
|
|
|
|
|
width: 0,
|
|
|
|
|
height: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
},
|
|
|
|
|
example: [
|
|
|
|
|
{
|
|
|
|
|
type: 1,
|
|
|
|
|
content: "示例1",
|
|
|
|
|
created_at:this.$moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
read_count: true
|
|
|
|
|
created_at: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
read_count: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 2,
|
|
|
|
|
content: "示例2",
|
|
|
|
|
created_at:this.$moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
read_count: false
|
|
|
|
|
}
|
|
|
|
|
created_at: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
read_count: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
select:{
|
|
|
|
|
select: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10
|
|
|
|
|
page_size: 10,
|
|
|
|
|
},
|
|
|
|
|
tableHeight: 120,
|
|
|
|
|
loading: false,
|
|
|
|
|
@ -67,14 +86,18 @@ export default {
|
|
|
|
|
type: "index",
|
|
|
|
|
title: "序号",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: 64
|
|
|
|
|
width: 64,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "类型",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: 100,
|
|
|
|
|
render: (h, { row }) => {
|
|
|
|
|
return h("span", {}, row.type === 1 ? "合同流程" : "付款计划");
|
|
|
|
|
let map = new Map([
|
|
|
|
|
["szemcold", "审批流转"],
|
|
|
|
|
["contract", "预算绩效"],
|
|
|
|
|
]);
|
|
|
|
|
return h("span", {}, map.get(row.from_type));
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@ -83,94 +106,140 @@ export default {
|
|
|
|
|
align: "left",
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
tooltip: true,
|
|
|
|
|
minWidth: 120
|
|
|
|
|
minWidth: 120,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "下发时间",
|
|
|
|
|
key: "created_at",
|
|
|
|
|
width: 180,
|
|
|
|
|
align: "center"
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "状态",
|
|
|
|
|
key: "read_count",
|
|
|
|
|
title: "查看",
|
|
|
|
|
key: "show",
|
|
|
|
|
width: 120,
|
|
|
|
|
render: (h, { row }) => {
|
|
|
|
|
return row.read_count
|
|
|
|
|
? h(
|
|
|
|
|
"el-link",
|
|
|
|
|
{
|
|
|
|
|
props: {
|
|
|
|
|
type: "success",
|
|
|
|
|
underline: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"已读"
|
|
|
|
|
)
|
|
|
|
|
: h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: {
|
|
|
|
|
type: "error",
|
|
|
|
|
size: "small",
|
|
|
|
|
ghost: true
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
['click']:e => {
|
|
|
|
|
if(/^\/system/.test(this.$route.path)) return
|
|
|
|
|
|
|
|
|
|
readNotice({
|
|
|
|
|
id: row.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '已读'
|
|
|
|
|
})
|
|
|
|
|
this.getNotices()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: {
|
|
|
|
|
type: "primary",
|
|
|
|
|
size: "small",
|
|
|
|
|
ghost: true,
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
["click"]: (_) => {
|
|
|
|
|
if (row.from_type === "szemcold") {
|
|
|
|
|
window.open(
|
|
|
|
|
`${process.env.VUE_APP_OUT_OLD}/index.php?s=/flow/edit/id/${row.id}&username=${this.$store.state.user.username}`,
|
|
|
|
|
"edit",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(row.from_type === 'contract') {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/contract/contract/contractList',
|
|
|
|
|
query: {
|
|
|
|
|
keyword:/\[(.*?)\]/.exec(row.content) ? /\[(.*?)\]/.exec(row.content)[1] : ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"未读"
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"查看"
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// title: "状态",
|
|
|
|
|
// key: "read_count",
|
|
|
|
|
// width: 120,
|
|
|
|
|
// render: (h, { row }) => {
|
|
|
|
|
// return row.read_count
|
|
|
|
|
// ? h(
|
|
|
|
|
// "el-link",
|
|
|
|
|
// {
|
|
|
|
|
// props: {
|
|
|
|
|
// type: "success",
|
|
|
|
|
// underline: false,
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// "已读"
|
|
|
|
|
// )
|
|
|
|
|
// : h(
|
|
|
|
|
// "Button",
|
|
|
|
|
// {
|
|
|
|
|
// props: {
|
|
|
|
|
// type: "error",
|
|
|
|
|
// size: "small",
|
|
|
|
|
// ghost: true
|
|
|
|
|
// },
|
|
|
|
|
// on: {
|
|
|
|
|
// ['click']:e => {
|
|
|
|
|
// if(/^\/system/.test(this.$route.path)) return
|
|
|
|
|
//
|
|
|
|
|
// readNotice({
|
|
|
|
|
// id: row.id
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// type: 'success',
|
|
|
|
|
// message: '已读'
|
|
|
|
|
// })
|
|
|
|
|
// this.getNotices()
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// "未读"
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getNotices() {
|
|
|
|
|
if(/^\/system/.test(this.$route.path)) return
|
|
|
|
|
try{
|
|
|
|
|
this.loading = true
|
|
|
|
|
const res = await getNotice(this.select,true);
|
|
|
|
|
this.list = res.data;
|
|
|
|
|
this.total = res.total;
|
|
|
|
|
this.loading = false
|
|
|
|
|
}catch (e) {
|
|
|
|
|
this.loading = false
|
|
|
|
|
if (/^\/system/.test(this.$route.path)) return;
|
|
|
|
|
try {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const res = await getNotice2(this.select, true);
|
|
|
|
|
this.list = res;
|
|
|
|
|
this.total = res.length;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
init() {
|
|
|
|
|
let cardDom = document.getElementById('todo-card');
|
|
|
|
|
let cardDom = document.getElementById("todo-card");
|
|
|
|
|
let cardTitleH = 58;
|
|
|
|
|
let page = this.$refs['todo-page']
|
|
|
|
|
let page = this.$refs["todo-page"];
|
|
|
|
|
const elementResize = ElementResize({
|
|
|
|
|
strategy:'scroll'
|
|
|
|
|
})
|
|
|
|
|
elementResize.listenTo(cardDom,ele => {
|
|
|
|
|
this.tableHeight = cardDom.getBoundingClientRect().height - 40 - cardTitleH - page.getBoundingClientRect().height
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
strategy: "scroll",
|
|
|
|
|
});
|
|
|
|
|
elementResize.listenTo(cardDom, (ele) => {
|
|
|
|
|
this.tableHeight =
|
|
|
|
|
cardDom.getBoundingClientRect().height -
|
|
|
|
|
40 -
|
|
|
|
|
cardTitleH -
|
|
|
|
|
page.getBoundingClientRect().height;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.window.width = screen.availWidth * 0.95;
|
|
|
|
|
this.window.height = screen.availHeight * 0.95;
|
|
|
|
|
this.window.top = (window.screen.height - 30 - this.window.height) / 2;
|
|
|
|
|
this.window.left = (window.screen.width - 10 - this.window.width) / 2;
|
|
|
|
|
this.getNotices();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.init();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|