refactor(Navbar.vue): 退出样式调整,tagView添加关闭图标,引入字段全局方法。

This commit is contained in:
有来技术
2021-12-07 00:23:27 +08:00
parent a021f3e5e5
commit 2aee00631e
8 changed files with 141 additions and 149 deletions

View File

@@ -49,7 +49,7 @@
<template #default="scope">
<el-button
type="primary"
:icon="Edit"
:icon="Plus"
size="mini"
circle
plain
@@ -116,7 +116,7 @@
<script setup lang="ts">
import {list, detail, update, add, del} from '@/api/system/client'
import {Search, Plus, Edit, Refresh, Delete} from '@element-plus/icons'
import {onMounted, reactive, toRefs, ref, unref} from 'vue'
import {onMounted, reactive, getCurrentInstance, ref, unref} from 'vue'
import {ElForm, ElMessage,ElMessageBox} from "element-plus";
const state = reactive({
@@ -261,6 +261,12 @@ function handleDelete(row:any) {
onMounted(() => {
handleQuery()
// 全局方法调用
const { proxy } = getCurrentInstance();
proxy.$listDictItems('gender').then(response=>{
console.log('性别字典数据',response.data)
})
})
</script>

View File

@@ -262,7 +262,6 @@ import { defineComponent, onMounted, reactive, toRefs, unref, ref } from 'vue'
import {Search, Plus, Edit, Refresh, Delete} from '@element-plus/icons'
import { listDept, getDept, delDept, updateDept, addDept } from '@/api/system/dept'
import treeselect from '@/components/TreeSelect/Index.vue'
import { handleTree, parseTime } from '@/utils/ruoyi'
import { ElForm, ElMessage } from 'element-plus'
export default defineComponent({
@@ -395,7 +394,7 @@ export default defineComponent({
}
/** 查询部门下拉树结构 */
const getTreeselect = () => {
treeselect().then(response => {
treeselect().then(response=> {
dataMap.deptOptions = response?.data
dataMap.originOptions = flatten(response?.data) as any
})
@@ -417,7 +416,7 @@ export default defineComponent({
console.log(row.deptId)
dataMap.deptidfix = row.deptId
const result = await getDept(row.deptId)
const result = await getDept(row.deptId) as any
if (result?.code === 200) {
dataMap.formUpdata = result.data
dataMap.formVal.deptName = result.data.deptName
@@ -473,7 +472,7 @@ export default defineComponent({
}
/** 删除按钮操作 */
const handleDelete = async(row: any) => {
const result = await delDept(row.deptId)
const result = await delDept(row.deptId) as any
if (result?.code === 200) {
getList()
} else {
@@ -499,7 +498,7 @@ export default defineComponent({
// })
})
return { ...toRefs(dataMap),Search,Plus,Edit,Delete,Refresh,Delete, parseTime,dialogshow, getDeptId, flatten, getTreeselect, formDialog, statusFormat, queryForm, getList, normalizer, handleDelete, cancel, handleQuery, resetQuery, handleAdd, handleUpdate, submitForm }
return { ...toRefs(dataMap),Search,Plus,Edit,Delete,Refresh,dialogshow, getDeptId, flatten, getTreeselect, formDialog, statusFormat, queryForm, getList, normalizer, handleDelete, cancel, handleQuery, resetQuery, handleAdd, handleUpdate, submitForm }
}
})