让企业管理更智慧、更快捷

Skip to content
源代码提交(3)
{
"name": "@package/lwc-ui-components",
"version": "1.0.21",
"version": "1.0.22",
"private": false,
"description": "立威云UI组件库",
"author": "",
......
......@@ -209,7 +209,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export default {
version: '1.0.20',
version: '1.0.21',
install,
LwcBasicButton,
LwcBasicButtonIcon,
......
......@@ -15,6 +15,7 @@
style="width: 70px; height: 70px; border-radius: 50%;"
:lazy="lazy"
:src="image || defaultAvatar"
v-bind="imageProps"
></el-image>
</el-col>
</el-row>
......@@ -117,6 +118,10 @@ export default {
lazy: {
type: Boolean,
default: true
},
imageProps: {
type: Object,
default: () => {}
}
},
......
......@@ -25,7 +25,7 @@ Default.args = {
level: '店长',
status: "ACTIVE",
empNo: "101",
imageUrl: "http://img.leadwaycloud.com/33231c51b869bf787bcdbe6f32dc82a2",
image: "http://10.146.96.23/leadwaycloud-oss/oss/file/preview/948513499067288/965765666716561?imageView2/1/w/80/h/80",
statusConfig: {
options: [{
label: '启用',
......
......@@ -8,7 +8,7 @@
<el-row class="px-2" @click.native="onClick(user)">
<el-row :gutter="24" class="py-2">
<el-col :span="6">
<el-avatar class="w-full h-full" :fit="fit" :size="70" :src="user.image || defaultAvatar"></el-avatar>
<el-avatar class="w-full h-full" :fit="fit" :size="70" :src="user.image || defaultAvatar" v-bind="imageProps"></el-avatar>
</el-col>
<el-col :span="18">
<el-col class="truncate text-color-primary" :span="24">
......@@ -52,6 +52,10 @@ export default {
user: {
type: Object,
default() { return {} }
},
imageProps: {
type: Object,
default: () => {}
}
},
methods: {
......
......@@ -14,6 +14,7 @@
style="width: 70px; height: 70px; border-radius: 50%;"
:lazy="lazy"
:src="user.image || defaultAvatar"
v-bind="imageProps"
></el-image>
</el-col>
<el-col :span="24" class="truncate mt-2 text-color-primary flex justify-center items-center">
......@@ -83,6 +84,10 @@ export default {
lazy: {
type: Boolean,
default: true
},
imageProps: {
type: Object,
default: () => {}
}
},
methods: {
......
......@@ -13,6 +13,7 @@
style="width: 70px; height: 70px; border-radius: 50%;"
:lazy="lazy"
:src="user.image || defaultAvatar"
v-bind="imageProps"
></el-image>
</el-col>
<el-col :span="24" class="truncate mt-2">
......@@ -53,6 +54,10 @@ export default {
lazy: {
type: Boolean,
default: true
},
imageProps: {
type: Object,
default: () => {}
}
},
methods: {
......
......@@ -11,6 +11,7 @@
style="width: 64px; height: 64px;"
:lazy="lazy"
:src="value.image || defaultImage"
v-bind="imageProps"
></el-image>
</el-row>
<el-row class="flex flex-col justify-center">
......@@ -64,6 +65,10 @@ export default {
lazy: {
type: Boolean,
default: false
},
imageProps: {
type: Object,
default: () => {}
}
},
components: {
......
......@@ -23,7 +23,7 @@ Default.args = {
export const FullParasm = Template.bind({});
FullParasm.storyName = "完全参数"
FullParasm.args = {
value: true,
value: null,
options: [{
label: '启用',
type: 'success',
......@@ -32,11 +32,6 @@ FullParasm.args = {
label: '禁用',
type: 'danger',
value: false
}],
visible: () => true,
className: [],
textClassName: [],
badgeConfig: {
type: 'success'
}
}]
};
......@@ -38,8 +38,8 @@ export default {
let badgeType = badgeConfig?.type || 'primary';
if (options && options.length > 0) {
const find = _.find(options, (i) => i.value === value)
renderText = find.label;
badgeType = find.type;
renderText = find?.label || null;
badgeType = find?.type || 'primary';
}
let _badgeConfig = { "is-dot": true }
......@@ -48,13 +48,13 @@ export default {
return h('div', {
class: ['lwc-data-display-badge-text', 'flex', 'items-center', ...className]
}, [
h('el-badge', {
renderText ? h('el-badge', {
class: badgeConfig.className ? ['flex', 'mr-1', ...badgeConfig.className] : ['flex', 'mr-1'],
props: {
..._badgeConfig,
type: badgeType
}
}),
}) : null,
renderItem(h, this, { text: renderText, className: textClassName })
]);
}
......
......@@ -34,7 +34,8 @@ export default {
break;
default:
}
return typeof(this.value) == 'undefined' ? "" : h('el-tag', {
const label = item[this.optionProps.label]
return typeof(this.value) == 'undefined' || !label ? "" : h('el-tag', {
class: extendType.class,
props: {
type: type,
......@@ -43,7 +44,7 @@ export default {
disableTransitions: true,
...(item.props || {})
}
}, item[this.optionProps.label]);
}, label);
}
}
......@@ -129,3 +129,20 @@ ServerNew.args = {
merchantId: "demo"
}
};
export const ServerNew2 = Template.bind({});
ServerNew2.storyName = "服务器上传(oss)"
ServerNew2.args = {
cropper: false,
type: "action",
accept: "image/*",
limit: null,
value: null,
action: "http://api.leadwaycloud.com/leadwaycloud-oss/oss/file/upload",
path: "http://api.leadwaycloud.com/leadwaycloud-oss/oss/file/preview",
name: 'file',
isZimg: false,
data: {
merchantId: "demo"
}
};