20 changed files with 1717 additions and 42 deletions
@ -0,0 +1,50 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 秦东 |
||||
|
@ 时间: 2024-09-12 10:25:52 |
||||
|
@ 备注: 分值 |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import { AnalysisCss,AnalysisInputCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts' |
||||
|
|
||||
|
const props = withDefaults( |
||||
|
defineProps<{ |
||||
|
modelValue?: string |
||||
|
disabled?: boolean |
||||
|
}>(), |
||||
|
{} |
||||
|
) |
||||
|
const emits = defineEmits<{ |
||||
|
(e: 'update:modelValue', value: string): void |
||||
|
}>() |
||||
|
const value = computed({ |
||||
|
get: () => { |
||||
|
return props.modelValue |
||||
|
}, |
||||
|
set: (newVal: any) => { |
||||
|
emits('update:modelValue', newVal) |
||||
|
}, |
||||
|
}); |
||||
|
/** |
||||
|
@ 作者: 秦东 |
||||
|
@ 时间: 2024-03-01 09:07:11 |
||||
|
@ 功能: 布局处理 |
||||
|
*/ |
||||
|
const getFormItemLableStyle = (ele: any) => { |
||||
|
if(ele?.labelStyle){ |
||||
|
// console.log("返回栅格宽度3",AnalysisCss(ele?.labelStyle)) |
||||
|
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) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<template> |
||||
|
<el-input v-bind="$props" v-model="value" :style="getFormItemInputStyle(configStyle,2)" :input-style="getFormItemInputStyle(configStyle,3)" oninput ="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^\./g, '')" placeholder="请输入"></el-input> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,121 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 秦东 |
||||
|
@ 时间: 2024-09-12 10:44:17 |
||||
|
@ 备注: 图片 |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import { AnalysisCss,AnalysisInputCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts' |
||||
|
import errimg from '@/assets/404_images/imgNotFound.png' |
||||
|
import { uploadUrl,getRequest } from '@/api/DesignForm' |
||||
|
|
||||
|
|
||||
|
const props = withDefaults( |
||||
|
defineProps<{ |
||||
|
modelValue?: string |
||||
|
disabled?: boolean |
||||
|
tablekey?: Object |
||||
|
data?: Object |
||||
|
formTableSetUp?: Object |
||||
|
imgUrl?: string |
||||
|
}>(), |
||||
|
{} |
||||
|
) |
||||
|
const emits = defineEmits<{ |
||||
|
(e: 'update:modelValue', value: string): void |
||||
|
}>() |
||||
|
const value = computed({ |
||||
|
get: () => { |
||||
|
if(props.data.control.imgUrl == ""){ |
||||
|
return props.modelValue?props.modelValue:errimg; |
||||
|
}else{ |
||||
|
return props.data.control.imgUrl |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
set: (newVal: any) => { |
||||
|
emits('update:modelValue', newVal) |
||||
|
return newVal |
||||
|
}, |
||||
|
}); |
||||
|
//组件css部分 |
||||
|
const configStyle = computed(() => { |
||||
|
return props.data.styles || {} |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
|
||||
|
const imgLoading = ref(false) |
||||
|
const imgPath = ref(errimg) |
||||
|
|
||||
|
//文件上传的格式与大小 |
||||
|
const beforeAvatarUpload = (rawFile) => { |
||||
|
imgLoading.value = true |
||||
|
// console.log("文件上传的格式与大小",rawFile.type) |
||||
|
let imgType = ['image/jpeg','image/jpg','image/png','image/gif','image/svg'] |
||||
|
if (!imgType.includes(rawFile.type)) { |
||||
|
ElMessage.error('您上传的不是图片!') |
||||
|
imgLoading.value = false |
||||
|
return false |
||||
|
} else if (rawFile.size / 1024 / 1024 > 200) { |
||||
|
ElMessage.error('您上传到额图片大于 200MB!') |
||||
|
imgLoading.value = false |
||||
|
return false |
||||
|
} |
||||
|
return true |
||||
|
} |
||||
|
//上传成功回调 |
||||
|
const handleAvatarSuccess = ( |
||||
|
response, |
||||
|
uploadFile |
||||
|
) => { |
||||
|
// imageUrl.value = URL.createObjectURL(uploadFile.raw!) |
||||
|
console.log("上传成功回调",value) |
||||
|
|
||||
|
emits('update:modelValue', response.data.url) |
||||
|
imgPath.value = response.data.url |
||||
|
value.value=response.data.url |
||||
|
console.log("上传成功回调---------->",value.value) |
||||
|
// let oldFormSetUp = props.formTableSetUp |
||||
|
// if(props.formTableSetUp && props.formTableSetUp.list && props.formTableSetUp.list.length > 0){ |
||||
|
// oldFormSetUp.list.forEach((item)=>{ |
||||
|
// if(item.name && item.name == props.data.name){ |
||||
|
// // value.value = response.data.url |
||||
|
// // item.control.link = response.data.url |
||||
|
// value.set(response.data.url) |
||||
|
// emits('update:modelValue', response.data.url) |
||||
|
// console.log("上传成功回调------>",response.data.url) |
||||
|
// } |
||||
|
// }) |
||||
|
// } |
||||
|
// props.setimgurl=response.data.url |
||||
|
// emits("update:imgUrl",response.data.url) |
||||
|
// console.log("上传成功回调------>",url.value) |
||||
|
// emits("updateCont",response.data.url) |
||||
|
|
||||
|
imgLoading.value = false |
||||
|
} |
||||
|
const getFormItemInputStyle = (ele: any,sty:number) => { |
||||
|
if(ele?.inputStyle){ |
||||
|
console.log("返回栅格宽度4",AnalysisInputCss(ele?.inputStyle,sty)) |
||||
|
return AnalysisInputCss(ele?.inputStyle,sty) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<template> |
||||
|
<el-upload |
||||
|
v-bind="$props" |
||||
|
class="upload-demo" |
||||
|
:action="uploadUrl" |
||||
|
:show-file-list="false" |
||||
|
:on-success="handleAvatarSuccess" |
||||
|
:before-upload="beforeAvatarUpload" |
||||
|
v-loading="imgLoading" |
||||
|
> |
||||
|
<!-- <img referrerpolicy="no-referrer" :src="url" :style="styleObject" :fit="fit" :class="[boderAndShadowClassIsActive ? boderAndShadowClass : '', radiusClassIsActive ? radiusClass : '',mp, floatFlag ? floatStyle : '']" /> --> |
||||
|
<img v-if="value" :src="value" class="avatar" :style="getFormItemInputStyle(configStyle,2)" /> |
||||
|
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon> |
||||
|
</el-upload> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,85 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 秦东 |
||||
|
@ 时间: 2024-09-12 10:03:22 |
||||
|
@ 备注: 行政组织选择 |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import { orgInfo } from '@/api/hr/org/type' |
||||
|
import { getOrgTreeList } from '@/api/hr/org/index' |
||||
|
|
||||
|
const props = withDefaults( |
||||
|
defineProps<{ |
||||
|
modelValue?: string |
||||
|
disabled?: boolean |
||||
|
}>(), |
||||
|
{} |
||||
|
) |
||||
|
const emits = defineEmits<{ |
||||
|
(e: 'update:modelValue', value: string): void |
||||
|
}>() |
||||
|
const value = computed({ |
||||
|
get: () => { |
||||
|
return props.modelValue*1 |
||||
|
}, |
||||
|
set: (newVal: any) => { |
||||
|
emits('update:modelValue', newVal) |
||||
|
// let newValJson:criteriaForPeopleList[] = JSON.parse(newVal) |
||||
|
// if(newValJson.length > 0){ |
||||
|
// let userAry = new Array |
||||
|
// let userKeyAry = new Array |
||||
|
// newValJson.forEach(item =>{ |
||||
|
// userAry.push(item.name+"("+item.number+")") |
||||
|
// userKeyAry.push(item.userkey.toString()) |
||||
|
// }) |
||||
|
// emits('update:modelValue', userAry.join(',')) |
||||
|
// // userlist.value = userAry.join(',') |
||||
|
// // |
||||
|
// }else{ |
||||
|
// emits('update:modelValue', "") |
||||
|
// } |
||||
|
}, |
||||
|
}); |
||||
|
const orgTreeList = ref<orgInfo[]>(); |
||||
|
const orgTreeLoading = ref(false); //加载行政组织树 |
||||
|
const orgTreeProps ={ |
||||
|
children: 'child', |
||||
|
label: 'name', |
||||
|
} //行政组织树对照值 |
||||
|
|
||||
|
function haveOrgTreeInfo(){ |
||||
|
orgTreeLoading.value = true; |
||||
|
getOrgTreeList({}) |
||||
|
.then(({ data })=>{ |
||||
|
orgTreeList.value = data |
||||
|
}).finally(()=>{orgTreeLoading.value = false;}) |
||||
|
} |
||||
|
|
||||
|
onBeforeMount(() => { |
||||
|
haveOrgTreeInfo(); |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
onMounted(() => { |
||||
|
// console.log("value---1--》",value.value,props.modelValue) |
||||
|
nextTick(() => {}) |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<el-tree-select |
||||
|
v-bind="$props" |
||||
|
v-model="value" |
||||
|
v-loading="orgTreeLoading" |
||||
|
node-key="id" |
||||
|
:props="orgTreeProps" |
||||
|
:data="orgTreeList" |
||||
|
check-strictly |
||||
|
:render-after-expand="false" |
||||
|
/> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
|
||||
|
</style> |
||||
File diff suppressed because it is too large
@ -0,0 +1,46 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 秦东 |
||||
|
@ 时间: 2024-09-12 14:41:53 |
||||
|
@ 备注: 获取行政组织数据 |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import { getgovcont } from '@/api/hr/org/index' |
||||
|
const props = defineProps({ |
||||
|
orgid:{ |
||||
|
type: String, |
||||
|
default:"" |
||||
|
} |
||||
|
}) |
||||
|
const orgName = ref("") |
||||
|
//选择行政组织 |
||||
|
const pickOrgVal = (val:any) => { |
||||
|
|
||||
|
if(val != "" && val != null){ |
||||
|
|
||||
|
getgovcont({id:val*1,idstr:val}) |
||||
|
.then(({data}) =>{ |
||||
|
// console.log("选择行政组织-3->",data,data.name) |
||||
|
orgName.value = data.name |
||||
|
}) |
||||
|
.finally(()=>{ |
||||
|
|
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
onBeforeMount(() => { |
||||
|
pickOrgVal(props.orgid) |
||||
|
}) |
||||
|
onMounted(() => { |
||||
|
pickOrgVal(props.orgid) |
||||
|
}); |
||||
|
watch(() =>props.orgid,(val:string) => { |
||||
|
// console.log("选择行政组织-4->",val) |
||||
|
pickOrgVal(val) |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div>{{ orgName }}</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
|
||||
|
</style> |
||||
Loading…
Reference in new issue