vue项目开发笔记记录(四)

简介: vue项目开发笔记记录

vue项目开发笔记记录(三):https://developer.aliyun.com/article/1483520


码值过滤

filterFn:(v)=>{ return v.filter(item.dispVal.indexOf('住院')>-1)}

export const items = [
  {
    label: '人员类别',
    prop: 'psnide',
    span: 8,
    type: 'codeTable',
    codeKey: 'INSU_IDET_TYPE',
    filterFn: (v) => { return v.filter(item => item.dispVal.indexOf('在职人员') > -1) },
    filterable: true,
    options: []
  }
]

重置表单

:model="queryForm"
ref="queryForm"

resetForm() {
    this.reset()
    this.$refs.queryForm.elForm.resetFields()
},

一次性引入

import * as Api from '@/api/PaymentInAdvance/PaymentInAdvanceManage/Request'

经办日期处理

import { ACP_DATATYPE, CURRENT_DAY, CURRENT_MONTH_FIRST } from '@/utils/constant'
dateRange: [
  moment().startOf('month').format('YYYY-MM-DD'),
  moment().endOf('month').format('YYYY-MM-DD')
]      
sendDate: [CURRENT_MONTH_FIRST, CURRENT_DAY],
     
optTimeBegn: Array.isArray(this.queryForm.sendDate) ? this.queryForm.sendDate[0] : '',
optTimeEnd: Array.isArray(this.queryForm.sendDate) ? this.queryForm.sendDate[1] : '',

码值过滤

{ label: '业务办理情形', prop: 'bizStas', type: 'codeTable', codeKey: 'PH_BIZ_STAS', options: [], filterFn: (v) => {
    return v.filter(item => ['-1', '0', '2'].includes(item.dataVal) === true)
}

监听码值变化,切换

 queryForm: {
        personInfo: {},
        name: '',
        certno: '',
        empNo: '',
        empName: '',
        acpType: ACP_DATATYPE,
        dateRange: [
          moment().startOf('month').format('YYYY-MM'),
          moment().endOf('month').format('YYYY-MM')
        ],
        sendDate: [CURRENT_MONTH_FIRST, CURRENT_DAY]
},
acpType: '0',

  watch: {
    queryForm: {
      handler: function(newVal) {
        if (newVal.personInfo) {
          this.queryForm.psnNo = newVal.personInfo.psnNo
          this.queryForm.certno = newVal.personInfo.certno
          this.queryForm.name = newVal.personInfo.psnName
          this.queryForm.empNo = newVal.personInfo.empNo
        }
        this.acpType = newVal.acpType
        if (this.acpType) {
          this.changeAcpType(this.acpType)
        }
      },
      deep: true
    }
  },


changeAcpType(v) {
      if (v === '0') {
        this.itemsDatas.forEach(item => {
          if (item.prop === 'empNo' || item.prop === 'empName') {
            this.$set(item, 'hidden', true)
          }
          if (item.prop === 'certno' || item.prop === 'name') {
            this.$set(item, 'hidden', false)
          }
        })
      } else {
        this.itemsDatas.forEach(item => {
          if (item.prop === 'empNo' || item.prop === 'empName') {
            this.$set(item, 'hidden', false)
          }
          if (item.prop === 'certno' || item.prop === 'name') {
            this.$set(item, 'hidden', true)
          }
        })
      }
    },

校验

rules: {
  insutype: { required: true, message: '请选择险种', trigger: 'change' }
},
ref="queryForm" :model="queryForm" :rules="rules"

this.$refs.queryForm.elForm.validate((valid) => {
   if (valid) {
      this.getList()
    } else {
      return false
    }
})

手机号校验

conerMob: [{ required: true, message: '请输入正确的手机号', validator: validator, regexp: 'phone', trigger: 'blur' }]
import validator from '@/utils/el-validator'

表格常用操作图标

注意: type和icon二选一,不能混合使用

type:
蓝色按钮类型: search 查询, submit 提交,save 保存,import 导入, export 导出,print 打印 , sure 确定,audit 审核(初审), batchAudit 批量审核以及其他 other
绿色按钮类型: add 新增(新增,添加,新建)
黄色按钮类型: edit 修改,review 复审
红色按钮类型: delete 删除, batchDelete 批量删除,cancel 取消,disable 禁用
白色按钮类型: reset 重置, close 关闭, back 返回,以及默认白色

icon: 这种基本用于表格操作里面的图标按钮
edit 修改,
maintenance 维护, 
detail 详情,
audit 审核, 
review 复审, 
cancelAudit 取消审核, 
delete 删除,
print 打印,
export 导出
cancel 取消,
stop 停止,
upload 上传, 
calculate 计算, 
check 核查, 
replace 替换 
save 保存, 
submit 提交, 
exit 退出
accept 受理, 
historicalRecord 历史记录, 
adjust 调整, 
send 发起/发送, 
invitation 邀请函, 
supplement 补充材料
personnel 人员

具体使用:
operationTypeArr: [
  { type: 'search', title: '查询', eleType: 'primary' },
  { type: 'submit', title: '提交', eleType: 'primary' },
  { type: 'save', title: '保存', eleType: 'primary' },
  { type: 'import', title: '导入', eleType: 'primary' },
  { type: 'export', title: '导出', eleType: 'primary' },
  { type: 'sure', title: '确定', eleType: 'primary' },
  { type: 'audit', title: '审核', eleType: 'primary' },
  { type: 'batchAudit', title: '批量审核', eleType: 'primary' },
  { type: 'other', title: '其他', eleType: 'primary' },
  { type: 'add', title: '新增', eleType: 'success' },
  { type: 'edit', title: '修改', eleType: 'warning' },
  { type: 'review', title: '复审', eleType: 'warning' },
  { type: 'delete', title: '删除', eleType: 'danger' },
  { type: 'batchDelete', title: '批量删除', eleType: 'danger' },
  { type: 'cancel', title: '取消', eleType: 'danger' },
  { type: 'disable', title: '禁用', eleType: 'danger' },
  { type: 'print', title: '打印', eleType: 'primary' },
  { type: 'reset', title: '重置', eleType: '' },
  { type: 'close', title: '关闭', eleType: '' },
  { type: 'back', title: '返回', eleType: '' }
],
iconArr: [
  { icon: 'edit', title: '修改', iconSvg: 'el-icon-edit', isFontSize: true, eleType: 'warning' },
  { icon: 'delete', title: '删除', iconSvg: 'el-icon-delete', isFontSize: true, eleType: 'danger' },
  { icon: 'detail', title: '详情', iconSvg: 'el-icon-view', isFontSize: true, eleType: 'primary' },
  { icon: 'upload', title: '上传', iconSvg: 'el-icon-upload2', isFontSize: true, eleType: 'success' },
  { icon: 'preview', title: '预览', iconSvg: 'el-icon-view', isFontSize: true, eleType: 'primary' },
  { icon: 'lookover', title: '查看', iconSvg: 'el-icon-view', isFontSize: true, eleType: 'primary' },
  { icon: 'setting', title: '设置', iconSvg: 'el-icon-setting', isFontSize: true, eleType: 'warning' },
  { icon: 'config', title: '配置', iconSvg: 'el-icon-setting', isFontSize: true, eleType: 'warning' },
  { icon: 'sure', title: '确认', iconSvg: 'el-icon-check', isFontSize: true, eleType: 'success' },

  { icon: 'save', title: '保存', iconSvg: 'save', eleType: 'primary' },
  { icon: 'submit', title: '提交', iconSvg: 'submit', eleType: 'primary' },
  { icon: 'maintenance', title: '维护', iconSvg: 'maintenance', eleType: 'warning' },
  { icon: 'audit', title: '审核', iconSvg: 'aduit', eleType: 'primary' },
  { icon: 'review', title: '复审', iconSvg: 'aduit', eleType: 'warning' },
  { icon: 'cancelAudit', title: '取消审核', iconSvg: 'cancelAduit', eleType: 'danger' },
  { icon: 'print', title: '打印', iconSvg: 'el-icon-printer', isFontSize: true, eleType: 'primary' },
  { icon: 'export', title: '导出', iconSvg: 'el-icon-download', isFontSize: true, eleType: 'primary' },
  { icon: 'cancel', title: '取消', iconSvg: 'cancel', eleType: 'danger' },
  { icon: 'stop', title: '停止', iconSvg: 'stop', eleType: 'danger' },
  { icon: 'calculate', title: '计算', iconSvg: 'count', eleType: 'primary' },
  { icon: 'recall', title: '撤回', iconSvg: 'recall', eleType: 'danger' },
  { icon: 'exit', title: '退出', iconSvg: 'exit', eleType: 'danger' },
  { icon: 'check', title: '核查', iconSvg: 'check', eleType: 'warning' },
  { icon: 'replace', title: '替换', iconSvg: 'replace', eleType: 'warning' },
  { icon: 'analysis', title: '分析', iconSvg: 'analysis', eleType: 'warning' },
  { icon: 'apply', title: '申请', iconSvg: 'apply', eleType: 'primary' },
  { icon: 'duizhang', title: '对账', iconSvg: 'duizhang', eleType: 'primary' },
  { icon: 'accept', title: '受理', iconSvg: 'accept', eleType: 'primary' },
  { icon: 'historicalRecord', title: '历史记录', iconSvg: 'historicalRecord', eleType: 'primary' },
  { icon: 'adjust', title: '调整', iconSvg: 'adjust', eleType: 'warning' },
  { icon: 'send', title: '发起/发送', iconSvg: 'send', eleType: 'primary' },
  { icon: 'invitation', title: '邀请函', iconSvg: 'invitation', eleType: 'primary' },
  { icon: 'supplement', title: '补充材料', iconSvg: 'supplement', eleType: 'primary' },
  { icon: 'personnel', title: '人员', iconSvg: 'personnel', eleType: 'primary' }
]

监听码值变化,切换

 queryForm: {
        personInfo: {},
        name: '',
        certno: '',
        empNo: '',
        empName: '',
        acpType: ACP_DATATYPE,
        dateRange: [
          moment().startOf('month').format('YYYY-MM'),
          moment().endOf('month').format('YYYY-MM')
        ],
        sendDate: [CURRENT_MONTH_FIRST, CURRENT_DAY]
},
acpType: '0',

  watch: {
    queryForm: {
      handler: function(newVal) {
        if (newVal.personInfo) {
          this.queryForm.psnNo = newVal.personInfo.psnNo
          this.queryForm.certno = newVal.personInfo.certno
          this.queryForm.name = newVal.personInfo.psnName
          this.queryForm.empNo = newVal.personInfo.empNo
        }
        this.acpType = newVal.acpType
        if (this.acpType) {
          this.changeAcpType(this.acpType)
        }
      },
      deep: true
    }
  },


changeAcpType(v) {
      if (v === '0') {
        this.itemsDatas.forEach(item => {
          if (item.prop === 'empNo' || item.prop === 'empName') {
            this.$set(item, 'hidden', true)
          }
          if (item.prop === 'certno' || item.prop === 'name') {
            this.$set(item, 'hidden', false)
          }
        })
      } else {
        this.itemsDatas.forEach(item => {
          if (item.prop === 'empNo' || item.prop === 'empName') {
            this.$set(item, 'hidden', false)
          }
          if (item.prop === 'certno' || item.prop === 'name') {
            this.$set(item, 'hidden', true)
          }
        })
      }
    },

日期选择器时,默认显示当天日期

<el-form-item label="交易数据">
            <el-date-picker
              type="date"
              placeholder="选择日期"
              v-model="searchFormField.date"
              style="width: 100%;"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
</el-form-item>
        
     
 methods: {
    getNowTime() {
       var now = new Date();
       var year = now.getFullYear(); //得到年份
       var month = now.getMonth(); //得到月份
       var date = now.getDate(); //得到日期
       month = month + 1;
       month = month.toString().padStart(2, "0");
       date = date.toString().padStart(2, "0");
       var defaultDate = `${year}-${month}-${date}`;
       this.$set(this.searchFormField, "date", defaultDate);
   },
 }

状态为tag标签

<template slot="valiFlagName" slot-scope="scope">
        <State-tag :tag-type="scope.row.valiFlagName === '有效'? 'pass' : 'nopass'" :title="scope.row.valiFlagName" />
</template>

{
  label: '有效标志',
  prop: 'valiFlagName',
  align: 'center',
  type: 'custom',
  slotName: 'valiFlagName',
},

文件预览

import PreviewImage from '@/components/Preview'
<PreviewImage
      ref="ImgPreview"
      :viewer-visible.sync="viewerVisible"
      :img-data-list.sync="imgDataList"
      :img-index.sync="imgIndex"
/>

viewerVisible: false,
imgDataList: [],
imgIndex: 0,

 // 预览
showUploadPreview(data) {
      // this.isInnerVisible = true
      // this.currentPreview = data
 this.imgDataList = [{ title: data.filename, url: data.filePath, id: data.fileId }]
 this.viewerVisible = true
}

解决弹窗高度滚动条问题

/deep/.pf-table {
  min-height: 430px;
  /deep/.el-table {
    min-height: 430px !important;
  }
}

>>>.el-table--small th, >>>.el-table--small td {
    padding: 7px 0;
}
>>>.el-table thead th .cell {
    height: 32px;
    line-height: 32px;
}

弹窗关闭与打开

<EditDialog
:dialog-title="dialogTitle"
:administrative-domain-form="administrativeDomainForm"
:is-dialog-visible="isDialogVisible"
@saveAddministrativeDomain="saveAddministrativeDomain"
@update:isShow="isShow"
@search="search"
/>

isDialogVisible: false,

this.isDialogVisible = true


isShow(v) {
  this.isDialogVisible = v
},
//子组件
 <form-dialog size="middle" :title="dialogTitle" :is-show="isDialogVisible" @update:isShow="isShow" @resetForm="resetForm">

props: {
    isDialogVisible: {
      type: Boolean,
      default: false
    },
}
isShow(v) {
   this.$emit('update:isShow', v)
},
closeDialog() {
   this.$emit('update:isShow', false)
},

<el-button @click="closeDialog()">取消</el-button>

正则图片校验

isImage(str) {
      var reg = /\.(png|jpg|gif|jpeg|webp)$/
      return reg.test(str)
    },

文件下载

/* 文件下载处理 */
export function funDownload(href, filename) {
  var a = document.createElement('a')
  var e = document.createEvent('MouseEvents')
  e.initEvent('click', false, false)
  a.href = href
  a.download = filename
  a.dispatchEvent(e)
}

限制input框只能输入整数

onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"

校验是否为正整数

1.首先在vue文件的methods()中添加校验方法,这里校验方法命名为isNumber用自带的.test方法进行正则校验

 methods: {
   isNumber(rule, value, callback) {
      if (value === '') {
        return callback();
      }  //这是用来判断如果不是必须输入的,则直接跳出
      const r = /^\+?[1-9][0-9]*$/; // 正整数
      // 如果判断不符合正则,则不是正整数不能提交
      if (!r.test(value)) {
        return callback(new Error('数量必须为正整数'));
      } else {
        return callback();
      }
    },
}

2.在data()中定义的rules里使用校验规则
rules: {
  size: [{ validator: this.isNumber, trigger: 'blur' }],
},

vue打包war

cnpm install --save folder-zip-sync

"build:war": "npm run build:prod && node ./build/war.js",

添加war.js

Cascader 级联选择器清除选中

<el-cascader
    v-model="value"
    :options="options"
    ref="cascader">
</el-cascader>

// 清空级联选择器选中状态
this.$refs.cascader.$refs.panel.clearCheckedNodes()
// 清除高亮
this.$refs.cascader.$refs.panel.activePath = []

重置表格选中状态


clearSelection() {
  this.$refs['pf-table'].clearSelection() // 清除多选
}
ref="multipleTable"

this.$refs.multipleTable.clearSelection()

病案首页处理

import Modal from '@/views/expert-review-sys/components/Medical/modal'

//modal.vue
<el-row :gutter="10">
      <el-col :span="isFold && !isFold2 ?24:10" style="height: 100%">
      
<Group-plan v-bind="this.$attrs" @handle-fold="handleFold" />
      
<transition name="fade" model="out-in">
    <el-col v-if="!isFold" :span="!isFold && isFold2 ?24:14">
      <Details v-bind="this.$attrs" @handle-fold2="handleFold2" />
    </el-col>
</transition>

isFold: false,
isFold2: false

handleFold(v) {
  this.isFold = v
},
handleFold2(v) {
  this.isFold2 = v
}

//detailsRight.vue
<section class="layer pf-item" :class="isFold2?'audiut-box':''">

<div class="audiut-boxs" style="height: 100%;width: 100%;padding: 0 15px;">
      <div class="box-header handle">
        <span class="box-title box-title1">信息评审项</span>
        <div class="box-tools">
          <i class="fold" :class="isFold2?'el-icon-s-unfold':'el-icon-s-fold'" :title="isFold2?'折叠':'展开'" @click="foldClick" />
        </div>
      </div>
isFold2: false,

foldClick() {
  this.isFold2 = !this.isFold2
  this.$emit('handle-fold2', this.isFold2)
}

//baxq.vue
<i :class="isFold?'el-icon-s-fold folded':'el-icon-s-unfold fold'" :title="isFold?'折叠':'展开'" @click="foldClick" />
    <section class="layer" :class="isFold?'medical-homePage':''">

setDate(value) {
  if (value) {
    return moment(value).format('YYYY/MM/DD')
  } else {
    return ''
  }
}
return '\u3000\u3000\u3000\u3000\u3000\u3000'

import moment from 'moment'
isFold: false
 
foldClick() {
  this.isFold = !this.isFold
  this.$emit('handle-fold', this.isFold)
}

当前年份

(new Date()).getFullYear() + ''

区保医划

 <template slot="search-header">
      <form-items ref="form" :model="queryForm" :items-datas="itemsDatas" :form-datas="queryForm" :rules="rules">
        <my-button type="reset" title="重置" @click="resetForm" />
        <my-button type="search" title="查询" @click="search" />
      </form-items>
    </template>
    
itemsDatas: [
        {
          label: '医保区划',
          prop: 'admdvs',
          type: 'component',
          componentName: 'MedicalArea',
          folder: 'Common'
        },
        { label: '抽样日期', prop: 'datetimerange', type: 'dateRange' }
],

form-items中使用模板

<template slot="applFlagName" slot-scope="scope">
          <State-tag :tag-type="scope.row.applFlagName === '申诉'? 'pass' : 'nopass'" :title="scope.row.applFlagName" />
        </template>

分页处理

  this.table.total = res.data.pageInfo.recordCounts
            this.table.pageNum = res.data.pageInfo.pageNum
            this.table.pageSize = res.data.pageInfo.pageSize
            
            
            this.table1.total = res.data.recordCounts
            this.table1.startRow = res.data.startRow
            this.table1.endRow = res.data.endRow

原生分页处理

<el-pagination :current-page="table.pageNum" :page-sizes="[15, 30, 50, 100]" :page-size="table.pageSize" :total="table.total" layout="slot, sizes, prev, pager, next, jumper" @current-change="handleCurrentChange" @size-change="handleSizeChange">
            <template slot>
              <span class="el-pagination__total">{{ `总共${table.total}条 显示${table.startRow}-${table.endRow}条` }}</span>
            </template>
          </el-pagination>

table: {
        tableData: [],
        loading: false,
        pageNum: 1,
        pageSize: 15,
        total: 10,
        height: 555,
        startRow: 0,
        endRow: 0
      },
      
 handleCurrentChange(val) {
      this.table.pageNum = val
      this.getCmiKpiAnalysisList()
    },
    handleSizeChange(val) {
      this.table1.pageSize = val
      this.getCmiKpiAnalysisList()
    },


this.table.tableData = res.data.rows
            this.table.pageNum = res.data.pageInfo.pageNum
            this.table.pageSize = res.data.pageInfo.pageSize
            this.table.total = res.data.pageInfo.recordCounts
            this.table.startRow = res.data.pageInfo.startRow
            this.table.endRow = res.data.pageInfo.endRow

button颜色

>>>.el-table .el-button {
    color: #1B65B9;
    width: auto;
}

.el-table >>>.el-button {
    color: #1B65B9;
    width: auto;
}

医院名称组件

itemsDatas: [
        {
          label: '医保区划',
          prop: 'admdvs',
          type: 'component',
          componentName: 'MedicalArea',
          folder: 'Common'
        },
        {
          label: '医院名称',
          prop: 'medinsCodg',
          type: 'component',
          componentName: 'MedicalInstitutionsSelect/index',
          folder: 'Common',
          params: { bindType: 'name', fixFlag: '0', queCont: '1' }
        }
      ],

亿万过滤器

filters: {
     numberFormat: function (value) {
              let unit = '';
                var k = 10000,
                   sizes = ['', '万', '亿', '万亿'],
                   i;
                   if(value < k){
                       value =value;
                   }else{
                       i = Math.floor(Math.log(value) / Math.log(k));
                       value = ((value / Math.pow(k, i))).toFixed(2);
                       unit = sizes[i];
                   }
              return value+unit;
        }
},

操作按钮

<my-button icon="detail" title="详情" @click="showDetail(scope.row)" />
        <my-button icon="delete" title="删除" @click="delRule(scope.row)" />

统计年度宽度

>>>.el-date-editor.el-input, >>>.el-date-editor.el-input__inner {
    width: 100%;
}

分页

this.paginationQuery.pageSize

自定义图标

<my-button title="退回" @click="giveUp(scope.row)">
    <svg-icon icon-class="back" class="backss" />
</my-button>

svg图标放在icons->svg文件夹下面


reset

reset() {
      this.$refs.form.elForm.resetFields()
},
 <el-tab-pane label="病案首页" name="first">
        <Group-plan :rew-task-detl="medcasInfo" />
      </el-tab-pane>
      <el-tab-pane label="出院小结" name="second">
        <Hospital :dscg-end="medcasInfo" />
      </el-tab-pane>
      <el-tab-pane label="检查报告" name="third" />
      <el-tab-pane label="细菌结果" name="fourth">
        <Bacteria :bacteria-rslt="medcasInfo" />
      </el-tab-pane>
      <el-tab-pane label="申诉信息" name="fifth">
        <GriInfo :appl-info="medcasInfo" />
      </el-tab-pane>
      <el-tab-pane label="长期医嘱单" name="sixth">
        <Orders :drord-records="medcasInfo" />
      </el-tab-pane>
      <el-tab-pane label="检验结果" name="seventh">
        <DschaSumma :test-rslt="medcasInfo" />
      </el-tab-pane>
无右边的

有右边的


<el-tab-pane label="病案首页" name="first">
          <Group-plan :rew-task-detl="rewTaskDetl" />
        </el-tab-pane>
        <el-tab-pane label="出院小结" name="second">
          <Hospital :dscg-end="rewTaskDetl" />
        </el-tab-pane>
        <el-tab-pane label="检查报告" name="third" />
        <el-tab-pane label="细菌结果" name="fourth">
          <Bacteria :bacteria-rslt="rewTaskDetl" />
        </el-tab-pane>
        <el-tab-pane label="申诉信息" name="fifth">
          <GriInfo :appl-info="rewTaskDetl" />
        </el-tab-pane>
        <el-tab-pane label="长期医嘱单" name="sixth">
          <Orders :drord-records="rewTaskDetl" />
        </el-tab-pane>
        <el-tab-pane label="检验结果" name="seventh">
          <DschaSumma :test-rslt="rewTaskDetl" />
        </el-tab-pane>
fixmedinsCode: rewTaskDetl.medinsCodg,
medcasno: rewTaskDetl.medcasno

展示错误内容

<el-dialog title="错误内容" :visible.sync="errorShow" :modal-append-to-body="true" :append-to-body="true" size="big">
      <section>
        <my-table-view :columns="errorColumns" :data="errorData" :is-configheader="false" />
      </section>
      <span slot="footer" class="dialog-footer">
        <my-button type="close" title="关闭" @click="errorShow = false" />
      </span>
    </el-dialog>


this.$msgWarning('部分费用信息保存失败!')
this.errorShow = true

this.errorShow = true
this.errorData = res.data.errorList

2020092901

默认时间处理

//月初到今天
/**
 * 获取本月第一天
 * @param {number} format
 */
export function getFirstDay(format) {
  if (format) {
    return parseTime((new Date()).setDate(1), format)
  } else {
    return parseTime((new Date()).setDate(1), '{y}-{m}-{d}')
  }
}

/**
 * 获取当前天
 * @param {string}
 */
export function getToday(format) {
  if (format) {
    return parseTime(new Date(), format)
  } else {
    return parseTime(new Date(), '{y}-{m}-{d}')
  }
}

import { getToday, getFirstDay } from '@/utils/index'

this.queryForm.queryDate = [getFirstDay(), getToday()]

state

const state = {
  bizParaValInfo: {
    isDiseSpdrug: false,
    isPrescription: false,
    isAddManually: false,
    isOpspDise: false,
    isOutPatient: false
  }
}

mutations

SET_BIZPARAVAL_INFO: (state, info) => {
    state.bizParaValInfo = info
}

actions

const actions = {
  setBizParaValInfo({ commit }, info) {
    commit('SET_BIZPARAVAL_INFO', info)
  }
}

getters

const getters = {
  bizParaValInfo: state => state.virtualSettlement.bizParaValInfo,
}
export default getters

触发状态管理

this.$store.dispatch('realSettlement/setBizParaValInfo', { ...data })

医保区划


itemsDatas: [
        {
          label: '医保区划',
          prop: 'poolarea',
          type: 'component',
          componentName: 'MedicalArea',
          folder: 'Common',
          span: 24,
          md: 24,
          lg: 24,
          xl: 24
        }
      ],
this.searchForm.poolarea.join(',')
相关文章
|
1天前
|
JavaScript Java
Vue : v-if, v-show
Vue : v-if, v-show
12 0
Vue : v-if, v-show
|
1天前
|
JavaScript 前端开发
Vue : 监视属性
Vue : 监视属性
9 0
|
1天前
|
缓存 JavaScript
Vue: 事件修饰符, 键盘事件, 鼠标事件,计算属性
Vue: 事件修饰符, 键盘事件, 鼠标事件,计算属性
15 2
|
1天前
|
JavaScript 安全
一文彻底学会vue的组件通信
Vue组件通信包括父向子通过`props`传递数据,如`&lt;Student :name=&quot;18&quot;&gt;&lt;/Student&gt;`,子组件通过`$emit`触发自定义事件与父组件通信,如`this.$emit(&#39;myEvent&#39;, this.name)`。此外,使用全局事件总线(`Vue.prototype.$bus`)可在多级组件间通信,通过`$on`订阅和`$emit`发布事件。还有消息订阅与发布模式,利用`pubsub-js`库实现更灵活的组件交互。
7 0
一文彻底学会vue的组件通信
|
1天前
|
缓存 JavaScript
一文彻底学会Vue路由
Vue Router简介,包括基本使用、嵌套路由、参数传递和路由守卫。首先,通过`npm i vue-router@3`安装,然后在`main.js`引入并应用。配置路由时,创建VueRouter实例,定义如`/home`、`/about`等路径及其对应组件。使用`&lt;router-link&gt;`进行切换,`&lt;router-view&gt;`展示组件。嵌套路由通过`children`配置多级路径,参数传递可使用`query`或`params`。路由守卫分为全局、独享和组件内三种,用于控制访问权限。
7 1
一文彻底学会Vue路由
|
7天前
|
缓存 监控 JavaScript
探讨优化Vue应用性能和加载速度的策略
【5月更文挑战第17天】本文探讨了优化Vue应用性能和加载速度的策略:1) 精简代码和组件拆分以减少冗余;2) 使用计算属性和侦听器、懒加载、预加载和预获取优化路由;3) 数据懒加载和防抖节流处理高频事件;4) 图片压缩和选择合适格式,使用CDN加速资源加载;5) 利用浏览器缓存和组件缓存提高效率;6) 使用Vue Devtools和性能分析工具监控及调试。通过这些方法,可提升用户在复杂应用中的体验。
26 0
|
8天前
|
JavaScript 前端开发
vue(1),小白看完都会了
vue(1),小白看完都会了
|
8天前
|
JavaScript 数据库
ant design vue日期组件怎么清空 取消默认当天日期
ant design vue日期组件怎么清空 取消默认当天日期
|
1天前
|
JavaScript 前端开发 数据库
Vue技术文章
Vue技术文章
|
3天前
|
JavaScript Java 关系型数据库
基于SprinBoot+vue的租房管理系统2
基于SprinBoot+vue的租房管理系统2
11 0