fix: update widget name rules and the association selector options (#119)

This commit is contained in:
Fine0830
2022-07-14 16:40:06 +08:00
committed by GitHub
parent b5c07e023b
commit e144b43267
5 changed files with 12 additions and 12 deletions

View File

@@ -51,9 +51,15 @@ const widgets = computed(() => {
const items = widgets.filter(
(d: { value: string; label: string } & LayoutConfig) => {
if (dashboardStore.selectedGrid.id !== d.id) {
if (isLinear && d.type === "Widget" && d.widget && d.id) {
if (
isLinear &&
d.type === "Widget" &&
d.widget &&
d.widget.name &&
d.id
) {
d.value = d.id;
d.label = d.widget.name || d.id;
d.label = d.widget.name;
return d;
}
// if (isRank && d.type !== "Widget" && d.widget && d.id) {

View File

@@ -74,7 +74,7 @@ function updateWidgetConfig(param: { [key: string]: string }) {
function updateWidgetName(param: { [key: string]: string }) {
const key = Object.keys(param)[0];
const n = decodeURIComponent(param[key]);
const pattern = /^[A-Za-z0-9-_\u4e00-\u9fa5]{1,30}$/;
const pattern = /^[A-Za-z0-9-_\u4e00-\u9fa5]{1,300}$/;
if (!pattern.test(n)) {
ElMessage.error(t("nameTip"));
return;