| | |
| | | <template #right> |
| | | <u-upload |
| | | @afterRead="afterReadImage" |
| | | @delete="deletePic" |
| | | name="6" |
| | | multiple |
| | | :maxCount="1" |
| | |
| | | @cancel="showType = false" |
| | | /> |
| | | <!-- 飞行器厂商 --> |
| | | <u-picker |
| | | <!-- <u-picker |
| | | :show="showManufacturer" |
| | | :columns="[manufacturerList]" |
| | | keyName="label" |
| | | @confirm="onPickerConfirmManufacturer" |
| | | @cancel="showManufacturer = false" |
| | | /> |
| | | /> --> |
| | | <u-popup |
| | | :show="showManufacturer" |
| | | mode="bottom" |
| | | round="20" |
| | | @close="showManufacturer = false" |
| | | > |
| | | <scroll-view scroll-y> |
| | | <view class="select-header"> |
| | | <u-search |
| | | v-model="searchFacturerName" |
| | | placeholder="请输入飞行器厂商名称关键字" |
| | | @custom="getManufacturerInfoApi" |
| | | ></u-search> |
| | | </view> |
| | | <view class="select-content"> |
| | | <!-- 加载状态 --> |
| | | <view v-if="loadingManufacturer" class="loading-container"> |
| | | <u-loading-icon></u-loading-icon> |
| | | </view> |
| | | <u-radio-group |
| | | v-if="!loadingManufacturer" |
| | | v-model="formParams.spacecraftId" |
| | | placement="column" |
| | | @change="radioChange" |
| | | > |
| | | <u-radio |
| | | :customStyle="{marginBottom: '8px'}" |
| | | v-for="(item, index) in manufacturerList" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :name="item.value" |
| | | > |
| | | </u-radio> |
| | | </u-radio-group> |
| | | </view> |
| | | </scroll-view> |
| | | </u-popup> |
| | | <u-picker |
| | | :show="showIsModified" |
| | | :columns="[actionsModified]" |
| | |
| | | ], |
| | | |
| | | }) |
| | | |
| | | // 搜索飞行器厂商 |
| | | const searchFacturerName = ref('') |
| | | |
| | | // 是否改装 |
| | | const actionsModified = ref([ |
| | | { |
| | |
| | | // 飞行器厂商 |
| | | const showManufacturer = ref(false); |
| | | const manufacturerList = ref([]) |
| | | const loadingManufacturer = ref(false) |
| | | // 选择飞行器厂商 |
| | | const onPickerConfirmManufacturer = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.manufacturer = selected.value |
| | | formParams.value.manufacturerText = selected.label |
| | | showManufacturer.value = false |
| | | } |
| | | function radioChange(value) { |
| | | formParams.value.manufacturer = value |
| | | formParams.value.manufacturerText = manufacturerList.value.find(item => item.value === value)?.label || '' |
| | | } |
| | | // 飞行器类型 |
| | | const showType = ref(false); |
| | |
| | | // } |
| | | // 获取无人机厂商 |
| | | function getManufacturerInfoApi() { |
| | | if (searchFacturerName.value === '') { |
| | | uni.showToast({ |
| | | title: '请输入搜索内容', |
| | | icon: 'none' |
| | | }) |
| | | return |
| | | } |
| | | loadingManufacturer.value = true |
| | | manufacturerInfoApi({ |
| | | unitName: searchFacturerName.value, |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | loadingManufacturer.value = false |
| | | manufacturerList.value = res.data.data.records.map(item => ({ |
| | | ...item, |
| | | label: item.unitName, |
| | |
| | | }) |
| | | } |
| | | onMounted(async () => { |
| | | getManufacturerInfoApi() |
| | | // getManufacturerInfoApi() |
| | | // 动态从外部URL导入xzqhData,确保在使用前已初始化 |
| | | // 注意:直接动态导入外部URL可能会有跨域或构建问题,建议检查服务器CORS设置 |
| | | const response = await fetch('https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ja-app-wx/xzqh/index.json') |
| | |
| | | margin-right: 8rpx; |
| | | } |
| | | } |
| | | .uni-scroll-view { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .select-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding: 20rpx 20rpx; |
| | | font-size: 32rpx; |
| | | color: #222324; |
| | | .select-header-btn { |
| | | display: flex; |
| | | font-size: 28rpx; |
| | | color: #1D6FE9; |
| | | .cancel-btn { |
| | | color: #86909C; |
| | | margin-right: 20rpx; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .select-content { |
| | | height: 400rpx; |
| | | text-align: center; |
| | | padding: 20rpx 20rpx; |
| | | .loading-container { |
| | | height: 400rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | } |
| | | </style> |