"use strict";var t=require("../../../../common/vendor.js"),s={computed:{value(){const{text:e,mode:u,format:r,href:n}=this;return u==="price"?(/^\d+(\.\d+)?$/.test(e)||t.index.$u.error("\u91D1\u989D\u6A21\u5F0F\u4E0B\uFF0Ctext\u53C2\u6570\u9700\u8981\u4E3A\u91D1\u989D\u683C\u5F0F"),t.index.$u.test.func(r)?r(e):t.index.$u.priceFormat(e,2)):u==="date"?(!t.index.$u.test.date(e)&&t.index.$u.error("\u65E5\u671F\u6A21\u5F0F\u4E0B\uFF0Ctext\u53C2\u6570\u9700\u8981\u4E3A\u65E5\u671F\u6216\u65F6\u95F4\u6233\u683C\u5F0F"),t.index.$u.test.func(r)?r(e):r?t.index.$u.timeFormat(e,r):t.index.$u.timeFormat(e,"yyyy-mm-dd")):u==="phone"?t.index.$u.test.func(r)?r(e):r==="encrypt"?`${e.substr(0,3)}****${e.substr(7)}`:e:u==="name"?(typeof e!="string"&&t.index.$u.error("\u59D3\u540D\u6A21\u5F0F\u4E0B\uFF0Ctext\u53C2\u6570\u9700\u8981\u4E3A\u5B57\u7B26\u4E32\u683C\u5F0F"),t.index.$u.test.func(r)?r(e):r==="encrypt"?this.formatName(e):e):(u==="link"&&!t.index.$u.test.url(n)&&t.index.$u.error("\u8D85\u94FE\u63A5\u6A21\u5F0F\u4E0B\uFF0Chref\u53C2\u6570\u9700\u8981\u4E3AURL\u683C\u5F0F"),e)}},methods:{formatName(e){let u="";if(e.length===2)u=e.substr(0,1)+"*";else if(e.length>2){let r="";for(let n=0,i=e.length-2;n<i;n++)r+="*";u=e.substr(0,1)+r+e.substr(-1,1)}else u=e;return u}}};exports.value=s;
