Commit d0e0bf22 authored by tanyang's avatar tanyang

Merge remote-tracking branch 'origin/V20230915' into V20230915

parents 1770612d 2f30a27c
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"url": "https://gitee.com/y_project/RuoYi-Vue.git" "url": "https://gitee.com/y_project/RuoYi-Vue.git"
}, },
"dependencies": { "dependencies": {
"@alita/chalk": "^1.1.2",
"@cell-x/el-table-sticky": "^1.0.2", "@cell-x/el-table-sticky": "^1.0.2",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"@vue/composition-api": "^1.7.2", "@vue/composition-api": "^1.7.2",
......
...@@ -823,6 +823,9 @@ li { ...@@ -823,6 +823,9 @@ li {
.el-select-dropdown__item { .el-select-dropdown__item {
padding: 0 16px; padding: 0 16px;
} }
.el-select-dropdown__item.selected::after {
right:8px;
}
} }
} }
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
</el-menu-item> </el-menu-item>
</app-link> </app-link>
</template> </template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> <el-submenu v-else ref="subMenu" :index="resolvePath(item.path,item.query)" popper-append-to-body>
<template slot="title"> <template slot="title">
<item v-if="item.meta" :icon="sideIcon(item)" :title="item.meta.title" /> <item v-if="item.meta" :icon="sideIcon(item)" :title="item.meta.title" />
</template> </template>
<sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child" :base-path="resolvePath(child.path,child.query)" <sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child" :base-path="resolvePath(child.path)"
:active-menu="activeMenu" class="nest-menu" /> :active-menu="activeMenu" class="nest-menu" />
</el-submenu> </el-submenu>
</template> </template>
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
default: false default: false
}, },
basePath: { basePath: {
type: String, type: [String],
default: '' default: ''
}, },
activeMenu: { activeMenu: {
......
<template> <template>
<div :class="{'has-logo':showLogo}" @mouseenter="sideEnter" @mouseleave="sideLeave" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div :class="{'has-logo':showLogo}" @mouseenter="sideEnter" @mouseleave="sideLeave"
:style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" /> <logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper"> <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu <el-menu :default-active="activeMenu" :collapse="isCollapse" :background-color="variables.menuBg" :text-color="variables.menuText"
:default-active="activeMenu" :unique-opened="true" :active-text-color="settings.theme" :collapse-transition="false" mode="vertical">
:collapse="isCollapse" <sidebar-item v-for="(route, index) in hidechildren" :key="route.path + index" :is-collapse="isCollapse" :active-menu="activeMenu"
:background-color="variables.menuBg" :item="route" :base-path="route.path" :class="route.fixed&&route.fixed.isFixed?'sideFoot':''"
:text-color="variables.menuText" :style="route.fixed&&route.fixed.isFixed?{'bottom': route.fixed.number*50+'px'}: bottomMenu&&index==routes.length-bottomMenu-2?{'padding-bottom': bottomMenu*50+'px'}:''" />
:unique-opened="true"
:active-text-color="settings.theme"
:collapse-transition="false"
mode="vertical"
>
<sidebar-item
v-for="(route, index) in hidechildren"
:key="route.path + index"
:is-collapse="isCollapse"
:active-menu="activeMenu"
:item="route"
:base-path="route.path"
:class="route.fixed&&route.fixed.isFixed?'sideFoot':''"
:style="route.fixed&&route.fixed.isFixed?{'bottom': route.fixed.number*50+'px'}: bottomMenu&&index==routes.length-bottomMenu-2?{'padding-bottom': bottomMenu*50+'px'}:''"
/>
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
<div v-show="isExpand" class="side-expand" @click="toggleSideBar"> <div v-show="isExpand" class="side-expand" @click="toggleSideBar">
...@@ -44,22 +28,23 @@ export default { ...@@ -44,22 +28,23 @@ export default {
data() { data() {
return { return {
isExpand: false isExpand: false
} };
}, },
computed: { computed: {
...mapState(["settings"]), ...mapState(["settings"]),
...mapGetters(["sidebarRouters", "sidebar"]), ...mapGetters(["sidebarRouters", "sidebar"]),
hidechildren(){ hidechildren() {
return this.sidebarRouters.map(item=>{ const resultArray = this.sidebarRouters.map(item => {
if(item.children?.length){ if (item.children?.length) {
item.children = item.children.filter(i=>{ item.children = item.children.filter(i => {
if (typeof (i.hidden) == 'boolean' && i.hidden == false || i.path == "index"){ if (typeof (i.hidden) == 'boolean' && i.hidden == false || i.path == "index") {
return i return i;
} }
}) });
} }
return item return item;
}) });
return JSON.parse(JSON.stringify(resultArray));
}, },
activeMenu() { activeMenu() {
const route = this.$route; const route = this.$route;
...@@ -71,12 +56,12 @@ export default { ...@@ -71,12 +56,12 @@ export default {
return path; return path;
}, },
device() { device() {
return this.$store.state.app.device return this.$store.state.app.device;
}, },
bottomMenu() { bottomMenu() {
const routeArr = this.$router.options.routes const routeArr = this.$router.options.routes;
const navFixed = routeArr.filter(item => item.fixed && item.fixed.isFixed) const navFixed = routeArr.filter(item => item.fixed && item.fixed.isFixed);
return navFixed.length return navFixed.length;
}, },
showLogo() { showLogo() {
return this.$store.state.settings.sidebarLogo; return this.$store.state.settings.sidebarLogo;
...@@ -89,16 +74,16 @@ export default { ...@@ -89,16 +74,16 @@ export default {
}, },
}, },
methods: { methods: {
toggleSideBar(){ toggleSideBar() {
this.$emit('handleBar', this.isCollapse ? '-96' : '96'); // 96为展开宽度和收起宽度之差 this.$emit('handleBar', this.isCollapse ? '-96' : '96'); // 96为展开宽度和收起宽度之差
this.$store.dispatch('app/toggleSideBar'); this.$store.dispatch('app/toggleSideBar');
}, },
sideEnter(){ sideEnter() {
if (this.device !== 'mobile') { if (this.device !== 'mobile') {
this.isExpand = true; this.isExpand = true;
} }
}, },
sideLeave(){ sideLeave() {
if (this.device !== 'mobile') { if (this.device !== 'mobile') {
this.isExpand = false; this.isExpand = false;
} }
......
import Vue from 'vue'; import Vue from 'vue';
import VCA from '@vue/composition-api' //composition APi import VCA from '@vue/composition-api'; //composition APi
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
...@@ -87,9 +87,11 @@ Vue.use(Element, { ...@@ -87,9 +87,11 @@ Vue.use(Element, {
Vue.config.productionTip = false; Vue.config.productionTip = false;
new Vue({ const vueIns = new Vue({
el: '#app', el: '#app',
router, router,
store, store,
render: h => h(App) render: h => h(App)
}); });
export default vueIns;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: thy * @Author: thy
* @Date: 2023-11-08 09:28:17 * @Date: 2023-11-08 09:28:17
* @LastEditors: thy * @LastEditors: thy
* @LastEditTime: 2023-11-17 09:36:01 * @LastEditTime: 2023-12-01 15:31:33
* @Description: file content * @Description: file content
* @FilePath: \dsk-operate-ui\src\utils\iframeTools.js * @FilePath: \dsk-operate-ui\src\utils\iframeTools.js
*/ */
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
import { dskAccessToken } from '@/api/common'; import { dskAccessToken } from '@/api/common';
import { getUrlSearchQuery, isUrl, paramsToQuery } from "@/utils/"; import { getUrlSearchQuery, isUrl, paramsToQuery } from "@/utils/";
import { Message } from "element-ui"; import { Message } from "element-ui";
import chalk from "@alita/chalk";
window.alitadebug = true;
/** /**
...@@ -24,13 +26,16 @@ class IframeTools { ...@@ -24,13 +26,16 @@ class IframeTools {
authToken = ""; authToken = "";
origin = location.origin; origin = location.origin;
isOuter = false; isOuter = false;
iframeLoaded = false;
isAutoInit = false;
/** /**
* 插件域名地址 * 插件域名地址
* @param {string} pluginDomain 默认当前环境变量VUE_APP_SUB_SYSTEM_ADDRESS * @param {string} pluginDomain 默认当前环境变量VUE_APP_SUB_SYSTEM_ADDRESS
* @param {HTMLIFrameElement} subSystemIframe 子系统iframe dom节点 * @param {HTMLIFrameElement} subSystemIframe 子系统iframe dom节点
* @returns * @returns
*/ */
constructor(subSystemIframe, pluginDomain = process.env.VUE_APP_SUB_SYSTEM_ADDRESS) { constructor(subSystemIframe, pluginDomain = process.env.VUE_APP_SUB_SYSTEM_ADDRESS, isAutoInit = false) {
return new Promise(async (resolve, reject) => {
try { try {
const query = getUrlSearchQuery(); const query = getUrlSearchQuery();
if (!query.url) return Message.warning("缺少子系统目标地址"); if (!query.url) return Message.warning("缺少子系统目标地址");
...@@ -41,12 +46,17 @@ class IframeTools { ...@@ -41,12 +46,17 @@ class IframeTools {
this.queryParams = query; this.queryParams = query;
this.pluginDomain = pluginDomain; this.pluginDomain = pluginDomain;
this.subSystemIframe = subSystemIframe; this.subSystemIframe = subSystemIframe;
// 是否外部打开
this.isOuter = query.isOuter && typeof JSON.parse(query.isOuter) == "boolean" ? JSON.parse(query.isOuter) : false; this.isOuter = query.isOuter && typeof JSON.parse(query.isOuter) == "boolean" ? JSON.parse(query.isOuter) : false;
// 是否自动初始化iframe
this.isAutoInit = isAutoInit;
// 是一个合法地址 初始化 先替换域名地址 再获取令牌并 拼接 // 是一个合法地址 初始化 先替换域名地址 再获取令牌并 拼接
this.init(); await this.init();
resolve(this);
} catch (error) { } catch (error) {
throw new Error(error); reject(error);
} }
});
} }
/** /**
...@@ -78,7 +88,12 @@ class IframeTools { ...@@ -78,7 +88,12 @@ class IframeTools {
url = `${url}${paramsToQuery(query) ? "?" + paramsToQuery(query) : ""}`; url = `${url}${paramsToQuery(query) ? "?" + paramsToQuery(query) : ""}`;
this.queryParams.url = url; this.queryParams.url = url;
console.log(this.queryParams.url); console.log(this.queryParams.url);
// 倒计时刷新token 正常误差10s 提前获取 if (this.isAutoInit) {
this.subSystemIframe.src = url;
// 初始化iframe
await this.initIframe(this.subSystemIframe);
}
// 倒计时刷新token 误差10s 提前获取
this.setTokenRefresh(expire * 1000 - 1000 * 10); this.setTokenRefresh(expire * 1000 - 1000 * 10);
} }
} catch (error) { } catch (error) {
...@@ -87,6 +102,21 @@ class IframeTools { ...@@ -87,6 +102,21 @@ class IframeTools {
} }
} }
initIframe(iframe) {
if (!iframe) throw new Error("缺少需要监听的iframe元素");
return new Promise((resolve, reject) => {
let that = this;
iframe.addEventListener("load", function onIframeLoad(e) {
iframe.removeEventListener("load", onIframeLoad, false);
that.iframeLoaded = true;
// console.clear();
chalk.hello("author:thy", "0.0.1");
chalk.ready(chalk.bgGreen("iframeTools 初始化完毕"));
resolve(true);
}, false);
});
}
/** /**
* 获取子系统token * 获取子系统token
*/ */
......
import Interaction from "@/utils/postMessageBridge/action/interaction";
import Router from "@/utils/postMessageBridge/action/router";
const interaction = new Interaction();
const router = new Router();
export const messageHandlers = {
interaction,
router
};
export {
interaction,
router
};
\ No newline at end of file
import { pmb } from "../bridge";
let _this = null;
class Interaction {
actionName = "interaction";
constructor() {
_this = this;
}
default(params = {}, mergeParams = { action: this.actionName, ...params }) {
if (!params) throw new Error("传入的params参数错误");
return new Promise((resolve, reject) => pmb.publish(mergeParams, (e) => resolve(e)));
}
layoutHtml(userParams = {}) {
return _this.default({
method: "layoutHtml",
params: { ...userParams }
});
}
syncScroll(userParams = {}) {
return _this.default({
method: "syncScroll",
params: { ...userParams }
});
}
showConditions(userParams = {}) {
return _this.default({
method: "showConditions",
params: { ...userParams }
});
}
}
export default Interaction;
\ No newline at end of file
import { pmb } from "../bridge";
let _this = null;
class Router {
actionName = "router";
constructor() {
_this = this;
}
default(params = {}, mergeParams = { action: this.actionName, ...params }) {
if (!params) throw new Error("传入的params参数错误");
return new Promise((resolve, reject) => pmb.publish(mergeParams, (e) => resolve(e)));
}
toTargetRouter(userParams = {}) {
return new Promise((resolve, reject) => {
this.$tab.openPage(userParams.title, userParams.url);
console.log(userParams);
resolve();
});
}
iframeToTargetRouter(userParams = {}) {
return _this.default({
method: "toTargetUrl",
params: { ...userParams }
});
}
componentCreated(userParams = {}) {
return new Promise(async (resolve, reject) => {
return await this.loadedInit();
});
}
}
export default Router;
\ No newline at end of file
/*
* @Author: thy
* @Date: 2023-11-28 18:09:11
* @LastEditors: thy
* @LastEditTime: 2023-12-01 12:15:31
* @Description: file content
* @FilePath: \dsk-operate-ui\src\utils\postMessageBridge\bridge\eventCenter.js
*/
import { v4 } from "uuid";
import { normalToPromise } from "@/utils/postMessageBridge/tools";
import chalk from "@alita/chalk";
window.alitadebug = true;
/**
* 事件回调 调度中心
*/
class EventCenter {
//事件回调储存栈
_eventHandlerMap = new Map();
_vueIns = null;
constructor(vueIns) {
vueIns ? this._vueIns = vueIns : null;
process.env.ENV != "production" ? chalk.ready(chalk.bgGreen("事件调度中心初始化完毕")) : null;
}
/**
* 根据回调ID获取事件回调储存中的回调
* @param {string} handlerId
*/
getTargetHandler(handlerId) {
return this._eventHandlerMap.get(handlerId);
}
/**
* 注册事件回调到 事件储存中
* @param {Promise} promiseCallBack
*/
registerHandler(promiseCallBack) {
return new Promise((resolve, reject) => {
if (Object.prototype.toString.call(promiseCallBack) !== "[object Function]") return console.warn("传入的回调类型不是一个函数");
const uid = v4();
this._eventHandlerMap.set(uid, promiseCallBack);
resolve(uid);
});
}
/**
* 根据回调ID卸载事件回调储存中的回调
* @param {string} handlerId
*/
writeOffHandler(handlerId) {
return this._eventHandlerMap.delete(handlerId);
}
/**
* 根据回调ID 执行事件回调储存中的回调 并卸载
* @param {string} handlerId
*/
executeHandler(handlerId, params = {}) {
return new Promise((resolve, reject) => {
try {
const currentCallBack = this.getTargetHandler(handlerId);
if (!currentCallBack) return reject("执行回调错误,未找到对应回调");
// 缓存回调
const cb = normalToPromise(currentCallBack);
// 删除回调
this._eventHandlerMap.delete(handlerId);
// 执行回调
resolve(cb(params));
} catch (error) {
console.log(error);
}
});
}
}
export default EventCenter;
\ No newline at end of file
...@@ -2,44 +2,155 @@ ...@@ -2,44 +2,155 @@
* @Author: thy * @Author: thy
* @Date: 2023-10-26 14:56:41 * @Date: 2023-10-26 14:56:41
* @LastEditors: thy * @LastEditors: thy
* @LastEditTime: 2023-10-31 09:28:26 * @LastEditTime: 2023-12-07 15:41:56
* @Description: file content * @Description: file content
* @FilePath: \dsk-operate-ui\src\utils\postMessageBridge\bridge\index.js * @FilePath: \dsk-operate-ui\src\utils\postMessageBridge\bridge\index.js
*/ */
import EventCenter from "./eventCenter";
import { messageHandlers } from "@/utils/postMessageBridge/action";
import chalk from "@alita/chalk";
window.alitadebug = true;
class PostMessageBridge { class PostMessageBridge {
// 当前系统 // 当前系统
_currenySystem = null; _currentSystem = null;
// 当前系统域
_currentOriginUrl = null;
// 目标系统 // 目标系统
_targetSystem = null; _targetSystem = null;
// 目标域 // 目标域
_targetOriginUrl = null; _targetOriginUrl = null;
// 事件调度中心 // 事件调度中心
_eventHandlers = new Map(); _eventCenter = null;
// 当前vue实例
_vueIns = null;
// 处理函数
_messageHandlers = null;
//通信是否建立成功
_communication = false;
constructor() { }
/** /**
* *
* @param {{ * @param {{
* currenySystem : Window || undefined; * currentSystem : Window || undefined;
* currentOriginUrl : string;
* targetSystem : Window || undefined; * targetSystem : Window || undefined;
* targetOriginUrl : string || undefined; * targetOriginUrl : string || undefined;
* vueIns : any;
* }} options * }} options
*/ */
constructor(options) { async init(options) {
this._currenySystem = options.currenySystem; try {
this._currentSystem = options.currentSystem;
this._currentOriginUrl = options.currentOriginUrl || location.origin;
this._targetSystem = options.targetSystem; this._targetSystem = options.targetSystem;
this._targetOriginUrl = options.targetOriginUrl || "*"; this._targetOriginUrl = options.targetOriginUrl || "*";
this._vueIns = options.vueIns || null;
this._messageHandlers = messageHandlers;
this._eventCenter = new EventCenter(this._vueIns);
this._currentSystem.removeEventListener("message", this.messageListener.bind(this), false);
this._currentSystem.addEventListener("message", this.messageListener.bind(this), false);
// 初始化完毕
process.env.ENV != "production" ? chalk.ready(chalk.bgGreen("通信桥梁初始化完毕")) : true;
} catch (error) {
console.log(error);
}
}
getVueInstance(insArray, current) {
if (insArray?.length) {
const result = insArray.find(item => {
if (item.$children && item.$children?.length) {
return this.getVueInstance(item.$children, current);
}
return item.$route == current;
});
return result;
}
} }
/** /**
* 订阅消息 * 触发message 时执行的函数
* @param {{ * @param {MessageEvent} event
* id : string; * @returns
* method : string; */
* params : object; messageListener(event) {
* }} messageEvent new Promise(async (resolve, reject) => {
try {
const { data, origin, source } = event;
// 判断来源 必须 来自子系统
if (origin !== this._targetOriginUrl || source !== this._targetSystem?.contentWindow) return;
const { callbackId, action, method, params = {}, url, title, id } = data;
if(callbackId) console.log(callbackId,"回调ID","需要执行的方法",method);
//兼容插件老式写法
if (url || title || id) {
this._vueIns.$tab.openPage(title, url);
return resolve();
}
// 未获取到当前交互id 不执行调用
if (!callbackId) return;
// 有注册回调 执行回调
if (this._eventCenter.getTargetHandler(callbackId)) {
resolve(this._eventCenter.executeHandler(callbackId, params));
} else {
// 订阅消息
const result = await this.subscribe(action, method, params);
resolve(result);
}
} catch (error) {
console.log(error);
reject(error);
}
});
};
/**
* 发布消息
* @param {Object} options
* @param {Function} callback
*/ */
receiveMessage(messageEvent) { async publish(options, callback) {
if (!options || !callback) return;
if (!options.action) throw new Error("缺少action参数");
if (!options.method) throw new Error("缺少method参数");
if (Object.prototype.toString.call(callback) != "[object Function]") return console.warn("传入的回调不是一个函数");
options.params = options.params || {};
// 绑定到vue实例
const bfn = callback.bind(this._vueIns);
const callbackId = await this._eventCenter.registerHandler(bfn);
const { params, ...rest } = options;
process.env.ENV != "production" ? chalk.log(chalk.bgBlack(`发布消息:\n回调ID:${callbackId}\n命中模块:${options.action}\n命中方法:${options.method}\n传递参数:\n${JSON.stringify(params)}`)) : null;
this._targetSystem?.contentWindow?.postMessage({
callbackId,
...rest,
params,
}, { targetOrigin: this._targetOriginUrl });
return callbackId;
}
/**
* 订阅消息
* @param {string} action 执行的模块
* @param {string} method 执行的方法
* @param {Object} params 参数
* @returns
*/
async subscribe(action, method, params) {
try {
const fn = this._messageHandlers[action] ? this._messageHandlers[action][method] ? this._messageHandlers[action][method] : null : null;
// 绑定到vue实例
const result = fn ? await this._messageHandlers[action][method].call(this._vueIns, params) : null;
return result;
} catch (error) {
console.log(router);
}
} }
} }
// 单例模式
export const pmb = new PostMessageBridge();
export default PostMessageBridge;
\ No newline at end of file
export { default as PostMessageBridge, pmb } from "./bridge";
\ No newline at end of file
/**
* 普通函数包装为promise风格函数
* @param {Function} fn
* @returns {Promise<any>} 返回一个promise
*/
export const normalToPromise = (fn) => {
const tag = Object.prototype.toString.call(fn);
if (tag !== "[object Function]" && tag !== "[object AsyncFunction]") return fn;
return (...args) => {
return new Promise((resolve, reject) => {
try {
const result = fn(...args);
resolve(result);
} catch (error) {
reject(error);
}
});
};
};
\ No newline at end of file
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</el-col> </el-col>
<div class="empty" v-if="hzqkTotal === 0"> <div class="empty" v-if="hzqkTotal === 0">
<img class="img" src="@/assets/images/project/empty.png"> <img class="img" src="@/assets/images/project/empty.png">
<div class="p1">抱歉,您还未添加合作客户</div> <div class="p1">抱歉,您还未添加与客户的合作中标项目情况</div>
</div> </div>
</el-row> </el-row>
</div> </div>
...@@ -240,9 +240,10 @@ ...@@ -240,9 +240,10 @@
this.hzqkList=res.data; this.hzqkList=res.data;
let list=[]; let list=[];
for(let i=0; i<res.data.length; i++){ for(let i=0; i<res.data.length; i++){
if(res.data[i].totalAmount){ if(!res.data[i].totalAmount){
list.push(res.data[i]) res.data[i].totalAmount=0
} }
list.push(res.data[i])
} }
if(list.length > 0){ if(list.length > 0){
this.initChart(list) this.initChart(list)
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<el-form-item label="项目名称:" prop="projectName" label-width="120px"> <el-form-item label="项目名称:" prop="projectName" label-width="120px">
<el-input v-model="addParam.projectName" placeholder="请输入项目名称" @input="resetProjectSearch();getCompany1()"></el-input> <el-input v-model="addParam.projectName" placeholder="请输入项目名称" @input="resetProjectSearch();getCompany1()"></el-input>
<div class="resultlist" v-infinite-scroll="load" v-if="showlist1"> <div class="resultlist" v-infinite-scroll="load" v-if="showlist1">
<div v-for="(item,index) in companData1" @click="selCompany1(item.projectName)"><span v-html="item.projectName"></span></div> <div v-for="(item,index) in companData1" @click="selCompany1(item)"><span v-html="item.projectName"></span></div>
</div> </div>
</el-form-item> </el-form-item>
<div class="erow"> <div class="erow">
...@@ -321,7 +321,6 @@ export default { ...@@ -321,7 +321,6 @@ export default {
resetProjectSearch() { resetProjectSearch() {
this.companData1 = [] this.companData1 = []
this.projectpage = 1 this.projectpage = 1
console.log(this.companData1);
}, },
//获取项目名称 //获取项目名称
getCompany1(){ getCompany1(){
...@@ -348,7 +347,13 @@ export default { ...@@ -348,7 +347,13 @@ export default {
} }
}, },
selCompany1(item){ selCompany1(item){
this.addParam.projectName = item.replace(/<[^>]+>/g, '') const params = {};
params.projectName = item.projectName.replace(/<[^>]+>/g, '');
if(item.projectStage) params.projectStage = (this.projectStage.find(i => item.projectStage == i.dictLabel))?.dictValue || "";
if(item.projectCategory) params.projectCategory = (this.projectCategory.find(i => item.projectCategory == i.dictLabel))?.dictValue || "";
if(item.status) params.status = (this.status.find(i => item.status == i.dictLabel))?.dictValue || "";
if(item.investmentAmount) params.investmentAmount = item.investmentAmount;
this.addParam = {...this.addParam,...params};
this.showlist1 = false this.showlist1 = false
}, },
//获取业主单位 //获取业主单位
...@@ -371,6 +376,7 @@ export default { ...@@ -371,6 +376,7 @@ export default {
}, },
selCompany(item){ selCompany(item){
this.addParam.ownerCompany = item.name.replace(/<[^>]+>/g, '') this.addParam.ownerCompany = item.name.replace(/<[^>]+>/g, '')
this.showlist = false this.showlist = false
}, },
// 处理条件下拉 // 处理条件下拉
......
...@@ -315,20 +315,19 @@ export default { ...@@ -315,20 +315,19 @@ export default {
// 判断客户是否关联显示修改 // 判断客户是否关联显示修改
association(id) { association(id) {
if (id) { if (id) {
customerInfo(id).then(res => { customerInfo(id).then(async res => {
console.log(res);
if (res.code == 200) { if (res.code == 200) {
if (res.data.userId == this.$store.state.user.userId) { if (res.data.userId == this.$store.state.user.userId) {
this.$nextTick(() => { await this.$nextTick()
this.customerInfo = res.data; this.customerInfo = res.data;
this.customerId = res.data.customerId; this.customerId = res.data.customerId;
});
if (res.data.companyId == this.companyId) { if (res.data.companyId == this.companyId) {
this.$nextTick(() => { await this.$nextTick()
this.isCustomer = true; this.isCustomer = true;
this.isCompany = true; this.isCompany = true;
});
} else { } else {
this.$nextTick(() => { await this.$nextTick();
this.isCustomer = true; this.isCustomer = true;
this.isCompany = false; this.isCompany = false;
this.currentPath.pathName = this.$route.query.path || 'business'; this.currentPath.pathName = this.$route.query.path || 'business';
...@@ -336,23 +335,16 @@ export default { ...@@ -336,23 +335,16 @@ export default {
companyName: this.customerInfo.companyName companyName: this.customerInfo.companyName
}; };
document.getElementById('tagTitle').innerText = this.customerInfo.companyName; document.getElementById('tagTitle').innerText = this.customerInfo.companyName;
// let lists = this.$store.state.tagsView.visitedViews
// lists.forEach(item=>{
// if(item.fullPath == this.$route.fullPath){
let titlename = document.getElementById('tagTitles'); let titlename = document.getElementById('tagTitles');
if (titlename) { if (titlename) {
titlename.innerText = this.customerInfo.companyName; titlename.innerText = this.customerInfo.companyName;
} }
// }
// })
});
} }
} else { } else {
this.$nextTick(() => { await this.$nextTick();
this.isCustomer = true; this.isCustomer = true;
this.isCompany = true; this.isCompany = true;
this.currentPath.pathName = 'overview'; this.currentPath.pathName = 'overview';
});
} }
} }
}).catch(err => { }).catch(err => {
......
...@@ -1435,6 +1435,9 @@ export default { ...@@ -1435,6 +1435,9 @@ export default {
handleUrl(item){ handleUrl(item){
switch (item.name) { switch (item.name) {
case '项目管理': case '项目管理':
if(this.permissions.includes('*:*:*')){
this.$router.push({ path: item.url })
}else {
if(this.permissions.includes('project:info')){ if(this.permissions.includes('project:info')){
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
}else { }else {
...@@ -1443,8 +1446,12 @@ export default { ...@@ -1443,8 +1446,12 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}
break; break;
case '客户管理': case '客户管理':
if(this.permissions.includes('*:*:*')){
this.$router.push({ path: item.url })
}else {
if(this.permissions.includes('customer:info')){ if(this.permissions.includes('customer:info')){
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
}else { }else {
...@@ -1453,8 +1460,12 @@ export default { ...@@ -1453,8 +1460,12 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}
break; break;
case '全国经济大全': case '全国经济大全':
if(this.permissions.includes('*:*:*')){
this.$router.push({ path: item.url })
}else {
if(this.permissions.includes('nationalEconomies:query')){ if(this.permissions.includes('nationalEconomies:query')){
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
}else { }else {
...@@ -1463,8 +1474,12 @@ export default { ...@@ -1463,8 +1474,12 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}
break; break;
case '集团户': case '集团户':
if(this.permissions.includes('*:*:*')){
this.$router.push({ path: item.url })
}else {
if(this.permissions.includes('group:query')){ if(this.permissions.includes('group:query')){
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
}else { }else {
...@@ -1473,8 +1488,12 @@ export default { ...@@ -1473,8 +1488,12 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}
break; break;
case '查城投平台': case '查城投平台':
if(this.permissions.includes('*:*:*')){
this.$router.push({ path: item.url })
}else {
if(this.permissions.includes('owner:query')){ if(this.permissions.includes('owner:query')){
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
}else { }else {
...@@ -1483,8 +1502,12 @@ export default { ...@@ -1483,8 +1502,12 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}
break; break;
case '商机雷达': case '商机雷达':
if(this.permissions.includes('*:*:*')){
this.$router.push({ path: item.url })
}else {
if(this.permissions.includes('radar:query')){ if(this.permissions.includes('radar:query')){
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
}else { }else {
...@@ -1493,6 +1516,7 @@ export default { ...@@ -1493,6 +1516,7 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}
break; break;
default: default:
break; break;
......
...@@ -360,6 +360,12 @@ export default { ...@@ -360,6 +360,12 @@ export default {
sortChange({ column, prop, order }){ sortChange({ column, prop, order }){
if(prop === 'aptitudeCountNew'){ if(prop === 'aptitudeCountNew'){
this.queryParams.field ='aptitudeCountNew' this.queryParams.field ='aptitudeCountNew'
}else if(prop === 'recentlyCount'){
this.queryParams.field ='winBidCount'
}else if(prop === 'customerCount'){
this.queryParams.field ='customer'
}else if(prop === 'supplierCount'){
this.queryParams.field ='supplier'
}else { }else {
this.queryParams.field = prop this.queryParams.field = prop
} }
......
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,7 @@ export default {
// 设置上传的请求头部 // 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + `"/business/open/tender/importData/"}${this.detailId ? this.detailId : parseInt(this.$route.query.id)}`, url: process.env.VUE_APP_BASE_API + `/business/open/tender/importData/${this.detailId ? this.detailId : parseInt(this.$route.query.id)}`,
// 展示上传结果 // 展示上传结果
showResult: false, showResult: false,
// 模板下载地址 // 模板下载地址
......
...@@ -221,10 +221,11 @@ ...@@ -221,10 +221,11 @@
this.addtips() this.addtips()
} }
let j = 0 let j = 0
for(var i=1;i<=7;i++){ for(let i=1;i<=7;i++){
let isSelf = document.getElementById('inputxt'+i).contains(event.target) // 这个是自己的区域 let isSelf = document.getElementById('inputxt'+i).contains(event.target) // 这个是自己的区域
if(isSelf) { if(isSelf) {
this.nowedit = i this.nowedit = i
break;
}else { }else {
j++; j++;
} }
...@@ -254,13 +255,13 @@ ...@@ -254,13 +255,13 @@
break; break;
case 7 : case 7 :
// param = {'constructionPhone':this.xmsldata.constructionPhone} // param = {'constructionPhone':this.xmsldata.constructionPhone}
this.isphone(1,this.xmsldata.constructionPhone) this.isphone(2,this.xmsldata.constructionPhone)
break; break;
} }
if(this.nowedit!=6 && this.nowedit!=7) if(this.nowedit!=6 && this.nowedit!=7) {
this.editXMSL(param) this.editXMSL(param)
} }
this.nowedit = -1 }
} }
}) })
}, },
...@@ -276,8 +277,7 @@ ...@@ -276,8 +277,7 @@
this.spanWidth = 'width:'+wid this.spanWidth = 'width:'+wid
}); });
}, },
editXMSL(param){ async editXMSL(param){
this.nowedit = -1
if(this.isDisabled == true) if(this.isDisabled == true)
return false return false
if(param.projectStage){//修改项目阶段 if(param.projectStage){//修改项目阶段
...@@ -286,17 +286,17 @@ ...@@ -286,17 +286,17 @@
}else{ }else{
let params = param let params = param
params.id = this.id params.id = this.id
editXMNR(JSON.stringify(params)).then(res=>{ const res = await editXMNR(JSON.stringify(params));
if (res.code == 200){ if (res.code == 200){
if(!param.projectStage){ if(!param.projectStage){
// this.$message.success('修改成功!') // this.$message.success('修改成功!')
} }
}else{ }else{
this.$message.error(res.msg) this.$message.error(res.msg)
this.getXMSL() await this.getXMSL()
} }
})
} }
this.nowedit = -1;
}, },
//验证电话号码 //验证电话号码
isphone(type,value){ isphone(type,value){
...@@ -352,7 +352,7 @@ ...@@ -352,7 +352,7 @@
}, },
getXMSL(){ getXMSL(){
getXMSL(this.id).then(result=> { return getXMSL(this.id).then(result=> {
this.xmjd = !result.data.projectStage?'待添加':result.data.projectStage this.xmjd = !result.data.projectStage?'待添加':result.data.projectStage
if(result.data.labelList == null || result.data.labelList == "" || result.data.labelList == undefined){ if(result.data.labelList == null || result.data.labelList == "" || result.data.labelList == undefined){
this.tipslit = [] this.tipslit = []
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
招标方式{{jskBidPlanDto.tenderWay.length? jskBidPlanDto.tenderWay.length + "项": ""}} 招标方式{{jskBidPlanDto.tenderWay.length? jskBidPlanDto.tenderWay.length + "项": ""}}
<i class="el-icon-caret-bottom"></i> <i class="el-icon-caret-bottom"></i>
</span> </span>
<el-select v-model="jskBidPlanDto.tenderWay" class="select-multiple" multiple placeholder="请选择"> <el-select v-model="jskBidPlanDto.tenderWay" class="select-multiple" popper-class="select-option" multiple placeholder="请选择">
<el-option v-for="(item, i) in tenderWayList" :key="i":label="item" :value="item"> <el-option v-for="(item, i) in tenderWayList" :key="i":label="item" :value="item">
</el-option> </el-option>
</el-select> </el-select>
...@@ -1064,6 +1064,14 @@ export default { ...@@ -1064,6 +1064,14 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.select-option{
.el-select-dropdown__list{
.el-select-dropdown__item{
padding: 0 26px 0 16px;
}
}
}
.content{ .content{
padding: 0px 16px; padding: 0px 16px;
padding-top: 16px; padding-top: 16px;
......
...@@ -970,7 +970,6 @@ ...@@ -970,7 +970,6 @@
color: rgba(35,35,35,0.8); color: rgba(35,35,35,0.8);
} }
.content_right{ .content_right{
.ename_input{ .ename_input{
width: 640px; width: 640px;
margin-right: 20px; margin-right: 20px;
...@@ -978,6 +977,7 @@ ...@@ -978,6 +977,7 @@
.land_ipt_470 { .land_ipt_470 {
width: 640px; width: 640px;
} }
} }
.item_ckquery_list { .item_ckquery_list {
......
<template>
<div class="search-performance-iframe-container">
<!-- 查询tab切换 -->
<div class="search-tab-list-performance">
<div class="search-tab-item-performance" v-for="(item,index) of searchTabList" :key="index"
:class="{'current-tab-performance' : item.name == currentValue}" @click="changeCurrent(item)">
<span class="search-tab-name">{{item.name}}</span>
</div>
</div>
<iframe-com-ins ref="searchPerformanceIframeContainer" :iframeStyles="urlQueryParams.iframeStyles" :styles="urlQueryParams.styles"
:url="urlQueryParams.url"></iframe-com-ins>
</div>
</template>
<script>
import IframeComIns from "@/views/subsystem/components/IframeComIns";
import IframeTools from "@/utils/iframeTools";
import { pmb } from "@/utils/postMessageBridge";
import { interaction, router } from "@/utils/postMessageBridge/action";
export default {
name: "searchPerformanceIframeContainer",
components: {
IframeComIns
},
data() {
return {
urlQueryParams: {
url: ""
},
iframeToolsIns: {},
messageBridgeIns: {},
currentValue: "中标业绩",
searchTabList: [
{
name: "中标业绩",
value: "/performance"
},
{
name: "四库业绩",
value: "/sky"
},
{
name: "全网业绩",
value: "/zb"
},
{
name: "水利监管平台",
value: "/sljg"
},
{
name: "水利信用平台",
value: "/slxy"
},
],
observer: null
};
},
//可访问data属性
created() {
this.init();
},
beforeDestroy() {
if (this.iframeToolsIns) {
this.iframeToolsIns.clearRefreshTimer ? this.iframeToolsIns.clearRefreshTimer() : null;
}
if (this.observer) {
this.observer?.disconnect();
}
},
//计算集
computed: {
},
//方法集
methods: {
clearObserver() {
if (this.observer) {
this.observer?.disconnect();
}
this.observer = null;
},
async init() {
await this.$nextTick();
const dom = this.$refs["searchPerformanceIframeContainer"].$el.querySelector("iframe");
// 初始化iframe工具
const iframeTools = await new IframeTools(dom);
this.iframeToolsIns = iframeTools;
this.urlQueryParams = iframeTools.queryParams;
await iframeTools.initIframe(dom);
// 初始化iframe通信工具
await pmb.init({
currentSystem: window,
currentOriginUrl: location.origin,
targetSystem: iframeTools.subSystemIframe,
targetOriginUrl: process.env.VUE_APP_SUB_SYSTEM_ADDRESS,
vueIns: this
});
this.messageBridgeIns = pmb;
this.loadedInit();
},
mutationObserverFn(mutationsList) {
for (let mutation of mutationsList) {
if (mutation.attributeName === "src") {
// 当iframe的src属性发生改变时,触发该回调函数
const currentUrl = this.iframeToolsIns.subSystemIframe.src;
console.log("当前url:" + currentUrl);
break;
}
}
},
async loadedInit() {
console.log("初始化方法被调用");
// 是否需要使用iframe滚动条监听
if (this.urlQueryParams?.syncScroll) {
await interaction.syncScroll();
}
// 是否需要插件适配当前视口
if (this.urlQueryParams?.layout) {
await interaction.layoutHtml();
}
},
async changeCurrent(item) {
try {
if (this.currentValue == item.name) return;
this.currentValue = item.name;
await router.iframeToTargetRouter({
url: `/search${item.value}`
});
} catch (error) {
}
}
},
}
</script>
<style lang="scss" scoped>
.search-performance-iframe-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
overflow: hidden;
padding: 16px 24px;
.search-tab-list-performance {
height: 51px;
display: flex;
align-items: center;
background: #fff;
box-sizing: border-box;
.search-tab-item-performance {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #333;
font-weight: bold;
min-width: 96px;
padding: 0px 16px;
box-sizing: border-box;
&.current-tab-performance {
color: #0081ff;
border-bottom: 2px solid #0081ff;
}
.search-tab-name {
cursor: pointer;
}
}
}
.iframe-com-ins {
height: calc(100% - 67px);
margin-top: 16px;
}
}
</style>
\ No newline at end of file
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<script> <script>
import IframeComIns from "./components/IframeComIns"; import IframeComIns from "./components/IframeComIns";
import IframeTools from "@/utils/iframeTools"; import IframeTools from "@/utils/iframeTools";
import { pmb } from "@/utils/postMessageBridge";
import { interaction } from "@/utils/postMessageBridge/action";
export default { export default {
name: "subsystemIframeContainer", name: "subsystemIframeContainer",
components: { components: {
...@@ -14,13 +16,16 @@ export default { ...@@ -14,13 +16,16 @@ export default {
}, },
data() { data() {
return { return {
urlQueryParams: {}, urlQueryParams: {
iframeToolsIns: {} url: ""
},
iframeToolsIns: {},
messageBridgeIns: {}
}; };
}, },
//可访问data属性 //可访问data属性
created() { created() {
this.Init(); this.init();
}, },
beforeDestroy() { beforeDestroy() {
if (this.iframeToolsIns) { if (this.iframeToolsIns) {
...@@ -33,13 +38,38 @@ export default { ...@@ -33,13 +38,38 @@ export default {
}, },
//方法集 //方法集
methods: { methods: {
async Init() { async init() {
await this.$nextTick(); await this.$nextTick();
const dom = this.$refs["subsystemIframeContainer"].$el.querySelector("iframe"); const dom = this.$refs["subsystemIframeContainer"].$el.querySelector("iframe");
const iframeTools = new IframeTools(dom); // 初始化iframe工具
const iframeTools = await new IframeTools(dom);
this.iframeToolsIns = iframeTools; this.iframeToolsIns = iframeTools;
this.urlQueryParams = iframeTools.queryParams; this.urlQueryParams = iframeTools.queryParams;
console.log(this.urlQueryParams); await iframeTools.initIframe(dom);
// 初始化iframe通信工具
await pmb.init({
currentSystem: window,
currentOriginUrl: location.origin,
targetSystem: iframeTools.subSystemIframe,
targetOriginUrl: process.env.VUE_APP_SUB_SYSTEM_ADDRESS,
vueIns: this
});
this.messageBridgeIns = pmb;
this.loadedInit();
},
async loadedInit() {
// 是否需要使用iframe滚动条监听
if (this.urlQueryParams?.syncScroll) {
await interaction.syncScroll();
}
// 是否需要插件适配当前视口
if (this.urlQueryParams?.layout) {
await interaction.layoutHtml();
}
if (this.urlQueryParams?.showConditions) {
await interaction.showConditions();
}
} }
}, },
} }
...@@ -52,5 +82,7 @@ export default { ...@@ -52,5 +82,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
padding: 16px 24px;
} }
</style> </style>
...@@ -35,7 +35,7 @@ module.exports = { ...@@ -35,7 +35,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://47.104.91.229:9099/prod-api`,//测试 target: `http://120.46.64.239:9099/prod-api`,//测试
// target: `https://szhapi.jiansheku.com`,//线上 // target: `https://szhapi.jiansheku.com`,//线上
// target: `http://122.9.160.122:9011`, //线上 // target: `http://122.9.160.122:9011`, //线上
// target: `http://192.168.0.165:9098`,//施-无线 // target: `http://192.168.0.165:9098`,//施-无线
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment