Browse Source

选择用户联动效果实现v0.1

lwx_v27
liwenxuan 2 weeks ago
parent
commit
3c0f074b75
  1. 14
      src/components/DesignForm/public/expand/rangedUserTree.vue
  2. 15
      src/components/DesignForm/public/form/form.vue

14
src/components/DesignForm/public/expand/rangedUserTree.vue

@ -1,5 +1,5 @@
<script lang='ts' setup> <script lang='ts' setup>
import { computed, onMounted, onBeforeMount,nextTick } from 'vue' import { computed, onMounted, onBeforeMount,nextTick,inject } from 'vue'
import { criteriaForPeopleList } from '@/api/hr/org/type' import { criteriaForPeopleList } from '@/api/hr/org/type'
import request from '@/utils/request'; import request from '@/utils/request';
import { useAttrs } from 'vue' import { useAttrs } from 'vue'
@ -25,6 +25,7 @@ const treeData = ref([]) // 存储懒加载的数据
const isDataLoaded = ref(false) // const isDataLoaded = ref(false) //
const loading = ref(false) // const loading = ref(false) //
const treeSelectRef = ref() // const treeSelectRef = ref() //
const { location, updateLocation } = inject('location')
// //
const lastSelectedValue = ref(null) const lastSelectedValue = ref(null)
@ -56,6 +57,13 @@ const handleValueChange = (newValue) => {
value.value = newValue; value.value = newValue;
} }
} }
//, liwenxuan 2025-11-11 start
//,form
updateLocation(value.value,props.data.name)
//, liwenxuan 2025-11-11 end
} else { } else {
// //
if (newValue.length > 0) { if (newValue.length > 0) {
@ -123,7 +131,7 @@ onBeforeMount(() => {
}) })
onUnmounted(()=>{ onUnmounted(()=>{
console.log("onUnmounted") //console.log("onUnmounted")
}) })
// //
@ -269,7 +277,7 @@ function hasNodesInTree(tree) {
{{ loading ? '正在加载' : '无数据' }} {{ loading ? '正在加载' : '无数据' }}
</div> </div>
</template> </template>
</el-tree-select> </el-tree-select><!-- <button >{{ location }}</button> -->
</div> </div>
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>

15
src/components/DesignForm/public/form/form.vue

@ -1769,6 +1769,21 @@ function getTree1() {
}) })
} }
//, liwenxuan 2025-11-11 start
const location = ref('North Pole')
function updateLocation(currentValue: any,currentComp:any) {
location.value = currentValue+currentComp
}
provide('location', {
location,
updateLocation
})
//, liwenxuan 2025-11-11 end
function modifyTreeData(treeData, idList) { function modifyTreeData(treeData, idList) {
//console.log("modifyTreeDataMinimal "); //console.log("modifyTreeDataMinimal ");
let gkFlag = true let gkFlag = true

Loading…
Cancel
Save