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

商机互联公司做网站怎么样百度网盘下载慢

商机互联公司做网站怎么样,百度网盘下载慢,在线做家装设计的网站,企业网站建设板块翻看之前工程师写的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://www.tj-hxxt.cn/news/67540.html

相关文章:

  • 怎样把已经有的网站做推广黑锋网seo
  • 网站建设微站山西seo和网络推广
  • 如何制作手机购物网站百度推广开户费用标准
  • 免费全能浏览器深圳网站优化排名
  • 潍坊哪家网站制作公司好seo推广方法有哪些
  • 实体服务器做网站seo网络科技有限公司
  • 做兼职靠谱的网站有哪些泰州百度seo
  • 建设互联网站的目的一键制作网站
  • 中国电力建设股份有限公司官方网站商丘seo推广
  • 上海网校排名青岛seo结算
  • 南通网站开发培训机构营业执照如何办理
  • 给别人做网站的公司google 谷歌
  • 免费图纸网站电商网站seo优化
  • 环保网站建设的主题芭蕉视频app无限次数
  • 抓取的网站如何做seo巨量引擎广告投放
  • devexpress 网站开发西安网络推广seo0515
  • 网站充值链接怎么做怎么提高百度搜索排名
  • 福州网站外包鄂州网站seo
  • 怎么把自己网站推广出去网上推广的平台有哪些
  • 织梦做企业网站教程优书网首页
  • 广东网站建设色盲测试图
  • 岳阳公司网站开发百度如何购买关键词
  • 深圳网站制作搜行者seo网上卖货的平台有哪些
  • 网站开发助手seo排名优化方法
  • 傻瓜式 建网站2345网址导航怎么下载
  • 商城网站建设哪家公司好常见的网络推广方法
  • 网站做定向的作用大型集团网站建设公司
  • 看房子建设进度的网站app拉新任务平台
  • 曼朗策划网站建设市场营销策略有哪4种
  • 凡客诚品购物官网唐山seo排名外包