|
@@ -5,7 +5,7 @@
|
|
<el-input v-model="searchForm.name" size="large" placeholder="请输入菜单名称搜索" clearable/>
|
|
<el-input v-model="searchForm.name" size="large" placeholder="请输入菜单名称搜索" clearable/>
|
|
</div>
|
|
</div>
|
|
<div class="ml-3">
|
|
<div class="ml-3">
|
|
- <el-button type="primary" @click="searchClick" size="large">
|
|
|
|
|
|
+ <el-button type="primary" @click="getTableData" size="large">
|
|
<HcIcon name="search-2"/>
|
|
<HcIcon name="search-2"/>
|
|
<span>搜索</span>
|
|
<span>搜索</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -27,9 +27,6 @@
|
|
<el-button size="small" type="primary" @click="eidtModal">新增子项</el-button>
|
|
<el-button size="small" type="primary" @click="eidtModal">新增子项</el-button>
|
|
</template>
|
|
</template>
|
|
</HcTable>
|
|
</HcTable>
|
|
- <template #action>
|
|
|
|
- <HcPages :pages="searchForm" @change="pageChange"></HcPages>
|
|
|
|
- </template>
|
|
|
|
|
|
|
|
<!--菜单新增编辑-->
|
|
<!--菜单新增编辑-->
|
|
<HcDialog bgColor="#ffffff" isToBody :show="addModal" :title="modalTitle + '菜单'" @close="addModalClose" widths="70rem">
|
|
<HcDialog bgColor="#ffffff" isToBody :show="addModal" :title="modalTitle + '菜单'" @close="addModalClose" widths="70rem">
|
|
@@ -94,20 +91,17 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import {ref, watch} from "vue";
|
|
|
|
|
|
+import {onActivated, ref, watch} from "vue";
|
|
|
|
+import mainApi from "~api/system/menu";
|
|
|
|
+import {getArrValue} from "js-fast-way";
|
|
|
|
|
|
-const searchForm = ref({
|
|
|
|
- name: '',
|
|
|
|
- current: 1, size: 20, total: 0
|
|
|
|
|
|
+//页面被激活时
|
|
|
|
+onActivated(() => {
|
|
|
|
+ getTableData()
|
|
})
|
|
})
|
|
-//分页被点击
|
|
|
|
-const pageChange = ({current, size}) => {
|
|
|
|
- searchForm.value.current = current
|
|
|
|
- searchForm.value.size = size
|
|
|
|
-}
|
|
|
|
-const searchClick = () => {
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
+//菜单数据
|
|
|
|
+const searchForm = ref({name: '', parentId: ''})
|
|
const tableColumn = [
|
|
const tableColumn = [
|
|
{key: 'name', name: '菜单名称'},
|
|
{key: 'name', name: '菜单名称'},
|
|
{key: 'name', name: '路由地址'},
|
|
{key: 'name', name: '路由地址'},
|
|
@@ -118,13 +112,19 @@ const tableColumn = [
|
|
{key: 'text', name: '排序'},
|
|
{key: 'text', name: '排序'},
|
|
{key: 'text', name: '上级菜单'},
|
|
{key: 'text', name: '上级菜单'},
|
|
{key: 'action', name: '操作', width: 250}
|
|
{key: 'action', name: '操作', width: 250}
|
|
-
|
|
|
|
]
|
|
]
|
|
-const tableData = ref([
|
|
|
|
- {name: '名称1', text: '文本1', color: 'red'},
|
|
|
|
- {name: '名称2', text: '文本2', color: 'blue'},
|
|
|
|
- {name: '名称3', text: '文本3', color: '无'}
|
|
|
|
-])
|
|
|
|
|
|
+const tableData = ref([])
|
|
|
|
+const getTableData = async () => {
|
|
|
|
+ const {error, code, data} = await mainApi.lazyList(searchForm.value)
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ tableData.value = getArrValue(data)
|
|
|
|
+ } else {
|
|
|
|
+ tableData.value = []
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
const tableCheckedKeys = ref([]);
|
|
const tableCheckedKeys = ref([]);
|
|
const tableSelectionChange = (rows) => {
|
|
const tableSelectionChange = (rows) => {
|
|
tableCheckedKeys.value = rows
|
|
tableCheckedKeys.value = rows
|