This commit is contained in:
1378012178@qq.com 2025-07-09 15:48:04 +08:00
commit 33c1c9da9e
18 changed files with 735 additions and 450 deletions

View File

@ -7,6 +7,7 @@ enum Api {
syncRegion = '/iot/tplink/regionInfo/sync',
list = '/iot/tplink/cameraInfo/list',
syncProjectIpcDevice = '/iot/tplink/cameraInfo/syncProjectIpcDevice',
syncAllDevices = '/iot/tplink/cameraInfo/syncAllDevices',
ipcCapability = '/iot/tplink/cameraInfo/getIpcCapability',
nuList = '/iot/tplink/cameraInfo/nuList',
edit = '/iot/tplink/cameraInfo/edit',
@ -74,13 +75,18 @@ export const syncRegion = (params?) => defHttp.get({ url: Api.syncRegion, params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
* IPC设备
* @param params
*/
export const syncProjectIpcDevice = (params) => defHttp.get({ url: Api.syncProjectIpcDevice, params });
/**
*
* @param params
*/
export const syncAllDevices = (params) => defHttp.get({ url: Api.syncAllDevices, params });
/**
* IPC能力集
* @param params

View File

@ -24,46 +24,71 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'deviceModel'
},
{
title: 'IP地址',
align: "center",
dataIndex: 'ip'
},
{
title: 'MAC地址',
align: "center",
dataIndex: 'mac'
},
{
title: '区域名称',
align: "center",
dataIndex: 'regionName'
},
{
title: '父设备名称',
align: "center",
dataIndex: 'parentDeviceName'
},
{
title: '项目名称',
align: "center",
dataIndex: 'projectName'
},
{
title: '位置名称',
align: "center",
dataIndex: 'locationName'
},
{
title: '护理单元',
align: "center",
dataIndex: 'nuId_dictText',
},
// {
// title: 'IP地址',
// align: "center",
// dataIndex: 'ip'
// },
// {
// title: 'MAC地址',
// align: "center",
// dataIndex: 'mac'
// },
// {
// title: '区域名称',
// align: "center",
// dataIndex: 'regionName'
// },
// {
// title: '父设备名称',
// align: "center",
// dataIndex: 'parentDeviceName'
// },
// {
// title: '项目名称',
// align: "center",
// dataIndex: 'projectName'
// },
// {
// title: '位置名称',
// align: "center",
// dataIndex: 'locationName'
// },
// {
// title: '护理单元',
// align: "center",
// dataIndex: 'nuId_dictText',
// },
// {
// title: '护理单元',
// align: "center",
// dataIndex: 'nuName'
// },
{
title: 'FTP地址',
align: "center",
dataIndex: 'ftpIp'
},
{
title: 'FTP端口',
align: "center",
dataIndex: 'ftpPort'
},
{
title: 'FTP用户',
align: "center",
dataIndex: 'ftpUsername'
},
{
title: 'FTP密码',
align: "center",
dataIndex: 'ftpPassword'
},
{
title: 'FTP上传路径',
align: "center",
dataIndex: 'ftpUploadpath'
},
];
export const formSchema: FormSchema[] = [
@ -103,63 +128,82 @@ export const formSchema: FormSchema[] = [
component: 'Input',
dynamicDisabled: true
},
// {
// label: 'IP地址',
// field: 'ip',
// component: 'Input',
// dynamicDisabled: true
// },
// {
// label: 'MAC地址',
// field: 'mac',
// component: 'Input',
// dynamicDisabled: true
// },
// {
// label: '区域名称',
// field: 'regionName',
// component: 'Input',
// dynamicDisabled: true
// },
// {
// label: '父设备名称',
// field: 'parentDeviceName',
// component: 'Input',
// dynamicDisabled: true
// },
// {
// label: '项目ID',
// field: 'projectId',
// component: 'Input',
// show: false,
// },
// {
// label: '项目名称',
// field: 'projectName',
// component: 'Input',
// dynamicDisabled: true
// },
// {
// label: '位置名称',
// field: 'locationName',
// component: 'Input',
// dynamicDisabled: true
// },
// {
// label: '护理单元',
// field: 'nuId',
// component: 'JSelectNu',
// componentProps: {
// rowKey: 'nuId',
// labelKey: 'nuName',
// selectType: true,
// },
// },
{
label: 'IP地址',
field: 'ip',
label: 'FTP地址',
field: 'ftpIp',
component: 'Input',
dynamicDisabled: true
},
{
label: 'MAC地址',
field: 'mac',
label: 'FTP端口',
field: 'ftpPort',
component: 'Input',
dynamicDisabled: true
},
{
label: '区域名称',
field: 'regionName',
label: 'FTP用户',
field: 'ftpUsername',
component: 'Input',
dynamicDisabled: true
},
{
label: '父设备名称',
field: 'parentDeviceName',
label: 'FTP密码',
field: 'ftpPassword',
component: 'Input',
dynamicDisabled: true
},
{
label: '项目ID',
field: 'projectId',
label: 'FTP上传路径',
field: 'ftpUploadpath',
component: 'Input',
show: false,
},
{
label: '项目名称',
field: 'projectName',
component: 'Input',
dynamicDisabled: true
},
{
label: '位置名称',
field: 'locationName',
component: 'Input',
dynamicDisabled: true
},
{
label: '护理单元',
field: 'nuId',
component: 'JSelectNu',
componentProps: {
rowKey: 'nuId',
labelKey: 'nuName',
selectType: true,
},
},
{
label: '设备重启',
field: 'id',
component: 'Input',
slot: 'customInput',
}
];

View File

@ -185,7 +185,7 @@ import {ref, onMounted, reactive, onUnmounted} from "vue";
// getBatchProgress({}).then(res=>{});
// }
onMounted(()=>{
/*onMounted(()=>{
console.log(router.currentRoute.value.query);
formData.deviceIndex = router.currentRoute.value.query.deviceIndex;
formData.parentId = router.currentRoute.value.query.parentId;
@ -201,11 +201,31 @@ import {ref, onMounted, reactive, onUnmounted} from "vue";
cameraData.value.scale = formData.scale;
cameraData.value.parentId = formData.parentId;
console.log(cameraData);
})
})*/
// onUnmounted(()=>{
//
// })
function edit(record) {
formData.deviceIndex = record.deviceIndex;
formData.parentId = record.parentId;
formData.multitrans = record.multitrans;
formData.projectId = record.projectId;
formData.regionId = record.regionId;
formData.ip = record.ip;
cameraData.value.deviceIndex = formData.deviceIndex;
cameraData.value.projectId = formData.projectId;
cameraData.value.regionId = formData.regionId;
cameraData.value.multitrans = formData.multitrans;
cameraData.value.scale = formData.scale;
cameraData.value.parentId = formData.parentId;
}
defineExpose({
edit,
});
</script>
<style lang="less" scoped>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" :width="width" :fullscreen="true" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<CameraPictureConfig ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></CameraPictureConfig>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CameraPictureConfig from './CameraPictureConfig.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('100%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @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({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -1,3 +1,4 @@
<!--
<template>
<a-row class="p-2" type="flex" :gutter="10">
@ -44,3 +45,186 @@
}
</style>
-->
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="handleSync"> 拉取设备</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
<CameraPictureConfigModal ref="cameraPictureConfigModal"></CameraPictureConfigModal>
<CameraInfoDrawer @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import {ref, reactive, createVNode, h, onMounted, watch, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './camera.data';
import {list, syncAllDevices} from './camera.api';
import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router';
import CameraPreviewModal from './components/CameraPreviewModal.vue'
import CameraInfoDrawer from './components/CameraInfoDrawer.vue'
import CameraPictureConfigModal from './components/CameraPictureConfigModal.vue';
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
let router = useRouter();
const formRef = ref();
const queryParam = reactive<any>({});
const registerModal = ref();
const previewModal = ref();
const deviceModal = ref();
const cameraPictureConfigModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '摄像头信息',
api: list,
columns,
canResize: false,
formConfig: {
// labelWidth: 200,
schemas: searchFormSchema,
},
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:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 编辑
*/
function handleEdit(record: Recordable) {
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
}
/**
* 预览
*/
function handlePreview(record: Recordable) {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 画面配置
*/
function handlePicConfig(record) {
var params = {
deviceIndex: record.deviceIndex,
parentId: record.parentId,
multitrans: record.multitrans,
projectId: record.projectId,
regionId: record.regionId,
ip: record.ip
}
cameraPictureConfigModal.value.disableSubmit = true;
cameraPictureConfigModal.value.edit(params);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '画面配置',
onClick: handlePicConfig.bind(null, record),
},
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '预览',
onClick: handlePreview.bind(null, record),
},
];
}
/**
* 同步设备
*/
async function handleSync(){
await syncAllDevices({});
reload();
}
</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%;
}
}
.p-2{
height: calc(100vh - 120px);
}
</style>

View File

@ -72,10 +72,10 @@
record = {};
}
initModel.value = record;
if(record.projectId!=''&&record.regionId!=''){
// if(record.projectId!=''&&record.regionId!=''){
await fetchStorageDev(record.projectId,record.regionId);
await fetchPlan();
}
// }
},
{ deep: true, immediate: true }
);

View File

@ -65,9 +65,9 @@ import {defineExpose, nextTick, onMounted, ref, unref, watch} from 'vue';
//
async function loadRootTreeData() {
if(model.value.projectId==''&&model.value.regionId==''){
/* if(model.value.projectId==''&&model.value.regionId==''){
return ;
}
}*/
try {
loading.value = true;
treeData.value = [];

View File

@ -1,3 +1,4 @@
<!--
<template>
<a-row class="p-2" type="flex" :gutter="10">
@ -44,3 +45,181 @@
}
</style>
-->
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"> 新增</a-button>
<a-button v-if="selectedRowKeys.length > 0" preIcon="ant-design:delete-outlined" @click="batchHandleDelete"> 删除</a-button>
</template>
<!--操作栏-->
<template #action="{ record }"></template>
<template v-slot:bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex === 'recordSwitchBoolean'">
<a-switch
v-model:checked="record.recordSwitchBoolean"
checked-children="开"
un-checked-children="关"
@change="(checked) => handleSwitchChange(checked, record)"
/>
</template>
</template>
<!-- <template #recordSlot="{ text, record }">
<a-switch
v-model:checked="record.recordSwitch"
checked-children="启用"
un-checked-children="停用"
/>
</template>-->
</BasicTable>
<!-- 表单区域 -->
<PlanModal ref="registerModal"></PlanModal>
</div>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import { ref, reactive, createVNode, h, onMounted, watch, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './plan.data';
import {batchDeleteCfgs, editRecordCfgs, list} from './plan.api';
import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router';
import PlanModal from './components/PlanModal.vue';
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
let router = useRouter();
const queryParam = reactive<any>({});
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '物联管理-录像计划',
api: list,
columns,
rowKey : "ids",
canResize: false,
showActionColumn: false,
actionColumn: {
width: 180,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource, getSelectRows }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 新增
*/
function handleAdd(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 编辑
*/
function handleEdit(record: Recordable) {
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
const selectRows = getSelectRows();
let ids = [];
let devIds = [];
if(selectRows.length>0){
selectRows.forEach(function(element) {
ids.push(element.ids);
devIds.push(element.deviceIndex);
})
let params = { ids: ids.join(","), deviceIndex: devIds.join(",")};
console.log(params);
await batchDeleteCfgs(params);
}
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
];
}
function handleSwitchChange(checked, record) {
let recordSwitch = 0;
if(checked){
recordSwitch = 1;
}
editRecordCfgs({ ids: record.ids, recordSwitch: recordSwitch });
}
</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%;
}
}
.p-2{
height: calc(100vh - 120px);
}
</style>

View File

@ -3,27 +3,27 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '单元编码',
align: "center",
dataIndex: 'nuId'
},
{
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
// {
// title: '单元编码',
// align: "center",
// dataIndex: 'nuId'
// },
// {
// title: '单元名称',
// align: "center",
// dataIndex: 'nuName'
// },
{
title: '设备号',
align: "center",
dataIndex: 'address'
},
{
title: '机构名称',
align: "center",
dataIndex: 'departName',
width: 220,
},
// {
// title: '机构名称',
// align: "center",
// dataIndex: 'departName',
// width: 220,
// },
// {
// title: '采集器号',
// align: "center",
@ -91,31 +91,31 @@ export const columns: BasicColumn[] = [
];
export const searchFormSchema: FormSchema[] = [
{
label: '机构',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择机构',
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
},
colProps: { span: 6 },
},
{
label: '护理单元',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择护理单元',
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
},
colProps: { span: 6 },
},
// {
// label: '机构',
// field: 'deviceStatus',
// component: 'JDictSelectTag',
// componentProps: {
// placeholder: '请选择机构',
// dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
// },
// colProps: { span: 6 },
// },
// {
// label: '护理单元',
// field: 'deviceStatus',
// component: 'JDictSelectTag',
// componentProps: {
// placeholder: '请选择护理单元',
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
// },
// colProps: { span: 6 },
// },
{
label: '设备号',
field: 'address',
component: 'Input',
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '设备状态',
@ -128,7 +128,7 @@ export const searchFormSchema: FormSchema[] = [
{ label: '拉闸', value: '0' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '在线状态',
@ -141,7 +141,7 @@ export const searchFormSchema: FormSchema[] = [
{ label: '离线', value: 'false' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '信号强度',
@ -155,6 +155,6 @@ export const searchFormSchema: FormSchema[] = [
{ label: '低', value: '3' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
];

View File

@ -47,7 +47,7 @@
</BasicTable>
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
<ApiLogModal ref="apiLogModal"></ApiLogModal>
<ElectricitySyncLogListModal ref="syncLogModal"></ElectricitySyncLogListModal>
<!-- <ElectricitySyncLogListModal ref="syncLogModal"></ElectricitySyncLogListModal>-->
</div>
</template>
@ -63,12 +63,12 @@
import HldyUtilsModal from "@/views/utils/nuUtils/HldyUtilsModal.vue";
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
import ElectricitySyncLogListModal from "/@/views/iot/SyncLog/ElectricitySyncLogListModal.vue";
// import ElectricitySyncLogListModal from "/@/views/iot/SyncLog/ElectricitySyncLogListModal.vue";
import { defHttp } from '/@/utils/http/axios';
const queryParam = reactive<any>({});
const apiLogModal = ref();
const syncLogModal = ref();
// const syncLogModal = ref();
const hldyUtilsModal = ref();
//model
const [registerModal, {openModal}] = useModal();
@ -108,7 +108,7 @@ import { defHttp } from '/@/utils/http/axios';
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
//
function handleHldyParams(params){
defHttp.post({
@ -120,10 +120,10 @@ import { defHttp } from '/@/utils/http/axios';
})
}
//
function handleSync(record: Recordable){
syncLogModal.value.disableSubmit = true;
syncLogModal.value.init(record);
}
// function handleSync(record: Recordable){
// syncLogModal.value.disableSubmit = true;
// syncLogModal.value.init(record);
// }
/**
* 操作栏
@ -154,14 +154,13 @@ import { defHttp } from '/@/utils/http/axios';
label: '日志',
onClick: showApiLog.bind(null, record),
},
{
label: '同步',
onClick: handleSync.bind(null, record),
},
// {
// label: '',
// onClick: handleSync.bind(null, record),
// },
]
}
//
async function handleRead(record: Recordable) {
const params = {

View File

@ -148,10 +148,10 @@
label: '日志',
onClick: showApiLog.bind(null, record),
},
{
label: '同步',
onClick: handleSync.bind(null, record),
},
// {
// label: '',
// onClick: handleSync.bind(null, record),
// },
]
}

View File

@ -3,27 +3,27 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '单元编码',
align: "center",
dataIndex: 'nuId'
},
{
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
// {
// title: '单元编码',
// align: "center",
// dataIndex: 'nuId'
// },
// {
// title: '单元名称',
// align: "center",
// dataIndex: 'nuName'
// },
{
title: '设备号',
align: "center",
dataIndex: 'address'
},
{
title: '机构名称',
align: "center",
dataIndex: 'departName',
width: 220,
},
// {
// title: '机构名称',
// align: "center",
// dataIndex: 'departName',
// width: 220,
// },
// {
// title: '采集器号',
// align: "center",
@ -99,31 +99,31 @@ export const columns: BasicColumn[] = [
];
export const searchFormSchema: FormSchema[] = [
{
label: '机构',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择机构',
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
},
colProps: { span: 6 },
},
{
label: '护理单元',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择护理单元',
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
},
colProps: { span: 6 },
},
// {
// label: '机构',
// field: 'deviceStatus',
// component: 'JDictSelectTag',
// componentProps: {
// placeholder: '请选择机构',
// dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
// },
// colProps: { span: 6 },
// },
// {
// label: '护理单元',
// field: 'deviceStatus',
// component: 'JDictSelectTag',
// componentProps: {
// placeholder: '请选择护理单元',
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
// },
// colProps: { span: 6 },
// },
{
label: '设备号',
field: 'address',
component: 'Input',
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '设备状态',
@ -136,7 +136,7 @@ export const searchFormSchema: FormSchema[] = [
{ label: '拉闸', value: '0' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '在线状态',
@ -149,7 +149,7 @@ export const searchFormSchema: FormSchema[] = [
{ label: '离线', value: 'false' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '信号强度',
@ -163,6 +163,6 @@ export const searchFormSchema: FormSchema[] = [
{ label: '低', value: '3' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
];

View File

@ -3,16 +3,16 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '单元编码',
align: "center",
dataIndex: 'nuId'
},
{
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
// {
// title: '单元编码',
// align: "center",
// dataIndex: 'nuId'
// },
// {
// title: '单元名称',
// align: "center",
// dataIndex: 'nuName'
// },
{
title: '设备号',
align: "center",
@ -23,10 +23,26 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'deviceName'
},
// {
// title: '机构',
// align: "center",
// dataIndex: 'departName'
// },
{
title: '机构',
title: '在线状态',
align: "center",
dataIndex: 'departName'
dataIndex: 'status',
customRender:({record})=>{
return record.status?(record.status=='0'?'在线':'离线'):'';
},
},
{
title: '启用状态',
align: "center",
dataIndex: 'delFlag',
customRender:({record})=>{
return record.delFlag?(record.delFlag=='0'?'启用':'停用'):'';
},
},
{
title: '温度',
@ -67,50 +83,35 @@ export const columns: BasicColumn[] = [
dataIndex: 'electricity',
defaultHidden: true,
},
{
title: '在线状态',
align: "center",
dataIndex: 'status',
customRender:({record})=>{
return record.status?(record.status=='0'?'在线':'离线'):'';
},
},
{
title: '启用状态',
align: "center",
dataIndex: 'delFlag',
customRender:({record})=>{
return record.delFlag?(record.delFlag=='0'?'启用':'停用'):'';
},
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '机构',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择机构',
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
},
colProps: { span: 6 },
},
{
label: '护理单元',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择护理单元',
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
},
colProps: { span: 6 },
},
// {
// label: '机构',
// field: 'deviceStatus',
// component: 'JDictSelectTag',
// componentProps: {
// placeholder: '请选择机构',
// dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
// },
// colProps: { span: 6 },
// },
// {
// label: '护理单元',
// field: 'deviceStatus',
// component: 'JDictSelectTag',
// componentProps: {
// placeholder: '请选择护理单元',
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
// },
// colProps: { span: 6 },
// },
{
label: '设备号',
field: 'sn',
component: 'Input',
colProps: { span: 6 },
colProps: { span: 4 },
},
{
label: '在线状态',
@ -123,7 +124,7 @@ export const searchFormSchema: FormSchema[] = [
{ label: '离线', value: '1' },
],
},
colProps: { span: 6 },
colProps: { span: 4 },
},
];

View File

@ -138,10 +138,10 @@
onClick: handleApiLogAlarm.bind(null, record),
ifShow: ()=>{ return record.delFlag == '0' }
},
{
label: '同步',
onClick: handleSync.bind(null, record),
},
// {
// label: '',
// onClick: handleSync.bind(null, record),
// },
]
}

View File

@ -1,102 +0,0 @@
<template>
<a-spin :spinning="loading">
<BasicForm @register="registerForm">
<template #pwd="{ model, field }">
<a-row :gutter="8">
<a-input-password v-model:value="model[field]" placeholder="请输入密码" />
</a-row>
</template>
</BasicForm>
<div class="j-box-bottom-button offset-20" style="margin-top: 30px">
<div class="j-box-bottom-button-float" :class="[`${prefixCls}`]">
<a-button preIcon="ant-design:sync-outlined" @click="onReset">重置</a-button>
<a-button type="primary" preIcon="ant-design:save-filled" @click="onSubmit">保存</a-button>
</div>
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { watch, computed, inject, ref, unref, onMounted } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { getUser,saveUser } from '../depart.api';
import { tplinkUseFormSchema } from '../depart.data';
import { useDesign } from '/@/hooks/web/useDesign';
import { useMessage } from "@/hooks/web/useMessage";
const { createMessage } = useMessage();
const { prefixCls } = useDesign('j-depart-form-content');
const emit = defineEmits(['success']);
const props = defineProps({
data: { type: Object, default: () => ({}) },
rootTreeData: { type: Array, default: () => [] },
});
const loading = ref<boolean>(false);
//
const model = ref<object>({});
//
const [registerForm, { resetFields, setFieldsValue, validateFields, getFieldsValue, validate, updateSchema }] = useForm({
schemas: tplinkUseFormSchema,
showActionButtonGroup: false,
});
onMounted(() => {
// data
watch(
() => props.data,
async () => {
let record = unref(props.data);
if (typeof record !== 'object') {
record = {};
}
model.value = record;
await resetFields();
//
let data = await getUser({ orgCode : model.value.orgCode });
if(data == null){
data = {};
data.orgCode = record.orgCode;
}
await setFieldsValue({ ...data });
},
{ deep: true, immediate: true }
);
});
//
async function onReset() {
await resetFields();
await setFieldsValue({ ...model.value });
}
//
async function onSubmit() {
try {
loading.value = true;
let values = await validate();
values = Object.assign({}, model.value, values);
//
await saveUser(values);
let data = await getUser({ orgCode : values.orgCode });
//
emit('success');
Object.assign(model.value, data);
} finally {
loading.value = false;
}
}
</script>
<style lang="less">
// update-begin-author:liusq date:20230625 for: [issues/563]
@prefix-cls: ~'@{namespace}-j-depart-form-content';
/*begin 兼容暗夜模式*/
.@{prefix-cls} {
background: @component-background;
border-top: 1px solid @border-color-base;
}
/*end 兼容暗夜模式*/
// update-end-author:liusq date:20230625 for: [issues/563]
</style>

View File

@ -24,9 +24,6 @@ export enum Api {
getUpdateDepartInfo = '/sys/user/getUpdateDepartInfo',
doUpdateDepartInfo = '/sys/user/doUpdateDepartInfo',
changeDepartChargePerson = '/sys/user/changeDepartChargePerson',
getUser = '/iot/tplink/getUser',
saveUser = '/iot/tplink/saveUser',
}
/**
@ -123,11 +120,3 @@ export const deleteDepart = (id) => defHttp.delete({ url: Api.delete, params:{ i
* @param params
*/
export const changeDepartChargePerson = (params) => defHttp.put({ url: Api.changeDepartChargePerson, params });
/**
*
*/
export const saveUser = (params) => defHttp.post({ url: Api.saveUser, params });
/**
*
*/
export const getUser = (params?) => defHttp.get({ url: Api.getUser, params });

View File

@ -226,98 +226,3 @@ export const orgCategoryOptions = {
child: [{ value: '2', label: '部门' }],
};
export const tplinkUseFormSchema: FormSchema[] = [
{
field: 'id',
label: 'id',
component: 'Input',
show: false,
},
{
field: 'orgCode',
label: '所属机构',
component: 'Input',
required: true,
dynamicDisabled: true,
},
{
field: 'tumsProjectId',
label: '所属项目ID',
component: 'Input',
required: true,
show: false,
},
{
field: 'tumsProjectName',
label: '所属项目',
component: 'Input',
required: true,
dynamicDisabled: true,
},
{
field: 'tumsUsername',
label: '用户名',
component: 'Input',
required: true,
},
{
field: 'tumsPassword',
label: '密码',
required: true,
component: 'StrengthMeter',
rules: [
{
required: true,
message: '请输入登录密码',
},
{
pattern:
/^(?!.*(.)\1{2})(?=(?:.*[0-9].*[A-Z])|(?:.*[0-9].*[a-z])|(?:.*[0-9].*[~!@#$%^&*()_+={[}\]|\\:;'"<,>.?/ -])|(?:.*[A-Z].*[a-z])|(?:.*[A-Z].*[~!@#$%^&*()_+={[}\]|\\:;'"<,>.?/ -])|(?:.*[a-z].*[~!@#$%^&*()_+={[}\]|\\:;'"<,>.?/ -]))[0-9A-Za-z~!@#$%^&*()_+={[}\]|\\:;'"<,>.?/ -]{8,64}$/,
message: '密码由8位数字、大小写字母和特殊符号组成!',
},
],
// dynamicDisabled: ({ values }) => {
// return !!values.id;
// },
},
{
field: 'tumsRoleId',
label: '角色',
required: true,
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择类型',
options: [
{ label: '超级管理员', value: '1' },
{ label: '项目管理员', value: '2' },
{ label: '项目查看员', value: '3' },
{ label: '视频监控员', value: '4' },
],
},
},
{
field: 'ftpIp',
label: 'FTP地址',
component: 'Input',
},
{
field: 'ftpPort',
label: 'FTP端口',
component: 'Input',
},
{
field: 'ftpUsername',
label: 'FTP用户',
component: 'Input',
},
{
field: 'ftpPassword',
label: 'FTP密码',
component: 'InputPassword',
},
{
field: 'ftpUploadpath',
label: 'FTP上传路径',
component: 'Input',
},
];

View File

@ -21,11 +21,6 @@
<DataSourceTab :data="departData" />
</div>
</a-tab-pane>
<a-tab-pane tab="TPLINK用户" key="tplink-user-info">
<div style="padding: 0 20px 20px">
<TplinkUserTab :data="departData" />
</div>
</a-tab-pane>
</a-tabs>
<div v-show="departData == null" style="padding-top: 40px">
<a-empty description="尚未选择机构" />
@ -42,7 +37,6 @@
import DepartFormTab from './components/DepartFormTab.vue';
import DepartRuleTab from './components/DepartRuleTab.vue';
import DataSourceTab from './components/DataSourceTab.vue';
import TplinkUserTab from './components/TplinkUserTab.vue';
const { prefixCls } = useDesign('depart-manage');
provide('prefixCls', prefixCls);