feat: 用户选择器 (#189)

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-11-06 11:48:36 +08:00
committed by GitHub
parent a454f2ab2d
commit 8479f69bdc
18 changed files with 46 additions and 20 deletions

View File

@ -71,6 +71,15 @@
:style="item.style"
clearable
filterable />
<na-user-select
v-else-if="item.type === 'user-select' && (!item.condition || item.condition())"
v-model="form[item.field[0]][item.field[1]]"
v-role="item.role || '*/*/*'"
:class="item.class"
:placeholder="item.placeholder"
:style="item.style"
clearable
filterable />
</template>
<el-badge :hidden="vue.query.dynamicFilter.filters.length === 0" :value="vue.query.dynamicFilter.filters.length">

View File

@ -46,7 +46,7 @@ export default {
immediate: true,
deep: true,
handler(n) {
this.user = n ?? {}
this.user = n
},
},
},

View File

@ -72,6 +72,7 @@ export default {
//最大化
setFullscreen() {
this.isFullscreen = !this.isFullscreen
this.$emit('onSetFullscreen', this.isFullscreen)
},
},
}

View File

@ -63,6 +63,9 @@ export default {
this.myChart = myChart
window.addEventListener('resize', () => myChart.resize())
},
resize(width) {
this.myChart.resize({ width: width || 'auto' })
},
},
}
</script>

View File

@ -505,7 +505,7 @@ export default {
this.loading = true
try {
await this.exportApi.post(this.getQueryParams())
this.$message.success(`数据已导出(上限2万条)`)
this.$message.success(`数据已导出(上限5万条)`)
} catch {}
this.loading = false
},

View File

@ -158,7 +158,9 @@ export default {
}
})
} else {
const setrow = this.tableData.filter((item) => item[this.defaultProps.value] === this.defaultValue[this.defaultProps.value])
const setrow = this.tableData.filter(
(item) => item[this.defaultProps.value] === (this.defaultValue ?? {})[this.defaultProps.value],
)
this.$refs.table.setCurrentRow(setrow[0])
}
this.$refs.table.setScrollTop(0)
@ -182,7 +184,7 @@ export default {
item.currentLabel = item.value[this.defaultProps.label]
})
} else {
this.$refs.select.states.selectedLabel = this.defaultValue[this.defaultProps.label]
this.$refs.select.states.selectedLabel = (this.defaultValue ?? {})[this.defaultProps.label]
}
})
},

View File

@ -118,7 +118,7 @@ export default {
/// 模块说明
moduleRemark: '',
/// 模块类型
type: 'SysComponent',
type: 'NetAdmin.SysComponent',
},
}
},

View File

@ -30,6 +30,15 @@
<div class="left-panel">
<na-search
:controls="[
{
type: 'remote-select',
field: ['dy', 'ownerId'],
api: $API.sys_user.query,
config: { props: { label: 'userName', value: 'id' } },
placeholder: '用户',
style: 'width:15rem',
condition: () => $GLOBAL.hasPermission('sys/log/operation/user'),
},
{
multiple: true,
type: 'select',