This commit is contained in:
fofolee
2022-06-07 19:39:07 +08:00
11 changed files with 66 additions and 27 deletions

View File

@@ -270,7 +270,7 @@
/>
</q-dialog>
<q-dialog v-model="showUserData">
<UserData @insertText="insertSpecialVar" />
<UserData @insertText="insertSpecialVar" :showInsertBtn="true" />
</q-dialog>
</q-scroll-area>
</template>

View File

@@ -37,6 +37,7 @@
style="width: 280px"
autofocus
v-model="$root.profile.quickFileTag"
@blur="$root.profile.quickFileTag || ($root.profile.quickFileTag = '文件')"
type="text"
>
<template v-slot:append>
@@ -68,6 +69,8 @@
input-class="text-center"
style="width: 280px"
v-model="$root.profile.quickUrlTag"
@blur="$root.profile.quickUrlTag || ($root.profile.quickUrlTag = '网址')"
type="text"
>
<template v-slot:append>

View File

@@ -11,13 +11,13 @@
></iframe>
<div
v-else
v-show="!!runResult"
v-show="!!runResult.length"
:class="{ 'text-red': !runResultStatus }"
class="text q-px-md q-py-sm"
>
<div v-for="item in runResult" :key="item">
<ObjectTree :obj="item" v-if="typeof item === 'object'" />
<pre class="result" v-text="item" v-else-if="!!item"></pre>
<pre class="result" v-text="item" v-else></pre>
</div>
</div>
</div>
@@ -86,7 +86,12 @@ export default {
!utools.isDarkColors() || (cfw.document.body.style.color = "white");
let clientHeight =
cfw.document.documentElement.getBoundingClientRect().height;
this.frameHeight = clientHeight === 20 ? 0 : clientHeight;
clientHeight = clientHeight === 20 ? 0 : clientHeight;
this.frameHeight = Math.max(
// 当有绝对定位的元素时只能通过遍历获取高度
this.getMaxElHeight(cfw.document),
clientHeight
);
this.$emit("frameLoad", this.frameHeight);
};
},
@@ -108,6 +113,14 @@ export default {
onerror: (e) => showError(e),
};
},
getMaxElHeight(doc) {
let els = Array.prototype.slice.call(doc.body.getElementsByTagName("*"));
let elHeights = [];
for (let i = 0, l = els.length; i < l; i++) {
elHeights.push(els[i].scrollTop + els[i].offsetHeight);
}
return Math.max.apply(Math, elHeights);
},
},
};
</script>

View File

@@ -84,12 +84,7 @@ export default {
},
computed: {
disableShare() {
return (
this.shareLock ||
!this.yuQueInfo.yuQueToken ||
(this.yuQueInfo.authorId !== this.command.authorId &&
this.command.fromShare)
);
return this.shareLock || !this.yuQueInfo.yuQueToken;
},
},
mounted() {

View File

@@ -18,7 +18,9 @@
:placeholder="item.value || '本机未设置'"
>
<template v-slot:prepend>
<q-chip color="primary" dense>{{ item.id }}</q-chip>
<q-chip color="primary" text-color="white" dense>{{
item.id
}}</q-chip>
</template>
<template v-slot:append>
<q-toggle

View File

@@ -2,7 +2,7 @@
export default {
mounted() {
utools.setExpendHeight(0);
this.$root.payload.forEach((file) => {
this.$root.enterData.payload.forEach((file) => {
let uid = this.getUid();
let fileInfo = window.getFileInfo({
type: "file",

View File

@@ -24,7 +24,7 @@ export default {
);
url = choise.text + "://" + url;
}
let title = this.$root.payload.title
let title = this.$root.enterData.payload.title
.replace(/和另外 \d+ 个页面.*/, "")
.replace(/[-|—] .*?[Edge|Firefox|Chrome].*/, "")
.trim();
@@ -39,7 +39,7 @@ export default {
let uid = this.getUid();
let command = {
features: {
explain: `访问${title}`,
explain: title,
cmds: [title],
platform: ["linux", "win32", "darwin"],
code: `key_${uid}`,
@@ -51,7 +51,7 @@ export default {
};
try {
let res = await quickcommand.downloadFile(iconUrl, iconPath);
if (res) command.features.icon = iconPath;
if (res) command.features.icon = window.getBase64Ico(iconPath);
} catch (e) {}
this.importCommand(command);
utools.showNotification("操作成功!");

View File

@@ -85,9 +85,11 @@ export default {
}),
showMessageBox: (message, icon = "success", time) => {
message = _.truncate(message, { length: 1200 });
if (icon === "success") icon = "positive";
if (icon === "error") icon = "negative";
if (!time) time = Math.max(message.toString().length * 120, 1000);
if (typeof time === "undefined")
time = Math.max(message.toString().length * 120, 1000);
Notify.create({
type: icon,
message: message,