Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
3168c917
Commit
3168c917
authored
Aug 14, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加锐印权限
parent
0a84ab31
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
313 additions
and
10 deletions
+313
-10
components.d.ts
+1
-0
src/api/externalAuth.ts
+4
-4
src/api/podUsOrder.ts
+6
-0
src/main.ts
+10
-2
src/router/index.ts
+7
-0
src/router/menu.ts
+5
-0
src/store/permission.ts
+15
-0
src/store/user.ts
+7
-0
src/types/api/auth.ts
+2
-2
src/types/api/externalAuth.ts
+1
-0
src/utils/index.ts
+9
-0
src/views/order/podUs/index.vue
+22
-2
src/views/setting/settingIndex.vue
+224
-0
No files found.
components.d.ts
View file @
3168c917
...
...
@@ -21,6 +21,7 @@ declare module 'vue' {
ElConfigProvider
:
typeof
import
(
'element-plus/es'
)[
'ElConfigProvider'
]
ElDatePicker
:
typeof
import
(
'element-plus/es'
)[
'ElDatePicker'
]
ElDialog
:
typeof
import
(
'element-plus/es'
)[
'ElDialog'
]
ElDivider
:
typeof
import
(
'element-plus/es'
)[
'ElDivider'
]
ElDrawer
:
typeof
import
(
'element-plus/es'
)[
'ElDrawer'
]
ElDropdown
:
typeof
import
(
'element-plus/es'
)[
'ElDropdown'
]
ElDropdownItem
:
typeof
import
(
'element-plus/es'
)[
'ElDropdownItem'
]
...
...
src/api/externalAuth.ts
View file @
3168c917
...
...
@@ -2,11 +2,11 @@ import { BasePaginationData, BaseRespData } from '@/types/api'
import
axios
from
'./axios'
import
{
ExternalAuthListData
}
from
'@/types/api/externalAuth'
export
function
getExternalAuthorisationListApi
(
data
:
{
type
:
string
data
?
:
{
type
?
:
string
},
page
:
number
,
pageSize
:
number
,
page
?
:
number
,
pageSize
?
:
number
,
)
{
return
axios
.
post
<
never
,
BasePaginationData
<
ExternalAuthListData
>>
(
'factory/baseExternalAccount/list_page'
,
...
...
src/api/podUsOrder.ts
View file @
3168c917
...
...
@@ -557,3 +557,9 @@ export function completeDeliveryApi(params: {
export
function
get17TrackInfoApi
(
params
:
{
id
:
string
|
number
})
{
return
axios
.
get
(
`factory/podJomallOrderUs/get17TrackInfo`
,
{
params
})
}
// 获取riin 权限
export
function
getAccountCodeByFactoryIdApi
(
params
:
{
token
:
string
})
{
return
axios
.
get
(
`factory/baseExternalAccount/getAccountCodeByFactoryId`
,
{
params
,
})
}
src/main.ts
View file @
3168c917
...
...
@@ -7,13 +7,21 @@ import './styles/index.scss'
import
VxeUITable
from
'vxe-table'
import
'vxe-table/lib/style.css'
import
{
isPermissionBtn
}
from
'@/utils/index'
import
{
createPinia
}
from
'pinia'
const
pinia
=
createPinia
()
// 确保在渲染用户提供的HTML内容时,不会执行任何潜在的恶意脚本,从而提高应用的安全性
import
vueDomPurifyHTMLPlugin
from
'vue-dompurify-html'
createApp
(
App
)
const
app
=
createApp
(
App
)
app
.
use
(
pinia
)
app
.
use
(
vueDomPurifyHTMLPlugin
)
.
use
(
router
)
.
use
(
store
)
.
use
(
VxeUITable
)
.
mount
(
'#app'
)
app
.
config
.
globalProperties
.
$isPermissionBtn
=
isPermissionBtn
src/router/index.ts
View file @
3168c917
...
...
@@ -256,6 +256,13 @@ const router = createRouter({
},
component
:
WarehousePosition
,
},
{
path
:
'/setting/settingIndex'
,
meta
:
{
title
:
'设置'
,
},
component
:
()
=>
import
(
'@/views/setting/settingIndex.vue'
),
},
],
},
// 登录
...
...
src/router/menu.ts
View file @
3168c917
...
...
@@ -192,6 +192,11 @@ const menu: MenuItem[] = [
},
],
},
{
index
:
'/setting/settingIndex'
,
id
:
7
,
label
:
'设置'
,
},
// {
// index: '',
...
...
src/store/permission.ts
0 → 100644
View file @
3168c917
import
{
defineStore
}
from
'pinia'
const
usePermissionBtnStore
=
defineStore
(
'permissionBtn'
,
{
state
:
()
=>
({
permissionBtns
:
[]
as
string
[],
// 权限按钮数组
}),
actions
:
{
setBtn
(
state
:
string
[])
{
this
.
permissionBtns
=
state
},
},
})
export
default
usePermissionBtnStore
src/store/user.ts
View file @
3168c917
...
...
@@ -30,8 +30,15 @@ const useUserStore = defineStore('user', {
async
login
(
data
:
LoginReq
)
{
try
{
const
resp
=
await
loginApi
(
data
)
console
.
log
(
33
,
resp
)
this
.
setUser
(
resp
.
data
.
sysUser
)
setToken
(
resp
.
data
.
token
)
localStorage
.
setItem
(
'baseExternalAccountTypes'
,
JSON
.
stringify
(
resp
.
data
.
sysUser
.
baseExternalAccountTypes
),
)
router
.
push
({
path
:
'/dashboard'
})
}
catch
(
error
)
{
// showError(error)
...
...
src/types/api/auth.ts
View file @
3168c917
...
...
@@ -24,6 +24,7 @@ export interface SysUser {
factoryCode
:
string
status
:
number
factory
:
Factory
baseExternalAccountTypes
?:
[]
}
export
interface
Factory
{
...
...
@@ -36,4 +37,4 @@ export interface Factory {
goodsNumber
:
number
authorizeNumber
:
number
status
:
number
}
\ No newline at end of file
}
src/types/api/externalAuth.ts
View file @
3168c917
...
...
@@ -16,4 +16,5 @@ export interface ExternalAuthListData {
token
?:
string
refreshToken
?:
string
refreshTokenFailureTime
?:
string
enable
?:
boolean
}
src/utils/index.ts
View file @
3168c917
import
{
get
}
from
'lodash-es'
import
{
ElMessage
}
from
'element-plus'
import
{
DateTime
}
from
'luxon'
import
usePermissionBtnStore
from
'@/store/permission'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export
function
val
<
T
>
(
data
:
T
,
key
:
string
|
((
data
:
T
)
=>
any
))
{
if
(
typeof
key
===
'function'
)
return
key
(
data
)
...
...
@@ -40,3 +42,10 @@ export function convertToChinaTime(
const
chinaTime
=
inputTime
.
setZone
(
targetZone
)
return
chinaTime
.
toFormat
(
'yyyy-MM-dd HH:mm:ss'
)
}
export
function
isPermissionBtn
(
key
:
string
)
{
const
permissionBtns
=
usePermissionBtnStore
().
permissionBtns
if
(
!
permissionBtns
)
return
false
return
permissionBtns
.
includes
(
key
)
}
src/views/order/podUs/index.vue
View file @
3168c917
...
...
@@ -381,7 +381,9 @@
</ElButton>
</span>
</ElFormItem>
<ElFormItem
v-if=
"status === 'TO_BE_CONFIRMED'"
>
<ElFormItem
v-if=
"status === 'TO_BE_CONFIRMED' && isPermissionBtn('RIIN')"
>
<span
class=
"item"
>
<ElButton
type=
"success"
@
click=
"confirmProductToRiin"
>
转至锐印生产
...
...
@@ -1532,7 +1534,10 @@
<
/ElButton
>
<
/span
>
<
span
v
-
if
=
"status === 'IN_TRANSIT' || status === 'COMPLETE'"
v
-
if
=
"
(status === 'IN_TRANSIT' || status === 'COMPLETE') &&
isPermissionBtn('TRACK')
"
class
=
"operate-item"
>
<
ElButton
link
type
=
"primary"
@
click
=
"logTrajectory(row)"
...
...
@@ -2370,6 +2375,7 @@ import {
statusPushApi
,
completeDeliveryApi
,
get17TrackInfoApi
,
getAccountCodeByFactoryIdApi
,
}
from
'@/api/podUsOrder'
import
{
BaseRespData
}
from
'@/types/api'
...
...
@@ -2410,6 +2416,9 @@ import RightClickMenu from '@/components/RightClickMenu.vue'
import
ResultInfo
from
'./components/ResultInfo.vue'
import
{
isArray
,
isString
}
from
'@/utils/validate'
import
platformJson
from
'../../../json/platform.json'
import
{
getToken
}
from
'@/api/axios'
import
usePermissionBtnStore
from
'@/store/permission'
const
permissionBtns
=
usePermissionBtnStore
()
import
{
useRouter
,
type
NavigationGuardNext
,
...
...
@@ -5013,6 +5022,17 @@ function changeChinaTime(zone: string) {
}
)
}
const
token
=
getToken
()
as
string
async
function
getPermission
()
{
const
res
=
await
getAccountCodeByFactoryIdApi
({
token
}
)
permissionBtns
.
setBtn
(
res
.
data
)
console
.
log
(
res
)
}
getPermission
()
const
globalProperties
=
getCurrentInstance
()?.
appContext
.
config
.
globalProperties
// 获取全局挂载
const
isPermissionBtn
=
globalProperties
?.
$isPermissionBtn
useRouter
().
beforeEach
((
to
,
from
,
next
)
=>
{
handleBeforeRouteLeave
(
to
,
from
,
next
)
}
)
...
...
src/views/setting/settingIndex.vue
0 → 100644
View file @
3168c917
<
template
>
<div
class=
"user-page flex-column card h-100 overflow-hidden"
style=
"position: relative"
>
<div
class=
"card-header"
>
<span>
系统配置
</span>
</div>
<div
class=
"cardBox"
shadow=
"never"
>
<div
v-for=
"(item, index) in formList"
style=
"width: 600px"
:key=
"index"
>
<el-form
v-if=
"item.type === 'RIIN'"
class=
"form"
ref=
"formRef"
label-width=
"auto"
:model=
"item"
>
<div
class=
"formBox"
>
<el-form-item
label=
"转至RIIN生产"
>
<el-switch
v-model=
"item.enable"
class=
"ml-2"
style=
"--el-switch-on-color: #42b983"
/>
</el-form-item>
<div
class=
"formContent"
v-if=
"item.enable"
>
<el-form-item
label=
"账号"
prop=
"appKey"
:rules=
"[
{ required: true, message: '请输入RIIN账号' }]"
>
<ElInput
ref=
"productionOrderRef"
v-model=
"item.appKey"
placeholder=
"请输入RIIN账号"
clearable
style=
"width: 100%"
/></el-form-item>
<el-form-item
label=
"App Secret"
prop=
"appSecret"
:rules=
"[
{ required: true, message: '请输入App Secret' }]"
>
<ElInput
ref=
"productionOrderRef"
v-model=
"item.appSecret"
placeholder=
"请输入App Secret"
clearable
style=
"width: 100%"
/></el-form-item>
</div>
</div>
<el-form-item
style=
"margin-bottom: 20px"
>
<ElButton
class=
"btn"
color=
"#42b983"
@
click=
"saveConfiguration(item, index)"
>
保存配置
</ElButton
>
</el-form-item>
</el-form>
<el-form
v-if=
"item.type === 'TRACK'"
class=
"form"
ref=
"formRef"
label-width=
"auto"
:model=
"item"
>
<div
class=
"formBox"
>
<el-form-item
label=
"物流轨迹跟踪"
>
<el-switch
v-model=
"item.enable"
class=
"ml-2"
style=
"--el-switch-on-color: #42b983"
/>
</el-form-item>
<div
class=
"formContent"
v-if=
"item.enable"
>
<el-form-item
label=
"17Track账号"
prop=
"appKey"
:rules=
"[
{ required: true, message: '请输入17Track账号' }]"
>
<ElInput
ref=
"productionOrderRef"
v-model=
"item.appKey"
placeholder=
"请输入17Track账号"
clearable
style=
"width: 100%"
/></el-form-item>
<el-form-item
label=
"账号Token"
prop=
"appSecret"
:rules=
"[
{ required: true, message: '请输入账号Token' }]"
>
<ElInput
ref=
"productionOrderRef"
v-model=
"item.token"
placeholder=
"请输入账号Token"
clearable
style=
"width: 100%"
/></el-form-item>
</div>
</div>
<el-form-item>
<ElButton
class=
"btn"
color=
"#42b983"
@
click=
"saveConfiguration(item, index)"
>
保存配置
</ElButton
>
</el-form-item>
</el-form>
</div>
</div>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
addExternalAuthorisationApi
,
getExternalAuthorisationListApi
,
}
from
'@/api/externalAuth'
import
{
ExternalAuthListData
}
from
'@/types/api/externalAuth'
interface
formType
{
id
?:
number
enable
?:
boolean
appKey
?:
string
appSecret
?:
string
type
?:
string
}
const
formRef
=
ref
()
async
function
saveConfiguration
(
item
:
formType
,
index
:
number
)
{
let
loading
try
{
await
formRef
.
value
[
index
]?.
validate
()
const
params
=
{
...
item
}
const
url
=
!
params
.
id
?
'factory/baseExternalAccount/add'
:
'factory/baseExternalAccount/update'
loading
=
ElLoading
.
service
({
fullscreen
:
true
,
text
:
'操作中...'
,
background
:
'rgba(0, 0, 0, 0.3)'
,
})
const
res
=
await
addExternalAuthorisationApi
(
url
,
params
)
console
.
log
(
res
)
// ElMessage.success('保存配置成功')
await
ElMessageBox
.
confirm
(
'保存配置成功!!需重新登录才能生效'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
showCancelButton
:
false
,
type
:
'success'
,
})
getDetail
()
}
catch
(
error
)
{
console
.
log
(
error
)
}
finally
{
loading
?.
close
()
}
}
const
formList
=
ref
<
ExternalAuthListData
[]
>
([])
async
function
getDetail
()
{
const
res
=
await
getExternalAuthorisationListApi
({},
1
,
100
)
const
newArr
=
[...
res
.
data
.
records
.
filter
((
el
)
=>
el
.
type
)]
const
boolRIIN
=
newArr
.
every
((
el
)
=>
el
.
type
==
'RIIN'
)
const
boolTRACK
=
newArr
.
every
((
el
)
=>
el
.
type
==
'TRACK'
)
if
(
!
newArr
.
length
)
{
formList
.
value
=
[{
type
:
'RIIN'
},
{
type
:
'TRACK'
}]
}
else
if
(
!
boolRIIN
)
{
formList
.
value
=
[...
newArr
,
{
type
:
'RIIN'
}]
}
else
if
(
!
boolTRACK
)
{
formList
.
value
=
[...
newArr
,
{
type
:
'TRACK'
}]
}
else
{
formList
.
value
=
[...
newArr
]
}
console
.
log
(
152
,
formList
.
value
)
}
onMounted
(()
=>
{
getDetail
()
})
</
script
>
<
style
lang=
"scss"
scoped
>
.card-header
{
margin-left
:
200px
;
font-size
:
30px
;
margin-bottom
:
20px
;
}
:deep
()
{
.cardBox
{
overflow-y
:
scroll
;
.el-card__footer
{
border
:
none
!important
;
}
.formBox
{
width
:
100%
;
margin-bottom
:
20px
;
padding
:
20px
;
border
:
1px
solid
#ebebeb
;
border-radius
:
8px
;
&:last-child
{
margin-bottom
:
0
;
}
.formContent
{
padding
:
20px
;
background-color
:
#f9f9f9
;
border-radius
:
5px
;
.
el-form-item
:
last-child
{
margin-bottom
:
0
!important
;
}
}
}
.btn
{
color
:
#fff
;
}
}
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment