文件分类新增压缩解压,数学分类新增统计、几何、三角、单位换算

This commit is contained in:
fofolee
2025-01-10 02:14:36 +08:00
parent 4c279e8309
commit ada0d2b968
11 changed files with 1324 additions and 101 deletions

View File

@@ -67,6 +67,68 @@ export const fileCommands = {
},
],
},
{
value: "quickcomposer.file.archive",
label: "文件归档",
desc: "压缩和解压文件",
icon: "archive",
isAsync: true,
config: [
{
key: "operation",
label: "操作类型",
type: "select",
icon: "settings",
width: 6,
defaultValue: "compress",
options: [
{ label: "压缩", value: "compress" },
{ label: "解压", value: "extract" },
],
},
{
key: "format",
label: "归档格式",
type: "select",
icon: "format_shapes",
width: 6,
defaultValue: "zip",
options: [
{ label: "ZIP", value: "zip" },
{ label: "TAR", value: "tar" },
{ label: "GZIP", value: "gzip" },
],
},
{
key: "source",
label: "源文件/文件夹",
type: "varInput",
icon: "folder_open",
width: 12,
options: {
dialog: {
type: "open",
options: {
properties: ["openFile", "openDirectory", "multiSelections"],
},
},
},
},
{
key: "destination",
label: "目标路径",
type: "varInput",
icon: "save",
width: 12,
options: {
dialog: {
type: "save",
options: {},
},
},
},
],
},
{
value: "utools.shellTrashItem",
label: "删除文件到回收站",

View File

@@ -4,117 +4,353 @@ export const mathCommands = {
defaultOpened: false,
commands: [
{
value: "Math.sin",
label: "数学计算",
desc: "数学函数计算",
icon: "calculate",
outputVariable: "calculatedText",
saveOutput: true,
value: "quickcomposer.math.basic.evaluate",
label: "基础运算",
desc: "基础数学运算",
icon: "exposure",
config: [
{
label: "要计算的数值",
icon: "numbers",
type: "numInput",
key: "expression",
label: "表达式",
type: "varInput",
icon: "functions",
width: 12,
},
],
subCommands: [
{
label: "正弦(sin)",
value: "Math.sin",
icon: "functions",
value: "quickcomposer.math.basic.evaluate",
label: "计算表达式",
icon: "calculate",
},
{
label: "余弦(cos)",
value: "Math.cos",
icon: "functions",
value: "quickcomposer.math.basic.round",
label: "四舍五入",
icon: "exposure",
config: [
{
key: "decimals",
label: "小数位数",
type: "numInput",
icon: "pin",
width: 6,
min: 0,
defaultValue: 2,
},
],
},
{
label: "正切(tan)",
value: "Math.tan",
icon: "functions",
value: "quickcomposer.math.basic.floor",
label: "向下取整",
icon: "arrow_downward",
},
{
label: "反正弦(asin)",
value: "Math.asin",
icon: "functions",
value: "quickcomposer.math.basic.ceil",
label: "向上取整",
icon: "arrow_upward",
},
{
label: "反余弦(acos)",
value: "Math.acos",
icon: "functions",
value: "quickcomposer.math.basic.abs",
label: "绝对值",
icon: "unfold_more",
},
{
label: "反正切(atan)",
value: "Math.atan",
icon: "functions",
},
{
label: "平方根(sqrt)",
value: "Math.sqrt",
icon: "functions",
},
{
label: "自然对数(ln)",
value: "Math.log",
icon: "functions",
},
{
label: "10对数(log10)",
value: "Math.log10",
icon: "functions",
},
{
label: "绝对值(abs)",
value: "Math.abs",
icon: "functions",
},
{
label: "向上取整(ceil)",
value: "Math.ceil",
icon: "functions",
},
{
label: "向下取整(floor)",
value: "Math.floor",
icon: "functions",
},
{
label: "四舍五入(round)",
value: "Math.round",
icon: "functions",
},
{
label: "幂运算(pow)",
value: "Math.pow",
value: "quickcomposer.math.basic.factorial",
label: "阶乘",
icon: "functions",
},
],
},
{
value: "quickcomposer.math.random",
value: "quickcomposer.math.random.number",
label: "随机数",
desc: "生成随机数",
icon: "casino",
config: [
{
label: "整数",
type: "switch",
defaultValue: false,
width: 2,
key: "min",
label: "最小值",
type: "numInput",
icon: "arrow_downward",
width: 6,
defaultValue: 0,
},
{
label: "起始值",
icon: "last_page",
key: "max",
label: "最大值",
type: "numInput",
width: 5,
icon: "arrow_upward",
width: 6,
defaultValue: 100,
},
{
label: "结束值",
icon: "first_page",
key: "count",
label: "生成数量",
type: "numInput",
width: 5,
icon: "format_list_numbered",
width: 6,
min: 1,
defaultValue: 1,
},
{
key: "decimals",
label: "小数位数",
type: "numInput",
icon: "pin",
width: 6,
min: 0,
defaultValue: 0,
},
],
subCommands: [
{
value: "quickcomposer.math.random.number",
label: "随机数",
icon: "casino",
},
{
value: "quickcomposer.math.random.integer",
label: "随机整数",
icon: "casino",
},
],
},
{
value: "quickcomposer.math.statistics",
label: "统计计算",
desc: "统计学相关计算",
icon: "bar_chart",
config: [
{
key: "numbers",
label: "数据集合",
type: "varInput",
icon: "dataset",
width: 12,
placeholder: "用逗号分隔的数字,如: 1,2,3,4,5",
},
],
subCommands: [
{
value: "quickcomposer.math.statistics.mean",
label: "平均值",
icon: "horizontal_rule",
},
{
value: "quickcomposer.math.statistics.median",
label: "中位数",
icon: "align_vertical_center",
},
{
value: "quickcomposer.math.statistics.mode",
label: "众数",
icon: "stacked_bar_chart",
},
{
value: "quickcomposer.math.statistics.variance",
label: "方差",
icon: "analytics",
},
{
value: "quickcomposer.math.statistics.stddev",
label: "标准差",
icon: "ssid_chart",
},
{
value: "quickcomposer.math.statistics.sum",
label: "求和",
icon: "add",
},
{
value: "quickcomposer.math.statistics.product",
label: "求积",
icon: "close",
},
{
value: "quickcomposer.math.statistics.max",
label: "最大值",
icon: "keyboard_double_arrow_up",
},
{
value: "quickcomposer.math.statistics.min",
label: "最小值",
icon: "keyboard_double_arrow_down",
},
{
value: "quickcomposer.math.statistics.range",
label: "极差",
icon: "height",
},
],
},
{
value: "quickcomposer.math.geometry.circle",
label: "几何计算",
desc: "几何图形计算",
icon: "architecture",
subCommands: [
{
value: "quickcomposer.math.geometry.circle",
label: "圆形计算",
icon: "circle",
config: [
{
key: "radius",
label: "半径",
type: "numInput",
icon: "radio_button_checked",
width: 12,
min: 0,
},
],
},
{
value: "quickcomposer.math.geometry.rectangle",
label: "矩形计算",
icon: "rectangle",
config: [
{
key: "width",
label: "宽度",
type: "numInput",
icon: "width",
width: 6,
min: 0,
},
{
key: "height",
label: "高度",
type: "numInput",
icon: "height",
width: 6,
min: 0,
},
],
},
{
value: "quickcomposer.math.geometry.triangle",
label: "三角形计算",
icon: "change_history",
config: [
{
key: "a",
label: "边长a",
type: "numInput",
icon: "straighten",
width: 4,
min: 0,
},
{
key: "b",
label: "边长b",
type: "numInput",
icon: "straighten",
width: 4,
min: 0,
},
{
key: "c",
label: "边长c",
type: "numInput",
icon: "straighten",
width: 4,
min: 0,
},
],
},
],
},
{
value: "quickcomposer.math.trigonometry.sin",
label: "三角函数",
desc: "三角函数计算",
icon: "show_chart",
config: [
{
key: "angle",
label: "角度值",
type: "numInput",
icon: "rotate_right",
width: 12,
},
],
subCommands: [
{
value: "quickcomposer.math.trigonometry.sin",
label: "正弦(sin)",
icon: "show_chart",
},
{
value: "quickcomposer.math.trigonometry.cos",
label: "余弦(cos)",
icon: "show_chart",
},
{
value: "quickcomposer.math.trigonometry.tan",
label: "正切(tan)",
icon: "show_chart",
},
{
value: "quickcomposer.math.trigonometry.asin",
label: "反正弦(arcsin)",
icon: "show_chart",
},
{
value: "quickcomposer.math.trigonometry.acos",
label: "反余弦(arccos)",
icon: "show_chart",
},
{
value: "quickcomposer.math.trigonometry.atan",
label: "反正切(arctan)",
icon: "show_chart",
},
],
},
{
value: "quickcomposer.math.conversion.decimal",
label: "单位换算",
desc: "数学单位换算",
icon: "swap_horiz",
config: [
{
key: "value",
label: "数值",
type: "numInput",
icon: "pin",
width: 12,
},
{
key: "from",
label: "从",
type: "select",
icon: "input",
width: 6,
options: [
{ label: "十进制", value: "decimal" },
{ label: "二进制", value: "binary" },
{ label: "八进制", value: "octal" },
{ label: "十六进制", value: "hex" },
{ label: "度", value: "degrees" },
{ label: "弧度", value: "radians" },
],
},
{
key: "to",
label: "到",
type: "select",
icon: "output",
width: 6,
options: [
{ label: "十进制", value: "decimal" },
{ label: "二进制", value: "binary" },
{ label: "八进制", value: "octal" },
{ label: "十六进制", value: "hex" },
{ label: "度", value: "degrees" },
{ label: "弧度", value: "radians" },
],
},
],
outputVariable: "randomNumber",
saveOutput: true,
},
],
};