变更
This commit is contained in:
parent
25a377d05c
commit
6105fa0c1e
12
src/App.vue
12
src/App.vue
|
@ -9,5 +9,15 @@
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
html{
|
||||||
|
padding:0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</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 :model="form" label-width="auto" style="width: 750px" size="large">
|
||||||
<el-form-item label="产品名称">
|
<el-form-item label="产品名称">
|
||||||
<el-input v-model="form.name" />
|
<el-input v-model="form.name" />
|
||||||
|
@ -107,9 +107,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<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 { Delete, Plus, ZoomIn } from '@element-plus/icons-vue';
|
||||||
import type { UploadFile } from 'element-plus';
|
import type { UploadFile } from 'element-plus';
|
||||||
|
import myAxios from "@/api/myAxiso";
|
||||||
|
|
||||||
const dialogImageUrl = ref('');
|
const dialogImageUrl = ref('');
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
|
@ -136,7 +137,20 @@ const form = reactive({
|
||||||
label:[],//商品标签
|
label:[],//商品标签
|
||||||
desc:'',//详情描述
|
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 = () => {
|
const onSubmit = () => {
|
||||||
console.log('submit!')
|
console.log('submit!')
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<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-button type="success" @click="handleEdit(scope.row)">编辑<i class="el-icon-edit"></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
|
<el-popconfirm
|
||||||
class="ml-5"
|
class="ml-5"
|
||||||
|
@ -90,16 +92,16 @@ const reset =()=>{
|
||||||
username.value = ''
|
username.value = ''
|
||||||
}
|
}
|
||||||
const form=ref({
|
const form=ref({
|
||||||
selectedItems:'',
|
selectedItems:'',//商品编号
|
||||||
uploadedFiles:'',
|
uploadedFiles:'',//商品图片
|
||||||
name:'',
|
name:'',
|
||||||
price:'',
|
price:'',
|
||||||
resource:'',
|
resource:'',//商品类型
|
||||||
quantity:'',
|
quantity:'',//商品数量
|
||||||
state:'',
|
state:'',//商品状态(上架,下架,售罄)
|
||||||
region:'',
|
region:'',//是否为限定产品
|
||||||
label:[],
|
label:[],//商品标签
|
||||||
desc:'',
|
desc:'',//详情描述
|
||||||
})
|
})
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
dialogTableVisible.value = true
|
dialogTableVisible.value = true
|
||||||
|
@ -117,26 +119,26 @@ const load = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const save = () => {
|
// const save = () => {
|
||||||
const formObj = toRaw(form.value)
|
// const formObj = toRaw(form.value)
|
||||||
formObj.isCarbon = formObj.isCarbon == '是' ? true : false
|
// formObj.isCarbon = formObj.isCarbon == '是' ? true : false
|
||||||
console.log(formObj)
|
// console.log(formObj)
|
||||||
instance.post('/admin/updateOrInsertUser', formObj).then(res => {
|
// instance.post('/admin/updateOrInsertUser', formObj).then(res => {
|
||||||
if(res.data.code == '200'){
|
// if(res.data.code == '200'){
|
||||||
load()
|
// load()
|
||||||
updateSuccess()
|
// updateSuccess()
|
||||||
}else{
|
// }else{
|
||||||
load()
|
// load()
|
||||||
updataFail()
|
// updataFail()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
dialogTableVisible.value = false
|
// dialogTableVisible.value = false
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
const handleAdd = async () => {
|
// const handleAdd = async () => {
|
||||||
dialogTableVisible.value = true
|
// dialogTableVisible.value = true
|
||||||
form.value = {}
|
// form.value = {}
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user