Compare commits

..

No commits in common. "0a9e6a9b4d09f01d9397181f27d86e7b1993171d" and "0049e41cd846f802b01a50dc1189ebdae0ca3cfc" have entirely different histories.

7 changed files with 67 additions and 140 deletions

View File

@ -16,7 +16,7 @@ export const columns = [
{
title: '模板名称',
key: 'title',
width: 200,
width: 150,
},
{
title: '模板编码',
@ -53,7 +53,7 @@ export const columns = [
{
title: '文件路径',
key: 'filePath',
width: 150,
width: 100,
render(record) {
return h(
'a',

View File

@ -124,30 +124,16 @@
default: 0,
},
});
/**
* 定义数据源
*/
const typeList = [
{ label: '普通邮件', value: 1 },
{ label: '图文邮件', value: 2 },
{ label: '模板文件', value: 3 },
];
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.emailId ? '编辑文件模板' : '添加文件模板',
subBtuText: '确定',
width: 600,
});
/**
* 文件上传
* @param filePath 文件地址
* @param fileName 文件名称
*/
const typeList = [
{ label: '普通邮件', value: 1 },
{ label: '图文邮件', value: 2 },
{ label: '模板文件', value: 3 },
];
const fileUpload = async (filePath: any, fileName: any) => {
formData.filePath = filePath;
formData.fileName = fileName;
@ -159,7 +145,6 @@
);
return;
};
/**
* 执行提交
*/
@ -206,10 +191,7 @@
setFormData();
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -80,6 +80,7 @@
const editVisible = ref(false);
const emailId = ref(0);
const rowKeys = ref([]);
const showModal = ref(false);
/**
* 定义查询参数
@ -175,9 +176,6 @@
reloadTable();
}
/**
* 执行注册
*/
const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80,
@ -193,7 +191,6 @@
await nextTick();
createModalRef.value.openModal();
};
/**
* 执行编辑
*/
@ -203,7 +200,6 @@
await nextTick();
createModalRef.value.openModal();
}
/**
* 执行删除
* @param id 参数

View File

@ -88,6 +88,7 @@
import { onMounted, reactive, ref } from 'vue';
import { useMessage } from 'naive-ui';
import { useModal } from '@/components/Modal';
import UploadFile from '@/components/Upload/file.vue';
const emit = defineEmits(['success', 'update:visible']);
const formRef = ref();
@ -102,7 +103,7 @@
code: '',
number: '',
content: '',
type: '',
type: undefined,
});
/**
@ -120,25 +121,27 @@
default: 0,
},
});
/**
* 定义数据源
*/
const typeList = [
{ label: '系统通知', value: 1 },
{ label: '用户私信', value: 2 },
{ label: '待办事项', value: 3 },
];
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.messageId ? '编辑文件模板' : '添加文件模板',
subBtuText: '确定',
width: 600,
});
const typeList = [
{ label: '系统通知', value: 1 },
{ label: '用户私信', value: 2 },
{ label: '待办事项', value: 3 },
];
const fileUpload = async (filePath: any, fileName: any) => {
formData.filePath = filePath;
formData.fileName = fileName;
formRef.value?.validate(
(errors) => {},
(rule) => {
return rule?.key === 'filePath';
},
);
return;
};
/**
* 执行提交
*/
@ -187,10 +190,7 @@
setFormData();
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -27,6 +27,7 @@
</template>
新建
</n-button>
<n-button
type="error"
@click="handleDelete"
@ -66,13 +67,12 @@
} from '@/api/file/messageTemplate';
import { columns } from './columns';
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
import CreateModal from './CreateModal.vue';
import editDialog from './edit.vue';
import { basicModal, useModal } from '@/components/Modal';
import { schemas } from './querySchemas';
import { renderIcon } from '@/utils';
/**
* 定义常量
*/
const message = useMessage();
const dialog = useDialog();
const basicTableRef = ref();
@ -80,18 +80,14 @@
const editVisible = ref(false);
const messageId = ref(0);
const rowKeys = ref([]);
const exportLoading = ref(false);
/**
* 定义查询参数
*/
const showModal = ref(false);
const formParams = reactive({
title: '',
type: '',
});
/**
* 定义操作栏
*/
const actionColumn = reactive({
width: 200,
title: '操作',
@ -121,35 +117,24 @@
},
});
/**
* 加载数据列表
*/
function addTable() {
showModal.value = true;
}
const loadDataTable = async (res) => {
rowKeys.value = [];
const result = await getMessageTemplateList({ ...formParams, ...res });
return result;
};
/**
* 数据行选中事件
* @param keys 参数
*/
function onCheckedRow(keys) {
rowKeys.value = keys;
}
/**
* 加载数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') {
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
}
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -160,10 +145,6 @@
reloadTable();
}
/**
* 执行重置
* @param values 参数
*/
function handleReset(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -174,9 +155,6 @@
reloadTable();
}
/**
* 执行注册
*/
const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80,
@ -192,7 +170,6 @@
await nextTick();
createModalRef.value.openModal();
};
/**
* 执行编辑
*/
@ -202,7 +179,6 @@
await nextTick();
createModalRef.value.openModal();
}
/**
* 执行删除
* @param id 参数
@ -214,9 +190,7 @@
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
record.id
? await messageTemplateDelete(record.id)
: await messageTemplateBatchDelete(rowKeys.value);
record.id ? await messageDelete(record.id) : await messageBatchDelete(rowKeys.value);
message.success('删除成功');
reloadTable();
},

View File

@ -84,6 +84,7 @@
import { onMounted, reactive, ref } from 'vue';
import { useMessage } from 'naive-ui';
import { useModal } from '@/components/Modal';
import UploadFile from '@/components/Upload/file.vue';
const emit = defineEmits(['success', 'update:visible']);
const formRef = ref();
@ -98,7 +99,7 @@
code: '',
number: '',
content: '',
type: '',
type: undefined,
});
/**
@ -116,25 +117,27 @@
default: 0,
},
});
/**
* 定义数据源
*/
const typeList = [
{ label: '阿里云', value: 1 },
{ label: '腾讯云', value: 2 },
{ label: '华为云', value: 3 },
];
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.smsId ? '编辑文件模板' : '添加文件模板',
subBtuText: '确定',
width: 600,
});
const typeList = [
{ label: '阿里云', value: 1 },
{ label: '腾讯云', value: 2 },
{ label: '华为云', value: 3 },
];
const fileUpload = async (filePath: any, fileName: any) => {
formData.filePath = filePath;
formData.fileName = fileName;
formRef.value?.validate(
(errors) => {},
(rule) => {
return rule?.key === 'filePath';
},
);
return;
};
/**
* 执行提交
*/
@ -181,10 +184,7 @@
setFormData();
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -27,6 +27,7 @@
</template>
新建
</n-button>
<n-button
type="error"
@click="handleDelete"
@ -66,7 +67,9 @@
} from '@/api/file/smsTemplate';
import { columns } from './columns';
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
import CreateModal from './CreateModal.vue';
import editDialog from './edit.vue';
import { basicModal, useModal } from '@/components/Modal';
import { schemas } from './querySchemas';
import { renderIcon } from '@/utils';
@ -77,19 +80,14 @@
const editVisible = ref(false);
const smsId = ref(0);
const rowKeys = ref([]);
const showModal = ref(false);
const exportLoading = ref(false);
/**
* 定义查询参数
*/
const showModal = ref(false);
const formParams = reactive({
title: '',
type: '',
});
/**
* 定义操作栏
*/
const actionColumn = reactive({
width: 200,
title: '操作',
@ -119,36 +117,24 @@
},
});
/**
* 加载数据列表
* @param res 参数
*/
function addTable() {
showModal.value = true;
}
const loadDataTable = async (res) => {
rowKeys.value = [];
const result = await getSmsTemplateList({ ...formParams, ...res });
return result;
};
/**
* 数据行选中事件
* @param keys 参数
*/
function onCheckedRow(keys) {
rowKeys.value = keys;
}
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') {
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
}
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -159,10 +145,6 @@
reloadTable();
}
/**
* 执行重置
* @param values 参数
*/
function handleReset(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -173,9 +155,6 @@
reloadTable();
}
/**
* 执行注册
*/
const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80,
@ -191,7 +170,6 @@
await nextTick();
createModalRef.value.openModal();
};
/**
* 执行编辑
*/
@ -201,7 +179,6 @@
await nextTick();
createModalRef.value.openModal();
}
/**
* 执行删除
* @param id 参数
@ -213,9 +190,7 @@
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
record.id
? await smsTemplateDelete(record.id)
: await smsTemplateBatchDelete(rowKeys.value);
record.id ? await positionDelete(record.id) : await positionBatchDelete(rowKeys.value);
message.success('删除成功');
reloadTable();
},