修复已知问题

This commit is contained in:
2024-10-10 21:04:39 +08:00
parent 1b430ef7a0
commit 1d8f8e8a7d
8 changed files with 182 additions and 66 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
VITE_APP_NAME=后台管理系统 VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://server.gxwebsoft.com VITE_SOCKET_URL=wss://server.gxwebsoft.com
#VITE_SERVER_URL=https://server.gxwebsoft.com/api VITE_SERVER_URL=https://server.gxwebsoft.com/api
VITE_THINK_URL=https://gxtyzx-api.websoft.top/api VITE_THINK_URL=https://gxtyzx-api.websoft.top/api
VITE_API_URL=https://modules.gxwebsoft.com/api VITE_API_URL=https://modules.gxwebsoft.com/api
VITE_SERVER_URL=http://127.0.0.1:30000/api #VITE_SERVER_URL=http://127.0.0.1:30000/api
#VITE_API_URL=http://127.0.0.1:9001/api #VITE_API_URL=http://127.0.0.1:9001/api
#VITE_THINK_URL=http://127.0.0.1:9099/api #VITE_THINK_URL=http://127.0.0.1:9099/api
#/booking/bookingItem #/booking/bookingItem
+5
View File
@@ -6,7 +6,12 @@ import type { PageParam } from '@/api';
export interface FormRecord { export interface FormRecord {
formRecordId?: number; formRecordId?: number;
formId?: number; formId?: number;
type?: string;
name?: string; name?: string;
phone?: string;
age?: number;
extra?: string;
dateTime?: string;
formData?: string; formData?: string;
formObj?: Object; formObj?: Object;
userId?: number; userId?: number;
+2 -2
View File
@@ -47,9 +47,9 @@ export interface PageParam {
// 搜素关键词 // 搜素关键词
keywords?: string; keywords?: string;
// 起始时间 // 起始时间
createTimeStart?: number; createTimeStart?: string;
// 结束时间 // 结束时间
createTimeEnd?: number; createTimeEnd?: string;
timeStart?: number; timeStart?: number;
timeEnd?: number; timeEnd?: number;
isExpireTime?: number; isExpireTime?: number;
+2 -2
View File
@@ -5,7 +5,7 @@ import type {
WebsiteField, WebsiteField,
WebsiteFieldParam WebsiteFieldParam
} from '@/api/cms/website/field/model'; } from '@/api/cms/website/field/model';
import { SERVER_API_URL } from '@/config/setting'; import { MODULES_API_URL, SERVER_API_URL } from "@/config/setting";
/** /**
* 分页查询项目参数 * 分页查询项目参数
@@ -134,7 +134,7 @@ export async function checkExistence(
*/ */
export async function configWebsiteField(params?: WebsiteFieldParam) { export async function configWebsiteField(params?: WebsiteFieldParam) {
const res = await request.get<ApiResult<Config>>( const res = await request.get<ApiResult<Config>>(
SERVER_API_URL + '/cms/cms-website-field/config', MODULES_API_URL + '/cms/website-field/config',
{ {
params params
} }
+11 -1
View File
@@ -66,9 +66,15 @@ export function openUrl(url: string, params?: any): void {
* @param id 128 * @param id 128
* @param d 项目数据 * @param d 项目数据
* 拼接规则: {域名}{path}?spm=c.{用户ID}.{租户ID}.{栏目ID}.{商品ID}.{timestamp}&token={token} * 拼接规则: {域名}{path}?spm=c.{用户ID}.{租户ID}.{栏目ID}.{商品ID}.{timestamp}&token={token}
* @param onlyUrl
* @return https:///websoft.top/product/detail/128.html?spm=c.5.3057.10005.undefined&token=DDkr1PpE9DouIVMjLEMt9733QsgG7oNV * @return https:///websoft.top/product/detail/128.html?spm=c.5.3057.10005.undefined&token=DDkr1PpE9DouIVMjLEMt9733QsgG7oNV
*/ */
export function openSpmUrl(path?: string, d?: any, id = 0): void { export function openSpmUrl(
path?: string,
d?: any,
id = 0,
onlyUrl?: boolean
): any {
// const domain = getSiteDomain(); // const domain = getSiteDomain();
const domain = localStorage.getItem('Domain'); const domain = localStorage.getItem('Domain');
const spm = ref<string>(''); const spm = ref<string>('');
@@ -104,6 +110,10 @@ export function openSpmUrl(path?: string, d?: any, id = 0): void {
return; return;
} }
if (onlyUrl == true) {
return `https://${domain}${path}${spm.value}`;
}
// TODO 开发环境 // TODO 开发环境
if (import.meta.env.DEV) { if (import.meta.env.DEV) {
console.log('开发环境'); console.log('开发环境');
+92 -11
View File
@@ -1,6 +1,30 @@
<!-- 搜索表单 --> <!-- 搜索表单 -->
<template> <template>
<a-space :size="10" style="flex-wrap: wrap"> <a-space :size="10" style="flex-wrap: wrap">
<a-button
danger
type="primary"
class="ele-btn-icon"
:disabled="selection?.length === 0"
@click="removeBatch"
>
<template #icon>
<DeleteOutlined />
</template>
<span>批量删除</span>
</a-button>
<FormSelect
v-model:value="where.formId"
:placeholder="`选择表单名称`"
style="width: 220px"
@change="chooseFormName"
/>
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
class="ele-fluid"
/>
<a-input-search <a-input-search
allow-clear allow-clear
placeholder="请输入关键词" placeholder="请输入关键词"
@@ -8,30 +32,28 @@
@pressEnter="search" @pressEnter="search"
@search="search" @search="search"
/> />
<FormSelect
v-model:value="where.formId"
:placeholder="`选择表单名称`"
style="width: 220px"
@change="chooseFormName"
/>
<a-button @click="reset">重置</a-button> <a-button @click="reset">重置</a-button>
<a-button type="primary" class="ele-btn-icon"> <a-button type="primary" class="ele-btn-icon" @click="handleExport">
<span>导出xls</span> <span>导出xls</span>
</a-button> </a-button>
</a-space> </a-space>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { watch } from 'vue'; import { ref, watch } from 'vue';
import useSearch from '@/utils/use-search'; import useSearch from '@/utils/use-search';
import { FormRecordParam } from '@/api/cms/form-record/model'; import { FormRecord, FormRecordParam } from '@/api/cms/form-record/model';
import { Form } from '@/api/cms/form/model'; import { Form } from '@/api/cms/form/model';
import {assignObject} from "ele-admin-pro"; import { toDateString } from 'ele-admin-pro';
import { DeleteOutlined } from '@ant-design/icons-vue';
import { BookingOrder } from '@/api/booking/bookingOrder/model';
import { utils, writeFile } from 'xlsx';
import { message } from 'ant-design-vue';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
// 选中的角色 // 选中的角色
selection?: []; selection?: FormRecord[];
data?: Form; data?: Form;
}>(), }>(),
{} {}
@@ -52,21 +74,80 @@
keywords: undefined keywords: undefined
}); });
// 请求状态
const loading = ref(false);
// 日期范围选择
const dateRange = ref<[string, string]>(['', '']);
const orders = ref<BookingOrder[] | any[]>();
const xlsFileName = ref<string>();
const chooseFormName = (id: number) => { const chooseFormName = (id: number) => {
where.formId = id; where.formId = id;
emit('search', where); emit('search', where);
}; };
const search = () => { const search = () => {
const [d1, d2] = dateRange.value ?? [];
xlsFileName.value = `${d1}至${d2}`;
where.createTimeStart = d1 ? d1 + ' 00:00:00' : '';
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : '';
emit('search', where); emit('search', where);
}; };
// 批量删除
const removeBatch = () => {
emit('remove');
};
/* 重置 */ /* 重置 */
const reset = () => { const reset = () => {
resetFields(); resetFields();
dateRange.value = ['', ''];
search(); search();
}; };
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
['姓名', '电话', '年龄', '类型', '预定信息', '预约日期']
];
orders.value = props.selection?.map((d) => {
array.push([
`${d.name}`,
`${d.phone}`,
`${d.age}`,
`${d.type}`,
`${d.extra}`,
`${d.dateTime}`,
]);
});
const sheetName = `预约记录导出`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${where.createTimeEnd ? xlsFileName.value + '_' : ''}${sheetName}.xlsx`
);
loading.value = false;
}, 2000);
};
watch( watch(
() => props.selection, () => props.selection,
() => {} () => {}
+39 -14
View File
@@ -8,6 +8,7 @@
:columns="columns" :columns="columns"
:datasource="datasource" :datasource="datasource"
:customRow="customRow" :customRow="customRow"
v-model:selection="selection"
tool-class="ele-toolbar-form" tool-class="ele-toolbar-form"
class="sys-org-table" class="sys-org-table"
> >
@@ -137,27 +138,51 @@
// 表格列配置 // 表格列配置
const columns = ref<ColumnItem[]>([ const columns = ref<ColumnItem[]>([
{ // {
title: 'ID', // title: 'ID',
width: 90, // width: 90,
dataIndex: 'formRecordId' // dataIndex: 'formRecordId'
}, // },
{
title: '手机号码',
dataIndex: 'phone',
width: 180,
key: 'phone'
},
{ {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name' key: 'name'
}, },
{ {
title: '其他数据', title: '手机号码',
dataIndex: 'component', dataIndex: 'phone',
key: 'component' key: 'phone'
}, },
{
title: '类型',
dataIndex: 'type',
key: 'type'
},
{
title: '年龄',
dataIndex: 'age',
key: 'age'
},
{
title: '本次接种的剂次',
dataIndex: 'extra',
key: 'extra'
},
{
title: '备注信息',
dataIndex: 'comments',
key: 'comments'
},
{
title: '预约时间',
dataIndex: 'dateTime',
key: 'dateTime'
},
// {
// title: '其他数据',
// dataIndex: 'component',
// key: 'component'
// },
// { // {
// title: '状态', // title: '状态',
// dataIndex: 'status', // dataIndex: 'status',
+29 -34
View File
@@ -21,9 +21,11 @@
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'"> <template v-if="column.key === 'name'">
<span @click="openPreview('/form/' + record.formId)">{{ <span
record.name class="cursor-pointer"
}}</span> @click="openSpmUrl('/form', record, record.formId, true)"
>{{ record.name }}</span
>
</template> </template>
<template v-if="column.key === 'path'"> <template v-if="column.key === 'path'">
<span class="ele-text-placeholder">{{ record.path }}</span> <span class="ele-text-placeholder">{{ record.path }}</span>
@@ -31,7 +33,7 @@
<template v-if="column.key === 'component'"> <template v-if="column.key === 'component'">
<span class="ele-text-placeholder">{{ record.component }}</span> <span class="ele-text-placeholder">{{ record.component }}</span>
</template> </template>
<template v-if="column.key === 'formData'"> </template> <template v-if="column.key === 'formData'"></template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<a-badge <a-badge
v-if="record.status === 0" v-if="record.status === 0"
@@ -48,15 +50,21 @@
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-space> <a-space>
<a @click="openUrl('/cms/form-record?id=' + record.formId)" <a @click="openUrl('/cms/form-record?id=' + record.formId)">
><SolutionOutlined />表单数据</a <SolutionOutlined />
表单数据</a
> >
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popover> <a-popover>
<template #content> <template #content>
<div class="ele-cell"> <div class="ele-cell">
<ele-qr-code <ele-qr-code
:value="`${domain}/form/${record.formId}`" :value="`${openSpmUrl(
'/form',
record,
record.formId,
true
)}`"
:size="160" :size="160"
level="M" level="M"
:margin="1" :margin="1"
@@ -64,7 +72,10 @@
手机扫一扫 手机扫一扫
</div> </div>
</template> </template>
<a @click="onShare"><QrcodeOutlined />分享</a> <a @click="onShare">
<QrcodeOutlined />
分享</a
>
</a-popover> </a-popover>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a @click="openEdit(record)">设计</a> <a @click="openEdit(record)">设计</a>
@@ -120,10 +131,11 @@
} from '@/api/cms/form'; } from '@/api/cms/form';
import type { Form, FormParam } from '@/api/cms/form/model'; import type { Form, FormParam } from '@/api/cms/form/model';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { openPreview, openUrl } from '@/utils/common'; import { openPreview, openSpmUrl, openUrl } from '@/utils/common';
import { useTenantStore } from '@/store/modules/tenant'; import { useTenantStore } from '@/store/modules/tenant';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { getSiteInfo } from '@/api/layout'; import { getSiteInfo } from '@/api/layout';
const { push } = useRouter(); const { push } = useRouter();
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
// 表格实例 // 表格实例
@@ -135,19 +147,16 @@
const current = ref<Form | null>(null); const current = ref<Form | null>(null);
// 是否显示编辑弹窗 // 是否显示编辑弹窗
const showEdit = ref(false); const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 二维码 // 二维码
const showQrCode = ref(false); const showQrCode = ref(false);
// 加载状态 // 加载状态
const loading = ref(true); const loading = ref(true);
// 网站域名 // 网站域名
const domain = ref(''); const domain = ref(localStorage.getItem('Domain'));
getSiteInfo().then((data) => { // getSiteInfo().then((data) => {
// tenantId.value = data.tenantId; // domain.value = String(data.domain);
domain.value = String(data.domain); // });
});
// 表格数据源 // 表格数据源
const datasource: DatasourceFunction = ({ const datasource: DatasourceFunction = ({
@@ -225,22 +234,6 @@
}); });
}; };
const onOpen = (e) => {
console.log(e);
};
const openForm = (row?: Form) => {
push({
path: '/cms/form/detail',
query: { id: row?.formId }
});
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */ /* 删除单个 */
const remove = (row: Form) => { const remove = (row: Form) => {
const hide = message.loading('请求中..', 0); const hide = message.loading('请求中..', 0);
@@ -298,8 +291,8 @@
}, },
// 行双击事件 // 行双击事件
onDblclick: () => { onDblclick: () => {
openUrl('/cms/form-record?id=' + record.formId); // openUrl('/cms/form-record?id=' + record.formId);
// openEdit(record); openEdit(record);
} }
}; };
}; };
@@ -329,6 +322,7 @@
padding: 0 4px; padding: 0 4px;
margin-bottom: 0; margin-bottom: 0;
} }
.design-item { .design-item {
margin: auto; margin: auto;
display: flex; display: flex;
@@ -341,6 +335,7 @@
border-radius: 70px; border-radius: 70px;
background: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(6.123233995736766e-17%2C%201%2C%20-0.024693877551020406%2C%206.123233995736766e-17%2C%200.5%2C%200)%22%3E%3Cstop%20stop-color%3D%22%230a060d%22%20stop-opacity%3D%221%22%20offset%3D%220%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23660061%22%20stop-opacity%3D%221%22%20offset%3D%220.95%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E'); background: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(6.123233995736766e-17%2C%201%2C%20-0.024693877551020406%2C%206.123233995736766e-17%2C%200.5%2C%200)%22%3E%3Cstop%20stop-color%3D%22%230a060d%22%20stop-opacity%3D%221%22%20offset%3D%220%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23660061%22%20stop-opacity%3D%221%22%20offset%3D%220.95%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E');
} }
.ele-cell { .ele-cell {
display: flex; display: flex;
flex-direction: column; flex-direction: column;