Commit d95284e5 authored by baiyinhao's avatar baiyinhao

修改页面

parent fd9cc928
<template>
<div class="m-5 mr-0 overflow-hidden bg-white">
<BasicTree
title=""
ref="treeRef"
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
:defaultExpandAll="true"
:treeData="treeData"
:fieldNames="{ key: 'businessId', title: 'workSpaceName' }"
@select="handleSelect"
/>
</div>
</template>
<script lang="ts" setup>
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { TreeData } from './mock.ts';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
defineOptions({ name: 'DataSourceTree' });
const emit = defineEmits(['select']);
const { createMessage } = useMessage();
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
const [registerModal, { openModal }] = useModal();
async function fetch() {
treeData.value = handleTree(TreeData, 'businessId', undefined, undefined, undefined);
await nextTick(() => {
getTree().expandAll(true);
});
}
function handleTree(data, id, parentId, children, rootId) {
id = id || 'id';
parentId = parentId || 'parentId';
children = children || 'children';
rootId =
rootId ||
Math.min.apply(
Math,
data.map((item) => {
return item[parentId];
}),
) ||
0;
// 对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data));
// 循环所有项
const treeData = cloneData.filter((father) => {
const branchArr = cloneData.filter((child) => {
// 返回每一项的子级数组
return father[id] === child[parentId];
});
branchArr.length > 0 ? (father.children = branchArr) : '';
// 返回第一层
return father[parentId] === rootId;
});
return treeData !== '' ? treeData : data;
}
// function handleSelect() {
// const keys = getTree().getSelectedKeys();
// const node = getTree().getSelectedNode(keys[0]);
// // console.log('node', node);
// emit('select', node);
// }
/**选中的数据*/
function handleSelect(keys) {
emit('select', keys[0]);
}
onMounted(() => {
fetch();
});
</script>
<template> <template>
<div class="callerManage_details"> <div class="callerManage_details">
<div class="header"> <div class="header title_left">
<Icon @click="handleGoBack" class="backBtn" icon="ant-design:left-outlined" :size="20" :color="'#666C81'" /> <Icon @click="handleGoBack" class="backBtn" icon="ant-design:left-outlined" :size="20" />
<Icon icon="ant-design:user-switch-outlined" :size="20" :color="'#AFBAFE'" /> <Icon icon="ant-design:user-switch-outlined" :size="32" :color="'#7360e2'" />
<div class="header_info"> <div class="header_info">
<div>admin</div> <div>admin</div>
<div>调用方管理/admin</div> <div>调用方管理/admin</div>
</div> </div>
</div> </div>
<step-header title="基本信息"/> <step-header title="基本信息" />
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<template #tokenTime="{ field, model }"> <template #tokenTime="{ field, model }">
<InputNumber style="width: 55px" v-if="tokenTimeEidt" v-model:value="model[field]"></InputNumber> <InputNumber style="width: 55px" v-if="tokenTimeEidt" v-model:value="model[field]" />
<span v-else>&nbsp;&nbsp;&nbsp;{{ model[field] }}</span>&nbsp; <span v-else>&nbsp;&nbsp;&nbsp;{{ model[field] }}</span>&nbsp;
<EditOutlined @click="handleTokenTimeEdit" /> <EditOutlined @click="handleTokenTimeEdit" />
</template> </template>
<template #userKey="{ field, model }"> <template #userKey="{ field, model }">
<Input style="width: 300px" v-if="userKeyEidt" v-model:value="model[field]"></Input> <Input style="width: 300px" v-if="userKeyEidt" v-model:value="model[field]" />
<span v-else>&nbsp;&nbsp;&nbsp;{{ model[field] }}&nbsp;</span>&nbsp; <span v-else>&nbsp;&nbsp;&nbsp;{{ model[field] }}&nbsp;</span>&nbsp;
<EditOutlined @click="handleUserKeyEdit" /> <EditOutlined @click="handleUserKeyEdit" />
</template> </template>
</BasicForm> </BasicForm>
<step-header title="已使用服务"/> <step-header title="已使用服务" />
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
...@@ -40,89 +40,111 @@ ...@@ -40,89 +40,111 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { InputNumber,Input } from 'ant-design-vue'; import { InputNumber, Input } from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import { EditOutlined } from '@ant-design/icons-vue'; import { EditOutlined } from '@ant-design/icons-vue';
import {router} from "@/router"; import { router } from '@/router';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import {detailsColumns, formSchema, detailSchemas} from "./callerManage.data"; import { detailsColumns, formSchema, detailSchemas } from './callerManage.data';
import StepHeader from "@/components/stepHeader.vue"; import StepHeader from '@/components/stepHeader.vue';
import {tableListDetails} from "./mock"; import { tableListDetails } from './mock';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import {ref} from "vue"; import { ref } from 'vue';
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100, labelWidth: 100,
baseColProps: { lg: 12, md: 24 }, baseColProps: { lg: 12, md: 24 },
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
span: 23, span: 23,
}, },
}); });
const tokenTimeEidt = ref(false); const tokenTimeEidt = ref(false);
function handleTokenTimeEdit() { function handleTokenTimeEdit() {
tokenTimeEidt.value = !tokenTimeEidt.value tokenTimeEidt.value = !tokenTimeEidt.value;
} }
const userKeyEidt = ref(false); const userKeyEidt = ref(false);
function handleUserKeyEdit() { function handleUserKeyEdit() {
userKeyEidt.value = !userKeyEidt.value userKeyEidt.value = !userKeyEidt.value;
} }
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({ const [
title: ' ', registerTable,
api: async (params) => { { reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
const response = { ] = useTable({
pageNu: "1", title: ' ',
pageSize: "10", api: async (params) => {
pages: "1", const response = {
total: tableListDetails.length, pageNu: '1',
code:'', pageSize: '10',
message:'', pages: '1',
data: tableListDetails, total: tableListDetails.length,
}; code: '',
message: '',
return { ...response}; data: tableListDetails,
}, };
columns:detailsColumns,
formConfig: {
showActionButtonGroup:false,
labelWidth: 120,
schemas: detailSchemas,
autoSubmitOnEnter: true,
},
useSearchForm: true,
showTableSetting: false,
bordered: true,
actionColumn: {
width: 120,
title: '操作',
dataIndex: 'action',
},
});
function handleGoBack() { return { ...response };
router.go(-1); },
} columns: detailsColumns,
function handleCancelCall() { formConfig: {
showActionButtonGroup: false,
labelWidth: 120,
schemas: detailSchemas,
autoSubmitOnEnter: true,
},
useSearchForm: true,
showTableSetting: false,
bordered: true,
actionColumn: {
width: 120,
title: '操作',
dataIndex: 'action',
},
});
} function handleGoBack() {
router.go(-1);
}
function handleCancelCall() {}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.callerManage_details{ .callerManage_details {
background-color: white; padding: 20px;
padding: 20px; background-color: white;
.header{
.header {
display: flex;
align-items: center;
padding-bottom: 20px;
.backBtn {
cursor: pointer;
}
.header_info {
padding-left: 15px;
}
}
}
.title {
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 20px; justify-content: space-between;
.backBtn{
cursor: pointer; .title_left {
} display: flex;
.header_info{ align-items: center;
padding-left: 15px; justify-content: space-between;
margin-left: 20px;
.name {
padding-bottom: 5px;
font-size: 17px;
font-weight: 600;
}
} }
} }
}
</style> </style>
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <PageWrapper class="w-1/3 xl:w-2/9" dense style="height: 100vh">
<GroupTree @select="onNodeSelect" style="height: 100%; overflow-y: auto" />
<template #bodyCell="{ column, record }"> </PageWrapper>
<template v-if="column.key === 'action'"> <PageWrapper class="w-2/3 xl:w-7/9 enter-y" dense
<TableAction ><template #headerContent>
:actions="[ <div style="display: flex; justify-content: space-between">
{ <div class="title">
label: '详情', <div class="title_left">
onClick: handleDetails.bind(null, record), <div>
}, <Icon icon="dashicons:admin-settings" :size="32" :color="'#0960BD'" />
]" </div>
/> <div style="padding-left: 10px">
</template> <div class="name">调用方管理</div>
<div style="color: darkgray">数据服务/服务管理</div>
</div>
</div>
</div>
<!-- <a-button type="primary" @click="handleLog">调用日志</a-button> -->
</div>
</template>
<template #footer>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '详情',
onClick: handleDetails.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
</div>
</template> </template>
</BasicTable> </PageWrapper>
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, onMounted,ref } from 'vue'; import { reactive, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { columns, searchFormSchema } from './callerManage.data'; import { columns, searchFormSchema } from './callerManage.data';
import {tableList} from "./mock"; import { tableList } from './mock';
import { useRoute, onBeforeRouteLeave } from 'vue-router';
import { useRoute, onBeforeRouteLeave } from 'vue-router'; import { router } from '@/router';
import { router } from '@/router'; import GroupTree from './GroupTree.vue';
import Icon from '@/components/Icon/Icon.vue';
defineOptions({ name: 'safetyLevelManage' }); defineOptions({ name: 'SafetyLevelManage' });
const { createMessage,createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const route = useRoute(); const route = useRoute();
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm,getRowSelection }] = useTable({ const [
title: '调用方管理列表', registerTable,
api: async (params) => { { reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
const response = { ] = useTable({
pageNu: "1", title: '调用方管理列表',
pageSize: "10", api: async (params) => {
pages: "1", const response = {
total: tableList.length, pageNu: '1',
code:'', pageSize: '10',
message:'', pages: '1',
data: tableList, total: tableList.length,
}; code: '',
message: '',
data: tableList,
};
return { ...response}; return { ...response };
}, },
rowKey: 'businessId', rowKey: 'businessId',
rowSelection: true, rowSelection: true,
columns, columns,
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,
schemas: searchFormSchema, schemas: searchFormSchema,
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: false, showTableSetting: false,
bordered: true, showIndexColumn: false,
handleSearchInfoFn(info) { bordered: true,
console.log('handleSearchInfoFn', info); handleSearchInfoFn(info) {
return info; console.log('handleSearchInfoFn', info);
}, return info;
actionColumn: { },
width: 120, actionColumn: {
title: '操作', width: 120,
dataIndex: 'action', title: '操作',
// slots: { customRender: 'action' }, dataIndex: 'action',
}, // slots: { customRender: 'action' },
});
function handleDeleteIds() {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '确认批量删除选中数据吗?',
onOk() {
createMessage.success('批量删除成功!');
}, },
}); });
}
function handleDetails() {
router.push({
path: '/dataService/serviceManage/callerManage/details',
});
}
function handleDeleteIds() {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '确认批量删除选中数据吗?',
onOk() {
createMessage.success('批量删除成功!');
},
});
}
function handleDetails() {
router.push({
path: '/dataService/serviceManage/callerManage/details',
});
}
onMounted(() => { onMounted(() => {});
</script>
<style scoped lang="scss">
.title {
display: flex;
align-items: center;
justify-content: space-between;
}); .title_left {
display: flex;
align-items: center;
justify-content: space-between;
</script> .name {
padding-bottom: 5px;
font-size: 17px;
font-weight: 600;
}
}
}
</style>
export const TreeData: 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: 'admin-个人工作区',
workSpaceName: 'admin-个人工作区',
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: 102,
parentWorkSpaceName: '共享工作区',
workSpaceName: '共享工作区',
parentId: 100,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '0',
businessId: 103,
parentWorkSpaceName: '高级工作区',
workSpaceName: '高级工作区',
parentId: 100,
'code:': '010',
ancestors: '0,100,107',
orderNum: 2,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 201,
parentWorkSpaceName: 'admin-个人工作区',
workSpaceName: '独导',
parentId: 101,
'code:': '002',
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: 'test',
parentId: 102,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 203,
parentWorkSpaceName: '高级工作区',
workSpaceName: 'sql_api',
parentId: 103,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 301,
parentWorkSpaceName: 'admin-个人工作区',
workSpaceName: '向导API',
parentId: 201,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
{
delFlag: '0',
flag: '1',
businessId: 302,
parentWorkSpaceName: '共享工作区',
workSpaceName: '托管系统',
parentId: 202,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
children: [],
selectType: null,
createTime: '2024-10-24 10:04:04',
createBy: 'admin',
},
];
export const tableList: any[] = [ export const tableList: any[] = [
{ {
businessId: 1, businessId: 1,
account:'admin', account: 'admin',
name:'admin', name: 'admin',
serviceNum:'17', serviceNum: '17',
callNum:'28', callNum: '28',
callSuccessNum:'18', callSuccessNum: '18',
callFailNum:'10', callFailNum: '10',
}, },
{ {
businessId: 1, businessId: 1,
account:'admin', account: 'admin',
name:'admin', name: 'admin',
serviceNum:'17', serviceNum: '17',
callNum:'28', callNum: '28',
callSuccessNum:'18', callSuccessNum: '18',
callFailNum:'10', callFailNum: '10',
}, },
{ {
businessId: 1, businessId: 1,
account:'admin', account: 'admin',
name:'admin', name: 'admin',
serviceNum:'17', serviceNum: '17',
callNum:'28', callNum: '28',
callSuccessNum:'18', callSuccessNum: '18',
callFailNum:'10', callFailNum: '10',
}, },
] ];
export const tableListDetails: any[] = [ export const tableListDetails: any[] = [
{ {
businessId: 1, businessId: 1,
name:'test1', name: 'test1',
callNum:'0', callNum: '0',
callSuccessNum:'0', callSuccessNum: '0',
callFailNum:'0', callFailNum: '0',
flag:'调用中', flag: '调用中',
startTime:'2023-12-05', startTime: '2023-12-05',
endTime:'2023-12-05', endTime: '2023-12-05',
}, },
{ {
businessId: 1, businessId: 1,
name:'test1', name: 'test1',
callNum:'0', callNum: '0',
callSuccessNum:'0', callSuccessNum: '0',
callFailNum:'0', callFailNum: '0',
flag:'调用中', flag: '调用中',
startTime:'2023-12-05', startTime: '2023-12-05',
endTime:'2023-12-05', endTime: '2023-12-05',
}, },
{ {
businessId: 1, businessId: 1,
name:'test1', name: 'test1',
callNum:'0', callNum: '0',
callSuccessNum:'0', callSuccessNum: '0',
callFailNum:'0', callFailNum: '0',
flag:'调用中', flag: '调用中',
startTime:'2023-12-05', startTime: '2023-12-05',
endTime:'2023-12-05', endTime: '2023-12-05',
}, },
] ];
...@@ -3,61 +3,84 @@ ...@@ -3,61 +3,84 @@
<template #title> <template #title>
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div class="flex"> <div class="flex">
<Icon icon="ant-design:setting-outlined" :size="30" style="color:#0960BD;"/> <Icon icon="ant-design:setting-outlined" :size="30" style="color: #0960bd" />
<div style="margin-left: 10px"> <div style="margin-left: 10px">
<span>上线设置</span> <span>上线设置</span>
<h4 style="color: #BFBFBF">API / 验收 / SAL API</h4> <h4 style="color: #bfbfbf">API / 验收 / SAL API</h4>
</div> </div>
</div> </div>
<div class="flex" style="gap: 15px"> <div class="flex" style="gap: 15px">
<a-button type="link" @click="handleTest"> <a-button type="link" @click="handleTest">
<Icon icon="ant-design:bug-outlined" :size="24"/> <Icon icon="ant-design:bug-outlined" :size="24" />
<p style="color: black">调试</p> <p style="color: black">调试</p>
</a-button> </a-button>
<a-button type="link" @click="handleSave"> <a-button type="link" @click="handleSave">
<Icon icon="ant-design:inbox-outlined" :size="24"/> <Icon icon="ant-design:inbox-outlined" :size="24" />
<p style="color: black">保存</p> <p style="color: black">保存</p>
</a-button> </a-button>
</div> </div>
</div> </div>
</template> </template>
<div> <div>
<BasicForm @register="registerForm" style="padding:0 0 0 40px"> <BasicForm @register="registerForm" style="padding: 0 0 0 40px">
<template #dynamicRouting="{ field,model, }"> <template #dynamicRouting="{ field, model }">
<div> <div>
<Select style="width: 30%" placeholder="请选择" <Select
v-model:value="model['dynamic']" :options="routeList"/> style="width: 30%"
<Input style="width: 70%" placeholder="请选择"
v-model:value="model[field]" placeholder="请输入"/> v-model:value="model['dynamic']"
:options="routeList"
/>
<Input style="width: 70%" v-model:value="model[field]" placeholder="请输入" />
</div> </div>
</template> </template>
<template #expirationDuration="{ field,model, }"> <template #expirationDuration="{ field, model }">
<FormItem :name="field" label="有效期持续时间" <FormItem
:rules="[{ required: true, message: '请输入有效期持续时间',type: 'string' }]" :name="field"
style="margin-left: 0"> label="有效期持续时间"
:rules="[{ required: true, message: '请输入有效期持续时间', type: 'string' }]"
style="margin-left: 0"
>
<Input.Group> <Input.Group>
<FormItemRest> <FormItemRest>
<Input style="width: calc(100% - 380px); margin-left: -1px;" <Input
v-model:value="model[field]" placeholder="请输入"/> style="width: calc(100% - 380px); margin-left: -1px"
v-model:value="model[field]"
placeholder="请输入"
/>
</FormItemRest> </FormItemRest>
<FormItemRest> <FormItemRest>
<Select style="width: 380px" placeholder="请选择" <Select
v-model:value="model['expiration']" :options="timeList"/> style="width: 380px"
placeholder="请选择"
v-model:value="model['expiration']"
:options="timeList"
/>
</FormItemRest> </FormItemRest>
</Input.Group> </Input.Group>
</FormItem> </FormItem>
</template> </template>
<template #rateLimitPolicy="{ field,model, }"> <template #rateLimitPolicy="{ field, model }">
<FormItem :name="field" label="流控策略" <FormItem
:rules="[{ required: true, message: '请输入流控策略',type: 'string' }]" :name="field"
style="margin-left: 45px"> label="流控策略"
:rules="[{ required: true, message: '请输入流控策略', type: 'string' }]"
style="margin-left: 45px"
>
<Input.Group> <Input.Group>
<FormItemRest> <FormItemRest>
<Input style="width: calc(100% - 380px); margin-left: -1px;" <Input
v-model:value="model[field]" placeholder="请输入"/> style="width: calc(100% - 380px); margin-left: -1px"
v-model:value="model[field]"
placeholder="请输入"
/>
</FormItemRest> </FormItemRest>
<Select style="width: 380px" placeholder="请选择" <Select
v-model:value="model['rateLimit']" :options="timesDataList"/> style="width: 380px"
placeholder="请选择"
v-model:value="model['rateLimit']"
:options="timesDataList"
/>
</Input.Group> </Input.Group>
</FormItem> </FormItem>
</template> </template>
...@@ -67,29 +90,28 @@ ...@@ -67,29 +90,28 @@
<ProductionTestModal @register="productionTestModal" /> <ProductionTestModal @register="productionTestModal" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
/**上线设置页面*/ /**上线设置页面*/
import {PageWrapper} from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import {tableList, routeList, timeList, timesDataList} from './mock'; import { tableList, routeList, timeList, timesDataList } from './mock';
import {schemas} from './onlineManage.data'; import { schemas } from './onlineManage.data';
import Icon from "@/components/Icon/Icon.vue"; import Icon from '@/components/Icon/Icon.vue';
import {onMounted, reactive, ref} from "vue"; import { onMounted, reactive, ref } from 'vue';
import {router} from '@/router'; import { router } from '@/router';
import {useRoute} from "vue-router"; import { useRoute } from 'vue-router';
import {BasicForm, FormSchema, useForm} from "@/components/Form"; import { BasicForm, FormSchema, useForm } from '@/components/Form';
import {useMessage} from "@/hooks/web/useMessage"; import { useMessage } from '@/hooks/web/useMessage';
import {FormItem, FormItemRest} from "ant-design-vue"; import { FormItem, FormItemRest, Select, Input } from 'ant-design-vue';
import {Select, Input} from "ant-design-vue"; import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
import {BasicDrawer, useDrawerInner} from "@/components/Drawer"; import ProductionTestModal from './productionTestModal.vue';
import ProductionTestModal from "./productionTestModal.vue"; import { useModal } from '@/components/Modal';
import {useModal} from "@/components/Modal";
const [productionTestModal, { openModal: openProductionTestModal }] = useModal();
const title = ref(); const [productionTestModal, { openModal: openProductionTestModal }] = useModal();
const route = useRoute();
/**上线设置表单配置*/ const title = ref();
const {createMessage} = useMessage(); const route = useRoute();
const [registerForm, {getFieldsValue, resetFields, setFieldsValue}] = /**上线设置表单配置*/
useForm({ const { createMessage } = useMessage();
const [registerForm, { getFieldsValue, resetFields, setFieldsValue }] = useForm({
labelWidth: 120, labelWidth: 120,
schemas, schemas,
showActionButtonGroup: false, showActionButtonGroup: false,
...@@ -97,63 +119,61 @@ const [registerForm, {getFieldsValue, resetFields, setFieldsValue}] = ...@@ -97,63 +119,61 @@ const [registerForm, {getFieldsValue, resetFields, setFieldsValue}] =
span: 24, span: 24,
}, },
}); });
const [register,{closeDrawer}] = useDrawerInner((data) => { const [register, { closeDrawer }] = useDrawerInner((data) => {
// 方式1 // 方式1
setFieldsValue({ setFieldsValue({
field2: data.data, field2: data.data,
field1: data.info, field1: data.info,
}); });
});
/**测试按钮*/
function handleTest() {
openProductionTestModal(true, {
isUpdate: false,
}); });
}
/**保存按钮*/ /**测试按钮*/
function handleSave() { function handleTest() {
closeDrawer(); openProductionTestModal(true, {
createMessage.success('保存成功!!'); isUpdate: false,
} });
}
/**保存按钮*/
function handleSave() {
closeDrawer();
createMessage.success('保存成功');
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.modal_top { .modal_top {
padding: 20px 0 20px 20px; display: flex;
display: flex; align-items: center;
align-items: center; padding: 20px 0 20px 20px;
.title { .title {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
}
} }
}
.save-button {
position: absolute; /* 绝对定位 */ .save-button {
top: 15px; /* 顶部对齐 */ position: absolute; /* 绝对定位 */
right: 10px; /* 右侧对齐 */ top: 15px; /* 顶部对齐 */
margin: 10px 60px 10px 10px; /* 可选:增加一些边缘间距 */ right: 10px; /* 右侧对齐 */
} margin: 10px 60px 10px 10px; /* 可选:增加一些边缘间距 */
}
.save-button1 { .save-button1 {
position: absolute; /* 绝对定位 */ position: absolute; /* 绝对定位 */
top: 15px; /* 顶部对齐 */ top: 15px; /* 顶部对齐 */
right: 10px; /* 右侧对齐 */ right: 10px; /* 右侧对齐 */
margin: 10px; /* 可选:增加一些边缘间距 */ margin: 10px; /* 可选:增加一些边缘间距 */
} }
.local_typeValue { .local_typeValue {
width: calc(100% - 120px); width: calc(100% - 120px);
margin-bottom: 0; margin-bottom: 0;
margin-left: -1px; margin-left: -1px;
border-right: 0; border-right: 0;
.ant-input { .ant-input {
border-radius: 0 6px 6px 0; border-radius: 0 6px 6px 0;
}
} }
}
</style> </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