generated from Leo_Ding/web-template
Merge branch 'master' of https://gitlab.guxuan.icu/Leo_Ding/zhonghai_admin
This commit is contained in:
commit
9fa0dcff58
@ -1,39 +1,38 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:width="640"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
:cancel-text="cancelText"
|
||||
:ok-text="okText"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '90px' } }">
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules" :label-col="{ style: { width: '90px' } }">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.announcement.form.title')"
|
||||
name="title">
|
||||
<a-input
|
||||
:placeholder="$t('pages.system.announcement.form.title.placeholder')"
|
||||
<a-form-item :label="$t('pages.system.announcement.form.title')" name="title">
|
||||
<a-input :placeholder="$t('pages.system.announcement.form.title.placeholder')"
|
||||
v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.announcement.form.content')"
|
||||
name="content">
|
||||
<a-textarea
|
||||
v-model:value="formData.content"
|
||||
<a-form-item :label="$t('pages.system.announcement.form.content')" name="content">
|
||||
<a-textarea v-model:value="formData.content"
|
||||
:placeholder="$t('pages.system.announcement.form.content.placeholder')" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'所属区域'" name="areaId">
|
||||
<a-select ref="select" v-model:value="formData.areaId" :placeholder="$t('pages.system.announcement.form.content.placeholder')">
|
||||
<a-select-option
|
||||
v-for="item in areaEnum.getAll()"
|
||||
:value="item.value">{{item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'状态'" name="status">
|
||||
<a-radio-group v-model:value="formData.status" :options="[
|
||||
{ label: '启用', value: 'enabled' },
|
||||
{ label: '停用', value: 'disabled' },
|
||||
]"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.announcement.form.createdAt')"
|
||||
@ -50,6 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { areaEnum } from "@/enums/useEnum"
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { ref } from 'vue'
|
||||
import { config } from '@/config'
|
||||
@ -69,7 +69,8 @@ const roles = ref([])
|
||||
formRules.value = {
|
||||
title: { required: true, message: t('pages.system.announcement.form.title.placeholder') },
|
||||
content: { required: true, message: t('pages.system.announcement.form.content.placeholder') },
|
||||
// createdAt: { required: true, message: t('pages.system.announcement.form.createdAt.placeholder') },
|
||||
areaId: { required: true, message: '请选择区域'},
|
||||
status: { required: true, message: '请选择是否启用'},
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -71,6 +71,21 @@
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'areaId'">
|
||||
<span>{{ areaEnum.getName(record.areaId) }}</span>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="statusTypeEnum.is('disabled', record.status)">
|
||||
{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="'createdAt' === column.dataIndex">
|
||||
{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
@ -103,12 +118,14 @@ import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { statusTypeEnum } from '@/enums/system'
|
||||
import { statusTypeEnum} from '@/enums/system'
|
||||
|
||||
import { usePagination } from '@/hooks'
|
||||
import AddDialog from './components/AddDialog.vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import dayjs from 'dayjs'
|
||||
import { customersEnum, areaEnum } from "@/enums/useEnum"
|
||||
|
||||
defineOptions({
|
||||
name: 'systemRole',
|
||||
@ -119,8 +136,8 @@ const columns = [
|
||||
{ title: t('pages.system.announcement.form.createdAt'), dataIndex: 'createdAt', width: 200 },
|
||||
{ title: t('pages.system.announcement.form.title'), dataIndex: 'title', key: 'title', width: 240 },
|
||||
{ title: t('pages.system.announcement.form.content'), dataIndex: 'content', width: 240 },
|
||||
{ title: t('pages.system.announcement.form.status'), key: 'status', width: 120 },
|
||||
{ title: t('pages.system.announcement.form.areaId'), key: 'areaId', width: 120 },
|
||||
{ title: t('pages.system.announcement.form.status'), key: 'status', dataIndex: 'status', width: 120 },
|
||||
{ title: t('pages.system.announcement.form.areaId'), key: 'areaId', dataIndex: 'areaId', width: 120 },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
|
||||
]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user