zhangwencui
3 天以前 83b2f9856324fe5c996c0d4d2fadbb8e9f084982
参数加分页
已修改2个文件
76 ■■■■■ 文件已修改
src/views/basicData/parameterMaintenance/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionProcess/index.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/parameterMaintenance/index.vue
@@ -31,10 +31,10 @@
                :column="tableColumn"
                :tableData="tableData"
                :page="page"
                height="calc(100vh - 280px)"
                height="calc(100vh - 320px)"
                :tableLoading="tableLoading"
                :isSelection="false"
                :isShowPagination="false"
                :isShowPagination="true"
                @pagination="pagination">
      </PIMTable>
    </div>
@@ -442,12 +442,16 @@
  const getList = () => {
    tableLoading.value = true;
    // 调用新接口 /baseParam/list
    getBaseParamList({ paramName: searchForm.paramName })
    getBaseParamList({
      paramName: searchForm.paramName,
      current: page.current,
      size: page.size,
    })
      .then(res => {
        tableLoading.value = false;
        if (res.code === 200) {
          tableData.value = res.data || [];
          page.total = res.data?.length || 0;
          tableData.value = res.data?.records || [];
          page.total = res.data?.total || 0;
        } else {
          ElMessage.error(res.msg || "查询失败");
        }
src/views/productionManagement/productionProcess/index.vue
@@ -167,7 +167,7 @@
            </el-input>
          </div>
          <el-table :data="filteredParamList"
                    height="360"
                    height="300"
                    border
                    highlight-current-row
                    @current-change="handleParamSelect">
@@ -183,6 +183,18 @@
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页控件 -->
          <div class="pagination-container"
               style="margin-top: 10px;">
            <el-pagination v-model:current-page="paramPage.current"
                           v-model:page-size="paramPage.size"
                           :page-sizes="[10, 20, 50, 100]"
                           layout="total, sizes, prev, pager, next, jumper"
                           :total="paramPage.total"
                           @size-change="handleParamSizeChange"
                           @current-change="handleParamCurrentChange"
                           size="small" />
          </div>
        </div>
        <!-- 右侧参数详情 -->
        <div class="param-detail-area">
@@ -343,11 +355,6 @@
  // 参数列表数据
  const paramList = ref([]);
  const paramLoading = ref(false);
  const paramPage = reactive({
    current: 1,
    size: 10,
    total: 0,
  });
  // 数据字典
  const dictTypes = ref([]);
@@ -392,6 +399,13 @@
  const filteredParamList = ref([]);
  const selectedParam = ref(null);
  const paramSearchKeyword = ref("");
  // 可选参数分页
  const paramPage = reactive({
    current: 1,
    size: 10,
    total: 0,
  });
  // 编辑参数对话框
  const editParamDialogVisible = ref(false);
@@ -677,10 +691,14 @@
      return;
    }
    // 获取可选参数列表
    getBaseParamList({ paramName: paramSearchKeyword.value }).then(res => {
    getBaseParamList({
      paramName: paramSearchKeyword.value,
      current: paramPage.current,
      size: paramPage.size,
    }).then(res => {
      if (res.code === 200) {
        filteredParamList.value = res.data || [];
        page.total = res.data?.length || 0;
        filteredParamList.value = res.data?.records || [];
        paramPage.total = res.data?.total || 0;
      } else {
        ElMessage.error(res.msg || "查询失败");
      }
@@ -695,14 +713,22 @@
  };
  const handleParamSearch = () => {
    const keyword = paramSearchKeyword.value.trim().toLowerCase();
    if (!keyword) {
      filteredParamList.value = availableParamList.value;
    } else {
      filteredParamList.value = availableParamList.value.filter(item =>
        item.paramName.toLowerCase().includes(keyword)
      );
    }
    // 重置分页
    paramPage.current = 1;
    // 重新加载数据
    handleSelectParam();
  };
  // 处理分页大小变化
  const handleParamSizeChange = size => {
    paramPage.size = size;
    handleSelectParam();
  };
  // 处理当前页码变化
  const handleParamCurrentChange = current => {
    paramPage.current = current;
    handleSelectParam();
  };
  const getParamTypeText = type => {
    const typeMap = {
@@ -975,7 +1001,7 @@
      th {
        background: transparent;
        font-weight: 600;
        color: #ffffff;
        // color: #ffffff;
        border-bottom: none;
        padding: 16px 0;
      }