refactor: button

This commit is contained in:
xingyu4j
2022-11-15 17:42:04 +08:00
parent 70b8dcb174
commit fabca00f7a
27 changed files with 807 additions and 817 deletions

View File

@ -2,7 +2,7 @@
import { ref, unref, onMounted } from 'vue'
import { ContentDetailWrap } from '@/components/ContentDetailWrap'
import { BasicInfoForm, CloumInfoForm, GenInfoForm } from './components'
import { ElTabs, ElTabPane, ElButton, ElMessage } from 'element-plus'
import { ElTabs, ElTabPane, ElMessage } from 'element-plus'
import { getCodegenTableApi, updateCodegenTableApi } from '@/api/infra/codegen'
import { useRouter, useRoute } from 'vue-router'
import { useI18n } from '@/hooks/web/useI18n'
@ -70,9 +70,7 @@ onMounted(() => {
</el-tab-pane>
</el-tabs>
<template #right>
<el-button type="primary" :loading="loading" @click="submitForm">
{{ t('action.save') }}
</el-button>
<XButton type="primary" :title="t('action.save')" :loading="loading" @click="submitForm()" />
</template>
</ContentDetailWrap>
</template>

View File

@ -178,15 +178,16 @@ getList()
</Descriptions>
<!-- 操作按钮 -->
<template #footer>
<el-button
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm"
>
{{ t('action.save') }}
</el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
</XModal>
</template>

View File

@ -147,15 +147,16 @@ onMounted(async () => {
/>
<!-- 操作按钮 -->
<template #footer>
<el-button
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="loading"
@click="submitForm"
>
{{ t('action.save') }}
</el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
</XModal>
</template>

View File

@ -192,15 +192,16 @@ getList()
/>
<!-- 操作按钮 -->
<template #footer>
<el-button
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm"
>
{{ t('action.save') }}
</el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
</XModal>
</template>

View File

@ -235,15 +235,16 @@ getList()
</Descriptions>
<!-- 操作按钮 -->
<template #footer>
<el-button
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm"
>
{{ t('action.save') }}
</el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
</XModal>
</template>