调整
This commit is contained in:
@@ -26,7 +26,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类:" style="width: 100%;" prop="targetCatId" :rules="[{ required: true, message: '请选择商品分类', trigger: 'blur' }]">
|
||||
<el-cascader style="width: 380px" v-model="form.targetCatId" :props="props"></el-cascader>
|
||||
<ai-lazy-cascader
|
||||
style="width: 380px"
|
||||
v-model="form.targetCatId"
|
||||
filterable
|
||||
:props="props"></ai-lazy-cascader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="bottom flex-center">
|
||||
@@ -38,23 +42,25 @@
|
||||
|
||||
<script>
|
||||
import {sendChromeAPIMessage, sendChromeWebReqMessage} from '@/api/chromeApi'
|
||||
import AiLazyCascader from "@/components/AiLazyCascader.vue"
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
export default {
|
||||
name: 'AiCopyFromTemu',
|
||||
props: ['params'],
|
||||
components: {AiLazyCascader},
|
||||
data() {
|
||||
return {
|
||||
props: {
|
||||
value: 'catId',
|
||||
label: 'catName',
|
||||
lazy: true,
|
||||
lazyLoad (node, resolve) {
|
||||
lazyLoad (value, resolve) {
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-anniston-mms/category/children/list',
|
||||
needMallId: true,
|
||||
data: {
|
||||
parentCatId: node.value || ''
|
||||
parentCatId: value || ''
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.errorCode === 1000000) {
|
||||
@@ -66,6 +72,32 @@ export default {
|
||||
}))
|
||||
}
|
||||
})
|
||||
},
|
||||
lazySearch(queryString, resolve) {
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-anniston-mms/category/search',
|
||||
needMallId: true,
|
||||
data: {
|
||||
searchText: queryString || ''
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.errorCode === 1000000) {
|
||||
resolve(res.result.categoryPaths.map(v => {
|
||||
let value = []
|
||||
let label = []
|
||||
for (let i = 1; i <= 10; i++ ) {
|
||||
if (v['cat'+i+'NodeVO']) {
|
||||
value.push(v['cat'+i+'NodeVO'].catId)
|
||||
label.push(v['cat'+i+'NodeVO'].catName)
|
||||
}
|
||||
}
|
||||
return {
|
||||
catId: value,
|
||||
catName: label
|
||||
}
|
||||
}))
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
form: {
|
||||
|
||||
Reference in New Issue
Block a user