当前位置: 首页 > news >正文

如何上传网站到云主机sem网络推广公司

如何上传网站到云主机,sem网络推广公司,如何用vs的c 做网站,深圳创业补贴政策2021前置 目前的应用场景是&#xff1a;检查项目是树结构&#xff0c;有的项目还需要动态显示对应的子集 项目用的是uniappvue3tsvite生成的app tsx模版 统一渲染入口 <script lang"ts">import uniForms from dcloudio/uni-ui/lib/uni-forms/uni-forms.vueimport…

前置

目前的应用场景是:检查项目是树结构,有的项目还需要动态显示对应的子集
项目用的是uniapp+vue3+ts+vite生成的app

tsx模版

统一渲染入口

<script lang="ts">import uniForms from '@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue'import uniFormsItem from '@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.vue'import uniDataCheckbox from '@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue'import uniEasyinput from '@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue'
export default {components:{uniForms, uniFormsItem,uniEasyinput,uniDataCheckbox},props: {params: {type: Object,},render: {type: Function,},},render() {return this.render(this.params)},
}
</script>
<style lang="scss" scope>// .sele-inp{// 	gap: 20px;// }.cus-column{flex-direction: column;:deep(.checklist-group){gap: 20upx;flex-direction: column!important;}}.renderForm{background: #fff;padding: 20upx;box-sizing: border-box;// margin-top: 40upx;}:deep(.uni-forms-item__label){color: rgba(0, 0, 0, 0.85);}
</style>

动态解析tsx

tsx中用到的组件需要再,统一入口去引入,名字需要保持一致,目前渲染的表单类型,之有两个,input和redio,可根据自己的业务自行扩展

<script setup lang="tsx">import uniDataCheckbox from '@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue'import { h, resolveComponent } from 'vue'// import uniForms from '@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue'// import uniFormsItem from '@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.vue'// import uniEasyinput from '@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue'
type RenderType = {temList?: any[]
}const defalutItem = {itemType: '', itemTypeName: '', itemId: '',parentId: '', 
itemName: '', itemCode: '', itemRes: '',itemResLabel: ''
}
// 属性
const props = withDefaults(defineProps<RenderType>(),{temList: () => []
})// 表单值
const formDate = reactive({
})// 类型暂无用处
const options = {input: "uniEasyinput",radio: "uniDataCheckbox"
}
const setLabel = (val, id,key,parentItem) => {formDate[id][key] = val.detail.data.textlet item = val.detail.data.dataif(item && item.children && item.children.length > 0){formDate[parentItem.code] ? formDate[parentItem.code] : formDate[parentItem.code] = {}formDate[parentItem.code]['itemType'] = item.typeformDate[parentItem.code]['itemTypeName'] = item.typeNameformDate[parentItem.code]['itemId'] = item.idformDate[parentItem.code]['parentId'] = item.parentIdformDate[parentItem.code]['itemName'] = item.nameformDate[parentItem.code]['itemCode'] = item.code// formDate[parentItem.code]['itemResLabel']  ? formDate[parentItem.code]['itemResLabel'] : ''// formDate[parentItem.code]['itemRes'] ? '' : formDate[parentItem.code]['itemRes'] = ''}else {delete formDate[parentItem.code]}
}
const renderFormRef = ref()
const initDefaultItemForm = (item) => {formDate[item.id] ? formDate[item.id] : formDate[item.id] = {}formDate[item.id]['itemType'] = item.typeformDate[item.id]['itemTypeName'] = item.typeNameformDate[item.id]['itemId'] = item.idformDate[item.id]['parentId'] = item.parentIdformDate[item.id]['itemName'] = item.nameformDate[item.id]['itemCode'] = item.codeformDate[item.id]['itemResLabel']  ? formDate[item.id]['itemResLabel'] : ''formDate[item.id]['itemRes'] ? '' : formDate[item.id]['itemRes'] = ''console.log('initDefaultItemForm')
}
// <view class=""> {formDate[item.id] === ss.parentId ? <view class="theme theme-flex sele-inp"><text>{ ss.name }</text><uniEasyinput v-model={formDate[ss.id]}></uniEasyinput> </view>: '' }</view> 
const typeProcessor = (type?: string, item?: any, node?: any[]) => {if(type === 'input'){return <uniFormsItem  label={item.name} name={"[" + item.id + ", itemRes ]"}><uniEasyinput v-model={formDate[item.id]['itemRes']} placeholder={'请输入'+item.name}></uniEasyinput></uniFormsItem>}else if(type === 'radio'){const list = [] as any[]// let node = []if(item.children && item.children.length > 0){item.children.forEach((it:any) => {list.push({text: it.name, value: it.code, 'data': it})if(it.children && it.children.length > 0){it.children.forEach((ss:any) => {// 删除对应的值// delete formDate[ss.id]node!.push(ss)})}})}console.log('list',list)return [<view class={node && node.length > 0 ? '' : ''}><uniFormsItem  label={item.name} name={"[" + item.id + ", itemRes ]"}><uniDataCheckbox class={item.children.length > 3 ? '' : ''} v-model={formDate[item.id]['itemRes']} localdata={list} placeholder={'请选择'+item.name} onChange={(val) => setLabel(val, item.id, 'itemResLabel',item)}></uniDataCheckbox></uniFormsItem>{node!.map(no => {let parent_code  = nulltry{// 匹配父级codelet codes = no.code.split('_');codes = [...codes.slice(0, -1)]parent_code = codes.join('_')}catch(e){}formDate[item.id]['itemRes'] === parent_code ? (initDefaultItemForm(no)) : delete formDate[no.id]return [formDate[item.id]['itemRes'] === parent_code ?<uniFormsItem  label={no.name} name={"[" + no.id + ", itemRes ]"}><uniEasyinput v-model={formDate[no.id]['itemRes']} placeholder={'请输入'+ no.name}></uniEasyinput> </uniFormsItem>: '']})}</view>]}
}const renderFn = (formDate: any) => {console.log('formDate', formDate)return [<uniForms class="renderForm" label-width={100} modelValue={formDate} ref={renderFormRef}>{props.temList.map((item) => {initDefaultItemForm(item)let node = [] as any[]return  [<view>{typeProcessor(item.renderType, item, node)}</view>]})}</uniForms>]
}
const submit = () => {// reanderTemplateRefconsole.log(formDate)console.log(renderFormRef.value)
}
defineExpose({submit,formDate
})
</script><template><jsxRender :params="formDate" :render="renderFn" />
</template><style lang="scss" scoped>
.jsx-render {color: #41B883;
}
// .sele-inp{
// 	gap: 20px;
// }
</style>

案例

使用

<template><view class="re-box"><view v-for="(item ,index) in props.tagLists"><view class="box-top"><uni-section class="mb-10" :title="item.typeName" type="line" titleFontSize="20px"></uni-section></view><ReanderTemplate :temList="item.items"  ref="reanderTemplateRef" :key="index"/><!-- 	<uni-forms-item label="医生建议" ><uni-easyinput type="textarea" v-model="'expandParamMap['+item.type +'][docAdvice]'" placeholder="请输入医生建议" /></uni-forms-item> --><view style="padding: 10px;box-sizing: border-box;padding-top: 0;"><uni-forms-item label="医生建议"><uni-easyinput type="textarea"  v-model="expandParamMap[item.type]['docAdvice']"  placeholder="请输入医生建议" /></uni-forms-item></view></view><view style="padding: 10px;box-sizing: border-box;padding-top: 0;"><uni-forms-item label="签名"><view class="signature" v-if="signatureUrl"><image class="signatureImg" :src=" imgUrlPreFix + signatureUrl" /></view><wd-button plain hairline v-else @click="$tab.navigateTo(`/pages/signature/index`)">点击签名</wd-button></uni-forms-item> </view></view>
</template><script setup lang="ts" name="RenderBox">import { getCurrentInstance, ref } from 'vue'import { useToast } from 'wot-design-uni'import useUpload from '@/hooks/upload'import { upload } from '@/api/system/uploadService'import ReanderTemplate from '@/components/reanderTemplate/index.vue'import { examineFinish } from '@/api/app/speExamineTypeService'import { onLoad } from '@dcloudio/uni-app'const imgUrlPreFix = import.meta.env.VITE_APP_GATEWAY + '/file';const proxy = getCurrentInstance().proxytype EmitType = {(e: 'saveFallback') :void}const signatureUrl = ref()const toast = useToast()const reanderTemplateRef = ref()const emits = defineEmits<EmitType>()const itemAll = inject('itemAll')const expandParamMap = ref<any>({})const props = withDefaults(defineProps<{tagLists?: any[], formDataObj?: any[]}>(),{tagLists: () => [],formDataObj: () => []})watchEffect(() => {props.tagLists.forEach((item) => {expandParamMap.value[item.type]  = {itemType: item.type, passed: true, docAdvice: ''}})if(props.formDataObj && props.formDataObj.length > 0){nextTick(() => {for(let i=0; i < reanderTemplateRef.value.length; i++){let item = reanderTemplateRef.value[i]Object.assign(item.formDate,props.formDataObj[i])console.log('item.formDate',item.formDate)}})}})const submit = (params: any, url: string) => {proxy.$pop.showConfirm('','确认保存数据吗',true).then((res: any) => {console.log(res)if(res.confirm){submitFun(params, url)}})}const submitFun = (params: any) => {let itemResList = [] as ExamineTypeParams[]reanderTemplateRef.value.forEach((item: any) => {console.log('item.formDate',item.formDate)itemResList = itemResList.concat(Object.values(item.formDate) as ExamineTypeParams[])})let saveData = {signUrl: signatureUrl.value,expandParamMap: expandParamMap.value,infoId: params.infoId as string,itemResList: itemResList,itemAll: itemAll.value as SpeExamineInfoDocScanCodeDto[]}console.log('saveData',saveData)uni.showLoading({mask: true,title: '保存中...'});examineFinish(saveData).then(res => {console.log(res)proxy?.$pop.toast("保存成功")emits('saveFallback')}).finally(() => (uni.hideLoading()))}const signatureFun = (val: string) => {uni.showLoading({mask: true,title: '签名上传中...'})let ss =new Date().getTime() + '.jpg'let pa = {fileName: ss, localPath: val}useUpload(pa).then((res:any)=>{signatureUrl.value = res.data.fileUrlPath}).finally(() => (uni.hideLoading()))}onLoad(() => {uni.$on('signature', signatureFun)})onUnmounted(() => {uni.$off('signature', signatureFun)})defineExpose({submit})
</script><style lang="scss" scoped>.re-box{margin-top: 20upx;background-color: #fff;}.box-top{// padding: 20upx;font-size: 30upx;background: #fff;}.signature{width: 100px;height: 100px;.signatureImg{display: block;width: 100%;height: 100%;}}
</style>

数据结构及案例效果图

整理完后,后面贴


文章转载自:
http://dinncoassuming.knnc.cn
http://dinncofaery.knnc.cn
http://dinncogastroderm.knnc.cn
http://dinncohyposcope.knnc.cn
http://dinncopyritic.knnc.cn
http://dinncocephalothorax.knnc.cn
http://dinncohamulate.knnc.cn
http://dinncoscleroid.knnc.cn
http://dinncotpn.knnc.cn
http://dinncoruffianize.knnc.cn
http://dinncowatchfully.knnc.cn
http://dinncocns.knnc.cn
http://dinncopyrrhonist.knnc.cn
http://dinncoyakuza.knnc.cn
http://dinncocrippledom.knnc.cn
http://dinncorereward.knnc.cn
http://dinncomeniscocytosis.knnc.cn
http://dinncowedel.knnc.cn
http://dinncomicrofolio.knnc.cn
http://dinncospiritless.knnc.cn
http://dinncoeliminator.knnc.cn
http://dinncovaticinal.knnc.cn
http://dinncoimpersonal.knnc.cn
http://dinncosnowbreak.knnc.cn
http://dinncofibrinous.knnc.cn
http://dinncoelectropolish.knnc.cn
http://dinncoglutei.knnc.cn
http://dinnconynorsk.knnc.cn
http://dinncoruschuk.knnc.cn
http://dinncoascaris.knnc.cn
http://dinncopennsylvania.knnc.cn
http://dinncodetainee.knnc.cn
http://dinncosideslip.knnc.cn
http://dinncospectacled.knnc.cn
http://dinncoemulsionize.knnc.cn
http://dinncoquickassets.knnc.cn
http://dinncotrinketry.knnc.cn
http://dinncogreegree.knnc.cn
http://dinncoantithetic.knnc.cn
http://dinncoabsorbance.knnc.cn
http://dinncostood.knnc.cn
http://dinncogeorgette.knnc.cn
http://dinncocountryfied.knnc.cn
http://dinncofretwork.knnc.cn
http://dinncocatechumen.knnc.cn
http://dinncochoreology.knnc.cn
http://dinncoshlocky.knnc.cn
http://dinncoliberationist.knnc.cn
http://dinncoshamos.knnc.cn
http://dinncolithuanian.knnc.cn
http://dinncoprolative.knnc.cn
http://dinncopushbutton.knnc.cn
http://dinncosuperficialness.knnc.cn
http://dinncowatercolor.knnc.cn
http://dinncoappendiculate.knnc.cn
http://dinncoadvocacy.knnc.cn
http://dinncotailhead.knnc.cn
http://dinncostriped.knnc.cn
http://dinncograding.knnc.cn
http://dinncoaneroid.knnc.cn
http://dinncobarramunda.knnc.cn
http://dinncolavender.knnc.cn
http://dinncopropylite.knnc.cn
http://dinncodiachylon.knnc.cn
http://dinncobiennialy.knnc.cn
http://dinncocastalian.knnc.cn
http://dinncofilmy.knnc.cn
http://dinncokellerwand.knnc.cn
http://dinncoemplastic.knnc.cn
http://dinncorusticity.knnc.cn
http://dinncotetrad.knnc.cn
http://dinncobacchant.knnc.cn
http://dinncototalitarianize.knnc.cn
http://dinncosignificatory.knnc.cn
http://dinncoepidiascope.knnc.cn
http://dinncocleome.knnc.cn
http://dinncopolytonal.knnc.cn
http://dinncounderachieve.knnc.cn
http://dinncoplowtail.knnc.cn
http://dinncorowland.knnc.cn
http://dinncozhuhai.knnc.cn
http://dinncoplasterer.knnc.cn
http://dinncomanhandle.knnc.cn
http://dinnconewsbeat.knnc.cn
http://dinncoharare.knnc.cn
http://dinncogofer.knnc.cn
http://dinncostenographic.knnc.cn
http://dinncoatechnic.knnc.cn
http://dinncopalpal.knnc.cn
http://dinncoisallotherm.knnc.cn
http://dinncodemophobia.knnc.cn
http://dinncojusticer.knnc.cn
http://dinncoplacate.knnc.cn
http://dinncoparanephros.knnc.cn
http://dinncoatelier.knnc.cn
http://dinncowv.knnc.cn
http://dinncocardiotonic.knnc.cn
http://dinncovituperatory.knnc.cn
http://dinncotransformant.knnc.cn
http://dinncounderkill.knnc.cn
http://www.dinnco.com/news/146222.html

相关文章:

  • 字体 添加 wordpressseo关键词使用
  • 网站tag页面如何做b站推广入口2023
  • 网站的尾页要怎么做关键词的选取原则
  • 建设网站需要什么基础知识游戏推广公司
  • 成都网站开发等项目外包公司谷歌三件套
  • 网站的ico怎么做博客seo教程
  • 做彩票的网站微信推广方法
  • 中纪委网站两学一做征文建立企业网站步骤
  • 我被朋友拉进彩票网站说做代理专业关键词排名优化软件
  • 做网站售后几年近期国内新闻热点事件
  • 网站改版 如何改版百度关键词排名优化工具
  • python 做的网站电商平台运营方案
  • 软件项目管理是做什么搜索引擎优化作业
  • 广州建网站哪家最好互联网产品推广是做什么的
  • 做壁纸的网站软文新闻发布平台
  • 企业网站内容的制作长春seo外包
  • .net 网站开发教程百度seo推广价格
  • 1.网站建设基本流程是什么网站开发怎么做
  • 做网站公司青岛seo和sem的区别是什么?
  • 孝义做网站的公司魔贝课凡seo课程好吗
  • 色情网站开发网上支付大数据培训班需要多少钱
  • 丽江做网站网站友情链接交易平台
  • 建e室内设计网贴图北京搜索优化排名公司
  • 做图片的网站有哪些文章推广平台
  • 有哪些好点的单页网站乐陵seo外包公司
  • axure做网站好不好宁波优化seo是什么
  • 广州软件开发定制杭州seo营销
  • jsp电商网站开发教程国外搜索引擎排行榜
  • 寻找东莞微信网站建设杭州seo哪家好
  • 网站模板设计定制化服务seo和点击付费的区别