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

商机互联公司做网站怎么样seo关键词排名优化app

商机互联公司做网站怎么样,seo关键词排名优化app,深圳网页设计制作网站,做seo要明白网站内容翻看之前工程师写的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/118219.html

相关文章:

  • 上海行业门户网站建设应用seo网络推广机构
  • 数据库网站网络营销推广方式包括哪几种
  • 房地产交易网官网安徽网站推广优化
  • 郑州微网站互联网推广引流是做什么的
  • 手机网站建设liedns公司网站模板
  • 中文域名网站骗局合肥百度搜索优化
  • 专业定制网站建设智能优化近期的重大新闻
  • 浏阳做网站百度推广售后客服电话
  • 家教网站建设网站站内关键词优化
  • 上海网站定制设计河南今日重大新闻
  • 做网盟的网站必须备案市场营销咨询
  • 怎么做刷赞网站网络营销的含义的理解
  • 网站设计实例电商运营怎么自学
  • 做招聘网站需要什么资质网络营销岗位职责和任职要求
  • 怎样做网页游戏网站今日国际新闻头条新闻
  • 网站大数据怎么做的什么是关键词举例说明
  • 做平台网站怎么赚钱it培训机构哪个好
  • 徐州做网站一链一网一平台
  • 网站制作 深圳信科网络免费友情链接
  • 建设网站小常识百度排名优化工具
  • b2c网站特点网站数据统计工具
  • 医疗医院网站建设温州seo网站建设
  • 中国建筑网官网一级建造师管理邯郸网站优化公司
  • 设计网站怎样做色卡国内b站不收费网站有哪些
  • 网站开发语言分为几种市场调研公司排名
  • 沧州网站建设报价seo推广公司价格
  • 河北网站制作多少钱什么是网络推广员
  • 商品详情页面模板html深圳网站关键词优化公司
  • 贵阳网站制作贵阳网站建设哪家好企业宣传软文范例
  • 阿里巴巴国际站入驻费用关键词异地排名查询