Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
topsun-baoshen-excel
Commits
e821dbab
Commit
e821dbab
authored
Nov 22, 2024
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
变量转换设置映射字段改为下拉选择
parent
68fdf0fc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
15 deletions
+34
-15
var.ts
src/api/var.ts
+11
-0
excel.ts
src/stores/excel.ts
+10
-3
VarChange.vue
src/views/var/varChange/VarChange.vue
+4
-0
ConfigFormItem.vue
src/views/var/varChange/components/ConfigFormItem.vue
+9
-12
No files found.
src/api/var.ts
View file @
e821dbab
...
...
@@ -136,4 +136,15 @@ export const apiOrderVarGetNewVars = (orderItemId: any) => {
});
};
/**
* 获取变量下拉数据
* @param orderItemId
* @returns
*/
export
const
getVarSpecList
=
(
productCode
:
any
)
=>
{
return
axios
.
get
(
"/api/varTemplateDetail/getVarSpecList"
,
{
params
:
{
productCode
}
});
};
src/stores/excel.ts
View file @
e821dbab
...
...
@@ -6,7 +6,7 @@ type StoreState = {
fileInfo
:
Record
<
any
,
any
>
isSelectedRow
:
Boolean
isSetSheetMarks
:
Boolean
[]
sheetBegin
:
Record
<
any
,
any
>
[]
sheetBegin
:
Record
<
any
,
any
>
[]
,
}
export
const
useExcelStore
=
defineStore
(
'excelStore'
,
{
...
...
@@ -95,6 +95,7 @@ type ExcelChangeStore = {
scriptList
:
Recordable
[]
orderFieldList
:
Recordable
[]
usedFieldList
:
Recordable
[]
specList
?:
Recordable
[]
}
export
const
useExcelChangeStore
=
defineStore
(
'excelChangeStore'
,
{
...
...
@@ -148,7 +149,7 @@ export const useExcelChangeStore = defineStore('excelChangeStore', {
},
setUsedFieldList
(
list
:
any
)
{
this
.
usedFieldList
=
list
}
}
,
}
})
...
...
@@ -158,7 +159,7 @@ export const useVariableExcelChangeStore = defineStore('variableExcelChangeStore
allMapConfigs
:
{},
// 缓存当前这条数据的所有映射关系
scriptList
:
[],
// 脚本
orderFieldList
:
[],
// 订单字段
usedFieldList
:
[]
// 当前编辑column使用过的映射字段
usedFieldList
:
[]
,
// 当前编辑column使用过的映射字段
}),
getters
:
{
getAllMapConfigs
():
Recordable
{
...
...
@@ -187,6 +188,9 @@ export const useVariableExcelChangeStore = defineStore('variableExcelChangeStore
:
(
item
.
disabled
=
false
)
return
item
})
},
getSpecList
():
any
{
return
this
.
specList
}
},
actions
:
{
...
...
@@ -204,6 +208,9 @@ export const useVariableExcelChangeStore = defineStore('variableExcelChangeStore
},
setUsedFieldList
(
list
:
any
)
{
this
.
usedFieldList
=
list
},
setSpecList
(
list
:
any
)
{
this
.
specList
=
list
}
}
})
\ No newline at end of file
src/views/var/varChange/VarChange.vue
View file @
e821dbab
...
...
@@ -192,6 +192,7 @@ import {
apiVarTemplateGetConf
,
apiVarTemplateConvert
,
apiVarTemplateSaveConf
,
getVarSpecList
,
}
from
"@/api/var"
;
import
{
ElMessage
,
...
...
@@ -361,9 +362,12 @@ const toDetail = async (row: any) => {
const
{
data
}
=
await
apiVarTemplateGetVars
(
row
.
varTemplateDetailId
);
const
{
data
:
cdata
}
=
await
apiVarTemplateGetConf
(
row
.
varTemplateDetailId
);
const
{
data
:
specList
}
=
await
getVarSpecList
(
row
.
productCode
)
const
{
res
,
titles
,
configs
}
=
filterRunData2
(
data
.
result
,
true
);
excelChangeStore
.
setSpecList
(
specList
)
cdata
.
result
?.
forEach
((
item
)
=>
{
Reflect
.
set
(
configs
[
item
.
title
],
"filedConfs"
,
item
.
filedConfs
);
});
...
...
src/views/var/varChange/components/ConfigFormItem.vue
View file @
e821dbab
...
...
@@ -2,24 +2,21 @@
<!-- 字段映射设置 -->
<el-col>
<el-form-item
label=
"对应字段"
prop=
"mapField"
>
<!--
<el-select
v-if=
"!isVariable"
<el-select
v-model=
"item.mapField"
style=
"width:
1
60px"
style=
"width:
2
60px"
filterable
placeholder=
"请选择"
@
change=
"mapFieldChange"
clearable
>
<el-option
v-for=
"item in getAllFields"
:key=
"item.filedName"
:label=
"item.fliedTitle"
:value=
"item.filedName"
:disabled=
"!!item.disabled"
v-for=
"item in getSpecList"
:key=
"item.itemId"
:label=
"item.spec"
:value=
"item.spec"
/>
</el-select>
-->
<
el-input
v-model=
"item.mapField"
style=
"width: 260px"
/
>
</el-select>
<
!--
<el-input
v-model=
"item.mapField"
style=
"width: 260px"
/>
--
>
<!--
<el-checkbox
class=
"ml-1"
v-model=
"isVariable"
@
change=
"checkboxChange"
>
是变量
</el-checkbox>
-->
<el-button
class=
"ml-1"
...
...
@@ -84,7 +81,7 @@ import { onMounted, ref, watch } from 'vue'
const
props
=
defineProps
<
{
item
?:
any
;
index
:
number
}
>
()
const
emits
=
defineEmits
([
'remove'
])
const
excelChangeStore
=
useVariableExcelChangeStore
()
const
{
getScriptList
}
=
storeToRefs
(
excelChangeStore
)
const
{
getScriptList
,
getSpecList
}
=
storeToRefs
(
excelChangeStore
)
const
isVariable
=
ref
(
false
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment