Commit a348ff29 authored by LiXuyang's avatar LiXuyang

落标检查-列表-改

parent 8d4fc805
......@@ -47,7 +47,7 @@
}
});
const getTitle = computed(() => (isUpdate.value ? '编辑落点检查' : '新建落点检查'));
const getTitle = computed(() => (isUpdate.value ? '编辑落标检查' : '新建落标检查'));
/**确定按钮*/
async function handleSubmit() {
......
......@@ -6,13 +6,7 @@
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #path="{ field, model }">
<div class="flex">
<InputSearch v-model:value="model[field]" enter-button="选择" />
</div>
</template>
</BasicForm>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
......@@ -22,9 +16,9 @@
import { BasicForm, useForm } from '@/components/Form';
import {
addTypeModalFormSchema,
copyModalFormSchema
copyModalFormSchema,
} from '@/views/dataStandards/labelDropInspection/label.data';
import {useMessage} from "@/hooks/web/useMessage";
import { useMessage } from '@/hooks/web/useMessage';
const isUpdate = ref(false);
const isMove = ref(false);
......@@ -57,7 +51,7 @@
});
// const getTitle = computed(() => (isUpdate.value ? '编辑实体' : '新建实体'));
const getTitle = '复制到';
const getTitle = '新建分类';
const { createMessage } = useMessage();
/**确定按钮*/
......
......@@ -6,13 +6,7 @@
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #path="{ field, model }">
<div class="flex">
<InputSearch v-model:value="model[field]" enter-button="选择" />
</div>
</template>
</BasicForm>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
......
......@@ -15,8 +15,8 @@
<div class="flex-1" style="display: flex; flex-direction: column; gap: 15px">
<div class="flex" style="gap: 10px">
<div class="flex-1 flex">
<div>
<FundProjectionScreenOutlined style="font-size: 30px" />
<div style="margin: 10px 0 0 10px">
<FundProjectionScreenOutlined style="font-size: 30px; color: #1e96f3" />
</div>
<div style="margin-left: 10px">
<div style="font-size: 16px">{{ tabName }}</div>
......@@ -41,7 +41,10 @@
@click="handleCopy"
>复制到</a-button
>
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <= 0"
<a-button
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleDelete"
>删除</a-button
>
<a-button
......@@ -93,7 +96,7 @@
// 复制
icon: 'ion:documents-outline',
onClick: handleCopy.bind(null, record),
tooltip: '复制',
tooltip: '复制',
},
{
// 移动
......@@ -119,10 +122,7 @@
import { BasicTree, ContextMenuItem } from '@/components/Tree';
import { labelTableData, treeData } from './labelData';
import { EventDataNode } from 'ant-design-vue/es/vc-tree/interface';
import {
labelColumn,
labelFormSchemas,
} from '@/views/dataStandards/labelDropInspection/label.data';
import { labelColumn } from '@/views/dataStandards/labelDropInspection/label.data';
import { reactive, ref, unref } from 'vue';
import { useMessage } from '@/hooks/web/useMessage';
import AddLabelModel from './addLabelModel.vue';
......@@ -133,6 +133,7 @@
import MoveModal from './moveModal.vue';
import AddTypeModal from './addTypeModal.vue';
// 初始化
const { push } = useRouter();
const [addLabelModel, { openModal: openAddLabelModel }] = useModal();
const [moveModal, { openModal: openMoveModal }] = useModal();
......@@ -141,9 +142,15 @@
const { createMessage, createConfirm } = useMessage();
const searchInfo = reactive<Recordable>({});
const searchKey = ref();
const tabName = ref(treeData[0].name);
const tree = ref();
// 数据
const tabName = ref(treeData[0].name);
const path = ref(treeData[0].name);
/**
* 方法
*/
// 左侧树选中
function handleSelect() {
const keys = unref(tree).getSelectedKeys();
const node = unref(tree).getSelectedNode(keys[0]);
......@@ -152,6 +159,7 @@
tabName.value = node.title;
path.value = getPath(treeData[0]);
}
// 获取路径
function getPath(data) {
if (data.name === tabName.value) {
return '/' + data.name;
......@@ -167,45 +175,37 @@
return;
}
}
// 打开新建分类模态框
function handleAddType() {
openAddTypeModal(true, {
isUpdate: true,
path: path.value,
});
}
/**
* 新增落标检查
*/
// 新增落标检查
function handleAdd() {
openAddLabelModel(true, {
isUpdate: false,
});
}
/**
* 跳转详情页
*/
// 跳转详情页
function handleDetail(record) {
push({
path: '/dataStandards/labelDropInspection/labelDetail',
query: { ...record, ...{ path: path.value + '/' + record.name } },
});
}
/** 列表删除 */
// 列表删除
function handleRemove(record) {
createMessage.success('删除成功!');
}
// 新建落标检查回调
function addLabelSuccess({ isUpdate, values }) {
if (isUpdate) {
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
//修改表单的值
const result = updateTableDataRecord(values.businessId, values);
reload();
} else {
tableData.value.push(values);
reload();
}
createMessage.success('新建成功!');
reload();
}
// 左侧树右键菜单
function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> {
const menu = [
{
......@@ -218,7 +218,7 @@
{
label: '新建分类',
handler: () => {
console.log('点击了新建分类', node);
handleAddType();
},
icon: 'ant-design:folder-add-outlined',
},
......@@ -230,7 +230,7 @@
{
label: '刷新',
handler: () => {
console.log('点击了刷新', node);
handleRefresh();
},
icon: 'ant-design:reload-outlined',
},
......@@ -239,14 +239,61 @@
resolve(menu);
});
}
function handleReport(node) {
router.push({
path: '/dataStandards/labelDropInspection/labelReport',
query: {
name: node.name,
// 左侧树刷新
function handleRefresh() {
createMessage.success('刷新成功!');
}
// 批量上线
function handleUp() {
createConfirm({
iconType: 'warning',
title: '批量上线',
content: '确认上线选中数据吗?',
onOk() {
createMessage.success('上线成功!');
reload();
},
});
}
// 批量下线
function handleDown() {
createConfirm({
iconType: 'warning',
title: '批量下线',
content: '确认下线选中数据吗?',
onOk() {
createMessage.success('下线成功!');
reload();
},
});
}
// 批量删除
function handleDelete() {
createConfirm({
iconType: 'warning',
title: '批量删除',
content: '确认删除选中数据吗?',
onOk() {
createMessage.success('删除成功!');
reload();
},
});
}
// 打开复制到模态框
function handleCopy() {
openCopyModal(true, {
isUpdate: false,
});
}
// 打开移动模态框
function handleMove() {
openMoveModal(true, {
isUpdate: false,
});
}
/**
* 列表
*/
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
......@@ -290,39 +337,6 @@
dataIndex: 'action',
},
});
function handleUp() {
createConfirm({
iconType: 'warning',
title: '批量上线',
content: '确认上线选中数据吗?',
onOk() {
createMessage.success('上线成功!');
reload();
},
});
}
function handleDown() {
createConfirm({
iconType: 'warning',
title: '批量下线',
content: '确认下线选中数据吗?',
onOk() {
createMessage.success('下线成功!');
reload();
},
});
}
/** 移动按钮*/
function handleCopy() {
openCopyModal(true, {
isUpdate: false,
});
}
function handleMove() {
openMoveModal(true, {
isUpdate: false,
});
}
</script>
<style scoped></style>
import { BasicColumn, FormSchema } from '@/components/Table';
import { BaseFormatProps } from 'vue-i18n';
import {pathOptionsData} from "@/views/dataStandards/labelDropInspection/labelData";
export const labelColumn: BasicColumn[] = [
{
......@@ -36,96 +37,7 @@ export const addLabelModelFormSchemas: FormSchema[] = [
label: '路径',
component: 'TreeSelect',
componentProps: {
treeData: [
{
title: '落标检查',
value: '0-0',
icon: 'ant-design:line-chart-outlined',
children: [
{
title: 'DMP_admin-个人工作区',
value: '0-0-0',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-1', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-2', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '共享工作区',
value: '0-0-1',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-3', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-4', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: 'gxx',
value: '0-0-2',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-5', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-6', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '商城工作区',
value: '0-0-3',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-7', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-8', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区01',
value: '0-0-4',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-9', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-10', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区02',
value: '0-0-5',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-11', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-12', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: 'glc',
value: '0-0-6',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-13', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-14', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区04',
value: '0-0-7',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-15', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-16', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区',
value: '0-0-8',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-17', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-18', icon: 'ant-design:line-chart-outlined' },
],
},
],
},
],
treeData: pathOptionsData,
},
colProps: { lg: 24 },
},
......@@ -166,14 +78,22 @@ export const copyModalFormSchema: FormSchema[] = [
{
field: 'path',
label: '路径',
slot: 'path',
component: 'TreeSelect',
componentProps: {
treeData: pathOptionsData,
},
colProps: { lg: 24 },
},
];
export const moveModalFormSchema: FormSchema[] = [
{
field: 'path',
label: '路径',
slot: 'path',
component: 'TreeSelect',
componentProps: {
treeData: pathOptionsData,
},
colProps: { lg: 24 },
},
];
export const addTypeModalFormSchema: FormSchema[] = [
......@@ -185,6 +105,10 @@ export const addTypeModalFormSchema: FormSchema[] = [
{
field: 'path',
label: '路径',
slot: 'path',
component: 'TreeSelect',
componentProps: {
treeData: pathOptionsData,
},
colProps: { lg: 24 },
},
];
......@@ -92,3 +92,93 @@ export const labelTableData = [
updateTime: '2022/10/26 16:53:45',
},
];
export const pathOptionsData = [
{
title: '落标检查',
value: '0-0',
icon: 'ant-design:line-chart-outlined',
children: [
{
title: 'DMP_admin-个人工作区',
value: '0-0-0',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-1', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-2', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '共享工作区',
value: '0-0-1',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-3', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-4', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: 'gxx',
value: '0-0-2',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-5', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-6', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '商城工作区',
value: '0-0-3',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-7', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-8', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区01',
value: '0-0-4',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-9', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-10', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区02',
value: '0-0-5',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-11', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-12', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: 'glc',
value: '0-0-6',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-13', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-14', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区04',
value: '0-0-7',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-15', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-16', icon: 'ant-design:line-chart-outlined' },
],
},
{
title: '数据中台工作区',
value: '0-0-8',
icon: 'ion:desktop-outline',
children: [
{ title: 'dmp落标检查', value: '0-0-0-17', icon: 'ant-design:line-chart-outlined' },
{ title: 'gxx落标检查', value: '0-0-0-18', icon: 'ant-design:line-chart-outlined' },
],
},
],
},
]
......@@ -6,13 +6,7 @@
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #path="{ field, model }">
<div class="flex">
<InputSearch v-model:value="model[field]" enter-button="选择" />
</div>
</template>
</BasicForm>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
......
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