删除无用代码

This commit is contained in:
jasminexz 2023-09-08 17:32:52 +08:00
parent 1386387120
commit 754764b4eb
15 changed files with 13 additions and 194 deletions

View File

@ -40,6 +40,8 @@ declare module 'vue' {
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']

View File

@ -6,4 +6,11 @@ import type { R } from "./request";
*/
export const metricLineApi = (params?: object): Promise<R<any>> => {
return rq.get<R<any>>("/sentinel/metric/line", { params });
};
/**
*
*/
export const resourcesApi = (params?: object): Promise<R<any>> => {
return rq.get<R<any>>("/sentinel/resources", { params });
};

View File

@ -141,8 +141,4 @@ function getPadding(len: number): string {
function repeatStr(str: string, count: number): string {
return count > 0 ? Array(count + 1).join(str) : '';
}
// console.log(formartMarkdownTable(`|张三|列22222|
// |---|---|
// |1|2|`))
}

View File

@ -445,7 +445,6 @@ const saveDoc = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate((valid, _fields) => {
if (valid) {
console.log(docForm.value.type, curDocDialogType, docForm);
saveLoading.value = true
// then
const handleResp = (_: any) => {

View File

@ -53,7 +53,6 @@ const getArticleQrCode = (name: string, id: number) => {
articleQrCodeApi({ id: id }).then(resp => {
let blob = new Blob([resp.data], { type: "image/png" })
qrcodeImg.value = URL.createObjectURL(blob)
console.log(qrcodeImg.value);
qrcodeUrl.value = resp.headers.get('Article-Url')
}).finally(() => {
isLoading.value = false

View File

@ -307,7 +307,7 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { computed, onUnmounted, ref } from 'vue'
import { secondsToDatetime, formateMs } from '@renderer/assets/utils/util';
import { ElNotification } from 'element-plus';
@ -319,9 +319,6 @@ const emits = defineEmits([
'table', 'image', 'link'
])
onMounted(() => {
})
onUnmounted(() => {
stop()
})

View File

@ -206,20 +206,6 @@ export class CmWrapper {
drop(a: DragEvent) {
uploadFileCallback(a)
return
// let data: DataTransfer | null = a.dataTransfer
// if (data?.files.length && data?.files.length > 0 && window.FileReader) {
// // uploadPicture(data?.files)
// this._editor.state.doc.toString()
// console.log("🚀 ~ file: codemirror.ts:192 ~ CmWrapper ~ drop ~ this._editor.state.doc.toString():", this._editor.state.doc.toString())
// // let file: File = data?.files[0]
// // let reader = new FileReader();
// // reader.addEventListener('load', () => {
// // console.log(reader.result);
// // })
// // reader.readAsDataURL(file);
// }
}
})
]
@ -402,9 +388,6 @@ export class CmWrapper {
const suffixTo: number = range.to + suffixLen
const suffix = this.sliceDoc(editor, suffixFrom, suffixTo)
console.log(prefix, suffix);
// 判断是取消还是添加, 如果被选中的文本前后已经是 target 字符, 则删除前后字符
if (prefix == prefixTarget && suffix == suffixTarget) {
return {

View File

@ -116,7 +116,6 @@ const handlePrintScreenUpload = (isShow?: boolean) => {
*/
const selectCheck = (treeNode: DocTree, checked: any) => {
docTreeChecked.value = treeNode
console.log(checked.checkedKeys);
if (isEmpty(checked.checkedKeys)) {
pid.value = -1
docTreeChecked.value = docTreeData.value[0]

View File

@ -45,7 +45,7 @@ const updPwdForm = ref<UpdPwdForm>({
})
const rules = ref<FormRules<UpdPwdForm>>({
password: [{ required: true, message: '请填写旧密码', trigger: 'blur' }],
newPassword: [{ required: true, message: '请填写密码', trigger: 'blur' }],
newPassword: [{ required: true, message: '请填写密码', trigger: 'blur' }],
confirmPassword: [{ required: true, message: '请填写确认密码', trigger: 'blur' }],
})

View File

@ -39,8 +39,6 @@ const saveNote = () => {
Notify.info('不能保存空的便签')
return
}
console.log(noteContent.value)
noteAddApi({ content: noteContent.value }).then(_resp => {
emits('saved')
noteContent.value = ''

View File

@ -63,7 +63,6 @@ const getNoteList = () => {
}
const saveToStorage = (content: string) => {
console.log(TempTextareaKey);
Local.set(TempTextareaKey, content)
}

View File

@ -288,7 +288,6 @@ const articleNamesToArray = (names: string): string[] => {
return []
}
let result = names.split(',').filter(name => isNotBlank(name))
console.log(result)
return result
}

View File

@ -204,7 +204,6 @@ const formatStorePath = () => {
*/
const saveLoading = ref<boolean>(false)
const saveDoc = () => {
console.log(docForm.value.type, curDocDialogType, docForm);
saveLoading.value = true
// then
const handleResp = (_: any) => {

View File

@ -151,8 +151,6 @@ const useInnerImg = (img: string) => {
}
const useOutsideImg = (img: string) => {
console.log(img);
dailyForm.value.imgPreview = img
}

View File

@ -96,160 +96,4 @@ export const formatJson = (msg: string, customRetract?: string): string => {
}
}
return jsonStr;
};
export const getSolar = (): string => {
let today = new Date();
let solar = getSolarTermByYearMonthDay(today.getMonth() + 1, today.getDate());
// console.log('当前日期[%s-%s]的最后一次节气: %s', today.getMonth() + 1, today.getDate(), solar);
return solar;
}
export const getSolarTermByYearMonthDay = (month: number, day: any): string => {
// return '冬至';
if (month == 1) {
if (day >= 5) return "小寒";
if (day >= 19) return "大寒"
}
if (month == 2) {
if (day < 3) return "大寒";
if (day >= 3) return "立春";
if (day >= 18) return "雨水"
}
if (month == 3) {
if (day < 5) return "雨水";
if (day >= 5) return "惊蛰";
if (day >= 20) return "春分"
}
if (month == 4) {
if (day < 4) return "春分";
if (day >= 4) return "清明";
if (day >= 19) return "谷雨"
}
if (month == 5) {
if (day < 5) return "谷雨";
if (day >= 5) return "立夏";
if (day >= 20) return "小满"
}
if (month == 6) {
if (day < 5) return "小满";
if (day >= 5) return "芒种";
if (day >= 21) return "夏至"
}
if (month == 7) {
if (day < 7) return "夏至";
if (day >= 7) return "小暑";
if (day >= 22) return "大暑"
}
if (month == 8) {
if (day < 6) return "大暑";
if (day >= 6) return "立秋";
if (day >= 22) return "处暑"
}
if (month == 9) {
if (day < 7) return "处暑";
if (day >= 7) return "白露";
if (day >= 22) return "秋分"
}
if (month == 10) {
if (day < 7) return "秋分";
if (day >= 7) return "寒露";
if (day >= 23) return "霜降"
}
if (month == 11) {
if (day < 7) return "霜降";
if (day >= 7) return "立冬";
if (day >= 22) return "小雪"
}
if (month == 12) {
if (day < 5) return "小雪";
if (day >= 5) return "大雪";
if (day >= 21) return "冬至"
}
return '';
}
export interface SolarColor {
firstColor: string;
firstColorFlip: string;
secondColor: string;
secondColorFlip: string,
}
export const getSolorColor = (): SolarColor => {
const currentSolar = getSolar();
if (currentSolar == '小寒') {
return { firstColor: '#283233', secondColor: '#973131', firstColorFlip: '#42494a', secondColorFlip: '#a65050' }
}
if (currentSolar == '大寒') {
return { firstColor: '#c6c0ba', secondColor: '#576975', firstColorFlip: '#b5b0aa', secondColorFlip: '#4c5c66' }
}
if (currentSolar == '立春') {
return { firstColor: '#f6da8c', secondColor: '#c4beb9', firstColorFlip: '#e6cb83', secondColorFlip: '#ada8a4' }
}
if (currentSolar == '雨水') {
return { firstColor: '#ccaf9b', secondColor: '#463936', firstColorFlip: '#b59b8a', secondColorFlip: '#a68e7e' }
}
if (currentSolar == '惊蛰') {
return { firstColor: '#c9c1ba', secondColor: '#508e69', firstColorFlip: '#a9c2b3', secondColorFlip: '#c9c1ba' }
}
if (currentSolar == '春分') {
return { firstColor: '#c3bfba', secondColor: '#f5d791', firstColorFlip: '#d9c793', secondColorFlip: '#d6d2cc' }
}
if (currentSolar == '清明') {
return { firstColor: '#ded2c3', secondColor: '#b7bc4b', firstColorFlip: '#c1c2a1', secondColorFlip: '#f4e7d7' }
}
if (currentSolar == '谷雨') {
return { firstColor: '#d3e0ea', secondColor: '#529e43', firstColorFlip: '#b6d4b0', secondColorFlip: '#d3e0ea' }
}
if (currentSolar == '立夏') {
return { firstColor: '#efd58e', secondColor: '#6cc1ff', firstColorFlip: '#f7e7ba', secondColorFlip: '#83cbff' }
}
if (currentSolar == '小满') {
return { firstColor: '#d19c46', secondColor: '#53915a', firstColorFlip: '#edaf54', secondColorFlip: '#50a356' }
}
if (currentSolar == '芒种') {
return { firstColor: '#87c0f9', secondColor: '#b08738', firstColorFlip: '#7294ad', secondColorFlip: '#edaf54' }
}
if (currentSolar == '夏至') {
return { firstColor: '#dfeaf2', secondColor: '#8ed2b1', firstColorFlip: '#a2cfe5', secondColorFlip: '#b8d3da' }
}
if (currentSolar == '小暑') {
return { firstColor: '#60d7a0', secondColor: '#83bd6f', firstColorFlip: '#83bd6f', secondColorFlip: '#65ab63' }
}
if (currentSolar == '大暑') {
return { firstColor: '#05aae4', secondColor: '#9de7ed', firstColorFlip: '#3c9ee8', secondColorFlip: '#96e0e2' }
}
if (currentSolar == '立秋') {
return { firstColor: '#dbbc30', secondColor: '#a08373', firstColorFlip: '#fcd42b', secondColorFlip: '#885629' }
}
if (currentSolar == '处暑') {
return { firstColor: '#b6e2e3', secondColor: '#8ed2af', firstColorFlip: '#8dd0d1', secondColorFlip: '#35b578' }
}
if (currentSolar == '白露') {
return { firstColor: '#bdd8a5', secondColor: '#406b5e', firstColorFlip: '#9dd4bc', secondColorFlip: '#274238' }
}
if (currentSolar == '秋分') {
return { firstColor: '#f0ce8f', secondColor: '#c1ac9a', firstColorFlip: '#d9ba81', secondColorFlip: '#ab9888' }
}
if (currentSolar == '寒露') {
return { firstColor: '#edcbae', secondColor: '#c3beba', firstColorFlip: '#d6b79d', secondColorFlip: '#b0aba8' }
}
if (currentSolar == '霜降') {
return { firstColor: '#f2e6e2', secondColor: '#997b50', firstColorFlip: '#ded3cf', secondColorFlip: '#826944' }
}
if (currentSolar == '立冬') {
return { firstColor: '#3d6989', secondColor: '#abc9df', firstColorFlip: '#335873', secondColorFlip: '#8fa8ba' }
}
if (currentSolar == '小雪') {
return { firstColor: '#c3dcf4', secondColor: '#b0cced', firstColorFlip: '#b1c8de', secondColorFlip: '#9bb4d1' }
}
if (currentSolar == '大雪') {
return { firstColor: '#afc8e7', secondColor: '#84a8d2', firstColorFlip: '#a0b7d4', secondColorFlip: '#7797bd' }
}
if (currentSolar == '冬至') {
return { firstColor: '#ede1cc', secondColor: '#a3c1ce', firstColorFlip: '#d4c9b6', secondColorFlip: '#8da7b3' }
}
return { firstColor: '#ede1cc', secondColor: '#a3c1ce', firstColorFlip: '#d4c9b6', secondColorFlip: '#8da7b3' }
}
};