Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
# Conflicts: # frontend/src/api/system/dictData.ts # frontend/src/views/authority/role/components/rolePopup.vue
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogSmall">
|
||||
<el-form :model="formData" :rules="rules">
|
||||
<el-form :model="formData" ref='formRuleRef' :rules='rules'>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" />
|
||||
</el-form-item>
|
||||
@@ -12,17 +12,17 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择资源类型">
|
||||
<el-option label="菜单" value="菜单" />
|
||||
<el-option label="按钮" value="按钮" />
|
||||
<el-option label="公共资源" value="公共资源" />
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('resourceType')"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="formData.remark" :rows="2" type="textarea"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由" prop="route_Name">
|
||||
<el-input v-model="formData.route_Name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@@ -34,42 +34,71 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ResourceDialog">
|
||||
import { defineProps, defineEmits, reactive,watch } from 'vue';
|
||||
import { defineProps, defineEmits,watch,ref, type Ref } from 'vue';
|
||||
import { dialogSmall } from '@/utils/elementBind'
|
||||
import { ElMessage, FormInstance, FormItemRule } from 'element-plus'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const dictStore = useDictStore()
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
dialogTitle: string;
|
||||
|
||||
formData: {
|
||||
|
||||
id:string;
|
||||
name: string;
|
||||
path: string;
|
||||
sort: number;
|
||||
type: string;
|
||||
remark: string;
|
||||
route_Name: string;
|
||||
id: string;//资源表Id
|
||||
pid:string;//节点(0为根节点)
|
||||
pids?:string;//节点上层所有节点
|
||||
name: string;//名称
|
||||
code:string;//资源标识
|
||||
path:string;//路径
|
||||
icon?:string;//图标
|
||||
sort:number;//排序
|
||||
type:number;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
remark?: string;//权限资源描述
|
||||
state:number;//权限资源状态
|
||||
create_By?:string;//创建人
|
||||
create_Time?:string;//创建时间
|
||||
update_By?:string;//更新人
|
||||
update_Time?:string;//更新时间
|
||||
};
|
||||
}>();
|
||||
|
||||
const rules = {
|
||||
name :[
|
||||
{require:true,trigger:"blur",message:"请填写菜单名称"}
|
||||
]
|
||||
}
|
||||
|
||||
// 定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
const rules : Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name :[{required:true,trigger:'blur',message:'菜单名称必填!'}],
|
||||
path :[{required:true,trigger:'blur',message:'菜单路径必填!'}],
|
||||
type :[{required:true,trigger:'change',message:'菜单类型必选!'}]
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
//重置表单内容
|
||||
//取消表单校验状态
|
||||
formRuleRef.value && formRuleRef.value.resetFields()
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
};
|
||||
try {
|
||||
formRuleRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
// 将表单数据转为json,发送到后端
|
||||
let confirmFormData = JSON.parse(JSON.stringify(props.formData))
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
} else {
|
||||
ElMessage.error('表单验证失败!')
|
||||
}
|
||||
})
|
||||
}catch (error) {
|
||||
console.error('验证过程中发生错误', error)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 当 props.visible 改变时,更新 formData
|
||||
watch(() => props.visible, (newVal) => {
|
||||
|
||||
@@ -40,122 +40,91 @@
|
||||
import { type Resource } from '@/api/resource/interface'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import ResourceDialog from "@/views/authority/resource/components/ResourceDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen} from '@element-plus/icons-vue'
|
||||
import {CirclePlus, Delete, EditPen,HomeFilled} from '@element-plus/icons-vue'
|
||||
import resourceDataList from '@/api/resource/resourceData'
|
||||
import type { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { ElMessage, ElMessageBox, inputEmits } from 'element-plus';
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
let multipleSelection = ref<string[]>([]);
|
||||
const resourceData = resourceDataList
|
||||
const dialogFormVisible = ref(false)
|
||||
const isEditMode = ref(false);
|
||||
const dialogTitle = ref('新增菜单')
|
||||
|
||||
const dialogForm = ref<Resource.ResResourceList>({
|
||||
id: '',
|
||||
pid:'',
|
||||
pids:'',
|
||||
name: '',
|
||||
path: '',
|
||||
sort: 0,
|
||||
type: '',
|
||||
code:'',
|
||||
path:'',
|
||||
icon:'',
|
||||
sort:100,
|
||||
type:0,
|
||||
remark: '',
|
||||
route_Name: '',
|
||||
create_Time: '' ,
|
||||
update_Time: '' ,
|
||||
state:1,
|
||||
children:[],
|
||||
});
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<Resource.ResResourceList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
width: 150,
|
||||
minWidth: 200,
|
||||
search: { el: 'input', tooltip: '我是搜索提示' },
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '资源标识',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'path',
|
||||
label: '路径',
|
||||
width: 300,
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'sort',
|
||||
label: '排序',
|
||||
width: 100,
|
||||
search: {
|
||||
// 自定义 search 显示内容
|
||||
render: ({ searchParam }) => {
|
||||
prop: 'type',
|
||||
label: '类型',
|
||||
width: 150,
|
||||
enum: dictStore.getDictData('resourceType'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
label: '权限资源状态',
|
||||
minWidth: 120,
|
||||
enum: dictStore.getDictData('status'),
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
render: scope => {
|
||||
return (
|
||||
<div class='flx-center'>
|
||||
<el-input vModel_trim={searchParam.minAge} placeholder='最小排序' />
|
||||
<span class='mr10 ml10'>-</span>
|
||||
<el-input vModel_trim={searchParam.maxAge} placeholder='最大排序' />
|
||||
</div>
|
||||
|
||||
<el-tag type={scope.row.state ? 'success' : 'danger'} > {scope.row.state ? '正常' : '禁用'} </el-tag>
|
||||
)
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '类型',
|
||||
width: 150,
|
||||
// 字典数据(本地数据)
|
||||
//enum: dictStore.getDictData('type'),
|
||||
//search: { el: 'select', props: { filterable: true } },
|
||||
//fieldNames: { label: 'label', value: 'resourceType' },
|
||||
search: {
|
||||
// 自定义 search 显示内容
|
||||
render: ({ searchParam }) => {
|
||||
return (
|
||||
<div class='flx-center'>
|
||||
<el-select placeholder="请选择">
|
||||
<el-option label="菜单"></el-option>
|
||||
<el-option label="按钮"></el-option>
|
||||
<el-option label="公共资源"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
)
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'route_Name',
|
||||
width: 200,
|
||||
label: '路由',
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
prop: 'create_Time',
|
||||
label: '创建时间',
|
||||
width: 180,
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
span: 1,
|
||||
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD'},
|
||||
defaultValue: ['2024-11-12', '2024-12-12'],}
|
||||
},
|
||||
{
|
||||
prop: 'update_Time',
|
||||
label: '更新时间',
|
||||
width: 180,
|
||||
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right',minWidth: 200 },
|
||||
])
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
// 打开新增对话框
|
||||
const openAddDialog = () => {
|
||||
dialogForm.value = {
|
||||
id: '',
|
||||
pid:'',
|
||||
pids:'',
|
||||
name: '',
|
||||
path: '',
|
||||
sort: 100,
|
||||
type: '',
|
||||
code:'',
|
||||
path:'',
|
||||
icon:'',
|
||||
sort:100,
|
||||
remark: '',
|
||||
route_Name: '',
|
||||
create_Time: '' ,
|
||||
update_Time: '' ,
|
||||
state:1,
|
||||
children: [],
|
||||
};
|
||||
isEditMode.value = true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<!-- 基础信息弹出框 -->
|
||||
<el-dialog :model-value="dialogVisible" :title="title" v-bind="dialogSmall" @close="handleCancel" width="500" draggable>
|
||||
<div>
|
||||
|
||||
<el-form :model="data"
|
||||
ref='formRuleRef'
|
||||
:rules='rules'
|
||||
@@ -9,9 +10,11 @@
|
||||
<el-form-item label="名称" prop='name' :label-width="100">
|
||||
<el-input v-model="data.name" placeholder="请输入名称" autocomplete="off" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="编码" prop='code' :label-width="100">
|
||||
<el-input v-model="data.code" placeholder="请输入编码" autocomplete="off" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="类型" prop='type' :label-width="100">
|
||||
<el-select v-model="data.type" placeholder="请选择类型" autocomplete="off">
|
||||
<el-option
|
||||
@@ -22,6 +25,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="描述" prop='remark' :label-width="100">
|
||||
<el-input v-model="data.remark" :rows="2" type="textarea" placeholder="请输入备注" autocomplete="off" />
|
||||
</el-form-item>
|
||||
@@ -52,6 +56,7 @@
|
||||
} from '@/api/role/role'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const {dialogVisible,title,data,openType,getTableList} = defineProps<{
|
||||
dialogVisible:boolean;
|
||||
title:string;
|
||||
@@ -66,6 +71,7 @@
|
||||
}
|
||||
}>();
|
||||
|
||||
|
||||
//定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
//定义校验规则
|
||||
@@ -83,6 +89,7 @@
|
||||
}
|
||||
|
||||
const handleOK = () => {
|
||||
|
||||
ElMessage.info('角色数据提交')
|
||||
try {
|
||||
formRuleRef.value?.validate((valid: boolean) => {
|
||||
@@ -119,11 +126,13 @@
|
||||
emit('update:visible',false)
|
||||
} else {
|
||||
ElMessage.error('表单验证失败!')
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('验证过程中发生错误', error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -191,7 +191,7 @@ const openDrawer = (title: string, row: Partial<Role.RoleBO> = {}) => {
|
||||
openType = 'add'
|
||||
else if (title === '编辑角色')
|
||||
openType = 'edit'
|
||||
|
||||
|
||||
rolePopupVisible.value = true
|
||||
rolePopupTitle.value = title
|
||||
|
||||
@@ -204,6 +204,7 @@ const openDrawer = (title: string, row: Partial<Role.RoleBO> = {}) => {
|
||||
}
|
||||
|
||||
rolePopupData.value = safeRow
|
||||
|
||||
} else if (title === '设置权限') {
|
||||
permissionUnitVisible.value = true
|
||||
permissionUnitTitle.value = title
|
||||
|
||||
@@ -21,14 +21,16 @@
|
||||
<script setup lang='tsx' name='useProTable'>
|
||||
// 根据实际路径调整
|
||||
import TimeControl from '@/components/TimeControl/index.vue'
|
||||
import { type Log } from '@/api/log/interface'
|
||||
import { type Sys_Log_Audit } from '@/api/log/interface'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import { Upload ,DataAnalysis} from '@element-plus/icons-vue'
|
||||
import logDataList from '@/api/log/logData'
|
||||
import type { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { reactive,ref,watch } from 'vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
let multipleSelection = ref<string[]>([])
|
||||
const logData = logDataList
|
||||
const dictStore = useDictStore()
|
||||
// 定义包含和排除的单位
|
||||
const includedUnits = ['日', '周', '月', '自定义']; // 可以根据需要包含的单位
|
||||
const excludedUnits = ['季度','年']; // 要排除的单位
|
||||
@@ -36,7 +38,7 @@ const defaultUnits = '日'; // 默认的单位
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<Log.LogList>[]>([
|
||||
const columns = reactive<ColumnProps<Sys_Log_Audit.Audit_LogList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{
|
||||
prop: 'id',
|
||||
@@ -44,15 +46,20 @@ const columns = reactive<ColumnProps<Log.LogList>[]>([
|
||||
width: 70,
|
||||
},
|
||||
{
|
||||
prop: 'user',
|
||||
prop: 'create_By',
|
||||
label: '操作用户',
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
width: 150,
|
||||
search: { el: 'input' },
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'record_Time',
|
||||
prop: 'ip',
|
||||
label: 'IP',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'create_Time',
|
||||
label: '记录时间',
|
||||
width: 200,
|
||||
minWidth: 180,
|
||||
search: {
|
||||
span: 2,
|
||||
render: () => {
|
||||
@@ -69,28 +76,38 @@ const columns = reactive<ColumnProps<Log.LogList>[]>([
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '内容',
|
||||
|
||||
prop: 'remark',
|
||||
label: '事件描述',
|
||||
minWidth: 400,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
prop: 'result',
|
||||
label: '事件结果',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'warn',
|
||||
label: '告警标志',
|
||||
enum: dictStore.getDictData('status'),
|
||||
minWidth: 100,
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
render: scope => {
|
||||
return (
|
||||
<el-tag type={scope.row.warn ? 'danger' : 'success'}>{scope.row.warn ? '告警' : '未告警'}</el-tag>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'operate_Type',
|
||||
label: '日志类型',
|
||||
width: 200,
|
||||
width: 100,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
label: '日志等级',
|
||||
width: 200,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
//选中
|
||||
// 处理选择变化
|
||||
const handleSelectionChange = (selection: Log.LogList[]) => {
|
||||
const handleSelectionChange = (selection: Sys_Log_Audit.Audit_LogList[]) => {
|
||||
multipleSelection.value = selection.map(row => row.id) // 更新选中的行
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const deviceData = deviceDataList
|
||||
const deviceData = deviceDataList.data
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
const errorData = errorDataList.errordetail
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemDetail>[]>([
|
||||
const columns = reactive<ColumnProps<ErrorSystem.Error_detail>[]>([
|
||||
{
|
||||
prop: 'measured',
|
||||
label: '被测量',
|
||||
@@ -46,8 +46,8 @@ const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemDetail>[]>([
|
||||
|
||||
|
||||
interface SpanMethodProps {
|
||||
row: ErrorSystem.ErrorSystemDetail
|
||||
column: TableColumnCtx<ErrorSystem.ErrorSystemDetail>
|
||||
row: ErrorSystem.Error_detail
|
||||
column: TableColumnCtx<ErrorSystem.Error_detail>
|
||||
rowIndex: number
|
||||
columnIndex: number
|
||||
}
|
||||
|
||||
@@ -3,43 +3,47 @@
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="基础信息">
|
||||
<div class="form-grid">
|
||||
<el-form :model="formData" >
|
||||
<el-row :gutter="160" >
|
||||
<el-form :model="formData" ref='formRuleRef' :rules='rules'>
|
||||
<el-row :gutter="120" >
|
||||
<el-col :span="9">
|
||||
<el-form-item label="误差体系名称" prop="name">
|
||||
<el-input v-model='formData.name' placeholder="标准号+年份+设备等级"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发布时间" prop="publishTime">
|
||||
<el-input v-model="formData.publishTime" />
|
||||
<el-form-item label="参照标准名称" prop="standard_Name">
|
||||
<el-input v-model='formData.standard_Name'/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="上传误差体系截图" prop="screenshot">
|
||||
<el-button :icon="FolderOpened" type="primary"></el-button>
|
||||
<el-form-item label="发布时间" prop="standard_Time">
|
||||
<el-input v-model="formData.standard_Time" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="160" >
|
||||
<el-row :gutter="120" >
|
||||
<el-col :span="9">
|
||||
<el-form-item label="适用设备等级" prop="level">
|
||||
<el-select v-model='formData.level' placeholder="请选择设备等级">
|
||||
<el-option label="A级" value="A级" />
|
||||
<el-option label="S级" value="S级" />
|
||||
<el-form-item label="适用设备等级" prop="dev_Level">
|
||||
<el-select v-model='formData.dev_Level' placeholder="请选择设备等级">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('errorLevel')"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实施时间" prop="year">
|
||||
<el-input v-model='formData.year'/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-select v-model='formData.state' placeholder="请选择状态">
|
||||
<el-option label="启用" value="启用" />
|
||||
<el-option label="停用" value="停用" />
|
||||
<el-form-item label="状态" prop="enable">
|
||||
<el-select v-model='formData.enable' placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('status')"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -148,24 +152,40 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ErrorSystemDialog">
|
||||
import { defineProps, defineEmits, reactive,watch,ref } from 'vue';
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const dictStore = useDictStore()
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
dialogTitle: string;
|
||||
|
||||
formData: {
|
||||
id:string;
|
||||
name: string;
|
||||
publishTime:string;
|
||||
year: string;
|
||||
level: string;
|
||||
state: string;
|
||||
id: string;//误差体系表Id
|
||||
name: string;//误差体系名称
|
||||
standard_Name:string;//参照标准名称
|
||||
standard_Time:string;//标准推行时间
|
||||
dev_Level:string;//使用设备等级
|
||||
enable:number;//状态:0-不启用 1-启用
|
||||
state:number;//0-删除 1-正常
|
||||
};
|
||||
}>();
|
||||
|
||||
|
||||
// 定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{ required: true, message: '误差体系名称必填!', trigger: 'blur' }],
|
||||
standard_Name: [{ required: true, message: '参照标准名称必填!', trigger: 'blur' }],
|
||||
standard_Time: [{ required: true, message: '标准推行时间必填!', trigger: 'blur' }],
|
||||
dev_Level:[{ required: true, message: '请选择一项设备等级', trigger: 'change' },],
|
||||
enable:[{ required: true, message: '请选择一项状态', trigger: 'change '},]
|
||||
});
|
||||
|
||||
|
||||
let multipleSelection = ref<number[]>([])
|
||||
const errorTypeOptions = [
|
||||
{ label: '绝对值-标称值', value: 'type1' },
|
||||
@@ -254,12 +274,32 @@ const typeList = [
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
//重置表单内容
|
||||
//取消表单校验状态
|
||||
formRuleRef.value && formRuleRef.value.resetFields()
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
//ElMessage.info('业务数据提交')
|
||||
try {
|
||||
formRuleRef.value?.validate((valid: boolean) => {
|
||||
if (valid)
|
||||
{
|
||||
// 将表单数据转为json,发送到后端
|
||||
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
|
||||
console.log(confirmFormData)
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
}
|
||||
else
|
||||
{
|
||||
ElMessage.error('表单验证失败!')
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('验证过程中发生错误', error)
|
||||
}
|
||||
};
|
||||
|
||||
// 当 props.visible 改变时,更新 formData
|
||||
|
||||
@@ -50,32 +50,36 @@ import { reactive,ref } from 'vue'
|
||||
import type { ErrorSystem } from '@/api/error/interface'
|
||||
import ErrorSystemDialog from "@/views/machine/errorSystem/components/ErrorSystemDialog.vue"; // 导入子组件
|
||||
import ErrorStandardDialog from "@/views/machine/errorSystem/components/ErrorStandardDialog.vue"; // 导入子组件
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const dictStore = useDictStore()
|
||||
let multipleSelection = ref<string[]>([])
|
||||
const errorData = errorDataList.errordata
|
||||
const dialogFormVisible = ref(false)
|
||||
const dialogTitle = ref('新增误差体系')
|
||||
const dialogForm = ref<ErrorSystem.ErrorSystemList>({
|
||||
id: '',
|
||||
name: '',
|
||||
publishTime: '',
|
||||
year:'',
|
||||
level:'',
|
||||
state: '',
|
||||
id: '',
|
||||
name: '',
|
||||
standard_Name:'',
|
||||
standard_Time:'',
|
||||
dev_Level:'',
|
||||
enable:1,
|
||||
state:1,
|
||||
});
|
||||
|
||||
|
||||
|
||||
const detail_dialogFormVisible = ref(false)
|
||||
const detail_dialogTitle = ref('Q/GDW 10650.2-2021 误差体系')
|
||||
const detail_dialogForm = ref<ErrorSystem.ErrorSystemDetail>({
|
||||
const detail_dialogForm = ref<ErrorSystem.Error_detail>({
|
||||
measured: '',//被测量
|
||||
deviceLevel: '',//检测装置级别
|
||||
measurementType:'',
|
||||
condition: '',//测量条件
|
||||
maxErrorValue: '',//最大误差
|
||||
});
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
||||
const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{
|
||||
prop: 'id',
|
||||
@@ -85,28 +89,31 @@ const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
||||
{
|
||||
prop: 'name',
|
||||
label: '误差体系名称',
|
||||
|
||||
},
|
||||
{
|
||||
prop: 'year',
|
||||
prop: 'standard_Name',
|
||||
label: '参照标准名称',
|
||||
},
|
||||
{
|
||||
prop: 'standard_Time',
|
||||
label: '标准实施年份',
|
||||
width: 200,
|
||||
search: { el: 'input' },
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'level',
|
||||
prop: 'dev_Level',
|
||||
label: '适用设备等级',
|
||||
width: 200,
|
||||
width: 120,
|
||||
enum: dictStore.getDictData('errorLevel'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 400, },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
|
||||
])
|
||||
|
||||
// 打开编辑对话框
|
||||
const openEditDialog = (errorSystem: ErrorSystem.ErrorSystemList) => {
|
||||
errorSystem.publishTime ='2024'
|
||||
errorSystem.state = '启用';
|
||||
errorSystem.standard_Time ='2024'
|
||||
dialogForm.value = {...errorSystem};
|
||||
dialogTitle.value = '编辑误差体系';
|
||||
dialogFormVisible.value = true; // 打开对话框
|
||||
@@ -114,12 +121,13 @@ const openEditDialog = (errorSystem: ErrorSystem.ErrorSystemList) => {
|
||||
|
||||
const openAddDialog = () => {
|
||||
dialogForm.value = {
|
||||
id: '',
|
||||
name: '',
|
||||
publishTime: '',
|
||||
year: '',
|
||||
level: '',
|
||||
state: '',
|
||||
id: '',
|
||||
name: '',
|
||||
standard_Name:'',
|
||||
standard_Time:'',
|
||||
dev_Level:'',
|
||||
|
||||
state:0,
|
||||
};
|
||||
dialogTitle.value = '新增误差体系';
|
||||
dialogFormVisible.value = true; // 打开对话框
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogSmall">
|
||||
<el-form :model="formData" >
|
||||
<el-form :model="formData" ref='formRuleRef' :rules='rules'>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" :disabled="isReadOnly"/>
|
||||
</el-form-item>
|
||||
@@ -32,7 +32,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系" prop="type">
|
||||
<el-form-item label="误差体系" prop="type" >
|
||||
<el-select v-model="formData.error_Sys_Id" placeholder="请选择误差体系" :disabled="isReadOnly">
|
||||
<el-option
|
||||
v-for="plan in errorList"
|
||||
@@ -54,7 +54,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits, reactive,watch,ref } from 'vue';
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogSmall} from '@/utils/elementBind'
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
@@ -107,13 +108,41 @@ const emit = defineEmits<{
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
// 定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{ required: true, message: '检测计划名称必填!', trigger: 'blur' }],
|
||||
father_Plan_Id: [{ required: true, message: '参照标准名称必填!', trigger: 'change' }],
|
||||
|
||||
});
|
||||
|
||||
const handleCancel = () => {
|
||||
//重置表单内容
|
||||
//取消表单校验状态
|
||||
formRuleRef.value && formRuleRef.value.resetFields()
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
|
||||
try {
|
||||
formRuleRef.value?.validate((valid: boolean) => {
|
||||
if (valid)
|
||||
{
|
||||
// 将表单数据转为json,发送到后端
|
||||
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
|
||||
console.log(confirmFormData)
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
}
|
||||
else
|
||||
{
|
||||
ElMessage.error('表单验证失败!')
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('验证过程中发生错误', error)
|
||||
}
|
||||
};
|
||||
|
||||
// 当 props.visible 改变时,更新 formData
|
||||
|
||||
@@ -48,42 +48,42 @@
|
||||
const columns = reactive<ColumnProps<Device.DeviceList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{
|
||||
prop: 'Name',
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'Dev_Type',
|
||||
prop: 'dev_Type',
|
||||
label: '类型',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'Dev_Chns',
|
||||
prop: 'dev_Chns',
|
||||
label: '通道数',
|
||||
minWidth: 70,
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'ReCheck_Num',
|
||||
prop: 'reCheck_Num',
|
||||
label: '复检次数',
|
||||
minWidth: 70,
|
||||
},
|
||||
{
|
||||
prop: 'Report_State',
|
||||
prop: 'report_State',
|
||||
label: '报告状态',
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
prop: 'Check_Result',
|
||||
prop: 'check_Result',
|
||||
label: '检测结果',
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
prop: 'Check_State',
|
||||
prop: 'check_State',
|
||||
label: '检测状态',
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
prop: 'Document_State',
|
||||
prop: 'document_State',
|
||||
label: '归档状态',
|
||||
minWidth: 130,
|
||||
},
|
||||
@@ -94,8 +94,6 @@
|
||||
dialogVisible.value = true
|
||||
title.value = textTitle
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<el-button type='primary' link :icon='EditPen' @click="openEditDialog(scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' >删除</el-button>
|
||||
<el-button type='primary' link :icon='List' @click="showDeviceOpen(scope.row)">设备</el-button>
|
||||
<el-button type='primary' link :icon='List' @click="showtestSourceOpen(scope.row)">检测源</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
|
||||
@@ -47,13 +48,16 @@ import type { Plan } from '@/api/plan/interface'
|
||||
import PlanDialog from "@/views/plan/planList/components/PlanDialog.vue"; // 导入子组件
|
||||
import Open from '@/views/plan/planList/components/PlanOpen.vue'
|
||||
import { useViewSize } from '@/hooks/useViewSize'
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const dictStore = useDictStore()
|
||||
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
|
||||
const openView = ref()
|
||||
const planData = planDataList
|
||||
const dialogFormVisible = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const isReadOnly = ref(false)
|
||||
const router = useRouter();
|
||||
const dialogForm = ref<Plan.PlanList>({
|
||||
id: '',
|
||||
name: '',
|
||||
@@ -98,26 +102,32 @@ const columns = reactive<ColumnProps<Plan.PlanList>[]>([
|
||||
prop: 'test_State',
|
||||
label: '检测状态',
|
||||
width: 100,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
enum: dictStore.getDictData('planTestState'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{
|
||||
prop: 'report_State',
|
||||
label: '检测报告状态',
|
||||
width: 150,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
enum: dictStore.getDictData('planReportState'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{
|
||||
prop: 'result',
|
||||
label: '检测结果',
|
||||
width: 100,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
enum: dictStore.getDictData('planResult'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{
|
||||
prop: 'father_Plan_Id',
|
||||
label: '父节点',
|
||||
width: 200,
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 350, },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 500, },
|
||||
])
|
||||
|
||||
// 打开编辑对话框
|
||||
@@ -129,6 +139,7 @@ const openEditDialog = (planSystem: Plan.PlanList) => {
|
||||
};
|
||||
|
||||
const openAddDialog = () => {
|
||||
|
||||
dialogForm.value = {
|
||||
id: '',
|
||||
name: '',
|
||||
@@ -157,6 +168,12 @@ const handleRowClick = (planSystem: Plan.PlanList) =>{
|
||||
const showDeviceOpen = (planSystem: Plan.PlanList) => {
|
||||
openView.value.open('设备列表')
|
||||
}
|
||||
|
||||
const showtestSourceOpen=(planSystem: Plan.PlanList)=>{
|
||||
router.push({
|
||||
path: "/machine/testSource",
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user