修复自定义字典样式不生效问题

master
RuoYi 3 years ago
parent 1e08687175
commit 719e0853fa
  1. 4
      src/components/DictTag/index.vue
  2. 3
      src/main.js
  3. 2
      src/utils/dict.js

@ -6,7 +6,7 @@
v-if="item.elTagType == 'default' || item.elTagType == ''" v-if="item.elTagType == 'default' || item.elTagType == ''"
:key="item.value" :key="item.value"
:index="index" :index="index"
:class="item.elTagType" :class="item.elTagClass"
>{{ item.label }}</span> >{{ item.label }}</span>
<el-tag <el-tag
v-else v-else
@ -14,7 +14,7 @@
:key="item.value + ''" :key="item.value + ''"
:index="index" :index="index"
:type="item.elTagType === 'primary' ? '' : item.elTagType" :type="item.elTagType === 'primary' ? '' : item.elTagType"
:class="item.elTagType" :class="item.elTagClass"
>{{ item.label }}</el-tag> >{{ item.label }}</el-tag>
</template> </template>
</template> </template>

@ -25,7 +25,7 @@ import elementIcons from '@/components/SvgIcon/svgicon'
import './permission' // permission control import './permission' // permission control
import { useDict } from '@/utils/dict' import { useDict } from '@/utils/dict'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel } from '@/utils/ruoyi' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
// 分页组件 // 分页组件
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
@ -52,6 +52,7 @@ app.config.globalProperties.resetForm = resetForm
app.config.globalProperties.handleTree = handleTree app.config.globalProperties.handleTree = handleTree
app.config.globalProperties.addDateRange = addDateRange app.config.globalProperties.addDateRange = addDateRange
app.config.globalProperties.selectDictLabel = selectDictLabel app.config.globalProperties.selectDictLabel = selectDictLabel
app.config.globalProperties.selectDictLabels = selectDictLabels
// 全局组件挂载 // 全局组件挂载
app.component('DictTag', DictTag) app.component('DictTag', DictTag)

@ -9,7 +9,7 @@ export function useDict(...args) {
args.forEach((d, index) => { args.forEach((d, index) => {
res.value[d] = []; res.value[d] = [];
getDicts(d).then(resp => { getDicts(d).then(resp => {
res.value[d] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass })) res.value[d] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass }))
}) })
}) })
return toRefs(res.value); return toRefs(res.value);

Loading…
Cancel
Save