Merge branch 'master' of http://111.229.35.227:3000/gitadmin/wms-naivevue
This commit is contained in:
commit
0a9e6a9b4d
@ -7,6 +7,7 @@
|
||||
:row-key="(row) => row.id"
|
||||
ref="tableRef"
|
||||
@update:checked-row-keys="onSelectionChange"
|
||||
:autoScrollX="true"
|
||||
>
|
||||
<template #tableTitle>
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<PageWrapper>
|
||||
<n-grid x-gap="12" cols="4">
|
||||
<n-grid x-gap="12" cols="1 s:1 m:1 l:3 xl:3 2xl:3" responsive="screen">
|
||||
<n-grid-item span="1">
|
||||
<n-card shadow="hover" class="border-0">
|
||||
<template #header>
|
||||
@ -79,7 +79,7 @@
|
||||
</template>
|
||||
</n-card>
|
||||
</n-grid-item>
|
||||
<n-grid-item span="3">
|
||||
<n-grid-item span="2">
|
||||
<n-card shadow="hover" class="mb-4 border-0 proCard">
|
||||
<configItem :configId="configId" v-if="configItemShow" />
|
||||
</n-card>
|
||||
|
@ -7,6 +7,7 @@
|
||||
:row-key="(row) => row.id"
|
||||
ref="tableRef"
|
||||
@update:checked-row-keys="onSelectionChange"
|
||||
:autoScrollX="true"
|
||||
>
|
||||
<template #tableTitle>
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<PageWrapper>
|
||||
<n-grid x-gap="12" cols="4">
|
||||
<n-grid x-gap="12" cols="1 s:1 m:1 l:3 xl:3 2xl:3" responsive="screen">
|
||||
<n-grid-item span="1">
|
||||
<n-card shadow="hover" class="border-0">
|
||||
<template #header>
|
||||
@ -13,7 +13,7 @@
|
||||
clearable
|
||||
/>
|
||||
</n-gi>
|
||||
<n-gi span="6" style="text-align: right">
|
||||
<n-gi span="6" style="text-align: right; margin-left: 5px">
|
||||
<n-button
|
||||
type="primary"
|
||||
@click="
|
||||
@ -79,7 +79,7 @@
|
||||
</template>
|
||||
</n-card>
|
||||
</n-grid-item>
|
||||
<n-grid-item span="3">
|
||||
<n-grid-item span="2">
|
||||
<n-card shadow="hover" class="mb-4 border-0 proCard">
|
||||
<dictItem :dictId="dictId" v-if="dictItemShow" />
|
||||
</n-card>
|
||||
|
@ -25,7 +25,7 @@ export const columns = [
|
||||
return h(
|
||||
NTag,
|
||||
{
|
||||
type: record.type == 1 ? 'processing' : 'success',
|
||||
type: record.type == 1 ? 'info' : 'success',
|
||||
},
|
||||
{
|
||||
default: () => (record.type == 1 ? '通知' : '公告'),
|
||||
|
@ -1,11 +1,6 @@
|
||||
<template>
|
||||
<basicModal
|
||||
@register="modalRegister"
|
||||
ref="modalRef"
|
||||
class="basicModal basicFormModal"
|
||||
@on-ok="handleSubmit"
|
||||
@on-close="handleClose"
|
||||
>
|
||||
<n-drawer v-model:show="props.visible" @after-leave="handleClose" :width="size">
|
||||
<n-drawer-content :title="props.noticeId ? '编辑公告' : '新增公告'">
|
||||
<template #default>
|
||||
<n-form
|
||||
class="ls-form"
|
||||
@ -26,6 +21,21 @@
|
||||
clearable
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item
|
||||
label="通知封面"
|
||||
path="cover"
|
||||
:rules="{ required: true, message: '请上传通知封面', trigger: 'change' }"
|
||||
>
|
||||
<UploadImg
|
||||
@changeFileName="(name) => (formData.imageImgName = name)"
|
||||
:fileType="['image/jpeg', 'image/png', 'image/jpg', 'image/gif']"
|
||||
name="notice"
|
||||
:fileSize="20"
|
||||
v-model:image-url="formData.cover"
|
||||
>
|
||||
<template #tip>支持扩展名: jpg png jpeg;文件大小不超过20M</template>
|
||||
</UploadImg>
|
||||
</n-form-item>
|
||||
<n-form-item label="通知类型">
|
||||
<n-select
|
||||
v-model:value="formData.type"
|
||||
@ -51,14 +61,22 @@
|
||||
</div>
|
||||
</n-form>
|
||||
</template>
|
||||
</basicModal>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<n-button @click="handleClose">取消</n-button>
|
||||
<n-button :loading="subLoading" type="primary" @click="submit"> 确定 </n-button>
|
||||
</span>
|
||||
</template>
|
||||
</n-drawer-content>
|
||||
</n-drawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getNoticeDetail, noticeAdd, noticeUpdate } from '@/api/data/notice';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { useMessage } from 'naive-ui';
|
||||
import UploadImg from '@/components/Upload/Image.vue';
|
||||
import Editor from '@/components/Editor/tinymce.vue';
|
||||
import { useModal } from '@/components/Modal';
|
||||
import { useLockFn } from '@/utils/useLockFn';
|
||||
|
||||
const emit = defineEmits(['success', 'update:visible']);
|
||||
const formRef = ref();
|
||||
@ -67,6 +85,7 @@
|
||||
* 定义表单参数
|
||||
*/
|
||||
const message = useMessage();
|
||||
const size = document.body.clientWidth - 500;
|
||||
|
||||
/**
|
||||
* 定义表单参数
|
||||
@ -106,15 +125,6 @@
|
||||
{ label: '公告', value: 2 },
|
||||
];
|
||||
|
||||
/**
|
||||
* 定义模态
|
||||
*/
|
||||
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
||||
title: props.noticeId ? '编辑公告' : '添加公告',
|
||||
subBtuText: '确定',
|
||||
width: document.body.clientWidth - 500,
|
||||
});
|
||||
|
||||
/**
|
||||
* 执行提交
|
||||
*/
|
||||
@ -142,6 +152,8 @@
|
||||
emit('update:visible', false);
|
||||
};
|
||||
|
||||
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
|
||||
|
||||
/**
|
||||
* 设置表单数据
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ export const columns = [
|
||||
return h(
|
||||
NTag,
|
||||
{
|
||||
type: record.type == 0 ? 'processing' : 'warning',
|
||||
type: record.type == 0 ? 'info' : 'warning',
|
||||
},
|
||||
{
|
||||
default: () => (record.type == 0 ? '系统' : '业务'),
|
||||
|
@ -24,7 +24,7 @@
|
||||
<n-form-item
|
||||
label="参数类型"
|
||||
path="type"
|
||||
:rule="{ required: true, message: '请选择参数类型', trigger: 'change' }"
|
||||
:rule="{ type: 'number', required: true, message: '请选择参数类型', trigger: 'change' }"
|
||||
>
|
||||
<n-select
|
||||
v-model:value="formData.type"
|
||||
@ -83,7 +83,7 @@
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
name: '',
|
||||
type: 0,
|
||||
type: undefined,
|
||||
code: '',
|
||||
value: '',
|
||||
status: 1,
|
||||
|
@ -117,6 +117,13 @@
|
||||
onClick: handleDelete.bind(null, record),
|
||||
auth: ['sys:tenant:delete'],
|
||||
},
|
||||
{
|
||||
label: '创建账号',
|
||||
icon: renderIcon(PlusOutlined),
|
||||
type: 'info',
|
||||
onClick: handleAddAccount.bind(null, record),
|
||||
auth: ['sys:tenant:account'],
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
@ -204,7 +211,14 @@
|
||||
await nextTick();
|
||||
createModalRef.value.openModal();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行添加账号
|
||||
* @param recored 参数
|
||||
*/
|
||||
const handleAddAccount = async (recored: Recordable) => {
|
||||
await tenantAccount({ tenantId: recored.id });
|
||||
message.success('创建成功');
|
||||
};
|
||||
/**
|
||||
* 执行删除
|
||||
* @param id 参数
|
||||
|
@ -204,12 +204,7 @@
|
||||
path="address"
|
||||
:rule="{ required: true, message: '请输入详细地址', trigger: 'blur' }"
|
||||
>
|
||||
<n-input
|
||||
v-model:value="formData.address"
|
||||
type="textarea"
|
||||
placeholder="请输入详细地址"
|
||||
clearable
|
||||
/>
|
||||
<n-input v-model:value="formData.address" placeholder="请输入详细地址" clearable />
|
||||
</n-form-item>
|
||||
</div>
|
||||
<div class="flex">
|
||||
|
Loading…
Reference in New Issue
Block a user