!15 修复了一些小问题

Merge pull request !15 from puhui999/master
pull/20/head
芋道源码 2023-03-07 12:13:16 +00:00 committed by Gitee
commit e2895bafa5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 14 additions and 10 deletions

View File

@ -33,12 +33,15 @@ export default defineComponent({
if (!props.type) { if (!props.type) {
return null return null
} }
if (!props.value) { //
if (!props.value && props.value !== 0) {
return null return null
} }
getDictObj(props.type, props.value.toString()) getDictObj(props.type, props.value.toString())
//
return ( return (
<ElTag <ElTag
style={dictData.value?.cssClass ? 'color: #fff' : ''}
type={dictData.value?.colorType} type={dictData.value?.colorType}
color={ color={
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass) dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)

View File

@ -30,7 +30,7 @@ const removeStyles = () => {
// //
const targetelement = 'style' const targetelement = 'style'
const targetattr = 'id' const targetattr = 'id'
let allsuspects = document.getElementsByTagName(targetelement) const allsuspects = document.getElementsByTagName(targetelement)
for (let i = allsuspects.length; i >= 0; i--) { for (let i = allsuspects.length; i >= 0; i--) {
if ( if (
allsuspects[i] && allsuspects[i] &&
@ -43,8 +43,8 @@ const removeStyles = () => {
} }
} }
const reImport = () => { const reImport = () => {
let head = document.getElementsByTagName('head')[0] const head = document.getElementsByTagName('head')[0]
let style = document.createElement('style') const style = document.createElement('style')
style.innerText = styleCss style.innerText = styleCss
style.id = 'cssTheme' style.id = 'cssTheme'
head.appendChild(style) head.appendChild(style)
@ -52,10 +52,10 @@ const reImport = () => {
watch( watch(
() => appStore.getIsDark, () => appStore.getIsDark,
() => { () => {
if (appStore.getIsDark == true) { if (appStore.getIsDark) {
reImport() reImport()
} }
if (appStore.getIsDark == false) { if (!appStore.getIsDark) {
removeStyles() removeStyles()
} }
}, },

View File

@ -11,10 +11,10 @@
> >
<el-select v-model="bindMessageId" @change="updateTaskMessage"> <el-select v-model="bindMessageId" @change="updateTaskMessage">
<el-option <el-option
v-for="item in Object.keys(messageMap)" v-for="key in Object.keys(messageMap)"
:value="item" :value="key"
:label="messageMap[item]" :label="messageMap[key]"
:key="item" :key="key"
/> />
</el-select> </el-select>
<XButton <XButton

1
types/global.d.ts vendored
View File

@ -1,3 +1,4 @@
export {}
declare global { declare global {
declare interface Fn<T = any> { declare interface Fn<T = any> {
(...arg: T[]): T (...arg: T[]): T