Merge branch 'master' of http://47.115.223.229:8888/yangjun/hldy_yunwei_vue
This commit is contained in:
commit
33c1c9da9e
|
@ -7,6 +7,7 @@ enum Api {
|
||||||
syncRegion = '/iot/tplink/regionInfo/sync',
|
syncRegion = '/iot/tplink/regionInfo/sync',
|
||||||
list = '/iot/tplink/cameraInfo/list',
|
list = '/iot/tplink/cameraInfo/list',
|
||||||
syncProjectIpcDevice = '/iot/tplink/cameraInfo/syncProjectIpcDevice',
|
syncProjectIpcDevice = '/iot/tplink/cameraInfo/syncProjectIpcDevice',
|
||||||
|
syncAllDevices = '/iot/tplink/cameraInfo/syncAllDevices',
|
||||||
ipcCapability = '/iot/tplink/cameraInfo/getIpcCapability',
|
ipcCapability = '/iot/tplink/cameraInfo/getIpcCapability',
|
||||||
nuList = '/iot/tplink/cameraInfo/nuList',
|
nuList = '/iot/tplink/cameraInfo/nuList',
|
||||||
edit = '/iot/tplink/cameraInfo/edit',
|
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 });
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步此项目下的IPC设备
|
* 同步此项目下的IPC设备
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const syncProjectIpcDevice = (params) => defHttp.get({ url: Api.syncProjectIpcDevice, params });
|
export const syncProjectIpcDevice = (params) => defHttp.get({ url: Api.syncProjectIpcDevice, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有摄像头设备
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const syncAllDevices = (params) => defHttp.get({ url: Api.syncAllDevices, params });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取IPC能力集
|
* 获取IPC能力集
|
||||||
* @param params
|
* @param params
|
||||||
|
|
|
@ -24,46 +24,71 @@ export const columns: BasicColumn[] = [
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'deviceModel'
|
dataIndex: 'deviceModel'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: 'IP地址',
|
// title: 'IP地址',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'ip'
|
// dataIndex: 'ip'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: 'MAC地址',
|
// title: 'MAC地址',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'mac'
|
// dataIndex: 'mac'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '区域名称',
|
// title: '区域名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'regionName'
|
// dataIndex: 'regionName'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '父设备名称',
|
// title: '父设备名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'parentDeviceName'
|
// dataIndex: 'parentDeviceName'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '项目名称',
|
// title: '项目名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'projectName'
|
// dataIndex: 'projectName'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '位置名称',
|
// title: '位置名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'locationName'
|
// dataIndex: 'locationName'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '护理单元',
|
// title: '护理单元',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuId_dictText',
|
// dataIndex: 'nuId_dictText',
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// title: '护理单元',
|
// title: '护理单元',
|
||||||
// align: "center",
|
// align: "center",
|
||||||
// dataIndex: 'nuName'
|
// 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[] = [
|
export const formSchema: FormSchema[] = [
|
||||||
|
@ -103,63 +128,82 @@ export const formSchema: FormSchema[] = [
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
dynamicDisabled: true
|
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地址',
|
label: 'FTP地址',
|
||||||
field: 'ip',
|
field: 'ftpIp',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
dynamicDisabled: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'MAC地址',
|
label: 'FTP端口',
|
||||||
field: 'mac',
|
field: 'ftpPort',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
dynamicDisabled: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '区域名称',
|
label: 'FTP用户',
|
||||||
field: 'regionName',
|
field: 'ftpUsername',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
dynamicDisabled: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '父设备名称',
|
label: 'FTP密码',
|
||||||
field: 'parentDeviceName',
|
field: 'ftpPassword',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
dynamicDisabled: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '项目ID',
|
label: 'FTP上传路径',
|
||||||
field: 'projectId',
|
field: 'ftpUploadpath',
|
||||||
component: 'Input',
|
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',
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ import {ref, onMounted, reactive, onUnmounted} from "vue";
|
||||||
// getBatchProgress({}).then(res=>{});
|
// getBatchProgress({}).then(res=>{});
|
||||||
// }
|
// }
|
||||||
|
|
||||||
onMounted(()=>{
|
/*onMounted(()=>{
|
||||||
console.log(router.currentRoute.value.query);
|
console.log(router.currentRoute.value.query);
|
||||||
formData.deviceIndex = router.currentRoute.value.query.deviceIndex;
|
formData.deviceIndex = router.currentRoute.value.query.deviceIndex;
|
||||||
formData.parentId = router.currentRoute.value.query.parentId;
|
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.scale = formData.scale;
|
||||||
cameraData.value.parentId = formData.parentId;
|
cameraData.value.parentId = formData.parentId;
|
||||||
console.log(cameraData);
|
console.log(cameraData);
|
||||||
})
|
})*/
|
||||||
// onUnmounted(()=>{
|
// 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>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
|
@ -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>
|
|
@ -1,3 +1,4 @@
|
||||||
|
<!--
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<a-row class="p-2" type="flex" :gutter="10">
|
<a-row class="p-2" type="flex" :gutter="10">
|
||||||
|
@ -44,3 +45,186 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</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>
|
||||||
|
|
|
@ -72,10 +72,10 @@
|
||||||
record = {};
|
record = {};
|
||||||
}
|
}
|
||||||
initModel.value = record;
|
initModel.value = record;
|
||||||
if(record.projectId!=''&&record.regionId!=''){
|
// if(record.projectId!=''&&record.regionId!=''){
|
||||||
await fetchStorageDev(record.projectId,record.regionId);
|
await fetchStorageDev(record.projectId,record.regionId);
|
||||||
await fetchPlan();
|
await fetchPlan();
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
|
|
|
@ -65,9 +65,9 @@ import {defineExpose, nextTick, onMounted, ref, unref, watch} from 'vue';
|
||||||
|
|
||||||
// 加载顶级区域信息
|
// 加载顶级区域信息
|
||||||
async function loadRootTreeData() {
|
async function loadRootTreeData() {
|
||||||
if(model.value.projectId==''&&model.value.regionId==''){
|
/* if(model.value.projectId==''&&model.value.regionId==''){
|
||||||
return ;
|
return ;
|
||||||
}
|
}*/
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
treeData.value = [];
|
treeData.value = [];
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<!--
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<a-row class="p-2" type="flex" :gutter="10">
|
<a-row class="p-2" type="flex" :gutter="10">
|
||||||
|
@ -44,3 +45,181 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</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>
|
||||||
|
|
|
@ -3,27 +3,27 @@ import {FormSchema} from '/@/components/Table';
|
||||||
|
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
// {
|
||||||
title: '单元编码',
|
// title: '单元编码',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuId'
|
// dataIndex: 'nuId'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '单元名称',
|
// title: '单元名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuName'
|
// dataIndex: 'nuName'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '设备号',
|
title: '设备号',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'address'
|
dataIndex: 'address'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '机构名称',
|
// title: '机构名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'departName',
|
// dataIndex: 'departName',
|
||||||
width: 220,
|
// width: 220,
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// title: '采集器号',
|
// title: '采集器号',
|
||||||
// align: "center",
|
// align: "center",
|
||||||
|
@ -91,31 +91,31 @@ export const columns: BasicColumn[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
{
|
// {
|
||||||
label: '机构',
|
// label: '机构',
|
||||||
field: 'deviceStatus',
|
// field: 'deviceStatus',
|
||||||
component: 'JDictSelectTag',
|
// component: 'JDictSelectTag',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
placeholder: '请选择机构',
|
// placeholder: '请选择机构',
|
||||||
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
|
// dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
|
||||||
},
|
// },
|
||||||
colProps: { span: 6 },
|
// colProps: { span: 6 },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '护理单元',
|
// label: '护理单元',
|
||||||
field: 'deviceStatus',
|
// field: 'deviceStatus',
|
||||||
component: 'JDictSelectTag',
|
// component: 'JDictSelectTag',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
placeholder: '请选择护理单元',
|
// placeholder: '请选择护理单元',
|
||||||
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
||||||
},
|
// },
|
||||||
colProps: { span: 6 },
|
// colProps: { span: 6 },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: '设备号',
|
label: '设备号',
|
||||||
field: 'address',
|
field: 'address',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设备状态',
|
label: '设备状态',
|
||||||
|
@ -128,7 +128,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '拉闸', value: '0' },
|
{ label: '拉闸', value: '0' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '在线状态',
|
label: '在线状态',
|
||||||
|
@ -141,7 +141,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '离线', value: 'false' },
|
{ label: '离线', value: 'false' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '信号强度',
|
label: '信号强度',
|
||||||
|
@ -155,6 +155,6 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '低', value: '3' },
|
{ label: '低', value: '3' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
|
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
|
||||||
<ApiLogModal ref="apiLogModal"></ApiLogModal>
|
<ApiLogModal ref="apiLogModal"></ApiLogModal>
|
||||||
<ElectricitySyncLogListModal ref="syncLogModal"></ElectricitySyncLogListModal>
|
<!-- <ElectricitySyncLogListModal ref="syncLogModal"></ElectricitySyncLogListModal>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -63,12 +63,12 @@
|
||||||
|
|
||||||
import HldyUtilsModal from "@/views/utils/nuUtils/HldyUtilsModal.vue";
|
import HldyUtilsModal from "@/views/utils/nuUtils/HldyUtilsModal.vue";
|
||||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.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';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const apiLogModal = ref();
|
const apiLogModal = ref();
|
||||||
const syncLogModal = ref();
|
// const syncLogModal = ref();
|
||||||
const hldyUtilsModal = ref();
|
const hldyUtilsModal = ref();
|
||||||
//注册model
|
//注册model
|
||||||
const [registerModal, {openModal}] = useModal();
|
const [registerModal, {openModal}] = useModal();
|
||||||
|
@ -108,7 +108,7 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
//护理单元回调
|
//护理单元回调
|
||||||
function handleHldyParams(params){
|
function handleHldyParams(params){
|
||||||
defHttp.post({
|
defHttp.post({
|
||||||
|
@ -120,10 +120,10 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//同步
|
//同步
|
||||||
function handleSync(record: Recordable){
|
// function handleSync(record: Recordable){
|
||||||
syncLogModal.value.disableSubmit = true;
|
// syncLogModal.value.disableSubmit = true;
|
||||||
syncLogModal.value.init(record);
|
// syncLogModal.value.init(record);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作栏
|
* 操作栏
|
||||||
|
@ -154,14 +154,13 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
label: '日志',
|
label: '日志',
|
||||||
onClick: showApiLog.bind(null, record),
|
onClick: showApiLog.bind(null, record),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: '同步',
|
// label: '同步',
|
||||||
onClick: handleSync.bind(null, record),
|
// onClick: handleSync.bind(null, record),
|
||||||
},
|
// },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 抄电表
|
// 抄电表
|
||||||
async function handleRead(record: Recordable) {
|
async function handleRead(record: Recordable) {
|
||||||
const params = {
|
const params = {
|
||||||
|
|
|
@ -148,10 +148,10 @@
|
||||||
label: '日志',
|
label: '日志',
|
||||||
onClick: showApiLog.bind(null, record),
|
onClick: showApiLog.bind(null, record),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: '同步',
|
// label: '同步',
|
||||||
onClick: handleSync.bind(null, record),
|
// onClick: handleSync.bind(null, record),
|
||||||
},
|
// },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,27 +3,27 @@ import {FormSchema} from '/@/components/Table';
|
||||||
|
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
// {
|
||||||
title: '单元编码',
|
// title: '单元编码',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuId'
|
// dataIndex: 'nuId'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '单元名称',
|
// title: '单元名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuName'
|
// dataIndex: 'nuName'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '设备号',
|
title: '设备号',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'address'
|
dataIndex: 'address'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '机构名称',
|
// title: '机构名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'departName',
|
// dataIndex: 'departName',
|
||||||
width: 220,
|
// width: 220,
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// title: '采集器号',
|
// title: '采集器号',
|
||||||
// align: "center",
|
// align: "center",
|
||||||
|
@ -99,31 +99,31 @@ export const columns: BasicColumn[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
{
|
// {
|
||||||
label: '机构',
|
// label: '机构',
|
||||||
field: 'deviceStatus',
|
// field: 'deviceStatus',
|
||||||
component: 'JDictSelectTag',
|
// component: 'JDictSelectTag',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
placeholder: '请选择机构',
|
// placeholder: '请选择机构',
|
||||||
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
|
// dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
|
||||||
},
|
// },
|
||||||
colProps: { span: 6 },
|
// colProps: { span: 6 },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '护理单元',
|
// label: '护理单元',
|
||||||
field: 'deviceStatus',
|
// field: 'deviceStatus',
|
||||||
component: 'JDictSelectTag',
|
// component: 'JDictSelectTag',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
placeholder: '请选择护理单元',
|
// placeholder: '请选择护理单元',
|
||||||
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
||||||
},
|
// },
|
||||||
colProps: { span: 6 },
|
// colProps: { span: 6 },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: '设备号',
|
label: '设备号',
|
||||||
field: 'address',
|
field: 'address',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设备状态',
|
label: '设备状态',
|
||||||
|
@ -136,7 +136,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '拉闸', value: '0' },
|
{ label: '拉闸', value: '0' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '在线状态',
|
label: '在线状态',
|
||||||
|
@ -149,7 +149,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '离线', value: 'false' },
|
{ label: '离线', value: 'false' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '信号强度',
|
label: '信号强度',
|
||||||
|
@ -163,6 +163,6 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '低', value: '3' },
|
{ label: '低', value: '3' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,16 +3,16 @@ import {FormSchema} from '/@/components/Table';
|
||||||
|
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
// {
|
||||||
title: '单元编码',
|
// title: '单元编码',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuId'
|
// dataIndex: 'nuId'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '单元名称',
|
// title: '单元名称',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'nuName'
|
// dataIndex: 'nuName'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '设备号',
|
title: '设备号',
|
||||||
align: "center",
|
align: "center",
|
||||||
|
@ -23,10 +23,26 @@ export const columns: BasicColumn[] = [
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'deviceName'
|
dataIndex: 'deviceName'
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '机构',
|
||||||
|
// align: "center",
|
||||||
|
// dataIndex: 'departName'
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '机构',
|
title: '在线状态',
|
||||||
align: "center",
|
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: '温度',
|
title: '温度',
|
||||||
|
@ -67,50 +83,35 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'electricity',
|
dataIndex: 'electricity',
|
||||||
defaultHidden: true,
|
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[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
{
|
// {
|
||||||
label: '机构',
|
// label: '机构',
|
||||||
field: 'deviceStatus',
|
// field: 'deviceStatus',
|
||||||
component: 'JDictSelectTag',
|
// component: 'JDictSelectTag',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
placeholder: '请选择机构',
|
// placeholder: '请选择机构',
|
||||||
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
|
// dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
|
||||||
},
|
// },
|
||||||
colProps: { span: 6 },
|
// colProps: { span: 6 },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '护理单元',
|
// label: '护理单元',
|
||||||
field: 'deviceStatus',
|
// field: 'deviceStatus',
|
||||||
component: 'JDictSelectTag',
|
// component: 'JDictSelectTag',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
placeholder: '请选择护理单元',
|
// placeholder: '请选择护理单元',
|
||||||
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
||||||
},
|
// },
|
||||||
colProps: { span: 6 },
|
// colProps: { span: 6 },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: '设备号',
|
label: '设备号',
|
||||||
field: 'sn',
|
field: 'sn',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '在线状态',
|
label: '在线状态',
|
||||||
|
@ -123,7 +124,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
{ label: '离线', value: '1' },
|
{ label: '离线', value: '1' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -138,10 +138,10 @@
|
||||||
onClick: handleApiLogAlarm.bind(null, record),
|
onClick: handleApiLogAlarm.bind(null, record),
|
||||||
ifShow: ()=>{ return record.delFlag == '0' }
|
ifShow: ()=>{ return record.delFlag == '0' }
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: '同步',
|
// label: '同步',
|
||||||
onClick: handleSync.bind(null, record),
|
// onClick: handleSync.bind(null, record),
|
||||||
},
|
// },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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>
|
|
|
@ -24,9 +24,6 @@ export enum Api {
|
||||||
getUpdateDepartInfo = '/sys/user/getUpdateDepartInfo',
|
getUpdateDepartInfo = '/sys/user/getUpdateDepartInfo',
|
||||||
doUpdateDepartInfo = '/sys/user/doUpdateDepartInfo',
|
doUpdateDepartInfo = '/sys/user/doUpdateDepartInfo',
|
||||||
changeDepartChargePerson = '/sys/user/changeDepartChargePerson',
|
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
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const changeDepartChargePerson = (params) => defHttp.put({ url: Api.changeDepartChargePerson, 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 });
|
|
||||||
|
|
|
@ -226,98 +226,3 @@ export const orgCategoryOptions = {
|
||||||
child: [{ value: '2', label: '部门' }],
|
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',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
|
@ -21,11 +21,6 @@
|
||||||
<DataSourceTab :data="departData" />
|
<DataSourceTab :data="departData" />
|
||||||
</div>
|
</div>
|
||||||
</a-tab-pane>
|
</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>
|
</a-tabs>
|
||||||
<div v-show="departData == null" style="padding-top: 40px">
|
<div v-show="departData == null" style="padding-top: 40px">
|
||||||
<a-empty description="尚未选择机构" />
|
<a-empty description="尚未选择机构" />
|
||||||
|
@ -42,7 +37,6 @@
|
||||||
import DepartFormTab from './components/DepartFormTab.vue';
|
import DepartFormTab from './components/DepartFormTab.vue';
|
||||||
import DepartRuleTab from './components/DepartRuleTab.vue';
|
import DepartRuleTab from './components/DepartRuleTab.vue';
|
||||||
import DataSourceTab from './components/DataSourceTab.vue';
|
import DataSourceTab from './components/DataSourceTab.vue';
|
||||||
import TplinkUserTab from './components/TplinkUserTab.vue';
|
|
||||||
|
|
||||||
const { prefixCls } = useDesign('depart-manage');
|
const { prefixCls } = useDesign('depart-manage');
|
||||||
provide('prefixCls', prefixCls);
|
provide('prefixCls', prefixCls);
|
||||||
|
|
Loading…
Reference in New Issue