Commit e1bbdb73 by linjinhong

修改物流列表获取形式

parent 3742f158
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
## CustomizeForm 属性 (Props) ## CustomizeForm 属性 (Props)
| 参数 | 说明 | 类型 | 默认值 | 必填 | | 参数 | 说明 | 类型 | 默认值 | 必填 |
| :-----------: | :--------------------------------------------: | :---------------------------: | :-------: | :--: | | :-----------: | :------------------------------------------: | :---------------------------: | :-------: | :--: |
| config | 表单配置项 | IFormConfig[] | [] | ✓ | | config | 表单配置项 | IFormConfig[] | [] | ✓ |
| modelValue | 表单数据对象 | Record<string, unknown> | {} | ✕ | | modelValue | 表单数据对象 | Record<string, unknown> | {} | ✕ |
| labelWidth | 表单标签宽度 | string \|number | 100 | ✕ | | labelWidth | 表单标签宽度 | string \|number | 100 | ✕ |
| formItemWidth | 表单项宽度 | string \|number | 50% | ✕ | | formItemWidth | 表单项宽度 | string \|number | 50% | ✕ |
| size | 组件尺寸 | 'large'\| 'default'\| 'small' | 'default' | ✕ | | size | 组件尺寸 | 'large'\| 'default'\| 'small' | 'default' | ✕ |
| inline | 是否行内布局 | boolean | false | ✕ | | inline | 是否行内布局 | boolean | false | ✕ |
| labelPosition | 标签位置 | 'left'\| 'right'\| 'top' | 'right' | ✕ | | labelPosition | 标签位置 | 'left'\| 'right'\| 'top' | 'right' | ✕ |
| ... | 其余属性与 element-plus 文档中 form Props 相同 | ... | ... | ... | | ... | 其余属性与 element-plus 文档中 Form API 相同 | ... | ... | ... |
- **CustomizeForm 说明**: - **CustomizeForm 说明**:
- CustomizeForm 属性 (Props) 可自行添加,添加属性与 element-plus 文档中 form Props 相同 - CustomizeForm 属性 (Props) 可自行添加,添加属性与 element-plus 文档中 form Props 相同
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
| isIncludeProp | 是否包含在 prop 属性中, 需搭配 refashConfig()方法使用 | boolean | - | | isIncludeProp | 是否包含在 prop 属性中, 需搭配 refashConfig()方法使用 | boolean | - |
| fixed | 固定位置 | string | - | | fixed | 固定位置 | string | - |
- attrs 中 element-plus 文档中 FormItem API 相同
- 可参考文件 src\views\logistics\declarationRule.vue - 可参考文件 src\views\logistics\declarationRule.vue
--- ---
...@@ -52,10 +53,12 @@ ...@@ -52,10 +53,12 @@
- form 表格如需动态渲染则需要传入计算属性 config - form 表格如需动态渲染则需要传入计算属性 config
```tsx **config 示例** ```tsx **config 示例**
const editForm = ref({})
const config = [ const config = [
//含有title属性的对象独占一行,目前最好只做标题使用,也可以用render自定义内容但是可能有bug待优化 //含有title属性的对象独占一行,目前最好只做标题使用,也可以用render自定义内容但是可能有bug待优化
{ {
title: '个人信息', title: '个人信息',
render: () => VNode,
}, },
{ {
prop: 'name', prop: 'name',
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
| attrs | 控件属性配置 | Record<string, unknown> | - | | attrs | 控件属性配置 | Record<string, unknown> | - |
| render | 自定义渲染函数 | () => VNode | - | | render | 自定义渲染函数 | () => VNode | - |
- attrs 中 element-plus 文档中 FormItem API 相同
--- ---
### 控件类型 (EComponenetType) ### 控件类型 (EComponenetType)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
- **Table 表格说明**: - **Table 表格说明**:
- table 表格如需动态渲染则需要传入计算属性 config - table 表格如需动态渲染则需要传入计算属性 config
- Table 属性 (Props) 可自行添加 - Table 属性 (Props) 可自行添加,添加属性与 vxetable 文档中 api Props 相同
- 可参考文件 src\views\logistics\logisticsMethod.vue - 可参考文件 src\views\logistics\logisticsMethod.vue
```tsx **config 示例** ```tsx **config 示例**
...@@ -100,4 +100,4 @@ interface RenderFunctions { ...@@ -100,4 +100,4 @@ interface RenderFunctions {
| getSelectEvent | 获取选中行数据 | 无 | | getSelectEvent | 获取选中行数据 | 无 |
| selectRowEvent | 设置高亮行 | row: any | | selectRowEvent | 设置高亮行 | row: any |
> **可用方法说明**: 可自行添加 - **说明**: 可新增方法自行添加
...@@ -494,6 +494,7 @@ onMounted(() => { ...@@ -494,6 +494,7 @@ onMounted(() => {
* @description: 更改状态 * @description: 更改状态
*/ */
async function changeStatus(data: LogisticsMethod) { async function changeStatus(data: LogisticsMethod) {
loading.value = true
try { try {
const params = { const params = {
id: data.id, id: data.id,
...@@ -696,7 +697,7 @@ function deleteCol(index: number) { ...@@ -696,7 +697,7 @@ function deleteCol(index: number) {
*/ */
async function getAllList() { async function getAllList() {
try { try {
const res = await Promise.all([ const res = await Promise.allSettled([
getWarehouseList(), getWarehouseList(),
getRuleList(), getRuleList(),
getPlatformList(), getPlatformList(),
...@@ -705,13 +706,13 @@ async function getAllList() { ...@@ -705,13 +706,13 @@ async function getAllList() {
res.forEach((item, index) => { res.forEach((item, index) => {
if (item.code === 200) { if (item.code === 200) {
if (index == 0) { if (index == 0) {
warehouseList.value = item.data warehouseList.value = item.data || []
} else if (index == 1) { } else if (index == 1) {
ruleNameList.value = item.data || [] ruleNameList.value = item.data || []
} else if (index == 2) { } else if (index == 2) {
platformList.value = item.data platformList.value = item.data || []
} else if (index == 3) { } else if (index == 3) {
logisticsCompanyList.value = item.data logisticsCompanyList.value = item.data || []
} }
} }
}) })
......
...@@ -347,7 +347,7 @@ function setCellStyle() { ...@@ -347,7 +347,7 @@ function setCellStyle() {
*/ */
async function getAllList() { async function getAllList() {
try { try {
const res = await Promise.all([getlogisticsWayAllList(), getList()]) const res = await Promise.allSettled([getlogisticsWayAllList(), getList()])
searchConfig.value[0].attrs!.options = [...(res[0]?.data || [])] searchConfig.value[0].attrs!.options = [...(res[0]?.data || [])]
} catch (error) { } catch (error) {
console.log(error) console.log(error)
......
...@@ -627,7 +627,7 @@ function handleCheckboxRecords(value: never[]) { ...@@ -627,7 +627,7 @@ function handleCheckboxRecords(value: never[]) {
const logisticsWayList = ref([]) const logisticsWayList = ref([])
async function getAllList() { async function getAllList() {
try { try {
const res = await Promise.all([getlogisticsWayAllList(), getList()]) const res = await Promise.allSettled([getlogisticsWayAllList(), getList()])
console.log(545, res) console.log(545, res)
logisticsWayList.value = res[0]?.data || [] logisticsWayList.value = res[0]?.data || []
} catch (error) { } catch (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment