cnhis-design-vue 3.1.55-beta.19 → 3.1.55-beta.20
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as
|
|
1
|
+
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as n}from"../utils/index.js";import{defineTablePlugin as u}from"../hooks/useTablePlugin.js";function l(){const l="defaultValuePlugin",a=new Map([[t.TIME,({defaultValue:t,valueFormat:n="HH:mm"})=>"current"===t?e(Date.now(),n):t],[t.DATE,({defaultValue:t,valueFormat:n="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),n):t]]);return u({name:l,apply(e){e.fieldHooks.field.tap(l,(e=>(e.editRender={defaultValue:({column:e})=>function(e){var t;const u=n(e);if(!u||null==u.defaultValue)return null;const l=null==(t=e.editRender)?void 0:t.name,o=l&&a.get(l);return o?o(u):u.defaultValue}(e),...e.editRender},e)))}})}export{l as defaultValuePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.55-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.55-beta.20",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.55-beta.20",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Path as e}from"@formily/path";import{isArray as t,isString as n,includes as r,negate as a,
|
|
1
|
+
import{Path as e}from"@formily/path";import{isArray as t,isString as n,includes as r,negate as a,isNumber as i,gt as o,gte as l,lt as c,lte as u,identity as f,noop as s,isObject as d}from"lodash-es";import{unref as p}from"vue";import{add as m,differenceInMilliseconds as F}from"date-fns";function D(e){return null==e||""==e}function N(e){return(t,r)=>(n(t)&&(t=+t),n(r)&&(r=+r),!(!i(t)||Number.isNaN(t)||!i(r)||Number.isNaN(r))&&e(t,r))}const h={EQ:(e,t)=>`${e}`===t,NEQ:(e,t)=>`${e}`!==t,CL:(e,a)=>!(!t(e)&&!n(e))&&r(e,a),NC:(e,a)=>!t(e)&&!n(e)||!r(e,a),NULL:D,NOT_NULL:a(D),BIG:N(o),BIGEQ:N(l),LESS:N(c),LESSEQ:N(u)};function E(e,t,n={}){return(n[t.con]||h[t.con]||(()=>!1))(e,`${t.value}`)}function g(e,t){if(!t||!n(t))return e.every(f);try{return new Function("return "+t.replace(/OR/g,"||").replace(/AND/g,"&&").replace(/[a-zA-Z]/g,"").replace(/\d+/g,(t=>e[+t-1]?"true":"false")))()}catch(e){return console.error("表达式错误=>",t),!1}}function A(n,r){if(!t(r.conObj))return!1;return g(r.conObj.map((t=>E(e.getIn(n,t.field_key),t,r.compareMap))),r.sqlExpression)}const b=Object.freeze({SET_VALUE:function(e,{getter:t,setter:r}){if(!d(e))return;const{results:a=[],params:i=[],compareMap:o={}}=e;if(!a.length)return;function l(e){var r;if(!n(e))return e;const a=e.trim().match(/^\$\{([a-zA-Z\d\s]+)}$/);return a?t(null==(r=a[1])?void 0:r.trim()):e}i.every((e=>e&&e.p_name&&E(t(e.p_name),{con:e.p_select,value:l(e.p_value)},o)))&&a.forEach((e=>r(e.p_name,l(e.p_value))))},REPEAT_VALIDATE:s,IS_SHOW_FIELD:s,SQLSAVE:s,API:s});function L(e){return b[e]||s}function V(e,r,a){function o(e){return t(e)&&!!e.length}function l(e,t=!0){e.forEach((e=>{if(!e.operationalResult||!t&&null!=r(e.operationalResult))return;const o=e.operationFormParam.reduce(((e,t)=>(e[t=t.replace(/^table\./,"")]=+r(t),e)),{}),l=e.operationalRule.replace(/\${(.+?)}/g,"$1");let c=new Function("table",`return ${l}`)(o);n(c)&&(c=+c),c=i(c)?isNaN(c)?"":c.toFixed(+e.operationalPrecision):"",a(e.operationalResult,c)}))}return{operationalFormHandler:function(t){if(!o(p(e)))return;const n=p(e).filter((e=>e.operationFormParam.includes(`table.${t}`)));n.length&&l(n)},triggerAllOperationalFormHandler:function(){o(p(e))&&l(p(e),!1)}}}function $(e,n,r){function a(e){return t(e)&&!!e.length}function o(e,t=!0){e.forEach((e=>{e.diffValField&&e.diffValUnit&&e.scene&&(t||null==n(e.diffValField))&&("DIFF"===e.scene?function({startDateField:e,endDateField:t,diffValField:a,diffValUnit:i,precision:o="0"}){const l=n(e),c=n(t);if(l&&c){const e=F(new Date(c),new Date(l))/1e3/60,t=e/60,n=t/24;let u="";switch(i){case"DAY":u=n.toFixed(+o);break;case"HOUR":u=t.toFixed(+o);break;case"MIN":u=e.toFixed(+o);break;case"DHM":u=`${Math.floor(n)}天${Math.floor(t%24)}小时${Math.floor(e%60)}分钟`;break}r(a,u)}else r(a,null)}(e):"CALC"===e.scene&&function(e){const t=+e.diffValField;if(!i(t)||Number.isNaN(t))return;const a=n(e.endDateField);if(a){const n=m(new Date(a),{days:"DAY"===e.diffValUnit?t:0,hours:"HOUR"===e.diffValUnit?t:0,minutes:"MIN"===e.diffValUnit?t:0});r(e.startDateField,n)}else r(e.startDateField,null)}(e))}))}return{dateOperationalFormHandler:function(t){if(!a(p(e)))return;const n=p(e).filter((e=>"DIFF"===e.scene&&e.startDateField===t||e.endDateField===t));n.length&&o(n)},triggerAllDateOperationalFormHandler:function(){a(p(e))&&o(p(e),!1)}}}export{L as getBindEventSettingTrigger,$ as getDateOperationalFormHandler,V as getOperationalFormHandler,g as isConditionsMatchSqlExpression,E as isMatchLowCodeCondition,A as isMatchLowCodeConditionsWithSqlExpression};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.55-beta.
|
|
3
|
+
"version": "3.1.55-beta.20",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"iOS 7",
|
|
65
65
|
"last 3 iOS versions"
|
|
66
66
|
],
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a8f7d7cdca3113620c2a7b0dbaf062673dfc51cc"
|
|
68
68
|
}
|