Commit a53622e0 authored by LiXuyang's avatar LiXuyang

标签-图像分析

parent 4bd1a098
...@@ -23,7 +23,7 @@ export const labelTreeData = [ ...@@ -23,7 +23,7 @@ export const labelTreeData = [
{ {
title: '模板主体1', title: '模板主体1',
key: '0-0-0-0', key: '0-0-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '模板主体1', name: '模板主体1',
relationBody: '主体-测试', relationBody: '主体-测试',
labelType: '衍生标签', labelType: '衍生标签',
...@@ -37,7 +37,7 @@ export const labelTreeData = [ ...@@ -37,7 +37,7 @@ export const labelTreeData = [
{ {
title: '模板主体测试1', title: '模板主体测试1',
key: '0-0-0-1', key: '0-0-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '模板主体测试1', name: '模板主体测试1',
relationBody: '主体-测试', relationBody: '主体-测试',
labelType: '原子标签', labelType: '原子标签',
...@@ -59,7 +59,7 @@ export const labelTreeData = [ ...@@ -59,7 +59,7 @@ export const labelTreeData = [
{ {
title: '模板主体-测试1', title: '模板主体-测试1',
key: '0-0-0-2-0', key: '0-0-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '模板主体-测试1', name: '模板主体-测试1',
relationBody: '主体-测试', relationBody: '主体-测试',
labelType: '原子标签', labelType: '原子标签',
...@@ -85,7 +85,7 @@ export const labelTreeData = [ ...@@ -85,7 +85,7 @@ export const labelTreeData = [
{ {
title: '模板部门主体1', title: '模板部门主体1',
key: '0-0-1-0', key: '0-0-1-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '模板部门主体1', name: '模板部门主体1',
relationBody: '部门主体', relationBody: '部门主体',
labelType: '原子标签', labelType: '原子标签',
...@@ -99,7 +99,7 @@ export const labelTreeData = [ ...@@ -99,7 +99,7 @@ export const labelTreeData = [
{ {
title: '模板部门主体测试1', title: '模板部门主体测试1',
key: '0-0-1-1', key: '0-0-1-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '模板部门主体测试1', name: '模板部门主体测试1',
relationBody: '部门主体', relationBody: '部门主体',
labelType: '原子标签', labelType: '原子标签',
...@@ -121,7 +121,7 @@ export const labelTreeData = [ ...@@ -121,7 +121,7 @@ export const labelTreeData = [
{ {
title: '模板部门主体-测试1', title: '模板部门主体-测试1',
key: '0-0-1-2-0', key: '0-0-1-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '模板部门主体-测试1', name: '模板部门主体-测试1',
relationBody: '部门主体', relationBody: '部门主体',
labelType: '原子标签', labelType: '原子标签',
...@@ -157,7 +157,7 @@ export const labelTreeData = [ ...@@ -157,7 +157,7 @@ export const labelTreeData = [
{ {
title: '共享1测试', title: '共享1测试',
key: '0-1-0-0', key: '0-1-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '共享1测试', name: '共享1测试',
relationBody: '共享区1', relationBody: '共享区1',
labelType: '原子标签', labelType: '原子标签',
...@@ -171,7 +171,7 @@ export const labelTreeData = [ ...@@ -171,7 +171,7 @@ export const labelTreeData = [
{ {
title: '共享1-2', title: '共享1-2',
key: '0-1-0-1', key: '0-1-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '共享1-2', name: '共享1-2',
relationBody: '共享区1', relationBody: '共享区1',
labelType: '原子标签', labelType: '原子标签',
...@@ -193,7 +193,7 @@ export const labelTreeData = [ ...@@ -193,7 +193,7 @@ export const labelTreeData = [
{ {
title: '包测试3', title: '包测试3',
key: '0-1-0-2-0', key: '0-1-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '包测试3', name: '包测试3',
relationBody: '共享区1', relationBody: '共享区1',
labelType: '原子标签', labelType: '原子标签',
...@@ -219,7 +219,7 @@ export const labelTreeData = [ ...@@ -219,7 +219,7 @@ export const labelTreeData = [
{ {
title: '经济', title: '经济',
key: '0-1-1-0', key: '0-1-1-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '经济', name: '经济',
relationBody: '共享区2', relationBody: '共享区2',
labelType: '原子标签', labelType: '原子标签',
...@@ -233,7 +233,7 @@ export const labelTreeData = [ ...@@ -233,7 +233,7 @@ export const labelTreeData = [
{ {
title: '商品', title: '商品',
key: '0-1-1-1', key: '0-1-1-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '商品', name: '商品',
relationBody: '共享区2', relationBody: '共享区2',
labelType: '原子标签', labelType: '原子标签',
...@@ -255,7 +255,7 @@ export const labelTreeData = [ ...@@ -255,7 +255,7 @@ export const labelTreeData = [
{ {
title: '测试标签', title: '测试标签',
key: '0-1-1-2-0', key: '0-1-1-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '测试标签', name: '测试标签',
relationBody: '共享区2', relationBody: '共享区2',
labelType: '原子标签', labelType: '原子标签',
...@@ -301,7 +301,7 @@ export const labelTreeData = [ ...@@ -301,7 +301,7 @@ export const labelTreeData = [
{ {
title: '商城部门1', title: '商城部门1',
key: '1-1-0-0', key: '1-1-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '商城部门1', name: '商城部门1',
relationBody: '部门名单', relationBody: '部门名单',
labelType: '原子标签', labelType: '原子标签',
...@@ -315,7 +315,7 @@ export const labelTreeData = [ ...@@ -315,7 +315,7 @@ export const labelTreeData = [
{ {
title: '部门测试', title: '部门测试',
key: '1-1-0-1', key: '1-1-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '部门测试', name: '部门测试',
relationBody: '部门名单', relationBody: '部门名单',
labelType: '原子标签', labelType: '原子标签',
...@@ -337,7 +337,7 @@ export const labelTreeData = [ ...@@ -337,7 +337,7 @@ export const labelTreeData = [
{ {
title: '测试1', title: '测试1',
key: '1-1-0-2-0', key: '1-1-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '测试1', name: '测试1',
relationBody: '部门名单', relationBody: '部门名单',
labelType: '原子标签', labelType: '原子标签',
...@@ -363,7 +363,7 @@ export const labelTreeData = [ ...@@ -363,7 +363,7 @@ export const labelTreeData = [
{ {
title: '标签3', title: '标签3',
key: '1-1-1-0', key: '1-1-1-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '标签3', name: '标签3',
relationBody: '标签部门', relationBody: '标签部门',
labelType: '原子标签', labelType: '原子标签',
...@@ -377,7 +377,7 @@ export const labelTreeData = [ ...@@ -377,7 +377,7 @@ export const labelTreeData = [
{ {
title: '部门11', title: '部门11',
key: '1-1-1-1', key: '1-1-1-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '部门11', name: '部门11',
relationBody: '标签部门', relationBody: '标签部门',
labelType: '原子标签', labelType: '原子标签',
...@@ -399,7 +399,7 @@ export const labelTreeData = [ ...@@ -399,7 +399,7 @@ export const labelTreeData = [
{ {
title: '测试3', title: '测试3',
key: '1-1-1-2-0', key: '1-1-1-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '测试3', name: '测试3',
relationBody: '标签部门', relationBody: '标签部门',
labelType: '原子标签', labelType: '原子标签',
...@@ -445,7 +445,7 @@ export const labelTreeData = [ ...@@ -445,7 +445,7 @@ export const labelTreeData = [
{ {
title: '员工', title: '员工',
key: '2-0-0-0', key: '2-0-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '员工', name: '员工',
relationBody: '主要3', relationBody: '主要3',
labelType: '原子标签', labelType: '原子标签',
...@@ -459,7 +459,7 @@ export const labelTreeData = [ ...@@ -459,7 +459,7 @@ export const labelTreeData = [
{ {
title: '主体', title: '主体',
key: '2-0-0-1', key: '2-0-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '主体', name: '主体',
relationBody: '主要3', relationBody: '主要3',
labelType: '原子标签', labelType: '原子标签',
...@@ -481,7 +481,7 @@ export const labelTreeData = [ ...@@ -481,7 +481,7 @@ export const labelTreeData = [
{ {
title: '试用', title: '试用',
key: '2-0-0-2-0', key: '2-0-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '试用', name: '试用',
relationBody: '主要3', relationBody: '主要3',
labelType: '原子标签', labelType: '原子标签',
...@@ -517,7 +517,7 @@ export const labelTreeData = [ ...@@ -517,7 +517,7 @@ export const labelTreeData = [
{ {
title: '年龄', title: '年龄',
key: '2-1-0-0', key: '2-1-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '年龄', name: '年龄',
relationBody: '主体-测试', relationBody: '主体-测试',
labelType: '原子标签', labelType: '原子标签',
...@@ -531,7 +531,7 @@ export const labelTreeData = [ ...@@ -531,7 +531,7 @@ export const labelTreeData = [
{ {
title: '性别', title: '性别',
key: '2-1-0-1', key: '2-1-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '性别', name: '性别',
relationBody: '主体-测试', relationBody: '主体-测试',
labelType: '原子标签', labelType: '原子标签',
...@@ -553,7 +553,7 @@ export const labelTreeData = [ ...@@ -553,7 +553,7 @@ export const labelTreeData = [
{ {
title: '特殊员工', title: '特殊员工',
key: '2-1-0-2-0', key: '2-1-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '特殊员工', name: '特殊员工',
relationBody: '主体-测试', relationBody: '主体-测试',
labelType: '原子标签', labelType: '原子标签',
...@@ -589,7 +589,7 @@ export const labelTreeData = [ ...@@ -589,7 +589,7 @@ export const labelTreeData = [
{ {
title: '指标', title: '指标',
key: '2-2-0-0', key: '2-2-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '指标', name: '指标',
relationBody: '标签', relationBody: '标签',
labelType: '原子标签', labelType: '原子标签',
...@@ -603,7 +603,7 @@ export const labelTreeData = [ ...@@ -603,7 +603,7 @@ export const labelTreeData = [
{ {
title: '商品', title: '商品',
key: '2-2-0-1', key: '2-2-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '商品', name: '商品',
relationBody: '标签', relationBody: '标签',
labelType: '原子标签', labelType: '原子标签',
...@@ -625,7 +625,7 @@ export const labelTreeData = [ ...@@ -625,7 +625,7 @@ export const labelTreeData = [
{ {
title: '类型3', title: '类型3',
key: '2-2-0-2-0', key: '2-2-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '类型3', name: '类型3',
relationBody: '标签', relationBody: '标签',
labelType: '原子标签', labelType: '原子标签',
...@@ -661,7 +661,7 @@ export const labelTreeData = [ ...@@ -661,7 +661,7 @@ export const labelTreeData = [
{ {
title: '成长', title: '成长',
key: '2-3-0-0', key: '2-3-0-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '成长', name: '成长',
relationBody: '指标', relationBody: '指标',
labelType: '原子标签', labelType: '原子标签',
...@@ -675,7 +675,7 @@ export const labelTreeData = [ ...@@ -675,7 +675,7 @@ export const labelTreeData = [
{ {
title: '指数', title: '指数',
key: '2-3-0-1', key: '2-3-0-1',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '指数', name: '指数',
relationBody: '指标', relationBody: '指标',
labelType: '原子标签', labelType: '原子标签',
...@@ -697,7 +697,7 @@ export const labelTreeData = [ ...@@ -697,7 +697,7 @@ export const labelTreeData = [
{ {
title: '测试3', title: '测试3',
key: '2-3-0-2-0', key: '2-3-0-2-0',
icon: 'ant-design:apartment-outlined', icon: 'ant-design:tag-outlined',
name: '测试3', name: '测试3',
relationBody: '指标', relationBody: '指标',
labelType: '原子标签', labelType: '原子标签',
......
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #path="{ field, model }">
<InputSearch :disabled="true" v-model:value="model[field]" enter-button="选择" @search="handlePath" />
</template>
<template #type="{ field, model }">
<span>{{ model[field] }}</span>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue';
import { InputSearch } from 'ant-design-vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { addFileModalFormSchema } from '@/views/mallResourceDevelopment/label/portraitAnalysis/portrait.data';
const isUpdate = ref(false);
const isMove = ref(false);
const rowId = ref('');
function handlePath() {}
const [registerForm, { getFieldsValue, setFieldsValue, updateSchema, resetFields, validate }] =
useForm({
labelWidth: 100,
baseColProps: { span: 24 },
schemas: addFileModalFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isMove.value = !!data?.isMove;
await setFieldsValue({
path: data.path,
});
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
}
});
// const getTitle = computed(() => (isUpdate.value ? '编辑实体' : '新建实体'));
const getTitle = '转物理模型';
/**确定按钮*/
async function handleSubmit() {
await validate();
closeModal();
}
</script>
...@@ -23,6 +23,7 @@ export const detailFormSchema: FormSchema[] = [ ...@@ -23,6 +23,7 @@ export const detailFormSchema: FormSchema[] = [
{ {
label: '画像样式', label: '画像样式',
field: 'style', field: 'style',
defaultValue: 0,
slot: 'style', slot: 'style',
}, },
]; ];
......
...@@ -5,16 +5,24 @@ ...@@ -5,16 +5,24 @@
<a-button type="primary">保存</a-button> <a-button type="primary">保存</a-button>
</template> </template>
<template #footer> <template #footer>
<div>基本信息</div> <div class="des-title" style="margin: 0 0 20px 30px">基本信息</div>
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<template #style="{ field, model }"> <template #style="{ field, model }">
<div class="flex" style="text-align: center; gap: 10px"> <div class="flex" style="text-align: center; gap: 10px">
<div style="cursor: pointer" @click="model[field] = 0"> <div style="cursor: pointer" @click="model[field] = 0">
<AlignLeftOutlined class="style-icon" :class="model[field] === 0 ? 'check-class' : null" /> <AlignLeftOutlined
class="style-icon"
:class="model[field] === 0 ? 'check-class' : null"
/>
<div>默认</div> <div>默认</div>
</div> </div>
<div style="cursor: pointer" @click="model[field] = 1"> <div style="cursor: pointer" @click="model[field] = 1">
<Icon icon="ion:body-outline" class="style-icon" :class="model[field] === 1 ? 'check-class' : null" style="font-size: 50px" /> <Icon
icon="ion:body-outline"
class="style-icon"
:class="model[field] === 1 ? 'check-class' : null"
style="font-size: 50px"
/>
<div>人物</div> <div>人物</div>
</div> </div>
<div style="cursor: pointer" @click="model[field] = 2"> <div style="cursor: pointer" @click="model[field] = 2">
...@@ -28,7 +36,7 @@ ...@@ -28,7 +36,7 @@
<div class="flex"> <div class="flex">
<div class="w-1/2"> <div class="w-1/2">
<div class="flex justify-between" style="padding: 16px 16px 0 32px"> <div class="flex justify-between" style="padding: 16px 16px 0 32px">
<div style="font-size: 16px; font-weight: bolder">属性</div> <div class="des-title">属性</div>
<a-button type="primary"><PlusOutlined />添加字段</a-button> <a-button type="primary"><PlusOutlined />添加字段</a-button>
</div> </div>
<BasicTable @register="fieldTable"> <BasicTable @register="fieldTable">
...@@ -48,7 +56,7 @@ ...@@ -48,7 +56,7 @@
</div> </div>
<div class="w-1/2"> <div class="w-1/2">
<div class="flex justify-between" style="padding: 16px 16px 0 32px"> <div class="flex justify-between" style="padding: 16px 16px 0 32px">
<div style="font-size: 16px; font-weight: bolder">标签</div> <div class="des-title">标签</div>
<a-button type="primary"><PlusOutlined />添加标签</a-button> <a-button type="primary"><PlusOutlined />添加标签</a-button>
</div> </div>
<BasicTable @register="tagTable"> <BasicTable @register="tagTable">
...@@ -79,7 +87,7 @@ ...@@ -79,7 +87,7 @@
import { ref } from 'vue'; import { ref } from 'vue';
import BasicForm from '@/components/Form/src/BasicForm.vue'; import BasicForm from '@/components/Form/src/BasicForm.vue';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import { Divider, Input } from 'ant-design-vue'; import {Divider, FormProps, Input} from 'ant-design-vue';
import { AlignLeftOutlined, BankOutlined, PlusOutlined } from '@ant-design/icons-vue'; import { AlignLeftOutlined, BankOutlined, PlusOutlined } from '@ant-design/icons-vue';
import { useForm } from '@/components/Form'; import { useForm } from '@/components/Form';
import { editFormSchema } from '@/views/dataWarehousePlanning/logicalModel/modelDetail/model.data'; import { editFormSchema } from '@/views/dataWarehousePlanning/logicalModel/modelDetail/model.data';
...@@ -100,6 +108,7 @@ ...@@ -100,6 +108,7 @@
tagTableData, tagTableData,
} from '@/views/mallResourceDevelopment/label/portraitAnalysis/detail/detailData'; } from '@/views/mallResourceDevelopment/label/portraitAnalysis/detail/detailData';
import TableAction from '@/components/Table/src/components/TableAction.vue'; import TableAction from '@/components/Table/src/components/TableAction.vue';
import {BaseFormatProps} from "vue-i18n";
const route = useRoute(); const route = useRoute();
const title = route.query.title; const title = route.query.title;
...@@ -136,16 +145,17 @@ ...@@ -136,16 +145,17 @@
baseColProps: { span: 12 }, baseColProps: { span: 12 },
schemas: fieldFormSchema, schemas: fieldFormSchema,
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
} as BasicTableProps, } as FormProps,
useSearchForm: true, useSearchForm: true,
showTableSetting: false, showTableSetting: false,
bordered: true, bordered: true,
pagination: false,
actionColumn: { actionColumn: {
width: 100, width: 100,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
}, },
}); } as BasicTableProps);
const [tagTable] = useTable({ const [tagTable] = useTable({
title: '', title: '',
api: async (params) => { api: async (params) => {
...@@ -170,16 +180,17 @@ ...@@ -170,16 +180,17 @@
baseColProps: { span: 12 }, baseColProps: { span: 12 },
schemas: tagFormSchema, schemas: tagFormSchema,
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
} as BasicTableProps, } as FormProps,
useSearchForm: true, useSearchForm: true,
showTableSetting: false, showTableSetting: false,
bordered: true, bordered: true,
pagination: false,
actionColumn: { actionColumn: {
width: 100, width: 100,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
}, },
}); } as BasicTableProps);
</script> </script>
<style scoped> <style scoped>
...@@ -192,4 +203,8 @@ ...@@ -192,4 +203,8 @@
color: #3b8cf7; color: #3b8cf7;
border: 3px solid #3b8cf7; border: 3px solid #3b8cf7;
} }
.des-title {
font-size: 16px;
font-weight: bolder;
}
</style> </style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="flex w-2/11"> <div class="flex w-2/11">
<BasicTree <BasicTree
class="flex-1" class="flex-1"
:treeData="labelTreeData" :treeData="portraitTreeData"
defaultExpandLevel="1" defaultExpandLevel="1"
@select="handleSelect" @select="handleSelect"
ref="treeData" ref="treeData"
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
>移动</a-button >移动</a-button
> >
<a-button class="top-button" type="primary">新建文件夹</a-button> <a-button class="top-button" type="primary">新建文件夹</a-button>
<a-button class="top-button" type="primary" @click="handleAddPortrait">新建画像</a-button> <a-button class="top-button" type="primary" @click="handleAddPortrait"
>新建画像</a-button
>
</template> </template>
<template #footer> <template #footer>
<BasicTable @register="portraitTable" ref="tabTableRef"> <BasicTable @register="portraitTable" ref="tabTableRef">
...@@ -68,7 +70,8 @@ ...@@ -68,7 +70,8 @@
</template> </template>
</template> </template>
<template #name="{ text, record }"> <template #name="{ text, record }">
<a @click="handleBody(record)">{{ text }}</a> <a v-if="record.relationBody" @click="handleBody(record)">{{ text }}</a>
<span v-else>{{ text }}</span>
</template> </template>
<template #originalSubject="{ text, record }"> <template #originalSubject="{ text, record }">
<a-button type="link" @click="handleBody(record)">{{ text }}</a-button> <a-button type="link" @click="handleBody(record)">{{ text }}</a-button>
...@@ -79,6 +82,7 @@ ...@@ -79,6 +82,7 @@
</div> </div>
</div> </div>
</template> </template>
<AddFileModal @register="addFileModal" />
</PageWrapper> </PageWrapper>
</template> </template>
...@@ -121,15 +125,21 @@ ...@@ -121,15 +125,21 @@
portraitTableColumn, portraitTableColumn,
portraitTableFormSchema, portraitTableFormSchema,
} from '@/views/mallResourceDevelopment/label/portraitAnalysis/portrait.data'; } from '@/views/mallResourceDevelopment/label/portraitAnalysis/portrait.data';
import { portraitTreeData } from './portraitData';
import AddFileModal from './addFileModal.vue';
const [addFileModal, { openModal: openAddFileModal }] = useModal();
const tabName = ref(''); const tabName = ref('');
const treeData = ref(); const treeData = ref();
const path = ref();
function handleSelect() { function handleSelect() {
const keys = unref(treeData).getSelectedKeys(); const keys = unref(treeData).getSelectedKeys();
const node = unref(treeData).getSelectedNode(keys[0]); const node = unref(treeData).getSelectedNode(keys[0]);
console.log('node', node); console.log('node', node);
// 获取标题 // 获取标题
tabName.value = node.title; tabName.value = node.title;
path.value = getPath(portraitTreeData[0]);
console.log('path', path.value);
if (node.children) { if (node.children) {
const list = cloneDeep(node.children); const list = cloneDeep(node.children);
list.forEach((item) => { list.forEach((item) => {
...@@ -145,7 +155,22 @@ ...@@ -145,7 +155,22 @@
// tabName.value = findTitleById(labelTreeData[0], key[0]); // tabName.value = findTitleById(labelTreeData[0], key[0]);
// console.log('tabName', tabName.value); // console.log('tabName', tabName.value);
} }
// 嵌套 -获取树title // 嵌套获取路径
function getPath(data) {
if (data.name === tabName.value) {
return '/' + data.name;
} else {
if (data.children && data.children.length > 0) {
for (let item of data.children) {
const path = getPath(item);
if (path) {
return '/' + data.name + path;
}
}
}
return;
}
}
const tabTableRef = ref(null); const tabTableRef = ref(null);
function topButtonDisabled() { function topButtonDisabled() {
if (tabTableRef.value) { if (tabTableRef.value) {
...@@ -162,16 +187,14 @@ ...@@ -162,16 +187,14 @@
function handleBody(record) { function handleBody(record) {
console.log('recode', record); console.log('recode', record);
router.push({ router.push({
path: '/mallResourceDevelopment/label/label/labelDetail', path: '/mallResourceDevelopment/label/portraitAnalysis/detail',
query: { ...record }, query: { ...record },
}); });
} }
function handleAddPortrait() { function handleAddPortrait() {
router.push({ openAddFileModal(true, {
path: '/mallResourceDevelopment/label/portraitAnalysis/detail', isUpdate: false,
query: { path: path.value,
title: tabName.value,
},
}); });
} }
const [portraitTable, { setTableData: tabSetTableData, getRowSelection: tabGetRowSelection }] = const [portraitTable, { setTableData: tabSetTableData, getRowSelection: tabGetRowSelection }] =
......
...@@ -15,6 +15,7 @@ export const portraitTableColumn: BasicColumn[] = [ ...@@ -15,6 +15,7 @@ export const portraitTableColumn: BasicColumn[] = [
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
width: 100, width: 100,
slots: { customRender: 'name' },
}, },
{ {
title: '创建时间', title: '创建时间',
...@@ -32,3 +33,22 @@ export const portraitTableColumn: BasicColumn[] = [ ...@@ -32,3 +33,22 @@ export const portraitTableColumn: BasicColumn[] = [
width: 100, width: 100,
}, },
]; ];
export const addFileModalFormSchema: FormSchema[] = [
{
label: '路径',
field: 'path',
slot: 'path',
},
{
label: '文件名称',
field: 'name',
required: true,
component: 'Input',
},
{
label: '文件类型',
field: 'type',
defaultValue: '画像分析',
slot: 'type',
},
];
export const portraitTreeData = [
{
title: '画像分析',
key: '0',
name: '画像分析',
icon: 'ant-design:pic-left-outlined',
children: [
{
title: '共享工作区',
key: '0-1',
icon: 'ant-design:desktop-outlined',
name: '共享工作区',
createTime: '2023/11/16 06:50:23',
updateTime: '2023/12/08 19:33:26',
children: [
{
title: '共享区1',
key: '0-1-0',
icon: 'ant-design:apartment-outlined',
name: '共享区1',
createTime: '2023/11/16 06:50:23',
updateTime: '2023/12/08 19:33:26',
children: [
{
title: '共享1测试',
key: '0-1-0-0',
icon: 'ant-design:smile-outlined',
name: '共享1测试',
relationBody: '共享区1',
createTime: '2023/09/09 19:16:22',
updateTime: '2023/09/09 22:09:36',
owner: 'admin',
},
{
title: '共享1-2',
key: '0-1-0-1',
icon: 'ant-design:smile-outlined',
name: '共享1-2',
relationBody: '共享区1',
createTime: '2023/09/09 19:16:22',
updateTime: '2023/09/09 22:09:36',
owner: 'admin',
},
{
title: '传送包',
key: '0-1-0-2',
icon: 'ant-design:folder-open-outlined',
name: '传送包',
createTime: '2023/11/16 06:50:23',
updateTime: '2023/12/08 19:33:26',
children: [
{
title: '包测试3',
key: '0-1-0-2-0',
icon: 'ant-design:smile-outlined',
name: '包测试3',
relationBody: '共享区1',
createTime: '2023/09/09 19:16:22',
updateTime: '2023/09/09 22:09:36',
owner: 'admin',
},
],
},
],
},
{
title: '共享区2',
key: '0-1-1',
icon: 'ant-design:apartment-outlined',
name: '共享区2',
createTime: '2023/11/16 06:50:23',
updateTime: '2023/12/08 19:33:26',
children: [
{
title: '经济',
key: '0-1-1-0',
icon: 'ant-design:smile-outlined',
name: '经济',
relationBody: '共享区2',
createTime: '2023/09/09 19:16:22',
updateTime: '2023/09/09 22:09:36',
owner: 'admin',
},
{
title: '商品',
key: '0-1-1-1',
icon: 'ant-design:smile-outlined',
name: '商品',
relationBody: '共享区2',
createTime: '2023/09/09 19:16:22',
updateTime: '2023/09/09 22:09:36',
owner: 'admin',
},
{
title: '购物包',
key: '0-1-1-2',
icon: 'ant-design:folder-open-outlined',
name: '购物包',
createTime: '2023/11/16 06:50:23',
updateTime: '2023/12/08 19:33:26',
children: [
{
title: '测试标签',
key: '0-1-1-2-0',
icon: 'ant-design:smile-outlined',
name: '测试标签',
relationBody: '共享区2',
createTime: '2023/09/09 19:16:22',
updateTime: '2023/09/09 22:09:36',
owner: 'admin',
},
],
},
],
},
],
},
],
},
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment