@5minds/node-red-dashboard-2-processcube-dynamic-table 1.1.3 → 1.1.5
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/nodes/dynamic-table.js +36 -32
- package/package.json +77 -77
- package/resources/ui-dynamic-table.umd.js +2 -2
- package/ui/components/DynamicTable.vue +118 -108
package/nodes/dynamic-table.js
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
module.exports = function (RED) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
function DynamicTableNode(config) {
|
|
3
|
+
RED.nodes.createNode(this, config);
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const node = this;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const group = RED.nodes.getNode(config.group);
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const base = group.getBase();
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
base.stores.data.save(base, node, columns);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
11
|
+
//server-side event handlers
|
|
12
|
+
const evts = {
|
|
13
|
+
onAction: true,
|
|
14
|
+
beforeSend: function (msg) {
|
|
15
|
+
if (Array.isArray(msg)) return msg;
|
|
16
|
+
data = RED.util.evaluateNodeProperty(
|
|
17
|
+
config.data,
|
|
18
|
+
config.data_type,
|
|
19
|
+
node,
|
|
20
|
+
msg
|
|
21
|
+
);
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
return data;
|
|
24
|
+
},
|
|
25
|
+
onInput: function (msg, send, done) {
|
|
26
|
+
base.stores.data.save(base, node, msg);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
if (group) {
|
|
31
|
+
group.register(node, config, evts);
|
|
32
|
+
} else {
|
|
33
|
+
node.error("No group configured");
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
|
-
}
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
RED.nodes.registerType("ui-dynamic-table", DynamicTableNode, {
|
|
38
|
+
defaults: {
|
|
39
|
+
outputs: { value: 1 },
|
|
40
|
+
},
|
|
41
|
+
outputs: function (config) {
|
|
42
|
+
return config.outputs || 1;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
41
45
|
};
|
package/package.json
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
"name": "@5minds/node-red-dashboard-2-processcube-dynamic-table",
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "A ui component for showing dynamic Data with actions in a table",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"processcube",
|
|
7
|
+
"usertask",
|
|
8
|
+
"node-red",
|
|
9
|
+
"node-red-dashboard-2"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-table.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Martin Moellenbeck",
|
|
18
|
+
"url": "https://github.com/moellenbeck"
|
|
19
|
+
},
|
|
20
|
+
"contributors": [
|
|
21
|
+
{
|
|
22
|
+
"name": "Luis Thieme",
|
|
23
|
+
"url": "https://github.com/luisthieme"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
"import": "./resources/dynamic-table.esm.js",
|
|
28
|
+
"require": "./resources/dynamic-table.umd.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/*",
|
|
32
|
+
"nodes/*",
|
|
33
|
+
"ui/*",
|
|
34
|
+
"resources/*"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "vite build",
|
|
38
|
+
"build:dev": "NODE_ENV=development vite build",
|
|
39
|
+
"dev": "NODE_ENV=development vite build --watch",
|
|
40
|
+
"dev:prod": "vite build --watch",
|
|
41
|
+
"lint": "npm run lint:js && npm run lint:package",
|
|
42
|
+
"lint:fix": "npm run lint:js:fix && npm run lint:package:fix",
|
|
43
|
+
"lint:js": "eslint --ext .js,.vue,.cjs,.mjs .",
|
|
44
|
+
"lint:js:fix": "yarn lint:js --fix",
|
|
45
|
+
"lint:package": "sort-package-json --check 'package.json'",
|
|
46
|
+
"lint:package:fix": "sort-package-json 'package.json'"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"vue": "^3.3.8",
|
|
50
|
+
"vuex": "^4.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@vitejs/plugin-vue": "^4.5.0",
|
|
54
|
+
"eslint": "^8.53.0",
|
|
55
|
+
"eslint-config-standard": "^17.1.0",
|
|
56
|
+
"eslint-plugin-import": "^2.29.0",
|
|
57
|
+
"eslint-plugin-n": "^16.3.1",
|
|
58
|
+
"eslint-plugin-vue": "^9.18.1",
|
|
59
|
+
"vite": "^5.3.2",
|
|
60
|
+
"vite-plugin-css-injected-by-js": "^3.3.0"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=14"
|
|
64
|
+
},
|
|
65
|
+
"node-red": {
|
|
66
|
+
"version": ">=3.0.0",
|
|
67
|
+
"nodes": {
|
|
68
|
+
"ui-dynamic-table": "nodes/dynamic-table.js"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"node-red-dashboard-2": {
|
|
72
|
+
"version": "1.0.0",
|
|
73
|
+
"widgets": {
|
|
74
|
+
"ui-dynamic-table": {
|
|
75
|
+
"output": "ui-dynamic-table.umd.js",
|
|
76
|
+
"component": "DynamicTable"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
24
79
|
}
|
|
25
|
-
],
|
|
26
|
-
"exports": {
|
|
27
|
-
"import": "./resources/dynamic-table.esm.js",
|
|
28
|
-
"require": "./resources/dynamic-table.umd.js"
|
|
29
|
-
},
|
|
30
|
-
"files": [
|
|
31
|
-
"dist/*",
|
|
32
|
-
"nodes/*",
|
|
33
|
-
"ui/*",
|
|
34
|
-
"resources/*"
|
|
35
|
-
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "vite build",
|
|
38
|
-
"build:dev": "NODE_ENV=development vite build",
|
|
39
|
-
"dev": "NODE_ENV=development vite build --watch",
|
|
40
|
-
"dev:prod": "vite build --watch",
|
|
41
|
-
"lint": "npm run lint:js && npm run lint:package",
|
|
42
|
-
"lint:fix": "npm run lint:js:fix && npm run lint:package:fix",
|
|
43
|
-
"lint:js": "eslint --ext .js,.vue,.cjs,.mjs .",
|
|
44
|
-
"lint:js:fix": "yarn lint:js --fix",
|
|
45
|
-
"lint:package": "sort-package-json --check 'package.json'",
|
|
46
|
-
"lint:package:fix": "sort-package-json 'package.json'"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"vue": "^3.3.8",
|
|
50
|
-
"vuex": "^4.1.0"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@vitejs/plugin-vue": "^4.5.0",
|
|
54
|
-
"eslint": "^8.53.0",
|
|
55
|
-
"eslint-config-standard": "^17.1.0",
|
|
56
|
-
"eslint-plugin-import": "^2.29.0",
|
|
57
|
-
"eslint-plugin-n": "^16.3.1",
|
|
58
|
-
"eslint-plugin-vue": "^9.18.1",
|
|
59
|
-
"vite": "^5.3.2",
|
|
60
|
-
"vite-plugin-css-injected-by-js": "^3.3.0"
|
|
61
|
-
},
|
|
62
|
-
"engines": {
|
|
63
|
-
"node": ">=14"
|
|
64
|
-
},
|
|
65
|
-
"node-red": {
|
|
66
|
-
"version": ">=3.0.0",
|
|
67
|
-
"nodes": {
|
|
68
|
-
"ui-dynamic-table": "nodes/dynamic-table.js"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"node-red-dashboard-2": {
|
|
72
|
-
"version": "1.0.0",
|
|
73
|
-
"widgets": {
|
|
74
|
-
"ui-dynamic-table": {
|
|
75
|
-
"output": "ui-dynamic-table.umd.js",
|
|
76
|
-
"component": "DynamicTable"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
80
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
(function(o,
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode("h1[data-v-936bcac1]{margin-bottom:10px}h2[data-v-936bcac1]{margin-top:1.5rem;margin-bottom:.75rem}h3[data-v-936bcac1]{margin-top:1rem}p[data-v-936bcac1]{margin-bottom:5px}ul li[data-v-936bcac1]{list-style-type:circle;list-style-position:inside;margin-left:15px}pre[data-v-936bcac1]{padding:12px;margin:12px;background-color:#eee}code[data-v-936bcac1]{font-size:.825rem;color:#ae0000}input[data-v-936bcac1]{padding:12px;margin:12px;background-color:#eee}.task-div[data-v-936bcac1]{padding:8px;margin:16px;border:solid;border-radius:4px;border-color:#303030}.action-button-container[data-v-936bcac1]{width:100%;display:flex;justify-content:center}")),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
(function(o,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vuex"),require("vue")):typeof define=="function"&&define.amd?define(["exports","vuex","vue"],r):(o=typeof globalThis<"u"?globalThis:o||self,r(o["ui-dynamic-table"]={},o.vuex,o.Vue))})(this,function(o,r,t){"use strict";const m=(e,i)=>{const n=e.__vccOpts||e;for(const[d,s]of i)n[d]=s;return n},f={name:"DynamicTable",inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!0,visible:!0})}},data(){return{search:"",actions:[],tasks:[],headers:[]}},mounted(){this.$socket.on("widget-load:"+this.id,e=>{this.initialize(e),this.$store.commit("data/bind",{widgetId:this.id,data:e})}),this.$socket.on("msg-input:"+this.id,e=>{this.initialize(e),this.$store.commit("data/bind",{widgetId:this.id,data:e})}),this.$socket.emit("widget-load",this.id)},unmounted(){var e,i;(e=this.$socket)==null||e.off("widget-load"+this.id),(i=this.$socket)==null||i.off("msg-input:"+this.id)},methods:{send(e,i){const n=[];n[i]=e,this.$socket.emit("widget-action",this.id,n)},actionFn(e,i){this.send({payload:i},this.actions.findIndex(n=>n.label===e.label))},initialize(e){this.tasks=e,this.actions=this.props.options,this.headers=this.props.columns.map(i=>({title:i.label,key:i.value})),this.headers.push({title:"Actions",align:"center",key:"actions"})},conditionCheck(e,i){if(e=="")return!0;try{return new Function("row",`return ${e}`)(i)}catch(n){return console.error("Error evaluating condition:",n),!1}}}};function u(e,i,n,d,s,c){const k=t.resolveComponent("v-text-field"),x=t.resolveComponent("v-toolbar"),h=t.resolveComponent("v-btn"),p=t.resolveComponent("v-container"),b=t.resolveComponent("v-data-table");return t.openBlock(),t.createBlock(b,{headers:s.headers,items:s.tasks,search:s.search,class:"full-width-table"},{top:t.withCtx(()=>[t.createVNode(x,{flat:"",class:"py-2"},{default:t.withCtx(()=>[t.createVNode(k,{class:"mx-3",modelValue:s.search,"onUpdate:modelValue":i[0]||(i[0]=a=>s.search=a),label:"Search","prepend-inner-icon":"mdi-magnify",variant:"outlined","hide-details":"","single-line":""},null,8,["modelValue"])]),_:1})]),"item.actions":t.withCtx(({item:a})=>[t.createVNode(p,{class:"action-button-container"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.actions,(l,y)=>(t.openBlock(),t.createBlock(p,{style:{padding:"0px",display:"inline",width:"fit-content",margin:"0px"}},{default:t.withCtx(()=>[c.conditionCheck(l.condition,a)?(t.openBlock(),t.createBlock(h,{style:{margin:"0px 2px"},key:y,size:"small",onClick:g=>c.actionFn(l,a)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.label),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:2},1024))),256))]),_:2},1024)]),"no-data":t.withCtx(()=>[t.createVNode(h,{color:"primary",onClick:c.initialize},{default:t.withCtx(()=>[t.createTextVNode(" Reload ")]),_:1},8,["onClick"])]),_:1},8,["headers","items","search"])}const _=m(f,[["render",u],["__scopeId","data-v-936bcac1"]]);o.DynamicTable=_,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,123 +1,133 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
<v-data-table
|
|
3
|
+
:headers="headers"
|
|
4
|
+
:items="tasks"
|
|
5
|
+
:search="search"
|
|
6
|
+
class="full-width-table">
|
|
7
|
+
<template v-slot:top>
|
|
8
|
+
<v-toolbar flat class="py-2">
|
|
9
|
+
<v-text-field
|
|
10
|
+
class="mx-3"
|
|
11
|
+
v-model="search"
|
|
12
|
+
label="Search"
|
|
13
|
+
prepend-inner-icon="mdi-magnify"
|
|
14
|
+
variant="outlined"
|
|
15
|
+
hide-details
|
|
16
|
+
single-line></v-text-field>
|
|
17
|
+
</v-toolbar>
|
|
18
|
+
</template>
|
|
19
|
+
<template v-slot:item.actions="{ item }">
|
|
20
|
+
<v-container class="action-button-container">
|
|
21
|
+
<v-container
|
|
22
|
+
v-for="(action, index) in actions"
|
|
23
|
+
style="
|
|
24
|
+
padding: 0px;
|
|
25
|
+
display: inline;
|
|
26
|
+
width: fit-content;
|
|
27
|
+
margin: 0px;
|
|
28
|
+
">
|
|
29
|
+
<v-btn
|
|
30
|
+
style="margin: 0px 2px"
|
|
31
|
+
v-if="conditionCheck(action.condition, item)"
|
|
32
|
+
:key="index"
|
|
33
|
+
size="small"
|
|
34
|
+
@click="actionFn(action, item)">
|
|
35
|
+
{{ action.label }}
|
|
36
|
+
</v-btn>
|
|
37
|
+
</v-container>
|
|
38
|
+
</v-container>
|
|
39
|
+
</template>
|
|
40
|
+
<template v-slot:no-data>
|
|
41
|
+
<v-btn color="primary" @click="initialize"> Reload </v-btn>
|
|
42
|
+
</template>
|
|
43
|
+
</v-data-table>
|
|
43
44
|
</template>
|
|
44
45
|
|
|
45
46
|
<script>
|
|
46
47
|
import { mapState } from "vuex";
|
|
47
48
|
|
|
48
49
|
export default {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
search: "",
|
|
61
|
-
actions: [],
|
|
62
|
-
tasks: [],
|
|
63
|
-
headers: [],
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
mounted() {
|
|
67
|
-
this.$socket.on("widget-load:" + this.id, (columns) => {
|
|
68
|
-
this.initialize(columns);
|
|
69
|
-
this.$store.commit("data/bind", {
|
|
70
|
-
widgetId: this.id,
|
|
71
|
-
columns,
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
this.$socket.on("msg-input:" + this.id, (columns) => {
|
|
75
|
-
this.initialize(columns);
|
|
76
|
-
this.$store.commit("data/bind", {
|
|
77
|
-
widgetId: this.id,
|
|
78
|
-
columns,
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
this.$socket.emit("widget-load", this.id);
|
|
82
|
-
},
|
|
83
|
-
unmounted() {
|
|
84
|
-
this.$socket?.off("widget-load" + this.id);
|
|
85
|
-
this.$socket?.off("msg-input:" + this.id);
|
|
86
|
-
},
|
|
87
|
-
methods: {
|
|
88
|
-
send(msg, index) {
|
|
89
|
-
const msgArr = [];
|
|
90
|
-
msgArr[index] = msg;
|
|
91
|
-
this.$socket.emit("widget-action", this.id, msgArr);
|
|
50
|
+
name: "DynamicTable",
|
|
51
|
+
inject: ["$socket"],
|
|
52
|
+
props: {
|
|
53
|
+
/* do not remove entries from this - Dashboard's Layout Manager's will pass this data to your component */
|
|
54
|
+
id: { type: String, required: true },
|
|
55
|
+
props: { type: Object, default: () => ({}) },
|
|
56
|
+
/* state: { type: Object, default: () => ({ enabled: false, visible: false }) } // DEFAULT */
|
|
57
|
+
state: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: () => ({ enabled: true, visible: true }),
|
|
60
|
+
},
|
|
92
61
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
search: "",
|
|
65
|
+
actions: [],
|
|
66
|
+
tasks: [],
|
|
67
|
+
headers: [],
|
|
68
|
+
};
|
|
98
69
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
70
|
+
mounted() {
|
|
71
|
+
this.$socket.on("widget-load:" + this.id, (data) => {
|
|
72
|
+
this.initialize(data);
|
|
73
|
+
this.$store.commit("data/bind", {
|
|
74
|
+
widgetId: this.id,
|
|
75
|
+
data,
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
this.$socket.on("msg-input:" + this.id, (data) => {
|
|
79
|
+
this.initialize(data);
|
|
80
|
+
this.$store.commit("data/bind", {
|
|
81
|
+
widgetId: this.id,
|
|
82
|
+
data,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
this.$socket.emit("widget-load", this.id);
|
|
86
|
+
},
|
|
87
|
+
unmounted() {
|
|
88
|
+
this.$socket?.off("widget-load" + this.id);
|
|
89
|
+
this.$socket?.off("msg-input:" + this.id);
|
|
90
|
+
},
|
|
91
|
+
methods: {
|
|
92
|
+
send(msg, index) {
|
|
93
|
+
const msgArr = [];
|
|
94
|
+
msgArr[index] = msg;
|
|
95
|
+
this.$socket.emit("widget-action", this.id, msgArr);
|
|
96
|
+
},
|
|
97
|
+
actionFn(action, item) {
|
|
98
|
+
this.send(
|
|
99
|
+
{ payload: item },
|
|
100
|
+
this.actions.findIndex(
|
|
101
|
+
(element) => element.label === action.label
|
|
102
|
+
)
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
initialize(tasks) {
|
|
106
|
+
this.tasks = tasks;
|
|
107
|
+
this.actions = this.props.options;
|
|
102
108
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
this.headers = this.props.columns.map((item) => ({
|
|
110
|
+
title: item.label,
|
|
111
|
+
key: item.value,
|
|
112
|
+
}));
|
|
107
113
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
this.headers.push({
|
|
115
|
+
title: "Actions",
|
|
116
|
+
align: "center",
|
|
117
|
+
key: "actions",
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
conditionCheck(condition, row) {
|
|
121
|
+
if (condition == "") return true;
|
|
122
|
+
try {
|
|
123
|
+
const func = new Function("row", `return ${condition}`);
|
|
124
|
+
return func(row);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.error("Error evaluating condition:", error);
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
119
130
|
},
|
|
120
|
-
},
|
|
121
131
|
};
|
|
122
132
|
</script>
|
|
123
133
|
|