flex 无法将“<mx:>”解析为组件执行.解决办法:

本文解决Flex项目导入早期版本时无法解析组件执行的问题。通过导入命名空间及改头部导入,确保正确调用F3组件。关键步骤包括使用mx1前缀替换原始前缀,并调整默认导入的命名空间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

flex项目导入早期版本 无法将“<mx:******>”解析为组件执行.解决办法:

1.导入命名空间:注意:【xmlns:mx1="library://ns.adobe.com/flex/mx"】这个是f3组件的命名控件

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:mx1="library://ns.adobe.com/flex/mx">

 

 

 

 使用时由于命名前缀换成 mx1 用所以后面的f3组件的前缀应变成

<mx1:Button />

2.改头部导入命名空间

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"">

  

 

默认导入的是 xmlns:mx="library://ns.adobe.com/flex/halo" schema 命名空间。。

 

<template> <view :style="colorStyle"> <view class="h-120 flex-between-center px-20"> <view class="h-72 bg--w111-f5f5f5 rd-36rpx px-32 flex-1 flex-y-center relative"> <text class="iconfont icon-ic_search text--w111-999"></text> <input type="text" confirm-type="search" placeholder="请输入要查询的内容" @confirm="inputConfirm" @input="setValue" class="fs-28 w-438 text--w111-333 pl-18 line1" v-model="searchValue" /> <text class="iconfont icon-ic_close1 fs-28 text--w111-999 z-10" v-show="searchValue" @tap="clearSearchVal"></text> </view> <view class="fs-28 text--w111-333 ml-32" @tap='searchBut'>搜索</view> </view> <view class="px-20" v-if="history.length"> <view class="flex-between-center mt-16 mb-24"> <view class="fs-28 lh-40rpx fw-500 text--w111-333">历史搜索</view> <text class="iconfont icon-ic_delete fs-28 text--w111-999" @tap="clear"></text> </view> <view class="flex flex-wrap"> <text class="flex-center h-56 line1 rd-28rpx bg--w111-f5f5f5 px-24 fs-24 text--w111-666 mr-24 mb-16" v-for="(item,index) in isShowMore ? history : history.slice(0,7)" :key="index" @tap='setHotSearchValue(item.keyword)' v-if="item.keyword">{{item.keyword}}</text> <view class="w-56 h-56 rd-28rpx bg--w111-f5f5f5 flex-center text--w111-666" v-if="history.length > 7" @tap="isShowMore = !isShowMore"> <text class="iconfont fs-24" :class="isShowMore ? 'icon-ic_uparrow' : 'icon-ic_downarrow'"></text> </view> </view> </view> <view class="px-20"> <view class="flex-between-center mt-40 mb-24"> <view class="fs-28 lh-40rpx fw-500 text--w111-333">热门搜索</view> <text class="iconfont icon-ic_Refresh fs-28 text--w111-999" :class="isSpin ? 'spin' : ''" @tap="refresh"></text> </view> <view class="flex flex-wrap"> <view class="flex-center search_item h-56 rd-28rpx px-24 fs-24 mr-24 mb-16" v-for="(item,index) in hotSearchList" :key="index" :style="{'color':item.color,'background-color':item.bg_color,border: item.border_color ? '1px solid ' + item.border_color : 'none'}" @tap='setHotSearchValue(item.name)'> <view class="flex-y-center"> <image v-if="item.icon" :src="item.icon" class="w-24 h-24 rd-4rpx mr-8"></image> <text>{{item.name}}</text> </view> </view> </view> </view> <view> <scroll-view scroll-x="true" class="white-nowrap vertical-middle w-730 mt-32 pl-20" show-scrollbar="false"> <view class="inline-block mr-20" v-if="salesRecommendList.length"> <view class="w-454 rd-24rpx gradient_bg pt-22 pb-8"> <view class="fs-28 font-red lh-40rpx fw-600 pl-24 mb-18 flex-y-center" @tap="goRank(1)"> <image src="@/static/img/sales_icon.png" class="w-40 h-40"></image> <text class="pl-8">销量</text> </view> <view class="mx-8 rd-24rpx bg--w111-fff h-748 p-20"> <view class="flex-y-center" v-if="salesRecommendList[0]" @tap="goDetail(salesRecommendList[0])"> <view class="relative w-108 h-108"> <image :src="salesRecommendList[0].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count1 fs-24 text--w111-fff flex-center">1</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{salesRecommendList[0].store_name}}</view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{salesRecommendList[0].store_info}}</view> </view> </view> <view class="flex-y-center mt-16" v-if="salesRecommendList[1]" @tap="goDetail(salesRecommendList[1])"> <view class="relative w-108 h-108"> <image :src="salesRecommendList[1].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count2 fs-24 text--w111-fff flex-center">2</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{salesRecommendList[1].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{salesRecommendList[1].store_info}}</view> </view> </view> <view class="flex-y-center mt-16 mb-34" v-if="salesRecommendList[2]" @tap="goDetail(salesRecommendList[2])"> <view class="relative w-108 h-108"> <image :src="salesRecommendList[2].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count3 fs-24 text--w111-fff flex-center">3</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{salesRecommendList[2].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{salesRecommendList[2].store_info}}</view> </view> </view> <view class="flex-between-center scroll_cell" v-for="(item,index) in salesRecommendList.slice(3)" :key="index" @tap="goDetail(item)"> <view class="flex-y-center"> <text class="inline-block w-30 h-32 lh-32rpx text--w111-fff text-center fs-24 rank_4">{{index + 4}}</text> <text class="fs-26 text--w111-333 ml-20 w-360 line1"> <image v-if="item.delivery_type.indexOf('2') > -1" style="height:32.6rpx;width:116.08rpx;margin-right:10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.png"></image> <image v-if="item.delivery_type.indexOf('1') > -1" style="height:32.6rpx;width:116.08rpx;margin-right: 10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodkd.png"></image><text style="vertical-align:middle;">{{item.store_name}}</text></text> </view> </view> </view> </view> </view> <view class="inline-block mr-20" v-if="scoreRecommendList.length"> <view class="w-454 rd-24rpx gradient_bg pt-22 pb-8"> <view class="fs-28 font-red lh-40rpx fw-600 pl-24 mb-18 flex-y-center" @tap="goRank(2)"> <image src="@/static/img/sales_icon.png" class="w-40 h-40"></image> <text class="pl-8">评分</text> </view> <view class="mx-8 rd-24rpx bg--w111-fff h-748 p-20"> <view class="flex-y-center" v-if="scoreRecommendList[0]" @tap="goDetail(scoreRecommendList[0])"> <view class="relative w-108 h-108"> <image :src="scoreRecommendList[0].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count1 fs-24 text--w111-fff flex-center">1</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{scoreRecommendList[0].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{scoreRecommendList[0].store_info}}</view> </view> </view> <view class="flex-y-center mt-16" v-if="scoreRecommendList[1]" @tap="goDetail(scoreRecommendList[1])"> <view class="relative w-108 h-108"> <image :src="scoreRecommendList[1].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count2 fs-24 text--w111-fff flex-center">2</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{scoreRecommendList[1].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{scoreRecommendList[1].store_info}}</view> </view> </view> <view class="flex-y-center mt-16 mb-34" v-if="scoreRecommendList[2]" @tap="goDetail(scoreRecommendList[2])"> <view class="relative w-108 h-108"> <image :src="scoreRecommendList[2].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count3 fs-24 text--w111-fff flex-center">3</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{scoreRecommendList[2].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{scoreRecommendList[2].store_info}}</view> </view> </view> <view class="flex-between-center scroll_cell" v-for="(item,index) in scoreRecommendList.slice(3)" :key="index" @tap="goDetail(item)"> <view class="flex-y-center"> <text class="inline-block w-30 h-32 lh-32rpx text--w111-fff text-center fs-24 rank_4">{{index + 4}}</text> <text class="fs-26 text--w111-333 ml-20 w-360 line1"> <image v-if="item.delivery_type.indexOf('2') > -1" style="height:32.6rpx;width:116.08rpx;margin-right:10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodzt.png"></image> <image v-if="item.delivery_type.indexOf('1') > -1" style="height:32.6rpx;width:116.08rpx;margin-right: 10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodkd.png"></image>{{item.store_name}}</text> </view> </view> </view> </view> </view> <view class="inline-block mr-20" v-if="collectRecommendList.length"> <view class="w-454 rd-24rpx gradient_bg pt-22 pb-8"> <view class="fs-28 font-red lh-40rpx fw-600 pl-24 mb-18 flex-y-center" @tap="goRank(3)"> <image src="@/static/img/sales_icon.png" class="w-40 h-40"></image> <text class="pl-8">收藏</text> </view> <view class="mx-8 rd-24rpx bg--w111-fff h-748 p-20"> <view class="flex-y-center" v-if="collectRecommendList[0]" @tap="goDetail(collectRecommendList[0])"> <view class="relative w-108 h-108"> <image :src="collectRecommendList[0].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count1 fs-24 text--w111-fff flex-center">1</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{collectRecommendList[0].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{collectRecommendList[0].store_info}}</view> </view> </view> <view class="flex-y-center mt-16" v-if="collectRecommendList[1]" @tap="goDetail(collectRecommendList[1])"> <view class="relative w-108 h-108"> <image :src="collectRecommendList[1].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count2 fs-24 text--w111-fff flex-center">2</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{collectRecommendList[1].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{collectRecommendList[1].store_info}}</view> </view> </view> <view class="flex-y-center mt-16 mb-34" v-if="collectRecommendList[2]" @tap="goDetail(collectRecommendList[2])"> <view class="relative w-108 h-108"> <image :src="collectRecommendList[2].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count3 fs-24 text--w111-fff flex-center">3</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{collectRecommendList[2].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{collectRecommendList[2].store_info}}</view> </view> </view> <view class="flex-between-center scroll_cell" v-for="(item,index) in collectRecommendList.slice(3)" :key="index" @tap="goDetail(item)"> <view class="flex-y-center"> <text class="inline-block w-30 h-32 lh-32rpx text--w111-fff text-center fs-24 rank_4">{{index + 4}}</text> <text class="fs-26 text--w111-333 ml-20 w-360 line1"> <image v-if="item.delivery_type.indexOf('2') > -1" style="height:32.6rpx;width:116.08rpx;margin-right:10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodzt.png"></image> <image v-if="item.delivery_type.indexOf('1') > -1" style="height:32.6rpx;width:116.08rpx;margin-right: 10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodkd.png"></image><text style="vertical-align:middle;">{{item.store_name}}</text></text> </view> </view> </view> </view> </view> </scroll-view> </view> <scroll-view scroll-y="true" class="fuzzy_modal" :style="{height:fuzzyHeight + 'px',top: 60 + 'px'}" v-if="newPartyList.length" @touchmove.stop.prevent="moveStop"> <view class="cell" v-for="(item,index) in newPartyList" :key="index" @tap="setCommentSearch(item.id)"> <view class="keyword line1" v-html="item.keyword"></view> </view> </scroll-view> </view> </template> <script> let sysHeight = uni.getSystemInfoSync().statusBarHeight; import home from '@/components/home/index.vue' import { getSearchKeyword, getSearchRecommendApi, getHotWordApi } from '@/api/store.js'; import { searchList, clearSearch } from '@/api/api.js'; import recommend from '@/components/recommend'; import colors from "@/mixins/color"; import { goShopDetail } from '@/libs/order.js'; import { HTTP_REQUEST_URL } from '@/config/app.js'; import { Debounce } from '@/utils/validate.js' export default { components: { recommend, home }, mixins: [colors], data() { return { hostProduct: [], searchValue: '', focus: true, bastList: [], hotSearchList: [], isSpin:false, first: 0, limit: 8, page: 1, loading: false, loadend: false, loadTitle: '加载更多', hotPage: 1, isScroll: true, history: [], imgHost: HTTP_REQUEST_URL, salesRecommendList:[], scoreRecommendList:[], collectRecommendList:[], sysHeight:sysHeight, newPartyList: [], //模糊搜索关键词列表 isShowMore: false }; }, computed: { fuzzyHeight() { let screenHeight = uni.getSystemInfoSync().screenHeight; return screenHeight - this.sysHeight - 56; } }, onLoad(e) { this.searchValue = e.searchVal || ''; this.getSearchHotKeywords(); this.getSearchRecommend(); setTimeout(()=>{ this.newPartySearch(); },1000) }, onShow: function(e) { uni.removeStorageSync('form_type_cart'); this.searchList(); }, methods: { refresh(){ this.isSpin = true; this.getSearchHotKeywords(); }, // 获取搜索热词 getSearchHotKeywords(){ getHotWordApi().then(res=>{ this.hotSearchList = res.data; setTimeout(_=>{ this.isSpin = false; },1000) }) }, searchList() { searchList({ page: 1, limit: 10 }).then(res => { this.history = res.data; }); }, clear() { let that = this; clearSearch().then(res => { uni.showToast({ title: res.msg, success() { that.history = []; } }); }); }, inputConfirm: function(event) { if (event.detail.value) { uni.hideKeyboard(); this.setHotSearchValue(event.detail.value); } }, setValue: Debounce(function(e){ this.newPartySearch(); }), newPartySearch: function() { getSearchKeyword({keyword:this.searchValue}).then(res => { this.newPartyList = res.data.list; this.newPartyList.map((item) => { this.$set(item,'keyword',this.brightKeyword(item.store_name,res.data.keyword)); }); }); }, brightKeyword(val,keyword) { if (val.indexOf(keyword) > -1) { val = `<p class="line1">${val}</p>` return val.replace(keyword, `<span style="color: #C9771E;">${keyword}</span>`); } else { return val; } }, setCommentSearch(id) { uni.navigateTo({ url:'/pages/goods/goods_list/index?productId=' + id }) }, setHotSearchValue: function(event) { this.$set(this, 'searchValue', event); this.focus = false; this.searchBut(); }, searchBut: function() { let that = this; that.focus = false; if (that.searchValue.length > 0) { this.newPartyList = []; uni.navigateTo({ url:'/pages/goods/goods_list/index?searchValue=' + that.searchValue }) } else { return this.$util.Tips({ title: '请输入要搜索的商品', icon: 'none', duration: 1000, mask: true, }); } }, getSearchRecommend(){ getSearchRecommendApi(1).then(res=>{ this.salesRecommendList = res.data; }) getSearchRecommendApi(2).then(res=>{ this.scoreRecommendList= res.data; }) getSearchRecommendApi(3).then(res=>{ this.collectRecommendList= res.data; }) }, // 去详情页 goDetail(item) { goShopDetail(item, this.uid).catch(res => { uni.navigateTo({ url: `/pages/goods_details/index?id=${item.id}` }); }); }, goRank(type){ uni.navigateTo({ url:`/pages/columnGoods/rank/index?type=${type}` }) }, clearSearchVal(){ this.searchValue = ''; this.newPartyList = []; } } } </script>排行榜有数据但是salesRecommendList、scoreRecommendList、collectRecommendList.length都为0且 即便res.data里有数据 打印出的length仍旧为0
最新发布
06-24
解读学习代码: <script setup> import { carManGetService, carManStartService, carManStopService, carManDelService, vidallDataGetService } from '@/api/cloud.js' import { Plus, Delete, Edit, Search, Refresh } from '@element-plus/icons-vue' import { ref } from 'vue' import AddCar from './components/AddCar.vue' import SureDevice from './components/SureDevice.vue' import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import CarvidSelect from '@/views/manage/components/CarvidSelect.vue' import DevcidSelect from '@/views/manage/components/DevcidSelect.vue' import { Picture as IconPicture } from '@element-plus/icons-vue' import { ElMessage, ElMessageBox, ElEmpty } from 'element-plus' const tableRef = ref([]) const carManDataList = ref([]) const total = ref(0) const updateDialog = ref() const deviceDialog = ref() // const editDialog = ref() const tableSelection = ref([]) const loading = ref(true) //定义请求参数对象 const params = ref({ pageNum: 1, pageSize: 10, cid: '', vid: '', key: '', status: '', enableStatus: '' }) //导入列表数据 const getCarManDataList = async () => { const res = await carManGetService(params.value) // 增加健壮性判断 if (res && res.data && res.data.data) { carManDataList.value = res.data.data.records total.value = res.data.data.total } else { carManDataList.value = [] total.value = 0 } loading.value = false } getCarManDataList() // 获取所属车辆 const vidDataList = ref([]) const getRoleDataList = async () => { const res = await vidallDataGetService() vidDataList.value = res.data.data } getRoleDataList() //搜索 const onSearch = () => { params.value.pageNum = 1 getCarManDataList() } //重置 const onReset = () => { params.value.pageNum = 1 params.value.cid = '' params.value.vid = '' params.value.key = '' params.value.enableStatus = '' params.value.status = '' getCarManDataList() } //多选框 let ids = [] const handleSelectionChange = (selects) => { ids = [] tableSelection.value = selects selects.forEach((rows) => { ids.push(rows.id) }) console.log(ids) console.log(tableSelection.value) } // 表格样式 // const rowStyle = (val) => { // // console.log('1111', val) // if (val.rowIndex % 2 === 0) { // // 奇数行 // return { // 'text-align': 'center', // color: '#fff', // background: '#2e3a54' // // color: 'red' // } // } // // 偶数行 // else // return { // 'text-align': 'center', // color: '#fff', // backgroundColor: '#1f2940' // } // } // 搜索式输入框 const handleSearch = () => {} //新增 const onAddMessage = () => { updateDialog.value.open({}) } //编辑 const onEditTable = (row) => { console.log(row.status) updateDialog.value.open(row) } // 添加或者编辑 成功的回调 const onSuccess = (type) => { if (type === 'add') { // // 如果是添加,最好渲染最后一页 // const lastPage = Math.ceil((total.value + 1) / params.value.pageSize) // // 更新成最大页码数,再渲染 // params.value.pageNum = lastPage params.value.pageNum = 1 } getCarManDataList() } //启用禁用 const onStart = async (row) => { // console.log(row.status) // console.log(row.id) if (row.enableStatus === 0) { // params.value.id = row.id const res = await carManStartService({ id: row.id }) if (res.data.code === 200) { // console.log('错误', res) ElMessage.success('车辆已启用') } else if (res.data.code !== 200) { ElMessage.error(`${res.data.msg}`) } } else if (row.enableStatus === 1) { // params.value.id = row.id const res = await carManStopService({ id: row.id }) if (res.data.code === 200) { // console.log('错误', res) ElMessage.success('车辆已禁用') } else if (res.data.code !== 200) { ElMessage.error(`${res.data.msg}`) } } getCarManDataList() } // 绑定台架 const inSureDevice = async (row) => { deviceDialog.value.open(row) } // 删除逻辑 const onDeleteMessage = async () => { // 提示用户是否要删除 await ElMessageBox.confirm('此操作将永久删除该数据, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) const res = await carManDelService(ids) if (res.data.code == 200) { ElMessage.success('删除成功') getCarManDataList() tableRef.value.clearSelection() } else if (res.data.code !== 200) { ElMessage.error(`${res.data.msg}`) } } //处理分页逻辑 const handleSizeChange = (size) => { //每页条数改变后,从第一页开始渲染 params.value.pageNum = 1 params.value.pageSize = size getCarManDataList() } const handleCurrentChange = (page) => { params.value.pageNum = page getCarManDataList() } zhCn.el.pagination = { goto: '跳至', pageClassifier: '页', total: '共 {total} 条', pagesize: '条/页' } </script> <template> <div class="bread"> <el-breadcrumb separator="/"> <el-breadcrumb-item ><img src="@/assets/车辆管理i.png" style="width: 20px" /></el-breadcrumb-item> <el-breadcrumb-item>车辆管理</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/manage/car' }" >车辆信息</el-breadcrumb-item > </el-breadcrumb> </div> <page-container> <AddCar ref="updateDialog" @success="onSuccess"></AddCar> <SureDevice ref="deviceDialog" @success="onSuccess"></SureDevice> <el-form inline class="search_form"> <el-form-item label="关键字:"> <el-input v-model="params.key" placeholder="请输入车辆名称、车牌号" clearable @input="handleSearch" ></el-input> </el-form-item> <el-form-item label="车辆编号:"> <CarvidSelect v-model="params.vid" placeholder="请选择车辆编号" clearable @input="handleSearch" ></CarvidSelect> </el-form-item> <el-form-item label="驾驶舱编号:"> <DevcidSelect v-model="params.cid" placeholder="请选择驾驶舱编号" clearable @input="handleSearch" ></DevcidSelect> </el-form-item> <el-form-item label="在线状态:"> <el-select v-model="params.status" placeholder="请选择在线状态" clearable > <el-option label="离线" :value="0"></el-option> <el-option label="在线" :value="1"></el-option> </el-select> </el-form-item> <el-form-item label="启用状态:"> <el-select v-model="params.enableStatus" placeholder="请选择启用状态" clearable > <el-option label="禁用" :value="0"></el-option> <el-option label="启用" :value="1"></el-option> </el-select> </el-form-item> <el-form-item> <el-button @click="onSearch" style="background-color: #165dff; color: #fff" ><el-icon style="padding-right: 5px"><Search /></el-icon> 搜索</el-button > <el-button @click="onReset" style="background-color: #fff; color: #000"> <el-icon style="padding-right: 5px"><Refresh /></el-icon> 重置</el-button > </el-form-item> </el-form> <el-form class="function_form" inline style="justify-content: end; display: flex" > <el-form-item style="margin-right: 0"> <!-- <el-button style="background-color: #366ef4; color: #fff" @click="onUpdate" :disabled="tableSelection.length === 0" ><el-icon style="padding-right: 5px"><Upload /></el-icon >一键升级</el-button > --> <el-button @click="onAddMessage" style="background-color: #165dff; color: #fff" > <el-icon style="padding-right: 5px"><Plus /></el-icon> 新增</el-button > <el-button @click="onDeleteMessage" :disabled="tableSelection.length === 0" style="background-color: #f53f3f; color: #fff" > <el-icon style="padding-right: 5px"><Delete /></el-icon> 删除</el-button > </el-form-item> </el-form> <el-table id="table" ref="tableRef" :row-key="(row) => row.id" @selection-change="handleSelectionChange" :data="carManDataList" style="width: 100%; margin-top: 10px" :header-cell-style="{ 'text-align': 'center', background: '#f2f3f5', color: '#000' }" :cell-style="{ 'text-align': 'center', color: '#000' }" > <el-table-column fixed type="selection" :reserve-selection="true" width="40" /> <el-table-column prop="vid" label="车辆编号" min-width="160" :show-overflow-tooltip="true" ><template #default="{ row }"> <div> {{ vidDataList.find((item) => row.vid == item.id)?.name || '-' }} </div> <div v-if="row.vid === '' || row.vid === null || row.vid === undefined" > - </div> </template> </el-table-column> <el-table-column prop="cid" label="驾驶舱编号" min-width="100" :show-overflow-tooltip="true" ><template #default="{ row }"> <div v-if="row.cid === '' || row.cid === null || row.cid === undefined" > - </div> </template> </el-table-column> <el-table-column prop="name" label="车辆名称" min-width="120" :show-overflow-tooltip="true" ><template #default="{ row }"> <div v-if=" row.name === '' || row.name === null || row.name === undefined " > - </div> </template> </el-table-column> <el-table-column prop="plateNumber" label="车辆牌照" min-width="120" :show-overflow-tooltip="true" ><template #default="{ row }"> <div v-if=" row.plateNumber === '' || row.plateNumber === null || row.plateNumber === undefined " > - </div> </template> </el-table-column> <!-- <el-table-column prop="abilities" label="车辆能力集" min-width="120" :show-overflow-tooltip="true" ><template #default="{ row }"> <div v-for="item in row.abilities" :key="item.id"> {{ item.name }}, </div> <div v-if=" row.abilities === '' || row.abilities === null || row.abilities === undefined || row.abilities.length === 0 " > - </div> </template> </el-table-column> <el-table-column prop="onboardDevices" label="车载设备" min-width="120" :show-overflow-tooltip="true" ><template #default="{ row }"> <div v-for="item in row.onboardDevices" :key="item.id"> {{ item.name }}, </div> <div v-if=" row.onboardDevices === '' || row.onboardDevices === null || row.onboardDevices === undefined || row.onboardDevices.length === 0 " > - </div> </template> </el-table-column> --> <el-table-column prop="picture" label="车辆图片" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <el-image v-if="row.picture" :src="row.picture" alt="" style="width: 50px; height: 50px" > <template #error> <div class="image-slot"> <el-icon><icon-picture /></el-icon> </div> </template> </el-image> <div v-if=" row.picture === '' || row.picture === null || row.picture === undefined " > - </div> </template> </el-table-column> <el-table-column prop="status" label="在线状态" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <el-tag v-if="row.status === 0" type="info">离线</el-tag> <el-tag v-if="row.status === 1" type="success">在线</el-tag> <div v-if=" row.status === '' || row.status === null || row.status === undefined " > - </div> </template> </el-table-column> <el-table-column prop="enableStatus" label="启用状态" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <el-tag v-if="row.enableStatus === 0" type="danger">禁用</el-tag> <el-tag v-if="row.enableStatus === 1" type="success">启用</el-tag> <div v-if=" row.enableStatus === '' || row.enableStatus === null || row.enableStatus === undefined " > - </div> </template> </el-table-column> <el-table-column prop="hasGateway" label="是否具备网关" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <div v-if="row.hasGateway === 0">否</div> <div v-if="row.hasGateway === 1">是</div> <div v-if=" row.hasGateway === '' || row.hasGateway === null || row.hasGateway === undefined " > - </div> </template> </el-table-column> <el-table-column prop="model" label="型号" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <div v-if=" row.model === '' || row.model === null || row.model === undefined " > - </div> </template> </el-table-column> <el-table-column prop="manufactureDate" label="出厂日期" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <div v-if=" row.manufactureDate === '' || row.manufactureDate === null || row.manufactureDate === undefined " > - </div> </template> </el-table-column> <el-table-column prop="organizeId" label="组织号" min-width="110" :show-overflow-tooltip="true" > <template #default="{ row }"> <div v-if=" row.organizeId === '' || row.organizeId === null || row.organizeId === undefined " > - </div> </template> </el-table-column> <el-table-column prop="created" label="创建时间" min-width="170" /> <el-table-column prop="last" label="更新时间" min-width="170" /> <el-table-column label="操作" width="260" fixed="right"> <template #default="{ row }"> <el-button class="operate" style="color: #165dff" link @click="onEditTable(row)" ><el-icon style="padding-right: 3px"><Edit /></el-icon >编辑</el-button > <el-text class="mx-1" style="color: #165dff; padding-left: 3px" >|</el-text > <el-button link @click="onStart(row)"> <el-button link v-if="row.enableStatus === 0" style="color: #00ff48" ><img style="width: 14px; padding-right: 3px" src="@/assets/logo.png" />启用</el-button > <el-button class="operate" link v-if="row.enableStatus === 1" style="color: #ff4646" ><img style="width: 13px; padding-right: 3px" src="@/assets/logo.png" />禁用</el-button > </el-button> <el-text class="mx-1" style="color: #165dff; padding-left: 3px" >|</el-text > <el-button link @click="inSureDevice(row)"> <el-button link style="color: #165dff" ><img style="width: 14px; padding-right: 3px" src="@/assets/logo.png" />绑定驾驶舱</el-button > </el-button> </template> </el-table-column> <template #empty> <el-empty description="没有数据"></el-empty> </template> </el-table> <el-pagination :teleported="false" v-model:current-page="params.pageNum" v-model:page-size="params.pageSize" :page-sizes="[5, 10]" layout="total,prev, pager, next,sizes" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" style="margin-top: 40px; margin-bottom: 40px; justify-content: end" /> </page-container> </template> <style lang="scss" scoped> .operate { margin-left: 0px !important; } // :deep .el-input__wrapper { // background-color: #f2f3f5; // } // 面包屑 .bread { height: 50px; display: flex; align-items: center; padding-left: 20px; :deep .el-breadcrumb__item:last-child .el-breadcrumb__inner { cursor: pointer !important; } } :deep .el-breadcrumb { display: flex; align-items: center; .el-breadcrumb__inner { color: #4e5969; } .el-breadcrumb__item { &:nth-child(1), &:last-child { .el-breadcrumb__inner { color: #1d2129; } } } } // 表格 :deep .el-scrollbar__wrap { max-height: 48vh; } // 分页 :deep .el-pagination { .el-pager li { // background-color: #fff; color: #000; // border: 1px solid #e5e5ea; border-radius: 2px; min-width: 32px; height: 32px; margin: 0 5px; } .el-pager li:hover { background-color: #e8f3ff; color: #165dff; } .el-pager li.is-active { background-color: #e8f3ff !important; color: #165dff !important; font-size: medium; } .btn-next, .btn-prev { // background-color: #fff; // border: 1px solid #e5e5ea; // border-radius: 5px; width: 32px; height: 32px; } } :deep .image-slot { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; background: var(--el-fill-color-light); color: var(--el-text-color-secondary); font-size: 20px; } </style>
06-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值