dev2 #1

Open
panjunjie wants to merge 174 commits from dev2 into main
16 changed files with 271 additions and 216 deletions
Showing only changes of commit 79e179366c - Show all commits

View File

@ -5,5 +5,5 @@
window.ver = "2.0.278";
window.SYS = {CONFIG:{}, URL:{}};</script><script>window._AMapSecurityConfig = {
securityJsCode:"07788e7ebd7e913985722bfc5986999f"
}</script><script src="https://mall.gpxscs.cn/admin/config.js?v=2.0.278"></script><script src="https://mall.gpxscs.cn/admin/im/libs3.6.0.min.js?v=2.0.278"></script><script src="https://mall.gpxscs.cn/admin/im/im.js?v=2.0.278"></script><link href="static/css/chunk-19648027.83a11e8c.css" rel="prefetch"><link href="static/css/chunk-1ada8a0f.50b49cf8.css" rel="prefetch"><link href="static/css/vab-extra.9da8d2d7.css" rel="prefetch"><link href="static/js/chunk-19648027.6233a553.js" rel="prefetch"><link href="static/js/chunk-1ada8a0f.f04968a1.js" rel="prefetch"><link href="static/js/vab-extra.29abc81b.js" rel="prefetch"><link href="static/css/app.d3766ec2.css" rel="preload" as="style"><link href="static/css/element-ui.0e3a750b.css" rel="preload" as="style"><link href="static/js/app.3e9d1db1.js" rel="preload" as="script"><link href="static/js/element-ui.4e8e0db4.js" rel="preload" as="script"><link href="static/js/vue.11eaebc3.js" rel="preload" as="script"><link href="static/css/element-ui.0e3a750b.css" rel="stylesheet"><link href="static/css/app.d3766ec2.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="img/icons/favicon-16x16.png"><link rel="manifest" href="manifest.json"><meta name="theme-color" content="#ffffff"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="apple-mobile-web-app-title" content="xiaofa-admin"><link rel="apple-touch-icon" href="img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="img/icons/safari-pinned-tab.svg" color="#ffffff"><meta name="msapplication-TileImage" content="img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#ffffff"></head><body><noscript></noscript><div id="app"><div class="first-loading-wrp"><div class="loading-wrp"><span class="dot dot-spin"><i></i> <i></i> <i></i> <i></i></span></div><h1>小发同城</h1></div></div><script>if (window.location.hostname !== 'localhost') {
}</script><script src="static/js/element-ui.4e8e0db4.js"></script><script src="static/js/vue.11eaebc3.js"></script><script src="static/js/app.3e9d1db1.js"></script></body></html>
}</script><script src="https://mall.gpxscs.cn/admin/config.js?v=2.0.278"></script><script src="https://mall.gpxscs.cn/admin/im/libs3.6.0.min.js?v=2.0.278"></script><script src="https://mall.gpxscs.cn/admin/im/im.js?v=2.0.278"></script><link href="static/css/chunk-16a348ba.b2a02acb.css" rel="prefetch"><link href="static/css/chunk-19648027.83a11e8c.css" rel="prefetch"><link href="static/css/vab-extra.9da8d2d7.css" rel="prefetch"><link href="static/js/chunk-16a348ba.121557d4.js" rel="prefetch"><link href="static/js/chunk-19648027.6233a553.js" rel="prefetch"><link href="static/js/vab-extra.29abc81b.js" rel="prefetch"><link href="static/css/app.d3766ec2.css" rel="preload" as="style"><link href="static/css/element-ui.0e3a750b.css" rel="preload" as="style"><link href="static/js/app.a6cf206c.js" rel="preload" as="script"><link href="static/js/element-ui.4e8e0db4.js" rel="preload" as="script"><link href="static/js/vue.11eaebc3.js" rel="preload" as="script"><link href="static/css/element-ui.0e3a750b.css" rel="stylesheet"><link href="static/css/app.d3766ec2.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="img/icons/favicon-16x16.png"><link rel="manifest" href="manifest.json"><meta name="theme-color" content="#ffffff"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="apple-mobile-web-app-title" content="xiaofa-admin"><link rel="apple-touch-icon" href="img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="img/icons/safari-pinned-tab.svg" color="#ffffff"><meta name="msapplication-TileImage" content="img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#ffffff"></head><body><noscript></noscript><div id="app"><div class="first-loading-wrp"><div class="loading-wrp"><span class="dot dot-spin"><i></i> <i></i> <i></i> <i></i></span></div><h1>小发同城</h1></div></div><script>if (window.location.hostname !== 'localhost') {
}</script><script src="static/js/element-ui.4e8e0db4.js"></script><script src="static/js/vue.11eaebc3.js"></script><script src="static/js/app.a6cf206c.js"></script></body></html>

View File

@ -2376,7 +2376,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "im/libs3.6.0.min.js"
},
{
"revision": "62134dc4656c68390af26dee2d68581b",
"revision": "216188a2dbc1416af7b3d1a6c05a940d",
"url": "index.html"
},
{
@ -2392,17 +2392,17 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "robots.txt"
},
{
"revision": "74e66eb6e650125de3d5",
"revision": "ceda1ff9b4716f02c5ad",
"url": "static/css/app.d3766ec2.css"
},
{
"revision": "18f99d6c37eb4e63a9c6",
"url": "static/css/chunk-16a348ba.b2a02acb.css"
},
{
"revision": "f5dd29b853f67685e75d",
"url": "static/css/chunk-19648027.83a11e8c.css"
},
{
"revision": "8267ddc79ed68a3ebd70",
"url": "static/css/chunk-1ada8a0f.50b49cf8.css"
},
{
"revision": "7b9212a0410ce12f6058",
"url": "static/css/element-ui.0e3a750b.css"
@ -2636,17 +2636,17 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "static/img/xiaofa-logo.20439423.png"
},
{
"revision": "74e66eb6e650125de3d5",
"url": "static/js/app.3e9d1db1.js"
"revision": "ceda1ff9b4716f02c5ad",
"url": "static/js/app.a6cf206c.js"
},
{
"revision": "18f99d6c37eb4e63a9c6",
"url": "static/js/chunk-16a348ba.121557d4.js"
},
{
"revision": "f5dd29b853f67685e75d",
"url": "static/js/chunk-19648027.6233a553.js"
},
{
"revision": "8267ddc79ed68a3ebd70",
"url": "static/js/chunk-1ada8a0f.f04968a1.js"
},
{
"revision": "7b9212a0410ce12f6058",
"url": "static/js/element-ui.4e8e0db4.js"

View File

@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"precache-manifest.1693fd2bf8280ceb478d91faa090a3de.js"
"precache-manifest.b44202cb526a52c2d46340f379893592.js"
);
workbox.core.setCacheNameDetails({prefix: "xiaofa-admin"});

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/*!
* build: xiaofa-admin
* copyright: https://www.lancerdt.com
* time: 2025-9-4 16:54:39
* time: 2025-9-6 11:56:13
*/
/*!
* Quill Editor v1.3.7

View File

@ -1,5 +1,5 @@
/*!
* build: xiaofa-admin
* copyright: https://www.lancerdt.com
* time: 2025-9-4 16:54:39
* time: 2025-9-6 11:56:13
*/@media only screen and (max-width:767px){.hidden-xs-only{display:none!important}}@media only screen and (min-width:768px){.hidden-sm-and-up{display:none!important}}@media only screen and (min-width:768px) and (max-width:991px){.hidden-sm-only{display:none!important}}@media only screen and (max-width:991px){.hidden-sm-and-down{display:none!important}}@media only screen and (min-width:992px){.hidden-md-and-up{display:none!important}}@media only screen and (min-width:992px) and (max-width:1199px){.hidden-md-only{display:none!important}}@media only screen and (max-width:1199px){.hidden-md-and-down{display:none!important}}@media only screen and (min-width:1200px){.hidden-lg-and-up{display:none!important}}@media only screen and (min-width:1200px) and (max-width:1919px){.hidden-lg-only{display:none!important}}@media only screen and (max-width:1919px){.hidden-lg-and-down{display:none!important}}@media only screen and (min-width:1920px){.hidden-xl-only{display:none!important}}

View File

@ -1,5 +1,5 @@
/*!
* build: xiaofa-admin
* copyright: https://www.lancerdt.com
* time: 2025-9-4 16:54:39
* time: 2025-9-6 11:56:13
*/[data-v-28093814]:export{menu-color:#fff;menu-color-active:#fff;menu-background:#282c34;column-second-menu-background:#fff}.vab-avatar-list[data-v-28093814] .el-avatar{display:inline-block;margin-left:-15px;cursor:pointer;border:3px solid #fff}.echarts{width:600px;height:400px}[data-v-7f7baab5]:export{menu-color:#fff;menu-color-active:#fff;menu-background:#282c34;column-second-menu-background:#fff}@media only screen and (max-width:767px){[data-v-7f7baab5] .vab-cropper-canvas{display:block;float:none;margin:0 auto}[data-v-7f7baab5] .vab-cropper-preview{display:none}}[data-v-7f7baab5] .el-textarea{margin-top:20px}[data-v-7f7baab5] .el-dialog__footer{height:72px}[data-v-7f7baab5] .el-dialog__footer:before{display:block;clear:both;content:""}[data-v-7f7baab5] .el-dialog__footer>div>div{display:inline}[data-v-7f7baab5] .el-dialog__footer>div>div .el-upload-list{display:none}[data-v-7f7baab5] .el-dialog__footer>div>div .el-upload--picture-card{float:right;width:auto;height:32px;line-height:32px;vertical-align:middle;background-color:transparent;border:0;border-radius:0}[data-v-7f7baab5] .el-dialog__footer>div .el-button{float:right;margin-left:10px}.icon-selector-popper .el-card__body{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:20px;cursor:pointer}.icon-selector-popper .el-card__body i{font-size:28px;color:rgba(0,0,0,.65);text-align:center;vertical-align:middle;pointer-events:none;cursor:pointer}.icon-selector-popper .el-pagination{margin:0}[data-v-3aef4cea]:export{menu-color:#fff;menu-color-active:#fff;menu-background:#282c34;column-second-menu-background:#fff}.upload[data-v-3aef4cea]{height:500px}.upload .upload-content .el-upload__tip[data-v-3aef4cea]{display:block;height:30px;line-height:30px}.upload .upload-content[data-v-3aef4cea] .el-upload--picture-card{width:128px;height:128px;margin:3px 8px 8px 8px;border:2px dashed #c0ccda}.upload .upload-content[data-v-3aef4cea] .el-upload-list--picture{margin-bottom:20px}.upload .upload-content[data-v-3aef4cea] .el-upload-list--picture-card .el-upload-list__item{width:128px;height:128px;margin:3px 8px 8px 8px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -43,19 +43,34 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column label="操作" width="120">
<!-- 操作列编辑 + 新增保存按钮 -->
<el-table-column label="操作" width="100">
<template #default="scope">
<!-- 保存按钮点击提交当前行编码修改 -->
<el-button
plain
size="mini"
type="primary"
@click="handleEdit(scope.row)"
type="success"
@click="handleSaveSingle(scope.row)"
:loading="scope.row.saveLoading"
>
编辑
保存
</el-button>
</template>
</el-table-column>
<el-table-column label="商品id" prop="id" width="120px" />
<el-table-column label="商品条码" width="180">
<template #default="scope">
<el-input
v-model="scope.row.barcode"
placeholder="请输入商品条码"
clearable
size="small"
class="barcode-input"
:disabled="scope.row.saveLoading"
@change="handleBarcodeChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="商品主图" width="180px">
<template #default="scope">
<div v-if="scope.row.thumb" class="img-group">
@ -77,13 +92,7 @@
</div>
</template>
</el-table-column>
<el-table-column label="商品编码" prop="barcode" width="150">
<template #default="scope">
<div :title="scope.row.barcode || '无编码'">
{{ scope.row.barcode || '无' }}
</div>
</template>
</el-table-column>
<el-table-column label="商品id" prop="id" width="120px" />
<el-table-column label="分类" prop="category" width="120" />
<el-table-column label="价格" width="120">
<template #default="scope">
@ -105,192 +114,238 @@
:disabled="pagination.total === 0"
/>
</div>
<editGoodsImgs ref="goodsEdit" @success="handleEditSuccess" />
<batchEditBarcode ref="batchEditBarcode" @success="handleEditSuccess" />
</div>
</template>
<script>
import GoodsToolApi from '@/api/goodsTool'
import editGoodsImgs from './editGoodsImgs.vue'
import batchEditBarcode from './batchEditBarcode.vue'
export default {
data() {
return {
tableData: [],
pagination: {
pageNum: 1,
pageSize: 10,
total: 0,
pages: 0,
},
filter: {
name: '',
barcode: '',
barcodeEmty: '', // : 'yes', 'no'
},
multipleSelection: [],
import GoodsToolApi from '@/api/goodsTool'
import batchEditBarcode from './batchEditBarcode.vue'
export default {
data() {
return {
tableData: [],
pagination: {
pageNum: 1,
pageSize: 10,
total: 0,
pages: 0,
},
filter: {
name: '',
barcode: '',
barcodeEmty: '', // : 'yes', 'no'
},
multipleSelection: [],
}
},
components: {
batchEditBarcode,
},
mounted() {
this.handleImgList()
},
methods: {
//
async handleImgList() {
try {
const params = {
pageNum: this.pagination.pageNum,
pageSize: this.pagination.pageSize,
...(this.filter.name && { name: this.filter.name }),
...(this.filter.barcode && { barcode: this.filter.barcode }),
...(this.filter.barcodeEmty && {
barcodeEmty: this.filter.barcodeEmty,
}),
}
const res = await GoodsToolApi.getImgList(params)
//
this.tableData = (res.records || []).map(item => ({
...item,
saveLoading: false, //
originalBarcode: item.barcode, //
}))
this.pagination.total = res.total || 0
this.pagination.pages = res.pages || 0
this.pagination.current = res.current || 1
console.log('商品列表数据获取成功', {
tableData: this.tableData,
pagination: this.pagination,
params: params,
})
} catch (error) {
this.$message.error('获取数据失败,请重试')
this.tableData = []
}
},
components: {
editGoodsImgs,
batchEditBarcode,
},
mounted() {
//
handleSearch() {
this.pagination.pageNum = 1
this.handleImgList()
},
methods: {
async handleImgList() {
try {
//
const params = {
pageNum: this.pagination.pageNum,
pageSize: this.pagination.pageSize,
//
...(this.filter.name && { name: this.filter.name }),
...(this.filter.barcode && { barcode: this.filter.barcode }),
...(this.filter.barcodeEmty && {
barcodeEmty: this.filter.barcodeEmty,
}),
}
const res = await GoodsToolApi.getImgList(params)
this.tableData = res.records || []
this.pagination.total = res.total || 0
this.pagination.pages = res.pages || 0
this.pagination.current = res.current || 1
console.log('商品列表数据获取成功', {
tableData: this.tableData,
pagination: this.pagination,
params: params,
})
} catch (error) {
this.$message.error('获取数据失败,请重试')
this.tableData = []
}
},
//
handleSearch() {
//
this.pagination.pageNum = 1
this.handleImgList()
},
//
handleReset() {
//
this.filter = {
name: '',
barcode: '',
barcodeEmty: '',
}
//
this.pagination.pageNum = 1
this.handleImgList()
},
handleCurrentChange(pageNum) {
this.pagination.pageNum = pageNum
this.handleImgList()
},
handleSizeChange(pageSize) {
this.pagination.pageSize = pageSize
this.pagination.pageNum = 1
this.handleImgList()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
// open
handleEdit(row) {
this.$refs.goodsEdit.open({
isBatch: false, //
data: row, //
})
},
handleBatchEdit() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请先选中需要编辑的商品');
return;
}
this.$refs.batchEditBarcode.open(this.multipleSelection);
},
//
handleEditSuccess() {
this.handleImgList()
//
this.$refs.imgTable.clearSelection()
this.multipleSelection = []
},
handleReset() {
this.filter = {
name: '',
barcode: '',
barcodeEmty: '',
}
this.pagination.pageNum = 1
this.handleImgList()
},
}
//
handleCurrentChange(pageNum) {
this.pagination.pageNum = pageNum
this.handleImgList()
},
handleSizeChange(pageSize) {
this.pagination.pageSize = pageSize
this.pagination.pageNum = 1
this.handleImgList()
},
//
handleSelectionChange(val) {
this.multipleSelection = val
},
//
handleBatchEdit() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请先选中需要编辑的商品');
return;
}
this.$refs.batchEditBarcode.open(this.multipleSelection);
},
//
async handleSaveSingle(row) {
//
if (row.barcode === row.originalBarcode) {
this.$message.info('商品编码未修改,无需保存');
return;
}
//
if (row.barcode && row.barcode.length > 50) {
this.$message.warning('商品编码长度不能超过50个字符');
return;
}
try {
//
row.saveLoading = true;
//
const updateData = [{
id: row.id,
barcode: row.barcode || '', //
}];
let res=await GoodsToolApi.saveBatchBarcode(updateData);
if(res.status==200){
//
row.originalBarcode = row.barcode;
this.$message.success('商品编码保存成功');
}else{
this.$message.error('操作异常');
}
} catch (error) {
//
row.barcode = row.originalBarcode;
this.$message.error('保存失败,请重试');
console.error('单条保存编码失败:', error);
} finally {
//
row.saveLoading = false;
}
},
handleBarcodeChange(row) {
if (row.barcode && row.barcode.length > 50) {
this.$message.warning('商品编码长度不能超过50个字符');
}
},
//
handleEditSuccess() {
this.handleImgList();
this.$refs.imgTable.clearSelection();
this.multipleSelection = [];
},
},
}
</script>
<style lang="scss" scoped>
.filter {
display: flex;
align-items: center;
padding: 15px 20px;
margin-bottom: 15px;
gap: 10px;
border-radius: 5px;
box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
background: #fff;
flex-wrap: wrap;
}
.filter {
display: flex;
align-items: center;
padding: 15px 20px;
margin-bottom: 15px;
gap: 10px;
border-radius: 5px;
box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
background: #fff;
flex-wrap: wrap;
}
.input_item {
width: 200px;
}
.input_item {
width: 200px;
}
.list {
background: #fff;
padding: 20px;
display: flex;
flex-direction: column;
gap: 10px;
border-radius: 5px;
box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
}
.list {
background: #fff;
padding: 20px;
display: flex;
flex-direction: column;
gap: 10px;
border-radius: 5px;
box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
}
.img-group {
position: relative;
display: inline-block;
}
.img-group {
position: relative;
display: inline-block;
}
.img-thumb {
width: 50px;
height: 50px;
cursor: pointer;
border-radius: 3px;
}
.img-thumb {
width: 50px;
height: 50px;
cursor: pointer;
border-radius: 3px;
}
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.no-data {
color: #999;
font-size: 12px;
}
.no-data {
color: #999;
font-size: 12px;
}
::v-deep .el-table__cell {
vertical-align: middle !important;
}
// 使
.barcode-input {
width: 100%;
}
::v-deep .el-pagination {
margin-top: 10px;
text-align: right;
}
</style>
::v-deep .el-table__cell {
vertical-align: middle !important;
}
::v-deep .el-pagination {
margin-top: 10px;
text-align: right;
}
</style>