@nixweb/nixloc-ui 0.0.178 → 0.0.180

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.178",
3
+ "version": "0.0.180",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -65,7 +65,6 @@ export default {
65
65
  let paramsWithValue = { ...this.params, ...{ value: this.text } };
66
66
  let params = { url: this.urlCallToAction, obj: paramsWithValue };
67
67
  this.loading = true;
68
- console.log(params);
69
68
  this.postApi(params).then((response) => {
70
69
  if (response.success) {
71
70
  if (!response.content) {
@@ -224,7 +224,7 @@ export default {
224
224
  if (event.name == "tagRemoved") {
225
225
  if (this.fieldTarget == event.data) this.cleanSelect();
226
226
  }
227
-
227
+
228
228
  },
229
229
  deep: true,
230
230
  },
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div>
3
+ <div v-for="activity in listActivity(ruleId)">
4
+ <div class="div-molded">
5
+ <SendEmail :activity="activity" v-if="activity.name == 'mail'" v-model="activity.recipient" />
6
+ </div>
7
+ </div>
8
+ </div>
9
+ </template>
10
+ <script>
11
+
12
+ import SendEmail from '@nixweb/nixloc-ui/src/component/shared/automation/components/SendEmail.vue';
13
+
14
+
15
+ import { mapGetters } from 'vuex';
16
+
17
+
18
+ export default {
19
+ name: "ActivitiesList",
20
+ components: {
21
+ SendEmail
22
+ },
23
+ props: {
24
+ ruleId: String
25
+ },
26
+ computed: {
27
+ ...mapGetters("automation", ["listActivity"]),
28
+
29
+ }
30
+ }
31
+
32
+ </script>
33
+ <style scoped>
34
+ .div-molded {
35
+ padding: 10px;
36
+ margin-top: 10px;
37
+ margin-left: 50px;
38
+ margin-right: 50px;
39
+ min-height: 110px;
40
+ border-radius: 10px;
41
+ background-color: #FAFAFC;
42
+ border: 1px solid #E8EAED;
43
+ }
44
+ </style>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div>
3
+ <b-row>
4
+ <b-col xs="12" sm="12" md="12" lg="5" xl="5">
5
+ <SelectRule :options="rules" v-model="selectedRule" />
6
+ </b-col>
7
+ <b-col sm="3">
8
+ <div class="div-btn">
9
+ <i class="fa-solid fa-circle-plus" @click="add"></i>
10
+ </div>
11
+ </b-col>
12
+ </b-row>
13
+ <DynamicComponentList />
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import SelectRule from "./SelectRule.vue";
19
+ import DynamicComponentList from "./DynamicComponentList.vue";
20
+
21
+ import { mapMutations } from "vuex";
22
+
23
+ export default {
24
+ name: "AddRule",
25
+ components: {
26
+ SelectRule,
27
+ DynamicComponentList
28
+ },
29
+ props: {
30
+ rules: Array
31
+ },
32
+ data() {
33
+ return {
34
+ selectedRule: this.options[0],
35
+ };
36
+ },
37
+ methods: {
38
+ ...mapMutations("generic", ["addNotifications"]),
39
+ ...mapMutations("automation", ["addSelectedRules"]),
40
+ add() {
41
+ this.selectedRule.id = this.generateId();
42
+ var selectedRule = JSON.parse(JSON.stringify(this.selectedRule));
43
+ this.addSelectedRules(selectedRule);
44
+ },
45
+ generateId() {
46
+ return Math.random()
47
+ .toString(36)
48
+ .replace(/[^a-z]+/g, "")
49
+ .substr(0, 5);
50
+ },
51
+ }
52
+ };
53
+ </script>
54
+ <style scoped>
55
+ .div-btn {
56
+ margin-top: -3px;
57
+ font-size: 25px;
58
+ color: #577696;
59
+ cursor: pointer;
60
+ }
61
+ </style>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div>
3
+ <AddRule :rules="rules" />
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import AddRule from "./AddRule.vue";
9
+
10
+ import { mapState } from "vuex";
11
+
12
+ export default {
13
+ name: "AutomationBuilder",
14
+ components: {
15
+ AddRule,
16
+ },
17
+ props: {
18
+ rules: Array
19
+ },
20
+ data() {
21
+ return {
22
+
23
+ };
24
+ },
25
+ };
26
+ </script>
27
+
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <div class="div-main">
3
+ <div v-for="(rule, index) in rules">
4
+ <div class="div-component">
5
+ <b-row>
6
+ <b-col sm="12">
7
+ <Molded>
8
+ <b-row>
9
+ <b-col sm="11">
10
+ <BillingByRent v-if="rule.name == 'billingByRent'" :rule="rule" />
11
+ </b-col>
12
+ <b-col sm="1">
13
+ <div class="icon-trash text-right" @click="remove(rule.id)">
14
+ <i class="fa-solid fa-trash"></i>
15
+ </div>
16
+ </b-col>
17
+ </b-row>
18
+ <div>
19
+ <ActivitiesList :ruleId="rule.id" />
20
+ </div>
21
+ </Molded>
22
+ <div v-if="index != (rules.length - 1) && rules.length > 1" class="div-icon text-center">
23
+ <i class="fa-solid fa-arrow-down-from-line"></i>
24
+ </div>
25
+ </b-col>
26
+ </b-row>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+
34
+ import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
35
+ import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
36
+ import BillingByRent from "./components/BillingByRent";
37
+ import ActivitiesList from "./ActivitiesList";
38
+
39
+ import { mapMutations, mapState } from "vuex";
40
+
41
+ export default {
42
+ name: "DynamicComponentList",
43
+ components: {
44
+ Molded, SelectStatic, BillingByRent, ActivitiesList
45
+ },
46
+ props: {
47
+ DynamicComponentList: Array
48
+ },
49
+ data() {
50
+ return {
51
+
52
+ };
53
+ },
54
+ computed: {
55
+ ...mapState("automation", ["rules"]),
56
+ },
57
+ methods: {
58
+ ...mapMutations("automation", ["removeRule"]),
59
+ remove(id) {
60
+ this.removeRule(id);
61
+ }
62
+ }
63
+ };
64
+ </script>
65
+ <style scoped>
66
+ .div-main {
67
+ margin-left: 100px;
68
+ margin-right: 100px;
69
+ margin-top: 40px;
70
+ }
71
+
72
+ .div-component {
73
+ margin-top: 20px
74
+ }
75
+
76
+ .div-icon {
77
+ font-size: 20px;
78
+ margin-top: 15px;
79
+ color: #347ADB;
80
+ }
81
+
82
+ .icon-trash {
83
+ color: red;
84
+ cursor: pointer;
85
+ }
86
+ </style>
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div class="selected-filter" @blur="open = false">
3
+ <div class="selected" :class="{ open: open }" @click="open = !open">
4
+ {{ selected }}
5
+ </div>
6
+ <div class="items" :class="{ hide: !open }">
7
+ <div v-for="(options, i) of options" :key="i">
8
+ <div @click="select(options)">
9
+ <span :class="options.classCss">
10
+ <i :class="options.icon"></i>
11
+ <span> {{ options.title }}</span>
12
+ </span>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ props: ["options", "value"],
22
+ data() {
23
+ return {
24
+ selected: "Selecione uma opção",
25
+ open: false,
26
+ };
27
+ },
28
+ mounted() {
29
+ this.$emit("input", this.selected);
30
+ },
31
+ methods: {
32
+ select(options) {
33
+ this.$emit("input", options);
34
+ this.selected = options.title;
35
+ this.open = false;
36
+ },
37
+ },
38
+ };
39
+ </script>
40
+
41
+ <style scoped>
42
+ .selected-filter {
43
+ position: relative;
44
+ width: 100%;
45
+ text-align: left;
46
+ outline: none;
47
+ height: 40px;
48
+ line-height: 40px;
49
+ z-index: 2;
50
+ }
51
+
52
+ .selected-filter .selected {
53
+ background-color: white;
54
+ border: 1px solid #DBDEE0;
55
+ border-radius: 6px;
56
+ color: #495057;
57
+ padding-left: 1em;
58
+ cursor: pointer;
59
+ user-select: none;
60
+ }
61
+
62
+ .selected-filter .selected:after {
63
+ position: absolute;
64
+ content: "";
65
+ top: 19px;
66
+ right: 1em;
67
+ width: 0;
68
+ height: 0;
69
+ border: 5px solid transparent;
70
+ border-color: black transparent transparent transparent;
71
+ }
72
+
73
+ .selected-filter .items {
74
+ color: black;
75
+ border-radius: 0px 0px 6px 6px;
76
+ overflow: hidden;
77
+ position: absolute;
78
+ background-color: #fafafc;
79
+ left: 0;
80
+ right: 0;
81
+ z-index: 1;
82
+ height: 120px;
83
+ overflow-y: visible;
84
+ overflow-x: hidden;
85
+ }
86
+
87
+ .selected-filter .items div {
88
+ color: black;
89
+ padding-left: 1em;
90
+ cursor: pointer;
91
+ user-select: none;
92
+ }
93
+
94
+ .hide {
95
+ display: none;
96
+ }
97
+ </style>
98
+
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div>
3
+ <div class="title">
4
+ <i class="fa-solid fa-file-invoice"></i>
5
+ Gerar Faturamento
6
+ </div>
7
+ <div class="div-task">
8
+ <b-row>
9
+ <b-col xs="12" sm="12" md="12" lg="12" xl="4">
10
+ <SelectStatic title="Frequência" :required="true" :data="[
11
+ { content: 'Semanal', id: 'weekly' },
12
+ { content: 'Quinzenal', id: 'fortnightly' },
13
+ { content: 'Mensal', id: 'monthly' },
14
+ { content: 'Anual', id: 'yearly' },
15
+ ]" :markFormDirty="true" v-model="rule.frequency" />
16
+ </b-col>
17
+ <b-col xs="12" sm="12" md="12" lg="12" xl="3">
18
+ <InputDecimal title="Valor" field="value" :required="true" :markFormDirty="true" :maxLength="5"
19
+ type="float" v-model="rule.amount" />
20
+ </b-col>
21
+ <b-col xs="12" sm="12" md="12" lg="12" xl="2">
22
+ <DateTime title="Data Início" :required="true" field="dateStart" format="DD/MM/YYYY" type="date"
23
+ placeholder v-model="rule.dateStart" />
24
+ </b-col>
25
+ <b-col xs="12" sm="12" md="12" lg="12" xl="2">
26
+ <DateTime title="Data Fim" field="dateEnd" format="DD/MM/YYYY" type="date" placeholder
27
+ v-model="rule.dateEnd" />
28
+ </b-col>
29
+ </b-row>
30
+ <b-row>
31
+ <b-col xs="12" sm="12" md="12" lg="8" xl="6">
32
+ <SelectStatic title="Atividade" :data="[
33
+ { content: 'Enviar E-mail', name: 'mail', recipient: '' },
34
+ { content: 'Enviar WhatsApp', name: 'whatsapp', recipient: '' },
35
+ ]" :markFormDirty="false" v-model="activity" />
36
+ </b-col>
37
+ <b-col sm="3">
38
+ <div class="div-btn">
39
+ <i class="fa-solid fa-circle-plus" @click="add"></i>
40
+ </div>
41
+ </b-col>
42
+ </b-row>
43
+ </div>
44
+ </div>
45
+ </template>
46
+ <script>
47
+
48
+ import InputDecimal from "@nixweb/nixloc-ui/src/component/forms/InputDecimal";
49
+ import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
50
+ import DateTime from "@nixweb/nixloc-ui/src/component/forms/DateTime";
51
+
52
+ import { mapMutations } from "vuex";
53
+
54
+ export default {
55
+ name: "Teste",
56
+ components: {
57
+ InputDecimal, SelectStatic, DateTime
58
+ },
59
+ props: {
60
+ rule: Object
61
+ },
62
+ data() {
63
+ return {
64
+ activity: {}
65
+ }
66
+ },
67
+ methods: {
68
+ ...mapMutations("automation", ["addActivity"]),
69
+ add() {
70
+ this.activity.id = this.generateId();
71
+ if (this.activity.content) {
72
+ var activity = JSON.parse(JSON.stringify(this.activity));
73
+ this.addActivity({ id: this.rule.id, activity: activity })
74
+ }
75
+
76
+ },
77
+ generateId() {
78
+ return Math.random()
79
+ .toString(36)
80
+ .replace(/[^a-z]+/g, "")
81
+ .substr(0, 5);
82
+ },
83
+ }
84
+ }
85
+ </script>
86
+ <style scoped>
87
+ .title {
88
+ font-size: 16px;
89
+ margin-bottom: 10px;
90
+ }
91
+
92
+ .div-btn {
93
+ margin-top: 30px;
94
+ font-size: 25px;
95
+ color: #577696;
96
+ cursor: pointer;
97
+ }
98
+ </style>
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <div>
3
+ <b-row>
4
+ <b-col sm="1">
5
+ <div class="icon-mail">
6
+ <i class="fa-solid fa-envelope"></i>
7
+ </div>
8
+ </b-col>
9
+ <b-col sm="9">
10
+ <InputText title="Digite o E-mail e tecle enter" :maxLength="100" :enter="addEmail" v-model="email" />
11
+ <div class="side-by-side" v-for="email in emails ">
12
+ <div class="tag">
13
+ <div class="side-by-side">
14
+ {{ email }}
15
+ </div>
16
+ <div class="side-by-side">
17
+ <i class="icon-close fa-solid fa-circle-xmark"></i>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </b-col>
22
+ <b-col sm="2">
23
+ <div class="text-right div-icon-close" @click="remove">
24
+ <i class="fa-solid fa-xmark"></i>
25
+ </div>
26
+ </b-col>
27
+ </b-row>
28
+ </div>
29
+ </template>
30
+ <script>
31
+
32
+ import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
33
+ import { mapMutations } from "vuex";
34
+
35
+ export default {
36
+ name: "SendMail",
37
+ props: ["activity", "value"],
38
+ components: {
39
+ InputText
40
+ },
41
+ data() {
42
+ return {
43
+ email: "",
44
+ emails: []
45
+ }
46
+ },
47
+ methods: {
48
+ ...mapMutations("automation", ["removeActivity"]),
49
+ addEmail() {
50
+ this.emails.push(this.email);
51
+ this.email = "";
52
+ },
53
+ remove() {
54
+ this.removeActivity(this.activity.id);
55
+ }
56
+ },
57
+ watch: {
58
+ emails: {
59
+ handler(emails) {
60
+ this.$emit("input", emails);
61
+ },
62
+ deep: true,
63
+ },
64
+ },
65
+ }
66
+
67
+ </script>
68
+ <style scoped>
69
+ .icon-mail {
70
+ margin-left: 20px;
71
+ margin-top: 8px;
72
+ font-size: 20px;
73
+ }
74
+
75
+ .tag {
76
+ background-color: #E0E0E0;
77
+ margin-right: 10px;
78
+ padding: 3px;
79
+ font-size: 13px;
80
+ border-radius: 20px;
81
+ }
82
+
83
+ .icon-close {
84
+ color: darkgrey;
85
+ font-size: 20px;
86
+ }
87
+
88
+ .div-icon-close {
89
+ font-size: 16px;
90
+ color: red;
91
+ margin-right: 10px;
92
+ cursor: pointer;
93
+ }
94
+ </style>
@@ -265,6 +265,11 @@ export default {
265
265
 
266
266
  this.convertToObjectAndGetAll();
267
267
  }
268
+ if (event.name == "getAllListViewWithDataHandler") {
269
+ this.addSelected([]);
270
+ this.getAll();
271
+ }
272
+
268
273
  },
269
274
  deep: true,
270
275
  },
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <Panel
4
- :module="panel.module"
5
- :title="panel.title"
6
- :showVerticalFilter="panel.showVerticalFilter"
7
- :showSearch="panel.showSearch"
8
- :showButtons="panel.showButtons"
9
- >
3
+ <Panel :module="panel.module" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
4
+ :showSearch="panel.showSearch" :showButtons="panel.showButtons">
10
5
  <div slot="content-main">
11
6
  <br />
12
7
  <div class="div-loading" v-show="loading">
@@ -38,19 +33,10 @@
38
33
  <br />
39
34
  <slot></slot>
40
35
  <div class="div-file">
41
- <FileUpload
42
- title="Carregar .xlsx"
43
- classIcon="fa-solid fa-file-excel"
44
- :container="container"
45
- accepted=".xlsx"
46
- allowed=".xlsx"
47
- :disabled="true"
48
- urlPost="/api/v1/adm/file-upload/upload"
49
- urlRemove="/api/v1/adm/file-upload/delete"
50
- :onLoad="successUploadFile"
51
- :nameDataBase="fileName"
52
- v-model="fileName"
53
- />
36
+ <FileUpload title="Carregar .xlsx" classIcon="fa-solid fa-file-excel" :container="container"
37
+ accepted=".xlsx" allowed=".xlsx" :disabled="true" urlPost="/api/v1/adm/file-upload/upload"
38
+ urlRemove="/api/v1/adm/file-upload/delete" :onLoad="successUploadFile" :nameDataBase="fileName"
39
+ v-model="fileName" />
54
40
  </div>
55
41
  </div>
56
42
  <div v-show="fileName && !loading">
@@ -66,42 +52,14 @@
66
52
  </span>
67
53
  <br />
68
54
  <div class="div-btn">
69
- <Button
70
- _key="btnBack"
71
- type="info"
72
- title="voltar"
73
- classIcon="fa-solid fa-circle-arrow-left"
74
- size="small"
75
- :clicked="back"
76
- />
77
- <Button
78
- v-if="!isValid"
79
- _key="btnValidate"
80
- type="primary"
81
- title="Iniciar Validação"
82
- :disabled="false"
83
- classIcon="fa-solid fa-arrow-right-arrow-left"
84
- size="small"
85
- :clicked="validate"
86
- />
87
- <Button
88
- v-if="listError.length > 0"
89
- _key="btnListError"
90
- type="danger"
91
- title="Erro(s)"
92
- classIcon="fa-sharp fa-solid fa-triangle-exclamation"
93
- size="small"
94
- :clicked="openListError"
95
- />
96
- <Button
97
- v-if="isValid"
98
- _key="btnImport"
99
- type="success"
100
- title="Importar"
101
- classIcon="fa-solid fa-file-import"
102
- size="small"
103
- :clicked="startImport"
104
- />
55
+ <Button _key="btnBack" type="info" title="voltar" classIcon="fa-solid fa-circle-arrow-left"
56
+ size="small" :clicked="back" />
57
+ <Button v-if="!isValid" _key="btnValidate" type="primary" title="Iniciar Validação" :disabled="false"
58
+ classIcon="fa-solid fa-arrow-right-arrow-left" size="small" :clicked="validate" />
59
+ <Button v-if="listError.length > 0" _key="btnListError" type="danger" title="Erro(s)"
60
+ classIcon="fa-sharp fa-solid fa-triangle-exclamation" size="small" :clicked="openListError" />
61
+ <Button v-if="isValid" _key="btnImport" type="success" title="Importar"
62
+ classIcon="fa-solid fa-file-import" size="small" :clicked="startImport" />
105
63
  </div>
106
64
  <br />
107
65
  <Alert type="danger" v-if="listError.length > 0">
@@ -117,30 +75,14 @@
117
75
  <b> 10 </b> primeiros (se houver).
118
76
  </span>
119
77
  </Alert>
120
- <TableImport
121
- v-if="fileName"
122
- :select="select"
123
- :headerTable="headerTable"
124
- :data="data"
125
- />
78
+ <TableImport v-if="fileName" :select="select" :headerTable="headerTable" :data="data" />
126
79
  </div>
127
80
  </div>
128
81
  </b-tab>
129
82
  <b-tab title="Histórico">
130
- <Button
131
- v-if="listError.length > 0"
132
- _key="btnListError"
133
- type="danger"
134
- title="Erro(s)"
135
- classIcon="fa-sharp fa-solid fa-triangle-exclamation"
136
- size="small"
137
- :clicked="openListError"
138
- />
139
- <ViewTemplateConfiguration
140
- :templateList="templateList"
141
- :showSearch="false"
142
- :showHorizontalFilter="false"
143
- >
83
+ <Button v-if="listError.length > 0" _key="btnListError" type="danger" title="Erro(s)"
84
+ classIcon="fa-sharp fa-solid fa-triangle-exclamation" size="small" :clicked="openListError" />
85
+ <ViewTemplateConfiguration :templateList="templateList" :showSearch="false" :showHorizontalFilter="false">
144
86
  </ViewTemplateConfiguration>
145
87
  </b-tab>
146
88
  </b-tabs>
@@ -153,14 +95,8 @@
153
95
  <i class="fa-light fa-circle-check"></i>
154
96
  </div>
155
97
  <div>
156
- <Button
157
- _key="btnBack"
158
- type="info"
159
- title="voltar"
160
- classIcon="fa-solid fa-circle-arrow-left"
161
- size="small"
162
- :clicked="back"
163
- />
98
+ <Button _key="btnBack" type="info" title="voltar" classIcon="fa-solid fa-circle-arrow-left" size="small"
99
+ :clicked="back" />
164
100
  </div>
165
101
  </Molded>
166
102
  </div>
@@ -168,30 +104,17 @@
168
104
  <br />
169
105
  </div>
170
106
  </Panel>
171
- <Modal
172
- title="Erro(s)"
173
- :width="900"
174
- :height="750"
175
- v-show="showModal('listError')"
176
- >
107
+ <Modal title="Erro(s)" :width="900" :height="750" v-show="showModal('listError')">
177
108
  <ListNotifications :listError="listError" />
178
109
  </Modal>
179
- <Modal
180
- title="Você tem certeza?"
181
- :width="500"
182
- v-show="showModal('confirmDelete')"
183
- >
110
+ <Modal title="Você tem certeza?" :width="500" v-show="showModal('confirmDelete')">
184
111
  <Alert type="warning">
185
112
  <span>
186
113
  Atenção, todos os registros relacionados também serão excluídos, esta
187
114
  ação é irreversível!
188
115
  </span>
189
116
  </Alert>
190
- <Confirmation
191
- :isModal="false"
192
- type="danger"
193
- :confirmed="removeSelected"
194
- />
117
+ <Confirmation :isModal="false" type="danger" :confirmed="removeSelected" />
195
118
  </Modal>
196
119
  </div>
197
120
  </template>
@@ -1,22 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <Panel
4
- :module="panel.module"
5
- :title="panel.title"
6
- :showVerticalFilter="panel.showVerticalFilter"
7
- :showSearch="panel.showSearch"
8
- :showButtons="panel.showButtons"
9
- >
3
+ <Panel :module="panel.module" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
4
+ :showSearch="panel.showSearch" :showButtons="panel.showButtons">
10
5
  <div slot="content-main">
11
6
  <b-row>
12
- <b-col
13
- xs="12"
14
- sm="12"
15
- md="12"
16
- lg="6"
17
- xl="6"
18
- v-if="allReports.saved.length > 0"
19
- >
7
+ <b-col xs="12" sm="12" md="12" lg="6" xl="6" v-if="allReports.saved.length > 0">
20
8
  <div><i class="fas fa-file-alt icon-saved"></i> Personalizado</div>
21
9
  <hr class="hr" />
22
10
  <div class="div-molded" v-for="report in allReports.saved">
@@ -30,12 +18,7 @@
30
18
  <div>{{ report.name }}</div>
31
19
  </b-col>
32
20
  <b-col sm="1">
33
- <Confirmation
34
- title="Deseja excluir?"
35
- type="danger"
36
- :data="report"
37
- :confirmed="confirmDelete"
38
- >
21
+ <Confirmation title="Deseja excluir?" type="danger" :data="report" :confirmed="confirmDelete">
39
22
  <div class="text-right">
40
23
  <i class="fas fa-times-circle icon-remove"></i>
41
24
  </div>
@@ -0,0 +1,31 @@
1
+ export default {
2
+ namespaced: true,
3
+ state: {
4
+ rules: [],
5
+ },
6
+ getters: {
7
+ listActivity: (state) => (id) => {
8
+ var selected = state.rules.find(x => x.id == id);
9
+ return selected.listActivity
10
+ },
11
+ },
12
+ mutations: {
13
+ addSelectedRules: (state, obj) => {
14
+ state.rules.push(obj);
15
+ },
16
+ removeRule: (state, id) => {
17
+ let filter = state.rules.filter(x => x.id != id);
18
+ state.rules = filter;
19
+ },
20
+ addActivity: (state, obj) => {
21
+ var selected = state.rules.find(x => x.id == obj.id);
22
+ selected.listActivity.push(obj.activity);
23
+ },
24
+ removeActivity: (state, id) => {
25
+ state.rules.forEach(item => {
26
+ let filter = item.listActivity.filter(x => x.id != id);
27
+ item.listActivity = filter;
28
+ });
29
+ },
30
+ },
31
+ }