提交 71501798 authored 作者: xiejiang's avatar xiejiang

fix: 修复打包问题

上级 4491b708
node_modules
dist
.nvmdrc
......@@ -78,7 +78,7 @@
"stylelint-config-standard": "^36.0.0",
"stylelint-order": "~6.0.4",
"tailwindcss": "^3.4.13",
"typescript": "~5.4.0",
"typescript": "5.6.2",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"vite": "4.5.5",
......@@ -87,7 +87,7 @@
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-html": "^3.2.2",
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "^2.1.6"
"vue-tsc": "2.0.29"
},
"engines": {
"node": ">=16.0.0",
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-12-02 14:56:33
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-08 14:51:30
* @LastEditTime: 2024-12-10 11:24:31
* @Description:
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
*/
......@@ -50,6 +50,7 @@ export interface ReqSaveDictionary {
isAllowDelete: number | undefined // 是否允许删除:1允许,0不允许
isAllowEdit: number | undefined // 是否允许编辑:1允许,0不允许
remark: string // 字典说明
valueName: string //字典值名称
}
export interface ResDictionary extends KeyAny {
......
......@@ -17,7 +17,6 @@ declare module 'vue' {
FooterFixBtn: typeof import('./components/FooterFixBtn/index.vue')['default']
ImageViewer: typeof import('./components/ImageViewer/index.vue')['default']
Img: typeof import('./components/Upload/Img.vue')['default']
IndexMc: typeof import('./components/PageContainer/index-mc.vue')['default']
InfoLable: typeof import('./components/InfoLable/index.vue')['default']
Media: typeof import('./components/Upload/media.vue')['default']
OperateBtn: typeof import('./components/OperateBtn/index.vue')['default']
......@@ -31,6 +30,44 @@ declare module 'vue' {
SlideVerify: typeof import('./components/SlideVerify/index.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemPrompts: typeof import('./components/SystemPrompts/index.vue')['default']
TAside: typeof import('tdesign-vue-next')['Aside']
TAutoComplete: typeof import('tdesign-vue-next')['AutoComplete']
TBreadcrumb: typeof import('tdesign-vue-next')['Breadcrumb']
TBreadcrumbItem: typeof import('tdesign-vue-next')['BreadcrumbItem']
TButton: typeof import('tdesign-vue-next')['Button']
TCheckbox: typeof import('tdesign-vue-next')['Checkbox']
TCheckboxGroup: typeof import('tdesign-vue-next')['CheckboxGroup']
TCollapse: typeof import('tdesign-vue-next')['Collapse']
TCollapsePanel: typeof import('tdesign-vue-next')['CollapsePanel']
TConfigProvider: typeof import('tdesign-vue-next')['ConfigProvider']
TDatePicker: typeof import('tdesign-vue-next')['DatePicker']
TDialog: typeof import('tdesign-vue-next')['Dialog']
TDrawer: typeof import('tdesign-vue-next')['Drawer']
TDropdown: typeof import('tdesign-vue-next')['Dropdown']
TDropdownItem: typeof import('tdesign-vue-next')['DropdownItem']
TDropdownMenu: typeof import('tdesign-vue-next')['DropdownMenu']
TFooter: typeof import('tdesign-vue-next')['Footer']
TForm: typeof import('tdesign-vue-next')['Form']
TFormItem: typeof import('tdesign-vue-next')['FormItem']
THeadMenu: typeof import('tdesign-vue-next')['HeadMenu']
TIcon: typeof import('tdesign-vue-next')['Icon']
TInput: typeof import('tdesign-vue-next')['Input']
TLayout: typeof import('tdesign-vue-next')['Layout']
TMenu: typeof import('tdesign-vue-next')['Menu']
TMenuItem: typeof import('tdesign-vue-next')['MenuItem']
TOption: typeof import('tdesign-vue-next')['Option']
TRadio: typeof import('tdesign-vue-next')['Radio']
TRadioButton: typeof import('tdesign-vue-next')['RadioButton']
TRadioGroup: typeof import('tdesign-vue-next')['RadioGroup']
TSelect: typeof import('tdesign-vue-next')['Select']
TSubmenu: typeof import('tdesign-vue-next')['Submenu']
TTable: typeof import('tdesign-vue-next')['Table']
TTabPanel: typeof import('tdesign-vue-next')['TabPanel']
TTabs: typeof import('tdesign-vue-next')['Tabs']
TTag: typeof import('tdesign-vue-next')['Tag']
TTextarea: typeof import('tdesign-vue-next')['Textarea']
TTooltip: typeof import('tdesign-vue-next')['Tooltip']
TTree: typeof import('tdesign-vue-next')['Tree']
Upload: typeof import('./components/Upload/index.vue')['default']
WangEditor: typeof import('./components/WangEditor/index.vue')['default']
}
......
<template>
<div>
<PageFilters ref="pageFilters" :filter-conditions="props.filterConditions" @on-filter="confirmFilter" />
<div class="mx-[14px] mt-[12px] p-[16px] bg-white">
<div class="flex justify-between items-center" v-if="showTableHeader">
<div class="header-left">
<slot name="header-left"></slot>
</div>
<div class="header-right">
<div class="flex items-center justify-end gap-2">
<t-button v-if="props.showSetting" variant="outline" @click="columnControllerVisible = true">
<template #icon><SettingIcon /></template>列配置
</t-button>
<slot name="header-right"></slot>
</div>
</div>
</div>
<!-- table -->
<div class="mt-[16px]">
<slot name="table"></slot>
<div v-if="showTable">
<t-table
v-bind="tableProps"
v-model:column-controller-visible="columnControllerVisible"
:row-key="rowKey"
:data="tableData"
:columns="columns"
:column-controller="columnControllerConfig"
:loading="loading"
:loading-props="loadingProps"
max-height="585"
@filter-change="onFilterChange"
@sort-change="onSortChange"
>
<!-- 为每一列创建动态插槽 -->
<template v-for="col in columns" #[col.colKey]="{ row }" :key="col.colKey">
<!-- <component :is="col.render" v-bind="row" v-if="col.render" /> -->
<template v-if="col.colKey != 'operation'">
<t-tooltip
:content="String(row[col.colKey])"
placement="top"
theme="light"
overlay-class-name="custom-tooltip"
>
<div class="cell-content">{{ row[col.colKey] }}</div>
</t-tooltip>
</template>
</template>
<!-- 保留自定义列插槽 -->
<template v-for="(_, name) in $slots" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template>
</t-table>
</div>
</div>
<!-- 分页 -->
<div v-if="showPagination" class="mt-[32px]">
<t-pagination
v-model="pageInfo.page"
v-model:page-size="pageInfo.limit"
:total="pageInfo.total"
show-sizer
show-jumper
:page-size-options="pageSizeOptions"
@change="onChange"
class="reset-pagination"
/>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { AxiosRequestConfig } from 'axios'
import { PaginationProps, TableProps, PrimaryTableCol, LoadingProps } from 'tdesign-vue-next'
import { filterItemProp } from '@/components/PageFilters/interface/index'
import { ResultData } from '@/api/interface'
import { isFunction } from '@/utils/is/index'
defineOptions({
name: 'PageContainer'
})
onMounted(() => {
getData()
})
type Slots = Record<'table' | 'header-left' | 'header-right', () => VNode> & Record<string, () => VNode>
const slots = defineSlots<Slots>()
const showTableHeader = computed(() => isFunction(slots['header-left']) || isFunction(slots['header-right']))
const showTable = computed(() => !isFunction(slots.table))
const pageFilters = ref()
interface Pageable {
page: number
limit: number
total: number
}
interface PageFiltersProps {
filterConditions: filterItemProp[]
showPagination?: boolean
rowKey?: string
showSetting?: boolean // 是否显示列配置按钮
requestApi: (params: any, config?: AxiosRequestConfig) => Promise<ResultData>
tableProps?: Partial<TableProps> // t-table 原生属性
columns?: PrimaryTableCol[] // 表格列配置
}
const props = withDefaults(defineProps<PageFiltersProps>(), {
filterConditions: () => [],
showSetting: false,
showPagination: true,
rowKey: 'id',
tableProps: () => ({ hover: true, resizable: true }),
columns: () => []
})
// 组件事件
const emit = defineEmits<{
'filter-change': [filters: Record<string, any>]
'search-change': [params: Record<string, any>]
'sort-change': [sort: Record<string, any>]
}>()
const columnControllerVisible = ref(false)
const columnControllerConfig = computed<TableProps['columnController']>(() => ({
hideTriggerButton: true,
placement: 'top-right',
dialogProps: { preventScrollThrough: true },
fields: props.columns.map(item => item.colKey) as string[],
...props.tableProps?.columnController
}))
const tableData = ref<any>([])
// 搜索后查询数据
const confirmFilter = () => {
pageInfo.page = 1
getData()
}
const loading = ref(false)
const loadingProps = ref<LoadingProps>({
text: '加载中',
size: '24px'
})
const getData = async () => {
const params = pageFilters.value.resetFilterConditions()
loading.value = true
tableData.value = Array(5)
.fill(0)
.map((_, index) => {
// 生成随机手机号
const parentMenuName = `139${Math.floor(Math.random() * 100000000)
.toString()
.padStart(8, '0')}`
return {
id: index + 1,
menuName: `用户${Math.floor(Math.random() * 1000 + 1)}`,
parentMenuName,
sortNumber: Math.random() > 0.5 ? 1 : 2,
inputTime: '2024-03-21 12:00:00',
onlyid: '这里是钉钉这里是'
}
})
try {
const res = await props.requestApi({ ...pageInfo, ...params })
console.log(res)
pageInfo.total = res.recordsFiltered ?? 0
tableData.value = res.data ?? []
} finally {
loading.value = false
}
}
// 分页切换
const pageInfo: Pageable = reactive({
page: 1,
limit: 10,
total: 0
})
const pageSizeOptions: PaginationProps['pageSizeOptions'] = [
{
label: '每页 10 条',
value: 10
},
{
label: '每页 15 条',
value: 15
},
{
label: '每页 30 条',
value: 30
},
{
label: '每页 100 条',
value: 100
}
]
const onChange: PaginationProps['onChange'] = async ({ pageSize, current }) => {
pageInfo.page = current
pageInfo.limit = pageSize
getData()
}
// 处理表格列筛选变化
const onFilterChange = (filters: any) => {
emit('filter-change', filters)
}
// 处理排序变化
const onSortChange: TableProps['onSortChange'] = val => {
emit('sort-change', val)
}
defineExpose({
getData,
tableData
})
</script>
<style lang="less" scoped>
:deep(.reset-pagination) {
.t-pagination__jump {
background-color: var(--white);
color: var(--td-font-gray-1);
.t-input-adornment__text {
color: var(--td-font-gray-1);
}
}
.t-pagination__total {
margin-right: 20px;
text-align: right;
}
}
:deep(.t-table__header--fixed) {
&:not(.t-table__header--multiple) > tr > th {
background-color: var(--white);
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-07 11:19:31
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-09 12:00:01
* @LastEditTime: 2024-12-10 11:13:57
* @Description: 表格页面容器组件
-->
<template>
......@@ -47,16 +47,23 @@
@sort-change="onSortChange"
>
<!-- 为每一列创建动态插槽 -->
<template v-for="col in columns" #[col.colKey]="{ row }" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<t-tooltip :content="row[col.colKey]" placement="top" theme="light" overlay-class-name="custom-tooltip">
<div class="cell-content">{{ row[col.colKey] || '-' }}</div>
</t-tooltip>
<template #default="{ row }">
<template v-for="col in columns" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<t-tooltip
:content="row[col.colKey as string]"
placement="top"
theme="light"
overlay-class-name="custom-tooltip"
>
<div class="cell-content">{{ row[col.colKey as string] || '-' }}</div>
</t-tooltip>
</template>
</template>
</template>
<!-- 保留自定义列插槽 -->
<template v-for="(_, name) in $slots" #[name]="scope">
<template v-for="[name] in Object.entries($slots)" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template>
</t-table>
......
......@@ -27,7 +27,7 @@
<t-input
maxlength="11"
@input="
v => {
(v: any) => {
formData.adminUserMobile = v.target.value.replace(/[^0-9]/g, '')
}
"
......@@ -84,7 +84,7 @@ const { setBreadcrumb } = useBasic()
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqCompany>['data'] = reactive({
const formData = reactive<ReqCompany>({
companyName: '',
companyType: '',
adminUserMobile: '',
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-05 10:14:56
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-09 09:17:08
* @LastEditTime: 2024-12-10 11:20:18
* @Description: 登录
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -24,7 +24,7 @@
maxlength="11"
clearable
@input="
v => {
(v: any) => {
formData.mobile = v.target.value.replace(/[^0-9]/g, '')
}
"
......@@ -40,7 +40,7 @@
v-model="formData.code"
maxlength="4"
@input="
v => {
(v: any) => {
formData.code = v.target.value.replace(/[^0-9]/g, '')
}
"
......@@ -127,10 +127,10 @@ const validateTelePhone: CustomValidator = async val => {
const userStore = useUserStore()
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<{
const formData = ref<{
mobile: string
code: string // 短信验证码
}>['data'] = reactive({
}>({
mobile: '',
code: ''
})
......@@ -156,7 +156,7 @@ const isShowPuzzleVcode = ref(false)
const sliderVerify = ref()
// 发送短信验证码
const getCode = function () {
if (!isPhoneNumber(formData.mobile) || codeBtnDisabled.value) {
if (!isPhoneNumber(formData.value.mobile) || codeBtnDisabled.value) {
return
}
isShowPuzzleVcode.value = true
......@@ -183,7 +183,7 @@ const onSuccess = (val: OnSuccess) => {
//关闭拼图验证码
const onPuzzleVcodeClose = () => {
getSmsCode({
telephone: formData.mobile
telephone: formData.value.mobile
})
.then(() => {
MessagePlugin.success('验证成功!')
......@@ -216,15 +216,15 @@ const onAgain = () => {
// 是否禁用登录按钮
const isLoginButtonDisable = computed(() => {
return !(formData.mobile && isPhoneNumber(formData.mobile) && formData.code)
return !(formData.value.mobile && isPhoneNumber(formData.value.mobile) && formData.value.code)
})
// 登录
const onSubmit: FormProps['onSubmit'] = ({ validateResult }) => {
if (validateResult === true) {
const payloadMsg = {
mobile: formData.mobile,
code: formData.code
mobile: formData.value.mobile,
code: formData.value.code
}
try {
LoginBySmsCode(payloadMsg).then(({ data }) => {
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-09 15:15:33
* @LastEditTime: 2024-12-10 11:21:21
* @Description: 系统字典-管理子集
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -40,9 +40,11 @@
<template v-for="(_, name) in $slots" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template>
<template v-for="col in columns" #[col.colKey]="{ row }" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<div class="cell-content">{{ row[col.colKey] || '-' }}</div>
<template #default="{ row }">
<template v-for="col in columns" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<div class="cell-content">{{ row[col.colKey as string] || '-' }}</div>
</template>
</template>
</template>
</t-table>
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-08 14:54:41
* @LastEditTime: 2024-12-10 11:24:22
* @Description: 系统字典-新增编辑字典
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -71,7 +71,7 @@ const drawerVisible = ref(false)
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqSaveDictionary>['data'] = reactive({
const formData = reactive<ReqSaveDictionary>({
dictCode: '',
dictId: '',
remark: '',
......
......@@ -40,7 +40,7 @@ const drawerVisible = ref(false)
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqEditDictData>['data'] = reactive({
const formData = reactive<ReqEditDictData>({
dictId: '',
dictDataId: '',
dataCode: '',
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-05 16:11:56
* @LastEditTime: 2024-12-10 11:29:57
* @Description: 菜单管理-新增编辑菜单
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -26,8 +26,8 @@
maxlength="50"
v-model="formData.router"
@change="
val => {
formData.menuSign = val as string
() => {
formData.menuSign = formData.router
}
"
placeholder="请输入路由名称"
......@@ -78,7 +78,7 @@ const drawerVisible = ref(false)
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqMenuEdit>['data'] = reactive({
const formData = reactive<ReqMenuEdit>({
htmlPlatform: '',
icon: '',
isButton: '1',
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-12-08 09:25:35
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-09 18:01:54
* @LastEditTime: 2024-12-10 11:22:08
* @Description:
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -20,9 +20,11 @@
<template v-for="(_, name) in $slots" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template>
<template v-for="col in columns" #[col.colKey]="{ row }" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<div class="cell-content">{{ row[col.colKey] || '-' }}</div>
<template #default="{ row }">
<template v-for="col in columns" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<div class="cell-content">{{ row[col.colKey as string] || '-' }}</div>
</template>
</template>
</template>
</t-table>
......
......@@ -47,7 +47,7 @@ const drawerVisible = ref(false)
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqVersion>['data'] = reactive({
const formData = reactive<ReqVersion>({
version: '',
versionType: 1,
versionId: 0,
......
......@@ -36,9 +36,11 @@
<template v-for="(_, name) in $slots" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template>
<template v-for="col in columns" #[col.colKey]="{ row }" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<div class="cell-content">{{ row[col.colKey] || '-' }}</div>
<template #default="{ row }">
<template v-for="col in columns" :key="col.colKey">
<template v-if="col.colKey != 'operation'">
<div class="cell-content">{{ row[col.colKey as string] || '-' }}</div>
</template>
</template>
</template>
</t-table>
......
......@@ -37,7 +37,7 @@ const drawerVisible = ref(false)
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqRole>['data'] = reactive({
const formData = reactive<ReqRole>({
description: '',
roleId: '',
roleName: ''
......
......@@ -29,14 +29,16 @@
max-height="400px"
:pagination="pagination.total > 10 ? pagination : undefined"
>
<template v-for="col in columns" #[col.colKey]="{ row }" :key="col.colKey">
<template v-if="col.colKey == 'dataPermission'">
<div class="cell-content">{{ dataPermissions(row) || '-' }}</div>
<template #default="{ row }">
<template v-for="col in columns" :key="col.colKey">
<template v-if="col.colKey == 'dataPermission'">
<div class="cell-content">{{ dataPermissions(row) || '-' }}</div>
</template>
<template v-else-if="col.colKey == 'functionPermission'">
<div class="cell-content">{{ functionPermission(row) || '-' }}</div>
</template>
<template v-else> {{ row[col.colKey as string] || '-' }} </template>
</template>
<template v-else-if="col.colKey == 'functionPermission'">
<div class="cell-content">{{ functionPermission(row) || '-' }}</div>
</template>
<template v-else> {{ row[col.colKey] || '-' }} </template>
</template>
</t-table>
......
......@@ -17,7 +17,11 @@
<t-input
v-model="formData.mobile"
maxlength="11"
@input="v => (formData.mobile = v.replace(/[^0-9]/g, ''))"
@input="
(v: any) => {
formData.mobile = v.target.value.replace(/[^0-9]/g, '')
}
"
placeholder="请输入手机号码"
>
</t-input>
......@@ -44,7 +48,7 @@ const drawerVisible = ref(false)
const submitLoading = ref(false)
const formRef = useTemplateRef<FormInstanceFunctions>('formRef')
const formData: FormProps<ReqUser>['data'] = reactive({
const formData = reactive<ReqUser>({
userName: '',
mobile: '',
userId: '',
......
......@@ -34,11 +34,13 @@
"src/**/*.vue",
"build/**/*.ts",
"build/**/*.d.ts",
"node_modules/tdesign-vue-next/global.d.ts"
, "src/api/modules/dectionory/index.ts", "src/api/modules/dectionory/index.ts" ],
"exclude": ["node_modules", "dist", "**/*.js"],
"jsx": "preserve",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
"allowSyntheticDefaultImports": true
"node_modules/tdesign-vue-next/global.d.ts",
"src/api/modules/dectionory/index.ts",
"src/api/modules/dectionory/index.ts"
],
"exclude": ["node_modules", "dist", "**/*.js"]
// "jsx": "preserve",
// "jsxFactory": "h",
// "jsxFragmentFactory": "Fragment",
// "allowSyntheticDefaultImports": true
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论