Browse Source

1、添加视频智能监控模型表单 查询部分

2、将项目中相机、站点等选择树替换为限制场景的数据
master
Fuyuu 9 months ago
parent
commit
23e2c08741
  1. 49
      src/views/military/modules/ai/aiModel/DtAiModelList.vue
  2. 1
      src/views/military/modules/ai/cameraLinkage/DtCameraLinkageList.vue
  3. 34
      src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/DtCameraLinkgeSubInfo.data.ts
  4. 143
      src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/components/DtCameraLinkgeSubInfoForm.vue
  5. 119
      src/views/military/modules/ai/cameraLinkage/components/DtCameraLinkageModal.vue
  6. 12
      src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue
  7. 2
      src/views/military/modules/earthMap/camera/MsCameraSite.data.ts
  8. 94
      src/views/military/modules/equipmentManage/dataProtocol/DtDeviceDataProtocol.data.ts
  9. 54
      src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolForm.vue
  10. 44
      src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolModal.vue
  11. 426
      src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts
  12. 86
      src/views/military/modules/equipmentManage/netProtocol/DtDeviceNetProtocol.data.ts
  13. 27
      src/views/military/modules/equipmentManage/videoMonitorEquInfo/cameraManage/CameraSetDemo.vue

49
src/views/military/modules/ai/aiModel/DtAiModelList.vue

@ -9,7 +9,26 @@
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24"> </a-row>
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item label="模型编号" name="modelCode">
<JInput placeholder="请输入模型编号" v-model:value="queryParam.modelCode"></JInput>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item label="模型名称" name="modelName">
<JInput placeholder="请输入模型名称" v-model:value="queryParam.modelName"></JInput>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left" 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>
<!--引用表格-->
@ -64,7 +83,7 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DtAiModel.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import DtAiModelModal from './components/DtAiModelModal.vue';
import { JInput } from '/@/components/Form';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
@ -160,6 +179,10 @@
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
@ -168,17 +191,17 @@
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
},
// {
// label: '',
// onClick: handleDetail.bind(null, record),
// },
// {
// label: '',
// popConfirm: {
// title: '',
// confirm: handleDelete.bind(null, record),
// },
// },
];
}

1
src/views/military/modules/ai/cameraLinkage/DtCameraLinkageList.vue

@ -89,7 +89,6 @@
canResize: false,
showTableSetting: true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: false,

34
src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/DtCameraLinkgeSubInfo.data.ts

@ -7,45 +7,45 @@ import { log } from 'console';
export const columns: BasicColumn[] = [
{
title: '相机名称',
align: "center",
dataIndex: 'cameraId_dictText'
align: 'center',
dataIndex: 'cameraId_dictText',
width: 190,
},
{
title: '联动类型',
align: "center",
align: 'center',
dataIndex: 'linkageType_dictText',
width: 120
width: 90,
},
{
title: '执行序号',
align: "center",
align: 'center',
dataIndex: 'linkageNo',
sorter: true,
width: 100
width: 100,
},
{
title: 'PTZ值',
align: "center",
align: 'center',
dataIndex: 'ptz',
customRender: ({ text }) => {
console.log(text.length);
return text.length == 2 ? '无PTZ值' : text;
},
},
{
title: '预置位',
align: "center",
align: 'center',
dataIndex: 'placements',
customRender: ({ text }) => {
console.log(text.length);
return text.length == 0 ? '无预置位' : text;
},
},
{
title: '停留时间/秒(s)',
align: "center",
dataIndex: 'sleepNumber'
}
align: 'center',
dataIndex: 'sleepNumber',
width: 130,
},
// ,{
// title: '备用1',
// align: "center",
@ -75,11 +75,11 @@ export const columns: BasicColumn[] = [
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "联动编号",
label: '联动编号',
field: 'linkageCode',
component: 'JInput',
colProps: { span: 6 }
}
colProps: { span: 6 },
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -148,6 +148,6 @@ export const formSchema: FormSchema[] = [
label: '',
field: 'id',
component: 'Input',
show: false
show: false,
},
];

143
src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/components/DtCameraLinkgeSubInfoForm.vue

@ -9,8 +9,7 @@
</a-col>
<a-col :span="12">
<a-form-item label="相机名称" v-bind="validateInfos.cameraId">
<!-- <a-input v-model:value="formData.cameraId" placeholder="请输入相机编号" :disabled="disabled"></a-input> -->
<a-tree-select v-model:value="formData.cameraId" allow-clear :treeData="cameraList" :disabled="disabled" placeholder="请选择联动相机">
<a-tree-select v-model:value="formData.cameraId" allow-clear :treeData="nodeTree" :disabled="disabled" placeholder="请选择联动相机">
</a-tree-select>
</a-form-item>
</a-col>
@ -21,7 +20,6 @@
</a-col>
<a-col :span="12">
<a-form-item label="联动类型" v-bind="validateInfos.linkageType">
<!-- <a-input-number v-model:value="formData.sensorStatus" placeholder="请输入状态" style="width: 100%" :disabled="disabled"/> -->
<j-dict-select-tag
v-model:value="formData.linkageType"
dictCode="dt_linkage_type"
@ -33,8 +31,6 @@
</a-col>
<a-col :span="12" v-if="formData.linkageType == 1">
<a-form-item label="PTZ值" v-bind="validateInfos.ptz">
<!-- <a-input v-model:value="formData.ptz" placeholder="请输入PTZ值" style="width: 100%"
:disabled="disabled"></a-input> -->
<a-button type="dashed" style="width: 50%; margin-bottom: 16px" @click="addPTZInput()" v-show="!formDisabled">
<a-icon type="plus" />
添加
@ -56,8 +52,6 @@
</a-col>
<a-col :span="12" v-if="formData.linkageType == 2">
<a-form-item label="预置位" v-bind="validateInfos.placements">
<!-- <a-input-number v-model:value="formData.placements" placeholder="请输入预置位" style="width: 100%"
:disabled="disabled" /> -->
<a-select
mode="tags"
v-model:value="formData.placements"
@ -105,14 +99,102 @@
import { saveOrUpdate } from '../DtCameraLinkgeSubInfo.api';
import { Form } from 'ant-design-vue';
import { MinusCircleOutlined } from '@ant-design/icons-vue';
import { useUserStore } from '/@/store/modules/user';
//
const cameraList: any = ref([]);
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => {} },
formBpm: { type: Boolean, default: true },
});
//
const userStore = useUserStore().userInfo;
// id
const sceneId = userStore?.sceneId;
/* 添加内容 */
//
const sceneList: any = [];
//
const areaList: any = [];
//
const stationList: any = [];
//
const newCameraList: any = [];
//
function getCurrentScene() {
return defHttp.get(
{ url: '/military/msMapScene/list', params: { sceneId: sceneId + '*', pageNo: 1, pageSize: 9999 } },
{ isTransformResponse: false }
);
}
//
function getCurrentSceneArea() {
return defHttp.get({ url: '/military/msMapLine/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false });
}
//
function getCurrentAreaStation() {
return defHttp.get({ url: '/military/camera/site/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false });
}
//
function getCurrentStationCamera() {
return defHttp.get({ url: '/military/camera/setting/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false });
}
//
const nodeTree: any = ref([]);
//
function getNodeTree() {
//
getCurrentScene().then((res) => {
sceneList.value = res.result.records;
getCurrentSceneArea().then((res1) => {
areaList.value = res1.result.records;
getCurrentAreaStation().then((res2) => {
stationList.value = res2.result.records;
getCurrentStationCamera().then((res3) => {
newCameraList.value = res3.result.records;
//
const tree: any = [];
//
sceneList.value.forEach((row) => {
const node = { title: row.sceneName, value: row.sceneId, children: [] };
tree.push(node);
});
//
areaList.value.forEach((row) => {
const parentNode = tree.find((node) => node.value === row.sceneId);
if (parentNode) {
const node = { title: row.name, value: row.id, children: [] };
parentNode.children.push(node);
}
});
//
stationList.value.forEach((row) => {
const parentNodes = tree.map((node) => node.children).flat();
const parentNode = parentNodes.find((node) => node.value === row.lineId);
if (parentNode) {
const node = { title: row.sitename, value: row.id, children: [] };
parentNode.children.push(node);
}
});
//
newCameraList.value.forEach((row) => {
//
const parentNodes = tree.flatMap((node) => node.children).flatMap((node) => node.children);
const parentNode = parentNodes.find((node) => node.value === row.siteId);
if (parentNode) {
const node = { title: row.cameraName, value: row.id, children: null };
parentNode.children.push(node);
}
});
// ant tree-select
nodeTree.value = handleCameraTree(tree);
});
});
});
});
}
/* 添加内容 */
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
@ -139,54 +221,32 @@
linkageType: [{ required: true, message: '请选择联动类型!' }],
linkageNo: [{ required: true, message: '请输入执行序号!' }],
sleepNumber: [{ required: true, message: '请设置停留时间!' }],
// ptz: [{ required: true, message: 'PTZ!' }],
// placements: [{ required: true, message: '!' }]
};
onMounted(() => {
setSelectList();
//
getNodeTree();
});
function setSelectList() {
defHttp
.get(
{
url: '/military/camera/site/getSiteCameraInfo',
params: { pageNo: 1, pageSize: 9999 },
},
{ isTransformResponse: false }
)
// getAction(this.url.queryCameraSelectList, {pageNo: 1, pageSize: 9999})
.then((res) => {
if (res.success) {
console.log(res.result);
cameraList.value = handleCameraTree(res.result);
}
});
}
//
function handleCameraTree(data, index = undefined) {
let arr: any = [];
for (let i = 0; i < data.length; i++) {
let obj: any = {};
let item = data[i];
obj.title = item.name;
obj.value = obj.key = item.id;
// obj.selectable = false;
obj.title = item.title;
obj.value = obj.key = item.value;
obj.disabled = item.children?.length >= 0 ? true : false;
if (item.children && item.children.length > 0) {
obj.children = [];
// obj.key = i + 1;
let indexValue: any = index ? index + '-' + (i + 1) : i + 1;
obj.children = handleCameraTree(item.children, indexValue);
} else {
// obj.key = index !== undefined ? index + '-' + (i + 1) : (i + 1) + '';
// let tmp = (obj.key + '').split('-').length;
// obj.selectable = tmp >= 3;
}
// obj.key = index !== undefined ? index + '-' + (i + 1) : (i + 1) + '';
arr.push(obj);
}
return arr;
}
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
// PTZ
function addPTZInput(P: any = null, T = null, Z = null) {
formData.ptz.push({
P: P,
@ -194,12 +254,14 @@
Z: Z,
});
}
// PTZ
const removePTZInput = (item: any) => {
let index = formData.ptz.indexOf(item);
if (index !== -1) {
formData.ptz.splice(index, 1);
}
};
// PTZ
function init(record: any = null) {
if (!record.ptz) return [];
let arr = JSON.parse(record.ptz);
@ -211,7 +273,6 @@
arr['Z'] = parseFloat(element[2]);
name.push(arr);
});
// names.value = name
return name;
}
//
@ -233,7 +294,6 @@
if (!val) {
formData.placements = [];
} else {
// console.log("formData.placements", formData.placements);
if (!Array.isArray(formData.placements)) {
let temp = formData.placements.split(',');
temp = temp.filter((item) => {
@ -262,8 +322,6 @@
nextTick(() => {
resetFields();
//
// console.log(record);
// console.log(formData);
if (record.id) {
record.ptz = init(record);
}
@ -315,7 +373,6 @@
if (a.includes(NaN) || a.includes(null)) {
throw Error();
}
// console.log(a);
arr.push(a);
});
model.ptz = JSON.stringify(arr);

119
src/views/military/modules/ai/cameraLinkage/components/DtCameraLinkageModal.vue

@ -4,48 +4,56 @@
<!-- 子表单区域 -->
<a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs" v-show="false">
<a-tab-pane tab="相机联动配置子表" key="dtCameraLinkageSub" :forceRender="true">
<JVxeTable keep-source resizable ref="dtCameraLinkageSub" :loading="dtCameraLinkageSubTable.loading"
:columns="dtCameraLinkageSubTable.columns" :dataSource="dtCameraLinkageSubTable.dataSource" :height="340"
:disabled="formDisabled" :rowNumber="true" :rowSelection="true" :toolbar="true" />
<JVxeTable
keep-source
resizable
ref="dtCameraLinkageSub"
:loading="dtCameraLinkageSubTable.loading"
:columns="dtCameraLinkageSubTable.columns"
:dataSource="dtCameraLinkageSubTable.dataSource"
:height="340"
:disabled="formDisabled"
:rowNumber="true"
:rowSelection="true"
:toolbar="true"
/>
</a-tab-pane>
</a-tabs>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
import { formSchema, dtCameraLinkageSubJVxeColumns } from '../DtCameraLinkage.data';
import { saveOrUpdate, queryDtCameraLinkageSub } from '../DtCameraLinkage.api';
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts';
import { formSchema, dtCameraLinkageSubJVxeColumns } from '../DtCameraLinkage.data';
import { saveOrUpdate, queryDtCameraLinkageSub } from '../DtCameraLinkage.api';
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils';
// Emits
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const formDisabled = ref(false);
const refKeys = ref(['dtCameraLinkageSub',]);
const activeKey = ref('dtCameraLinkageSub');
const dtCameraLinkageSub = ref();
const tableRefs = { dtCameraLinkageSub, };
const dtCameraLinkageSubTable = reactive({
// Emits
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const formDisabled = ref(false);
const refKeys = ref(['dtCameraLinkageSub']);
const activeKey = ref('dtCameraLinkageSub');
const dtCameraLinkageSub = ref();
const tableRefs = { dtCameraLinkageSub };
const dtCameraLinkageSubTable = reactive({
loading: false,
dataSource: [],
columns: dtCameraLinkageSubJVxeColumns
})
//
const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
columns: dtCameraLinkageSubJVxeColumns,
});
//
const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 24 }
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
console.log(data.record);
baseColProps: { span: 24 },
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
//
await reset();
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
@ -56,31 +64,37 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
await setFieldsValue({
...data.record,
});
requestSubTableData(queryDtCameraLinkageSub, { id: data?.record?.id }, dtCameraLinkageSubTable)
requestSubTableData(queryDtCameraLinkageSub, { id: data?.record?.id }, dtCameraLinkageSubTable);
}
//
setProps({ disabled: !data?.showFooter })
});
//
const [handleChangeTabs, handleSubmit, requestSubTableData, formRef] = useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs, activeKey, refKeys);
setProps({ disabled: !data?.showFooter });
});
//
const [handleChangeTabs, handleSubmit, requestSubTableData, formRef] = useJvxeMethod(
requestAddOrEdit,
classifyIntoFormData,
tableRefs,
activeKey,
refKeys
);
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
async function reset() {
async function reset() {
await resetFields();
activeKey.value = 'dtCameraLinkageSub';
dtCameraLinkageSubTable.dataSource = [];
}
function classifyIntoFormData(allValues) {
let main = Object.assign({}, allValues.formValue)
}
function classifyIntoFormData(allValues) {
let main = Object.assign({}, allValues.formValue);
return {
...main, //
dtCameraLinkageSubList: allValues.tablesValue[0].tableData,
};
}
}
//
async function requestAddOrEdit(values) {
//
async function requestAddOrEdit(values) {
try {
setModalProps({ confirmLoading: true });
console.log(values);
@ -93,17 +107,16 @@ async function requestAddOrEdit(values) {
} finally {
setModalProps({ confirmLoading: false });
}
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%
}
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

12
src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue

@ -183,6 +183,10 @@
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
@ -203,10 +207,10 @@
// label: '',
// onClick: handleAreaTable.bind(null, record),
// },
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
// {
// label: '',
// onClick: handleDetail.bind(null, record),
// },
// {
// label: '',
// popConfirm: {

2
src/views/military/modules/earthMap/camera/MsCameraSite.data.ts

@ -19,7 +19,7 @@ export const columns: BasicColumn[] = [
dataIndex: 'sitecode',
},
{
title: '点名称',
title: '点名称',
align: "center",
dataIndex: 'sitename'
},

94
src/views/military/modules/equipmentManage/dataProtocol/DtDeviceDataProtocol.data.ts

@ -1,71 +1,75 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
/*
* @Author: Fuyuu 1805498209@qq.com
* @Date: 2023-12-20 15:41:22
* @LastEditors: Fuyuu 1805498209@qq.com
* @LastEditTime: 2023-12-28 16:29:13
* @FilePath: \dt-admin-pc-v2\src\views\military\modules\equipmentManage\protocolType\DtDeviceDataProtocol.data.ts
* @Description: ,`customMade`, koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '数据协议类型编号',
align:"center",
dataIndex: 'protocolType'
title: '类型编号',
align: 'center',
dataIndex: 'protocolType',
},
{
title: '协议名称',
align:"center",
dataIndex: 'protocolName'
align: 'center',
dataIndex: 'protocolName',
},
{
title: '备注',
align:"center",
dataIndex: 'remark'
},
{
title: '所属区域',
align:"center",
dataIndex: 'sysAreaCode'
align: 'center',
dataIndex: 'remark',
},
// {
// title: '所属区域',
// align: 'center',
// dataIndex: 'sysAreaCode',
// },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "数据协议类型编号",
label: '类型编号',
field: 'protocolType',
component: 'Input',
colProps: {span: 6},
colProps: { span: 6 },
},
{
label: "协议名称",
label: '协议名称',
field: 'protocolName',
component: 'Input',
colProps: {span: 6},
},
{
label: "所属区域",
field: 'sysAreaCode',
component: 'Input',
colProps: {span: 6},
colProps: { span: 6 },
},
// {
// label: '所属区域',
// field: 'sysAreaCode',
// component: 'Input',
// colProps: { span: 6 },
// },
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '数据协议类型编号',
label: '类型编号',
field: 'protocolType',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入数据协议类型编号!'},
];
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入类型编号!' }];
},
},
{
label: '协议名称',
field: 'protocolName',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入协议名称!'},
];
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入协议名称!' }];
},
},
{
@ -73,27 +77,25 @@ export const formSchema: FormSchema[] = [
field: 'remark',
component: 'Input',
},
{
label: '所属区域',
field: 'sysAreaCode',
component: 'Input',
},
// {
// label: '所属区域',
// field: 'sysAreaCode',
// component: 'Input',
// },
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
show: false,
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

54
src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolForm.vue

@ -1,39 +1,47 @@
<!--
* @Author: Fuyuu 1805498209@qq.com
* @Date: 2023-12-20 15:41:22
* @LastEditors: Fuyuu 1805498209@qq.com
* @LastEditTime: 2023-12-28 15:36:46
* @FilePath: \dt-admin-pc-v2\src\views\military\modules\equipmentManage\protocolType\components\DtDeviceDataProtocolForm.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<div style="width: 100%; text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { BasicForm, useForm } from '/@/components/Form/index';
import { computed, defineComponent } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../DtDeviceDataProtocol.data';
import {saveOrUpdate} from '../DtDeviceDataProtocol.api';
import { getBpmFormSchema } from '../DtDeviceDataProtocol.data';
import { saveOrUpdate } from '../DtDeviceDataProtocol.api';
export default defineComponent({
name: "DtDeviceDataProtocolForm",
components:{
BasicForm
name: 'DtDeviceDataProtocolForm',
components: {
BasicForm,
},
props:{
props: {
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
setup(props) {
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 12}
baseColProps: { span: 12 },
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
const formDisabled = computed(() => {
if (props.formData.disabled === false) {
return false;
}
return true;
@ -41,21 +49,21 @@
let formData = {};
const queryByIdUrl = '/device/dtDeviceDataProtocol/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
async function initFormData() {
let params = { id: props.formData.dataId };
const data = await defHttp.get({ url: queryByIdUrl, params });
formData = { ...data };
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
await setProps({ disabled: formDisabled.value });
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
console.log('表单数据', params);
await saveOrUpdate(params, true);
}
initFormData();
@ -64,7 +72,7 @@
registerForm,
formDisabled,
submitForm,
}
}
};
},
});
</script>

44
src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolModal.vue

@ -1,30 +1,38 @@
<!--
* @Author: Fuyuu 1805498209@qq.com
* @Date: 2023-12-20 15:41:22
* @LastEditors: Fuyuu 1805498209@qq.com
* @LastEditTime: 2023-12-28 15:36:53
* @FilePath: \dt-admin-pc-v2\src\views\military\modules\equipmentManage\protocolType\components\DtDeviceDataProtocolModal.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="896" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../DtDeviceDataProtocol.data';
import {saveOrUpdate} from '../DtDeviceDataProtocol.api';
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../DtDeviceDataProtocol.data';
import { saveOrUpdate } from '../DtDeviceDataProtocol.api';
// Emits
const emit = defineEmits(['register','success']);
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 12}
baseColProps: { span: 12 },
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
@ -33,7 +41,7 @@
});
}
//
setProps({ disabled: !data?.showFooter })
setProps({ disabled: !data?.showFooter });
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
@ -41,7 +49,7 @@
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
setModalProps({ confirmLoading: true });
//
await saveOrUpdate(values, isUpdate.value);
//
@ -49,18 +57,18 @@
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
setModalProps({ confirmLoading: false });
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker){
width: 100%
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

426
src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts

@ -2,147 +2,231 @@ import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types';
import { useUserStore } from '/@/store/modules/user';
import { defHttp } from '/@/utils/http/axios';
import { ref } from 'vue';
// 获取当前权限下的场景id
const sceneId = useUserStore().userInfo?.sceneId;
// 场景列表
const sceneList: any = [];
// 防区列表
const areaList: any = [];
// 站点列表
const stationList: any = [];
// 树状相机数据
const nodeTree: any = ref([]);
// 获取当前场景及子场景信息
function getCurrentScene() {
return defHttp.get(
{ url: '/military/msMapScene/list', params: { sceneId: sceneId + '*', pageNo: 1, pageSize: 9999 } },
{ isTransformResponse: false }
);
}
// 获取当前场景(包括其子场景)下的所有防区
function getCurrentSceneArea() {
return defHttp.get({ url: '/military/msMapLine/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false });
}
// 获取当前防区下的所有站点
function getCurrentAreaStation() {
return defHttp.get({ url: '/military/camera/site/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false });
}
// 处理相机树状数据
function handleCameraTree(data, index = undefined) {
let arr: any = [];
for (let i = 0; i < data.length; i++) {
let obj: any = {};
let item = data[i];
obj.label = item.title;
obj.value = obj.key = item.value;
obj.disabled = item.children?.length >= 0 ? true : false;
if (item.children && item.children.length > 0) {
obj.children = handleCameraTree(item.children);
}
arr.push(obj);
}
return arr;
}
// 将数据转化为树状结构
getCurrentScene().then((res) => {
sceneList.value = res.result.records;
getCurrentSceneArea().then((res1) => {
areaList.value = res1.result.records;
getCurrentAreaStation().then((res2) => {
stationList.value = res2.result.records;
// 定义一个空数组作为树状数组的根节点
const tree: any = [];
//遍历场景列表,查找当前场景(及子场景)数据
sceneList.value.forEach((row) => {
const node = { title: row.sceneName, value: row.sceneId, children: [] };
tree.push(node);
});
// 遍历防区列表,查找对应场景下的数据
areaList.value.forEach((row) => {
const parentNode = tree.find((node) => node.value === row.sceneId);
if (parentNode) {
const node = { title: row.name, value: row.id, children: [] };
parentNode.children.push(node);
}
});
// 遍历站点列表,查找对应防区下的数据
stationList.value.forEach((row) => {
const parentNodes = tree.map((node) => node.children).flat();
const parentNode = parentNodes.find((node) => node.value === row.lineId);
if (parentNode) {
const node = { title: row.sitename, value: row.id, children: null };
parentNode.children.push(node);
}
});
// 转化为ant tree-select结构
nodeTree.value = handleCameraTree(tree);
});
});
});
//列表数据
export const columns: BasicColumn[] = [
{
title: '所属站点',
align: "center",
dataIndex: 'deviceOwnerId_dictText'
align: 'center',
dataIndex: 'deviceOwnerId_dictText',
},
{
title: '类型',
align: "center",
title: '设备类型',
align: 'center',
dataIndex: 'deviceType_dictText',
width: 120
width: 120,
},
{
title: '设备编码',
align: "center",
align: 'center',
dataIndex: 'deviceCode',
width: 120
width: 120,
},
{
title: '名称',
align: "center",
dataIndex: 'deviceName'
title: '设备名称',
align: 'center',
dataIndex: 'deviceName',
},
{
title: '位置',
align: "center",
dataIndex: 'devicePosition'
title: '部署位置',
align: 'center',
dataIndex: 'devicePosition',
},
{
title: '经度',
align: "center",
dataIndex: 'deviceLon'
align: 'center',
dataIndex: 'deviceLon',
},
{
title: '纬度',
align: "center",
dataIndex: 'deviceLat'
align: 'center',
dataIndex: 'deviceLat',
},
{
title: '海拔',
align: "center",
dataIndex: 'deviceAlt'
align: 'center',
dataIndex: 'deviceAlt',
},
{
title: '设备状态',
align: "center",
align: 'center',
dataIndex: 'deviceStatus_dictText',
width: 90
width: 90,
},
{
title: '访问路径',
align: "center",
dataIndex: 'deviceUrl'
align: 'center',
dataIndex: 'deviceUrl',
},
{
title: '网络协议',
align: "center",
dataIndex: 'netProtocol'
align: 'center',
dataIndex: 'netProtocol_dictText',
},
{
title:'数据协议',
align:"center",
dataIndex:"dataProtocol"
title: '数据协议',
align: 'center',
dataIndex: 'dataProtocol_dictText',
},
{
title: 'ip地址',
align: "center",
dataIndex: 'deviceIp'
align: 'center',
dataIndex: 'deviceIp',
},
{
title: '端口',
align: "center",
dataIndex: 'ipPort'
align: 'center',
dataIndex: 'ipPort',
},
{
title: '端口2',
align: "center",
dataIndex: 'ipPort2'
align: 'center',
dataIndex: 'ipPort2',
},
{
title: '入网许可证',
align: "center",
align: 'center',
dataIndex: 'isAudit_dictText',
width: 120
width: 120,
},
{
title: '用户名',
align: "center",
dataIndex: 'username'
align: 'center',
dataIndex: 'username',
},
{
title: '密码',
align: "center",
dataIndex: 'password'
align: 'center',
dataIndex: 'password',
},
{
title: '设备子类型',
align: "center",
dataIndex: 'subtype'
align: 'center',
dataIndex: 'subtype',
},
{
title: '安装高度',
align: "center",
dataIndex: 'deviceHeight'
align: 'center',
dataIndex: 'deviceHeight',
},
{
title: '初始方位角',
align: "center",
dataIndex: 'initAzimuth'
align: 'center',
dataIndex: 'initAzimuth',
},
{
title: '初始俯仰角',
align: "center",
dataIndex: 'initPitch'
align: 'center',
dataIndex: 'initPitch',
},
{
title: '工作半径',
align: "center",
dataIndex: 'workingRadius'
align: 'center',
dataIndex: 'workingRadius',
},
{
title: '水平视场角度',
align: "center",
dataIndex: 'horizontalAngle'
align: 'center',
dataIndex: 'horizontalAngle',
},
{
title: '垂直视场角度',
align: "center",
dataIndex: 'verticalAngle'
align: 'center',
dataIndex: 'verticalAngle',
},
{
title: '识别刻度',
align: "center",
dataIndex: 'identificationScale'
align: 'center',
dataIndex: 'identificationScale',
},
{
title: '备注',
align: "center",
dataIndex: 'remark'
align: 'center',
dataIndex: 'remark',
},
// {
@ -154,32 +238,31 @@ export const columns: BasicColumn[] = [
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "所属站点",
label: '所属站点',
field: 'deviceOwnerId',
component: 'JDictSelectTag',
defaultValue: '00001-00001-00002',
component: 'TreeSelect',
componentProps: {
dictCode: "ms_map_scene,scene_name,scene_id"
treeData: nodeTree,
},
colProps: { span: 6 },
},
{
label: "设备类型",
label: '设备类型',
field: 'deviceType',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_deveice_type,type_name,type_no"
dictCode: 'dt_deveice_type,type_name,type_no',
},
colProps: { span: 6 },
},
{
label: "设备编码",
label: '设备编码',
field: 'deviceCode',
component: 'Input',
colProps: { span: 6 },
},
{
label: "设备名称",
label: '设备名称',
field: 'deviceName',
component: 'JInput',
colProps: { span: 6 },
@ -191,11 +274,11 @@ export const searchFormSchema: FormSchema[] = [
// colProps: {span: 6},
// },
{
label: "设备状态",
label: '设备状态',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_sensor_status"
dictCode: 'dt_sensor_status',
},
colProps: { span: 6 },
},
@ -212,81 +295,72 @@ export const searchFormSchema: FormSchema[] = [
// colProps: {span: 6},
// },
{
label: "数据协议",
label: '数据协议',
field: 'protocol',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_device_data_protocol,protocol_name,protocol_type"
dictCode: 'dt_device_data_protocol,protocol_name,protocol_type',
},
colProps: { span: 6 },
},
{
label: "网络协议",
label: '网络协议',
field: 'protocol',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_device_net_protocol,protocol_name,protocol_type"
dictCode: 'dt_device_net_protocol,protocol_name,protocol_type',
},
colProps: { span: 6 },
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '所属站点',
field: 'deviceOwnerId',
component: 'JDictSelectTag',
component: 'TreeSelect',
componentProps: {
dictCode: "ms_map_scene,scene_name,scene_id"
treeData: nodeTree,
},
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '所属站点不能为空!' },
];
return [{ required: true, message: '所属站点不能为空!' }];
},
},
{
label: '类型',
label: '设备类型',
field: 'deviceType',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_deveice_type,type_name,type_no",
stringToNumber: true
dictCode: 'dt_deveice_type,type_name,type_no',
stringToNumber: true,
},
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '类型不能为空!' },
];
return [{ required: true, message: '设备类型不能为空!' }];
},
},
{
label: '编码',
label: '设备编码',
field: 'deviceCode',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '编码不能为空!' },
];
return [{ required: true, message: '设备编码不能为空!' }];
},
},
{
label: '名称',
label: '设备名称',
field: 'deviceName',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '名称不能为空!' },
];
return [{ required: true, message: '设备名称不能为空!' }];
},
},
{
label: '位置',
label: '部署位置',
field: 'devicePosition',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '位置不能为空!' },
];
return [{ required: true, message: '部署位置不能为空!' }];
},
},
{
@ -294,9 +368,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceLon',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '经度不能为空!' },
];
return [{ required: true, message: '经度不能为空!' }];
},
},
{
@ -304,9 +376,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceLat',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '纬度不能为空!' },
];
return [{ required: true, message: '纬度不能为空!' }];
},
},
{
@ -314,9 +384,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceAlt',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '海拔不能为空!' },
];
return [{ required: true, message: '海拔不能为空!' }];
},
},
{
@ -324,13 +392,11 @@ export const formSchema: FormSchema[] = [
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_sensor_status",
stringToNumber: true
dictCode: 'dt_sensor_status',
stringToNumber: true,
},
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '设备状态不能为空!' },
];
return [{ required: true, message: '设备状态不能为空!' }];
},
},
{
@ -338,27 +404,21 @@ export const formSchema: FormSchema[] = [
field: 'netProtocol',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_device_net_protocol,protocol_name,protocol_type",
stringToNumber: true
dictCode: 'dt_device_net_protocol,protocol_name,protocol_type',
},
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '网络协议不能为空!' },
];
return [{ required: true, message: '网络协议不能为空!' }];
},
},
{
label: '数据协议',
field: 'dataProtocol',
component: 'JDictSelectTag',
componentProps:{
dictCode:"dt_device_data_protocol,protocol_name,protocol_type",
stringToNumber: true
componentProps: {
dictCode: 'dt_device_data_protocol,protocol_name,protocol_type',
},
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '数据协议不能为空!' },
];
return [{ required: true, message: '数据协议不能为空!' }];
},
},
{
@ -366,9 +426,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceUrl',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '访问路径不能为空!' },
];
return [{ required: true, message: '访问路径不能为空!' }];
},
},
{
@ -383,7 +441,7 @@ export const formSchema: FormSchema[] = [
{
pattern: /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/,
message: 'ip地址格式不正确!',
}
},
],
},
{
@ -398,7 +456,7 @@ export const formSchema: FormSchema[] = [
{
pattern: /^([1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
message: '端口格式不正确!',
}
},
],
},
{
@ -409,7 +467,7 @@ export const formSchema: FormSchema[] = [
{
pattern: /^([1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
message: '端口2格式不正确!',
}
},
],
},
{
@ -417,13 +475,11 @@ export const formSchema: FormSchema[] = [
field: 'isAudit',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_is_audit",
stringToNumber: true
dictCode: 'dt_is_audit',
stringToNumber: true,
},
dynamicRules: ({ model, schema }) => {
return [
{ required: true, message: '入网许可证不能为空!' },
];
return [{ required: true, message: '入网许可证不能为空!' }];
},
},
{
@ -492,7 +548,7 @@ export const formSchema: FormSchema[] = [
label: '',
field: 'id',
component: 'Input',
show: false
show: false,
},
];
//子表单数据
@ -505,53 +561,53 @@ export const dtDeviceSensorInfoColumns: BasicColumn[] = [
// },
{
title: '传感器名称',
align: "center",
dataIndex: 'sensorName'
align: 'center',
dataIndex: 'sensorName',
},
{
title: '传感器编号',
align: "center",
dataIndex: 'sensorCode'
align: 'center',
dataIndex: 'sensorCode',
},
{
title: '状态',
align: "center",
dataIndex: 'sensorStatus'
align: 'center',
dataIndex: 'sensorStatus',
},
{
title: '经度',
align: "center",
dataIndex: 'sensorLon'
align: 'center',
dataIndex: 'sensorLon',
},
{
title: '维度',
align: "center",
dataIndex: 'sensorLat'
align: 'center',
dataIndex: 'sensorLat',
},
{
title: '地址编号例如01',
align: "center",
dataIndex: 'sensorAddress'
align: 'center',
dataIndex: 'sensorAddress',
},
{
title: '寄存器地址编号',
align: "center",
dataIndex: 'portId'
align: 'center',
dataIndex: 'portId',
},
{
title: '值',
align: "center",
dataIndex: 'sdata'
align: 'center',
dataIndex: 'sdata',
},
{
title: '备注',
align: "center",
dataIndex: 'remark'
align: 'center',
dataIndex: 'remark',
},
{
title: '所属区域',
align: "center",
dataIndex: 'sysAreaCode'
align: 'center',
dataIndex: 'sysAreaCode',
},
];
//子表列表数据
@ -568,18 +624,18 @@ export const dtDeviceStatusColumns: BasicColumn[] = [
// },
{
title: '设备初始状态',
align: "center",
dataIndex: 'status'
align: 'center',
dataIndex: 'status',
},
{
title: '状态补充说明',
align: "center",
dataIndex: 'remark'
align: 'center',
dataIndex: 'remark',
},
{
title: '所属区域',
align: "center",
dataIndex: 'sysAreaCode'
align: 'center',
dataIndex: 'sysAreaCode',
},
];
//子表表格配置
@ -596,18 +652,16 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '传感器名称',
key: 'sensorName',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
validateRules: [
{ required: true, message: '${title}不能为空' },
],
validateRules: [{ required: true, message: '${title}不能为空' }],
},
{
title: '传感器编号',
key: 'sensorCode',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -615,7 +669,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '状态',
key: 'sensorStatus',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -623,7 +677,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '经度',
key: 'sensorLon',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -631,7 +685,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '维度',
key: 'sensorLat',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -639,7 +693,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '地址编号例如01',
key: 'sensorAddress',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -647,7 +701,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '寄存器地址编号',
key: 'portId',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -655,7 +709,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '值',
key: 'sdata',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -663,7 +717,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '备注',
key: 'remark',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -671,17 +725,17 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '所属区域',
key: 'sysAreaCode',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
]
];
export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [
{
title: '设备唯一标识',
key: 'deviceId',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -689,29 +743,25 @@ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [
title: '所属站点ID',
key: 'deviceOwnerId',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
validateRules: [
{ required: true, message: '${title}不能为空' },
],
validateRules: [{ required: true, message: '${title}不能为空' }],
},
{
title: '设备初始状态',
key: 'status',
type: JVxeTypes.inputNumber,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
validateRules: [
{ required: true, message: '${title}不能为空' },
],
validateRules: [{ required: true, message: '${title}不能为空' }],
},
{
title: '状态补充说明',
key: 'remark',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
@ -719,16 +769,16 @@ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [
title: '所属区域',
key: 'sysAreaCode',
type: JVxeTypes.input,
width: "200px",
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
},
]
];
/**
* formSchema
* @param param
*/
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;

86
src/views/military/modules/equipmentManage/netProtocol/DtDeviceNetProtocol.data.ts

@ -1,71 +1,67 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '网络协议类型编号',
align:"center",
dataIndex: 'protocolType'
title: '类型编号',
align: 'center',
dataIndex: 'protocolType',
},
{
title: '协议名称',
align:"center",
dataIndex: 'protocolName'
align: 'center',
dataIndex: 'protocolName',
},
{
title: '备注',
align:"center",
dataIndex: 'remark'
},
{
title: '所属区域',
align:"center",
dataIndex: 'sysAreaCode'
align: 'center',
dataIndex: 'remark',
},
// {
// title: '所属区域',
// align: 'center',
// dataIndex: 'sysAreaCode',
// },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "网络协议类型编号",
label: '类型编号',
field: 'protocolType',
component: 'Input',
colProps: {span: 6},
colProps: { span: 6 },
},
{
label: "协议名称",
label: '协议名称',
field: 'protocolName',
component: 'Input',
colProps: {span: 6},
},
{
label: "所属区域",
field: 'sysAreaCode',
component: 'Input',
colProps: {span: 6},
colProps: { span: 6 },
},
// {
// label: '所属区域',
// field: 'sysAreaCode',
// component: 'Input',
// colProps: { span: 6 },
// },
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '网络协议类型编号',
label: '类型编号',
field: 'protocolType',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入网络协议类型编号!'},
];
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入类型编号!' }];
},
},
{
label: '协议名称',
field: 'protocolName',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入协议名称!'},
];
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入协议名称!' }];
},
},
{
@ -73,27 +69,25 @@ export const formSchema: FormSchema[] = [
field: 'remark',
component: 'Input',
},
{
label: '所属区域',
field: 'sysAreaCode',
component: 'Input',
},
// {
// label: '所属区域',
// field: 'sysAreaCode',
// component: 'Input',
// },
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
show: false,
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

27
src/views/military/modules/equipmentManage/videoMonitorEquInfo/cameraManage/CameraSetDemo.vue

@ -8,7 +8,7 @@
<div style="background: #fff">
<p style="margin: 0; padding: 5px 20px; font-size: 20px">
相机列表
<a-icon type="sync" @click="reNew" ref="reNewBtn" />
<a-icon style="cursor: pointer" type="sync" @click="reNew" ref="reNewBtn" />
</p>
<div class="cameraBox">
<!--树形控件界面-->
@ -628,7 +628,6 @@
let user = cameraForm.value.user;
let password = cameraForm.value.password;
let height = cameraForm.value.height;
let videoRecorderId = cameraForm.value.videoRecorderId;
let type = cameraForm.value.type;
let factory = cameraForm.value.factory;
let leftAngle = cameraForm.value.leftAngle;
@ -750,8 +749,13 @@
//
if (res.success) {
createMessage.success(success_message);
//
if (!cameraForm.value.id) {
fromClear();
} else {
//
cameraForm.value = res.result;
}
//
getNodeTree();
} else {
@ -1034,23 +1038,10 @@
//
function reNew() {
reNewBtn.value.spin = true;
defHttp
.get(
{
url: url.value.getVMCameraInfo,
},
{ isTransformResponse: false }
)
.then((res) => {
if (res.success) {
createMessage.success('相机列表更新成功!');
} else {
createMessage.error(res.message);
}
//
getNodeTree();
getVideoRecorderArr();
reNewBtn.value.spin = false;
});
//
createMessage.success('刷新成功');
}
defineExpose({

Loading…
Cancel
Save