@houaoran/designer 1.0.0
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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/components.es.js +11424 -0
- package/dist/components.umd.js +878 -0
- package/dist/index.es.js +39113 -0
- package/dist/index.umd.js +1187 -0
- package/package.json +96 -0
- package/src/components/DragBox.vue +49 -0
- package/src/components/DragTool.vue +235 -0
- package/src/components/EventConfig.vue +557 -0
- package/src/components/FcDesigner.vue +2569 -0
- package/src/components/FcTitle.vue +69 -0
- package/src/components/FetchConfig.vue +415 -0
- package/src/components/FieldInput.vue +371 -0
- package/src/components/FnConfig.vue +315 -0
- package/src/components/FnEditor.vue +327 -0
- package/src/components/FnInput.vue +103 -0
- package/src/components/FormLabel.vue +47 -0
- package/src/components/HtmlEditor.vue +125 -0
- package/src/components/JsonPreview.vue +146 -0
- package/src/components/OptionsTextInput.vue +151 -0
- package/src/components/PropsInput.vue +72 -0
- package/src/components/Required.vue +75 -0
- package/src/components/Row.vue +26 -0
- package/src/components/SignaturePad.vue +176 -0
- package/src/components/Struct.vue +153 -0
- package/src/components/StructEditor.vue +121 -0
- package/src/components/StructTree.vue +209 -0
- package/src/components/TableOptions.vue +164 -0
- package/src/components/TreeOptions.vue +167 -0
- package/src/components/TypeSelect.vue +144 -0
- package/src/components/Validate.vue +302 -0
- package/src/components/ValueInput.vue +89 -0
- package/src/components/Warning.vue +46 -0
- package/src/components/ai/AiPanel.vue +1122 -0
- package/src/components/ai/MarkdownRenderer.vue +548 -0
- package/src/components/language/LanguageConfig.vue +174 -0
- package/src/components/language/LanguageInput.vue +191 -0
- package/src/components/style/BackgroundInput.vue +315 -0
- package/src/components/style/BorderInput.vue +242 -0
- package/src/components/style/BoxSizeInput.vue +166 -0
- package/src/components/style/BoxSpaceInput.vue +269 -0
- package/src/components/style/ColorInput.vue +90 -0
- package/src/components/style/ConfigItem.vue +118 -0
- package/src/components/style/FontInput.vue +197 -0
- package/src/components/style/PositionInput.vue +146 -0
- package/src/components/style/RadiusInput.vue +164 -0
- package/src/components/style/ShadowContent.vue +335 -0
- package/src/components/style/ShadowInput.vue +91 -0
- package/src/components/style/SizeInput.vue +118 -0
- package/src/components/style/StyleConfig.vue +307 -0
- package/src/components/table/Table.vue +252 -0
- package/src/components/table/TableView.vue +1058 -0
- package/src/components/tableForm/TableForm.vue +471 -0
- package/src/components/tableForm/TableFormColumnView.vue +103 -0
- package/src/components/tableForm/TableFormView.vue +46 -0
- package/src/components/tree/FcTree.vue +713 -0
- package/src/components/tree/FcTreeNode.vue +216 -0
- package/src/config/base/field.js +43 -0
- package/src/config/base/form.js +132 -0
- package/src/config/base/style.js +26 -0
- package/src/config/base/validate.js +15 -0
- package/src/config/index.js +70 -0
- package/src/config/menu.js +24 -0
- package/src/config/rule/alert.js +45 -0
- package/src/config/rule/button.js +49 -0
- package/src/config/rule/card.js +40 -0
- package/src/config/rule/cascader.js +121 -0
- package/src/config/rule/checkbox.js +68 -0
- package/src/config/rule/col.js +86 -0
- package/src/config/rule/collapse.js +30 -0
- package/src/config/rule/collapseItem.js +36 -0
- package/src/config/rule/color.js +53 -0
- package/src/config/rule/date.js +66 -0
- package/src/config/rule/dateRange.js +60 -0
- package/src/config/rule/divider.js +31 -0
- package/src/config/rule/editor.js +31 -0
- package/src/config/rule/group.js +86 -0
- package/src/config/rule/html.js +43 -0
- package/src/config/rule/image.js +32 -0
- package/src/config/rule/input.js +62 -0
- package/src/config/rule/number.js +49 -0
- package/src/config/rule/password.js +52 -0
- package/src/config/rule/radio.js +43 -0
- package/src/config/rule/rate.js +44 -0
- package/src/config/rule/row.js +46 -0
- package/src/config/rule/select.js +70 -0
- package/src/config/rule/signaturePad.js +59 -0
- package/src/config/rule/slider.js +53 -0
- package/src/config/rule/space.js +44 -0
- package/src/config/rule/subForm.js +47 -0
- package/src/config/rule/switch.js +46 -0
- package/src/config/rule/tabPane.js +29 -0
- package/src/config/rule/table.js +37 -0
- package/src/config/rule/tableForm.js +115 -0
- package/src/config/rule/tableFormColumn.js +55 -0
- package/src/config/rule/tabs.js +38 -0
- package/src/config/rule/tag.js +69 -0
- package/src/config/rule/text.js +41 -0
- package/src/config/rule/textarea.js +63 -0
- package/src/config/rule/time.js +58 -0
- package/src/config/rule/timeRange.js +49 -0
- package/src/config/rule/title.js +37 -0
- package/src/config/rule/transfer.js +59 -0
- package/src/config/rule/tree.js +70 -0
- package/src/config/rule/treeSelect.js +77 -0
- package/src/config/rule/upload.js +107 -0
- package/src/form/index.js +19 -0
- package/src/index.js +173 -0
- package/src/locale/en.js +981 -0
- package/src/locale/zh-cn.js +983 -0
- package/src/style/fonts/fc-icons.woff +0 -0
- package/src/style/icon.css +1052 -0
- package/src/style/index.css +836 -0
- package/src/utils/form.js +9 -0
- package/src/utils/highlight/highlight.min.js +307 -0
- package/src/utils/highlight/javascript.min.js +80 -0
- package/src/utils/highlight/style.css +1 -0
- package/src/utils/highlight/xml.min.js +29 -0
- package/src/utils/hintStubs.js +120 -0
- package/src/utils/index.js +544 -0
- package/src/utils/jsonDiff.js +173 -0
- package/src/utils/locale.js +23 -0
- package/src/utils/message.js +19 -0
- package/src/utils/template.js +105 -0
- package/types/index.d.ts +575 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="_fd-event">
|
|
3
|
+
<el-badge :value="eventNum" type="warning" :hidden="eventNum < 1">
|
|
4
|
+
<el-button size="small" @click="visible=true">{{ t('event.title') }}</el-button>
|
|
5
|
+
</el-badge>
|
|
6
|
+
<el-dialog class="_fd-event-dialog" :title="t('event.title')" v-model="visible" destroy-on-close
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
append-to-body
|
|
9
|
+
width="1080px">
|
|
10
|
+
<el-container class="_fd-event-con" style="height: 600px">
|
|
11
|
+
<el-aside style="width:300px;">
|
|
12
|
+
<el-container class="_fd-event-l">
|
|
13
|
+
<el-header class="_fd-event-head" height="40px">
|
|
14
|
+
<el-dropdown popper-class="_fd-event-dropdown" trigger="click" size="default"
|
|
15
|
+
:placement="'bottom-start'">
|
|
16
|
+
<span class="el-dropdown-link">
|
|
17
|
+
<el-button link type="primary" size="default">
|
|
18
|
+
{{ t('event.create') }}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
19
|
+
</el-button>
|
|
20
|
+
</span>
|
|
21
|
+
<template #dropdown>
|
|
22
|
+
<el-dropdown-menu>
|
|
23
|
+
<el-dropdown-item v-for="name in eventList" :key="name" @click="add(name)"
|
|
24
|
+
:disabled="Object.keys(event).indexOf(name) > -1">
|
|
25
|
+
<div class="_fd-event-item">
|
|
26
|
+
<span>{{ name }}</span>
|
|
27
|
+
<span class="_fd-label" v-if="eventInfo[name]">
|
|
28
|
+
{{ eventInfo[name] }}
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
</el-dropdown-item>
|
|
32
|
+
<template v-for="(hook, idx) in hookList">
|
|
33
|
+
<el-dropdown-item :divided="eventList.length > 0 && !idx"
|
|
34
|
+
@click="add(hook)"
|
|
35
|
+
:disabled="Object.keys(event).indexOf(hook) > -1">
|
|
36
|
+
<div class="_fd-event-item">
|
|
37
|
+
<div> {{ hook }}</div>
|
|
38
|
+
<span class="_fd-label">
|
|
39
|
+
{{ eventInfo[hook] }}
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
</el-dropdown-item>
|
|
43
|
+
</template>
|
|
44
|
+
<el-dropdown-item :divided="eventList.length > 0" @click="cusEvent">
|
|
45
|
+
<div>{{ t('props.custom') }}</div>
|
|
46
|
+
</el-dropdown-item>
|
|
47
|
+
</el-dropdown-menu>
|
|
48
|
+
</template>
|
|
49
|
+
</el-dropdown>
|
|
50
|
+
</el-header>
|
|
51
|
+
<el-main>
|
|
52
|
+
<el-menu
|
|
53
|
+
:default-active="defActive"
|
|
54
|
+
v-model="activeData">
|
|
55
|
+
<template v-for="(item, name) in event">
|
|
56
|
+
<template v-if="Array.isArray(item)">
|
|
57
|
+
<template v-for="(event, index) in item" :key="name + index">
|
|
58
|
+
<el-menu-item :index="name + index">
|
|
59
|
+
<div class="_fd-event-title"
|
|
60
|
+
@click.stop="edit({name, item, index})">
|
|
61
|
+
<div class="_fd-event-method">
|
|
62
|
+
<span>function<span>{{
|
|
63
|
+
name
|
|
64
|
+
}}</span></span>
|
|
65
|
+
<span class="_fd-label"
|
|
66
|
+
v-if="eventInfo[name]">{{ eventInfo[name] }}</span>
|
|
67
|
+
</div>
|
|
68
|
+
<i class="fc-icon icon-delete"
|
|
69
|
+
@click.stop="rm({name, item, index})"></i>
|
|
70
|
+
</div>
|
|
71
|
+
</el-menu-item>
|
|
72
|
+
</template>
|
|
73
|
+
</template>
|
|
74
|
+
<el-menu-item v-else :index="name + 0">
|
|
75
|
+
<div class="_fd-event-title" @click.stop="edit({name})">
|
|
76
|
+
<div class="_fd-event-method">
|
|
77
|
+
<span>function<span>{{
|
|
78
|
+
name
|
|
79
|
+
}}</span></span>
|
|
80
|
+
<span class="_fd-label"
|
|
81
|
+
v-if="eventInfo[name]">{{ eventInfo[name] }}</span>
|
|
82
|
+
</div>
|
|
83
|
+
<i class="fc-icon icon-delete" @click.stop="rm({name})"></i>
|
|
84
|
+
</div>
|
|
85
|
+
</el-menu-item>
|
|
86
|
+
</template>
|
|
87
|
+
<el-menu-item v-if="cus" style="padding-left: 10px;" index="custom">
|
|
88
|
+
<div class="_fd-event-title" @click.stop>
|
|
89
|
+
<el-input type="text" v-model="cusValue" size="default"
|
|
90
|
+
@keydown.enter="addCus"
|
|
91
|
+
:placeholder="t('event.placeholder')">
|
|
92
|
+
</el-input>
|
|
93
|
+
<div>
|
|
94
|
+
<i class="fc-icon icon-add" @click.stop="addCus"></i>
|
|
95
|
+
<i class="fc-icon icon-delete" @click.stop="closeCus"></i>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</el-menu-item>
|
|
99
|
+
</el-menu>
|
|
100
|
+
</el-main>
|
|
101
|
+
</el-container>
|
|
102
|
+
</el-aside>
|
|
103
|
+
<el-main>
|
|
104
|
+
<el-container class="_fd-event-r">
|
|
105
|
+
<el-header class="_fd-event-head" height="40px" v-if="activeData">
|
|
106
|
+
<div><a target="_blank" href="https://form-create.com/v3/instance/">{{t('form.document')}}</a></div>
|
|
107
|
+
<div>
|
|
108
|
+
<el-button size="small" @click="close">{{ t('props.cancel') }}</el-button>
|
|
109
|
+
<el-button size="small" type="primary" @click="save" color="#2f73ff">{{
|
|
110
|
+
t('props.save')
|
|
111
|
+
}}
|
|
112
|
+
</el-button>
|
|
113
|
+
</div>
|
|
114
|
+
</el-header>
|
|
115
|
+
<el-main v-if="activeData">
|
|
116
|
+
<FnEditor ref="fn" v-model="eventStr" body :name="activeData.name"
|
|
117
|
+
:args="fnArgs"
|
|
118
|
+
style="height: 558px;"/>
|
|
119
|
+
</el-main>
|
|
120
|
+
</el-container>
|
|
121
|
+
</el-main>
|
|
122
|
+
</el-container>
|
|
123
|
+
<template #footer>
|
|
124
|
+
<div>
|
|
125
|
+
<el-button size="default" @click="visible=false">{{ t('props.cancel') }}</el-button>
|
|
126
|
+
<el-button type="primary" size="default" @click="submit" color="#2f73ff">{{
|
|
127
|
+
t('props.ok')
|
|
128
|
+
}}
|
|
129
|
+
</el-button>
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
132
|
+
</el-dialog>
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<script>
|
|
137
|
+
import unique from '@form-create/utils/lib/unique';
|
|
138
|
+
import deepExtend from '@form-create/utils/lib/deepextend';
|
|
139
|
+
import is from '@form-create/utils/lib/type';
|
|
140
|
+
import {defineComponent} from 'vue';
|
|
141
|
+
import FnEditor from './FnEditor.vue';
|
|
142
|
+
import errorMessage from '../utils/message';
|
|
143
|
+
import {getInjectArg} from '../utils';
|
|
144
|
+
|
|
145
|
+
const $T = '$FNX:';
|
|
146
|
+
|
|
147
|
+
const isFNX = v => {
|
|
148
|
+
return is.String(v) && v.indexOf($T) === 0;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export default defineComponent({
|
|
152
|
+
name: 'EventConfig',
|
|
153
|
+
emits: ['update:modelValue'],
|
|
154
|
+
props: {
|
|
155
|
+
modelValue: [Object, undefined, null],
|
|
156
|
+
componentName: String,
|
|
157
|
+
eventName: {
|
|
158
|
+
type: Array,
|
|
159
|
+
default: () => []
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
inject: ['designer'],
|
|
163
|
+
components: {
|
|
164
|
+
FnEditor,
|
|
165
|
+
},
|
|
166
|
+
data() {
|
|
167
|
+
return {
|
|
168
|
+
visible: false,
|
|
169
|
+
activeData: null,
|
|
170
|
+
val: null,
|
|
171
|
+
defActive: 'no',
|
|
172
|
+
hookList: ['hook_load', 'hook_mounted', 'hook_beforeUnmount', 'hook_deleted', 'hook_watch', 'hook_value', 'hook_hidden', 'hook_titleClick'],
|
|
173
|
+
event: {},
|
|
174
|
+
cus: false,
|
|
175
|
+
cusValue: '',
|
|
176
|
+
eventStr: '',
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
computed: {
|
|
180
|
+
t() {
|
|
181
|
+
return this.designer.setupState.t;
|
|
182
|
+
},
|
|
183
|
+
activeRule() {
|
|
184
|
+
return this.designer.setupState.activeRule;
|
|
185
|
+
},
|
|
186
|
+
orgEvent() {
|
|
187
|
+
if (!this.eventName || !this.eventName.length) {
|
|
188
|
+
return ['click'];
|
|
189
|
+
}
|
|
190
|
+
return this.eventName;
|
|
191
|
+
},
|
|
192
|
+
eventList() {
|
|
193
|
+
return this.orgEvent.map(v => {
|
|
194
|
+
return typeof v === 'object' ? v.name : v;
|
|
195
|
+
})
|
|
196
|
+
},
|
|
197
|
+
eventInfo() {
|
|
198
|
+
const info = {};
|
|
199
|
+
this.orgEvent.forEach(v => {
|
|
200
|
+
if (typeof v === 'object') {
|
|
201
|
+
info[v.name] = this.t('com.' + this.componentName + '.event.' + v.name) || v.info || this.t('eventInfo.' + v.name) || '';
|
|
202
|
+
} else {
|
|
203
|
+
info[v] = this.t('com.' + this.componentName + '.event.' + v) || this.t('eventInfo.' + v) || '';
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
this.hookList.forEach(v => {
|
|
207
|
+
info[v] = this.t('eventInfo.' + v) || '';
|
|
208
|
+
})
|
|
209
|
+
return info;
|
|
210
|
+
},
|
|
211
|
+
eventNum() {
|
|
212
|
+
let num = 0;
|
|
213
|
+
Object.keys(this.modelValue || {}).forEach(k => {
|
|
214
|
+
num += Array.isArray(this.modelValue[k]) ? this.modelValue[k].length : 1;
|
|
215
|
+
});
|
|
216
|
+
const hooks = this.activeRule ? {...this.activeRule._hook || {}} : {};
|
|
217
|
+
Object.keys(hooks).forEach(k => {
|
|
218
|
+
num += Array.isArray(hooks[k]) ? hooks[k].length : 1;
|
|
219
|
+
});
|
|
220
|
+
return num;
|
|
221
|
+
},
|
|
222
|
+
fnArgs() {
|
|
223
|
+
return [getInjectArg(this.t)];
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
watch: {
|
|
227
|
+
visible(v) {
|
|
228
|
+
this.event = v ? this.loadFN() : {};
|
|
229
|
+
if (!v) {
|
|
230
|
+
this.destroy();
|
|
231
|
+
this.closeCus();
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
methods: {
|
|
236
|
+
addCus() {
|
|
237
|
+
const val = this.cusValue && this.cusValue.trim();
|
|
238
|
+
if (val) {
|
|
239
|
+
this.closeCus();
|
|
240
|
+
this.add(val);
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
closeCus() {
|
|
244
|
+
this.cus = false;
|
|
245
|
+
this.cusValue = '';
|
|
246
|
+
},
|
|
247
|
+
cusEvent() {
|
|
248
|
+
this.cus = true;
|
|
249
|
+
},
|
|
250
|
+
loadFN() {
|
|
251
|
+
const e = deepExtend({}, this.modelValue || {});
|
|
252
|
+
const hooks = this.activeRule ? {...this.activeRule._hook || {}} : {};
|
|
253
|
+
Object.keys(hooks).forEach(k => {
|
|
254
|
+
e['hook_' + k] = hooks[k];
|
|
255
|
+
})
|
|
256
|
+
const val = {};
|
|
257
|
+
Object.keys(e).forEach(k => {
|
|
258
|
+
if (Array.isArray(e[k])) {
|
|
259
|
+
const data = [];
|
|
260
|
+
e[k].forEach(v => {
|
|
261
|
+
if (isFNX(v)) {
|
|
262
|
+
data.push(v.replace($T, ''));
|
|
263
|
+
} else if (is.Function(v) && isFNX(v.__json)) {
|
|
264
|
+
data.push(v.__json.replace($T, ''));
|
|
265
|
+
} else if (v && v.indexOf('$GLOBAL:') === 0) {
|
|
266
|
+
data.push(v);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
val[k] = data;
|
|
270
|
+
} else if (isFNX(e[k])) {
|
|
271
|
+
val[k] = [e[k].replace($T, '')];
|
|
272
|
+
} else if (is.Function(e[k])) {
|
|
273
|
+
const json = e[k].__json || '';
|
|
274
|
+
if (!json) {
|
|
275
|
+
val[k] = ['' + e[k]];
|
|
276
|
+
} else if (isFNX(json)) {
|
|
277
|
+
val[k] = [json.replace($T, '')];
|
|
278
|
+
} else {
|
|
279
|
+
val[k] = [json];
|
|
280
|
+
}
|
|
281
|
+
} else if (e[k] && e[k].indexOf('$GLOBAL:') === 0) {
|
|
282
|
+
val[k] = [e[k]];
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
return val;
|
|
286
|
+
},
|
|
287
|
+
parseFN(e) {
|
|
288
|
+
const on = {};
|
|
289
|
+
const hooks = {};
|
|
290
|
+
Object.keys(e).forEach(k => {
|
|
291
|
+
const lst = [];
|
|
292
|
+
e[k].forEach((v, i) => {
|
|
293
|
+
lst[i] = v.indexOf('$GLOBAL:') !== 0 ? ($T + v) : v;
|
|
294
|
+
});
|
|
295
|
+
if (lst.length > 0) {
|
|
296
|
+
if (k.indexOf('hook_') > -1) {
|
|
297
|
+
hooks[k.replace('hook_', '')] = lst.length === 1 ? lst[0] : lst;
|
|
298
|
+
} else {
|
|
299
|
+
on[k] = lst.length === 1 ? lst[0] : lst;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
return {hooks, on};
|
|
304
|
+
},
|
|
305
|
+
add(name) {
|
|
306
|
+
let data = {};
|
|
307
|
+
if (Array.isArray(this.event[name])) {
|
|
308
|
+
this.event[name].push('');
|
|
309
|
+
data = {
|
|
310
|
+
name,
|
|
311
|
+
item: this.event[name],
|
|
312
|
+
index: this.event[name].length - 1,
|
|
313
|
+
};
|
|
314
|
+
} else if (this.event[name]) {
|
|
315
|
+
const arr = [this.event[name], ''];
|
|
316
|
+
this.event[name] = arr;
|
|
317
|
+
data = {
|
|
318
|
+
name,
|
|
319
|
+
item: arr,
|
|
320
|
+
index: 1,
|
|
321
|
+
};
|
|
322
|
+
} else {
|
|
323
|
+
const arr = [''];
|
|
324
|
+
this.event[name] = arr;
|
|
325
|
+
data = {
|
|
326
|
+
name,
|
|
327
|
+
item: arr,
|
|
328
|
+
index: 0,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
if (!this.activeData) {
|
|
332
|
+
this.edit(data);
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
edit(data) {
|
|
336
|
+
data.key = unique();
|
|
337
|
+
if (data.item) {
|
|
338
|
+
this.val = data.item[data.index];
|
|
339
|
+
} else {
|
|
340
|
+
this.val = this.event[data.name];
|
|
341
|
+
}
|
|
342
|
+
this.activeData = data;
|
|
343
|
+
this.eventStr = this.val;
|
|
344
|
+
this.defActive = data.name + (data.index || 0);
|
|
345
|
+
},
|
|
346
|
+
save() {
|
|
347
|
+
if (!this.$refs.fn.save()) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
const str = this.eventStr;
|
|
351
|
+
|
|
352
|
+
if (this.activeData.item) {
|
|
353
|
+
this.activeData.item[this.activeData.index] = str;
|
|
354
|
+
} else {
|
|
355
|
+
this.event[this.activeData.name] = str;
|
|
356
|
+
}
|
|
357
|
+
this.destroy();
|
|
358
|
+
},
|
|
359
|
+
rm(data) {
|
|
360
|
+
if (data.index !== undefined) {
|
|
361
|
+
data.item.splice(data.index, 1);
|
|
362
|
+
if(data.item.length === 0) {
|
|
363
|
+
delete this.event[data.name];
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
delete this.event[data.name];
|
|
367
|
+
}
|
|
368
|
+
if (this.defActive === (data.name + (data.index || 0))) {
|
|
369
|
+
this.destroy();
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
destroy() {
|
|
373
|
+
this.activeData = null;
|
|
374
|
+
this.val = null;
|
|
375
|
+
this.defActive = 'no';
|
|
376
|
+
},
|
|
377
|
+
close() {
|
|
378
|
+
this.destroy();
|
|
379
|
+
},
|
|
380
|
+
submit() {
|
|
381
|
+
if (this.activeData) {
|
|
382
|
+
return errorMessage(this.t('event.saveMsg'));
|
|
383
|
+
}
|
|
384
|
+
const {on, hooks} = this.parseFN(this.event);
|
|
385
|
+
this.$emit('update:modelValue', on);
|
|
386
|
+
this.activeRule._hook = hooks;
|
|
387
|
+
this.visible = false;
|
|
388
|
+
this.destroy();
|
|
389
|
+
this.closeCus();
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
});
|
|
393
|
+
</script>
|
|
394
|
+
|
|
395
|
+
<style>
|
|
396
|
+
|
|
397
|
+
._fd-event .el-button {
|
|
398
|
+
font-weight: 400;
|
|
399
|
+
width: 100%;
|
|
400
|
+
border-color: #2E73FF;
|
|
401
|
+
color: #2E73FF;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
._fd-event .el-badge {
|
|
405
|
+
width: 100%;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
._fd-event-con .el-main {
|
|
409
|
+
padding: 0;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
._fd-event-l, ._fd-event-r {
|
|
413
|
+
display: flex;
|
|
414
|
+
flex-direction: column;
|
|
415
|
+
flex: 1;
|
|
416
|
+
height: 100%;
|
|
417
|
+
border: 1px solid #ececec;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
._fd-event-dropdown .el-dropdown-menu {
|
|
421
|
+
max-height: 500px;
|
|
422
|
+
overflow: auto;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
._fd-event-head {
|
|
426
|
+
display: flex;
|
|
427
|
+
padding: 5px 15px;
|
|
428
|
+
border-bottom: 1px solid #eee;
|
|
429
|
+
background: #f8f9ff;
|
|
430
|
+
align-items: center;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
._fd-event-head .el-button.is-link {
|
|
434
|
+
color: #2f73ff;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
._fd-event-r {
|
|
438
|
+
border-left: 0 none;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
._fd-event-r ._fd-event-head {
|
|
442
|
+
justify-content: space-between;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
._fd-event-l > .el-main, ._fd-event-r > .el-main {
|
|
446
|
+
display: flex;
|
|
447
|
+
flex-direction: row;
|
|
448
|
+
flex: 1;
|
|
449
|
+
flex-basis: auto;
|
|
450
|
+
box-sizing: border-box;
|
|
451
|
+
min-width: 0;
|
|
452
|
+
width: 100%;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
._fd-event-r > .el-main {
|
|
456
|
+
flex-direction: column;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
._fd-event-item {
|
|
460
|
+
display: flex;
|
|
461
|
+
flex-direction: column;
|
|
462
|
+
justify-content: center;
|
|
463
|
+
max-width: 250px;
|
|
464
|
+
font-size: 14px;
|
|
465
|
+
overflow: hidden;
|
|
466
|
+
white-space: pre-wrap;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
._fd-event-item ._fd-label {
|
|
470
|
+
font-size: 12px;
|
|
471
|
+
color: #AAAAAA;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
._fd-event-l .el-menu {
|
|
475
|
+
padding: 0 10px 5px;
|
|
476
|
+
border-right: 0 none;
|
|
477
|
+
width: 100%;
|
|
478
|
+
border-top: 0 none;
|
|
479
|
+
overflow: auto;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
._fd-event-l .el-menu-item.is-active {
|
|
483
|
+
background: #e4e7ed;
|
|
484
|
+
color: #303133;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
._fd-event-l .el-menu-item {
|
|
488
|
+
height: auto;
|
|
489
|
+
line-height: 1em;
|
|
490
|
+
border: 1px solid #ECECEC;
|
|
491
|
+
border-radius: 5px;
|
|
492
|
+
padding: 0;
|
|
493
|
+
margin-top: 5px;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
._fd-event-method {
|
|
497
|
+
display: flex;
|
|
498
|
+
flex-direction: column;
|
|
499
|
+
justify-content: center;
|
|
500
|
+
width: 225px;
|
|
501
|
+
font-size: 14px;
|
|
502
|
+
font-family: monospace;
|
|
503
|
+
color: #9D238C;
|
|
504
|
+
overflow: hidden;
|
|
505
|
+
white-space: pre-wrap;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
._fd-event-method ._fd-label {
|
|
509
|
+
margin-top: 4px;
|
|
510
|
+
color: #AAAAAA;
|
|
511
|
+
font-size: 12px;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
._fd-event-method > span:first-child, ._fd-fn-list-method > span:first-child {
|
|
515
|
+
color: #9D238C;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
._fd-event-method > span:first-child > span, ._fd-fn-list-method > span:first-child > span {
|
|
519
|
+
color: #000;
|
|
520
|
+
margin-left: 10px;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
._fd-event-title {
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
justify-content: space-between;
|
|
527
|
+
width: 100%;
|
|
528
|
+
padding: 10px 0;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
._fd-event-title .fc-icon {
|
|
532
|
+
margin-right: 6px;
|
|
533
|
+
font-size: 18px;
|
|
534
|
+
color: #282828;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
._fd-event-title .el-input {
|
|
538
|
+
width: 200px;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
._fd-event-title .el-input__wrapper {
|
|
542
|
+
box-shadow: none;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
._fd-event-title .el-menu-item.is-active i {
|
|
546
|
+
color: #282828;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
._fd-event-con .CodeMirror {
|
|
550
|
+
height: 100%;
|
|
551
|
+
width: 100%;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
._fd-event-con .CodeMirror-wrap pre.CodeMirror-line {
|
|
555
|
+
padding-left: 20px;
|
|
556
|
+
}
|
|
557
|
+
</style>
|