|
@@ -1,16 +1,17 @@
|
|
<template>
|
|
<template>
|
|
<div class="system-edit-dic-container">
|
|
<div class="system-edit-dic-container">
|
|
- <el-dialog :title="(ruleForm.id !== 0 ? '设置' : '设置') + '配置插件'" v-model="isShowDialog" width="50%">
|
|
|
|
|
|
+ <el-dialog title="设置配置信息" v-model="isShowDialog" width="50%">
|
|
<el-form :model="ruleForm" ref="formRef" :rules="rules" size="default" label-width="110px">
|
|
<el-form :model="ruleForm" ref="formRef" :rules="rules" size="default" label-width="110px">
|
|
-
|
|
|
|
-
|
|
|
|
- <el-form-item label="配置内容" prop="content">
|
|
|
|
- <el-input v-model="ruleForm.value" type="textarea" placeholder="配置内容,一行一条"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
-
|
|
|
|
- <el-form-item label="配置说明" prop="doc">
|
|
|
|
- <el-input v-model="ruleForm.doc" type="textarea" placeholder="请输入配置说明"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <div style="display: flex; justify-content: space-between">
|
|
|
|
+ <div style="width: 50%; padding: 10px">
|
|
|
|
+ <div>配置内容</div>
|
|
|
|
+ <el-input v-model="ruleForm.value" type="textarea" placeholder="配置内容,一行一条" style="min-height:420px"></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="width: 50%; padding: 10px">
|
|
|
|
+ <div>配置说明</div>
|
|
|
|
+ <div><Editor :is-disable="false" v-model="ruleForm.doc" /></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</el-form>
|
|
</el-form>
|
|
<template #footer>
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<span class="dialog-footer">
|
|
@@ -25,7 +26,7 @@
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { reactive, toRefs, defineComponent, ref, unref } from 'vue';
|
|
import { reactive, toRefs, defineComponent, ref, unref } from 'vue';
|
|
import api from '/@/api/notice';
|
|
import api from '/@/api/notice';
|
|
-
|
|
|
|
|
|
+import Editor from '/@/components/editor/index.vue';
|
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
import { Delete, Plus, CircleClose, Top, Bottom, Minus, Right } from '@element-plus/icons-vue';
|
|
import { Delete, Plus, CircleClose, Top, Bottom, Minus, Right } from '@element-plus/icons-vue';
|
|
@@ -34,9 +35,8 @@ interface RuleFormState {
|
|
id: number;
|
|
id: number;
|
|
name: string;
|
|
name: string;
|
|
type: string;
|
|
type: string;
|
|
- value:string;
|
|
|
|
- doc:string;
|
|
|
|
-
|
|
|
|
|
|
+ value: string;
|
|
|
|
+ doc: string;
|
|
}
|
|
}
|
|
interface DicState {
|
|
interface DicState {
|
|
isShowDialog: boolean;
|
|
isShowDialog: boolean;
|
|
@@ -45,44 +45,38 @@ interface DicState {
|
|
configData: {};
|
|
configData: {};
|
|
id: number;
|
|
id: number;
|
|
type_name: string;
|
|
type_name: string;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'Edit',
|
|
name: 'Edit',
|
|
- components: { Delete, Plus, CircleClose, Minus, Right, Top, Bottom },
|
|
|
|
|
|
+ components: { Delete, Plus, CircleClose, Minus, Right, Top, Bottom, Editor },
|
|
|
|
|
|
setup(prop, { emit }) {
|
|
setup(prop, { emit }) {
|
|
const myRef = ref<HTMLElement | null>(null);
|
|
const myRef = ref<HTMLElement | null>(null);
|
|
const formRef = ref<HTMLElement | null>(null);
|
|
const formRef = ref<HTMLElement | null>(null);
|
|
const state = reactive<DicState>({
|
|
const state = reactive<DicState>({
|
|
id: 0,
|
|
id: 0,
|
|
- configData:[],
|
|
|
|
- type_name:'',
|
|
|
|
|
|
+ configData: [],
|
|
|
|
+ type_name: '',
|
|
isShowDialog: false,
|
|
isShowDialog: false,
|
|
ruleForm: {
|
|
ruleForm: {
|
|
id: 0,
|
|
id: 0,
|
|
- name: "",
|
|
|
|
- type: "notice",
|
|
|
|
- value:'',
|
|
|
|
- doc:'',
|
|
|
|
|
|
+ name: '',
|
|
|
|
+ type: 'notice',
|
|
|
|
+ value: '',
|
|
|
|
+ doc: '',
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
value: [{ required: true, message: '配置内容不能为空', trigger: 'blur' }],
|
|
value: [{ required: true, message: '配置内容不能为空', trigger: 'blur' }],
|
|
-
|
|
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// 打开弹窗
|
|
// 打开弹窗
|
|
const openDialog = (row: RuleFormState | null) => {
|
|
const openDialog = (row: RuleFormState | null) => {
|
|
-
|
|
|
|
if (row) {
|
|
if (row) {
|
|
state.type_name = row.value;
|
|
state.type_name = row.value;
|
|
|
|
|
|
- api.config.getbyname({ name: row.value,type:'notice' }).then((res: any) => {
|
|
|
|
|
|
+ api.config.getbyname({ name: row.value, type: 'notice' }).then((res: any) => {
|
|
state.ruleForm = res || [];
|
|
state.ruleForm = res || [];
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -90,16 +84,13 @@ export default defineComponent({
|
|
state.isShowDialog = true;
|
|
state.isShowDialog = true;
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
const resetForm = () => {
|
|
const resetForm = () => {
|
|
-
|
|
|
|
state.ruleForm = {
|
|
state.ruleForm = {
|
|
id: 0,
|
|
id: 0,
|
|
- name: "",
|
|
|
|
- type: "notice",
|
|
|
|
- value:'',
|
|
|
|
- doc:'',
|
|
|
|
|
|
+ name: '',
|
|
|
|
+ type: 'notice',
|
|
|
|
+ value: '',
|
|
|
|
+ doc: '',
|
|
};
|
|
};
|
|
};
|
|
};
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
@@ -117,22 +108,18 @@ export default defineComponent({
|
|
if (!formWrap) return;
|
|
if (!formWrap) return;
|
|
formWrap.validate((valid: boolean) => {
|
|
formWrap.validate((valid: boolean) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- state.ruleForm.name=state.type_name;
|
|
|
|
- state.ruleForm.type="notice";
|
|
|
|
|
|
+ state.ruleForm.name = state.type_name;
|
|
|
|
+ state.ruleForm.type = 'notice';
|
|
api.config.save(state.ruleForm).then(() => {
|
|
api.config.save(state.ruleForm).then(() => {
|
|
- ElMessage.success('插件设置成功');
|
|
|
|
- closeDialog(); // 关闭弹窗
|
|
|
|
- emit('dataList');
|
|
|
|
- });
|
|
|
|
|
|
+ ElMessage.success('插件设置成功');
|
|
|
|
+ closeDialog(); // 关闭弹窗
|
|
|
|
+ emit('dataList');
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
return {
|
|
return {
|
|
-
|
|
|
|
openDialog,
|
|
openDialog,
|
|
closeDialog,
|
|
closeDialog,
|
|
onCancel,
|
|
onCancel,
|
|
@@ -145,6 +132,9 @@ export default defineComponent({
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
<style>
|
|
<style>
|
|
|
|
+.el-textarea__inner{
|
|
|
|
+ min-height: 420px !important;
|
|
|
|
+}
|
|
.inline {
|
|
.inline {
|
|
display: inline-flex;
|
|
display: inline-flex;
|
|
}
|
|
}
|