chore: push latest changes

This commit is contained in:
wanwu
2025-11-16 22:13:57 +08:00
parent de821ae5fd
commit 7ede50739b
780 changed files with 101983 additions and 10460 deletions

View File

@@ -54,67 +54,66 @@
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.limit"
layout="total, sizes, prev, pager, next, jumper" :total="tableData.total"/>
</div>
<el-dialog v-model="visibleDetail" :title="t('模版详情')" width="600px" destroy-on-close >
<ModalDetail :class="'w-[600px]'" :title="t('模版详情')">
<el-form label-width="100px" ref="formRef" class="page-form">
<el-form-item :label="t('短信类型')" prop="template_id">
<div>{{ detail.sms_type }}</div>
<div>{{ detail?.sms_type }}</div>
</el-form-item>
<el-form-item :label="t('模版名称')" prop="template_id">
<div>{{ detail.name }}</div>
<div>{{ detail?.name }}</div>
</el-form-item>
<el-form-item :label="t('模版类型')" prop="title">
<div >{{ detail.title }}</div>
<div>{{ detail?.title }}</div>
</el-form-item>
<el-form-item :label="t('短信内容')" prop="title" v-if="detail.sms">
<div >{{ detail.sms?.content }}</div>
<el-form-item :label="t('短信内容')" prop="title" v-if="detail?.sms">
<div>{{ detail?.sms?.content }}</div>
</el-form-item>
<el-form-item :label="t('审核状态')" prop="title">
<div >{{ detail.audit_info.audit_status_name }}</div>
<div>{{ detail?.audit_info?.audit_status_name }}</div>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<!-- <el-button @click="visibleDetail = false">{{ t("cancel") }}</el-button> -->
<el-button type="primary" @click="visibleDetail = false">{{ t("confirm") }}</el-button>
<el-button type="primary" @click="detailConfirm">{{ t('confirm') }}</el-button>
</span>
</template>
</el-dialog>
<el-dialog v-model="visibleReport" :title="t('模版报备')" width="820px" destroy-on-close >
<el-form label-width="100px" ref="formRef" class="page-form" v-loading="reportLoading">
<el-form-item :label="t('模版名称')" prop="template_id">
<div class="input-width">{{ detail.name }}</div>
</el-form-item>
<el-form-item :label="t('模版类型')" prop="title">
<el-radio-group v-model="reportData.template_type">
<el-radio v-for="[key, value] in Object.entries(template_type_list)" :key="key" :label="Number(key)">{{ value }}</el-radio>
</el-radio-group>
</el-form-item>
<div class="ml-[100px] mb-[10px] mt-[-10px] text-[12px] text-[#999] leading-[20px]">
<div>验证码仅支持验证码类型变量</div>
<div>行业通知支持验证码类型变量</div>
<div>营销推广不支持变量</div>
</div>
<el-form-item :label="t('变量类型')" prop="params_json" v-if="detail.variable && Object.keys(detail.variable).length > 0">
<div v-for="(label, key) in detail.variable" :key="key" class="mb-2 flex items-center">
<div class="flex flex-1 items-center">
<div class="w-32 mr-1 ">{{ label }}</div>
<el-select v-model="reportData.params_json[key]" placeholder="请选择类型" class="flex-1" filterable clearable :disabled="isMarketingWithVariable">
<el-option v-for="item in filteredParamTypes" :key="item.type" :label="item.name + '' + item.desc + ''" :value="item.type"/>
</el-select>
</div>
</ModalDetail>
<ModalReport :class="'w-[820px]'" :title="t('模版报备')">
<div v-loading="reportLoading">
<el-form label-width="100px" ref="formRef" class="page-form">
<el-form-item :label="t('模版名称')" prop="template_id">
<div class="input-width">{{ detail?.name }}</div>
</el-form-item>
<el-form-item :label="t('模版类型')" prop="title">
<el-radio-group v-model="reportData.template_type">
<el-radio v-for="[key, value] in Object.entries(template_type_list)" :key="key" :label="Number(key)">{{ value }}</el-radio>
</el-radio-group>
</el-form-item>
<div class="ml-[100px] mb-[10px] mt-[-10px] text-[12px] text-[#999] leading-[20px]">
<div>验证码支持验证码类型变量</div>
<div>行业通知不支持验证码类型变量</div>
<div>营销推广不支持变量</div>
</div>
</el-form-item>
</el-form>
<el-form-item :label="t('变量类型')" prop="params_json" v-if="detail?.variable && Object.keys(detail.variable).length > 0">
<div v-for="(label, key) in detail.variable" :key="key" class="mb-2 flex items-center">
<div class="flex flex-1 items-center">
<div class="w-32 mr-1 ">{{ label }}</div>
<el-select v-model="reportData.params_json[key]" placeholder="请选择类型" class="flex-1" filterable clearable :disabled="isMarketingWithVariable">
<el-option v-for="item in filteredParamTypes" :key="item.type" :label="item.name + '' + item.desc + ''" :value="item.type"/>
</el-select>
</div>
</div>
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="visibleReport = false">{{ t("cancel") }}</el-button>
<el-button type="primary" @click="reportTemplateFn()" :disabled="isMarketingWithVariable">{{ t("confirm") }}</el-button>
<el-button @click="reportCancel">{{ t('cancel') }}</el-button>
<el-button type="primary" @click="reportConfirm" :disabled="isMarketingWithVariable">{{ t('confirm') }}</el-button>
</span>
</template>
</el-dialog>
<el-dialog v-model="visibleAsync" :title="t('同步模版状态')" width="800px" destroy-on-close >
</ModalReport>
<ModalAsync :class="'w-[800px]'" :title="t('同步模版状态')">
<el-alert type="warning" :closable="false" class="!mb-[10px]">
<template #default>
以下模版名称重复请先调整模版名称后重新同步模版
@@ -125,20 +124,20 @@
<el-table :data="repeatListArray" border style="width: 100%;">
<el-table-column label="模版名称" prop="name" />
<el-table-column label="插件名称">
<template #default="{ row }">
<el-tag v-for="item in row.platforms" :key="item" class="mr-1 mb-1">{{ item }}</el-tag>
</template>
<template #default="{ row }">
<el-tag v-for="item in row.platforms" :key="item" class="mr-1 mb-1">{{ item }}</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visibleAsync = false">{{ t("cancel") }}</el-button>
<el-button type="primary" @click="visibleAsync = false">{{ t("confirm") }}</el-button>
<el-button @click="asyncCancel">{{ t('cancel') }}</el-button>
<el-button type="primary" @click="asyncConfirm">{{ t('confirm') }}</el-button>
</span>
</template>
</el-dialog>
</ModalAsync>
</div>
</template>
@@ -146,6 +145,7 @@
import { ref, computed, reactive, onMounted, watch } from 'vue'
import { getTemplateList, getTemplateReportConfig, reportTemplate, templateSync, getreportTemplateInfo, clearTemplate } from '@/app/api/notice'
import { t } from '@/lang'
import { useVbenModal } from '@vben/common-ui'
const props = defineProps({
username: {
@@ -222,13 +222,15 @@ onMounted(() => {
}
})
const visibleAsync = ref(false)
const [ModalDetail, modalDetailApi] = useVbenModal()
const [ModalReport, modalReportApi] = useVbenModal()
const [ModalAsync, modalAsyncApi] = useVbenModal()
const repeatList = ref({})
const syncEvent = () => {
templateSync('niuyun', props.username).then((res) => {
repeatList.value = res.data.repeat_list
if (repeatList.value && Object.keys(repeatList.value).length > 0) {
visibleAsync.value = true
modalAsyncApi.open()
} else {
loadSmsTemplateList()
}
@@ -244,10 +246,9 @@ const repeatListArray = computed(() => {
// 详情
const detail = ref(null)
const visibleDetail = ref(false)
const editEvent = (row:any) => {
visibleDetail.value = true
detail.value = row
modalDetailApi.open()
}
// 清除报备
@@ -267,7 +268,6 @@ const clearEvent = (row:any) => {
const template_params_type_list = ref({})
const template_type_list = ref({})
const template_status_list = ref({})
const visibleReport = ref(false)
const reportData = ref({
template_type: 1,
template_key: '',
@@ -307,9 +307,9 @@ const reportEvent = (row:any) => {
if (!signature) {
ElMessage.error('请先配置签名')
} else {
detail.value = row
modalReportApi.open()
if (row.template_id) {
visibleReport.value = true
detail.value = row
getreportTemplateInfo('niuyun', props.username, { template_key: row.key }).then((res) => {
const paramJson = res.data?.param_json ?? {}
reportData.value.template_key = res.data.template_key
@@ -323,9 +323,7 @@ const reportEvent = (row:any) => {
reportLoading.value = false
})
} else {
visibleReport.value = true
reportLoading.value = false
detail.value = row
reportData.value.template_type = 1
reportData.value.template_key = detail.value.key
reportData.value.params_json = {}
@@ -350,10 +348,16 @@ const reportTemplateFn = () => {
reportData.value.template_id = Number(detail.value.template_id)
}
reportTemplate(detail.value.sms_type, props.username, reportData.value).then((res) => {
visibleReport.value = false
modalReportApi.close()
loadSmsTemplateList()
})
}
const detailConfirm = () => { modalDetailApi.close() }
const reportCancel = () => { modalReportApi.close() }
const reportConfirm = () => { reportTemplateFn() }
const asyncCancel = () => { modalAsyncApi.close() }
const asyncConfirm = () => { modalAsyncApi.close() }
</script>
<style lang="scss" scoped>