style(系统设置): 统一修改弹窗确认和取消按钮间距&插件按钮换行问题

This commit is contained in:
xinxin.wu 2023-08-23 18:25:32 +08:00 committed by 刘瑞斌
parent 59ae66ceef
commit a0d65b3e92
9 changed files with 87 additions and 56 deletions

View File

@ -4,7 +4,7 @@
title-align="start" title-align="start"
:class="['ms-modal-form', `ms-modal-${props.dialogSize}`]" :class="['ms-modal-form', `ms-modal-${props.dialogSize}`]"
v-bind="attrs" v-bind="attrs"
:footer="props.showfooter" :footer="props.footer"
:mask-closable="false" :mask-closable="false"
@close="handleCancel" @close="handleCancel"
> >
@ -54,7 +54,6 @@
const { t } = useI18n(); const { t } = useI18n();
export type buttontype = 'text' | 'dashed' | 'outline' | 'primary' | 'secondary';
export type SizeType = 'medium' | 'large' | 'small'; export type SizeType = 'medium' | 'large' | 'small';
export interface SwitchProps { export interface SwitchProps {
switchTooltip?: string; // switchTooltip?: string; //
@ -64,7 +63,7 @@
} }
export type DialogType = Partial<{ export type DialogType = Partial<{
showfooter: boolean; // footer footer: boolean; // footer
showCancel: boolean; // showCancel: boolean; //
okText: string; // okText: string; //
cancelText: string; // cancelText: string; //
@ -73,18 +72,19 @@
}> & { }> & {
dialogSize: SizeType; // medium large small dialogSize: SizeType; // medium large small
title: string; title: string;
confirm: (enable: boolean | undefined) => void; // confirm?: (enable: boolean | undefined) => void; //
visible: boolean; visible: boolean;
loading: boolean; loading: boolean;
close: () => void; close: () => void;
}; };
const props = withDefaults(defineProps<DialogType>(), { const props = withDefaults(defineProps<DialogType>(), {
showfooter: true, footer: true,
showCancel: true, showCancel: true,
title: '', title: '',
disabledOk: false, disabledOk: false,
close: Function, close: Function,
confirm: undefined,
}); });
const emits = defineEmits<{ const emits = defineEmits<{
(event: 'close'): void; (event: 'close'): void;

View File

@ -55,12 +55,10 @@
</a-form> </a-form>
</div> </div>
<template #footer> <template #footer>
<a-space> <a-button type="secondary" @click="handleCancel">{{ t('organization.member.Cancel') }}</a-button>
<a-button type="secondary" @click="handleCancel">{{ t('organization.member.Cancel') }}</a-button> <a-button class="ml-[12px]" type="primary" :loading="confirmLoading" @click="handleOK">
<a-button type="primary" :loading="confirmLoading" @click="handleOK"> {{ t('organization.member.Confirm') }}
{{ t('organization.member.Confirm') }} </a-button>
</a-button>
</a-space>
</template> </template>
</a-modal> </a-modal>
</template> </template>

View File

@ -229,7 +229,9 @@
const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getMemberList, { const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getMemberList, {
tableKey: TableKeyEnum.ORGANNATIONMEMBER, tableKey: TableKeyEnum.ORGANNATIONMEMBER,
scroll: { x: 1600 }, scroll: { x: 1600 },
size: 'default',
selectable: true, selectable: true,
showSetting: true,
}); });
const keyword = ref(''); const keyword = ref('');
const tableSelected = ref<(string | number)[]>([]); const tableSelected = ref<(string | number)[]>([]);

View File

@ -22,15 +22,15 @@
<icon-question-circle class="ml-2 text-[--color-text-4]" /> <icon-question-circle class="ml-2 text-[--color-text-4]" />
</a-tooltip> </a-tooltip>
</div> </div>
<a-space> <div>
<a-button type="secondary" @click="handleCancel">{{ t('organization.service.Cancel') }}</a-button> <a-button type="secondary" @click="handleCancel">{{ t('organization.service.Cancel') }}</a-button>
<a-button type="outline" :loading="testLoading" @click="testLink">{{ <a-button class="ml-[12px]" type="outline" :loading="testLoading" @click="testLink">{{
t('organization.service.testLink') t('organization.service.testLink')
}}</a-button> }}</a-button>
<a-button type="primary" :loading="loading" @click="saveHandler">{{ <a-button class="ml-[12px]" type="primary" :loading="loading" @click="saveHandler">{{
t('organization.service.Confirm') t('organization.service.Confirm')
}}</a-button> }}</a-button>
</a-space> </div>
</div> </div>
</template> </template>
</a-modal> </a-modal>

View File

@ -24,7 +24,7 @@
<a-table <a-table
:data="filterData" :data="filterData"
:pagination="false" :pagination="false"
:scroll="{ y: 360, x: 2400, maxHeight: 200 }" :scroll="{ y: 360, x: 2000, maxHeight: 200 }"
:expandable="expandable" :expandable="expandable"
:loading="loading" :loading="loading"
row-key="id" row-key="id"
@ -47,6 +47,8 @@
:title="t('system.plugin.tableColumnsDescription')" :title="t('system.plugin.tableColumnsDescription')"
data-index="description" data-index="description"
:ellipsis="true" :ellipsis="true"
:tooltip="true"
:width="150"
/> />
<a-table-column :title="t('system.plugin.tableColumnsStatus')"> <a-table-column :title="t('system.plugin.tableColumnsStatus')">
<template #cell="{ record }"> <template #cell="{ record }">
@ -61,9 +63,7 @@
</template> </template>
</a-table-column> </a-table-column>
<a-table-column :title="t('system.plugin.tableColumnsApplicationScene')" data-index="scenario"> <a-table-column :title="t('system.plugin.tableColumnsApplicationScene')" data-index="scenario">
<template #cell="{ record }">{{ <template #cell="{ record }">{{ getScenarioType(record.scenario) }}</template>
record.scenario === 'API' ? t('system.plugin.interfaceTest') : t('system.plugin.projectManagement')
}}</template>
</a-table-column> </a-table-column>
<a-table-column :title="t('system.plugin.tableColumnsOrg')" :width="300"> <a-table-column :title="t('system.plugin.tableColumnsOrg')" :width="300">
<template #cell="{ record }"> <template #cell="{ record }">
@ -90,40 +90,48 @@
</a-table-column> </a-table-column>
<a-table-column <a-table-column
:title="t('system.plugin.tableColumnsDescription')" :title="t('system.plugin.tableColumnsDescription')"
data-index="fileName"
:width="300"
:ellipsis="true" :ellipsis="true"
:tooltip="true"
data-index="fileName"
/> />
<a-table-column <a-table-column
:title="t('system.plugin.tableColumnsVersion')" :title="t('system.plugin.tableColumnsVersion')"
data-index="pluginId" data-index="pluginId"
:width="300" :width="200"
:ellipsis="true" :ellipsis="true"
:tooltip="true"
/> />
<a-table-column :title="t('system.plugin.tableColumnsAuthorization')"> <a-table-column :title="t('system.plugin.tableColumnsAuthorization')" :width="180">
<template #cell="{ record }"> <template #cell="{ record }">
<span>{{ <span>{{
record.xpack ? t('system.plugin.uploadOpenSource') : t('system.plugin.uploadCompSource') record.xpack ? t('system.plugin.uploadCompSource') : t('system.plugin.uploadOpenSource')
}}</span> }}</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column :title="t('system.plugin.tableColumnsCreatedBy')" data-index="createUser" /> <a-table-column
:title="t('system.plugin.tableColumnsCreatedBy')"
:ellipsis="true"
:tooltip="true"
data-index="createUser"
/>
<a-table-column :title="t('system.plugin.tableColumnsUpdateTime')" :width="200"> <a-table-column :title="t('system.plugin.tableColumnsUpdateTime')" :width="200">
<template #cell="{ record }"> <template #cell="{ record }">
<span>{{ getTime(record.updateTime) }}</span> <span>{{ getTime(record.updateTime) }}</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column :width="200" fixed="right" align="center" :bordered="false"> <a-table-column :width="180" fixed="right" :bordered="false">
<template #title> <template #title>
{{ t('system.plugin.tableColumnsActions') }} {{ t('system.plugin.tableColumnsActions') }}
</template> </template>
<template #cell="{ record }"> <template #cell="{ record }">
<MsButton @click="update(record)">{{ t('system.plugin.edit') }}</MsButton> <div class="flex">
<MsButton v-if="record.enable" @click="disableHandler(record)">{{ <MsButton @click="update(record)">{{ t('system.plugin.edit') }}</MsButton>
t('system.plugin.tableDisable') <MsButton v-if="record.enable" @click="disableHandler(record)">{{
}}</MsButton> t('system.plugin.tableDisable')
<MsButton v-else @click="enableHandler(record)">{{ t('system.plugin.tableEnable') }}</MsButton> }}</MsButton>
<MsTableMoreAction :list="tableActions" @select="handleSelect($event, record)"></MsTableMoreAction> <MsButton v-else @click="enableHandler(record)">{{ t('system.plugin.tableEnable') }}</MsButton>
<MsTableMoreAction :list="tableActions" @select="handleSelect($event, record)"></MsTableMoreAction>
</div>
</template> </template>
</a-table-column> </a-table-column>
</template> </template>
@ -143,14 +151,14 @@
> >
<UploadModel <UploadModel
v-model:visible="uploadVisible" v-model:visible="uploadVisible"
:originize-list="originizeList" :organize-list="organizeList"
@success="okHandler" @success="okHandler"
@brash="loadData()" @brash="loadData()"
/> />
<UpdatePluginModal <UpdatePluginModal
ref="updateModalRef" ref="updateModalRef"
v-model:visible="updateVisible" v-model:visible="updateVisible"
:originize-list="originizeList" :organize-list="organizeList"
@success="loadData()" @success="loadData()"
/> />
<scriptDetailDrawer v-model:visible="showDrawer" :value="detailYaml" :config="config" :read-only="true" /> <scriptDetailDrawer v-model:visible="showDrawer" :value="detailYaml" :config="config" :read-only="true" />
@ -226,6 +234,10 @@
label: 'system.plugin.projectManagement', label: 'system.plugin.projectManagement',
value: 'PLATFORM', value: 'PLATFORM',
}, },
{
label: 'system.plugin.databaseDriver',
value: 'JDBC_DRIVER',
},
]); ]);
const uploadVisible = ref<boolean>(false); const uploadVisible = ref<boolean>(false);
const updateVisible = ref<boolean>(false); const updateVisible = ref<boolean>(false);
@ -283,6 +295,20 @@
break; break;
} }
} }
function getScenarioType(scenario: string) {
switch (scenario) {
case 'API':
return t('system.plugin.interfaceTest');
case 'JDBC_DRIVER':
return t('system.plugin.databaseDriver');
case 'PLATFORM':
return t('system.plugin.projectManagement');
default:
break;
}
}
function uploadPlugin() { function uploadPlugin() {
uploadVisible.value = true; uploadVisible.value = true;
} }
@ -382,10 +408,10 @@
Object.assign(expandedRowKeys, [rowKey]); Object.assign(expandedRowKeys, [rowKey]);
}; };
const originizeList = ref<SelectOptionData>([]); const organizeList = ref<SelectOptionData>([]);
onBeforeMount(async () => { onBeforeMount(async () => {
loadData(); loadData();
originizeList.value = await getSystemOrgOption(); organizeList.value = await getSystemOrgOption();
}); });
</script> </script>

View File

@ -22,15 +22,15 @@
field="organizationIds" field="organizationIds"
:label="t('system.plugin.selectOrganization')" :label="t('system.plugin.selectOrganization')"
asterisk-position="end" asterisk-position="end"
:rules="[{ required: true, message: t('system.plugin.selectOriginize') }]" :rules="[{ required: true, message: t('system.plugin.selectOrganizeTip') }]"
> >
<a-select <a-select
v-model="form.organizationIds" v-model="form.organizationIds"
multiple multiple
:placeholder="t('system.plugin.selectOriginize')" :placeholder="t('system.plugin.selectOrganizeTip')"
allow-clear allow-clear
> >
<a-option v-for="item of originizeList" :key="item.id" :value="item.id">{{ item.name }}</a-option> <a-option v-for="item of organizeList" :key="item.id" :value="item.id">{{ item.name }}</a-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item field="description" :label="t('system.plugin.description')" asterisk-position="end"> <a-form-item field="description" :label="t('system.plugin.description')" asterisk-position="end">
@ -40,7 +40,7 @@
</div> </div>
<template #footer> <template #footer>
<a-button type="secondary" @click="handleCancel">{{ t('system.plugin.pluginCancel') }}</a-button> <a-button type="secondary" @click="handleCancel">{{ t('system.plugin.pluginCancel') }}</a-button>
<a-button type="primary" :loading="confirmLoading" @click="handleOk"> <a-button class="ml-[12px]" type="primary" :loading="confirmLoading" @click="handleOk">
{{ t('system.plugin.pluginConfirm') }} {{ t('system.plugin.pluginConfirm') }}
</a-button> </a-button>
</template> </template>
@ -57,7 +57,7 @@
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps<{ const props = defineProps<{
visible: boolean; visible: boolean;
originizeList: SelectOptionData; organizeList: SelectOptionData;
}>(); }>();
const emits = defineEmits<{ const emits = defineEmits<{
(e: 'success'): void; (e: 'success'): void;

View File

@ -39,15 +39,15 @@
field="organizationIds" field="organizationIds"
:label="t('system.plugin.selectOrganization')" :label="t('system.plugin.selectOrganization')"
asterisk-position="end" asterisk-position="end"
:rules="[{ required: true, message: t('system.plugin.selectOriginize') }]" :rules="[{ required: true, message: t('system.plugin.selectOrganizeTip') }]"
> >
<a-select <a-select
v-model="form.organizationIds" v-model="form.organizationIds"
multiple multiple
:placeholder="t('system.plugin.selectOriginize')" :placeholder="t('system.plugin.selectOrganizeTip')"
allow-clear allow-clear
> >
<a-option v-for="item of originizeList" :key="item.id" :value="item.id">{{ item.name }}</a-option> <a-option v-for="item of organizeList" :key="item.id" :value="item.id">{{ item.name }}</a-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item field="describe" :label="t('system.plugin.description')" asterisk-position="end"> <a-form-item field="describe" :label="t('system.plugin.description')" asterisk-position="end">
@ -90,15 +90,18 @@
</a-tooltip> </a-tooltip>
</div> </div>
<div> <div>
<a-space> <a-button type="secondary" @click="handleCancel">{{ t('system.plugin.pluginCancel') }}</a-button>
<a-button type="secondary" @click="handleCancel">{{ t('system.plugin.pluginCancel') }}</a-button> <a-button
<a-button type="secondary" :disabled="isDisabled" :loading="saveLoading" @click="saveAndAddPlugin">{{ class="mx-[12px]"
t('system.plugin.saveAndAdd') type="secondary"
}}</a-button> :disabled="isDisabled"
<a-button type="primary" :disabled="isDisabled" :loading="confirmLoading" @click="saveConfirm">{{ :loading="saveLoading"
t('system.plugin.pluginConfirm') @click="saveAndAddPlugin"
}}</a-button> >{{ t('system.plugin.saveAndAdd') }}</a-button
</a-space> >
<a-button type="primary" :disabled="isDisabled" :loading="confirmLoading" @click="saveConfirm">{{
t('system.plugin.pluginConfirm')
}}</a-button>
</div> </div>
</div> </div>
</template> </template>
@ -122,7 +125,7 @@
}>(); }>();
const props = defineProps<{ const props = defineProps<{
visible: boolean; visible: boolean;
originizeList: SelectOptionData; organizeList: SelectOptionData;
}>(); }>();
const pluginVisible = ref(false); const pluginVisible = ref(false);
const fileName = ref<string>(''); const fileName = ref<string>('');

View File

@ -54,7 +54,7 @@ export default {
'system.plugin.pluginPreStep': 'Previous Step', 'system.plugin.pluginPreStep': 'Previous Step',
'system.plugin.saveAndAdd': 'Save & Continue', 'system.plugin.saveAndAdd': 'Save & Continue',
'system.plugin.updateTitle': 'Update Plugin{name}', 'system.plugin.updateTitle': 'Update Plugin{name}',
'system.plugin.selectOriginize': 'Please Choose Organization', 'system.plugin.selectOrganizeTip': 'Please Choose Organization',
'system.plugin.selectOrganization': 'Choose Organization', 'system.plugin.selectOrganization': 'Choose Organization',
'system.plugin.infoTip': 'Jump to the Github download plug-in', 'system.plugin.infoTip': 'Jump to the Github download plug-in',
'system.plugin.getPlugin': 'Gets the open source plug-in', 'system.plugin.getPlugin': 'Gets the open source plug-in',
@ -101,6 +101,7 @@ export default {
'system.plugin.all': 'All', 'system.plugin.all': 'All',
'system.plugin.projectManagement': 'Project Management', 'system.plugin.projectManagement': 'Project Management',
'system.plugin.pluginStatus': 'Status', 'system.plugin.pluginStatus': 'Status',
'system.plugin.databaseDriver': 'Database Driver',
'system.plugin.deleteContentTip': 'system.plugin.deleteContentTip':
'After deletion, the defects/requirements of the platform cannot be synchronized, and the historical data is automatically switched to other templates. Please exercise caution!', 'After deletion, the defects/requirements of the platform cannot be synchronized, and the historical data is automatically switched to other templates. Please exercise caution!',
}; };

View File

@ -42,7 +42,7 @@ export default {
'system.plugin.pluginPreStep': '上一步', 'system.plugin.pluginPreStep': '上一步',
'system.plugin.saveAndAdd': '保存并继续添加', 'system.plugin.saveAndAdd': '保存并继续添加',
'system.plugin.updateTitle': '更新插件({name}', 'system.plugin.updateTitle': '更新插件({name}',
'system.plugin.selectOriginize': '请选择组织', 'system.plugin.selectOrganizeTip': '请选择组织',
'system.plugin.selectOrganization': '选择组织', 'system.plugin.selectOrganization': '选择组织',
'system.plugin.infoTip': '跳转至Github下载插件', 'system.plugin.infoTip': '跳转至Github下载插件',
'system.plugin.getPlugin': '获取开源插件', 'system.plugin.getPlugin': '获取开源插件',
@ -81,5 +81,6 @@ export default {
'system.plugin.all': '全部', 'system.plugin.all': '全部',
'system.plugin.projectManagement': '项目管理', 'system.plugin.projectManagement': '项目管理',
'system.plugin.pluginStatus': '插件状态', 'system.plugin.pluginStatus': '插件状态',
'system.plugin.databaseDriver': '数据库驱动',
'system.plugin.deleteContentTip': '删除后,将无法同步该平台的缺陷/需求,历史数据自动切换为其它模板展示,请谨慎操作!', 'system.plugin.deleteContentTip': '删除后,将无法同步该平台的缺陷/需求,历史数据自动切换为其它模板展示,请谨慎操作!',
}; };