提交 90015874 authored 作者: 刘旭's avatar 刘旭

上传构建

上级 c8150b66
......@@ -9,6 +9,8 @@
},
"dependencies": {
"@element-plus/icons-vue": "^1.1.4",
"@wangeditor/editor": "^5.1.22",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^0.24.0",
"echarts": "^5.3.0",
"element-plus": "^2.2.12",
......
<template>
<div style="border: 1px solid #ccc">
<Toolbar
style="border-bottom: 1px solid #ccc"
:editor="editorRef"
:defaultConfig="toolbarConfig"
:mode="mode"
/>
<Editor
style="height: 500px; overflow-y: hidden;"
v-model="valueHtml"
:defaultConfig="editorConfig"
:mode="mode"
@onCreated="handleCreated"
/>
</div>
</template>
<script>
import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { onBeforeUnmount, ref, shallowRef, onMounted } from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
export default {
components: { Editor, Toolbar },
setup() {
// 编辑器实例,必须用 shallowRef
const editorRef = shallowRef()
// 内容 HTML
const valueHtml = ref('<p>hello</p>')
// 模拟 ajax 异步获取内容
onMounted(() => {
setTimeout(() => {
valueHtml.value = '<p>模拟 Ajax 异步设置内容</p>'
}, 1500)
})
const toolbarConfig = {}
const editorConfig = { placeholder: '请输入内容...' }
// 组件销毁时,也及时销毁编辑器
onBeforeUnmount(() => {
const editor = editorRef.value
if (editor == null) return
editor.destroy()
})
const handleCreated = (editor) => {
editorRef.value = editor // 记录 editor 实例,重要!
}
return {
editorRef,
valueHtml,
mode: 'default', // 或 'simple'
toolbarConfig,
editorConfig,
handleCreated
};
}
}
</script>
\ No newline at end of file
import { request } from '../config'
export function listGoods(params: any) {
return request({
url: '/goods/list',
method: 'get',
params
})
}
export function deleteGoods(data: any) {
return request({
url: '/goods/delete',
method: 'post',
data
})
}
export function publishGoods(data: any) {
return request({
url: '/goods/create',
method: 'post',
data
})
}
export function detailGoods(id: number) {
return request({
url: '/goods/detail',
method: 'get',
params: { id }
})
}
export function editGoods(data: any) {
return request({
url: '/goods/update',
method: 'post',
data
})
}
export function listCatAndBrand() {
return request({
url: '/goods/catAndBrand',
method: 'get'
})
}
<template>
<div class="app-container">
<!-- 查询和其他操作 -->
<div class="filter-container">
<el-input v-model="listQuery.goodsId" clearable class="filter-item" style="width: 160px"
placeholder="请输入商品ID" />
<el-input v-model="listQuery.goodsSn" clearable class="filter-item" style="width: 160px"
placeholder="请输入商品编号" />
<el-input v-model="listQuery.name" clearable class="filter-item" style="width: 160px"
placeholder="请输入商品名称" />
<el-button class="filter-item" type="primary" icon="search" @click="handleFilter">查找</el-button>
<el-button class="filter-item" type="primary" icon="edit" @click="handleCreate">添加</el-button>
<el-button :loading="downloadLoading" class="filter-item" type="primary" icon="download"
@click="handleDownload">导出</el-button>
</div>
<!-- 查询结果 -->
<el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" border fit highlight-current-row>
<el-table-column type="expand">
<template #default="props">
<el-form label-position="left" class="table-expand">
<el-form-item label="商品编号">
<span>{{ props.row.goodsSn }}</span>
</el-form-item>
<el-form-item label="宣传画廊">
<el-image v-for="pic in props.row.gallery" :key="pic" :src="pic" class="gallery"
:preview-src-list="props.row.gallery" style="width: 40px; height: 40px" />
</el-form-item>
<el-form-item label="商品介绍">
<span>{{ props.row.brief }}</span>
</el-form-item>
<el-form-item label="商品单位">
<span>{{ props.row.unit }}</span>
</el-form-item>
<el-form-item label="关键字">
<span>{{ props.row.keywords }}</span>
</el-form-item>
<el-form-item label="类目ID">
<span>{{ props.row.categoryId }}</span>
</el-form-item>
<el-form-item label="品牌商ID">
<span>{{ props.row.brandId }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column align="center" label="商品ID" prop="id" />
<el-table-column align="center" min-width="100" label="名称" prop="name" />
<el-table-column align="center" property="iconUrl" label="图片">
<template #default="scope">
<el-image :src="thumbnail(scope.row.picUrl)"
:preview-src-list="toPreview(scope.row, scope.row.picUrl)" style="width: 40px; height: 40px" />
</template>
</el-table-column>
<el-table-column align="center" property="iconUrl" label="分享图">
<template #default="scope">
<img :src="scope.row.shareUrl" width="40" />
</template>
</el-table-column>
<el-table-column align="center" label="详情" prop="detail">
<template #default="scope">
<el-dialog :visible.sync="detailDialogVisible" title="商品详情">
<div class="goods-detail-box" v-html="goodsDetail" />
</el-dialog>
<el-button type="primary" size="small" @click="showDetail(scope.row.detail)">查看</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="市场售价" prop="counterPrice" />
<el-table-column align="center" label="当前价格" prop="retailPrice" />
<el-table-column align="center" label="是否新品" prop="isNew">
<template #default="scope">
<el-tag :type="scope.row.isNew ? 'success' : 'error'">{{
scope.row.isNew ? "新品" : "非新品"
}}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="是否热品" prop="isHot">
<template #default="scope">
<el-tag :type="scope.row.isHot ? 'success' : 'error'">{{
scope.row.isHot ? "热品" : "非热品"
}}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="是否在售" prop="isOnSale">
<template #default="scope">
<el-tag :type="scope.row.isOnSale ? 'success' : 'error'">{{
scope.row.isOnSale ? "在售" : "未售"
}}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
<template #default="scope">
<el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <el-tooltip placement="top" content="返回顶部">
<back-to-top :visibility-height="100" />
</el-tooltip> -->
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { ElMessageBox, ElNotification } from "element-plus";
import { listGoods, deleteGoods } from "@/services/api/commodityManage/list";
import { thumbnail, toPreview } from "@/utils/index";
import { useRouter } from "vue-router";
let router = useRouter();
let list = ref([]);
let total = ref(0);
let listLoading = ref(true);
let listQuery = ref({
page: 1,
limit: 20,
goodsSn: undefined,
name: undefined,
sort: "add_time",
order: "desc",
} as any);
let goodsDetail = ref("");
let detailDialogVisible = ref(false);
let downloadLoading = ref(false);
let getList = () => {
listLoading.value = true;
listGoods(listQuery)
.then((res: any) => {
list.value = res.data.list;
total.value = res.data.total;
listLoading.value = false;
})
.catch(() => {
list.value = [];
total.value = 0;
listLoading.value = false;
});
};
getList()
let handleFilter = () => {
listQuery.value.page = 1;
getList();
};
let handleCreate = () => {
// router.push({ path: "/goods/create" });
};
let handleUpdate = (row: any) => {
// router.push({ path: "/goods/edit", query: { id: row.id } });
};
let showDetail = (detail: any) => {
goodsDetail = detail;
detailDialogVisible.value = true;
};
let handleDelete = (row: any) => {
ElMessageBox.confirm("确定删除?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
deleteGoods(row)
.then((res: any) => {
ElNotification({
type: "success",
title: "成功",
message: "删除成功",
});
getList();
})
.catch((res: any) => {
ElNotification({
type: "error",
title: "失败",
message: res.data.errmsg,
});
});
})
.catch(() => { });
};
let handleDownload = () => {
// downloadLoading.value = true;
// import("@/vendor/Export2Excel").then((excel) => {
// const tHeader = [
// "商品ID",
// "商品编号",
// "名称",
// "专柜价格",
// "当前价格",
// "是否新品",
// "是否热品",
// "是否在售",
// "首页主图",
// "宣传图片列表",
// "商品介绍",
// "详细介绍",
// "商品图片",
// "商品单位",
// "关键字",
// "类目ID",
// "品牌商ID",
// ];
// const filterVal = [
// "id",
// "goodsSn",
// "name",
// "counterPrice",
// "retailPrice",
// "isNew",
// "isHot",
// "isOnSale",
// "listPicUrl",
// "gallery",
// "brief",
// "detail",
// "picUrl",
// "goodsUnit",
// "keywords",
// "categoryId",
// "brandId",
// ];
// excel.export_json_to_excel2(tHeader, list, filterVal, "商品信息");
downloadLoading.value = false;
// });
};
</script>
<style>
.table-expand {
font-size: 0;
padding-left: 60px;
}
.table-expand label {
width: 100px;
color: #99a9bf;
}
.table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
}
.gallery {
width: 80px;
margin-right: 10px;
}
.goods-detail-box img {
width: 100%;
}
</style>
\ No newline at end of file
差异被折叠。
......@@ -2,14 +2,14 @@ import os, sys
import zipfile
import shutil
cmd = "git clone http://192.168.2.95:8090/xuxu/SEMI \t\n"
cmd += "cd SEMI \t\n"
cmd = "git clone http://192.168.0.27:8090/xuxu/yongxinda-admin \t\n"
cmd += "cd yongxinda-admin \t\n"
cmd += "yarn install\t\n"
cmd += "yarn run build\t\n"
cmd += "docker build -t semi-portal .\t\n"
cmd += "docker tag semi-portal 192.168.2.141:5000/semi-portal\t\n"
cmd += "docker push 192.168.2.141:5000/semi-portal\t\n"
cmd += "docker build -t yongxinda-admin .\t\n"
cmd += "docker tag yongxinda-admin 192.168.0.26:5000/yongxinda-admin\t\n"
cmd += "docker push 192.168.0.26:5000/yongxinda-admin\t\n"
cmd += "cd .. \t\n"
cmd += "rm -r -f SEMI \t\n"
cmd += "rm -r -f yongxinda-admin \t\n"
os.system(cmd)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论