|
@@ -1,5 +1,5 @@
|
|
|
<script setup lang="tsx">
|
|
<script setup lang="tsx">
|
|
|
-import { nextTick, ref } from 'vue';
|
|
|
|
|
|
|
+import { nextTick, ref, useTemplateRef } from 'vue';
|
|
|
import { NButton, NImage } from 'naive-ui';
|
|
import { NButton, NImage } from 'naive-ui';
|
|
|
import type { InternalRowData } from 'naive-ui/es/data-table/src/interface';
|
|
import type { InternalRowData } from 'naive-ui/es/data-table/src/interface';
|
|
|
import { fetchGetAllStoreList, fetchGetDeskCategoryList, fetchUpdateCategory } from '@/service/api/goods/desk-category';
|
|
import { fetchGetAllStoreList, fetchGetDeskCategoryList, fetchUpdateCategory } from '@/service/api/goods/desk-category';
|
|
@@ -7,9 +7,11 @@ import { fetchGetAllTagList } from '@/service/api/goods/tag';
|
|
|
import { useAppStore } from '@/store/modules/app';
|
|
import { useAppStore } from '@/store/modules/app';
|
|
|
import { useModalFrom } from '@/components/zt/ModalForm/hooks/useModalForm';
|
|
import { useModalFrom } from '@/components/zt/ModalForm/hooks/useModalForm';
|
|
|
import { useForm } from '@/components/zt/Form/hooks/useForm';
|
|
import { useForm } from '@/components/zt/Form/hooks/useForm';
|
|
|
|
|
+import RelatedGoodsModal from './components/related-goods-modal.vue';
|
|
|
const appStore = useAppStore();
|
|
const appStore = useAppStore();
|
|
|
const deskData = ref<Api.goods.ShopCategory[]>([]);
|
|
const deskData = ref<Api.goods.ShopCategory[]>([]);
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
|
|
+const relatedGoodsModalRef = useTemplateRef('relatedGoodsModalRef');
|
|
|
const [registerSearchForm, { getFieldsValue: getSearchForm }] = useForm({
|
|
const [registerSearchForm, { getFieldsValue: getSearchForm }] = useForm({
|
|
|
schemas: [
|
|
schemas: [
|
|
|
{
|
|
{
|
|
@@ -75,10 +77,15 @@ const tableColumns: NaiveUI.TableColumn<InternalRowData>[] = [
|
|
|
render: row => (
|
|
render: row => (
|
|
|
<div class="flex-center gap-8px">
|
|
<div class="flex-center gap-8px">
|
|
|
{row.level == 1 && (
|
|
{row.level == 1 && (
|
|
|
- <NButton type="primary" ghost size="small" onClick={() => edit(row)}>
|
|
|
|
|
|
|
+ <NButton type="primary" size="small" quaternary onClick={() => edit(row)}>
|
|
|
编辑
|
|
编辑
|
|
|
</NButton>
|
|
</NButton>
|
|
|
)}
|
|
)}
|
|
|
|
|
+ {row.level == 2 && (
|
|
|
|
|
+ <NButton type="primary" size="small" quaternary onClick={() => handleClick()}>
|
|
|
|
|
+ 关联商品
|
|
|
|
|
+ </NButton>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -177,6 +184,9 @@ async function handleSubmitForm() {
|
|
|
getData();
|
|
getData();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+function handleClick() {
|
|
|
|
|
+ relatedGoodsModalRef.value?.openModal();
|
|
|
|
|
+}
|
|
|
// function handleOpen() {
|
|
// function handleOpen() {
|
|
|
// importTemplateRef.value?.openModal();
|
|
// importTemplateRef.value?.openModal();
|
|
|
// }
|
|
// }
|
|
@@ -271,6 +281,7 @@ function buildTree<T>(items: T[], options: BuildTreeOptions = {}): T[] {
|
|
|
></ZImportTemplate>
|
|
></ZImportTemplate>
|
|
|
-->
|
|
-->
|
|
|
<BasicModelForm @register-modal-form="registerModalForm" @submit-form="handleSubmitForm"></BasicModelForm>
|
|
<BasicModelForm @register-modal-form="registerModalForm" @submit-form="handleSubmitForm"></BasicModelForm>
|
|
|
|
|
+ <RelatedGoodsModal ref="relatedGoodsModalRef"></RelatedGoodsModal>
|
|
|
</LayoutTable>
|
|
</LayoutTable>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|