jiangping
2023-08-22 074f334d060ec7d33d39cdeaae5ed84a2a2dd3a3
Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmMes
已修改9个文件
34 ■■■■ 文件已修改
screen_standard/.env.development 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/public/favicon.ico 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/components/AppLayout.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/router/index.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/utils/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/index.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/process.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/vite.config.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/.env.development
@@ -2,5 +2,5 @@
VITE_NAME='开发环境'
VITE_BASE_CONTEXT=''
VITE_BASE_PATH=''
VITE_BASE_URL='http://192.168.0.35:10021/'
VITE_BASE_PATH='/api'
VITE_BASE_PATH='http://192.168.0.35:10021/'
screen_standard/index.html
@@ -4,7 +4,7 @@
    <meta charset="UTF-8">
    <link rel="icon" href="/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vite App</title>
    <title>DM云工厂</title>
  </head>
  <body>
    <div id="app"></div>
screen_standard/public/favicon.ico

screen_standard/src/components/AppLayout.vue
@@ -148,7 +148,7 @@
      enterprise.setDepartId(data.tempCom.id)
    })
    .catch(err => {})
  const week = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日',]
  const week = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
  setInterval(() => {
    let date = new Date()
    data.tempDate = {
screen_standard/src/router/index.js
@@ -4,7 +4,8 @@
import processView from '../views/process.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHistory(import.meta.env.VITE_BASE_CONTEXT),
  routes: [
    {
      path: '/',
screen_standard/src/utils/request.js
@@ -2,7 +2,7 @@
import { ElMessage } from 'element-plus';
const axiosInstance = axios.create({
    baseURL: '/api',
    baseURL: import.meta.env.VITE_BASE_PATH,
    headers: {'Content-Type': 'application/json'},
    timeout: 60000
});
screen_standard/src/views/index.vue
@@ -15,7 +15,7 @@
                        <div class="content_left_item1_content_row_line">
                            <el-progress
                                :show-text="false"
                                :percentage="item.doneNum">
                                :percentage="item.doneNum / baseNum">
                            </el-progress>
                        </div>
                        <div class="content_left_item1_content_row_num">{{ item.doneNum }}</div>
@@ -207,8 +207,11 @@
        patrolInspection: [],
        dayDistribution: [],
        typeDistribution: [],
        num: 0
        num: 0,
        baseNum: 0
    })
    let { baseNum } = toRefs(data)
    let timer = ref(null)
    let timer1 = ref(null)
@@ -293,11 +296,7 @@
        getTop(companyId.value, departId.value)
            .then(res => {
                if (res.length > 0) {
                    res.forEach((item, index) => {
                        if (index > 1) {
                            item.doneNum1 = res[0].doneNum / item.doneNum
                        }
                    })
                    data.baseNum = res[0].doneNum
                    data.production = res
                }
            })
screen_standard/src/views/process.vue
@@ -719,6 +719,7 @@
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 13px;
        }
      }
    }
screen_standard/vite.config.js
@@ -11,8 +11,9 @@
// https://vitejs.dev/config/
export default defineConfig(({mode, command}) => {
  let env = loadEnv(mode, process.cwd(), '')
  console.log(env.NODE_ENV);
  // console.log(env.NODE_ENV);
  return {
    base:env.VITE_BASE_CONTEXT,
    plugins: [
      vue(),
      vueJsx(),
@@ -42,11 +43,11 @@
      open: true, // 在服务器启动时自动在浏览器中打开应用程序
      //反向代理配置,注意rewrite写法,开始没看文档在这里踩了坑
      proxy: {  // 本地开发环境通过代理实现跨域,生产环境使用 nginx 转发
        '/api': {
        [env.VITE_BASE_PATH] : {
          target: env.VITE_BASE_URL, // 通过代理接口访问实际地址。这里是实际访问的地址。vue会通过代理服务器来代理请求
          changeOrigin: true,
          ws: false,  // 允许websocket代理
          rewrite: (path) => path.replace(/^\/api/, '') // 将api替换为空
          rewrite: (path) => path.replace(/^\[env.VITE_BASE_PATH]/, '') // 将api替换为空
        }
      }
    }