import {defineComponent, onMounted, reactive, ref} from 'vue' import SaveForm from '@components/save-form' import {DataTableRowKey, NButton, NDataTable, NDatePicker, NFormItem, NInput, NSelect, NSpace, NTag, useDialog, useMessage} from 'naive-ui' import Pagination from '@components/pagination' import {getMapValueByKey, getSelectDataFromObj} from '@/utils/objectUtil' import {appKey, clientType, messageSenderFunctionModule, messageSenderMode} from '@/utils/constant' import {musicSheetApplicationExtendCategoryList, musicSheetApplicationExtendStatus, sysMessageConfigPage} from '@views/music-library/api' import {subjectPage, sysApplicationPage} from '@views/system-manage/api' import {filterTimes, getTimes} from "@/utils/dateUtil"; export default defineComponent({ name: 'push-record', props: { appKey: { type: String, required: true } }, setup(props) { const dialog = useDialog() const message = useMessage() const state = reactive({ loading: false, appId: null as any, pagination: { page: 1, rows: 10, pageTotal: 0 }, searchForm: { description: null, //消息名称 clientId: null, //客户端 model: null, // 功能模块 sendTime: null // 发送时间 }, dataList: [] }) onMounted(async () => { getList() }) const saveForm = ref() const onSearch = () => { saveForm.value?.submit() } const onBtnReset = () => { saveForm.value?.reset() } const onSubmit = () => { state.pagination.page = 1 getList() } const checkedRowKeysRef = ref([]) const handleCheck = (rowKeys: DataTableRowKey[]) => { checkedRowKeysRef.value = rowKeys } const getList = async () => { try { state.loading = true const {data} = await sysMessageConfigPage({ ...state.pagination, description: state.searchForm.description, clientId: state.searchForm.clientId, model: state.searchForm.model, appKey: props.appKey, ...getTimes(state.searchForm.sendTime, ['sendTimeStart', 'sendTimeEnd']), }) state.pagination.pageTotal = Number(data.total) state.dataList = data.rows || [] } catch { } state.loading = false } const columns = (): any => { return [ { title: '发送时间', key: 'sendTime' }, { title: '发送平台', key: 'sender' }, { title: '姓名', key: 'username' }, { title: '消息名称', key: 'title' }, { title: '发送对象', key: 'clientId', render: (row: any) => { return (
{getMapValueByKey(row.clientId, new Map(Object.entries(clientType)))}
) } }, { title: '功能模块', key: 'messageType' }, { title: '触发条件', key: 'triggerCondition' }, { title: '推送标题', key: 'title' }, { title: '推送内容', key: 'content' }, ] } return () => { return (
(state.searchForm = val)} > 搜索 重置
row.id} scrollX={'1400'} >
) } } })