three-trees-ui 1.0.59 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.js CHANGED
@@ -955,7 +955,7 @@ var utils = {
955
955
  }
956
956
  const keyPath = config[key]
957
957
  // 获取当前组件所在的表单
958
- const formInst = utils.getOnlineFormInstance(inst)
958
+ const formInst = utils.getOnlineFormInstance(inst.$parent)
959
959
  // 获取当前组件是否在子表中的某一行
960
960
  const { subScopeEl, index, subname } = utils.getSubScopeElAndIndex(inst.$el)
961
961
  if (subScopeEl) {
@@ -1256,35 +1256,4 @@ Date.prototype.format = function(format) {
1256
1256
  return format
1257
1257
  }
1258
1258
 
1259
- //精确四舍五入
1260
- Number.prototype.toFixedRound = function(d) {
1261
- d = Number(d)
1262
- var s = this + ''
1263
- if (!d) d = 0
1264
- if (s.indexOf('.') == -1) s += '.'
1265
- s += new Array(d + 1).join('0')
1266
- if (new RegExp('^(-|\\+)?(\\d+(\\.\\d{0,' + (d + 1) + '})?)\\d*$').test(s)) {
1267
- var s = '0' + RegExp.$2,
1268
- pm = RegExp.$1,
1269
- a = RegExp.$3.length,
1270
- b = true
1271
- if (a == d + 2) {
1272
- a = s.match(/\d/g)
1273
- if (parseInt(a[a.length - 1]) > 4) {
1274
- for (var i = a.length - 2; i >= 0; i--) {
1275
- a[i] = parseInt(a[i]) + 1
1276
- if (a[i] == 10) {
1277
- a[i] = 0
1278
- b = i != 1
1279
- } else break
1280
- }
1281
- }
1282
- s = a.join('').replace(new RegExp('(\\d+)(\\d{' + d + '})\\d$'), '$1.$2')
1283
- }
1284
- if (b) s = s.substr(1)
1285
- return (pm + s).replace(/\.$/, '')
1286
- }
1287
- return this + ''
1288
- }
1289
-
1290
1259
  export default utils