fix: 修改按标签

This commit is contained in:
100011797 2023-03-30 14:24:22 +08:00
parent 048d8508a6
commit 04ad3d4689
1 changed files with 5 additions and 13 deletions

View File

@ -123,6 +123,11 @@ const onTagSelect = (_data: any, _index: number) => {
const indexType = tagList.value[_index].type;
const _item = handleItem({ ..._data, value: undefined, type: indexType })
tagList.value[_index] = _item
onValueChange()
};
const onValueChange = () => {
// const _data = tagList.value.filter((item) => item?.value !== undefined);
const newValue = tagList.value.map((item: any) => {
return {
column: item.id,
@ -134,19 +139,6 @@ const onTagSelect = (_data: any, _index: number) => {
emits('change', [{ value: newValue, name: '标签' }], tagList.value);
};
const onValueChange = () => {
const _data = tagList.value.filter((item) => item?.value !== undefined);
const newValue = _data.map((item: any) => {
return {
column: item.id,
type: item?.type,
value: item?.value,
};
});
emits('update:value', [{ value: newValue, name: '标签' }]);
emits('change', [{ value: newValue, name: '标签' }], _data);
};
watch(
() => [props.tagData, props.value],
([newTag, newVal]) => {