工作小结

148 阅读1分钟
权限展示
v-if="testPageURL('/productionManagement/workList')"   ====>  页面跳转,点击按钮跳转
v-if="testPower('后端接口')"   ====>    点击页面里的按钮是否展示
下拉菜单
selectKey1(val){
       this.paramsVal = val==''?'':[val];
       this.getlistVehParamsUpdRecord();
     },
删除成功提示
this.$notification.open({
          duration: 3,
          message: '成功',
          description: '退出成功!',
          icon: <a-icon type="smile" style="color: #108ee9" />,
        })
对象多级展示怕报错
{{(updateInfo.otaVersionRule || {}).ruleName||'-'}}
分页
<!-- 底部页数 -->
        search: {
          currentPage: 1,//当前页
          pageSize: 12,//一页条数
          currentPageNum: 0,//当前页条数
          updateTimeAsc: false,
          count:0//总条数
        },
        
        <div class="ms-pagination"  v-if="userListData.length>0">
          <div>当前页 {{search.currentPageNum}} 条,共 {{search.count}} 条</div>
          <a-pagination show-quick-jumper :default-current="search.currentPage"  :defaultPageSize="search.pageSize" :total="search.count" @change="onChange" />
        </div>
        
        onChange(pageNumber) {
            this.search.currentPage = pageNumber;
            setTimeout(()=>{this.getlistUpdOtaSoftCodeWc()},0)
         },
         
         
          this.loading = false;
          this.userListData = res.PAGE_LIST || [];
          this.search.currentPageNum = this.userListData.length;
          this.search.count = res.count;
        
弹框取消按钮隐藏
:cancel-button-props="{ style: progress?{ display: 'none'}:'' }"
用删除公用组件删除记录
      deleteStatus(flag) {
        if (!!flag) {
          if(this.userListData.length==1){
            //一页最后一个
            this.search.currentPage = this.search.currentPage-1;
          }
          this.getUserList(this.search.currentPage==1?true:false);
        }
      },
输入框禁止输入文字
newestEdition.mainVersion = newestEdition.mainVersion.replace(/[^\d]/g,'')

onkeyup="this.value=this.value.replace(/[^\d]/g,'') "
<a-input
    placeholder="数字,整数"
    @change="
      newestEdition.mainVersion = newestEdition.mainVersion.replace(
        /[^\d]/g,
        ''
      )
    "
    v-model="newestEdition.mainVersion"
    allowClear
  />
父级为undefined,那么.子集报错的写法
{{(updateInfo.otaVersionRule || {}).ruleName||'-'}}
model弹框

1、提示删除

<a-modal
                title="移除线路"
                class="ms-default-modal ms-del-modal"
                :width='680'
                :visible="modalVisible"
                :closable='true'
                :centered='true'
                :destroyOnClose='true'
                @cancel="modalVisible=false"
                :maskStyle="{'backgroundColor':'rgba(0,0,0,0.25)'}"
            >
                <div class="operation">
                    <div class="content">
                        <span style="fontSize:32px">
                            <svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-jinggao" />
                            </svg>
                        </span>
                        <div>是否确认移除“ {{lineInfo.name}} ”</div>
                    </div>
                </div>
                <template slot="footer">
                    <div class="opera">
                    <div class="ms-btn ms-primary-btn" @click="save()">确 认</div>
                    <div class="ms-btn ms-default-btn" @click="modalVisible=false">取 消</div>
                    </div>
                </template>
                <template slot="closeIcon">
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tianjia1" />
                    </svg>
                </template>
            </a-modal>
ipad手机端的缩放字体
const baseSize = 65
function setRem () {
    const scale = document.documentElement.clientWidth / 750;
    document.documentElement.style.fontSize = (baseSize * Math.min(scale, 2)) + 'px';
}
setRem()
window.onresize = function () {
    setRem()
} ----->rem.js

引入main.js文件里;
2、单位:字体、padding、margin、height都用设计图上的px/8,得到vh
  宽度用百分比;
3、ipad 尺寸1280 X 800  因为设置了(common.cssApp.vue文件中引入)html、body、#app的height为100vh,所以高度要全部除以8