物联设备管理

This commit is contained in:
曹磊 2026-03-30 18:20:25 +08:00
parent ca125c3517
commit 7f620df8b4
21 changed files with 2537 additions and 0 deletions

View File

@ -0,0 +1,209 @@
<template>
<div class="p-2">
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="orgCode">
<template #label><span title="机构编码">机构编码</span></template>
<a-input v-model:value="queryParam.orgCode" placeholder="请输入机构编码" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="departName">
<template #label><span title="机构名称">机构名称</span></template>
<a-input v-model:value="queryParam.departName" placeholder="请输入机构名称" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template #bodyCell="{ column, record, index, text }">
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<DepartPreviewModal ref="previewDrawer" @success="handleSuccess" />
<DeviceIntegrationModal ref="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="iot-nuIotElectricitynInfo" setup>
import {reactive, ref,h} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { useUserStore } from '/@/store/modules/user';
import {Modal} from "ant-design-vue";
import {list, save} from './manager.api';
import { columns, searchFormSchema } from './manager.data';
import {useModal} from "@/components/Modal";
import DepartPreviewModal from "./components/DepartPreviewModal.vue";
import DeviceIntegrationModal from "./components/DeviceIntegrationModal.vue";
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const previewDrawer = ref();
const registerDrawer = ref();
const tipVisible = ref(false);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '物联设备管理',
api: list,
columns,
canResize:false,
useSearchForm: false,
showIndexColumn: true,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 290,
fixed:'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
function handleCancel() {
tipVisible.value = false;
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '新增清单',
onClick: handleDeviceList.bind(null, record),
},
{
label: '设备集成',
onClick: handleDeviceIntegration.bind(null, record),
},
{
label: '设备日志',
onClick: handleDeviceLog.bind(null, record),
}
]
}
/**
* 编辑
*/
// function handleAdd() {
// registerDrawer.value.disableSubmit = false;
// registerDrawer.value.add();
// }
/**
* 新增清单
*/
function handleDeviceList(record: Recordable) {
previewDrawer.value.disableSubmit = false;
previewDrawer.value.edit(record);
}
/**
* 设备集成
*/
function handleDeviceIntegration(record: Recordable) {
registerDrawer.value.disableSubmit = false;
registerDrawer.value.edit(record);
}
/**
* 设备日志
*/
function handleDeviceLog(record: Recordable) {
registerDrawer.value.disableSubmit = true;
registerDrawer.value.edit(record);
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,200 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="规格型号" v-bind="validateInfos.deviceModel" id="departPreviewForm-deviceModel" name="deviceModel">
<a-select ref="select"
placeholder="规格型号"
v-model:value="formData.deviceModel" @change="handleChange">
<a-select-option :value="item.deviceModel" v-for="item in deviceConfigs" :key="item.id">{{item.deviceModel}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="设备类型" v-bind="validateInfos.deviceType" id="departPreviewForm-deviceType" name="deviceType">
<j-dict-select-tag v-model:value="formData.deviceType" dictCode="tplink_device_type" disabled allow-clear />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="生产厂家" v-bind="validateInfos.factory" id="departPreviewForm-factory" name="factory">
<a-input v-model:value="formData.factory" :disabled="true"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="设备维度" v-bind="validateInfos.dimension" id="departPreviewForm-dimension" name="dimension">
<a-input v-model:value="formData.dimension" :disabled="true"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="采购数量" v-bind="validateInfos.purchaseQuantity" id="departPreviewForm-purchaseQuantity" name="purchaseQuantity">
<a-input-number v-model:value="formData.purchaseQuantity" style="width: 100%"></a-input-number>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { configList,savePreview } from './preview.api';
import { Form } from 'ant-design-vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import {nulist} from "@/views/iotManager/manager.api";
const orgCode = ref<any>('');
const deviceConfigs = ref([]);
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: undefined,
orgCode: undefined,
deviceType: undefined,
deviceModel: undefined,
factory: undefined,
dimension: "机构维度",
purchaseQuantity: undefined
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
deviceModel: [{ required: true, message: '请选择设备!'},],
purchaseQuantity: [{ required: true, message: '请输入采购数量!'},],
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add(record) {
getDeviceConfig();
orgCode.value = record.orgCode;
formData.orgCode = record.orgCode;
}
/**
* 编辑
*/
function edit(record) {
getDeviceConfig();
orgCode.value = record.orgCode;
nextTick(() => {
resetFields();
//
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await savePreview(model)
.then((res) => {
emit('ok');
})
.finally(() => {
confirmLoading.value = false;
});
}
function getDeviceConfig(){
let params = {'dimension': '机构维度'};
configList(params)
.then((res) => {
deviceConfigs.value = res;
}).catch(() =>{})
.finally(() => {
});
}
function handleChange(key,record) {
let vo = deviceConfigs.value.filter(item => item.id == record.key);
formData.deviceType = vo[0]["deviceType"];
formData.factory = vo[0]["factory"];
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer :title="title" :width="width" :visible="visible" :closable="true" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
<AddDepartPreviewForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false">
</AddDepartPreviewForm>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import AddDepartPreviewForm from './AddDepartPreviewForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const configVisible = ref<boolean>(false);
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add(record) {
title.value = '新增机构维度';
visible.value = true;
nextTick(() => {
registerForm.value.add(record);
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑机构维度';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,220 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="选择区域" v-bind="validateInfos.nuId" id="nuPreviewForm-nuId" name="nuId">
<a-select ref="select"
placeholder="请选择区域"
v-model:value="formData.nuId">
<a-select-option :value="item.nuId" v-for="item in nuInfos" :key="item.nuId">{{item.nuName}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="规格型号" v-bind="validateInfos.deviceModel" id="nuPreviewForm-deviceModel" name="deviceModel">
<a-select ref="select"
placeholder="规格型号"
v-model:value="formData.deviceModel" @change="handleChange">
<a-select-option :value="item.deviceModel" v-for="item in deviceConfigs" :key="item.id">{{item.deviceModel}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="设备类型" v-bind="validateInfos.deviceType" id="nuPreviewForm-deviceType" name="deviceType">
<j-dict-select-tag v-model:value="formData.deviceType" dictCode="tplink_device_type" disabled allow-clear />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="生产厂家" v-bind="validateInfos.factory" id="nuPreviewForm-factory" name="factory">
<a-input v-model:value="formData.factory" :disabled="true"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="设备维度" v-bind="validateInfos.dimension" id="nuPreviewForm-dimension" name="dimension">
<a-input v-model:value="formData.dimension" :disabled="true"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="采购数量" v-bind="validateInfos.purchaseQuantity" id="nuPreviewForm-purchaseQuantity" name="purchaseQuantity">
<a-input-number v-model:value="formData.purchaseQuantity" style="width: 100%"></a-input-number>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { nuList,configList,savePreview } from './preview.api';
import { Form } from 'ant-design-vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const orgCode = ref<any>('');
const deviceConfigs = ref([]);
const nuInfos = ref([]);
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: undefined,
orgCode: undefined,
nuId: undefined,
deviceType: undefined,
deviceModel: undefined,
factory: undefined,
dimension: "区域维度",
purchaseQuantity: undefined
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
nuId: [{ required: true, message: '请选择区域!'},],
deviceModel: [{ required: true, message: '请选择设备!'},],
purchaseQuantity: [{ required: true, message: '请输入采购数量!'},],
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add(record) {
getNuInfos(record);
getDeviceConfig();
orgCode.value = record.orgCode;
formData.orgCode = record.orgCode;
}
/**
* 编辑
*/
function edit(record) {
getNuInfos(record);
getDeviceConfig();
orgCode.value = record.orgCode;
nextTick(() => {
resetFields();
//
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await savePreview(model)
.then((res) => {
emit('ok');
})
.finally(() => {
confirmLoading.value = false;
});
}
function getDeviceConfig(){
let params = {'dimension': '区域维度'};
configList(params)
.then((res) => {
deviceConfigs.value = res;
}).catch(() =>{})
.finally(() => {
});
}
function handleChange(key,record) {
let vo = deviceConfigs.value.filter(item => item.id == record.key);
formData.deviceType = vo[0]["deviceType"];
formData.factory = vo[0]["factory"];
}
async function getNuInfos(record){
let params = {'orgCode': record.orgCode };
nuInfos.value = await nuList(params);
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer :title="title" :width="width" :visible="visible" :closable="true" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
<AddNuPreviewForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false">
</AddNuPreviewForm>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import AddNuPreviewForm from './AddNuPreviewForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const configVisible = ref<boolean>(false);
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add(record) {
title.value = '新增区域维度';
visible.value = true;
nextTick(() => {
registerForm.value.add(record);
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑区域维度';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,163 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
</div>
</template>
<script lang="ts" name="DeviceManager-Camera" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { cameraList } from './integration.api';
import { useUserStore } from '/@/store/modules/user';
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
const previewModal = ref();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '监控设备',
api: cameraList,
columns: deviceColumns,
canResize: false,
useSearchForm: false,
immediate: false,
showActionColumn: true,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 8,
xl: 6,
xxl: 8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
console.log('searchQuery', queryParam);
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 预览
*/
function handlePreview(record: Recordable) {
if (record.deviceIndex == null) {
return
}
record.streamType = 1;
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '预览',
onClick: handlePreview.bind(null, record),
ifShow: record.deviceType == 'SURVEILLANCECAMERA'
},
];
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.departId = record.id;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
margin-bottom: 14px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,217 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="dimension">
<template #label><span title="设备维度">设备维度</span></template>
<a-select v-model:value="queryParam.dimension" placeholder="请选择设备维度" allow-clear>
<a-select-option value="机构维度">机构维度</a-select-option>
<a-select-option value="区域维度">区域维度</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="deviceType">
<template #label><span title="设备类型">设备类型</span></template>
<j-dict-select-tag v-model:value="queryParam.deviceType" :showLabel="false" dictCode="tplink_device_type" placeholder="请选择设备类型" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="addDepartDevice"> 机构维度</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="addNuDevice"> 区域维度</a-button>
<a-button type="primary" preIcon="ant-design:search-outlined" @click="devicePreview"> 设备预览</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AddDepartPreviewModal ref="addDepartPreviewDrawer" @success="handleSuccess" />
<AddNuPreviewModal ref="addNuPreviewDrawer" @success="handleSuccess" />
<NuPreviewModal ref="nuPreviewDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="iotManager-areaList" setup>
import {ref, reactive, defineExpose, nextTick, createVNode} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { departColumns } from './preview.data';
import { departPreview } from './preview.api';
import { useUserStore } from '/@/store/modules/user';
import AddDepartPreviewModal from './AddDepartPreviewModal.vue';
import AddNuPreviewModal from './AddNuPreviewModal.vue';
import NuPreviewModal from './NuPreviewModal.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {Modal} from "ant-design-vue";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
const formRef = ref();
const queryParam = reactive<any>({});
const addDepartPreviewDrawer = ref();
const addNuPreviewDrawer = ref();
const nuPreviewDrawer = ref();
const orgCode = ref<any>('');
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '设备清单',
api: departPreview,
columns: departColumns,
canResize: false,
useSearchForm: false,
showIndexColumn: true,
showActionColumn: false,
immediate: false,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 180,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
];
}
/**
* 机构添加设备
*/
function addDepartDevice(){
let record = {
orgCode: orgCode.value
}
addDepartPreviewDrawer.value.disableSubmit = false;
addDepartPreviewDrawer.value.add(record);
}
/**
* 区域添加设备
*/
function addNuDevice(){
let record = {
orgCode: orgCode.value
}
addNuPreviewDrawer.value.disableSubmit = false;
addNuPreviewDrawer.value.add(record);
}
/**
* 设备预览
*/
function devicePreview(){
let record ={
orgCode: orgCode.value
}
nuPreviewDrawer.value.disableSubmit = true;
nuPreviewDrawer.value.edit(record);
}
/**
* 查询
*/
function searchQuery() {
queryParam.orgCode = orgCode.value;
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
searchQuery();
}
//
function init(record) {
orgCode.value = record.orgCode;
searchQuery();
}
defineExpose({
init
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<a-drawer :title="title" :width="width" :visible="visible" :closable="true" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
<DepartPreviewList v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false">
</DepartPreviewList>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DepartPreviewList from './DepartPreviewList.vue'
const title = ref<string>('');
const width = ref<number>(1200);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '设备清单' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,116 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleChange">
<a-tab-pane key="1" tab="监控设备">
<CameraList ref="CameraListModal"></CameraList>
</a-tab-pane>
<a-tab-pane key="2" tab="网络设备" force-render>
<NetworkList ref="NetworkListModal"></NetworkList>
</a-tab-pane>
<a-tab-pane key="3" tab="智能电表" force-render>
<ElectricityList ref="ElectricityListModal"></ElectricityList>
</a-tab-pane>
<a-tab-pane key="4" tab="智能水表" force-render>
<WaterList ref="WaterListModal"></WaterList>
</a-tab-pane>
<a-tab-pane key="5" tab="温湿度计" force-render>
<HumidList ref="HumidListModal"></HumidList>
</a-tab-pane>
</a-tabs>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CameraList from './CameraList.vue'
import NetworkList from './NetworkList.vue'
import ElectricityList from './ElectricityList.vue'
import WaterList from './WaterList.vue'
import HumidList from './HumidList.vue'
// import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const CameraListModal = ref();
const NetworkListModal = ref();
const ElectricityListModal = ref();
const WaterListModal = ref();
const HumidListModal = ref();
const activeKey = ref('1');
const dbsbInfo = ref<any>({});
const title = ref<string>('');
const width = ref<string>('1200');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
async function edit(record) {
visible.value = true;
title.value = '设备集成';
nextTick(() => {
activeKey.value = "1";
getDataList(activeKey.value, record);
dbsbInfo.value = record;
});
}
function getDataList(type, record) {
console.log("🚀 ~ getDataList ~ type, record:", type, record)
if (type == '1') {
CameraListModal.value.init(record);
} else if (type == '2') {
NetworkListModal.value.init(record);
} else if (type == '3') {
ElectricityListModal.value.init(record);
} else if (type == '4') {
WaterListModal.value.init(record);
} else if (type == '5') {
HumidListModal.value.init(record);
}
}
function handleChange(key) {
console.log("🚀 ~ handleChange ~ key:", key)
activeKey.value = key;
getDataList(key, dbsbInfo.value);
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(params) {
handleCancel();
emit('success', params);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,144 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="DeviceManager-Electricity" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { electricityList } from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '电表设备',
api: electricityList,
columns: deviceColumns,
canResize: false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 8,
xl: 6,
xxl: 8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
console.log('searchQuery', queryParam);
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
];
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.departId = record.id;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
margin-bottom: 14px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,144 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="DeviceManager-Electricity" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { humidList } from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '温湿度计',
api: humidList,
columns: deviceColumns,
canResize: false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 8,
xl: 6,
xxl: 8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
console.log('searchQuery', queryParam);
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
];
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.departId = record.id;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
margin-bottom: 14px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,144 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="DeviceManager-Network" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { networkList } from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '网络设备',
api: networkList,
columns: deviceColumns,
canResize: false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 8,
xl: 6,
xxl: 8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
console.log('searchQuery', queryParam);
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
];
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.departId = record.id;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
margin-bottom: 14px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,226 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="nuName">
<template #label><span title="区域名称">区域名称</span></template>
<a-input v-model:value="queryParam.nuName" placeholder="请输入区域名称" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="dimension">
<template #label><span title="设备维度">设备维度</span></template>
<a-select v-model:value="queryParam.dimension" placeholder="请选择设备维度" allow-clear>
<a-select-option value="机构维度">机构维度</a-select-option>
<a-select-option value="区域维度">区域维度</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="deviceType">
<template #label><span title="设备类型">设备类型</span></template>
<j-dict-select-tag v-model:value="queryParam.deviceType" :showLabel="false" dictCode="tplink_device_type" placeholder="请选择设备类型" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<!-- <AreaDeviceAddModal ref="areaAddDrawer" @success="handleSuccess" />-->
<!-- <AreaDeviceModal ref="areaDrawer" @success="handleSuccess" />-->
</div>
</template>
<script lang="ts" name="iotManager-areaList" setup>
import {ref, reactive, defineExpose, nextTick, createVNode} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { nuColumns } from './preview.data';
import { nuPreview,deletePreview } from './preview.api';
import { useUserStore } from '/@/store/modules/user';
// import AreaDeviceModal from './AreaDeviceModal.vue';
// import AreaDeviceAddModal from './AreaDeviceAddModal.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {Modal} from "ant-design-vue";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
const formRef = ref();
const queryParam = reactive<any>({});
const areaAddDrawer = ref();
const areaDrawer = ref();
const orgCode = ref<any>('');
const departId = ref<any>('');
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '设备清单',
api: nuPreview,
columns: nuColumns,
canResize: false,
useSearchForm: false,
showIndexColumn: true,
showActionColumn: true,
immediate: false,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 编辑
*/
function handleEdit() {
// registerDrawer.value.disableSubmit = false;
// registerDrawer.value.add();
}
//
async function handleDelete(record: Recordable) {
await deletePreview(record);
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否删除此数据',
confirm: handleDelete.bind(null, record),
},
},
];
}
/**
* 添加设备
*/
function deviceManager(record: Recordable){
areaAddDrawer.value.disableSubmit = false;
areaAddDrawer.value.edit(record);
}
/**
* 区域设备预览
*/
function handlePreview(record: Recordable){
areaDrawer.value.disableSubmit = true;
areaDrawer.value.edit(record);
}
/**
* 查询
*/
function searchQuery() {
queryParam.orgCode = orgCode.value;
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
searchQuery();
}
//
function init(record) {
orgCode.value = record.orgCode;
searchQuery();
}
defineExpose({
init
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<a-drawer :title="title" :width="width" :visible="visible" :closable="true" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
<NuPreviewList v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false">
</NuPreviewList>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuPreviewList from './NuPreviewList.vue'
const title = ref<string>('');
const width = ref<number>(1400);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '设备清单' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,144 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="DeviceManager-Electricity" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { waterList } from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '水表设备',
api: waterList,
columns: deviceColumns,
canResize: false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
pagination: {
current: 1,
pageSize: 15,
pageSizeOptions: ['15', '50', '70', '100'],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 8,
xl: 6,
xxl: 8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
console.log('searchQuery', queryParam);
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
];
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.departId = record.id;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
margin-bottom: 14px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,21 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
cameraList = '/iot/device/manager/cameraList',
networkList = '/iot/device/manager/networkList',
electricityList = '/iot/device/manager/electricityList',
waterList = '/iot/device/manager/waterList',
humidList = '/iot/device/manager/humidList',
}
/**
*
* @param params
*/
export const cameraList = (params) => defHttp.get({ url: Api.cameraList, params });
export const networkList = (params) => defHttp.get({ url: Api.networkList, params });
export const electricityList = (params) => defHttp.get({ url: Api.electricityList, params });
export const waterList = (params) => defHttp.get({ url: Api.waterList, params });
export const humidList = (params) => defHttp.get({ url: Api.humidList, params });

View File

@ -0,0 +1,51 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const deviceColumns: BasicColumn[] = [
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
width: 150
},
{
title: '设备类型',
align: "center",
dataIndex: 'deviceType_dictText'
},
{
title: '设备型号',
align: "center",
dataIndex: 'deviceModel',
width: 200
},
{
title: '生产厂家',
align: "center",
dataIndex: 'factory',
width: 200
},
{
title: '在线状态',
align: "center",
dataIndex: 'deviceStatus',
width: 100
},
{
title: '设备状态',
align: "center",
dataIndex: 'maintainStatus',
customRender:({record})=>{
if(record.maintainStatus=='0'){
return "正常";
}
if(record.maintainStatus=='1'){
return "损坏";
}
},
width: 200
},
];
export const searchFormSchema: FormSchema[] = [];

View File

@ -0,0 +1,31 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
departPreview = '/iot/device/manager/departPreview',
nuPreview = '/iot/device/manager/nuPreview',
configList = '/iot/device/config/queryList',
nuList = '/iot/device/manager/nuList',
savePreview = '/iot/device/manager/savePreview',
deletePreview = '/iot/device/manager/deletePreview',
}
/**
*
* @param params
*/
export const departPreview = (params) => defHttp.get({ url: Api.departPreview, params });
export const nuPreview = (params) => defHttp.get({ url: Api.nuPreview, params });
export const configList = (params) => defHttp.get({ url: Api.configList, params });
export const nuList = (params) => defHttp.get({ url: Api.nuList, params });
/**
*
* @param id
*/
export const savePreview = (params) => defHttp.post({ url: Api.savePreview, params });
/**
*
* @param id
*/
export const deletePreview = (params) => defHttp.post({ url: Api.deletePreview, params });

View File

@ -0,0 +1,118 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const departColumns: BasicColumn[] = [
{
title: '机构编码',
align: "center",
dataIndex: 'orgCode',
width: 150
},
{
title: '机构名称',
align: "center",
dataIndex: 'departName',
},
{
title: '设备类型',
align: "center",
dataIndex: 'deviceType_dictText',
width: 150
},
{
title: '设备型号',
align: "center",
dataIndex: 'deviceModel',
width: 150
},
{
title: '生产厂家',
align: "center",
dataIndex: 'factory',
width: 150
},
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
width: 150
},
{
title: '采购数量',
align: "center",
dataIndex: 'purchaseQuantity',
width: 150
},
];
export const nuColumns: BasicColumn[] = [
{
title: '机构编码',
align: "center",
dataIndex: 'orgCode',
width: 100
},
{
title: '机构名称',
align: "center",
dataIndex: 'departName',
},
{
title: '区域编码',
align: "center",
dataIndex: 'nuId',
customRender:({record})=>{
if(record.nuId==null || record.nuId==''){
return "-";
}else{
return record.nuId;
}
},
width: 120
},
{
title: '区域名称',
align: "center",
dataIndex: 'nuName',
customRender:({record})=>{
if(record.nuName==null || record.nuName==''){
return "-";
}else{
return record.nuName;
}
},
},
{
title: '设备类型',
align: "center",
dataIndex: 'deviceType_dictText',
width: 150
},
{
title: '设备型号',
align: "center",
dataIndex: 'deviceModel',
width: 150
},
{
title: '生产厂家',
align: "center",
dataIndex: 'factory',
width: 150
},
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
width: 100
},
{
title: '采购数量',
align: "center",
dataIndex: 'purchaseQuantity',
width: 100
},
];
export const searchFormSchema: FormSchema[] = [];

View File

@ -0,0 +1,20 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/iot/device/manager/list',
save = '/iot/device/manager/add',
delete = '/iot/device/manager/delete'
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const save = (params) => defHttp.post({ url: Api.save, params }, { joinParamsToUrl: true });

View File

@ -0,0 +1,37 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '机构编码',
align: "center",
dataIndex: 'orgCode',
width: 150
},
{
title: '机构名称',
align: "center",
dataIndex: 'departName'
},
{
title: '机构负责人',
align: "center",
dataIndex: 'orgLeader',
width: 200
},
{
title: '审核状态',
align: "center",
dataIndex: 'auditStatus',
width: 200
},
{
title: '审核日期',
align: "center",
dataIndex: 'auditTime',
width: 200
},
];
export const searchFormSchema: FormSchema[] = [];