Commit 594df71b authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 1674938d a348ff29
......@@ -39,7 +39,10 @@
@click="handleMoveInGroup"
>移入规则组</a-button
>
<a-button type="primary" :disabled="getRowSelection().selectedRowKeys <= 0"
<a-button
type="primary"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleDeleteGroup"
>移出规则组</a-button
>
<a-button type="primary" @click="handleImport">导入</a-button>
......@@ -58,6 +61,7 @@
},
{
icon: 'ion:chevron-down-circle-outline',
onClick: handleVersion.bind(null, record),
},
{
// 删除
......@@ -74,7 +78,7 @@
</template>
</template>
</BasicTable>
<RuleEditModel :is-add="isAdd" @register="ruleEditModal" />
<RuleEditModel :is-add="isAdd" @register="ruleEditModal" @success="REModalSuccess" />
<RuleMoreUpdate @register="ruleMoreUpdateModel" />
<importModal @register="registerImport" @success="handleImportSuccess" />
<RuleGroupAddModel @register="ruleGroupAddModel" />
......@@ -161,7 +165,13 @@
});
}
function handlePlus(node) {}
function REModalSuccess() {
if (isAdd.value) {
createMessage.success('新增成功');
} else {
createMessage.success('修改成功');
}
}
/**
* 组新增
*/
......@@ -241,6 +251,18 @@
},
});
}
// 批量删除
function handleDeleteGroup() {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '确认批量移出所选工作组吗?',
onOk() {
createMessage.success('移出成功!');
reload();
},
});
}
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
......
......@@ -392,7 +392,7 @@ export const ruleMoreUpdateModelFormSchema = [
];
export const ruleGroupAddModelFormSchema = [
{
field: 'groupName',
field: 'name',
label: '新建规则组',
component: 'Input',
colProps: { lg: 24, md: 24 },
......
......@@ -266,11 +266,23 @@ export const versionModelList = [
time: '2022/10/27 18:53:43',
created: 'admin',
describe: 'batch create version',
// 版本信息
rule: 'cd_id主键唯一',
distinct: '对ID唯一性的检查',
group: '',
dataSource: 'Inceptor',
model: '/质量模板/admin-个人工作区/内置模板/主键唯一',
},
{
version: 'V1',
time: '2022/10/27 18:17:37',
created: 'admin',
describe: 'batch create version',
// 版本信息
rule: 'cd_id主键唯一',
distinct: '对ID唯一性的检查',
group: '',
dataSource: 'Inceptor',
model: '/质量模板/admin-个人工作区/内置模板/主键唯一',
},
];
......@@ -37,7 +37,9 @@
/>
</div>
<div>
<a-button type="primary" @click="handleAddGroup">新建规则组</a-button>
<a-button type="primary" @click="handleAddGroup" :disabled="isUpdate"
>新建规则组</a-button
>
</div>
</div>
</template>
......@@ -102,7 +104,7 @@
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, defineProps } from 'vue';
import { ref, computed, unref, defineProps, defineEmits } from 'vue';
import { Select } from 'ant-design-vue';
import { BasicModal, useModalInner, useModal } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
......@@ -117,55 +119,29 @@
import AddNewVersion from './addNewVersion.vue';
import { useTable } from '@/components/Table';
import { configData, taskData } from '@/views/dataQuality/dataSheet/rule/ruleData';
import { useMessage } from '@/hooks/web/useMessage';
// 初始化
const emit = defineEmits(['success']);
const props = defineProps({
disabled: { type: Boolean, default: false },
isAdd: { type: Boolean, default: false },
});
const isUpdate = ref(true);
const rowId = ref('');
const { createConfirm } = useMessage();
// 数据
const getTitle = computed(() => (isUpdate.value ? '质量规则详情' : '新建规则'));
const modelOptions = [{ label: '公民身份号码', value: '公民身份号码' }];
/**
* 方法
*/
// 打开组添加模态框
function handleAddGroup() {
openRuleGroupAddModel(true, {
isUpdate: false,
});
}
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
const [ruleGroupAddModel, { openModal: openRuleGroupAddModel }] = useModal();
const [addNewVersion, { openModal: openAddNewVersion }] = useModal();
const modelOptions = [{ label: '公民身份号码', value: '公民身份号码' }];
//初始化表单
const [registerForm, { setFieldsValue, getFieldsValue, resetSchema, resetFields, validate }] =
useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
// schemas: props.isAdd ? ruleModelFormSchema : ruleEditModelFormSchema,
showActionButtonGroup: false,
disabled: props.disabled,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({
confirmLoading: false,
okText: props.disabled ? '回滚' : props.isAdd ? '确定' : '提交新版本',
});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
await resetSchema([...ruleEditModelFormSchema]);
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
} else {
await resetSchema([...ruleModelFormSchema]);
}
});
// 关键模板-修改后
function changeModel() {
// 更新表单
......@@ -173,6 +149,7 @@
// 更新sql预览
getSql();
}
// 更新sql预览信息
function getSql() {
const model = getFieldsValue();
if (model.model) {
......@@ -198,6 +175,75 @@
return [];
}
}
// 当前模态框确定按钮
async function handleSubmit() {
await validate();
if (props.disabled) {
createConfirm({
iconType: 'warning',
title: '确认回滚',
content: '确认回滚至当前版本吗?',
onOk() {
emit('success');
closeModal();
},
});
} else {
openAddNewVersion(true, {
isUpdate: false,
});
}
}
// 新增版本模态框回调
async function handleSubmitNewVersion(describe) {
emit('success');
closeModal();
}
/**
* 模态框
*/
const [ruleGroupAddModel, { openModal: openRuleGroupAddModel }] = useModal();
const [addNewVersion, { openModal: openAddNewVersion }] = useModal();
/**
* 表单
*/
const [registerForm, { setFieldsValue, getFieldsValue, resetSchema, resetFields, validate }] =
useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
// schemas: props.isAdd ? ruleModelFormSchema : ruleEditModelFormSchema,
showActionButtonGroup: false,
disabled: props.disabled,
actionColOptions: {
span: 23,
},
});
/**
* 弹窗
*/
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({
confirmLoading: false,
okText: props.disabled ? '回滚' : '提交新版本',
});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
await resetSchema([...ruleEditModelFormSchema]);
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
getSql();
} else {
await resetSchema([...ruleModelFormSchema]);
}
});
/**
* 列表
*/
const [
configTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection, setTableData },
......@@ -251,15 +297,4 @@
bordered: true,
pagination: false,
});
/**确定按钮*/
async function handleSubmit() {
await validate();
openAddNewVersion(true, {
isUpdate: false,
});
}
/**确定按钮*/
async function handleSubmitNewVersion(describe) {
closeModal();
}
</script>
......@@ -11,7 +11,7 @@
<template #range>
<div style="display: flex">
<div style="flex: 1"> 可见范围 </div>
<div>
<div v-if="!isUpdate">
<a-button>清空</a-button>
<a-button type="primary"><PlusOutlined />添加工作组</a-button>
</div>
......@@ -22,7 +22,7 @@
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue';
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons-vue';
......@@ -32,10 +32,10 @@
const isUpdate = ref(true);
const rowId = ref('');
const getTitle = '新建规则组';
const getTitle = computed(() => (isUpdate.value ? '修改规则组' : '新建规则组'));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
const [registerForm, { setFieldsValue, resetFields, validate, updateSchema }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: ruleGroupAddModelFormSchema,
......@@ -54,12 +54,30 @@
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
await updateSchema([
{
field: 'group',
componentProps: {
disabled: true,
},
},
]);
console.log('data', data);
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
} else {
await updateSchema([
{
field: 'group',
componentProps: {
disabled: false,
},
},
]);
}
});
/**确定按钮*/
......
......@@ -14,6 +14,7 @@
// 编辑
{
icon: 'clarity:note-edit-line',
onClick: handleUpdate.bind(null, record),
},
{
// 删除
......@@ -30,22 +31,47 @@
</template>
</template>
</BasicTable>
<RuleGroupAddModal @register="ruleGroupAddModel" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicModal, useModal, useModalInner } from '@/components/Modal';
import { useTable, TableAction, BasicTable } from '@/components/Table';
import { ruleGroupEditData } from '@/views/dataQuality/dataSheet/rule/ruleData';
import { ruleGroupEditFormSchema, ruleGroupEditTable } from '@/views/dataQuality/dataSheet/rule/rule.data';
import {
ruleGroupEditFormSchema,
ruleGroupEditTable,
} from '@/views/dataQuality/dataSheet/rule/rule.data';
import { useMessage } from '@/hooks/web/useMessage';
import RuleGroupAddModal from './ruleGroupAddModel.vue';
// 初始化
const { createMessage, createConfirm } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
// 数据
// const getTitle = computed(() => (isUpdate.value ? '质量规则详情' : '新建规则'));
const getTitle = '管理规则组';
//初始化弹框
// 确认
async function handleSubmit() {
closeModal();
}
// 列表修改
function handleUpdate(record) {
openRuleGroupAddModel(true, {
isUpdate: true,
record,
});
}
// 列表删除
function handleRemove(record) {
createMessage.success('删除成功!');
}
/**
* 初始化模态框
*/
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
......@@ -55,18 +81,11 @@
// 塞值
}
});
/**确定按钮*/
async function handleSubmit() {
closeModal();
}
/** 列表删除 */
function handleRemove(record) {
createMessage.success('删除成功!');
}
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({
const [ruleGroupAddModel, { openModal: openRuleGroupAddModel }] = useModal();
/**
* 初始化表格
*/
const [registerTable] = useTable({
title: '',
api: async (params) => {
console.log('params:', params);
......
......@@ -34,41 +34,60 @@
</List.Item>
</template>
</List>
<RuleEditModel :disabled="true" @register="ruleEditModel" />
<RuleEditModel :disabled="true" @register="ruleEditModel" @success="REModalSuccess" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue';
import { BasicForm } from '@/components/Form';
import { BasicModal, useModal, useModalInner } from '@/components/Modal';
import { List } from 'ant-design-vue';
import { List, ModalProps } from 'ant-design-vue';
import { RollbackOutlined } from '@ant-design/icons-vue';
import { versionFormSchema } from './rule.data';
import { versionModelList } from './ruleData';
import RuleEditModel from './ruleEditModel.vue';
import { useMessage } from '@/hooks/web/useMessage';
// 初始化
const [ruleEditModel, { openModal: openRuleEditModel }] = useModal();
const isUpdate = ref(true);
const rowId = ref('');
// const getTitle = computed(() => (isUpdate.value ? '质量规则详情' : '新建规则'));
const { createMessage } = useMessage();
// 数据
const getTitle = '版本管理';
//初始化弹框
/**
* 方法
*/
// 版本回滚回调方法
function REModalSuccess() {
closeModal();
createMessage.success('回滚成功');
}
// 打开版本详情模态框
function handleRollback(record) {
openRuleEditModel(true, {
record,
isUpdate: true,
});
}
// 确定方法 -这里只要取消按钮
// async function handleSubmit() {
// closeModal();
// }
/**
* 弹窗
*/
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
setModalProps({
confirmLoading: false,
showOkBtn: false,
cancelText: '关闭',
} as ModalProps);
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
}
});
function handleRollback(record) {
openRuleEditModel(true, {
record,
isUpdate: true,
});
}
/**确定按钮*/
async function handleSubmit() {
closeModal();
}
</script>
......@@ -100,9 +100,9 @@ export const storageManagementData: any[] = [
pointNum: '5000',
num: '2000',
user: '张三',
parameterName: 'check_date',
parameterName: Math.random().toString(36).substring(2, 12),
parameterType: '字符类',
parameterValue: '参数值',
parameterValue: Math.random().toString(36).substring(7),
},
{
id: '2',
......@@ -114,9 +114,9 @@ export const storageManagementData: any[] = [
pointNum: '7000',
num: '3500',
user: '李四',
parameterName: 'check_date',
parameterName: Math.random().toString(36).substring(2, 12),
parameterType: '时间类',
parameterValue: '参数值',
parameterValue: Math.random().toString(36).substring(7),
},
{
id: '3',
......@@ -128,9 +128,9 @@ export const storageManagementData: any[] = [
pointNum: '6000',
num: '3000',
user: '王五',
parameterName: 'check_date',
parameterName: Math.random().toString(36).substring(2, 12),
parameterType: '数值类',
parameterValue: '参数值',
parameterValue: Math.random().toString(36).substring(7),
},
{
id: '4',
......@@ -142,9 +142,9 @@ export const storageManagementData: any[] = [
pointNum: '4500',
num: '2250',
user: '赵六',
parameterName: 'check_date',
parameterName: Math.random().toString(36).substring(2, 12),
parameterType: '自定义类',
parameterValue: '参数值',
parameterValue: Math.random().toString(36).substring(7),
},
{
id: '5',
......@@ -156,9 +156,9 @@ export const storageManagementData: any[] = [
pointNum: '5500',
num: '2750',
user: '孙七',
parameterName: 'check_date',
parameterName: Math.random().toString(36).substring(2, 12),
parameterType: '数值类',
parameterValue: '参数值',
parameterValue: Math.random().toString(36).substring(7),
},
];
export const storageManagementBasicFormSchema: FormSchema[] = [
......@@ -216,4 +216,85 @@ export const storageManagementBasicFormSchema: FormSchema[] = [
span: 24,
},
},
{
field: 'divider-linked',
component: 'Divider',
label: '计划逻辑正确',
colProps: {
span: 24,
},
},
{
field: 'field122',
component: 'InputTextArea',
label: '',
componentProps: {
disabled: true,
defaultValue: Math.random().toString(36).substring(2, 52),
},
colProps: {
span: 24,
},
},
{
field: 'divider-linked',
component: 'Divider',
label: '标题逻辑正确',
colProps: {
span: 24,
},
},
{
field: 'field123',
component: 'InputTextArea',
label: '',
componentProps: {
disabled: true,
defaultValue: Math.random().toString(36).substring(2, 52),
},
colProps: {
span: 24,
},
},
{
field: 'divider-linked',
component: 'Divider',
label: '名称逻辑正确',
colProps: {
span: 24,
},
},
{
field: 'field122',
component: 'InputTextArea',
label: '',
componentProps: {
disabled: true,
defaultValue: Math.random().toString(36).substring(2, 52),
},
colProps: {
span: 24,
},
},
{
field: 'divider-linked',
component: 'Divider',
label: '时刻逻辑',
colProps: {
span: 24,
},
},
{
field: 'field123',
component: 'InputTextArea',
label: '',
componentProps: {
disabled: true,
defaultValue: Math.random().toString(36).substring(2, 52),
},
colProps: {
span: 24,
},
},
];
......@@ -22,7 +22,11 @@
style="margin-right: 10px; margin-bottom: 20px"
>查看报告</a-button
>
<a-button type="primary" style="margin-right: 10px; margin-bottom: 20px" @click="handleSave"
<a-button
type="primary"
style="margin-right: 10px; margin-bottom: 20px"
@click="handleSave"
:disabled="isDisabled"
>保存</a-button
>
<a-button
......@@ -52,7 +56,7 @@
>运行</a-button
></div
>
<BasicForm @register="registerForm" />
<BasicForm @register="registerForm" :disabled="isDisabled" />
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<DeptTree class="w-1/4" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-3/4" :searchInfo="searchInfo" />
......@@ -89,6 +93,7 @@
const tableData = ref([]);
const isOnline = ref(true);
const isOffline = ref(false);
const isDisabled = ref(false);
const rowId = ref('');
const searchInfo = reactive<Recordable>({});
......@@ -177,15 +182,40 @@
go('/dataQuality/dataSheet/task/viewTaskOperation', false);
}
/** 上线 未完成 应为弹窗*/
/** 上线 */
function handleQualityTaskOnline() {
isOnline.value = false;
isOffline.value = true;
Modal.confirm({
title: '确认上线',
content: '是否确认上线?',
onOk: () => {
go('/dataQuality/dataSheet/task');
isOnline.value = false;
isOffline.value = true;
isDisabled.value = true;
createMessage.success('上线成功!');
},
onCancel: () => {
console.log('取消上线');
},
});
}
/** 下线 未完成 应为弹窗*/
/** 下线 */
function handleQualityTaskOffline() {
isOnline.value = true;
isOffline.value = false;
Modal.confirm({
title: '确认下线',
content: '是否确认下线?',
onOk: () => {
go('/dataQuality/dataSheet/task');
isOnline.value = true;
isOffline.value = false;
isDisabled.value = false;
createMessage.success('下线成功!');
},
onCancel: () => {
console.log('取消下线');
},
});
}
/** 配置运行 正在做 应为弹窗*/
......
......@@ -45,12 +45,20 @@
<a-button type="primary" @click="handleAddMainBody" style="margin-right: 10px"
>新增质量任务
</a-button>
<a-button type="primary" @click="handleAddQualityRule" style="margin-right: 10px"
>新增质量规则
</a-button>
<a-button
type="primary"
@click="handleQualityTaskRunSetting"
:disabled="getRowSelection().selectedRowKeys <= 0"
>配置运行</a-button
>
<!-- <a-button type="primary" @click="handleQualityTaskSetting" style="margin-right: 10px"
>配置质量任务文件
</a-button> -->
<!-- -->
<!-- <a-button type="primary" @click="handleAddQualityRule" style="margin-right: 10px">新增质量规则-->
<!-- </a-button>-->
<!-- -->
<!-- <a-button-->
<!-- type="primary"-->
<!-- @click="handleAlarmSetting"-->
......@@ -161,6 +169,7 @@
import AddFolder from '@/views/dataQuality/dataSheet/task/addFolder.vue';
import RemoveModal from '@/views/dataQuality/dataSheet/task/removeModal.vue';
import MainBodyModal from '@/views/dataQuality/dataSheet/task/mainBodyModal.vue';
import QualityRunSettingModal from './QualityTaskRunSetting.vue';
import QualitySettingModal from './QualityTaskSetting.vue';
import NewRuleModal from './QualityTaskNewRule.vue';
import AlarmSettingModal from './QualityTaskAlarmSetting.vue';
......@@ -307,18 +316,38 @@
openCheckRangePlusModal(true, {});
}
/** 上线 未完成 应为弹窗*/
/** 上线 */
function handleQualityTaskOnline() {
go('/dataQuality/dataSheet/task');
isOnline.value = false;
isOffline.value = true;
Modal.confirm({
title: '确认上线',
content: '是否确认上线?',
onOk: () => {
go('/dataQuality/dataSheet/task');
isOnline.value = false;
isOffline.value = true;
createMessage.success('上线成功!');
},
onCancel: () => {
console.log('取消上线');
},
});
}
/** 下线 未完成 应为弹窗*/
/** 下线 */
function handleQualityTaskOffline() {
go('/dataQuality/dataSheet/task');
isOnline.value = true;
isOffline.value = false;
Modal.confirm({
title: '确认下线',
content: '是否确认下线?',
onOk: () => {
go('/dataQuality/dataSheet/task');
isOnline.value = true;
isOffline.value = false;
createMessage.success('下线成功!');
},
onCancel: () => {
console.log('取消下线');
},
});
}
/** 设置业务标签 */
......@@ -341,11 +370,11 @@
}
function handleDeleteIds() {
createConfirm({
iconType: 'warning',
Modal.confirm({
title: '确认删除',
content: '确认批量删除选中数据吗?',
onOk() {
onOk: () => {
// Your code to delete the selected items goes here.
createMessage.success('批量删除成功!');
},
});
......
......@@ -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