Merge branch 'main' of http://154.8.193.216:3030/admin1/jiangchengfeiyi-Web
This commit is contained in:
commit
fef1b41ee0
|
@ -101,7 +101,7 @@
|
||||||
:total="total" />
|
:total="total" />
|
||||||
</div>
|
</div>
|
||||||
<!-- 编辑/详情表单 -->
|
<!-- 编辑/详情表单 -->
|
||||||
<el-dialog v-model="DialogVisible" :title="title">
|
<!-- <el-dialog v-model="DialogVisible" :title="title">
|
||||||
<el-form label-width="100px" :disabled="disabled">
|
<el-form label-width="100px" :disabled="disabled">
|
||||||
<el-form-item label="商品编号">
|
<el-form-item label="商品编号">
|
||||||
<el-input v-model="editForm.id" disabled></el-input>
|
<el-input v-model="editForm.id" disabled></el-input>
|
||||||
|
@ -183,7 +183,7 @@
|
||||||
<el-button type="primary" @click="saveEdit" :disabled="disabled">确认</el-button>
|
<el-button type="primary" @click="saveEdit" :disabled="disabled">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -198,23 +198,25 @@ const searchParams: any = ref({ //封装分页
|
||||||
sortField: "id", //根据ID分类
|
sortField: "id", //根据ID分类
|
||||||
sortOrder: "descend" //降序
|
sortOrder: "descend" //降序
|
||||||
})
|
})
|
||||||
const fileSimple = ref()
|
const tableData : any= ref([]);
|
||||||
|
const appointmentDateArr = ref([])
|
||||||
const disabled = ref(true)
|
const disabled = ref(true)
|
||||||
const title = ref('') //表单名字
|
const title = ref('') //表单名字
|
||||||
const productName = ref('');
|
const productName = ref('');
|
||||||
const DialogVisible = ref(false);
|
const DialogVisible = ref(false);
|
||||||
const state = ref(''); //根据商品上架状态select栏
|
const state = ref(''); //根据商品上架状态select栏
|
||||||
const tableData : any= ref([]);
|
|
||||||
const editForm : any = ref({});
|
const editForm : any = ref({});
|
||||||
const reload : any = inject("reload") //页面重新刷新
|
const reload : any = inject("reload") //页面重新刷新
|
||||||
const uploadProductImg : any = ref() //图片上传的ref绑定
|
// const fileSimple = ref()
|
||||||
const uploadProductDetail : any = ref() //图片上传的ref绑定
|
// const uploadProductImg : any = ref() //图片上传的ref绑定
|
||||||
const typeList: any = ref([
|
// const uploadProductDetail : any = ref() //图片上传的ref绑定
|
||||||
{
|
|
||||||
value1: '',
|
// const typeList: any = ref([
|
||||||
label: ''
|
// {
|
||||||
}
|
// value1: '',
|
||||||
])
|
// label: ''
|
||||||
|
// }
|
||||||
|
// ])
|
||||||
onMounted(() => { //页面加载时获取商品列表和分类页表
|
onMounted(() => { //页面加载时获取商品列表和分类页表
|
||||||
getProductList()
|
getProductList()
|
||||||
})
|
})
|
||||||
|
@ -225,8 +227,7 @@ const getProductList = async () => {
|
||||||
if (res.data.code === 1) {
|
if (res.data.code === 1) {
|
||||||
tableData.value = res.data.data.records;
|
tableData.value = res.data.data.records;
|
||||||
total.value = parseInt(res.data.data.total) //总数据量,用于分页
|
total.value = parseInt(res.data.data.total) //总数据量,用于分页
|
||||||
console.log(tableData.value);
|
console.log('时间--->',tableData.value);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '获取数据失败',
|
message: '获取数据失败',
|
||||||
|
@ -294,46 +295,46 @@ const reset = () => {
|
||||||
reload()
|
reload()
|
||||||
};
|
};
|
||||||
//上传图片移除 --逻辑上移除
|
//上传图片移除 --逻辑上移除
|
||||||
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
// const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
console.log(uploadFile, uploadFiles)
|
// console.log(uploadFile, uploadFiles)
|
||||||
}
|
// }
|
||||||
const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //覆盖商品照片
|
// const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //覆盖商品照片
|
||||||
uploadProductImg.value!.clearFiles()
|
// uploadProductImg.value!.clearFiles()
|
||||||
const file = files[0] as UploadRawFile
|
// const file = files[0] as UploadRawFile
|
||||||
file.uid = genFileId()
|
// file.uid = genFileId()
|
||||||
uploadProductImg.value!.handleStart(file)
|
// uploadProductImg.value!.handleStart(file)
|
||||||
}
|
// }
|
||||||
const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //覆盖商品详情图片
|
// const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //覆盖商品详情图片
|
||||||
uploadProductDetail.value!.clearFiles()
|
// uploadProductDetail.value!.clearFiles()
|
||||||
const file = files[0] as UploadRawFile
|
// const file = files[0] as UploadRawFile
|
||||||
file.uid = genFileId()
|
// file.uid = genFileId()
|
||||||
uploadProductDetail.value!.handleStart(file)
|
// uploadProductDetail.value!.handleStart(file)
|
||||||
}
|
// }
|
||||||
//将 商品类别 赋值到表格里
|
// //将 商品类别 赋值到表格里
|
||||||
const loadForm = (value: any, flag: number) => {
|
// const loadForm = (value: any, flag: number) => {
|
||||||
flag ? editForm.value.type = value : editForm.value.festivalOrder = value //三元运算符 flag=1 是关于"商品类别"选项的值 flag=0 是关于“是否为节日限定”选项的值
|
// flag ? editForm.value.type = value : editForm.value.festivalOrder = value //三元运算符 flag=1 是关于"商品类别"选项的值 flag=0 是关于“是否为节日限定”选项的值
|
||||||
}
|
// }
|
||||||
//图片上传请求 此请求只要选择了图片,就会默认上传
|
//图片上传请求 此请求只要选择了图片,就会默认上传
|
||||||
const handleChange = async (file: any, flag: number) => {
|
// const handleChange = async (file: any, flag: number) => {
|
||||||
fileSimple.value = file
|
// fileSimple.value = file
|
||||||
let formData = new FormData() //这一步很重要 创建一个FormData对象
|
// let formData = new FormData() //这一步很重要 创建一个FormData对象
|
||||||
formData.append("file", fileSimple.value.raw) //fileSimple.value.raw 才是文件主体 将其以文件的格式插入formData
|
// formData.append("file", fileSimple.value.raw) //fileSimple.value.raw 才是文件主体 将其以文件的格式插入formData
|
||||||
const res = await myAxios({ //编写请求,与以前的请求不同,这一次要指定好头部类型和文件类型
|
// const res = await myAxios({ //编写请求,与以前的请求不同,这一次要指定好头部类型和文件类型
|
||||||
url: '/file/upload/server/not_login',
|
// url: '/file/upload/server/not_login',
|
||||||
method: 'post',
|
// method: 'post',
|
||||||
headers: {
|
// headers: {
|
||||||
'content-Type': 'multipart/form-data'
|
// 'content-Type': 'multipart/form-data'
|
||||||
},
|
// },
|
||||||
data: {
|
// data: {
|
||||||
biz: "test",
|
// biz: "test",
|
||||||
file: formData.get("file") // 取出formData对象中的file
|
// file: formData.get("file") // 取出formData对象中的file
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
if (res.data.code === 1) {
|
// if (res.data.code === 1) {
|
||||||
//三元运算 当flag为0时,赋值给商品图片 flag为1时,赋值给详情图片
|
// //三元运算 当flag为0时,赋值给商品图片 flag为1时,赋值给详情图片
|
||||||
flag ? editForm.value.detailImg = res.data.data : editForm.value.goodImg = res.data.data
|
// flag ? editForm.value.detailImg = res.data.data : editForm.value.goodImg = res.data.data
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
const onSearch = (data : String)=>{ //搜索按钮方法
|
const onSearch = (data : String)=>{ //搜索按钮方法
|
||||||
searchParams.value.name = data
|
searchParams.value.name = data
|
||||||
searchParams.value.current = 1
|
searchParams.value.current = 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user