diff --git a/src/components/common-form/index.vue b/src/components/common-form/index.vue index 405f350..cc008a9 100644 --- a/src/components/common-form/index.vue +++ b/src/components/common-form/index.vue @@ -3,6 +3,17 @@ import { computed, ref } from 'vue' import cloneDeep from 'lodash/cloneDeep' import { $i18nBundle } from '@/messages' +/** + * @typedef {FormProps} CommonFormProps + * @property {[CommonFormOption]} options 配置选项 + * @property {boolean} showButtons 是否显示按钮区域 + * @property {boolean} showSubmit 是否显示提交按钮 + * @property {boolean} showReset 是否显示重置按钮 + * @method submitForm 提交逻辑 + */ +/** + * @type {CommonFormProps} + */ const props = defineProps({ /** * @type [CommonFormOption] @@ -17,6 +28,22 @@ const props = defineProps({ }, model: { type: Object + }, + showButtons: { + type: Boolean, + default: true + }, + showSubmit: { + type: Boolean, + default: true + }, + showReset: { + type: Boolean, + default: true + }, + submitForm: { + type: Function, + default () {} } }) @@ -68,8 +95,26 @@ const form = ref(null) :model="model" :option="option" /> + + + {{ $t('common.label.submit') }} + + + {{ $t('common.label.reset') }} + + + diff --git a/src/components/common-table/common-table-column.vue b/src/components/common-table/common-table-column.vue new file mode 100644 index 0000000..f9bffaf --- /dev/null +++ b/src/components/common-table/common-table-column.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/common-table/index.vue b/src/components/common-table/index.vue new file mode 100644 index 0000000..c7dfe47 --- /dev/null +++ b/src/components/common-table/index.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/components/index.js b/src/components/index.js index ed6fd52..36c2c70 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -4,6 +4,7 @@ import CommonFormControl from '@/components/common-form-control/index.vue' import CommonMenu from '@/components/common-menu/index.vue' import CommonMenuItem from '@/components/common-menu-item/index.vue' import CommonTabsView from '@/components/common-tabs-view/index.vue' +import CommonTable from '@/components/common-table/index.vue' /** * 自定义通用组件自动注册 @@ -19,5 +20,6 @@ export default { Vue.component('CommonMenu', CommonMenu) Vue.component('CommonMenuItem', CommonMenuItem) Vue.component('CommonTabsView', CommonTabsView) + Vue.component('CommonTable', CommonTable) } } diff --git a/src/messages/common_cn.js b/src/messages/common_cn.js index db4ecc2..28bce54 100644 --- a/src/messages/common_cn.js +++ b/src/messages/common_cn.js @@ -21,6 +21,8 @@ common.label.personalCenter = '个人中心' common.label.personalInfo = '个人资料' common.label.about = '关于' common.label.logout = '退出' +common.label.submit = '提交' +common.label.reset = '重置' //* =======================msg=====================// common.msg.nonNull = '{0}不能为空' diff --git a/src/messages/common_en.js b/src/messages/common_en.js index a33ffce..4bbe482 100644 --- a/src/messages/common_en.js +++ b/src/messages/common_en.js @@ -21,6 +21,8 @@ common.label.personalCenter = 'Personal Center' common.label.personalInfo = 'Personal Info' common.label.about = 'About' common.label.logout = 'Logout' +common.label.submit = 'Submit' +common.label.reset = 'Reset' //* =======================msg=====================// common.msg.nonNull = '{0} is required.' diff --git a/src/views/components/global/GlobalSettings.vue b/src/views/components/global/GlobalSettings.vue index 54a598f..4b0084d 100644 --- a/src/views/components/global/GlobalSettings.vue +++ b/src/views/components/global/GlobalSettings.vue @@ -88,6 +88,7 @@ const options = [