feat:注释自动跳转

This commit is contained in:
lixg
2022-11-25 17:34:41 +08:00
parent a9b85f3802
commit 35ba74c3f7
9 changed files with 193 additions and 203 deletions

View File

@@ -29,11 +29,15 @@
</div>
<div class="btns">
<div class="btn btn1" style="margin-right: 20px">
<div
class="btn btn1"
style="margin-right: 20px"
@click="searchAuth"
>
<div class="img1"></div>
<div class="wz">搜索</div>
</div>
<div class="btn btn2">
<div class="btn btn2" @click="resetAuth">
<div class="img2"></div>
<div class="wz">重置</div>
</div>
@@ -55,6 +59,7 @@
<div class="tableBox">
<div class="pa">
<a-pagination
v-if="tableDataTotal > 10"
showSizeChanger="true"
showQuickJumper="true"
hideOnSinglePage="true"
@@ -62,6 +67,7 @@
:current="currentPage"
:total="tableDataTotal"
class="pagination"
@change="changePagination"
/>
</div>
</div>
@@ -126,6 +132,7 @@
<script>
import { toRefs, reactive } from "vue";
import * as api from "../../api/index1";
export default {
name: "ProjPowerList",
props: {
@@ -133,6 +140,10 @@ export default {
type: Boolean,
default: false,
},
selectProjectId: {
type: Number,
default: null,
},
},
setup(props, ctx) {
@@ -142,98 +153,31 @@ export default {
closable: false, //modal右上角的关闭按钮
pageSize: 10,
currentPage: 1,
tableDataTotal: 100,
tableDataTotal: -1,
selectedRowKeys: [],
cancelModal: false, //取消授权弹窗
closeCancel: false, //取消授权弹窗关闭图标
tableData: [
{
key: 1,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 2,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 3,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 4,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 5,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 6,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "归属权",
},
{
key: 7,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "查看权",
},
{
key: 8,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 9,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
{
key: 10,
name: "张三",
com: "产研部",
gang: "产品经理",
number: "20201234",
state: "管理权",
},
// {
// key: 1,
// name: "张三",
// com: "产研部",
// gang: "产品经理",
// number: "20201234",
// state: "管理权",
// },
],
});
const closeDrawer = () => {
ctx.emit("update:ProjPvisible", false);
};
const afterVisibleChange = (bool) => {
console.log("state", bool, props);
if (bool) {
optionAuthPerm();
}
};
const onSelectChange = (selectedRowKeys) => {
console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = selectedRowKeys;
@@ -324,6 +268,48 @@ export default {
];
return columns;
};
//‘获取权限名单
const optionAuthPerm = () => {
let obj = {
keyWord: state.name ? state.name : "",
type: 2,
tag: 1,
opt: 1,
refId: props.selectProjectId,
pageNo: state.currentPage,
pageSize: state.pageSize,
};
console.log("获取权限名单obj", obj);
api
.optionAuthPerm(obj)
.then((res) => {
console.log("获取权限名单成功", res);
if (res.data.code === 200) {
state.tableDataTotal = res.data.data.total;
}
})
.catch((err) => {
console.log("获取权限名单失败", err);
});
};
//分页
const changePagination = (page) => {
state.currentPage = page;
optionAuthPerm();
};
//查询
const searchAuth = () => {
state.currentPage = 1;
optionAuthPerm();
};
//重置
const resetAuth = () => {
state.currentPage = 1;
state.name = null;
optionAuthPerm();
};
return {
...toRefs(state),
closeDrawer,
@@ -331,6 +317,10 @@ export default {
tableDataFunc,
showCancelModal,
closeCancelModal,
afterVisibleChange,
changePagination,
searchAuth,
resetAuth,
};
},
};