Browse Source

去重

lwx_v7
超级管理员 2 years ago
parent
commit
71dda8466c
  1. 526
      src/components/DesignForm/formControlAttr.vue
  2. 21
      src/types/components.d.ts

526
src/components/DesignForm/formControlAttr.vue

@ -28,10 +28,6 @@
import { Plus } from '@element-plus/icons-vue'
import request from '@/utils/request';
@ -630,73 +626,6 @@
vIf: state.isSearch,
vShow: ['associatedForms']
},
<<<<<<< HEAD
=======
{
label: '上传图片',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_url',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '尺寸',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_showMode',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '契合度',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_fit',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '圆角',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_radius',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '边框和阴影',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_boderAndShadow',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '图片链接',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_link',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '浮动',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_float',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
{
label: '内外四边距',
value: config.lowcodeImage,
path: 'config.lowcodeImage',
type: 'lowcodeImage_marginAndPadding',
vIf: state.isSearch,
vShow: ['lowcodeImage']
},
>>>>>>> lwx_v6
{
label: '轮播图设置',
value: config.carousel,
@ -1151,10 +1080,6 @@
const newVal = obj.isNum ? formatNumber(val) : val //
obj.path && getPropByPath(controlData.value, obj.path, newVal)
}
<<<<<<< HEAD
=======
>>>>>>> lwx_v6
}
/**
* 获取非负整数随机数
@ -1735,10 +1660,6 @@ const floatSelectOptions = [
]
//!!!!!!!!!!!!!!!start
const dataSource = ref<Tree[]>([])
interface Tree {
id?: string
@ -1809,13 +1730,7 @@ const setNodeEnable = (node:Node,data:Tree) =>{
//!!!!!!!!!!!!!!!end
//liwenxuan 20240217 transfer end
//liwenxuan20240313 lowcodeImage start
//
function lowcodeImageUploadSuccess(response: any, uploadFile: UploadFile, uploadFiles: UploadFiles){
@ -1923,18 +1838,7 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
return associatedFormsCurrentFormFieldTree.label.includes(value)
}
//liwenxuan20240403 associatedForms end
const showModeSelectOptions = [
{
value: '自定义像素值',
label: '自定义像素值',
},
{
value: '自定义占父容器比例',
label: '自定义占父容器比例',
},
]
const optionsCss = [
{ label: '无样式', value: '' },
@ -1942,32 +1846,6 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
{ label: '每行三列', value: 'form-row-3' },
{ label: '每行四列', value: 'form-row-4' }
]
<<<<<<< HEAD
const floatSelectOptions = [
{
value: 'left',
label: '左',
},
{
value: 'right',
label: '右',
},
]
const dataSource = ref<Tree[]>([])
interface Tree {
id?: string
label: string
disabled?: boolean
children?: Tree[]
parentId?: string
[key: string]: any
}
=======
>>>>>>> lwx_v6
const layouytStyle = reactive<any>(controlData.value.styles)
watch(()=>layouytStyle,(val : any)=>{
console.log("监听样式处理",val)
@ -2091,145 +1969,8 @@ const loadNextPage = () => {
loadingnomore.value = true
}
}
const addRootNode = () => {
let onlyNumber = uuidv4().replaceAll('-','').toString();
controlData.value.control.fixedOptions.push({
id: onlyNumber,
label: '新根节点',
disabled: false,
children: [],
})
}
const append = (data: Tree) => {
let onlyNumber = uuidv4().replaceAll('-','').toString();
const newChild = { id: onlyNumber, label: '新节点', disabled:false,children: [] }
if (!data.children) {
data.children = []
}
data.children.push(newChild)
dataSource.value = [...dataSource.value]
}
const remove = (node: Node, data: Tree) => {
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!");
if(really){
const parent = node.parent
const children: Tree[] = parent.data.children || parent.data
const index = children.findIndex((d) => d.id === data.id)
children.splice(index, 1)
dataSource.value = [...dataSource.value]
}
}
const changeLabel = (node:Node,data:Tree) =>{
let favDrink = prompt("请输入:");
if(favDrink!=null && favDrink.length>0){
const parent = node.parent
const children: Tree[] = parent.data.children || parent.data
const index = children.findIndex((d) => d.id === data.id)
children[index].label = favDrink
dataSource.value = [...dataSource.value]
}
}
const setNodeEnable = (node:Node,data:Tree) =>{
const parent = node.parent
const children: Tree[] = parent.data.children || parent.data
const index = children.findIndex((d) => d.id === data.id)
children[index].disabled = !children[index].disabled
dataSource.value = [...dataSource.value]
}
function lowcodeImageUploadSuccess(response: any, uploadFile: UploadFile, uploadFiles: UploadFiles){
const element = controlData.value.control
element.imgUrl=response.data.url
element.uploadFlag=true
}
const transferDataSourceOptions = [
{
value: '数据源',
label: '数据源',
},
{
value: '固定选项',
label: '固定选项',
},
]
const associatedFormsHideDialogFlag = ref(false)
const defaultProps = {
children: 'children',
label: 'label',
}
function getAssociatedFormsCurrentFieldTree() {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldTree',
method: 'post',
data: {
cfid:'13'
},
});
}
function getAssociatedFormsOrgAndManTree() {
return request({
url: '/javasys/lowCode/transfer/getOrgAndManTree',
method: 'post',
});
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
let resData = ref(data.children)
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
label: '当前表单',
children: [...resData.value]
}]
});
const orgAndManTree = ref<Tree[]>()
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children)
orgAndManTree.value = [{
id: data.id,
//label: data.label,
label: '组织机构',
children: [...resData.value]
}]
});
const fieldTreeSearchFlag = ref(false)
function handleFieldTreeExpand(){
fieldTreeSearchFlag.value = true;
}
function handleFieldTreeCollapse(){
fieldTreeSearchFlag.value = false;
}
function handleFieldTreeNodeclick(){
}
function handleFieldTreeContextmenu(MouseEvent:any, object:any, Node:any, element:any){
//console.log(MouseEvent)
console.log(object)
//console.log(Node)
//console.log(element)
}
import { ElTree } from 'element-plus'
const fieldTreeFilterText = ref('')
const fieldTreeRef = ref<InstanceType<typeof ElTree>>()
watch(fieldTreeFilterText, (val) => {
fieldTreeRef.value!.filter(val)
})
const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) => {
if (!value) return true
return associatedFormsCurrentFormFieldTree.label.includes(value)
}
</script>
<template>
<div class="sidebar-tools">
@ -2355,7 +2096,7 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
<el-button type="primary" append-to-body="true" modal="true" @click="dialogTableVisible = true" >轮播图设置</el-button>
</el-row>
<<<<<<< HEAD
<el-row v-else-if="item.type === 'transfer_name'">
<el-input
v-model="controlData.config.transferName"
@ -2556,229 +2297,6 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
</el-row>
=======
<el-row v-else-if="item.type === 'transfer_name'">
<el-input
v-model="controlData.config.transferName"
placeholder="请输入穿梭框名"
style="width:221px"
/>
</el-row>
<el-row v-else-if="item.type ==='transfer_options_datasource'">
<!-- <span style="display:inline-block;width:78px">选项数据源</span> -->
<el-select
v-model="controlData.config.transferDataSource"
placeholder="选项数据源"
style="width: 150px; height:20px">
<el-option
v-for="dataSourceOption1 in transferDataSourceOptions"
:key="dataSourceOption1.value"
:label="dataSourceOption1.label"
:value="dataSourceOption1.value"
/>
</el-select>
<div v-if="controlData.config.transferDataSource==='固定选项'" style="width: auto;margin-top:33px;margin-left:-220px;padding-bottom: 6px;">
<el-button type="primary" append-to-body="true" modal="true" @click="transferDialogTableVisible = true" >编辑固定选项</el-button>
</div>
<div v-if="controlData.config.transferDataSource==='数据源'" style="width: auto;margin-top: 20px;">
<!-- <span style="display:inline-block;width:50px;margin-bottom: 25px;">接口url</span> -->
<el-input
v-model="controlData.config.apiUrl"
style="width:278px;margin-left: -68px;margin-top: -5px;"
placeholder="数据源接口url">
<template #prepend>
<el-select
v-model="controlData.config.method"
style="width: 100px">
<el-option label="get" value="get" />
<el-option label="post" value="post" />
</el-select>
</template>
</el-input>
</div>
</el-row>
<!-- 图片 liwenxuan 20240312 -->
<el-row v-else-if="item.type === 'lowcodeImage_radius'">
<el-switch v-model="controlData.control.radius" style="margin-right: 15px;"/>
<el-popover
placement="top-start"
:width="200"
trigger="hover"
content="数值越大圆角程度越高"
>
<template #reference>
<el-input-number v-if="controlData.control.radius" v-model="controlData.control.radiusNum" :step="1"/>
</template>
</el-popover>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_url'">
<el-upload
:action="uploadUrl" :before-remove="beforeRemove"
:on-success="lowcodeImageUploadSuccess"
:on-error="videoUploadErr"
:limit="1"
accept=".jpg,.jpeg,.png,.tif,.tga,.bmp,.dds,.svg,.eps,.pdf,.hdr,.raw,.exr,.psd,.afphoto,.afdesign">
<el-button v-if="!controlData.control.uploadFlag" type="primary">点此上传</el-button>
<el-button v-if="controlData.control.uploadFlag" type="primary">已上传,点击修改</el-button>
</el-upload>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_showMode'">
<el-select
v-model="controlData.control.showMode"
placeholder="选项数据源"
style="width: 150px; height:20px">
<el-option
v-for="showModeSelected in showModeSelectOptions"
:key="showModeSelected.value"
:label="showModeSelected.label"
:value="showModeSelected.value"
/>
</el-select>
<div v-if="controlData.control.showMode==='自定义像素值'" style="width: auto;margin-top:33px;margin-left:-187px;padding-bottom: 6px;">
<span style="margin-right: 10px;">宽度(像素) </span><el-input-number v-model="controlData.control.pxWidth" style="margin-bottom: 10px;" /><br/>
<span style="margin-right: 10px;">高度(像素) </span><el-input-number v-model="controlData.control.pxHeight" />
</div>
<div v-if="controlData.control.showMode==='自定义占父容器比例'" style="width: auto;margin-top:33px;margin-left:-187px;padding-bottom: 6px;">
<span style="margin-right: 10px;">百分比宽 </span><el-input-number v-model="controlData.control.widthPercent" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;">百分比高 </span><el-input-number v-model="controlData.control.heightPercent" />
</div>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_fit'">
<el-radio-group v-model="controlData.control.fit">
<el-popover
placement="top-start"
title="fill"
:width="200"
trigger="hover"
content="默认值。调整替换后的内容大小,以填充元素的内容框。如有必要,将拉伸或挤压物体以适应该对象。"
>
<template #reference>
<el-radio :label="1" :value="1">fill</el-radio>
</template>
</el-popover>
<el-popover
placement="top-start"
title="contain"
:width="200"
trigger="hover"
content="缩放替换后的内容以保持其纵横比,同时将其放入元素的内容框。"
>
<template #reference>
<el-radio :label="2" :value="2">contain</el-radio>
</template>
</el-popover>
<el-popover
placement="top-start"
title="cover"
:width="200"
trigger="hover"
content="调整替换内容的大小,以在填充元素的整个内容框时保持其长宽比。该对象将被裁剪以适应。"
>
<template #reference>
<el-radio :label="3" :value="3">cover</el-radio>
</template>
</el-popover>
<el-popover
placement="top-start"
title="none"
:width="200"
trigger="hover"
content="不对替换的内容调整大小。"
>
<template #reference>
<el-radio :label="4" :value="4">none</el-radio>
</template>
</el-popover>
<el-popover
placement="top-start"
title="scale-down"
:width="200"
trigger="hover"
content="调整内容大小就像没有指定内容或包含内容一样(将导致较小的具体对象尺寸)"
>
<template #reference>
<el-radio :label="5" :value="5">scale-down</el-radio>
</template>
</el-popover>
</el-radio-group>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_boderAndShadow'">
<el-switch v-model="controlData.control.boderAndShadow" style="margin-right: 15px;"/>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_link'">
<el-input
v-model="controlData.control.link"
placeholder="请录入图片链接地址"
style="width:221px"
/>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_marginAndPadding'">
<div style="width: auto;margin-top:33px;margin-left:-47px;padding-bottom: 6px;">
<span style="margin-right: 10px;"> 外边距()</span><el-input-number v-model="controlData.control.mt" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 外边距()</span><el-input-number v-model="controlData.control.mb" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 外边距()</span><el-input-number v-model="controlData.control.ml" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 外边距()</span><el-input-number v-model="controlData.control.mr" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 内边距()</span><el-input-number v-model="controlData.control.pt" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 内边距()</span><el-input-number v-model="controlData.control.pb" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 内边距()</span><el-input-number v-model="controlData.control.pl" style="margin-bottom: 10px;"/><br/>
<span style="margin-right: 10px;"> 内边距()</span><el-input-number v-model="controlData.control.pr" style="margin-bottom: 10px;"/><br/>
</div>
</el-row>
<el-row v-else-if="item.type === 'lowcodeImage_float'">
<el-switch v-model="controlData.control.floatFlag" style="margin-right: 15px;"/>
<el-select
v-if="controlData.control.floatFlag"
v-model="controlData.control.floatValue"
style="width: 150px; height:20px">
<el-option
v-for="showModeSelected1 in floatSelectOptions"
:key="showModeSelected1.value"
:label="showModeSelected1.label"
:value="showModeSelected1.value"
/>
</el-select>
</el-row>
<el-row v-else-if="item.type === 'associatedForms_hide'">
<el-button type="primary" append-to-body="true" modal="true" @click="associatedFormsHideDialogFlag = true" >设置隐藏条件</el-button>
</el-row>
>>>>>>> lwx_v6
<el-input
v-else
:type="item.inputStyle"
@ -3444,13 +2962,7 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
@close="closePreview"
/>
<<<<<<< HEAD
<!-- 穿梭框设置弹窗 liwenxuan 20240217 start -->
=======
<!-- 轮播图设置弹窗 liwenxuan 20240122 end -->
<!-- 穿梭框设置弹窗 liwenxuan 20240217 start -->
>>>>>>> lwx_v6
<el-dialog v-model="transferDialogTableVisible" title="创建穿梭框选项树" top="150px" style="margin-top:70px;" width="50%" >
<div v-if="controlData.type=='lowcodeTransfer'">
<el-button type="success" plain style="margin-top: 5px;margin-bottom: 5px;" @click="addRootNode()">新增根节点</el-button>
@ -3542,10 +3054,9 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
<!-- 关联表单设置弹窗 liwenxuan 20240402 end -->
</template>
<<<<<<< HEAD
<style lang='scss' scoped>
=======
<style lang='scss' scoped>
.sidebar-tools .el-tabs__content{
padding: 0;
@ -3558,7 +3069,7 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
padding-left: 10px;
background-color: rgb(229, 229, 229);
}
>>>>>>> lwx_v6
.form_cont{
padding: 0 10px;
}
@ -3573,14 +3084,7 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
width: 100px;
height: 100px;
}
}
<<<<<<< HEAD
=======
//!!!!!!!!!!!!!!!!!穿start
>>>>>>> lwx_v6
}
.custom-tree-node {
flex: 1;
display: flex;
@ -3601,25 +3105,5 @@ const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) =>
.el-main{
--el-main-padding: 5px
}
<<<<<<< HEAD
</style>
<style >
.sidebar-tools .el-tabs__content{
padding: 0;
}
.el-collapse-item__header {
padding-left: 10px;
background-color: rgb(229, 229, 229);
}
.el-collapse-item__header{
padding-left: 10px;
background-color: rgb(229, 229, 229);
}
</style>
=======
</style>
>>>>>>> lwx_v6

21
src/types/components.d.ts

@ -21,16 +21,14 @@ declare module '@vue/runtime-core' {
DesignLayoutPage: typeof import('./../components/DesignForm/designLayout/designLayoutPage.vue')['default']
DiyIconfont: typeof import('./../components/DesignForm/public/expand/diy-iconfont.vue')['default']
DragControl: typeof import('./../components/DesignForm/dragControl.vue')['default']
<<<<<<< HEAD
ElAffix: typeof import('element-plus/es')['ElAffix']
ElAlert: typeof import('element-plus/es')['ElAlert']
=======
>>>>>>> lwx_v6
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
@ -53,6 +51,7 @@ declare module '@vue/runtime-core' {
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
@ -64,22 +63,21 @@ declare module '@vue/runtime-core' {
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElResult: typeof import('element-plus/es')['ElResult']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSelectV2: typeof import('element-plus/es')['ElSelectV2']
ElSlider: typeof import('element-plus/es')['ElSlider']
<<<<<<< HEAD
ElSpace: typeof import('element-plus/es')['ElSpace']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
=======
>>>>>>> lwx_v6
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
@ -88,6 +86,8 @@ declare module '@vue/runtime-core' {
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTransfer: typeof import('element-plus/es')['ElTransfer']
@ -117,7 +117,6 @@ declare module '@vue/runtime-core' {
IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
IEpClose: typeof import('~icons/ep/close')['default']
<<<<<<< HEAD
IEpCollection: typeof import('~icons/ep/collection')['default']
IEpDelete: typeof import('~icons/ep/delete')['default']
IEpDownload: typeof import('~icons/ep/download')['default']
@ -130,14 +129,6 @@ declare module '@vue/runtime-core' {
IEpPosition: typeof import('~icons/ep/position')['default']
IEpRefresh: typeof import('~icons/ep/refresh')['default']
IEpRefreshLeft: typeof import('~icons/ep/refresh-left')['default']
=======
IEpDelete: typeof import('~icons/ep/delete')['default']
IEpEdit: typeof import('~icons/ep/edit')['default']
IEpMessageBox: typeof import('~icons/ep/message-box')['default']
IEpOperation: typeof import('~icons/ep/operation')['default']
IEpPlus: typeof import('~icons/ep/plus')['default']
IEpRefresh: typeof import('~icons/ep/refresh')['default']
>>>>>>> lwx_v6
IEpSearch: typeof import('~icons/ep/search')['default']
IEpSetting: typeof import('~icons/ep/setting')['default']
IEpTop: typeof import('~icons/ep/top')['default']

Loading…
Cancel
Save