【更新】更新前端机构、职位、角色、用户 选择器的内部逻辑

pull/109/MERGE
小诺 2 years ago committed by 俞宝山
parent ac84f7376a
commit 6156b0755e

@ -27,12 +27,12 @@
<a-row :gutter="24">
<a-col :span="12">
<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-col>
<a-col :span="12">
<a-button type="primary" class="primarySele" @click="loadData(searchFormState)"> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> 重置 </a-button>
<a-button type="primary" class="primarySele" @click="loadData()"> </a-button>
<a-button class="snowy-buttom-left" @click="() => reset()"> 重置 </a-button>
</a-col>
</a-row>
</a-form>
@ -134,7 +134,7 @@
// ref
const selectedTable = ref()
const tableRecordNum = ref()
let searchFormState = reactive({})
const searchFormState = ref({})
const searchFormRef = ref()
const cardLoading = ref(true)
// treeNode title,key,children
@ -184,14 +184,11 @@
}
//
const loadData = () => {
orgSelectorPlusApi.orgSelector(props.pageUrl, searchFormState).then((res) => {
orgSelectorPlusApi.orgSelector(props.pageUrl, searchFormState.value).then((res) => {
//
tableRecordNum.value = res.length
tableData.value = res
//
if (JSON.stringify(searchFormState) === '{}') {
loadCheckedKey()
}
loadCheckedKey()
})
}
//
@ -254,9 +251,9 @@
//
const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) {
searchFormState.orgId = selectedKeys.toString()
searchFormState.value.orgId = selectedKeys.toString()
} else {
delete searchFormState.orgId
delete searchFormState.value.orgId
}
loadData()
}
@ -279,8 +276,15 @@
}
handleClose()
}
//
const reset = () => {
delete searchFormState.value.searchKey
loadData()
}
const handleClose = () => {
searchFormState = reactive({})
searchFormState.value = {}
tableRecordNum.value = 0
tableData.value = []
visible = false
}

@ -27,12 +27,12 @@
<a-row :gutter="24">
<a-col :span="12">
<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-col>
<a-col :span="12">
<a-button type="primary" class="primarySele" @click="loadData(searchFormState)"> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> 重置 </a-button>
<a-button type="primary" class="primarySele" @click="loadData()"> </a-button>
<a-button class="snowy-buttom-left" @click="() => reset()"> 重置 </a-button>
</a-col>
</a-row>
</a-form>
@ -134,7 +134,7 @@
// ref
const selectedTable = ref()
const tableRecordNum = ref()
let searchFormState = reactive({})
const searchFormState = ref({})
const searchFormRef = ref()
const cardLoading = ref(true)
// treeNode title,key,children
@ -184,14 +184,11 @@
}
//
const loadData = () => {
posSelectorPlusApi.posSelector(props.pageUrl, searchFormState).then((res) => {
posSelectorPlusApi.posSelector(props.pageUrl, searchFormState.value).then((res) => {
//
tableRecordNum.value = res.length
tableData.value = res
//
if (JSON.stringify(searchFormState) === '{}') {
loadCheckedKey()
}
loadCheckedKey()
})
}
//
@ -254,9 +251,9 @@
//
const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) {
searchFormState.orgId = selectedKeys.toString()
searchFormState.value.orgId = selectedKeys.toString()
} else {
delete searchFormState.orgId
delete searchFormState.value.orgId
}
loadData()
}
@ -279,8 +276,15 @@
}
handleClose()
}
//
const reset = () => {
delete searchFormState.value.searchKey
loadData()
}
const handleClose = () => {
searchFormState = reactive({})
searchFormState.value = {}
tableRecordNum.value = 0
tableData.value = []
visible = false
}

@ -27,12 +27,12 @@
<a-row :gutter="24">
<a-col :span="12">
<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-col>
<a-col :span="12">
<a-button type="primary" class="primarySele" @click="loadData(searchFormState)"> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> 重置 </a-button>
<a-button type="primary" class="primarySele" @click="loadData()"> </a-button>
<a-button class="snowy-buttom-left" @click="() => reset()"> 重置 </a-button>
</a-col>
</a-row>
</a-form>
@ -134,7 +134,7 @@
// ref
const selectedTable = ref()
const tableRecordNum = ref()
let searchFormState = reactive({})
const searchFormState = ref({})
const searchFormRef = ref()
const cardLoading = ref(true)
// treeNode title,key,children
@ -229,16 +229,13 @@
const loadData = () => {
//
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
tableData.value = res
//
if (JSON.stringify(searchFormState) === '{}') {
loadCheckedKey()
}
loadCheckedKey()
})
}
//
@ -302,15 +299,15 @@
const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) {
if (selectedKeys[0] === 'GLOBAL') {
searchFormState.category = selectedKeys[0]
delete searchFormState.orgId
searchFormState.value.category = selectedKeys[0]
delete searchFormState.value.orgId
} else {
searchFormState.orgId = selectedKeys.toString()
delete searchFormState.category
searchFormState.value.orgId = selectedKeys.toString()
delete searchFormState.value.category
}
} else {
delete searchFormState.category
delete searchFormState.orgId
delete searchFormState.value.category
delete searchFormState.value.orgId
}
loadData()
}
@ -332,8 +329,15 @@
}
handleClose()
}
//
const reset = () => {
delete searchFormState.value.searchKey
loadData()
}
const handleClose = () => {
searchFormState = reactive({})
searchFormState.value = {}
tableRecordNum.value = 0
tableData.value = []
visible = false
}

@ -27,12 +27,12 @@
<a-row :gutter="24">
<a-col :span="12">
<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-col>
<a-col :span="12">
<a-button type="primary" class="primarySele" @click="loadData(searchFormState)"> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> 重置 </a-button>
<a-button type="primary" class="primarySele" @click="loadData()"> </a-button>
<a-button class="snowy-buttom-left" @click="reset()"> </a-button>
</a-col>
</a-row>
</a-form>
@ -134,7 +134,7 @@
// ref
const selectedTable = ref()
const tableRecordNum = ref()
let searchFormState = reactive({})
const searchFormState = ref({})
const searchFormRef = ref()
const cardLoading = ref(true)
// treeNode title,key,children
@ -184,14 +184,11 @@
}
//
const loadData = () => {
userSelectorPlusApi.userSelector(props.pageUrl, searchFormState).then((res) => {
userSelectorPlusApi.userSelector(props.pageUrl, searchFormState.value).then((res) => {
//
tableRecordNum.value = res.length
tableData.value = res
//
if (JSON.stringify(searchFormState) === '{}') {
loadCheckedKey()
}
loadCheckedKey()
})
}
//
@ -254,9 +251,9 @@
//
const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) {
searchFormState.orgId = selectedKeys.toString()
searchFormState.value.orgId = selectedKeys.toString()
} else {
delete searchFormState.orgId
delete searchFormState.value.orgId
}
loadData()
}
@ -279,8 +276,15 @@
}
handleClose()
}
//
const reset = () => {
delete searchFormState.value.searchKey
loadData()
}
const handleClose = () => {
searchFormState = reactive({})
searchFormState.value = {}
tableRecordNum.value = 0
tableData.value = []
visible = false
}

Loading…
Cancel
Save