Commit fafee7dd authored by 罗林杰's avatar 罗林杰

修改我创建的数据集

parent 3dc0593b
<template> <template>
<div class="m-5 mr-0 overflow-hidden bg-white"> <div class=" overflow-hidden bg-white">
<BasicTree <BasicTree
title="" title=""
ref="treeRef" ref="treeRef"
......
...@@ -7,24 +7,23 @@ ...@@ -7,24 +7,23 @@
@ok="handleSubmit" @ok="handleSubmit"
> >
<BasicForm @register="registerForm" /> <BasicForm @register="registerForm" />
<EditFileModal @register="registerEditFile" />
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, unref } from 'vue'; import { ref, unref } from 'vue';
import { BasicModal, useModal, useModalInner } from '@/components/Modal'; import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { addFileFormSchema } from './data'; import { addFileFormSchema } from './data';
import { TreeData } from './dataFileData'; import { newFileTreeData } from './dataFileData';
import EditFileModal from './editFileModal.vue'; import { useMessage } from '@/hooks/web/useMessage';
defineOptions({ name: 'AccountModal' }); defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true); const isUpdate = ref(true);
const title = ref(); const title = ref();
const { createMessage } = useMessage();
const [registerEditFile, { openModal: openEditFileModal }] = useModal();
//获取接口数据并放在下拉框里(这里是打开了一个弹框) //获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单 //初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
...@@ -49,7 +48,7 @@ ...@@ -49,7 +48,7 @@
}); });
} }
title.value = data.title; title.value = data.title;
const treeList = handleTree(TreeData, 'businessId', undefined, undefined, undefined); const treeList = handleTree(newFileTreeData, 'businessId', undefined, undefined, undefined);
updateSchema([ updateSchema([
{ {
field: 'path', field: 'path',
...@@ -94,9 +93,7 @@ ...@@ -94,9 +93,7 @@
const values = await validate(); const values = await validate();
setModalProps({ confirmLoading: true }); setModalProps({ confirmLoading: true });
closeModal(); closeModal();
openEditFileModal(true, { createMessage.success('新建成功');
title: '编辑文件',
});
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
} }
......
import { informationColumns } from '@/views/mallResourceDevelopment/dataSet/datasetByCreate/data';
export const tableList: any[] = [ export const tableList: any[] = [
{ {
...@@ -457,3 +456,215 @@ export const basicOldData = { ...@@ -457,3 +456,215 @@ export const basicOldData = {
version: 'V9.0', version: 'V9.0',
source: '元数据', source: '元数据',
}; };
export const newFileTreeData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 100,
parentWorkSpaceName: '公共数据集',
workSpaceName: '公共数据集',
parentId: 0,
'code:': '001',
ancestors: '0',
orderNum: 0,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 101,
parentWorkSpaceName: '公共数据集',
workSpaceName: '党建建设',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 201,
parentWorkSpaceName: '党建建设',
workSpaceName: '基本信息',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 202,
parentWorkSpaceName: '党建建设',
workSpaceName: '党员发展计划',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 203,
parentWorkSpaceName: '党建建设',
workSpaceName: '主题教育活动',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 204,
parentWorkSpaceName: '党建建设',
workSpaceName: '党建工作总结',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 205,
parentWorkSpaceName: '党建建设',
workSpaceName: '党史知识竞赛',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 206,
parentWorkSpaceName: '党建建设',
workSpaceName: '红色文化展览',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 207,
parentWorkSpaceName: '党建建设',
workSpaceName: '志愿服务活动',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 208,
parentWorkSpaceName: '党建建设',
workSpaceName: '党员风采展示',
parentId: 101,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 102,
parentWorkSpaceName: '公共数据集',
workSpaceName: '交通信息',
parentId: 100,
'code:': '004',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 209,
parentWorkSpaceName: '交通信息',
workSpaceName: '城市公交优化方案',
parentId: 102,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 210,
parentWorkSpaceName: '交通信息',
workSpaceName: '智能交通系统部署',
parentId: 102,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 211,
parentWorkSpaceName: '交通信息',
workSpaceName: '绿色出行倡议',
parentId: 102,
'code:': '003',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
];
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</div> </div>
<div class="buttonGroup"> <div class="buttonGroup">
<a-button type="primary" @click="handleVersionPublish">版本发布</a-button> <a-button type="primary" @click="handleVersionPublish">版本发布</a-button>
<a-button type="primary" @click="handleParameterConfiguration">版本管理</a-button> <a-button type="primary" @click="handleVersionManagement">版本管理</a-button>
<a-button type="primary" @click="handleVersionManagement">删除</a-button> <a-button type="primary" @click="handleDelete">删除</a-button>
<a-button type="primary" @click="handleUp">上架</a-button> <a-button type="primary" @click="handleUp">上架</a-button>
<a-button type="primary" @click="handleVersionManagement">编辑</a-button> <a-button type="primary" @click="handleVersionManagement">编辑</a-button>
</div> </div>
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
defineOptions({ name: 'AccountDetail' }); defineOptions({ name: 'AccountDetail' });
const { createMessage } = useMessage(); const { createMessage, createConfirm } = useMessage();
const ATabs = Tabs; const ATabs = Tabs;
const ATabPane = Tabs.TabPane; const ATabPane = Tabs.TabPane;
const currentKey = ref('1'); const currentKey = ref('1');
...@@ -256,6 +256,18 @@ ...@@ -256,6 +256,18 @@
title: '申请发布V10.0版本:数据集1', title: '申请发布V10.0版本:数据集1',
}); });
} }
function handleDelete() {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '确认删除吗?',
onOk() {
router.back();
createMessage.success('删除成功!');
},
});
}
function goBack() { function goBack() {
router.back(); router.back();
} }
......
...@@ -201,9 +201,8 @@ ...@@ -201,9 +201,8 @@
} }
function handleSubmit() { function handleSubmit() {
router.push({ closeModal();
path: '/dataset/datasetByCreate/datasetByCreateDetail', createMessage.success('提交成功');
});
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<GroupTree class="w-1/4 xl:w-1/5" @select="handleSelect" /> <GroupTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5"> <div class="w-3/4 xl:w-4/5">
<template #toolbar> <div style="display: flex; align-items: center; background-color: white; padding-top: 20px">
<a-button type="primary" @click="deleteButton">删除</a-button> <Icon style="margin-left: 30px" icon="ion:folder-outline" :size="50" :color="'#6499e9'" />
<a-button type="primary" @click="handleMove(1)">移动</a-button> <div style="margin-left: 10px">
<a-button type="primary" @click="batchUploading">批量上架</a-button> <span class="title">test</span>
<a-button type="primary" @click="handleNewFolder">新建文件夹</a-button> <div>
<a-button type="primary" @click="handleDataEntry">新建文件</a-button> <span class="path">我创建的</span>
</template> </div>
<template #bodyCell="{ column, record }"> </div>
<template v-if="column.key === 'status'"> <a-button style="margin-left: 550px" type="primary" @click="deleteButton">删除</a-button>
<template v-if="record.uploadStatus === '0'"> <a-button style="margin-left: 10px" type="primary" @click="handleMove(1)">移动</a-button>
<Icon icon="grommet-icons:status-good" color="green" /><span>已发布</span> <a-button style="margin-left: 10px" type="primary" @click="batchUploading"
>批量上架</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleNewFolder"
>新建文件夹</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleCataloging"
>新建编目</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleDataEntry"
>新建文件</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleDataEntry"
>批量新建</a-button
>
</div>
<BasicTable style="background-color: white" @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<template v-if="record.uploadStatus === '0'">
<Icon icon="grommet-icons:status-good" color="green" /><span>已发布</span>
</template>
<template v-if="record.uploadStatus === '1'">
<Icon icon="carbon:error-outline" color="red" /><span>未发布</span>
</template>
</template> </template>
<template v-if="record.uploadStatus === '1'"> <template v-if="column.key === 'uploadStatus'">
<Icon icon="carbon:error-outline" color="red" /><span>未发布</span> <template v-if="record.uploadStatus === '0'">
<Icon icon="grommet-icons:status-good" color="green" /><span>已上架</span>
</template>
<template v-if="record.uploadStatus === '1'">
<Icon icon="carbon:error-outline" color="red" /><span>未上架</span>
</template>
</template> </template>
</template> <template v-if="column.key === 'name'">
<template v-if="column.key === 'uploadStatus'"> <div @click="handleDetail" style="color: #6499e9">
<template v-if="record.uploadStatus === '0'"> <Icon icon="carbon:folder" />
<Icon icon="grommet-icons:status-good" color="green" /><span>已上架</span> <span>{{ record.name }}</span>
</div>
</template> </template>
<template v-if="record.uploadStatus === '1'"> <template v-if="column.key === 'action'">
<Icon icon="carbon:error-outline" color="red" /><span>未上架</span> <TableAction
:actions="[
{
label: '上架',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleUpload.bind(null),
},
},
{
label: '编辑',
onClick: handEdit.bind(null),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handDelete.bind(null),
},
},
]"
/>
</template> </template>
</template> </template>
<template v-if="column.key === 'action'"> </BasicTable>
<TableAction </div>
:actions="[
{
label: '上架',
onClick: handleUpload.bind(null, 0, record),
},
{
label: '删除',
onClick: handDelete.bind(null),
},
]"
/>
</template>
</template>
</BasicTable>
<MoveFile @register="registerMoveFile" /> <MoveFile @register="registerMoveFile" />
<NewFolder @register="registerNewFolder" /> <NewFolder @register="registerNewFolder" />
<AddFileModal @register="registerAddFileModal" /> <AddFileModal @register="registerAddFileModal" />
<EditFileModal @register="registerEditFile" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -60,11 +100,15 @@ ...@@ -60,11 +100,15 @@
import GroupTree from './GroupTree.vue'; import GroupTree from './GroupTree.vue';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import AddFileModal from './addFileModal.vue'; import AddFileModal from './addFileModal.vue';
import { router } from '@/router';
import EditFileModal from '@/views/mallResourceDevelopment/dataSet/datasetByCreate/editFileModal.vue';
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const [registerMoveFile, { openModal: openMoveFileModal }] = useModal(); const [registerMoveFile, { openModal: openMoveFileModal }] = useModal();
const [registerNewFolder, { openModal: openNewFolderModal }] = useModal(); const [registerNewFolder, { openModal: openNewFolderModal }] = useModal();
const [registerAddFileModal, { openModal: openAddFileModal }] = useModal(); const [registerAddFileModal, { openModal: openAddFileModal }] = useModal();
const [registerEditFile, { openModal: openEditFileModal }] = useModal();
const [registerTable, { reload, getRowSelection }] = useTable({ const [registerTable, { reload, getRowSelection }] = useTable({
api: async () => { api: async () => {
const response = { const response = {
...@@ -94,7 +138,7 @@ ...@@ -94,7 +138,7 @@
return info; return info;
}, },
actionColumn: { actionColumn: {
width: 100, width: 120,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
}, },
...@@ -111,12 +155,15 @@ ...@@ -111,12 +155,15 @@
isUpdate: false, isUpdate: false,
}); });
} }
function handleCataloging() {
openNewFolderModal(true, {
isUpdate: true,
});
}
/** 移动按钮*/ /** 移动按钮*/
function handleMove(isMove, record: Recordable) { function handleMove(isMove) {
// console.log('record',record)
openMoveFileModal(true, { openMoveFileModal(true, {
record,
isMove: isMove, isMove: isMove,
}); });
} }
...@@ -151,7 +198,16 @@ ...@@ -151,7 +198,16 @@
}, },
}); });
} }
function handleDetail() {
router.push({
path: '/dataset/datasetByCreate/datasetByCreateDetail',
});
}
function handEdit() {
openEditFileModal(true, {
title: '编辑文件',
});
}
/** 部门树的select*/ /** 部门树的select*/
function handleSelect() { function handleSelect() {
reload(); reload();
...@@ -159,3 +215,13 @@ ...@@ -159,3 +215,13 @@
onMounted(() => {}); onMounted(() => {});
</script> </script>
<style scoped>
.title {
font-size: 16px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
</style>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
return treeData !== '' ? treeData : data; return treeData !== '' ? treeData : data;
} }
const getTitle = computed(() => (!unref(isUpdate) ? '新建主体' : '编辑主体')); const getTitle = computed(() => (!unref(isUpdate) ? '新建文件夹' : '新建编目'));
async function handleSubmit() { async function handleSubmit() {
try { try {
......
...@@ -198,3 +198,13 @@ ...@@ -198,3 +198,13 @@
console.log('选择节点selectedDeptId:', deptId); console.log('选择节点selectedDeptId:', deptId);
}; };
</script> </script>
<style scoped>
.title {
font-size: 16px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
</style>
...@@ -204,3 +204,13 @@ ...@@ -204,3 +204,13 @@
console.log('选择节点selectedDeptId:', deptId); console.log('选择节点selectedDeptId:', deptId);
}; };
</script> </script>
<style scoped>
.title {
font-size: 16px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
</style>
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