瀏覽代碼

feat: 接口管理增加api导入功能,优化预警类型图形的背景圆圈,去掉应用编辑中的角色选择

yanglzh 1 年之前
父節點
當前提交
693bb66b69

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

@@ -16,6 +16,7 @@ export default {
     del: (id: number) => del('/system/api/del', { id }),
     edit: (data: object) => put('/system/api/edit', data),
     bindMenus: (bindMenus: any[]) => post('/system/api/bindMenus', { bindMenus }),
+    import: () => post('/system/api/import'),
   },
   menu: {
     getList: (params: object) => get('/system/menu/tree', params),

File diff suppressed because it is too large
+ 0 - 3
src/views/iot/iotmanager/dashboard.vue


+ 16 - 2
src/views/system/api/index.vue

@@ -35,17 +35,23 @@
 							</el-icon>
 							新增接口
 						</el-button>
-						<el-button type="primary" :disabled="!ids.length" @click="bindMenus()" v-auth="'add'">
+						<el-button type="primary" :disabled="!ids.length" @click="bindMenus()" v-auth="'batch'">
 							<el-icon>
 								<ele-Grid />
 							</el-icon>
 							批量绑定菜单
 						</el-button>
+						<el-button type="primary" @click="apiImport()" :loading="importing" v-auth="'import'">
+							<el-icon>
+								<ele-Download />
+							</el-icon>
+							api导入
+						</el-button>
 					</el-form-item>
 				</el-form>
 			</div>
 			<el-table :data="tableData" @selection-change="handleSelectionChange" style="width: 100%" v-loading="loading" :expand-row-keys="[]" row-key="id" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
-				<el-table-column type="selection" width="55" align="center" />
+				<el-table-column v-col="'selection'" type="selection" width="55" align="center" />
 				<!-- <el-table-column type="index" label="序号" width="60" align="center" /> -->
 				<el-table-column prop="id" label="ID" width="100" align="center" />
 				<el-table-column prop="name" v-col="'name'" label="接口名称" show-overflow-tooltip></el-table-column>
@@ -83,6 +89,7 @@ import { useSearch } from '/@/hooks/useCommon'
 const editFormRef = ref()
 const bindRef = ref()
 const queryRef = ref()
+const importing = ref(false)
 const ids = ref<number[]>([])
 
 const { params, tableData, getList, loading } = useSearch<ApiRow[]>(api.api.getList, 'Info', { name: '', address: '', types: -1 })
@@ -103,6 +110,13 @@ const handleSelectionChange = (selection: any[]) => {
 	ids.value = selection.filter(item => item.types === 2).map((item) => item.id);
 };
 
+const apiImport = () => {
+	importing.value = true
+	api.api.import().then(() => {
+		ElMessage.success('导入成功')
+	}).finally(() => importing.value = false)
+};
+
 // 重置表单
 const resetQuery = () => {
 	queryRef.value.resetFields()

+ 0 - 14
src/views/system/application/edit.vue

@@ -28,16 +28,6 @@
 					</template>
 				</el-cascader>
 			</el-form-item>
-			<el-form-item label="角色" prop="roleId">
-				<el-cascader :options="roleData"
-					:props="{ checkStrictly: true, emitPath: false, value: 'id', label: 'name' }"
-					placeholder="请选择角色" clearable class="w100" v-model="formData.roleId">
-					<template #default="{ node, data }">
-						<span>{{ data.name }}</span>
-						<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
-					</template>
-				</el-cascader>
-			</el-form-item>
 			<el-form-item label="应用描述" prop="desc">
 				<el-input v-model="formData.desc" type="textarea" :rows="3" />
 			</el-form-item>
@@ -76,10 +66,6 @@ const props = defineProps({
 		type: Array,
 		default: () => [],
 	},
-	roleData: {
-		type: Array,
-		default: () => [],
-	},
 })
 const baseForm = {
 	id: undefined,

+ 1 - 5
src/views/system/application/index.vue

@@ -54,7 +54,7 @@
 			</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"  :deptData="deptData" :roleData="roleData" @getList="getList()"></EditForm>
+		<EditForm ref="editFormRef"  :deptData="deptData" @getList="getList()"></EditForm>
 	</el-card>
 </template>
   
@@ -68,7 +68,6 @@ import { useSearch } from '/@/hooks/useCommon'
 
 const queryRef = ref()
 const deptData = ref([])
-const roleData = ref([])
 const editFormRef = ref()
 const { params, tableData, getList, loading } = useSearch<any[]>(api.getList, 'Data', { keyWord: '' })
 getList()
@@ -76,9 +75,6 @@ const initTableData = () => {
 	user.dept.getList({status:1}).then((res: any) => {
 		deptData.value = res;
 	});
-	user.role.getList({status:1}).then((res: any) => {
-		roleData.value = res;
-	});
 };
 initTableData();
 const onActionStatus = (item: any) => {

+ 1 - 0
src/views/system/menu/component/list.vue

@@ -18,6 +18,7 @@
 						<el-dropdown-item command="status-状态">状态</el-dropdown-item>
 						<el-dropdown-item command="createdAt-创建时间">创建时间</el-dropdown-item>
 						<el-dropdown-item command="handle-操作">操作</el-dropdown-item>
+						<el-dropdown-item command="selection-复选框">复选框</el-dropdown-item>
 					</el-dropdown-menu>
 				</template>
 			</el-dropdown>

Some files were not shown because too many files changed in this diff