From cb69e6df51c8ff000277576dc3a2530edcce557c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Fri, 18 Aug 2023 15:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E6=95=B0=E6=8D=AE=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/zongzhi/common.js | 10 + src/api/zongzhi/st.js | 68 +++ src/components/MyTable/index.vue | 21 +- src/main.js | 2 + src/permission.js | 18 +- src/store/getters.js | 3 +- src/store/index.js | 4 +- src/store/modules/dict.js | 30 ++ src/utils/common.js | 13 + .../ecosphere/components/componentLeft.vue | 221 +++++--- .../components/componentCenterLeft.vue | 469 +++++++++-------- .../components/componentCenterRight.vue | 474 +++++++++--------- .../components/componentLeft.vue | 7 +- .../security/components/componentLeft.vue | 95 ++-- 14 files changed, 854 insertions(+), 581 deletions(-) create mode 100644 src/api/zongzhi/common.js create mode 100644 src/store/modules/dict.js create mode 100644 src/utils/common.js diff --git a/src/api/zongzhi/common.js b/src/api/zongzhi/common.js new file mode 100644 index 0000000..173b0b6 --- /dev/null +++ b/src/api/zongzhi/common.js @@ -0,0 +1,10 @@ +import request from '@/utils/request.js' + +// 查询字典 +export function getDictList(query) { + return request({ + url: '/system/dict/data/getlist', + method: 'get', + params: query + }) +} diff --git a/src/api/zongzhi/st.js b/src/api/zongzhi/st.js index 905d25d..08ec945 100644 --- a/src/api/zongzhi/st.js +++ b/src/api/zongzhi/st.js @@ -59,3 +59,71 @@ export function listArticle(query) { params: query }) } +// 查询重点企业名录列表 +export function listEnterprise(query) { + return request({ + url: '/zongzhi/enterprise/list', + method: 'get', + params: query + }) +} + +// 查询重点领域监管列表 +export function listDomain(query) { + return request({ + url: '/zongzhi/domain/list', + method: 'get', + params: query + }) +} +// 查询重点工作项目列表 +export function listWork(query) { + return request({ + url: '/zongzhi/work/list', + method: 'get', + params: query + }) +} + +// 查询工作动态列表 +export function listDongtai(query) { + return request({ + url: '/zongzhi/dongtai/list', + method: 'get', + params: query + }) +} + +// 查询等保系统列表 +export function listSystem(query) { + return request({ + url: '/zongzhi/system/list', + method: 'get', + params: query + }) +} +// 查询等保单位列表 +export function listUnit(query) { + return request({ + url: '/zongzhi/dengbaounit/list', + method: 'get', + params: query + }) +} + +// 查询政府网站列表 +export function listWeb(query) { + return request({ + url: '/zongzhi/web/list', + method: 'get', + params: query + }) +} +// 查询IDC单位列表 +export function listIDCunit(query) { + return request({ + url: '/zongzhi/idcunit/list', + method: 'get', + params: query + }) +} diff --git a/src/components/MyTable/index.vue b/src/components/MyTable/index.vue index 241f61a..4c077da 100644 --- a/src/components/MyTable/index.vue +++ b/src/components/MyTable/index.vue @@ -1,28 +1,27 @@ diff --git a/src/main.js b/src/main.js index e744a37..1ab99db 100644 --- a/src/main.js +++ b/src/main.js @@ -22,6 +22,8 @@ import router from './router' import MyTable from '@/components/MyTable' import Paginations from '@/components/Pagination' +import { filterDict } from '@/utils/common.js' +Vue.prototype.$filterDict = filterDict Vue.component('MyTable', MyTable) Vue.component('Paginations', Paginations) import $ from 'jquery' diff --git a/src/permission.js b/src/permission.js index ce5b947..f9d0b53 100644 --- a/src/permission.js +++ b/src/permission.js @@ -6,12 +6,14 @@ * @LastEditors: Wiley.Yang * @LastEditTime: 2022-02-16 15:50:20 */ +import store from './store' import router from './router' // import store from './store' -// import { Message } from 'element-ui' +import { Message } from 'element-ui' import NProgress from 'nprogress' // progress bar import 'nprogress/nprogress.css' // progress bar style import getPageTitle from '@/utils/get-page-title' +// import { error } from 'jquery' // import { asyncRoutes, constantRoutes } from '@/router' NProgress.configure({ showSpinner: false }) // NProgress Configuration @@ -31,8 +33,20 @@ router.beforeEach(async(to, from, next) => { // next(`/Screen`); // NProgress.done(); // } + // 获取大屏所用到的接口 + if (JSON.stringify(store.state.dict.dictObject) === '{}') { + store + .dispatch('getDictType') + .then((res) => { + next() + }) + .catch((error) => { + Message.error(error) + }) + } else { + next() + } - next() NProgress.done() }) diff --git a/src/store/getters.js b/src/store/getters.js index 46d6070..bb274b0 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -7,6 +7,7 @@ * @LastEditTime: 2022-02-14 16:13:10 */ const getters = { - fixedHeader: state => state.settings.fixedHeader + fixedHeader: (state) => state.settings.fixedHeader, + dictObject: (state) => state.dict.dictObject } export default getters diff --git a/src/store/index.js b/src/store/index.js index 8ae3c33..9060a20 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,12 +10,14 @@ import Vue from 'vue' import Vuex from 'vuex' import getters from './getters' import settings from './modules/settings' +import dict from './modules/dict' Vue.use(Vuex) const store = new Vuex.Store({ modules: { - settings + settings, + dict }, getters }) diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..d5bebf6 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,30 @@ +import { getDictList } from '@/api/zongzhi/common.js' +const dict = { + state: { + dictObject: {} + }, + mutations: { + SET_DICT: (state, dict) => { + state.dictObject = dict + } + }, + actions: { + getDictType({ commit }) { + return new Promise((resolve, reject) => { + const query = { + list: 'sys_user_sex,tc_net_sx,tc_yq_media,tc_enter_type,tc_inlet_yewu,tc_item_type' + } + getDictList(query) + .then((res) => { + commit('SET_DICT', res.data) + resolve() + }) + .catch((error) => { + reject(error) + }) + }) + } + } +} + +export default dict diff --git a/src/utils/common.js b/src/utils/common.js new file mode 100644 index 0000000..2787b63 --- /dev/null +++ b/src/utils/common.js @@ -0,0 +1,13 @@ +import store from '@/store' + +export function filterDict(type, value) { + const dict = store.getters.dictObject + // console.log(dict, type, value) + // debugger + const result = dict[type].filter((item) => item.dictValue == value) + if (result.length > 0) { + return result[0].dictLabel + } else { + return '未匹配到' + } +} diff --git a/src/views/privateOrder/ecosphere/components/componentLeft.vue b/src/views/privateOrder/ecosphere/components/componentLeft.vue index 396d0f2..b06530d 100644 --- a/src/views/privateOrder/ecosphere/components/componentLeft.vue +++ b/src/views/privateOrder/ecosphere/components/componentLeft.vue @@ -141,7 +141,7 @@ -
+
工作动态
- - {{ item.dynamicName }} + + {{ item.materialsName }}
-
{{ item.department }}
+
{{ item.type }}
@@ -223,43 +224,23 @@ :modal-append-to-body="false" center :modal="false" + :before-close="beForeClose" >
- - - - + +
- - + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="inventoryBtn" + />
@@ -285,7 +266,7 @@ highlight-current-row @row-click="rowClick" > - + /> -->