|
@@ -1,6 +1,6 @@
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, onMounted, watch } from 'vue'
|
|
|
|
-import { showToast } from '@/components/toast'
|
|
|
|
|
|
+import { ref, onMounted, watch, getCurrentInstance } from 'vue'
|
|
|
|
+const that = getCurrentInstance().proxy
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
// 要回显的分组id
|
|
// 要回显的分组id
|
|
@@ -85,10 +85,10 @@ function onAddAction() {
|
|
// 新增分组确认方法
|
|
// 新增分组确认方法
|
|
function onAddConfirm() {
|
|
function onAddConfirm() {
|
|
if (!newGroupName.value) {
|
|
if (!newGroupName.value) {
|
|
- return showToast('请输入分组名称')
|
|
|
|
|
|
+ return that.$toast('请输入分组名称')
|
|
}
|
|
}
|
|
if (groupList.value.some((v) => v.name === newGroupName.value)) {
|
|
if (groupList.value.some((v) => v.name === newGroupName.value)) {
|
|
- return showToast('分组名称已存在')
|
|
|
|
|
|
+ return that.$toast('分组名称已存在')
|
|
}
|
|
}
|
|
const newItem = {
|
|
const newItem = {
|
|
// id: Math.random(),
|
|
// id: Math.random(),
|
|
@@ -122,10 +122,10 @@ function onItemInput(event, item) {
|
|
function onItemConfirm(item) {
|
|
function onItemConfirm(item) {
|
|
const list = groupList.value
|
|
const list = groupList.value
|
|
if (!item.input) {
|
|
if (!item.input) {
|
|
- return showToast('请输入分组名称')
|
|
|
|
|
|
+ return that.$toast('请输入分组名称')
|
|
}
|
|
}
|
|
if (list.some((v) => v.name === item.input)) {
|
|
if (list.some((v) => v.name === item.input)) {
|
|
- return showToast('分组名称已存在')
|
|
|
|
|
|
+ return that.$toast('分组名称已存在')
|
|
}
|
|
}
|
|
item.name = item.input
|
|
item.name = item.input
|
|
item.showEdit = false
|
|
item.showEdit = false
|