变更
This commit is contained in:
parent
25a377d05c
commit
6105fa0c1e
src
12
src/App.vue
12
src/App.vue
|
@ -9,5 +9,15 @@
|
|||
|
||||
|
||||
<style scoped>
|
||||
|
||||
html{
|
||||
padding:0;
|
||||
margin: 0;
|
||||
}
|
||||
body{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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!')
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user