diff --git a/frontend/src/api/error/interface/index.ts b/frontend/src/api/error/interface/index.ts index e194a34..24df056 100644 --- a/frontend/src/api/error/interface/index.ts +++ b/frontend/src/api/error/interface/index.ts @@ -15,6 +15,7 @@ export namespace ErrorSystem { export interface ErrorSystemDetail { measured: string;//被测量 deviceLevel: string;//检测装置级别 + measurementType?: string;//测量类型 condition: string;//测量条件 maxErrorValue: string;//最大误差 } diff --git a/frontend/src/api/resource/resourceData.ts b/frontend/src/api/resource/resourceData.ts index ed15746..c6fe5b4 100644 --- a/frontend/src/api/resource/resourceData.ts +++ b/frontend/src/api/resource/resourceData.ts @@ -6,7 +6,7 @@ const resourcedata = ref([ 'id': '1', 'name': '检测计划', 'path':'/plan/planList/index', - 'sort':1, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -17,7 +17,7 @@ const resourcedata = ref([ 'id': '2', 'name': '台账管理', 'path':'/plan/planList/index', - 'sort':2, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -28,7 +28,7 @@ const resourcedata = ref([ 'name': '检测脚本', 'path':'/plan/planList/index', - 'sort':21, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -40,7 +40,7 @@ const resourcedata = ref([ 'name': '被检设备', 'path':'/plan/planList/index', - 'sort':22, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -52,7 +52,7 @@ const resourcedata = ref([ 'name': '误差体系', 'path':'/plan/planList/index', - 'sort':23, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -63,7 +63,7 @@ const resourcedata = ref([ 'name': '检测源', 'path':'/plan/planList/index', - 'sort':24, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -78,7 +78,7 @@ const resourcedata = ref([ 'name': '权限管理', 'path':'/plan/planList/index', - 'sort':3, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -89,7 +89,7 @@ const resourcedata = ref([ 'name': '用户管理', 'path':'/plan/planList/index', - 'sort':31, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -101,7 +101,7 @@ const resourcedata = ref([ 'name': '角色管理', 'path':'/plan/planList/index', - 'sort':32, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -113,7 +113,7 @@ const resourcedata = ref([ 'name': '菜单管理', 'path':'/plan/planList/index', - 'sort':33, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -127,7 +127,7 @@ const resourcedata = ref([ 'name': '系统配置', 'path':'/plan/planList/index', - 'sort':4, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -138,7 +138,7 @@ const resourcedata = ref([ 'name': '通用配置', 'path':'/plan/planList/index', - 'sort':41, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -150,7 +150,7 @@ const resourcedata = ref([ 'name': '数据字典', 'path':'/plan/planList/index', - 'sort':42, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -162,7 +162,7 @@ const resourcedata = ref([ 'name': '报告模版', 'path':'/plan/planList/index', - 'sort':43, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -173,7 +173,7 @@ const resourcedata = ref([ 'name': '版本注册', 'path':'/plan/planList/index', - 'sort':44, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -188,7 +188,7 @@ const resourcedata = ref([ 'name': '日志管理', 'path':'/plan/planList/index', - 'sort':5, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -200,7 +200,7 @@ const resourcedata = ref([ 'name': '统计分析', 'path':'/plan/planList/index', - 'sort':6, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', @@ -212,7 +212,7 @@ const resourcedata = ref([ 'name': '示例', 'path':'/plan/planList/index', - 'sort':7, + 'sort':100, 'type':'菜单', 'remark':'检测计划描述', 'route_Name':'route', diff --git a/frontend/src/components/TimeControl/index.vue b/frontend/src/components/TimeControl/index.vue index 6f0962f..c5fb762 100644 --- a/frontend/src/components/TimeControl/index.vue +++ b/frontend/src/components/TimeControl/index.vue @@ -22,6 +22,7 @@ v-model='startDate' type='date' placeholder='起始时间' + @change="emitDateChange" :disabled-date="disableStartDate" :readonly="timeUnit != '自定义'" > @@ -31,6 +32,7 @@ v-model='endDate' type='date' placeholder='结束时间' + @change="emitDateChange" :disabled-date="disableEndDate" :readonly="timeUnit !== '自定义'" > @@ -45,7 +47,7 @@
- 本{{ timeUnit }} + 当前 - import { watch,computed, ref,reactive ,onMounted, defineProps, defineEmits } from 'vue'; + import { ref ,onMounted, defineProps, defineEmits } from 'vue'; + + // 定义时间单位的类型 +interface TimeUnit { + label: string; + value: string; +} +// 定义组件的props,包含包括和排除的时间单位 + const props = defineProps({ + include: { + type: Array as () => string[], + default: () => ['日', '周', '月', '季度', '年', '自定义'], + }, + exclude: { + type: Array as () => string[], + default: () => [], + }, + default: { + type: String, + default: '日', + }, +}); - const timeUnit = ref('日'); // 默认选择按周 + // 定义事件 + const emit = defineEmits<{ + (e: 'update-dates', startDate: Date, endDate: Date): void; + }>(); + const timeUnit = ref(props.default); // 默认选择 const startDate = ref(new Date()); // 起始日期 const endDate = ref(new Date()); // 结束日期 const isNextDisabled = ref(false); // 控制下一周期按钮的禁用状态 const today = ref(new Date()); // 当前日期 - const timeUnits = [ - { label: '日', value: '日' }, - { label: '周', value: '周' }, - { label: '月', value: '月' }, - { label: '季度', value: '季度' }, - { label: '年', value: '年' }, - { label: '自定义', value: '自定义' }, - ]; + // 过滤出可用的时间单位 + const timeUnits = ref( + props.include.filter(unit => !props.exclude.includes(unit)).map(unit => ({ + label: unit, + value: unit, + })) + ); + + // 发出日期变化事件 + const emitDateChange = () => { + emit('update-dates', startDate.value, endDate.value); + }; // 在组件挂载时更新日期范围 onMounted(() => { @@ -92,6 +123,8 @@ startDate.value = new Date(new Date().setDate(new Date().getDate() - 1)) endDate.value = new Date() } + timeUnit.value = unit; + emitDateChange(); // 变化时也发出更新事件 updateNextButtonStatus() } const updateDateRange = () => { @@ -218,3 +251,4 @@ + diff --git a/frontend/src/views/analyse/index.vue b/frontend/src/views/analyse/index.vue new file mode 100644 index 0000000..8e8347f --- /dev/null +++ b/frontend/src/views/analyse/index.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/authority/resource/index.vue b/frontend/src/views/authority/resource/index.vue index 18e3a9c..32f2e52 100644 --- a/frontend/src/views/authority/resource/index.vue +++ b/frontend/src/views/authority/resource/index.vue @@ -65,7 +65,7 @@ const proTable = ref() // 表格配置项 const columns = reactive[]>([ - { type: 'selection', fixed: 'left', width: 50 }, + { type: 'selection', fixed: 'left', width: 70 }, { prop: 'name', label: '名称', @@ -150,7 +150,7 @@ const openAddDialog = () => { id: '', name: '', path: '', - sort: 0, + sort: 100, type: '', remark: '', route_Name: '', diff --git a/frontend/src/views/log/index.vue b/frontend/src/views/log/index.vue index 0878bf7..5d908db 100644 --- a/frontend/src/views/log/index.vue +++ b/frontend/src/views/log/index.vue @@ -9,7 +9,7 @@ > @@ -28,17 +28,18 @@ import { reactive,ref } from 'vue' let multipleSelection = ref([]) const logData = logDataList // 定义包含和排除的单位 -const includedUnits = ['日', '周', '月', '季度']; // 可以根据需要包含的单位 -const excludedUnits = ['年']; // 要排除的单位 +const includedUnits = ['日', '周', '月', '自定义']; // 可以根据需要包含的单位 +const excludedUnits = ['季度','年']; // 要排除的单位 +const defaultUnits = '日'; // 默认的单位 // ProTable 实例 const proTable = ref() // 表格配置项 const columns = reactive[]>([ - { type: 'selection', fixed: 'left', width: 50 }, + { type: 'selection', fixed: 'left', width: 70 }, { prop: 'id', label: '序号', - width: 100, + width: 70, }, { prop: 'user', @@ -55,7 +56,11 @@ const columns = reactive[]>([ render: ({ searchParam }) => { return (
- +
) }, @@ -85,10 +90,11 @@ const columns = reactive[]>([ // 处理选择变化 const handleSelectionChange = (selection: Log.LogList[]) => { multipleSelection.value = selection.map(row => row.id) // 更新选中的行 - + } +