Container.DataItem几种方式.

本文介绍了一种在ASP.NET中进行数据绑定的新方法,通过使用DataRowView直接访问数据项,可以提高页面性能。此方法需要引入System.Data命名空间,并且与DictionaryEntry.Key的用法类似。

在绑定数据时经常会用到这个句程序:<%# DataBinder.Eval(Container.DataItem,"xxxx")%>或者<%# DataBinder.Eval(Container,"DataItem.xxxx")%>

今天又学到一种,而且微软也说这种方法的效率要比以上两种高。

<%# ((DataRowView)Container.DataItem)["xxxx"]%>

很有用的,这样可以在前台页面做好多事情了。

还要记住要这样用必须要在前台页面导入名称空间System.Data,否则会生成错误信息。

<%@ Import namespace="System.Data" %>

这种用法其实和<%# ((DictionaryEntry)Container.DataItem).Key%>是一个道理。

关键是Container这个东西,它比较神秘。它的名称空间是System.ComponentModel。对于它我还需要进一步理解。  


 
<template> <view class="detail-container"> <!-- 顶部索引板块 --> <view class="index-card"> <u-form :model="formData" ref="indexForm" class="mobile-form"> <!-- 问卷标题 --> <u-form-item label="问卷标题:" prop="dcWjTitle" label-width="150rpx"> <u-input v-model="formData.dcWjTitle" placeholder="请输入问卷标题" clearable border="bottom" prefixIcon="file-text" /> </u-form-item> <!-- 被测评人 --> <u-form-item label="被测评人:" prop="dcId" label-width="150rpx"> <u-select v-model="formData.dcId" :list="bdrOptions" multiple value-name="dcId" label-name="dcName" @confirm="handleBdrSelect" placeholder="请选择被测评人" ></u-select> </u-form-item> <!-- 人员部门 --> <u-form-item label="人员部门:" prop="dcDept" label-width="150rpx"> <u-input v-model="formData.dcDept" placeholder="请输入人员部门" clearable border="bottom" prefixIcon="home" /> </u-form-item> <!-- 人员状态 --> <u-form-item label="人员状态:" prop="state" label-width="150rpx"> <u-select v-model="formData.state" :list="stateOptions" value-name="value" label-name="label" placeholder="请选择提交状态" ></u-select> </u-form-item> <!-- 按钮区域 --> <view class="button-group"> <u-button type="primary" @click="handleSearch" class="action-button" icon="search" > 搜索 </u-button> <u-button @click="handleReset" class="action-button" icon="reload" > 重置 </u-button> </view> </u-form> </view> <!-- 数据显示区域 --> <view class="data-card"> <view class="card-header"> <u-button type="primary" size="small" icon="reload" @click="fetchData" > 刷新数据 </u-button> </view> <view class="card-container"> <!-- 数据加载状态 --> <u-loading-page :loading="loading" loadingText="加载中..." /> <!-- 数据卡片 --> <view v-for="(item, index) in tableData" :key="item.dcWjId" class="data-card-item" > <!-- 顶部:问卷标题 --> <view class="card-header-section"> <view class="card-title">{{ item.dcWjTitle }}</view> </view> <!-- 中间:其他数据 --> <view class="card-body-section"> <view class="card-row"> <text class="card-label">被测评人:</text> <text class="card-value">{{ item.dcName }}</text> </view> <view class="card-row"> <text class="card-label">部门:</text> <text class="card-value">{{ item.dcDept }}</text> </view> <view class="card-row"> <text class="card-label">创建时间:</text> <text class="card-value">{{ item.createTime }}</text> </view> <view class="card-row"> <text class="card-label">提交时间:</text> <text class="card-value">{{ item.updateTime || '-' }}</text> </view> </view> <!-- 底部:状态和操作按钮 --> <view class="card-footer-section"> <view class="status-container"> <u-tag :text="item.state === '1' ? '已提交' : '未提交'" :type="item.state === '1' ? 'success' : 'info'" /> <view class="score">总分: {{ item.score || '0' }}</view> </view> <u-button size="small" type="primary" @click="handleView(item)" class="action-btn" > 编辑/查看 </u-button> </view> </view> <!-- 空数据提示 --> <u-empty v-if="tableData.length === 0" mode="data" /> </view> <!-- 分页控件 --> <view class="pagination-container"> <u-pagination v-model="pagination.current" :itemsPerPage="pagination.size" :total="pagination.total" :showTotal="true" @change="handlePageChange" /> </view> </view> </view> </template> <script> import { ref, reactive, onMounted } from 'vue'; import { onLoad } from '@dcloudio/uni-app'; export default { setup() { // 环境变量管理API地址 - 使用uni-app兼容方式 const API_BASE = 'http://172.26.26.43/dev-api'; // 替换为实际API地址 const API_URL = `${API_BASE}/wjdc/wj/listTx`; const BDR_API_URL = `${API_BASE}/wjdc/wj/getBdrList`; // 状态选项 const stateOptions = ref([ { label: '已提交', value: 1 }, { label: '未提交', value: 0 } ]); // 被测评人相关数据 const bdrOptions = ref([]); // 被测评人选项列表 const bdrLoading = ref(false); // 加载状态 const bdrCache = ref([]); // 缓存所有被测评人数据 // 表单数据 const formData = reactive({ dcWjTitle: '', dcId: [], dcDept: '', state: null }); // 表格数据 const tableData = ref([]); const loading = ref(false); // 分页配置 const pagination = reactive({ current: 1, size: 10, total: 0 }); // 表单引用 const indexForm = ref(null); // 处理被测评人选择 const handleBdrSelect = (selected) => { formData.dcId = selected.map(item => item.value); }; // 获取被测评人列表 const fetchBdrList = async () => { const token = getAuthToken(); if (!token) return; bdrLoading.value = true; try { const [err, res] = await uni.request({ url: BDR_API_URL, method: 'GET', header: { 'Authorization': `Bearer ${token}` } }); if (err) { throw new Error(err.errMsg || '请求失败'); } const data = res.data; if (data && data.code === 200) { bdrCache.value = data.data || []; bdrOptions.value = bdrCache.value.map(item => ({ value: item.dcId, label: item.dcName })); } else { const msg = data?.msg || '返回数据格式不正确'; uni.showToast({ title: '获取被测评人列表失败: ' + msg, icon: 'none' }); } } catch (error) { console.error('获取被测评人列表失败:', error); uni.showToast({ title: '获取被测评人列表失败: ' + error.message, icon: 'none' }); } finally { bdrLoading.value = false; } }; const token = getAuthToken(); if (!token) return; bdrLoading.value = true; try { const response = await uni.request({ url: BDR_API_URL, method: 'GET', params: { pageNum: pagination.current, pageSize: pagination.size, ...formData, dcId: formData.dcId.join(',') }, header: { 'Authorization': `Bearer ${token}` } }); const data = response[1].data; if (data && data.code === 200) { bdrCache.value = data.data || []; bdrOptions.value = bdrCache.value.map(item => ({ value: item.dcId, label: item.dcName })); } else { const msg = data?.msg || '返回数据格式不正确'; uni.showToast({ title: '获取被测评人列表失败: ' + msg, icon: 'none' }); } } catch (error) { console.error('获取被测评人列表失败:', error); uni.showToast({ title: '获取被测评人列表失败', icon: 'none' }); } finally { bdrLoading.value = false; } }; // 获取认证令牌 const getAuthToken = () => { const token = uni.getStorageSync('token'); if (!token) { uni.showToast({ title: '请先登录', icon: 'none' }); uni.navigateTo({ url: '/pages/login/login' }); return null; } return token; }; // 搜索按钮处理函数 const handleSearch = () => { // 检查被测评人选择数量 if (formData.dcId.length > 1) { uni.showToast({ title: '当前只能搜索一个被测人员', icon: 'none', duration: 3000 }); return; } pagination.current = 1; fetchData(); }; // 重置按钮处理函数 const handleReset = () => { formData.dcWjTitle = ''; formData.dcId = []; formData.dcDept = ''; formData.state = null; handleSearch(); }; // 编辑/查看 const handleView = (row) => { uni.navigateTo({ url: `/pages/operation/operation?id=${row.dcWjId}` }); }; // 页码改变 const handlePageChange = (page) => { pagination.current = page; fetchData(); }; // 获取数据 const fetchData = async () => { const token = getAuthToken(); if (!token) return; loading.value = true; try { const params = { pageNum: pagination.current, pageSize: pagination.size, ...formData, dcId: formData.dcId.join(',') }; const [err, res] = await uni.request({ url: API_URL, method: 'GET', data: params, header: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } }); if (err) { throw new Error(err.errMsg || '请求失败'); } const data = res.data; if (data && data.code === 200) { tableData.value = data.rows || []; pagination.total = data.total || 0; if (tableData.value.length === 0) { uni.showToast({ title: '没有找到匹配的数据', icon: 'none' }); } } else { const errorMsg = data?.msg || '未知错误'; console.error('API返回错误:', errorMsg); uni.showToast({ title: `请求失败: ${errorMsg}`, icon: 'none' }); tableData.value = []; pagination.total = 0; } } catch (error) { // ... 错误处理 ... } finally { loading.value = false; } }; const token = getAuthToken(); if (!token) return; loading.value = true; try { const params = { pageNum: pagination.current, pageSize: pagination.size, ...formData, dcId: formData.dcId.join(',') }; const response = await uni.request({ url: API_URL, method: 'GET', data: params, header: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } }); const data = response[1].data; if (data && data.code === 200) { tableData.value = data.rows || []; pagination.total = data.total || 0; if (tableData.value.length === 0) { uni.showToast({ title: '没有找到匹配的数据', icon: 'none' }); } } else { const errorMsg = data?.msg || '未知错误'; console.error('API返回错误:', errorMsg); uni.showToast({ title: `请求失败: ${errorMsg}`, icon: 'none' }); tableData.value = []; pagination.total = 0; } } catch (error) { // 安全地访问错误属性 const statusCode = error.statusCode || error.errMsg?.match(/status code (\d+)/)?.[1]; if (statusCode === '401') { uni.showToast({ title: '认证过期,请重新登录', icon: 'none' }); uni.removeStorageSync('token'); uni.navigateTo({ url: '/pages/login/login' }); return; } console.error('获取数据失败:', error); // 安全地获取错误信息 let errorMsg = '网络请求失败'; if (error.errMsg) { errorMsg = error.errMsg; } else if (error.message) { errorMsg = error.message; } else if (typeof error === 'string') { errorMsg = error; } uni.showToast({ title: `请求失败: ${errorMsg}`, icon: 'none' }); tableData.value = []; pagination.total = 0; } finally { loading.value = false; } }; onMounted(() => { fetchBdrList(); fetchData(); }); return { formData, bdrOptions, stateOptions, tableData, loading, pagination, indexForm, handleBdrSelect, handleSearch, handleReset, handleView, handlePageChange, fetchData }; } }; </script> <style> .detail-container { padding: 20rpx; background-color: #f8f8f8; min-height: 100vh; } .index-card { background: #fff; border-radius: 16rpx; padding: 24rpx; margin-bottom: 24rpx; box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.05); } .mobile-form .u-form-item { margin-bottom: 32rpx; } .mobile-form .u-input, .mobile-form .u-select { background: #f8f8f8; border-radius: 12rpx; padding: 20rpx; margin-top: 12rpx; } .button-group { display: flex; justify-content: space-between; margin-top: 24rpx; } .button-group .action-button { flex: 1; margin: 0 12rpx; height: 80rpx; border-radius: 12rpx; font-size: 32rpx; } .data-card { background: #fff; border-radius: 16rpx; padding: 24rpx; box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.05); } .data-card .card-header { margin-bottom: 24rpx; display: flex; justify-content: flex-end; } .card-container .data-card-item { background: #fff; border-radius: 16rpx; padding: 24rpx; margin-bottom: 24rpx; border: 1rpx solid #eee; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); } .card-container .card-header-section { padding-bottom: 20rpx; border-bottom: 1rpx solid #f0f2f5; margin-bottom: 20rpx; } .card-container .card-header-section .card-title { font-size: 34rpx; font-weight: bold; color: #333; } .card-container .card-body-section { margin-bottom: 20rpx; } .card-container .card-row { display: flex; margin-bottom: 16rpx; font-size: 30rpx; line-height: 1.6; } .card-container .card-label { color: #666; min-width: 150rpx; } .card-container .card-value { color: #333; flex: 1; } .card-container .card-footer-section { display: flex; justify-content: space-between; align-items: center; padding-top: 20rpx; border-top: 1rpx solid #f0f2f5; } .card-container .status-container { display: flex; align-items: center; } .card-container .status-container .score { margin-left: 24rpx; font-size: 30rpx; color: #e6a23c; font-weight: 500; } .card-container .action-btn { min-width: 180rpx; } .pagination-container { margin-top: 40rpx; display: flex; justify-content: center; } /* 响应式调整 - 移动端 */ @media (max-width: 768px) { .button-group { flex-direction: column; } .button-group .action-button { margin: 12rpx 0; width: 100%; } .card-container .card-footer-section { flex-direction: column; align-items: flex-start; } .card-container .status-container { margin-bottom: 20rpx; } .card-container .action-btn { width: 100%; } } </style> 报错:18:40:24.208 [plugin:vite:vue] [vue/compiler-sfc] Unexpected reserved word 'await'. (258:25) 18:40:24.208 D:/民意测评/vue3-uni-mycp/pages/detail/detail.vue 18:40:24.208 256| 18:40:24.208 257| try { 18:40:24.208 258| const response = await uni.request({ 18:40:24.208 | ^ 18:40:24.208 259| url: BDR_API_URL, 18:40:24.208 260| method: 'GET', 18:40:24.208 at pages/detail/detail.vue:258:25
07-18
<template> <div class="app-container"> <el-form> <el-row :gutter="14"> <el-col :span="7"> <el-form-item label="商户名称"> <el-select v-model="merchantValue" @change="handleMerchantChange" placeholder="请选择商户"> <el-option v-for="item in merchantOptions" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="车场名称"> <el-select v-model="parkingValue" @change="handleparkingChange" placeholder="请选择车场"> <el-option v-for="item in parkingOptions" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-form-item> </el-col> </el-row> </el-form> <div class="scenario"> <span>场景</span> <el-tag icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="scenarioAdd">+</el-tag> <div v-for="(item, index) in scenarioList" :key="index" class="scenario-item"> <el-select v-model="item.sceneId" placeholder="请选择场景" style="margin-left: 10px" @change="checkDuplicate(item)"> <el-option v-for="option in sceneBindingOptions" :key="option.value" :label="option.label" :value="option.value" /> </el-select> <span style="margin-left: 10px">条件</span> <el-input v-model="item.minAmount" placeholder="金额大于" style="width: 200px; margin-left: 10px" @input="checkAmountRange(item)" /> <el-input v-model="item.maxAmount" placeholder="金额小于" style="width: 200px; margin-left: 10px" @input="checkAmountRange(item)" /> <span style="margin-left: 10px">支付账户</span> <el-select v-model="item.accountObj" value-key="value" placeholder="请选择账户" style="margin-left: 10px" @change="checkDuplicate(item)"> <el-option v-for="option in channelConfigOptions" :key="option.channelKey" :label="option.channelName" :value="item.channelKey" /> </el-select> <el-button type="danger" icon="el-icon-delete" style="margin-left: 10px" @click="scenarioRemove(index)">删除</el-button> </div> </div> <el-button type="success" icon="el-icon-plus" style="margin-top: 15px; margin-left: 10px" @click="submit">提交</el-button> </div> </template> <script> import { GetOpPayMerchantinfoList, GetParkNameByMerchantCode, GetOpPaySceneBindingList, GetOpPayChannelConfigList, addOpPayStrategy, GetOpPayStrategyByParkId, UpdateOpPayStrategy, QueryOpPayChannelInfo } from '@/api/openpay/opPayMerchant' export default { data() { return { merchantValue: '', parkingValue: '', merchantOptions: [], parkingOptions: [], channelConfigOptions: [], sceneBindingOptions: [], scenarioList: [ { id: null, sceneId: null, sceneName: '', parkId: null, channelKey: '', minAmount: null, maxAmount: null, accountObj: null, isEdit: false, }, ], } }, mounted() { this.getMerchantList() }, methods: { getMerchantList() { GetOpPayMerchantinfoList().then((res) => { if (res.code === 200) { this.merchantOptions = res.data.map((item) => ({ value: item.merchantCode, label: item.merchantName, })) } }) GetOpPaySceneBindingList().then((res) => { if (res.code === 200) { this.sceneBindingOptions = res.data.map((item) => ({ value: item.id, label: item.sceneName, })) } }) const param = {}; QueryOpPayChannelInfo(param).then((res) => { if (res.code === 200) { console.log(res.data) this.channelConfigOptions = res.data.result.map((item) => ({ value: item.channelKey, label: item.channelName, channelKey: item.channelKey, })) } }) }, handleMerchantChange() { if (this.merchantValue) { GetParkNameByMerchantCode(this.merchantValue).then((res) => { if (res.code === 200) { this.parkingOptions = res.data.map((item) => ({ value: item.id, label: item.parkName, })) // 如果车场列表为空,清空场景列表并重置车场下拉框 if (this.parkingOptions.length === 0) { this.scenarioList = [ { id: null, sceneId: null, sceneName: '', parkId: null, channelKey: '', minAmount: null, maxAmount: null, accountObj: null, isEdit: false, }, ] this.parkingValue = null // 重置车场下拉框 } else { // 如果有车场数据,获取第一个车场的策略列表 this.parkingValue = this.parkingOptions[0].value this.getStrategyList() } } }) } else { this.parkingOptions = [] this.parkingValue = null // 重置车场下拉框 this.scenarioList = [ { id: null, sceneId: null, sceneName: '', parkId: null, channelKey: '', minAmount: null, maxAmount: null, accountObj: null, isEdit: false, }, ] } }, handleparkingChange() { this.getStrategyList() }, // 检查是否存在金额范围冲突 isAmountRangeConflict(item) { return this.scenarioList.some((existingItem) => { // 排除当前编辑的项 if (existingItem.id === item.id) return false; // 只在同一个场景下检查金额范围冲突 if (existingItem.sceneId !== item.sceneId) return false; return ( parseFloat(item.minAmount) < parseFloat(existingItem.maxAmount) && parseFloat(item.maxAmount) > parseFloat(existingItem.minAmount) ); }); }, // 检查是否存在相同的场景和支付账户组合 isDuplicateScenarioAndAccount(item) { return this.scenarioList.some((existingItem) => { return ( existingItem.sceneId === item.sceneId && existingItem.accountObj?.value === item.accountObj?.value && existingItem.id !== item.id // 排除当前编辑的项 ) }) }, checkAmountRange(item) { if (this.isAmountRangeConflict(item)) { this.$message({ type: 'warning', message: '金额范围与已有场景冲突!' }) // 清空当前输入 item.minAmount = null item.maxAmount = null } }, checkDuplicate(item) { if (this.isDuplicateScenarioAndAccount(item)) { this.$message({ type: 'warning', message: '相同的场景和支付账户组合已存在!' }) // 清空当前选择 item.sceneId = null item.accountObj = null item.maxAmount = null item.minAmount = null } }, getStrategyList() { GetOpPayStrategyByParkId(this.parkingValue).then((res) => { if (res.code === 200 && res.data && res.data.length > 0) { this.scenarioList = res.data.map((item) => { const accountObj = this.channelConfigOptions.find((opt) => opt.label === item.accountName) return { id: item.syStrategyId, sceneId: item.sceneBindingId, sceneName: item.sceneName, parkId: item.parkId, channelKey: item.channelKey, minAmount: item.minAmount, maxAmount: item.maxAmount, accountObj: accountObj || null, isEdit: true, // 已存在的场景设置为可编辑 } }) } else { this.scenarioList = [ { id: null, sceneId: null, sceneName: '', parkId: this.parkingValue, channelKey: '', minAmount: null, maxAmount: null, accountObj: null, isEdit: false, // 新增场景默认不可编辑 }, ] } }) }, scenarioAdd() { this.scenarioList.push({ id: null, sceneId: null, sceneName: '', parkId: this.parkingValue, channelKey: '', minAmount: null, maxAmount: null, accountObj: null, isEdit: false, // 新增场景默认不可编辑 }) // 检查是否存在相同的场景和支付账户组合 if (this.scenarioList.some((item) => item.sceneId === newItem.sceneId && item.accountObj?.value === newItem.accountObj?.value)) { this.$message({ type: 'warning', message: '不能添加相同的场景和支付账户组合!' }) return } // 检查是否存在金额范围冲突 if (this.isAmountRangeConflict(newItem)) { this.$message({ type: 'warning', message: '金额范围与已有场景冲突!' }) return } this.scenarioList.push(newItem) }, scenarioRemove(index) { this.$confirm('确定要删除这条记录吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }) .then(() => { const item = this.scenarioList[index] if (!item.isEdit) { this.$message.warning('新增数据无法删除') return } UpdateOpPayStrategy({ Id: item.id, ScenarioId: item.sceneId, ParkId: item.parkId, ChannelKey: item.channelKey, MinAmount: item.minAmount, MaxAmount: item.maxAmount, Status: '0', // 设置为禁用状态 }) .then((res) => { if (res.code === 200) { this.scenarioList.splice(index, 1) this.$message({ type: 'success', message: '删除成功!' }) } else { this.$message({ type: 'error', message: res.message || '删除失败!' }) } }) .catch((error) => { this.$message({ type: 'error', message: `请求失败:${error.message}` }) }) }) .catch(() => { this.$message({ type: 'info', message: '已取消删除' }) }) }, async submit() { // 校验逻辑 for (let i = 0; i < this.scenarioList.length; i++) { const item = this.scenarioList[i] if (!item.sceneId) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景为空,请选择!` }) return } if (item.minAmount === null || item.minAmount === '' || parseFloat(item.minAmount) < 0) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景的条件1必须是非负数!` }) return } if (!item.maxAmount) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景的条件2为空,请输入!` }) return } if (!item.accountObj) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景的支付账户为空,请选择!` }) return } if (parseFloat(item.maxAmount) <= parseFloat(item.minAmount)) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景的条件2必须大于条件1!` }) return } // 检查是否存在相同的场景和支付账户组合 if (this.isDuplicateScenarioAndAccount(item)) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景和支付账户组合已存在!` }) return } // 检查是否存在金额范围冲突 if (this.isAmountRangeConflict(item)) { this.$message({ type: 'warning', message: `第 ${i + 1} 个场景的金额范围与已有场景冲突!` }) return } } try { for (let i = 0; i < this.scenarioList.length; i++) { const item = this.scenarioList[i] const data = { ScenarioId: Number(item.sceneId), ParkId: this.parkingValue, ChannelKey: item.accountObj?.channelKey, MinAmount: Number(parseFloat(item.minAmount).toFixed(2)), MaxAmount: Number(parseFloat(item.maxAmount).toFixed(2)), PayChannelConfigId: item.accountObj?.value, Priority: 1, Status: '1', CreateTime: new Date(), } let response if (item.isEdit) { // 如果是已存在的场景,调用更新接口 response = await UpdateOpPayStrategy({ Id: item.id, ...data }) } else { // 如果是新增的场景,调用新增接口 response = await addOpPayStrategy(data) } if (response.code !== 200) { // 如果某个操作失败,抛出错误 throw new Error(`第 ${i + 1} 个场景提交失败:${response.message || '未知错误'}`) } } // 所有操作成功 this.$message({ type: 'success', message: '提交成功!' }) this.getStrategyList() // 刷新列表 } catch (err) { // 捕获错误并显示提示 this.$message({ type: 'error', message: `提交失败:${err.message}` }) } }, }, } </script> <style scoped> .app-container { padding: 20px; } .scenario-item { margin-top: 10px; } /* 自定义样式 */ .el-button--danger { background-color: #ff4d4f; /* 自定义背景颜色 */ border-color: #ff4d4f; /* 自定义边框颜色 */ padding: 8px 16px; /* 自定义内边距 */ font-size: 12px; /* 自定义字体大小 */ border-radius: 20px; /* 自定义圆角大小 */ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 自定义阴影 */ color: #ffffff; /* 自定义文本颜色 */ } .el-button--danger:hover { background-color: #ff7875; /* 鼠标悬停时的背景颜色 */ border-color: #ff7875; /* 鼠标悬停时的边框颜色 */ } </style> 这段代码中 QueryOpPayChannelInfo(param).then((res) => { if (res.code === 200) { console.log(res.data) this.channelConfigOptions = res.data.result.map((item) => ({ value: item.channelKey, label: item.channelName, channelKey: item.channelKey, })) } }) 这个方法 为什么没有获取到值
08-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值