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"> <div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol"> <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> </a-form>
</div> </div>
<!--引用表格--> <!--引用表格-->
@ -64,7 +83,7 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DtAiModel.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DtAiModel.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import DtAiModelModal from './components/DtAiModelModal.vue'; import DtAiModelModal from './components/DtAiModelModal.vue';
import { JInput } from '/@/components/Form';
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
@ -160,6 +179,10 @@
label: '编辑', label: '编辑',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
}, },
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
]; ];
} }
@ -168,17 +191,17 @@
*/ */
function getDropDownAction(record) { function getDropDownAction(record) {
return [ return [
{ // {
label: '详情', // label: '',
onClick: handleDetail.bind(null, record), // onClick: handleDetail.bind(null, record),
}, // },
{ // {
label: '删除', // label: '',
popConfirm: { // popConfirm: {
title: '是否确认删除', // title: '',
confirm: handleDelete.bind(null, record), // confirm: handleDelete.bind(null, record),
}, // },
}, // },
]; ];
} }

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

@ -89,7 +89,6 @@
canResize: false, canResize: false,
showTableSetting: true, showTableSetting: true,
formConfig: { formConfig: {
//labelWidth: 120,
schemas: searchFormSchema, schemas: searchFormSchema,
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
showAdvancedButton: false, 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[] = [ export const columns: BasicColumn[] = [
{ {
title: '相机名称', title: '相机名称',
align: "center", align: 'center',
dataIndex: 'cameraId_dictText' dataIndex: 'cameraId_dictText',
width: 190,
}, },
{ {
title: '联动类型', title: '联动类型',
align: "center", align: 'center',
dataIndex: 'linkageType_dictText', dataIndex: 'linkageType_dictText',
width: 120 width: 90,
}, },
{ {
title: '执行序号', title: '执行序号',
align: "center", align: 'center',
dataIndex: 'linkageNo', dataIndex: 'linkageNo',
sorter: true, sorter: true,
width: 100 width: 100,
}, },
{ {
title: 'PTZ值', title: 'PTZ值',
align: "center", align: 'center',
dataIndex: 'ptz', dataIndex: 'ptz',
customRender: ({ text }) => { customRender: ({ text }) => {
console.log(text.length);
return text.length == 2 ? '无PTZ值' : text; return text.length == 2 ? '无PTZ值' : text;
}, },
}, },
{ {
title: '预置位', title: '预置位',
align: "center", align: 'center',
dataIndex: 'placements', dataIndex: 'placements',
customRender: ({ text }) => { customRender: ({ text }) => {
console.log(text.length);
return text.length == 0 ? '无预置位' : text; return text.length == 0 ? '无预置位' : text;
}, },
}, },
{ {
title: '停留时间/秒(s)', title: '停留时间/秒(s)',
align: "center", align: 'center',
dataIndex: 'sleepNumber' dataIndex: 'sleepNumber',
} width: 130,
},
// ,{ // ,{
// title: '备用1', // title: '备用1',
// align: "center", // align: "center",
@ -75,11 +75,11 @@ export const columns: BasicColumn[] = [
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
label: "联动编号", label: '联动编号',
field: 'linkageCode', field: 'linkageCode',
component: 'JInput', component: 'JInput',
colProps: { span: 6 } colProps: { span: 6 },
} },
]; ];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
@ -148,6 +148,6 @@ export const formSchema: FormSchema[] = [
label: '', label: '',
field: 'id', field: 'id',
component: 'Input', 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>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="相机名称" v-bind="validateInfos.cameraId"> <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="nodeTree" :disabled="disabled" placeholder="请选择联动相机">
<a-tree-select v-model:value="formData.cameraId" allow-clear :treeData="cameraList" :disabled="disabled" placeholder="请选择联动相机">
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -21,7 +20,6 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="联动类型" v-bind="validateInfos.linkageType"> <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 <j-dict-select-tag
v-model:value="formData.linkageType" v-model:value="formData.linkageType"
dictCode="dt_linkage_type" dictCode="dt_linkage_type"
@ -33,8 +31,6 @@
</a-col> </a-col>
<a-col :span="12" v-if="formData.linkageType == 1"> <a-col :span="12" v-if="formData.linkageType == 1">
<a-form-item label="PTZ值" v-bind="validateInfos.ptz"> <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-button type="dashed" style="width: 50%; margin-bottom: 16px" @click="addPTZInput()" v-show="!formDisabled">
<a-icon type="plus" /> <a-icon type="plus" />
添加 添加
@ -56,8 +52,6 @@
</a-col> </a-col>
<a-col :span="12" v-if="formData.linkageType == 2"> <a-col :span="12" v-if="formData.linkageType == 2">
<a-form-item label="预置位" v-bind="validateInfos.placements"> <a-form-item label="预置位" v-bind="validateInfos.placements">
<!-- <a-input-number v-model:value="formData.placements" placeholder="请输入预置位" style="width: 100%"
:disabled="disabled" /> -->
<a-select <a-select
mode="tags" mode="tags"
v-model:value="formData.placements" v-model:value="formData.placements"
@ -105,14 +99,102 @@
import { saveOrUpdate } from '../DtCameraLinkgeSubInfo.api'; import { saveOrUpdate } from '../DtCameraLinkgeSubInfo.api';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import { MinusCircleOutlined } from '@ant-design/icons-vue'; import { MinusCircleOutlined } from '@ant-design/icons-vue';
import { useUserStore } from '/@/store/modules/user';
//
const cameraList: any = ref([]);
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => {} }, formData: { type: Object, default: () => {} },
formBpm: { type: Boolean, default: true }, 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 formRef = ref();
const useForm = Form.useForm; const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']); const emit = defineEmits(['register', 'ok']);
@ -139,54 +221,32 @@
linkageType: [{ required: true, message: '请选择联动类型!' }], linkageType: [{ required: true, message: '请选择联动类型!' }],
linkageNo: [{ required: true, message: '请输入执行序号!' }], linkageNo: [{ required: true, message: '请输入执行序号!' }],
sleepNumber: [{ required: true, message: '请设置停留时间!' }], sleepNumber: [{ required: true, message: '请设置停留时间!' }],
// ptz: [{ required: true, message: 'PTZ!' }],
// placements: [{ required: true, message: '!' }]
}; };
onMounted(() => { 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) { function handleCameraTree(data, index = undefined) {
let arr: any = []; let arr: any = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let obj: any = {}; let obj: any = {};
let item = data[i]; let item = data[i];
obj.title = item.name; obj.title = item.title;
obj.value = obj.key = item.id; obj.value = obj.key = item.value;
// obj.selectable = false; obj.disabled = item.children?.length >= 0 ? true : false;
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
obj.children = []; obj.children = [];
// obj.key = i + 1;
let indexValue: any = index ? index + '-' + (i + 1) : i + 1; let indexValue: any = index ? index + '-' + (i + 1) : i + 1;
obj.children = handleCameraTree(item.children, indexValue); 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); arr.push(obj);
} }
return arr; return arr;
} }
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
// PTZ
function addPTZInput(P: any = null, T = null, Z = null) { function addPTZInput(P: any = null, T = null, Z = null) {
formData.ptz.push({ formData.ptz.push({
P: P, P: P,
@ -194,12 +254,14 @@
Z: Z, Z: Z,
}); });
} }
// PTZ
const removePTZInput = (item: any) => { const removePTZInput = (item: any) => {
let index = formData.ptz.indexOf(item); let index = formData.ptz.indexOf(item);
if (index !== -1) { if (index !== -1) {
formData.ptz.splice(index, 1); formData.ptz.splice(index, 1);
} }
}; };
// PTZ
function init(record: any = null) { function init(record: any = null) {
if (!record.ptz) return []; if (!record.ptz) return [];
let arr = JSON.parse(record.ptz); let arr = JSON.parse(record.ptz);
@ -211,7 +273,6 @@
arr['Z'] = parseFloat(element[2]); arr['Z'] = parseFloat(element[2]);
name.push(arr); name.push(arr);
}); });
// names.value = name
return name; return name;
} }
// //
@ -233,7 +294,6 @@
if (!val) { if (!val) {
formData.placements = []; formData.placements = [];
} else { } else {
// console.log("formData.placements", formData.placements);
if (!Array.isArray(formData.placements)) { if (!Array.isArray(formData.placements)) {
let temp = formData.placements.split(','); let temp = formData.placements.split(',');
temp = temp.filter((item) => { temp = temp.filter((item) => {
@ -262,8 +322,6 @@
nextTick(() => { nextTick(() => {
resetFields(); resetFields();
// //
// console.log(record);
// console.log(formData);
if (record.id) { if (record.id) {
record.ptz = init(record); record.ptz = init(record);
} }
@ -315,7 +373,6 @@
if (a.includes(NaN) || a.includes(null)) { if (a.includes(NaN) || a.includes(null)) {
throw Error(); throw Error();
} }
// console.log(a);
arr.push(a); arr.push(a);
}); });
model.ptz = JSON.stringify(arr); 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-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs" v-show="false">
<a-tab-pane tab="相机联动配置子表" key="dtCameraLinkageSub" :forceRender="true"> <a-tab-pane tab="相机联动配置子表" key="dtCameraLinkageSub" :forceRender="true">
<JVxeTable keep-source resizable ref="dtCameraLinkageSub" :loading="dtCameraLinkageSubTable.loading" <JVxeTable
:columns="dtCameraLinkageSubTable.columns" :dataSource="dtCameraLinkageSubTable.dataSource" :height="340" keep-source
:disabled="formDisabled" :rowNumber="true" :rowSelection="true" :toolbar="true" /> 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-tab-pane>
</a-tabs> </a-tabs>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, unref, reactive } from 'vue'; import { ref, computed, unref, reactive } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal'; import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import { JVxeTable } from '/@/components/jeecg/JVxeTable' import { JVxeTable } from '/@/components/jeecg/JVxeTable';
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts' import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts';
import { formSchema, dtCameraLinkageSubJVxeColumns } from '../DtCameraLinkage.data'; import { formSchema, dtCameraLinkageSubJVxeColumns } from '../DtCameraLinkage.data';
import { saveOrUpdate, queryDtCameraLinkageSub } from '../DtCameraLinkage.api'; import { saveOrUpdate, queryDtCameraLinkageSub } from '../DtCameraLinkage.api';
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils' import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils';
// Emits
// Emits const emit = defineEmits(['register', 'success']);
const emit = defineEmits(['register', 'success']); const isUpdate = ref(true);
const isUpdate = ref(true); const formDisabled = ref(false);
const formDisabled = ref(false); const refKeys = ref(['dtCameraLinkageSub']);
const refKeys = ref(['dtCameraLinkageSub',]); const activeKey = ref('dtCameraLinkageSub');
const activeKey = ref('dtCameraLinkageSub'); const dtCameraLinkageSub = ref();
const dtCameraLinkageSub = ref(); const tableRefs = { dtCameraLinkageSub };
const tableRefs = { dtCameraLinkageSub, }; const dtCameraLinkageSubTable = reactive({
const dtCameraLinkageSubTable = reactive({
loading: false, loading: false,
dataSource: [], dataSource: [],
columns: dtCameraLinkageSubJVxeColumns columns: dtCameraLinkageSubJVxeColumns,
}) });
// //
const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({ const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
//labelWidth: 150, //labelWidth: 150,
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
baseColProps: { span: 24 } baseColProps: { span: 24 },
}); });
// //
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
console.log(data.record);
// //
await reset(); await reset();
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter }); setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
@ -56,31 +64,37 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
await setFieldsValue({ await setFieldsValue({
...data.record, ...data.record,
}); });
requestSubTableData(queryDtCameraLinkageSub, { id: data?.record?.id }, dtCameraLinkageSubTable) requestSubTableData(queryDtCameraLinkageSub, { id: data?.record?.id }, dtCameraLinkageSubTable);
} }
// //
setProps({ disabled: !data?.showFooter }) setProps({ disabled: !data?.showFooter });
}); });
// //
const [handleChangeTabs, handleSubmit, requestSubTableData, formRef] = useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs, activeKey, refKeys); 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(); await resetFields();
activeKey.value = 'dtCameraLinkageSub'; activeKey.value = 'dtCameraLinkageSub';
dtCameraLinkageSubTable.dataSource = []; dtCameraLinkageSubTable.dataSource = [];
} }
function classifyIntoFormData(allValues) { function classifyIntoFormData(allValues) {
let main = Object.assign({}, allValues.formValue) let main = Object.assign({}, allValues.formValue);
return { return {
...main, // ...main, //
dtCameraLinkageSubList: allValues.tablesValue[0].tableData, dtCameraLinkageSubList: allValues.tablesValue[0].tableData,
};
} }
} //
// async function requestAddOrEdit(values) {
async function requestAddOrEdit(values) {
try { try {
setModalProps({ confirmLoading: true }); setModalProps({ confirmLoading: true });
console.log(values); console.log(values);
@ -93,17 +107,16 @@ async function requestAddOrEdit(values) {
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/** 时间和数字输入框样式 */ /** 时间和数字输入框样式 */
:deep(.ant-input-number) { :deep(.ant-input-number) {
width: 100% width: 100%;
} }
:deep(.ant-calendar-picker) { :deep(.ant-calendar-picker) {
width: 100% width: 100%;
} }
</style> </style>

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

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

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

@ -19,7 +19,7 @@ export const columns: BasicColumn[] = [
dataIndex: 'sitecode', dataIndex: 'sitecode',
}, },
{ {
title: '点名称', title: '点名称',
align: "center", align: "center",
dataIndex: 'sitename' 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'; * @Author: Fuyuu 1805498209@qq.com
import { rules} from '/@/utils/helper/validator'; * @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'; import { render } from '/@/utils/common/renderUtils';
//列表数据 //列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '数据协议类型编号', title: '类型编号',
align:"center", align: 'center',
dataIndex: 'protocolType' dataIndex: 'protocolType',
}, },
{ {
title: '协议名称', title: '协议名称',
align:"center", align: 'center',
dataIndex: 'protocolName' dataIndex: 'protocolName',
}, },
{ {
title: '备注', title: '备注',
align:"center", align: 'center',
dataIndex: 'remark' dataIndex: 'remark',
},
{
title: '所属区域',
align:"center",
dataIndex: 'sysAreaCode'
}, },
// {
// title: '所属区域',
// align: 'center',
// dataIndex: 'sysAreaCode',
// },
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
label: "数据协议类型编号", label: '类型编号',
field: 'protocolType', field: 'protocolType',
component: 'Input', component: 'Input',
colProps: {span: 6}, colProps: { span: 6 },
}, },
{ {
label: "协议名称", label: '协议名称',
field: 'protocolName', field: 'protocolName',
component: 'Input', component: 'Input',
colProps: {span: 6}, colProps: { span: 6 },
},
{
label: "所属区域",
field: 'sysAreaCode',
component: 'Input',
colProps: {span: 6},
}, },
// {
// label: '所属区域',
// field: 'sysAreaCode',
// component: 'Input',
// colProps: { span: 6 },
// },
]; ];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
label: '数据协议类型编号', label: '类型编号',
field: 'protocolType', field: 'protocolType',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入类型编号!' }];
{ required: true, message: '请输入数据协议类型编号!'},
];
}, },
}, },
{ {
label: '协议名称', label: '协议名称',
field: 'protocolName', field: 'protocolName',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入协议名称!' }];
{ required: true, message: '请输入协议名称!'},
];
}, },
}, },
{ {
@ -73,27 +77,25 @@ export const formSchema: FormSchema[] = [
field: 'remark', field: 'remark',
component: 'Input', component: 'Input',
}, },
{ // {
label: '所属区域', // label: '所属区域',
field: 'sysAreaCode', // field: 'sysAreaCode',
component: 'Input', // component: 'Input',
}, // },
// TODO 主键隐藏字段,目前写死为ID // TODO 主键隐藏字段,目前写死为ID
{ {
label: '', label: '',
field: 'id', field: 'id',
component: 'Input', component: 'Input',
show: false show: false,
}, },
]; ];
/** /**
* formSchema * formSchema
* @param param * @param param
*/ */
export function getBpmFormSchema(_formData): FormSchema[]{ export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return 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> <template>
<div style="min-height: 400px"> <div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm> <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> <a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import {computed, defineComponent} from 'vue'; import { computed, defineComponent } from 'vue';
import {defHttp} from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes'; import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../DtDeviceDataProtocol.data'; import { getBpmFormSchema } from '../DtDeviceDataProtocol.data';
import {saveOrUpdate} from '../DtDeviceDataProtocol.api'; import { saveOrUpdate } from '../DtDeviceDataProtocol.api';
export default defineComponent({ export default defineComponent({
name: "DtDeviceDataProtocolForm", name: 'DtDeviceDataProtocolForm',
components:{ components: {
BasicForm BasicForm,
}, },
props:{ props: {
formData: propTypes.object.def({}), formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true), formBpm: propTypes.bool.def(true),
}, },
setup(props){ setup(props) {
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({ const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150, labelWidth: 150,
schemas: getBpmFormSchema(props.formData), schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false, showActionButtonGroup: false,
baseColProps: {span: 12} baseColProps: { span: 12 },
}); });
const formDisabled = computed(()=>{ const formDisabled = computed(() => {
if(props.formData.disabled === false){ if (props.formData.disabled === false) {
return false; return false;
} }
return true; return true;
@ -41,21 +49,21 @@
let formData = {}; let formData = {};
const queryByIdUrl = '/device/dtDeviceDataProtocol/queryById'; const queryByIdUrl = '/device/dtDeviceDataProtocol/queryById';
async function initFormData(){ async function initFormData() {
let params = {id: props.formData.dataId}; let params = { id: props.formData.dataId };
const data = await defHttp.get({url: queryByIdUrl, params}); const data = await defHttp.get({ url: queryByIdUrl, params });
formData = {...data} formData = { ...data };
// //
await setFieldsValue(formData); await setFieldsValue(formData);
// //
await setProps({disabled: formDisabled.value}) await setProps({ disabled: formDisabled.value });
} }
async function submitForm() { async function submitForm() {
let data = getFieldsValue(); let data = getFieldsValue();
let params = Object.assign({}, formData, data); let params = Object.assign({}, formData, data);
console.log('表单数据', params) console.log('表单数据', params);
await saveOrUpdate(params, true) await saveOrUpdate(params, true);
} }
initFormData(); initFormData();
@ -64,7 +72,7 @@
registerForm, registerForm,
formDisabled, formDisabled,
submitForm, submitForm,
} };
} },
}); });
</script> </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> <template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="896" @ok="handleSubmit"> <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="896" @ok="handleSubmit">
<BasicForm @register="registerForm"/> <BasicForm @register="registerForm" />
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {ref, computed, unref} from 'vue'; import { ref, computed, unref } from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal'; import { BasicModal, useModalInner } from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import {formSchema} from '../DtDeviceDataProtocol.data'; import { formSchema } from '../DtDeviceDataProtocol.data';
import {saveOrUpdate} from '../DtDeviceDataProtocol.api'; import { saveOrUpdate } from '../DtDeviceDataProtocol.api';
// Emits // Emits
const emit = defineEmits(['register','success']); const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true); const isUpdate = ref(true);
// //
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
//labelWidth: 150, //labelWidth: 150,
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
baseColProps: {span: 12} baseColProps: { span: 12 },
}); });
// //
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
// //
await resetFields(); await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
isUpdate.value = !!data?.isUpdate; isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) { if (unref(isUpdate)) {
// //
@ -33,7 +41,7 @@
}); });
} }
// //
setProps({ disabled: !data?.showFooter }) setProps({ disabled: !data?.showFooter });
}); });
// //
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
@ -41,7 +49,7 @@
async function handleSubmit(v) { async function handleSubmit(v) {
try { try {
let values = await validate(); let values = await validate();
setModalProps({confirmLoading: true}); setModalProps({ confirmLoading: true });
// //
await saveOrUpdate(values, isUpdate.value); await saveOrUpdate(values, isUpdate.value);
// //
@ -49,18 +57,18 @@
// //
emit('success'); emit('success');
} finally { } finally {
setModalProps({confirmLoading: false}); setModalProps({ confirmLoading: false });
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/** 时间和数字输入框样式 */ /** 时间和数字输入框样式 */
:deep(.ant-input-number){ :deep(.ant-input-number) {
width: 100% width: 100%;
} }
:deep(.ant-calendar-picker){ :deep(.ant-calendar-picker) {
width: 100% width: 100%;
} }
</style> </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 { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator'; import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; 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[] = [ export const columns: BasicColumn[] = [
{ {
title: '所属站点', title: '所属站点',
align: "center", align: 'center',
dataIndex: 'deviceOwnerId_dictText' dataIndex: 'deviceOwnerId_dictText',
}, },
{ {
title: '类型', title: '设备类型',
align: "center", align: 'center',
dataIndex: 'deviceType_dictText', dataIndex: 'deviceType_dictText',
width: 120 width: 120,
}, },
{ {
title: '设备编码', title: '设备编码',
align: "center", align: 'center',
dataIndex: 'deviceCode', dataIndex: 'deviceCode',
width: 120 width: 120,
}, },
{ {
title: '名称', title: '设备名称',
align: "center", align: 'center',
dataIndex: 'deviceName' dataIndex: 'deviceName',
}, },
{ {
title: '位置', title: '部署位置',
align: "center", align: 'center',
dataIndex: 'devicePosition' dataIndex: 'devicePosition',
}, },
{ {
title: '经度', title: '经度',
align: "center", align: 'center',
dataIndex: 'deviceLon' dataIndex: 'deviceLon',
}, },
{ {
title: '纬度', title: '纬度',
align: "center", align: 'center',
dataIndex: 'deviceLat' dataIndex: 'deviceLat',
}, },
{ {
title: '海拔', title: '海拔',
align: "center", align: 'center',
dataIndex: 'deviceAlt' dataIndex: 'deviceAlt',
}, },
{ {
title: '设备状态', title: '设备状态',
align: "center", align: 'center',
dataIndex: 'deviceStatus_dictText', dataIndex: 'deviceStatus_dictText',
width: 90 width: 90,
}, },
{ {
title: '访问路径', title: '访问路径',
align: "center", align: 'center',
dataIndex: 'deviceUrl' dataIndex: 'deviceUrl',
}, },
{ {
title: '网络协议', title: '网络协议',
align: "center", align: 'center',
dataIndex: 'netProtocol' dataIndex: 'netProtocol_dictText',
}, },
{ {
title:'数据协议', title: '数据协议',
align:"center", align: 'center',
dataIndex:"dataProtocol" dataIndex: 'dataProtocol_dictText',
}, },
{ {
title: 'ip地址', title: 'ip地址',
align: "center", align: 'center',
dataIndex: 'deviceIp' dataIndex: 'deviceIp',
}, },
{ {
title: '端口', title: '端口',
align: "center", align: 'center',
dataIndex: 'ipPort' dataIndex: 'ipPort',
}, },
{ {
title: '端口2', title: '端口2',
align: "center", align: 'center',
dataIndex: 'ipPort2' dataIndex: 'ipPort2',
}, },
{ {
title: '入网许可证', title: '入网许可证',
align: "center", align: 'center',
dataIndex: 'isAudit_dictText', dataIndex: 'isAudit_dictText',
width: 120 width: 120,
}, },
{ {
title: '用户名', title: '用户名',
align: "center", align: 'center',
dataIndex: 'username' dataIndex: 'username',
}, },
{ {
title: '密码', title: '密码',
align: "center", align: 'center',
dataIndex: 'password' dataIndex: 'password',
}, },
{ {
title: '设备子类型', title: '设备子类型',
align: "center", align: 'center',
dataIndex: 'subtype' dataIndex: 'subtype',
}, },
{ {
title: '安装高度', title: '安装高度',
align: "center", align: 'center',
dataIndex: 'deviceHeight' dataIndex: 'deviceHeight',
}, },
{ {
title: '初始方位角', title: '初始方位角',
align: "center", align: 'center',
dataIndex: 'initAzimuth' dataIndex: 'initAzimuth',
}, },
{ {
title: '初始俯仰角', title: '初始俯仰角',
align: "center", align: 'center',
dataIndex: 'initPitch' dataIndex: 'initPitch',
}, },
{ {
title: '工作半径', title: '工作半径',
align: "center", align: 'center',
dataIndex: 'workingRadius' dataIndex: 'workingRadius',
}, },
{ {
title: '水平视场角度', title: '水平视场角度',
align: "center", align: 'center',
dataIndex: 'horizontalAngle' dataIndex: 'horizontalAngle',
}, },
{ {
title: '垂直视场角度', title: '垂直视场角度',
align: "center", align: 'center',
dataIndex: 'verticalAngle' dataIndex: 'verticalAngle',
}, },
{ {
title: '识别刻度', title: '识别刻度',
align: "center", align: 'center',
dataIndex: 'identificationScale' dataIndex: 'identificationScale',
}, },
{ {
title: '备注', title: '备注',
align: "center", align: 'center',
dataIndex: 'remark' dataIndex: 'remark',
}, },
// { // {
@ -154,32 +238,31 @@ export const columns: BasicColumn[] = [
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
label: "所属站点", label: '所属站点',
field: 'deviceOwnerId', field: 'deviceOwnerId',
component: 'JDictSelectTag', component: 'TreeSelect',
defaultValue: '00001-00001-00002',
componentProps: { componentProps: {
dictCode: "ms_map_scene,scene_name,scene_id" treeData: nodeTree,
}, },
colProps: { span: 6 }, colProps: { span: 6 },
}, },
{ {
label: "设备类型", label: '设备类型',
field: 'deviceType', field: 'deviceType',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_deveice_type,type_name,type_no" dictCode: 'dt_deveice_type,type_name,type_no',
}, },
colProps: { span: 6 }, colProps: { span: 6 },
}, },
{ {
label: "设备编码", label: '设备编码',
field: 'deviceCode', field: 'deviceCode',
component: 'Input', component: 'Input',
colProps: { span: 6 }, colProps: { span: 6 },
}, },
{ {
label: "设备名称", label: '设备名称',
field: 'deviceName', field: 'deviceName',
component: 'JInput', component: 'JInput',
colProps: { span: 6 }, colProps: { span: 6 },
@ -191,11 +274,11 @@ export const searchFormSchema: FormSchema[] = [
// colProps: {span: 6}, // colProps: {span: 6},
// }, // },
{ {
label: "设备状态", label: '设备状态',
field: 'deviceStatus', field: 'deviceStatus',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_sensor_status" dictCode: 'dt_sensor_status',
}, },
colProps: { span: 6 }, colProps: { span: 6 },
}, },
@ -212,81 +295,72 @@ export const searchFormSchema: FormSchema[] = [
// colProps: {span: 6}, // colProps: {span: 6},
// }, // },
{ {
label: "数据协议", label: '数据协议',
field: 'protocol', field: 'protocol',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_device_data_protocol,protocol_name,protocol_type" dictCode: 'dt_device_data_protocol,protocol_name,protocol_type',
}, },
colProps: { span: 6 }, colProps: { span: 6 },
}, },
{ {
label: "网络协议", label: '网络协议',
field: 'protocol', field: 'protocol',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_device_net_protocol,protocol_name,protocol_type" dictCode: 'dt_device_net_protocol,protocol_name,protocol_type',
}, },
colProps: { span: 6 }, colProps: { span: 6 },
}, },
]; ];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
label: '所属站点', label: '所属站点',
field: 'deviceOwnerId', field: 'deviceOwnerId',
component: 'JDictSelectTag', component: 'TreeSelect',
componentProps: { componentProps: {
dictCode: "ms_map_scene,scene_name,scene_id" treeData: nodeTree,
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '所属站点不能为空!' }];
{ required: true, message: '所属站点不能为空!' },
];
}, },
}, },
{ {
label: '类型', label: '设备类型',
field: 'deviceType', field: 'deviceType',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_deveice_type,type_name,type_no", dictCode: 'dt_deveice_type,type_name,type_no',
stringToNumber: true stringToNumber: true,
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '设备类型不能为空!' }];
{ required: true, message: '类型不能为空!' },
];
}, },
}, },
{ {
label: '编码', label: '设备编码',
field: 'deviceCode', field: 'deviceCode',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '设备编码不能为空!' }];
{ required: true, message: '编码不能为空!' },
];
}, },
}, },
{ {
label: '名称', label: '设备名称',
field: 'deviceName', field: 'deviceName',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '设备名称不能为空!' }];
{ required: true, message: '名称不能为空!' },
];
}, },
}, },
{ {
label: '位置', label: '部署位置',
field: 'devicePosition', field: 'devicePosition',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '部署位置不能为空!' }];
{ required: true, message: '位置不能为空!' },
];
}, },
}, },
{ {
@ -294,9 +368,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceLon', field: 'deviceLon',
component: 'InputNumber', component: 'InputNumber',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '经度不能为空!' }];
{ required: true, message: '经度不能为空!' },
];
}, },
}, },
{ {
@ -304,9 +376,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceLat', field: 'deviceLat',
component: 'InputNumber', component: 'InputNumber',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '纬度不能为空!' }];
{ required: true, message: '纬度不能为空!' },
];
}, },
}, },
{ {
@ -314,9 +384,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceAlt', field: 'deviceAlt',
component: 'InputNumber', component: 'InputNumber',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '海拔不能为空!' }];
{ required: true, message: '海拔不能为空!' },
];
}, },
}, },
{ {
@ -324,13 +392,11 @@ export const formSchema: FormSchema[] = [
field: 'deviceStatus', field: 'deviceStatus',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_sensor_status", dictCode: 'dt_sensor_status',
stringToNumber: true stringToNumber: true,
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '设备状态不能为空!' }];
{ required: true, message: '设备状态不能为空!' },
];
}, },
}, },
{ {
@ -338,27 +404,21 @@ export const formSchema: FormSchema[] = [
field: 'netProtocol', field: 'netProtocol',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_device_net_protocol,protocol_name,protocol_type", dictCode: 'dt_device_net_protocol,protocol_name,protocol_type',
stringToNumber: true
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '网络协议不能为空!' }];
{ required: true, message: '网络协议不能为空!' },
];
}, },
}, },
{ {
label: '数据协议', label: '数据协议',
field: 'dataProtocol', field: 'dataProtocol',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps:{ componentProps: {
dictCode:"dt_device_data_protocol,protocol_name,protocol_type", dictCode: 'dt_device_data_protocol,protocol_name,protocol_type',
stringToNumber: true
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '数据协议不能为空!' }];
{ required: true, message: '数据协议不能为空!' },
];
}, },
}, },
{ {
@ -366,9 +426,7 @@ export const formSchema: FormSchema[] = [
field: 'deviceUrl', field: 'deviceUrl',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '访问路径不能为空!' }];
{ 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}$/, 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地址格式不正确!', 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])$/, 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: '端口格式不正确!', 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])$/, 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格式不正确!', message: '端口2格式不正确!',
} },
], ],
}, },
{ {
@ -417,13 +475,11 @@ export const formSchema: FormSchema[] = [
field: 'isAudit', field: 'isAudit',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
dictCode: "dt_is_audit", dictCode: 'dt_is_audit',
stringToNumber: true stringToNumber: true,
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '入网许可证不能为空!' }];
{ required: true, message: '入网许可证不能为空!' },
];
}, },
}, },
{ {
@ -492,7 +548,7 @@ export const formSchema: FormSchema[] = [
label: '', label: '',
field: 'id', field: 'id',
component: 'Input', component: 'Input',
show: false show: false,
}, },
]; ];
//子表单数据 //子表单数据
@ -505,53 +561,53 @@ export const dtDeviceSensorInfoColumns: BasicColumn[] = [
// }, // },
{ {
title: '传感器名称', title: '传感器名称',
align: "center", align: 'center',
dataIndex: 'sensorName' dataIndex: 'sensorName',
}, },
{ {
title: '传感器编号', title: '传感器编号',
align: "center", align: 'center',
dataIndex: 'sensorCode' dataIndex: 'sensorCode',
}, },
{ {
title: '状态', title: '状态',
align: "center", align: 'center',
dataIndex: 'sensorStatus' dataIndex: 'sensorStatus',
}, },
{ {
title: '经度', title: '经度',
align: "center", align: 'center',
dataIndex: 'sensorLon' dataIndex: 'sensorLon',
}, },
{ {
title: '维度', title: '维度',
align: "center", align: 'center',
dataIndex: 'sensorLat' dataIndex: 'sensorLat',
}, },
{ {
title: '地址编号例如01', title: '地址编号例如01',
align: "center", align: 'center',
dataIndex: 'sensorAddress' dataIndex: 'sensorAddress',
}, },
{ {
title: '寄存器地址编号', title: '寄存器地址编号',
align: "center", align: 'center',
dataIndex: 'portId' dataIndex: 'portId',
}, },
{ {
title: '值', title: '值',
align: "center", align: 'center',
dataIndex: 'sdata' dataIndex: 'sdata',
}, },
{ {
title: '备注', title: '备注',
align: "center", align: 'center',
dataIndex: 'remark' dataIndex: 'remark',
}, },
{ {
title: '所属区域', title: '所属区域',
align: "center", align: 'center',
dataIndex: 'sysAreaCode' dataIndex: 'sysAreaCode',
}, },
]; ];
//子表列表数据 //子表列表数据
@ -568,18 +624,18 @@ export const dtDeviceStatusColumns: BasicColumn[] = [
// }, // },
{ {
title: '设备初始状态', title: '设备初始状态',
align: "center", align: 'center',
dataIndex: 'status' dataIndex: 'status',
}, },
{ {
title: '状态补充说明', title: '状态补充说明',
align: "center", align: 'center',
dataIndex: 'remark' dataIndex: 'remark',
}, },
{ {
title: '所属区域', title: '所属区域',
align: "center", align: 'center',
dataIndex: 'sysAreaCode' dataIndex: 'sysAreaCode',
}, },
]; ];
//子表表格配置 //子表表格配置
@ -596,18 +652,16 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '传感器名称', title: '传感器名称',
key: 'sensorName', key: 'sensorName',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
validateRules: [ validateRules: [{ required: true, message: '${title}不能为空' }],
{ required: true, message: '${title}不能为空' },
],
}, },
{ {
title: '传感器编号', title: '传感器编号',
key: 'sensorCode', key: 'sensorCode',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -615,7 +669,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '状态', title: '状态',
key: 'sensorStatus', key: 'sensorStatus',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -623,7 +677,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '经度', title: '经度',
key: 'sensorLon', key: 'sensorLon',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -631,7 +685,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '维度', title: '维度',
key: 'sensorLat', key: 'sensorLat',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -639,7 +693,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '地址编号例如01', title: '地址编号例如01',
key: 'sensorAddress', key: 'sensorAddress',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -647,7 +701,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '寄存器地址编号', title: '寄存器地址编号',
key: 'portId', key: 'portId',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -655,7 +709,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '值', title: '值',
key: 'sdata', key: 'sdata',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -663,7 +717,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '备注', title: '备注',
key: 'remark', key: 'remark',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -671,17 +725,17 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [
title: '所属区域', title: '所属区域',
key: 'sysAreaCode', key: 'sysAreaCode',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
] ];
export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [
{ {
title: '设备唯一标识', title: '设备唯一标识',
key: 'deviceId', key: 'deviceId',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -689,29 +743,25 @@ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [
title: '所属站点ID', title: '所属站点ID',
key: 'deviceOwnerId', key: 'deviceOwnerId',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
validateRules: [ validateRules: [{ required: true, message: '${title}不能为空' }],
{ required: true, message: '${title}不能为空' },
],
}, },
{ {
title: '设备初始状态', title: '设备初始状态',
key: 'status', key: 'status',
type: JVxeTypes.inputNumber, type: JVxeTypes.inputNumber,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
validateRules: [ validateRules: [{ required: true, message: '${title}不能为空' }],
{ required: true, message: '${title}不能为空' },
],
}, },
{ {
title: '状态补充说明', title: '状态补充说明',
key: 'remark', key: 'remark',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
@ -719,16 +769,16 @@ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [
title: '所属区域', title: '所属区域',
key: 'sysAreaCode', key: 'sysAreaCode',
type: JVxeTypes.input, type: JVxeTypes.input,
width: "200px", width: '200px',
placeholder: '请输入${title}', placeholder: '请输入${title}',
defaultValue: '', defaultValue: '',
}, },
] ];
/** /**
* formSchema * formSchema
* @param param * @param param
*/ */
export function getBpmFormSchema(_formData): FormSchema[] { export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema; return formSchema;

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

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

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

@ -8,7 +8,7 @@
<div style="background: #fff"> <div style="background: #fff">
<p style="margin: 0; padding: 5px 20px; font-size: 20px"> <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> </p>
<div class="cameraBox"> <div class="cameraBox">
<!--树形控件界面--> <!--树形控件界面-->
@ -628,7 +628,6 @@
let user = cameraForm.value.user; let user = cameraForm.value.user;
let password = cameraForm.value.password; let password = cameraForm.value.password;
let height = cameraForm.value.height; let height = cameraForm.value.height;
let videoRecorderId = cameraForm.value.videoRecorderId;
let type = cameraForm.value.type; let type = cameraForm.value.type;
let factory = cameraForm.value.factory; let factory = cameraForm.value.factory;
let leftAngle = cameraForm.value.leftAngle; let leftAngle = cameraForm.value.leftAngle;
@ -750,8 +749,13 @@
// //
if (res.success) { if (res.success) {
createMessage.success(success_message); createMessage.success(success_message);
//
if (!cameraForm.value.id) {
fromClear();
} else {
// //
cameraForm.value = res.result; cameraForm.value = res.result;
}
// //
getNodeTree(); getNodeTree();
} else { } else {
@ -1034,23 +1038,10 @@
// //
function reNew() { function reNew() {
reNewBtn.value.spin = true; 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(); getNodeTree();
getVideoRecorderArr(); //
reNewBtn.value.spin = false; createMessage.success('刷新成功');
});
} }
defineExpose({ defineExpose({

Loading…
Cancel
Save