Merge remote-tracking branch 'langye/master'

master
xy 9 months ago
commit 7844b639f6

@ -16,6 +16,15 @@ export function save (data) {
})
}
export function saveMyself (data) {
return request({
url: "/api/backend/user/myself-save",
method: "post",
data
})
}
export function destroy (data) {
return request({
url: "/api/backend/user/delete",

@ -170,23 +170,34 @@
<div class="mycard flow">
<div class="mycard__title">
<span>常用流程</span>
<div>
<el-button
size="mini"
type="primary"
style="padding: 5px 10px"
@click="openQucik"
>批量更改</el-button>
</div>
</div>
<div class="mycard__body flow__body">
<div
v-for="item in usualFlows"
:key="item.key"
@click="toCreate(item)">
<div class="flow-cover">
<template v-if="item.icon">
<Icon class="flow__body--icon" :icon="item.icon"></Icon>
</template>
<template v-else>
<i class="el-icon-edit flow__body--icon"></i>
</template>
<!-- 自己的 常用流程 -->
<div
v-for="item in usualFlows"
:key="item.key"
@click="toCreate(item)">
<div class="flow-cover">
<template v-if="item.icon">
<Icon class="flow__body--icon" :icon="item.icon"></Icon>
</template>
<template v-else>
<i class="el-icon-edit flow__body--icon"></i>
</template>
</div>
<span class="flow__body--name">{{item.name}}
</span>
</div>
<span class="flow__body--name">{{ item.name }}</span>
</div>
</div>
</div>
</div>
@ -285,6 +296,48 @@
frameborder="0"
/>
</vxe-modal>
<!-- 编辑菜单 -->
<vxe-modal
v-model="isShowQuick"
:z-index="zIndex"
transfer
show-zoom
resize
show-footer
show-confirm-button
show-cancel-button
type="confirm"
:fullscreen="$store.getters.device === 'mobile'"
title="常用流程"
:width="defaultModalSize.width"
:height="defaultModalSize.height"
esc-closable
:padding="false"
>
<div class="mycard flow dashboard-container">
<div class="mycard__body flow__body" style="width: 100%;grid-template-columns: repeat(6, 1fr);">
<div
v-for="item in flows"
:key="item.key"
@click="changeCheck(item)">
<div class="flow-cover">
<template v-if="item.icon">
<Icon class="flow__body--icon" :icon="item.icon"></Icon>
</template>
<template v-else>
<i class="el-icon-edit flow__body--icon"></i>
</template>
</div>
<span class="flow__body--name">
<el-checkbox @change="(e)=>{return changeCheck(item,e)}" v-model="item.checked">{{ item.name }}</el-checkbox>
</span>
</div>
</div>
</div>
<template #footer>
<el-button type="primary" :loading="quickLoading" @click="updatequick"></el-button>
</template>
</vxe-modal>
</div>
</template>
@ -299,6 +352,9 @@ import { index as configIndex } from "@/api/config";
import { index } from "@/api/attendance";
import {isExternal} from "@/utils/validate";
import { defaultModalSize } from "@/settings";
import {saveMyself} from "@/api/user"
import {getInfo} from "@/api/me"
export default {
name: "Dashboard",
components: {
@ -310,7 +366,8 @@ export default {
modalUrl: "",
zIndex: PopupManager.nextZIndex(),
isShowModal: false,
isShowQuick:false,
quickLoading:false,
weatherIcon: new Map([
["晴", "el-icon-sunny"],
["阴", "el-icon-cloudy"],
@ -436,22 +493,29 @@ export default {
console.error(err);
}
},
//
changeCheck(item){
this.$set(item,'checked',!item.checked)
this.$forceUpdate()
},
async getUsualFlows() {
try {
await this.getFlows();
const res = await configIndex({
filter: [
{
key: "key",
op: "eq",
value: "dashboard_menus",
},
],
});
this.usualFlows = this.flows.filter(
(i) => res.data[0]?.value?.indexOf(i.id.toString()) !== -1
);
console.log(this.usualFlows);
const res = await getInfo()
this.usualFlows = res.quick_enter?res.quick_enter:[]
// const res = await configIndex({
// filter: [
// {
// key: "key",
// op: "eq",
// value: "dashboard_menus",
// },
// ],
// });
// this.usualFlows = this.flows.filter(
// (i) => res.data[0]?.value?.indexOf(i.id.toString()) !== -1
// );
console.log(res,this.usualFlows);
} catch (err) {
console.error(err);
}
@ -464,6 +528,29 @@ export default {
console.error(err);
}
},
openQucik(){
this.flows.map(flow => {
const isChecked = this.usualFlows.some(usualFlow => usualFlow.id === flow.id);
flow.checked = isChecked
});
this.isShowQuick = true
},
updatequick(){
this.quickLoading = true
let arr = this.flows.filter((i)=> i.checked===true)
saveMyself({
quick_enter:arr
}).then(res=>{
this.$message({
type: 'success',
message: '更改成功!'
})
this.isShowQuick = false
this.quickLoading = false
this.getUsualFlows()
})
},
async getTotal() {
try {
const res = await axios.get(`${process.env.VUE_APP_BASE_API}/api/oa/statistics/notifications`,{
@ -667,6 +754,9 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
font-weight: bold;
padding-left: 20px;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
&::before {
content: "";
@ -815,6 +905,8 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
font-size: 14px;
padding-top: 20px;
text-align: center;
width: 100%;
height: 40px;
}
}
}

Loading…
Cancel
Save