This commit is contained in:
yuanteng 2024-12-04 09:49:37 +08:00
parent 8b40389be5
commit 40412a745b

View File

@ -101,7 +101,7 @@
:total="total" />
</div>
<!-- 编辑/详情表单 -->
<el-dialog v-model="DialogVisible" :title="title">
<!-- <el-dialog v-model="DialogVisible" :title="title">
<el-form label-width="100px" :disabled="disabled">
<el-form-item label="商品编号">
<el-input v-model="editForm.id" disabled></el-input>
@ -183,7 +183,7 @@
<el-button type="primary" @click="saveEdit" :disabled="disabled">确认</el-button>
</span>
</template>
</el-dialog>
</el-dialog> -->
</template>
<script setup lang="ts">
@ -198,23 +198,25 @@ const searchParams: any = ref({ //封装分页
sortField: "id", //ID
sortOrder: "descend" //
})
const fileSimple = ref()
const tableData : any= ref([]);
const appointmentDateArr = ref([])
const disabled = ref(true)
const title = ref('') //
const productName = ref('');
const DialogVisible = ref(false);
const state = ref(''); //select
const tableData : any= ref([]);
const editForm : any = ref({});
const reload : any = inject("reload") //
const uploadProductImg : any = ref() //ref
const uploadProductDetail : any = ref() //ref
const typeList: any = ref([
{
value1: '',
label: ''
}
])
// const fileSimple = ref()
// const uploadProductImg : any = ref() //ref
// const uploadProductDetail : any = ref() //ref
// const typeList: any = ref([
// {
// value1: '',
// label: ''
// }
// ])
onMounted(() => { //
getProductList()
})
@ -225,8 +227,7 @@ const getProductList = async () => {
if (res.data.code === 1) {
tableData.value = res.data.data.records;
total.value = parseInt(res.data.data.total) //
console.log(tableData.value);
console.log('时间--->',tableData.value);
} else {
ElMessage({
message: '获取数据失败',
@ -294,46 +295,46 @@ const reset = () => {
reload()
};
// --
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles)
}
const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //
uploadProductImg.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadProductImg.value!.handleStart(file)
}
const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //
uploadProductDetail.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadProductDetail.value!.handleStart(file)
}
//
const loadForm = (value: any, flag: number) => {
flag ? editForm.value.type = value : editForm.value.festivalOrder = value // flag=1 "" flag=0
}
// const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
// console.log(uploadFile, uploadFiles)
// }
// const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //
// uploadProductImg.value!.clearFiles()
// const file = files[0] as UploadRawFile
// file.uid = genFileId()
// uploadProductImg.value!.handleStart(file)
// }
// const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //
// uploadProductDetail.value!.clearFiles()
// const file = files[0] as UploadRawFile
// file.uid = genFileId()
// uploadProductDetail.value!.handleStart(file)
// }
// //
// const loadForm = (value: any, flag: number) => {
// flag ? editForm.value.type = value : editForm.value.festivalOrder = value // flag=1 "" flag=0
// }
//
const handleChange = async (file: any, flag: number) => {
fileSimple.value = file
let formData = new FormData() // FormData
formData.append("file", fileSimple.value.raw) //fileSimple.value.raw formData
const res = await myAxios({ //
url: '/file/upload/server/not_login',
method: 'post',
headers: {
'content-Type': 'multipart/form-data'
},
data: {
biz: "test",
file: formData.get("file") // formDatafile
}
})
if (res.data.code === 1) {
// flag0 flag1
flag ? editForm.value.detailImg = res.data.data : editForm.value.goodImg = res.data.data
}
}
// const handleChange = async (file: any, flag: number) => {
// fileSimple.value = file
// let formData = new FormData() // FormData
// formData.append("file", fileSimple.value.raw) //fileSimple.value.raw formData
// const res = await myAxios({ //
// url: '/file/upload/server/not_login',
// method: 'post',
// headers: {
// 'content-Type': 'multipart/form-data'
// },
// data: {
// biz: "test",
// file: formData.get("file") // formDatafile
// }
// })
// if (res.data.code === 1) {
// // flag0 flag1
// flag ? editForm.value.detailImg = res.data.data : editForm.value.goodImg = res.data.data
// }
// }
const onSearch = (data : String)=>{ //
searchParams.value.name = data
searchParams.value.current = 1