Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaode-admin-fe
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
0
Merge Requests
0
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
侯明涛
xiaode-admin-fe
Commits
89492153
Commit
89492153
authored
Jul 29, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复bug
parent
b914ba26
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
61 deletions
+78
-61
.env-config.ts
+2
-2
.gitignore
+1
-1
build/config/build.ts
+1
-1
src/config/service.ts
+1
-1
src/plugins/naive.ts
+6
-2
src/router/index.ts
+1
-1
src/service/api/product.ts
+7
-0
src/styles/css/naive.css
+11
-3
src/views/doc-set-ma/index.vue
+47
-49
src/views/product-ma/index.vue
+0
-0
vite.config.ts
+1
-1
No files found.
.env-config.ts
View file @
89492153
...
@@ -16,7 +16,7 @@ const serviceEnvConfig: ServiceEnv = {
...
@@ -16,7 +16,7 @@ const serviceEnvConfig: ServiceEnv = {
proxy
:
'/api'
proxy
:
'/api'
},
},
sit
:
{
sit
:
{
url
:
'http
s://sit-pet.chonglinzs.com/chonglin
-api/manager/api'
,
// 本地调试打开
url
:
'http
://82.156.138.187:19001/sdream
-api/manager/api'
,
// 本地调试打开
proxy
:
''
proxy
:
''
},
},
uat
:
{
uat
:
{
...
@@ -28,7 +28,7 @@ const serviceEnvConfig: ServiceEnv = {
...
@@ -28,7 +28,7 @@ const serviceEnvConfig: ServiceEnv = {
proxy
:
'/api'
proxy
:
'/api'
},
},
prod
:
{
prod
:
{
url
:
'http
s://pet.chonglinzs.com/chonglin
-api/manager/api'
,
// 本地调试打开
url
:
'http
://82.156.138.187:19001/sdream
-api/manager/api'
,
// 本地调试打开
proxy
:
''
proxy
:
''
}
}
};
};
...
...
.gitignore
View file @
89492153
...
@@ -10,7 +10,7 @@ lerna-debug.log*
...
@@ -10,7 +10,7 @@ lerna-debug.log*
node_modules
node_modules
.DS_Store
.DS_Store
dist
dist
chonglin-admin
sdream-admin-fe
dist-ssr
dist-ssr
coverage
coverage
*.local
*.local
...
...
build/config/build.ts
View file @
89492153
...
@@ -4,7 +4,7 @@ export function createViteBuild(viteEnv: ImportMetaEnv, viteCommand: string) {
...
@@ -4,7 +4,7 @@ export function createViteBuild(viteEnv: ImportMetaEnv, viteCommand: string) {
const
isProd
=
viteEnv
.
VITE_ENV_TYPE
===
'prod'
;
const
isProd
=
viteEnv
.
VITE_ENV_TYPE
===
'prod'
;
const
isBuild
=
viteCommand
===
'build'
;
const
isBuild
=
viteCommand
===
'build'
;
const
build
:
Record
<
string
,
any
|
BuildOptions
>
=
{
const
build
:
Record
<
string
,
any
|
BuildOptions
>
=
{
outDir
:
'
chonglin-admin
'
,
outDir
:
'
sdream-admin-fe
'
,
brotliSize
:
false
,
brotliSize
:
false
,
sourcemap
:
false
,
sourcemap
:
false
,
chunkSizeWarningLimit
:
500
,
chunkSizeWarningLimit
:
500
,
...
...
src/config/service.ts
View file @
89492153
/** 请求超时时间 */
/** 请求超时时间 */
export
const
REQUEST_TIMEOUT
=
60
*
1000
;
export
const
REQUEST_TIMEOUT
=
60
*
1000
*
5
;
/** 错误信息的显示时间 */
/** 错误信息的显示时间 */
export
const
ERROR_MSG_DURATION
=
3
*
1000
;
export
const
ERROR_MSG_DURATION
=
3
*
1000
;
...
...
src/plugins/naive.ts
View file @
89492153
...
@@ -78,7 +78,9 @@ import {
...
@@ -78,7 +78,9 @@ import {
NAvatar
,
NAvatar
,
NTimeline
,
NTimeline
,
NTimelineItem
,
NTimelineItem
,
NAlert
NAlert
,
NLayout
,
NLayoutSider
}
from
'naive-ui'
;
}
from
'naive-ui'
;
/** 按需引入naiveUI */
/** 按需引入naiveUI */
...
@@ -162,7 +164,9 @@ export default function setupNaiveUI(app: App) {
...
@@ -162,7 +164,9 @@ export default function setupNaiveUI(app: App) {
NTransfer
,
NTransfer
,
NTimeline
,
NTimeline
,
NTimelineItem
,
NTimelineItem
,
NAlert
NAlert
,
NLayout
,
NLayoutSider
]
]
});
});
app
.
use
(
naive
);
app
.
use
(
naive
);
...
...
src/router/index.ts
View file @
89492153
...
@@ -5,7 +5,7 @@ import { constantRoutes } from './routes';
...
@@ -5,7 +5,7 @@ import { constantRoutes } from './routes';
import
{
scrollBehavior
}
from
'./helpers'
;
import
{
scrollBehavior
}
from
'./helpers'
;
import
{
createRouterGuard
}
from
'./guard'
;
import
{
createRouterGuard
}
from
'./guard'
;
const
history
=
createWebHistory
(
'/
chonglin-admin
'
);
const
history
=
createWebHistory
(
'/
sdream-admin-fe
'
);
export
const
router
=
createRouter
({
export
const
router
=
createRouter
({
history
,
history
,
...
...
src/service/api/product.ts
View file @
89492153
...
@@ -39,6 +39,13 @@ export function fetchDeactivateProduct<T>(params: T) {
...
@@ -39,6 +39,13 @@ export function fetchDeactivateProduct<T>(params: T) {
}
}
/**
/**
* 更新产品状态 (01-启用 02-停用)
*/
export
function
fetchUpdateProductStatus
<
T
>
(
params
:
T
)
{
return
request
.
post
(
`/product/pc/v1/update_product_status`
,
params
)
}
/**
* 删除 产品
* 删除 产品
*/
*/
export
function
fetchDeleteProduct
<
T
>
(
params
:
T
)
{
export
function
fetchDeleteProduct
<
T
>
(
params
:
T
)
{
...
...
src/styles/css/naive.css
View file @
89492153
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
border-radius
:
8px
;
border-radius
:
8px
;
/* 设置dialog的圆角 */
/* 设置dialog的圆角 */
}
}
.n-popover
{
.n-popover
{
border-radius
:
8px
!important
;
border-radius
:
8px
!important
;
/* 设置popover的圆角 */
/* 设置popover的圆角 */
...
@@ -10,14 +11,17 @@
...
@@ -10,14 +11,17 @@
.n-image-preview-toolbar
.n-base-icon
{
.n-image-preview-toolbar
.n-base-icon
{
width
:
1.6em
!important
;
width
:
1.6em
!important
;
}
}
.n-form-item-blank
>
div
,
.n-form-item-blank
>
span
,
.n-form-item-blank
>
div
,
.n-form-item-blank
>
p
{
.n-form-item-blank
>
span
,
.n-form-item-blank
>
p
{
width
:
100%
;
width
:
100%
;
}
}
.n-notification
{
.n-notification
{
border-radius
:
8px
!important
;
border-radius
:
8px
!important
;
}
}
.n-message
{
.n-message
{
border-radius
:
24px
!important
;
border-radius
:
24px
!important
;
}
}
...
@@ -25,3 +29,7 @@
...
@@ -25,3 +29,7 @@
.n-data-table
.n-data-table-th
{
.n-data-table
.n-data-table-th
{
background-color
:
#f7f7f8
!important
;
background-color
:
#f7f7f8
!important
;
}
}
.vxe-table--render-default.border--inner
.vxe-table--header-wrapper
{
background-color
:
#f9f9fb
!important
;
}
src/views/doc-set-ma/index.vue
View file @
89492153
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
}
from
'vue'
;
import
{
ref
,
onMounted
}
from
'vue'
;
import
{
onBeforeRouteLeave
}
from
'vue-router'
import
{
PAGINATION_PAGE_SIZES
}
from
'@/const/index'
import
{
PAGINATION_PAGE_SIZES
}
from
'@/const/index'
import
{
Icon
}
from
'@iconify/vue'
;
import
{
Icon
}
from
'@iconify/vue'
;
import
{
objectClean
}
from
'@/utils'
;
import
{
objectClean
}
from
'@/utils'
;
...
@@ -20,7 +21,8 @@ const docTypeCodeOptions = [
...
@@ -20,7 +21,8 @@ const docTypeCodeOptions = [
{
label
:
'渠道业务规则文档'
,
value
:
'01'
},
{
label
:
'渠道业务规则文档'
,
value
:
'01'
},
{
label
:
'产品相关监管规定文档'
,
value
:
'02'
},
{
label
:
'产品相关监管规定文档'
,
value
:
'02'
},
{
label
:
'产品相关宣传素材文档'
,
value
:
'03'
},
{
label
:
'产品相关宣传素材文档'
,
value
:
'03'
},
{
label
:
'个养-商养产品信息文档'
,
value
:
'04'
},
{
label
:
'个养产品信息文档'
,
value
:
'04'
},
{
label
:
'商养产品信息文档'
,
value
:
'05'
},
]
]
const
docStatusOptions
=
[
const
docStatusOptions
=
[
{
label
:
'草稿'
,
value
:
'00'
},
{
label
:
'草稿'
,
value
:
'00'
},
...
@@ -75,6 +77,11 @@ const queryParams = ref(createQueryParams());
...
@@ -75,6 +77,11 @@ const queryParams = ref(createQueryParams());
/** 检索 */
/** 检索 */
function
handleQuery
()
{
function
handleQuery
()
{
pagination
.
value
=
{
pageSize
:
10
,
itemCount
:
0
,
pageNum
:
1
}
getListData
();
getListData
();
}
}
/** 重置检索 */
/** 重置检索 */
...
@@ -87,9 +94,17 @@ function handleResetQuery() {
...
@@ -87,9 +94,17 @@ function handleResetQuery() {
}
}
getListData
();
getListData
();
}
}
const
timer
=
ref
<
any
>
(
null
)
function
startPolling
()
{
clearTimeout
(
timer
.
value
)
timer
.
value
=
null
timer
.
value
=
setTimeout
(()
=>
{
getListData
(
false
)
},
5000
);
}
async
function
getListData
()
{
async
function
getListData
(
showLoading
=
true
)
{
loading
.
value
=
true
;
loading
.
value
=
showLoading
;
const
{
pageNum
,
pageSize
}
=
pagination
.
value
;
const
{
pageNum
,
pageSize
}
=
pagination
.
value
;
const
{
docName
,
docTypeCode
,
docStatus
,
analyzeStatus
,
createTime
,
auditTime
}
=
queryParams
.
value
;
const
{
docName
,
docTypeCode
,
docStatus
,
analyzeStatus
,
createTime
,
auditTime
}
=
queryParams
.
value
;
const
params
=
{
const
params
=
{
...
@@ -108,6 +123,10 @@ async function getListData() {
...
@@ -108,6 +123,10 @@ async function getListData() {
if
(
data
?.
ok
)
{
if
(
data
?.
ok
)
{
listData
.
value
=
data
.
data
.
records
;
listData
.
value
=
data
.
data
.
records
;
pagination
.
value
.
itemCount
=
data
.
data
.
total
;
pagination
.
value
.
itemCount
=
data
.
data
.
total
;
const
hasParsingData
=
listData
.
value
.
some
((
item
:
any
)
=>
item
.
analyzeStatus
===
'01'
)
if
(
hasParsingData
)
{
startPolling
()
}
}
}
loading
.
value
=
false
;
loading
.
value
=
false
;
}
}
...
@@ -159,7 +178,7 @@ function filterDocStatus(status: string) {
...
@@ -159,7 +178,7 @@ function filterDocStatus(status: string) {
const
isShowAddDocModal
=
ref
(
false
)
const
isShowAddDocModal
=
ref
(
false
)
const
addDocForm
=
ref
({
const
addDocForm
=
ref
<
any
>
({
docTypeCode
:
null
,
docTypeCode
:
null
,
docUrl
:
''
,
docUrl
:
''
,
docName
:
''
,
docName
:
''
,
...
@@ -194,7 +213,7 @@ function onCloseAddDocModal() {
...
@@ -194,7 +213,7 @@ function onCloseAddDocModal() {
}
}
const
addDocLoading
=
ref
(
false
)
const
addDocLoading
=
ref
(
false
)
function
handleValidateAddDocForm
()
{
function
handleValidateAddDocForm
()
{
addDocFormRef
.
value
?.
validate
((
errors
)
=>
{
addDocFormRef
.
value
?.
validate
((
errors
:
any
)
=>
{
if
(
!
errors
)
{
if
(
!
errors
)
{
submitAddProdcutDoc
()
submitAddProdcutDoc
()
}
}
...
@@ -204,7 +223,7 @@ function handleValidateAddDocForm() {
...
@@ -204,7 +223,7 @@ function handleValidateAddDocForm() {
})
})
}
}
const
defaultFileList
=
ref
([])
const
defaultFileList
=
ref
<
any
>
([])
const
operateType
=
ref
(
''
)
const
operateType
=
ref
(
''
)
function
onAddDoc
()
{
function
onAddDoc
()
{
...
@@ -285,15 +304,12 @@ async function customRequest({
...
@@ -285,15 +304,12 @@ async function customRequest({
onFinish
,
onFinish
,
onError
,
onError
,
onProgress
onProgress
}:
UploadCustomRequestOptions
)
{
}:
any
)
{
const
fm
=
new
FormData
()
const
fm
=
new
FormData
()
fm
.
append
(
'file'
,
file
.
file
)
fm
.
append
(
'file'
,
file
.
file
)
fm
.
append
(
'scene'
,
'product'
)
fm
.
append
(
'scene'
,
'product'
)
const
res
=
await
fetchUploadImgFile
(
fm
,
{
const
res
=
await
fetchUploadImgFile
(
fm
,
{
withCredentials
,
withCredentials
onUploadProgress
:
({
percent
})
=>
{
onProgress
({
percent
:
Math
.
ceil
(
percent
)
})
}
})
})
if
(
res
.
data
)
{
if
(
res
.
data
)
{
addDocForm
.
value
.
docUrl
=
res
.
data
.
data
.
fullUrl
addDocForm
.
value
.
docUrl
=
res
.
data
.
data
.
fullUrl
...
@@ -372,6 +388,13 @@ function onAuditDoc(data: any) {
...
@@ -372,6 +388,13 @@ function onAuditDoc(data: any) {
onMounted
(()
=>
{
onMounted
(()
=>
{
getListData
()
getListData
()
})
})
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
clearTimeout
(
timer
.
value
)
timer
.
value
=
null
next
()
})
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<div>
...
@@ -434,6 +457,7 @@ onMounted(() => {
...
@@ -434,6 +457,7 @@ onMounted(() => {
<vxe-column
min-width=
"120"
field=
"analyzeStatus"
title=
"解析状态"
>
<vxe-column
min-width=
"120"
field=
"analyzeStatus"
title=
"解析状态"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<span>
{{
filterAnalyzeStatus
(
row
.
analyzeStatus
)
}}
</span>
<span>
{{
filterAnalyzeStatus
(
row
.
analyzeStatus
)
}}
</span>
<n-spin
v-if=
"row.analyzeStatus === '01'"
class=
"define-mini-size"
:stroke-width=
"22"
size=
"small"
/>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
min-width=
"200"
field=
"createBy"
title=
"创建人"
></vxe-column>
<vxe-column
min-width=
"200"
field=
"createBy"
title=
"创建人"
></vxe-column>
...
@@ -473,46 +497,13 @@ onMounted(() => {
...
@@ -473,46 +497,13 @@ onMounted(() => {
</div>
</div>
</n-card>
</n-card>
<n-modal
v-model:show=
"showAddProductModal"
>
<n-card
style=
"max-width: 600px;"
title=
"新增产品"
:bordered=
"false"
size=
"huge"
role=
"dialog"
aria-modal=
"true"
>
<
template
#
header-extra
>
<Icon
icon=
"ic:sharp-close"
class=
"text-size-22px cursor-pointer"
@
click=
"showAddProductModal = false"
/>
</
template
>
<n-form
ref=
"addProductFormRef"
:model=
"addFormModal"
:rules=
"rules"
label-placement=
"left"
label-width=
"auto"
require-mark-placement=
"right-hanging"
:size=
"size"
:style=
"{
maxWidth: '640px',
}"
>
<n-form-item
label=
"产品编码"
path=
"productCode"
>
<n-input
show-count
maxlength=
"16"
v-model:value=
"addFormModal.productCode"
placeholder=
"产品编码"
/>
</n-form-item>
<n-form-item
label=
"产品名称"
path=
"productName"
>
<n-input
show-count
maxlength=
"32"
v-model:value=
"addFormModal.productName"
placeholder=
"产品名称"
/>
</n-form-item>
<n-form-item
label=
"产品类别"
path=
"productTypeId"
>
<n-select
label-field=
"typeName"
value-field=
"typeId"
v-model:value=
"addFormModal.productTypeId"
clearable
placeholder=
"产品类别"
:options=
"productTypeList"
/>
</n-form-item>
<n-form-item
label=
"产品介绍"
path=
"description"
>
<n-input
type=
"textarea"
v-model:value=
"addFormModal.description"
placeholder=
"产品介绍"
/>
</n-form-item>
</n-form>
<
template
#
footer
>
<n-space
justify=
"center"
>
<n-button
@
click=
"onCloseAddForm"
>
取消
</n-button>
<n-button
:loading=
"addProductLoading"
type=
"primary"
@
click=
"handleValidateAddForm"
>
确定
</n-button>
</n-space>
</
template
>
</n-card>
</n-modal>
<n-modal
v-model:show=
"isShowAddDocModal"
>
<n-modal
v-model:show=
"isShowAddDocModal"
>
<n-card
style=
"max-width: 600px;"
title=
"新增文档"
:bordered=
"false"
size=
"huge"
role=
"dialog"
aria-modal=
"true"
>
<n-card
style=
"max-width: 600px;"
title=
"新增文档"
:bordered=
"false"
size=
"huge"
role=
"dialog"
aria-modal=
"true"
>
<
template
#
header-extra
>
<
template
#
header-extra
>
<Icon
icon=
"ic:sharp-close"
class=
"text-size-22px cursor-pointer"
@
click=
"isShowAddDocModal = false"
/>
<Icon
icon=
"ic:sharp-close"
class=
"text-size-22px cursor-pointer"
@
click=
"isShowAddDocModal = false"
/>
</
template
>
</
template
>
<n-form
ref=
"addDocFormRef"
:model=
"addDocForm"
:rules=
"addDocRules"
label-placement=
"left"
label-width=
"auto"
<n-form
ref=
"addDocFormRef"
:model=
"addDocForm"
:rules=
"addDocRules"
label-placement=
"left"
label-width=
"auto"
require-mark-placement=
"right-hanging"
:s
ize=
"size"
:s
tyle=
"{
require-mark-placement=
"right-hanging"
:style=
"{
maxWidth: '640px',
maxWidth: '640px',
}"
>
}"
>
<n-form-item
label=
"文档类型"
path=
"docTypeCode"
>
<n-form-item
label=
"文档类型"
path=
"docTypeCode"
>
...
@@ -526,8 +517,8 @@ onMounted(() => {
...
@@ -526,8 +517,8 @@ onMounted(() => {
</n-alert>
</n-alert>
<br
/>
<br
/>
<n-upload
:disabled=
"operateType === 'preview'"
@
preview=
"handlePreview"
<n-upload
:disabled=
"operateType === 'preview'"
@
preview=
"handlePreview"
:default-file-list=
"defaultFileList"
accept=
"
'.txt, .docx, .pdf, .doc, .wps, .ett, .xls, .xlsx'
"
:default-file-list=
"defaultFileList"
accept=
"
.txt,.docx,.pdf,.doc,.wps,.ett,.xls,.xlsx"
:max=
"1
"
:max=
"1"
action=
"https://naive-upload.free.beeceptor.com/"
:headers=
"{
action=
"https://naive-upload.free.beeceptor.com/"
:headers=
"{
'naive-info': 'hello!',
'naive-info': 'hello!',
}"
:data=
"{
}"
:data=
"{
'naive-data': 'cool! naive!',
'naive-data': 'cool! naive!',
...
@@ -545,8 +536,8 @@ onMounted(() => {
...
@@ -545,8 +536,8 @@ onMounted(() => {
<n-form-item
<n-form-item
v-if=
"operateType === 'audit' || operateType === 'preview' && (addDocForm.docStatus === '02' || addDocForm.docStatus === '03')"
v-if=
"operateType === 'audit' || operateType === 'preview' && (addDocForm.docStatus === '02' || addDocForm.docStatus === '03')"
label=
"审核意见"
path=
"auditDesc"
>
label=
"审核意见"
path=
"auditDesc"
>
<n-input
:disabled=
"operateType === 'preview'"
type=
"textarea"
v-model:value=
"addDocForm.auditDesc
"
<n-input
maxlength=
"200"
show-count
:disabled=
"operateType === 'preview'"
type=
"textarea
"
placeholder=
"审核意见"
/>
v-model:value=
"addDocForm.auditDesc"
placeholder=
"审核意见"
/>
</n-form-item>
</n-form-item>
</n-form>
</n-form>
<
template
#
footer
v-if=
"operateType !== 'preview'"
>
<
template
#
footer
v-if=
"operateType !== 'preview'"
>
...
@@ -562,3 +553,10 @@ onMounted(() => {
...
@@ -562,3 +553,10 @@ onMounted(() => {
</n-modal>
</n-modal>
</div>
</div>
</template>
</template>
<
style
>
.define-mini-size
.n-base-loading
{
font-size
:
12px
!important
;
margin-left
:
4px
;
}
</
style
>
src/views/product-ma/index.vue
View file @
89492153
This diff is collapsed.
Click to expand it.
vite.config.ts
View file @
89492153
...
@@ -14,7 +14,7 @@ export default defineConfig(configEnv => {
...
@@ -14,7 +14,7 @@ export default defineConfig(configEnv => {
const
viteCommand
=
configEnv
.
command
;
const
viteCommand
=
configEnv
.
command
;
const
vitePath
=
resolvePath
(
'./'
,
import
.
meta
.
url
);
const
vitePath
=
resolvePath
(
'./'
,
import
.
meta
.
url
);
return
{
return
{
base
:
'/
chonglin-admin
/'
,
base
:
'/
sdream-admin-fe
/'
,
resolve
:
{
resolve
:
{
alias
:
{
alias
:
{
'~'
:
vitePath
.
root
,
'~'
:
vitePath
.
root
,
...
...
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