Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
develop-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3275500c
authored
Oct 30, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品管理
1 parent
19b576c5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
185 additions
and
8 deletions
src/api/commodity.js
src/assets/style/public.scss
src/components/d2-auth/d2-auth-btn.js
src/views/goods/commodity.vue
src/api/commodity.js
0 → 100644
View file @
3275500
import
request
from
'./request'
export
function
getList
(
data
)
{
data
.
method
=
'/commodity.search'
return
request
(
data
)
}
src/assets/style/public.scss
View file @
3275500
...
@@ -42,3 +42,11 @@ $prefix: d2;
...
@@ -42,3 +42,11 @@ $prefix: d2;
font-size
:
14px
;
font-size
:
14px
;
position
:
relative
;
position
:
relative
;
}
}
// element
.el-table--medium
td
{
padding
:
4px
0
!
important
;
}
.el-table
.cell
{
padding
:
0
0
;
}
\ No newline at end of file
\ No newline at end of file
src/components/d2-auth/d2-auth-btn.js
View file @
3275500
...
@@ -84,7 +84,7 @@ export default {
...
@@ -84,7 +84,7 @@ export default {
curBtns
.
forEach
(
btn
=>
curBtns
.
forEach
(
btn
=>
__aBtns
.
push
(
h
(
'el-button'
,
{
__aBtns
.
push
(
h
(
'el-button'
,
{
props
:
{
props
:
{
type
:
btn
.
type
||
'text'
,
type
:
btn
.
type
||
(
btn
.
category
===
'Button'
?
''
:
'text'
)
,
icon
:
btn
.
icon
?
`el-icon-
${
btn
.
icon
}
`
:
''
icon
:
btn
.
icon
?
`el-icon-
${
btn
.
icon
}
`
:
''
},
},
style
:
{
style
:
{
...
...
src/views/goods/commodity.vue
View file @
3275500
<!-- 商品管理 -->
<!-- 商品管理 -->
<
template
>
<
template
>
<div></div>
<d2-container
class=
"commodity"
>
<el-form
:inline=
"true"
v-model=
"searchForm"
label-width=
"85px"
slot=
"header"
>
<el-form-item
label=
"商品名称"
>
<el-input
v-model=
"searchForm.name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"分类"
>
<el-select
v-model=
"searchForm.class"
placeholder=
"请选择产品分类"
>
<el-option
v-for=
"item in baseData.product"
:key=
"item.confId"
:label=
"item.confKey"
:value=
"item.confId"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"品牌商"
>
<el-select
v-model=
"searchForm.brandName"
placeholder=
"请选择品牌商"
>
<el-option
v-for=
"item in baseData.brandList"
:key=
"item.confId"
:label=
"item.confKey"
:value=
"item.confId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
:id=
"tableParams.btnId"
type=
"primary"
icon=
"el-icon-search"
>
查询
</el-button>
<el-button
@
click=
"handleReset"
>
重置
</el-button>
</el-form-item>
</el-form>
<d2-table-header>
<auth-button
category=
"Button"
:data=
"editFormReset"
></auth-button>
</d2-table-header>
<d2-table
ref=
"commodityTable"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
:beforeSearchFn=
"beforeSearchFn"
>
<span
slot=
"img"
slot-scope=
"scope"
>
<img
class=
"pro-img"
:src=
"scope.scope.img"
/>
</span>
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
></auth-button>
</d2-table>
</d2-container>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getList
}
from
'@api/commodity'
export
default
{
export
default
{
name
:
'commodity'
,
name
:
'commodity'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{
name
:
''
,
class
:
''
,
brandName
:
''
},
editFormReset
:
{
aa
:
''
},
getListApi
:
getList
,
// 表格参数
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
tableOption
:
true
,
tableColumns
:
[{
label
:
'商品ID'
,
prop
:
'id'
},
{
label
:
'商品图片'
,
prop
:
'img'
,
addHtml
:
'img'
},
{
label
:
'商品名称'
,
prop
:
'name'
},
{
label
:
'分类'
,
prop
:
'class'
},
{
label
:
'品牌商'
,
prop
:
'brandName'
},
{
label
:
'属性'
,
prop
:
'attr'
},
{
label
:
'关联商品数'
,
prop
:
'relativeProNum'
},
{
label
:
'关联商户数'
,
prop
:
'relativeNum'
},
{
label
:
'产品状态'
,
prop
:
'state'
,
formatter
:
(
cellValue
)
=>
{
return
{
0
:
'上架'
,
1
:
'下架'
}[
cellValue
.
state
]
}
},
{
label
:
'创建时间'
,
prop
:
'createTime'
}]
},
// 基本数据
baseData
:
{
product
:
[{
confId
:
1
,
confKey
:
'分类1'
}],
brandList
:
[]
}
}
}
},
},
components
:
{},
mounted
()
{
var
allOpt
=
{
confId
:
''
,
confKey
:
'全部'
}
computed
:
{},
this
.
baseData
.
product
.
unshift
(
allOpt
)
this
.
baseData
.
brandList
.
unshift
(
allOpt
)
mounted
()
{
},
},
methods
:
{}
methods
:
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
'搜索前操作--'
)
resolve
()
})
},
handleSearch
()
{
console
.
log
(
this
.
searchForm
)
},
handleReset
()
{
},
handleAdd
(
form
)
{
console
.
log
(
form
)
},
handleExport
()
{
},
handleEdit
(
row
)
{
console
.
log
(
row
)
},
handleDetail
(
row
)
{
console
.
log
(
row
)
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.commodity
.pro-img
{
width
:
80px
;
height
:
80px
;
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment