fix paste bugs

This commit is contained in:
samunohito 2024-02-18 15:14:52 +09:00
parent 38b4197395
commit bfdfc2c778
2 changed files with 7 additions and 12 deletions

View File

@ -296,15 +296,10 @@ function setupGrid(): GridSetting {
bindTo: 'url', icon: 'ti-icons', type: 'image', editable: true, width: 'auto', validators: [required], bindTo: 'url', icon: 'ti-icons', type: 'image', editable: true, width: 'auto', validators: [required],
customValueEditor: async (row, col, value, cellElement) => { customValueEditor: async (row, col, value, cellElement) => {
const file = await selectFile(cellElement); const file = await selectFile(cellElement);
if (file) { gridItems.value[row.index].url = file.url;
gridItems.value[row.index].url = file.url; gridItems.value[row.index].fileId = file.id;
gridItems.value[row.index].fileId = file.id;
} else {
gridItems.value[row.index].url = '';
gridItems.value[row.index].fileId = undefined;
}
return file ? file.url : ''; return file.url;
}, },
}, },
{ bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required, regex] }, { bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required, regex] },
@ -317,8 +312,8 @@ function setupGrid(): GridSetting {
bindTo: 'roleIdsThatCanBeUsedThisEmojiAsReaction', title: 'role', type: 'text', editable: true, width: 140, bindTo: 'roleIdsThatCanBeUsedThisEmojiAsReaction', title: 'role', type: 'text', editable: true, width: 140,
valueTransformer: (row) => { valueTransformer: (row) => {
// IDID // IDID
return gridItems.value[row.index].roleIdsThatCanBeUsedThisEmojiAsReaction return (gridItems.value[row.index].roleIdsThatCanBeUsedThisEmojiAsReaction ?? [])
.map(({ name }) => name) .map((it) => it.name)
.join(','); .join(',');
}, },
customValueEditor: async (row) => { customValueEditor: async (row) => {

View File

@ -163,8 +163,8 @@ function setupGrid(): GridSetting {
bindTo: 'roleIdsThatCanBeUsedThisEmojiAsReaction', title: 'role', type: 'text', editable: true, width: 140, bindTo: 'roleIdsThatCanBeUsedThisEmojiAsReaction', title: 'role', type: 'text', editable: true, width: 140,
valueTransformer: (row) => { valueTransformer: (row) => {
// IDID // IDID
return gridItems.value[row.index].roleIdsThatCanBeUsedThisEmojiAsReaction return (gridItems.value[row.index].roleIdsThatCanBeUsedThisEmojiAsReaction ?? [])
.map(({ name }) => name) .map((it) => it.name)
.join(','); .join(',');
}, },
customValueEditor: async (row) => { customValueEditor: async (row) => {