Kaynağa Gözat

修改暗黑模式及配置信息

yukai 2 yıl önce
ebeveyn
işleme
dc00581278

+ 1 - 0
src/api/notice/index.ts

@@ -14,6 +14,7 @@ export default {
     add: (data: object) => post("/notice/template/add", data),
     delete: (ids: number) => del("/notice/template/delete", { ids }),
     edit: (data: object) => put("/notice/template/edit", data),
+    save: (data: object) => put("/notice/template/save", data),
     detail: (id: number) => get("/notice/template/get", { id }),
     configIddetail: (configId: number) => get("/notice/template/getbyconfig", { configId }),
   },

+ 35 - 45
src/views/iot/noticeservices/config/component/edit.vue

@@ -1,16 +1,17 @@
 <template>
 	<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-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>
 			<template #footer>
 				<span class="dialog-footer">
@@ -25,7 +26,7 @@
 <script lang="ts">
 import { reactive, toRefs, defineComponent, ref, unref } from 'vue';
 import api from '/@/api/notice';
-
+import Editor from '/@/components/editor/index.vue';
 
 import { ElMessage } from 'element-plus';
 import { Delete, Plus, CircleClose, Top, Bottom, Minus, Right } from '@element-plus/icons-vue';
@@ -34,9 +35,8 @@ interface RuleFormState {
 	id: number;
 	name: string;
 	type: string;
-	value:string;
-	doc:string;
-	
+	value: string;
+	doc: string;
 }
 interface DicState {
 	isShowDialog: boolean;
@@ -45,44 +45,38 @@ interface DicState {
 	configData: {};
 	id: number;
 	type_name: string;
-
 }
 
 export default defineComponent({
 	name: 'Edit',
-	components: { Delete, Plus, CircleClose, Minus, Right, Top, Bottom },
+	components: { Delete, Plus, CircleClose, Minus, Right, Top, Bottom, Editor },
 
 	setup(prop, { emit }) {
 		const myRef = ref<HTMLElement | null>(null);
 		const formRef = ref<HTMLElement | null>(null);
 		const state = reactive<DicState>({
 			id: 0,
-			configData:[],
-			type_name:'',
+			configData: [],
+			type_name: '',
 			isShowDialog: false,
 			ruleForm: {
 				id: 0,
-				name: "",
-				type: "notice",
-				value:'',
-				doc:'',
+				name: '',
+				type: 'notice',
+				value: '',
+				doc: '',
 			},
 			rules: {
 				value: [{ required: true, message: '配置内容不能为空', trigger: 'blur' }],
-				
 			},
 		});
 
-
-
-
 		// 打开弹窗
 		const openDialog = (row: RuleFormState | null) => {
-
 			if (row) {
 				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 || [];
 				});
 			}
@@ -90,16 +84,13 @@ export default defineComponent({
 			state.isShowDialog = true;
 		};
 
-		
-
 		const resetForm = () => {
-		
 			state.ruleForm = {
 				id: 0,
-				name: "",
-				type: "notice",
-				value:'',
-				doc:'',
+				name: '',
+				type: 'notice',
+				value: '',
+				doc: '',
 			};
 		};
 		// 关闭弹窗
@@ -117,22 +108,18 @@ export default defineComponent({
 			if (!formWrap) return;
 			formWrap.validate((valid: boolean) => {
 				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(() => {
-							ElMessage.success('插件设置成功');
-							closeDialog(); // 关闭弹窗
-							emit('dataList');
-						});
+						ElMessage.success('插件设置成功');
+						closeDialog(); // 关闭弹窗
+						emit('dataList');
+					});
 				}
 			});
 		};
 
-	
-
-
 		return {
-		
 			openDialog,
 			closeDialog,
 			onCancel,
@@ -145,6 +132,9 @@ export default defineComponent({
 });
 </script>
 <style>
+.el-textarea__inner{
+	min-height: 420px !important;
+}
 .inline {
 	display: inline-flex;
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/views/iot/noticeservices/config/index.vue


+ 2 - 3
src/views/iot/noticeservices/config/setting.vue

@@ -41,7 +41,7 @@
 							<el-icon>
 								<ele-FolderAdd />
 							</el-icon>
-							新增配置
+							新增通知
 						</el-button>
 					</el-form-item>
 				</el-form>
@@ -135,6 +135,7 @@
 					</el-col>
 				</el-row>
 			</div>
+			<div  style="text-align: center;padding: 28px;" v-if="(tableData.total==0)">暂无数据</div>
 			<pagination
 				v-show="tableData.total > 0"
 				:total="tableData.total"
@@ -430,7 +431,6 @@ export default defineComponent({
 }
 
 .ant-btn-link {
-	color: #1d39c4;
 	border-color: transparent;
 	background: transparent;
 	box-shadow: none;
@@ -459,7 +459,6 @@ export default defineComponent({
 	padding: 4px 15px;
 	font-size: 14px;
 	border-radius: 2px;
-	color: rgba(0, 0, 0, 0.85);
 
 }
 .ant-btn > .anticon {

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor