Browse Source

增加新增修改弹框

wangqin
刘朋 9 months ago
parent
commit
30c842c28a
  1. 144
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/AddNEditDialog.vue
  2. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/index.vue

144
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/AddNEditDialog.vue

@ -0,0 +1,144 @@
<template>
<Dialog v-model="modelVisible" :title="data ? '修改' : '新增'">
<div class='AddNEditDialog'>
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList" column="1" labelWidth="90px" />
</div>
<template #footer>
<Button style="background-color: rgba(0, 179, 204, .3);" @click.native="modelVisible = false, submitting = false">
取消
</Button>
<Button @click.native="handleSubmit" :loading="submitting">
确定
</Button>
</template>
</Dialog>
</template>
<script>
import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue"
import Form from '@screen/components/FormConfig';
import request from "@/utils/request";
import { getSelectOptionsStation } from "@screen/pages/control/event/businessDataManagement/utils.js";
import { Message } from "element-ui";
import * as PresetFormItems from "@screen/common/PresetFormItems.js";
export default {
name: 'AddNEditDialog',
components: {
Dialog,
Button,
Form
},
model: {
prop: 'visible',
event: "update:value"
},
props: {
visible: Boolean,
data: Object
},
inject: ['setCurrentPage'],
data() {
return {
submitting: false,
formData: {},
formList: [
{
label: "信息级别:",
key: "level",
type: "RadioGroup",
isAlone: true,
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
label: "影响通行",
},
{
key: "2",
label: "不影响通行",
},
],
},
},
PresetFormItems.releaseChannel,
{
label: "审核方式:",
key: "level",
type: "RadioGroup",
isAlone: true,
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
label: "单人审核",
},
{
key: "2",
label: "双人审核",
},
],
},
},
{
label: "启用日期:",
key: "startDate",
type: "DatePicker",
required: true
}
]
}
},
computed: {
modelVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:value', val)
}
}
},
watch: {
modelVisible: {
immediate: true,
handler(bool) {
if (!bool) return;
this.formData = {
...this.data
}
this.getOptions();
}
}
},
methods: {
getOptions() {
},
handleSubmit() {
}
},
}
</script>
<style lang='scss' scoped>
.AddNEditDialog {
width: 450px;
height: 200px;
display: flex;
flex-direction: column;
gap: 15px;
.tips {
font-size: 12px;
}
}
</style>

10
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/index.vue

@ -40,6 +40,7 @@ import Pagination from '@screen/components/Pagination.vue';
import InputSearch from '@screen/components/InputSearch/index.vue';
import Card from './components/Card';
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue';
import AddNEditDialog from "./components/AddNEditDialog.vue";
import { searchFormList } from './data';
@ -49,20 +50,27 @@ export default {
Pagination,
InputSearch,
Card,
ButtonGradient
ButtonGradient,
AddNEditDialog
},
data() {
return {
searchFormList,
data: [],
addNEditDialogVisible: false,
dialogData: null
}
},
methods: {
handleOpenDialogAddEdit(data) {
console.log('data', data);
this.addNEditDialogVisible = true;
this.dialogData = data;
},
handleSearch(data) {
// this.searchData = data;
// this.getData();
},
}
}
</script>

Loading…
Cancel
Save