Commit ff44eebe by huangqy

111

parent 227b5d6c
......@@ -9,7 +9,7 @@
<script>
window._CONFIG = {};
window._CONFIG['publicURL'] = 'http://192.168.3.130:10030';
window._CONFIG['serverURL'] = 'http://192.168.3.130:10029';
window._CONFIG['serverURL'] = 'http://192.168.3.130:10030';
window._CONFIG['wsURL'] = 'ws://192.168.3.130:10030/notice/'
</script>
<body>
......
......@@ -135,5 +135,4 @@ body {
}
.el-collapse-item__wrap {
border: none;
}
\ No newline at end of file
}
\ No newline at end of file
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: [
{
path: '',
......
import axios from 'axios'
import { VueAxios } from './axios'
import { ElMessage } from 'element-plus'
let apiBaseUrl = window._CONFIG['publicURL']
......@@ -10,6 +11,28 @@ const request = axios.create({
timeout: 10000 // 请求超时时间
})
const err = error => {
if (error.response) {
let data = error.response.data
console.log('------异常响应------', error.response.status, data)
switch (error.response.status) {
case 403:
ElMessage.error('拒绝访问')
break
case 500:
ElMessage.error(data.message);
break
case 404:
ElMessage.error('很抱歉,资源未找到!')
break
default:
ElMessage.error(data.message)
break
}
}
return Promise.reject(error)
}
request.interceptors.request.use(config => {
// 给请求头添加一个名为Authorization的密匙
if (sessionStorage.getItem('token')) {
......@@ -24,7 +47,7 @@ request.interceptors.request.use(config => {
request.interceptors.response.use((response) => {
return response.data
})
}, err)
const installer = {
vm: {},
......
......@@ -90,9 +90,9 @@
</el-form-item>
</el-tooltip>
<el-form-item>
<el-button type="primary" @click="resetConfig">读取</el-button>
<el-button type="primary" @click="saveConfig" v-if="sysForm.id">保存</el-button>
<el-button type="primary" @click="syncGoods">同步物资</el-button>
<el-button @click="resetConfig" :color="imgColor">读取</el-button>
<el-button @click="saveConfig" v-if="sysForm.id" :color="imgColor">保存</el-button>
<el-button @click="syncGoods" :color="imgColor">同步物资</el-button>
<el-dropdown @command="handleCommand">
<span :style="{ cursor: 'pointer', marginLeft: '12px', background: imgColor, borderRadius: '4px' }" >
<img src="../assets/icons/主题.png" style="width: 32px;">
......@@ -109,7 +109,7 @@
</el-form>
<el-divider><span style="font-size: 20px;">库房/ip配置</span></el-divider>
<div class="head-container">
<el-button class="filter-item" type="primary" style="float: right" @click="addConfig">新增</el-button>
<el-button class="filter-item" style="float: right" @click="addConfig" :color="imgColor">新增</el-button>
</div>
<el-table :header-cell-style="{backgroundColor: '#f5f7fa',color: '#000',fontSize: '18px',fontWeight: '600'}" :data="configList" border style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="70"/>
......@@ -119,7 +119,7 @@
<el-table-column prop="masterIp" label="物理主机IP" align="center" />
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button type="primary" size="small" @click="editConfig(scope.row)">编辑</el-button>
<el-button size="small" @click="editConfig(scope.row)" :color="imgColor">编辑</el-button>
<el-popconfirm title="你确定删除吗?" @confirm="removeConfig(scope.row)">
<template #reference>
<el-button type="danger" size="small">删除</el-button>
......@@ -136,7 +136,7 @@
</template>
<el-card style="height: calc(100vh - 227.75px)">
<div class="head-container">
<el-button class="filter-item" type="primary" style="float: right" @click="add">新增</el-button>
<el-button class="filter-item" style="float: right" @click="add" :color="imgColor">新增</el-button>
</div>
<el-table :header-cell-style="{backgroundColor: '#f5f7fa',color: '#000',fontSize: '18px',fontWeight: '600'}" :data="channelList" border style="width: 100%;">
<el-table-column prop="stationId" label="通道号" align="center" width="100"/>
......@@ -174,7 +174,7 @@
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button type="primary" size="small" @click="edit(scope.row)">编辑</el-button>
<el-button :color="imgColor" size="small" @click="edit(scope.row)">编辑</el-button>
<el-popconfirm title="你确定删除吗?" @confirm="removeDevice(scope.row)">
<template #reference>
<el-button type="danger" size="small">删除</el-button>
......@@ -194,7 +194,7 @@
<el-select v-model="form.stationId" @change="getLedConfigList" style="width: 200px">
<el-option :label="'通道' + item.stationId" :value="item.stationId" v-for="item in channelList" :key="item.stationId"></el-option>
</el-select>
<el-button class="filter-item" type="primary" style="float: right" @click="addLedConfig">新增</el-button>
<el-button class="filter-item" :color="imgColor" style="float: right" @click="addLedConfig">新增</el-button>
</div>
<el-table :header-cell-style="{backgroundColor: '#f5f7fa',color: '#000',fontSize: '18px',fontWeight: '600'}" :data="ledConfigList" border style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="70"/>
......@@ -210,7 +210,7 @@
<el-table-column prop="fontname" label="字体名称" align="center"/>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button type="primary" size="small" @click="editLedConfig(scope.row)">编辑</el-button>
<el-button :color="imgColor" size="small" @click="editLedConfig(scope.row)">编辑</el-button>
<el-popconfirm title="你确定删除吗?" @confirm="removeLed(scope.row)">
<template #reference>
<el-button type="danger" size="small">删除</el-button>
......@@ -227,7 +227,7 @@
</template>
<el-card style="height: calc(100vh - 227.75px)">
<div class="head-container">
<el-button class="filter-item" type="primary" style="float: right" @click="addGpioConfig">新增</el-button>
<el-button class="filter-item" :color="imgColor" style="float: right" @click="addGpioConfig">新增</el-button>
</div>
<el-table :header-cell-style="{backgroundColor: '#f5f7fa',color: '#000',fontSize: '18px',fontWeight: '600'}" :data="gpioConfigList" border style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="100"/>
......@@ -258,7 +258,7 @@
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button type="primary" size="small" @click="editGpioConfig(scope.row)">编辑</el-button>
<el-button :color="imgColor" size="small" @click="editGpioConfig(scope.row)">编辑</el-button>
<el-popconfirm title="你确定删除吗?" @confirm="removeGpioConfig(scope.row)">
<template #reference>
<el-button type="danger" size="small">删除</el-button>
......
......@@ -5,8 +5,10 @@
<template #header>
<div class="card-header">
<span>计划任务</span>
<el-button class="button" type="warning" @click="syncInBill" :loading="loading">入库单接收</el-button>
<el-button class="button" type="warning" @click="exportData" icon="download">导出单据</el-button>
<div>
<el-button class="button" type="warning" @click="syncInBill" :loading="loading">入库单接收</el-button>
<el-button class="button" type="warning" @click="exportData" icon="download">导出单据</el-button>
</div>
</div>
</template>
<el-table :header-cell-style="{backgroundColor: '#f5f7fa',color: '#000',fontSize: '18px',fontWeight: '550'}"
......@@ -83,7 +85,7 @@
<el-table-column prop="modelName" label="号型名称" align="center" show-overflow-tooltip/>
<el-table-column prop="planAmount" label="计划数量" align="center"/>
<el-table-column prop="realAmount" label="实际数量" align="center"/>
<el-table-column prop="writeAmount" label="手动修改数量" align="center" show-overflow-tooltip width="150">
<el-table-column prop="writeAmount" label="手动修改数量" align="center" show-overflow-tooltip width="160">
<template #default="scope">
<div class="editable-cell">
<div v-if="editable && itemForm.modelCode == scope.row.modelCode" class="editable-cell-input-wrapper">
......@@ -107,6 +109,19 @@
/>
</el-card>
</el-col>
<div style="position: absolute; bottom: 90px; right: 40px; display: flex">
<el-input
type="text"
id="tmScan"
class="ant-input"
placeholder="请扫描条码"
style="margin-right: 20px; width: 300px"
v-model="scanText"
@keydown="parseTm"
/>
<el-button type="primary" ghost @click="openTmScan" style="width: 100px" class="mgr15">条码扫描</el-button>
</div>
</el-row>
</template>
......
......@@ -2,10 +2,10 @@
<el-card style="height: calc(100vh - 147px)">
<template #header>
<div style="display: flex;">
<el-select v-model="positionCode" placeholder="请选择垛位" filterable size="large" class="titleSelect">
<el-select v-model="positionCode" placeholder="请选择垛位" filterable size="large" class="titleSelect" style="width: 280px;margin-right: 15px;">
<el-option :label="'垛位号: ' + item.positionName" :value="item.positionCode" v-for="item in positionList" :key="item.positionCode"></el-option>
</el-select>
<el-select v-model="temporaryName" placeholder="请选择单据" filterable size="large" class="titleSelect" clearable @focus="getTemporaryName">
<el-select v-model="temporaryName" placeholder="请选择单据" filterable size="large" class="titleSelect" clearable @focus="getTemporaryName" style="width: 280px;">
<el-option :label="'单据号: ' + item" :value="item" v-for="item in temporaryList" :key="item"></el-option>
</el-select>
<el-radio-group v-model="type" size="large" @change="changeType" style="margin-left: auto;margin-right: 15px;">
......@@ -58,7 +58,7 @@
</template>
<script>
import { defineComponent, ref, reactive, toRefs, onBeforeUnmount } from 'vue'
import { defineComponent, ref, reactive, toRefs, onBeforeUnmount, onMounted } from 'vue'
import { ElMessage, ElCard } from 'element-plus'
import { postAction, getAction } from '@/api/manage'
import { Help, Monitor } from '@element-plus/icons-vue'
......@@ -75,6 +75,7 @@ export default defineComponent({
const pageNo = ref(1)
const pageSize = ref(10)
const total = ref(0)
const imgColor = ref()
const state = reactive({
......@@ -105,6 +106,14 @@ export default defineComponent({
console.log('A 组件,切换到 B 组件,A 组件消失时执行')
})
onMounted(() => {
if (sessionStorage.getItem('bgColor')) {
imgColor.value = sessionStorage.getItem('bgColor')
} else {
sessionStorage.setItem('bgColor', '#1f8a36')
}
});
const getTableData= () => {
console.log('刷新无单据数据')
pageNo.value = 1
......@@ -228,6 +237,7 @@ export default defineComponent({
pageNo,
pageSize,
total,
imgColor,
handleCurrentChange
}
},
......
......@@ -8,7 +8,7 @@
<el-row>
<el-col :span="6">
<el-card style="height: calc(100vh - 147px);">
<el-radio-group v-model="logType" label="日志类型" @change="changeType">
<el-radio-group v-model="logType" label="日志类型" @change="changeType" :fill="imgColor">
<el-radio-button value="normal" label="出入日志"></el-radio-button>
<el-radio-button value="error" label="异常日志"></el-radio-button>
</el-radio-group>
......@@ -31,7 +31,7 @@
<el-form-item label="号型">
<el-input v-model="searchData.modelName" placeholder="请输入号型"/>
</el-form-item>
<el-button round style="width: 100%" @click="loadData" color="">查询</el-button>
<el-button round style="width: 100%" @click="loadData" :color="imgColor">查询</el-button>
</el-form>
</el-card>
</el-col>
......@@ -100,7 +100,7 @@
<script>
import { defineComponent, ref, reactive, toRefs, getCurrentInstance } from 'vue'
import { defineComponent, ref, reactive, toRefs, getCurrentInstance, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { postAction } from '@/api/manage'
export default defineComponent({
......@@ -117,6 +117,7 @@ export default defineComponent({
endTime: parseTime(new Date())
})
const total = ref(0)
const imgColor = ref()
function parseTime(time) {
if (time) {
......@@ -150,6 +151,15 @@ export default defineComponent({
loadData()
}
onMounted(() => {
if (sessionStorage.getItem('bgColor')) {
imgColor.value = sessionStorage.getItem('bgColor')
} else {
sessionStorage.setItem('bgColor', '#1f8a36')
}
});
const loadData = () => {
searchData.value.startTime = parseTime(new Date(new Date().setHours(0, 0, 0, 0)))
......@@ -188,7 +198,8 @@ export default defineComponent({
logList,
formData,
searchData,
total,
total,
imgColor,
loadData,
handleCurrentChange,
changeType,
......
......@@ -9,7 +9,7 @@ import legacy from '@vitejs/plugin-legacy'
// https://vitejs.dev/config/
export default defineConfig({
base: '/', // 开发或生产环境服务的公共基础路径 配置引入相对路径
base: './', // 开发或生产环境服务的公共基础路径 配置引入相对路径
server: {
// 是否自动打开浏览器
open: true,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论