wangfei
2025-04-03 d3d7aa9ebbc8265e8dab321d3cee98c385fa696d
卧式缓存模块图片小片显示、系统管理模块新增系统配置页面
7个文件已修改
1个文件已添加
296 ■■■■■ 已修改文件
UI-Project/src/lang/en.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/lang/py.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/lang/zh.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Caching/cachingbefore.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Caching/cachingun.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Identify/identifwutwo.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/User/userpageNo.vue 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/lang/en.js
@@ -399,6 +399,9 @@
          height:'Height',
      },
      productStock:{
          configName:'配置名',
          configCode:'配置代码',
          configValue:'配置值',
          addusers:'Add user',
          username:'User name',
          usernamea:'User name:',
UI-Project/src/lang/py.js
@@ -398,6 +398,9 @@
        height: 'Высота',
    },
    productStock: {
        configName:'配置名',
        configCode:'配置代码',
        configValue:'配置值',
        addusers: 'Добавьте пользователей.',
        username: 'Имя пользователя.',
        usernamea: 'Имя пользователя.:',
UI-Project/src/lang/zh.js
@@ -398,6 +398,12 @@
          height:'高度',
      },
      productStock:{
          addconfigName:'添加配置',
          editconfigName:'修改配置',
          configName:'配置名',
          configCode:'配置代码',
          configValue:'配置值',
          configValuea:'配置值:',
          addusers:'添加用户',
          username:'用户名',
          usernamea:'用户名:',
UI-Project/src/router/index.js
@@ -221,6 +221,11 @@
      path: '/User/permissions',
      name: 'permissions',
      component: () => import('../views/User/permissions.vue')
    },
    {
      path: '/User/userpageNo',
      name: 'userpageNo',
      component: () => import('../views/User/userpageNo.vue')
    }
  ]
 },
UI-Project/src/views/Caching/cachingbefore.vue
@@ -34,11 +34,11 @@
  }
  tableDataa.value = data.EdgStorageCageinfos[0]
  tableDatab.value = data.taskMessage
  // adjustedRects.value = data.EdgStorageCageinfos[0].map(rect => ({
  //     ...rect,
  //     width: rect.width * 0.5 ,
  //     id: rect.id * 10,
  //   }));
  adjustedRects.value = data.EdgStorageCageinfos[0].map((rect, index) => ({
      ...rect,
      id: rect.id * 9,
      showRect: !!data.EdgStorageCageinfos[0][index]?.details[0]
    }));
};
// 格式化后端时间并计算一周前的时间
const defaultTime = ref<[Date, Date]>([new Date(), new Date()]);
@@ -424,12 +424,13 @@
    </el-card>
  <div class="awatch">
    <img src="../../assets/woshihuancun.png" alt="" style="width: 50%;height: 70%;margin-left: 30%;margin-top: 20px;position: relative;"> 
    <div style="position: relative; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;">
    <div style="position: relative; width: 500px;height: 95px;margin-top: -142px;margin-left: 600px;">
    <div  
      v-for="(rect, index) in adjustedRects"
      v-show="rect.showRect"
      :key="rect"  
      :style="{ position: 'absolute', 
       top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`,
      top: `${rect.id}px`, left: `10px`, width: `422px`, height: `3px`,
      backgroundColor: '#409EFF'
       }"  
    >
UI-Project/src/views/Caching/cachingun.vue
@@ -33,6 +33,11 @@
  }
  tableDataa.value = data.EdgStorageCageinfos[0]
  tableDatab.value = data.taskMessage
  adjustedRects.value = data.EdgStorageCageinfos[0].map((rect, index) => ({
      ...rect,
      id: rect.id * 9,
      showRect: !!data.EdgStorageCageinfos[0][index]?.details[0]
    }));
};
// 格式化后端时间并计算一周前的时间
const defaultTime = ref<[Date, Date]>([new Date(), new Date()]);
@@ -401,12 +406,13 @@
    </el-card>
  <div class="awatch">
    <img src="../../assets/woshihuancun.png" alt="" style="width: 50%;height: 70%;margin-left: 30%;margin-top: 20px;position: relative;"> 
    <div style="position: relative; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;">
    <div style="position: relative; width: 500px;height: 95px;margin-top: -222px;margin-left: 600px;">
    <div  
      v-for="(rect, index) in adjustedRects"
      v-show="rect.showRect"
      :key="rect"  
      :style="{ position: 'absolute', 
       top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`,
       top: `${rect.id}px`, left: `10px`, width: `422px`, height: `3px`,
      backgroundColor: '#409EFF'
       }"  
    >
UI-Project/src/views/Identify/identifwutwo.vue
@@ -98,9 +98,9 @@
            // 如果不存在,则添加新矩形,默认 isActive 为 false
            return {
              ...rect,
              xAxisa: rect.xAxis * scaleFactory,
              xAxisa: rect.xAxis * scaleFactor,
              yAxisa: (widthreturn - (rect.yAxis + rect.edgHeight)) * scaleFactory,
              width: rect.edgWidth * scaleFactory,
              width: rect.edgWidth * scaleFactor,
              height: rect.edgHeight * scaleFactory,
              widtha: rect.edgWidth,
              heighta: rect.edgHeight,
UI-Project/src/views/User/userpageNo.vue
New file
@@ -0,0 +1,250 @@
<script setup>
import {Search} from "@element-plus/icons-vue";
import {reactive} from "vue";
import {useRouter} from "vue-router"
const router = useRouter()
const adda = ref(false)
import request from "@/utils/request"
import { ref, onMounted } from "vue";
import { ElMessage, ElMessageBox } from 'element-plus'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
let language = ref(localStorage.getItem('lang') || 'zh')
const selectedProjectNoa = ref(null);
const userName = ref('');
const password = ref('');
const tableData = ref([])
const currentPage2 = ref(1)
const totalRecords = ref(0)
const configValue = ref('')
const isEnable = ref('')
  const listByUserName = async () => {
  try {
  const response = await request.post('/loadGlass/sys/sysConfig/queryConfigPage',{
      pageNo: 1,
      pageSize: 20,
      configName: "",
      configCode: "",
      configValue: "",
      isEnable: 0
     });
    if (response.code === 200) {
        const formattedData = response.data.records.map(record => ({
        ...record,
        formattedCreateTime: formatTimestamp(record.createTime),
        formattedUpdateTime: formatTimestamp(record.updateTime),
      }));
        tableData.value = formattedData;
      totalRecords.value = response.data.total/2 || 0
      } else {
      ElMessage.warning(response.data);
    }
  } catch (error) {
  }
};
onMounted(() => {
  listByUserName('');
});
const handlePageChange2 = (newPage) => {
  currentPage2.value = newPage;
  window.localStorage.setItem('pagenumber', currentPage2.value)
  historicala(currentPage2.value);
};
const historicala = async (page) => {
  try {
  let page = window.localStorage.getItem('pagenumber')
  const response = await request.post('/loadGlass/sys/sysConfig/queryConfigPage',{
      pageNo: page,
      pageSize: 20,
      configName: "",
      configCode: "",
      configValue: "",
      isEnable: 0
     });
    if (response.code === 200) {
        const formattedData = response.data.records.map(record => ({
        ...record,
        formattedCreateTime: formatTimestamp(record.createTime),
        formattedUpdateTime: formatTimestamp(record.updateTime),
      }));
        tableData.value = formattedData;
      totalRecords.value = response.data.total/2 || 0
      } else {
      ElMessage.warning(response.data);
    }
  } catch (error) {
  }
};
// 处理编辑按钮点击
function handleEdit(row) {
  adda.value = true;
  configValue.value = row.configValue
  isEnable.value = row.isEnable
  window.localStorage.setItem('id', row.id)
  window.localStorage.setItem('configName', row.configName)
  window.localStorage.setItem('configCode', row.configCode)
}
const optionsa = [
  {
    value: 0,
    label: t('sorter.disable'),
  },
  {
    value: 1,
    label: t('sorter.start'),
  }
  ]
// function closeDialoga(row) {
//      adda.value = false;
//      userName.value = '';
//      nickName.value = '';
//      password.value = '';
// }
// 编辑
const getTableRowa = async () => {
  let configName = window.localStorage.getItem('configName')
  let configCode = window.localStorage.getItem('configCode')
  let id = window.localStorage.getItem('id')
  try {
    const response = await request.post('/loadGlass/sys/sysConfig/updateConfig',{
      id: id,
      configName: configName,
      configCode: configCode,
      configValue: configValue.value,
      isEnable: isEnable.value
  }
  );
    if (response.code === 200) {
      ElMessage.success(response.message);
      adda.value = false;
      historicala(page)
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
  }
};
// 格式化时间戳为年月日时间字符串的函数
function formatTimestamp(timestamp) {
  const date = new Date(timestamp);
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并补零
  const day = String(date.getDate()).padStart(2, '0'); // 补零
  const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间)
  const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间)
  const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间)
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
</script>
<template>
  <div>
    <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" >
      <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
          <el-table height="400" ref="table" :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"
            :data="tableData">
            <el-table-column prop="configName" align="center" :label="$t('productStock.configName')"/>
          <el-table-column prop="configCode" align="center" :label="$t('productStock.configCode')"/>
          <el-table-column prop="configValue" align="center" :label="$t('productStock.configValue')"/>
          <el-table-column
            align="center"
            :label="$t('sorter.startstatus')"
            prop="isEnable"
          >
          <template #default="scope">
            <el-tag
              :type="scope.row.isEnable === 1 ? 'success' : 'warning'"
            >
              {{ scope.row.isEnable === 1 ? $t('sorter.start') : $t('sorter.disable') }}
            </el-tag>
          </template>
      </el-table-column>
          <el-table-column prop="formattedCreateTime" align="center" :label="$t('film.createtime')"/>
          <el-table-column prop="formattedUpdateTime" align="center" :label="$t('sorter.updateTime')" />
          <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
            <template #default="scope">
              <el-button type="text" plain @click="handleEdit(scope.row)">{{ $t('productStock.exit') }}</el-button>
            </template>
        </el-table-column>
          </el-table>
        </div>
        <div style="margin-top: 20px;margin-left: 40%;">
          <el-pagination
          v-model:current-page="currentPage2"
          :page-size="pageSize"
          :size="large"
          :disabled="disabled"
          layout="prev, pager, next, jumper"
          :total="totalRecords"
          @current-change="handlePageChange2"
          style="margin-top: 10px;"
      />
    </div>
    </el-card>
  </div>
  <el-dialog v-model="adda" top="23vh" width="37%" :title="$t('productStock.reusername')" >
    <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
            <el-form ref="formRef" label-width="150px">
      <el-form label-width="100px" label-position="right">
        <el-row style="margin-top: -15px;margin-bottom: -2px;">
          <el-col :span="6">
              <div id="dt" style="font-size: 15px;">
        <div>
          <el-form-item :label="$t('productStock.configValuea')" :required="true" style="width: 25vw">
                <el-input :placeholder="$t('productStock.configValue')" v-model="configValue" autocomplete="off" style="width: 350px;"/>
              </el-form-item></div></div>
          </el-col>
        </el-row>
        <el-row style="margin-top: 10px;">
          <el-col :span="6">
              <div id="dt" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('searchOrder.startstatusa')" :required="true" style="width: 25vw;">
                <el-select
            :placeholder="$t('searchOrder.startstatus')"
             clearable
             style="width: 350px;"
             v-model="isEnable">
               <el-option
                v-for="item in optionsa"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
          </el-select>
              </el-form-item></div></div>
          </el-col>
        </el-row>
        </el-form>
            </el-form>
          </div>
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="getTableRowa">
          {{ $t('productStock.sure') }}
        </el-button>
        <el-button @click="closeDialoga">{{ $t('productStock.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<style scoped>
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
#dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
#dialog-footer{
  text-align: center;
  margin-top: -15px;
}
#message{
  text-align: center;
  align-items: center;
  color: black;
   width: 200px;
   height: 100px;
   background-color: #337ecc;
   margin-left: 28%;
}
#awatch{
  height: 460px;
  /* margin-top: -60px; */
}
</style>