初始化
This commit is contained in:
105
frontend/packages/Borders/Border14/index.vue
Normal file
105
frontend/packages/Borders/Border14/index.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div
|
||||
style="width: 100%; height: 100%"
|
||||
class="bs-design-wrap"
|
||||
>
|
||||
<div
|
||||
:key="updateKey"
|
||||
class="custom-border-box"
|
||||
:style="{
|
||||
'border-top-left-radius': radiusLeftTop + 'px',
|
||||
'border-top-right-radius': radiusRightTop + 'px',
|
||||
'border-bottom-left-radius': radiusLeftBottom + 'px',
|
||||
'border-bottom-right-radius': radiusRightBottom + 'px',
|
||||
border: `${width}px solid ${color} `,
|
||||
opacity: opacity / 100,
|
||||
'background-image': `linear-gradient(${gradientDirection}, ${
|
||||
gradientColor0 ? gradientColor0 : gradientColor1
|
||||
} , ${gradientColor1 ? gradientColor1 : gradientColor0})`
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
|
||||
export default {
|
||||
name: 'Border14',
|
||||
components: {},
|
||||
mixins: [refreshComponentMixin],
|
||||
props: {
|
||||
// 卡片的属性
|
||||
config: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
color () {
|
||||
return this.config.customize.borderColor || ''
|
||||
},
|
||||
width () {
|
||||
return this.config.customize.borderWidth || 0
|
||||
},
|
||||
gradientColor0 () {
|
||||
return this.config.customize.gradientColor0 || ''
|
||||
},
|
||||
gradientColor1 () {
|
||||
return this.config.customize.gradientColor1 || ''
|
||||
},
|
||||
radiusLeftTop () {
|
||||
return this.config.customize.radiusLeftTop || 0
|
||||
},
|
||||
radiusRightTop () {
|
||||
return this.config.customize.radiusRightTop || 0
|
||||
},
|
||||
radiusLeftBottom () {
|
||||
return this.config.customize.radiusLeftBottom || 0
|
||||
},
|
||||
radiusRightBottom () {
|
||||
return this.config.customize.radiusRightBottom || 0
|
||||
},
|
||||
gradientDirection () {
|
||||
return this.config.customize.gradientDirection
|
||||
},
|
||||
opacity () {
|
||||
return (this.config.customize.opacity === 0 || this.config.customize.opacity) ? this.config.customize.opacity : 100
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted () {},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bs-design-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: transparent;
|
||||
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
|
||||
box-sizing: border-box;
|
||||
|
||||
.custom-border-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/*滚动条样式*/
|
||||
::v-deep ::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
border-radius: 4px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
::v-deep ::-webkit-scrollbar-thumb {
|
||||
background: #dddddd !important;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
193
frontend/packages/Borders/Border14/setting.vue
Normal file
193
frontend/packages/Borders/Border14/setting.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<div class="bs-setting-wrap">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="config"
|
||||
label-width="90px"
|
||||
label-position="left"
|
||||
class="setting-body bs-el-form"
|
||||
>
|
||||
<slot name="top" />
|
||||
<el-form
|
||||
:model="config.customize"
|
||||
label-position="left"
|
||||
class="setting-body bs-el-form"
|
||||
label-width="90px"
|
||||
>
|
||||
<SettingTitle>标题</SettingTitle>
|
||||
<el-form-item
|
||||
label="边框名称"
|
||||
class="lc-field-body"
|
||||
>
|
||||
<el-input
|
||||
v-model="config.title"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<SettingTitle>位置</SettingTitle>
|
||||
<div class="lc-field-body">
|
||||
<PosWhSetting :config="config" />
|
||||
</div>
|
||||
<SettingTitle>旋转</SettingTitle>
|
||||
<div class="lc-field-body">
|
||||
<RotateSetting
|
||||
:config="config"
|
||||
/>
|
||||
</div>
|
||||
<SettingTitle>基础</SettingTitle>
|
||||
<div class="lc-field-body">
|
||||
<el-form-item label="边框线颜色">
|
||||
<ColorPicker
|
||||
v-model="config.customize.borderColor"
|
||||
placeholder="请选择边框线颜色"
|
||||
:predefine-colors="predefineThemeColors"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="边框线宽度">
|
||||
<el-input-number
|
||||
v-model="config.customize.borderWidth"
|
||||
class="bs-el-input-number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="背景色一">
|
||||
<ColorPicker
|
||||
v-model="config.customize.gradientColor0"
|
||||
placeholder="请选择背景色"
|
||||
:predefine-colors="predefineThemeColors"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="背景色二">
|
||||
<ColorPicker
|
||||
v-model="config.customize.gradientColor1"
|
||||
placeholder="请选择背景色"
|
||||
:predefine-colors="predefineThemeColors"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="渐变色方向">
|
||||
<el-select
|
||||
v-model="config.customize.gradientDirection"
|
||||
popper-class="bs-el-select"
|
||||
class="bs-el-select"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in gradientDirection"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="不透明度"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="config.customize.opacity"
|
||||
class="bs-el-input-number"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="左上圆角值">
|
||||
<el-input-number
|
||||
v-model="config.customize.radiusLeftTop"
|
||||
class="bs-el-input-number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="左下圆角值">
|
||||
<el-input-number
|
||||
v-model="config.customize.radiusLeftBottom"
|
||||
class="bs-el-input-number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="右上圆角值">
|
||||
<el-input-number
|
||||
v-model="config.customize.radiusRightTop"
|
||||
class="bs-el-input-number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="右下圆角值">
|
||||
<el-input-number
|
||||
v-model="config.customize.radiusRightBottom"
|
||||
class="bs-el-input-number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<slot name="bottom" />
|
||||
</div>
|
||||
</el-form>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ColorPicker from 'data-room-ui/ColorPicker/index.vue'
|
||||
import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
|
||||
import RotateSetting from 'data-room-ui/BigScreenDesign/RightSetting/RotateSetting.vue'
|
||||
import { predefineColors } from 'data-room-ui/js/utils/colorList'
|
||||
import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
|
||||
export default {
|
||||
name: 'Border14Setting',
|
||||
components: {
|
||||
ColorPicker,
|
||||
PosWhSetting,
|
||||
RotateSetting,
|
||||
SettingTitle
|
||||
},
|
||||
props: {
|
||||
config: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
predefineThemeColors: {
|
||||
type: Array,
|
||||
default: () => predefineColors
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
gradientDirection: [
|
||||
{
|
||||
label: '从左到右',
|
||||
value: 'to right'
|
||||
},
|
||||
{
|
||||
label: '从右到左',
|
||||
value: 'to left'
|
||||
},
|
||||
{
|
||||
label: '从上到下',
|
||||
value: 'to bottom'
|
||||
},
|
||||
{
|
||||
label: '从下到上',
|
||||
value: 'to top'
|
||||
},
|
||||
{
|
||||
label: '从左上到右下',
|
||||
value: 'to bottom right'
|
||||
},
|
||||
{
|
||||
label: '从右上到左下',
|
||||
value: 'to bottom left'
|
||||
},
|
||||
{
|
||||
label: '从左下到右上',
|
||||
value: 'to top right'
|
||||
},
|
||||
{
|
||||
label: '从右下到左上',
|
||||
value: 'to top left'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted () {},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.lc-field-body {
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
||||
54
frontend/packages/Borders/Border14/settingConfig.js
Normal file
54
frontend/packages/Borders/Border14/settingConfig.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import { commonConfig } from '../../js/config'
|
||||
|
||||
export const settingConfig = {
|
||||
// 设置面板属性的显隐
|
||||
displayOption: {
|
||||
dataAllocation: {
|
||||
// 是否存在数据配置
|
||||
enable: false
|
||||
}
|
||||
}
|
||||
}
|
||||
const customConfig = {
|
||||
type: 'border14',
|
||||
root: {
|
||||
// 绕x轴旋转角度
|
||||
rotateX: 0,
|
||||
// 绕y轴旋转角度
|
||||
rotateY: 0,
|
||||
// 绕z轴旋转角度
|
||||
rotateZ: 0,
|
||||
// 透视距离
|
||||
perspective: 0,
|
||||
skewX: 0,
|
||||
skewY: 0
|
||||
},
|
||||
customize: {
|
||||
// 边框线颜色
|
||||
borderColor: '#87888e',
|
||||
// 边框线宽度
|
||||
borderWidth: 2,
|
||||
// 边框背景颜色
|
||||
backgroundColor: '#232832',
|
||||
colorType: 'single',
|
||||
// 渐变色0值
|
||||
gradientColor0: '',
|
||||
// 渐变色1值
|
||||
gradientColor1: '',
|
||||
// 渐变色色值改变方向
|
||||
gradientDirection: 'to right',
|
||||
// 透明度
|
||||
opacity: 100,
|
||||
// 左上圆角
|
||||
radiusLeftTop: 14,
|
||||
// 右上圆角
|
||||
radiusRightTop: 14,
|
||||
// 左下圆角
|
||||
radiusLeftBottom: 14,
|
||||
// 右下圆角
|
||||
radiusRightBottom: 14
|
||||
}
|
||||
}
|
||||
export const dataConfig = {
|
||||
...commonConfig(customConfig)
|
||||
}
|
||||
Reference in New Issue
Block a user