path
parent
b06ea25e9b
commit
4a17e701c9
|
|
@ -6,13 +6,13 @@ VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
# Cross-domain proxy, you can configure multiple
|
# Cross-domain proxy, you can configure multiple
|
||||||
# Please note that no line breaks
|
# Please note that no line breaks
|
||||||
VITE_PROXY = [["/api","http://36.133.205.221:81"],["/upload","http://36.133.205.221:81/api/web/upload"]]
|
VITE_PROXY = [["/basic-api","http://lcny.sk797.cn"],["/upload","http://lcny.sk797.cn/api/web/upload"]]
|
||||||
|
|
||||||
# Delete console
|
# Delete console
|
||||||
VITE_DROP_CONSOLE = false
|
VITE_DROP_CONSOLE = false
|
||||||
|
|
||||||
# Basic interface address SPA
|
# Basic interface address SPA
|
||||||
VITE_GLOB_API_URL=/api
|
VITE_GLOB_API_URL=/basic-api
|
||||||
|
|
||||||
# File upload address, optional
|
# File upload address, optional
|
||||||
VITE_GLOB_UPLOAD_URL=/upload
|
VITE_GLOB_UPLOAD_URL=/upload
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,20 @@ export function getDeviceTypes(mode: ErrorMessageMode = 'none') {
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description:设备类型
|
||||||
|
*/
|
||||||
|
export function getKeywords(params, mode: ErrorMessageMode = 'none') {
|
||||||
|
return defHttp.get(
|
||||||
|
{
|
||||||
|
url: '/api/keywords',
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description:添加设备
|
* @description:添加设备
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
...obj,
|
...obj,
|
||||||
agricultural_base_id: obj.base_id,
|
agricultural_base_id: obj.base_id,
|
||||||
type: formatDataByObject(deviceTypes).find((e) => e.label == obj.type)?.value,
|
type: formatDataByObject(deviceTypes).find((e) => e.label == obj.type)?.value,
|
||||||
|
supplier_key: obj?.supplier?.id,
|
||||||
|
project_key: obj?.project?.id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { BasicColumn } from '/@/components/Table'
|
import { BasicColumn } from '/@/components/Table'
|
||||||
import { FormSchema } from '/@/components/Table'
|
import { FormSchema } from '/@/components/Table'
|
||||||
import { getAgriculturalBasic } from '/@/api/sys/user'
|
import { getAgriculturalBasic } from '/@/api/sys/user'
|
||||||
import { getDeviceTypes } from '/@/api/sys/other'
|
import { getDeviceTypes, getKeywords } from '/@/api/sys/other'
|
||||||
import { h } from 'vue'
|
import { h } from 'vue'
|
||||||
import { Tag } from 'ant-design-vue'
|
import { Tag } from 'ant-design-vue'
|
||||||
function formatDataByObject(obj): any[] {
|
function formatDataByObject(obj): any[] {
|
||||||
|
|
@ -27,6 +27,20 @@ export const columns: BasicColumn[] = [
|
||||||
title: '设备编号',
|
title: '设备编号',
|
||||||
dataIndex: 'sn',
|
dataIndex: 'sn',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '设备厂商',
|
||||||
|
dataIndex: 'supplier',
|
||||||
|
customRender: ({ text }) => {
|
||||||
|
return text?.name ?? ''
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '项目',
|
||||||
|
dataIndex: 'project',
|
||||||
|
customRender: ({ text }) => {
|
||||||
|
return text?.name ?? ''
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '基地',
|
title: '基地',
|
||||||
dataIndex: 'base_name',
|
dataIndex: 'base_name',
|
||||||
|
|
@ -181,12 +195,41 @@ export const accountFormSchema: FormSchema[] = [
|
||||||
required: true,
|
required: true,
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'supplier_key',
|
||||||
|
label: '设备厂商',
|
||||||
|
required: true,
|
||||||
|
component: 'ApiSelect',
|
||||||
|
componentProps: {
|
||||||
|
api: async () => {
|
||||||
|
const res = await getKeywords({ key: 'device-supplier' })
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'key',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'project_key',
|
||||||
|
label: '项目',
|
||||||
|
required: true,
|
||||||
|
component: 'ApiSelect',
|
||||||
|
componentProps: {
|
||||||
|
api: async () => {
|
||||||
|
const res = await getKeywords({ key: 'device-project' })
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'key',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'monitoring_point',
|
field: 'monitoring_point',
|
||||||
label: '监控点',
|
label: '监控点',
|
||||||
required: true,
|
required: true,
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'extends.ip',
|
field: 'extends.ip',
|
||||||
label: '设备IP',
|
label: '设备IP',
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<Box title="水质监测数据">
|
<Box title="水质监测数据">
|
||||||
<template #center>
|
<template #center>
|
||||||
<!-- <div
|
<div
|
||||||
class="text-center bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-14px font-bold"
|
class="text-center bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-14px font-bold"
|
||||||
>
|
>
|
||||||
{{ currentTabValue }}
|
{{ currentTabValue }}
|
||||||
</div> -->
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<div class="py-10px relative" v-if="tabList.length > 1">
|
<div class="py-10px relative" v-if="tabList.length > 1">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<Box title="土壤监测数据">
|
<Box title="土壤监测数据">
|
||||||
<template #center>
|
<template #center>
|
||||||
<!-- <div
|
<div
|
||||||
class="text-center bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-14px font-bold"
|
class="text-center bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-14px font-bold"
|
||||||
>
|
>
|
||||||
{{ currentTabValue }}
|
{{ currentTabValue }}
|
||||||
</div> -->
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<div class="py-10px relative" v-if="tabList.length > 1">
|
<div class="py-10px relative" v-if="tabList.length > 1">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue