Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
customisation-management_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
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
qinjianhui
customisation-management_front
Commits
db60a6f0
Commit
db60a6f0
authored
Feb 26, 2024
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 格式化代码
parent
ee8406a7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
593 additions
and
332 deletions
+593
-332
src/api/product.ts
+3
-8
src/views/product/lists/bindDiy.vue
+6
-6
src/views/product/lists/edit.vue
+61
-29
src/views/product/lists/index.vue
+106
-61
src/views/product/xiaoguotu/edit.vue
+72
-40
src/views/product/xiaoguotu/index.vue
+68
-39
src/views/user/setting.vue
+27
-14
src/views/userSave/item/index.vue
+88
-45
src/views/userSave/lists/index.vue
+110
-54
src/views/userSave/lists/renderChima.vue
+52
-36
No files found.
src/api/product.ts
View file @
db60a6f0
import
request
from
'@/utils/request'
//设计产品/成品/系统素材三级分类列表
export
function
shopTypeList
(
params
?:
any
)
{
return
request
.
get
({
url
:
'/api/diy/template/type/list'
,
params
})
...
...
@@ -25,14 +24,13 @@ export function shopTypeChangeTop(params?: any) {
return
request
.
post
({
url
:
'/shop/type/changeTop'
,
params
})
}
//模板列表
export
function
foxpsdDiyTemplateListFindAndCountAll
(
params
:
Record
<
string
,
any
>
)
{
export
function
foxpsdDiyTemplateListFindAndCountAll
(
params
:
Record
<
string
,
any
>
)
{
return
request
.
post
({
url
:
'/api/diy/template/listFindAndCountAll'
,
params
})
}
//foxpsd 模板详情
export
function
foxpsdDiyTemplateItem
(
params
:
Record
<
string
,
any
>
)
{
return
request
.
get
({
url
:
'/foxpsdData/api/diy/template/item'
,
params
})
...
...
@@ -48,7 +46,6 @@ export function apiDiyTemplateUnbindDiy(params?: any) {
return
request
.
post
({
url
:
'/api/diy/template/unbind/diy'
,
params
})
}
// 模板创建
export
function
apiDiyTemplateCreate
(
params
?:
any
)
{
return
request
.
post
({
url
:
'/api/diy/template/create'
,
params
})
...
...
@@ -138,5 +135,3 @@ export function apiDiyTemplateChimaUpdate(params?: any) {
export
function
apiDiyTemplateChimaDelete
(
params
?:
any
)
{
return
request
.
post
({
url
:
'/api/diy/template/chima/delete'
,
params
})
}
src/views/product/lists/bindDiy.vue
View file @
db60a6f0
...
...
@@ -65,7 +65,7 @@ import type { FormInstance } from 'element-plus'
import
{
apiDiyTemplateUpdate
,
apiDiyTemplateCreate
,
apiDiyTemplateBindDiy
,
apiDiyTemplateBindDiy
}
from
'@/api/product'
import
Popup
from
'@/components/popup/index.vue'
import
{
getImageUrl
}
from
'@/utils/getImgUrl'
...
...
@@ -80,7 +80,7 @@ const mobanList: any = ref([])
const
formData
=
reactive
({
id
:
''
,
diy_ids
:
''
,
//待绑定的模板
default_diy_id
:
''
,
default_diy_id
:
''
})
const
formRules
:
any
=
reactive
({
...
...
@@ -88,9 +88,9 @@ const formRules: any = reactive({
{
required
:
true
,
message
:
'请输入标签名称'
,
trigger
:
'blur'
,
}
,
]
,
trigger
:
'blur'
}
]
})
const
templateChange
=
(
e
:
any
)
=>
{
...
...
@@ -150,6 +150,6 @@ const handleClose = () => {
defineExpose
({
open
,
setFormData
,
getDetail
,
getDetail
})
</
script
>
src/views/product/lists/edit.vue
View file @
db60a6f0
<
template
>
<div
class=
"edit-popup"
>
<popup
ref=
"popupRef"
:title=
"popupTitle"
:async=
"true"
width=
"700px"
@
confirm=
"handleSubmit"
@
close=
"handleClose"
>
<el-form
ref=
"formRef"
:model=
"formData"
label-width=
"120px"
:rules=
"formRules"
>
<popup
ref=
"popupRef"
:title=
"popupTitle"
:async=
"true"
width=
"700px"
@
confirm=
"handleSubmit"
@
close=
"handleClose"
>
<el-form
ref=
"formRef"
:model=
"formData"
label-width=
"120px"
:rules=
"formRules"
>
<el-form-item
label=
"模板名称"
prop=
"title"
>
<el-input
v-model=
"formData.title"
placeholder=
"请输入模板名称"
clearable
/>
<el-input
v-model=
"formData.title"
placeholder=
"请输入模板名称"
clearable
/>
</el-form-item>
<el-form-item
label=
"产品主图"
prop=
"img_url"
>
...
...
@@ -16,12 +32,20 @@
</el-form-item>
<el-form-item
label=
"分类"
prop=
"type_id"
>
<el-cascader
v-model=
"formData.type_id"
:options=
"type_list"
:props=
"
{ label: 'title', value: 'id' }" />
<el-cascader
v-model=
"formData.type_id"
:options=
"type_list"
:props=
"
{ label: 'title', value: 'id' }"
/>
</el-form-item>
<el-form-item
label=
"自定义编码"
prop=
"bianma"
>
<el-input
v-model=
"formData.bianma"
placeholder=
"请输入自定义编码"
clearable
/>
<div
class=
" text-xs"
>
自定义编码会合成到生产图中(英文或数字)
</div>
<el-input
v-model=
"formData.bianma"
placeholder=
"请输入自定义编码"
clearable
/>
<div
class=
"text-xs"
>
自定义编码会合成到生产图中(英文或数字)
</div>
</el-form-item>
<el-form-item
label=
"生产图格式"
prop=
"sc_img_type"
>
...
...
@@ -31,7 +55,9 @@
<el-radio
:label=
"2"
>
SVG
</el-radio>
<el-radio
:label=
"3"
>
TIFF
</el-radio>
</el-radio-group>
<div
class=
" text-xs"
>
没特殊需求,请选择方法jpg及svg,其中svg性能最好
</div>
<div
class=
"text-xs"
>
没特殊需求,请选择方法jpg及svg,其中svg性能最好
</div>
</div>
</el-form-item>
...
...
@@ -41,7 +67,9 @@
<el-radio
:label=
"0"
>
后续生成
</el-radio>
<el-radio
:label=
"1"
>
立刻生成
</el-radio>
</el-radio-group>
<div
class=
" text-xs"
>
默认为【后续生成】,可以通过接口等用户下单后再去合成
</div>
<div
class=
"text-xs"
>
默认为【后续生成】,可以通过接口等用户下单后再去合成
</div>
</div>
</el-form-item>
...
...
@@ -53,21 +81,28 @@
</el-form-item>
<el-form-item
label=
"描述"
prop=
"content"
>
<el-input
v-model=
"formData.content"
placeholder=
"请输入描述"
type=
"textarea"
:autosize=
"
{ minRows: 3, maxRows: 3 }" maxlength="200" show-word-limit clearable />
<el-input
v-model=
"formData.content"
placeholder=
"请输入描述"
type=
"textarea"
:autosize=
"
{ minRows: 3, maxRows: 3 }"
maxlength="200"
show-word-limit
clearable
/>
</el-form-item>
</el-form>
</popup>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
type
{
FormInstance
}
from
'element-plus'
import
{
shopTypeList
,
apiDiyTemplateUpdate
,
apiDiyTemplateCreate
}
from
'@/api/product'
import
{
shopTypeList
,
apiDiyTemplateUpdate
,
apiDiyTemplateCreate
}
from
'@/api/product'
import
Popup
from
'@/components/popup/index.vue'
const
emit
=
defineEmits
([
'success'
,
'close'
])
...
...
@@ -87,10 +122,9 @@ const formData = reactive({
bianma
:
''
,
content
:
''
,
sc_img_type
:
1
,
// 1 JPG 2 SVG
chima_now_render
:
0
chima_now_render
:
0
})
const
formRules
:
any
=
reactive
({
title
:
[
{
...
...
@@ -136,34 +170,33 @@ const formRules: any = reactive({
]
})
const
handleSubmit
=
async
()
=>
{
await
formRef
.
value
?.
validate
();
await
formRef
.
value
?.
validate
()
let
obj
:
any
=
{
...
toRaw
(
formData
)
};
const
obj
:
any
=
{
...
toRaw
(
formData
)
}
if
(
obj
.
id
===
''
)
delete
obj
.
id
if
(
obj
.
type_id
&&
obj
.
type_id
.
length
>
0
)
{
obj
.
type_id
=
obj
.
type_id
[
obj
.
type_id
.
length
-
1
]
}
mode
.
value
==
'edit'
?
await
apiDiyTemplateUpdate
(
obj
)
:
await
apiDiyTemplateCreate
(
obj
)
mode
.
value
==
'edit'
?
await
apiDiyTemplateUpdate
(
obj
)
:
await
apiDiyTemplateCreate
(
obj
)
popupRef
.
value
?.
close
()
emit
(
'success'
)
}
const
type_list
=
ref
([]);
const
type_list
=
ref
([])
const
getData
=
async
()
=>
{
le
t
res
=
await
shopTypeList
()
cons
t
res
=
await
shopTypeList
()
console
.
log
(
res
)
type_list
.
value
=
res
.
data
.
list
;
type_list
.
value
=
res
.
data
.
list
}
const
open
=
async
(
key
=
'add'
)
=>
{
mode
.
value
=
key
popupRef
.
value
?.
open
();
popupRef
.
value
?.
open
()
await
getData
()
}
...
...
@@ -176,9 +209,8 @@ const setFormData = (data: Record<any, any>) => {
}
}
const
getDetail
=
async
(
row
:
Record
<
string
,
any
>
)
=>
{
setFormData
(
row
);
setFormData
(
row
)
}
const
handleClose
=
()
=>
{
...
...
src/views/product/lists/index.vue
View file @
db60a6f0
<
template
>
<div
class=
"article-lists"
>
<el-card
class=
"!border-none"
shadow=
"never"
>
<el-form
ref=
"formRef"
class=
"mb-[-16px]"
@
submit
.
native
.
prevent
:model=
"queryParams"
:inline=
"true"
>
<el-form
ref=
"formRef"
class=
"mb-[-16px]"
@
submit
.
native
.
prevent
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"编号/标题"
>
<el-input
class=
"w-[280px]"
v-model=
"queryParams.content"
clearable
@
keyup
.
enter=
"resetPage"
/>
<el-input
class=
"w-[280px]"
v-model=
"queryParams.content"
clearable
@
keyup
.
enter=
"resetPage"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"resetPage"
>
查询
</el-button>
...
...
@@ -26,19 +37,34 @@
<pagination
v-model=
"pager"
@
change=
"getLists"
/>
</div>
<el-table
ref=
"tableRef"
class=
"mt20"
@
selection-change=
"handleSelectionChange"
size=
"large"
v-loading=
"pager.loading"
:data=
"pager.lists"
:tree-props=
"{ children: 'children', hasChildren: 'hasChildren' }"
row-key=
"id"
>
<el-table
ref=
"tableRef"
class=
"mt20"
@
selection-change=
"handleSelectionChange"
size=
"large"
v-loading=
"pager.loading"
:data=
"pager.lists"
:tree-props=
"{ children: 'children', hasChildren: 'hasChildren' }"
row-key=
"id"
>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
label=
"展开"
>
<
template
#
default=
"{ row }"
>
<span
v-if=
"row.children && row.children.length >0"
>
关联模板数:
{{
row
.
children
.
length
}}
</span>
<span
v-if=
"row.children && row.children.length > 0"
>
关联模板数:
{{
row
.
children
.
length
}}
</span
>
</
template
>
</el-table-column>
<el-table-column
label=
"SKU"
width=
"180"
>
<
template
#
default=
"{ row }"
>
<div
class=
"two"
v-copy=
"row.sku"
>
{{
row
.
sku
}}
<icon
class=
"ml-2"
:size=
"14"
color=
"#38f"
name=
"el-icon-DocumentCopy"
/>
<icon
class=
"ml-2"
:size=
"14"
color=
"#38f"
name=
"el-icon-DocumentCopy"
/>
</div>
</
template
>
</el-table-column>
...
...
@@ -46,9 +72,15 @@
<el-table-column
label=
"商品信息"
>
<
template
#
default=
"{ row }"
>
<div
class=
"flex relative"
>
<image-contain
v-if=
"row.img_url"
:src=
"getImageUrl(row.img_url, 200)"
:width=
"100"
:height=
"100"
:preview-src-list=
"[row.img_url]"
preview-teleported
fit=
"contain"
/>
<image-contain
v-if=
"row.img_url"
:src=
"getImageUrl(row.img_url, 200)"
:width=
"100"
:height=
"100"
:preview-src-list=
"[row.img_url]"
preview-teleported
fit=
"contain"
/>
<div
class=
"goodsInfo ml-4"
>
<div
class=
"title"
>
{{
row
.
title
}}
</div>
...
...
@@ -56,7 +88,9 @@
<div
class=
"flex"
>
<div
class=
"one"
>
分类:
</div>
<div
class=
"two"
>
<span
v-if=
"row.db_diy_type"
>
{{
row
.
db_diy_type
.
title
}}
</span>
<span
v-if=
"row.db_diy_type"
>
{{
row
.
db_diy_type
.
title
}}
</span>
</div>
</div>
</div>
...
...
@@ -69,39 +103,44 @@
<el-table-column
label=
"生产图生成格式"
>
<
template
#
default=
"{ row }"
>
<el-tag
v-if=
"row.sc_img_type==
1"
>
JPG
</el-tag>
<el-tag
v-if=
"row.sc_img_type==
2"
>
SVG
</el-tag>
<el-tag
v-if=
"row.sc_img_type==
3"
>
TIFF
</el-tag>
<el-tag
v-if=
"row.sc_img_type ==
1"
>
JPG
</el-tag>
<el-tag
v-if=
"row.sc_img_type ==
2"
>
SVG
</el-tag>
<el-tag
v-if=
"row.sc_img_type ==
3"
>
TIFF
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"尺码图是否立即生成"
>
<
template
#
default=
"{ row }"
>
<el-tag
v-if=
"row.chima_now_render==
1"
>
立刻生成
</el-tag>
<el-tag
v-if=
"row.chima_now_render ==
1"
>
立刻生成
</el-tag>
<el-tag
v-else
>
后续生成
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
prop=
"create_date"
/>
<el-table-column
label=
"创建时间"
prop=
"create_date"
/>
<el-table-column
label=
"上下架"
>
<
template
#
default=
"{ row }"
>
<el-switch
v-model=
"row.status"
:active-value=
"1"
:inactive-value=
"0"
@
change=
"changeStatus($event as number, row.id)"
/>
<el-switch
v-model=
"row.status"
:active-value=
"1"
:inactive-value=
"0"
@
change=
"changeStatus($event as number, row.id)"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"120"
fixed=
"right"
>
<
template
#
default=
"{ row }"
>
<div>
<el-button
type=
"primary"
link
>
<router-link
:to=
"
{
<router-link
:to=
"
{
path: '/product/face',
query: {
did: row.id
}
}">
}"
>
创建层面
</router-link>
</el-button>
...
...
@@ -109,12 +148,14 @@
<div>
<el-button
type=
"primary"
link
>
<router-link
:to=
"
{
<router-link
:to=
"
{
path: '/product/xiaoguotu',
query: {
did: row.id
}
}">
}"
>
创建效果图
</router-link>
</el-button>
...
...
@@ -122,31 +163,36 @@
<div>
<el-button
type=
"primary"
link
>
<router-link
:to=
"
{
<router-link
:to=
"
{
path: '/product/chima',
query: {
did: row.id
}
}">
}"
>
创建尺码
</router-link>
</el-button>
</div>
<div
class=
" mt-3"
>
<div
class=
"mt-3"
>
<el-button
type=
"primary"
link
@
click=
"handleEdit(row)"
>
编辑
</el-button>
</div>
<div
v-if=
"!row.parent_id"
>
<el-button
type=
"primary"
link
@
click=
"handleEdit(row,'bindDiy')"
>
<el-button
type=
"primary"
link
@
click=
"handleEdit(row, 'bindDiy')"
>
绑定模板
</el-button>
</div>
<div
v-if=
"row.children && row.children.length>
0"
>
<div
v-if=
"row.children && row.children.length >
0"
>
<el-button
type=
"primary"
link
@
click=
"unbindDiy(row)"
>
解绑模板
</el-button>
...
...
@@ -166,10 +212,19 @@
</div>
</el-card>
<edit-popup
v-if=
"showEdit"
ref=
"editRef"
@
success=
"getLists"
@
close=
"showEdit = false"
/>
<bind-diy-popup
ref=
"bindDiyRef"
v-if=
"showEdit2"
@
success=
"getLists"
@
close=
"showEdit2 = false"
/>
<edit-popup
v-if=
"showEdit"
ref=
"editRef"
@
success=
"getLists"
@
close=
"showEdit = false"
/>
<bind-diy-popup
ref=
"bindDiyRef"
v-if=
"showEdit2"
@
success=
"getLists"
@
close=
"showEdit2 = false"
/>
</div>
</template>
<
script
lang=
"ts"
setup
name=
"productLists"
>
...
...
@@ -181,12 +236,11 @@ import {
}
from
'@/api/product'
import
{
usePaging
}
from
'@/hooks/usePaging'
import
feedback
from
'@/utils/feedback'
import
{
getImageUrl
}
from
"@/utils/getImgUrl"
;
import
BindDiyPopup
from
"./bindDiy.vue"
import
{
getImageUrl
}
from
'@/utils/getImgUrl'
import
BindDiyPopup
from
'./bindDiy.vue'
import
EditPopup
from
'./edit.vue'
import
type
{
ElTable
}
from
'element-plus'
const
editRef
=
shallowRef
<
InstanceType
<
typeof
EditPopup
>>
()
const
bindDiyRef
=
shallowRef
<
InstanceType
<
typeof
BindDiyPopup
>>
()
const
showEdit
=
ref
(
false
)
...
...
@@ -197,7 +251,7 @@ const tableRef = shallowRef<InstanceType<typeof ElTable>>()
const
queryParams
=
reactive
({
content
:
''
,
type
:
'all'
,
have_all
:
0
have_all
:
0
})
const
{
pager
,
getLists
,
resetPage
,
resetParams
}
=
usePaging
({
...
...
@@ -205,37 +259,35 @@ const { pager, getLists, resetPage, resetParams } = usePaging({
params
:
queryParams
})
const
selectData
=
ref
<
any
[]
>
([])
const
handleSelectionChange
=
(
val
:
any
[])
=>
{
selectData
.
value
=
val
.
map
(({
id
})
=>
id
)
}
const
handleAdd
=
async
()
=>
{
showEdit
.
value
=
true
;
await
nextTick
();
editRef
.
value
?.
open
(
'add'
);
showEdit
.
value
=
true
await
nextTick
()
editRef
.
value
?.
open
(
'add'
)
}
const
handleEdit
=
async
(
data
:
any
,
key
=
'edit'
)
=>
{
if
(
key
==
'edit'
)
{
showEdit
.
value
=
true
;
await
nextTick
();
editRef
.
value
?.
open
(
'edit'
);
const
handleEdit
=
async
(
data
:
any
,
key
=
'edit'
)
=>
{
if
(
key
==
'edit'
)
{
showEdit
.
value
=
true
await
nextTick
()
editRef
.
value
?.
open
(
'edit'
)
editRef
.
value
?.
getDetail
(
data
)
}
else
{
showEdit2
.
value
=
true
;
await
nextTick
();
bindDiyRef
.
value
?.
open
(
'edit'
);
}
else
{
showEdit2
.
value
=
true
await
nextTick
()
bindDiyRef
.
value
?.
open
(
'edit'
)
bindDiyRef
.
value
?.
getDetail
(
data
)
}
}
const
unbindDiy
=
async
(
row
:
any
)
=>
{
const
unbindDiy
=
async
(
row
:
any
)
=>
{
await
feedback
.
confirm
(
'确定要解绑吗?'
)
le
t
res
=
await
apiDiyTemplateUnbindDiy
({
id
:
row
.
id
cons
t
res
=
await
apiDiyTemplateUnbindDiy
({
id
:
row
.
id
})
getLists
()
}
...
...
@@ -250,7 +302,6 @@ const changeStatus = async (status: number, id: number) => {
}
}
const
handleExpand
=
()
=>
{
isExpand
=
!
isExpand
toggleExpand
(
pager
.
lists
,
isExpand
)
...
...
@@ -267,7 +318,7 @@ const toggleExpand = (children: any[], unfold = true) => {
const
handleDelete
=
async
(
id
:
number
)
=>
{
await
feedback
.
confirm
(
'确定要删除?'
)
await
apiDiyTemplateDelete
({
id
})
await
apiDiyTemplateDelete
({
id
})
getLists
()
}
...
...
@@ -278,8 +329,6 @@ onActivated(() => {
onMounted
(()
=>
{
getLists
()
})
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -287,7 +336,6 @@ onMounted(() => {
.title
{
font-weight
:
bold
;
}
}
:deep
(
.el-table__row--level-1
)
{
...
...
@@ -331,10 +379,7 @@ onMounted(() => {
margin-right
:
5px
;
}
}
}
}
.nav_her_btn
{
...
...
src/views/product/xiaoguotu/edit.vue
View file @
db60a6f0
<
template
>
<div
class=
"edit-popup"
>
<popup
ref=
"popupRef"
:title=
"popupTitle"
:async=
"true"
width=
"1000px"
@
confirm=
"handleSubmit"
@
close=
"handleClose"
>
<el-form
ref=
"formRef"
:model=
"formData"
label-width=
"140px"
:rules=
"formRules"
>
<popup
ref=
"popupRef"
:title=
"popupTitle"
:async=
"true"
width=
"1000px"
@
confirm=
"handleSubmit"
@
close=
"handleClose"
>
<el-form
ref=
"formRef"
:model=
"formData"
label-width=
"140px"
:rules=
"formRules"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"14"
>
<el-form-item
label=
"名称"
prop=
"title"
>
<el-input
v-model=
"formData.title"
placeholder=
"请输入名称"
clearable
/>
<el-input
v-model=
"formData.title"
placeholder=
"请输入名称"
clearable
/>
</el-form-item>
<el-form-item
label=
"排序"
prop=
"idx"
>
...
...
@@ -18,23 +34,41 @@
<el-form-item
label=
"颜色"
prop=
"color_id"
>
<el-select
v-model=
"formData.color_id"
>
<el-option
value=
""
>
不绑定颜色
</el-option>
<el-option
:label=
"item.title"
:value=
"item.id"
v-for=
"item in colorList"
:key=
"item.id"
/>
<el-option
:label=
"item.title"
:value=
"item.id"
v-for=
"item in colorList"
:key=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item
class=
"!mb-0"
>
<div>
<upload
:multiple=
"false"
:action=
"`$
{config.baseUrl}/api/v1/upload`" @change="onChange"
@error="onError" type="psd" :saveFoxpsd="false" :show-progress="true">
<el-button
:loading=
"uploadPsdLoading"
type=
"primary"
>
上传PSD文件
</el-button>
<upload
:multiple=
"false"
:action=
"`$
{config.baseUrl}/api/v1/upload`"
@change="onChange"
@error="onError"
type="psd"
:saveFoxpsd="false"
:show-progress="true"
>
<el-button
:loading=
"uploadPsdLoading"
type=
"primary"
>
上传PSD文件
</el-button
>
</upload>
<div>
上传时间较长,请耐心等待
</div>
</div>
</el-form-item>
<el-form-item
label=
"PSD文件"
prop=
"psd_url"
>
<el-input
v-model=
"formData.psd_url"
placeholder=
"psd 文件路径"
clearable
disabled
/>
<el-input
v-model=
"formData.psd_url"
placeholder=
"psd 文件路径"
clearable
disabled
/>
</el-form-item>
</el-col>
...
...
@@ -44,7 +78,9 @@
<div>
<material-picker
v-model=
"formData.img_url"
:limit=
"1"
/>
</div>
<div
class=
"text-xs"
>
png,jpg,jpeg等格式,最大为100kb,750*750像素
</div>
<div
class=
"text-xs"
>
png,jpg,jpeg等格式,最大为100kb,750*750像素
</div>
</div>
</el-form-item>
</el-col>
...
...
@@ -55,7 +91,6 @@
</
template
>
<
script
lang=
"ts"
setup
>
import
type
{
FormInstance
}
from
'element-plus'
import
{
apiDiyTemplateXiaoguotuUpdate
,
...
...
@@ -67,7 +102,6 @@ import Popup from '@/components/popup/index.vue'
import
config
from
'@/config'
import
feedback
from
'@/utils/feedback'
const
emit
=
defineEmits
([
'success'
,
'close'
])
const
formRef
=
shallowRef
<
FormInstance
>
()
const
popupRef
=
shallowRef
<
InstanceType
<
typeof
Popup
>>
()
...
...
@@ -75,7 +109,7 @@ const mode = ref('add')
const
popupTitle
=
computed
(()
=>
{
return
mode
.
value
==
'edit'
?
'编辑效果图'
:
'新增效果图'
})
const
route
=
useRoute
()
;
const
route
=
useRoute
()
const
uploadPsdLoading
=
ref
(
false
)
const
formData
=
reactive
({
...
...
@@ -139,62 +173,61 @@ const formRules: any = reactive({
})
const
onChange
=
async
(
e
:
any
)
=>
{
console
.
log
(
e
);
uploadPsdLoading
.
value
=
true
;
let
relativePath
=
e
.
response
.
data
.
relativePath
;
le
t
res
=
await
apiPsdParser
({
console
.
log
(
e
)
uploadPsdLoading
.
value
=
true
const
relativePath
=
e
.
response
.
data
.
relativePath
cons
t
res
=
await
apiPsdParser
({
lianjie
:
relativePath
,
upload
:
'oss'
})
if
(
res
.
data
.
width
>
1600
||
res
.
data
.
height
>
1600
)
{
feedback
.
msgError
(
"psd 最大可上传1600*1600像素"
);
feedback
.
msgError
(
'psd 最大可上传1600*1600像素'
)
return
}
formData
.
img_url
=
res
.
data
.
img_url
;
formData
.
psd_url
=
res
.
data
.
relativePath
;
formData
.
psd_svg
=
res
.
data
.
svg
;
formData
.
psd_txt
=
res
.
data
.
txt
;
formData
.
dpi
=
res
.
data
.
dpi
;
formData
.
width
=
res
.
data
.
width
;
formData
.
height
=
res
.
data
.
height
;
formData
.
img_url
=
res
.
data
.
img_url
formData
.
psd_url
=
res
.
data
.
relativePath
formData
.
psd_svg
=
res
.
data
.
svg
formData
.
psd_txt
=
res
.
data
.
txt
formData
.
dpi
=
res
.
data
.
dpi
formData
.
width
=
res
.
data
.
width
formData
.
height
=
res
.
data
.
height
uploadPsdLoading
.
value
=
false
;
uploadPsdLoading
.
value
=
false
}
const
onError
=
(
e
:
any
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
)
}
const
handleSubmit
=
async
()
=>
{
await
formRef
.
value
?.
validate
();
await
formRef
.
value
?.
validate
()
let
obj
:
any
=
{
...
toRaw
(
formData
)
};
const
obj
:
any
=
{
...
toRaw
(
formData
)
}
if
(
obj
.
id
===
''
)
delete
obj
.
id
if
(
obj
.
id
)
delete
obj
.
diy_id
mode
.
value
==
'edit'
?
await
apiDiyTemplateXiaoguotuUpdate
(
obj
)
:
await
apiDiyTemplateXiaoguotuCreate
(
obj
)
mode
.
value
==
'edit'
?
await
apiDiyTemplateXiaoguotuUpdate
(
obj
)
:
await
apiDiyTemplateXiaoguotuCreate
(
obj
)
popupRef
.
value
?.
close
()
emit
(
'success'
)
}
const
colorList
:
any
=
ref
([]);
const
colorList
:
any
=
ref
([])
const
getData
=
async
()
=>
{
let
res
:
any
=
await
apiDiyTemplateColorList
({
const
res
:
any
=
await
apiDiyTemplateColorList
({
diy_id
:
route
.
query
.
did
})
colorList
.
value
=
res
.
data
.
list
;
colorList
.
value
=
res
.
data
.
list
}
const
open
=
async
(
key
=
'add'
,
pager
:
any
)
=>
{
mode
.
value
=
key
popupRef
.
value
?.
open
();
await
getData
();
popupRef
.
value
?.
open
()
await
getData
()
}
const
setFormData
=
(
data
:
Record
<
any
,
any
>
)
=>
{
...
...
@@ -206,9 +239,8 @@ const setFormData = (data: Record<any, any>) => {
}
}
const
getDetail
=
async
(
row
:
Record
<
string
,
any
>
)
=>
{
setFormData
(
row
);
setFormData
(
row
)
}
const
handleClose
=
()
=>
{
...
...
src/views/product/xiaoguotu/index.vue
View file @
db60a6f0
...
...
@@ -4,15 +4,17 @@
<el-page-header
:content=
"$route.meta.title"
@
back=
"goBack"
/>
</el-card>
<el-card
class=
"!border-none mt-2"
shadow=
"never"
v-loading=
"pager.loading"
v-if=
"activeTab=='xiaoguotu'"
>
<el-tabs
v-model=
"activeTab"
class=
" bg-white"
>
<el-card
class=
"!border-none mt-2"
shadow=
"never"
v-loading=
"pager.loading"
v-if=
"activeTab == 'xiaoguotu'"
>
<el-tabs
v-model=
"activeTab"
class=
"bg-white"
>
<el-tab-pane
label=
"效果图"
name=
"xiaoguotu"
></el-tab-pane>
<el-tab-pane
label=
"颜色"
name=
"color"
></el-tab-pane>
</el-tabs>
<div
class=
"mb-4 mt-2"
>
<el-button
type=
"primary"
@
click=
"handleAdd()"
>
<template
#
icon
>
...
...
@@ -23,14 +25,27 @@
</div>
<div
class=
"mt-2"
>
<el-table
ref=
"tableRef"
size=
"large"
v-loading=
"pager.loading"
:data=
"pager.lists"
row-key=
"id"
:tree-props=
"{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table
ref=
"tableRef"
size=
"large"
v-loading=
"pager.loading"
:data=
"pager.lists"
row-key=
"id"
:tree-props=
"{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
label=
"ID"
prop=
"id"
/>
<el-table-column
label=
"主图"
>
<
template
#
default=
"{ row }"
>
<image-contain
v-if=
"row.img_url"
:src=
"getImageUrl(row.img_url, 200)"
:width=
"80"
:height=
"80"
:preview-src-list=
"[row.img_url]"
preview-teleported
fit=
"contain"
/>
<image-contain
v-if=
"row.img_url"
:src=
"getImageUrl(row.img_url, 200)"
:width=
"80"
:height=
"80"
:preview-src-list=
"[row.img_url]"
preview-teleported
fit=
"contain"
/>
</
template
>
</el-table-column>
...
...
@@ -43,8 +58,11 @@
</el-table-column>
<el-table-column
label=
"颜色"
min-width=
"120"
>
<
template
#
default=
"{ row }"
>
<div
v-if=
"row.db_diy_color"
>
<div
class=
"w-[20px] h-[20px]"
:style=
"
{background:row.db_diy_color.sezhi}">
</div>
<div
v-if=
"row.db_diy_color"
>
<div
class=
"w-[20px] h-[20px]"
:style=
"
{ background: row.db_diy_color.sezhi }"
>
</div>
<div>
{{
row
.
db_diy_color
.
title
}}
</div>
</div>
<span
v-else
>
未绑定
</span>
...
...
@@ -57,7 +75,11 @@
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
prop=
"create_date"
min-width=
"120"
/>
<el-table-column
label=
"创建时间"
prop=
"create_date"
min-width=
"120"
/>
<el-table-column
label=
"操作"
width=
"120"
fixed=
"right"
>
<
template
#
default=
"{ row }"
>
<el-button
type=
"primary"
link
@
click=
"handleEdit(row)"
>
...
...
@@ -72,34 +94,46 @@
</div>
</el-card>
<edit-popup
v-if=
"showEdit"
ref=
"editRef"
@
success=
"getLists"
@
close=
"showEdit = false"
/>
<ColorPage
:activeTab=
"activeTab"
v-if=
"activeTab=='color'"
@
on-change=
"(e)=>{activeTab=e}"
/>
<edit-popup
v-if=
"showEdit"
ref=
"editRef"
@
success=
"getLists"
@
close=
"showEdit = false"
/>
<ColorPage
:activeTab=
"activeTab"
v-if=
"activeTab == 'color'"
@
on-change=
"
(e) => {
activeTab = e
}
"
/>
</div>
</template>
<
script
lang=
"ts"
setup
name=
"productFenlei"
>
import
{
apiDiyTemplateXiaoguotuList
,
apiDiyTemplateXiaoguotuDelete
}
from
'@/api/product'
import
{
apiDiyTemplateXiaoguotuList
,
apiDiyTemplateXiaoguotuDelete
}
from
'@/api/product'
import
{
usePaging
}
from
'@/hooks/usePaging'
import
feedback
from
'@/utils/feedback'
import
EditPopup
from
'./edit.vue'
import
type
{
ElTable
}
from
'element-plus'
import
useMultipleTabs
from
'@/hooks/useMultipleTabs'
import
{
getImageUrl
}
from
"@/utils/getImgUrl"
;
import
{
getImageUrl
}
from
'@/utils/getImgUrl'
import
ColorPage
from
"../color/index.vue"
;
import
ColorPage
from
'../color/index.vue'
const
{
removeTab
}
=
useMultipleTabs
()
const
route
=
useRoute
();
const
router
=
useRouter
();
const
route
=
useRoute
()
const
router
=
useRouter
()
const
goBack
=
()
=>
{
removeTab
();
router
.
go
(
-
1
);
removeTab
()
router
.
go
(
-
1
)
}
const
editRef
=
shallowRef
<
InstanceType
<
typeof
EditPopup
>>
()
...
...
@@ -112,26 +146,24 @@ const paramsData: any = reactive({
diy_id
:
route
.
query
.
did
})
const
{
type
}
=
defineProps
([
'type'
]);
type
&&
(
paramsData
.
type
=
type
);
const
{
type
}
=
defineProps
([
'type'
])
type
&&
(
paramsData
.
type
=
type
)
const
{
pager
,
getLists
}
=
usePaging
({
fetchFun
:
apiDiyTemplateXiaoguotuList
,
params
:
paramsData
})
const
handleAdd
=
async
()
=>
{
showEdit
.
value
=
true
;
await
nextTick
();
editRef
.
value
?.
open
(
'add'
,
pager
);
showEdit
.
value
=
true
await
nextTick
()
editRef
.
value
?.
open
(
'add'
,
pager
)
}
const
handleEdit
=
async
(
data
:
any
)
=>
{
showEdit
.
value
=
true
;
await
nextTick
();
editRef
.
value
?.
open
(
'edit'
,
pager
);
showEdit
.
value
=
true
await
nextTick
()
editRef
.
value
?.
open
(
'edit'
,
pager
)
editRef
.
value
?.
getDetail
(
data
)
}
...
...
@@ -141,8 +173,5 @@ const handleDelete = async (id: number) => {
getLists
()
}
getLists
()
</
script
>
src/views/user/setting.vue
View file @
db60a6f0
...
...
@@ -2,27 +2,43 @@
<
template
>
<div
class=
"user-setting"
>
<el-card
class=
"!border-none"
shadow=
"never"
>
<el-form
ref=
"formRef"
class=
"ls-form"
:model=
"formData"
:rules=
"rules"
label-width=
"100px"
>
<el-form
ref=
"formRef"
class=
"ls-form"
:model=
"formData"
:rules=
"rules"
label-width=
"100px"
>
<el-form-item
label=
"当前密码:"
prop=
"password_3"
>
<div
class=
"w-80"
>
<el-input
v-model
.
trim=
"formData.password_3"
placeholder=
"修改密码时必填, 不修改密码时留空"
type=
"password"
show-password
/>
<el-input
v-model
.
trim=
"formData.password_3"
placeholder=
"修改密码时必填, 不修改密码时留空"
type=
"password"
show-password
/>
</div>
</el-form-item>
<el-form-item
label=
"新的密码:"
prop=
"password_1"
>
<div
class=
"w-80"
>
<el-input
v-model
.
trim=
"formData.password_1"
placeholder=
"修改密码时必填, 不修改密码时留空"
type=
"password"
show-password
/>
<el-input
v-model
.
trim=
"formData.password_1"
placeholder=
"修改密码时必填, 不修改密码时留空"
type=
"password"
show-password
/>
</div>
</el-form-item>
<el-form-item
label=
"确定密码:"
prop=
"password_2"
>
<div
class=
"w-80"
>
<el-input
v-model
.
trim=
"formData.password_2"
placeholder=
"修改密码时必填, 不修改密码时留空"
type=
"password"
show-password
/>
<el-input
v-model
.
trim=
"formData.password_2"
placeholder=
"修改密码时必填, 不修改密码时留空"
type=
"password"
show-password
/>
</div>
</el-form-item>
</el-form>
...
...
@@ -72,10 +88,8 @@ const rules = reactive<object>({
]
})
// 设置个人设置
const
setUser
=
async
()
=>
{
if
(
formData
.
password_3
||
formData
.
password_1
||
formData
.
password_2
)
{
if
(
!
formData
.
password_3
)
{
return
feedback
.
msgError
(
'请输入当前密码'
)
...
...
@@ -107,8 +121,8 @@ const setUser = async () => {
}
await
setUserInfo
(
formData
)
feedback
.
msgSuccess
(
"操作成功"
);
userStore
.
getUserInfo
();
feedback
.
msgSuccess
(
'操作成功'
)
userStore
.
getUserInfo
()
}
// 提交数据
...
...
@@ -116,7 +130,6 @@ const handleSubmit = async () => {
await
formRef
.
value
?.
validate
()
setUser
()
}
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
src/views/userSave/item/index.vue
View file @
db60a6f0
...
...
@@ -5,59 +5,105 @@
</el-card>
<template
v-if=
"data"
>
<el-card
class=
"!border-none mt-2"
shadow=
"never"
>
<el-descriptions
class=
"margin-top"
:title=
"data.sku + ' ' + data.db_diy.title"
:column=
"3"
:border=
"true"
>
<el-descriptions
class=
"margin-top"
:title=
"data.sku + ' ' + data.db_diy.title"
:column=
"3"
:border=
"true"
>
<template
#
extra
>
<div
class=
"flex"
>
<div>
<el-tag
size=
"large"
type=
"warning"
v-if=
"data.xgt_status == 9"
>
效果图待生成
</el-tag>
<el-tag
size=
"large"
type=
"success"
v-else-if=
"data.xgt_status == 1"
>
效果图已生成
</el-tag>
<el-tag
size=
"large"
type=
"warning"
v-if=
"data.xgt_status == 9"
>
效果图待生成
</el-tag
>
<el-tag
size=
"large"
type=
"success"
v-else-if=
"data.xgt_status == 1"
>
效果图已生成
</el-tag
>
<el-tag
size=
"large"
type=
"danger"
v-else
>
效果图失败
</el-tag>
</div>
<div
class=
"ml-3"
>
<el-tag
size=
"large"
type=
"warning"
v-if=
"data.status == 9"
>
总待生成
</el-tag>
<el-tag
size=
"large"
type=
"success"
v-else-if=
"data.status == 1"
>
总已生成
</el-tag>
<el-tag
size=
"large"
type=
"warning"
v-if=
"data.status == 9"
>
总待生成
</el-tag
>
<el-tag
size=
"large"
type=
"success"
v-else-if=
"data.status == 1"
>
总已生成
</el-tag
>
<el-tag
size=
"large"
type=
"danger"
v-else
>
总失败
</el-tag>
</div>
</div>
</
template
>
<el-descriptions-item
label=
"SKU"
>
{{ data.sku }}
</el-descriptions-item>
<el-descriptions-item
label=
"自定义编码"
>
{{ data.bianma }}
</el-descriptions-item>
<el-descriptions-item
label=
"模板SKU"
>
{{ data.db_diy.sku }}
</el-descriptions-item>
<el-descriptions-item
label=
"用户昵称"
>
{{ data.db_diy_user.name }}
</el-descriptions-item>
<el-descriptions-item
label=
"用户SKU"
>
{{ data.db_diy_user.sku }}
</el-descriptions-item>
<el-descriptions-item
label=
"回调地址"
>
{{ data.callback }}
</el-descriptions-item>
<el-descriptions-item
label=
"创建时间"
>
{{ data.create_date }}
</el-descriptions-item>
<el-descriptions-item
label=
"效果图完成时间"
>
{{ data.xgt_update_date }}
</el-descriptions-item>
<el-descriptions-item
label=
"总完成时间"
>
{{ data.update_date }}
</el-descriptions-item>
<el-descriptions-item
label=
"SKU"
>
{{
data.sku
}}
</el-descriptions-item>
<el-descriptions-item
label=
"自定义编码"
>
{{
data.bianma
}}
</el-descriptions-item>
<el-descriptions-item
label=
"模板SKU"
>
{{
data.db_diy.sku
}}
</el-descriptions-item>
<el-descriptions-item
label=
"用户昵称"
>
{{
data.db_diy_user.name
}}
</el-descriptions-item>
<el-descriptions-item
label=
"用户SKU"
>
{{
data.db_diy_user.sku
}}
</el-descriptions-item>
<el-descriptions-item
label=
"回调地址"
>
{{
data.callback
}}
</el-descriptions-item>
<el-descriptions-item
label=
"创建时间"
>
{{
data.create_date
}}
</el-descriptions-item>
<el-descriptions-item
label=
"效果图完成时间"
>
{{
data.xgt_update_date
}}
</el-descriptions-item>
<el-descriptions-item
label=
"总完成时间"
>
{{
data.update_date
}}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card
class=
"!border-none mt-2"
shadow=
"never"
>
<div
class=
"
font-bold"
>
用户设计图
</div>
<div
class=
"
font-bold"
>
用户设计图
</div>
<div
class=
"mt-2"
>
<image-contain
v-for=
"item in data.face_list"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"80"
:height=
"80"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
/>
<image-contain
v-for=
"(item,index) in data.face_list"
:key=
"index"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"80"
:height=
"80"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
/>
</div>
</el-card>
<el-card
class=
"!border-none mt-2"
shadow=
"never"
>
<div
class=
"
font-bold"
>
效果图
</div>
<div
class=
"
font-bold"
>
效果图
</div>
<div
class=
"mt-4"
>
<image-contain
v-for=
"item in data.xiaoguotu_list"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"80"
:height=
"80"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
/>
<image-contain
v-for=
"(item,i) in data.xiaoguotu_list"
:key=
"i"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"80"
:height=
"80"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
/>
</div>
</el-card>
<el-card
class=
"!border-none mt-2"
shadow=
"never"
>
<div
class=
"
font-bold"
>
尺码图
</div>
<div
class=
"
font-bold"
>
尺码图
</div>
<div
class=
"flex mt-4"
>
<el-table
class=
"mt-4"
size=
"large"
:data=
"data.chima_list"
>
<el-table-column
label=
"标题"
prop=
"title"
></el-table-column>
...
...
@@ -65,7 +111,9 @@
<el-table-column
label=
"文件路径"
>
<
template
#
default=
"{ row }"
>
<el-button
link
type=
"primary"
v-if=
"row.img_url"
>
<a
:href=
"getImageUrl(row.img_url)"
target=
"_blank"
>
{{
row
.
img_url
}}
</a>
<a
:href=
"getImageUrl(row.img_url)"
target=
"_blank"
>
{{
row
.
img_url
}}
</a>
</el-button>
<div
v-else
>
未生成
</div>
</
template
>
...
...
@@ -84,31 +132,29 @@
</div>
</template>
<
script
lang=
"ts"
setup
name=
"productFenlei"
>
import
type
{
ElTable
}
from
'element-plus'
import
useMultipleTabs
from
'@/hooks/useMultipleTabs'
import
{
getImageUrl
}
from
"@/utils/getImgUrl"
;
import
{
apiDiyUserSaveItem
}
from
"@/api/member"
const
morenImg
=
'https://foxpsd.com/diy/shop/images/xiaoguotu.jpg'
;
import
{
getImageUrl
}
from
'@/utils/getImgUrl'
import
{
apiDiyUserSaveItem
}
from
'@/api/member'
const
morenImg
=
'https://foxpsd.com/diy/shop/images/xiaoguotu.jpg'
const
{
removeTab
}
=
useMultipleTabs
()
const
router
=
useRouter
()
;
const
route
=
useRoute
()
;
const
router
=
useRouter
()
const
route
=
useRoute
()
const
goBack
=
()
=>
{
removeTab
();
router
.
go
(
-
1
);
removeTab
()
router
.
go
(
-
1
)
}
const
data
=
ref
()
;
const
data
=
ref
()
const
getData
=
async
()
=>
{
le
t
res
:
any
=
await
apiDiyUserSaveItem
({
sku
:
route
.
query
.
sku
})
data
.
value
=
res
.
data
;
cons
t
res
:
any
=
await
apiDiyUserSaveItem
({
sku
:
route
.
query
.
sku
})
data
.
value
=
res
.
data
}
const
getHouzhui
=
(
url
:
string
):
boolean
=>
{
if
(
/
\.(
svg|tiff
)
$/
.
test
(
url
))
{
return
true
...
...
@@ -118,13 +164,10 @@ const getHouzhui = (url: string): boolean => {
}
onActivated
(()
=>
{
getData
();
getData
()
})
onMounted
(()
=>
{
getData
();
getData
()
})
</
script
>
src/views/userSave/lists/index.vue
View file @
db60a6f0
<
template
>
<div
class=
"article-lists"
>
<el-card
class=
"!border-none"
shadow=
"never"
>
<el-form
ref=
"formRef"
class=
"mb-[-16px]"
@
submit
.
native
.
prevent
:model=
"queryParams"
:inline=
"true"
>
<el-form
ref=
"formRef"
class=
"mb-[-16px]"
@
submit
.
native
.
prevent
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"编号/标题"
>
<el-input
class=
"w-[280px]"
v-model=
"queryParams.content"
clearable
@
keyup
.
enter=
"resetPage"
/>
<el-input
class=
"w-[280px]"
v-model=
"queryParams.content"
clearable
@
keyup
.
enter=
"resetPage"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"resetPage"
>
查询
</el-button>
...
...
@@ -15,14 +26,29 @@
<el-card
class=
"!border-none mt-4"
shadow=
"never"
>
<div
class=
"flex justify-between"
>
<div
class=
"flex mb-4"
>
<el-button
type=
"primary"
@
click=
"downUserSave(selectData.join(','))"
:disabled=
"selectData.length>0?false:true"
>
批量下载
</el-button>
<el-button
type=
"danger"
@
click=
"handleDelete(selectData.join(','))"
:disabled=
"selectData.length>0?false:true"
>
批量删除
</el-button>
<el-button
type=
"primary"
@
click=
"downUserSave(selectData.join(','))"
:disabled=
"selectData.length > 0 ? false : true"
>
批量下载
</el-button
>
<el-button
type=
"danger"
@
click=
"handleDelete(selectData.join(','))"
:disabled=
"selectData.length > 0 ? false : true"
>
批量删除
</el-button
>
</div>
<pagination
v-model=
"pager"
@
change=
"getLists"
/>
</div>
<el-table
class=
"mt-4"
@
selection-change=
"handleSelectionChange"
size=
"large"
v-loading=
"pager.loading"
:data=
"pager.lists"
>
<el-table
class=
"mt-4"
@
selection-change=
"handleSelectionChange"
size=
"large"
v-loading=
"pager.loading"
:data=
"pager.lists"
>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
label=
"SKU"
width=
"200"
>
<template
#
default=
"
{ row }">
...
...
@@ -34,25 +60,41 @@
</div>
<div
v-copy=
"row.sku"
class=
"flex items-center"
>
<el-button
link
type=
"primary"
>
复制
</el-button>
<icon
class=
"ml-2"
:size=
"14"
color=
"#38f"
name=
"el-icon-DocumentCopy"
/>
<icon
class=
"ml-2"
:size=
"14"
color=
"#38f"
name=
"el-icon-DocumentCopy"
/>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"基础信息"
width=
"150"
>
<el-table-column
label=
"基础信息"
width=
"150"
>
<
template
#
default=
"{ row }"
>
<div
v-if=
"row.db_diy"
>
模板标题:
{{
row
.
db_diy
.
title
}}
</div>
<div>
自定义编码:
{{
row
.
bianma
}}
</div>
<div>
自定义编码:
{{
row
.
bianma
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"用户设计图"
min-width=
"150"
>
<
template
#
default=
"{ row }"
>
<div
class=
"flex flex-wrap relative"
v-if=
"row.face_list.length > 0"
>
<image-contain
v-for=
"item in row.face_list"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"50"
:height=
"50"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
class=
"mr-2 mb-2"
/>
<div
class=
"flex flex-wrap relative"
v-if=
"row.face_list.length > 0"
>
<image-contain
v-for=
"(item, index) in row.face_list"
:key=
"index"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"50"
:height=
"50"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
class=
"mr-2 mb-2"
/>
</div>
<div
v-else
>
-
</div>
</
template
>
...
...
@@ -60,35 +102,43 @@
<el-table-column
label=
"效果图"
min-width=
"150"
>
<
template
#
default=
"{ row }"
>
<div
class=
"flex flex-wrap relative"
v-if=
"row.xiaoguotu_list.length > 0"
>
<image-contain
v-for=
"item in row.xiaoguotu_list"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"50"
:height=
"50"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
class=
"mr-2 mb-2"
/>
<div
class=
"flex flex-wrap relative"
v-if=
"row.xiaoguotu_list.length > 0"
>
<image-contain
v-for=
"(item, index) in row.xiaoguotu_list"
:key=
"index"
:src=
"getImageUrl(item.img_url || morenImg, 100)"
:width=
"50"
:height=
"50"
:preview-src-list=
"[getImageUrl(item.img_url || morenImg)]"
preview-teleported
fit=
"contain"
class=
"mr-2 mb-2"
/>
</div>
<div
v-else
>
-
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"尺码图"
min-width=
"150"
>
<
template
#
default=
"{ row }"
>
<div
class=
"flex relative"
v-if=
"row.chima_list.length > 0"
>
<router-link
:to=
"`/userSave/lists/item?sku=$
{row.sku}`">
<el-button
type=
"primary"
link
>
点击查看
</el-button>
<el-button
type=
"primary"
link
>
点击查看
</el-button>
</router-link>
</div>
<div
v-else
>
-
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"效果图状态"
>
<
template
#
default=
"{ row }"
>
<el-tag
type=
"success"
v-if=
"row.xgt_status == 1"
>
已生成
</el-tag>
<el-tag
type=
"warning"
v-else-if=
"row.xgt_status == 9"
>
待生成
</el-tag>
<el-tag
type=
"warning"
v-else-if=
"row.xgt_status == 9"
>
待生成
</el-tag
>
<el-tag
type=
"danger"
v-else
>
失败
</el-tag>
</
template
>
</el-table-column>
...
...
@@ -103,9 +153,18 @@
<el-table-column
label=
"时间"
width=
"180"
>
<
template
#
default=
"{ row }"
>
<div>
创建时间:
<div>
{{
row
.
create_date
}}
</div></div>
<div>
效果图完成时间:
<div>
{{
row
.
xgt_update_date
}}
</div></div>
<div>
总完成时间:
<div>
{{
row
.
update_date
}}
</div></div>
<div>
创建时间:
<div>
{{
row
.
create_date
}}
</div>
</div>
<div>
效果图完成时间:
<div>
{{
row
.
xgt_update_date
}}
</div>
</div>
<div>
总完成时间:
<div>
{{
row
.
update_date
}}
</div>
</div>
</
template
>
</el-table-column>
...
...
@@ -113,9 +172,7 @@
<
template
#
default=
"{ row }"
>
<div
class=
""
>
<router-link
:to=
"`/userSave/lists/item?sku=$
{row.sku}`">
<el-button
type=
"primary"
link
>
详情
</el-button>
<el-button
type=
"primary"
link
>
详情
</el-button>
</router-link>
</div>
...
...
@@ -139,22 +196,31 @@
</div>
</el-card>
<RenderChima
v-if=
"showEdit"
ref=
"editRef"
@
success=
"getLists"
@
close=
"showEdit = false"
/>
<RenderChima
v-if=
"showEdit"
ref=
"editRef"
@
success=
"getLists"
@
close=
"showEdit = false"
/>
</div>
</template>
<
script
lang=
"ts"
setup
name=
"productLists"
>
import
{
apiDiyUserSaveList
,
apiDiyUserSaveDelete
,
apiDiyUserDownCreate
}
from
"@/api/member"
import
{
apiDiyUserSaveList
,
apiDiyUserSaveDelete
,
apiDiyUserDownCreate
}
from
'@/api/member'
import
{
usePaging
}
from
'@/hooks/usePaging'
import
feedback
from
'@/utils/feedback'
import
{
getImageUrl
}
from
"@/utils/getImgUrl"
;
import
RenderChima
from
"./renderChima.vue"
import
{
getImageUrl
}
from
'@/utils/getImgUrl'
import
RenderChima
from
'./renderChima.vue'
const
showEdit
=
ref
(
false
)
const
editRef
=
shallowRef
<
InstanceType
<
typeof
RenderChima
>>
()
const
morenImg
=
'https://foxpsd.com/diy/shop/images/xiaoguotu.jpg'
;
const
morenImg
=
'https://foxpsd.com/diy/shop/images/xiaoguotu.jpg'
const
queryParams
=
reactive
({
content
:
''
,
content
:
''
})
const
{
pager
,
getLists
,
resetPage
,
resetParams
}
=
usePaging
({
...
...
@@ -167,29 +233,25 @@ const handleSelectionChange = (val: any[]) => {
selectData
.
value
=
val
.
map
(({
sku
})
=>
sku
)
}
const
downUserSave
=
async
(
skus
:
string
)
=>
{
const
downUserSave
=
async
(
skus
:
string
)
=>
{
await
feedback
.
confirm
(
'确定要下载吗?'
)
await
apiDiyUserDownCreate
({
skus
})
feedback
.
msgSuccess
(
"操作成功"
)
feedback
.
msgSuccess
(
'操作成功'
)
getLists
()
}
const
handleDelete
=
async
(
skus
:
string
)
=>
{
await
feedback
.
confirm
(
'确定要删除?'
)
await
apiDiyUserSaveDelete
({
skus
})
getLists
()
}
const
handleAdd
=
async
(
row
:
any
)
=>
{
showEdit
.
value
=
true
;
await
nextTick
();
editRef
.
value
?.
open
(
'add'
,
row
);
const
handleAdd
=
async
(
row
:
any
)
=>
{
showEdit
.
value
=
true
await
nextTick
()
editRef
.
value
?.
open
(
'add'
,
row
)
}
onActivated
(()
=>
{
getLists
()
})
...
...
@@ -197,8 +259,6 @@ onActivated(() => {
onMounted
(()
=>
{
getLists
()
})
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -206,7 +266,6 @@ onMounted(() => {
.title
{
font-weight
:
bold
;
}
}
.foxpsd_box
{
...
...
@@ -246,10 +305,7 @@ onMounted(() => {
margin-right
:
5px
;
}
}
}
}
.nav_her_btn
{
...
...
@@ -259,4 +315,5 @@ onMounted(() => {
font-size
:
18px
;
color
:
#38f
;
cursor
:
pointer
;
}
</
style
>
\ No newline at end of file
}
</
style
>
src/views/userSave/lists/renderChima.vue
View file @
db60a6f0
<
template
>
<div
class=
"edit-popup"
>
<popup
ref=
"popupRef"
title=
"重新生成指定尺码"
:async=
"true"
width=
"800px"
@
confirm=
"handleSubmit"
@
close=
"handleClose"
>
<el-form
ref=
"formRef"
:model=
"formData"
label-width=
"160px"
:rules=
"formRules"
class=
"w-[90%]"
v-if=
"diy"
>
<popup
ref=
"popupRef"
title=
"重新生成指定尺码"
:async=
"true"
width=
"800px"
@
confirm=
"handleSubmit"
@
close=
"handleClose"
>
<el-form
ref=
"formRef"
:model=
"formData"
label-width=
"160px"
:rules=
"formRules"
class=
"w-[90%]"
v-if=
"diy"
>
<el-form-item
label=
"选择尺码"
prop=
"chima_id"
>
<el-select
v-model=
"formData.chima_id"
placeholder=
"请选择要生成的尺码"
>
<el-option
:value=
"item.id"
:label=
"'标题:'+item.title + ' 编码:' + item.bianma"
v-for=
"item in diy.chimaList"
></el-option>
<el-select
v-model=
"formData.chima_id"
placeholder=
"请选择要生成的尺码"
>
<el-option
v-for=
"(item, i) in diy.chimaList"
:value=
"item.id"
:label=
"'标题:' + item.title + ' 编码:' + item.bianma"
:key=
"i"
></el-option>
</el-select>
</el-form-item>
...
...
@@ -20,31 +40,32 @@
<el-form-item
label=
"额外关联的数据"
prop=
"posts_content"
>
<div
class=
"w-full"
>
<el-input
v-model=
"formData.posts_content"
placeholder=
"JSON格式"
type=
"textarea"
:autosize=
"
{ minRows: 3, maxRows: 3 }" maxlength="200" show-word-limit clearable />
<el-input
v-model=
"formData.posts_content"
placeholder=
"JSON格式"
type=
"textarea"
:autosize=
"
{ minRows: 3, maxRows: 3 }"
maxlength="200"
show-word-limit
clearable
/>
<div>
非必填,没有可以不写
</div>
<div>
<div>
结构演示
</div>
[
{
"name":"素材",
"content":"https://img.foxpsd.com/images%2Fth3.jpg"
}
]
[ { "name":"素材",
"content":"https://img.foxpsd.com/images%2Fth3.jpg" } ]
</div>
</div>
</el-form-item>
</el-form>
</popup>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
type
{
FormInstance
}
from
'element-plus'
import
{
apiDiyTemplateItem
}
from
'@/api/product'
import
{
apiDiyUserSaveChimaRender
}
from
"@/api/member"
;
import
{
apiDiyUserSaveChimaRender
}
from
'@/api/member'
import
Popup
from
'@/components/popup/index.vue'
const
emit
=
defineEmits
([
'success'
,
'close'
])
...
...
@@ -54,9 +75,9 @@ const mode = ref('add')
const
formData
=
reactive
({
chima_id
:
''
,
sku
:
''
,
sku
:
''
,
posts_content
:
''
,
sc_img_type
:
1
sc_img_type
:
1
})
const
formRules
:
any
=
reactive
({
...
...
@@ -69,15 +90,14 @@ const formRules: any = reactive({
]
})
const
handleSubmit
=
async
()
=>
{
await
formRef
.
value
?.
validate
();
await
formRef
.
value
?.
validate
()
let
obj
:
any
=
{
...
toRaw
(
formData
)
};
const
obj
:
any
=
{
...
toRaw
(
formData
)
}
if
(
obj
.
posts_content
)
{
obj
.
posts
=
JSON
.
parse
(
obj
.
posts_content
);
delete
obj
.
posts_content
;
if
(
obj
.
posts_content
)
{
obj
.
posts
=
JSON
.
parse
(
obj
.
posts_content
)
delete
obj
.
posts_content
}
await
apiDiyUserSaveChimaRender
(
obj
)
...
...
@@ -85,11 +105,11 @@ const handleSubmit = async () => {
emit
(
'success'
)
}
const
userSaveItem
=
ref
()
;
const
diy
=
ref
()
;
const
userSaveItem
=
ref
()
const
diy
=
ref
()
const
getData
=
async
(
sku
:
string
)
=>
{
le
t
res
=
await
apiDiyTemplateItem
({
cons
t
res
=
await
apiDiyTemplateItem
({
sku
})
diy
.
value
=
res
.
data
...
...
@@ -97,14 +117,13 @@ const getData = async (sku: string) => {
}
const
open
=
(
key
=
'add'
,
row
:
any
)
=>
{
userSaveItem
.
value
=
row
;
formData
.
sku
=
row
.
sku
;
userSaveItem
.
value
=
row
formData
.
sku
=
row
.
sku
getData
(
row
.
db_diy
.
sku
)
mode
.
value
=
key
popupRef
.
value
?.
open
();
popupRef
.
value
?.
open
()
}
const
setFormData
=
(
data
:
Record
<
any
,
any
>
)
=>
{
for
(
const
key
in
formData
)
{
if
(
data
[
key
]
!=
null
&&
data
[
key
]
!=
undefined
)
{
...
...
@@ -114,11 +133,8 @@ const setFormData = (data: Record<any, any>) => {
}
}
const
getDetail
=
async
(
row
:
Record
<
string
,
any
>
)
=>
{
setFormData
(
row
);
setFormData
(
row
)
}
const
handleClose
=
()
=>
{
...
...
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