feat(dict.ts):添加字典接口和移除全局获取字典项的ts警告;
This commit is contained in:
56
src/views/system/dict/index.vue
Normal file
56
src/views/system/dict/index.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix" slot="header">
|
||||
<span>字典列表</span>
|
||||
</div>
|
||||
<!-- 字典列表子组件 -->
|
||||
<dict @dictClick="dictClick" @resetItem="resetItem" ref="dict"></dict>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix" slot="header">
|
||||
<span>{{ dict.name }}数据项</span>
|
||||
</div>
|
||||
<!-- 字典数据项子组件 -->
|
||||
<dict-item ref="dictItem"></dict-item>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dict from './components/Dict.vue'
|
||||
import DictItem from './components/DictItem.vue'
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
components: {Dict, DictItem},
|
||||
data() {
|
||||
return {
|
||||
dict: {
|
||||
name: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dictClick(row) {
|
||||
this.dict.name = row.name ? '【' + row.name + '】' : undefined
|
||||
this.$refs.dictItem.dictClick(row)
|
||||
},
|
||||
resetItem() {
|
||||
this.dict.name = undefined
|
||||
this.$refs.dictItem.dictClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user