让企业管理更智慧、更快捷
Skip to content
GitLab
探索
登录
注册
源代码提交(7)
fix: 修复上传附件组件type=action拿不到返回
· d0bdf12b
由
丁阳
创作于
7月 23, 2021
d0bdf12b
fix: 修复下拉select组件value值为空时需点击两次展开下拉问题
· 1b806941
由
丁阳
创作于
7月 23, 2021
1b806941
fix: 修复上传附件组件文件为链接时下载文件错误 新增按钮btnConfig显示隐藏按钮
· f282c663
由
丁阳
创作于
7月 26, 2021
f282c663
Merge branch 'dy-dev' of
http://git.leadwaycloud.com/package/lwc-ui-components
into tlc-dev
· 0109f7bd
由
唐良成
创作于
7月 28, 2021
0109f7bd
Merge branch 'tlc-dev'
· 3e813cf4
由
唐良成
创作于
7月 28, 2021
3e813cf4
docs: update changelog
· 11f125cf
由
唐良成
创作于
7月 28, 2021
11f125cf
0.1.35
· 7b2ede54
由
唐良成
创作于
7月 28, 2021
7b2ede54
隐藏空白变更内容
行内
左右并排
package-lock.json
浏览文件 @
7b2ede54
{
"name": "@package/lwc-ui-components",
"version": "0.1.3
4
",
"version": "0.1.3
5
",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
package.json
浏览文件 @
7b2ede54
{
"name"
:
"@package/lwc-ui-components"
,
"version"
:
"0.1.3
4
"
,
"version"
:
"0.1.3
5
"
,
"private"
:
false
,
"license"
:
"UNLICENSED"
,
"scripts"
:
{
...
...
src/index.js
浏览文件 @
7b2ede54
...
...
@@ -205,7 +205,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export
default
{
version
:
'
0.1.3
3
'
,
version
:
'
0.1.3
4
'
,
install
,
LwcBasicButton
,
LwcBasicButtonIcon
,
...
...
src/stories/changelog.stories.mdx
浏览文件 @
7b2ede54
...
...
@@ -8,6 +8,19 @@
`新特性`
`非兼容性更新`
---
### **v0.1.35 20210728**
#### 新增
- 新增 `lwc-upload-file` 按钮 `btnConfig` 显示隐藏按钮
#### Bug修复
- 修复 `lwc-upload-image` type=action 时数据回调问题
- 修复 `select` 组件 `value` 值为空时需点击两次展开下拉问题
- 修复 `lwc-upload-file` 组件文件为链接时下载文件错误
---
### **v0.1.34 20210722**
...
...
src/stories/select/dialog/index.stories.js
浏览文件 @
7b2ede54
...
...
@@ -53,7 +53,7 @@ let data = [
export
const
Default
=
Template
.
bind
({});
Default
.
storyName
=
"
Object单选
"
;
Default
.
args
=
{
value
:
{
id
:
5
,
username
:
"
用户5
"
},
value
:
{},
optionProps
:
{
id
:
"
id
"
,
name
:
"
username
"
,
...
...
src/stories/select/dialog/src/index.js
浏览文件 @
7b2ede54
...
...
@@ -365,7 +365,7 @@ export default {
},
mounted
()
{
this
.
$watch
(
'
value
'
,
function
(
val
){
if
((
typeof
val
===
'
object
'
&&
!
_
.
isEmpty
(
val
))
||
val
)
{
if
((
typeof
val
===
'
object
'
&&
!
_
.
isEmpty
(
val
))
||
(
typeof
val
!==
'
object
'
&&
val
)
)
{
if
(
this
.
type
===
"
obj
"
)
{
this
.
selectList
=
[]
this
.
selectValue
=
this
.
multiple
?
val
.
map
(
v
=>
{
return
v
[
this
.
optionProps
[
"
id
"
]]
})
:
val
[
this
.
optionProps
[
"
id
"
]]
...
...
src/stories/select/down-table/index.stories.js
浏览文件 @
7b2ede54
...
...
@@ -47,7 +47,7 @@ let data = [
export
const
Default
=
Template
.
bind
({});
Default
.
storyName
=
"
Object单选
"
Default
.
args
=
{
value
:
{
id
:
5
,
username
:
"
用户5
"
},
value
:
{},
optionProps
:
{
id
:
"
id
"
,
name
:
"
username
"
...
...
src/stories/select/down-table/src/index.js
浏览文件 @
7b2ede54
...
...
@@ -340,7 +340,7 @@ export default {
},
mounted
()
{
this
.
$watch
(
'
value
'
,
function
(
val
){
if
((
typeof
val
===
'
object
'
&&
!
_
.
isEmpty
(
val
))
||
val
)
{
if
((
typeof
val
===
'
object
'
&&
!
_
.
isEmpty
(
val
))
||
(
typeof
val
!==
'
object
'
&&
val
)
)
{
if
(
this
.
type
===
"
obj
"
)
{
this
.
selectList
=
[]
this
.
selectValue
=
this
.
multiple
?
val
.
map
(
v
=>
{
return
v
[
this
.
optionProps
[
"
id
"
]]
})
:
val
[
this
.
optionProps
[
"
id
"
]]
...
...
src/stories/upload/file/index.stories.js
浏览文件 @
7b2ede54
...
...
@@ -28,7 +28,8 @@ const Template = (args, { argTypes }) => ({
return
{
type
:
v
.
fileIndex
,
name
:
v
.
fileName
,
file
:
v
.
fileIndex
!==
'
pdf
'
?
image
:
test
// file: v.fileIndex !== 'pdf' ? image : test
file
:
"
http://211.149.204.108:17002/leadwaycloud-oss/oss/file/preview/574533689957248/589747151982167?imageView2/1/w/80/h/80
"
}
})
resolve
(
current
)
...
...
@@ -255,5 +256,27 @@ Default.args = {
rowKey
:
"
id
"
,
operColumn
:
{
align
:
"
center
"
},
showNote
:
false
,
uploadConfig
:
{
type
:
"
action
"
,
path
:
"
http://211.149.204.108:17002/leadwaycloud-oss/oss/file/preview
"
,
action
:
"
http://211.149.204.108:17002/leadwaycloud-oss/oss/file/upload
"
,
accept
:
"
image/*
"
,
name
:
"
file
"
,
isZimg
:
false
,
data
:{
"
merchantId
"
:
"
system
"
},
listType
:
"
text
"
,
listConfig
:
{
tipText
:
"
支持格式:.rar .zip .doc .docx .pdf ,单个文件不能超过20MB
"
}
},
btnConfig
:
{
toolbar
:
{
delete
:
false
},
column
:
{
download
:
true
}
}
};
src/stories/upload/file/src/index.js
浏览文件 @
7b2ede54
...
...
@@ -28,6 +28,8 @@ function renderTableColumn(h, _vm) {
}
function
renderOperColumn
(
h
,
_vm
)
{
const
{
column
=
{}
}
=
_vm
.
btnConfig
const
{
preview
=
true
,
delete
:
del
=
true
,
download
=
true
}
=
column
return
h
(
"
el-table-column
"
,
{
props
:
{
width
:
"
130px
"
,
...
...
@@ -37,7 +39,7 @@ function renderOperColumn(h, _vm) {
scopedSlots
:
{
default
:
({
row
})
=>
{
return
[
h
(
'
el-button
'
,
{
preview
?
h
(
'
el-button
'
,
{
props
:
{
size
:
"
mini
"
,
type
:
"
text
"
...
...
@@ -48,8 +50,8 @@ function renderOperColumn(h, _vm) {
_vm
.
previewFile
(
row
)
}
}
},
"
预览
"
),
h
(
'
el-button
'
,
{
},
"
预览
"
)
:
null
,
download
?
h
(
'
el-button
'
,
{
props
:
{
size
:
"
mini
"
,
type
:
"
text
"
...
...
@@ -60,8 +62,8 @@ function renderOperColumn(h, _vm) {
_vm
.
downFile
(
"
row
"
,
row
)
}
}
},
"
下载
"
),
h
(
'
el-button
'
,
{
},
"
下载
"
)
:
null
,
del
?
h
(
'
el-button
'
,
{
props
:
{
size
:
"
mini
"
,
type
:
"
text
"
...
...
@@ -72,7 +74,7 @@ function renderOperColumn(h, _vm) {
_vm
.
deleteFile
(
"
row
"
,
row
)
}
}
},
"
删除
"
)
},
"
删除
"
)
:
null
]
}
}
...
...
@@ -163,13 +165,22 @@ function renderAddFile(h, _vm) {
...
_vm
.
uploadConfig
},
on
:
{
// type=api返回
"
change
"
:
(
val
)
=>
{
_vm
.
fileForm
.
file
.
push
(
val
)
_vm
.
fileForm
.
fileList
.
push
(
val
)
},
// type=action/base64返回
"
update:value
"
:
(
val
)
=>
{
_vm
.
fileForm
.
filePathList
.
push
(
val
)
},
// type=action返回
"
upload
"
:
(
val
)
=>
{
_vm
.
fileForm
.
fileList
.
push
(
JSON
.
parse
(
val
))
}
}
})
]),
h
(
"
el-form-item
"
,
{
_vm
.
showNote
?
h
(
"
el-form-item
"
,
{
props
:
{
label
:
"
备注信息
"
}
...
...
@@ -187,7 +198,7 @@ function renderAddFile(h, _vm) {
}
}
})
])
])
:
null
]),
h
(
"
div
"
,
{
class
:
'
text-right
'
...
...
@@ -255,6 +266,29 @@ export default {
return
{}
}
},
showNote
:
{
type
:
Boolean
,
default
:
function
()
{
return
true
}
},
btnConfig
:
{
type
:
Object
,
default
:
function
()
{
return
{
toolbar
:
{
add
:
true
,
delete
:
true
,
download
:
true
,
},
column
:
{
delete
:
true
,
download
:
true
,
preview
:
true
}
}
}
}
},
data
()
{
return
{
...
...
@@ -267,7 +301,8 @@ export default {
tableLoading
:
false
,
checkedList
:
[],
fileForm
:
{
file
:
[],
filePathList
:
[],
fileList
:
[],
note
:
""
},
search
:
null
...
...
@@ -303,9 +338,12 @@ export default {
self
.
tableLoading
=
true
onPreview
(
type
===
"
checked
"
?
self
.
checkedList
:
[
file
]).
then
(
data
=>
{
self
.
tableLoading
=
false
data
.
forEach
(
res
=>
{
data
.
forEach
(
async
(
res
)
=>
{
let
responsePromise
=
await
fetch
(
res
.
file
)
let
blob
=
await
responsePromise
.
blob
()
let
objectURL
=
window
.
URL
.
createObjectURL
(
blob
)
let
link
=
document
.
createElement
(
'
a
'
);
link
.
href
=
res
.
file
link
.
href
=
objectURL
link
.
download
=
res
.
name
;
link
.
click
();
});
...
...
@@ -332,6 +370,8 @@ export default {
}
},
render
(
h
)
{
const
{
toolbar
=
{}
}
=
this
.
btnConfig
const
{
add
=
true
,
delete
:
del
=
true
,
download
=
true
}
=
toolbar
return
h
(
'
div
'
,{
directives
:
[{
name
:
"
loading
"
,
...
...
@@ -339,21 +379,22 @@ export default {
}]
},[
h
(
"
div
"
,
{
class
:
"
text-right
mb-3
"
class
:
"
mb-3
"
},
[
h
(
'
el-button
'
,
{
add
?
h
(
'
el-button
'
,
{
props
:
{
size
:
"
small
"
},
on
:
{
click
:
()
=>
{
this
.
addFileDialog
=
true
this
.
$set
(
this
.
fileForm
,
"
file
"
,
[])
this
.
$set
(
this
.
fileForm
,
"
filePathList
"
,
[])
this
.
$set
(
this
.
fileForm
,
"
fileList
"
,
[])
this
.
$set
(
this
.
fileForm
,
"
note
"
,
null
)
}
}
},
"
新增
"
),
h
(
'
el-button
'
,
{
},
"
新增
"
)
:
null
,
download
?
h
(
'
el-button
'
,
{
props
:
{
size
:
"
small
"
},
...
...
@@ -362,8 +403,8 @@ export default {
this
.
downFile
(
"
checked
"
)
}
}
},
"
下载
"
),
h
(
'
el-button
'
,
{
},
"
下载
"
)
:
null
,
del
?
h
(
'
el-button
'
,
{
props
:
{
size
:
"
small
"
},
...
...
@@ -372,7 +413,7 @@ export default {
this
.
deleteFile
(
"
checked
"
)
}
}
},
"
删除
"
)
},
"
删除
"
)
:
null
]),
h
(
'
el-table
'
,
{
class
:
"
w-full
"
,
...
...
src/stories/upload/image/index.stories.js
浏览文件 @
7b2ede54
...
...
@@ -22,7 +22,10 @@ export default {
headers
:
{
type
:
"
object
"
,
description
:
"
设置上传的请求头部
"
},
listType
:
{
type
:
"
string
"
,
description
:
"
列表类型 可选参数:picture-图片类型 text-按钮文字类型 custom-不显示 默认picture
"
,
control
:
{
type
:
"
select
"
,
options
:
[
"
picture
"
,
"
text
"
,
"
custom
"
]
}
},
listConfig
:
{
type
:
"
object
"
,
description
:
"
对象参数 btnType - 按钮类型 btnText - 按钮文字 tipText - 说明文字
"
},
customRender
:
{
type
:
"
object
"
,
description
:
"
listType为custom可配置自定义组件
"
}
customRender
:
{
type
:
"
object
"
,
description
:
"
listType为custom可配置自定义组件
"
},
upload
:
{
type
:
"
function
"
,
description
:
"
type=action的emit
"
},
"
update:value
"
:
{
type
:
"
function
"
,
description
:
"
type=action/base64的emit
"
},
change
:
{
type
:
"
function
"
,
description
:
"
type=api的emit
"
},
},
decorators
:
[()
=>
({
template
:
'
<el-col class="bg-white p-4"><story/></el-col>
'
})]
};
...
...