蓝鲸智慧旅游项目

审批模块:
  1. 审批设置跳转视图层,解决方案:通过路由传参实现需求
  2. 动态添加审批级别,解决方案:for循环渲染视图,动态的操作数组义实现需求.
企业管理模块:
  1. 上传图片:①接口地址需要全称;②需要单独设置请求头的token;③设置上传的文件字段名
  2. 校验:①在form标签中定义:rules="rules";②在lable定义prop;③在选项data中定义rules校验规则;
    注意点:①定义prop的值要和v-model的值一样;②选项中定义rules要在表单的数据之后
  3. 省市县的二级联动:①获取到省的数据;②在省的select中定义change事件,同时将选中的省id传过去;③请求市的数据
    https://blog.csdn.net/liuxin_1991/article/details/81502227
    // 获取地区,默认id=0
    async getCity(id) {
    let _this = this;
    // 如果选择省,将市的select设置为空
    this.form.city = "";
    const res = await this.$axios.post(`/region/list`, { region_id: id });
    if (id == 0) {
    // 如果 id=0 得到的数据为省的
    _this.provinceList = res.data;
    let id = this.form.province;
    // 再同时获取市的数据
    _this.$axios
    .post(`/region/list`, { region_id: id })
    .then(function(res) {
    _this.cityList = res.data;
    });
    } else {
    // 如果 id!=0 得到的数据为市的
    this.cityList = res.data;
    }
    },
  4. 组织排序:使用Sortable.js,对vue不友好,拖拽有时候乱跳;改用vuedraggable插件,此插件依赖Sortable.js.
  https://blog.csdn.net/IT_HLM/article/details/79541741
  https://blog.csdn.net/zhaoxiang66/article/details/81003094
  ①安装npm install vuedraggable -S(可能需要安装Sortable)
  ②引用import draggable from 'vuedraggable'
  ③注册组件components: { draggable },
  ④通过draggable标签来使用
  ⑤调用update方法,此方法事件对象返回新索引和旧索引,同样数据是响应式的.
 
组团管理模块:
    1. 打印页面:使用print插件  https://github.com/xyl66/vuePlugs_printjs
    2. 教程:https://blog.csdn.net/peiyongwei/article/details/82460709
    3. import Print from '@/plugs/print'
      Vue.use(Print) // 注册
      <template>
      <section ref="print">
      打印内容
      <div class="no-print">不要打印我</div>
      </section>
      </template>
      this.$print(this.$refs.print) // 使用

猜你喜欢

转载自www.cnblogs.com/jun-qi/p/10542972.html
今日推荐