diff --git a/src/api/dashboard/notice.js b/src/api/dashboard/notice.js
index 6be0d2c..9983bd0 100644
--- a/src/api/dashboard/notice.js
+++ b/src/api/dashboard/notice.js
@@ -1,10 +1,11 @@
import request from "@/utils/request";
-export function getNotice(params){
+export function getNotice(params,noLoading = false){
return request({
method:'get',
url:'/api/admin/notice/index',
- params
+ params,
+ noLoading
})
}
@@ -16,10 +17,11 @@ export function readNotice(params){
})
}
-export function statistic(params){
+export function statistic(params,noLoading = false){
return request({
method:'get',
url:'/api/admin/notice/statistic',
- params
+ params,
+ noLoading
})
}
diff --git a/src/layout/components/worker/index.vue b/src/layout/components/worker/index.vue
index 3cec04d..7440000 100644
--- a/src/layout/components/worker/index.vue
+++ b/src/layout/components/worker/index.vue
@@ -27,6 +27,7 @@
@@ -44,20 +45,6 @@ const files = require.context(
let cpns = files.keys().map((key) => {
return files(key).default || files(key);
});
-const componentsRegister = () => {
- let obj = {};
- cpns.forEach((cpn) => {
- Object.defineProperty(obj, cpn.name, {
- value: cpn,
- enumerable: true,
- writable: true,
- configurable: true,
- });
- });
- obj["GridLayout"] = VueGridLayout.GridLayout;
- obj["GridItem"] = VueGridLayout.GridItem;
- return obj;
-};
let layout = cpns.map((item) => {
return {
...item.layout,
@@ -65,20 +52,37 @@ let layout = cpns.map((item) => {
};
});
export default {
- components: componentsRegister(),
+ components: {
+ "GridLayout": VueGridLayout.GridLayout,
+ "GridItem": VueGridLayout.GridItem
+ },
+ provide() {
+ return {
+ getStatistic: () => this.data
+ }
+ },
data() {
return {
- layoutList:[]
+ layoutList:[],
+ data: {
+ statistic: {}
+ }
+ }
+ },
+ methods: {
+ sendData(data) {
+ this.data.statistic = data
}
},
- methods: {},
computed: {},
created() {
- this.layoutList = this.$store.state.app.workerLayout.map(item => {
- layout.forEach(lay => {
- lay.i === item.i ? item.component = lay.component : ''
+ this.$store.dispatch('app/getLayout').then(res => {
+ this.layoutList = res.map(item => {
+ layout.forEach(lay => {
+ lay.i === item.i ? item.component = lay.component : ''
+ })
+ return item
})
- return item
})
},
}
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index 575e593..fdc70de 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -1,52 +1,93 @@
-import Cookies from 'js-cookie'
-
+import Cookies from "js-cookie";
+import { Message } from "element-ui";
+import { show, save } from "@/api/system/expand";
+import store from "@/store";
const state = {
sidebar: {
- opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
- withoutAnimation: false
+ opened: Cookies.get("sidebarStatus")
+ ? !!+Cookies.get("sidebarStatus")
+ : true,
+ withoutAnimation: false,
},
- device: 'desktop',
- workerLayout:[],
-}
-
+ device: "desktop",
+ workerLayout: {},
+};
+const getter = {
+ layout: (state) => {
+ return state["app/workerLayout"]?.config || [];
+ },
+};
const mutations = {
- TOGGLE_SIDEBAR: state => {
- state.sidebar.opened = !state.sidebar.opened
- state.sidebar.withoutAnimation = false
+ TOGGLE_SIDEBAR: (state) => {
+ state.sidebar.opened = !state.sidebar.opened;
+ state.sidebar.withoutAnimation = false;
if (state.sidebar.opened) {
- Cookies.set('sidebarStatus', 1)
+ Cookies.set("sidebarStatus", 1);
} else {
- Cookies.set('sidebarStatus', 0)
+ Cookies.set("sidebarStatus", 0);
}
},
CLOSE_SIDEBAR: (state, withoutAnimation) => {
- Cookies.set('sidebarStatus', 0)
- state.sidebar.opened = false
- state.sidebar.withoutAnimation = withoutAnimation
+ Cookies.set("sidebarStatus", 0);
+ state.sidebar.opened = false;
+ state.sidebar.withoutAnimation = withoutAnimation;
},
TOGGLE_DEVICE: (state, device) => {
- state.device = device
+ state.device = device;
+ },
+ SET_LAYOUT: (state, layout) => {
+ state.workerLayout = layout;
},
- SET_LAYOUT:(state,layout) => {
- state.workerLayout = layout
- }
-}
+};
const actions = {
toggleSideBar({ commit }) {
- commit('TOGGLE_SIDEBAR')
+ commit("TOGGLE_SIDEBAR");
},
closeSideBar({ commit }, { withoutAnimation }) {
- commit('CLOSE_SIDEBAR', withoutAnimation)
+ commit("CLOSE_SIDEBAR", withoutAnimation);
},
toggleDevice({ commit }, device) {
- commit('TOGGLE_DEVICE', device)
- }
-}
+ commit("TOGGLE_DEVICE", device);
+ },
+ getLayout({ commit, state }) {
+ return state.workerLayout.config
+ ? JSON.parse(state.workerLayout.config)
+ : new Promise((resolve, reject) => {
+ show({
+ admin_id: store.state.user.userId,
+ }).then((res) => {
+ commit("SET_LAYOUT", res);
+ resolve(JSON.parse(res?.config) || [])
+ });
+ });
+ },
+ setLayout({ commit }) {
+ show({
+ admin_id: store.state.user.userId,
+ }).then((res) => {
+ commit("SET_LAYOUT", res);
+ });
+ },
+ saveLayout({ commit, dispatch, state }, layout) {
+ save({
+ id: state.workerLayout.id,
+ name: "1",
+ config: JSON.stringify(layout),
+ }).then((res) => {
+ dispatch("setLayout");
+ Message({
+ type: "success",
+ message: "保存成功",
+ });
+ });
+ },
+};
export default {
namespaced: true,
state,
+ getter,
mutations,
- actions
-}
+ actions,
+};
diff --git a/src/views/achievements/evaluate.vue b/src/views/achievements/evaluate.vue
index cf55ab7..99ad22d 100644
--- a/src/views/achievements/evaluate.vue
+++ b/src/views/achievements/evaluate.vue
@@ -1,47 +1,72 @@
-
-
+
+
-
+
- {
- $refs['addPlanEvaluate'].type = command;
- $refs['addPlanEvaluate'].setPlanId(scope.row.id);
- $refs['addPlanEvaluate'].show();
- }
- "
+
+ 年中目标
+
+ {
+ $refs['addPlanEvaluate'].type = 2;
+ $refs['addPlanEvaluate'].setPlanId(scope.row.id);
+ $refs['addPlanEvaluate'].show();
+ }
+ "
+ >
+ 年末目标
+
@@ -56,138 +81,141 @@
diff --git a/src/views/budget/budgetList.vue b/src/views/budget/budgetList.vue
index 6692c0e..1b00328 100644
--- a/src/views/budget/budgetList.vue
+++ b/src/views/budget/budgetList.vue
@@ -164,24 +164,19 @@
"
>绩效指标
- {
- $refs['addEvaluate'].type = command;
+ {
$refs['addEvaluate'].setId(scope.row.id);
$refs['addEvaluate'].show();
}
"
>
-
- 绩效目标
-
-
-
- 年中目标
- 年末目标
-
-
+ 绩效目标
+
diff --git a/src/views/budget/components/addEvaluate.vue b/src/views/budget/components/addEvaluate.vue
index 968abb1..b7718bc 100644
--- a/src/views/budget/components/addEvaluate.vue
+++ b/src/views/budget/components/addEvaluate.vue
@@ -1,12 +1,18 @@
-
-
+ 年中绩效目标
+
-
+ placeholder="请填写年中绩效目标"
+ >
+ 年末绩效目标
+