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 算法
Vue 中 key 属性的深入解析:改变 key 导致组件销毁与重建
Vue 中 key 属性的深入解析:改变 key 导致组件销毁与重建
198 0
|
1月前
|
JavaScript UED
用组件懒加载优化Vue应用性能
用组件懒加载优化Vue应用性能
|
1月前
|
JavaScript 前端开发 开发者
Vue 自定义进度条组件封装及使用方法详解
这是一篇关于自定义进度条组件的使用指南和开发文档。文章详细介绍了如何在Vue项目中引入、注册并使用该组件,包括基础与高级示例。组件支持分段配置(如颜色、文本)、动画效果及超出进度提示等功能。同时提供了完整的代码实现,支持全局注册,并提出了优化建议,如主题支持、响应式设计等,帮助开发者更灵活地集成和定制进度条组件。资源链接已提供,适合前端开发者参考学习。
165 17
|
1月前
|
JavaScript 前端开发 UED
Vue 表情包输入组件实现代码及详细开发流程解析
这是一篇关于 Vue 表情包输入组件的使用方法与封装指南的文章。通过安装依赖、全局注册和局部使用,可以快速集成表情包功能到 Vue 项目中。文章还详细介绍了组件的封装实现、高级配置(如自定义表情列表、主题定制、动画效果和懒加载)以及完整集成示例。开发者可根据需求扩展功能,例如 GIF 搜索或自定义表情上传,提升用户体验。资源链接提供进一步学习材料。
88 1
|
1月前
|
存储 JavaScript 前端开发
如何高效实现 vue 文件批量下载及相关操作技巧
在Vue项目中,实现文件批量下载是常见需求。例如文档管理系统或图片库应用中,用户可能需要一次性下载多个文件。本文介绍了三种技术方案:1) 使用`file-saver`和`jszip`插件在前端打包文件为ZIP并下载;2) 借助后端接口完成文件压缩与传输;3) 使用`StreamSaver`解决大文件下载问题。同时,通过在线教育平台的实例详细说明了前后端的具体实现步骤,帮助开发者根据项目需求选择合适方案。
104 0
|
3月前
|
JavaScript
vue实现任务周期cron表达式选择组件
vue实现任务周期cron表达式选择组件
371 4
|
2月前
|
JavaScript 数据可视化 前端开发
基于 Vue 与 D3 的可拖拽拓扑图技术方案及应用案例解析
本文介绍了基于Vue和D3实现可拖拽拓扑图的技术方案与应用实例。通过Vue构建用户界面和交互逻辑,结合D3强大的数据可视化能力,实现了力导向布局、节点拖拽、交互事件等功能。文章详细讲解了数据模型设计、拖拽功能实现、组件封装及高级扩展(如节点类型定制、连接样式优化等),并提供了性能优化方案以应对大数据量场景。最终,展示了基础网络拓扑、实时更新拓扑等应用实例,为开发者提供了一套完整的实现思路和实践经验。
240 77
|
3月前
|
缓存 JavaScript 前端开发
Vue 基础语法介绍
Vue 基础语法介绍
|
1月前
|
监控 JavaScript 前端开发
Vue 文件批量下载组件封装完整使用方法及优化方案解析
本文详细介绍了批量下载功能的技术实现与组件封装方案。主要包括两种实现方式:**前端打包方案(基于file-saver和jszip)** 和 **后端打包方案**。前者通过前端直接将文件打包为ZIP下载,适合小文件场景;后者由后端生成ZIP文件流返回,适用于大文件或大量文件下载。同时,提供了可复用的Vue组件`BatchDownload`,支持进度条、失败提示等功能。此外,还扩展了下载进度监控和断点续传等高级功能,并针对跨域、性能优化及用户体验改进提出了建议。可根据实际需求选择合适方案并快速集成到项目中。
199 17
|
1月前
|
JavaScript 前端开发 UED
Vue 手风琴实现的三种常用方式及长尾关键词解析
手风琴效果是Vue开发中常见的交互组件,可节省页面空间、提升用户体验。本文介绍三种实现方式:1) 原生Vue结合数据绑定与CSS动画;2) 使用Element UI等组件库快速构建;3) 自定义指令操作DOM实现独特效果。每种方式适用于不同场景,可根据项目需求选择。示例包括产品特性页、后台菜单及FAQ展示,灵活满足多样需求。附代码示例与资源链接,助你高效实现手风琴功能。
108 10