Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qr-consistency-vue3
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
qr-consistency-vue3
Commits
763e7903
Commit
763e7903
authored
Apr 22, 2025
by
高滢
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
40402d33
7f9b9732
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
246 additions
and
4 deletions
+246
-4
brandData.js
src/api/brandData/brandData.js
+44
-0
index.vue
src/views/system/domesticBrand/index.vue
+202
-4
No files found.
src/api/brandData/brandData.js
0 → 100644
View file @
763e7903
import
request
from
'@/utils/request'
// 查询国内品牌数据列表
export
function
listBrandData
(
query
)
{
return
request
({
url
:
'/control/brandData/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询国内品牌数据详细
export
function
getBrandData
(
id
)
{
return
request
({
url
:
'/control/brandData/'
+
id
,
method
:
'get'
})
}
// 新增国内品牌数据
export
function
addBrandData
(
data
)
{
return
request
({
url
:
'/control/brandData'
,
method
:
'post'
,
data
:
data
})
}
// 修改国内品牌数据
export
function
updateBrandData
(
data
)
{
return
request
({
url
:
'/control/brandData'
,
method
:
'put'
,
data
:
data
})
}
// 删除国内品牌数据
export
function
delBrandData
(
id
)
{
return
request
({
url
:
'/control/brandData/'
+
id
,
method
:
'delete'
})
}
src/views/system/domesticBrand/index.vue
View file @
763e7903
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
国内
<div
style=
"width: 100%;display: flex;align-items: center;justify-content: flex-end"
>
<el-button
type=
"primary"
plain
icon=
"Plus"
@
click=
"handleAdd"
style=
""
>
新增
</el-button>
</div>
</div>
<el-table
v-loading=
"loading"
:data=
"brandDataList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"类型"
align=
"center"
prop=
"type"
/>
<el-table-column
label=
"品牌"
align=
"center"
prop=
"brand"
/>
<el-table-column
label=
"更新人"
align=
"center"
prop=
"updateBy"
/>
<el-table-column
label=
"更新时间"
align=
"center"
prop=
"updateTime"
>
</el-table-column>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
#
default=
"scope"
>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['brandData:brandData:edit']"
>
修改
</el-button>
<el-button
link
type=
"primary"
icon=
"Delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['brandData:brandData:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
v-model:page=
"queryParams.pageNum"
v-model:limit=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改国内品牌数据对话框 -->
<el-dialog
:title=
"title"
v-model=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"brandDataRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"品牌"
prop=
"brand"
>
<el-input
v-model=
"form.brand"
placeholder=
"请输入品牌"
/>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</
template
>
</el-dialog>
</div>
</template>
</template>
<
script
setup
>
<
script
setup
name=
"BrandData"
>
import
{
listBrandData
,
getBrandData
,
delBrandData
,
addBrandData
,
updateBrandData
}
from
"@/api/brandData/brandData"
;
const
{
proxy
}
=
getCurrentInstance
();
const
brandDataList
=
ref
([]);
const
open
=
ref
(
false
);
const
loading
=
ref
(
true
);
const
showSearch
=
ref
(
true
);
const
ids
=
ref
([]);
const
single
=
ref
(
true
);
const
multiple
=
ref
(
true
);
const
total
=
ref
(
0
);
const
title
=
ref
(
""
);
const
data
=
reactive
({
form
:
{},
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
},
rules
:
{
createTime
:
[
{
required
:
true
,
message
:
"创建时间不能为空"
,
trigger
:
"blur"
}
],
}
});
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
);
/** 查询国内品牌数据列表 */
function
getList
()
{
loading
.
value
=
true
;
listBrandData
(
queryParams
.
value
).
then
(
response
=>
{
brandDataList
.
value
=
response
.
rows
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
});
}
// 取消按钮
function
cancel
()
{
open
.
value
=
false
;
reset
();
}
// 表单重置
function
reset
()
{
form
.
value
=
{
id
:
null
,
type
:
null
,
brand
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
remark
:
null
};
proxy
.
resetForm
(
"brandDataRef"
);
}
/** 搜索按钮操作 */
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
;
getList
();
}
/** 重置按钮操作 */
function
resetQuery
()
{
proxy
.
resetForm
(
"queryRef"
);
handleQuery
();
}
// 多选框选中数据
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
(
item
=>
item
.
id
);
single
.
value
=
selection
.
length
!=
1
;
multiple
.
value
=
!
selection
.
length
;
}
/** 新增按钮操作 */
function
handleAdd
()
{
reset
();
open
.
value
=
true
;
title
.
value
=
"添加国内品牌数据"
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
_id
=
row
.
id
||
ids
.
value
getBrandData
(
_id
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
open
.
value
=
true
;
title
.
value
=
"修改国内品牌数据"
;
});
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"brandDataRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
updateBrandData
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
});
}
else
{
addBrandData
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
});
}
}
});
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'是否确认删除国内品牌数据编号为"'
+
_ids
+
'"的数据项?'
).
then
(
function
()
{
return
delBrandData
(
_ids
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}
/** 导出按钮操作 */
function
handleExport
()
{
proxy
.
download
(
'brandData/brandData/export'
,
{
...
queryParams
.
value
},
`brandData_
${
new
Date
().
getTime
()}
.xlsx`
)
}
getList
();
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
:deep
(
.el-pagination
)
{
display
:
flex
;
justify-content
:
center
;
width
:
100%
;
margin-top
:
24px
;
}
:deep
(
.el-pagination.is-background
.el-pager
li
.is-active
)
{
background-color
:
#0154FB
;
}
</
style
>
</
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