Browse Source

修改近期组件样式数据展示形式

lwx_v4
超级管理员 1 year ago
parent
commit
fd6fe93c35
  1. 14
      src/components/DesignForm/public/form/formGroup.vue
  2. 99
      src/components/DesignForm/public/form/formItem.vue
  3. 7
      src/widget/baidumap/index.vue
  4. 102
      src/widget/baidumap/indexLook.vue
  5. 2
      src/widget/index.ts
  6. 13
      src/widget/org/index.vue
  7. 1
      src/widget/systemunit/deptOrgPage.vue
  8. 1
      src/widget/systemunit/ownerPage.vue

14
src/components/DesignForm/public/form/formGroup.vue

@ -575,21 +575,21 @@ function optionsValue3Get1(data: any,fieldName: string){
<OwnerPage v-else-if="element.type === 'owner' " :data="element" :tablekey="props.tableinfo" :numrun="props.numrun" />
<!--所属部门-->
<DeptOrgPage v-else-if="element.type === 'deptOrg' " :data="element" :form-props="formProps" :tablekey="props.tableinfo" />
<DigitPage v-else-if="element.type === 'digitpage'" :data="element" />
<AssociatedForms v-else-if="element.type === 'associatedForms'" :data="element" :form-props="formProps" :tablekey="props.tableinfo" />
<DigitPage v-else-if="element.type === 'digitpage' && type != 4" :data="element" />
<AssociatedForms v-else-if="element.type === 'associatedForms' && type != 4" :data="element" :form-props="formProps" :tablekey="props.tableinfo" />
<LowcodeImage v-else-if="element.type === 'lowcodeImage' " :data="element" :tablekey="props.tableinfo" :form-table-set-up="props.alldata" >
</LowcodeImage>
<LowcodeTransfer v-else-if="element.type === 'lowcodeTransfer'" :data="element" />
<LowcodeTransfer v-else-if="element.type === 'lowcodeTransfer' && type != 4" :data="element" />
<VideoUpAndPlay v-else-if="element.type === 'videoUpAndPlay' " :data="element" />
<LowcodeCarsusel v-else-if="element.type === 'lowcodeCarsusel'" :data="element" />
<SignatureMap v-else-if="element.type === 'signaturemap'" :data="element" />
<SignatureMap v-else-if="element.type === 'signaturemap' && type != 4" :data="element" />
<OrgCentent v-else-if="element.type === 'orgCentent'" :data="element" />
<BaiduMap v-else-if="element.type === 'baidumap'" :data="element" />
<BaiduMap v-else-if="element.type === 'baidumap' && type != 4" :data="element" />
<OrgCitys v-else-if="element.type === 'organization' " :data="element" />
<UrlLink v-else-if="element.type === 'urllink'" :data="element" />
<SerialNumber v-else-if="element.type === 'serialNumber'" :data="element" :tablekey="props.tableinfo.name" :numrun="props.numrun" />
<UrlLink v-else-if="element.type === 'urllink' && type != 4" :data="element" />
<SerialNumber v-else-if="element.type === 'serialNumber' && type != 4" :data="element" :tablekey="props.tableinfo.name" :numrun="props.numrun" />
<!--其他组件-->
<FormItem v-else :data="element" @optionsValue3Get1="optionsValue3Get1" :purview="props.purview" :node-key="props.nodeKey"/>

99
src/components/DesignForm/public/form/formItem.vue

@ -33,6 +33,8 @@ import formatResult from '@/utils/DesignForm/formatResult'
import { debounce } from '@/utils/DesignForm/index'
import { useRoute } from 'vue-router'
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import TextImg from "@/assets/image/tinymce.png"
import { AnalysisCss,AnalysisInputCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts'
@ -767,6 +769,59 @@ const judgeCheckbox = (val:any,list:any) => {
}
return valAry
}
/**
@ 作者: 秦东
@ 时间: 2024-08-05 10:00:31
@ 功能: 下拉菜单处理
*/
const selectValue = (val:any,list:any) => {
// console.log("",val,list)
let valAry = []
if(val && val != "" && val != null ){
let pickSelect = JSON.parse(val)
// console.log("-----3------->",pickSelect)
if(Array.isArray(pickSelect)){
if(pickSelect.length > 0){
if(Array.isArray(list)){
pickSelect.forEach((item) => {
list.forEach((ltem) => {
if(item*1 == ltem.value*1){
valAry.push(ltem.label)
}
})
})
}
}
}else{
if(Array.isArray(list)){
list.forEach((ltem) => {
if(val == ltem.value){
valAry.push(ltem.label)
}
})
}
}
}else{
// console.log("-4->",val)
}
// console.log("-2->",valAry)
return valAry
}
/**
@ 作者: 秦东
@ 时间: 2024-08-06 08:34:05
@ 功能: 选择用户
*/
const pickUserVal = (val:any) => {
let valAry = string2json(val)
// console.log("-2->",valAry)
return valAry
}
</script>
<template>
@ -788,7 +843,8 @@ const judgeCheckbox = (val:any,list:any) => {
<span :style="getFormItemLableStyle(configStyle)" >{{ getLabel(data.item) }}</span>
{{editDisabled}}
</template>
<div class="form-value" v-if="type === 4">
<template class="form-value" v-if="type === 4">
<div class="form-value" v-if="data.type === 'datePicker'" v-html="timeToString(value,data.control.type)">
</div>
@ -801,9 +857,46 @@ const judgeCheckbox = (val:any,list:any) => {
<div class="form-value" v-else-if="data.type == 'checkbox'" v-html="judgeCheckbox(value,data.options)">
</div>
<div class="form-value" v-else v-html="value">
<div class="form-value" v-else-if="data.type == 'colorPicker'" >
<div :style="'width:20px; height:20px; background-color:'+value+';'"></div>
</div>
<div class="form-value" v-else-if="data.type == 'slider'" style="width:200px;" >
<el-slider v-model="value" disabled />
</div>
<div class="form-value" v-else-if="data.type == 'rate'" >
<el-rate v-model="value" disabled />
</div>
<div class="form-value" v-else-if="data.type == 'switch'" >
<el-switch
v-model="value"
:active-value="data.control.activeValue"
:inactive-value="data.control.inactiveValue"
disabled
/>
</div>
<div class="form-value" v-else-if="data.type == 'select'" v-html="selectValue(value,data.options)">
</div>
<div class="form-value" v-else-if="data.type == 'upload'" v-html="value">
</div>
<div class="form-value" v-else-if="data.type == 'tinymce'" v-html="value">
</div>
<template class="form-value" v-else-if="data.type == 'signaturemap'" >
<el-image style="width: 100%; height: 100%" :src="value" />
</template>
<div class="form-value" v-else-if="data.type == 'lowcodeTransfer'" v-html="value">
</div>
<div class="form-value" v-else-if="data.type == 'baidumap'" style="width: 100%;" >
<BaiduMapLook :address="value" />
</div>
<div class="form-value" v-else-if="data.type == 'expand-user'" v-html="pickUserVal(value)">
</div>
<div class="form-value" v-else v-html="value">
</div>
</template>
<template v-else>
<el-input
v-bind="control"
@ -849,7 +942,7 @@ const judgeCheckbox = (val:any,list:any) => {
:placeholder="data.control.placeholder?data.control.placeholder:'请输入'+getLabel(data.item)"
:style="getFormItemInputStyle(configStyle,2)"
:input-style="getFormItemInputStyle(configStyle,3)"
v-if="data.type === 'textarea'"
v-if="['textarea', 'description'].includes(data.type)"
/>
<el-radio-group
v-bind="control"

7
src/widget/baidumap/index.vue

@ -230,7 +230,10 @@ watch(()=>address.value,(val:string)=>{
}
})
onMounted(()=>{
// console.log("--1-->",value.value,props.data)
console.log("加载地址--1-->",value.value,formProps,props.data)
console.log("加载地址--2-->",formProps.value.model)
console.log("加载地址--3-->",props.data.name)
console.log("加载地址--4-->",formProps.value.model[props.data.name])
if(value.value != null && value.value != "") {
let adresAry = value.value.split('|*@*|')
if(adresAry.length >0){
@ -241,7 +244,7 @@ onMounted(()=>{
}
// console.log("--2-->",value.value,adresAry,address.value,lngLat.value)
if(lngLat.value != null && lngLat.value != ""){
let lnogLate = lnglat.value.split(",");
let lnogLate = lngLat.value.split(",");
if(lnogLate.length >= 2){
longitude.value = lnogLate[0]
latitude.value = lnogLate[lnogLate.length - 1]

102
src/widget/baidumap/indexLook.vue

@ -0,0 +1,102 @@
<!--
@ 作者: 秦东
@ 时间: 2024-08-05 16:11:35
@ 备注:
-->
<template>
<div>
<el-input v-model="address" disabled />
<div :id="mapId" ref="myBaiduMapView" class="smallMapView"></div>
</div>
</template>
<script lang='ts' setup>
const props = withDefaults(
defineProps<{
address: any
}>(),
{}
)
let mapId = "baiduMapView"+ Math.ceil(Math.random());
const mapObject = ref<any>()
const mapShow = ref(false)
const address = ref<string>(); //
const lngLat = ref<string>(); //
const longitude= ref<number>(117.14272945140574)
const latitude= ref<number>(35.91808471435389)
const loadJScript = () => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://api.map.baidu.com/getscript?v=3.0&ak=ljiKlTAsS7SNVqDM16IUwRVFFhrvbxiF';
script.onload = () => {
mapInit(mapObject)
}
document.body.appendChild(script);
}
//
const mapInit = (maps:any) => {
const map = new window.BMap.Map(mapId); // Map
var opts = {type: BMAP_NAVIGATION_CONTROL_LARGE}
map.addControl(new BMap.NavigationControl(opts)); //
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.MapTypeControl());
map.enableScrollWheelZoom(); //
const point = new BMap.Point(longitude.value,latitude.value); //
map.centerAndZoom(point, 16);
var marker = new BMap.Marker(point);
map.addOverlay(marker);
}
//
watch(()=>props.address,(val:any)=>{
console.log("监听地图地址变话",val);
if(val != null && val != "") {
let adresAry = val.split('|*@*|')
if(adresAry.length >0){
address.value = adresAry[0]
if(adresAry.length >=1){
lngLat.value = adresAry[adresAry.length-1]
}
}
// console.log("--2-->",value.value,adresAry,address.value,lngLat.value)
if(lngLat.value != null && lngLat.value != ""){
let lnogLate = lngLat.value.split(",");
if(lnogLate.length >= 2){
longitude.value = lnogLate[0]
latitude.value = lnogLate[lnogLate.length - 1]
}
}
// console.log("--31-->",val,adresAry,address.value,lngLat.value,longitude.value,latitude.value)
mapInit(mapObject)
}
},{deep:true})
onMounted(()=>{
if(props.address != null && props.address != "") {
let adresAry = props.address.split('|*@*|')
if(adresAry.length >0){
address.value = adresAry[0]
if(adresAry.length >=1){
lngLat.value = adresAry[adresAry.length-1]
}
}
// console.log("--2-->",value.value,adresAry,address.value,lngLat.value)
if(lngLat.value != null && lngLat.value != ""){
let lnogLate = lngLat.value.split(",");
if(lnogLate.length >= 2){
longitude.value = lnogLate[0]
latitude.value = lnogLate[lnogLate.length - 1]
}
}
// console.log("--31-->",val,adresAry,address.value,lngLat.value,longitude.value,latitude.value)
mapInit(mapObject)
}
nextTick(()=>{
loadJScript()
})
})
</script>
<style lang='scss' scoped>
.smallMapView{
width:100%;
height:400px;
}
</style>

2
src/widget/index.ts

@ -5,6 +5,7 @@ import serialNumber from './number/index.vue'
import urlLink from './urllink/index.vue'
import orgCitys from './orgcitys/index.vue'
import baiduMap from './baidumap/index.vue'
import baiduMapLook from './baidumap/indexLook.vue'
import orgCentent from './org/index.vue'
import digitPage from './digitpage/index.vue'
@ -31,6 +32,7 @@ export default (app: any) => {
app.component('UrlLink', urlLink)
app.component('OrgCitys', orgCitys)
app.component('BaiduMap', baiduMap)
app.component('BaiduMapLook', baiduMapLook)
app.component('OrgCentent', orgCentent)
app.component('DigitPage', digitPage)

13
src/widget/org/index.vue

@ -186,7 +186,18 @@ onMounted(() => {
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-if="type === 4" >
<el-tree-select
v-model="value"
v-loading="orgTreeLoading"
node-key="id"
:props="orgTreeProps"
:data="orgTreeList"
check-strictly
disabled
:render-after-expand="false"
/>
</template>
<template v-else>
<el-tree-select
v-model="value"

1
src/widget/systemunit/deptOrgPage.vue

@ -227,6 +227,7 @@ onMounted(()=>{
node-key="id"
clearable
check-strictly
:disabled="type == 4"
style="width: 240px"
/>
</div>

1
src/widget/systemunit/ownerPage.vue

@ -228,6 +228,7 @@ const orgTreeProps ={
:filterable="true"
node-key="id"
clearable
:disabled="type == 4"
style="width: 240px"
/>
</div>

Loading…
Cancel
Save