glj-代码提交
This commit is contained in:
parent
a3ba1550bd
commit
5f27a923d7
|
@ -1,13 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-add-role-container">
|
<div class="system-add-role-container">
|
||||||
<el-dialog title="新增" v-model="state.isShowDialog" width="769px" draggable>
|
<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-row :gutter="35">
|
||||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="Image title" prop="title">
|
<el-form-item label="Image title" prop="title">
|
||||||
<el-input v-model="state.ruleForm.title" placeholder="title" clearable></el-input>
|
<el-input v-model="state.ruleForm.title" placeholder="title" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="images">
|
<el-form-item label="images">
|
||||||
<el-upload class="avatar-uploader" :show-file-list="false" :auto-upload="true" :http-request="upLoadImg" :data="v" accept="image/*">
|
<el-upload class="avatar-uploader" :show-file-list="false" :auto-upload="true" :http-request="upLoadImg" :data="v" accept="image/*">
|
||||||
|
@ -28,12 +33,12 @@
|
||||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="Sort">
|
<el-form-item label="Sort">
|
||||||
<el-radio-group v-model="state.ruleForm.sort">
|
<el-radio-group v-model="state.ruleForm.sort">
|
||||||
<el-radio style="margin-right:1rem" label="1" size="large" border>First</el-radio>
|
<el-radio style="margin-right: 1rem" label="1" size="large" border>First</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="2" size="large" border>Second</el-radio>
|
<el-radio style="margin-right: 1rem" label="2" size="large" border>Second</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="3" size="large" border>Third</el-radio>
|
<el-radio style="margin-right: 1rem" label="3" size="large" border>Third</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="4" size="large" border>Fourth</el-radio>
|
<el-radio style="margin-right: 1rem" label="4" size="large" border>Fourth</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="5" size="large" border>Fifth</el-radio>
|
<el-radio style="margin-right: 1rem" label="5" size="large" border>Fifth</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="6" size="large" border>Sixth</el-radio>
|
<el-radio style="margin-right: 1rem" label="6" size="large" border>Sixth</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -101,6 +106,9 @@ const onSubmit = async (el) => {
|
||||||
if (!el) return;
|
if (!el) return;
|
||||||
await el.validate((valid, fields) => {
|
await el.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
let time = Date.parse(state.ruleForm.happenTime);
|
||||||
|
time = new Date(time);
|
||||||
|
state.ruleForm.happenTime = time;
|
||||||
addInstall(state.ruleForm).then((res) => {
|
addInstall(state.ruleForm).then((res) => {
|
||||||
ElMessage.success('新增成功');
|
ElMessage.success('新增成功');
|
||||||
emit('callback', res);
|
emit('callback', res);
|
||||||
|
|
|
@ -1,13 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-add-role-container">
|
<div class="system-add-role-container">
|
||||||
<el-dialog title="修改" v-model="state.isShowDialog" width="769px" draggable>
|
<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-row :gutter="35">
|
||||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="Image title" prop="title">
|
<el-form-item label="Image title" prop="title">
|
||||||
<el-input v-model="state.ruleForm.title" placeholder="title" clearable></el-input>
|
<el-input v-model="state.ruleForm.title" placeholder="title" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="images">
|
<el-form-item label="images">
|
||||||
<el-upload class="avatar-uploader" :show-file-list="false" :auto-upload="true" :http-request="upLoadImg" :data="v" accept="image/*">
|
<el-upload class="avatar-uploader" :show-file-list="false" :auto-upload="true" :http-request="upLoadImg" :data="v" accept="image/*">
|
||||||
|
@ -28,12 +38,12 @@
|
||||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="Sort">
|
<el-form-item label="Sort">
|
||||||
<el-radio-group v-model="state.ruleForm.sort">
|
<el-radio-group v-model="state.ruleForm.sort">
|
||||||
<el-radio style="margin-right:1rem" label="1" size="large" border>First</el-radio>
|
<el-radio style="margin-right: 1rem" label="1" size="large" border>First</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="2" size="large" border>Second</el-radio>
|
<el-radio style="margin-right: 1rem" label="2" size="large" border>Second</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="3" size="large" border>Third</el-radio>
|
<el-radio style="margin-right: 1rem" label="3" size="large" border>Third</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="4" size="large" border>Fourth</el-radio>
|
<el-radio style="margin-right: 1rem" label="4" size="large" border>Fourth</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="5" size="large" border>Fifth</el-radio>
|
<el-radio style="margin-right: 1rem" label="5" size="large" border>Fifth</el-radio>
|
||||||
<el-radio style="margin-right:1rem" label="6" size="large" border>Sixth</el-radio>
|
<el-radio style="margin-right: 1rem" label="6" size="large" border>Sixth</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -68,7 +78,7 @@ const state = reactive({
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
title: '',
|
title: '',
|
||||||
link: '',
|
link: '',
|
||||||
sort: "",
|
sort: '',
|
||||||
isLink: 1,
|
isLink: 1,
|
||||||
images: null,
|
images: null,
|
||||||
},
|
},
|
||||||
|
@ -86,10 +96,10 @@ const openDialog = (row) => {
|
||||||
}
|
}
|
||||||
if (da.link) {
|
if (da.link) {
|
||||||
state.ruleForm.isLink = 1;
|
state.ruleForm.isLink = 1;
|
||||||
}else{
|
} else {
|
||||||
state.ruleForm.isLink = 0;
|
state.ruleForm.isLink = 0;
|
||||||
}
|
}
|
||||||
console.log(state.ruleForm,"state.ruleForm");
|
console.log(state.ruleForm, 'state.ruleForm');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//上传
|
//上传
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="title" label="Rotation title"> </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 prop="link" label="Jump link"></el-table-column>
|
||||||
<el-table-column label="Operate" width="140">
|
<el-table-column label="Operate" width="140">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
|
Loading…
Reference in New Issue