From 116aec5c476366b239146ff1219ce10d9cd14379 Mon Sep 17 00:00:00 2001 From: lizhi <1370025557@qq.com> Date: Thu, 30 Jun 2022 10:55:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/platform/system/controller/address.ts | 9 ++ src/api/platform/system/controller/boxcard.ts | 51 +++++++ .../platform/system/entity/boxCardModel.ts | 25 ++++ .../institution/address/AddressModal.vue | 89 +++++++++++++ src/views/institution/address/address.data.ts | 126 ++++++++++++++++++ src/views/institution/address/index.vue | 116 ++++++++++++++++ 7 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 src/api/platform/system/controller/boxcard.ts create mode 100644 src/api/platform/system/entity/boxCardModel.ts create mode 100644 src/views/institution/address/AddressModal.vue create mode 100644 src/views/institution/address/address.data.ts create mode 100644 src/views/institution/address/index.vue diff --git a/.env.development b/.env.development index 09279ca..5be9756 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ VITE_PUBLIC_PATH = / # 本地开发代理,可以解决跨域及多地址代理 # 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题 # 可以有多个,注意多个不能换行,否则代理将会失效 -VITE_PROXY = [["/api","http://192.168.3.10:9999"],["/upload","http://192.168.3.10:9999/system_proxy/system/file/upload"]] +VITE_PROXY = [["/api","http://localhost:9999"],["/upload","http://localhost:9999/system_proxy/system/file/upload"]] # 是否删除console.log VITE_DROP_CONSOLE = false diff --git a/src/api/platform/system/controller/address.ts b/src/api/platform/system/controller/address.ts index 1de27a7..54754b4 100644 --- a/src/api/platform/system/controller/address.ts +++ b/src/api/platform/system/controller/address.ts @@ -6,6 +6,7 @@ import {AddressParams,AddressItem} from '/@/api/platform/system/entity/addressModel'; import { defHttp } from '/@/utils/http/axios'; + enum Api { get = '/system_proxy/system/address', QueryById = '/system_proxy/system/address/query', @@ -23,10 +24,18 @@ export const treeList = (params: AddressParams) => defHttp.get({url: Api.list, export const listAddr = (params?: Partial) => defHttp.get({url: Api.list, params}); +/**新增 */ +export const addAddr =(params:Partial) =>defHttp.post({url:Api.add,data:params}); +/**修改 */ +export const editAddr =(params:Partial) =>defHttp.put({url:Api.edit,data:params}); export const queryByParentIds = (params) => defHttp.get({url: Api.QueryByParentIds + `/${params}`}); +/**查询详细 */ +export const getAddr = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); +/**删除 */ +export const delAddr = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); diff --git a/src/api/platform/system/controller/boxcard.ts b/src/api/platform/system/controller/boxcard.ts new file mode 100644 index 0000000..925a681 --- /dev/null +++ b/src/api/platform/system/controller/boxcard.ts @@ -0,0 +1,51 @@ +import {BoxCardParams, BoxCardListItem, BoxCardListGetListResult} from '/@/api/platform/system/entity/boxCardModel' +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from '/@/utils/is'; + +const prefix = '/iot/equip'; + +enum Api { + GetCardById = '/boxcard/getById', + List = '/boxcard/list', + ListForSelect = '/boxcard/listForSelect', + Add = '/boxcard/add', + Update = '/boxcard/update', + Remove = '/boxcard/remove' +} + +/** + * 查询根据id + * @param params + */ +export const getCardById = (params: { id: String } ) => + defHttp.get({ url: prefix + Api.GetCardById, params }); + +/** + * 条件查询list + * @param params + */ +export const cardList = (params: BoxCardParams) => + defHttp.get({ url: prefix + Api.List, params }); + +/** + * 获取下拉列表的list + * @param params + */ +export const listForSelect = (params: {isUsed: number}) => + defHttp.get({url: prefix + Api.ListForSelect}); + +/** + * 新增或修改 + * @param params + */ +export const set = (params: BoxCardListItem) =>{ + if (isDef(params.id)) { + return defHttp.put({ url: prefix + Api.Update, params }); + } else { + return defHttp.post({ url: prefix + Api.Add, params }); + } +}; + + +export const remove = (params: {ids: String}) => + defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file diff --git a/src/api/platform/system/entity/boxCardModel.ts b/src/api/platform/system/entity/boxCardModel.ts new file mode 100644 index 0000000..1efec50 --- /dev/null +++ b/src/api/platform/system/entity/boxCardModel.ts @@ -0,0 +1,25 @@ +// 引入基础包 +import { Page, CommonEntity } from '/@/api/common/data/entity'; +import type { R } from '/#/axios'; +// 定义查询参数 +export type BoxCardParams = { + id?: string; + company?: string; + iccid?: string; + card?: string; +} | Page; + + +export interface BoxCardListItem extends CommonEntity{ + id: string; + iccid: string; + card: string; + company: string; + isUsed: number; + status: string; + createByName: string; + createByTime: string; + +} + +export type BoxCardListGetListResult = R; \ No newline at end of file diff --git a/src/views/institution/address/AddressModal.vue b/src/views/institution/address/AddressModal.vue new file mode 100644 index 0000000..ae0d354 --- /dev/null +++ b/src/views/institution/address/AddressModal.vue @@ -0,0 +1,89 @@ + + diff --git a/src/views/institution/address/address.data.ts b/src/views/institution/address/address.data.ts new file mode 100644 index 0000000..668a7e5 --- /dev/null +++ b/src/views/institution/address/address.data.ts @@ -0,0 +1,126 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; + + + +export const columns: BasicColumn[] = [ + { + title: '区域ID', + dataIndex: 'id', + width: 50, + }, + { + title: '区域名称', + dataIndex: 'name', + width: 120, + }, + { + title: '排序', + dataIndex: 'sort', + width:50 + }, + { + title: '创建时间', + dataIndex: 'createTime', + width:200 + }, + +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '区域名称', + component: 'Input', + componentProps: { + placeholder: '请输入区域名称', + }, + colProps: { span: 5 }, + }, + { + field:'code', + label:'区域ID', + component:'Input', + componentProps:{ + placeholder:'请输入区域ID', + }, + colProps:{span:5} + }, + { + field: 'dateRange', + label: '创建时间', + component: 'RangePicker', + componentProps: { + style: { width:'100%' }, + valueFormat: 'YYYY-MM-DD', + placeholder: ['开始日期','结束日期'] + }, + colProps: { span: 8 } + }, + +]; +/*表单配置*/ +export const addressFormSchema: FormSchema[] = [ + // { + // field: 'parentId', + // label: '地区', + // component: 'ApiTreeSelect', + // //component: 'TreeSelect', + // //defaultValue:'一级区域', + // componentProps: { + // api: treeList, + // resultField: 'list', + // labelField: 'name', + // valueField: 'code', + // // ReplaceFields:{ + // // title: 'name', + // // key: 'code', + // // value: 'code' + // // } + // }, + // required: true, + // }, + // + { + field: 'parentId', + label: '上级地区', + component: 'TreeSelect', + defaultValue: '0', + required: true, + componentProps:{ + replaceFields: { + title: 'name', + key: 'id', + value: 'id', + }, + + getPopupContainer: () => document.body, + } + }, + { + field: 'id', + label: '区域ID', + component: 'Input', + helpMessage: ['区域ID'], + required: true + }, + { + field:'sort', + label:'排序', + component:'Input', + required:true + }, + { + label: '区域名称', + field: 'name', + component: 'Input', + }, + + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/institution/address/index.vue b/src/views/institution/address/index.vue new file mode 100644 index 0000000..2bf70d6 --- /dev/null +++ b/src/views/institution/address/index.vue @@ -0,0 +1,116 @@ + + + \ No newline at end of file