feat: save files

This commit is contained in:
xiaojunnuo
2023-06-25 23:25:56 +08:00
parent 2851a33eb2
commit 671d273e2f
30 changed files with 253 additions and 222 deletions
+1
View File
@@ -63,6 +63,7 @@
"@rollup/plugin-commonjs": "^23.0.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/chai": "^4.3.4",
"@types/lodash": "^4.14.195",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.15",
"@typescript-eslint/eslint-plugin": "^5.46.1",
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

+6 -105
View File
@@ -1,106 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
width="210mm"
height="210mm"
viewBox="0 0 210 210"
version="1.1"
id="svg8"
>
<g id="layer1" style="display:inline">
<path
style="fill:#002255;stroke:none;stroke-width:0.625348"
d="M 35.587501,69.766667 V 59.766664 h 70.000109 69.99991 v 10.000003 9.999997 H 105.58761 35.587501 Z"
id="path12" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2"
width="32.244232"
height="20"
x="71.506088"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-8"
width="32.244232"
height="20"
x="107.42467"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-5-8"
width="32.244232"
height="20"
x="143.34325"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-4"
width="32.244232"
height="20"
x="71.506088"
y="129.82079" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-8-3"
width="32.244232"
height="20"
x="107.42467"
y="129.82079" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-5-8-2"
width="32.244232"
height="20"
x="143.34325"
y="129.82079" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-7"
width="32.244232"
height="20"
x="35.587502"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-4-0"
width="32.244232"
height="20"
x="35.587502"
y="129.82079" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-9"
width="32.244232"
height="20"
x="71.506088"
y="82.941666" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-8-37"
width="32.244232"
height="20"
x="107.42467"
y="82.941666" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-5-8-4"
width="32.244232"
height="20"
x="143.34325"
y="82.941666" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-7-1"
width="32.244232"
height="20"
x="35.587502"
y="82.941666" />
</g>
<polygon
points="75.3,174.4 103.1,103.6 79.8,103.6 112.6,41.3 156.4,41.3 129.9,90.5 148.1,90.5 "
fill="#f6cc00"
id="polygon276"
transform="matrix(1.0930933,0,0,0.99853202,-17.517362,-0.52287941)" />
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="500" height="500" viewBox="0 0 500.000000 500.000000"
>
<path d="M28.34 56.68h28.34V36.12H28.34a7.79 7.79 0 1 1 0-15.58h19.84v9.05h8.5V12H28.34a16.29 16.29 0 0 0 0 32.58h19.84v3.56H28.34a19.84 19.84 0 0 1 0-39.68h28.34V0H28.34a28.34 28.34 0 0 0 0 56.68z"
transform="translate(70, 76) scale(6,6)"
></path>
</svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 402 B

@@ -30,13 +30,19 @@ export const useResourceStore = defineStore({
currentAsidePath: ""
}),
getters: {
// @ts-ignore
getAsideMenus() {
// @ts-ignore
return this.asideMenus;
},
// @ts-ignore
getHeaderMenus() {
// @ts-ignore
return this.headerMenus;
},
// @ts-ignore
getFrameworkMenus() {
// @ts-ignore
return this.frameworkMenus;
}
},
@@ -54,17 +60,17 @@ export const useResourceStore = defineStore({
this.inited = true;
const showMenus = _.cloneDeep(frameworkMenus[0].children);
this.frameworkMenus = filterMenus(showMenus, (item) => {
this.frameworkMenus = filterMenus(showMenus, (item: any) => {
return item?.meta?.showOnHeader !== false;
});
this.fixedAsideMenus = findMenus(showMenus, (item) => {
this.fixedAsideMenus = findMenus(showMenus, (item: any) => {
return item?.meta?.fixedAside === true;
});
this.headerMenus = headerMenus;
this.setAsideMenu();
},
setAsideMenu(topMenu?) {
setAsideMenu(topMenu?: any) {
if (this.frameworkMenus.length === 0) {
return;
}
@@ -74,13 +80,13 @@ export const useResourceStore = defineStore({
const asideMenus = topMenu?.children || [];
this.asideMenus = [...this.fixedAsideMenus, ...asideMenus];
},
setAsideMenuByCurrentRoute(matched) {
setAsideMenuByCurrentRoute(matched: any) {
const menuHeader = this.frameworkMenus;
if (matched?.length <= 1) {
return;
}
function findFromTree(tree, find) {
function findFromTree(tree: any, find: any) {
const results: Array<any> = [];
for (const item of tree) {
if (find(item)) {
@@ -88,7 +94,7 @@ export const useResourceStore = defineStore({
return results;
}
if (item.children && item.children.length > 0) {
const found = findFromTree(item.children, find);
const found: any = findFromTree(item.children, find);
if (found) {
results.push(item);
return results.concat(found);
@@ -97,7 +103,7 @@ export const useResourceStore = defineStore({
}
}
const matchedPath = matched[1].path;
const _side = findFromTree(menuHeader, (menu) => menu.path === matchedPath);
const _side = findFromTree(menuHeader, (menu: any) => menu.path === matchedPath);
if (_side?.length > 0) {
if (this.currentAsidePath === _side[0]) {
return;
@@ -106,11 +112,11 @@ export const useResourceStore = defineStore({
this.setAsideMenu(_side[0]);
}
},
filterByPermission(permissions) {
filterByPermission(permissions: any) {
this.frameworkMenus = this.filterChildrenByPermission(this.frameworkMenus, permissions);
},
filterChildrenByPermission(list, permissions) {
const menus = list.filter((item) => {
filterChildrenByPermission(list: any, permissions: any) {
const menus = list.filter((item: any) => {
if (item?.meta?.permission) {
return permissions.includes(item.meta.permission);
}
@@ -51,7 +51,7 @@ export const useSettingStore = defineStore({
this.persistTheme();
// await changeTheme(this.theme.primaryColor);
},
async setPrimaryColor(color) {
async setPrimaryColor(color: any) {
const theme = this.theme;
theme.primaryColor = color;
await this.setTheme();
@@ -1,13 +1,13 @@
import _ from "lodash";
export default {
arrayToMap(array) {
arrayToMap(array: any) {
if (!array) {
return {};
}
if (!_.isArray(array)) {
return array;
}
const map = {};
const map: any = {};
for (const item of array) {
if (item.key) {
map[item.key] = item;
@@ -15,7 +15,7 @@ export default {
}
return map;
},
mapToArray(map) {
mapToArray(map: any) {
if (!map) {
return [];
}
@@ -57,6 +57,9 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
name: {
title: "名称",
type: "text",
search: {
show: true
},
form: {
rules: [{ required: true, message: "必填项" }]
}
@@ -2,6 +2,7 @@
<fs-page v-if="pipeline" class="page-pipeline-edit">
<template #header>
<div class="title">
<fs-button class="back" icon="ion:chevron-back-outline" @click="goBack"></fs-button>
<pi-editable v-model="pipeline.title" :hover-show="false" :disabled="!editMode"></pi-editable>
</div>
<div class="more">
@@ -588,6 +589,7 @@ export default defineComponent({
pipeline,
currentHistory,
histories,
goBack,
...useTaskRet,
...useStageRet,
...useTrigger(),
@@ -602,6 +604,10 @@ export default defineComponent({
.page-pipeline-edit {
.fs-page-header {
.title {
display: flex;
.back {
margin-right: 10px;
}
.pi-editable {
width: 300px;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

@@ -5,7 +5,7 @@
</div>
<p class="d2-page-cover__sub-title">让你的证书永不过期</p>
<div class="content">
<img src="./image/preview.png" class="preview_img" />
<img src="/images/preview.png" class="preview_img" />
</div>
<div class="footer_box">
<div class="left"></div>
@@ -76,6 +76,7 @@ export default defineComponent({
width: 80%;
.preview_img {
width: 100%;
border: 1px solid #eee;
}
}
@@ -40,7 +40,7 @@ export class UserController extends CrudController<UserService> {
const users = ret.data.records;
//获取roles
const userIds = users.map((item) => item.id);
const userIds = users.map(item => item.id);
const userRoles = await this.roleService.getByUserIds(userIds);
const userRolesMap = new Map();
for (const ur of userRoles) {
@@ -116,4 +116,3 @@ export class UserController extends CrudController<UserService> {
return this.ok(tree);
}
}
@@ -4,6 +4,7 @@ import { IEmailService } from '@certd/pipeline';
import nodemailer from 'nodemailer';
import { SettingsService } from '../../system/service/settings-service';
import type SMTPConnection from 'nodemailer/lib/smtp-connection';
import { logger } from '../../../utils/logger';
export type EmailConfig = {
host: string;
@@ -46,7 +47,7 @@ export class EmailService implements IEmailService {
text: email.content,
};
await transporter.sendMail(mailOptions);
console.log('sendEmail success', email);
logger.info('sendEmail complete: ', email);
}
async test(userId: number, receiver: string) {