feat(payment): 添加统一下单接口并修复类型引用
- 添加 create 和 createWithOrder 两个统一下单接口 - 将 Order 类型替换为 ShopOrder 类型 - 修复 getNativeCode 函数的参数类型引用 - 修复 importArticles 导入语句的格式问题 feat(navigation): 实现导航管理导入导出功能 - 添加导航导入弹窗组件 Import.vue - 实现导航数据导出功能,支持按搜索结果导出 - 优化导出数据的列宽设置 - 添加导出加载状态和错误处理 - 修复组件格式化问题 refactor(led): 重构LED显示页面实现自动轮播 - 重命名组件名称为 LedIndex - 添加两个表格实例引用用于独立控制 - 实现页面自动轮播功能,设置10秒间隔 - 隐藏表格分页组件 - 优化页面加载和卸载逻辑 style(components): 统一组件代码格式化 - 修复多个组件中的格式化问题 - 统一 import 语句的格式 - 修复组件标签闭合问题 - 优化代码缩进和换行 chore(env): 更新开发环境配置注释 - 注释掉 VITE_API_URL 配置项 - 保持其他环境配置不变
This commit is contained in:
@@ -4,61 +4,60 @@
|
||||
<div class="text-4xl font-bold">广西医科大学第一附属医院</div>
|
||||
<div class="text-2xl my-5">门诊医生一周内停替诊公布</div>
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
ref="stopTableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
:toolkit="[]"
|
||||
:toolbar="false"
|
||||
:page-size="pageSize"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
class="sys-org-table led-table"
|
||||
@done="onStopDone"
|
||||
/>
|
||||
<div class="text-2xl my-5">门诊医生当天剩余号源公布</div>
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
ref="numberTableRef"
|
||||
row-key="id"
|
||||
:columns="columns2"
|
||||
:datasource="datasource2"
|
||||
:customRow="customRow"
|
||||
:toolkit="[]"
|
||||
:toolbar="false"
|
||||
:page-size="pageSize"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
class="sys-org-table led-table"
|
||||
@done="onNumberDone"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toTreeData } from 'ele-admin-pro';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
ColumnItem,
|
||||
EleProTableDone
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import { pageCmsAd, removeCmsAd, removeBatchCmsAd } from '@/api/cms/cmsAd';
|
||||
import type { CmsAd, CmsAdParam } from '@/api/cms/cmsAd/model';
|
||||
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
|
||||
import { listCmsNavigation } from '@/api/cms/cmsNavigation';
|
||||
import { numberReplace, stopReplace } from '@/api/led';
|
||||
|
||||
const pageSize = 10;
|
||||
const rotateIntervalMs = 10000;
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
// 国际化
|
||||
const { locale } = useI18n();
|
||||
// 表格选中数据
|
||||
const selection = ref<CmsAd[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<CmsAd | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 栏目数据
|
||||
const navigationList = ref<CmsNavigation[]>();
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
const stopTableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
const numberTableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
const stopPageCount = ref(1);
|
||||
const numberPageCount = ref(1);
|
||||
const stopCurrPage = ref(1);
|
||||
const numberCurrPage = ref(1);
|
||||
|
||||
let stopTimer: number | undefined;
|
||||
let numberTimer: number | undefined;
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||
@@ -191,107 +190,70 @@
|
||||
});
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: CmsAdParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
const onStopDone: EleProTableDone<any> = (_res, curr, count) => {
|
||||
stopCurrPage.value = curr;
|
||||
stopPageCount.value = count || 1;
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: CmsAd) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
const onNumberDone: EleProTableDone<any> = (_res, curr, count) => {
|
||||
numberCurrPage.value = curr;
|
||||
numberPageCount.value = count || 1;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
const nextStopPage = () => {
|
||||
if (stopPageCount.value <= 1) return;
|
||||
stopCurrPage.value =
|
||||
stopCurrPage.value >= stopPageCount.value ? 1 : stopCurrPage.value + 1;
|
||||
stopTableRef.value?.reload({ page: stopCurrPage.value, limit: pageSize });
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: CmsAd) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeCmsAd(row.adId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchCmsAd(selection.value.map((d) => d.adId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
const nextNumberPage = () => {
|
||||
if (numberPageCount.value <= 1) return;
|
||||
numberCurrPage.value =
|
||||
numberCurrPage.value >= numberPageCount.value
|
||||
? 1
|
||||
: numberCurrPage.value + 1;
|
||||
numberTableRef.value?.reload({
|
||||
page: numberCurrPage.value,
|
||||
limit: pageSize
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
// 加载栏目数据
|
||||
if (!navigationList.value) {
|
||||
listCmsNavigation({}).then((res) => {
|
||||
navigationList.value = toTreeData({
|
||||
data: res?.map((d) => {
|
||||
d.value = d.navigationId;
|
||||
d.label = d.title;
|
||||
if (!d.component) {
|
||||
d.disabled = true;
|
||||
}
|
||||
return d;
|
||||
}),
|
||||
idField: 'navigationId',
|
||||
parentIdField: 'parentId'
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: CmsAd) => {
|
||||
const customRow = (_record: any) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
//
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
// openEdit(record);
|
||||
//
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
|
||||
onMounted(() => {
|
||||
stopTimer = window.setInterval(nextStopPage, rotateIntervalMs);
|
||||
numberTimer = window.setInterval(nextNumberPage, rotateIntervalMs);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (stopTimer) window.clearInterval(stopTimer);
|
||||
if (numberTimer) window.clearInterval(numberTimer);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'CmsAd'
|
||||
name: 'LedIndex'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.led-table {
|
||||
:deep(.ant-pagination) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user