liwenxuan 3 months ago
parent
commit
3f5c2c40f9
  1. 1
      src/assets/icons/videoupload.svg
  2. 150
      src/components/lowCode/assistant/datePicker_20250820.vue
  3. 133
      src/components/lowCode/assistant/lowcodeTransferPage.vue

1
src/assets/icons/videoupload.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756255899037" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4836" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M18.437162 86.654663H0v-55.311487C0 14.012243 14.012243 0 31.343176 0h50.886568v18.437162H31.343176C24.337054 18.437162 18.437162 24.337054 18.437162 31.343176v55.311487zM0 167.778178h18.437162V239.683111H0zM0 316.381707h18.437162V398.242708H0zM0 477.522506h18.437162V553.114872H0zM0 628.707238h18.437162v74.486136H0zM0 785.423118h18.437162v70.061218H0zM82.229744 1024H31.343176c-17.330933 0-31.343176-14.012243-31.343176-31.343176v-49.411595h18.437162v49.411595c0 7.006122 5.899892 12.906014 12.906014 12.906014h50.886568v18.437162zM163.353259 1005.562838h73.74865v18.437162h-73.74865zM321.175369 1005.562838h79.279798v18.437162H321.175369zM479.734966 1005.562838h68.954987v18.437162h-68.954987zM625.388549 1005.562838h79.279798v18.437162h-79.279798zM782.104429 1005.562838h74.486136v18.437162h-74.486136zM992.656824 1024h-54.574001v-18.437162h54.574001c7.006122 0 12.906014-5.899892 12.906014-12.906014v-54.942744h18.437162v54.942744c0 17.330933-14.012243 31.343176-31.343176 31.343176zM1005.562838 786.160605h18.437162v75.592366h-18.437162zM1005.562838 637.925819h18.437162v70.061217h-18.437162zM1005.562838 482.316169h18.437162v76.698595h-18.437162zM1005.562838 320.069139h18.437162v81.123515h-18.437162zM1005.562838 167.778178h18.437162v73.011163h-18.437162zM1024 84.810947h-18.437162V31.343176c0-7.006122-5.899892-12.906014-12.906014-12.906014h-53.836514V0h53.836514c17.330933 0 31.343176 14.012243 31.343176 31.343176V84.810947zM786.529348 0h73.011163v18.437162h-73.011163zM635.344616 0h71.904934v18.437162h-71.904934zM479.734966 0h71.904933v18.437162h-71.904933zM320.069139 0h80.386028v18.437162H320.069139zM168.884408 0h73.011163v18.437162H168.884408zM271.763774 511.815628h486.741087v18.437163h-486.741087z" fill="#ADB9CC" p-id="4837"></path><path d="M505.915736 277.663666h18.437163v486.741087h-18.437163z" fill="#ADB9CC" p-id="4838"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

150
src/components/lowCode/assistant/datePicker_20250820.vue

@ -0,0 +1,150 @@
<!--
@ 作者: 秦东
@ 时间: 2024-11-14 13:08:53
@ 备注: 日期选择器
-->
<script lang='ts' setup>
import dayJs from 'dayjs'
const props = withDefaults(
defineProps<{
modelValue?: string
disabled?: boolean
data?:any
types?:number
}>(),
{}
)
const emits = defineEmits<{
(e: 'update:modelValue', value: string): void
}>()
const value = computed({
get: () => {
return props.modelValue
},
set: (newVal: any) => {
emits('update:modelValue', newVal)
},
});
//
const handleClick = (event) => {
//
event.target.readOnly = true;
};
//
const valPrint = (val:number,group:string,type:string) => {
alert(val)
console.log(val)
switch(group){
case "year":
if(type != "" && type == "x"){
return dayJs(val).format('YYYY');
}else{
return dayJs(val).format(type);
}
break;
case "month":
if(type != "" && type == "x"){
return dayJs(val).format('MM');
}else{
return dayJs(val).format(type);
}
break;
case "datetime":
if(type != "" && type == "x"){
return dayJs(val).format('YYYY-MM-DD HH:mm:ss');
}else{
return dayJs(val).format(type);
}
break;
case "week":
if(type != "" && type == "x"){
return dayJs(val).format('YYYY年第ww周');
}else{
return dayJs(val).format(type);
}
break;
case "datetimerange":
if(Array.isArray(val)){
let startTime = val[0]
let endNum = val.length-1
if(endNum<0){
endNum = 0
}
let endEnd = val[endNum]
if(type != "" && type == "x"){
return dayJs(startTime).format('YYYY-MM-DD HH:mm:ss') + " - " + dayJs(endEnd).format('YYYY-MM-DD HH:mm:ss');
}else{
return dayJs(startTime).format(type) + " - " + dayJs(endEnd).format(type);
}
}
break;
case "daterange":
if(Array.isArray(val)){
let startTime = val[0]
let endNum = val.length-1
if(endNum<0){
endNum = 0
}
let endEnd = val[endNum]
if(type != "" && type == "x"){
return dayJs(startTime).format('YYYY-MM-DD') + " - " + dayJs(endEnd).format('YYYY-MM-DD');
}else{
return dayJs(startTime).format(type) + " - " + dayJs(endEnd).format(type);
}
}
break;
case "monthrange":
if(Array.isArray(val)){
let startTime = val[0]
let endNum = val.length-1
if(endNum<0){
endNum = 0
}
let endEnd = val[endNum]
if(type != "" && type == "x"){
return dayJs(startTime).format('YYYY-MM') + " - " + dayJs(endEnd).format('YYYY-MM');
}else{
return dayJs(startTime).format(type) + " - " + dayJs(endEnd).format(type);
}
}
break;
default:
if(type != "" && type == "x"){
return dayJs(val).format('YYYY-MM-DD');
}else{
return dayJs(val).format(type);
}
}
}
</script>
<template>
<el-date-picker
v-if="props.types!=3"
align="left"
v-model="value"
:type="props.data.control.type"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:teleported="true"
:placeholder="props.data.control.placeholder"
:value-format="props.data.valueFormat"
:format="props.data.control.format"
@click="handleClick"
@focus="handleClick"
/>
<el-text v-else class="wordColor">{{valPrint(value,props.data.control.type,props.data.control.valueFormat)}}</el-text>
</template>
<style lang='scss' scoped>
.wordColor{
color:#000000;
}
</style>

133
src/components/lowCode/assistant/lowcodeTransferPage.vue

@ -0,0 +1,133 @@
<!--
@ 作者: 秦东
@ 时间: 2025-06-10 15:34:04
@ 备注: 单行文本及密码
-->
<script lang='ts' setup>
import { AnalysisCss,AnalysisInputCss } from '@/api/common/cssInfo'
import {
constFormProps
} from '@/api/lowCode/utils';
const props = withDefaults(
defineProps<{
data: FormList
tablekey: any
numrun?: number
modelValue?: any //
tProp?: string // form-itemprop
types?:number
control:any
}>(),
{}
)
const emits = defineEmits(['update:modelValue','pageIdAry'])
const formProps = inject(constFormProps, {}) as any
const config = computed(() => {
return props.data.config || {}
})
const type = computed(() => {
return formProps.value.type
})
const value = computed({
get: () => {
return props.modelValue
},
set: (newVal: any) => {
emits('update:modelValue', newVal)
},
});
/**
@ 作者: 秦东
@ 时间: 2025-06-10 14:25:01
@ 功能: 获取组件名称
*/
const getLabel = (val:any) => {
if(val.label){
return val.label;
}else{
return "";
}
}
/**
@ 作者: 秦东
@ 时间: 2024-11-13 14:36:08
@ 功能: 解析css
*/
const getFormItemLableStyle = (ele: any) => {
if(ele?.labelStyle){
// console.log("3",AnalysisCss(ele))
return AnalysisCss(ele?.labelStyle)
}
}
const getFormItemInputStyle = (ele: any,sty:number) => {
if(ele?.inputStyle){
// console.log("4",AnalysisInputCss(ele?.inputStyle,sty))
return AnalysisInputCss(ele?.inputStyle,sty)
}
}
/**
@ 作者: 秦东
@ 时间: 2024-07-27 15:11:42
@ 功能: 判断是否禁用
*/
const judgeIsDisabled = (key:string) => {
return false
if (type.value === 3) {
return true //
}
if (type.value === 1 && config.value.addDisabled) {
return true
}
if (type.value === 2 && config.value.editDisabled) {
return true //
}
if(props.nodeKey != undefined && props.purview != undefined && props.purview != null && props.purview != null && props.purview != "" && props.purview != "") {
if(props.purview.length < 1){
return false;
}else{
let isShow = true;
props.purview.forEach((item)=>{
if(item.nodeKey == props.nodeKey){
if(item.powerAry && item.powerAry.length > 0){
item.powerAry.forEach((itm)=>{
if(itm.id == key){
console.log("判断此组件是否禁用",itm,itm.id == key,"--------->",itm.isLook)
isShow = !itm.isEdit
}
})
}
}
})
return isShow
}
}else{
return false;
}
}
/****input slot处理***/
const getInputSlot = (key?: string) => {
const slot = key === 'p' ? config.value.prepend : config.value.append
const has = slot.indexOf('key:') === 0
if (!has) {
return false
}
const slotKey = slot.replace('key:', '')
const control = getControlByName(slotKey)
if (!control || Object.keys(control)?.length === 0) {
return false
}
return control
}
</script>
<template>
<LowcodeTransfer :key="componentKey" :data="props.data" :selected-value="value" @checked-id-list-changed="checkedIdListChangedIndex" @update-model="updateModel" @re-render-component="reRenderComponent"></LowcodeTransfer>
</template>
<style lang='scss' scoped>
.wordColor{
color:#000000;
}
</style>
Loading…
Cancel
Save