glj-代码提交

This commit is contained in:
管李杰 2024-07-12 18:00:24 +08:00
parent a3ba1550bd
commit 5f27a923d7
3 changed files with 36 additions and 17 deletions

View File

@ -1,13 +1,18 @@
<template>
<div class="system-add-role-container">
<el-dialog title="新增" v-model="state.isShowDialog" width="769px" draggable>
<el-form :model="state.ruleForm" size="default" label-width="90px" ref="roleRef" :rules="rules">
<el-form :model="state.ruleForm" size="default" label-width="100px" ref="roleRef" :rules="rules">
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="Image title" prop="title">
<el-input v-model="state.ruleForm.title" placeholder="title" clearable></el-input>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="Happen time" prop="happenTime">
<el-date-picker v-model="state.ruleForm.happenTime" type="dates" placeholder="Select occurrence date" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="images">
<el-upload class="avatar-uploader" :show-file-list="false" :auto-upload="true" :http-request="upLoadImg" :data="v" accept="image/*">
@ -101,6 +106,9 @@ const onSubmit = async (el) => {
if (!el) return;
await el.validate((valid, fields) => {
if (valid) {
let time = Date.parse(state.ruleForm.happenTime);
time = new Date(time);
state.ruleForm.happenTime = time;
addInstall(state.ruleForm).then((res) => {
ElMessage.success('新增成功');
emit('callback', res);

View File

@ -1,13 +1,23 @@
<template>
<div class="system-add-role-container">
<el-dialog title="修改" v-model="state.isShowDialog" width="769px" draggable>
<el-form :model="state.ruleForm" size="default" label-width="90px" ref="roleRef" :rules="rules">
<el-form :model="state.ruleForm" size="default" label-width="100px" ref="roleRef" :rules="rules">
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="Image title" prop="title">
<el-input v-model="state.ruleForm.title" placeholder="title" clearable></el-input>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="Happen time" prop="happenTime">
<el-date-picker
v-model="state.ruleForm.happenTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="Select occurrence date"
/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="images">
<el-upload class="avatar-uploader" :show-file-list="false" :auto-upload="true" :http-request="upLoadImg" :data="v" accept="image/*">
@ -68,7 +78,7 @@ const state = reactive({
ruleForm: {
title: '',
link: '',
sort: "",
sort: '',
isLink: 1,
images: null,
},
@ -89,7 +99,7 @@ const openDialog = (row) => {
} else {
state.ruleForm.isLink = 0;
}
console.log(state.ruleForm,"state.ruleForm");
console.log(state.ruleForm, 'state.ruleForm');
});
};
//

View File

@ -30,6 +30,7 @@
</template>
</el-table-column>
<el-table-column prop="title" label="Rotation title"> </el-table-column>
<el-table-column prop="happenTime" label="Happen time"> </el-table-column>
<el-table-column prop="link" label="Jump link"></el-table-column>
<el-table-column label="Operate" width="140">
<template #default="scope">