Commit a9c0f871 authored by chenqikuai's avatar chenqikuai

fix(src\views\root\msg\index.vue): 修复消息管理查看消息弹出框样式问题

fix #200
parent 1cb0d6cf
<template> <template>
<div> <div>
<p class=" text-2xl font-bold mb-5">消息管理</p> <p class="text-2xl font-bold mb-5">消息管理</p>
<!-- 消息分类 --> <!-- 消息分类 -->
<span class=" mr-3">消息分类</span> <span class="mr-3">消息分类</span>
<a-select :default-value="1" style="width: 120px; margin-right:10px;" v-model="types"> <a-select :default-value="1" style="width: 120px; margin-right: 10px" v-model="types">
<a-select-option v-for="type in msgType" :key="type.value">{{ type.label }}</a-select-option> <a-select-option v-for="type in msgType" :key="type.value">{{ type.label }}</a-select-option>
</a-select> </a-select>
<!-- 操作 --> <!-- 操作 -->
<a-button type="primary" style=" margin-right:10px;" @click="query">查询</a-button> <a-button type="primary" style="margin-right: 10px" @click="query">查询</a-button>
<a-button type="primary" style=" margin-right:10px;" @click="publish">新增</a-button> <a-button type="primary" style="margin-right: 10px" @click="publish">新增</a-button>
<!-- 新增弹窗 --> <!-- 新增弹窗 -->
<a-modal v-model="show" title="新增消息" :centered="true" footer=""> <a-modal v-model="show" title="新增消息" :centered="true" footer="">
<a-form-model <a-form-model
...@@ -36,14 +36,13 @@ ...@@ -36,14 +36,13 @@
</a-form-model-item> </a-form-model-item>
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }"> <a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="onSubmit">确认</a-button> <a-button type="primary" @click="onSubmit">确认</a-button>
<a-button style="margin-left: 10px;" @click="resetForm">重置</a-button> <a-button style="margin-left: 10px" @click="resetForm">重置</a-button>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</a-modal> </a-modal>
<!-- 内容弹窗 --> <!-- 内容弹窗 -->
<a-modal v-model="visible" title="查看内容" @ok="handleOk" footer="" :centered="true"> <a-modal v-model="visible" :title="current.title" @ok="handleOk" footer="" :centered="true">
<p class=" text-center text-lg">{{ current.title }}</p> <p class="text-base text-center">{{ current.content }}</p>
<p class=" text-base">{{ current.content }}</p>
</a-modal> </a-modal>
<!-- 消息列表 --> <!-- 消息列表 -->
<a-table <a-table
...@@ -51,7 +50,7 @@ ...@@ -51,7 +50,7 @@
:data-source="list" :data-source="list"
rowKey="uuid" rowKey="uuid"
:loading="tableLoading" :loading="tableLoading"
style=" text-align: center; margin-top:40px;" style="text-align: center; margin-top: 40px"
bordered bordered
:pagination="pagination" :pagination="pagination"
@change="tableChange" @change="tableChange"
...@@ -74,20 +73,12 @@ ...@@ -74,20 +73,12 @@
</span> </span>
<!-- 操作 --> <!-- 操作 -->
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a v-if="record.notify_status == 1" @click="add(record)"> <a v-if="record.notify_status == 1" @click="add(record)"> 上架 </a>
上架 <a v-else @click="remove(record)"> 下架 </a>
</a>
<a v-else @click="remove(record)">
下架
</a>
<a-divider v-show="record.notify_status === 1" type="vertical" /> <a-divider v-show="record.notify_status === 1" type="vertical" />
<a v-show="record.notify_status === 1" @click="onEdit(record)"> <a v-show="record.notify_status === 1" @click="onEdit(record)"> 编辑 </a>
编辑
</a>
<a-divider v-show="record.notify_status === 1" type="vertical" /> <a-divider v-show="record.notify_status === 1" type="vertical" />
<a v-if="record.notify_status == 1" @click="onDelete(record)"> <a v-if="record.notify_status == 1" @click="onDelete(record)"> 删除 </a>
删除
</a>
</span> </span>
</a-table> </a-table>
<!-- 操作Modal --> <!-- 操作Modal -->
...@@ -99,7 +90,7 @@ ...@@ -99,7 +90,7 @@
@ok="onOk" @ok="onOk"
@cancle="show = false" @cancle="show = false"
> >
<p class=" text-center">{{ text }}</p> <p class="text-center">{{ text }}</p>
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -158,7 +149,7 @@ export default Vue.extend({ ...@@ -158,7 +149,7 @@ export default Vue.extend({
notify_status: 0, notify_status: 0,
notify_type: this.types, notify_type: this.types,
}) })
.then(res => { .then((res) => {
this.list = res.data.items this.list = res.data.items
this.pagination.total = res.data.total this.pagination.total = res.data.total
this.tableLoading = false this.tableLoading = false
...@@ -211,7 +202,7 @@ export default Vue.extend({ ...@@ -211,7 +202,7 @@ export default Vue.extend({
notify_status: status, notify_status: status,
uuid: this.uuid, uuid: this.uuid,
}) })
.then(res => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
message.success(msg) message.success(msg)
this.getList() this.getList()
...@@ -219,7 +210,7 @@ export default Vue.extend({ ...@@ -219,7 +210,7 @@ export default Vue.extend({
}) })
}, },
removeNotify() { removeNotify() {
notify.removeNotify(this.uuid).then(res => { notify.removeNotify(this.uuid).then((res) => {
if (res.code === 200) { if (res.code === 200) {
message.success('删除成功') message.success('删除成功')
this.getList() this.getList()
...@@ -264,7 +255,7 @@ export default Vue.extend({ ...@@ -264,7 +255,7 @@ export default Vue.extend({
notify_type: this.form.type, notify_type: this.form.type,
title: this.form.title, title: this.form.title,
}) })
.then(res => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
message.success('新增成功') message.success('新增成功')
this.show = false this.show = false
...@@ -280,7 +271,7 @@ export default Vue.extend({ ...@@ -280,7 +271,7 @@ export default Vue.extend({
title: this.form.title, title: this.form.title,
uuid: this.uuid, uuid: this.uuid,
}) })
.then(res => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
message.success('编辑成功') message.success('编辑成功')
this.show = false this.show = false
...@@ -289,7 +280,7 @@ export default Vue.extend({ ...@@ -289,7 +280,7 @@ export default Vue.extend({
}) })
}, },
onSubmit() { onSubmit() {
;(this.$refs.ruleForm as FormModel).validate(valid => { ;(this.$refs.ruleForm as FormModel).validate((valid) => {
if (valid) { if (valid) {
if (this.btnType === 'add') { if (this.btnType === 'add') {
this.addNotice() this.addNotice()
...@@ -306,7 +297,7 @@ export default Vue.extend({ ...@@ -306,7 +297,7 @@ export default Vue.extend({
let form = this.form let form = this.form
;(form.title = ''), (form.content = '') ;(form.title = ''), (form.content = '')
type formtype = keyof typeof form type formtype = keyof typeof form
Object.keys(this.form).forEach(m => { Object.keys(this.form).forEach((m) => {
// this.form[m as formtype] = '' // this.form[m as formtype] = ''
}) })
this.form['type'] = 1 this.form['type'] = 1
...@@ -314,12 +305,9 @@ export default Vue.extend({ ...@@ -314,12 +305,9 @@ export default Vue.extend({
}, },
data() { data() {
const rules = { const rules = {
// module: [ type: [{ required: true, message: '请选择消息分类' }],
// { required: true, message: '请输入模板名称', trigger: 'blur' }, title: [{ required: true, message: '请输入消息标题' }],
// ], content: [{ required: true, message: '请输入消息内容' }],
type: [{ required: true, message: '请选择消息分类', trigger: 'blur' }],
title: [{ required: true, message: '请输入消息标题', trigger: 'blur' }],
content: [{ required: true, message: '请输入消息内容', trigger: 'blur' }],
} }
return { return {
visible: false, visible: false,
......
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