| | |
| | | <ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData"> |
| | | <template #left> |
| | | <ElSpace wrap> |
| | | <ElButton v-auth="'add'" @click="showDialog('add')" v-ripple>新增波次策略</ElButton> |
| | | <ElButton v-auth="'add'" @click="showDialog('add')" v-ripple>{{ t('pages.manager.waveRule.actions.add') }}</ElButton> |
| | | <ElButton |
| | | v-auth="'delete'" |
| | | type="danger" |
| | |
| | | @click="handleBatchDelete" |
| | | v-ripple |
| | | > |
| | | 批量删除 |
| | | {{ t('common.actions.batchDelete') }} |
| | | </ElButton> |
| | | </ElSpace> |
| | | </template> |
| | |
| | | |
| | | <script setup> |
| | | import { ElMessage } from 'element-plus' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { guardRequestWithMessage } from '@/utils/sys/requestGuard' |
| | | import { useAuth } from '@/hooks/core/useAuth' |
| | | import { useTable } from '@/hooks/core/useTable' |
| | |
| | | } from './waveRulePage.helpers' |
| | | |
| | | defineOptions({ name: 'WaveRule' }) |
| | | const { t } = useI18n() |
| | | |
| | | const { hasAuth } = useAuth() |
| | | const searchForm = ref(createWaveRuleSearchState()) |
| | |
| | | |
| | | const searchItems = computed(() => [ |
| | | { |
| | | label: '关键字', |
| | | label: t('table.keyword'), |
| | | key: 'condition', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入编号或名称' |
| | | placeholder: t('pages.manager.waveRule.search.conditionPlaceholder') |
| | | } |
| | | }, |
| | | { |
| | | label: '编号', |
| | | label: t('table.code'), |
| | | key: 'code', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入编号' |
| | | placeholder: t('pages.manager.waveRule.search.codePlaceholder') |
| | | } |
| | | }, |
| | | { |
| | | label: '类型', |
| | | label: t('pages.manager.waveRule.table.type'), |
| | | key: 'type', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '名称', |
| | | label: t('table.name'), |
| | | key: 'name', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入策略名称' |
| | | placeholder: t('pages.manager.waveRule.search.namePlaceholder') |
| | | } |
| | | } |
| | | ]) |
| | |
| | | }), |
| | | [], |
| | | { |
| | | timeoutMessage: '波次策略类型加载超时,已停止等待' |
| | | timeoutMessage: t('pages.manager.waveRule.messages.typeTimeout') |
| | | } |
| | | ) |
| | | typeOptions.value = buildWaveRuleTypeOptions(Array.isArray(records?.records) ? records.records : records?.list || records || []) |
| | |
| | | } catch (error) { |
| | | detailDrawerVisible.value = false |
| | | detailData.value = {} |
| | | ElMessage.error(error?.message || '获取波次策略详情失败') |
| | | ElMessage.error(error?.message || t('pages.manager.waveRule.messages.detailFailed')) |
| | | } finally { |
| | | detailLoading.value = false |
| | | } |
| | |
| | | dialogVisible.value = true |
| | | dialogType.value = 'edit' |
| | | } catch (error) { |
| | | ElMessage.error(error?.message || '获取波次策略详情失败') |
| | | ElMessage.error(error?.message || t('pages.manager.waveRule.messages.detailFailed')) |
| | | } |
| | | } |
| | | |
| | |
| | | saveRequest: fetchSaveWaveRule, |
| | | updateRequest: fetchUpdateWaveRule, |
| | | deleteRequest: fetchDeleteWaveRule, |
| | | entityName: '波次策略', |
| | | entityName: t('pages.manager.waveRule.entity'), |
| | | resolveRecordLabel: (record) => record?.name || record?.code || record?.id, |
| | | refreshCreate, |
| | | refreshUpdate, |