mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-31 16:29:46 +08:00
✨ Feature: sync with picgo 2.4.0 beta 1
This commit is contained in:
29
src/renderer/components/ToolboxHandler.vue
Normal file
29
src/renderer/components/ToolboxHandler.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div class="toolbox-handler">
|
||||
<ElButton
|
||||
type="text"
|
||||
@click="() => props.handler(value)"
|
||||
>
|
||||
{{ props.handlerText }}
|
||||
</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { IToolboxItemCheckStatus } from '~/universal/types/enum'
|
||||
interface IProps {
|
||||
status: IToolboxItemCheckStatus
|
||||
value: any
|
||||
handlerText: string
|
||||
handler: (value: any) => void | Promise<void>
|
||||
}
|
||||
|
||||
const props = defineProps<IProps>()
|
||||
|
||||
</script>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ToolboxHandler'
|
||||
}
|
||||
</script>
|
||||
<style lang='stylus'>
|
||||
</style>
|
||||
48
src/renderer/components/ToolboxStatusIcon.vue
Normal file
48
src/renderer/components/ToolboxStatusIcon.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<el-icon
|
||||
:color="color"
|
||||
class="toolbox-status-icon"
|
||||
>
|
||||
<template v-if="props.status === IToolboxItemCheckStatus.SUCCESS">
|
||||
<SuccessFilled />
|
||||
</template>
|
||||
<template v-if="props.status === IToolboxItemCheckStatus.ERROR">
|
||||
<CircleCloseFilled />
|
||||
</template>
|
||||
<template v-if="props.status === IToolboxItemCheckStatus.LOADING">
|
||||
<Loading />
|
||||
</template>
|
||||
</el-icon>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { CircleCloseFilled, Loading, SuccessFilled } from '@element-plus/icons-vue'
|
||||
import { computed } from 'vue'
|
||||
import { IToolboxItemCheckStatus } from '~/universal/types/enum'
|
||||
interface IProps {
|
||||
status: IToolboxItemCheckStatus
|
||||
}
|
||||
|
||||
const props = defineProps<IProps>()
|
||||
|
||||
const color = computed(() => {
|
||||
switch (props.status) {
|
||||
case IToolboxItemCheckStatus.SUCCESS:
|
||||
return '#67C23A'
|
||||
case IToolboxItemCheckStatus.ERROR:
|
||||
return '#F56C6C'
|
||||
default:
|
||||
return '#909399'
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ToolboxStatusIcon'
|
||||
}
|
||||
</script>
|
||||
<style lang='stylus'>
|
||||
.toolbox-status-icon {
|
||||
margin-left: 8px;
|
||||
}
|
||||
</style>
|
||||
64
src/renderer/components/settings/CheckboxFormItem.vue
Normal file
64
src/renderer/components/settings/CheckboxFormItem.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<el-row align="middle">
|
||||
{{ props.settingText }}
|
||||
<template v-if="props.tooltips">
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
:content="props.tooltips"
|
||||
placement="right"
|
||||
>
|
||||
<el-icon style="margin-left: 4px">
|
||||
<QuestionFilled />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="value"
|
||||
:active-text="$T('SETTINGS_OPEN')"
|
||||
:inactive-text="$T('SETTINGS_CLOSE')"
|
||||
@change="handleChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { T as $T } from '@/i18n'
|
||||
import { saveConfig } from '@/utils/dataSender'
|
||||
import { ref, watch } from 'vue'
|
||||
import { QuestionFilled } from '@element-plus/icons-vue'
|
||||
|
||||
interface IProps {
|
||||
tooltips?: string
|
||||
settingProps: string
|
||||
settingText: string
|
||||
defaultValue: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<IProps>()
|
||||
|
||||
// to fix v-model blank bug
|
||||
watch(() => props.defaultValue, (v) => {
|
||||
value.value = v
|
||||
})
|
||||
|
||||
const value = ref<boolean>(props.defaultValue)
|
||||
const emit = defineEmits(['change'])
|
||||
|
||||
const handleChange = (val: ICheckBoxValueType) => {
|
||||
saveConfig(props.settingProps, val)
|
||||
emit('change', val)
|
||||
}
|
||||
|
||||
</script>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'CheckboxFormItem'
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang='stylus'>
|
||||
</style>
|
||||
Reference in New Issue
Block a user