Browse Source

修改综合监模型表、视频智能监控表排序方式,更改默认时间排序

master
jiejie 9 months ago
parent
commit
4099d361b6
  1. 2
      src/hooks/system/useListPage.ts
  2. 49
      src/views/military/modules/ai/aiModel/components/DtAiModelForm.vue
  3. 59
      src/views/military/modules/ai/monitorModel/DtMonitorModel.data.ts
  4. 14
      src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue
  5. 53
      src/views/military/modules/ai/monitorModel/components/DtMonitorModelForm.vue
  6. 18
      src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts

2
src/hooks/system/useListPage.ts

@ -281,7 +281,7 @@ export function useListTable(tableProps: TableProps): [
// 发送请求之前调用的方法 // 发送请求之前调用的方法
function beforeFetch(params) { function beforeFetch(params) {
// 默认以 createTime 降序排序 // 默认以 createTime 降序排序
return Object.assign({ column: 'createTime', order: 'desc' }, params); return Object.assign({ }, params);
} }
// 合并方法 // 合并方法

49
src/views/military/modules/ai/aiModel/components/DtAiModelForm.vue

@ -4,17 +4,17 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="模型编号" v-bind="validateInfos.modelCode"> <a-form-item label="模型编号" v-bind="validateInfos.modelCode">
<a-input v-model:value="formData.modelCode" placeholder="请输入模型编号" :disabled="disabled"></a-input> <a-input v-model:value="formData.modelCode" placeholder="请输入模型编号" :disabled="disabledForm.modelCode"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="模型名称" v-bind="validateInfos.modelName"> <a-form-item label="模型名称" v-bind="validateInfos.modelName">
<a-input v-model:value="formData.modelName" placeholder="请输入模型名称" :disabled="disabled"></a-input> <a-input v-model:value="formData.modelName" placeholder="请输入模型名称" :disabled="disabledForm.modelName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.remark"> <a-form-item label="备注" v-bind="validateInfos.remark">
<a-input v-model:value="formData.remark" placeholder="请输入备注" :disabled="disabled"></a-input> <a-input v-model:value="formData.remark" placeholder="请输入备注" :disabled="disabledForm.remark"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<!-- <a-col :span="24"> <!-- <a-col :span="24">
@ -79,26 +79,36 @@
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false); const confirmLoading = ref<boolean>(false);
// //
const validatorRules = {}; const validatorRules = {
modelCode: [{ required: true, message: '请输入模型编号!' },],
modelName: [{ required: true, message: '请输入模型名称!' }]
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
const disabledForm=ref({
modelCode:false,
modelName:false,
remark:false
})
// //
const disabled = computed(() => { // const disabled = computed(() => {
if (props.formBpm === true) { // if (props.formBpm === true) {
if (props.formData.disabled === false) { // if (props.formData.disabled === false) {
return false; // return false;
} else { // } else {
return true; // return true;
} // }
} // }
return props.formDisabled; // return props.formDisabled;
}); // });
/** /**
* 新增 * 新增
*/ */
function add() { function add() {
edit({}); edit({});
disabledForm.value.modelCode=false
disabledForm.value.modelName=false
disabledForm.value.remark=false
} }
/** /**
@ -110,6 +120,15 @@
// //
Object.assign(formData, record); Object.assign(formData, record);
}); });
if(!props.formDisabled){//
disabledForm.value.modelCode=true
disabledForm.value.modelName=false
disabledForm.value.remark=false
}else{
disabledForm.value.modelCode=true
disabledForm.value.modelName=true
disabledForm.value.remark=true
}
} }
/** /**

59
src/views/military/modules/ai/monitorModel/DtMonitorModel.data.ts

@ -2,12 +2,15 @@ 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 { SortOrder } from 'ant-design-vue/lib/table/interface';
//列表数据 //列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '模型编号', title: '模型编号',
align: "center", align: "center",
dataIndex: 'modelCode', dataIndex: 'modelCode',
// sorter: true,
// sortDirections:['ascend']
}, },
{ {
title: '模型名称', title: '模型名称',
@ -18,7 +21,8 @@ export const columns: BasicColumn[] = [
title: '备注', title: '备注',
align: "center", align: "center",
dataIndex: 'remark' dataIndex: 'remark'
} },
// , // ,
// { // {
// title: '备用1', // title: '备用1',
@ -57,6 +61,7 @@ export const formSchema: FormSchema[] = [
label: '模型编号', label: '模型编号',
field: 'modelCode', field: 'modelCode',
component: 'Input', component: 'Input',
}, },
{ {
label: '模型名称', label: '模型名称',
@ -68,31 +73,32 @@ export const formSchema: FormSchema[] = [
field: 'remark', field: 'remark',
component: 'Input', component: 'Input',
}, },
{ // {
label: '备用1', // label: '备用1',
field: 'field1', // field: 'field1',
component: 'Input', // component: 'Input',
}, // },
{ // {
label: '备用2', // label: '备用2',
field: 'field2', // field: 'field2',
component: 'Input', // component: 'Input',
}, // },
{ // {
label: '备用3', // label: '备用3',
field: 'field3', // field: 'field3',
component: 'Input', // component: 'Input',
}, // },
{ // {
label: '所属区域', // label: '所属区域',
field: 'sysAreaCode', // field: 'sysAreaCode',
component: 'Input', // component: 'Input',
}, // },
{ // {
label: '所属单位', // label: '所属单位',
field: 'sysUnitCode', // field: 'sysUnitCode',
component: 'Input', // component: 'Input',
}, // },
// TODO 主键隐藏字段,目前写死为ID // TODO 主键隐藏字段,目前写死为ID
{ {
label: '', label: '',
@ -101,3 +107,4 @@ export const formSchema: FormSchema[] = [
show: false, show: false,
}, },
]; ];

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

@ -207,13 +207,13 @@
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),
}, // },
}, // },
]; ];
} }

53
src/views/military/modules/ai/monitorModel/components/DtMonitorModelForm.vue

@ -3,19 +3,21 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="模型编号" v-bind="validateInfos.modelCode"> <a-form-item label="模型编号" v-bind="validateInfos.modelCode" >
<a-input-number v-model:value="formData.modelCode" placeholder="请输入模型编号" style="width: 100%" <!-- <a-input-number v-model:value="formData.modelCode" placeholder="请输入模型编号" style="width: 100%" :disabled="disabled"></a-input-number> -->
:disabled="disabled"></a-input-number> <a-input-number v-model:value="formData.modelCode" placeholder="请输入模型编号" style="width: 100%" :disabled="disabledForm.modelCode"></a-input-number>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="模型名称" v-bind="validateInfos.modelName"> <a-form-item label="模型名称" v-bind="validateInfos.modelName">
<a-input v-model:value="formData.modelName" placeholder="请输入模型名称" :disabled="disabled"></a-input> <a-input v-model:value="formData.modelName" placeholder="请输入模型名称" :disabled="disabledForm.modelName"></a-input>
<!-- <a-input v-model:value="formData.modelName" placeholder="请输入模型名称" :disabled="disabled"></a-input> -->
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.remark"> <a-form-item label="备注" v-bind="validateInfos.remark">
<a-input v-model:value="formData.remark" placeholder="请输入备注" :disabled="disabled"></a-input> <a-input v-model:value="formData.remark" placeholder="请输入备注" :disabled="disabledForm.remark"></a-input>
<!-- <a-input v-model:value="formData.remark" placeholder="请输入备注" :disabled="disabled"></a-input> -->
</a-form-item> </a-form-item>
</a-col> </a-col>
<!-- <a-col :span="24"> <!-- <a-col :span="24">
@ -55,6 +57,7 @@ import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils'; import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../DtMonitorModel.api'; import { saveOrUpdate } from '../DtMonitorModel.api';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import { title } from 'process';
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
@ -62,6 +65,7 @@ const props = defineProps({
formBpm: { type: Boolean, default: true } formBpm: { type: Boolean, default: true }
}); });
const formRef = ref(); const formRef = ref();
// const isShow=ref(true);
const useForm = Form.useForm; const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']); const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({ const formData = reactive<Record<string, any>>({
@ -85,25 +89,31 @@ const validatorRules = {
modelName: [{ required: true, message: '请输入模型名称!' }] modelName: [{ required: true, message: '请输入模型名称!' }]
}; };
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
const disabledForm=ref({
modelCode:false,
modelName:false,
remark:false
})
// //
const disabled = computed(() => { // const disabled = computed(() => {
if (props.formBpm === true) { // if (props.formBpm === true) {
if (props.formData.disabled === false) { // if (props.formData.disabled === false) {
return false; // return false;
} else { // } else {
return true; // return true;
} // }
} // }
return props.formDisabled; // return props.formDisabled;
}); // });
/** /**
* 新增 * 新增
*/ */
function add() { function add() {
edit({}); edit({});
disabledForm.value.modelCode=false
disabledForm.value.modelName=false
disabledForm.value.remark=false
} }
/** /**
@ -115,6 +125,15 @@ function edit(record) {
// //
Object.assign(formData, record); Object.assign(formData, record);
}); });
if(!props.formDisabled){//
disabledForm.value.modelCode=true
disabledForm.value.modelName=false
disabledForm.value.remark=false
}else{
disabledForm.value.modelCode=true
disabledForm.value.modelName=true
disabledForm.value.remark=true
}
} }
/** /**

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

@ -64,7 +64,7 @@ export const columns: BasicColumn[] = [
dataIndex: 'netProtocol' dataIndex: 'netProtocol'
}, },
{ {
title:'数据协议类型', title:'数据协议',
align:"center", align:"center",
dataIndex:"dataProtocol" dataIndex:"dataProtocol"
}, },
@ -157,6 +157,7 @@ export const searchFormSchema: FormSchema[] = [
label: "所属站点", label: "所属站点",
field: 'deviceOwnerId', field: 'deviceOwnerId',
component: 'JDictSelectTag', component: 'JDictSelectTag',
defaultValue: '00001-00001-00002',
componentProps: { componentProps: {
dictCode: "ms_map_scene,scene_name,scene_id" dictCode: "ms_map_scene,scene_name,scene_id"
}, },
@ -211,7 +212,7 @@ export const searchFormSchema: FormSchema[] = [
// colProps: {span: 6}, // colProps: {span: 6},
// }, // },
{ {
label: "协议类型", label: "数据协议",
field: 'protocol', field: 'protocol',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps: { componentProps: {
@ -219,6 +220,15 @@ export const searchFormSchema: FormSchema[] = [
}, },
colProps: { span: 6 }, colProps: { span: 6 },
}, },
{
label: "网络协议",
field: 'protocol',
component: 'JDictSelectTag',
componentProps: {
dictCode: "dt_device_net_protocol,protocol_name,protocol_type"
},
colProps: { span: 6 },
},
]; ];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
@ -338,7 +348,7 @@ export const formSchema: FormSchema[] = [
}, },
}, },
{ {
label: '数据协议类型', label: '数据协议',
field: 'dataProtocol', field: 'dataProtocol',
component: 'JDictSelectTag', component: 'JDictSelectTag',
componentProps:{ componentProps:{
@ -347,7 +357,7 @@ export const formSchema: FormSchema[] = [
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [ return [
{ required: true, message: '数据协议类型不能为空!' }, { required: true, message: '数据协议不能为空!' },
]; ];
}, },
}, },

Loading…
Cancel
Save