提交 131fe101 编写于 作者: 麦嘉得's avatar 麦嘉得

①消息组件(收件箱、草稿箱、消息审计)新增"类型"字段,分页功能

上级 b12b81b5
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
path: `${pre}assets_data_admin` path: `${pre}assets_data_admin`
}, },
{ {
title: '消息组件', title: '消息引擎',
path: `${pre}message` path: `${pre}message`
} }
/**{ /**{
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
</Table> </Table>
<Page <Page
style="margin-top: 30px; margin-bottom: 20px; text-align: center" style="margin-top: 30px; margin-bottom: 20px; text-align: center"
:crurent="tableContext.page.index"
:total="tableContext.page.total" :total="tableContext.page.total"
:page-size="tableContext.page.pageSize" :page-size="tableContext.page.pageSize"
:show-sizer="true" :show-sizer="true"
...@@ -110,6 +111,8 @@ ...@@ -110,6 +111,8 @@
next-text="下一页" next-text="下一页"
@on-change="handlePageChange" @on-change="handlePageChange"
@on-page-size-change="handleSizeChange" @on-page-size-change="handleSizeChange"
show-total
show-elevator
/> />
</div> </div>
</template> </template>
...@@ -163,10 +166,11 @@ export default { ...@@ -163,10 +166,11 @@ export default {
}, },
methods: { methods: {
handleSearch() { handleSearch() {
api.AuditList() api.AuditList({pageIndex:this.tableContext.page.index,pageSize:this.tableContext.page.pageSize})
.then(resp => { .then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
this.tableContext.data = resp.response.data; this.tableContext.data = resp.response.data;
this.tableContext.page.total=resp.response.data_count
} }
}) })
.finally(resp => { .finally(resp => {
...@@ -176,10 +180,12 @@ export default { ...@@ -176,10 +180,12 @@ export default {
handlePageChange(index) { handlePageChange(index) {
console.log(index); console.log(index);
this.tableContext.page.index = index; this.tableContext.page.index = index;
this.handleSearch();
}, },
handleSizeChange(size) { handleSizeChange(size) {
console.log(size); console.log(size);
this.tableContext.page.pageSize = size; this.tableContext.page.pageSize = size;
this.handleSearch();
}, },
handleSelectedRow(selectedRows, key) { handleSelectedRow(selectedRows, key) {
this.tableContext.subtotal = 0; this.tableContext.subtotal = 0;
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<Card shadow title="消息邮箱" :padding="0"> <Card shadow title="消息邮箱" :padding="0">
<CellGroup @on-click="handleChangeCell" class="ivu-pt-8 ivu-pb-8"> <CellGroup @on-click="handleChangeCell" class="ivu-pt-8 ivu-pb-8">
<Cell <Cell
title="收件箱" title="发件箱"
name="maintenanceType" name="maintenanceType"
label="收件箱" label="发件箱"
:selected="currentType === 'maintenanceType'" :selected="currentType === 'maintenanceType'"
/> />
<Cell <Cell
...@@ -103,4 +103,8 @@ export default { ...@@ -103,4 +103,8 @@ export default {
.main-container { .main-container {
height: 85vh; height: 85vh;
} }
.ivu-card {
font-size: 17px;
padding: 10px 0;
}
</style> </style>
\ No newline at end of file
...@@ -25,6 +25,13 @@ ...@@ -25,6 +25,13 @@
<!-- </Row>--> <!-- </Row>-->
<!--<Row>--> <!--<Row>-->
<!-- <Col span="24">--> <!-- <Col span="24">-->
<FormItem label="类型">
<Select v-model="formData.select_type">
<Option value="微信">微信</Option>
<Option value="短信">短信</Option>
<Option value="邮件">邮件</Option>
</Select>
</FormItem>
<FormItem label="内容" prop="remark"> <FormItem label="内容" prop="remark">
<Input <Input
v-model="formData.content" v-model="formData.content"
...@@ -94,6 +101,7 @@ ...@@ -94,6 +101,7 @@
</Table> </Table>
<Page <Page
style="margin-top: 30px; margin-bottom: 20px; text-align: center" style="margin-top: 30px; margin-bottom: 20px; text-align: center"
:crurent="tableContext.page.index"
:total="tableContext.page.total" :total="tableContext.page.total"
:page-size="tableContext.page.pageSize" :page-size="tableContext.page.pageSize"
:show-sizer="true" :show-sizer="true"
...@@ -102,6 +110,8 @@ ...@@ -102,6 +110,8 @@
next-text="下一页" next-text="下一页"
@on-change="handlePageChange" @on-change="handlePageChange"
@on-page-size-change="handleSizeChange" @on-page-size-change="handleSizeChange"
show-total
show-elevator
/> />
</div> </div>
</template> </template>
...@@ -137,6 +147,10 @@ export default { ...@@ -137,6 +147,10 @@ export default {
title: '主题', title: '主题',
key: 'titile' key: 'titile'
}, },
{
title: '类型',
key: 'msg_type'
},
{ {
title: '内容', title: '内容',
key: 'content' key: 'content'
...@@ -155,10 +169,11 @@ export default { ...@@ -155,10 +169,11 @@ export default {
}, },
methods: { methods: {
handleSearch() { handleSearch() {
api.MsgList() api.MsgList({pageIndex:this.tableContext.page.index,pageSize:this.tableContext.page.pageSize})
.then(resp => { .then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
this.tableContext.data = resp.response.data; this.tableContext.data = resp.response.data;
this.tableContext.page.total=resp.response.data_count
} }
}) })
.finally(resp => { .finally(resp => {
...@@ -168,10 +183,12 @@ export default { ...@@ -168,10 +183,12 @@ export default {
handlePageChange(index) { handlePageChange(index) {
console.log(index); console.log(index);
this.tableContext.page.index = index; this.tableContext.page.index = index;
this.handleSearch();
}, },
handleSizeChange(size) { handleSizeChange(size) {
console.log(size); console.log(size);
this.tableContext.page.pageSize = size; this.tableContext.page.pageSize = size;
this.handleSearch();
}, },
handleSelectedRow(selectedRows, key) { handleSelectedRow(selectedRows, key) {
this.tableContext.subtotal = 0; this.tableContext.subtotal = 0;
...@@ -210,8 +227,8 @@ export default { ...@@ -210,8 +227,8 @@ export default {
}); });
}, },
handledraft() { handledraft() {
console.log(this.formData.select_type);
api.DraftAdd({title:this.formData.send_title,receive_ids:this.formData.send_name.split(","),content:this.formData.content}).then(resp => { api.DraftAdd({title:this.formData.send_title,msg_type:this.formData.select_type,receive_ids:this.formData.send_name.split(","),content:this.formData.content}).then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
this.$Message.success('保存草稿成功'); this.$Message.success('保存草稿成功');
this.handleSearch(); this.handleSearch();
...@@ -222,7 +239,7 @@ export default { ...@@ -222,7 +239,7 @@ export default {
}, },
handleSubmit() { handleSubmit() {
api.MsgSend({title:this.formData.send_title,receive_ids:this.formData.send_name.split(","),content:this.formData.content}).then(resp => { api.MsgSend({title:this.formData.send_title,msg_type:this.formData.select_type,receive_ids:this.formData.send_name.split(","),content:this.formData.content}).then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
this.$Message.success('发送成功'); this.$Message.success('发送成功');
this.handleSearch(); this.handleSearch();
......
...@@ -25,6 +25,13 @@ ...@@ -25,6 +25,13 @@
<!-- </Row>--> <!-- </Row>-->
<!--<Row>--> <!--<Row>-->
<!-- <Col span="24">--> <!-- <Col span="24">-->
<FormItem label="类型">
<Select v-model="formData.select_type">
<Option value="微信">微信</Option>
<Option value="短信">短信</Option>
<Option value="邮件">邮件</Option>
</Select>
</FormItem>
<FormItem label="内容" prop="remark"> <FormItem label="内容" prop="remark">
<Input <Input
v-model="formData.content" v-model="formData.content"
...@@ -94,6 +101,7 @@ ...@@ -94,6 +101,7 @@
</Table> </Table>
<Page <Page
style="margin-top: 30px; margin-bottom: 20px; text-align: center" style="margin-top: 30px; margin-bottom: 20px; text-align: center"
:crurent="tableContext.page.index"
:total="tableContext.page.total" :total="tableContext.page.total"
:page-size="tableContext.page.pageSize" :page-size="tableContext.page.pageSize"
:show-sizer="true" :show-sizer="true"
...@@ -102,6 +110,8 @@ ...@@ -102,6 +110,8 @@
next-text="下一页" next-text="下一页"
@on-change="handlePageChange" @on-change="handlePageChange"
@on-page-size-change="handleSizeChange" @on-page-size-change="handleSizeChange"
show-total
show-elevator
/> />
</div> </div>
</template> </template>
...@@ -137,6 +147,10 @@ export default { ...@@ -137,6 +147,10 @@ export default {
title: '主题', title: '主题',
key: 'title' key: 'title'
}, },
{
title: '类型',
key: 'msg_type'
},
{ {
title: '内容', title: '内容',
key: 'content' key: 'content'
...@@ -155,10 +169,11 @@ export default { ...@@ -155,10 +169,11 @@ export default {
}, },
methods: { methods: {
handleSearch() { handleSearch() {
api.DraftList() api.DraftList({pageIndex:this.tableContext.page.index,pageSize:this.tableContext.page.pageSize})
.then(resp => { .then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
this.tableContext.data = resp.response.data; this.tableContext.data = resp.response.data;
this.tableContext.page.total=resp.response.data_count
} }
}) })
.finally(resp => { .finally(resp => {
...@@ -168,10 +183,12 @@ export default { ...@@ -168,10 +183,12 @@ export default {
handlePageChange(index) { handlePageChange(index) {
console.log(index); console.log(index);
this.tableContext.page.index = index; this.tableContext.page.index = index;
this.handleSearch();
}, },
handleSizeChange(size) { handleSizeChange(size) {
console.log(size); console.log(size);
this.tableContext.page.pageSize = size; this.tableContext.page.pageSize = size;
this.handleSearch();
}, },
handleSelectedRow(selectedRows, key) { handleSelectedRow(selectedRows, key) {
this.tableContext.subtotal = 0; this.tableContext.subtotal = 0;
...@@ -212,7 +229,7 @@ export default { ...@@ -212,7 +229,7 @@ export default {
handleSubmit() { handleSubmit() {
api.MsgSend({title:this.formData.send_title,receive_ids:this.formData.send_name.split(","),content:this.formData.content,draft_id:this.formData.id}).then(resp => { api.MsgSend({title:this.formData.send_title,msg_type:this.formData.select_type,receive_ids:this.formData.send_name.split(","),content:this.formData.content,draft_id:this.formData.id}).then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
this.$Message.success('发送成功'); this.$Message.success('发送成功');
this.handleSearch(); this.handleSearch();
...@@ -255,6 +272,7 @@ export default { ...@@ -255,6 +272,7 @@ export default {
this.formData.id = data.id; this.formData.id = data.id;
this.formData.send_name = data.user_id; this.formData.send_name = data.user_id;
this.formData.send_title = data.title; this.formData.send_title = data.title;
this.formData.select_type=data.msg_type;
this.formData.content = data.content; this.formData.content = data.content;
}, },
handleCloseUpdateModal() { handleCloseUpdateModal() {
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或