Merge pull request 'master' (#267) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/267
This commit is contained in:
@@ -66,15 +66,15 @@ const filterConfig = computed(() => {
|
||||
})
|
||||
|
||||
// 搜索功能表单元素默认值
|
||||
const setDefaultFormValues = () => {
|
||||
filterConfig.value.forEach(item => {
|
||||
form.value[item.prop] = item.props?.defaultValue || null
|
||||
})
|
||||
}
|
||||
// const setDefaultFormValues = () => {
|
||||
// filterConfig.value.forEach(item => {
|
||||
// form.value[item.prop] = item.props?.defaultValue || null
|
||||
// })
|
||||
// }
|
||||
|
||||
watchEffect(() => {
|
||||
if (filterConfig.value.length) {
|
||||
setDefaultFormValues()
|
||||
// setDefaultFormValues()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -86,7 +86,7 @@ const getValues = () => {
|
||||
//重置
|
||||
const handleReset = () => {
|
||||
form.value = {}
|
||||
setDefaultFormValues()
|
||||
// setDefaultFormValues()
|
||||
emits('search', form.value)
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,12 @@ const searchConfig = ref([
|
||||
|
||||
const tableIns = ref()
|
||||
|
||||
const auths = {
|
||||
edit: ['admin:user:edit'],
|
||||
del: ['admin:user:del'],
|
||||
add: ['admin:user:add'],
|
||||
}
|
||||
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
@@ -119,10 +125,10 @@ const tableConfig = reactive({
|
||||
currentRender: ({row, index}) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button type="primary" link onClick={()=>handleEdit(row)} v-perm={['admin:user:edit']}>编辑</el-button>
|
||||
<el-button type="primary" v-perm={auths.edit} link onClick={()=>handleEdit(row)}>编辑</el-button>
|
||||
{
|
||||
row.userType != 0 ?
|
||||
<el-button type="danger" link onClick={()=>handleDel(row)} v-perm={['admin:user:del']}>删除</el-button> :
|
||||
<el-button type="danger" v-perm={auths.del} link onClick={()=>handleDel(row)}>删除</el-button> :
|
||||
null
|
||||
}
|
||||
|
||||
@@ -148,6 +154,7 @@ const init = async () => {
|
||||
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
||||
const res = await getSubCompOpt()
|
||||
searchConfig.value.find(item=>item.prop == 'subCompanyId').props.data = res.data
|
||||
console.log("🚀 ~ init ~ searchConfig.value:", searchConfig.value)
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
Reference in New Issue
Block a user