DisposalStep1.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div style="position: relative;">
  3. <span style="position: absolute;top: 1.5rem;left: 32rem;color: red;">处置方式:{{ disposalWay }}</span>
  4. <InfoWindow
  5. v-if="disposalId" ref="infoWindowRef" :info-window-no="infoWindowNo"
  6. :where-clause-source="whereClauseSource" :multiple="true" :is-search-widget="true"
  7. />
  8. </div>
  9. </template>
  10. <script setup>
  11. import { queryById } from './api.js';
  12. import { message } from 'ant-design-vue';
  13. import Common from '../../common/Common.js';
  14. import { ref, defineProps, defineExpose, watch } from 'vue';
  15. const props = defineProps({
  16. disposalId: {
  17. type: String,
  18. default: null,
  19. },
  20. });
  21. const disposalWay = ref('');
  22. const infoWindowRef = ref();
  23. const whereClauseSource = ref('');
  24. const infoWindowNo = ref('20241101_160846');
  25. // 获取所选资产
  26. const getSelected = () => {
  27. const modelDatas = infoWindowRef.value.getSelectedModelDatas();
  28. const assetIds = modelDatas.map(item => {
  29. return item.id;
  30. });
  31. return assetIds;
  32. };
  33. // 查询资产类型
  34. const queryAsset = () => {
  35. queryById(props.disposalId).then(
  36. success => {
  37. if (success.errorCode === 0) {
  38. disposalWay.value = success.data.disposalWay;
  39. } else {
  40. message.warning(success.errorMessage);
  41. }
  42. },
  43. error => {
  44. Common.processException(error);
  45. },
  46. );
  47. };
  48. watch(() => props.disposalId, newValue => {
  49. if (newValue) {
  50. queryAsset();
  51. whereClauseSource.value = { customWhere: '(isApproved is null or isApproved = 0) and adpa.id = ' + newValue };
  52. }
  53. }, { immediate: true });
  54. defineExpose({
  55. getSelected,
  56. });
  57. </script>
  58. <style scoped>
  59. :deep(.ant-page-header-heading) {
  60. display: none !important;
  61. }
  62. :deep(.m-segmented) {
  63. display: none !important;
  64. }
  65. :deep(.flex-header) {
  66. flex: 0 0 40px !important;
  67. }
  68. </style>