fix: 修改按标签
This commit is contained in:
parent
048d8508a6
commit
04ad3d4689
|
|
@ -123,6 +123,11 @@ const onTagSelect = (_data: any, _index: number) => {
|
||||||
const indexType = tagList.value[_index].type;
|
const indexType = tagList.value[_index].type;
|
||||||
const _item = handleItem({ ..._data, value: undefined, type: indexType })
|
const _item = handleItem({ ..._data, value: undefined, type: indexType })
|
||||||
tagList.value[_index] = _item
|
tagList.value[_index] = _item
|
||||||
|
onValueChange()
|
||||||
|
};
|
||||||
|
|
||||||
|
const onValueChange = () => {
|
||||||
|
// const _data = tagList.value.filter((item) => item?.value !== undefined);
|
||||||
const newValue = tagList.value.map((item: any) => {
|
const newValue = tagList.value.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
column: item.id,
|
column: item.id,
|
||||||
|
|
@ -134,19 +139,6 @@ const onTagSelect = (_data: any, _index: number) => {
|
||||||
emits('change', [{ value: newValue, name: '标签' }], tagList.value);
|
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(
|
watch(
|
||||||
() => [props.tagData, props.value],
|
() => [props.tagData, props.value],
|
||||||
([newTag, newVal]) => {
|
([newTag, newVal]) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue