This commit is contained in:
chen-xin-zhi 2024-12-04 09:50:03 +08:00
commit fef1b41ee0

View File

@ -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") // formDatafile // file: formData.get("file") // formDatafile
} // }
}) // })
if (res.data.code === 1) { // if (res.data.code === 1) {
// flag0 flag1 // // flag0 flag1
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