代码优化
This commit is contained in:
parent
076644e4f6
commit
9bdae9d218
|
|
@ -8,9 +8,9 @@ VITE_API_URL = '/proxyApi'
|
||||||
# VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
|
# VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
|
||||||
|
|
||||||
# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅
|
# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅
|
||||||
VITE_proxyTarget = 'http://192.168.2.127:28080' # 梁超
|
# VITE_proxyTarget = 'http://192.168.2.127:28080' # 梁超
|
||||||
# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务
|
# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务
|
||||||
# VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务
|
VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务
|
||||||
# VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅j
|
# VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅j
|
||||||
|
|
||||||
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
|
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,10 @@ import userClass from '../hooks/userClass'
|
||||||
const { getCompanyList } = userClass()
|
const { getCompanyList } = userClass()
|
||||||
import imgSrc from '@/assets/img/logo.png'
|
import imgSrc from '@/assets/img/logo.png'
|
||||||
const store: any = mainStore()
|
const store: any = mainStore()
|
||||||
|
const searchTypeName = ref('装备')
|
||||||
const userStore = useStore()
|
const userStore = useStore()
|
||||||
const cart = cartStore()
|
const cart = cartStore()
|
||||||
const isType = localStorage.getItem('rolesType')
|
const isType: any = localStorage.getItem('rolesType')
|
||||||
userStore.editMenuList(1)
|
userStore.editMenuList(1)
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
@ -21,6 +22,7 @@ rolesName.value = localStorage.getItem('rolesType')
|
||||||
const isAdmin = ref(false)
|
const isAdmin = ref(false)
|
||||||
const roles = store.userInfo.roles
|
const roles = store.userInfo.roles
|
||||||
const activeLoginCompanyName = ref('')
|
const activeLoginCompanyName = ref('')
|
||||||
|
const searchCheckVisible = ref(false)
|
||||||
if (roles?.length > 0) {
|
if (roles?.length > 0) {
|
||||||
isAdmin.value = roles.some((e: any) => e.roleKey == 'admin')
|
isAdmin.value = roles.some((e: any) => e.roleKey == 'admin')
|
||||||
}
|
}
|
||||||
|
|
@ -102,16 +104,39 @@ const searchKeywordBtn = () => {
|
||||||
|
|
||||||
store.addHistoryRecord(keywordIptValue.value)
|
store.addHistoryRecord(keywordIptValue.value)
|
||||||
if (route.path == '/equipList') {
|
if (route.path == '/equipList') {
|
||||||
$bus.emit('search', keywordIptValue.value)
|
if (searchTypeName.value === '装备') {
|
||||||
|
$bus.emit('search', keywordIptValue.value)
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
name: 'parity',
|
||||||
|
query: { keyWord: keywordIptValue.value },
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (route.path == '/parity') {
|
if (route.path == '/parity') {
|
||||||
|
if (searchTypeName.value === '需求') {
|
||||||
|
$bus.emit('search', keywordIptValue.value)
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
name: 'equipList',
|
||||||
|
query: { keyWord: keywordIptValue.value },
|
||||||
|
})
|
||||||
|
}
|
||||||
$bus.emit('search', keywordIptValue.value)
|
$bus.emit('search', keywordIptValue.value)
|
||||||
}
|
}
|
||||||
if (route.path == '/home') {
|
if (route.path == '/home') {
|
||||||
router.push({
|
if (searchTypeName.value === '装备') {
|
||||||
name: 'equipList',
|
router.push({
|
||||||
query: { keyWord: keywordIptValue.value },
|
name: 'equipList',
|
||||||
})
|
query: { keyWord: keywordIptValue.value },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (searchTypeName.value === '需求') {
|
||||||
|
router.push({
|
||||||
|
name: 'parity',
|
||||||
|
query: { keyWord: keywordIptValue.value },
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -277,8 +302,76 @@ const onJumpUser = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 中间logo 部分 -->
|
<!-- 中间logo 部分 -->
|
||||||
|
|
||||||
<div class="logo-ipt-container wapper">
|
<div class="logo-ipt-container wapper">
|
||||||
|
<div class="home-logo">
|
||||||
|
<el-image
|
||||||
|
style="width: 70%; margin-left: 60px; cursor: pointer"
|
||||||
|
:src="imgSrc"
|
||||||
|
fit="cover"
|
||||||
|
@click="$router.push('/home')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="home-search">
|
||||||
|
<input
|
||||||
|
:placeholder="searchTypeName === '装备' ? '搜索装备关键词' : '搜索需求关键词'"
|
||||||
|
type="text"
|
||||||
|
v-model.trim="keywordIptValue"
|
||||||
|
@keydown.enter="searchKeywordBtn"
|
||||||
|
ref="inputRef"
|
||||||
|
@focus="placeholderText = ''"
|
||||||
|
@blur="
|
||||||
|
placeholderText =
|
||||||
|
searchTypeName === '装备' ? '搜索装备关键词' : '搜索需求关键词'
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<button class="search-btn" @click="searchKeywordBtn">搜索</button>
|
||||||
|
<div
|
||||||
|
class="left-check-box"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
searchCheckVisible = true
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ searchTypeName }}
|
||||||
|
<el-icon style="margin-left: 5px"><ArrowDownBold /></el-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="check-container" v-if="searchCheckVisible">
|
||||||
|
<div
|
||||||
|
style="border-top-left-radius: 6px; border-top-right-radius: 6px"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
searchTypeName = '装备'
|
||||||
|
searchCheckVisible = false
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
装备
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
searchTypeName = '需求'
|
||||||
|
searchCheckVisible = false
|
||||||
|
}
|
||||||
|
"
|
||||||
|
style="border-bottom-left-radius: 6px; border-bottom-right-radius: 6px"
|
||||||
|
>
|
||||||
|
需求
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cart-container">
|
||||||
|
<div class="cart-icon" @click="onCarts" v-if="isType == 2">
|
||||||
|
<el-badge :value="cartNum">
|
||||||
|
<svg class="icon" aria-hidden="true" style="width: 30px; height: 30px">
|
||||||
|
<use xlink:href="#icon-gouwuche2"></use>
|
||||||
|
</svg>
|
||||||
|
</el-badge>
|
||||||
|
<span style="margin-left: 15px"> 预约车 </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- <img
|
<!-- <img
|
||||||
src="@/assets/img/logo.png"
|
src="@/assets/img/logo.png"
|
||||||
alt="首页"
|
alt="首页"
|
||||||
|
|
@ -286,7 +379,7 @@ const onJumpUser = () => {
|
||||||
@click="$router.push('/home')"
|
@click="$router.push('/home')"
|
||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
<el-image
|
<!-- <el-image
|
||||||
style="width: 190px; cursor: pointer; margin-left: 60px"
|
style="width: 190px; cursor: pointer; margin-left: 60px"
|
||||||
:src="imgSrc"
|
:src="imgSrc"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
|
|
@ -321,7 +414,7 @@ const onJumpUser = () => {
|
||||||
</svg>
|
</svg>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
<span style="margin-left: 15px"> 预约车 </span>
|
<span style="margin-left: 15px"> 预约车 </span>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -454,25 +547,85 @@ const onJumpUser = () => {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #eeeff6;
|
background-color: #eeeff6;
|
||||||
padding: 30px 0 60px 0;
|
padding: 30px 0;
|
||||||
|
box-sizing: content-box;
|
||||||
|
|
||||||
img {
|
// padding: 30px 0 60px 0;
|
||||||
margin-left: 38px;
|
|
||||||
width: 160px;
|
.home-logo {
|
||||||
height: 60px;
|
width: 246px;
|
||||||
cursor: pointer;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.home-search {
|
||||||
|
position: relative;
|
||||||
|
width: 800px;
|
||||||
|
margin-left: 20px;
|
||||||
|
|
||||||
|
.left-check-box {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 53px;
|
||||||
|
width: 70px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-right: 1px solid #3cb4a6;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #11806f;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-container {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: -100%;
|
||||||
|
width: 70px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||||
|
z-index: 999;
|
||||||
|
transition: all 1s linear;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
div {
|
||||||
|
height: 25px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div:hover {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #00a288;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-container {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// img {
|
||||||
|
// margin-left: 38px;
|
||||||
|
// width: 160px;
|
||||||
|
// height: 60px;
|
||||||
|
// cursor: pointer;
|
||||||
|
// }
|
||||||
|
|
||||||
input {
|
input {
|
||||||
width: 700px;
|
width: 100%;
|
||||||
height: 45px;
|
height: 53px;
|
||||||
|
display: block;
|
||||||
border: 1px solid #3cb4a6;
|
border: 1px solid #3cb4a6;
|
||||||
border-radius: 45px;
|
border-radius: 20px;
|
||||||
margin-left: 70px;
|
line-height: 53px;
|
||||||
line-height: 45px;
|
|
||||||
color: #333;
|
color: #333;
|
||||||
text-shadow: 0 0 0 #333;
|
text-shadow: 0 0 0 #333;
|
||||||
padding-left: 30px;
|
padding-left: 75px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:focus {
|
input:focus {
|
||||||
|
|
@ -483,16 +636,20 @@ const onJumpUser = () => {
|
||||||
color: #949494;
|
color: #949494;
|
||||||
}
|
}
|
||||||
.search-btn {
|
.search-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 39px;
|
height: 43px;
|
||||||
transform: translate(-110px, 0);
|
transform: translate(-10px, 5px);
|
||||||
border-radius: 39px;
|
border-radius: 43px;
|
||||||
background: linear-gradient(132deg, #22ab9b 0%, #0d7462 100%);
|
background: linear-gradient(132deg, #22ab9b 0%, #0d7462 100%);
|
||||||
box-shadow: 0px 2px 4px 0px rgba(20, 175, 255, 0.5);
|
box-shadow: 0px 2px 4px 0px rgba(20, 175, 255, 0.5);
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ipt-down {
|
.ipt-down {
|
||||||
|
|
@ -515,9 +672,10 @@ const onJumpUser = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-icon {
|
.cart-icon {
|
||||||
width: 10%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
|
|
|
||||||
|
|
@ -102,9 +102,9 @@
|
||||||
<el-table-column align="center" prop="deviceCode" label="装备编码" />
|
<el-table-column align="center" prop="deviceCode" label="装备编码" />
|
||||||
<el-table-column align="center" prop="deviceName" label="装备名称" />
|
<el-table-column align="center" prop="deviceName" label="装备名称" />
|
||||||
<el-table-column align="center" prop="qcTime" label="最新质检日期" />
|
<el-table-column align="center" prop="qcTime" label="最新质检日期" />
|
||||||
<el-table-column align="center" prop="nickName" label="上传人" width="120" />
|
<el-table-column align="center" prop="createBy" label="创建人" width="120" />
|
||||||
<el-table-column align="center" prop="createTime" label="上传时间" />
|
<el-table-column align="center" prop="createTime" label="上传时间" />
|
||||||
<el-table-column align="center" prop="updateTime" label="更新时间" />
|
<!-- <el-table-column align="center" prop="updateTime" label="更新时间" /> -->
|
||||||
<el-table-column align="center" label="操作" :width="220">
|
<el-table-column align="center" label="操作" :width="220">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -355,7 +355,7 @@
|
||||||
<el-table-column align="center" prop="qcCode" label="维修保养编码" />
|
<el-table-column align="center" prop="qcCode" label="维修保养编码" />
|
||||||
<el-table-column align="center" prop="qcName" label="维修保养名称" />
|
<el-table-column align="center" prop="qcName" label="维修保养名称" />
|
||||||
<el-table-column align="center" prop="qcTime" label="维修保养日期" />
|
<el-table-column align="center" prop="qcTime" label="维修保养日期" />
|
||||||
<el-table-column align="center" prop="createBy" label="上传人" width="120" />
|
<el-table-column align="center" prop="nickName" label="上传人" width="120" />
|
||||||
<el-table-column align="center" prop="createTime" label="上传时间" />
|
<el-table-column align="center" prop="createTime" label="上传时间" />
|
||||||
<el-table-column align="center" label="附件">
|
<el-table-column align="center" label="附件">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue