Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
d90f80d8
提交
d90f80d8
authored
1月 08, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(bi/store): 旺店通店铺_修复完成
同上
上级
ad7b8a83
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
165 行增加
和
160 行删除
+165
-160
element-ui.scss
src/assets/styles/element-ui.scss
+3
-0
index.scss
src/assets/styles/index.scss
+2
-1
index.js
src/utils/index.js
+19
-9
index.vue
src/views/bi/prd_tag/index.vue
+2
-7
index.vue
src/views/bi/store/index.vue
+139
-143
没有找到文件。
src/assets/styles/element-ui.scss
浏览文件 @
d90f80d8
...
...
@@ -60,11 +60,14 @@
display
:
flex
;
flex-direction
:
column
;
height
:
50vh
;
padding
:
20px
;
.el-dialog__header
{
padding-top
:
10px
;
height
:
40px
;
}
.el-dialog__body
{
margin-top
:
20px
;
height
:
calc
(
50vh
-
40px
-
32px
);
}
}
...
...
src/assets/styles/index.scss
浏览文件 @
d90f80d8
...
...
@@ -129,7 +129,8 @@ aside {
flex-direction
:
column
;
align-items
:
center
;
padding
:
20px
;
>
div
{
>
div
{
width
:
100%
;
padding
:
20px
;
}
...
...
src/utils/index.js
浏览文件 @
d90f80d8
...
...
@@ -20,12 +20,12 @@ import { parseTime } from './date'
*/
export
function
formatDate
(
cellValue
)
{
if
(
cellValue
==
null
||
cellValue
==
""
)
return
""
;
var
date
=
new
Date
(
cellValue
)
var
date
=
new
Date
(
cellValue
)
var
year
=
date
.
getFullYear
()
var
month
=
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
var
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
var
hours
=
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
()
var
minutes
=
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
()
var
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
var
hours
=
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
()
var
minutes
=
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
()
var
seconds
=
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
()
return
year
+
'-'
+
month
+
'-'
+
day
+
' '
+
hours
+
':'
+
minutes
+
':'
+
seconds
}
...
...
@@ -233,7 +233,7 @@ export function getTime(type) {
export
function
debounce
(
func
,
wait
,
immediate
)
{
let
timeout
,
args
,
context
,
timestamp
,
result
const
later
=
function
()
{
const
later
=
function
()
{
// 据上一次触发时间间隔
const
last
=
+
new
Date
()
-
timestamp
...
...
@@ -250,7 +250,7 @@ export function debounce(func, wait, immediate) {
}
}
return
function
(...
args
)
{
return
function
(...
args
)
{
context
=
this
timestamp
=
+
new
Date
()
const
callNow
=
immediate
&&
!
timeout
...
...
@@ -345,7 +345,7 @@ export function makeMap(str, expectsLowerCase) {
?
val
=>
map
[
val
.
toLowerCase
()]
:
val
=>
map
[
val
]
}
export
const
exportDefault
=
'export default '
export
const
beautifierConf
=
{
...
...
@@ -402,17 +402,27 @@ export function camelCase(str) {
export
function
isNumberStr
(
str
)
{
return
/^
[
+-
]?(
0|
([
1-9
]\d
*
))(\.\d
+
)?
$/g
.
test
(
str
)
}
// 清除对象里属性的非响应式的值
/**
* 深度重置对象的属性值
* @param {Object} obj - 需要重置的对象
* @param {Array} props - 需要重置的属性数组
*/
export
function
resetObjValue
(
obj
,
props
)
{
for
(
let
prop
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
prop
))
{
// 判断属性值是否为数组或对象
if
(
Array
.
isArray
(
obj
[
prop
]))
{
obj
[
prop
]
=
[];
obj
[
prop
].
forEach
((
item
,
index
)
=>
{
if
(
typeof
item
===
'object'
&&
item
!==
null
)
{
resetObjValue
(
obj
[
prop
],
Object
.
keys
(
item
));
}
});
}
else
if
(
typeof
obj
[
prop
]
===
'object'
&&
obj
[
prop
]
!==
null
)
{
obj
[
prop
]
=
{};
resetObjValue
(
obj
[
prop
],
Object
.
keys
(
obj
[
prop
]));
}
else
{
obj
[
prop
]
=
undefined
;
// 基础类型重置为 undefined
}
...
...
src/views/bi/prd_tag/index.vue
浏览文件 @
d90f80d8
...
...
@@ -68,12 +68,11 @@
popper-class=
"my_popper"
></el-cascader>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</
div
>
</
template
>
</el-dialog>
</div>
</template>
...
...
@@ -341,10 +340,6 @@ getSeriesGoodsTagList()
}
}
}
.dialog-footer
{
align-self
:
flex-end
;
}
}
}
...
...
src/views/bi/store/index.vue
浏览文件 @
d90f80d8
<
template
>
<div
class=
"app-container"
>
<!-- 搜索表单 -->
<el-form
:model=
"queryParams"
ref=
"formRef"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"店铺名字"
prop=
"storeName"
>
<el-input
v-model=
"queryParams.storeName"
placeholder=
"请输入店铺名字"
clearable
@
input=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"所属平台"
>
<el-select
v-model=
"queryParams.platformId"
placeholder=
"请选择平台"
clearable
@
change=
"handleQuery"
>
<el-option
v-for=
"dict in sale_platform"
:key=
"dict.value"
:value=
"dict.value"
:label=
"dict.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"店铺状态"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"店铺状态"
clearable
@
change=
"handleQuery"
>
<el-option
v-for=
"dict in sys_normal_disable"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-form>
<!-- 操作栏 -->
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['gen:store:add']"
>
新增
</el-button>
</el-col>
<right-toolbar
v-model:showSearch=
"showSearch"
@
queryTable=
"getList"
:columns=
"columns"
></right-toolbar>
</el-row>
<!-- 表格数据 -->
<el-table
v-loading=
"loading"
:data=
"storeList"
>
<el-table-column
label=
"店铺编码"
prop=
"storeCode"
width=
"80px"
v-if=
"columns[0].visible"
/>
<el-table-column
label=
"店铺名称"
prop=
"storeName"
width=
"360px"
v-if=
"columns[1].visible"
/>
<el-table-column
label=
"渠道"
prop=
"channelId"
v-if=
"columns[2].visible"
>
<template
v-slot=
"scope"
>
<dict-tag
:options=
"sale_channel"
:value=
"scope.row.channelId"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"所属平台"
prop=
"platformId"
v-if=
"columns[3].visible"
>
<
template
v-slot=
"scope"
>
<dict-tag
:options=
"sale_platform"
:value=
"scope.row.platformId"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"店铺状态"
prop=
"status"
v-if=
"columns[4].visible"
>
<
template
v-slot=
"scope"
>
<el-switch
v-model=
"scope.row.status"
active-value=
"0"
inactive-value=
"1"
@
change=
"handleDelete(scope.row)"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
v-if=
"columns[5].visible"
>
<
template
v-slot=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['gen:store:edit']"
>
修改
</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"
/>
<div
class=
"content"
>
<!-- 搜索表单 -->
<el-form
:model=
"queryParams"
inline
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"店铺名字"
prop=
"storeName"
>
<el-input
v-model=
"queryParams.storeName"
placeholder=
"请输入店铺名字"
clearable
@
input=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"所属平台"
>
<el-select
v-model=
"queryParams.platformId"
placeholder=
"请选择平台"
clearable
@
change=
"handleQuery"
>
<el-option
v-for=
"dict in sale_platform"
:key=
"dict.value"
:value=
"dict.value"
:label=
"dict.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"店铺状态"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"店铺状态"
clearable
@
change=
"handleQuery"
>
<el-option
v-for=
"dict in sys_normal_disable"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-form>
<!-- 操作栏 -->
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"Plus"
@
click=
"handleAdd"
v-hasPermi=
"['gen:store:add']"
>
新增
</el-button>
</el-col>
<right-toolbar
v-model:showSearch=
"showSearch"
@
queryTable=
"getList"
:columns=
"columns"
></right-toolbar>
</el-row>
<!-- 表格数据 -->
<el-table
v-loading=
"loading"
:data=
"storeList"
>
<el-table-column
label=
"店铺编码"
prop=
"storeCode"
width=
"80px"
v-if=
"columns[0].visible"
/>
<el-table-column
label=
"店铺名称"
prop=
"storeName"
width=
"360px"
v-if=
"columns[1].visible"
/>
<el-table-column
label=
"渠道"
prop=
"channelId"
v-if=
"columns[2].visible"
>
<template
v-slot=
"scope"
>
<dict-tag
:options=
"sale_channel"
:value=
"scope.row.channelId"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"所属平台"
prop=
"platformId"
v-if=
"columns[3].visible"
>
<
template
v-slot=
"scope"
>
<dict-tag
:options=
"sale_platform"
:value=
"scope.row.platformId"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"店铺状态"
prop=
"status"
v-if=
"columns[4].visible"
>
<
template
v-slot=
"scope"
>
<el-switch
v-model=
"scope.row.status"
active-value=
"0"
inactive-value=
"1"
@
change=
"handleDelete(scope.row)"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
v-if=
"columns[5].visible"
>
<
template
v-slot=
"scope"
>
<el-button
text
type=
"primary"
icon=
"Edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['gen:store:edit']"
>
修改
</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"
/>
</div>
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"title"
v-model:visible=
"open"
append-to-body
>
<el-form
ref=
"form"
v-model=
"open"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
v-a
>
label-width=
"80px"
>
<el-form-item
label=
"店铺编码"
prop=
"storeCode"
>
<el-input
v-model=
"form.storeCode"
...
...
@@ -130,9 +126,8 @@
<el-form-item
label=
"渠道"
prop=
"channelId"
>
<el-radio-group
v-model=
"form.channelId"
>
<el-radio
v-for=
"dict in dict.type.sale_channel"
:key=
"dict.value"
:label=
"dict.value"
>
<el-radio
v-for=
"dict in sale_channel"
:value=
"dict.value"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
...
...
@@ -140,31 +135,29 @@
<el-form-item
label=
"所属平台"
prop=
"platformId"
>
<el-radio-group
v-model=
"form.platformId"
>
<el-radio
v-for=
"dict in dict.type.sale_platform"
:key=
"dict.value"
:label=
"dict.value"
>
<el-radio
v-for=
"dict in sale_platform"
:value=
"dict.value"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</
div
>
</
template
>
</el-dialog>
</div>
</template>
<
script
setup
>
import
{
listStore
,
addStore
,
updateStore
}
from
"@/api"
;
import
{
debounce
}
from
'@/utils'
import
{
debounce
,
resetObjValue
}
from
'@/utils'
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
sale_channel
,
sale_platform
,
sys_normal_disable
}
=
proxy
.
useDict
(
[
'sale_channel'
,
'sale_platform'
,
'sys_normal_disable'
]
);
// 渠道,平台,状态字典
const
{
sale_channel
,
sale_platform
,
sys_normal_disable
}
=
proxy
.
useDict
(
'sale_channel'
,
'sale_platform'
,
'sys_normal_disable'
);
// 渠道,平台,状态字典
const
loading
=
ref
(
true
)
// 遮罩层
const
formRef
=
ref
(
null
)
...
...
@@ -225,14 +218,10 @@ const cancel = () => {
}
// 表单重置
const
reset
=
()
=>
{
form
.
value
=
{
storeId
:
null
,
storeCode
:
null
,
storeName
:
null
,
channelId
:
'1'
,
// 默认渠道:"电商"
platformId
:
'1'
// 默认平台:"天猫"
};
resetForm
(
"form"
);
resetObjValue
(
form
)
form
.
channelId
=
'1'
form
.
platformId
=
'1'
formRef
.
value
.
resetFields
();
}
/** 搜索按钮操作 */
const
handleQuery
=
debounce
(
function
()
{
...
...
@@ -241,14 +230,14 @@ const handleQuery = debounce(function () {
})
/** 新增按钮操作 */
const
handleAdd
=
()
=>
{
form
.
value
.
storeId
&&
reset
();
form
.
storeId
&&
reset
();
open
.
value
=
true
;
title
.
value
=
"添加-电商店铺"
;
}
/** 修改按钮操作 */
const
handleUpdate
=
(
row
)
=>
{
reset
();
form
.
value
=
{
...
row
};
form
=
{
...
row
};
open
.
value
=
true
title
.
value
=
"修改-电商店铺"
}
...
...
@@ -256,8 +245,8 @@ const handleUpdate = (row) => {
const
submitForm
=
()
=>
{
formRef
.
value
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
storeId
!=
null
)
{
updateStore
(
form
.
value
).
then
(
response
=>
{
if
(
form
.
storeId
!=
null
)
{
updateStore
(
form
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
...
...
@@ -265,9 +254,9 @@ const submitForm = () => {
});
}
else
{
// 携带平台和渠道中文字符
form
.
value
.
channel
=
sale_channel
.
find
(
item
=>
item
.
value
===
this
.
form
.
channelId
).
label
form
.
value
.
platform
=
sale_platform
.
find
(
item
=>
item
.
value
===
this
.
form
.
platformId
).
label
addStore
(
form
.
value
).
then
(
response
=>
{
form
.
channel
=
sale_channel
.
value
.
find
(
item
=>
item
.
value
===
form
.
channelId
).
label
form
.
platform
=
sale_platform
.
value
.
find
(
item
=>
item
.
value
===
form
.
platformId
).
label
addStore
(
form
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
...
...
@@ -299,9 +288,15 @@ getList()
</
script
>
<
style
scoped
lang=
"scss"
>
.el-radio-group
{
.el-radio
{
margin-bottom
:
10px
;
.content
{
background-color
:
var
(
--
el-bg-color-overlay
);
width
:
100%
;
.el-radio-group
{
.el-radio
{
margin-bottom
:
10px
;
}
}
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论