Bladeren bron

Merge branch 'master' of http://git.mydig.net/Sagoo-Cloud/sagoo-admin-ui

vera_min 3 jaren geleden
bovenliggende
commit
472931b5e9

+ 1 - 0
.env.development

@@ -6,5 +6,6 @@ VITE_API_URL = 'http://zhgy.sagoo.cn:8899/api/v1'
 VITE_IMG_URL = 'http://zhgy.sagoo.cn:8899/'
 VITE_ASSESS_URL = 'http://zhgy.sagoo.cn/base-api/assess/v1'
 VITE_SCREEN_URL = 'http://home.yanglizhi.cn:10003'
+VITE_TOPO_URL = 'http://home.yanglizhi.cn:10001'
 # VITE_API_URL = 'http://sgadserver.wdeveloperw.xyz/api/v1'
 # VITE_IMG_URL = 'http://sgadserver.wdeveloperw.xyz/'

+ 2 - 1
.env.production

@@ -8,4 +8,5 @@ VITE_PUBLIC_PATH = /
 VITE_API_URL = 'http://zhgy.sagoo.cn:8899/api/v1'
 VITE_IMG_URL = 'http://zhgy.sagoo.cn:8899/'
 VITE_ASSESS_URL = 'http://zhgy.sagoo.cn/base-api/assess/v1'
-VITE_SCREEN_URL = 'http://home.yanglizhi.cn:10003'
+VITE_SCREEN_URL = 'http://home.yanglizhi.cn:10003'
+VITE_TOPO_URL = 'http://home.yanglizhi.cn:10001'

+ 8 - 0
src/api/configuration/index.ts

@@ -0,0 +1,8 @@
+import { get, del, post } from '/@/utils/request';
+
+export default {
+  getFolder: () => get('/configure/folder/list'),
+  getList: (folderId: number) => get('/configure/diagram/getInfoByFolderId', { folderId }),
+  del: (ids: string[]) => del('/screen/project/delProjectById', { ids }),
+  add: (data: any) => post('/screen/project/add', data),
+}

+ 4 - 4
src/views/assess/totalIndex/index.vue

@@ -17,8 +17,8 @@
 				</el-button>
 			</div>
 			<el-table :data="tableData.data" style="width: 100%">
-				<el-table-column align="center" prop="title" label="名称" show-overflow-tooltip></el-table-column>
-				<el-table-column align="center" prop="explain" label="描述" show-overflow-tooltip></el-table-column>
+				<el-table-column align="left" prop="title" label="名称"  width="260" show-overflow-tooltip></el-table-column>
+				<el-table-column align="left" prop="explain" label="描述" show-overflow-tooltip></el-table-column>
 				<el-table-column align="center" label="操作" width="180">
 					<template #default="scope">
 						<el-button size="small" type="text"  @click="onOpenEditItem(scope.row)">编辑</el-button>
@@ -44,7 +44,7 @@
 		<EditOrAddItem ref="EditOrAddItem" @fetchList="fetchList" />
 		<DetailItem ref="detailItemRef" />
 
-		
+
 	</div>
 </template>
 
@@ -123,7 +123,7 @@ export default defineComponent({
 			// state.tableData.data = data;
 			// state.tableData.total = state.tableData.data.length;
 			// console.log(data)
-			
+
 		};
 		const fetchList = () => {
 			api.getList().then((res: any) => {

+ 53 - 0
src/views/configuration/list.vue

@@ -0,0 +1,53 @@
+<template>
+	<div class="page">
+		<el-card shadow="hover">
+			<el-table :data="tableData" style="width: 100%" row-key="id" lazy :load="load" :tree-props="{ children: 'children', hasChildren: 'types' }">
+				<!-- <el-table-column type="index" label="序号" width="60" align="center" /> -->
+				<el-table-column prop="id" label="ID" show-overflow-tooltip></el-table-column>
+				<el-table-column prop="folderName" label="文件夹名称" show-overflow-tooltip></el-table-column>
+				<el-table-column prop="name" 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="updatedAt" label="更新时间" min-width="100" align="center"></el-table-column>
+				<el-table-column label="操作" width="100" align="center">
+					<template #default="scope">
+						<el-button size="small" text type="primary" v-if="!scope.row.folderName" @click="view(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>
+		</el-card>
+	</div>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue';
+import api from '/@/api/configuration';
+
+const tableData = ref<any[]>([]);
+
+api.getFolder().then((res: any) => {
+	tableData.value = (res.topology || []).map((item: any) => {
+		return {
+			...item,
+			name: '',
+			folderName: item.name,
+		};
+	});
+});
+
+const load = (row: any, treeNode: unknown, resolve: any) => {
+	api
+		.getList(row.id)
+		.then((res: any) => {
+			resolve(res.data || []);
+		})
+		.catch(() => {
+			resolve([]);
+		});
+};
+
+const view = (row: any) => {
+	window.open(import.meta.env.VITE_TOPO_URL + '#/show/' + row.id);
+};
+</script>

+ 9 - 0
src/views/datahub/modeling/component/detail.vue

@@ -95,6 +95,15 @@ export default defineComponent({
 		const resetForm = () => {
 			state.jsonsData = [];
 			state.jData = [];
+			state.tableData= {
+				data: [],
+				total: 0,
+				loading: false,
+				param: {
+					pageNum: 1,
+					pageSize: 10,
+				},
+			}
 		};
 		// 关闭弹窗
 		const closeDialog = () => {

+ 3 - 1
src/views/datahub/modeling/detail.vue

@@ -82,7 +82,7 @@
 					</el-table-column>
 				</el-table>
 				<pagination
-					v-show="tableData.total > 0"
+					v-show="tableData.data.length > 0"
 					:total="tableData.total"
 					v-model:page="tableData.param.pageNum"
 					v-model:limit="tableData.param.pageSize"
@@ -155,6 +155,8 @@ export default defineComponent({
 			typeList();
 		});
 
+
+
 		const typeList = () => {
 			api.tnode.getList(state.tableData.param).then((res: any) => {
 				state.tableData.data = res.list;

+ 7 - 2
src/views/datahub/modeling/index.vue

@@ -56,7 +56,12 @@
 				<el-table-column label="ID" align="center" prop="id" width="80" />
 				<el-table-column label="模型标识" prop="key" :show-overflow-tooltip="true" />
 				<el-table-column label="模型名称" prop="name" :show-overflow-tooltip="true" />
-
+				<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 prop="createdAt" label="创建时间" align="center"></el-table-column>
 
 				<el-table-column label="操作" width="400" align="center">
@@ -71,7 +76,7 @@
 						>
 							<span>字段管理</span>
 						</router-link>
-						<el-button size="small" text type="success" @click="onOpenRecord(scope.row)" >数据记录</el-button>
+						<el-button size="small" text type="success" @click="onOpenRecord(scope.row)"  v-if="scope.row.status==1">数据记录</el-button>
 						<el-button size="small" text type="warning" @click="onOpenEdit(scope.row)">修改</el-button>
 						<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
 					</template>

+ 20 - 8
src/views/screen/index.vue

@@ -14,7 +14,7 @@
 							<el-icon>
 								<ele-FolderAdd />
 							</el-icon>
-							新增大屏
+							新增大屏项目
 						</el-button>
 					</el-form-item>
 				</el-form>
@@ -41,20 +41,32 @@
 import api from '/@/api/screen';
 import { ElMessageBox, ElMessage } from 'element-plus';
 import { useSearch } from '/@/hooks/useCommon';
-import { getUUID } from '/@/utils/uuid';
 
 const { params, tableData, getList } = useSearch<any[]>(api.getList, 'Data', { name: '', address: '' });
 
 getList();
 
 const add = async () => {
-	await api.add({
-		indexImage: null,
-		projectName: getUUID(),
-		remarks: null,
+	ElMessageBox.prompt('请输入项目名称', '创建大屏项目', {
+		confirmButtonText: '确认',
+		cancelButtonText: '取消',
+		inputValidator: (value: string) => {
+			if (value.trim()) {
+				return true;
+			} else {
+				return '请输入项目名称';
+			}
+		},
+		inputErrorMessage: '请输入项目名称',
+	}).then(async ({ value }) => {
+		await api.add({
+			indexImage: null,
+			projectName: value,
+			remarks: null,
+		});
+		ElMessage.success('新增成功');
+		getList();
 	});
-	ElMessage.success('新增成功');
-	getList();
 };
 
 const edit = async (row: any) => {