Commit 9ce28302 authored by chenjiahao's avatar chenjiahao

Merge remote-tracking branch 'origin/master'

parents c02421cd b804180c
<template>
<PageWrapper dense content-full-height header-sticky>
<template #footer>
<BasicTable @register="queryTable">
<template #configValue="{ text, record }">
<Input v-model:value="record.configValue" />
</template>
</BasicTable>
<a-button type="primary">测试</a-button>
<Tabs v-model:activeKey="activeKey">
<TabPane key="1" tab="请求报文">
<div class="flex" style="margin: 15px 0">
<div style="width: 4px; margin: 4px 0; background-color: #128afa"></div>
<div style="margin-left: 6px"> 动态报文 </div>
</div>
<Textarea :auto-size="{ minRow: 6 }" v-model:value="message" />
</TabPane>
<TabPane key="2" tab="请求代码">
<div class="flex" style="margin: 15px 0">
<div style="width: 4px; margin: 4px 0; background-color: #128afa"></div>
<div style="margin-left: 6px"> 动态路由地址 </div>
</div>
<Textarea :auto-size="{ minRow: 6 }" v-model:value="address" />
<div class="flex" style="margin: 25px 0 15px 0">
<span>返回结果源码</span>
<BasicHelp text="返回结果源码" />
</div>
<Textarea :auto-size="{ minRow: 6 }" v-model:value="resultTxt" />
</TabPane>
</Tabs>
</template>
</PageWrapper>
</template>
<script lang="ts" setup>
import PageWrapper from '../../../../../components/Page/src/PageWrapper.vue';
import BasicTable from '../../../../../components/Table/src/BasicTable.vue';
import { Input, Tabs, TabPane, Textarea } from 'ant-design-vue';
import { BasicTableProps, useTable } from '@/components/Table';
import { ref } from 'vue';
import { testTableColumn } from '@/views/dataService/serviceMarket/myCall/apiTest/test.data';
import { testTableData } from '@/views/dataService/serviceMarket/myCall/apiTest/testData';
import BasicHelp from '@/components/Basic/src/BasicHelp.vue';
const address =
"curl -X POST‘http://node322:28143/employee′-H'token:\n" +
"7406056a00d65806200fe299d573a49b6bac08938e4ec73143d48caf110723bbc6d0e7efac9e01a2abbadada175b3c6ca3b251fd76cbbefed08f234998b5f7ac'-H'Content-Type:\n" +
'application/json\'-H\'Accept:*/*’-d\'("departmentID":"1")}"';
const resultTxt =
'{\n' +
'"success":true,\n' +
'"code":200,\n' +
'"message": "success",\n' +
'“data":{\n' +
'"valueSize": 70,\n' +
'"columnNames":[\n' +
'"LastName"\n' +
'"FirstName"\n' +
'}\n' +
'}';
const message =
'POST /login HTTP/1.1\n' +
'Host: www.example.com\n' +
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36\n' +
'Accept: application/json\n' +
'Content-Type: application/x-www-form-urlencoded\n' +
'\n' +
'username=admin&password=123456';
const activeKey = ref();
const [queryTable] = useTable({
title: '请求参数',
scroll: { y: 200 },
api: async (params) => {
console.log('params', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: testTableData.length,
code: '',
message: '',
data: testTableData,
};
return { ...response };
},
columns: testTableColumn,
useSearchForm: false,
showTableSetting: false,
showIndexColumn: false,
pagination: false,
rowKey: 'id',
} as BasicTableProps);
</script>
<style scoped></style>
import { BasicColumn } from '@/components/Table';
export const testTableColumn: BasicColumn[] = [
{
title: '参数code',
dataIndex: 'code',
},
{
title: '参数名称',
dataIndex: 'name',
},
{
title: '参数类型',
dataIndex: 'type',
},
{
title: '注释',
dataIndex: 'remark',
},
{
title: '是否必填',
dataIndex: 'required',
},
{
title: '参数值',
dataIndex: 'configValue',
slots: { customRender: 'configValue' },
},
];
export const testTableData = [
{
code: 'departmentID',
name: 'departmentID',
type: 'String',
remark: '',
required: '否',
configValue: 1,
},
];
...@@ -66,13 +66,13 @@ export const detailPageColumn: BasicColumn[] = [ ...@@ -66,13 +66,13 @@ export const detailPageColumn: BasicColumn[] = [
]; ];
export const detailReturnColumn: BasicColumn[] = [ export const detailReturnColumn: BasicColumn[] = [
{ {
title: '参数code', title: '列名',
dataIndex: 'code', dataIndex: 'name',
width: 150, width: 150,
}, },
{ {
title: '参数名称', title: '参数code',
dataIndex: 'name', dataIndex: 'code',
width: 150, width: 150,
}, },
{ {
...@@ -81,3 +81,15 @@ export const detailReturnColumn: BasicColumn[] = [ ...@@ -81,3 +81,15 @@ export const detailReturnColumn: BasicColumn[] = [
width: 150, width: 150,
}, },
]; ];
export const detailOrderColumn: BasicColumn[] = [
{
title: '列名',
dataIndex: 'field',
width: 150,
},
{
title: '排序方式',
dataIndex: 'order',
width: 150,
},
];
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
<Descriptions.Item label="API模式"> 向导模式 </Descriptions.Item> <Descriptions.Item label="API模式"> 向导模式 </Descriptions.Item>
<Descriptions.Item label="数据源"> Kundb2.1.2-yl </Descriptions.Item> <Descriptions.Item label="数据源"> Kundb2.1.2-yl </Descriptions.Item>
<Descriptions.Item label="数据库"> bm_catalog1 </Descriptions.Item> <Descriptions.Item label="数据库"> bm_catalog1 </Descriptions.Item>
<Descriptions.Item label="数据"> employee </Descriptions.Item> <Descriptions.Item label="数据"> employee </Descriptions.Item>
</Descriptions> </Descriptions>
<Divider /> <Divider />
<BasicTable @register="queryTable" /> <div class="flex" style="gap: 20px; flex-direction: column">
<BasicTable @register="pageTable" /> <BasicTable @register="queryTable" />
<BasicTable @register="returnTable" /> <BasicTable @register="pageTable" />
<BasicTable @register="returnTable" />
<BasicTable @register="orderTable" />
</div>
</template> </template>
<AddModel @register="addModel" /> <AddModel @register="addModel" />
</PageWrapper> </PageWrapper>
...@@ -29,6 +32,7 @@ ...@@ -29,6 +32,7 @@
import AddModel from '@/views/dataService/serviceMarket/serviceSearch/apiDetail/addModel.vue'; import AddModel from '@/views/dataService/serviceMarket/serviceSearch/apiDetail/addModel.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { import {
detailOrderColumn,
detailPageColumn, detailPageColumn,
detailQueryColumn, detailQueryColumn,
detailReturnColumn, detailReturnColumn,
...@@ -106,6 +110,24 @@ ...@@ -106,6 +110,24 @@
showIndexColumn: false, showIndexColumn: false,
// striped: false, // striped: false,
}); });
const [orderTable] = useTable({
title: '排序参数',
// 定高
scroll: { y: 150 },
api: async (params) => {
console.log('params', params);
const response = {
code: '',
message: '',
data: [],
};
return { ...response };
},
columns: detailOrderColumn,
pagination: false,
showIndexColumn: false,
// striped: false,
});
</script> </script>
<style scoped></style> <style scoped></style>
...@@ -2,25 +2,42 @@ ...@@ -2,25 +2,42 @@
<PageWrapper title="我的调用" contentBackground headerSticky> <PageWrapper title="我的调用" contentBackground headerSticky>
<template #footer> <template #footer>
<Descriptions :column="2"> <Descriptions :column="2">
<Descriptions.Item label="账号"> admin </Descriptions.Item> <Descriptions.Item>
<Descriptions.Item label="用户名称"> admin </Descriptions.Item> <span class="item-label">账号:</span>
<Descriptions.Item label="用户token" :span="2"> admin
</Descriptions.Item>
<Descriptions.Item> <span class="item-label">用户名称:</span> admin </Descriptions.Item>
<Descriptions.Item :span="2">
<span class="item-label">用户token:</span>
<span>{{ token }}</span> <span>{{ token }}</span>
<CopyOutlined @click="copyText" style="margin-left: 10px" /> <CopyOutlined @click="copyText" style="margin-left: 10px" />
<span v-if="copySuccess" style="color: #40c397">文本已复制</span> <span v-if="copySuccess" style="color: #40c397">复制成功</span>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item :span="2"> <Descriptions.Item :span="2">
<span style="color: #979dae; margin-left: 76.2px" <span style="color: #979dae; margin-left: 76.2px"
>一个用户只有一个token,token用于识别用户身份和安全性要求</span >一个用户只有一个token,token用于识别用户身份和安全性要求</span
> >
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="用户密钥" :span="2"> transwarp1234567 </Descriptions.Item> <Descriptions.Item :span="2">
<span class="item-label">用户密钥:</span>
transwarp1234567
</Descriptions.Item>
</Descriptions> </Descriptions>
<BasicTable @register="callTable"> <BasicTable @register="callTable">
<template #toolbar> <template #toolbar>
<a-button type="link" :disabled="getRowSelection().selectedRowKeys <= 0" <div class="flex-1 flex justify-between">
><FileMarkdownOutlined style="font-size: 18px" />下载API Doc</a-button <Input style="width: 200px" placeholder="输入关键字搜索" v-model:value="searchValue">
> <template #suffix>
<SearchOutlined />
</template>
</Input>
<a-button
type="link"
:disabled="getRowSelection().selectedRowKeys <= 0"
@click="handleDownload"
><FileMarkdownOutlined style="font-size: 18px" />下载API Doc</a-button
>
</div>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
...@@ -39,6 +56,7 @@ ...@@ -39,6 +56,7 @@
{ {
// api // api
icon: 'ant-design:api-outlined', icon: 'ant-design:api-outlined',
onClick: handleApi.bind(null, record),
}, },
]" ]"
/> />
...@@ -90,8 +108,13 @@ ...@@ -90,8 +108,13 @@
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import AddModel from '@/views/dataService/serviceMarket/serviceSearch/apiDetail/addModel.vue'; import AddModel from '@/views/dataService/serviceMarket/serviceSearch/apiDetail/addModel.vue';
import BasicTable from '@/components/Table/src/BasicTable.vue'; import {
import { BasicColumn, useTable, TableAction } from '@/components/Table'; BasicColumn,
useTable,
TableAction,
BasicTableProps,
BasicTable,
} from '@/components/Table';
import { entityData } from '@/views/dataWarehousePlanning/logicalModel/modelDetail/modelData'; import { entityData } from '@/views/dataWarehousePlanning/logicalModel/modelDetail/modelData';
import { entityColumns } from '@/views/dataWarehousePlanning/logicalModel/modelDetail/versionComparison/comparison.data'; import { entityColumns } from '@/views/dataWarehousePlanning/logicalModel/modelDetail/versionComparison/comparison.data';
import { import {
...@@ -99,7 +122,9 @@ ...@@ -99,7 +122,9 @@
callTableColumn, callTableColumn,
} from '@/views/dataService/serviceMarket/myCall/call.data'; } from '@/views/dataService/serviceMarket/myCall/call.data';
import { callData } from '@/views/dataService/serviceMarket/myCall/callData'; import { callData } from '@/views/dataService/serviceMarket/myCall/callData';
import {useMessage} from "@/hooks/web/useMessage";
const searchValue = ref();
const router = useRouter(); const router = useRouter();
const token = ref<string>( const token = ref<string>(
'fc68b6929ceb4aad5035d8805cac466716a7edf6f848c2b2e26dfcla47ea4a1241b640016b91eb90bfc0d57517cd7fa3b251fd76cbbefed08f234998b5f7ac', 'fc68b6929ceb4aad5035d8805cac466716a7edf6f848c2b2e26dfcla47ea4a1241b640016b91eb90bfc0d57517cd7fa3b251fd76cbbefed08f234998b5f7ac',
...@@ -125,6 +150,11 @@ ...@@ -125,6 +150,11 @@
query: record, query: record,
}); });
} }
function handleApi() {
router.push({
path: '/dataService/serviceMarket/myCall/apiTest',
});
}
function handleMonitor(record) { function handleMonitor(record) {
router.push({ router.push({
path: '/dataService/serviceMonitor/monitorInfo', path: '/dataService/serviceMonitor/monitorInfo',
...@@ -146,15 +176,15 @@ ...@@ -146,15 +176,15 @@
}; };
return { ...response }; return { ...response };
}, },
formConfig: { // formConfig: {
labelWidth: 80, // labelWidth: 80,
schemas: callFormSchema, // schemas: callFormSchema,
autoSubmitOnEnter: true, // autoSubmitOnEnter: true,
}, // },
rowKey: 'businessId', rowKey: 'businessId',
// 列 // 列
columns: callTableColumn, columns: callTableColumn,
useSearchForm: true, useSearchForm: false,
showIndexColumn: false, showIndexColumn: false,
showTableSetting: false, showTableSetting: false,
rowSelection: true, rowSelection: true,
...@@ -165,7 +195,15 @@ ...@@ -165,7 +195,15 @@
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
} as BasicColumn, } as BasicColumn,
}); } as BasicTableProps);
const { createMessage } = useMessage();
function handleDownload() {
createMessage.success('下载成功!');
}
</script> </script>
<style scoped></style> <style scoped>
.item-label {
width: 76.2px;
}
</style>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<!-- <div class="path">资源编目</div>--> <!-- <div class="path">资源编目</div>-->
</div> </div>
<div class="buttonGroup"> <div class="buttonGroup">
<Segmented v-model:value="value" :options="data"> <Segmented @change="segmentedChange" v-model:value="value" :options="data">
<template #label="{ payload, value: segmentValue }"> <template #label="{ payload, value: segmentValue }">
<div class="icon-container"> <div class="icon-container">
<Icon <Icon
...@@ -23,8 +23,12 @@ ...@@ -23,8 +23,12 @@
</div> </div>
</template> </template>
</Segmented> </Segmented>
<a-button type="primary" @click="handleBulkDownload">批量下载</a-button> <a-button :disabled="isDisabled" type="primary" @click="handleBulkDownload"
<a-button type="primary" @click="handleBatchPush">批量推送</a-button> >批量下载</a-button
>
<a-button :disabled="isDisabled" type="primary" @click="pushNotifications(selectedCard)"
>批量推送</a-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -108,11 +112,17 @@ ...@@ -108,11 +112,17 @@
<span v-if="item.isShare">有条件共享</span> <span v-if="item.isShare">有条件共享</span>
<span v-else>无条件共享</span> <span v-else>无条件共享</span>
<div> <div>
<a-button style="padding: 0; border: none; box-shadow: none"> <a-button
style="padding: 0; border: none; box-shadow: none"
@click="information(item)"
>
<Icon icon="icon-park-outline:eyes" />{{ item.view }}</a-button <Icon icon="icon-park-outline:eyes" />{{ item.view }}</a-button
> >
<Divider type="vertical" /> <Divider type="vertical" />
<a-button style="padding: 0; border: none; box-shadow: none"> <a-button
style="padding: 0; border: none; box-shadow: none"
@click="pushNotifications(item)"
>
<Icon icon="icon-park-outline:hand-up" />{{ item.edit }}</a-button <Icon icon="icon-park-outline:hand-up" />{{ item.edit }}</a-button
> >
</div> </div>
...@@ -137,6 +147,8 @@ ...@@ -137,6 +147,8 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
/> />
<ApplyForPushNotificationsModal @register="registerApplyForPushNotificationsModal" />
<EditModal @register="registerEditModal" />
</PageWrapper> </PageWrapper>
</div> </div>
</template> </template>
...@@ -164,6 +176,9 @@ ...@@ -164,6 +176,9 @@
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import GroupTree from './GroupTree.vue'; import GroupTree from './GroupTree.vue';
import { Columns } from './commonDataSet.data'; import { Columns } from './commonDataSet.data';
import { useModal } from '@/components/Modal';
import ApplyForPushNotificationsModal from '@/views/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal.vue';
import EditModal from '@/views/mallResourceDevelopment/dataSet/commonDataSet/editModal.vue';
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const route = useRouter(); const route = useRouter();
...@@ -174,7 +189,7 @@ ...@@ -174,7 +189,7 @@
const selectedCard = reactive([] as any[]); const selectedCard = reactive([] as any[]);
const cardListData = ref([]); const cardListData = ref([]);
const workSpaceName = ref('党建建设'); const workSpaceName = ref('党建建设');
const isDisabled = ref();
const data = ref([ const data = ref([
{ {
value: 'cardList', value: 'cardList',
...@@ -190,6 +205,12 @@ ...@@ -190,6 +205,12 @@
}, },
]); ]);
const [
registerApplyForPushNotificationsModal,
{ openModal: openApplyForPushNotificationsModal },
] = useModal();
const [registerEditModal, { openModal: openEditModal }] = useModal();
const [registerTable, { reload, getRowSelection }] = useTable({ const [registerTable, { reload, getRowSelection }] = useTable({
api: async () => { api: async () => {
let filteredList = cardList.filter((item) => { let filteredList = cardList.filter((item) => {
...@@ -225,7 +246,10 @@ ...@@ -225,7 +246,10 @@
return { ...response, data: cardListData.value }; return { ...response, data: cardListData.value };
}, },
columns: Columns, columns: Columns,
rowSelection: true, rowSelection: {
type: 'checkbox',
onChange: onSelectionChange,
},
showTableSetting: false, showTableSetting: false,
showIndexColumn: false, showIndexColumn: false,
pagination: false, pagination: false,
...@@ -243,6 +267,23 @@ ...@@ -243,6 +267,23 @@
} }
} }
function segmentedChange() {
isDisabled.value = true;
}
function isCardSelected(item: any) {
isDisabled.value = selectedCard.length <= 0;
return selectedCard.includes(item);
}
function onSelectionChange() {
isDisabled.value = getRowSelection().selectedRowKeys <= 0;
}
/**批量推送推送*/
function pushNotifications(record) {
openApplyForPushNotificationsModal(true, record);
}
function handleNewModal(scene: string) {} function handleNewModal(scene: string) {}
function handleSelectCard(item: any) { function handleSelectCard(item: any) {
...@@ -262,13 +303,11 @@ ...@@ -262,13 +303,11 @@
} }
} }
function isCardSelected(item: any) {
return selectedCard.includes(item);
}
function handleBulkDownload() {} function handleBulkDownload() {}
function handleBatchPush() {} function information(item) {
openEditModal(true, item);
}
function onSearch() { function onSearch() {
let filteredList = cardList.filter((item) => { let filteredList = cardList.filter((item) => {
......
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