import request from '@/config/axios'
|
|
export type ItemVO = {
|
id: string | undefined
|
itemNo: string
|
itemName: string
|
itemType: string
|
itemCategory: string
|
coefficient: number
|
precision: number
|
timeGranularity: string
|
unit: string
|
remark: string
|
status: string
|
timeLabel: string
|
timeLimit: string
|
timeStart: string
|
timeEnd: string
|
dimension: string
|
expression: string
|
}
|
|
export type PageParam = {
|
itemNo: string
|
itemName: string
|
itemType: string
|
itemCategory: string
|
}
|
|
|
// 查询列表
|
export const getItemPage = (params: PageParam) => {
|
return request.get({ url: '/data/ind-item/page', params })
|
}
|
|
// 查询详情
|
export const getItem = (id: string) => {
|
return request.get({ url: '/data/ind-item/get?id=' + id })
|
}
|
|
// 新增
|
export const createItem = (data: ItemVO) => {
|
return request.post({ url: '/data/ind-item/create', data })
|
}
|
|
// 修改
|
export const updateItem = (data: ItemVO) => {
|
return request.put({ url: '/data/ind-item/update', data })
|
}
|
|
// 删除
|
export const deleteItem = (id: number) => {
|
return request.delete({ url: '/data/ind-item/delete?id=' + id })
|
}
|
|
//获取下拉集合
|
export const getItemList = (params: PageParam) => {
|
return request.get({ url: '/data/ind-item/getList', params})
|
}
|
|
export const validateAsNumber = (rule, value, callback) => {
|
const regex = /^(\-|\+)?\d+(\.\d+)?$/;
|
if (!regex.test(value)) {
|
callback(new Error('请输入数字!'));
|
}
|
}
|