|
|
@ -27,12 +27,12 @@
|
|
|
|
<a-row :gutter="24">
|
|
|
|
<a-row :gutter="24">
|
|
|
|
<a-col :span="12">
|
|
|
|
<a-col :span="12">
|
|
|
|
<a-form-item name="searchKey">
|
|
|
|
<a-form-item name="searchKey">
|
|
|
|
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入角色名"></a-input>
|
|
|
|
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入角色名" />
|
|
|
|
</a-form-item>
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="12">
|
|
|
|
<a-col :span="12">
|
|
|
|
<a-button type="primary" class="primarySele" @click="loadData(searchFormState)"> 查询 </a-button>
|
|
|
|
<a-button type="primary" class="primarySele" @click="loadData()"> 查询 </a-button>
|
|
|
|
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> 重置 </a-button>
|
|
|
|
<a-button class="snowy-buttom-left" @click="() => reset()"> 重置 </a-button>
|
|
|
|
</a-col>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
|
|
|
</a-form>
|
|
|
@ -134,7 +134,7 @@
|
|
|
|
// 选中表格的ref 名称
|
|
|
|
// 选中表格的ref 名称
|
|
|
|
const selectedTable = ref()
|
|
|
|
const selectedTable = ref()
|
|
|
|
const tableRecordNum = ref()
|
|
|
|
const tableRecordNum = ref()
|
|
|
|
let searchFormState = reactive({})
|
|
|
|
const searchFormState = ref({})
|
|
|
|
const searchFormRef = ref()
|
|
|
|
const searchFormRef = ref()
|
|
|
|
const cardLoading = ref(true)
|
|
|
|
const cardLoading = ref(true)
|
|
|
|
// 替换treeNode 中 title,key,children
|
|
|
|
// 替换treeNode 中 title,key,children
|
|
|
@ -229,16 +229,13 @@
|
|
|
|
const loadData = () => {
|
|
|
|
const loadData = () => {
|
|
|
|
// 如果不是用全局的,我们每次查询加上这个条件
|
|
|
|
// 如果不是用全局的,我们每次查询加上这个条件
|
|
|
|
if (!roleGlobal) {
|
|
|
|
if (!roleGlobal) {
|
|
|
|
searchFormState.category = 'ORG'
|
|
|
|
searchFormState.value.category = 'ORG'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
roleSelectorPlusApi.roleSelector(props.pageUrl, searchFormState).then((res) => {
|
|
|
|
roleSelectorPlusApi.roleSelector(props.pageUrl, searchFormState.value).then((res) => {
|
|
|
|
// 总共多少条
|
|
|
|
// 总共多少条
|
|
|
|
tableRecordNum.value = res.length
|
|
|
|
tableRecordNum.value = res.length
|
|
|
|
tableData.value = res
|
|
|
|
tableData.value = res
|
|
|
|
// 如果无查询条件,查询到已加载的
|
|
|
|
loadCheckedKey()
|
|
|
|
if (JSON.stringify(searchFormState) === '{}') {
|
|
|
|
|
|
|
|
loadCheckedKey()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 加载已选中的
|
|
|
|
// 加载已选中的
|
|
|
@ -302,15 +299,15 @@
|
|
|
|
const treeSelect = (selectedKeys) => {
|
|
|
|
const treeSelect = (selectedKeys) => {
|
|
|
|
if (selectedKeys.length > 0) {
|
|
|
|
if (selectedKeys.length > 0) {
|
|
|
|
if (selectedKeys[0] === 'GLOBAL') {
|
|
|
|
if (selectedKeys[0] === 'GLOBAL') {
|
|
|
|
searchFormState.category = selectedKeys[0]
|
|
|
|
searchFormState.value.category = selectedKeys[0]
|
|
|
|
delete searchFormState.orgId
|
|
|
|
delete searchFormState.value.orgId
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
searchFormState.orgId = selectedKeys.toString()
|
|
|
|
searchFormState.value.orgId = selectedKeys.toString()
|
|
|
|
delete searchFormState.category
|
|
|
|
delete searchFormState.value.category
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
delete searchFormState.category
|
|
|
|
delete searchFormState.value.category
|
|
|
|
delete searchFormState.orgId
|
|
|
|
delete searchFormState.value.orgId
|
|
|
|
}
|
|
|
|
}
|
|
|
|
loadData()
|
|
|
|
loadData()
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -332,8 +329,15 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
handleClose()
|
|
|
|
handleClose()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 重置
|
|
|
|
|
|
|
|
const reset = () => {
|
|
|
|
|
|
|
|
delete searchFormState.value.searchKey
|
|
|
|
|
|
|
|
loadData()
|
|
|
|
|
|
|
|
}
|
|
|
|
const handleClose = () => {
|
|
|
|
const handleClose = () => {
|
|
|
|
searchFormState = reactive({})
|
|
|
|
searchFormState.value = {}
|
|
|
|
|
|
|
|
tableRecordNum.value = 0
|
|
|
|
|
|
|
|
tableData.value = []
|
|
|
|
visible = false
|
|
|
|
visible = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|