Merge remote-tracking branch 'origin/main'

main
黄伟杰 12 hours ago
commit 2b905e8749

@ -205,6 +205,58 @@ export default {
days: 'days'
}
},
ProcessParameter: {
fields: {
code: 'Process Parameter Code',
name: 'Process Parameter Name',
isEnable: 'Enabled',
remark: 'Remark',
createTime: 'Create Time',
operate: 'Operation'
},
placeholders: {
code: 'Please enter process parameter code',
name: 'Please enter process parameter name',
isEnable: 'Please select enabled status',
remark: 'Please enter remark'
},
messages: {
nameRequired: 'Process parameter name is required',
isEnableRequired: 'Enabled status is required',
codeRequired: 'Code is required'
},
filenames: {
export: 'ProcessParameter.xls'
}
},
ProcessRoute: {
fields: {
code: 'Process Route Code',
name: 'Process Route Name',
isEnable: 'Enabled',
remark: 'Remark',
createTime: 'Create Time',
operate: 'Operation',
items: 'Process Parameter Details',
processParameter: 'Process Parameter'
},
placeholders: {
code: 'Please enter process route code',
name: 'Please enter process route name',
isEnable: 'Please select enabled status',
remark: 'Please enter remark',
processParameter: 'Please select process parameter'
},
messages: {
nameRequired: 'Process route name is required',
isEnableRequired: 'Enabled status is required',
codeRequired: 'Code is required',
itemsRequired: 'Please complete process parameter details'
},
filenames: {
export: 'ProcessRoute.xls'
}
},
ReportDashboard: {
DashboardList: {
searchNameLabel: 'Name',

@ -205,6 +205,58 @@ export default {
days: '天'
}
},
ProcessParameter: {
fields: {
code: '工艺参数编码',
name: '工艺参数名称',
isEnable: '是否启用',
remark: '备注',
createTime: '创建时间',
operate: '操作'
},
placeholders: {
code: '请输入工艺参数编码',
name: '请输入工艺参数名称',
isEnable: '请选择是否启用',
remark: '请输入备注'
},
messages: {
nameRequired: '工艺参数名称不能为空',
isEnableRequired: '是否启用不能为空',
codeRequired: '编码不能为空'
},
filenames: {
export: '工艺参数.xls'
}
},
ProcessRoute: {
fields: {
code: '工艺路线编码',
name: '工艺路线名称',
isEnable: '是否启用',
remark: '备注',
createTime: '创建时间',
operate: '操作',
items: '工艺参数明细',
processParameter: '工艺参数'
},
placeholders: {
code: '请输入工艺路线编码',
name: '请输入工艺路线名称',
isEnable: '请选择是否启用',
remark: '请输入备注',
processParameter: '请选择工艺参数'
},
messages: {
nameRequired: '工艺路线名称不能为空',
isEnableRequired: '是否启用不能为空',
codeRequired: '编码不能为空',
itemsRequired: '请完善工艺参数明细'
},
filenames: {
export: '工艺路线.xls'
}
},
ReportDashboard: {
DashboardList: {
searchNameLabel: '名称',

@ -89,7 +89,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="日志编号" align="center" prop="id" width="100" fix="right" />
<el-table-column label="用户编号" align="center" prop="userId" />
<el-table-column label="用户类型" align="center" prop="userType" sortable>
@ -159,6 +159,18 @@ const message = useMessage() // 消息弹窗
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -182,6 +194,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -221,5 +234,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -86,7 +86,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="日志编号" align="center" prop="id" />
<el-table-column label="用户编号" align="center" prop="userId" />
<el-table-column label="用户类型" align="center" prop="userType" sortable>
@ -172,6 +172,18 @@ const message = useMessage() // 消息弹窗
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -194,6 +206,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -247,5 +260,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -56,7 +56,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column align="center" label="数据源">
<template #default="scope">
{{
@ -163,6 +163,18 @@ const { push } = useRouter() // 路由跳转
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -182,6 +194,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -249,5 +262,11 @@ onMounted(async () => {
await getList()
//
dataSourceConfigList.value = await DataSourceConfigApi.getDataSourceConfigList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -79,7 +79,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="参数主键" align="center" prop="id" />
<el-table-column label="参数分类" align="center" prop="category" />
<el-table-column label="参数名称" align="center" prop="name" :show-overflow-tooltip="true" sortable />
@ -151,6 +151,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -171,6 +183,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -223,5 +236,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -50,7 +50,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="文件名" align="center" prop="name" :show-overflow-tooltip="true" sortable />
<el-table-column label="文件路径" align="center" prop="path" :show-overflow-tooltip="true" />
<el-table-column label="URL" align="center" prop="url" :show-overflow-tooltip="true" />
@ -132,6 +132,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -151,6 +163,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -188,5 +201,11 @@ const handleDelete = async (id: number) => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -61,7 +61,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="配置名" align="center" prop="name" sortable />
<el-table-column label="存储器" align="center" prop="storage">
@ -139,6 +139,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -157,6 +169,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -213,5 +226,11 @@ const handleTest = async (id) => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -71,7 +71,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="任务编号" align="center" prop="id" />
<el-table-column label="任务名称" align="center" prop="name" sortable />
<el-table-column label="任务状态" align="center" prop="status" sortable>
@ -162,6 +162,18 @@ const { push } = useRouter() // 路由
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -181,6 +193,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -296,5 +309,11 @@ const handleJobLog = (id?: number) => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -66,7 +66,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="标题" align="center" prop="title" />
<el-table-column label="内容" align="center" prop="content" />
@ -129,6 +129,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<FeedbackVO[]>([]) //
const total = ref(0) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -150,6 +162,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -206,5 +219,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -74,7 +74,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="关联计划id" align="center" prop="planId" />
<el-table-column label="派工数量" align="center" prop="num" />
@ -141,6 +141,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<BaogongRecordVO[]>([]) //
const total = ref(0) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -161,6 +173,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -213,5 +226,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -7,21 +7,21 @@
label-width="120px"
v-loading="formLoading"
>
<el-form-item label="编码" prop="code">
<el-form-item :label="t('ProcessParameter.fields.code')" prop="code">
<div class="flex items-center gap-2 w-full">
<el-input
v-model="formData.code"
placeholder="请输入编码"
:placeholder="t('ProcessParameter.placeholders.code')"
:disabled="autoCode || formType === 'update'"
class="flex-1"
/>
<el-switch v-model="autoCode" :disabled="formType === 'update'" />
</div>
</el-form-item>
<el-form-item label="工艺参数名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入工艺参数名称" />
<el-form-item :label="t('ProcessParameter.fields.name')" prop="name">
<el-input v-model="formData.name" :placeholder="t('ProcessParameter.placeholders.name')" />
</el-form-item>
<el-form-item label="是否启用" prop="isEnable">
<el-form-item :label="t('ProcessParameter.fields.isEnable')" prop="isEnable">
<el-radio-group v-model="formData.isEnable">
<el-radio
v-for="dict in getStrDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
@ -32,12 +32,12 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-form-item :label="t('ProcessParameter.fields.remark')" prop="remark">
<el-input
v-model="formData.remark"
type="textarea"
:rows="3"
placeholder="请输入备注"
:placeholder="t('ProcessParameter.placeholders.remark')"
/>
</el-form-item>
</el-form>
@ -77,15 +77,15 @@ const formRef = ref()
const validateCode = (_: any, __: any, callback: any) => {
if (!autoCode.value && !formData.value.code) {
callback(new Error('编码不能为空'))
callback(new Error(t('ProcessParameter.messages.codeRequired')))
return
}
callback()
}
const formRules = reactive({
name: [{ required: true, message: '工艺参数名称不能为空', trigger: 'blur' }],
isEnable: [{ required: true, message: '是否启用不能为空', trigger: 'change' }],
name: [{ required: true, message: t('ProcessParameter.messages.nameRequired'), trigger: 'blur' }],
isEnable: [{ required: true, message: t('ProcessParameter.messages.isEnableRequired'), trigger: 'change' }],
code: [{ validator: validateCode, trigger: 'blur' }]
})

@ -7,26 +7,26 @@
:inline="true"
min-label-width="68px"
>
<el-form-item label="工艺参数编码" prop="code">
<el-form-item :label="t('ProcessParameter.fields.code')" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入工艺参数编码"
:placeholder="t('ProcessParameter.placeholders.code')"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="工艺参数名称" prop="name">
<el-form-item :label="t('ProcessParameter.fields.name')" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入工艺参数名称"
:placeholder="t('ProcessParameter.placeholders.name')"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否启用" prop="isEnable">
<el-select v-model="queryParams.isEnable" placeholder="请选择是否启用" clearable class="!w-180px">
<el-form-item :label="t('ProcessParameter.fields.isEnable')" prop="isEnable">
<el-select v-model="queryParams.isEnable" :placeholder="t('ProcessParameter.placeholders.isEnable')" clearable class="!w-180px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
:key="dict.value"
@ -35,7 +35,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime" v-show="showAllFilters">
<el-form-item :label="t('ProcessParameter.fields.createTime')" prop="createTime" v-show="showAllFilters">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
@ -81,31 +81,33 @@
<ContentWrap>
<el-table
ref="tableRef"
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:max-height="planTableMaxHeight"
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" reserve-selection />
<el-table-column label="工艺参数编码" align="center" prop="code" sortable />
<el-table-column label="工艺参数名称" align="center" prop="name" sortable />
<el-table-column label="是否启用" align="center" prop="isEnable" width="100">
<el-table-column :label="t('ProcessParameter.fields.code')" align="center" prop="code" sortable />
<el-table-column :label="t('ProcessParameter.fields.name')" align="center" prop="name" sortable />
<el-table-column :label="t('ProcessParameter.fields.isEnable')" align="center" prop="isEnable" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.isEnable" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column :label="t('ProcessParameter.fields.remark')" align="center" prop="remark" />
<el-table-column
label="创建时间"
:label="t('ProcessParameter.fields.createTime')"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
sortable
/>
<el-table-column label="操作" align="center" min-width="120px">
<el-table-column :label="t('ProcessParameter.fields.operate')" align="center" min-width="120px">
<template #default="scope">
<el-button
link
@ -152,6 +154,18 @@ const { t } = useI18n()
const loading = ref(true)
const list = ref<ProcessParameterVO[]>([])
const total = ref(0)
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -168,6 +182,7 @@ const filterCount = 4
const toggleFilters = () => {
showAllFilters.value = !showAllFilters.value
updatePlanTableMaxHeight()
}
const getList = async () => {
@ -178,6 +193,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -218,7 +234,7 @@ const handleExport = async () => {
ids: selectedIds.value.length ? selectedIds.value.join(',') : undefined
}
const data = await ProcessParameterApi.exportProcessParameter(params)
download.excel(data, '工艺参数.xls')
download.excel(data, t('ProcessParameter.filenames.export'))
} catch {
} finally {
exportLoading.value = false
@ -227,5 +243,11 @@ const handleExport = async () => {
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -7,21 +7,21 @@
label-width="120px"
v-loading="formLoading"
>
<el-form-item label="编码" prop="code">
<el-form-item :label="t('ProcessRoute.fields.code')" prop="code">
<div class="flex items-center gap-2 w-full">
<el-input
v-model="formData.code"
placeholder="请输入编码"
:placeholder="t('ProcessRoute.placeholders.code')"
:disabled="autoCode || formType === 'update'"
class="flex-1"
/>
<el-switch v-model="autoCode" :disabled="formType === 'update'" />
</div>
</el-form-item>
<el-form-item label="工艺路线名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入工艺路线名称" />
<el-form-item :label="t('ProcessRoute.fields.name')" prop="name">
<el-input v-model="formData.name" :placeholder="t('ProcessRoute.placeholders.name')" />
</el-form-item>
<el-form-item label="是否启用" prop="isEnable">
<el-form-item :label="t('ProcessRoute.fields.isEnable')" prop="isEnable">
<el-radio-group v-model="formData.isEnable">
<el-radio
v-for="dict in getStrDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
@ -32,24 +32,24 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-form-item :label="t('ProcessRoute.fields.remark')" prop="remark">
<el-input
v-model="formData.remark"
type="textarea"
:rows="3"
placeholder="请输入备注"
:placeholder="t('ProcessRoute.placeholders.remark')"
/>
</el-form-item>
<el-form-item label="工艺参数明细" prop="items">
<el-form-item :label="t('ProcessRoute.fields.items')" prop="items">
<div class="process-route-items">
<el-table :data="formData.items" border size="small" row-key="id">
<el-table-column label="工艺参数" min-width="260" align="center">
<el-table-column :label="t('ProcessRoute.fields.processParameter')" min-width="260" align="center">
<template #default="scope">
<div class="flex items-center gap-1">
<el-select
v-model="scope.row.processParameterId"
filterable
placeholder="请选择工艺参数"
:placeholder="t('ProcessRoute.placeholders.processParameter')"
class="flex-1"
clearable
>
@ -124,15 +124,15 @@ const formRef = ref()
const validateCode = (_: any, __: any, callback: any) => {
if (!autoCode.value && !formData.value.code) {
callback(new Error('编码不能为空'))
callback(new Error(t('ProcessRoute.messages.codeRequired')))
return
}
callback()
}
const formRules = reactive({
name: [{ required: true, message: '工艺路线名称不能为空', trigger: 'blur' }],
isEnable: [{ required: true, message: '是否启用不能为空', trigger: 'change' }],
name: [{ required: true, message: t('ProcessRoute.messages.nameRequired'), trigger: 'blur' }],
isEnable: [{ required: true, message: t('ProcessRoute.messages.isEnableRequired'), trigger: 'change' }],
code: [{ validator: validateCode, trigger: 'blur' }],
items: [{ validator: (_: any, __: any, callback: any) => validateItems(callback), trigger: 'change' }]
})
@ -247,7 +247,7 @@ const validateItems = (callback: any) => {
const items = formData.value.items || []
const invalidItem = items.find((item) => !item.processParameterId)
if (invalidItem) {
callback(new Error('请完善工艺参数明细'))
callback(new Error(t('ProcessRoute.messages.itemsRequired')))
return
}
callback()

@ -7,26 +7,26 @@
:inline="true"
min-label-width="68px"
>
<el-form-item label="工艺路线编码" prop="code">
<el-form-item :label="t('ProcessRoute.fields.code')" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入工艺路线编码"
:placeholder="t('ProcessRoute.placeholders.code')"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="工艺路线名称" prop="name">
<el-form-item :label="t('ProcessRoute.fields.name')" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入工艺路线名称"
:placeholder="t('ProcessRoute.placeholders.name')"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否启用" prop="isEnable">
<el-select v-model="queryParams.isEnable" placeholder="请选择是否启用" clearable class="!w-180px">
<el-form-item :label="t('ProcessRoute.fields.isEnable')" prop="isEnable">
<el-select v-model="queryParams.isEnable" :placeholder="t('ProcessRoute.placeholders.isEnable')" clearable class="!w-180px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
:key="dict.value"
@ -35,7 +35,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime" v-show="showAllFilters">
<el-form-item :label="t('ProcessRoute.fields.createTime')" prop="createTime" v-show="showAllFilters">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
@ -81,31 +81,33 @@
<ContentWrap>
<el-table
ref="tableRef"
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:max-height="planTableMaxHeight"
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" reserve-selection />
<el-table-column label="工艺路线编码" align="center" prop="code" sortable />
<el-table-column label="工艺路线名称" align="center" prop="name" sortable />
<el-table-column label="是否启用" align="center" prop="isEnable" width="100">
<el-table-column :label="t('ProcessRoute.fields.code')" align="center" prop="code" sortable />
<el-table-column :label="t('ProcessRoute.fields.name')" align="center" prop="name" sortable />
<el-table-column :label="t('ProcessRoute.fields.isEnable')" align="center" prop="isEnable" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.isEnable" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column :label="t('ProcessRoute.fields.remark')" align="center" prop="remark" />
<el-table-column
label="创建时间"
:label="t('ProcessRoute.fields.createTime')"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
sortable
/>
<el-table-column label="操作" align="center" min-width="120px">
<el-table-column :label="t('ProcessRoute.fields.operate')" align="center" min-width="120px">
<template #default="scope">
<el-button
link
@ -152,6 +154,18 @@ const { t } = useI18n()
const loading = ref(true)
const list = ref<ProcessRouteVO[]>([])
const total = ref(0)
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -168,6 +182,7 @@ const filterCount = 4
const toggleFilters = () => {
showAllFilters.value = !showAllFilters.value
updatePlanTableMaxHeight()
}
const getList = async () => {
@ -178,6 +193,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -218,7 +234,7 @@ const handleExport = async () => {
ids: selectedIds.value.length ? selectedIds.value.join(',') : undefined
}
const data = await ProcessRouteApi.exportProcessRoute(params)
download.excel(data, '工艺路线.xls')
download.excel(data, t('ProcessRoute.filenames.export'))
} catch {
} finally {
exportLoading.value = false
@ -227,5 +243,11 @@ const handleExport = async () => {
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -40,7 +40,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelectionChange">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="t('ProductionPlan.WorkReportRecord.tableTaskCodeColumn')" align="center" prop="taskCode" min-width="120px" sortable />
<el-table-column :label="t('ProductionPlan.WorkReportRecord.tablePlanCodeColumn')" align="center" prop="planCode" min-width="120px" sortable />
@ -86,6 +86,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<BaogongRecordStatVO[]>([]) //
const total = ref(0) //
const tableRef = ref()
const planTableMaxHeight = ref(520)
const planPaginationRef = ref<HTMLElement>()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
}
const selectedIds = ref<(string | number)[]>([])
//
@ -142,6 +154,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -217,6 +230,12 @@ const handleStatExport = async () => {
//
onMounted(async () => {
await getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

Loading…
Cancel
Save