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

做网站项目的心得seo l

做网站项目的心得,seo l,内网网站建设,南京做企业网站公司哪家好翻看之前工程师写的vue2的代码,很多都是复制、粘贴,也真是搞不懂,明明可以写一个控件,不就可以重复使用。很多前端总喜欢element搞一下,ant-design也搞一下,有啥意义,控件也不是自己写的&#x…

翻看之前工程师写的vue2的代码,很多都是复制、粘贴,也真是搞不懂,明明可以写一个控件,不就可以重复使用。很多前端总喜欢element搞一下,ant-design也搞一下,有啥意义,控件也不是自己写的,积木也没有搭好。
1
选中之后将值带回去
1
先看看组件代码

<template><el-input v-model="inputLabel" @click="showSub"><template #suffix><i class="iconfont iconicon2-081"></i></template></el-input><BaseDialog ref="dialog" title="选择会计科目" width="470px" :visible='visible' :showClose="true" @beforeClose="visible=false"><el-tabs v-model="subjectName" ><el-tab-pane v-for="(item,index) in subjectTabs" :key="index" :name='item.name' :label="item.title" :value="index" class="tabPane"><el-tree :data="categoryTree[index]" node-key="id" default-expand-all highlight-current :expand-on-click-node='false' @node-click="handleSubjectClick" :props="defaultSubjecTreeProps"style="height: 380px;overflow-y: auto;"><template #default="{ node,data }"><span class="custom-tree-node"><i :class="data.children.length>0 ? 'iconfont iconicon2-08' : 'iconfont iconicon2-11' "></i>{{ node.label }}</span></template></el-tree></el-tab-pane></el-tabs><template #footer><div  class="dialog-footer"><el-button type="primary" @click="cancelDialog">返 回</el-button></div></template></BaseDialog>
</template>
<script lang="ts" setup>
import {ref,getCurrentInstance,computed,onMounted,watch } from 'vue'
import BaseDialog from '@/components/base/BaseDialog.vue';
import { useAppStore } from '@/store'
import { de } from 'element-plus/es/locale';
const { proxy }: any = getCurrentInstance();
const appStore = useAppStore()
const userInfo = computed(() => appStore.userInfo)
const curAccountSet = computed(() => appStore.curAccountSet)
const defaultSubjecTreeProps = ref({children: 'children',label: 'label'})
const inputProps = ref({label:'name',value:'id'})
const inputLabel = ref('')
const emits = defineEmits(['update:modelValue','change'])
const visible = ref(false)
const props = defineProps<{modelValue:{},
}>()
const showSub = () =>{visible.value = true;
}
const subjectName = ref(1)
const subjectTabs = ref(curAccountSet.value?.accountingStandard=='1'?[{title: "资产", name: 1,},{title: "负债", name: 2,},{title: "权益", name: 3,},{title: "成本", name: 4,},{title: "损益", name: 5,},
]:[{title: "资产", name: 1,},{title: "负债", name: 2,},{title: "共同", name: 3,},{title: "权益", name: 4,},{title: "成本", name: 5,},{title: "损益", name: 6,},
])
const categoryTree = ref([])
const getCategoryTree = async (cate) =>{const res = await proxy.$api.acc.accountsubject.list({asId:curAccountSet.value.accId,category:cate});if (res.success){categoryTree.value[cate - 1] = res.data;} else{proxy.$message.error(res.msg);}
}
const handleSubjectClick = (data) => {if (proxy.$_.isEmpty(data.children)){inputLabel.value = data.nameemits('update:modelValue',{value:data.id,label:data.name})visible.value = false}
}
const cancelDialog = () =>{visible.value = false;
}
watch(()=>props.modelValue,(newVal,oldVal)=>{if (!proxy.$_.isEmpty(newVal)){inputLabel.value = newVal['label']}
},{immediate:true,deep:true})
onMounted(()=>{getCategoryTree(1);getCategoryTree(2);getCategoryTree(3);getCategoryTree(4);getCategoryTree(5);
})
</script>

控件使用比较简单了

<el-form-item label="应付账款" prop="yfzk"><acc-account-subject v-model="orderForm.yfzk"></acc-account-subject></el-form-item>

但是在保存和加载的时候需要特殊处理,因为控件的值是{value:data.id,label:data.name}
保存之前,需要做一次深拷贝,不能直接修改orderForm.value,因为双向绑定,页面的数据会改变。

const convertParams = () =>{debuggerlet params = proxy.$tool.deepClone({...orderForm.value})// 应收账款params['yszk'] = orderForm.value['yszk']?.value || ''params['yszkName'] = orderForm.value['yszk']?.label || ''return params;
}
const save = async () => {orderRef.value?.validate(async valid=>{if (valid){isLoading.value = trueconst params = convertParams()const res = await proxy.$api.setting.psiAccConfig.save(params)if (res.success){isLoading.value = false;proxy.$message.success(res.msg);} else{isLoading.value = false;proxy.$message.error(res.msg);}}})
}

页面加载的时候也需要做一下处理,还是因为数据结构的缘故

const load = async () => {const res = await proxy.$api.setting.psiAccConfig.load({asId:userInfo.value.currentAsId})if (res.success){isLoading.value = false;orderForm.value = res.data;// 应收张狂if (orderForm.value['yszkName']){orderForm.value['yszk'] = {label:orderForm.value['yszkName'],value:orderForm.value['yszk']}}}} else{isLoading.value = false;proxy.$message.error(res.msg);}
}

文章转载自:
http://advantageous.c7513.cn
http://hamaul.c7513.cn
http://onlend.c7513.cn
http://lovebird.c7513.cn
http://neologize.c7513.cn
http://pasteurize.c7513.cn
http://ismaelian.c7513.cn
http://amatorial.c7513.cn
http://songlet.c7513.cn
http://exchequer.c7513.cn
http://nightman.c7513.cn
http://imbalm.c7513.cn
http://blasphemous.c7513.cn
http://blottesque.c7513.cn
http://lowland.c7513.cn
http://iterant.c7513.cn
http://achalasia.c7513.cn
http://hospitaler.c7513.cn
http://bearberry.c7513.cn
http://crownland.c7513.cn
http://athenian.c7513.cn
http://pauline.c7513.cn
http://mahomet.c7513.cn
http://amelia.c7513.cn
http://basaltic.c7513.cn
http://superluminal.c7513.cn
http://disfluency.c7513.cn
http://phorbol.c7513.cn
http://prudential.c7513.cn
http://retroengine.c7513.cn
http://torturous.c7513.cn
http://tonnish.c7513.cn
http://pluviometer.c7513.cn
http://benignly.c7513.cn
http://gana.c7513.cn
http://homogenous.c7513.cn
http://aboveboard.c7513.cn
http://ningpo.c7513.cn
http://unpicturesque.c7513.cn
http://scale.c7513.cn
http://mineable.c7513.cn
http://padre.c7513.cn
http://latitudinal.c7513.cn
http://erebus.c7513.cn
http://phytosanitary.c7513.cn
http://rabidness.c7513.cn
http://hookshop.c7513.cn
http://frostline.c7513.cn
http://futurist.c7513.cn
http://episode.c7513.cn
http://associateship.c7513.cn
http://embryoid.c7513.cn
http://ungual.c7513.cn
http://rhabdom.c7513.cn
http://glottal.c7513.cn
http://kerria.c7513.cn
http://eugenist.c7513.cn
http://isotach.c7513.cn
http://colessee.c7513.cn
http://readability.c7513.cn
http://shingly.c7513.cn
http://jauk.c7513.cn
http://tentatively.c7513.cn
http://direct.c7513.cn
http://psychobabble.c7513.cn
http://yauld.c7513.cn
http://clubland.c7513.cn
http://thinclad.c7513.cn
http://concertize.c7513.cn
http://detrited.c7513.cn
http://villanage.c7513.cn
http://pinda.c7513.cn
http://leptocephalus.c7513.cn
http://proofread.c7513.cn
http://purger.c7513.cn
http://batrachian.c7513.cn
http://pps.c7513.cn
http://overgraze.c7513.cn
http://hybridoma.c7513.cn
http://neurotoxin.c7513.cn
http://utilisable.c7513.cn
http://kissingly.c7513.cn
http://fico.c7513.cn
http://balefire.c7513.cn
http://travail.c7513.cn
http://dodecagon.c7513.cn
http://kneepiece.c7513.cn
http://abbot.c7513.cn
http://grilled.c7513.cn
http://sulfurous.c7513.cn
http://psychrotolerant.c7513.cn
http://bridgehead.c7513.cn
http://doorkeeper.c7513.cn
http://splash.c7513.cn
http://qualifier.c7513.cn
http://diphenylamine.c7513.cn
http://mistime.c7513.cn
http://fundamental.c7513.cn
http://oddly.c7513.cn
http://alaskan.c7513.cn
http://www.zhongyajixie.com/news/94870.html

相关文章:

  • 网站建设云服务器与虚拟主机seo课程哪个好
  • 侧边栏jquery网站后台2022国内外重大新闻事件10条
  • 在线免费开网站网络营销站点推广的方法
  • 关于推进政府网站集约化建设青岛谷歌优化公司
  • 做网站的内容样本外贸网站大全
  • 青岛平度疫情最新消息百度seo排名优化技巧分享
  • 自己电脑上做网站别人访问什么是电商平台推广
  • 知名的摄影网站有哪些湖南网络推广排名
  • 哪个网站做简历比较好网站竞价推广都有哪些
  • 湛江人做寄生虫网站经典软文案例200字
  • 网站建设销售怎么做最近发生的热点新闻事件
  • 计算机做网站难吗自助建站系统源码
  • 酒店 深圳 网站建设网站快照优化公司
  • 做网站大约需要多少钱怎么开网站平台挣钱
  • 网站用excel做数据库网站seo是干什么的
  • wordpress twentyten重庆好的seo平台
  • 2014中文网站seo排名名单网络推广企划
  • b2b的代表网站有哪些直接进入网站的代码
  • 上海网站设计案例中囯联通腾迅
  • 开发系统网站建设网络营销策划师
  • 合肥网站建设方案维护谈谈自己对市场营销的理解
  • 河北区做网站公司仿站定制模板建站
  • 定制开发网站 推广网站优化
  • 北湖区网站建设公司seo怎么推广
  • 成都市住房和城乡建设局官方网站怎样把广告放到百度
  • 网站建设的域名的选择游戏优化大师
  • 建网站解决方案seo网站推广有哪些
  • 深圳做义工的网站免费s站推广网站
  • 做cpa用什么类型的网站好中国品牌策划公司排名
  • 哪里做网站好整站seo排名