renusify 1.4.2 → 1.4.4
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/components/app/index.vue +1 -10
- package/components/chart/worldMap.vue +293 -34
- package/components/chip/style.scss +0 -1
- package/components/codeEditor/highlightCss.vue +10 -112
- package/components/codeEditor/highlightHtml.vue +20 -159
- package/components/codeEditor/highlightJs.vue +14 -243
- package/components/codeEditor/index.vue +37 -57
- package/components/codeEditor/mixin.js +186 -0
- package/components/cropper/index.vue +2 -1
- package/components/form/camInput.vue +6 -2
- package/components/form/input.vue +1 -1
- package/components/form/json/index.vue +113 -65
- package/components/form/mask-input.vue +2 -2
- package/components/form/text-area.vue +1 -1
- package/components/form/text-editor/index.vue +0 -1
- package/components/form/timepicker/index.vue +18 -16
- package/components/form/unit-input.vue +1 -0
- package/components/formCreator/index.vue +7 -20
- package/components/img/index.vue +18 -18
- package/components/index.js +2 -2
- package/components/infinite/index.vue +9 -6
- package/components/map/index.vue +52 -20
- package/components/map/leaflet.css +511 -397
- package/components/map/route.vue +570 -560
- package/components/map/select.vue +64 -48
- package/components/message/index.vue +22 -21
- package/components/modal/index.vue +76 -17
- package/components/modal/style.scss +21 -16
- package/components/{app/notify → notify}/index.vue +21 -29
- package/components/{app/notify → notify}/notification.vue +10 -10
- package/components/notify/notify.js +27 -0
- package/components/searchBox/index.vue +30 -12
- package/components/slider/index.vue +16 -12
- package/components/table/index.vue +378 -379
- package/components/table/style.scss +1 -4
- package/components/tabs/index.vue +9 -23
- package/components/timeAgo/index.vue +4 -1
- package/components/tour/index.vue +237 -222
- package/components/tree/index.vue +135 -136
- package/components/tree/tree-element.vue +17 -3
- package/directive/drag/index.js +5 -5
- package/directive/index.js +1 -2
- package/directive/mask/index.js +1 -4
- package/directive/skeleton/index.js +27 -0
- package/directive/skeleton/style.scss +37 -0
- package/directive/sortable/index.js +3 -3
- package/directive/title/index.js +2 -3
- package/directive/touch/index.js +2 -4
- package/index.js +14 -9
- package/package.json +1 -1
- package/style/transitions.scss +6 -116
- package/tools/helper.js +1 -22
- package/components/app/notify/notify.js +0 -28
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
methods: {
|
|
3
|
+
pretty_html(text) {
|
|
4
|
+
if (!text) {
|
|
5
|
+
return ''
|
|
6
|
+
}
|
|
7
|
+
text = text.trim()
|
|
8
|
+
text = text.replace(/ +(?= )/g, '');
|
|
9
|
+
text = text.replace(/[\r|\n|\t]/g, '');
|
|
10
|
+
let r = ''
|
|
11
|
+
text = text.split('<')
|
|
12
|
+
let numopen = 0
|
|
13
|
+
text.forEach((line) => {
|
|
14
|
+
if (line) {
|
|
15
|
+
const end = line.startsWith('/')
|
|
16
|
+
if (end) {
|
|
17
|
+
numopen -= 1
|
|
18
|
+
}
|
|
19
|
+
r += '\t'.repeat(numopen) + '<' + line + '\n'
|
|
20
|
+
if (!end) {
|
|
21
|
+
numopen += 1
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
r = r.replace(/<([^/].*)>+[\r|\n|\t]+<\//g, '<$1></');
|
|
26
|
+
return r
|
|
27
|
+
},
|
|
28
|
+
pretty_js(text) {
|
|
29
|
+
if (!text) {
|
|
30
|
+
return ''
|
|
31
|
+
}
|
|
32
|
+
text = text.trim()
|
|
33
|
+
text = text.replace(/ +(?= )/g, '');
|
|
34
|
+
text = text.replace(/[\r|\n|\t]/g, '');
|
|
35
|
+
text = text.replace(/([,|;|{|(|\[])+[\s]/g, '$1');
|
|
36
|
+
let r = ''
|
|
37
|
+
text = text.split('')
|
|
38
|
+
let numopen = 0
|
|
39
|
+
const textLength = text.length
|
|
40
|
+
let inBracket = 0
|
|
41
|
+
let inprantez = 0
|
|
42
|
+
for (let i = 0; i < textLength; i++) {
|
|
43
|
+
const c = text[i]
|
|
44
|
+
const last = i > 0 ? text[i - 1] : ''
|
|
45
|
+
const next = i < textLength - 1 ? text[i + 1] : ''
|
|
46
|
+
|
|
47
|
+
if (c === '(') {
|
|
48
|
+
inprantez += 1
|
|
49
|
+
}
|
|
50
|
+
if (c === ')') {
|
|
51
|
+
inprantez -= 1
|
|
52
|
+
}
|
|
53
|
+
if (c === '[') {
|
|
54
|
+
inBracket += 1
|
|
55
|
+
}
|
|
56
|
+
if (c === ']') {
|
|
57
|
+
inBracket -= 1
|
|
58
|
+
}
|
|
59
|
+
if (c === '}') {
|
|
60
|
+
numopen -= 1
|
|
61
|
+
}
|
|
62
|
+
if (numopen < 0) {
|
|
63
|
+
numopen = 0
|
|
64
|
+
}
|
|
65
|
+
r += c
|
|
66
|
+
if (c === '}' && next !== ',' && next !== ';' && next !== '}' && next !== ')') {
|
|
67
|
+
r += '\n' + '\t'.repeat(numopen)
|
|
68
|
+
}
|
|
69
|
+
if (c === ',' && (!inprantez && !inBracket) && next !== '}') {
|
|
70
|
+
r += '\n' + '\t'.repeat(numopen)
|
|
71
|
+
}
|
|
72
|
+
if (c === ';' && next !== '}') {
|
|
73
|
+
r += '\n' + '\t'.repeat(numopen)
|
|
74
|
+
}
|
|
75
|
+
if (next === '}' && c !== '{' && numopen > 0) {
|
|
76
|
+
|
|
77
|
+
r += '\n' + '\t'.repeat(numopen - 1)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (c === '{') {
|
|
81
|
+
numopen += 1
|
|
82
|
+
if (next !== '}') {
|
|
83
|
+
r += '\n' + '\t'.repeat(numopen)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
r = r.replace(/\t /g, '\t');
|
|
88
|
+
r = r.replace(/^\s*\n/gm, '');
|
|
89
|
+
return r
|
|
90
|
+
},
|
|
91
|
+
setTab(event) {
|
|
92
|
+
if (event.key === "'" || event.key === '"' || event.key === '`') {
|
|
93
|
+
const end = event.target.selectionEnd;
|
|
94
|
+
event.preventDefault()
|
|
95
|
+
document.execCommand('insertText', false, event.key.repeat(2));
|
|
96
|
+
event.target.selectionEnd = end + 1;
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (event.key === "{") {
|
|
100
|
+
const end = event.target.selectionEnd;
|
|
101
|
+
event.preventDefault()
|
|
102
|
+
document.execCommand('insertText', false, '{}');
|
|
103
|
+
event.target.selectionEnd = end + 1;
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (event.key === "(") {
|
|
107
|
+
const end = event.target.selectionEnd;
|
|
108
|
+
event.preventDefault()
|
|
109
|
+
document.execCommand('insertText', false, '()');
|
|
110
|
+
event.target.selectionEnd = end + 1;
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (event.key === "[") {
|
|
114
|
+
const end = event.target.selectionEnd;
|
|
115
|
+
event.preventDefault()
|
|
116
|
+
document.execCommand('insertText', false, '[]');
|
|
117
|
+
event.target.selectionEnd = end + 1;
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (event.keyCode === 9) {
|
|
121
|
+
event.preventDefault()
|
|
122
|
+
document.execCommand('insertText', false, '\t');
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
if (event.keyCode === 13) {
|
|
126
|
+
event.preventDefault()
|
|
127
|
+
let n = event.target.value.substr(0, event.target.selectionStart).split('\n')
|
|
128
|
+
n = n[n.length - 1].split('\t')
|
|
129
|
+
|
|
130
|
+
let w = ''
|
|
131
|
+
for (let i = 0; i < n.length; i++) {
|
|
132
|
+
if (n[i] === '') {
|
|
133
|
+
w += '\t'
|
|
134
|
+
} else {
|
|
135
|
+
break
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
document.execCommand('insertText', false, '\n' + w);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
return true
|
|
143
|
+
},
|
|
144
|
+
re_quote(res) {
|
|
145
|
+
let regex = /"([^"]*)"/g;
|
|
146
|
+
res = res.replace(regex, '<span class="color-green code-editor-span">"$1"</span>');
|
|
147
|
+
regex = /'([^']*)'/g;
|
|
148
|
+
return res.replace(regex, "<span class=\"color-green code-editor-span\">'$1'</span>");
|
|
149
|
+
},
|
|
150
|
+
re_special(res, regex = /([{}\[\]])/g, color = "color-orange") {
|
|
151
|
+
return res.replace(regex, '<span class="' + color + ' code-editor-span">$1</span>')
|
|
152
|
+
},
|
|
153
|
+
re_number(res) {
|
|
154
|
+
return res.replace(/\b([0-9.]+)\b/g, '<span class="color-blue code-editor-span">$1</span>')
|
|
155
|
+
},
|
|
156
|
+
re_words(res, words) {
|
|
157
|
+
words.forEach((word) => {
|
|
158
|
+
res = res.replace(new RegExp("\\b(" + word + ")\\b", 'g'), '<span class="color-orange code-editor-span">$1</span>')
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
return res;
|
|
162
|
+
},
|
|
163
|
+
re_comment(res) {
|
|
164
|
+
//eslint-disable-next-line
|
|
165
|
+
let regex = /(\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*)$/gm;
|
|
166
|
+
return res.replace(regex, '<span class="color-comment code-editor-span">$1</span>')
|
|
167
|
+
},
|
|
168
|
+
re_func(res) {
|
|
169
|
+
//function like Date()
|
|
170
|
+
let regex = /([$a-zA-Z-0-9_\s]+)(?=\()/g;
|
|
171
|
+
res = res.replace(regex, '<span class="color-func2 code-editor-span">$1</span>')
|
|
172
|
+
|
|
173
|
+
// Object keys
|
|
174
|
+
regex = /([a-zA-Z-0-9_]+)(?=:)/g;
|
|
175
|
+
res = res.replace(regex, '<span class="color-purple code-editor-span">$1</span>')
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
//function like $r $d()
|
|
179
|
+
regex = /(\$([a-zA-z0-9]*)[.|(])/g;
|
|
180
|
+
res = res.replace(regex, '<span class="color-func code-editor-span">$1</span>')
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
return res;
|
|
184
|
+
},
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -61,6 +61,7 @@ export default {
|
|
|
61
61
|
getBlob: Boolean,
|
|
62
62
|
selectImg: {type: Boolean, default: true},
|
|
63
63
|
},
|
|
64
|
+
emits: ['cropped', 'original'],
|
|
64
65
|
data() {
|
|
65
66
|
return {
|
|
66
67
|
show: false,
|
|
@@ -172,7 +173,7 @@ export default {
|
|
|
172
173
|
that.crop(e.target.result);
|
|
173
174
|
};
|
|
174
175
|
|
|
175
|
-
this.$emit("
|
|
176
|
+
this.$emit("original", e.target.files[0]);
|
|
176
177
|
reader.readAsDataURL(e.target.files[0]);
|
|
177
178
|
},
|
|
178
179
|
getDataURL() {
|
|
@@ -133,7 +133,7 @@ export default {
|
|
|
133
133
|
},
|
|
134
134
|
headers: Object
|
|
135
135
|
},
|
|
136
|
-
emits:['update:modelValue','error'],
|
|
136
|
+
emits: ['update:modelValue', 'error'],
|
|
137
137
|
data() {
|
|
138
138
|
return {
|
|
139
139
|
started: false,
|
|
@@ -268,7 +268,11 @@ export default {
|
|
|
268
268
|
},
|
|
269
269
|
(err) => {
|
|
270
270
|
this.uploadPercentage = 0;
|
|
271
|
-
|
|
271
|
+
if (err.response) {
|
|
272
|
+
this.$emit('error', err.response.data)
|
|
273
|
+
} else {
|
|
274
|
+
this.$emit('error', err)
|
|
275
|
+
}
|
|
272
276
|
}
|
|
273
277
|
);
|
|
274
278
|
},
|
|
@@ -52,23 +52,29 @@
|
|
|
52
52
|
<r-btn @click.prevent="add" class="ms-1 color-success" rounded>{{ $t('add', 'renusify') }}</r-btn>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
<div v-else :class="{'state-error':error}" class="json-highlight ltr">
|
|
56
|
+
<textarea
|
|
57
|
+
v-model="lazyValue"
|
|
58
|
+
autocapitalize="off"
|
|
59
|
+
autocomplete="off"
|
|
60
|
+
autocorrect="off"
|
|
61
|
+
class="ltr w-full"
|
|
62
|
+
spellcheck="false"
|
|
63
|
+
:rows="modelValue?Object.keys(modelValue).length+5:5"
|
|
64
|
+
@keydown="setTab"
|
|
65
|
+
></textarea>
|
|
66
|
+
<div class="text-preview" v-html="build"></div>
|
|
67
|
+
</div>
|
|
64
68
|
</div>
|
|
65
69
|
</template>
|
|
66
70
|
<script>
|
|
67
71
|
import JsonView from "./JsonView";
|
|
72
|
+
import mixin from 'renusify/components/codeEditor/mixin'
|
|
68
73
|
|
|
69
74
|
export default {
|
|
70
75
|
name: 'r-json',
|
|
71
76
|
components: {JsonView},
|
|
77
|
+
mixins: [mixin],
|
|
72
78
|
props: {
|
|
73
79
|
label: String,
|
|
74
80
|
keyLabel: {type: String, default: 'key'},
|
|
@@ -93,14 +99,49 @@ export default {
|
|
|
93
99
|
emits: ['update:modelValue'],
|
|
94
100
|
data() {
|
|
95
101
|
return {
|
|
102
|
+
lazyValue: '',
|
|
96
103
|
modeForm: true,
|
|
97
104
|
error: false,
|
|
98
105
|
show: false,
|
|
99
|
-
info: {}
|
|
100
|
-
color: `rgb(${this.$helper.randomInt(0, 255)},${this.$helper.randomInt(0, 255)},${this.$helper.randomInt(0, 255)})`
|
|
106
|
+
info: {}
|
|
101
107
|
}
|
|
102
108
|
},
|
|
109
|
+
watch: {
|
|
110
|
+
modeForm: function () {
|
|
111
|
+
this.lazyValue = JSON.stringify(this.modelValue || {}, null, 4)
|
|
112
|
+
},
|
|
113
|
+
modelValue: function () {
|
|
114
|
+
try {
|
|
115
|
+
this.error = false
|
|
116
|
+
if (JSON.stringify(JSON.parse(this.lazyValue)) !== JSON.stringify(this.modelValue)) {
|
|
117
|
+
this.lazyValue = JSON.stringify(this.modelValue || {}, null, 4)
|
|
118
|
+
}
|
|
119
|
+
} catch (er) {
|
|
120
|
+
this.error = true
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
},
|
|
124
|
+
lazyValue: function () {
|
|
125
|
+
try {
|
|
126
|
+
this.error = false
|
|
127
|
+
this.$emit('update:modelValue', JSON.parse(this.lazyValue))
|
|
128
|
+
} catch (er) {
|
|
129
|
+
this.error = true
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
103
133
|
computed: {
|
|
134
|
+
build() {
|
|
135
|
+
if (!this.lazyValue) {
|
|
136
|
+
return "";
|
|
137
|
+
}
|
|
138
|
+
let res = this.lazyValue
|
|
139
|
+
res = this.re_quote(res);
|
|
140
|
+
res = this.re_words(res, [true, false, null]);
|
|
141
|
+
res = this.re_number(res);
|
|
142
|
+
res = this.re_special(res, /([{},:\[\]])/g, 'color-orange');
|
|
143
|
+
return res;
|
|
144
|
+
},
|
|
104
145
|
is_array() {
|
|
105
146
|
if (this.baseArray) {
|
|
106
147
|
return true
|
|
@@ -109,51 +150,6 @@ export default {
|
|
|
109
150
|
}
|
|
110
151
|
},
|
|
111
152
|
methods: {
|
|
112
|
-
setTab(event) {
|
|
113
|
-
if (event.key === '"') {
|
|
114
|
-
const end = event.target.selectionEnd;
|
|
115
|
-
event.preventDefault()
|
|
116
|
-
document.execCommand('insertText', false, event.key.repeat(2));
|
|
117
|
-
event.target.selectionEnd = end + 1;
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
if (event.key === "{") {
|
|
121
|
-
const end = event.target.selectionEnd;
|
|
122
|
-
event.preventDefault()
|
|
123
|
-
document.execCommand('insertText', false, '{}');
|
|
124
|
-
event.target.selectionEnd = end + 1;
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
if (event.key === "[") {
|
|
128
|
-
const end = event.target.selectionEnd;
|
|
129
|
-
event.preventDefault()
|
|
130
|
-
document.execCommand('insertText', false, '[]');
|
|
131
|
-
event.target.selectionEnd = end + 1;
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
if (event.keyCode === 9) {
|
|
135
|
-
event.preventDefault()
|
|
136
|
-
document.execCommand('insertText', false, ' '.repeat(4));
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
if (event.keyCode === 13) {
|
|
140
|
-
event.preventDefault()
|
|
141
|
-
let n = event.target.value.substr(0, event.target.selectionStart).split('\n')
|
|
142
|
-
n = n[n.length - 1].split('')
|
|
143
|
-
let w = ''
|
|
144
|
-
for (let i = 0; i < n.length; i++) {
|
|
145
|
-
if (n[i] === ' ') {
|
|
146
|
-
w += ' '
|
|
147
|
-
} else {
|
|
148
|
-
break
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
document.execCommand('insertText', false, '\n' + w);
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
return true
|
|
156
|
-
},
|
|
157
153
|
open() {
|
|
158
154
|
if (this.template) {
|
|
159
155
|
let d = this.modelValue
|
|
@@ -169,15 +165,7 @@ export default {
|
|
|
169
165
|
this.show = true
|
|
170
166
|
}
|
|
171
167
|
},
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
this.error = false
|
|
175
|
-
e = JSON.parse(e.target.value)
|
|
176
|
-
this.$emit('update:modelValue', e)
|
|
177
|
-
} catch (er) {
|
|
178
|
-
this.error = true
|
|
179
|
-
}
|
|
180
|
-
},
|
|
168
|
+
|
|
181
169
|
emit(e) {
|
|
182
170
|
this.$emit('update:modelValue', e)
|
|
183
171
|
},
|
|
@@ -228,5 +216,65 @@ export default {
|
|
|
228
216
|
.state-error {
|
|
229
217
|
border: 1px solid var(--color-error);
|
|
230
218
|
}
|
|
219
|
+
|
|
220
|
+
.json-highlight {
|
|
221
|
+
position: relative;
|
|
222
|
+
margin: -12px 0;
|
|
223
|
+
|
|
224
|
+
.text-preview {
|
|
225
|
+
white-space: pre-wrap;
|
|
226
|
+
word-break: keep-all;
|
|
227
|
+
overflow-wrap: break-word;
|
|
228
|
+
min-height: 40px;
|
|
229
|
+
font-size: 14px;
|
|
230
|
+
letter-spacing: 2px;
|
|
231
|
+
line-height: 20px;
|
|
232
|
+
margin: 0;
|
|
233
|
+
border: 0;
|
|
234
|
+
padding: 12px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
textarea {
|
|
238
|
+
&::selection {
|
|
239
|
+
background-color: var(--color-two);
|
|
240
|
+
-webkit-text-fill-color: var(--color-two-text);
|
|
241
|
+
color: var(--color-two-text);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
padding: 12px;
|
|
245
|
+
margin: 0;
|
|
246
|
+
border: 0;
|
|
247
|
+
font-size: 14px;
|
|
248
|
+
letter-spacing: 2px;
|
|
249
|
+
line-height: 20px;
|
|
250
|
+
-webkit-font-smoothing: antialiased;
|
|
251
|
+
-webkit-text-fill-color: transparent;
|
|
252
|
+
outline: none;
|
|
253
|
+
width: 100%;
|
|
254
|
+
height: 100%;
|
|
255
|
+
min-height: 40px;
|
|
256
|
+
white-space: pre-wrap;
|
|
257
|
+
word-break: keep-all;
|
|
258
|
+
overflow-wrap: break-word;
|
|
259
|
+
position: absolute;
|
|
260
|
+
top: 0;
|
|
261
|
+
left: 0;
|
|
262
|
+
resize: none;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.color-orange {
|
|
267
|
+
color: orange;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.color-green {
|
|
271
|
+
color: #0cde27;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
.color-blue {
|
|
276
|
+
color: #7ad5ff;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
231
279
|
}
|
|
232
280
|
</style>
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
for (let i = 0; i <lng; i++) {
|
|
75
75
|
const dataChar = data.charAt(n);
|
|
76
76
|
const maskChar = mask.charAt(i);
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
switch (maskChar) {
|
|
78
79
|
case 'N':
|
|
79
80
|
if (/[0-9]/.test(dataChar)) {
|
|
80
81
|
dataOutput += dataChar;
|
|
81
|
-
|
|
82
82
|
}
|
|
83
83
|
n++
|
|
84
84
|
break;
|
|
@@ -30,22 +30,24 @@
|
|
|
30
30
|
:withSec="withSec"
|
|
31
31
|
v-model="lazyValue"
|
|
32
32
|
></timepicker>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
<div class="my-3 d-flex h-space-between">
|
|
34
|
+
<r-btn
|
|
35
|
+
class="color-success-text"
|
|
36
|
+
outlined
|
|
37
|
+
@click="show_modal = false,emit()"
|
|
38
|
+
>
|
|
39
|
+
{{ $t('accept', 'renusify') }}
|
|
40
|
+
</r-btn
|
|
41
|
+
>
|
|
42
|
+
<r-btn
|
|
43
|
+
class="color-warning-text"
|
|
44
|
+
outlined
|
|
45
|
+
@click="(show_modal = false), (lazyValue = null),emit()"
|
|
46
|
+
>
|
|
47
|
+
{{ $t('cancel', 'renusify') }}
|
|
48
|
+
</r-btn
|
|
49
|
+
>
|
|
50
|
+
</div>
|
|
49
51
|
</r-card>
|
|
50
52
|
</r-modal>
|
|
51
53
|
</div>
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<r-row>
|
|
7
7
|
<template :key="key" v-for="(item,key) in options">
|
|
8
8
|
<r-col v-if="item['formInput']!==false&&iff(options[key])"
|
|
9
|
-
:class="options[key]['
|
|
9
|
+
:class="options[key]['class']?options[key]['class']:'col-12'">
|
|
10
10
|
<component
|
|
11
|
-
:is="
|
|
11
|
+
:is="item['type']"
|
|
12
12
|
:label="$t(key)"
|
|
13
13
|
v-model="editedItem[key]"
|
|
14
14
|
v-bind="getAttr(options[key])"
|
|
@@ -99,12 +99,6 @@ export default {
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
methods: {
|
|
102
|
-
buildName(name) {
|
|
103
|
-
if (name.startsWith('r-')) {
|
|
104
|
-
return name
|
|
105
|
-
}
|
|
106
|
-
return 'r-' + name
|
|
107
|
-
},
|
|
108
102
|
iff(data) {
|
|
109
103
|
const that = this
|
|
110
104
|
|
|
@@ -152,18 +146,11 @@ export default {
|
|
|
152
146
|
return true
|
|
153
147
|
},
|
|
154
148
|
getAttr(data) {
|
|
155
|
-
let res = {}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
res[item[0]] = this.editedItem[item[1]]
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
} else {
|
|
164
|
-
res[i] = data[i]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
149
|
+
let res = data['props'] ? data['props'] : {}
|
|
150
|
+
if (data['$bind']) {
|
|
151
|
+
data['$bind'].forEach((item) => {
|
|
152
|
+
res[item[0]] = this.editedItem[item[1]]
|
|
153
|
+
})
|
|
167
154
|
}
|
|
168
155
|
return res
|
|
169
156
|
},
|
package/components/img/index.vue
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
}"
|
|
15
15
|
>{{ alt }}
|
|
16
16
|
</div>
|
|
17
|
-
<img v-if="load &&!isSvg" ref="img" :
|
|
18
|
-
:height="size.height>0?size.height:'auto'"
|
|
19
|
-
:style="{'height':size.height>0?undefined:'auto',
|
|
17
|
+
<img v-if="load &&!isSvg" ref="img" :alt="alt" :height="size.height>0?size.height:'auto'" :src="link" :style="{'height':size.height>0?undefined:'auto',
|
|
20
18
|
'width':size.width>0?undefined:'auto'
|
|
21
|
-
}"
|
|
19
|
+
}"
|
|
20
|
+
:width="size.width>0?size.width:'auto'"
|
|
21
|
+
draggable="false"/>
|
|
22
22
|
<svg-img v-else-if="load &&isSvg&&link" :link="link" :size="size">
|
|
23
23
|
</svg-img>
|
|
24
24
|
</div>
|
|
@@ -119,21 +119,21 @@ export default {
|
|
|
119
119
|
if (this.height) {
|
|
120
120
|
res["height"] = this.height
|
|
121
121
|
}
|
|
122
|
-
let wPH=this.wPH
|
|
123
|
-
if(!wPH){
|
|
124
|
-
const ls=this.src.split('/')
|
|
125
|
-
if(ls.length>0){
|
|
126
|
-
const p=ls[ls.length-1].split('_')
|
|
127
|
-
if(p.length===3){
|
|
128
|
-
const p0=parseInt(p[0])
|
|
129
|
-
const p1=parseInt(p[1])
|
|
130
|
-
if(p0&&p1){
|
|
131
|
-
wPH=p0/p1
|
|
122
|
+
let wPH = this.wPH
|
|
123
|
+
if (!wPH) {
|
|
124
|
+
const ls = this.src.split('/')
|
|
125
|
+
if (ls.length > 0) {
|
|
126
|
+
const p = ls[ls.length - 1].split('_')
|
|
127
|
+
if (p.length === 3) {
|
|
128
|
+
const p0 = parseInt(p[0])
|
|
129
|
+
const p1 = parseInt(p[1])
|
|
130
|
+
if (p0 && p1) {
|
|
131
|
+
wPH = p0 / p1
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
if(wPH) {
|
|
136
|
+
if (wPH) {
|
|
137
137
|
if (res['width'] !== 0 && res['height'] === 0) {
|
|
138
138
|
res['height'] = parseInt(res['width'] / wPH)
|
|
139
139
|
}
|
|
@@ -142,7 +142,7 @@ export default {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
if (res['width'] !== 0||res['height']!== 0) {
|
|
145
|
+
if (res['width'] !== 0 || res['height'] !== 0) {
|
|
146
146
|
return this.size = res
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -153,7 +153,7 @@ export default {
|
|
|
153
153
|
let w = parseInt(parseFloat(cs.getPropertyValue('width')) - paddingX - borderX);
|
|
154
154
|
return this.size = {
|
|
155
155
|
width: w,
|
|
156
|
-
height: parseInt(wPH?w / wPH:0)
|
|
156
|
+
height: parseInt(wPH ? w / wPH : 0)
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
return false
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
},
|
|
162
162
|
activate() {
|
|
163
163
|
this.getSize()
|
|
164
|
-
if (this.size.width !== 0||this.size.height) {
|
|
164
|
+
if (this.size.width !== 0 || this.size.height) {
|
|
165
165
|
this.load = true
|
|
166
166
|
} else {
|
|
167
167
|
clearTimeout(this.time_id)
|