feat: 完成user新增编辑详情接口对接

This commit is contained in:
lilinyuan
2024-03-26 16:31:16 +08:00
parent f782587b79
commit 462c2e2110
3 changed files with 297 additions and 9 deletions

View File

@@ -7,9 +7,11 @@
import Tag from '@/components/Tag.vue'
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import { useAuthStore } from '@/stores/userstore.js'
import { getDeptOpt, getSubCompOpt } from '../../../api/user/user';
import { getDeptOpt, getSubCompOpt } from '../../../api/user/user.js';
import { ElMessageBox } from 'element-plus';
const authStore = useAuthStore()
const router = useRouter()
const searchConfig = ref([
{
@@ -117,15 +119,18 @@ const tableConfig = reactive({
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link>编辑</el-button>
<el-button type="danger" link>删除</el-button>
<el-button type="primary" link onClick={()=>handleEdit(row)}>编辑</el-button>
<el-button type="danger" link onClick={()=>handleDel(row)}>删除</el-button>
</div>
)
}
}
],
api: '/admin/mosr/user',
params: {}
params: {},
btns: [
{name: '新增', type: 'primary', auth: ['admin:user:add'], key: 'add'}
]
})
const init = async () => {
@@ -147,7 +152,40 @@ const search = (val) => {
tableIns.value.refresh()
}
const headBtnClick = (key) => {}
const handleAdd = () => {
router.push({
path: '/system/useradd',
query: {
isAdd: 1
}
})
}
const handleEdit = (row) => {
router.push({
path: '/system/useredit',
query: {
id: row.userId
}
})
}
const handleDel = (row) => {
ElMessageBox.confirm('确定删除该条数据吗?', '确定删除', {
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(async res => {
// const { code } = await
}).catch(()=>{})
}
const headBtnClick = (key) => {
switch(key) {
case 'add': handleAdd()
break;
}
}
</script>
<style lang="scss" scoped>