|
@@ -35,17 +35,23 @@
|
|
</el-icon>
|
|
</el-icon>
|
|
新增接口
|
|
新增接口
|
|
</el-button>
|
|
</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>
|
|
<el-icon>
|
|
<ele-Grid />
|
|
<ele-Grid />
|
|
</el-icon>
|
|
</el-icon>
|
|
批量绑定菜单
|
|
批量绑定菜单
|
|
</el-button>
|
|
</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-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</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 :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 type="index" label="序号" width="60" align="center" /> -->
|
|
<el-table-column prop="id" label="ID" width="100" 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>
|
|
<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 editFormRef = ref()
|
|
const bindRef = ref()
|
|
const bindRef = ref()
|
|
const queryRef = ref()
|
|
const queryRef = ref()
|
|
|
|
+const importing = ref(false)
|
|
const ids = ref<number[]>([])
|
|
const ids = ref<number[]>([])
|
|
|
|
|
|
const { params, tableData, getList, loading } = useSearch<ApiRow[]>(api.api.getList, 'Info', { name: '', address: '', types: -1 })
|
|
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);
|
|
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 = () => {
|
|
const resetQuery = () => {
|
|
queryRef.value.resetFields()
|
|
queryRef.value.resetFields()
|