|
|
|
@ -1,53 +1,55 @@
|
|
|
|
|
<template>
|
|
|
|
|
<TableList
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:code="code"
|
|
|
|
|
:config="config"
|
|
|
|
|
:data="list"
|
|
|
|
|
:operation="['create', 'search']"
|
|
|
|
|
:reset="handleReset"
|
|
|
|
|
title="消息通知"
|
|
|
|
|
:total="total"
|
|
|
|
|
@create="handleCreate"
|
|
|
|
|
@remove="handleRemove"
|
|
|
|
|
@search="handleSearch"
|
|
|
|
|
>
|
|
|
|
|
<template #search>
|
|
|
|
|
<el-form inline>
|
|
|
|
|
<div class="list-container">
|
|
|
|
|
<TableList
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:code="code"
|
|
|
|
|
:config="config"
|
|
|
|
|
:data="list"
|
|
|
|
|
:operation="['create', 'search']"
|
|
|
|
|
:reset="handleReset"
|
|
|
|
|
title="消息通知"
|
|
|
|
|
:total="total"
|
|
|
|
|
@create="handleCreate"
|
|
|
|
|
@remove="handleRemove"
|
|
|
|
|
@search="handleSearch"
|
|
|
|
|
>
|
|
|
|
|
<template #search>
|
|
|
|
|
<el-form inline>
|
|
|
|
|
<el-form-item label="消息标题" prop="title">
|
|
|
|
|
<el-input v-model="state.condition.title" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="发布时间" prop="dateRange">
|
|
|
|
|
<el-input v-model="state.condition.dateRange" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</template>
|
|
|
|
|
</TableList>
|
|
|
|
|
<el-dialog v-model="formState.formVisible" :title="formState.form.id ? '查看' : '添加' + '通知'">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="refsForm"
|
|
|
|
|
:disabled="!!formState.form.id"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
:model="formState.form"
|
|
|
|
|
:rules="formState.rules"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="消息标题" prop="title">
|
|
|
|
|
<el-input v-model="state.condition.title" />
|
|
|
|
|
<el-input v-model="formState.form.title" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="消息内容" prop="content">
|
|
|
|
|
<el-input v-model="formState.form.content" :autosize="{ minRows: 3, maxRows: 5 }" type="textarea" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="发布时间" prop="dateRange">
|
|
|
|
|
<el-input v-model="state.condition.dateRange" />
|
|
|
|
|
<el-form-item label="链接跳转" prop="linkJump">
|
|
|
|
|
<el-input v-model="formState.form.linkJump" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</template>
|
|
|
|
|
</TableList>
|
|
|
|
|
<el-dialog v-model="formState.formVisible" :title="formState.form.id ? '查看' : '添加' + '通知'">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="refsForm"
|
|
|
|
|
:disabled="!!formState.form.id"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
:model="formState.form"
|
|
|
|
|
:rules="formState.rules"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="消息标题" prop="title">
|
|
|
|
|
<el-input v-model="formState.form.title" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="消息内容" prop="content">
|
|
|
|
|
<el-input v-model="formState.form.content" :autosize="{ minRows: 3, maxRows: 5 }" type="textarea" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="链接跳转" prop="linkJump">
|
|
|
|
|
<el-input v-model="formState.form.linkJump" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="formState.formVisible = false">取消</el-button>
|
|
|
|
|
<el-button v-if="!formState.form.id" :loading="formState.submitting" type="primary" @click="handleSave">
|
|
|
|
|
保存
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="formState.formVisible = false">取消</el-button>
|
|
|
|
|
<el-button v-if="!formState.form.id" :loading="formState.submitting" type="primary" @click="handleSave">
|
|
|
|
|
保存
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="jsx">
|
|
|
|
@ -120,10 +122,7 @@
|
|
|
|
|
try {
|
|
|
|
|
await unref(refsForm).validate();
|
|
|
|
|
let data = _.cloneDeep(formState.form);
|
|
|
|
|
data.activityStartTime = data.time[0];
|
|
|
|
|
data.activityEndTime = data.time[1];
|
|
|
|
|
delete data.time;
|
|
|
|
|
await store.dispatch('limitActivity/save', data);
|
|
|
|
|
await store.dispatch('notify/save', data);
|
|
|
|
|
formState.formVisible = false;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.info('取消保存', e);
|
|
|
|
@ -131,12 +130,10 @@
|
|
|
|
|
formState.submitting = false;
|
|
|
|
|
};
|
|
|
|
|
const handleRemove = async (rows) => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
await store.dispatch(
|
|
|
|
|
store.dispatch(
|
|
|
|
|
'notify/remove',
|
|
|
|
|
rows.map((item) => item.id)
|
|
|
|
|
);
|
|
|
|
|
loading.value = false;
|
|
|
|
|
};
|
|
|
|
|
const config = reactive({
|
|
|
|
|
// 表格列配置
|
|
|
|
|