4 changed files with 347 additions and 150 deletions
@ -0,0 +1,128 @@ |
|||||
|
<template> |
||||
|
<div class="search"> |
||||
|
<Card> |
||||
|
<Row type="flex" justify="space-between"> |
||||
|
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" |
||||
|
ref="table"></Table> |
||||
|
<Row type="flex" justify="end" class="page"> |
||||
|
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize" |
||||
|
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
||||
|
size="small" show-total show-elevator show-sizer></Page> |
||||
|
</Row> |
||||
|
</Col> |
||||
|
</Row> |
||||
|
</Card> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getShareList |
||||
|
} from "@/api/app"; |
||||
|
export default { |
||||
|
name: "dic-manage", |
||||
|
data() { |
||||
|
return { |
||||
|
searchForm:{ |
||||
|
categoryId: "", |
||||
|
delFlag: 1, |
||||
|
pageNum: 1, |
||||
|
pageSize: "100", |
||||
|
shopId: "" |
||||
|
}, |
||||
|
columns: [ |
||||
|
// 表头 |
||||
|
{ |
||||
|
type: "selection", |
||||
|
width: 60, |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
type: "index", |
||||
|
width: 60, |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: "图片", |
||||
|
key: "productPicture", |
||||
|
minWidth: 60, |
||||
|
render: (h, params) => { |
||||
|
return h("img", { |
||||
|
attrs: { |
||||
|
src: params.row.productPicture, |
||||
|
}, |
||||
|
style: { |
||||
|
cursor: "zoom-in", |
||||
|
width: "80px", |
||||
|
height: "60px", |
||||
|
margin: "10px 0", |
||||
|
"object-fit": "contain", |
||||
|
}, |
||||
|
on: { |
||||
|
click: () => { |
||||
|
this.showPic(params.row); |
||||
|
}, |
||||
|
}, |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: "名称", |
||||
|
key: "productName", |
||||
|
minWidth: 60, |
||||
|
}, |
||||
|
{ |
||||
|
title: "排名", |
||||
|
key: "orderFiled", |
||||
|
width: 100, |
||||
|
}, |
||||
|
{ |
||||
|
title: "操作", |
||||
|
key: "action", |
||||
|
width: 350, |
||||
|
align: "center", |
||||
|
fixed: "right", |
||||
|
render: (h, params) => { |
||||
|
return h("div", [ |
||||
|
h( |
||||
|
"a", { |
||||
|
on: { |
||||
|
click: () => { |
||||
|
this.checkGoods(params.row); |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
"选择" |
||||
|
), |
||||
|
]); |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
data: [], //表单数据 |
||||
|
total: 0, // 表单数据总数 |
||||
|
}; |
||||
|
}, |
||||
|
methods: { |
||||
|
init(v) { |
||||
|
console.log(v) |
||||
|
this.searchForm.shopId = JSON.parse(v).id |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
getDataList() { |
||||
|
getShareList(this.searchForm).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.data = res.result.records; |
||||
|
this.total = res.result.total; |
||||
|
if (this.data.length == 0 && this.searchForm.pageNum > 1) { |
||||
|
this.searchForm.pageNum -= 1; |
||||
|
this.getDataList(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
checkGoods(v){ |
||||
|
this.$emit('on-submit1',v) |
||||
|
} |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
@ -1,126 +1,114 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
<Select |
<Select v-model="currentValue" :size="size" :loading="loading" :placeholder="placeholder" :multiple="multiple" |
||||
v-model="currentValue" |
:disabled="disabled" :filterable="filterable" :transfer="transfer" :clearable="clearable" |
||||
:size="size" |
:placement="placement" :transfer-class-name="transferClassName" :prefix="prefix" |
||||
:loading="loading" |
:max-tag-count="maxTagCount" :max-tag-placeholder="maxTagPlaceholder" @on-change="handleChange" |
||||
:placeholder="placeholder" |
@on-query-change="handleQueryChange" @on-clear="handleClear" @on-open-change="handleOpenChange" |
||||
:multiple="multiple" |
@on-select="handleSelect"> |
||||
:disabled="disabled" |
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{ |
||||
:filterable="filterable" |
|
||||
:transfer="transfer" |
|
||||
:clearable="clearable" |
|
||||
:placement="placement" |
|
||||
:transfer-class-name="transferClassName" |
|
||||
:prefix="prefix" |
|
||||
:max-tag-count="maxTagCount" |
|
||||
:max-tag-placeholder="maxTagPlaceholder" |
|
||||
@on-change="handleChange" |
|
||||
@on-query-change="handleQueryChange" |
|
||||
@on-clear="handleClear" |
|
||||
@on-open-change="handleOpenChange" |
|
||||
@on-select="handleSelect" |
|
||||
> |
|
||||
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{ |
|
||||
item.title |
item.title |
||||
}}</Option> |
}}</Option> |
||||
</Select> |
</Select> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { getDictDataByType } from "@/api/index"; |
import { |
||||
export default { |
getDictDataByType |
||||
name: "dict", |
} from "@/api/index"; |
||||
props: { |
export default { |
||||
value: "", |
name: "dict", |
||||
dict: String, |
props: { |
||||
placeholder: { |
value: "", |
||||
type: String, |
dict: String, |
||||
default: "请选择", |
placeholder: { |
||||
}, |
type: String, |
||||
placement: { |
default: "请选择", |
||||
type: String, |
}, |
||||
default: "bottom-start", |
placement: { |
||||
}, |
type: String, |
||||
size: String, |
default: "bottom-start", |
||||
multiple: { |
}, |
||||
type: Boolean, |
size: String, |
||||
default: false, |
multiple: { |
||||
}, |
type: Boolean, |
||||
disabled: { |
default: false, |
||||
type: Boolean, |
}, |
||||
default: false, |
disabled: { |
||||
}, |
type: Boolean, |
||||
filterable: { |
default: false, |
||||
type: Boolean, |
}, |
||||
default: false, |
filterable: { |
||||
}, |
type: Boolean, |
||||
transfer: { |
default: false, |
||||
type: Boolean, |
}, |
||||
default: false, |
transfer: { |
||||
}, |
type: Boolean, |
||||
transferClassName: String, |
default: false, |
||||
prefix: String, |
}, |
||||
maxTagCount: Number, |
transferClassName: String, |
||||
maxTagPlaceholder: Function, |
prefix: String, |
||||
clearable: { |
maxTagCount: Number, |
||||
type: Boolean, |
maxTagPlaceholder: Function, |
||||
default: true, |
clearable: { |
||||
}, |
type: Boolean, |
||||
}, |
default: true, |
||||
data() { |
}, |
||||
return { |
}, |
||||
currentValue: this.value, |
data() { |
||||
dictData: [], |
return { |
||||
loading: false, |
currentValue: this.value, |
||||
}; |
dictData: [], |
||||
}, |
loading: false, |
||||
methods: { |
}; |
||||
getData(v) { |
}, |
||||
this.loading = true; |
methods: { |
||||
getDictDataByType(v).then((res) => { |
getData(v) { |
||||
this.loading = false; |
this.loading = true; |
||||
if (res.success) { |
|
||||
this.dictData = res.result; |
getDictDataByType(v).then((res) => { |
||||
} |
this.loading = false; |
||||
}); |
if (res.success) { |
||||
}, |
this.dictData = res.result; |
||||
handleChange(v) { |
} |
||||
this.$emit("input", v); |
}); |
||||
this.$emit("on-change", v); |
|
||||
}, |
}, |
||||
handleQueryChange(v) { |
handleChange(v) { |
||||
this.$emit("on-query-change", v); |
this.$emit("input", v); |
||||
}, |
this.$emit("on-change", v); |
||||
handleClear() { |
}, |
||||
this.$emit("on-clear", ""); |
handleQueryChange(v) { |
||||
}, |
this.$emit("on-query-change", v); |
||||
handleOpenChange(v) { |
}, |
||||
this.$emit("on-open-change", v); |
handleClear() { |
||||
}, |
this.$emit("on-clear", ""); |
||||
handleSelect(v) { |
}, |
||||
this.$emit("on-select", v); |
handleOpenChange(v) { |
||||
}, |
this.$emit("on-open-change", v); |
||||
setCurrentValue(value) { |
}, |
||||
if (value === this.currentValue) { |
handleSelect(v) { |
||||
return; |
this.$emit("on-select", v); |
||||
} |
}, |
||||
this.currentValue = value; |
setCurrentValue(value) { |
||||
this.$emit("on-change", this.currentValue); |
if (value === this.currentValue) { |
||||
}, |
return; |
||||
}, |
} |
||||
watch: { |
this.currentValue = value; |
||||
value(val) { |
this.$emit("on-change", this.currentValue); |
||||
this.setCurrentValue(val); |
}, |
||||
}, |
}, |
||||
dict(val) { |
watch: { |
||||
this.getData(val); |
value(val) { |
||||
}, |
this.setCurrentValue(val); |
||||
}, |
}, |
||||
mounted() { |
dict(val) { |
||||
this.getData(this.dict); |
this.getData(val); |
||||
}, |
}, |
||||
}; |
}, |
||||
</script> |
mounted() { |
||||
|
this.getData(this.dict); |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
Loading…
Reference in new issue