Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 7m1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 7m1s
This commit is contained in:
commit
85975db5ee
22
.gitea/workflows/dev.yml
Normal file
22
.gitea/workflows/dev.yml
Normal file
@ -0,0 +1,22 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
|
||||
- name: Checkout code
|
||||
uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
|
||||
with:
|
||||
fetch-depth: 1 # 只拉取最新一次提交
|
||||
- name: node
|
||||
run: pnpm i
|
||||
- name: Build
|
||||
run: pnpm build:antd
|
||||
- name: cp
|
||||
run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\web-antd /E
|
||||
|
||||
|
||||
|
@ -16,10 +16,10 @@ VITE_INJECT_APP_LOADING=true
|
||||
VITE_ARCHIVER=true
|
||||
|
||||
# 后端接口地址
|
||||
VITE_GLOB_API_URL=/prod-api
|
||||
VITE_GLOB_API_URL=/api
|
||||
|
||||
# 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应)
|
||||
VITE_GLOB_ENABLE_ENCRYPT=true
|
||||
VITE_GLOB_ENABLE_ENCRYPT=false
|
||||
# RSA公钥 请求加密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
|
||||
# RSA私钥 响应解密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
|
61
apps/web-antd/src/api/property/assetType/index.ts
Normal file
61
apps/web-antd/src/api/property/assetType/index.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import type { AssetTypeVO, AssetTypeForm, AssetTypeQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询资产类型列表
|
||||
* @param params
|
||||
* @returns 资产类型列表
|
||||
*/
|
||||
export function assetTypeList(params?: AssetTypeQuery) {
|
||||
return requestClient.get<PageResult<AssetTypeVO>>('/property/assetType/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资产类型列表
|
||||
* @param params
|
||||
* @returns 资产类型列表
|
||||
*/
|
||||
export function assetTypeExport(params?: AssetTypeQuery) {
|
||||
return commonExport('/property/assetType/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产类型详情
|
||||
* @param id id
|
||||
* @returns 资产类型详情
|
||||
*/
|
||||
export function assetTypeInfo(id: ID) {
|
||||
return requestClient.get<AssetTypeVO>(`/property/assetType/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产类型
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function assetTypeAdd(data: AssetTypeForm) {
|
||||
return requestClient.postWithMsg<void>('/property/assetType', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资产类型
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function assetTypeUpdate(data: AssetTypeForm) {
|
||||
return requestClient.putWithMsg<void>('/property/assetType', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产类型
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function assetTypeRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/assetType/${id}`);
|
||||
}
|
64
apps/web-antd/src/api/property/assetType/model.d.ts
vendored
Normal file
64
apps/web-antd/src/api/property/assetType/model.d.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface AssetTypeVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
assetTypeName: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
createBy: string;
|
||||
|
||||
}
|
||||
|
||||
export interface AssetTypeForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
assetTypeName?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface AssetTypeQuery extends PageQuery {
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
assetTypeName?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
61
apps/web-antd/src/api/property/booking/index.ts
Normal file
61
apps/web-antd/src/api/property/booking/index.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import type { BookingVO, BookingForm, BookingQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询会议预约列表
|
||||
* @param params
|
||||
* @returns 会议预约列表
|
||||
*/
|
||||
export function bookingList(params?: BookingQuery) {
|
||||
return requestClient.get<PageResult<BookingVO>>('/property/booking/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出会议预约列表
|
||||
* @param params
|
||||
* @returns 会议预约列表
|
||||
*/
|
||||
export function bookingExport(params?: BookingQuery) {
|
||||
return commonExport('/property/booking/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会议预约详情
|
||||
* @param id id
|
||||
* @returns 会议预约详情
|
||||
*/
|
||||
export function bookingInfo(id: ID) {
|
||||
return requestClient.get<BookingVO>(`/property/booking/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会议预约
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function bookingAdd(data: BookingForm) {
|
||||
return requestClient.postWithMsg<void>('/property/booking', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新会议预约
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function bookingUpdate(data: BookingForm) {
|
||||
return requestClient.putWithMsg<void>('/property/booking', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会议预约
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function bookingRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/booking/${id}`);
|
||||
}
|
224
apps/web-antd/src/api/property/booking/model.d.ts
vendored
Normal file
224
apps/web-antd/src/api/property/booking/model.d.ts
vendored
Normal file
@ -0,0 +1,224 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface BookingVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 会议室名称
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 会议室id
|
||||
*/
|
||||
meetId: string | number;
|
||||
|
||||
/**
|
||||
* 会议室地址
|
||||
*/
|
||||
meetLocation: string;
|
||||
|
||||
/**
|
||||
* 所属单位
|
||||
*/
|
||||
unit: string;
|
||||
|
||||
/**
|
||||
* 预定人
|
||||
*/
|
||||
person: string;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 预定开始时间
|
||||
*/
|
||||
scheduledStarttime: string;
|
||||
|
||||
/**
|
||||
* 预定结束时间
|
||||
*/
|
||||
scheduledEndtime: string;
|
||||
|
||||
/**
|
||||
* 参会人数
|
||||
*/
|
||||
personSum: number;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
price: number;
|
||||
|
||||
/**
|
||||
* 是否包含增值服务
|
||||
*/
|
||||
attach: number;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
payState: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
}
|
||||
|
||||
export interface BookingForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 会议室名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 会议室id
|
||||
*/
|
||||
meetId?: string | number;
|
||||
|
||||
/**
|
||||
* 会议室地址
|
||||
*/
|
||||
meetLocation?: string;
|
||||
|
||||
/**
|
||||
* 所属单位
|
||||
*/
|
||||
unit?: string;
|
||||
|
||||
/**
|
||||
* 预定人
|
||||
*/
|
||||
person?: string;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 预定开始时间
|
||||
*/
|
||||
scheduledStarttime?: string;
|
||||
|
||||
/**
|
||||
* 预定结束时间
|
||||
*/
|
||||
scheduledEndtime?: string;
|
||||
|
||||
/**
|
||||
* 参会人数
|
||||
*/
|
||||
personSum?: number;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
price?: number;
|
||||
|
||||
/**
|
||||
* 是否包含增值服务
|
||||
*/
|
||||
attach?: number;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
payState?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface BookingQuery extends PageQuery {
|
||||
/**
|
||||
* 会议室名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 会议室id
|
||||
*/
|
||||
meetId?: string | number;
|
||||
|
||||
/**
|
||||
* 会议室地址
|
||||
*/
|
||||
meetLocation?: string;
|
||||
|
||||
/**
|
||||
* 所属单位
|
||||
*/
|
||||
unit?: string;
|
||||
|
||||
/**
|
||||
* 预定人
|
||||
*/
|
||||
person?: string;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 预定开始时间
|
||||
*/
|
||||
scheduledStarttime?: string;
|
||||
|
||||
/**
|
||||
* 预定结束时间
|
||||
*/
|
||||
scheduledEndtime?: string;
|
||||
|
||||
/**
|
||||
* 参会人数
|
||||
*/
|
||||
personSum?: number;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
price?: number;
|
||||
|
||||
/**
|
||||
* 是否包含增值服务
|
||||
*/
|
||||
attach?: number;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
payState?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@ -1,100 +1,49 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import {getDictOptions} from '#/utils/dict';
|
||||
import {renderDict} from '#/utils/render';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accessCode',
|
||||
label: '门禁设备编码',
|
||||
label: '设备编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accessName',
|
||||
label: '门禁名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'communityCode',
|
||||
label: '园区编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'buildingCode',
|
||||
label: '建筑编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accessIp',
|
||||
label: '门禁设备ip',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accessPort',
|
||||
label: '端口',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accssType',
|
||||
label: '门禁设备类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'factoryCode',
|
||||
label: '工厂编码',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'controlType',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_KZKLX 便于维护
|
||||
options: getDictOptions('wy_kzklx'),
|
||||
},
|
||||
fieldName: 'controlType',
|
||||
label: '控制卡类型:1-系统,2-E8',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'controlCode',
|
||||
label: '控制卡类型编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'outCode',
|
||||
label: '外部编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'orgCode',
|
||||
label: '组织编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'dataState',
|
||||
label: '数据状态:1有效,0无效',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'searchValue',
|
||||
label: '搜索值',
|
||||
label: '控制卡类型',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '主键',
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({rowIndex}) => {
|
||||
return rowIndex + 1;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '门禁设备编码',
|
||||
title: '设备编码',
|
||||
field: 'accessCode',
|
||||
},
|
||||
{
|
||||
title: '门禁名称',
|
||||
title: '设备名称',
|
||||
field: 'accessName',
|
||||
},
|
||||
{
|
||||
@ -106,7 +55,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'buildingCode',
|
||||
},
|
||||
{
|
||||
title: '门禁设备ip',
|
||||
title: '设备IP',
|
||||
field: 'accessIp',
|
||||
},
|
||||
{
|
||||
@ -114,19 +63,18 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'accessPort',
|
||||
},
|
||||
{
|
||||
title: '门禁设备类型',
|
||||
field: 'accssType',
|
||||
title: '设备类型',
|
||||
field: 'accessType',
|
||||
},
|
||||
{
|
||||
title: '工厂编码',
|
||||
field: 'factoryCode',
|
||||
},
|
||||
{
|
||||
title: '控制卡类型:1-系统,2-E8',
|
||||
title: '控制卡类型',
|
||||
field: 'controlType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_KZKLX 便于维护
|
||||
default: ({row}) => {
|
||||
return renderDict(row.controlType, 'wy_kzklx');
|
||||
},
|
||||
},
|
||||
@ -143,18 +91,10 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '组织编码',
|
||||
field: 'orgCode',
|
||||
},
|
||||
{
|
||||
title: '数据状态:1有效,0无效',
|
||||
field: 'dataState',
|
||||
},
|
||||
{
|
||||
title: '搜索值',
|
||||
field: 'searchValue',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
@ -171,13 +111,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '门禁设备编码',
|
||||
label: '设备编码',
|
||||
fieldName: 'accessCode',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '门禁名称',
|
||||
label: '设备名称',
|
||||
fieldName: 'accessName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
@ -195,7 +135,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '门禁设备ip',
|
||||
label: '设备IP',
|
||||
fieldName: 'accessIp',
|
||||
component: 'Input',
|
||||
},
|
||||
@ -205,8 +145,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '门禁设备类型',
|
||||
fieldName: 'accssType',
|
||||
label: '设备类型',
|
||||
fieldName: 'accessType',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
@ -217,7 +157,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '控制卡类型:1-系统,2-E8',
|
||||
label: '控制卡类型',
|
||||
fieldName: 'controlType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
@ -242,15 +182,4 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '数据状态:1有效,0无效',
|
||||
fieldName: 'dataState',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
@ -9,10 +9,10 @@ import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
@ -23,12 +23,12 @@ import {
|
||||
import type { AccessControlForm } from '#/api/property/accessControl/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import accessControlModal from './accessControl-modal.vue';
|
||||
import accessControlModal from './accessControlModal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
labelWidth: 100,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
@ -126,7 +126,7 @@ function handleDownloadExcel() {
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="门禁管理列表">
|
||||
<BasicTable table-title="门禁设备列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
@ -138,8 +138,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:accessControl:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:accessControl:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
|
@ -37,7 +37,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accssType',
|
||||
fieldName: 'accessType',
|
||||
label: '门禁设备类型',
|
||||
},
|
||||
{
|
||||
@ -115,7 +115,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '门禁设备类型',
|
||||
field: 'accssType',
|
||||
field: 'accessType',
|
||||
},
|
||||
{
|
||||
title: '工厂编码',
|
||||
@ -206,7 +206,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '门禁设备类型',
|
||||
fieldName: 'accssType',
|
||||
fieldName: 'accessType',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
|
@ -37,7 +37,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accssType',
|
||||
fieldName: 'accessType',
|
||||
label: '门禁设备类型',
|
||||
},
|
||||
{
|
||||
@ -115,7 +115,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '门禁设备类型',
|
||||
field: 'accssType',
|
||||
field: 'accessType',
|
||||
},
|
||||
{
|
||||
title: '工厂编码',
|
||||
@ -206,7 +206,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '门禁设备类型',
|
||||
fieldName: 'accssType',
|
||||
fieldName: 'accessType',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
|
@ -37,7 +37,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'accssType',
|
||||
fieldName: 'accessType',
|
||||
label: '门禁设备类型',
|
||||
},
|
||||
{
|
||||
@ -115,7 +115,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '门禁设备类型',
|
||||
field: 'accssType',
|
||||
field: 'accessType',
|
||||
},
|
||||
{
|
||||
title: '工厂编码',
|
||||
@ -206,7 +206,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '门禁设备类型',
|
||||
fieldName: 'accssType',
|
||||
fieldName: 'accessType',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
|
@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { applicationAdd, applicationInfo, applicationUpdate } from '#/api/property/application';
|
||||
import { applicationAdd, applicationInfo, applicationUpdate } from '#/api/property/assetManage/application';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
@ -1,26 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
applicationExport,
|
||||
applicationList,
|
||||
applicationRemove,
|
||||
} from '#/api/property/application';
|
||||
import type { ApplicationForm } from '#/api/property/application/model';
|
||||
} from '#/api/property/assetManage/application';
|
||||
import type { ApplicationForm } from '#/api/property/assetManage/application/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import applicationModal from './application-modal.vue';
|
||||
@ -35,15 +31,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@ -138,8 +125,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:application:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:application:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { assetAdd, assetInfo, assetUpdate } from '#/api/property/asset';
|
||||
import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/asset';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
@ -1,5 +1,6 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@ -9,78 +10,40 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
label: '资产名称',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
component: 'Select',
|
||||
fieldName: 'model',
|
||||
label: '类型',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'specs',
|
||||
label: '规格',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'price',
|
||||
label: '价格',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'stock',
|
||||
label: '库存',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'unit',
|
||||
label: '计量单位',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'depotId',
|
||||
label: '仓库id',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'msg',
|
||||
label: '描述信息',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'suppliersId',
|
||||
label: '供应商id',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'storageTime',
|
||||
label: '入库时间',
|
||||
label: '资产类型',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
fieldName: 'type',
|
||||
label: '固定资产类型',
|
||||
label: '固定资产',
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '主键',
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '资产名称',
|
||||
field: 'name',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
title: '资产类型',
|
||||
field: 'model',
|
||||
},
|
||||
{
|
||||
@ -116,7 +79,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'storageTime',
|
||||
},
|
||||
{
|
||||
title: '固定资产类型',
|
||||
title: '固定资产',
|
||||
field: 'type',
|
||||
},
|
||||
{
|
||||
@ -126,7 +89,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
@ -201,7 +164,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '固定资产类型',
|
||||
fieldName: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
componentProps: {},
|
||||
},
|
||||
];
|
@ -1,26 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
assetExport,
|
||||
assetList,
|
||||
assetRemove,
|
||||
} from '#/api/property/asset';
|
||||
import type { AssetForm } from '#/api/property/asset/model';
|
||||
} from '#/api/property/assetManage/asset';
|
||||
import type { AssetForm } from '#/api/property/assetManage/asset/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import assetModal from './asset-modal.vue';
|
||||
@ -35,15 +31,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@ -53,10 +40,7 @@ const gridOptions: VxeGridProps = {
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
@ -126,7 +110,7 @@ function handleDownloadExcel() {
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="资产管理列表">
|
||||
<BasicTable table-title="资产列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
@ -138,8 +122,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:asset:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:asset:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
110
apps/web-antd/src/views/property/assetManage/depot/data.ts
Normal file
110
apps/web-antd/src/views/property/assetManage/depot/data.ts
Normal file
@ -0,0 +1,110 @@
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'depotName',
|
||||
label: '仓库名称',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'modelType',
|
||||
label: '仓库类型',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_cclx'),
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_state'),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({rowIndex}) => {
|
||||
return (rowIndex + 1).toString();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '仓库名称',
|
||||
field: 'depotName',
|
||||
},
|
||||
{
|
||||
title: '仓库类型',
|
||||
field: 'modelType',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.modelType, 'wy_cclx')
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {default: 'state'}
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
field: 'msg',
|
||||
},
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '仓库名称',
|
||||
fieldName: 'depotName',
|
||||
component: 'Input',
|
||||
rules:'required'
|
||||
},
|
||||
{
|
||||
label: '仓库类型',
|
||||
fieldName: 'modelType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_cclx'),
|
||||
},
|
||||
rules:'selectRequired'
|
||||
|
||||
},
|
||||
{
|
||||
label: '描述信息',
|
||||
fieldName: 'msg',
|
||||
component: 'Textarea',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
];
|
@ -0,0 +1,69 @@
|
||||
<script setup lang="ts">
|
||||
import type {Unit} from '#/api/property/resident/unit/model';
|
||||
|
||||
import {shallowRef} from 'vue';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { depotInfo} from '#/api/property/assetManage/depot';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import type {DepotVO} from "#/api/property/assetManage/depot/model";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
depotDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const depotDetail = shallowRef<null | DepotVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
depotDetail.value = await depotInfo(id);
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="仓库详情" class="w-[70%]">
|
||||
<Descriptions v-if="depotDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="仓库名称">
|
||||
{{ depotDetail.depotName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="仓库类型" v-if="depotDetail.modelType!=null">
|
||||
<component
|
||||
:is="renderDict(depotDetail.modelType,'wy_cclx')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="depotDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(depotDetail.state,'wy_state')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="创建时间">
|
||||
{{ depotDetail.createTime}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="描述信息">
|
||||
{{ depotDetail.msg}}
|
||||
</DescriptionsItem>
|
||||
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { depotAdd, depotInfo, depotUpdate } from '#/api/property/depot';
|
||||
import { depotAdd, depotInfo, depotUpdate } from '#/api/property/assetManage/depot';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
@ -21,9 +21,9 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
labelWidth: 100,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
@ -1,30 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
depotExport,
|
||||
depotList,
|
||||
depotRemove,
|
||||
} from '#/api/property/depot';
|
||||
import type { DepotForm } from '#/api/property/depot/model';
|
||||
depotRemove, depotUpdate,
|
||||
} from '#/api/property/assetManage/depot';
|
||||
import type { DepotForm } from '#/api/property/assetManage/depot/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import depotModal from './depot-modal.vue';
|
||||
import depotDetail from './depot-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {TableSwitch} from "#/components/table";
|
||||
import {useAccess} from "@vben/access";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@ -35,15 +33,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@ -84,6 +73,10 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [DepotDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: depotDetail,
|
||||
});
|
||||
|
||||
const [DepotModal, modalApi] = useVbenModal({
|
||||
connectedComponent: depotModal,
|
||||
});
|
||||
@ -92,6 +85,11 @@ function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
async function handleInfo(row: Required<DepotForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
|
||||
async function handleEdit(row: Required<DepotForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
@ -122,11 +120,12 @@ function handleDownloadExcel() {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="仓库管理列表">
|
||||
<BasicTable table-title="仓库列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
@ -138,8 +137,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:depot:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:depot:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
@ -152,8 +151,24 @@ function handleDownloadExcel() {
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #state="{ row }">
|
||||
<TableSwitch
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
v-model:value="row.state"
|
||||
:api="() => depotUpdate(row)"
|
||||
:disabled="!hasAccessByCodes(['property:depot:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:depot:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:depot:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@ -178,5 +193,6 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DepotModal @reload="tableApi.query()" />
|
||||
<DepotDetail></DepotDetail>
|
||||
</Page>
|
||||
</template>
|
@ -9,18 +9,18 @@ import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
logExport,
|
||||
logList,
|
||||
logRemove,
|
||||
} from '#/api/property/log';
|
||||
import type { LogForm } from '#/api/property/log/model';
|
||||
} from '#/api/property/assetManage/log';
|
||||
import type { LogForm } from '#/api/property/assetManage/log/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import logModal from './log-modal.vue';
|
||||
@ -138,8 +138,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:log:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:log:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { logAdd, logInfo, logUpdate } from '#/api/property/log';
|
||||
import { logAdd, logInfo, logUpdate } from '#/api/property/assetManage/log';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
@ -1,5 +1,7 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {z} from "#/adapter/form";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@ -9,49 +11,44 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
label: '供应商名称',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'phone',
|
||||
label: '电话',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'location',
|
||||
label: '地址',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
fieldName: 'user',
|
||||
label: '联系人',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'phone',
|
||||
label: '电话',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'bank',
|
||||
label: '开户行',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'bankNumber',
|
||||
label: '卡号',
|
||||
componentProps:{
|
||||
options: getDictOptions('wy_state'),
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '主键',
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({rowIndex}) => {
|
||||
return rowIndex + 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '供应商名称',
|
||||
field: 'suppliersName',
|
||||
},
|
||||
{
|
||||
title: '联系人',
|
||||
field: 'user',
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
field: 'phone',
|
||||
@ -60,14 +57,6 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '地址',
|
||||
field: 'location',
|
||||
},
|
||||
{
|
||||
title: '联系人',
|
||||
field: 'user',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
field: 'bank',
|
||||
@ -76,6 +65,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '卡号',
|
||||
field: 'bankNumber',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {default: 'state'}
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
@ -87,7 +81,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
@ -108,43 +102,43 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'suppliersName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '电话',
|
||||
fieldName: 'phone',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '地址',
|
||||
fieldName: 'location',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '联系人',
|
||||
fieldName: 'user',
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'state',
|
||||
label: '电话',
|
||||
fieldName: 'phone',
|
||||
component: 'Input',
|
||||
rules: z.string().regex(/^1[3-9]\d{9}$/, { message: '格式错误' }),
|
||||
},
|
||||
{
|
||||
label: '地址',
|
||||
fieldName: 'location',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '开户行',
|
||||
fieldName: 'bank',
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '卡号',
|
||||
fieldName: 'bankNumber',
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
rules: z.string().regex(/^\d{12,19}$/, { message: '格式错误' }),
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Textarea',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
];
|
196
apps/web-antd/src/views/property/assetManage/suppliers/index.vue
Normal file
196
apps/web-antd/src/views/property/assetManage/suppliers/index.vue
Normal file
@ -0,0 +1,196 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
suppliersExport,
|
||||
suppliersList,
|
||||
suppliersRemove, suppliersUpdate,
|
||||
} from '#/api/property/assetManage/suppliers';
|
||||
import type { SuppliersForm } from '#/api/property/assetManage/suppliers/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import suppliersModal from './suppliers-modal.vue';
|
||||
import suppliersDetail from './suppliers-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {useAccess} from "@vben/access";
|
||||
import {TableSwitch} from "#/components/table";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await suppliersList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-suppliers-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [SuppliersModal, modalApi] = useVbenModal({
|
||||
connectedComponent: suppliersModal,
|
||||
});
|
||||
const [SuppliersDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: suppliersDetail,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<SuppliersForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleInfo(row: Required<SuppliersForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<SuppliersForm>) {
|
||||
await suppliersRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<SuppliersForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await suppliersRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(suppliersExport, '供应商数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="供应商列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:suppliers:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:suppliers:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:suppliers:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #state="{row}">
|
||||
<TableSwitch
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
v-model:value="row.state"
|
||||
:api="() => suppliersUpdate(row)"
|
||||
:disabled="!hasAccessByCodes(['property:suppliers:update'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:suppliers:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:suppliers:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:suppliers:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<SuppliersModal @reload="tableApi.query()" />
|
||||
<SuppliersDetail/>
|
||||
</Page>
|
||||
</template>
|
@ -0,0 +1,77 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {shallowRef} from 'vue';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { suppliersInfo} from '#/api/property/assetManage/suppliers';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import type {SuppliersVO} from "#/api/property/assetManage/suppliers/model";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
supplierDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const supplierDetail = shallowRef<null | SuppliersVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
supplierDetail.value = await suppliersInfo(id);
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="供应商详情" class="w-[70%]">
|
||||
<Descriptions v-if="supplierDetail" size="small" :column="2" bordered :labelStyle="{width:'110px'}">
|
||||
<DescriptionsItem label="供应商名称" :span="2">
|
||||
{{ supplierDetail.suppliersName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="联系人">
|
||||
{{supplierDetail.user}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="电话">
|
||||
{{supplierDetail.phone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="地址" :span="2">
|
||||
{{ supplierDetail.location}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开户行">
|
||||
{{ supplierDetail.bank}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="卡号">
|
||||
{{ supplierDetail.bankNumber}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="supplierDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(supplierDetail.state,'wy_state')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="创建时间">
|
||||
{{ supplierDetail.createTime}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注">
|
||||
{{ supplierDetail.remark}}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { suppliersAdd, suppliersInfo, suppliersUpdate } from '#/api/property/suppliers';
|
||||
import { suppliersAdd, suppliersInfo, suppliersUpdate } from '#/api/property/assetManage/suppliers';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
@ -21,9 +21,9 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
labelWidth: 100,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
101
apps/web-antd/src/views/property/assetType/assetType-modal.vue
Normal file
101
apps/web-antd/src/views/property/assetType/assetType-modal.vue
Normal file
@ -0,0 +1,101 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { assetTypeAdd, assetTypeInfo, assetTypeUpdate } from '#/api/property/assetType';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await assetTypeInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value ? assetTypeUpdate(data) : assetTypeAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@ -5,23 +5,13 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'depotName',
|
||||
label: '类型名称',
|
||||
fieldName: 'assetTypeName',
|
||||
label: '分类名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'msg',
|
||||
label: '描述信息',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'modelType',
|
||||
label: '类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
fieldName: 'sort',
|
||||
label: '排序',
|
||||
},
|
||||
];
|
||||
|
||||
@ -34,25 +24,21 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '类型名称',
|
||||
field: 'depotName',
|
||||
title: '分类名称',
|
||||
field: 'assetTypeName',
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
field: 'msg',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
field: 'modelType',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
title: '排序',
|
||||
field: 'sort',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
field: 'createBy',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
@ -73,23 +59,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '类型名称',
|
||||
fieldName: 'depotName',
|
||||
label: '分类名称',
|
||||
fieldName: 'assetTypeName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '描述信息',
|
||||
fieldName: 'msg',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
fieldName: 'modelType',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'state',
|
||||
label: '排序',
|
||||
fieldName: 'sort',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@ -16,14 +16,14 @@ import {
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
suppliersExport,
|
||||
suppliersList,
|
||||
suppliersRemove,
|
||||
} from '#/api/property/suppliers';
|
||||
import type { SuppliersForm } from '#/api/property/suppliers/model';
|
||||
assetTypeExport,
|
||||
assetTypeList,
|
||||
assetTypeRemove,
|
||||
} from '#/api/property/assetType';
|
||||
import type { AssetTypeForm } from '#/api/property/assetType/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import suppliersModal from './suppliers-modal.vue';
|
||||
import assetTypeModal from './assetType-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
@ -64,7 +64,7 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await suppliersList({
|
||||
return await assetTypeList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-suppliers-index'
|
||||
id: 'property-assetType-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@ -84,8 +84,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [SuppliersModal, modalApi] = useVbenModal({
|
||||
connectedComponent: suppliersModal,
|
||||
const [AssetTypeModal, modalApi] = useVbenModal({
|
||||
connectedComponent: assetTypeModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
@ -93,32 +93,32 @@ function handleAdd() {
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<SuppliersForm>) {
|
||||
async function handleEdit(row: Required<AssetTypeForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<SuppliersForm>) {
|
||||
await suppliersRemove(row.id);
|
||||
async function handleDelete(row: Required<AssetTypeForm>) {
|
||||
await assetTypeRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<SuppliersForm>) => row.id);
|
||||
const ids = rows.map((row: Required<AssetTypeForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await suppliersRemove(ids);
|
||||
await assetTypeRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(suppliersExport, '供应商数据', tableApi.formApi.form.values, {
|
||||
commonDownloadExcel(assetTypeExport, '资产类型数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
@ -126,11 +126,11 @@ function handleDownloadExcel() {
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="供应商列表">
|
||||
<BasicTable table-title="资产类型列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:suppliers:export']"
|
||||
v-access:code="['property:assetType:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
@ -139,13 +139,13 @@ function handleDownloadExcel() {
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:suppliers:remove']"
|
||||
v-access:code="['property:assetType:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:suppliers:add']"
|
||||
v-access:code="['property:assetType:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
@ -155,7 +155,7 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:suppliers:edit']"
|
||||
v-access:code="['property:assetType:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
@ -168,7 +168,7 @@ function handleDownloadExcel() {
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:suppliers:remove']"
|
||||
v-access:code="['property:assetType:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
@ -177,6 +177,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<SuppliersModal @reload="tableApi.query()" />
|
||||
<AssetTypeModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@ -198,3 +198,8 @@ function handleInfo(row: Required<PersonForm>) {
|
||||
<PersonDetail></PersonDetail>
|
||||
</Page>
|
||||
</template>
|
||||
<style scoped>
|
||||
:where(.css-dev-only-do-not-override-aza1th).ant-avatar{
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
|
@ -26,6 +26,7 @@ let userInfo = reactive({
|
||||
gender: '',
|
||||
});
|
||||
let unitName = ref('');
|
||||
const userId = ref<number | string>(0);
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
@ -67,6 +68,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await personInfo(id);
|
||||
userId.value = record.userId;
|
||||
console.log(userId.value,'====================1111')
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@ -119,7 +122,7 @@ function getUnitInfo(unit: { name: string }) {
|
||||
<BasicModal :title="title">
|
||||
<BasicForm>
|
||||
<template #userId="slotProps">
|
||||
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :disabled="isUpdate"/>
|
||||
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userId="userId"/>
|
||||
</template>
|
||||
<template #unitId="slotProps">
|
||||
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :disabled="isUpdate"/>
|
||||
|
@ -1,8 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import {Select} from 'ant-design-vue';
|
||||
// import {resident_unitList} from "#/api/property/resident/unit";
|
||||
import {userList} from "#/api/system/user";
|
||||
import {resident_unitList} from "#/api/property/resident/unit";
|
||||
|
||||
defineOptions({name: 'QueryUnitList'});
|
||||
|
||||
@ -10,30 +9,17 @@ withDefaults(defineProps<{ disabled?: boolean; placeholder?: string }>(), {
|
||||
disabled: false,
|
||||
placeholder: '可根据单位名称进行搜索...',
|
||||
});
|
||||
//todo
|
||||
// async function queryUnit(value: string, callback: any) {
|
||||
// const queryData = {
|
||||
// nickName: value,
|
||||
// pageSize: 100,
|
||||
// pageNum: 1,
|
||||
// }
|
||||
// const res = await resident_unitList(queryData);
|
||||
// const options = res.rows.map((unit) => ({
|
||||
// label: unit.name+'-'+unit.unitNumber,
|
||||
// value: unit.id,
|
||||
// }));
|
||||
// callback(options);
|
||||
// }
|
||||
|
||||
async function queryUnit(value: string, callback: any) {
|
||||
const queryData = {
|
||||
nickName: value,
|
||||
name: value,
|
||||
pageSize: 100,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await userList(queryData);
|
||||
const res = await resident_unitList(queryData);
|
||||
const options = res.rows.map((unit) => ({
|
||||
label: unit.nickName+'-'+unit.phonenumber,
|
||||
value: unit.userId,
|
||||
label: unit.name+'-'+unit.id,
|
||||
value: unit.id,
|
||||
}));
|
||||
callback(options);
|
||||
}
|
||||
|
@ -1,15 +1,28 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import {ref, watch} from 'vue';
|
||||
import {Select} from 'ant-design-vue';
|
||||
import {userList} from "#/api/system/user";
|
||||
import {findUserInfo, userList} from "#/api/system/user";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
|
||||
defineOptions({name: 'QueryUserList'});
|
||||
|
||||
withDefaults(defineProps<{ disabled?: boolean; placeholder?: string }>(), {
|
||||
const props = withDefaults(defineProps<{
|
||||
disabled?: boolean;
|
||||
placeholder?: string;
|
||||
isUpdate?: boolean;
|
||||
userId?: number;
|
||||
}>(), {
|
||||
disabled: false,
|
||||
placeholder: '可根据员工姓名进行搜索...',
|
||||
isUpdate: false,
|
||||
userId: 0
|
||||
});
|
||||
watch(() => props.isUpdate,
|
||||
(newX) => {
|
||||
if (newX) {
|
||||
getUserInfo()
|
||||
}
|
||||
}, {immediate: true})
|
||||
|
||||
async function queryUser(value: string, callback: any) {
|
||||
const queryData = {
|
||||
@ -21,36 +34,47 @@ async function queryUser(value: string, callback: any) {
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
|
||||
value: user.userId,
|
||||
userName: user.userName,
|
||||
gender: user.sex,
|
||||
phone: user.phonenumber,
|
||||
}));
|
||||
callback(options);
|
||||
}
|
||||
|
||||
|
||||
const data = ref<any[]>([]);
|
||||
const value = ref();
|
||||
const value = ref('');
|
||||
|
||||
const handleSearch = (val: string) => {
|
||||
queryUser(val, (d: any[]) => (data.value = d));
|
||||
};
|
||||
const emit = defineEmits(['update:userInfo']);
|
||||
const handleChange = (val: string) => {
|
||||
value.value = val;
|
||||
const userInfoStr = data.value.find(option => option.value === val)?.label;
|
||||
let arr = userInfoStr.split('-')
|
||||
let userInfo = {
|
||||
userName: arr[0],
|
||||
gender: arr[1],
|
||||
phone: arr[2],
|
||||
}
|
||||
// value.value = val;
|
||||
const userInfo = data.value.find(option => option.value === val);
|
||||
queryUser(val, (d: any[]) => (data.value = d));
|
||||
emit('update:userInfo', userInfo);
|
||||
};
|
||||
|
||||
async function getUserInfo() {
|
||||
console.log(value.value, '=============value')
|
||||
const user = await (await findUserInfo(value.value)).user
|
||||
console.log(user, '=================ss')
|
||||
if(user){
|
||||
data.value=[{
|
||||
label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
|
||||
value: user.userId,
|
||||
userName: user.userName,
|
||||
gender: user.sex,
|
||||
phone: user.phonenumber,
|
||||
}]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- v-model:value="value"-->
|
||||
<Select
|
||||
|
||||
v-model="value"
|
||||
show-search
|
||||
:placeholder="placeholder"
|
||||
style="width: 100%"
|
||||
|
@ -2,6 +2,7 @@ import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {z} from "#/adapter/form";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@ -134,7 +135,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '联系电话',
|
||||
fieldName: 'phone',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
rules: z.string().regex(/^1[3-9]\d{9}$/, { message: '格式错误' }),
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import resident_unitModal from './unit-modal.vue';
|
||||
import unitInfoModal from './unit-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {userStatusChange} from "#/api/system/user";
|
||||
import {resident_unitUpdate} from "#/api/property/resident/unit";
|
||||
import {TableSwitch} from "#/components/table";
|
||||
import {useAccess} from "@vben/access";
|
||||
|
||||
@ -150,10 +150,11 @@ const { hasAccessByCodes } = useAccess();
|
||||
</template>
|
||||
<template #state="{ row }">
|
||||
<TableSwitch
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
v-model:value="row.state"
|
||||
:api="() => userStatusChange(row)"
|
||||
:disabled=" !hasAccessByCodes(['property:unit:edit'])
|
||||
"
|
||||
:api="() => resident_unitUpdate(row)"
|
||||
:disabled=" !hasAccessByCodes(['property:unit:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
|
@ -27,7 +27,7 @@ export default defineConfig(async () => {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
// mock代理目标地址
|
||||
target: 'http://127.0.0.1:8080/',
|
||||
target: 'http://47.109.37.87:3010/',
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user