This commit is contained in:
sa_10_0 2024-10-23 19:47:37 +08:00
parent 25a377d05c
commit 6105fa0c1e
3 changed files with 58 additions and 32 deletions

View File

@ -9,5 +9,15 @@
<style scoped>
html{
padding:0;
margin: 0;
}
body{
padding: 0;
margin: 0;
overflow: hidden;
width: 100%;
height: 100%;
}
</style>

View File

@ -64,7 +64,7 @@
</el-dialog>
</div>
<!-- 表单-->
<div style="position: absolute;right: 20px;top: 100px;max-width: 60%" >
<div style="position: absolute;right: 20px;top: 100px;max-width: 20%" >
<el-form :model="form" label-width="auto" style="width: 750px" size="large">
<el-form-item label="产品名称">
<el-input v-model="form.name" />
@ -107,9 +107,10 @@
</template>
<script lang="ts" setup>
import { ref,reactive } from 'vue';
import { ref,reactive,onMounted } from 'vue';
import { Delete, Plus, ZoomIn } from '@element-plus/icons-vue';
import type { UploadFile } from 'element-plus';
import myAxios from "@/api/myAxiso";
const dialogImageUrl = ref('');
const dialogVisible = ref(false);
@ -136,7 +137,20 @@ const form = reactive({
label:[],//
desc:'',//
})
// onMounted(() => {
// getProductInformation()
// })
// const getProductInformation = async () => {
// const res: any = await myAxios.get('')
// console.log(res)
// if (res.code === 1 && res.data) {
//
//
// } else {
// message.error(`${res.message}`);
// backPage()
// }
// }
const onSubmit = () => {
console.log('submit!')
}

View File

@ -20,6 +20,8 @@
<template slot-scope="scope">
<el-button type="danger" slot="reference">详情<i class="el-icon-remove-outline"></i></el-button>
<el-button type="success" @click="handleEdit(scope.row)">编辑<i class="el-icon-edit"></i></el-button>
<el-button type="danger" slot="reference">下架<i class="el-icon-remove-outline"></i></el-button>
<el-button type="danger" slot="reference">删除<i class="el-icon-remove-outline"></i></el-button>
<el-popconfirm
class="ml-5"
@ -90,16 +92,16 @@ const reset =()=>{
username.value = ''
}
const form=ref({
selectedItems:'',
uploadedFiles:'',
selectedItems:'',//
uploadedFiles:'',//
name:'',
price:'',
resource:'',
quantity:'',
state:'',
region:'',
label:[],
desc:'',
resource:'',//
quantity:'',//
state:'',//()
region:'',//
label:[],//
desc:'',//
})
const handleEdit = (row: any) => {
dialogTableVisible.value = true
@ -117,26 +119,26 @@ const load = async () => {
})
}
const save = () => {
const formObj = toRaw(form.value)
formObj.isCarbon = formObj.isCarbon == '是' ? true : false
console.log(formObj)
instance.post('/admin/updateOrInsertUser', formObj).then(res => {
if(res.data.code == '200'){
load()
updateSuccess()
}else{
load()
updataFail()
}
})
dialogTableVisible.value = false
}
const handleAdd = async () => {
dialogTableVisible.value = true
form.value = {}
}
// const save = () => {
// const formObj = toRaw(form.value)
// formObj.isCarbon = formObj.isCarbon == '' ? true : false
// console.log(formObj)
// instance.post('/admin/updateOrInsertUser', formObj).then(res => {
// if(res.data.code == '200'){
// load()
// updateSuccess()
// }else{
// load()
// updataFail()
// }
// })
// dialogTableVisible.value = false
// }
//
// const handleAdd = async () => {
// dialogTableVisible.value = true
// form.value = {}
// }
</script>