Procházet zdrojové kódy

数据建模把描述放出来,菜单管理默认不展开,设备详情 上线下线按钮操作去掉

yanglzh před 2 roky
rodič
revize
9b9aba5e22

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 634 - 648
src/views/iot/device/instance/detail.vue


+ 108 - 108
src/views/iot/rule-engine/send.vue

@@ -1,47 +1,47 @@
 <template>
-	<el-card shadow="hover">
-		<div class="search">
-			<el-form :inline="true">
-				<el-form-item>
-					<!-- <el-button size="default" type="primary" class="ml10" @click="getList(1)">
+  <el-card shadow="hover">
+    <div class="search">
+      <el-form :inline="true">
+        <el-form-item>
+          <!-- <el-button size="default" type="primary" class="ml10" @click="getList(1)">
 							<el-icon>
 								<ele-Search />
 							</el-icon>
 							查询
 						</el-button> -->
-					<el-button type="success" @click="addOrEdit()">
-						<el-icon>
-							<ele-FolderAdd />
-						</el-icon>
-						新增规则编排
-					</el-button>
-				</el-form-item>
-			</el-form>
-		</div>
-		<el-table :data="tableData" style="width: 100%" v-loading="loading">
-			<el-table-column type="index" label="序号" width="80" align="center" />
-			<el-table-column prop="name" label="名称" show-overflow-tooltip></el-table-column>
-			<el-table-column prop="expound" label="说明" show-overflow-tooltip></el-table-column>
-			<el-table-column prop="createdAt" label="创建时间" min-width="100" align="center"></el-table-column>
-			<el-table-column prop="status" label="状态" width="100" align="center">
-				<template #default="scope">
-					<el-tag type="success" size="small" v-if="scope.row.status == 1">已启动</el-tag>
-					<el-tag type="info" size="small" v-else>已停止</el-tag>
-				</template>
-			</el-table-column>
-			<el-table-column label="操作" width="200" align="center">
-				<template #default="scope">
-					<el-button size="small" text type="info" v-if="scope.row.status" @click="setStatus(scope.row, 0)">停止</el-button>
-					<el-button size="small" text type="primary" v-else @click="setStatus(scope.row, 1)">启动</el-button>
-					<el-button size="small" text type="warning" @click="addOrEdit(scope.row)">编辑</el-button>
-					<el-button size="small" text type="warning" @click="edit(scope.row)">规则编辑</el-button>
-					<el-button size="small" text type="danger" @click="onDel(scope.row)">删除</el-button>
-				</template>
-			</el-table-column>
-		</el-table>
-		<pagination v-if="params.total" :total="params.total" v-model:page="params.pageNum" v-model:limit="params.pageSize" @pagination="getList()" />
-		<EditForm ref="editFormRef" @getList="getList()" :types="1"></EditForm>
-	</el-card>
+          <el-button type="success" @click="addOrEdit()">
+            <el-icon>
+              <ele-FolderAdd />
+            </el-icon>
+            新增数据转发
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table :data="tableData" style="width: 100%" v-loading="loading">
+      <el-table-column type="index" label="序号" width="80" align="center" />
+      <el-table-column prop="name" label="名称" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="expound" label="说明" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="createdAt" label="创建时间" min-width="100" align="center"></el-table-column>
+      <el-table-column prop="status" label="状态" width="100" align="center">
+        <template #default="scope">
+          <el-tag type="success" size="small" v-if="scope.row.status == 1">已启动</el-tag>
+          <el-tag type="info" size="small" v-else>已停止</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="200" align="center">
+        <template #default="scope">
+          <el-button size="small" text type="info" v-if="scope.row.status" @click="setStatus(scope.row, 0)">停止</el-button>
+          <el-button size="small" text type="primary" v-else @click="setStatus(scope.row, 1)">启动</el-button>
+          <el-button size="small" text type="warning" @click="addOrEdit(scope.row)">编辑</el-button>
+          <el-button size="small" text type="warning" @click="edit(scope.row)">规则编辑</el-button>
+          <el-button size="small" text type="danger" @click="onDel(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-if="params.total" :total="params.total" v-model:page="params.pageNum" v-model:limit="params.pageSize" @pagination="getList()" />
+    <EditForm ref="editFormRef" @getList="getList()" :types="1"></EditForm>
+  </el-card>
 </template>
 
 <script lang="ts" setup>
@@ -58,90 +58,90 @@ const editFormRef = ref();
 const { params, tableData, getList, loading } = useSearch<any[]>(api.getList, 'Data', { types: 1 });
 
 const headers = {
-	Authorization: 'Bearer ' + JSON.parse(sessionStorage.token),
+  Authorization: 'Bearer ' + JSON.parse(sessionStorage.token),
 };
 const flowsUrl = window.location.origin + '/rule-engine/flows';
 
 getList();
 
 const addOrEdit = async (row?: any) => {
-	if (row) {
-		editFormRef.value.open(row);
-		return;
-	} else {
-		editFormRef.value.open();
-	}
+  if (row) {
+    editFormRef.value.open(row);
+    return;
+  } else {
+    editFormRef.value.open();
+  }
 };
 
 const setStatus = async (row: any, status: number) => {
-	// 找到所有规则
-	const { data: flows } = await axios.get(flowsUrl, { headers });
-
-	const flow = flows.find((item: any) => item.id === row.flowId);
-
-	if (!flow) {
-		ElMessage.error('规则不存在');
-		return;
-	}
-
-	// 改变指定规则状态
-	flow.disabled = status ? false : true;
-
-	// 设置规则状态
-	await axios.post(flowsUrl, flows, { headers });
-
-	api
-		.setStatus(row.id, status)
-		.then(() => {
-			ElMessage.success('操作成功');
-			getList();
-		})
-		.catch(() => {
-			ElMessage.error('操作失败');
-		});
+  // 找到所有规则
+  const { data: flows } = await axios.get(flowsUrl, { headers });
+
+  const flow = flows.find((item: any) => item.id === row.flowId);
+
+  if (!flow) {
+    ElMessage.error('规则不存在');
+    return;
+  }
+
+  // 改变指定规则状态
+  flow.disabled = status ? false : true;
+
+  // 设置规则状态
+  await axios.post(flowsUrl, flows, { headers });
+
+  api
+    .setStatus(row.id, status)
+    .then(() => {
+      ElMessage.success('操作成功');
+      getList();
+    })
+    .catch(() => {
+      ElMessage.error('操作失败');
+    });
 };
 
 const edit = async (row: any) => {
-	localStorage.setItem('auth-tokens', `{"access_token":"${Session.get('token')}"}`);
-	// const url = window.location.protocol + '//' + window.location.hostname + ':1880/rule-engine?access_token=' + Session.get('token') + '#flow/' + row.flowId;
-	const url = '/rule-engine/#flow/' + row.flowId;
-	window.open(url);
+  localStorage.setItem('auth-tokens', `{"access_token":"${Session.get('token')}"}`);
+  // const url = window.location.protocol + '//' + window.location.hostname + ':1880/rule-engine?access_token=' + Session.get('token') + '#flow/' + row.flowId;
+  const url = '/rule-engine/#flow/' + row.flowId;
+  window.open(url);
 };
 
 const onDel = (row: any) => {
-	ElMessageBox.confirm(`此操作将删除:“${row.name}”,是否继续?`, '提示', {
-		confirmButtonText: '确认',
-		cancelButtonText: '取消',
-		type: 'warning',
-	}).then(async () => {
-		// 找到所有规则
-		const { data: flows } = await axios.get(flowsUrl, { headers });
-
-		const flowIndex = flows.findIndex((item: any) => item.id === row.flowId);
-
-		if (flowIndex === -1) {
-			ElMessage.error('规则不存在');
-			return;
-		}
-
-		// 删除指定规则
-		flows.splice(flowIndex, 1);
-
-		// 删除当前规则下的各个节点信息
-		const newFlows = flows.filter((item: any) => {
-			if (item.z === row.flowId) {
-				return false;
-			} else {
-				return true;
-			}
-		});
-
-		// 设置规则状态
-		await axios.post(flowsUrl, newFlows, { headers });
-
-		await api.del([row.id as string]);
-		ElMessage.success('删除成功');
-		getList();
-	});
+  ElMessageBox.confirm(`此操作将删除:“${row.name}”,是否继续?`, '提示', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning',
+  }).then(async () => {
+    // 找到所有规则
+    const { data: flows } = await axios.get(flowsUrl, { headers });
+
+    const flowIndex = flows.findIndex((item: any) => item.id === row.flowId);
+
+    if (flowIndex === -1) {
+      ElMessage.error('规则不存在');
+      return;
+    }
+
+    // 删除指定规则
+    flows.splice(flowIndex, 1);
+
+    // 删除当前规则下的各个节点信息
+    const newFlows = flows.filter((item: any) => {
+      if (item.z === row.flowId) {
+        return false;
+      } else {
+        return true;
+      }
+    });
+
+    // 设置规则状态
+    await axios.post(flowsUrl, newFlows, { headers });
+
+    await api.del([row.id as string]);
+    ElMessage.success('删除成功');
+    getList();
+  });
 };
 </script>

+ 2 - 1
src/views/system/datahub/modeling/index.vue

@@ -42,6 +42,7 @@
         <el-table-column label="ID" align="center" prop="id" width="80" v-col="'id'" />
         <!--				<el-table-column label="模型标识" prop="key" :show-overflow-tooltip="true" />-->
         <el-table-column label="模型名称" prop="name" :show-overflow-tooltip="true" v-col="'name'" />
+        <el-table-column label="描述" prop="desc" :show-overflow-tooltip="true" v-col="'desc'" />
         <el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
           <template #default="scope">
             <el-tag type="success" size="small" v-if="scope.row.status==1">已发布</el-tag>
@@ -138,7 +139,7 @@ export default defineComponent({
     };
     // 打开修改模型弹窗
     const onOpenEdit = (row: TableDataRow) => {
-      editDicRef.value.openDialog(row);
+      editDicRef.value.openDialog({ ...row });
     };
     //打开数据记录
     const onOpenRecord = (row: TableDataRow) => {

+ 1 - 1
src/views/system/menu/index.vue

@@ -25,7 +25,7 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table :data="state.menuTableData" default-expand-all style="width: 100%" row-key="path" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" v-loading="state.loading">
+      <el-table :data="state.menuTableData" :default-expand-all="false" style="width: 100%" row-key="path" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" v-loading="state.loading">
         <el-table-column label="菜单名称" show-overflow-tooltip v-col="'title'">
           <template #default="scope">
             <SvgIcon :name="scope.row.icon" />

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů