Compare commits
No commits in common. "46b01b45047815b84fd495d718a6a2d8a8e06b22" and "3d7ee782b11eb1d57757efbb6b7640d75f2fed25" have entirely different histories.
46b01b4504
...
3d7ee782b1
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"clawMode.mode": "editor",
|
|
||||||
"workbench.activityBar.location": "default"
|
|
||||||
}
|
|
||||||
2
.env
2
.env
@ -1,3 +1,3 @@
|
|||||||
VUE_APP_BASE_DOMAIN=http://dcloud-demo.definesys.cn:31213
|
VUE_APP_BASE_DOMAIN=http://dcloud-demo.definesys.cn:31213
|
||||||
VUE_APP_TENANT_ID=254638499280453633
|
VUE_APP_TENANT_ID=254638499280453633
|
||||||
VUE_APP_PUBLIC_PATH=/
|
VUE_APP_PUBLIC_PATH=/app/
|
||||||
@ -3,7 +3,7 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
node: true
|
node: true
|
||||||
},
|
},
|
||||||
extends: ['plugin:vue/recommended'],
|
extends: ['plugin:vue/recommended', '@vue/standard'],
|
||||||
rules: {
|
rules: {
|
||||||
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||||
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -27,5 +27,3 @@ yarn-error.log*
|
|||||||
node_modules.zip
|
node_modules.zip
|
||||||
apaas-custom-mydemo.zip
|
apaas-custom-mydemo.zip
|
||||||
apaas-custom-mydemo-1.zip
|
apaas-custom-mydemo-1.zip
|
||||||
eslint-report.html
|
|
||||||
fix-echarts-install.bat
|
|
||||||
|
|||||||
36
README.en.md
Normal file
36
README.en.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# yuchai
|
||||||
|
|
||||||
|
#### Description
|
||||||
|
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||||
|
|
||||||
|
#### Software Architecture
|
||||||
|
Software architecture description
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
|
||||||
|
1. xxxx
|
||||||
|
2. xxxx
|
||||||
|
3. xxxx
|
||||||
|
|
||||||
|
#### Instructions
|
||||||
|
|
||||||
|
1. xxxx
|
||||||
|
2. xxxx
|
||||||
|
3. xxxx
|
||||||
|
|
||||||
|
#### Contribution
|
||||||
|
|
||||||
|
1. Fork the repository
|
||||||
|
2. Create Feat_xxx branch
|
||||||
|
3. Commit your code
|
||||||
|
4. Create Pull Request
|
||||||
|
|
||||||
|
|
||||||
|
#### Gitee Feature
|
||||||
|
|
||||||
|
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||||
|
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||||
|
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||||
|
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||||
|
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||||
|
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||||
39
README.md
Normal file
39
README.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# yuchai
|
||||||
|
|
||||||
|
#### 介绍
|
||||||
|
{**以下是 Gitee 平台说明,您可以替换此简介**
|
||||||
|
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
||||||
|
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
||||||
|
|
||||||
|
#### 软件架构
|
||||||
|
软件架构说明
|
||||||
|
|
||||||
|
|
||||||
|
#### 安装教程
|
||||||
|
|
||||||
|
1. xxxx
|
||||||
|
2. xxxx
|
||||||
|
3. xxxx
|
||||||
|
|
||||||
|
#### 使用说明
|
||||||
|
|
||||||
|
1. xxxx
|
||||||
|
2. xxxx
|
||||||
|
3. xxxx
|
||||||
|
|
||||||
|
#### 参与贡献
|
||||||
|
|
||||||
|
1. Fork 本仓库
|
||||||
|
2. 新建 Feat_xxx 分支
|
||||||
|
3. 提交代码
|
||||||
|
4. 新建 Pull Request
|
||||||
|
|
||||||
|
|
||||||
|
#### 特技
|
||||||
|
|
||||||
|
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||||
|
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||||
|
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||||
|
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||||
|
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||||
|
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -100,13 +100,6 @@
|
|||||||
"title": "我发起的"
|
"title": "我发起的"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"apaas-custom-myDemo":{
|
|
||||||
"name": "apaas-custom-myDemo",
|
|
||||||
"path": "apaas-custom-myDemo",
|
|
||||||
"meta": {
|
|
||||||
"title": "我的测试"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apaas-custom-selfEngineCheck":{
|
"apaas-custom-selfEngineCheck":{
|
||||||
"name": "apaas-custom-selfEngineCheck",
|
"name": "apaas-custom-selfEngineCheck",
|
||||||
"path": "apaas-custom-selfEngineCheck",
|
"path": "apaas-custom-selfEngineCheck",
|
||||||
@ -141,20 +134,6 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"title": "权限管理"
|
"title": "权限管理"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"apaas-custom-roleMemberManagement":{
|
|
||||||
"name": "apaas-custom-roleMemberManagement",
|
|
||||||
"path": "apaas-custom-roleMemberManagement",
|
|
||||||
"meta": {
|
|
||||||
"title": "人员管理"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apaas-custom-checkPersonPermission":{
|
|
||||||
"name": "apaas-custom-checkPersonPermission",
|
|
||||||
"path": "apaas-custom-checkPersonPermission",
|
|
||||||
"meta": {
|
|
||||||
"title": "权限检查"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"customWidgetList": [
|
"customWidgetList": [
|
||||||
|
|||||||
Binary file not shown.
@ -1,10 +0,0 @@
|
|||||||
<meta charset="utf-8">
|
|
||||||
<title>0971f994c95754494ad9b508d6916c39 demo</title>
|
|
||||||
<script src="./0971f994c95754494ad9b508d6916c39.umd.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./0971f994c95754494ad9b508d6916c39.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
console.log(0971f994c95754494ad9b508d6916c39)
|
|
||||||
</script>
|
|
||||||
@ -1,279 +0,0 @@
|
|||||||
module.exports =
|
|
||||||
/******/ (function(modules) { // webpackBootstrap
|
|
||||||
/******/ // The module cache
|
|
||||||
/******/ var installedModules = {};
|
|
||||||
/******/
|
|
||||||
/******/ // The require function
|
|
||||||
/******/ function __webpack_require__(moduleId) {
|
|
||||||
/******/
|
|
||||||
/******/ // Check if module is in cache
|
|
||||||
/******/ if(installedModules[moduleId]) {
|
|
||||||
/******/ return installedModules[moduleId].exports;
|
|
||||||
/******/ }
|
|
||||||
/******/ // Create a new module (and put it into the cache)
|
|
||||||
/******/ var module = installedModules[moduleId] = {
|
|
||||||
/******/ i: moduleId,
|
|
||||||
/******/ l: false,
|
|
||||||
/******/ exports: {}
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Execute the module function
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/
|
|
||||||
/******/ // Flag the module as loaded
|
|
||||||
/******/ module.l = true;
|
|
||||||
/******/
|
|
||||||
/******/ // Return the exports of the module
|
|
||||||
/******/ return module.exports;
|
|
||||||
/******/ }
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // expose the modules object (__webpack_modules__)
|
|
||||||
/******/ __webpack_require__.m = modules;
|
|
||||||
/******/
|
|
||||||
/******/ // expose the module cache
|
|
||||||
/******/ __webpack_require__.c = installedModules;
|
|
||||||
/******/
|
|
||||||
/******/ // define getter function for harmony exports
|
|
||||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
||||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
||||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
||||||
/******/ }
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // define __esModule on exports
|
|
||||||
/******/ __webpack_require__.r = function(exports) {
|
|
||||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
||||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
||||||
/******/ }
|
|
||||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // create a fake namespace object
|
|
||||||
/******/ // mode & 1: value is a module id, require it
|
|
||||||
/******/ // mode & 2: merge all properties of value into the ns
|
|
||||||
/******/ // mode & 4: return value when already ns object
|
|
||||||
/******/ // mode & 8|1: behave like require
|
|
||||||
/******/ __webpack_require__.t = function(value, mode) {
|
|
||||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
||||||
/******/ if(mode & 8) return value;
|
|
||||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
||||||
/******/ var ns = Object.create(null);
|
|
||||||
/******/ __webpack_require__.r(ns);
|
|
||||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
||||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
||||||
/******/ return ns;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
||||||
/******/ __webpack_require__.n = function(module) {
|
|
||||||
/******/ var getter = module && module.__esModule ?
|
|
||||||
/******/ function getDefault() { return module['default']; } :
|
|
||||||
/******/ function getModuleExports() { return module; };
|
|
||||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
||||||
/******/ return getter;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Object.prototype.hasOwnProperty.call
|
|
||||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
||||||
/******/
|
|
||||||
/******/ // __webpack_public_path__
|
|
||||||
/******/ __webpack_require__.p = "";
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // Load entry module and return exports
|
|
||||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
||||||
/******/ })
|
|
||||||
/************************************************************************/
|
|
||||||
/******/ ({
|
|
||||||
|
|
||||||
/***/ "8875":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
|
||||||
// MIT license
|
|
||||||
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
||||||
|
|
||||||
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (true) {
|
|
||||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
||||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
||||||
} else {}
|
|
||||||
}(typeof self !== 'undefined' ? self : this, function () {
|
|
||||||
function getCurrentScript () {
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
|
||||||
// for chrome
|
|
||||||
if (!descriptor && 'currentScript' in document && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// for other browsers with native support for currentScript
|
|
||||||
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 8-10 support script readyState
|
|
||||||
// IE 11+ & Firefox support stack trace
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Find the second match for the "at" string to get file src url from stack.
|
|
||||||
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
|
||||||
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
|
||||||
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
|
||||||
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
|
||||||
line = (stackDetails && stackDetails[2]) || false,
|
|
||||||
currentLocation = document.location.href.replace(document.location.hash, ''),
|
|
||||||
pageSource,
|
|
||||||
inlineScriptSourceRegExp,
|
|
||||||
inlineScriptSource,
|
|
||||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
||||||
|
|
||||||
if (scriptLocation === currentLocation) {
|
|
||||||
pageSource = document.documentElement.outerHTML;
|
|
||||||
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
|
||||||
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++) {
|
|
||||||
// If ready state is interactive, return the script tag
|
|
||||||
if (scripts[i].readyState === 'interactive') {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If src matches, return the script tag
|
|
||||||
if (scripts[i].src === scriptLocation) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If inline source matches, return the script tag
|
|
||||||
if (
|
|
||||||
scriptLocation === currentLocation &&
|
|
||||||
scripts[i].innerHTML &&
|
|
||||||
scripts[i].innerHTML.trim() === inlineScriptSource
|
|
||||||
) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no match, return null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return getCurrentScript
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "fb15":
|
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
||||||
// This file is imported into lib/wc client bundles.
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
var currentScript = window.document.currentScript
|
|
||||||
if (true) {
|
|
||||||
var getCurrentScript = __webpack_require__("8875")
|
|
||||||
currentScript = getCurrentScript()
|
|
||||||
|
|
||||||
// for backward compatibility, because previously we directly included the polyfill
|
|
||||||
if (!('currentScript' in document)) {
|
|
||||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
||||||
if (src) {
|
|
||||||
__webpack_require__.p = src[1] // eslint-disable-line
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicate to webpack that this file can be concatenated
|
|
||||||
/* harmony default export */ var setPublicPath = (null);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
|
|
||||||
/*
|
|
||||||
* cubic函数
|
|
||||||
* 求三次方
|
|
||||||
* 接收一个数字类型的参数,并求其三次方并返回
|
|
||||||
*/
|
|
||||||
/* harmony default export */ var cubic = ({
|
|
||||||
// 函数名必须以custom开头,否则无法被解析
|
|
||||||
name: 'customcubic',
|
|
||||||
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
|
|
||||||
mockFunction: function mockFunction() {
|
|
||||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 执行函数, 接收到参数后的处理方法,必须有返回值
|
|
||||||
executeFunction: function executeFunction() {
|
|
||||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
return args[0] * args[0] * args[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
|
|
||||||
|
|
||||||
/* harmony default export */ var custom_functions = ({
|
|
||||||
Cubic: cubic
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/admin.js
|
|
||||||
|
|
||||||
var admin_install = function install(_ref, hookManager, definition) {
|
|
||||||
var RuleEngine = _ref.RuleEngine;
|
|
||||||
if (!RuleEngine) {
|
|
||||||
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object.keys(custom_functions).forEach(function (funcKey) {
|
|
||||||
var func = custom_functions[funcKey];
|
|
||||||
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
|
|
||||||
if (func.name.indexOf('custom') !== 0) {
|
|
||||||
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RuleEngine.getInstance().registerContextMethod(func.name, func);
|
|
||||||
} else {
|
|
||||||
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/* harmony default export */ var admin = ({
|
|
||||||
install: admin_install
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
||||||
|
|
||||||
|
|
||||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (admin);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
/******/ });
|
|
||||||
@ -1,289 +0,0 @@
|
|||||||
(function webpackUniversalModuleDefinition(root, factory) {
|
|
||||||
if(typeof exports === 'object' && typeof module === 'object')
|
|
||||||
module.exports = factory();
|
|
||||||
else if(typeof define === 'function' && define.amd)
|
|
||||||
define([], factory);
|
|
||||||
else if(typeof exports === 'object')
|
|
||||||
exports["0971f994c95754494ad9b508d6916c39"] = factory();
|
|
||||||
else
|
|
||||||
root["0971f994c95754494ad9b508d6916c39"] = factory();
|
|
||||||
})((typeof self !== 'undefined' ? self : this), function() {
|
|
||||||
return /******/ (function(modules) { // webpackBootstrap
|
|
||||||
/******/ // The module cache
|
|
||||||
/******/ var installedModules = {};
|
|
||||||
/******/
|
|
||||||
/******/ // The require function
|
|
||||||
/******/ function __webpack_require__(moduleId) {
|
|
||||||
/******/
|
|
||||||
/******/ // Check if module is in cache
|
|
||||||
/******/ if(installedModules[moduleId]) {
|
|
||||||
/******/ return installedModules[moduleId].exports;
|
|
||||||
/******/ }
|
|
||||||
/******/ // Create a new module (and put it into the cache)
|
|
||||||
/******/ var module = installedModules[moduleId] = {
|
|
||||||
/******/ i: moduleId,
|
|
||||||
/******/ l: false,
|
|
||||||
/******/ exports: {}
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Execute the module function
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/
|
|
||||||
/******/ // Flag the module as loaded
|
|
||||||
/******/ module.l = true;
|
|
||||||
/******/
|
|
||||||
/******/ // Return the exports of the module
|
|
||||||
/******/ return module.exports;
|
|
||||||
/******/ }
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // expose the modules object (__webpack_modules__)
|
|
||||||
/******/ __webpack_require__.m = modules;
|
|
||||||
/******/
|
|
||||||
/******/ // expose the module cache
|
|
||||||
/******/ __webpack_require__.c = installedModules;
|
|
||||||
/******/
|
|
||||||
/******/ // define getter function for harmony exports
|
|
||||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
||||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
||||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
||||||
/******/ }
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // define __esModule on exports
|
|
||||||
/******/ __webpack_require__.r = function(exports) {
|
|
||||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
||||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
||||||
/******/ }
|
|
||||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // create a fake namespace object
|
|
||||||
/******/ // mode & 1: value is a module id, require it
|
|
||||||
/******/ // mode & 2: merge all properties of value into the ns
|
|
||||||
/******/ // mode & 4: return value when already ns object
|
|
||||||
/******/ // mode & 8|1: behave like require
|
|
||||||
/******/ __webpack_require__.t = function(value, mode) {
|
|
||||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
||||||
/******/ if(mode & 8) return value;
|
|
||||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
||||||
/******/ var ns = Object.create(null);
|
|
||||||
/******/ __webpack_require__.r(ns);
|
|
||||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
||||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
||||||
/******/ return ns;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
||||||
/******/ __webpack_require__.n = function(module) {
|
|
||||||
/******/ var getter = module && module.__esModule ?
|
|
||||||
/******/ function getDefault() { return module['default']; } :
|
|
||||||
/******/ function getModuleExports() { return module; };
|
|
||||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
||||||
/******/ return getter;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Object.prototype.hasOwnProperty.call
|
|
||||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
||||||
/******/
|
|
||||||
/******/ // __webpack_public_path__
|
|
||||||
/******/ __webpack_require__.p = "";
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // Load entry module and return exports
|
|
||||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
||||||
/******/ })
|
|
||||||
/************************************************************************/
|
|
||||||
/******/ ({
|
|
||||||
|
|
||||||
/***/ "8875":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
|
||||||
// MIT license
|
|
||||||
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
||||||
|
|
||||||
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (true) {
|
|
||||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
||||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
||||||
} else {}
|
|
||||||
}(typeof self !== 'undefined' ? self : this, function () {
|
|
||||||
function getCurrentScript () {
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
|
||||||
// for chrome
|
|
||||||
if (!descriptor && 'currentScript' in document && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// for other browsers with native support for currentScript
|
|
||||||
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 8-10 support script readyState
|
|
||||||
// IE 11+ & Firefox support stack trace
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Find the second match for the "at" string to get file src url from stack.
|
|
||||||
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
|
||||||
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
|
||||||
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
|
||||||
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
|
||||||
line = (stackDetails && stackDetails[2]) || false,
|
|
||||||
currentLocation = document.location.href.replace(document.location.hash, ''),
|
|
||||||
pageSource,
|
|
||||||
inlineScriptSourceRegExp,
|
|
||||||
inlineScriptSource,
|
|
||||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
||||||
|
|
||||||
if (scriptLocation === currentLocation) {
|
|
||||||
pageSource = document.documentElement.outerHTML;
|
|
||||||
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
|
||||||
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++) {
|
|
||||||
// If ready state is interactive, return the script tag
|
|
||||||
if (scripts[i].readyState === 'interactive') {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If src matches, return the script tag
|
|
||||||
if (scripts[i].src === scriptLocation) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If inline source matches, return the script tag
|
|
||||||
if (
|
|
||||||
scriptLocation === currentLocation &&
|
|
||||||
scripts[i].innerHTML &&
|
|
||||||
scripts[i].innerHTML.trim() === inlineScriptSource
|
|
||||||
) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no match, return null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return getCurrentScript
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "fb15":
|
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
||||||
// This file is imported into lib/wc client bundles.
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
var currentScript = window.document.currentScript
|
|
||||||
if (true) {
|
|
||||||
var getCurrentScript = __webpack_require__("8875")
|
|
||||||
currentScript = getCurrentScript()
|
|
||||||
|
|
||||||
// for backward compatibility, because previously we directly included the polyfill
|
|
||||||
if (!('currentScript' in document)) {
|
|
||||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
||||||
if (src) {
|
|
||||||
__webpack_require__.p = src[1] // eslint-disable-line
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicate to webpack that this file can be concatenated
|
|
||||||
/* harmony default export */ var setPublicPath = (null);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
|
|
||||||
/*
|
|
||||||
* cubic函数
|
|
||||||
* 求三次方
|
|
||||||
* 接收一个数字类型的参数,并求其三次方并返回
|
|
||||||
*/
|
|
||||||
/* harmony default export */ var cubic = ({
|
|
||||||
// 函数名必须以custom开头,否则无法被解析
|
|
||||||
name: 'customcubic',
|
|
||||||
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
|
|
||||||
mockFunction: function mockFunction() {
|
|
||||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 执行函数, 接收到参数后的处理方法,必须有返回值
|
|
||||||
executeFunction: function executeFunction() {
|
|
||||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
return args[0] * args[0] * args[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
|
|
||||||
|
|
||||||
/* harmony default export */ var custom_functions = ({
|
|
||||||
Cubic: cubic
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/admin.js
|
|
||||||
|
|
||||||
var admin_install = function install(_ref, hookManager, definition) {
|
|
||||||
var RuleEngine = _ref.RuleEngine;
|
|
||||||
if (!RuleEngine) {
|
|
||||||
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object.keys(custom_functions).forEach(function (funcKey) {
|
|
||||||
var func = custom_functions[funcKey];
|
|
||||||
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
|
|
||||||
if (func.name.indexOf('custom') !== 0) {
|
|
||||||
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RuleEngine.getInstance().registerContextMethod(func.name, func);
|
|
||||||
} else {
|
|
||||||
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/* harmony default export */ var admin = ({
|
|
||||||
install: admin_install
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
||||||
|
|
||||||
|
|
||||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (admin);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
/******/ });
|
|
||||||
});
|
|
||||||
@ -1 +0,0 @@
|
|||||||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["0971f994c95754494ad9b508d6916c39"]=t():e["0971f994c95754494ad9b508d6916c39"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,c;(function(n,i){o=[],r=i,c="function"===typeof r?r.apply(t,o):r,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,c=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,u=c.exec(p.stack)||i.exec(p.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,d=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");f===d&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var s=0;s<l.length;s++){if("interactive"===l[s].readyState)return l[s];if(l[s].src===f)return l[s];if(f===d&&l[s].innerHTML&&l[s].innerHTML.trim()===o)return l[s]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(n.p=c[1])}var i={name:"customcubic",mockFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字")},executeFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字");return t[0]*t[0]*t[0]}},u={Cubic:i},f=function(e,t,n){var r=e.RuleEngine;r?Object.keys(u).forEach((function(e){var t=u[e];if(t&&t.name&&t.executeFunction&&t.executeFunction instanceof Function){if(0!==t.name.indexOf("custom"))return void console.error("自定义函数-".concat(t.name," 名称有误,请以custom开头"));r.getInstance().registerContextMethod(t.name,t)}else console.error("请检查".concat(t&&t.name,"的规则函数定义"))})):console.error("x-extension上下文中没有注册RuleEngine, 请检查")},a={install:f};t["default"]=a}})}));
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"copyAssets": [
|
|
||||||
"public/custom/apaas-custom-plugin-custom-rule"
|
|
||||||
],
|
|
||||||
"code": "PLUGIN_CUSTOM_RULE",
|
|
||||||
"name": "自开发规则",
|
|
||||||
"description": "自开发规则集成",
|
|
||||||
"extraConfig": {
|
|
||||||
"admin": true,
|
|
||||||
"adminCss": false,
|
|
||||||
"app": true,
|
|
||||||
"appCss": false,
|
|
||||||
"mobile": true,
|
|
||||||
"mobileCss": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<meta charset="utf-8">
|
|
||||||
<title>0971f994c95754494ad9b508d6916c39 demo</title>
|
|
||||||
<script src="./0971f994c95754494ad9b508d6916c39.umd.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./0971f994c95754494ad9b508d6916c39.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
console.log(0971f994c95754494ad9b508d6916c39)
|
|
||||||
</script>
|
|
||||||
@ -1,279 +0,0 @@
|
|||||||
module.exports =
|
|
||||||
/******/ (function(modules) { // webpackBootstrap
|
|
||||||
/******/ // The module cache
|
|
||||||
/******/ var installedModules = {};
|
|
||||||
/******/
|
|
||||||
/******/ // The require function
|
|
||||||
/******/ function __webpack_require__(moduleId) {
|
|
||||||
/******/
|
|
||||||
/******/ // Check if module is in cache
|
|
||||||
/******/ if(installedModules[moduleId]) {
|
|
||||||
/******/ return installedModules[moduleId].exports;
|
|
||||||
/******/ }
|
|
||||||
/******/ // Create a new module (and put it into the cache)
|
|
||||||
/******/ var module = installedModules[moduleId] = {
|
|
||||||
/******/ i: moduleId,
|
|
||||||
/******/ l: false,
|
|
||||||
/******/ exports: {}
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Execute the module function
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/
|
|
||||||
/******/ // Flag the module as loaded
|
|
||||||
/******/ module.l = true;
|
|
||||||
/******/
|
|
||||||
/******/ // Return the exports of the module
|
|
||||||
/******/ return module.exports;
|
|
||||||
/******/ }
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // expose the modules object (__webpack_modules__)
|
|
||||||
/******/ __webpack_require__.m = modules;
|
|
||||||
/******/
|
|
||||||
/******/ // expose the module cache
|
|
||||||
/******/ __webpack_require__.c = installedModules;
|
|
||||||
/******/
|
|
||||||
/******/ // define getter function for harmony exports
|
|
||||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
||||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
||||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
||||||
/******/ }
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // define __esModule on exports
|
|
||||||
/******/ __webpack_require__.r = function(exports) {
|
|
||||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
||||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
||||||
/******/ }
|
|
||||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // create a fake namespace object
|
|
||||||
/******/ // mode & 1: value is a module id, require it
|
|
||||||
/******/ // mode & 2: merge all properties of value into the ns
|
|
||||||
/******/ // mode & 4: return value when already ns object
|
|
||||||
/******/ // mode & 8|1: behave like require
|
|
||||||
/******/ __webpack_require__.t = function(value, mode) {
|
|
||||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
||||||
/******/ if(mode & 8) return value;
|
|
||||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
||||||
/******/ var ns = Object.create(null);
|
|
||||||
/******/ __webpack_require__.r(ns);
|
|
||||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
||||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
||||||
/******/ return ns;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
||||||
/******/ __webpack_require__.n = function(module) {
|
|
||||||
/******/ var getter = module && module.__esModule ?
|
|
||||||
/******/ function getDefault() { return module['default']; } :
|
|
||||||
/******/ function getModuleExports() { return module; };
|
|
||||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
||||||
/******/ return getter;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Object.prototype.hasOwnProperty.call
|
|
||||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
||||||
/******/
|
|
||||||
/******/ // __webpack_public_path__
|
|
||||||
/******/ __webpack_require__.p = "";
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // Load entry module and return exports
|
|
||||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
||||||
/******/ })
|
|
||||||
/************************************************************************/
|
|
||||||
/******/ ({
|
|
||||||
|
|
||||||
/***/ "8875":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
|
||||||
// MIT license
|
|
||||||
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
||||||
|
|
||||||
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (true) {
|
|
||||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
||||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
||||||
} else {}
|
|
||||||
}(typeof self !== 'undefined' ? self : this, function () {
|
|
||||||
function getCurrentScript () {
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
|
||||||
// for chrome
|
|
||||||
if (!descriptor && 'currentScript' in document && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// for other browsers with native support for currentScript
|
|
||||||
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 8-10 support script readyState
|
|
||||||
// IE 11+ & Firefox support stack trace
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Find the second match for the "at" string to get file src url from stack.
|
|
||||||
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
|
||||||
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
|
||||||
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
|
||||||
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
|
||||||
line = (stackDetails && stackDetails[2]) || false,
|
|
||||||
currentLocation = document.location.href.replace(document.location.hash, ''),
|
|
||||||
pageSource,
|
|
||||||
inlineScriptSourceRegExp,
|
|
||||||
inlineScriptSource,
|
|
||||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
||||||
|
|
||||||
if (scriptLocation === currentLocation) {
|
|
||||||
pageSource = document.documentElement.outerHTML;
|
|
||||||
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
|
||||||
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++) {
|
|
||||||
// If ready state is interactive, return the script tag
|
|
||||||
if (scripts[i].readyState === 'interactive') {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If src matches, return the script tag
|
|
||||||
if (scripts[i].src === scriptLocation) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If inline source matches, return the script tag
|
|
||||||
if (
|
|
||||||
scriptLocation === currentLocation &&
|
|
||||||
scripts[i].innerHTML &&
|
|
||||||
scripts[i].innerHTML.trim() === inlineScriptSource
|
|
||||||
) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no match, return null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return getCurrentScript
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "fb15":
|
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
||||||
// This file is imported into lib/wc client bundles.
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
var currentScript = window.document.currentScript
|
|
||||||
if (true) {
|
|
||||||
var getCurrentScript = __webpack_require__("8875")
|
|
||||||
currentScript = getCurrentScript()
|
|
||||||
|
|
||||||
// for backward compatibility, because previously we directly included the polyfill
|
|
||||||
if (!('currentScript' in document)) {
|
|
||||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
||||||
if (src) {
|
|
||||||
__webpack_require__.p = src[1] // eslint-disable-line
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicate to webpack that this file can be concatenated
|
|
||||||
/* harmony default export */ var setPublicPath = (null);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
|
|
||||||
/*
|
|
||||||
* cubic函数
|
|
||||||
* 求三次方
|
|
||||||
* 接收一个数字类型的参数,并求其三次方并返回
|
|
||||||
*/
|
|
||||||
/* harmony default export */ var cubic = ({
|
|
||||||
// 函数名必须以custom开头,否则无法被解析
|
|
||||||
name: 'customcubic',
|
|
||||||
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
|
|
||||||
mockFunction: function mockFunction() {
|
|
||||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 执行函数, 接收到参数后的处理方法,必须有返回值
|
|
||||||
executeFunction: function executeFunction() {
|
|
||||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
return args[0] * args[0] * args[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
|
|
||||||
|
|
||||||
/* harmony default export */ var custom_functions = ({
|
|
||||||
Cubic: cubic
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/app.js
|
|
||||||
|
|
||||||
var app_install = function install(_ref, hookManager, definition) {
|
|
||||||
var RuleEngine = _ref.RuleEngine;
|
|
||||||
if (!RuleEngine) {
|
|
||||||
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object.keys(custom_functions).forEach(function (funcKey) {
|
|
||||||
var func = custom_functions[funcKey];
|
|
||||||
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
|
|
||||||
if (func.name.indexOf('custom') !== 0) {
|
|
||||||
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RuleEngine.getInstance().registerContextMethod(func.name, func);
|
|
||||||
} else {
|
|
||||||
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/* harmony default export */ var app = ({
|
|
||||||
install: app_install
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
||||||
|
|
||||||
|
|
||||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (app);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
/******/ });
|
|
||||||
@ -1,289 +0,0 @@
|
|||||||
(function webpackUniversalModuleDefinition(root, factory) {
|
|
||||||
if(typeof exports === 'object' && typeof module === 'object')
|
|
||||||
module.exports = factory();
|
|
||||||
else if(typeof define === 'function' && define.amd)
|
|
||||||
define([], factory);
|
|
||||||
else if(typeof exports === 'object')
|
|
||||||
exports["0971f994c95754494ad9b508d6916c39"] = factory();
|
|
||||||
else
|
|
||||||
root["0971f994c95754494ad9b508d6916c39"] = factory();
|
|
||||||
})((typeof self !== 'undefined' ? self : this), function() {
|
|
||||||
return /******/ (function(modules) { // webpackBootstrap
|
|
||||||
/******/ // The module cache
|
|
||||||
/******/ var installedModules = {};
|
|
||||||
/******/
|
|
||||||
/******/ // The require function
|
|
||||||
/******/ function __webpack_require__(moduleId) {
|
|
||||||
/******/
|
|
||||||
/******/ // Check if module is in cache
|
|
||||||
/******/ if(installedModules[moduleId]) {
|
|
||||||
/******/ return installedModules[moduleId].exports;
|
|
||||||
/******/ }
|
|
||||||
/******/ // Create a new module (and put it into the cache)
|
|
||||||
/******/ var module = installedModules[moduleId] = {
|
|
||||||
/******/ i: moduleId,
|
|
||||||
/******/ l: false,
|
|
||||||
/******/ exports: {}
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Execute the module function
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/
|
|
||||||
/******/ // Flag the module as loaded
|
|
||||||
/******/ module.l = true;
|
|
||||||
/******/
|
|
||||||
/******/ // Return the exports of the module
|
|
||||||
/******/ return module.exports;
|
|
||||||
/******/ }
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // expose the modules object (__webpack_modules__)
|
|
||||||
/******/ __webpack_require__.m = modules;
|
|
||||||
/******/
|
|
||||||
/******/ // expose the module cache
|
|
||||||
/******/ __webpack_require__.c = installedModules;
|
|
||||||
/******/
|
|
||||||
/******/ // define getter function for harmony exports
|
|
||||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
||||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
||||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
||||||
/******/ }
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // define __esModule on exports
|
|
||||||
/******/ __webpack_require__.r = function(exports) {
|
|
||||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
||||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
||||||
/******/ }
|
|
||||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // create a fake namespace object
|
|
||||||
/******/ // mode & 1: value is a module id, require it
|
|
||||||
/******/ // mode & 2: merge all properties of value into the ns
|
|
||||||
/******/ // mode & 4: return value when already ns object
|
|
||||||
/******/ // mode & 8|1: behave like require
|
|
||||||
/******/ __webpack_require__.t = function(value, mode) {
|
|
||||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
||||||
/******/ if(mode & 8) return value;
|
|
||||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
||||||
/******/ var ns = Object.create(null);
|
|
||||||
/******/ __webpack_require__.r(ns);
|
|
||||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
||||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
||||||
/******/ return ns;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
||||||
/******/ __webpack_require__.n = function(module) {
|
|
||||||
/******/ var getter = module && module.__esModule ?
|
|
||||||
/******/ function getDefault() { return module['default']; } :
|
|
||||||
/******/ function getModuleExports() { return module; };
|
|
||||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
||||||
/******/ return getter;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Object.prototype.hasOwnProperty.call
|
|
||||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
||||||
/******/
|
|
||||||
/******/ // __webpack_public_path__
|
|
||||||
/******/ __webpack_require__.p = "";
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // Load entry module and return exports
|
|
||||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
||||||
/******/ })
|
|
||||||
/************************************************************************/
|
|
||||||
/******/ ({
|
|
||||||
|
|
||||||
/***/ "8875":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
|
||||||
// MIT license
|
|
||||||
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
||||||
|
|
||||||
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (true) {
|
|
||||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
||||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
||||||
} else {}
|
|
||||||
}(typeof self !== 'undefined' ? self : this, function () {
|
|
||||||
function getCurrentScript () {
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
|
||||||
// for chrome
|
|
||||||
if (!descriptor && 'currentScript' in document && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// for other browsers with native support for currentScript
|
|
||||||
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 8-10 support script readyState
|
|
||||||
// IE 11+ & Firefox support stack trace
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Find the second match for the "at" string to get file src url from stack.
|
|
||||||
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
|
||||||
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
|
||||||
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
|
||||||
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
|
||||||
line = (stackDetails && stackDetails[2]) || false,
|
|
||||||
currentLocation = document.location.href.replace(document.location.hash, ''),
|
|
||||||
pageSource,
|
|
||||||
inlineScriptSourceRegExp,
|
|
||||||
inlineScriptSource,
|
|
||||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
||||||
|
|
||||||
if (scriptLocation === currentLocation) {
|
|
||||||
pageSource = document.documentElement.outerHTML;
|
|
||||||
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
|
||||||
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++) {
|
|
||||||
// If ready state is interactive, return the script tag
|
|
||||||
if (scripts[i].readyState === 'interactive') {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If src matches, return the script tag
|
|
||||||
if (scripts[i].src === scriptLocation) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If inline source matches, return the script tag
|
|
||||||
if (
|
|
||||||
scriptLocation === currentLocation &&
|
|
||||||
scripts[i].innerHTML &&
|
|
||||||
scripts[i].innerHTML.trim() === inlineScriptSource
|
|
||||||
) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no match, return null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return getCurrentScript
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "fb15":
|
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
||||||
// This file is imported into lib/wc client bundles.
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
var currentScript = window.document.currentScript
|
|
||||||
if (true) {
|
|
||||||
var getCurrentScript = __webpack_require__("8875")
|
|
||||||
currentScript = getCurrentScript()
|
|
||||||
|
|
||||||
// for backward compatibility, because previously we directly included the polyfill
|
|
||||||
if (!('currentScript' in document)) {
|
|
||||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
||||||
if (src) {
|
|
||||||
__webpack_require__.p = src[1] // eslint-disable-line
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicate to webpack that this file can be concatenated
|
|
||||||
/* harmony default export */ var setPublicPath = (null);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
|
|
||||||
/*
|
|
||||||
* cubic函数
|
|
||||||
* 求三次方
|
|
||||||
* 接收一个数字类型的参数,并求其三次方并返回
|
|
||||||
*/
|
|
||||||
/* harmony default export */ var cubic = ({
|
|
||||||
// 函数名必须以custom开头,否则无法被解析
|
|
||||||
name: 'customcubic',
|
|
||||||
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
|
|
||||||
mockFunction: function mockFunction() {
|
|
||||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 执行函数, 接收到参数后的处理方法,必须有返回值
|
|
||||||
executeFunction: function executeFunction() {
|
|
||||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
return args[0] * args[0] * args[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
|
|
||||||
|
|
||||||
/* harmony default export */ var custom_functions = ({
|
|
||||||
Cubic: cubic
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/app.js
|
|
||||||
|
|
||||||
var app_install = function install(_ref, hookManager, definition) {
|
|
||||||
var RuleEngine = _ref.RuleEngine;
|
|
||||||
if (!RuleEngine) {
|
|
||||||
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object.keys(custom_functions).forEach(function (funcKey) {
|
|
||||||
var func = custom_functions[funcKey];
|
|
||||||
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
|
|
||||||
if (func.name.indexOf('custom') !== 0) {
|
|
||||||
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RuleEngine.getInstance().registerContextMethod(func.name, func);
|
|
||||||
} else {
|
|
||||||
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/* harmony default export */ var app = ({
|
|
||||||
install: app_install
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
||||||
|
|
||||||
|
|
||||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (app);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
/******/ });
|
|
||||||
});
|
|
||||||
@ -1 +0,0 @@
|
|||||||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["0971f994c95754494ad9b508d6916c39"]=t():e["0971f994c95754494ad9b508d6916c39"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,c;(function(n,i){o=[],r=i,c="function"===typeof r?r.apply(t,o):r,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,c=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,u=c.exec(p.stack)||i.exec(p.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,d=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");f===d&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var s=0;s<l.length;s++){if("interactive"===l[s].readyState)return l[s];if(l[s].src===f)return l[s];if(f===d&&l[s].innerHTML&&l[s].innerHTML.trim()===o)return l[s]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(n.p=c[1])}var i={name:"customcubic",mockFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字")},executeFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字");return t[0]*t[0]*t[0]}},u={Cubic:i},f=function(e,t,n){var r=e.RuleEngine;r?Object.keys(u).forEach((function(e){var t=u[e];if(t&&t.name&&t.executeFunction&&t.executeFunction instanceof Function){if(0!==t.name.indexOf("custom"))return void console.error("自定义函数-".concat(t.name," 名称有误,请以custom开头"));r.getInstance().registerContextMethod(t.name,t)}else console.error("请检查".concat(t&&t.name,"的规则函数定义"))})):console.error("x-extension上下文中没有注册RuleEngine, 请检查")},a={install:f};t["default"]=a}})}));
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<meta charset="utf-8">
|
|
||||||
<title>0971f994c95754494ad9b508d6916c39 demo</title>
|
|
||||||
<script src="./0971f994c95754494ad9b508d6916c39.umd.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./0971f994c95754494ad9b508d6916c39.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
console.log(0971f994c95754494ad9b508d6916c39)
|
|
||||||
</script>
|
|
||||||
@ -1,279 +0,0 @@
|
|||||||
module.exports =
|
|
||||||
/******/ (function(modules) { // webpackBootstrap
|
|
||||||
/******/ // The module cache
|
|
||||||
/******/ var installedModules = {};
|
|
||||||
/******/
|
|
||||||
/******/ // The require function
|
|
||||||
/******/ function __webpack_require__(moduleId) {
|
|
||||||
/******/
|
|
||||||
/******/ // Check if module is in cache
|
|
||||||
/******/ if(installedModules[moduleId]) {
|
|
||||||
/******/ return installedModules[moduleId].exports;
|
|
||||||
/******/ }
|
|
||||||
/******/ // Create a new module (and put it into the cache)
|
|
||||||
/******/ var module = installedModules[moduleId] = {
|
|
||||||
/******/ i: moduleId,
|
|
||||||
/******/ l: false,
|
|
||||||
/******/ exports: {}
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Execute the module function
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/
|
|
||||||
/******/ // Flag the module as loaded
|
|
||||||
/******/ module.l = true;
|
|
||||||
/******/
|
|
||||||
/******/ // Return the exports of the module
|
|
||||||
/******/ return module.exports;
|
|
||||||
/******/ }
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // expose the modules object (__webpack_modules__)
|
|
||||||
/******/ __webpack_require__.m = modules;
|
|
||||||
/******/
|
|
||||||
/******/ // expose the module cache
|
|
||||||
/******/ __webpack_require__.c = installedModules;
|
|
||||||
/******/
|
|
||||||
/******/ // define getter function for harmony exports
|
|
||||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
||||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
||||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
||||||
/******/ }
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // define __esModule on exports
|
|
||||||
/******/ __webpack_require__.r = function(exports) {
|
|
||||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
||||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
||||||
/******/ }
|
|
||||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // create a fake namespace object
|
|
||||||
/******/ // mode & 1: value is a module id, require it
|
|
||||||
/******/ // mode & 2: merge all properties of value into the ns
|
|
||||||
/******/ // mode & 4: return value when already ns object
|
|
||||||
/******/ // mode & 8|1: behave like require
|
|
||||||
/******/ __webpack_require__.t = function(value, mode) {
|
|
||||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
||||||
/******/ if(mode & 8) return value;
|
|
||||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
||||||
/******/ var ns = Object.create(null);
|
|
||||||
/******/ __webpack_require__.r(ns);
|
|
||||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
||||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
||||||
/******/ return ns;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
||||||
/******/ __webpack_require__.n = function(module) {
|
|
||||||
/******/ var getter = module && module.__esModule ?
|
|
||||||
/******/ function getDefault() { return module['default']; } :
|
|
||||||
/******/ function getModuleExports() { return module; };
|
|
||||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
||||||
/******/ return getter;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Object.prototype.hasOwnProperty.call
|
|
||||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
||||||
/******/
|
|
||||||
/******/ // __webpack_public_path__
|
|
||||||
/******/ __webpack_require__.p = "";
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // Load entry module and return exports
|
|
||||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
||||||
/******/ })
|
|
||||||
/************************************************************************/
|
|
||||||
/******/ ({
|
|
||||||
|
|
||||||
/***/ "8875":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
|
||||||
// MIT license
|
|
||||||
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
||||||
|
|
||||||
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (true) {
|
|
||||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
||||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
||||||
} else {}
|
|
||||||
}(typeof self !== 'undefined' ? self : this, function () {
|
|
||||||
function getCurrentScript () {
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
|
||||||
// for chrome
|
|
||||||
if (!descriptor && 'currentScript' in document && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// for other browsers with native support for currentScript
|
|
||||||
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 8-10 support script readyState
|
|
||||||
// IE 11+ & Firefox support stack trace
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Find the second match for the "at" string to get file src url from stack.
|
|
||||||
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
|
||||||
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
|
||||||
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
|
||||||
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
|
||||||
line = (stackDetails && stackDetails[2]) || false,
|
|
||||||
currentLocation = document.location.href.replace(document.location.hash, ''),
|
|
||||||
pageSource,
|
|
||||||
inlineScriptSourceRegExp,
|
|
||||||
inlineScriptSource,
|
|
||||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
||||||
|
|
||||||
if (scriptLocation === currentLocation) {
|
|
||||||
pageSource = document.documentElement.outerHTML;
|
|
||||||
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
|
||||||
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++) {
|
|
||||||
// If ready state is interactive, return the script tag
|
|
||||||
if (scripts[i].readyState === 'interactive') {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If src matches, return the script tag
|
|
||||||
if (scripts[i].src === scriptLocation) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If inline source matches, return the script tag
|
|
||||||
if (
|
|
||||||
scriptLocation === currentLocation &&
|
|
||||||
scripts[i].innerHTML &&
|
|
||||||
scripts[i].innerHTML.trim() === inlineScriptSource
|
|
||||||
) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no match, return null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return getCurrentScript
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "fb15":
|
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
||||||
// This file is imported into lib/wc client bundles.
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
var currentScript = window.document.currentScript
|
|
||||||
if (true) {
|
|
||||||
var getCurrentScript = __webpack_require__("8875")
|
|
||||||
currentScript = getCurrentScript()
|
|
||||||
|
|
||||||
// for backward compatibility, because previously we directly included the polyfill
|
|
||||||
if (!('currentScript' in document)) {
|
|
||||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
||||||
if (src) {
|
|
||||||
__webpack_require__.p = src[1] // eslint-disable-line
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicate to webpack that this file can be concatenated
|
|
||||||
/* harmony default export */ var setPublicPath = (null);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
|
|
||||||
/*
|
|
||||||
* cubic函数
|
|
||||||
* 求三次方
|
|
||||||
* 接收一个数字类型的参数,并求其三次方并返回
|
|
||||||
*/
|
|
||||||
/* harmony default export */ var cubic = ({
|
|
||||||
// 函数名必须以custom开头,否则无法被解析
|
|
||||||
name: 'customcubic',
|
|
||||||
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
|
|
||||||
mockFunction: function mockFunction() {
|
|
||||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 执行函数, 接收到参数后的处理方法,必须有返回值
|
|
||||||
executeFunction: function executeFunction() {
|
|
||||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
return args[0] * args[0] * args[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
|
|
||||||
|
|
||||||
/* harmony default export */ var custom_functions = ({
|
|
||||||
Cubic: cubic
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/mobile.js
|
|
||||||
|
|
||||||
var mobile_install = function install(_ref, hookManager, definition) {
|
|
||||||
var RuleEngine = _ref.RuleEngine;
|
|
||||||
if (!RuleEngine) {
|
|
||||||
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object.keys(custom_functions).forEach(function (funcKey) {
|
|
||||||
var func = custom_functions[funcKey];
|
|
||||||
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
|
|
||||||
if (func.name.indexOf('custom') !== 0) {
|
|
||||||
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RuleEngine.getInstance().registerContextMethod(func.name, func);
|
|
||||||
} else {
|
|
||||||
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/* harmony default export */ var mobile = ({
|
|
||||||
install: mobile_install
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
||||||
|
|
||||||
|
|
||||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (mobile);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
/******/ });
|
|
||||||
@ -1,289 +0,0 @@
|
|||||||
(function webpackUniversalModuleDefinition(root, factory) {
|
|
||||||
if(typeof exports === 'object' && typeof module === 'object')
|
|
||||||
module.exports = factory();
|
|
||||||
else if(typeof define === 'function' && define.amd)
|
|
||||||
define([], factory);
|
|
||||||
else if(typeof exports === 'object')
|
|
||||||
exports["0971f994c95754494ad9b508d6916c39"] = factory();
|
|
||||||
else
|
|
||||||
root["0971f994c95754494ad9b508d6916c39"] = factory();
|
|
||||||
})((typeof self !== 'undefined' ? self : this), function() {
|
|
||||||
return /******/ (function(modules) { // webpackBootstrap
|
|
||||||
/******/ // The module cache
|
|
||||||
/******/ var installedModules = {};
|
|
||||||
/******/
|
|
||||||
/******/ // The require function
|
|
||||||
/******/ function __webpack_require__(moduleId) {
|
|
||||||
/******/
|
|
||||||
/******/ // Check if module is in cache
|
|
||||||
/******/ if(installedModules[moduleId]) {
|
|
||||||
/******/ return installedModules[moduleId].exports;
|
|
||||||
/******/ }
|
|
||||||
/******/ // Create a new module (and put it into the cache)
|
|
||||||
/******/ var module = installedModules[moduleId] = {
|
|
||||||
/******/ i: moduleId,
|
|
||||||
/******/ l: false,
|
|
||||||
/******/ exports: {}
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Execute the module function
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/
|
|
||||||
/******/ // Flag the module as loaded
|
|
||||||
/******/ module.l = true;
|
|
||||||
/******/
|
|
||||||
/******/ // Return the exports of the module
|
|
||||||
/******/ return module.exports;
|
|
||||||
/******/ }
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // expose the modules object (__webpack_modules__)
|
|
||||||
/******/ __webpack_require__.m = modules;
|
|
||||||
/******/
|
|
||||||
/******/ // expose the module cache
|
|
||||||
/******/ __webpack_require__.c = installedModules;
|
|
||||||
/******/
|
|
||||||
/******/ // define getter function for harmony exports
|
|
||||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
||||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
||||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
||||||
/******/ }
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // define __esModule on exports
|
|
||||||
/******/ __webpack_require__.r = function(exports) {
|
|
||||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
||||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
||||||
/******/ }
|
|
||||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // create a fake namespace object
|
|
||||||
/******/ // mode & 1: value is a module id, require it
|
|
||||||
/******/ // mode & 2: merge all properties of value into the ns
|
|
||||||
/******/ // mode & 4: return value when already ns object
|
|
||||||
/******/ // mode & 8|1: behave like require
|
|
||||||
/******/ __webpack_require__.t = function(value, mode) {
|
|
||||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
||||||
/******/ if(mode & 8) return value;
|
|
||||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
||||||
/******/ var ns = Object.create(null);
|
|
||||||
/******/ __webpack_require__.r(ns);
|
|
||||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
||||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
||||||
/******/ return ns;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
||||||
/******/ __webpack_require__.n = function(module) {
|
|
||||||
/******/ var getter = module && module.__esModule ?
|
|
||||||
/******/ function getDefault() { return module['default']; } :
|
|
||||||
/******/ function getModuleExports() { return module; };
|
|
||||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
||||||
/******/ return getter;
|
|
||||||
/******/ };
|
|
||||||
/******/
|
|
||||||
/******/ // Object.prototype.hasOwnProperty.call
|
|
||||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
||||||
/******/
|
|
||||||
/******/ // __webpack_public_path__
|
|
||||||
/******/ __webpack_require__.p = "";
|
|
||||||
/******/
|
|
||||||
/******/
|
|
||||||
/******/ // Load entry module and return exports
|
|
||||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
||||||
/******/ })
|
|
||||||
/************************************************************************/
|
|
||||||
/******/ ({
|
|
||||||
|
|
||||||
/***/ "8875":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
|
||||||
// MIT license
|
|
||||||
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
||||||
|
|
||||||
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (true) {
|
|
||||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
||||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
||||||
} else {}
|
|
||||||
}(typeof self !== 'undefined' ? self : this, function () {
|
|
||||||
function getCurrentScript () {
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
|
||||||
// for chrome
|
|
||||||
if (!descriptor && 'currentScript' in document && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// for other browsers with native support for currentScript
|
|
||||||
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
|
||||||
return document.currentScript
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 8-10 support script readyState
|
|
||||||
// IE 11+ & Firefox support stack trace
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Find the second match for the "at" string to get file src url from stack.
|
|
||||||
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
|
||||||
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
|
||||||
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
|
||||||
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
|
||||||
line = (stackDetails && stackDetails[2]) || false,
|
|
||||||
currentLocation = document.location.href.replace(document.location.hash, ''),
|
|
||||||
pageSource,
|
|
||||||
inlineScriptSourceRegExp,
|
|
||||||
inlineScriptSource,
|
|
||||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
||||||
|
|
||||||
if (scriptLocation === currentLocation) {
|
|
||||||
pageSource = document.documentElement.outerHTML;
|
|
||||||
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
|
||||||
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++) {
|
|
||||||
// If ready state is interactive, return the script tag
|
|
||||||
if (scripts[i].readyState === 'interactive') {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If src matches, return the script tag
|
|
||||||
if (scripts[i].src === scriptLocation) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If inline source matches, return the script tag
|
|
||||||
if (
|
|
||||||
scriptLocation === currentLocation &&
|
|
||||||
scripts[i].innerHTML &&
|
|
||||||
scripts[i].innerHTML.trim() === inlineScriptSource
|
|
||||||
) {
|
|
||||||
return scripts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no match, return null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return getCurrentScript
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "fb15":
|
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
||||||
// This file is imported into lib/wc client bundles.
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
var currentScript = window.document.currentScript
|
|
||||||
if (true) {
|
|
||||||
var getCurrentScript = __webpack_require__("8875")
|
|
||||||
currentScript = getCurrentScript()
|
|
||||||
|
|
||||||
// for backward compatibility, because previously we directly included the polyfill
|
|
||||||
if (!('currentScript' in document)) {
|
|
||||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
||||||
if (src) {
|
|
||||||
__webpack_require__.p = src[1] // eslint-disable-line
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicate to webpack that this file can be concatenated
|
|
||||||
/* harmony default export */ var setPublicPath = (null);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/cubic/cubic.js
|
|
||||||
/*
|
|
||||||
* cubic函数
|
|
||||||
* 求三次方
|
|
||||||
* 接收一个数字类型的参数,并求其三次方并返回
|
|
||||||
*/
|
|
||||||
/* harmony default export */ var cubic = ({
|
|
||||||
// 函数名必须以custom开头,否则无法被解析
|
|
||||||
name: 'customcubic',
|
|
||||||
// 校验函数,用于函数保存前的校验, 可以对参数的个数及类型做限制
|
|
||||||
mockFunction: function mockFunction() {
|
|
||||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 执行函数, 接收到参数后的处理方法,必须有返回值
|
|
||||||
executeFunction: function executeFunction() {
|
|
||||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
if (!(args && args.length === 1)) {
|
|
||||||
throw new Error('参数长度必须是1个');
|
|
||||||
}
|
|
||||||
if (isNaN(parseFloat(args[0])) || !isFinite(args[0])) {
|
|
||||||
throw new Error('参数类型必须是数字');
|
|
||||||
}
|
|
||||||
return args[0] * args[0] * args[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/custom-functions/index.js
|
|
||||||
|
|
||||||
/* harmony default export */ var custom_functions = ({
|
|
||||||
Cubic: cubic
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./src/custom/apaas-custom-plugin-rule-functions/mobile.js
|
|
||||||
|
|
||||||
var mobile_install = function install(_ref, hookManager, definition) {
|
|
||||||
var RuleEngine = _ref.RuleEngine;
|
|
||||||
if (!RuleEngine) {
|
|
||||||
console.error('x-extension上下文中没有注册RuleEngine, 请检查');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object.keys(custom_functions).forEach(function (funcKey) {
|
|
||||||
var func = custom_functions[funcKey];
|
|
||||||
if (func && func.name && func.executeFunction && func.executeFunction instanceof Function) {
|
|
||||||
if (func.name.indexOf('custom') !== 0) {
|
|
||||||
console.error("\u81EA\u5B9A\u4E49\u51FD\u6570-".concat(func.name, " \u540D\u79F0\u6709\u8BEF\uFF0C\u8BF7\u4EE5custom\u5F00\u5934"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RuleEngine.getInstance().registerContextMethod(func.name, func);
|
|
||||||
} else {
|
|
||||||
console.error("\u8BF7\u68C0\u67E5".concat(func && func.name, "\u7684\u89C4\u5219\u51FD\u6570\u5B9A\u4E49"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/* harmony default export */ var mobile = ({
|
|
||||||
install: mobile_install
|
|
||||||
});
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
||||||
|
|
||||||
|
|
||||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (mobile);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
/******/ });
|
|
||||||
});
|
|
||||||
@ -1 +0,0 @@
|
|||||||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["0971f994c95754494ad9b508d6916c39"]=t():e["0971f994c95754494ad9b508d6916c39"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8875:function(e,t,n){var r,o,c;(function(n,i){o=[],r=i,c="function"===typeof r?r.apply(t,o):r,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,c=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,u=c.exec(p.stack)||i.exec(p.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,d=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");f===d&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var s=0;s<l.length;s++){if("interactive"===l[s].readyState)return l[s];if(l[s].src===f)return l[s];if(f===d&&l[s].innerHTML&&l[s].innerHTML.trim()===o)return l[s]}return null}}return e}))},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(n.p=c[1])}var i={name:"customcubic",mockFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字")},executeFunction:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t||1!==t.length)throw new Error("参数长度必须是1个");if(isNaN(parseFloat(t[0]))||!isFinite(t[0]))throw new Error("参数类型必须是数字");return t[0]*t[0]*t[0]}},u={Cubic:i},f=function(e,t,n){var r=e.RuleEngine;r?Object.keys(u).forEach((function(e){var t=u[e];if(t&&t.name&&t.executeFunction&&t.executeFunction instanceof Function){if(0!==t.name.indexOf("custom"))return void console.error("自定义函数-".concat(t.name," 名称有误,请以custom开头"));r.getInstance().registerContextMethod(t.name,t)}else console.error("请检查".concat(t&&t.name,"的规则函数定义"))})):console.error("x-extension上下文中没有注册RuleEngine, 请检查")},a={install:f};t["default"]=a}})}));
|
|
||||||
35598
package-lock.json
generated
35598
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -13,14 +13,12 @@
|
|||||||
"cm": "git-cz"
|
"cm": "git-cz"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@x-apaas/x-apaas-cli": "0.0.17",
|
|
||||||
"@x-apaas/x-apaas-frontend-i18n": "rc",
|
|
||||||
"@x-apaas/x-dcloud-page-engine": "rc",
|
|
||||||
"@x-apaas/x-dcloud-page-web": "rc",
|
|
||||||
"@x-ui/x-dcloud-ui": "^0.2.1",
|
"@x-ui/x-dcloud-ui": "^0.2.1",
|
||||||
|
"@x-apaas/x-dcloud-page-web": "rc",
|
||||||
|
"@x-apaas/x-dcloud-page-engine": "rc",
|
||||||
|
"@x-apaas/x-apaas-frontend-i18n": "rc",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"dayjs": "^1.8.27",
|
"dayjs": "^1.8.27",
|
||||||
"echarts": "^5.6.0",
|
|
||||||
"element-ui": "^2.13.2",
|
"element-ui": "^2.13.2",
|
||||||
"js-file-download": "^0.4.12",
|
"js-file-download": "^0.4.12",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
@ -46,6 +44,7 @@
|
|||||||
"@vue/cli-plugin-vuex": "^4.3.0",
|
"@vue/cli-plugin-vuex": "^4.3.0",
|
||||||
"@vue/cli-service": "^4.3.0",
|
"@vue/cli-service": "^4.3.0",
|
||||||
"@vue/eslint-config-prettier": "^6.0.0",
|
"@vue/eslint-config-prettier": "^6.0.0",
|
||||||
|
"@vue/eslint-config-standard": "^4.0.0",
|
||||||
"@vue/test-utils": "1.0.0-beta.31",
|
"@vue/test-utils": "1.0.0-beta.31",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"babel-plugin-component": "^1.1.1",
|
"babel-plugin-component": "^1.1.1",
|
||||||
@ -56,11 +55,11 @@
|
|||||||
"cz-conventional-changelog": "^3.2.0",
|
"cz-conventional-changelog": "^3.2.0",
|
||||||
"cz-customizable": "^6.2.0",
|
"cz-customizable": "^6.2.0",
|
||||||
"eslint": "^6.7.2",
|
"eslint": "^6.7.2",
|
||||||
"eslint-html-reporter": "^0.7.4",
|
|
||||||
"eslint-plugin-prettier": "^3.1.1",
|
"eslint-plugin-prettier": "^3.1.1",
|
||||||
"eslint-plugin-vue": "^6.2.2",
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
"husky": "^4.2.5",
|
"husky": "^4.2.5",
|
||||||
"lint-staged": "^9.5.0",
|
"lint-staged": "^9.5.0",
|
||||||
|
"node-sass": "^4.12.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^1.19.1",
|
||||||
"progress-bar-webpack-plugin": "^2.1.0",
|
"progress-bar-webpack-plugin": "^2.1.0",
|
||||||
|
|||||||
@ -147,5 +147,5 @@ export default {
|
|||||||
url: '/xdap-app/form/query/formComponent',
|
url: '/xdap-app/form/query/formComponent',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,14 +21,9 @@ export default {
|
|||||||
url: '/custom/dataEntryEngineModel/insert',
|
url: '/custom/dataEntryEngineModel/insert',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
},
|
},
|
||||||
// 更新引擎(列表编辑机型)
|
|
||||||
UPDATE_ENGINE_MODEL: {
|
|
||||||
url: '/custom/dataEntryEngineModel/update',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
//导入引擎
|
//导入引擎
|
||||||
IMPORT_ENGINE_MODEL: {
|
IMPORT_ENGINE_MODEL: {
|
||||||
url: '/custom/engineParamDetailPojo/excelImport',
|
url: '/custom/dataEntryEngineModel/import',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
},
|
},
|
||||||
//获取参数列表
|
//获取参数列表
|
||||||
@ -48,47 +43,5 @@ export default {
|
|||||||
GET_ENGINE_TABLE_DETAIL: {
|
GET_ENGINE_TABLE_DETAIL: {
|
||||||
url: '/custom/engineParamDetailPojo/selectParamListAndModel',
|
url: '/custom/engineParamDetailPojo/selectParamListAndModel',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
|
||||||
// 填写人进入详情页时获取参数树(传参与 GET_ENGINE_TABLE_DETAIL 相同)
|
|
||||||
GET_ENGINE_TABLE_DETAIL_FOR_FILLED_BY: {
|
|
||||||
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledBy',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
GET_ENGINE_TABLE_DETAIL_FOR_FILLED_BY_HISTORY: {
|
|
||||||
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledByHistory',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
// 责任人分发填写人时获取参数树(传参与 GET_ENGINE_TABLE_DETAIL 相同,userID 为责任人 ID)
|
|
||||||
GET_ENGINE_TABLE_DETAIL_FOR_RESPONSIBLE_PERSON: {
|
|
||||||
url: '/custom/engineParamDetailPojo/selectParamListAndModelForResponsiblePerson',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
GET_NEW_MODEL_VERSION: {
|
|
||||||
url: '/custom/dataEntryEngineModel/synchronizeParams',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
CONTINUE_DATA_APPROVAL: {
|
|
||||||
url: '/custom/activiti/continueApproval',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
UPDATE_APPROVAL_DATA: {
|
|
||||||
url: '/custom/activiti/updateNode',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
EDIT_DATA_DEPT: {
|
|
||||||
url: '/custom/engineParamDetailPojo/updateDept',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
REJECT_TODO_TASK: {
|
|
||||||
url: '/custom/todoTaskPojo/rejectTodo',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
CHECK_PERMISSION_USER_DATA: {
|
|
||||||
url: '/custom/permission/getPreAndRoleByCondition',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
EXPORT_PERMISSION_USER_DATA: {
|
|
||||||
url: '/custom/permission/exportPreAndRole',
|
|
||||||
method: 'get'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ export default {
|
|||||||
|
|
||||||
GET_ENGINE_VERSIONS: {
|
GET_ENGINE_VERSIONS: {
|
||||||
url: '/custom/engineParamDetailPojo/selectVersionList',
|
url: '/custom/engineParamDetailPojo/selectVersionList',
|
||||||
method: 'get'
|
method: 'post'
|
||||||
},
|
},
|
||||||
|
|
||||||
TEXT_DEMO: {
|
TEXT_DEMO: {
|
||||||
@ -220,42 +220,10 @@ export default {
|
|||||||
url: '/custom/responsible/getImportTemplate',
|
url: '/custom/responsible/getImportTemplate',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
},
|
||||||
GET_MODEL_BY_ID: {
|
|
||||||
url: '/custom/template/getTemplateById',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
// 修改流程主题
|
// 修改流程主题
|
||||||
EDIT_DATA_PROCESS_TITLE: {
|
EDIT_DATA_PROCESS_TITLE: {
|
||||||
url: '/custom/activiti/updateFlowTitle',
|
url: '/custom/activiti/updateFlowTitle',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
|
||||||
// 获取图表常用
|
|
||||||
GET_CHART_COMMONLY_USED: {
|
|
||||||
url: '/custom/common/getChartCommonParameter',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
ADD_CHART_COMMONLY_USED: {
|
|
||||||
url: '/custom/common/insertChartCommon',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
EDIT_CHART_COMMONLY_USED: {
|
|
||||||
url: '/custom/common/updateChartCommon',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
GET_USER_INFO :{
|
|
||||||
url: '/custom/xdapDeptUsersPojo/getUserInfo',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
GET_YC_TODO_LIST: {
|
|
||||||
url: '/custom/YcTaskResult/getTodoById',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
GET_YC_MY_SEND_LIST: {
|
|
||||||
url: '/custom/YcTaskResult/getInitiatorById',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
GET_YC_MY_DONE_LIST: {
|
|
||||||
url: '/custom/YcTaskResult/getCompletedById',
|
|
||||||
method: 'get'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,8 +83,7 @@ export default {
|
|||||||
GET_APPROVAL_CHANGE: {
|
GET_APPROVAL_CHANGE: {
|
||||||
url: '/custom/approval/getTemplateChanges',
|
url: '/custom/approval/getTemplateChanges',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
}, //获取审批所有
|
||||||
// 获取审批所有
|
|
||||||
GET_PPROVAL_ALL: {
|
GET_PPROVAL_ALL: {
|
||||||
url: '/custom/approval/getApprovalProcess',
|
url: '/custom/approval/getApprovalProcess',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
@ -106,7 +105,10 @@ export default {
|
|||||||
url: '/custom/approval/directSendingApproval',
|
url: '/custom/approval/directSendingApproval',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
},
|
||||||
|
GET_MODEL_BY_ID: {
|
||||||
|
url: '/custom/template/getTemplateById',
|
||||||
|
method: 'get'
|
||||||
|
},
|
||||||
GET_CAN_RETURN_NODE: {
|
GET_CAN_RETURN_NODE: {
|
||||||
url: '/custom/approval/getReturnNodes',
|
url: '/custom/approval/getReturnNodes',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
@ -122,29 +124,5 @@ export default {
|
|||||||
EDIT_APPROVAL_PROCESS_TITLE: {
|
EDIT_APPROVAL_PROCESS_TITLE: {
|
||||||
url: '/custom/approval/updateFlowTitle',
|
url: '/custom/approval/updateFlowTitle',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
|
||||||
EDIT_APPROVAL_PROCESS: {
|
|
||||||
url: '/custom/approval/updateNode',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
CONTINUE_APPROVAL_PROCESS: {
|
|
||||||
url: '/custom/approval/continueApproval',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
GET_DEPT_OF_USER: {
|
|
||||||
url: '/custom/responsible/getResponsibleDepartment',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
UPDATE_TEMPLATE_ORDER: {
|
|
||||||
url: '/custom/template/batchUpdateTemplateOrder',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
BATCH_UPDATE_DEPARTMENT: {
|
|
||||||
url: '/custom/todoTaskPojo/batchUpdateDepartment',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
SAVE_FILLED_BY_TEMP: {
|
|
||||||
url: '/custom/engineParamDetailPojo/saveFilledByTemp',
|
|
||||||
method: 'post'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export default {
|
|||||||
url: '/custom/permission/getAllPermission',
|
url: '/custom/permission/getAllPermission',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
},
|
||||||
DELETE_ROLE_DATA: {
|
DELETE_PERMISSION_DATA: {
|
||||||
url: '/custom/permission/deleteRole',
|
url: '/custom/permission/deleteRole',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
},
|
||||||
@ -64,20 +64,5 @@ export default {
|
|||||||
GET_ROLE_CONTROL_LIST: {
|
GET_ROLE_CONTROL_LIST: {
|
||||||
url: '/custom/permission/selectPersByRole',
|
url: '/custom/permission/selectPersByRole',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
|
||||||
// 获取角色成员列表
|
|
||||||
GET_ROLE_MEMBERS: {
|
|
||||||
url: '/custom/permission/getRoleMembers',
|
|
||||||
method: 'get'
|
|
||||||
},
|
|
||||||
// 添加角色成员
|
|
||||||
ADD_ROLE_MEMBERS: {
|
|
||||||
url: '/custom/permission/addRoleMembers',
|
|
||||||
method: 'post'
|
|
||||||
},
|
|
||||||
// 删除角色成员
|
|
||||||
DELETE_ROLE_MEMBERS: {
|
|
||||||
url: '/custom/permission/deleteRoleMembers',
|
|
||||||
method: 'post'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,9 +62,5 @@ export default {
|
|||||||
GET_REPORT_APPROVAL_USERS: {
|
GET_REPORT_APPROVAL_USERS: {
|
||||||
url: '/custom/benchmark/getApprovalUsers',
|
url: '/custom/benchmark/getApprovalUsers',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
|
||||||
CONTINUE_REPORT_APPROVAL: {
|
|
||||||
url: '/custom/benchmark/continueApproval',
|
|
||||||
method: 'get'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-loading {
|
|
||||||
position: absolute;
|
|
||||||
top: 42%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-loading .loading-gif {
|
|
||||||
width: 60%;
|
|
||||||
height: 60%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-ie :not(font) {
|
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}{
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-loading {
|
|
||||||
position: absolute;
|
|
||||||
top: 42%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-loading .loading-gif {
|
|
||||||
width: 60%;
|
|
||||||
height: 60%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-ie :not(font) {
|
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
@ -100,13 +100,6 @@
|
|||||||
"title": "我发起的"
|
"title": "我发起的"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"apaas-custom-myDemo":{
|
|
||||||
"name": "apaas-custom-myDemo",
|
|
||||||
"path": "apaas-custom-myDemo",
|
|
||||||
"meta": {
|
|
||||||
"title": "我的测试"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apaas-custom-selfEngineCheck":{
|
"apaas-custom-selfEngineCheck":{
|
||||||
"name": "apaas-custom-selfEngineCheck",
|
"name": "apaas-custom-selfEngineCheck",
|
||||||
"path": "apaas-custom-selfEngineCheck",
|
"path": "apaas-custom-selfEngineCheck",
|
||||||
@ -141,20 +134,6 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"title": "权限管理"
|
"title": "权限管理"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"apaas-custom-roleMemberManagement":{
|
|
||||||
"name": "apaas-custom-roleMemberManagement",
|
|
||||||
"path": "apaas-custom-roleMemberManagement",
|
|
||||||
"meta": {
|
|
||||||
"title": "人员管理"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apaas-custom-checkPersonPermission":{
|
|
||||||
"name": "apaas-custom-checkPersonPermission",
|
|
||||||
"path": "apaas-custom-checkPersonPermission",
|
|
||||||
"meta": {
|
|
||||||
"title": "权限检查"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"customWidgetList": [
|
"customWidgetList": [
|
||||||
|
|||||||
@ -7,14 +7,14 @@
|
|||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
:modalVisible.sync="visible"
|
:modalVisible.sync="visible"
|
||||||
:wrapper-class="'add-engine-model-modal'"
|
:wrapper-class="'add-engine-model-modal'"
|
||||||
:title="modalTitle"
|
title="添加机型"
|
||||||
:width="850"
|
:width="800"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="addForm"
|
ref="addForm"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-width="140px"
|
label-width="100px"
|
||||||
class="add-engine-form"
|
class="add-engine-form"
|
||||||
>
|
>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -33,29 +33,6 @@
|
|||||||
<el-input v-model="formData.platform" placeholder="请输入" maxlength="100" />
|
<el-input v-model="formData.platform" placeholder="请输入" maxlength="100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<!-- 竞品发动机专有字段:厂家全称和简称在第二行 -->
|
|
||||||
<div v-if="ycOrOth === '竞品'" class="form-row">
|
|
||||||
<el-form-item label="厂家名称(全称)" prop="manufacturerName">
|
|
||||||
<el-input v-model="formData.manufacturerName" placeholder="请输入" maxlength="100" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="厂家简称" prop="manufacturerAbbreviation">
|
|
||||||
<el-input v-model="formData.manufacturerAbbreviation" placeholder="请输入" maxlength="100" />
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<div v-if="ycOrOth === '竞品'" class="form-row">
|
|
||||||
<el-form-item label="品牌" prop="brand">
|
|
||||||
<el-input v-model="formData.brand" placeholder="请输入" maxlength="100" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="生产日期" prop="productionDate">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.productionDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="请选择生产日期"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<el-form-item label="细分市场" prop="marketSegment">
|
<el-form-item label="细分市场" prop="marketSegment">
|
||||||
<el-input v-model="formData.marketSegment" placeholder="请输入" maxlength="100" />
|
<el-input v-model="formData.marketSegment" placeholder="请输入" maxlength="100" />
|
||||||
@ -124,8 +101,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
submitting: false,
|
submitting: false,
|
||||||
isEditMode: false,
|
|
||||||
editingModelId: null,
|
|
||||||
ycOrOth: '竞品', // 默认为竞品,根据打开的页面不同而不同
|
ycOrOth: '竞品', // 默认为竞品,根据打开的页面不同而不同
|
||||||
formData: {
|
formData: {
|
||||||
modelName: '',
|
modelName: '',
|
||||||
@ -137,15 +112,7 @@ export default {
|
|||||||
marketSegment: '',
|
marketSegment: '',
|
||||||
projectName: '',
|
projectName: '',
|
||||||
projectNumber: '',
|
projectNumber: '',
|
||||||
dispatchStatus: '',
|
dispatchStatus: ''
|
||||||
emission: '',
|
|
||||||
burnType: '',
|
|
||||||
engineCapacity: '',
|
|
||||||
// 竞品发动机专有字段
|
|
||||||
manufacturerName: '',
|
|
||||||
manufacturerAbbreviation: '',
|
|
||||||
brand: '',
|
|
||||||
productionDate: ''
|
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
modelName: [{ required: true, message: '请输入产品型号', trigger: 'blur' }],
|
modelName: [{ required: true, message: '请输入产品型号', trigger: 'blur' }],
|
||||||
@ -156,8 +123,7 @@ export default {
|
|||||||
series: [{ required: true, message: '请输入系列', trigger: 'blur' }],
|
series: [{ required: true, message: '请输入系列', trigger: 'blur' }],
|
||||||
marketSegment: [{ required: true, message: '请输入细分市场', trigger: 'blur' }],
|
marketSegment: [{ required: true, message: '请输入细分市场', trigger: 'blur' }],
|
||||||
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
||||||
projectNumber: [{ required: true, message: '请输入项目编号', trigger: 'blur' }],
|
projectNumber: [{ required: true, message: '请输入项目编号', trigger: 'blur' }]
|
||||||
productionDate:[{ required: true, message: '请选择生产日期', trigger: 'blur' }]
|
|
||||||
// 根据实际需求添加验证规则
|
// 根据实际需求添加验证规则
|
||||||
},
|
},
|
||||||
dispatchStatusOptions: [
|
dispatchStatusOptions: [
|
||||||
@ -166,17 +132,10 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
modalTitle() {
|
|
||||||
return this.isEditMode ? '编辑机型' : '添加机型'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
showModal(ycOrOth = '竞品') {
|
showModal(ycOrOth = '竞品') {
|
||||||
// 根据来源页面设置 ycOrOth 值
|
// 根据来源页面设置 ycOrOth 值
|
||||||
// selfEnginedata.vue 传 "玉柴",otherEnginedata.vue 传 "竞品"
|
// selfEnginedata.vue 传 "玉柴",otherEnginedata.vue 传 "竞品"
|
||||||
this.isEditMode = false
|
|
||||||
this.editingModelId = null
|
|
||||||
this.ycOrOth = ycOrOth
|
this.ycOrOth = ycOrOth
|
||||||
this.visible = true
|
this.visible = true
|
||||||
// 重置表单
|
// 重置表单
|
||||||
@ -188,46 +147,8 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showModalForEdit(ycOrOth, row) {
|
|
||||||
if (!row || row.id == null) {
|
|
||||||
this.$message({ message: '无法编辑:缺少机型标识', type: 'warning' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.isEditMode = true
|
|
||||||
this.editingModelId = row.id
|
|
||||||
this.ycOrOth = ycOrOth
|
|
||||||
this.visible = true
|
|
||||||
const r = row || {}
|
|
||||||
this.formData = {
|
|
||||||
loginUserId: getUserId(),
|
|
||||||
ycOrOth,
|
|
||||||
modelName: r.modelName != null ? String(r.modelName) : '',
|
|
||||||
productNumber: r.productNumber != null ? String(r.productNumber) : '',
|
|
||||||
plate: r.plate != null ? String(r.plate) : '',
|
|
||||||
platform: r.platform != null ? String(r.platform) : '',
|
|
||||||
series: r.series != null ? String(r.series) : '',
|
|
||||||
marketSegment: r.marketSegment != null ? String(r.marketSegment) : '',
|
|
||||||
projectName: r.projectName != null ? String(r.projectName) : '',
|
|
||||||
projectNumber: r.projectNumber != null ? String(r.projectNumber) : '',
|
|
||||||
distributeStatus: r.distributeStatus != null ? String(r.distributeStatus) : '未分发',
|
|
||||||
emission: r.emission != null ? String(r.emission) : '',
|
|
||||||
burnType: r.burnType != null ? String(r.burnType) : '',
|
|
||||||
engineCapacity: r.engineCapacity != null ? String(r.engineCapacity) : '',
|
|
||||||
manufacturerName: r.manufacturerName != null ? String(r.manufacturerName) : '',
|
|
||||||
manufacturerAbbreviation: r.manufacturerAbbreviation != null ? String(r.manufacturerAbbreviation) : '',
|
|
||||||
brand: r.brand != null ? String(r.brand) : '',
|
|
||||||
productionDate: r.productionDate != null ? String(r.productionDate) : ''
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.addForm) {
|
|
||||||
this.$refs.addForm.clearValidate()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
closeModal() {
|
closeModal() {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.isEditMode = false
|
|
||||||
this.editingModelId = null
|
|
||||||
this.ycOrOth = '竞品' // 重置为默认值
|
this.ycOrOth = '竞品' // 重置为默认值
|
||||||
this.resetForm('竞品')
|
this.resetForm('竞品')
|
||||||
},
|
},
|
||||||
@ -243,41 +164,24 @@ export default {
|
|||||||
marketSegment: '',
|
marketSegment: '',
|
||||||
projectName: '',
|
projectName: '',
|
||||||
projectNumber: '',
|
projectNumber: '',
|
||||||
distributeStatus: '未分发',
|
distributeStatus: '未分发'
|
||||||
emission: '',
|
|
||||||
burnType: '',
|
|
||||||
engineCapacity: '',
|
|
||||||
// 竞品发动机专有字段
|
|
||||||
manufacturerName: '',
|
|
||||||
manufacturerAbbreviation: '',
|
|
||||||
brand: '',
|
|
||||||
productionDate: ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.$refs.addForm.validate((valid) => {
|
this.$refs.addForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.submitting = true
|
this.submitting = true
|
||||||
const params = { ...this.formData }
|
|
||||||
Object.keys(params).forEach((k) => {
|
|
||||||
if (params[k] == null) params[k] = ''
|
|
||||||
})
|
|
||||||
const isEdit = this.isEditMode && this.editingModelId != null
|
|
||||||
if (isEdit) {
|
|
||||||
params.id = this.editingModelId
|
|
||||||
}
|
|
||||||
const apiDef = isEdit ? api.UPDATE_ENGINE_MODEL : api.ADD_ENGINE_MODEL
|
|
||||||
const request = {
|
const request = {
|
||||||
...apiDef,
|
...api.ADD_ENGINE_MODEL,
|
||||||
params: {
|
params: {
|
||||||
...params
|
...this.formData
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: isEdit ? '保存成功' : '提交成功',
|
message: '提交成功',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
@ -285,9 +189,9 @@ export default {
|
|||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error(isEdit ? '更新失败:' : '添加失败:', err)
|
console.error('添加失败:', err)
|
||||||
this.$message({
|
this.$message({
|
||||||
message: isEdit ? '更新失败' : '添加失败',
|
message: '添加失败',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -305,8 +209,7 @@ export default {
|
|||||||
.add-engine-model-modal {
|
.add-engine-model-modal {
|
||||||
.add-engine-form {
|
.add-engine-form {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
height: calc(70vh - 120px) !important;
|
|
||||||
overflow-y: auto !important;
|
|
||||||
.form-row {
|
.form-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -329,5 +232,4 @@ export default {
|
|||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -138,14 +138,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -228,8 +221,7 @@ export default {
|
|||||||
opinion: ''
|
opinion: ''
|
||||||
},
|
},
|
||||||
approvalSubmitting: false,
|
approvalSubmitting: false,
|
||||||
currentApprovalRow: null,
|
currentApprovalRow: null
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -275,80 +267,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
this.loadData()
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
this.loadUserSelfRole()
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "参数模板审批流程" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('参数模板审批流程')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
// 加载用户自身角色权限
|
||||||
loadUserSelfRole() {
|
loadUserSelfRole() {
|
||||||
const request = {
|
const request = {
|
||||||
@ -358,26 +281,19 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 将权限数据存储到 localStorage
|
// 将权限数据存储到 localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
reject(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pageSizeChange(size) {
|
pageSizeChange(size) {
|
||||||
|
|||||||
@ -251,8 +251,8 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<!-- 当选择"编制"节点时,显示意见输入框 -->
|
<!-- 当选择"发起审批"节点时,显示意见输入框 -->
|
||||||
<div v-if="selectedReturnNode === '编制'" class="return-opinion-section">
|
<div v-if="selectedReturnNode === '发起审批'" class="return-opinion-section">
|
||||||
<div class="opinion-label">
|
<div class="opinion-label">
|
||||||
退回意见:
|
退回意见:
|
||||||
</div>
|
</div>
|
||||||
@ -340,7 +340,7 @@ export default {
|
|||||||
returnNodeDialogVisible: false,
|
returnNodeDialogVisible: false,
|
||||||
selectedReturnNode: '',
|
selectedReturnNode: '',
|
||||||
returnSubmitting: false,
|
returnSubmitting: false,
|
||||||
returnOpinion: '', // 退回意见(仅在选择编制节点时使用)
|
returnOpinion: '', // 退回意见(仅在选择发起审批节点时使用)
|
||||||
resending: false, // 直送提交loading状态
|
resending: false, // 直送提交loading状态
|
||||||
isEditingProcessTitle: false, // 是否正在编辑流程主题
|
isEditingProcessTitle: false, // 是否正在编辑流程主题
|
||||||
editingProcessTitle: '' // 正在编辑的流程主题值
|
editingProcessTitle: '' // 正在编辑的流程主题值
|
||||||
@ -781,14 +781,14 @@ export default {
|
|||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log(resp)
|
console.log(resp)
|
||||||
// 在列表最前面添加"编制"节点作为默认选项
|
// 在列表最前面添加"发起审批"节点作为默认选项
|
||||||
const nodes = Array.isArray(resp.data) ? resp.data : []
|
const nodes = Array.isArray(resp.data) ? resp.data : []
|
||||||
this.returnableNodes = ['编制', ...nodes]
|
this.returnableNodes = ['发起审批', ...nodes]
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取退回节点失败:', err)
|
console.error('获取退回节点失败:', err)
|
||||||
// 即使获取失败,也添加"编制"节点
|
// 即使获取失败,也添加"发起审批"节点
|
||||||
this.returnableNodes = ['编制']
|
this.returnableNodes = ['发起审批']
|
||||||
})
|
})
|
||||||
this.selectedReturnNode = ''
|
this.selectedReturnNode = ''
|
||||||
this.returnOpinion = ''
|
this.returnOpinion = ''
|
||||||
@ -802,8 +802,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 处理退回节点选择变化
|
// 处理退回节点选择变化
|
||||||
handleReturnNodeChange() {
|
handleReturnNodeChange() {
|
||||||
// 如果不是"编制"节点,清空意见
|
// 如果不是"发起审批"节点,清空意见
|
||||||
if (this.selectedReturnNode !== '编制') {
|
if (this.selectedReturnNode !== '发起审批') {
|
||||||
this.returnOpinion = ''
|
this.returnOpinion = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -821,8 +821,8 @@ export default {
|
|||||||
|
|
||||||
this.returnSubmitting = true
|
this.returnSubmitting = true
|
||||||
|
|
||||||
// 如果选择的是"编制"节点,调用拒绝接口
|
// 如果选择的是"发起审批"节点,调用拒绝接口
|
||||||
if (this.selectedReturnNode === '编制') {
|
if (this.selectedReturnNode === '发起审批') {
|
||||||
const submitData = {
|
const submitData = {
|
||||||
flowId: this.detail.flowId,
|
flowId: this.detail.flowId,
|
||||||
userId: getUserId(),
|
userId: getUserId(),
|
||||||
@ -1557,20 +1557,22 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.return-opinion-section {
|
.return-opinion-section {
|
||||||
margin-top: 16px !important;
|
margin-top: 16px;
|
||||||
|
padding-top: 16px;
|
||||||
border-top: 1px solid #ebeef5;
|
border-top: 1px solid #ebeef5;
|
||||||
|
|
||||||
.opinion-label {
|
.opinion-label {
|
||||||
margin-bottom: 5px !important;
|
margin-bottom: 8px;
|
||||||
margin-top: 5px !important;
|
margin-top: 8px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #606266;
|
color: #606266;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.approval-progress-fade-enter-active,
|
.approval-progress-fade-enter-active,
|
||||||
.approval-progress-fade-leave-active {
|
.approval-progress-fade-leave-active {
|
||||||
transition: opacity 0.2s ease;
|
transition: opacity 0.2s ease;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -162,16 +162,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">
|
|
||||||
无权限查看
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -518,8 +509,7 @@ export default {
|
|||||||
currentApprovalRow: null,
|
currentApprovalRow: null,
|
||||||
showReportDetail: false,
|
showReportDetail: false,
|
||||||
currentReportDetail: null,
|
currentReportDetail: null,
|
||||||
downloadingRowId: '',
|
downloadingRowId: ''
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -565,137 +555,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "对标报告" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('对标报告')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有报告的编辑权限
|
|
||||||
hasReportEditPermission() {
|
|
||||||
// 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 permissionPath 为 "对标报告" 且 parameterPer 是编辑的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
const parameterPer = perm.parameterPer || ''
|
|
||||||
return permissionPath === '对标报告' && parameterPer === '编辑'
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查报告编辑权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
|
||||||
loadUserSelfRole() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_USER_SELF_ROLE,
|
|
||||||
params: {
|
|
||||||
userOrDepID: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 将权限数据存储到 localStorage
|
|
||||||
try {
|
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取用户自身角色失败:', err)
|
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.dialogMode = 'create'
|
this.dialogMode = 'create'
|
||||||
this.currentRestartRow = null
|
this.currentRestartRow = null
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,557 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="manager-data-page custom-page">
|
|
||||||
<div class="page-content">
|
|
||||||
<div class="header-section">
|
|
||||||
<div class="title">
|
|
||||||
权限查看
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="page-search-panel">
|
|
||||||
<div class="searched-fields">
|
|
||||||
<div class="searched-field">
|
|
||||||
<span class="fielded-label">角色名称</span>
|
|
||||||
<el-input v-model="searchPanelValue.roleName" placeholder="请输入" />
|
|
||||||
</div>
|
|
||||||
<div class="searched-field">
|
|
||||||
<span class="fielded-label">成员名称</span>
|
|
||||||
<el-input v-model="searchPanelValue.username" placeholder="请输入" />
|
|
||||||
</div>
|
|
||||||
<div class="searched-field">
|
|
||||||
<span class="fielded-label">成员部门</span>
|
|
||||||
<el-input v-model="searchPanelValue.department" placeholder="请输入" />
|
|
||||||
</div>
|
|
||||||
<div class="search-actions">
|
|
||||||
<el-button type="primary" @click="handleExport">
|
|
||||||
导出
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="handleSearch">
|
|
||||||
查询
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="resetSearch">
|
|
||||||
重置
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="table-section">
|
|
||||||
<el-table
|
|
||||||
:data="tableData"
|
|
||||||
border
|
|
||||||
style="width: 100%"
|
|
||||||
:max-height="tableMaxHeight"
|
|
||||||
>
|
|
||||||
<el-table-column prop="roleName" label="角色名称" width="140" align="center" />
|
|
||||||
<el-table-column prop="username" label="成员姓名" width="120" align="center" />
|
|
||||||
<el-table-column prop="userNumber" label="成员工号" width="120" align="center" />
|
|
||||||
<el-table-column prop="department" label="成员部门" width="160" align="center" />
|
|
||||||
<el-table-column label="查看权限" align="left">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span class="perms-cell">{{ scope.row.roleName === '超级管理员' ? '全部权限' : formatPerms(scope.row.queryPerms) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="编辑权限" align="left">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span class="perms-cell">{{ scope.row.roleName === '超级管理员' ? '全部权限' : formatPerms(scope.row.editPerms) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<template slot="empty">
|
|
||||||
<div class="table-empty">
|
|
||||||
<template>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">
|
|
||||||
暂无数据
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table>
|
|
||||||
<div class="pagination-section">
|
|
||||||
<el-pagination
|
|
||||||
:current-page="pagination.currentPage"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="pagination.pageSize"
|
|
||||||
:total="pagination.total"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import api from '@/api'
|
|
||||||
import { getUserId } from '@/utils'
|
|
||||||
export default {
|
|
||||||
name: 'ManagerData',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableData: [],
|
|
||||||
/** 表格最大高度,留出顶部搜索、分页等空间,保证分页器可见 */
|
|
||||||
tableMaxHeight: 450,
|
|
||||||
pagination: {
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0
|
|
||||||
},
|
|
||||||
searchPanelValue: {
|
|
||||||
roleName: '',
|
|
||||||
username: '',
|
|
||||||
department: ''
|
|
||||||
},
|
|
||||||
subsystemList: [],
|
|
||||||
searchTimer: null, // 防抖定时器
|
|
||||||
currentRequest: null // 当前请求引用
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// this.loadManagerData()
|
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
// this.loadManagerData()
|
|
||||||
} else {
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
// this.loadManagerData()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
// 清理定时器和请求
|
|
||||||
if (this.searchTimer) {
|
|
||||||
clearTimeout(this.searchTimer)
|
|
||||||
this.searchTimer = null
|
|
||||||
}
|
|
||||||
this.currentRequest = null
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 将 \n 转为换行显示(支持字符串中的字面量 \n 或真实换行符)
|
|
||||||
formatPerms(val) {
|
|
||||||
if (val == null || val === '') return '无权限'
|
|
||||||
const str = String(val)
|
|
||||||
return str.replace(/\\n/g, '\n')
|
|
||||||
},
|
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 等于 "基础管理模块" 的权限(查看或编辑)
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath === '基础管理模块'
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有编辑权限
|
|
||||||
hasEditPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 等于 "基础管理模块" 且 parameterPer 是 "编辑" 的权限
|
|
||||||
// 检查所有 user-self-role,只要有一个是编辑权限就返回 true
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
const parameterPer = perm.parameterPer || ''
|
|
||||||
// 检查 permissionPath 是否等于 "基础管理模块" 且 parameterPer 是 "编辑" 或 2
|
|
||||||
return (
|
|
||||||
permissionPath === '基础管理模块' &&
|
|
||||||
(parameterPer === '编辑' || parameterPer === 2 || parameterPer === '2')
|
|
||||||
)
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查编辑权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
|
||||||
loadUserSelfRole() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_USER_SELF_ROLE,
|
|
||||||
params: {
|
|
||||||
userOrDepID: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 将权限数据存储到 localStorage
|
|
||||||
try {
|
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取用户自身角色失败:', err)
|
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
loadSubsystemList() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_SUBSYSTEM_LIST,
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
console.log(resp)
|
|
||||||
if (resp && resp.data) {
|
|
||||||
this.subsystemList = resp.data
|
|
||||||
} else {
|
|
||||||
this.subsystemList = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('加载子系统列表失败:', err)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
loadManagerData() {
|
|
||||||
const request = {
|
|
||||||
...api.CHECK_PERMISSION_USER_DATA,
|
|
||||||
params: {
|
|
||||||
pageNum: this.pagination.currentPage,
|
|
||||||
pageSize: this.pagination.pageSize,
|
|
||||||
roleName: this.searchPanelValue.roleName,
|
|
||||||
username: this.searchPanelValue.username,
|
|
||||||
department: this.searchPanelValue.department
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
// 处理返回数据,支持不同的数据结构
|
|
||||||
if (resp && resp.data) {
|
|
||||||
this.tableData = resp.data.list || []
|
|
||||||
// 如果返回对象中有 total 字段
|
|
||||||
this.pagination.total = resp.data.totalCount || 0
|
|
||||||
} else {
|
|
||||||
this.tableData = []
|
|
||||||
this.pagination.total = 0
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('加载管理数据失败:', err)
|
|
||||||
this.tableData = []
|
|
||||||
this.pagination.total = 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleSearch() {
|
|
||||||
this.pagination.currentPage = 1
|
|
||||||
this.loadManagerData()
|
|
||||||
},
|
|
||||||
resetSearch() {
|
|
||||||
this.searchPanelValue = {
|
|
||||||
roleName: '',
|
|
||||||
username: '',
|
|
||||||
department: ''
|
|
||||||
}
|
|
||||||
this.loadManagerData()
|
|
||||||
},
|
|
||||||
// 处理每页条数变化
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.pagination.pageSize = val
|
|
||||||
this.pagination.currentPage = 1 // 重置到第一页
|
|
||||||
this.loadManagerData()
|
|
||||||
},
|
|
||||||
// 处理当前页变化
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.pagination.currentPage = val
|
|
||||||
this.loadManagerData()
|
|
||||||
},
|
|
||||||
// 处理刷新
|
|
||||||
handleRefresh() {
|
|
||||||
this.pagination.currentPage = 1
|
|
||||||
this.loadManagerData()
|
|
||||||
},
|
|
||||||
// 导出
|
|
||||||
handleExport() {
|
|
||||||
const { url, method = 'get', headers = {} } = api.EXPORT_PERMISSION_USER_DATA || {}
|
|
||||||
const requestConfig = {
|
|
||||||
url,
|
|
||||||
method,
|
|
||||||
responseType: 'blob',
|
|
||||||
headers,
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
if (!requestConfig.url) {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '未配置下载地址'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$axios(requestConfig)
|
|
||||||
.then((response) => {
|
|
||||||
const blobData = response.data
|
|
||||||
if (!blobData) {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '导出失败,文件内容为空'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const contentType =
|
|
||||||
response.headers &&
|
|
||||||
(response.headers['content-type'] || response.headers['Content-Type'])
|
|
||||||
if (contentType && contentType.includes('application/json')) {
|
|
||||||
try {
|
|
||||||
const reader = new FileReader()
|
|
||||||
reader.onload = () => {
|
|
||||||
try {
|
|
||||||
const errorData = JSON.parse(reader.result)
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: errorData.message || '导出失败'
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '导出失败'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
reader.readAsText(blobData)
|
|
||||||
} catch (err) {
|
|
||||||
console.error('解析导出失败响应异常:', err)
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '导出失败'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const disposition =
|
|
||||||
response.headers &&
|
|
||||||
(response.headers['content-disposition'] || response.headers['Content-Disposition'])
|
|
||||||
let filename = '责任人管理数据.xlsx'
|
|
||||||
if (disposition) {
|
|
||||||
const filenameMatch = /filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i.exec(
|
|
||||||
disposition
|
|
||||||
)
|
|
||||||
const matchedName = filenameMatch ? filenameMatch[1] || filenameMatch[2] : ''
|
|
||||||
if (matchedName) {
|
|
||||||
try {
|
|
||||||
filename = decodeURIComponent(matchedName)
|
|
||||||
} catch (err) {
|
|
||||||
filename = matchedName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const downloadUrl = window.URL.createObjectURL(blobData)
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = downloadUrl
|
|
||||||
link.download = filename
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
window.URL.revokeObjectURL(downloadUrl)
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '导出成功'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error('导出失败:', err)
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '导出失败,请稍后重试'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.manager-data-page {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 20px;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
.page-content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-section {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
|
|
||||||
.comment-text {
|
|
||||||
color: #909399;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
color: #303133;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-left: 20px;
|
|
||||||
-webkit-box-flex: 1;
|
|
||||||
-ms-flex: 1;
|
|
||||||
flex: 1;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-section {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.perms-cell {
|
|
||||||
white-space: pre-line;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-toolbar {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination-section {
|
|
||||||
margin-top: 16px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link-separator {
|
|
||||||
margin: 0 8px;
|
|
||||||
color: #dcdfe6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-comment {
|
|
||||||
margin-top: 16px;
|
|
||||||
|
|
||||||
.red-comment {
|
|
||||||
color: #f56c6c;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
::v-deep .el-popper {
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
.page-content {
|
|
||||||
width: calc(100% - 80px) !important;
|
|
||||||
}
|
|
||||||
.handler-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.el-select-dropdown__item {
|
|
||||||
display: flex !important;
|
|
||||||
justify-content: space-between !important;
|
|
||||||
padding-right: 20px !important;
|
|
||||||
}
|
|
||||||
.username-text {
|
|
||||||
color: #303133 !important;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: right !important;
|
|
||||||
}
|
|
||||||
.user-id-text {
|
|
||||||
color: #909399 !important;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 20px;
|
|
||||||
margin-right: 30px;
|
|
||||||
text-align: right !important;
|
|
||||||
}
|
|
||||||
.department-tree-search {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
.department-tree {
|
|
||||||
max-height: 400px;
|
|
||||||
overflow-y: auto;
|
|
||||||
border: 1px solid #ebeef5;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 8px;
|
|
||||||
}
|
|
||||||
.import-uploader {
|
|
||||||
width: 100%;
|
|
||||||
.el-upload {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.el-upload-dragger {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
::v-deep .el-button {
|
|
||||||
line-height: 0.85 !important;
|
|
||||||
}
|
|
||||||
::v-deep .searched-fields{
|
|
||||||
display: flex;
|
|
||||||
gap: 6px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="fromTodo && !hideOperations" class="header-right">
|
<div v-if="fromTodo" class="header-right">
|
||||||
<el-button size="small" @click="handleReturn">
|
<el-button size="small" @click="handleReturn">
|
||||||
退回
|
退回
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -32,11 +32,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="detail-content">
|
<div class="detail-content">
|
||||||
<section class="block-section">
|
<section class="block-section">
|
||||||
<div class="section-title" @click="toggleBasicInfo">
|
<div class="section-title">
|
||||||
基础信息
|
基础信息
|
||||||
<i :class="basicInfoCollapsed ? 'el-icon-caret-left' : 'el-icon-caret-bottom'" class="collapse-icon"></i>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-show="!basicInfoCollapsed" class="info-grid">
|
<div class="info-grid">
|
||||||
<!-- 流程主题单独一行 -->
|
<!-- 流程主题单独一行 -->
|
||||||
<div class="info-item-full">
|
<div class="info-item-full">
|
||||||
<span class="label">流程主题</span>
|
<span class="label">流程主题</span>
|
||||||
@ -88,82 +87,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="block-section">
|
<section class="block-section">
|
||||||
<div class="section-title" @click="toggleDetailInfo">
|
<div class="section-title">
|
||||||
详细信息
|
|
||||||
<i :class="detailInfoCollapsed ? 'el-icon-caret-left' : 'el-icon-caret-bottom'" class="collapse-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div v-show="!detailInfoCollapsed" class="info-grid">
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">产品型号</span>
|
|
||||||
<span class="value">{{ modelDetail.modelName || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">状态代号</span>
|
|
||||||
<span class="value">{{ modelDetail.productNumber || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">板块</span>
|
|
||||||
<span class="value">{{ modelDetail.plate || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">平台</span>
|
|
||||||
<span class="value">{{ modelDetail.platform || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">系列</span>
|
|
||||||
<span class="value">{{ modelDetail.series || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">细分市场</span>
|
|
||||||
<span class="value">{{ modelDetail.marketSegment || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">项目名称</span>
|
|
||||||
<span class="value">{{ modelDetail.projectName || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">项目编号</span>
|
|
||||||
<span class="value">{{ modelDetail.projectNumber || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 竞品发动机专有字段 -->
|
|
||||||
<template v-if="engineType === '竞品'">
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">厂家名称(全称)</span>
|
|
||||||
<span class="value">{{ modelDetail.manufacturerName || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">厂家简称</span>
|
|
||||||
<span class="value">{{ modelDetail.manufacturerAbbreviation || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">品牌</span>
|
|
||||||
<span class="value">{{ modelDetail.brand || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">生产日期</span>
|
|
||||||
<span class="value">{{ modelDetail.productionDate || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="block-section">
|
|
||||||
<div class="section-title" @click="toggleApprovalContent">
|
|
||||||
审批内容
|
审批内容
|
||||||
<i :class="approvalContentCollapsed ? 'el-icon-caret-left' : 'el-icon-caret-bottom'" class="collapse-icon"></i>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-show="!approvalContentCollapsed">
|
|
||||||
<el-table :data="changeTable || []" border class="change-table" :max-height="500">
|
<el-table :data="changeTable || []" border class="change-table" :max-height="500">
|
||||||
<el-table-column label="序号" type="index" width="60" />
|
<el-table-column label="序号" type="index" width="60" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -196,31 +122,26 @@
|
|||||||
<el-table-column prop="changeComment" label="修改描述" min-width="160">
|
<el-table-column prop="changeComment" label="修改描述" min-width="160">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-wrapper">
|
|
||||||
<el-pagination
|
<el-pagination
|
||||||
|
v-if="changeTableTotal > 0"
|
||||||
|
class="pagination-wrapper"
|
||||||
:current-page="changeTablePageNumber"
|
:current-page="changeTablePageNumber"
|
||||||
:page-size="changeTablePageSize"
|
:page-size="changeTablePageSize"
|
||||||
:total="changeTableTotal"
|
:total="changeTableTotal"
|
||||||
layout="total, prev, pager, next, jumper, sizes"
|
layout="total, prev, pager, next, jumper"
|
||||||
:page-sizes="[10, 20, 50, 100, 9999]"
|
|
||||||
popper-class="pagination-select-dropdown"
|
|
||||||
@current-change="handlePageChange"
|
@current-change="handlePageChange"
|
||||||
@size-change="handlePageSizeChange"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div v-if="progressDetail.description" class="description-block">
|
<div v-if="progressDetail.description" class="description-block">
|
||||||
<span class="label">说明:</span>
|
<span class="label">说明:</span>
|
||||||
<span class="value">{{ detailOption }}</span>
|
<span class="value">{{ detailOption }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="block-section">
|
<section class="block-section">
|
||||||
<div class="section-title" @click="toggleApprovalFlow">
|
<div class="section-title">
|
||||||
审批流程
|
审批流程
|
||||||
<i :class="approvalFlowCollapsed ? 'el-icon-caret-left' : 'el-icon-caret-bottom'" class="collapse-icon"></i>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-show="!approvalFlowCollapsed" v-if="timelineNodes && timelineNodes.length > 0" class="approval-timeline">
|
<div v-if="timelineNodes && timelineNodes.length > 0" class="approval-timeline">
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
<el-timeline-item
|
<el-timeline-item
|
||||||
v-for="(node, index) in timelineNodes"
|
v-for="(node, index) in timelineNodes"
|
||||||
@ -256,7 +177,7 @@
|
|||||||
</el-timeline-item>
|
</el-timeline-item>
|
||||||
</el-timeline>
|
</el-timeline>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="!approvalFlowCollapsed" v-else class="empty-progress">
|
<div v-else class="empty-progress">
|
||||||
<span class="empty-text">暂无审批流程数据</span>
|
<span class="empty-text">暂无审批流程数据</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -311,8 +232,8 @@
|
|||||||
<el-radio v-for="node in returnableNodes" :key="node" :label="node">
|
<el-radio v-for="node in returnableNodes" :key="node" :label="node">
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<!-- 当选择"编制"节点时,显示意见输入框 -->
|
<!-- 当选择"发起审批"节点时,显示意见输入框 -->
|
||||||
<div v-if="selectedReturnNode === '编制'" class="return-opinion-section">
|
<div v-if="selectedReturnNode === '发起审批'" class="return-opinion-section">
|
||||||
<div class="opinion-label">
|
<div class="opinion-label">
|
||||||
退回意见:
|
退回意见:
|
||||||
</div>
|
</div>
|
||||||
@ -369,19 +290,10 @@ export default {
|
|||||||
validator: function(value) {
|
validator: function(value) {
|
||||||
return ['玉柴', '竞品'].indexOf(value) !== -1
|
return ['玉柴', '竞品'].indexOf(value) !== -1
|
||||||
}
|
}
|
||||||
},
|
|
||||||
// 是否隐藏操作按钮(从我的发起/我的经办进入时隐藏)
|
|
||||||
hideOperations: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
basicInfoCollapsed: true, // 基础信息是否折叠,默认关闭
|
|
||||||
detailInfoCollapsed: false, // 详细信息是否折叠,默认展开
|
|
||||||
approvalContentCollapsed: false, // 审批内容是否折叠,默认展开
|
|
||||||
approvalFlowCollapsed: true, // 审批流程是否折叠,默认关闭
|
|
||||||
changeTable: [],
|
changeTable: [],
|
||||||
showTopDetail: {
|
showTopDetail: {
|
||||||
processTitle: '',
|
processTitle: '',
|
||||||
@ -399,21 +311,6 @@ export default {
|
|||||||
activitiRecordDTOS: [], // 审批流程数据
|
activitiRecordDTOS: [], // 审批流程数据
|
||||||
flowNodes: [], // 审批流程节点数据
|
flowNodes: [], // 审批流程节点数据
|
||||||
progressDetailData: {}, // 审批流程详情数据
|
progressDetailData: {}, // 审批流程详情数据
|
||||||
modelDetail: {
|
|
||||||
modelName: '',
|
|
||||||
productNumber: '',
|
|
||||||
plate: '',
|
|
||||||
platform: '',
|
|
||||||
series: '',
|
|
||||||
marketSegment: '',
|
|
||||||
projectName: '',
|
|
||||||
projectNumber: '',
|
|
||||||
// 竞品发动机专有字段
|
|
||||||
manufacturerName: '',
|
|
||||||
manufacturerAbbreviation: '',
|
|
||||||
brand: '',
|
|
||||||
productionDate: ''
|
|
||||||
}, // 机型详细信息
|
|
||||||
approvalDialogVisible: false,
|
approvalDialogVisible: false,
|
||||||
approvalActionType: '', // 'reject' 或 'submit'
|
approvalActionType: '', // 'reject' 或 'submit'
|
||||||
approvalDialogTitle: '审批',
|
approvalDialogTitle: '审批',
|
||||||
@ -429,15 +326,12 @@ export default {
|
|||||||
returnableNodes: [],
|
returnableNodes: [],
|
||||||
selectedReturnNode: '',
|
selectedReturnNode: '',
|
||||||
returnSubmitting: false,
|
returnSubmitting: false,
|
||||||
returnOpinion: '拒绝', // 退回意见(仅在选择编制节点时使用)
|
returnOpinion: '', // 退回意见(仅在选择发起审批节点时使用)
|
||||||
isEditingProcessTitle: false, // 是否正在编辑流程主题
|
isEditingProcessTitle: false, // 是否正在编辑流程主题
|
||||||
editingProcessTitle: '' // 正在编辑的流程主题值
|
editingProcessTitle: '' // 正在编辑的流程主题值
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
changeTablePage() {
|
|
||||||
return this.changeTablePageNumber
|
|
||||||
},
|
|
||||||
titleText() {
|
titleText() {
|
||||||
console.log(this.engineType, 'this.engineType', this.detail, 111111)
|
console.log(this.engineType, 'this.engineType', this.detail, 111111)
|
||||||
return this.engineType === '玉柴' ? '玉柴发动机审批详情' : '竞品发动机审批详情'
|
return this.engineType === '玉柴' ? '玉柴发动机审批详情' : '竞品发动机审批详情'
|
||||||
@ -633,18 +527,6 @@ export default {
|
|||||||
// this.getApprovalChange()
|
// this.getApprovalChange()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleBasicInfo() {
|
|
||||||
this.basicInfoCollapsed = !this.basicInfoCollapsed
|
|
||||||
},
|
|
||||||
toggleDetailInfo() {
|
|
||||||
this.detailInfoCollapsed = !this.detailInfoCollapsed
|
|
||||||
},
|
|
||||||
toggleApprovalContent() {
|
|
||||||
this.approvalContentCollapsed = !this.approvalContentCollapsed
|
|
||||||
},
|
|
||||||
toggleApprovalFlow() {
|
|
||||||
this.approvalFlowCollapsed = !this.approvalFlowCollapsed
|
|
||||||
},
|
|
||||||
canResendApproval() {
|
canResendApproval() {
|
||||||
const request = {
|
const request = {
|
||||||
...api.CHECK_DATA_CAN_RETURN,
|
...api.CHECK_DATA_CAN_RETURN,
|
||||||
@ -703,41 +585,6 @@ export default {
|
|||||||
currentNode: resp.data.approvalStatus === '已拒绝' ? '编制' : (resp.data.currentNode || ''),
|
currentNode: resp.data.approvalStatus === '已拒绝' ? '编制' : (resp.data.currentNode || ''),
|
||||||
processor: resp.data.approvalStatus === '已拒绝' ? resp.data.createBy : (resp.data.processor || '')
|
processor: resp.data.approvalStatus === '已拒绝' ? resp.data.createBy : (resp.data.processor || '')
|
||||||
}
|
}
|
||||||
// 保存机型详细信息
|
|
||||||
if (resp.data.model) {
|
|
||||||
this.modelDetail = {
|
|
||||||
modelName: resp.data.model.modelName || '',
|
|
||||||
productNumber: resp.data.model.productNumber || '',
|
|
||||||
plate: resp.data.model.plate || '',
|
|
||||||
platform: resp.data.model.platform || '',
|
|
||||||
series: resp.data.model.series || '',
|
|
||||||
marketSegment: resp.data.model.marketSegment || '',
|
|
||||||
projectName: resp.data.model.projectName || '',
|
|
||||||
projectNumber: resp.data.model.projectNumber || '',
|
|
||||||
// 竞品发动机专有字段
|
|
||||||
manufacturerName: resp.data.model.manufacturerName || '',
|
|
||||||
manufacturerAbbreviation: resp.data.model.manufacturerAbbreviation || '',
|
|
||||||
brand: resp.data.model.brand || '',
|
|
||||||
productionDate: resp.data.model.productionDate || ''
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 如果 model 不存在,重置为空
|
|
||||||
this.modelDetail = {
|
|
||||||
modelName: '',
|
|
||||||
productNumber: '',
|
|
||||||
plate: '',
|
|
||||||
platform: '',
|
|
||||||
series: '',
|
|
||||||
marketSegment: '',
|
|
||||||
projectName: '',
|
|
||||||
projectNumber: '',
|
|
||||||
// 竞品发动机专有字段
|
|
||||||
manufacturerName: '',
|
|
||||||
manufacturerAbbreviation: '',
|
|
||||||
brand: '',
|
|
||||||
productionDate: ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 如果返回的是分页格式 { list: [], total: 0 }
|
// 如果返回的是分页格式 { list: [], total: 0 }
|
||||||
if (resp.data.list && Array.isArray(resp.data.list)) {
|
if (resp.data.list && Array.isArray(resp.data.list)) {
|
||||||
allData = resp.data.list
|
allData = resp.data.list
|
||||||
@ -1007,35 +854,30 @@ export default {
|
|||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log(resp)
|
console.log(resp)
|
||||||
// 在列表最前面添加"编制"节点作为默认选项
|
// 在列表最前面添加"发起审批"节点作为默认选项
|
||||||
const nodes = Array.isArray(resp.data) ? resp.data : []
|
const nodes = Array.isArray(resp.data) ? resp.data : []
|
||||||
this.returnableNodes = ['编制', ...nodes]
|
this.returnableNodes = ['发起审批', ...nodes]
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取退回节点失败:', err)
|
console.error('获取退回节点失败:', err)
|
||||||
// 即使获取失败,也添加"编制"节点
|
// 即使获取失败,也添加"发起审批"节点
|
||||||
this.returnableNodes = ['编制']
|
this.returnableNodes = ['发起审批']
|
||||||
})
|
})
|
||||||
this.selectedReturnNode = ''
|
this.selectedReturnNode = ''
|
||||||
this.returnOpinion = '拒绝'
|
this.returnOpinion = ''
|
||||||
this.returnNodeDialogVisible = true
|
this.returnNodeDialogVisible = true
|
||||||
},
|
},
|
||||||
// 关闭退回节点选择弹窗
|
// 关闭退回节点选择弹窗
|
||||||
handleReturnNodeDialogClose() {
|
handleReturnNodeDialogClose() {
|
||||||
this.returnNodeDialogVisible = false
|
this.returnNodeDialogVisible = false
|
||||||
this.selectedReturnNode = ''
|
this.selectedReturnNode = ''
|
||||||
this.returnOpinion = '拒绝'
|
this.returnOpinion = ''
|
||||||
},
|
},
|
||||||
// 处理退回节点选择变化
|
// 处理退回节点选择变化
|
||||||
handleReturnNodeChange() {
|
handleReturnNodeChange() {
|
||||||
// 如果不是"编制"节点,清空意见
|
// 如果不是"发起审批"节点,清空意见
|
||||||
if (this.selectedReturnNode !== '编制') {
|
if (this.selectedReturnNode !== '发起审批') {
|
||||||
this.returnOpinion = ''
|
this.returnOpinion = ''
|
||||||
} else {
|
|
||||||
// 如果选择"编制"节点,设置默认值为"拒绝"
|
|
||||||
if (!this.returnOpinion) {
|
|
||||||
this.returnOpinion = '拒绝'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 提交退回操作
|
// 提交退回操作
|
||||||
@ -1052,8 +894,8 @@ export default {
|
|||||||
|
|
||||||
this.returnSubmitting = true
|
this.returnSubmitting = true
|
||||||
|
|
||||||
// 如果选择的是"编制"节点,调用拒绝接口
|
// 如果选择的是"发起审批"节点,调用拒绝接口
|
||||||
if (this.selectedReturnNode === '编制') {
|
if (this.selectedReturnNode === '发起审批') {
|
||||||
const submitData = {
|
const submitData = {
|
||||||
approvalId: this.detail.id,
|
approvalId: this.detail.id,
|
||||||
operator: 'REJECT',
|
operator: 'REJECT',
|
||||||
@ -1281,11 +1123,6 @@ export default {
|
|||||||
// 只更新当前页显示的数据,不需要重新请求接口
|
// 只更新当前页显示的数据,不需要重新请求接口
|
||||||
this.updatePagedData()
|
this.updatePagedData()
|
||||||
},
|
},
|
||||||
handlePageSizeChange(size) {
|
|
||||||
this.changeTablePageSize = size
|
|
||||||
this.changeTablePageNumber = 1
|
|
||||||
this.updatePagedData()
|
|
||||||
},
|
|
||||||
changeTypeClass(type) {
|
changeTypeClass(type) {
|
||||||
if (type === 'create') return 'change-create'
|
if (type === 'create') return 'change-create'
|
||||||
if (type === 'delete') return 'change-delete'
|
if (type === 'delete') return 'change-delete'
|
||||||
@ -1519,21 +1356,6 @@ export default {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
cursor: pointer;
|
|
||||||
user-select: none;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
.collapse-icon {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #909399;
|
|
||||||
transition: transform 0.3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #409eff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1671,22 +1493,8 @@ export default {
|
|||||||
.pagination-wrapper {
|
.pagination-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
padding-right: 0;
|
|
||||||
|
|
||||||
::v-deep .el-pagination {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.el-select {
|
|
||||||
.el-input {
|
|
||||||
width: 100px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.modify-details-text {
|
.modify-details-text {
|
||||||
@ -1944,21 +1752,3 @@ export default {
|
|||||||
line-height: 0.85 !important;
|
line-height: 0.85 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.pagination-select-dropdown {
|
|
||||||
width: 110px !important;
|
|
||||||
min-width: 110px !important;
|
|
||||||
max-width: 110px !important;
|
|
||||||
|
|
||||||
.el-select-dropdown__wrap {
|
|
||||||
max-height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-select-dropdown__item {
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
padding: 0 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -5,37 +5,7 @@
|
|||||||
<div class="title">
|
<div class="title">
|
||||||
责任人管理
|
责任人管理
|
||||||
</div>
|
</div>
|
||||||
<div class="search-section">
|
<div>
|
||||||
<el-input
|
|
||||||
v-model="searchForm.department"
|
|
||||||
placeholder="搜索责任部门"
|
|
||||||
clearable
|
|
||||||
style="width: 180px; margin-right: 10px;"
|
|
||||||
@input="handleSearch"
|
|
||||||
/>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.subsystem"
|
|
||||||
placeholder="搜索子系统"
|
|
||||||
clearable
|
|
||||||
style="width: 180px; margin-right: 10px;"
|
|
||||||
@input="handleSearch"
|
|
||||||
/>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.username"
|
|
||||||
placeholder="搜索责任人"
|
|
||||||
clearable
|
|
||||||
style="width: 180px; margin-right: 10px;"
|
|
||||||
@input="handleSearch"
|
|
||||||
/>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.partsName"
|
|
||||||
placeholder="搜索状态代号"
|
|
||||||
clearable
|
|
||||||
style="width: 180px; margin-right: 10px;"
|
|
||||||
@input="handleSearch"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-if="hasEditPermission()">
|
|
||||||
<el-button type="primary" @click="handleAdd">
|
<el-button type="primary" @click="handleAdd">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -59,16 +29,42 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
<el-table :data="tableData" border style="width: 100%">
|
<el-table
|
||||||
<el-table-column type="index" label="序号" width="90" align="center" />
|
:data="tableData"
|
||||||
<el-table-column prop="department" label="责任部门" align="center">
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
width="90"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="department"
|
||||||
|
label="责任部门"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ formatDepartmentDisplay(scope.row.department) }}
|
{{ formatDepartmentDisplay(scope.row.department) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="partsName" label="项目编号" align="center" />
|
<el-table-column
|
||||||
<el-table-column prop="username" label="责任人" width="250" align="center" />
|
prop="subsystem"
|
||||||
<el-table-column v-if="hasEditPermission()" label="操作" width="200" align="center">
|
label="子系统"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="username"
|
||||||
|
label="责任人"
|
||||||
|
width="250"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
@ -87,24 +83,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template slot="empty">
|
|
||||||
<div class="table-empty">
|
|
||||||
<template v-if="canViewData">
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">
|
|
||||||
暂无数据
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">
|
|
||||||
无权限查看
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-section">
|
<div class="pagination-section">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@ -129,7 +107,12 @@
|
|||||||
:modal="false"
|
:modal="false"
|
||||||
@close="handleDialogClose"
|
@close="handleDialogClose"
|
||||||
>
|
>
|
||||||
<el-form ref="form" :model="formData" :rules="formRules" label-width="100px">
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
<el-form-item label="子系统:" prop="subsystem">
|
<el-form-item label="子系统:" prop="subsystem">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.subsystem"
|
v-model="formData.subsystem"
|
||||||
@ -145,15 +128,6 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="项目名称:" prop="partsName">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.partsName"
|
|
||||||
placeholder="请输入项目名称"
|
|
||||||
clearable
|
|
||||||
maxlength="100"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="责任部门:" prop="department">
|
<el-form-item label="责任部门:" prop="department">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.selectDeptName"
|
v-model="formData.selectDeptName"
|
||||||
@ -239,11 +213,7 @@
|
|||||||
<el-button @click="handleDepartmentDialogClose">
|
<el-button @click="handleDepartmentDialogClose">
|
||||||
取消
|
取消
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button type="primary" :disabled="!selectedDepartmentId" @click="handleDepartmentDialogConfirm">
|
||||||
type="primary"
|
|
||||||
:disabled="!selectedDepartmentId"
|
|
||||||
@click="handleDepartmentDialogConfirm"
|
|
||||||
>
|
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -270,7 +240,9 @@
|
|||||||
:disabled="importing"
|
:disabled="importing"
|
||||||
>
|
>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text"> 将文件拖到此处,或<em>点击上传</em> </div>
|
<div class="el-upload__text">
|
||||||
|
将文件拖到此处,或<em>点击上传</em>
|
||||||
|
</div>
|
||||||
<div slot="tip" class="el-upload__tip">
|
<div slot="tip" class="el-upload__tip">
|
||||||
仅支持Excel模板文件
|
仅支持Excel模板文件
|
||||||
</div>
|
</div>
|
||||||
@ -306,7 +278,6 @@ export default {
|
|||||||
formData: {
|
formData: {
|
||||||
department: '', // 级联选择器绑定的部门ID
|
department: '', // 级联选择器绑定的部门ID
|
||||||
subsystem: '', // 子系统
|
subsystem: '', // 子系统
|
||||||
partsName: '', // 项目名称
|
|
||||||
responsible: '', // 责任人用户ID(用于提交)
|
responsible: '', // 责任人用户ID(用于提交)
|
||||||
responsibleName: '', // 责任人姓名(用于自动完成显示)
|
responsibleName: '', // 责任人姓名(用于自动完成显示)
|
||||||
selectDeptId: '', // 选中的部门ID(用于搜索责任人)
|
selectDeptId: '', // 选中的部门ID(用于搜索责任人)
|
||||||
@ -316,10 +287,15 @@ export default {
|
|||||||
departmentId: '' // 部门ID(编辑时使用)
|
departmentId: '' // 部门ID(编辑时使用)
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
department: [{ required: true, message: '请选择责任部门', trigger: 'change' }],
|
department: [
|
||||||
subsystem: [{ required: true, message: '请输入子系统', trigger: 'blur' }],
|
{ required: true, message: '请选择责任部门', trigger: 'change' }
|
||||||
partsName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
],
|
||||||
responsible: [{ required: true, message: '请选择责任人', trigger: 'change' }]
|
subsystem: [
|
||||||
|
{ required: true, message: '请输入子系统', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
responsible: [
|
||||||
|
{ required: true, message: '请选择责任人', trigger: 'change' }
|
||||||
|
]
|
||||||
},
|
},
|
||||||
subsystemList: [],
|
subsystemList: [],
|
||||||
userOptions: [], // 人员选项列表
|
userOptions: [], // 人员选项列表
|
||||||
@ -336,16 +312,7 @@ export default {
|
|||||||
importDialogVisible: false, // 导入弹窗显示状态
|
importDialogVisible: false, // 导入弹窗显示状态
|
||||||
importFileList: [], // 导入文件列表
|
importFileList: [], // 导入文件列表
|
||||||
selectedImportFile: null, // 选中的导入文件
|
selectedImportFile: null, // 选中的导入文件
|
||||||
importing: false, // 导入中状态
|
importing: false // 导入中状态
|
||||||
canViewData: false, // 是否有查看数据的权限
|
|
||||||
// 搜索相关
|
|
||||||
searchForm: {
|
|
||||||
department: '',
|
|
||||||
subsystem: '',
|
|
||||||
username: '',
|
|
||||||
partsName: ''
|
|
||||||
},
|
|
||||||
allTableData: [] // 保存所有数据,用于前端搜索
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -360,36 +327,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadDepartmentList()
|
this.loadDepartmentList()
|
||||||
|
this.loadManagerData()
|
||||||
this.isResponsible()
|
this.isResponsible()
|
||||||
this.loadSubsystemList()
|
this.loadSubsystemList()
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
this.loadManagerData()
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadManagerData()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// 清理定时器和请求
|
// 清理定时器和请求
|
||||||
@ -400,111 +340,6 @@ export default {
|
|||||||
this.currentRequest = null
|
this.currentRequest = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 等于 "基础管理模块" 的权限(查看或编辑)
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath === '基础管理模块'
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有编辑权限
|
|
||||||
hasEditPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 等于 "基础管理模块" 且 parameterPer 是 "编辑" 的权限
|
|
||||||
// 检查所有 user-self-role,只要有一个是编辑权限就返回 true
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
const parameterPer = perm.parameterPer || ''
|
|
||||||
// 检查 permissionPath 是否等于 "基础管理模块" 且 parameterPer 是 "编辑" 或 2
|
|
||||||
return (
|
|
||||||
permissionPath === '基础管理模块' &&
|
|
||||||
(parameterPer === '编辑' || parameterPer === 2 || parameterPer === '2')
|
|
||||||
)
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查编辑权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
|
||||||
loadUserSelfRole() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_USER_SELF_ROLE,
|
|
||||||
params: {
|
|
||||||
userOrDepID: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 将权限数据存储到 localStorage
|
|
||||||
try {
|
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取用户自身角色失败:', err)
|
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
loadSubsystemList() {
|
loadSubsystemList() {
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_SUBSYSTEM_LIST,
|
...api.GET_SUBSYSTEM_LIST,
|
||||||
@ -558,8 +393,8 @@ export default {
|
|||||||
const request = {
|
const request = {
|
||||||
...api.GET_MANAGER_DATA,
|
...api.GET_MANAGER_DATA,
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: this.pagination.currentPage,
|
||||||
pageSize: 9999 // 加载所有数据用于前端搜索
|
pageSize: this.pagination.pageSize
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -567,85 +402,36 @@ export default {
|
|||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
// 处理返回数据,支持不同的数据结构
|
// 处理返回数据,支持不同的数据结构
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
this.allTableData = resp.data.result || []
|
this.tableData = resp.data.result
|
||||||
this.pagination.total = resp.data.count || this.allTableData.length
|
// 如果返回对象中有 total 字段
|
||||||
// 应用搜索过滤
|
this.pagination.total = resp.data.count
|
||||||
this.handleSearch()
|
|
||||||
} else {
|
} else {
|
||||||
this.allTableData = []
|
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.pagination.total = 0
|
this.pagination.total = 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('加载管理数据失败:', err)
|
console.error('加载管理数据失败:', err)
|
||||||
this.allTableData = []
|
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.pagination.total = 0
|
this.pagination.total = 0
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 搜索过滤
|
|
||||||
handleSearch() {
|
|
||||||
let filteredData = [...this.allTableData]
|
|
||||||
|
|
||||||
// 按责任部门搜索
|
|
||||||
if (this.searchForm.department && this.searchForm.department.trim()) {
|
|
||||||
const deptKeyword = this.searchForm.department.trim().toLowerCase()
|
|
||||||
filteredData = filteredData.filter(item => {
|
|
||||||
const dept = this.formatDepartmentDisplay(item.department || '')
|
|
||||||
return dept.toLowerCase().includes(deptKeyword) ||
|
|
||||||
(item.department || '').toLowerCase().includes(deptKeyword)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按子系统搜索
|
|
||||||
if (this.searchForm.subsystem && this.searchForm.subsystem.trim()) {
|
|
||||||
const subsystemKeyword = this.searchForm.subsystem.trim().toLowerCase()
|
|
||||||
filteredData = filteredData.filter(item => {
|
|
||||||
const subsystem = item.subsystem || ''
|
|
||||||
return subsystem.toLowerCase().includes(subsystemKeyword)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按责任人搜索
|
|
||||||
if (this.searchForm.username && this.searchForm.username.trim()) {
|
|
||||||
const usernameKeyword = this.searchForm.username.trim().toLowerCase()
|
|
||||||
filteredData = filteredData.filter(item => {
|
|
||||||
const username = item.username || item.userName || ''
|
|
||||||
return username.toLowerCase().includes(usernameKeyword)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按状态代号搜索
|
|
||||||
if (this.searchForm.partsName && this.searchForm.partsName.trim()) {
|
|
||||||
const partsNameKeyword = this.searchForm.partsName.trim().toLowerCase()
|
|
||||||
filteredData = filteredData.filter(item => {
|
|
||||||
const partsName = item.partsName || ''
|
|
||||||
return partsName.toLowerCase().includes(partsNameKeyword)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新总数
|
|
||||||
this.pagination.total = filteredData.length
|
|
||||||
|
|
||||||
// 分页处理
|
|
||||||
const startIndex = (this.pagination.currentPage - 1) * this.pagination.pageSize
|
|
||||||
const endIndex = startIndex + this.pagination.pageSize
|
|
||||||
this.tableData = filteredData.slice(startIndex, endIndex)
|
|
||||||
},
|
|
||||||
loadDepartmentList() {
|
loadDepartmentList() {
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_DEPT_OF_USER,
|
...api.QUERY_ORG_TREE,
|
||||||
|
// params: {
|
||||||
|
// departmentId: this.formData.departmentId
|
||||||
|
// },
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
// 处理返回的数据,确保格式为 { id, name }
|
// 处理返回的数据,确保格式为 { id, name, children }
|
||||||
let result = []
|
let result = []
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
result = resp.data
|
result = resp.data.result || resp.data.data || resp.data || []
|
||||||
}
|
}
|
||||||
// 格式化数据为树形结构需要的格式(只有一级树)
|
// 格式化数据为级联选择器需要的格式
|
||||||
this.departmentList = this.formatDepartmentTreeData(result)
|
this.departmentList = this.formatDepartmentTreeData(result)
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
@ -653,17 +439,29 @@ export default {
|
|||||||
this.departmentList = []
|
this.departmentList = []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 格式化部门树数据为树形结构格式(只有一级树)
|
// 格式化部门树数据为级联选择器格式
|
||||||
formatDepartmentTreeData(data) {
|
formatDepartmentTreeData(data) {
|
||||||
if (!Array.isArray(data)) {
|
if (!Array.isArray(data)) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
// 格式化数据,确保每个节点都有 id 和 name 字段(只有一级,不需要递归)
|
// 递归格式化数据,确保每个节点都有 id 和 name 字段
|
||||||
return data.map((node) => ({
|
const formatNode = (node) => {
|
||||||
|
const formatted = {
|
||||||
id: node.id,
|
id: node.id,
|
||||||
name: node.name
|
name: node.name || node.label || '',
|
||||||
}))
|
children: undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果有子节点,递归格式化
|
||||||
|
if (node.children && Array.isArray(node.children) && node.children.length > 0) {
|
||||||
|
formatted.children = node.children.map(child => formatNode(child))
|
||||||
|
}
|
||||||
|
|
||||||
|
return formatted
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.map(node => formatNode(node))
|
||||||
},
|
},
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.dialogMode = 'add'
|
this.dialogMode = 'add'
|
||||||
@ -671,7 +469,6 @@ export default {
|
|||||||
this.formData = {
|
this.formData = {
|
||||||
department: '',
|
department: '',
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
partsName: '',
|
|
||||||
responsible: '',
|
responsible: '',
|
||||||
responsibleName: '',
|
responsibleName: '',
|
||||||
selectDeptId: '',
|
selectDeptId: '',
|
||||||
@ -694,13 +491,11 @@ export default {
|
|||||||
// 设置表单数据,确保级联选择器和选择器能正确回显
|
// 设置表单数据,确保级联选择器和选择器能正确回显
|
||||||
// 初始化已选择的人员选项
|
// 初始化已选择的人员选项
|
||||||
if (row.userId) {
|
if (row.userId) {
|
||||||
this.userOptions = [
|
this.userOptions = [{
|
||||||
{
|
|
||||||
userId: row.userId,
|
userId: row.userId,
|
||||||
username: row.username || row.userId,
|
username: row.username || row.userId,
|
||||||
userNumber: row.userNumber || row.userId
|
userNumber: row.userNumber || row.userId
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
} else {
|
} else {
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
}
|
}
|
||||||
@ -708,7 +503,6 @@ export default {
|
|||||||
this.formData = {
|
this.formData = {
|
||||||
department: row.departmentId || '', // 级联选择器需要部门ID
|
department: row.departmentId || '', // 级联选择器需要部门ID
|
||||||
subsystem: row.subsystem || '', // 子系统
|
subsystem: row.subsystem || '', // 子系统
|
||||||
partsName: row.partsName || '', // 项目名称
|
|
||||||
responsible: row.userNumber || row.userId || '', // 责任人 userNumber(用于 el-select 的 value)
|
responsible: row.userNumber || row.userId || '', // 责任人 userNumber(用于 el-select 的 value)
|
||||||
responsibleName: row.username || '', // 责任人姓名(用于显示)
|
responsibleName: row.username || '', // 责任人姓名(用于显示)
|
||||||
selectDeptId: row.departmentId || '', // 选中的部门ID(用于搜索责任人)
|
selectDeptId: row.departmentId || '', // 选中的部门ID(用于搜索责任人)
|
||||||
@ -730,7 +524,6 @@ export default {
|
|||||||
this.formData = {
|
this.formData = {
|
||||||
department: '',
|
department: '',
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
partsName: '',
|
|
||||||
responsible: '',
|
responsible: '',
|
||||||
responsibleName: '',
|
responsibleName: '',
|
||||||
selectDeptId: '',
|
selectDeptId: '',
|
||||||
@ -762,10 +555,7 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
departmentId: this.formData.selectDeptId,
|
departmentId: this.formData.selectDeptId,
|
||||||
department: this.formData.selectDeptName,
|
department: this.formData.selectDeptName,
|
||||||
subsystem: Array.isArray(this.formData.subsystem)
|
subsystem: Array.isArray(this.formData.subsystem) ? this.formData.subsystem.join(',') : this.formData.subsystem,
|
||||||
? this.formData.subsystem.join(',')
|
|
||||||
: this.formData.subsystem,
|
|
||||||
partsName: this.formData.partsName || '',
|
|
||||||
userId: this.formData.userId || this.formData.responsible
|
userId: this.formData.userId || this.formData.responsible
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
@ -793,10 +583,7 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
departmentId: this.formData.selectDeptId,
|
departmentId: this.formData.selectDeptId,
|
||||||
department: this.formData.selectDeptName,
|
department: this.formData.selectDeptName,
|
||||||
subsystem: Array.isArray(this.formData.subsystem)
|
subsystem: Array.isArray(this.formData.subsystem) ? this.formData.subsystem.join(',') : this.formData.subsystem,
|
||||||
? this.formData.subsystem.join(',')
|
|
||||||
: this.formData.subsystem,
|
|
||||||
partsName: this.formData.partsName || '',
|
|
||||||
userId: this.formData.responsible,
|
userId: this.formData.responsible,
|
||||||
rowId: this.formData.rowId
|
rowId: this.formData.rowId
|
||||||
},
|
},
|
||||||
@ -903,9 +690,7 @@ export default {
|
|||||||
if (!query || query.trim() === '') {
|
if (!query || query.trim() === '') {
|
||||||
if (this.formData.responsible) {
|
if (this.formData.responsible) {
|
||||||
// 从现有 options 中查找已选择的人员信息
|
// 从现有 options 中查找已选择的人员信息
|
||||||
const selectedOptions = this.userOptions.filter(
|
const selectedOptions = this.userOptions.filter((opt) => opt.userNumber === this.formData.responsible)
|
||||||
(opt) => opt.userNumber === this.formData.responsible
|
|
||||||
)
|
|
||||||
this.userOptions = selectedOptions
|
this.userOptions = selectedOptions
|
||||||
} else {
|
} else {
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
@ -981,9 +766,7 @@ export default {
|
|||||||
console.error('搜索责任人失败:', err)
|
console.error('搜索责任人失败:', err)
|
||||||
// 搜索失败时,保留已选择的人员信息
|
// 搜索失败时,保留已选择的人员信息
|
||||||
if (this.formData.responsible) {
|
if (this.formData.responsible) {
|
||||||
const selectedOptions = this.userOptions.filter(
|
const selectedOptions = this.userOptions.filter((opt) => opt.userNumber === this.formData.responsible)
|
||||||
(opt) => opt.userNumber === this.formData.responsible
|
|
||||||
)
|
|
||||||
this.userOptions = selectedOptions
|
this.userOptions = selectedOptions
|
||||||
} else {
|
} else {
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
@ -1072,12 +855,12 @@ export default {
|
|||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.pagination.pageSize = val
|
this.pagination.pageSize = val
|
||||||
this.pagination.currentPage = 1 // 重置到第一页
|
this.pagination.currentPage = 1 // 重置到第一页
|
||||||
this.handleSearch() // 重新应用搜索和分页
|
this.loadManagerData()
|
||||||
},
|
},
|
||||||
// 处理当前页变化
|
// 处理当前页变化
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.pagination.currentPage = val
|
this.pagination.currentPage = val
|
||||||
this.handleSearch() // 重新应用搜索和分页
|
this.loadManagerData()
|
||||||
},
|
},
|
||||||
// 处理刷新
|
// 处理刷新
|
||||||
handleRefresh() {
|
handleRefresh() {
|
||||||
@ -1092,7 +875,7 @@ export default {
|
|||||||
// 将 · 替换为 -
|
// 将 · 替换为 -
|
||||||
const normalizedDept = department.replace(/·/g, '-')
|
const normalizedDept = department.replace(/·/g, '-')
|
||||||
// 按 - 分割
|
// 按 - 分割
|
||||||
const parts = normalizedDept.split('-').filter((part) => part.trim() !== '')
|
const parts = normalizedDept.split('-').filter(part => part.trim() !== '')
|
||||||
// 只显示最后一个节点
|
// 只显示最后一个节点
|
||||||
if (parts.length > 0) {
|
if (parts.length > 0) {
|
||||||
return parts[parts.length - 1]
|
return parts[parts.length - 1]
|
||||||
@ -1377,19 +1160,11 @@ export default {
|
|||||||
this.loadManagerData()
|
this.loadManagerData()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
let errMessage = ''
|
|
||||||
if (err && err.data && err.data.errors && Array.isArray(err.data.errors)) {
|
|
||||||
for (let error of err.data.errors) {
|
|
||||||
errMessage += error + '\n'
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
errMessage = err.message || '导入失败,请稍后重试'
|
|
||||||
}
|
|
||||||
console.error('导入失败:', err)
|
console.error('导入失败:', err)
|
||||||
loadingInstance.close()
|
loadingInstance.close()
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: errMessage || '导入失败,请稍后重试'
|
message: err.message || '导入失败,请稍后重试'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@ -1424,25 +1199,11 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.comment-text {
|
.comment-text {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.title {
|
|
||||||
color: #303133;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-left: 20px;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
.search-section {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
flex: 1;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-section {
|
.table-section {
|
||||||
|
|||||||
@ -20,14 +20,10 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button class="update-favorite-button" @click="handleUpdateFavorite"
|
<el-button class="update-favorite-button" @click="handleUpdateFavorite"
|
||||||
>
|
>更新常用</el-button
|
||||||
更新常用
|
|
||||||
</el-button
|
|
||||||
>
|
>
|
||||||
<el-button type="primary" class="add-favorite-button" @click="handleAddFavorite"
|
<el-button type="primary" class="add-favorite-button" @click="handleAddFavorite"
|
||||||
>
|
>新增常用</el-button
|
||||||
新增常用
|
|
||||||
</el-button
|
|
||||||
>
|
>
|
||||||
<el-button class="hidden-params-button" @click="handleShowHiddenParams">
|
<el-button class="hidden-params-button" @click="handleShowHiddenParams">
|
||||||
已隐藏参数
|
已隐藏参数
|
||||||
@ -48,12 +44,8 @@
|
|||||||
<div class="left-param-panel">
|
<div class="left-param-panel">
|
||||||
<div class="tree-search-header">
|
<div class="tree-search-header">
|
||||||
<el-radio-group v-model="treeSearchMode" size="mini" class="search-mode-switch">
|
<el-radio-group v-model="treeSearchMode" size="mini" class="search-mode-switch">
|
||||||
<el-radio-button label="subsystem">
|
<el-radio-button label="subsystem">子系统</el-radio-button>
|
||||||
子系统
|
<el-radio-button label="parts">零部件名称</el-radio-button>
|
||||||
</el-radio-button>
|
|
||||||
<el-radio-button label="parts">
|
|
||||||
零部件名称
|
|
||||||
</el-radio-button>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<el-input
|
<el-input
|
||||||
@ -63,15 +55,6 @@
|
|||||||
clearable
|
clearable
|
||||||
class="tree-search"
|
class="tree-search"
|
||||||
></el-input>
|
></el-input>
|
||||||
<div class="tree-select-actions">
|
|
||||||
<el-checkbox
|
|
||||||
v-model="treeSelectAllMaster"
|
|
||||||
:indeterminate="treeSelectAllIndeterminate"
|
|
||||||
class="tree-select-checkbox"
|
|
||||||
>
|
|
||||||
全选
|
|
||||||
</el-checkbox>
|
|
||||||
</div>
|
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="paramTree"
|
ref="paramTree"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
@ -95,24 +78,13 @@
|
|||||||
<table class="comparison-table">
|
<table class="comparison-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="subsystem-column">
|
<th class="subsystem-column">子系统名称</th>
|
||||||
子系统名称
|
<th class="parts-column">零部件名称</th>
|
||||||
</th>
|
<th class="param-column">参数名称</th>
|
||||||
<th class="parts-column">
|
|
||||||
零部件名称
|
|
||||||
</th>
|
|
||||||
<th class="param-column">
|
|
||||||
参数名称
|
|
||||||
</th>
|
|
||||||
<th class="unit-column">
|
|
||||||
单位
|
|
||||||
</th>
|
|
||||||
<th v-for="(model, index) in comparisonModels" :key="index" class="model-column">
|
<th v-for="(model, index) in comparisonModels" :key="index" class="model-column">
|
||||||
<div class="model-header">
|
<div class="model-header">
|
||||||
<div v-if="model.name" class="model-name"
|
<div v-if="model.name" class="model-name"
|
||||||
>
|
>{{ model.name }} V{{ model.parameterVersion }}</div
|
||||||
{{ model.name }} V{{ model.parameterVersion }}
|
|
||||||
</div
|
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
v-if="model.name"
|
v-if="model.name"
|
||||||
@ -135,12 +107,8 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(param, paramIndex) in displayParams" :key="paramIndex">
|
<tr v-for="(param, paramIndex) in displayParams" :key="paramIndex">
|
||||||
<td class="subsystem-column">
|
<td class="subsystem-column">{{ param.subsystemName }}</td>
|
||||||
{{ param.subsystemName }}
|
<td class="parts-column">{{ param.displayPartsName }}</td>
|
||||||
</td>
|
|
||||||
<td class="parts-column">
|
|
||||||
{{ param.displayPartsName }}
|
|
||||||
</td>
|
|
||||||
<td class="param-column">
|
<td class="param-column">
|
||||||
<span class="param-name">{{ getParamDisplayName(param) }}</span>
|
<span class="param-name">{{ getParamDisplayName(param) }}</span>
|
||||||
<i
|
<i
|
||||||
@ -148,9 +116,6 @@
|
|||||||
@click.stop="handleHideParam(param)"
|
@click.stop="handleHideParam(param)"
|
||||||
></i>
|
></i>
|
||||||
</td>
|
</td>
|
||||||
<td class="unit-column">
|
|
||||||
{{ param.unit || '-' }}
|
|
||||||
</td>
|
|
||||||
<td
|
<td
|
||||||
v-for="(model, modelIndex) in comparisonModels"
|
v-for="(model, modelIndex) in comparisonModels"
|
||||||
:key="modelIndex"
|
:key="modelIndex"
|
||||||
@ -175,7 +140,6 @@
|
|||||||
@close="handleAddModelDialogClose"
|
@close="handleAddModelDialogClose"
|
||||||
>
|
>
|
||||||
<div class="model-select-dialog">
|
<div class="model-select-dialog">
|
||||||
<template v-if="!isUserPermissionsEmpty()">
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="modelSearchText"
|
v-model="modelSearchText"
|
||||||
placeholder="请输入产品型号,状态代号/产品编号,平台,系列搜索"
|
placeholder="请输入产品型号,状态代号/产品编号,平台,系列搜索"
|
||||||
@ -192,9 +156,8 @@
|
|||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="modelName" label="产品型号" min-width="150" />
|
<el-table-column prop="modelName" label="产品型号" min-width="150" />
|
||||||
<el-table-column prop="parameterVersion" label="机型版本" min-width="70"
|
<el-table-column prop="parameterVersion" label="版本" min-width="70"
|
||||||
>
|
><template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>V{{ scope.row.parameterVersion }}</span>
|
<span>V{{ scope.row.parameterVersion }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -203,22 +166,10 @@
|
|||||||
<el-table-column prop="series" label="系列" min-width="70" />
|
<el-table-column prop="series" label="系列" min-width="70" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">
|
|
||||||
无权限查看
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleAddModelDialogClose">取消</el-button>
|
<el-button @click="handleAddModelDialogClose">取消</el-button>
|
||||||
<el-button
|
<el-button type="primary" :loading="loadingModelDetail" @click="handleConfirmAddModel">
|
||||||
type="primary"
|
|
||||||
:loading="loadingModelDetail"
|
|
||||||
@click="handleConfirmAddModel"
|
|
||||||
>
|
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
@ -269,9 +220,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleHiddenParamsDialogClose">
|
<el-button @click="handleHiddenParamsDialogClose">取消</el-button>
|
||||||
取消
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="selectedParamsToRestore.length === 0"
|
:disabled="selectedParamsToRestore.length === 0"
|
||||||
@ -306,9 +255,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleAddFavoriteDialogClose">
|
<el-button @click="handleAddFavoriteDialogClose">取消</el-button>
|
||||||
取消
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" :loading="savingFavorite" @click="handleConfirmAddFavorite">
|
<el-button type="primary" :loading="savingFavorite" @click="handleConfirmAddFavorite">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -320,11 +267,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { getUserId } from '@/utils'
|
import { getUserId } from '@/utils'
|
||||||
import '@/assets/scss/apaas-custom-hello.css'
|
|
||||||
|
|
||||||
/** 整车参数展示名称(接口可能仍返回「整车参数」) */
|
|
||||||
const WHOLE_ENGINE_PARAMS_NAME = '发动机基本信息'
|
|
||||||
const WHOLE_ENGINE_PARAMS_LEGACY_KEYS = ['整车参数', WHOLE_ENGINE_PARAMS_NAME]
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModelQuery',
|
name: 'ModelQuery',
|
||||||
@ -375,9 +317,7 @@ export default {
|
|||||||
// 保存完整的参数数据(不受常用配置影响,用于树节点选中时展示)
|
// 保存完整的参数数据(不受常用配置影响,用于树节点选中时展示)
|
||||||
savedAllParametersData: {}, // 格式:{ "子系统名称": [{ parameterName, parameterId, ... }] }
|
savedAllParametersData: {}, // 格式:{ "子系统名称": [{ parameterName, parameterId, ... }] }
|
||||||
// 是否使用常用配置过滤(当选中常用时为 true,当用户再次选中树节点时为 false)
|
// 是否使用常用配置过滤(当选中常用时为 true,当用户再次选中树节点时为 false)
|
||||||
useCommonFilter: false,
|
useCommonFilter: false
|
||||||
// 用户权限数据
|
|
||||||
userPermissions: [] // 从 localStorage 中获取的权限数据
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -496,8 +436,7 @@ export default {
|
|||||||
subsystemName: subsystemName,
|
subsystemName: subsystemName,
|
||||||
parameterId: parameterId,
|
parameterId: parameterId,
|
||||||
partsName: partsName, // 保存原始的 partsName
|
partsName: partsName, // 保存原始的 partsName
|
||||||
displayPartsName: displayPartsName, // 保存用于显示的零部件名称
|
displayPartsName: displayPartsName // 保存用于显示的零部件名称
|
||||||
unit: item.unit || '' // 保存单位
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -619,24 +558,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return filtered
|
return filtered
|
||||||
},
|
|
||||||
// 左侧树「全选」:与树勾选数量同步;勾选为全选,取消为全不选
|
|
||||||
treeSelectAllIndeterminate() {
|
|
||||||
const { allKeys, selectedCount } = this.getTreeSelectAllStats()
|
|
||||||
return allKeys.length > 0 && selectedCount > 0 && selectedCount < allKeys.length
|
|
||||||
},
|
|
||||||
treeSelectAllMaster: {
|
|
||||||
get() {
|
|
||||||
const { allKeys, selectedCount } = this.getTreeSelectAllStats()
|
|
||||||
return allKeys.length > 0 && selectedCount === allKeys.length
|
|
||||||
},
|
|
||||||
set(val) {
|
|
||||||
if (val) {
|
|
||||||
this.handleTreeSelectAll()
|
|
||||||
} else {
|
|
||||||
this.handleTreeDeselectAll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -650,183 +571,13 @@ export default {
|
|||||||
if (this.$refs.paramTree && this.treeFilterText) {
|
if (this.$refs.paramTree && this.treeFilterText) {
|
||||||
this.$refs.paramTree.filter(this.treeFilterText)
|
this.$refs.paramTree.filter(this.treeFilterText)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
// 监听权限数据变化,权限更新后强制重新渲染
|
|
||||||
userPermissions: {
|
|
||||||
handler() {
|
|
||||||
// 权限数据更新后,强制重新渲染参数值
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$forceUpdate()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 加载用户权限数据
|
|
||||||
this.loadUserSelfRole()
|
|
||||||
// 加载树数据(参数完成后会自动调用 loadFavoritesList)
|
// 加载树数据(参数完成后会自动调用 loadFavoritesList)
|
||||||
console.log('加载树数据')
|
|
||||||
this.loadTreeData()
|
this.loadTreeData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 加载用户自身角色权限
|
|
||||||
loadUserSelfRole() {
|
|
||||||
// 先从 localStorage 读取(快速显示)
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (permissionDataStr) {
|
|
||||||
this.userPermissions = JSON.parse(permissionDataStr)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('从 localStorage 加载用户权限数据失败:', err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 然后从 API 加载最新数据
|
|
||||||
const request = {
|
|
||||||
...api.GET_USER_SELF_ROLE,
|
|
||||||
params: {
|
|
||||||
userOrDepID: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
this.userPermissions = resp.data
|
|
||||||
// 同时更新 localStorage
|
|
||||||
try {
|
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
|
||||||
} catch (err) {
|
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
|
||||||
}
|
|
||||||
// 权限数据加载完成后,强制重新渲染(确保权限检查生效)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$forceUpdate()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取用户自身角色失败:', err)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
if (!this.userPermissions || !Array.isArray(this.userPermissions)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return this.userPermissions.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
},
|
|
||||||
// 检查用户权限是否为空数组
|
|
||||||
isUserPermissionsEmpty() {
|
|
||||||
return !this.userPermissions || !Array.isArray(this.userPermissions) || this.userPermissions.length === 0
|
|
||||||
},
|
|
||||||
// 检查是否有权限查看参数值
|
|
||||||
// model: 机型对象,包含 id, parameterVersion
|
|
||||||
// param: 参数对象,包含 subsystemName, partsName
|
|
||||||
hasParamPermission(model, param) {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.userPermissions || !Array.isArray(this.userPermissions) || this.userPermissions.length === 0) {
|
|
||||||
// 如果没有权限数据,显示 `-`
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取机型的 ycOrOth 值
|
|
||||||
const modelKey = `${model.id}_${model.parameterVersion || 1}`
|
|
||||||
const modelRawData = this.allModelRawData[modelKey]
|
|
||||||
const ycOrOth = (modelRawData && modelRawData.ycOrOth) || ''
|
|
||||||
|
|
||||||
// 判断机型类型:玉柴还是竞品
|
|
||||||
// ycOrOth 的值可能是 "玉柴"、"YC"、"竞品" 等
|
|
||||||
const isYuchai = ycOrOth === '玉柴' || ycOrOth === 'YC' || ycOrOth === 'yc'
|
|
||||||
const engineType = isYuchai ? '玉柴发动机数据' : '竞品发动机数据'
|
|
||||||
|
|
||||||
// 获取参数的子系统和零部件名称
|
|
||||||
const subsystemName = param.subsystemName || ''
|
|
||||||
// partsName 可能为空或为 '/',需要处理
|
|
||||||
let partsName = param.partsName || ''
|
|
||||||
// 如果 partsName 为空或为 '/',使用空字符串进行匹配
|
|
||||||
if (partsName === '/') {
|
|
||||||
partsName = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
// 收集所有相关的权限路径(包含对应发动机数据类型的权限)
|
|
||||||
const relevantPermissions = this.userPermissions.filter((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
// 检查是否包含对应的发动机数据类型
|
|
||||||
return permissionPath.includes(engineType)
|
|
||||||
})
|
|
||||||
|
|
||||||
if (relevantPermissions.length === 0) {
|
|
||||||
// 规则3:如果没有任何相关权限,全部参数值显示 `-`
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查是否有精确权限(三级路径:玉柴发动机数据/子系统/零部件)
|
|
||||||
const exactPermissions = relevantPermissions.filter((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
if (permissionPath.startsWith(engineType + '/')) {
|
|
||||||
const pathParts = permissionPath.split('/')
|
|
||||||
return pathParts.length >= 3
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
// 规则2:检查是否有通用权限(permissionPath 只包含"玉柴发动机数据"或"竞品发动机数据",或只有两级)
|
|
||||||
// 如果没有任何精确权限,只要有通用权限就允许查看所有参数
|
|
||||||
if (exactPermissions.length === 0) {
|
|
||||||
// 检查是否有通用权限(只有菜单名,或只有菜单名/子系统)
|
|
||||||
const hasGeneralPermission = relevantPermissions.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
// 只有菜单名,或只有菜单名/子系统(两级),都表示对该类型的所有参数都有权限
|
|
||||||
const pathParts = permissionPath.split('/')
|
|
||||||
return permissionPath === engineType || (permissionPath.startsWith(engineType + '/') && pathParts.length === 2)
|
|
||||||
})
|
|
||||||
|
|
||||||
if (hasGeneralPermission) {
|
|
||||||
// 规则2:如果有通用权限,对应的机型不做调整,正常显示所有参数
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
// 规则3:如果不在规则1和规则2中,全部参数值显示 `-`
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 规则4:如果有精确权限,需要精确匹配
|
|
||||||
// 检查是否有精确匹配的权限路径(格式:玉柴发动机数据/子系统/零部件)
|
|
||||||
// 需要精确匹配:机型类型、子系统、零部件名称
|
|
||||||
const hasExactPermission = exactPermissions.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
if (permissionPath.startsWith(engineType + '/')) {
|
|
||||||
const pathParts = permissionPath.split('/')
|
|
||||||
if (pathParts.length >= 3) {
|
|
||||||
const permSubsystem = pathParts[1] || ''
|
|
||||||
const permPartsName = pathParts[2] || ''
|
|
||||||
// 精确匹配子系统和零部件名称
|
|
||||||
// 如果 partsName 为空,需要特殊处理(可能表示整个子系统)
|
|
||||||
if (partsName === '' && permPartsName === '') {
|
|
||||||
// 如果参数没有零部件名称,权限也没有零部件名称,只要子系统匹配即可
|
|
||||||
return permSubsystem === subsystemName
|
|
||||||
}
|
|
||||||
// 精确匹配子系统和零部件
|
|
||||||
return permSubsystem === subsystemName && permPartsName === partsName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
if (hasExactPermission) {
|
|
||||||
// 规则4:如果有精确匹配的权限,正常显示
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 规则3:如果不在规则1和规则2中,且没有精确匹配,全部参数值显示 `-`
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
filterTreeNode(value, data) {
|
filterTreeNode(value, data) {
|
||||||
if (!value) return true
|
if (!value) return true
|
||||||
const searchValue = value.toLowerCase()
|
const searchValue = value.toLowerCase()
|
||||||
@ -882,50 +633,8 @@ export default {
|
|||||||
// 如果有已添加的机型,根据新选中的树节点重新加载参数数据
|
// 如果有已添加的机型,根据新选中的树节点重新加载参数数据
|
||||||
this.reloadModelDetailsForCheckedNodes()
|
this.reloadModelDetailsForCheckedNodes()
|
||||||
},
|
},
|
||||||
// 统计完整树节点总数与当前已勾选数量(用于「全选」复选框状态)
|
|
||||||
getTreeSelectAllStats() {
|
|
||||||
const source =
|
|
||||||
this.allTreeData && this.allTreeData.length > 0 ? this.allTreeData : this.treeData
|
|
||||||
if (!source || !source.length) {
|
|
||||||
return { allKeys: [], selectedCount: 0 }
|
|
||||||
}
|
|
||||||
const allKeys = this.getAllNodeKeys(source)
|
|
||||||
const checkedSet = new Set(this.checkedKeys)
|
|
||||||
const selectedCount = allKeys.filter((id) => checkedSet.has(id)).length
|
|
||||||
return { allKeys, selectedCount }
|
|
||||||
},
|
|
||||||
// 左侧参数树:全选(基于完整树数据)
|
|
||||||
handleTreeSelectAll() {
|
|
||||||
const source =
|
|
||||||
this.allTreeData && this.allTreeData.length > 0 ? this.allTreeData : this.treeData
|
|
||||||
if (!source || !source.length) {
|
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: '暂无参数树数据'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const allKeys = this.getAllNodeKeys(source)
|
|
||||||
this.checkedKeys = allKeys
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.paramTree && allKeys.length > 0) {
|
|
||||||
this.$refs.paramTree.setCheckedKeys(allKeys)
|
|
||||||
}
|
|
||||||
this.reloadModelDetailsForCheckedNodes()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 左侧参数树:全不选
|
|
||||||
handleTreeDeselectAll() {
|
|
||||||
this.checkedKeys = []
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.paramTree) {
|
|
||||||
this.$refs.paramTree.setCheckedKeys([])
|
|
||||||
}
|
|
||||||
this.reloadModelDetailsForCheckedNodes()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getParamValue(model, param) {
|
getParamValue(model, param) {
|
||||||
// param 是 { parameterName, subsystemName, parameterId, partsName }
|
// param 是 { parameterName, subsystemName, parameterId }
|
||||||
if (!model || !model.id || !param) {
|
if (!model || !model.id || !param) {
|
||||||
return '-'
|
return '-'
|
||||||
}
|
}
|
||||||
@ -934,14 +643,8 @@ export default {
|
|||||||
const parameterVersion = model.parameterVersion || 1
|
const parameterVersion = model.parameterVersion || 1
|
||||||
const modelKey = `${model.id}_${parameterVersion}`
|
const modelKey = `${model.id}_${parameterVersion}`
|
||||||
|
|
||||||
// 在页面渲染完成后,根据权限调整参数值显示
|
|
||||||
// 检查是否有权限查看该参数值
|
|
||||||
if (!this.hasParamPermission(model, param)) {
|
|
||||||
return '-'
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果是"整车参数"子系统,且是特定的参数,直接从机型原始数据中获取
|
// 如果是"整车参数"子系统,且是特定的参数,直接从机型原始数据中获取
|
||||||
if (this.isWholeEngineSubsystemName(param.subsystemName)) {
|
if (param.subsystemName === '整车参数') {
|
||||||
const paramNameToFieldMap = {
|
const paramNameToFieldMap = {
|
||||||
产品型号: 'modelName',
|
产品型号: 'modelName',
|
||||||
状态代号: 'productNumber',
|
状态代号: 'productNumber',
|
||||||
@ -1035,8 +738,7 @@ export default {
|
|||||||
...api.GET_MODEL_QUERT_TABLE_BY_VERSION,
|
...api.GET_MODEL_QUERT_TABLE_BY_VERSION,
|
||||||
params: {
|
params: {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 999,
|
size: 999
|
||||||
userId: getUserId()
|
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -1089,10 +791,6 @@ export default {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
this.loadingModelDetail = true
|
this.loadingModelDetail = true
|
||||||
const minLoadingMs = 1500
|
|
||||||
const minLoadingPromise = new Promise((resolve) => {
|
|
||||||
setTimeout(resolve, minLoadingMs)
|
|
||||||
})
|
|
||||||
// 获取当前选中的树节点对应的 subsystemTypes
|
// 获取当前选中的树节点对应的 subsystemTypes
|
||||||
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
||||||
// 批量加载选中机型的详情
|
// 批量加载选中机型的详情
|
||||||
@ -1107,7 +805,6 @@ export default {
|
|||||||
productNumber: model.productNumber || '',
|
productNumber: model.productNumber || '',
|
||||||
plate: model.plate || '',
|
plate: model.plate || '',
|
||||||
platform: model.platform || '',
|
platform: model.platform || '',
|
||||||
ycOrOth: model.ycOrOth || '',
|
|
||||||
series: model.series || '',
|
series: model.series || '',
|
||||||
marketSegment: model.marketSegment || '',
|
marketSegment: model.marketSegment || '',
|
||||||
projectName: model.projectName || '',
|
projectName: model.projectName || '',
|
||||||
@ -1117,7 +814,7 @@ export default {
|
|||||||
return this.loadModelDetail(modelId, model, parameterVersion, subsystemTypes)
|
return this.loadModelDetail(modelId, model, parameterVersion, subsystemTypes)
|
||||||
})
|
})
|
||||||
|
|
||||||
Promise.all([Promise.all(loadPromises), minLoadingPromise])
|
Promise.all(loadPromises)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// this.$message.success('添加机型成功')
|
// this.$message.success('添加机型成功')
|
||||||
this.handleAddModelDialogClose()
|
this.handleAddModelDialogClose()
|
||||||
@ -1279,7 +976,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保 allModelRawData 中有该机型的原始数据(用于整车参数显示和权限判断)
|
// 确保 allModelRawData 中有该机型的原始数据(用于整车参数显示)
|
||||||
const modelKey = `${modelId}_${parameterVersion}`
|
const modelKey = `${modelId}_${parameterVersion}`
|
||||||
if (!this.allModelRawData[modelKey]) {
|
if (!this.allModelRawData[modelKey]) {
|
||||||
this.$set(this.allModelRawData, modelKey, {
|
this.$set(this.allModelRawData, modelKey, {
|
||||||
@ -1287,18 +984,12 @@ export default {
|
|||||||
productNumber: modelData.productNumber || '',
|
productNumber: modelData.productNumber || '',
|
||||||
plate: modelData.plate || '',
|
plate: modelData.plate || '',
|
||||||
platform: modelData.platform || '',
|
platform: modelData.platform || '',
|
||||||
ycOrOth: modelData.ycOrOth || '',
|
|
||||||
series: modelData.series || '',
|
series: modelData.series || '',
|
||||||
marketSegment: modelData.marketSegment || '',
|
marketSegment: modelData.marketSegment || '',
|
||||||
projectName: modelData.projectName || '',
|
projectName: modelData.projectName || '',
|
||||||
projectNumber: modelData.projectNumber || '',
|
projectNumber: modelData.projectNumber || '',
|
||||||
parameterNum: modelData.parameterNum || ''
|
parameterNum: modelData.parameterNum || ''
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
// 如果已存在,确保 ycOrOth 值已保存
|
|
||||||
if (!this.allModelRawData[modelKey].ycOrOth && modelData.ycOrOth) {
|
|
||||||
this.$set(this.allModelRawData[modelKey], 'ycOrOth', modelData.ycOrOth)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新加载该机型的参数数据
|
// 重新加载该机型的参数数据
|
||||||
@ -1549,7 +1240,7 @@ export default {
|
|||||||
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
||||||
// 过滤掉"整车参数"子系统,不包含在下载数据中
|
// 过滤掉"整车参数"子系统,不包含在下载数据中
|
||||||
const filteredSubsystemTypes = subsystemTypes.filter(
|
const filteredSubsystemTypes = subsystemTypes.filter(
|
||||||
(item) => !this.isWholeEngineSubsystemPrefix(item)
|
(item) => !item.startsWith('整车参数-')
|
||||||
)
|
)
|
||||||
|
|
||||||
// 构建参数ID数组,和"更新常用"中的parameters一样,但不包含整车参数
|
// 构建参数ID数组,和"更新常用"中的parameters一样,但不包含整车参数
|
||||||
@ -1558,7 +1249,7 @@ export default {
|
|||||||
if (saveData && saveData.subsystems && saveData.subsystems.length > 0) {
|
if (saveData && saveData.subsystems && saveData.subsystems.length > 0) {
|
||||||
saveData.subsystems.forEach((item) => {
|
saveData.subsystems.forEach((item) => {
|
||||||
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
||||||
const isGlobal = this.isWholeEngineSubsystemName(item.subsystem) ? 1 : 0
|
const isGlobal = item.subsystem === '整车参数' ? 1 : 0
|
||||||
item.parameters.forEach((param) => {
|
item.parameters.forEach((param) => {
|
||||||
parameters.push({
|
parameters.push({
|
||||||
parameterId: param.parameterId,
|
parameterId: param.parameterId,
|
||||||
@ -1642,7 +1333,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 根据可显示的参数更新树节点选中状态(不改变树数据)
|
// 根据可显示的参数更新树节点选中状态(不改变树数据)
|
||||||
updateCheckedKeysByDisplayParams() {
|
updateCheckedKeysByDisplayParams() {
|
||||||
console.log('根据可显示的参数更新树节点选中状态(不改变树数据)');
|
|
||||||
// 确保使用完整的树数据和节点映射
|
// 确保使用完整的树数据和节点映射
|
||||||
this.treeData = JSON.parse(JSON.stringify(this.allTreeData))
|
this.treeData = JSON.parse(JSON.stringify(this.allTreeData))
|
||||||
this.nodeMap = JSON.parse(JSON.stringify(this.allNodeMap))
|
this.nodeMap = JSON.parse(JSON.stringify(this.allNodeMap))
|
||||||
@ -1678,7 +1368,7 @@ export default {
|
|||||||
|
|
||||||
if (isGlobal) {
|
if (isGlobal) {
|
||||||
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统
|
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统
|
||||||
targetSubsystemName = WHOLE_ENGINE_PARAMS_NAME
|
targetSubsystemName = '整车参数'
|
||||||
if (!subsystemPartsMap.has(targetSubsystemName)) {
|
if (!subsystemPartsMap.has(targetSubsystemName)) {
|
||||||
subsystemPartsMap.set(targetSubsystemName, new Set())
|
subsystemPartsMap.set(targetSubsystemName, new Set())
|
||||||
}
|
}
|
||||||
@ -1741,6 +1431,8 @@ export default {
|
|||||||
|
|
||||||
if (matchedSubsystemName) {
|
if (matchedSubsystemName) {
|
||||||
const partsNames = subsystemPartsMap.get(matchedSubsystemName)
|
const partsNames = subsystemPartsMap.get(matchedSubsystemName)
|
||||||
|
const subsystemName = matchedSubsystemName
|
||||||
|
|
||||||
// 检查是否有 partsName 为 '/' 的情况(应该选中子系统节点本身)
|
// 检查是否有 partsName 为 '/' 的情况(应该选中子系统节点本身)
|
||||||
if (partsNames.has('/')) {
|
if (partsNames.has('/')) {
|
||||||
// 如果 partsName 是 '/',选中子系统节点(一级节点)
|
// 如果 partsName 是 '/',选中子系统节点(一级节点)
|
||||||
@ -1842,6 +1534,7 @@ export default {
|
|||||||
if (subsystemNames.length === 0 && parameterTypes.length === 0) {
|
if (subsystemNames.length === 0 && parameterTypes.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建常用配置中的参数映射:subsystem -> Set<parameterKey>
|
// 构建常用配置中的参数映射:subsystem -> Set<parameterKey>
|
||||||
// parameterKey 格式:优先使用 parameterId,如果没有则使用 parameterName
|
// parameterKey 格式:优先使用 parameterId,如果没有则使用 parameterName
|
||||||
// 对于 isGlobal === 1 的参数,归类到"整车参数"子系统
|
// 对于 isGlobal === 1 的参数,归类到"整车参数"子系统
|
||||||
@ -1852,7 +1545,7 @@ export default {
|
|||||||
// 检查是否是 isGlobal 为 1 的参数(属于"整车参数"子系统)
|
// 检查是否是 isGlobal 为 1 的参数(属于"整车参数"子系统)
|
||||||
const isGlobal = p.isGlobal === 1 || p.isGlobal === '1'
|
const isGlobal = p.isGlobal === 1 || p.isGlobal === '1'
|
||||||
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统,否则属于原子系统
|
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统,否则属于原子系统
|
||||||
const targetSubsystemName = isGlobal ? WHOLE_ENGINE_PARAMS_NAME : subsystemName
|
const targetSubsystemName = isGlobal ? '整车参数' : subsystemName
|
||||||
|
|
||||||
// 优先使用 parameterId,如果没有则使用 parameterName
|
// 优先使用 parameterId,如果没有则使用 parameterName
|
||||||
const key = p.parameterId || p.parameterName
|
const key = p.parameterId || p.parameterName
|
||||||
@ -2086,7 +1779,7 @@ export default {
|
|||||||
let parameters = []
|
let parameters = []
|
||||||
saveData.subsystems.forEach((item) => {
|
saveData.subsystems.forEach((item) => {
|
||||||
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
||||||
const isGlobal = this.isWholeEngineSubsystemName(item.subsystem) ? 1 : 0
|
const isGlobal = item.subsystem === '整车参数' ? 1 : 0
|
||||||
item.parameters.forEach((param) => {
|
item.parameters.forEach((param) => {
|
||||||
parameters.push({
|
parameters.push({
|
||||||
parameterId: param.parameterId,
|
parameterId: param.parameterId,
|
||||||
@ -2181,7 +1874,7 @@ export default {
|
|||||||
let parameters = []
|
let parameters = []
|
||||||
saveData.subsystems.forEach((item) => {
|
saveData.subsystems.forEach((item) => {
|
||||||
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
||||||
const isGlobal = this.isWholeEngineSubsystemName(item.subsystem) ? 1 : 0
|
const isGlobal = item.subsystem === '整车参数' ? 1 : 0
|
||||||
item.parameters.forEach((param) => {
|
item.parameters.forEach((param) => {
|
||||||
parameters.push({
|
parameters.push({
|
||||||
parameterId: param.parameterId,
|
parameterId: param.parameterId,
|
||||||
@ -2388,15 +2081,13 @@ export default {
|
|||||||
},
|
},
|
||||||
// 加载树数据
|
// 加载树数据
|
||||||
loadTreeData() {
|
loadTreeData() {
|
||||||
console.log('加载树数据,调用接口获取树数据')
|
|
||||||
// 先加载所有参数数据,然后根据参数数据构建树结构(包括"整车参数")
|
// 先加载所有参数数据,然后根据参数数据构建树结构(包括"整车参数")
|
||||||
this.loadAllParametersData().then(() => {
|
this.loadAllParametersData().then(() => {
|
||||||
// 加载树结构数据
|
// 加载树结构数据
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_ENGINE_DETAIL_QUERY,
|
...api.GET_ENGINE_DETAIL_QUERY,
|
||||||
params: {
|
params: {
|
||||||
tcData: 'tc',
|
tcData: 'tc'
|
||||||
userId: getUserId()
|
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -2417,20 +2108,16 @@ export default {
|
|||||||
|
|
||||||
// 根据接口返回的"整车参数"参数数据构建树结构
|
// 根据接口返回的"整车参数"参数数据构建树结构
|
||||||
const wholeEngineParamsNode = this.buildWholeEngineParamsNode()
|
const wholeEngineParamsNode = this.buildWholeEngineParamsNode()
|
||||||
console.log('根据接口返回的"整车参数"参数数据构建树结构', wholeEngineParamsNode);
|
|
||||||
|
|
||||||
// 将"整车参数"节点放在第一位,其他节点放在后面
|
// 将"整车参数"节点放在第一位,其他节点放在后面
|
||||||
treeDataResult = [wholeEngineParamsNode, ...treeDataResult]
|
treeDataResult = [wholeEngineParamsNode, ...treeDataResult]
|
||||||
console.log('将"整车参数"节点放在第一位,其他节点放在后面', treeDataResult);
|
|
||||||
|
|
||||||
// 保存完整的树数据(未过滤)
|
// 保存完整的树数据(未过滤)
|
||||||
this.allTreeData = JSON.parse(JSON.stringify(treeDataResult))
|
this.allTreeData = JSON.parse(JSON.stringify(treeDataResult))
|
||||||
this.allNodeMap = JSON.parse(JSON.stringify(this.nodeMap))
|
this.allNodeMap = JSON.parse(JSON.stringify(this.nodeMap))
|
||||||
console.log('保存完整的树数据(未过滤)', this.allTreeData);
|
|
||||||
|
|
||||||
// 始终使用完整的树数据
|
// 始终使用完整的树数据
|
||||||
this.treeData = JSON.parse(JSON.stringify(this.allTreeData))
|
this.treeData = JSON.parse(JSON.stringify(this.allTreeData))
|
||||||
console.log('始终使用完整的树数据', this.treeData);
|
|
||||||
|
|
||||||
// 如果已选择常用配置,根据可显示的参数更新选中状态
|
// 如果已选择常用配置,根据可显示的参数更新选中状态
|
||||||
if (this.currentCommonConfig) {
|
if (this.currentCommonConfig) {
|
||||||
@ -2439,14 +2126,10 @@ export default {
|
|||||||
this.updateCheckedKeysByDisplayParams()
|
this.updateCheckedKeysByDisplayParams()
|
||||||
// 2. 然后比较当前显示的参数和常用配置中的参数,找出不在常用中的参数,隐藏它们
|
// 2. 然后比较当前显示的参数和常用配置中的参数,找出不在常用中的参数,隐藏它们
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
console.log('比较当前显示的参数和常用配置中的参数,找出不在常用中的参数,隐藏它们');
|
|
||||||
|
|
||||||
this.hideParamsNotInCommonByDisplayParams()
|
this.hideParamsNotInCommonByDisplayParams()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log('否则全选');
|
|
||||||
|
|
||||||
// 否则全选
|
// 否则全选
|
||||||
const allKeys = this.getAllNodeKeys(this.treeData)
|
const allKeys = this.getAllNodeKeys(this.treeData)
|
||||||
this.defaultExpandedKeys = allKeys
|
this.defaultExpandedKeys = allKeys
|
||||||
@ -2488,8 +2171,7 @@ export default {
|
|||||||
parameterId: param.parameterId || '',
|
parameterId: param.parameterId || '',
|
||||||
parameterName: param.parameterName || '',
|
parameterName: param.parameterName || '',
|
||||||
partsName: param.partsName || '',
|
partsName: param.partsName || '',
|
||||||
subsystem: item.subsystem, // 保存子系统名称
|
subsystem: item.subsystem // 保存子系统名称
|
||||||
unit: param.unit || '' // 保存单位
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -2600,30 +2282,13 @@ export default {
|
|||||||
})
|
})
|
||||||
return keys
|
return keys
|
||||||
},
|
},
|
||||||
isWholeEngineSubsystemName(name) {
|
// 根据接口返回的"整车参数"参数数据构建树结构
|
||||||
return WHOLE_ENGINE_PARAMS_LEGACY_KEYS.includes(name)
|
|
||||||
},
|
|
||||||
isWholeEngineSubsystemPrefix(item) {
|
|
||||||
if (!item || typeof item !== 'string') {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return WHOLE_ENGINE_PARAMS_LEGACY_KEYS.some((key) => item.startsWith(`${key}-`))
|
|
||||||
},
|
|
||||||
getWholeEngineParametersList() {
|
|
||||||
for (let i = 0; i < WHOLE_ENGINE_PARAMS_LEGACY_KEYS.length; i++) {
|
|
||||||
const key = WHOLE_ENGINE_PARAMS_LEGACY_KEYS[i]
|
|
||||||
if (this.allParametersData[key]) {
|
|
||||||
return this.allParametersData[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return []
|
|
||||||
},
|
|
||||||
// 根据接口返回的发动机基本信息参数数据构建树结构
|
|
||||||
buildWholeEngineParamsNode() {
|
buildWholeEngineParamsNode() {
|
||||||
const subsystemName = WHOLE_ENGINE_PARAMS_NAME
|
const subsystemName = '整车参数'
|
||||||
const parentId = 'parent-whole-engine-params'
|
const parentId = 'parent-whole-engine-params'
|
||||||
|
|
||||||
const parameters = this.getWholeEngineParametersList()
|
// 从 allParametersData 中获取"整车参数"的参数列表
|
||||||
|
const parameters = this.allParametersData[subsystemName] || []
|
||||||
|
|
||||||
// 提取所有的partsName并去重(过滤掉'/'和空值)
|
// 提取所有的partsName并去重(过滤掉'/'和空值)
|
||||||
const partsNameSet = new Set()
|
const partsNameSet = new Set()
|
||||||
@ -2766,7 +2431,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
height: calc(100% - 30px);
|
height: 100%;
|
||||||
|
|
||||||
.tree-search-header {
|
.tree-search-header {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
@ -2787,20 +2452,6 @@ export default {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-select-actions {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
.tree-select-checkbox {
|
|
||||||
::v-deep .el-checkbox__label {
|
|
||||||
font-size: 12px;
|
|
||||||
padding-left: 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-tree-node {
|
.custom-tree-node {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -2866,13 +2517,6 @@ export default {
|
|||||||
z-index: 15;
|
z-index: 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.unit-column {
|
|
||||||
width: 80px;
|
|
||||||
min-width: 80px;
|
|
||||||
left: 460px;
|
|
||||||
z-index: 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.model-column {
|
&.model-column {
|
||||||
min-width: 180px;
|
min-width: 180px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -2972,8 +2616,7 @@ export default {
|
|||||||
td {
|
td {
|
||||||
&.subsystem-column,
|
&.subsystem-column,
|
||||||
&.parts-column,
|
&.parts-column,
|
||||||
&.param-column,
|
&.param-column {
|
||||||
&.unit-column {
|
|
||||||
background: #f5f7fa;
|
background: #f5f7fa;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3023,14 +2666,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.unit-column {
|
|
||||||
position: sticky;
|
|
||||||
left: 460px;
|
|
||||||
background: white;
|
|
||||||
z-index: 5;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.model-column {
|
&.model-column {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,9 +20,6 @@
|
|||||||
<el-button v-if="hasTemplateManagementEditPermission()" class="import-btn" @click="handleImportTemplate()">
|
<el-button v-if="hasTemplateManagementEditPermission()" class="import-btn" @click="handleImportTemplate()">
|
||||||
导入参数模板
|
导入参数模板
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="hasTemplateManagementEditPermission()" type="primary" @click="handleShowOrderDialog">
|
|
||||||
调整排序
|
|
||||||
</el-button>
|
|
||||||
<!-- <el-button v-if="hasTemplateManagementEditPermission()" type="primary" @click="handleAddTemplate()">
|
<!-- <el-button v-if="hasTemplateManagementEditPermission()" type="primary" @click="handleAddTemplate()">
|
||||||
添加参数模板
|
添加参数模板
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
@ -235,37 +232,6 @@
|
|||||||
>
|
>
|
||||||
<div class="error-list"> {{ errorList }} </div>
|
<div class="error-list"> {{ errorList }} </div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
|
||||||
title="调整排序"
|
|
||||||
:visible.sync="orderDialogVisible"
|
|
||||||
width="600px"
|
|
||||||
append-to-body
|
|
||||||
@close="handleOrderDialogClose"
|
|
||||||
>
|
|
||||||
<div class="order-dialog-content">
|
|
||||||
<div class="order-tip" style="margin-bottom: 10px; color: #909399; font-size: 12px">
|
|
||||||
提示:拖动行可调整排序,拖动后排序号会自动更新
|
|
||||||
</div>
|
|
||||||
<el-table
|
|
||||||
:data="orderList"
|
|
||||||
row-key="id"
|
|
||||||
class="order-table"
|
|
||||||
max-height="600"
|
|
||||||
>
|
|
||||||
<el-table-column label="排序号" width="80" align="center">
|
|
||||||
<template slot-scope="{ $index }">
|
|
||||||
{{ $index + 1 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="模板名称" prop="templateName" />
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="handleOrderDialogClose">取消</el-button>
|
|
||||||
<el-button type="primary" :loading="updatingOrder" @click="handleUpdateOrder">确定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -314,11 +280,7 @@ export default {
|
|||||||
userId: getUserId(),
|
userId: getUserId(),
|
||||||
errorDialogVisible: false,
|
errorDialogVisible: false,
|
||||||
templateManagementPermissions: [], // 暂存 menuPath 为 "数据录入/模板管理" 的权限数组
|
templateManagementPermissions: [], // 暂存 menuPath 为 "数据录入/模板管理" 的权限数组
|
||||||
fromTodo: false, // 是否从待办页面进入
|
fromTodo: false // 是否从待办页面进入
|
||||||
orderDialogVisible: false,
|
|
||||||
orderList: [],
|
|
||||||
updatingOrder: false,
|
|
||||||
dragSortHandler: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -339,7 +301,13 @@ export default {
|
|||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'orderNum',
|
||||||
|
label: '排序号',
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
minWidth: '80',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'status',
|
prop: 'status',
|
||||||
customSlot: 'status',
|
customSlot: 'status',
|
||||||
@ -411,10 +379,17 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 检查是否有 permissionPath 为 "参数模板管理" 且 parameterPer 是编辑的权限
|
// 检查是否有 permissionPath 为 "参数模板管理" 且 parameterPer 是编辑的权限
|
||||||
|
// parameterPer 可能是数字 2 或字符串 "编辑" 或 "2"
|
||||||
return permissionData.some((perm) => {
|
return permissionData.some((perm) => {
|
||||||
const permissionPath = perm.permissionPath || ''
|
const permissionPath = perm.permissionPath || ''
|
||||||
const parameterPer = perm.parameterPer || ''
|
const parameterPer = perm.parameterPer
|
||||||
return permissionPath === '参数模板管理' && parameterPer === '编辑'
|
return (
|
||||||
|
permissionPath === '参数模板管理' &&
|
||||||
|
(parameterPer === 2 ||
|
||||||
|
parameterPer === '2' ||
|
||||||
|
parameterPer === '编辑' ||
|
||||||
|
parameterPer === 2)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('检查参数模板管理编辑权限失败:', err)
|
console.error('检查参数模板管理编辑权限失败:', err)
|
||||||
@ -983,9 +958,6 @@ export default {
|
|||||||
this.errorList = err.message || '导入失败,请稍后重试'
|
this.errorList = err.message || '导入失败,请稍后重试'
|
||||||
}
|
}
|
||||||
this.errorDialogVisible = true
|
this.errorDialogVisible = true
|
||||||
setTimeout(() => {
|
|
||||||
this.loadData()
|
|
||||||
}, 1000)
|
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
// 确保 loading 在所有情况下都能关闭
|
// 确保 loading 在所有情况下都能关闭
|
||||||
@ -1128,130 +1100,13 @@ export default {
|
|||||||
this.templateSelectLoading = false
|
this.templateSelectLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 生成UUID
|
||||||
generateUUID() {
|
generateUUID() {
|
||||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||||
const r = (Math.random() * 16) | 0
|
const r = (Math.random() * 16) | 0
|
||||||
const v = c === 'x' ? r : (r & 0x3) | 0x8
|
const v = c === 'x' ? r : (r & 0x3) | 0x8
|
||||||
return v.toString(16)
|
return v.toString(16)
|
||||||
})
|
})
|
||||||
},
|
|
||||||
handleShowOrderDialog() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_MODEL_LIST,
|
|
||||||
params: {
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 999
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request, false)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
const list = resp.data.result || []
|
|
||||||
this.orderList = list.map((item, index) => ({
|
|
||||||
id: item.id || item.row_id || `temp_${index}_${Date.now()}`,
|
|
||||||
templateName: item.templateName || item.po_name,
|
|
||||||
orderNum: item.orderNum || item.order_num || (index + 1)
|
|
||||||
}))
|
|
||||||
this.orderDialogVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initDragSort()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('加载模板列表失败:', err)
|
|
||||||
this.$message.error('加载模板列表失败')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleOrderDialogClose() {
|
|
||||||
this.orderDialogVisible = false
|
|
||||||
this.orderList = []
|
|
||||||
},
|
|
||||||
initDragSort() {
|
|
||||||
const table = document.querySelector('.order-table .el-table__body-wrapper tbody')
|
|
||||||
if (!table) return
|
|
||||||
const rows = table.querySelectorAll('tr')
|
|
||||||
rows.forEach((row) => {
|
|
||||||
row.draggable = true
|
|
||||||
row.style.cursor = 'move'
|
|
||||||
})
|
|
||||||
if (this.dragSortHandler) {
|
|
||||||
table.removeEventListener('dragstart', this.dragSortHandler.dragstart)
|
|
||||||
table.removeEventListener('dragend', this.dragSortHandler.dragend)
|
|
||||||
table.removeEventListener('dragover', this.dragSortHandler.dragover)
|
|
||||||
table.removeEventListener('drop', this.dragSortHandler.drop)
|
|
||||||
}
|
|
||||||
let draggedIndex = null
|
|
||||||
const dragstartHandler = (e) => {
|
|
||||||
const row = e.target.closest('tr')
|
|
||||||
if (!row) return
|
|
||||||
const rows = Array.from(table.querySelectorAll('tr'))
|
|
||||||
draggedIndex = rows.indexOf(row)
|
|
||||||
row.style.opacity = '0.5'
|
|
||||||
e.dataTransfer.effectAllowed = 'move'
|
|
||||||
}
|
|
||||||
const dragendHandler = (e) => {
|
|
||||||
const row = e.target.closest('tr')
|
|
||||||
if (row) row.style.opacity = '1'
|
|
||||||
draggedIndex = null
|
|
||||||
}
|
|
||||||
const dragoverHandler = (e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
e.dataTransfer.dropEffect = 'move'
|
|
||||||
}
|
|
||||||
const dropHandler = (e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
const targetRow = e.target.closest('tr')
|
|
||||||
if (!targetRow || draggedIndex === null) return
|
|
||||||
const rows = Array.from(table.querySelectorAll('tr'))
|
|
||||||
const targetIndex = rows.indexOf(targetRow)
|
|
||||||
if (draggedIndex !== targetIndex) {
|
|
||||||
const newOrderList = [...this.orderList]
|
|
||||||
const draggedItem = newOrderList[draggedIndex]
|
|
||||||
newOrderList.splice(draggedIndex, 1)
|
|
||||||
newOrderList.splice(targetIndex, 0, draggedItem)
|
|
||||||
this.orderList = newOrderList
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initDragSort()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
table.addEventListener('dragstart', dragstartHandler)
|
|
||||||
table.addEventListener('dragend', dragendHandler)
|
|
||||||
table.addEventListener('dragover', dragoverHandler)
|
|
||||||
table.addEventListener('drop', dropHandler)
|
|
||||||
this.dragSortHandler = {
|
|
||||||
dragstart: dragstartHandler,
|
|
||||||
dragend: dragendHandler,
|
|
||||||
dragover: dragoverHandler,
|
|
||||||
drop: dropHandler
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleUpdateOrder() {
|
|
||||||
this.updatingOrder = true
|
|
||||||
const updateList = this.orderList.map((item, index) => ({
|
|
||||||
id: item.id,
|
|
||||||
orderNum: index + 1
|
|
||||||
}))
|
|
||||||
const request = {
|
|
||||||
...api.UPDATE_TEMPLATE_ORDER,
|
|
||||||
params: {
|
|
||||||
items: updateList
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
this.$message.success('排序更新成功')
|
|
||||||
this.handleOrderDialogClose()
|
|
||||||
this.loadData()
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('更新排序失败:', err)
|
|
||||||
this.$message.error('更新排序失败')
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.updatingOrder = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1454,24 +1309,4 @@ export default {
|
|||||||
::v-deep .el-button {
|
::v-deep .el-button {
|
||||||
line-height: 0.85 !important;
|
line-height: 0.85 !important;
|
||||||
}
|
}
|
||||||
.order-dialog-content {
|
|
||||||
.order-table {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.order-tip {
|
|
||||||
padding: 8px 12px;
|
|
||||||
background: #f4f4f5;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
::v-deep .el-table__body tr {
|
|
||||||
cursor: move;
|
|
||||||
transition: all 0.3s;
|
|
||||||
}
|
|
||||||
::v-deep .el-table__body tr:hover {
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
}
|
|
||||||
::v-deep .el-table__body tr[draggable="true"] {
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,239 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="apaas-custom-page-todo custom-page">
|
|
||||||
<div class="list-container">
|
|
||||||
<div v-for="(item, index) in list" :key="index" class="list-item">
|
|
||||||
<div class="list-item-time">
|
|
||||||
{{ item.time }}
|
|
||||||
</div>
|
|
||||||
<div class="list-item-content-wrap">
|
|
||||||
<div
|
|
||||||
ref="contentEls"
|
|
||||||
class="list-item-content"
|
|
||||||
:class="{ 'is-expanded': expanded[index] }"
|
|
||||||
>
|
|
||||||
<span class="list-item-content-text">
|
|
||||||
{{
|
|
||||||
overflow[index] && !expanded[index]
|
|
||||||
? collapsedText[index]
|
|
||||||
: item.content
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
v-if="overflow[index]"
|
|
||||||
type="button"
|
|
||||||
class="list-item-toggle"
|
|
||||||
@click="toggle(index)"
|
|
||||||
>
|
|
||||||
{{ expanded[index] ? '收起' : '展开' }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ref="measureEl" class="list-item-measure" aria-hidden="true"></div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'TodoPage',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
time: '123123',
|
|
||||||
content:
|
|
||||||
'74weugfiufbewbfewhfwiufhwefhwekfhwkjfasdkg撒扩大刚放假规范几个房间看过尽快发给外交国大刚放假规范几个房间看过尽快发给外大刚放假规范几个房间看过尽快发给外大刚放假规范几个房间看过尽快发给外大刚放假规范几个房间看过尽快发给外防科技股份较为规范会计1疯狂攻击反馈'
|
|
||||||
},
|
|
||||||
{ time: '123123', content: '74weugfiufbewbfewhfwiufhwefhwekfhwkjf' },
|
|
||||||
{ time: '123123', content: '74weugfiufbewbfewhfwiufhwefhwekfhwkjf' }
|
|
||||||
],
|
|
||||||
expanded: [],
|
|
||||||
overflow: [],
|
|
||||||
collapsedText: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
list: {
|
|
||||||
deep: true,
|
|
||||||
immediate: true,
|
|
||||||
handler() {
|
|
||||||
this.ensureStateSize()
|
|
||||||
this.measureOverflow()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', this.onResize, { passive: true })
|
|
||||||
this.ensureStateSize()
|
|
||||||
this.measureOverflow()
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
window.removeEventListener('resize', this.onResize)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
ensureStateSize() {
|
|
||||||
const n = this.list.length
|
|
||||||
if (this.expanded.length !== n) {
|
|
||||||
this.expanded = Array.from({ length: n }, (_, i) => !!this.expanded[i])
|
|
||||||
}
|
|
||||||
if (this.overflow.length !== n) {
|
|
||||||
this.overflow = Array.from({ length: n }, (_, i) => !!this.overflow[i])
|
|
||||||
}
|
|
||||||
if (this.collapsedText.length !== n) {
|
|
||||||
this.collapsedText = Array.from({ length: n }, (_, i) => this.collapsedText[i] || '')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
measureOverflow() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
const els = Array.isArray(this.$refs.contentEls)
|
|
||||||
? this.$refs.contentEls
|
|
||||||
: this.$refs.contentEls
|
|
||||||
? [this.$refs.contentEls]
|
|
||||||
: []
|
|
||||||
|
|
||||||
const measureEl = this.$refs.measureEl
|
|
||||||
if (!measureEl) return
|
|
||||||
|
|
||||||
const nextOverflow = []
|
|
||||||
const nextCollapsed = []
|
|
||||||
|
|
||||||
this.list.forEach((item, idx) => {
|
|
||||||
const hostEl = els[idx]
|
|
||||||
if (!hostEl) {
|
|
||||||
nextOverflow[idx] = false
|
|
||||||
nextCollapsed[idx] = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const hostStyle = window.getComputedStyle(hostEl)
|
|
||||||
const contentWidth = hostEl.clientWidth
|
|
||||||
if (!contentWidth) {
|
|
||||||
nextOverflow[idx] = false
|
|
||||||
nextCollapsed[idx] = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
measureEl.style.width = `${contentWidth}px`
|
|
||||||
measureEl.style.font = hostStyle.font
|
|
||||||
measureEl.style.fontSize = hostStyle.fontSize
|
|
||||||
measureEl.style.fontFamily = hostStyle.fontFamily
|
|
||||||
measureEl.style.fontWeight = hostStyle.fontWeight
|
|
||||||
measureEl.style.letterSpacing = hostStyle.letterSpacing
|
|
||||||
measureEl.style.lineHeight = hostStyle.lineHeight
|
|
||||||
measureEl.style.wordBreak = hostStyle.wordBreak
|
|
||||||
measureEl.style.whiteSpace = 'normal'
|
|
||||||
|
|
||||||
const lineHeightStr = hostStyle.lineHeight
|
|
||||||
let lineHeight = parseFloat(lineHeightStr)
|
|
||||||
if (!Number.isFinite(lineHeight)) {
|
|
||||||
const fontSize = parseFloat(hostStyle.fontSize) || 14
|
|
||||||
lineHeight = fontSize * 1.2
|
|
||||||
}
|
|
||||||
const maxHeight = lineHeight * 3 + 0.5
|
|
||||||
|
|
||||||
// 先判断是否超过三行
|
|
||||||
measureEl.textContent = item.content
|
|
||||||
const isOverflow = measureEl.scrollHeight > maxHeight
|
|
||||||
nextOverflow[idx] = isOverflow
|
|
||||||
|
|
||||||
if (!isOverflow) {
|
|
||||||
nextCollapsed[idx] = item.content
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算三行内可放下的最大字符数(预留“...展开”的空间,保证按钮同一行)
|
|
||||||
const suffixForMeasure = `…展开`
|
|
||||||
let low = 0
|
|
||||||
let high = item.content.length
|
|
||||||
let best = 0
|
|
||||||
|
|
||||||
while (low <= high) {
|
|
||||||
const mid = Math.floor((low + high) / 2)
|
|
||||||
const candidate = item.content.slice(0, mid) + suffixForMeasure
|
|
||||||
measureEl.textContent = candidate
|
|
||||||
if (measureEl.scrollHeight <= maxHeight) {
|
|
||||||
best = mid
|
|
||||||
low = mid + 1
|
|
||||||
} else {
|
|
||||||
high = mid - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nextCollapsed[idx] = item.content.slice(0, best) + '…'
|
|
||||||
})
|
|
||||||
|
|
||||||
this.overflow = nextOverflow
|
|
||||||
this.collapsedText = nextCollapsed
|
|
||||||
})
|
|
||||||
},
|
|
||||||
toggle(index) {
|
|
||||||
this.$set(this.expanded, index, !this.expanded[index])
|
|
||||||
this.measureOverflow()
|
|
||||||
},
|
|
||||||
onResize() {
|
|
||||||
this.ensureStateSize()
|
|
||||||
this.measureOverflow()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.list-container {
|
|
||||||
width: 220px;
|
|
||||||
height: 100%;
|
|
||||||
border: 1px solid #e0e0e0;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 10px;
|
|
||||||
.list-item {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 100px;
|
|
||||||
height: auto;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
padding: 8px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.list-item:hover {
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-item-content-wrap {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-item-content {
|
|
||||||
position: relative;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-item-toggle {
|
|
||||||
padding: 0 0 0 6px;
|
|
||||||
border: 0;
|
|
||||||
background: transparent;
|
|
||||||
color: #1677ff;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-item-toggle:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-item-measure {
|
|
||||||
position: absolute;
|
|
||||||
left: -99999px;
|
|
||||||
top: -99999px;
|
|
||||||
visibility: hidden;
|
|
||||||
pointer-events: none;
|
|
||||||
word-break: break-word;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -43,14 +43,13 @@
|
|||||||
v-for="(colConfig, index) in tableConfig.colConfigs"
|
v-for="(colConfig, index) in tableConfig.colConfigs"
|
||||||
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
|
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
|
||||||
>
|
>
|
||||||
<div v-if="colConfig.customSlot === 'processTitle'" :key="'pt' + index + '' + rowIndex">
|
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleRowView(row)"
|
@click.stop="handleRowView(row)"
|
||||||
|
>查看</a
|
||||||
>
|
>
|
||||||
{{ row.processTitle || '--' }}
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -73,8 +72,6 @@
|
|||||||
:dispatch-type="dispatchType"
|
:dispatch-type="dispatchType"
|
||||||
:responsible-person-id="responsiblePersonId"
|
:responsible-person-id="responsiblePersonId"
|
||||||
:filled-by="filledBy"
|
:filled-by="filledBy"
|
||||||
:from-done="true"
|
|
||||||
:hide-operations="true"
|
|
||||||
class="engine-detail-wrapper"
|
class="engine-detail-wrapper"
|
||||||
@back="handleBackFromDetail"
|
@back="handleBackFromDetail"
|
||||||
/>
|
/>
|
||||||
@ -85,7 +82,6 @@
|
|||||||
:detail="currentEngineDetail"
|
:detail="currentEngineDetail"
|
||||||
:visible="showEngineCheck"
|
:visible="showEngineCheck"
|
||||||
:engine-type="engineType"
|
:engine-type="engineType"
|
||||||
:hide-operations="true"
|
|
||||||
class="engine-check-wrapper"
|
class="engine-check-wrapper"
|
||||||
@close="handleBackFromCheck"
|
@close="handleBackFromCheck"
|
||||||
/>
|
/>
|
||||||
@ -152,13 +148,7 @@ export default {
|
|||||||
rowDraggable: false,
|
rowDraggable: false,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
// { prop: 'documentNo', label: '单据编号', showOverflowTooltip: true, minWidth: '140' },
|
// { prop: 'documentNo', label: '单据编号', showOverflowTooltip: true, minWidth: '140' },
|
||||||
{
|
{ prop: 'processTitle', label: '流程主题', showOverflowTooltip: true, minWidth: '160' },
|
||||||
prop: 'processTitle',
|
|
||||||
label: '流程主题',
|
|
||||||
showOverflowTooltip: true,
|
|
||||||
minWidth: '200',
|
|
||||||
customSlot: 'processTitle'
|
|
||||||
},
|
|
||||||
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' },
|
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' },
|
||||||
// { prop: 'statusCode', label: '状态代号', showOverflowTooltip: true, minWidth: '120' },
|
// { prop: 'statusCode', label: '状态代号', showOverflowTooltip: true, minWidth: '120' },
|
||||||
// { prop: 'modelName', label: '产品型号', showOverflowTooltip: true, minWidth: '120' },
|
// { prop: 'modelName', label: '产品型号', showOverflowTooltip: true, minWidth: '120' },
|
||||||
@ -176,6 +166,14 @@ export default {
|
|||||||
minWidth: '160',
|
minWidth: '160',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: this.formatDateTime
|
formatter: this.formatDateTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'options',
|
||||||
|
label: '操作',
|
||||||
|
customSlot: 'options',
|
||||||
|
align: 'center',
|
||||||
|
width: '100',
|
||||||
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
seqType: '',
|
seqType: '',
|
||||||
@ -186,8 +184,6 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadData()
|
this.loadData()
|
||||||
// 检查URL中是否有flowId参数
|
|
||||||
this.checkFlowIdFromUrl()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
pageSizeChange(size) {
|
pageSizeChange(size) {
|
||||||
@ -369,35 +365,6 @@ export default {
|
|||||||
console.error('日期格式化错误:', error)
|
console.error('日期格式化错误:', error)
|
||||||
return cellValue
|
return cellValue
|
||||||
}
|
}
|
||||||
},
|
|
||||||
checkFlowIdFromUrl() {
|
|
||||||
// 检查URL中是否有flowId参数
|
|
||||||
const flowId = this.$route && this.$route.query && this.$route.query.flowId
|
|
||||||
if (flowId) {
|
|
||||||
const request = {
|
|
||||||
...api.GET_YC_MY_DONE_LIST,
|
|
||||||
params: {
|
|
||||||
flowId: flowId
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
// 根据返回值触发handleRowView
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 尝试多种可能的数据结构
|
|
||||||
const rowData = resp.data.result || resp.data.data || resp.data
|
|
||||||
// 确保rowData有必要的字段
|
|
||||||
if (rowData && (rowData.dataType || rowData.documentNo || rowData.modelId)) {
|
|
||||||
this.handleRowView(rowData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('根据flowId获取经办数据失败:', err)
|
|
||||||
this.$message.error('获取经办数据失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,23 +43,22 @@
|
|||||||
v-for="(colConfig, index) in tableConfig.colConfigs"
|
v-for="(colConfig, index) in tableConfig.colConfigs"
|
||||||
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
|
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
|
||||||
>
|
>
|
||||||
<div v-if="colConfig.customSlot === 'processTitle'" :key="'pt' + index + '' + rowIndex">
|
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleRowView(row)"
|
@click.stop="handleRowView(row)"
|
||||||
>
|
>
|
||||||
{{ row.processTitle || '--' }}
|
查看
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<span v-if="row.enableReturn == 1" style="width: 6px; display: inline-block"></span>
|
||||||
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
|
|
||||||
<a
|
<a
|
||||||
|
v-if="row.enableReturn == 1"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleRowWithdraw(row)"
|
@click.stop="handleRowWithdraw(row)"
|
||||||
|
>撤回</a
|
||||||
>
|
>
|
||||||
撤回
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -83,7 +82,6 @@
|
|||||||
:responsible-person-id="responsiblePersonId"
|
:responsible-person-id="responsiblePersonId"
|
||||||
:filled-by="filledBy"
|
:filled-by="filledBy"
|
||||||
:last-updated-by="lastUpdatedBy"
|
:last-updated-by="lastUpdatedBy"
|
||||||
:hide-operations="true"
|
|
||||||
class="engine-detail-wrapper"
|
class="engine-detail-wrapper"
|
||||||
@back="handleBackFromDetail"
|
@back="handleBackFromDetail"
|
||||||
/>
|
/>
|
||||||
@ -94,7 +92,6 @@
|
|||||||
:detail="currentEngineDetail"
|
:detail="currentEngineDetail"
|
||||||
:visible="showEngineCheck"
|
:visible="showEngineCheck"
|
||||||
:engine-type="engineType"
|
:engine-type="engineType"
|
||||||
:hide-operations="true"
|
|
||||||
class="engine-check-wrapper"
|
class="engine-check-wrapper"
|
||||||
@close="handleBackFromCheck"
|
@close="handleBackFromCheck"
|
||||||
/>
|
/>
|
||||||
@ -127,6 +124,7 @@ import ApprovalProgressDetail from './approvalProgressDetail.vue'
|
|||||||
import ReportDetail from './reportDetail.vue'
|
import ReportDetail from './reportDetail.vue'
|
||||||
import { getUserId } from '@/utils'
|
import { getUserId } from '@/utils'
|
||||||
import api from '@/api/demo'
|
import api from '@/api/demo'
|
||||||
|
import { flow } from 'lodash-es'
|
||||||
export default {
|
export default {
|
||||||
name: 'TodoPage',
|
name: 'TodoPage',
|
||||||
components: {
|
components: {
|
||||||
@ -161,13 +159,7 @@ export default {
|
|||||||
rowDraggable: false,
|
rowDraggable: false,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
// { prop: 'documentNo', label: '单据编号', showOverflowTooltip: true, minWidth: '140' },
|
// { prop: 'documentNo', label: '单据编号', showOverflowTooltip: true, minWidth: '140' },
|
||||||
{
|
{ prop: 'processTitle', label: '流程主题', showOverflowTooltip: true, minWidth: '160' },
|
||||||
prop: 'processTitle',
|
|
||||||
label: '流程主题',
|
|
||||||
showOverflowTooltip: true,
|
|
||||||
minWidth: '200',
|
|
||||||
customSlot: 'processTitle'
|
|
||||||
},
|
|
||||||
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '100' },
|
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '100' },
|
||||||
// { prop: 'statusCode', label: '状态代号', showOverflowTooltip: true, minWidth: '120' },
|
// { prop: 'statusCode', label: '状态代号', showOverflowTooltip: true, minWidth: '120' },
|
||||||
// { prop: 'modelName', label: '产品型号', showOverflowTooltip: true, minWidth: '120' },
|
// { prop: 'modelName', label: '产品型号', showOverflowTooltip: true, minWidth: '120' },
|
||||||
@ -191,7 +183,7 @@ export default {
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
customSlot: 'options',
|
customSlot: 'options',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '100',
|
width: '140',
|
||||||
fixed: 'right'
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -203,8 +195,6 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadData()
|
this.loadData()
|
||||||
// 检查URL中是否有flowId参数
|
|
||||||
this.checkFlowIdFromUrl()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
pageSizeChange(size) {
|
pageSizeChange(size) {
|
||||||
@ -496,35 +486,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.warn(row)
|
console.warn(row)
|
||||||
},
|
|
||||||
checkFlowIdFromUrl() {
|
|
||||||
// 检查URL中是否有flowId参数
|
|
||||||
const flowId = this.$route && this.$route.query && this.$route.query.flowId
|
|
||||||
if (flowId) {
|
|
||||||
const request = {
|
|
||||||
...api.GET_YC_MY_SEND_LIST,
|
|
||||||
params: {
|
|
||||||
flowId: flowId
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
// 根据返回值触发handleRowView
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 尝试多种可能的数据结构
|
|
||||||
const rowData = resp.data.result || resp.data.data || resp.data
|
|
||||||
// 确保rowData有必要的字段
|
|
||||||
if (rowData && (rowData.dataType || rowData.documentNo || rowData.modelId)) {
|
|
||||||
this.handleRowView(rowData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('根据flowId获取发起数据失败:', err)
|
|
||||||
this.$message.error('获取发起数据失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,9 +49,9 @@
|
|||||||
<div class="search-field">
|
<div class="search-field">
|
||||||
<span class="field-label">当前状态</span>
|
<span class="field-label">当前状态</span>
|
||||||
<el-select v-model="searchPanelValue.statusDescription" placeholder="请选择" clearable>
|
<el-select v-model="searchPanelValue.statusDescription" placeholder="请选择" clearable>
|
||||||
<el-option label="审核中" value="审核中" />
|
<el-option label="审批中" value="审批中" />
|
||||||
<el-option label="已通过" value="已通过" />
|
<el-option label="已通过" value="已通过" />
|
||||||
<el-option label="已拒绝" value="已拒绝" />
|
<el-option label="已退回" value="已退回" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-actions">
|
<div class="search-actions">
|
||||||
@ -113,14 +113,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -216,8 +209,7 @@ export default {
|
|||||||
// 申请人搜索相关
|
// 申请人搜索相关
|
||||||
applicantOptions: [],
|
applicantOptions: [],
|
||||||
applicantLoading: false,
|
applicantLoading: false,
|
||||||
applicantSearchTimer: null, // 防抖定时器
|
applicantSearchTimer: null // 防抖定时器
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -284,35 +276,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
this.loadData()
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
this.loadUserSelfRole()
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// 清理定时器
|
// 清理定时器
|
||||||
@ -384,49 +350,6 @@ export default {
|
|||||||
// 如果是提交人,就可以显示撤回按钮
|
// 如果是提交人,就可以显示撤回按钮
|
||||||
return this.isApplicant(row)
|
return this.isApplicant(row)
|
||||||
},
|
},
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "竞品发动机数据审批流程" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('竞品发动机数据审批流程')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
// 加载用户自身角色权限
|
||||||
loadUserSelfRole() {
|
loadUserSelfRole() {
|
||||||
const request = {
|
const request = {
|
||||||
@ -436,26 +359,19 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 将权限数据存储到 localStorage
|
// 将权限数据存储到 localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
reject(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pageSizeChange(size) {
|
pageSizeChange(size) {
|
||||||
|
|||||||
@ -56,7 +56,6 @@
|
|||||||
<el-option label="已分发" value="已分发" />
|
<el-option label="已分发" value="已分发" />
|
||||||
<el-option label="部分分发" value="部分分发" />
|
<el-option label="部分分发" value="部分分发" />
|
||||||
<el-option label="未分发" value="未分发" />
|
<el-option label="未分发" value="未分发" />
|
||||||
<el-option label="已完成" value="已完成" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-actions">
|
<div class="search-actions">
|
||||||
@ -109,22 +108,9 @@
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
<span
|
<span v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()" class="link-separator"></span>
|
||||||
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
|
||||||
class="link-separator"
|
|
||||||
></span>
|
|
||||||
<a
|
<a
|
||||||
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()"
|
||||||
href="javascript:void(0)"
|
|
||||||
class="el-link el-link--primary"
|
|
||||||
style="margin-left: 5px;"
|
|
||||||
@click.stop="handleRowEdit(row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</a>
|
|
||||||
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
|
||||||
<a
|
|
||||||
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
style="margin-left: 5px;"
|
style="margin-left: 5px;"
|
||||||
@ -132,7 +118,7 @@
|
|||||||
>
|
>
|
||||||
分发
|
分发
|
||||||
</a>
|
</a>
|
||||||
<span class="link-separator" v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"></span>
|
<span v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1" class="link-separator"></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"
|
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
@ -153,9 +139,6 @@
|
|||||||
<span v-else-if="row[colConfig.prop] === '未分发'" class="status-tag status-pending">
|
<span v-else-if="row[colConfig.prop] === '未分发'" class="status-tag status-pending">
|
||||||
未分发
|
未分发
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="row[colConfig.prop] === '已完成'" class="status-tag status-done">
|
|
||||||
已完成
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="colConfig.customSlot === 'versionNumber'" :key="index + '' + rowIndex">
|
<div v-if="colConfig.customSlot === 'versionNumber'" :key="index + '' + rowIndex">
|
||||||
V{{ row[colConfig.prop] || '' }}
|
V{{ row[colConfig.prop] || '' }}
|
||||||
@ -164,14 +147,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -273,8 +249,7 @@ export default {
|
|||||||
importing: false,
|
importing: false,
|
||||||
selectedImportFile: null,
|
selectedImportFile: null,
|
||||||
importFileList: [],
|
importFileList: [],
|
||||||
downloadingTemplate: false,
|
downloadingTemplate: false
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -365,7 +340,7 @@ export default {
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
customSlot: 'options',
|
customSlot: 'options',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200',
|
width: '120',
|
||||||
fixed: 'right'
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -374,35 +349,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
this.loadUserSelfRole()
|
||||||
if (this.hasViewPermission()) {
|
this.loadData()
|
||||||
this.canViewData = true
|
},
|
||||||
this.loadData()
|
mounted() {
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
this.loadUserSelfRole()
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
// 检查是否是管理员(isAdmin === 1)
|
||||||
@ -423,31 +376,6 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "竞品发动机数据" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('竞品发动机数据')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有竞品发动机数据的编辑权限
|
// 检查是否有竞品发动机数据的编辑权限
|
||||||
hasEngineDataEditPermission() {
|
hasEngineDataEditPermission() {
|
||||||
// 如果是管理员,拥有全部权限
|
// 如果是管理员,拥有全部权限
|
||||||
@ -464,10 +392,16 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 检查是否有 permissionPath 为 "竞品发动机数据" 且 parameterPer 是编辑的权限
|
// 检查是否有 permissionPath 为 "竞品发动机数据" 且 parameterPer 是编辑的权限
|
||||||
|
// parameterPer 可能是数字 2 或字符串 "编辑" 或 "2"
|
||||||
return permissionData.some((perm) => {
|
return permissionData.some((perm) => {
|
||||||
const permissionPath = perm.permissionPath || ''
|
const permissionPath = perm.permissionPath || ''
|
||||||
const parameterPer = perm.parameterPer || ''
|
const parameterPer = perm.parameterPer
|
||||||
return permissionPath === '竞品发动机数据' && parameterPer === '编辑'
|
return (
|
||||||
|
permissionPath === '竞品发动机数据' &&
|
||||||
|
(parameterPer === 2 ||
|
||||||
|
parameterPer === '2' ||
|
||||||
|
parameterPer === '编辑')
|
||||||
|
)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('检查竞品发动机数据编辑权限失败:', err)
|
console.error('检查竞品发动机数据编辑权限失败:', err)
|
||||||
@ -483,26 +417,19 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 将权限数据存储到 localStorage
|
// 将权限数据存储到 localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
reject(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleRowDispatch(row, rowIndex) {
|
handleRowDispatch(row, rowIndex) {
|
||||||
@ -563,7 +490,6 @@ export default {
|
|||||||
this.currentEngineDetail = null
|
this.currentEngineDetail = null
|
||||||
this.isDispatchMode = false
|
this.isDispatchMode = false
|
||||||
this.dispatchType = 'todo'
|
this.dispatchType = 'todo'
|
||||||
this.loadData()
|
|
||||||
},
|
},
|
||||||
currentChange(currentPage) {
|
currentChange(currentPage) {
|
||||||
this.pagination.currentPage = currentPage
|
this.pagination.currentPage = currentPage
|
||||||
@ -784,12 +710,6 @@ export default {
|
|||||||
// 从 selfEnginedata.vue 跳转,设置 ycOrOth 为 "竞品"
|
// 从 selfEnginedata.vue 跳转,设置 ycOrOth 为 "竞品"
|
||||||
this.$refs.addEngineModelModal.showModal('竞品')
|
this.$refs.addEngineModelModal.showModal('竞品')
|
||||||
},
|
},
|
||||||
handleRowEdit(row) {
|
|
||||||
if (row.distributeStatus !== '未分发') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$refs.addEngineModelModal.showModalForEdit('竞品', row)
|
|
||||||
},
|
|
||||||
handleAddSuccess() {
|
handleAddSuccess() {
|
||||||
// 子组件已经关闭弹窗,这里只需要刷新列表
|
// 子组件已经关闭弹窗,这里只需要刷新列表
|
||||||
this.loadData()
|
this.loadData()
|
||||||
@ -996,7 +916,7 @@ export default {
|
|||||||
width: 4px;
|
width: 4px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
.add-engine-model-modal .modal-body{
|
::v-deep .el-button {
|
||||||
|
line-height: 0.85 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,15 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="permission-management-page custom-page">
|
<div class="permission-management-page custom-page">
|
||||||
<!-- 人员管理组件 -->
|
|
||||||
<apaas-custom-roleMemberManagement
|
|
||||||
v-if="showRoleMemberManagement"
|
|
||||||
:role-id="currentRoleId"
|
|
||||||
:role-name="currentRoleName"
|
|
||||||
@back="handleBackFromRoleMember"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 权限管理主页面 -->
|
|
||||||
<div v-if="!showRoleMemberManagement">
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
权限管理
|
权限管理
|
||||||
@ -88,7 +78,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 新增/编辑对话框 -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@ -129,9 +118,7 @@
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
<!-- 审批流程菜单项只有查看权限,没有编辑权限 -->
|
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-if="!isApprovalFlowMenu(data.label)"
|
|
||||||
v-model="data.permissions.edit"
|
v-model="data.permissions.edit"
|
||||||
size="small"
|
size="small"
|
||||||
@change="handleNodePermissionChange(data, 'edit')"
|
@change="handleNodePermissionChange(data, 'edit')"
|
||||||
@ -157,7 +144,7 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
title="人员配置"
|
title="人员配置"
|
||||||
:visible.sync="personConfigDialogVisible"
|
:visible.sync="personConfigDialogVisible"
|
||||||
width="800px"
|
width="500px"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
class="person-config-dialog"
|
class="person-config-dialog"
|
||||||
@ -185,48 +172,53 @@
|
|||||||
<!-- 配置部门模式 -->
|
<!-- 配置部门模式 -->
|
||||||
<template v-if="personConfigFormData.configType === 'department'">
|
<template v-if="personConfigFormData.configType === 'department'">
|
||||||
<el-form-item label="责任部门:" prop="department">
|
<el-form-item label="责任部门:" prop="department">
|
||||||
<el-select
|
<el-cascader
|
||||||
v-model="personConfigFormData.selectDeptIds"
|
ref="departmentCascader"
|
||||||
multiple
|
v-model="personConfigFormData.department"
|
||||||
|
:options="departmentList"
|
||||||
|
:props="{
|
||||||
|
multiple: true,
|
||||||
|
checkStrictly: true,
|
||||||
|
value: 'id',
|
||||||
|
label: 'name',
|
||||||
|
children: 'children',
|
||||||
|
emitPath: true
|
||||||
|
}"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择责任部门(可多选)"
|
placeholder="请选择责任部门(可多选)"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="handlePersonDepartmentChange"
|
@change="handlePersonDepartmentChange"
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in departmentSelectOptionsMerged"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
/>
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<!-- 配置人员模式 -->
|
<!-- 配置人员模式 -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-form-item label="搜索人员:">
|
<!-- <el-form-item label="责任部门:" prop="department">
|
||||||
<el-input
|
<el-cascader
|
||||||
v-model="personSearchKeyword"
|
ref="departmentCascader"
|
||||||
placeholder="在已选人员中搜索人名"
|
v-model="personConfigFormData.department"
|
||||||
|
:options="departmentList"
|
||||||
|
:props="departmentCascaderProps"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择责任部门"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@input="handlePersonSearchInList"
|
@change="handlePersonDepartmentChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="添加人员:">
|
<el-form-item label="人员:" prop="person">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="personToAdd"
|
v-model="personConfigFormData.person"
|
||||||
|
multiple
|
||||||
filterable
|
filterable
|
||||||
remote
|
remote
|
||||||
reserve-keyword
|
placeholder="请输入人员姓名进行搜索"
|
||||||
placeholder="请输入人员姓名进行搜索并添加"
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
clearable
|
clearable
|
||||||
:remote-method="queryPersonByDepartment"
|
:remote-method="queryPersonByDepartment"
|
||||||
:loading="personSearchLoading"
|
:loading="personSearchLoading"
|
||||||
class="person-select"
|
class="person-select"
|
||||||
@change="handleAddPersonToList"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="person in personOptions"
|
v-for="person in personOptions"
|
||||||
@ -239,32 +231,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="已选人员:">
|
|
||||||
<el-table
|
|
||||||
:data="filteredPersonList"
|
|
||||||
border
|
|
||||||
max-height="300"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
|
||||||
<el-table-column prop="username" label="姓名" align="center" />
|
|
||||||
<el-table-column prop="userNumber" label="ID" align="center" />
|
|
||||||
<el-table-column label="操作" width="80" align="center">
|
|
||||||
<template slot-scope="{ row }">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
style="color: #f56c6c"
|
|
||||||
@click="handleRemovePersonFromList(row)"
|
|
||||||
>
|
|
||||||
移除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div style="margin-top: 8px; color: #909399; font-size: 12px">
|
|
||||||
共 {{ personConfigFormData.person.length }} 人
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -375,17 +341,11 @@ export default {
|
|||||||
addRoleMode: 'add', // 'add' 或 'edit'
|
addRoleMode: 'add', // 'add' 或 'edit'
|
||||||
addRoleFormData: {
|
addRoleFormData: {
|
||||||
roleName: '',
|
roleName: '',
|
||||||
roleCode: '',
|
|
||||||
roleDescription: '',
|
roleDescription: '',
|
||||||
roleId: '' // 编辑时使用
|
roleId: '' // 编辑时使用
|
||||||
},
|
},
|
||||||
// 人员管理页面相关
|
|
||||||
showRoleMemberManagement: false,
|
|
||||||
currentRoleId: '',
|
|
||||||
currentRoleName: '',
|
|
||||||
addRoleFormRules: {
|
addRoleFormRules: {
|
||||||
roleName: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
|
roleName: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
|
||||||
roleCode: [{ required: true, message: '请输入角色代码', trigger: 'blur' }],
|
|
||||||
roleDescription: [{ required: true, message: '请输入角色描述', trigger: 'blur' }]
|
roleDescription: [{ required: true, message: '请输入角色描述', trigger: 'blur' }]
|
||||||
},
|
},
|
||||||
// 菜单树数据
|
// 菜单树数据
|
||||||
@ -400,7 +360,7 @@ export default {
|
|||||||
// 待应用的权限数据(用于懒加载模式下延迟应用权限)
|
// 待应用的权限数据(用于懒加载模式下延迟应用权限)
|
||||||
pendingPermissions: [],
|
pendingPermissions: [],
|
||||||
// 固定的父级菜单列表
|
// 固定的父级菜单列表
|
||||||
menuList: ['参数模板管理', '玉柴发动机数据', '竞品发动机数据', '对标报告','参数模板审批流程','玉柴发动机数据审批流程','竞品发动机数据审批流程','对标报告审批流程','基础管理模块'],
|
menuList: ['参数模板管理', '玉柴发动机数据', '竞品发动机数据', '对标报告'],
|
||||||
// 模板列表数据(用于参数模板管理的二级节点)
|
// 模板列表数据(用于参数模板管理的二级节点)
|
||||||
templateList: [],
|
templateList: [],
|
||||||
// 人员配置相关
|
// 人员配置相关
|
||||||
@ -418,17 +378,12 @@ export default {
|
|||||||
},
|
},
|
||||||
personOptions: [], // 人员选项列表
|
personOptions: [], // 人员选项列表
|
||||||
personSearchLoading: false, // 人员搜索loading状态
|
personSearchLoading: false, // 人员搜索loading状态
|
||||||
personSearchKeyword: '', // 已选人员搜索关键字
|
|
||||||
personToAdd: '', // 待添加的人员ID
|
|
||||||
selectedPersonList: [], // 已选人员完整信息列表 [{ userId, username, userNumber }]
|
|
||||||
selectedDepartmentOptions: [], // 从接口解析的已选部门选项 { value, label },用于反显时显示部门名称
|
|
||||||
personConfigFormRules: {
|
personConfigFormRules: {
|
||||||
department: [
|
department: [
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
if (this.personConfigFormData.configType === 'department') {
|
if (this.personConfigFormData.configType === 'department') {
|
||||||
const deptIds = this.personConfigFormData.selectDeptIds
|
if (!value || (Array.isArray(value) && value.length === 0)) {
|
||||||
if (!deptIds || (Array.isArray(deptIds) && deptIds.length === 0)) {
|
|
||||||
callback(new Error('请选择责任部门'))
|
callback(new Error('请选择责任部门'))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
@ -471,21 +426,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filteredPersonList() {
|
|
||||||
let list = []
|
|
||||||
if (!this.personSearchKeyword || this.personSearchKeyword.trim() === '') {
|
|
||||||
list = this.selectedPersonList
|
|
||||||
} else {
|
|
||||||
//列表展示人员倒序排序
|
|
||||||
const keyword = this.personSearchKeyword.trim().toLowerCase()
|
|
||||||
list = this.selectedPersonList.filter((person) => {
|
|
||||||
const name = (person.username || '').toLowerCase()
|
|
||||||
const number = (person.userNumber || '').toLowerCase()
|
|
||||||
return name.includes(keyword) || number.includes(keyword)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return list.slice().reverse()
|
|
||||||
},
|
|
||||||
dialogTitle() {
|
dialogTitle() {
|
||||||
return this.dialogMode === 'add' ? '新增' : '修改'
|
return this.dialogMode === 'add' ? '新增' : '修改'
|
||||||
},
|
},
|
||||||
@ -513,34 +453,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return nodes
|
return nodes
|
||||||
},
|
|
||||||
// 部门树扁平化为 el-select 选项(多选用),value 统一为字符串以便与 selectDeptIds 匹配反显
|
|
||||||
departmentSelectOptions() {
|
|
||||||
const list = this.departmentList || []
|
|
||||||
const result = []
|
|
||||||
const flatten = (nodes) => {
|
|
||||||
if (!Array.isArray(nodes)) return
|
|
||||||
nodes.forEach((node) => {
|
|
||||||
result.push({
|
|
||||||
value: node.id == null ? '' : String(node.id),
|
|
||||||
label: node.name || node.label || ''
|
|
||||||
})
|
|
||||||
if (node.children && node.children.length > 0) {
|
|
||||||
flatten(node.children)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
flatten(list)
|
|
||||||
return result
|
|
||||||
},
|
|
||||||
// 合并部门树选项与接口返回的已选部门选项,保证反显时能显示部门名称(接口中的名称优先)
|
|
||||||
departmentSelectOptionsMerged() {
|
|
||||||
const treeOptions = this.departmentSelectOptions || []
|
|
||||||
const apiOptions = this.selectedDepartmentOptions || []
|
|
||||||
const map = new Map()
|
|
||||||
treeOptions.forEach((opt) => map.set(opt.value, { value: opt.value, label: opt.label }))
|
|
||||||
apiOptions.forEach((opt) => map.set(opt.value, { value: opt.value, label: opt.label }))
|
|
||||||
return Array.from(map.values())
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -564,16 +476,6 @@ export default {
|
|||||||
this.currentPersonRequest = null
|
this.currentPersonRequest = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 判断是否是审批流程菜单项(只有查看权限,没有编辑权限)
|
|
||||||
isApprovalFlowMenu(menuName) {
|
|
||||||
const approvalFlowMenus = [
|
|
||||||
'参数模板审批流程',
|
|
||||||
'玉柴发动机数据审批流程',
|
|
||||||
'竞品发动机数据审批流程',
|
|
||||||
'对标报告审批流程'
|
|
||||||
]
|
|
||||||
return approvalFlowMenus.includes(menuName)
|
|
||||||
},
|
|
||||||
getUserSelfRole() {
|
getUserSelfRole() {
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_USER_SELF_ROLE,
|
...api.GET_USER_SELF_ROLE,
|
||||||
@ -671,21 +573,13 @@ export default {
|
|||||||
// 遍历固定的菜单列表,即使子系统列表为空,也要构建菜单节点
|
// 遍历固定的菜单列表,即使子系统列表为空,也要构建菜单节点
|
||||||
this.menuList.forEach((menuName, menuIdx) => {
|
this.menuList.forEach((menuName, menuIdx) => {
|
||||||
const menuId = `menu-${menuIdx}`
|
const menuId = `menu-${menuIdx}`
|
||||||
// 定义没有子级的菜单项(叶子节点)
|
|
||||||
const leafMenus = [
|
|
||||||
'对标报告',
|
|
||||||
'参数模板审批流程',
|
|
||||||
'玉柴发动机数据审批流程',
|
|
||||||
'竞品发动机数据审批流程',
|
|
||||||
'对标报告审批流程'
|
|
||||||
]
|
|
||||||
const menuNode = {
|
const menuNode = {
|
||||||
id: menuId,
|
id: menuId,
|
||||||
label: menuName,
|
label: menuName,
|
||||||
type: 'menu',
|
type: 'menu',
|
||||||
children: null, // 初始为 null,懒加载时加载
|
children: null, // 初始为 null,懒加载时加载
|
||||||
// 这些菜单项没有子级,自己这一级就带有权限
|
// 对标报告没有子级,自己这一级就带有权限
|
||||||
isLeaf: leafMenus.includes(menuName),
|
isLeaf: menuName === '对标报告',
|
||||||
permissions: {
|
permissions: {
|
||||||
view: false,
|
view: false,
|
||||||
edit: false
|
edit: false
|
||||||
@ -717,16 +611,8 @@ export default {
|
|||||||
}
|
}
|
||||||
// 如果节点是菜单类型
|
// 如果节点是菜单类型
|
||||||
if (node.data.type === 'menu') {
|
if (node.data.type === 'menu') {
|
||||||
// 这些菜单项没有子级,直接返回空数组
|
// 对标报告没有子级,直接返回空数组
|
||||||
const leafMenus = [
|
if (node.data.label === '对标报告') {
|
||||||
'对标报告',
|
|
||||||
'参数模板审批流程',
|
|
||||||
'玉柴发动机数据审批流程',
|
|
||||||
'竞品发动机数据审批流程',
|
|
||||||
'对标报告审批流程',
|
|
||||||
'基础管理模块'
|
|
||||||
]
|
|
||||||
if (leafMenus.includes(node.data.label)) {
|
|
||||||
resolve([])
|
resolve([])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -753,7 +639,7 @@ export default {
|
|||||||
...api.GET_MODEL_LIST,
|
...api.GET_MODEL_LIST,
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 9999
|
pageSize: 999
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -975,16 +861,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 统一的节点权限变更处理
|
// 统一的节点权限变更处理
|
||||||
handleNodePermissionChange(data, permissionType) {
|
handleNodePermissionChange(data, permissionType) {
|
||||||
// 审批流程菜单项只有查看权限,没有编辑权限
|
|
||||||
if (permissionType === 'edit' && data.type === 'menu' && this.isApprovalFlowMenu(data.label)) {
|
|
||||||
// 如果是审批流程菜单项,不允许设置编辑权限,强制设置为 false
|
|
||||||
this.$set(data.permissions, 'edit', false)
|
|
||||||
if (data.id && this.nodeMap[data.id]) {
|
|
||||||
this.$set(this.nodeMap[data.id].permissions, 'edit', false)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果选中编辑权限,自动选中查看权限
|
// 如果选中编辑权限,自动选中查看权限
|
||||||
if (permissionType === 'edit' && data.permissions && data.permissions.edit === true) {
|
if (permissionType === 'edit' && data.permissions && data.permissions.edit === true) {
|
||||||
// 确保权限对象存在
|
// 确保权限对象存在
|
||||||
@ -1034,16 +910,6 @@ export default {
|
|||||||
const isChecked = menuNode.permissions[permissionType]
|
const isChecked = menuNode.permissions[permissionType]
|
||||||
const menuName = menuNode.label || ''
|
const menuName = menuNode.label || ''
|
||||||
|
|
||||||
// 审批流程菜单项只有查看权限,没有编辑权限
|
|
||||||
if (permissionType === 'edit' && this.isApprovalFlowMenu(menuName)) {
|
|
||||||
// 如果是审批流程菜单项,不允许设置编辑权限,强制设置为 false
|
|
||||||
this.$set(menuNode.permissions, 'edit', false)
|
|
||||||
if (menuNode.id && this.nodeMap[menuNode.id]) {
|
|
||||||
this.$set(this.nodeMap[menuNode.id].permissions, 'edit', false)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果选中编辑权限,自动选中查看权限
|
// 如果选中编辑权限,自动选中查看权限
|
||||||
if (permissionType === 'edit' && isChecked) {
|
if (permissionType === 'edit' && isChecked) {
|
||||||
this.$set(menuNode.permissions, 'view', true)
|
this.$set(menuNode.permissions, 'view', true)
|
||||||
@ -1138,12 +1004,8 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (menuName === '对标报告' ||
|
} else if (menuName === '对标报告') {
|
||||||
menuName === '参数模板审批流程' ||
|
// 对标报告:没有子节点,只有菜单本身
|
||||||
menuName === '玉柴发动机数据审批流程' ||
|
|
||||||
menuName === '竞品发动机数据审批流程' ||
|
|
||||||
menuName === '对标报告审批流程') {
|
|
||||||
// 这些菜单项:没有子节点,只有菜单本身
|
|
||||||
const menuPath = this.buildPermissionPath(menuNode)
|
const menuPath = this.buildPermissionPath(menuNode)
|
||||||
if (menuPath) {
|
if (menuPath) {
|
||||||
const existingPerm = this.pendingPermissions.find(
|
const existingPerm = this.pendingPermissions.find(
|
||||||
@ -1197,11 +1059,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (menuName === '对标报告' ||
|
} else if (menuName === '对标报告') {
|
||||||
menuName === '参数模板审批流程' ||
|
|
||||||
menuName === '玉柴发动机数据审批流程' ||
|
|
||||||
menuName === '竞品发动机数据审批流程' ||
|
|
||||||
menuName === '对标报告审批流程') {
|
|
||||||
const menuPath = this.buildPermissionPath(menuNode)
|
const menuPath = this.buildPermissionPath(menuNode)
|
||||||
if (menuPath) {
|
if (menuPath) {
|
||||||
const existingPerm = this.pendingPermissions.find(
|
const existingPerm = this.pendingPermissions.find(
|
||||||
@ -1221,23 +1079,14 @@ export default {
|
|||||||
// 如果取消选中,需要从 pendingPermissions 中移除该菜单下所有子节点的权限
|
// 如果取消选中,需要从 pendingPermissions 中移除该菜单下所有子节点的权限
|
||||||
if (this.pendingPermissions) {
|
if (this.pendingPermissions) {
|
||||||
const parameterPer = permissionType === 'view' ? 1 : 2
|
const parameterPer = permissionType === 'view' ? 1 : 2
|
||||||
// 定义没有子级的菜单项
|
|
||||||
const leafMenus = [
|
|
||||||
'对标报告',
|
|
||||||
'参数模板审批流程',
|
|
||||||
'玉柴发动机数据审批流程',
|
|
||||||
'竞品发动机数据审批流程',
|
|
||||||
'对标报告审批流程'
|
|
||||||
]
|
|
||||||
|
|
||||||
// 移除该菜单下所有子节点的权限
|
// 移除该菜单下所有子节点的权限
|
||||||
this.pendingPermissions = this.pendingPermissions.filter((perm) => {
|
this.pendingPermissions = this.pendingPermissions.filter((perm) => {
|
||||||
// 如果权限路径以菜单名开头,且权限类型匹配,则移除
|
// 如果权限路径以菜单名开头,且权限类型匹配,则移除
|
||||||
if (perm.permissionPath && perm.permissionPath.startsWith(menuName + '/')) {
|
if (perm.permissionPath && perm.permissionPath.startsWith(menuName + '/')) {
|
||||||
return perm.parameterPer !== parameterPer
|
return perm.parameterPer !== parameterPer
|
||||||
}
|
}
|
||||||
// 这些菜单项没有子节点,直接匹配菜单路径
|
// 对标报告没有子节点,直接匹配菜单路径
|
||||||
if (leafMenus.includes(menuName) && perm.permissionPath === menuName) {
|
if (menuName === '对标报告' && perm.permissionPath === menuName) {
|
||||||
return perm.parameterPer !== parameterPer
|
return perm.parameterPer !== parameterPer
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
@ -1250,7 +1099,7 @@ export default {
|
|||||||
if (perm.permissionPath && perm.permissionPath.startsWith(menuName + '/')) {
|
if (perm.permissionPath && perm.permissionPath.startsWith(menuName + '/')) {
|
||||||
return perm.parameterPer !== viewParameterPer
|
return perm.parameterPer !== viewParameterPer
|
||||||
}
|
}
|
||||||
if (leafMenus.includes(menuName) && perm.permissionPath === menuName) {
|
if (menuName === '对标报告' && perm.permissionPath === menuName) {
|
||||||
return perm.parameterPer !== viewParameterPer
|
return perm.parameterPer !== viewParameterPer
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
@ -1429,7 +1278,6 @@ export default {
|
|||||||
this.addRoleDialogVisible = true
|
this.addRoleDialogVisible = true
|
||||||
this.addRoleFormData = {
|
this.addRoleFormData = {
|
||||||
roleName: '',
|
roleName: '',
|
||||||
roleCode: '',
|
|
||||||
roleDescription: '',
|
roleDescription: '',
|
||||||
roleId: ''
|
roleId: ''
|
||||||
}
|
}
|
||||||
@ -1488,7 +1336,6 @@ export default {
|
|||||||
this.addRoleMode = 'add'
|
this.addRoleMode = 'add'
|
||||||
this.addRoleFormData = {
|
this.addRoleFormData = {
|
||||||
roleName: '',
|
roleName: '',
|
||||||
roleCode: '',
|
|
||||||
roleDescription: '',
|
roleDescription: '',
|
||||||
roleId: ''
|
roleId: ''
|
||||||
}
|
}
|
||||||
@ -1560,34 +1407,83 @@ export default {
|
|||||||
// 不显示错误提示,因为可能是新角色没有权限数据
|
// 不显示错误提示,因为可能是新角色没有权限数据
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 人员配置 - 显示人员管理页面
|
// 人员配置
|
||||||
handlePersonConfig(row) {
|
handlePersonConfig(row) {
|
||||||
console.log('打开人员管理页面:', row)
|
this.personConfigFormData = {
|
||||||
this.currentRoleId = row.rowId || row.id || ''
|
configType: 'person',
|
||||||
this.currentRoleName = row.roleName || ''
|
department: '',
|
||||||
this.showRoleMemberManagement = true
|
person: [], // userId 数组
|
||||||
|
selectDeptId: '',
|
||||||
|
selectDeptName: '',
|
||||||
|
selectDeptIds: [],
|
||||||
|
roleId: row.rowId || row.id || '',
|
||||||
|
roleName: row.roleName || ''
|
||||||
|
}
|
||||||
|
const request = {
|
||||||
|
...api.CHECK_ROLE_USER_DEPT,
|
||||||
|
params: {
|
||||||
|
roleId: row.rowId || row.id || ''
|
||||||
},
|
},
|
||||||
// 从人员管理页面返回
|
disableSuccessMsg: true
|
||||||
handleBackFromRoleMember() {
|
}
|
||||||
console.log('从人员管理页面返回')
|
this.$request(request)
|
||||||
this.showRoleMemberManagement = false
|
.asyncThen((resp) => {
|
||||||
this.currentRoleId = ''
|
if (resp && resp.data) {
|
||||||
this.currentRoleName = ''
|
// 解析返回数据,格式:{ "部门": [], "人员": ["李亚松-yc90117847"] }
|
||||||
|
const respData = resp.data
|
||||||
|
const personArray = respData['人员'] || respData.person || []
|
||||||
|
// 解析人员数组,格式:["userName-userId"]
|
||||||
|
const userIds = []
|
||||||
|
const personOptionsMap = new Map()
|
||||||
|
personArray.forEach((personStr) => {
|
||||||
|
if (typeof personStr === 'string' && personStr.includes('-')) {
|
||||||
|
const parts = personStr.split('-')
|
||||||
|
if (parts.length >= 2) {
|
||||||
|
const userName = parts[0]
|
||||||
|
const userId = parts.slice(1).join('-') // 处理 userId 中可能包含 - 的情况
|
||||||
|
userIds.push(userId)
|
||||||
|
// 构建选项对象
|
||||||
|
personOptionsMap.set(userId, {
|
||||||
|
userId: userId,
|
||||||
|
username: userName,
|
||||||
|
userNumber: userId // userNumber 使用 userId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 设置已选择的人员ID数组
|
||||||
|
this.personConfigFormData.person = userIds
|
||||||
|
// 设置选项(用于显示已选择的人员)
|
||||||
|
this.personOptions = Array.from(personOptionsMap.values())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.asyncErrorCatch((err) => {
|
||||||
|
console.error('加载人员列表失败:', err)
|
||||||
|
})
|
||||||
|
this.personConfigDialogVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.personConfigForm) {
|
||||||
|
this.$refs.personConfigForm.clearValidate()
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 配置类型切换
|
// 配置类型切换
|
||||||
handleConfigTypeChange(value) {
|
handleConfigTypeChange(value) {
|
||||||
// 切换到配置部门时:将 department 中的部门 id 数组同步到 selectDeptIds,保证 el-select 能反显(并统一为字符串以匹配选项)
|
// 切换配置类型时,清空相关数据
|
||||||
if (value === 'department') {
|
if (value === 'department') {
|
||||||
const raw = this.personConfigFormData.department
|
// 切换到配置部门模式
|
||||||
if (Array.isArray(raw) && raw.length > 0) {
|
this.personConfigFormData.department = []
|
||||||
const isFlatIds = !Array.isArray(raw[0])
|
this.personConfigFormData.selectDeptIds = []
|
||||||
if (isFlatIds) {
|
this.personConfigFormData.person = []
|
||||||
const ids = raw.map((id) => (id == null ? '' : String(id)))
|
this.personOptions = []
|
||||||
this.personConfigFormData.selectDeptIds = ids
|
} else {
|
||||||
}
|
// 切换到配置人员模式
|
||||||
}
|
this.personConfigFormData.department = ''
|
||||||
|
this.personConfigFormData.selectDeptId = ''
|
||||||
|
this.personConfigFormData.selectDeptName = ''
|
||||||
|
this.personConfigFormData.selectDeptIds = []
|
||||||
}
|
}
|
||||||
|
// 清除表单验证
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.personConfigForm) {
|
if (this.$refs.personConfigForm) {
|
||||||
this.$refs.personConfigForm.clearValidate()
|
this.$refs.personConfigForm.clearValidate()
|
||||||
@ -1597,7 +1493,7 @@ export default {
|
|||||||
// 加载部门列表
|
// 加载部门列表
|
||||||
loadDepartmentList() {
|
loadDepartmentList() {
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_DEPT_OF_USER,
|
...api.QUERY_ORG_TREE,
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
@ -1605,7 +1501,7 @@ export default {
|
|||||||
// 处理返回的数据,确保格式为 { id, name, children }
|
// 处理返回的数据,确保格式为 { id, name, children }
|
||||||
let result = []
|
let result = []
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
result = resp.data
|
result = resp.data.result || resp.data.data || resp.data || []
|
||||||
}
|
}
|
||||||
// 格式化数据为级联选择器需要的格式
|
// 格式化数据为级联选择器需要的格式
|
||||||
this.departmentList = this.formatDepartmentTreeData(result)
|
this.departmentList = this.formatDepartmentTreeData(result)
|
||||||
@ -1640,7 +1536,26 @@ export default {
|
|||||||
// 处理部门选择变化
|
// 处理部门选择变化
|
||||||
handlePersonDepartmentChange(value) {
|
handlePersonDepartmentChange(value) {
|
||||||
if (this.personConfigFormData.configType === 'department') {
|
if (this.personConfigFormData.configType === 'department') {
|
||||||
// 配置部门模式:el-select 多选,value 即为选中的部门 id 数组,v-model 已绑定 selectDeptIds
|
// 配置部门模式:value 是数组,每个元素是级联路径数组(多选)
|
||||||
|
// 例如:[[id1, id2], [id3, id4]] 表示选中了两个部门
|
||||||
|
if (value && Array.isArray(value) && value.length > 0) {
|
||||||
|
// 提取所有选中部门的最后一级ID,存入数组
|
||||||
|
this.personConfigFormData.selectDeptIds = value
|
||||||
|
.map((path) => {
|
||||||
|
// path 是级联路径数组,取最后一级作为部门ID
|
||||||
|
if (Array.isArray(path) && path.length > 0) {
|
||||||
|
return path[path.length - 1]
|
||||||
|
}
|
||||||
|
// 如果 path 不是数组,可能是直接的ID
|
||||||
|
return path
|
||||||
|
})
|
||||||
|
.filter((id) => id) // 过滤掉空值
|
||||||
|
} else {
|
||||||
|
this.personConfigFormData.selectDeptIds = []
|
||||||
|
}
|
||||||
|
console.log('配置部门模式 - 选中的部门值:', value)
|
||||||
|
console.log('配置部门模式 - 选中的部门ID数组:', this.personConfigFormData.selectDeptIds)
|
||||||
|
// 触发表单验证
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.personConfigForm) {
|
if (this.$refs.personConfigForm) {
|
||||||
this.$refs.personConfigForm.validateField('department')
|
this.$refs.personConfigForm.validateField('department')
|
||||||
@ -1750,18 +1665,18 @@ export default {
|
|||||||
)
|
)
|
||||||
// 去重:使用 Map 确保每个 userId 只出现一次
|
// 去重:使用 Map 确保每个 userId 只出现一次
|
||||||
const optionsMap = new Map()
|
const optionsMap = new Map()
|
||||||
// 先添加搜索结果,保证匹配项显示在下拉框最前面
|
// 先添加已选择的选项
|
||||||
|
selectedOptions.forEach((opt) => {
|
||||||
|
if (opt.userId) {
|
||||||
|
optionsMap.set(opt.userId, opt)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 再添加新的搜索结果
|
||||||
filteredUsers.forEach((user) => {
|
filteredUsers.forEach((user) => {
|
||||||
if (user.userId && !optionsMap.has(user.userId)) {
|
if (user.userId && !optionsMap.has(user.userId)) {
|
||||||
optionsMap.set(user.userId, user)
|
optionsMap.set(user.userId, user)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 再添加已选择的选项(用于标签反显)
|
|
||||||
selectedOptions.forEach((opt) => {
|
|
||||||
if (opt.userId && !optionsMap.has(opt.userId)) {
|
|
||||||
optionsMap.set(opt.userId, opt)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.personOptions = Array.from(optionsMap.values())
|
this.personOptions = Array.from(optionsMap.values())
|
||||||
this.personSearchLoading = false
|
this.personSearchLoading = false
|
||||||
this.currentPersonRequest = null
|
this.currentPersonRequest = null
|
||||||
@ -1810,49 +1725,31 @@ export default {
|
|||||||
const path = findNodePath(this.departmentList, deptId)
|
const path = findNodePath(this.departmentList, deptId)
|
||||||
return path ? path.join('-') : ''
|
return path ? path.join('-') : ''
|
||||||
},
|
},
|
||||||
// 根据部门id获取部门路径ID数组(用于级联选择器反显)
|
|
||||||
getDepartmentPathIds(deptId) {
|
|
||||||
if (!deptId || !this.departmentList || this.departmentList.length === 0) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const findNodePathIds = (nodes, targetId, pathIds = []) => {
|
|
||||||
for (const node of nodes) {
|
|
||||||
const currentPath = [...pathIds, node.id]
|
|
||||||
if (node.id === targetId) {
|
|
||||||
return currentPath
|
|
||||||
}
|
|
||||||
if (node.children && node.children.length > 0) {
|
|
||||||
const found = findNodePathIds(node.children, targetId, currentPath)
|
|
||||||
if (found) {
|
|
||||||
return found
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
return findNodePathIds(this.departmentList, deptId)
|
|
||||||
},
|
|
||||||
// 人员配置提交
|
// 人员配置提交
|
||||||
handlePersonConfigSubmit() {
|
handlePersonConfigSubmit() {
|
||||||
this.$refs.personConfigForm.validate((valid) => {
|
this.$refs.personConfigForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.personConfigSubmitting = true
|
this.personConfigSubmitting = true
|
||||||
|
|
||||||
// 收集人员ID(isDept=0)
|
let userOrDeptId = []
|
||||||
let personIds = (this.personConfigFormData.person || []).filter((id) => id)
|
let isDept = 0
|
||||||
// 收集部门ID(isDept=1):优先 selectDeptIds,否则从 department 提取
|
|
||||||
let deptIds = []
|
if (this.personConfigFormData.configType === 'department') {
|
||||||
|
// 配置部门模式:传部门ID数组
|
||||||
|
isDept = 1
|
||||||
|
// 优先使用 selectDeptIds,如果没有则从 department 中提取
|
||||||
if (
|
if (
|
||||||
this.personConfigFormData.selectDeptIds &&
|
this.personConfigFormData.selectDeptIds &&
|
||||||
this.personConfigFormData.selectDeptIds.length > 0
|
this.personConfigFormData.selectDeptIds.length > 0
|
||||||
) {
|
) {
|
||||||
deptIds = [...this.personConfigFormData.selectDeptIds]
|
userOrDeptId = this.personConfigFormData.selectDeptIds
|
||||||
} else if (
|
} else if (
|
||||||
this.personConfigFormData.department &&
|
this.personConfigFormData.department &&
|
||||||
Array.isArray(this.personConfigFormData.department) &&
|
Array.isArray(this.personConfigFormData.department) &&
|
||||||
this.personConfigFormData.department.length > 0
|
this.personConfigFormData.department.length > 0
|
||||||
) {
|
) {
|
||||||
deptIds = this.personConfigFormData.department
|
// 如果 selectDeptIds 为空,从 department 中提取
|
||||||
|
userOrDeptId = this.personConfigFormData.department
|
||||||
.map((path) => {
|
.map((path) => {
|
||||||
if (Array.isArray(path) && path.length > 0) {
|
if (Array.isArray(path) && path.length > 0) {
|
||||||
return path[path.length - 1]
|
return path[path.length - 1]
|
||||||
@ -1860,44 +1757,47 @@ export default {
|
|||||||
return path
|
return path
|
||||||
})
|
})
|
||||||
.filter((id) => id)
|
.filter((id) => id)
|
||||||
|
} else {
|
||||||
|
userOrDeptId = []
|
||||||
}
|
}
|
||||||
|
if (userOrDeptId.length === 0) {
|
||||||
// 校验:至少有一个人员或部门
|
this.$message.warning('请至少选择一个部门')
|
||||||
if (personIds.length === 0 && deptIds.length === 0) {
|
|
||||||
this.$message.warning(
|
|
||||||
this.personConfigFormData.configType === 'department'
|
|
||||||
? '请至少选择一个部门'
|
|
||||||
: '请至少选择一个人员'
|
|
||||||
)
|
|
||||||
this.personConfigSubmitting = false
|
this.personConfigSubmitting = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 配置人员模式:传人员ID数组(person 已经是 userId 数组)
|
||||||
|
isDept = 0
|
||||||
|
userOrDeptId = (this.personConfigFormData.person || []).filter((id) => id)
|
||||||
|
if (userOrDeptId.length === 0) {
|
||||||
|
this.$message.warning('请至少选择一个人员')
|
||||||
|
this.personConfigSubmitting = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const normalizeId = (id) => {
|
// 处理 userOrDeptId,去掉 "ID:" 前缀
|
||||||
|
const processedUserOrDeptId = userOrDeptId.map((id) => {
|
||||||
if (typeof id === 'string' && id.startsWith('ID:')) {
|
if (typeof id === 'string' && id.startsWith('ID:')) {
|
||||||
return id.substring(3)
|
return id.substring(3) // 去掉 "ID:" 前缀(3个字符)
|
||||||
}
|
}
|
||||||
return id
|
return id
|
||||||
}
|
})
|
||||||
|
|
||||||
// 合并:原来已配置的人员 + 已配置的部门,统一为 { id, isDept }
|
|
||||||
const processedUserOrDeptIds = [
|
|
||||||
...personIds.map((id) => ({ userOrDeptId: normalizeId(id), isDept: 0 })),
|
|
||||||
...deptIds.map((id) => ({ userOrDeptId: normalizeId(id), isDept: 1 }))
|
|
||||||
]
|
|
||||||
|
|
||||||
console.log('人员配置数据:', {
|
console.log('人员配置数据:', {
|
||||||
roleId: this.personConfigFormData.roleId,
|
roleId: this.personConfigFormData.roleId,
|
||||||
roleName: this.personConfigFormData.roleName,
|
roleName: this.personConfigFormData.roleName,
|
||||||
configType: this.personConfigFormData.configType,
|
configType: this.personConfigFormData.configType,
|
||||||
userOrDeptIds: processedUserOrDeptIds
|
isDept: isDept,
|
||||||
|
userOrDeptIds: processedUserOrDeptId
|
||||||
})
|
})
|
||||||
|
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_ROLE_PERMISSION_BING,
|
...api.GET_ROLE_PERMISSION_BING,
|
||||||
params: {
|
params: {
|
||||||
roleId: this.personConfigFormData.roleId,
|
roleId: this.personConfigFormData.roleId,
|
||||||
userOrDept: processedUserOrDeptIds
|
userOrDeptIds: processedUserOrDeptId,
|
||||||
|
isDept: isDept
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -1938,9 +1838,6 @@ export default {
|
|||||||
roleName: ''
|
roleName: ''
|
||||||
}
|
}
|
||||||
this.personOptions = []
|
this.personOptions = []
|
||||||
this.personSearchKeyword = ''
|
|
||||||
this.personToAdd = ''
|
|
||||||
this.selectedPersonList = []
|
|
||||||
// 清除定时器和请求
|
// 清除定时器和请求
|
||||||
if (this.personSearchTimer) {
|
if (this.personSearchTimer) {
|
||||||
clearTimeout(this.personSearchTimer)
|
clearTimeout(this.personSearchTimer)
|
||||||
@ -1951,47 +1848,12 @@ export default {
|
|||||||
this.$refs.personConfigForm.clearValidate()
|
this.$refs.personConfigForm.clearValidate()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlePersonSearchInList() {
|
|
||||||
},
|
|
||||||
handleAddPersonToList(userId) {
|
|
||||||
if (!userId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const person = this.personOptions.find((p) => p.userId === userId)
|
|
||||||
if (!person) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const exists = this.selectedPersonList.some((p) => p.userId === userId)
|
|
||||||
if (exists) {
|
|
||||||
this.$message.warning('该人员已在列表中')
|
|
||||||
this.personToAdd = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.selectedPersonList.push({
|
|
||||||
userId: person.userId,
|
|
||||||
username: person.username,
|
|
||||||
userNumber: person.userNumber
|
|
||||||
})
|
|
||||||
this.personConfigFormData.person.push(userId)
|
|
||||||
this.personToAdd = ''
|
|
||||||
},
|
|
||||||
handleRemovePersonFromList(row) {
|
|
||||||
const index = this.selectedPersonList.findIndex((p) => p.userId === row.userId)
|
|
||||||
if (index > -1) {
|
|
||||||
this.selectedPersonList.splice(index, 1)
|
|
||||||
const idIndex = this.personConfigFormData.person.indexOf(row.userId)
|
|
||||||
if (idIndex > -1) {
|
|
||||||
this.personConfigFormData.person.splice(idIndex, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 编辑角色(编辑角色名称和描述)
|
// 编辑角色(编辑角色名称和描述)
|
||||||
handleEdit(row) {
|
handleEdit(row) {
|
||||||
this.addRoleMode = 'edit'
|
this.addRoleMode = 'edit'
|
||||||
this.addRoleDialogVisible = true
|
this.addRoleDialogVisible = true
|
||||||
this.addRoleFormData = {
|
this.addRoleFormData = {
|
||||||
roleName: row.roleName || '',
|
roleName: row.roleName || '',
|
||||||
roleCode: row.roleCode || '',
|
|
||||||
roleDescription: row.roleDescription || '',
|
roleDescription: row.roleDescription || '',
|
||||||
roleId: row.rowId || row.id || ''
|
roleId: row.rowId || row.id || ''
|
||||||
}
|
}
|
||||||
@ -2053,12 +1915,9 @@ export default {
|
|||||||
|
|
||||||
const permData = permissionMap.get(permissionPath)
|
const permData = permissionMap.get(permissionPath)
|
||||||
// parameterPer 是数字:1是查看,2是编辑
|
// parameterPer 是数字:1是查看,2是编辑
|
||||||
// 审批流程菜单项只有查看权限,没有编辑权限
|
|
||||||
const isApprovalFlow = this.isApprovalFlowMenu(permissionPath)
|
|
||||||
if (perm.parameterPer === 1 || perm.parameterPer === '1' || perm.parameterPer === '查看') {
|
if (perm.parameterPer === 1 || perm.parameterPer === '1' || perm.parameterPer === '查看') {
|
||||||
permData.view = true
|
permData.view = true
|
||||||
} else if ((perm.parameterPer === 2 || perm.parameterPer === '2' || perm.parameterPer === '编辑') && !isApprovalFlow) {
|
} else if (perm.parameterPer === 2 || perm.parameterPer === '2' || perm.parameterPer === '编辑') {
|
||||||
// 只有非审批流程菜单项才设置编辑权限
|
|
||||||
permData.edit = true
|
permData.edit = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -2083,10 +1942,6 @@ export default {
|
|||||||
view: permData.view || false,
|
view: permData.view || false,
|
||||||
edit: permData.edit || false
|
edit: permData.edit || false
|
||||||
}
|
}
|
||||||
// 审批流程菜单项只有查看权限,没有编辑权限
|
|
||||||
if (node.type === 'menu' && this.isApprovalFlowMenu(node.label)) {
|
|
||||||
newPermissions.edit = false
|
|
||||||
}
|
|
||||||
// 如果只有编辑权限,自动添加查看权限
|
// 如果只有编辑权限,自动添加查看权限
|
||||||
if (newPermissions.edit && !newPermissions.view) {
|
if (newPermissions.edit && !newPermissions.view) {
|
||||||
newPermissions.view = true
|
newPermissions.view = true
|
||||||
@ -2187,11 +2042,6 @@ export default {
|
|||||||
hasView = true
|
hasView = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审批流程菜单项只有查看权限,没有编辑权限
|
|
||||||
if (node.type === 'menu' && this.isApprovalFlowMenu(node.label)) {
|
|
||||||
hasEdit = false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用 $set 确保响应式更新,直接替换整个权限对象
|
// 使用 $set 确保响应式更新,直接替换整个权限对象
|
||||||
const newPermissions = {
|
const newPermissions = {
|
||||||
view: hasView,
|
view: hasView,
|
||||||
@ -2300,8 +2150,8 @@ export default {
|
|||||||
permissions.push(perm)
|
permissions.push(perm)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 收集编辑权限(审批流程菜单项只有查看权限,没有编辑权限)
|
// 收集编辑权限
|
||||||
if (nodePermissions.edit && !(node.type === 'menu' && this.isApprovalFlowMenu(node.label))) {
|
if (nodePermissions.edit) {
|
||||||
const perm = {
|
const perm = {
|
||||||
permissionPath: permissionPath,
|
permissionPath: permissionPath,
|
||||||
parameterPer: 2, // 2是编辑
|
parameterPer: 2, // 2是编辑
|
||||||
@ -2461,33 +2311,6 @@ export default {
|
|||||||
|
|
||||||
// 人员选择下拉框样式(参考 modelDetail.vue)
|
// 人员选择下拉框样式(参考 modelDetail.vue)
|
||||||
::v-deep .person-select {
|
::v-deep .person-select {
|
||||||
.el-select__input {
|
|
||||||
display: inline-block !important;
|
|
||||||
visibility: visible !important;
|
|
||||||
opacity: 1 !important;
|
|
||||||
flex: 1;
|
|
||||||
min-width: 80px !important;
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-select__tags {
|
|
||||||
max-width: calc(100% - 30px);
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tag {
|
|
||||||
max-width: 90px;
|
|
||||||
|
|
||||||
.el-select__tags-text {
|
|
||||||
max-width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-select-dropdown__item {
|
.el-select-dropdown__item {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
justify-content: space-between !important;
|
justify-content: space-between !important;
|
||||||
|
|||||||
@ -110,9 +110,7 @@
|
|||||||
v-for="(colConfig, index) in tableConfig.colConfigs"
|
v-for="(colConfig, index) in tableConfig.colConfigs"
|
||||||
v-slot:[colConfig.customHeadSlot]="{ column }"
|
v-slot:[colConfig.customHeadSlot]="{ column }"
|
||||||
>
|
>
|
||||||
<div v-if="colConfig.customHeadSlot" :key="index">
|
<div v-if="colConfig.customHeadSlot" :key="index"> {{ column }} {{ colConfig }} </div>
|
||||||
{{ column }} {{ colConfig }}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template
|
<template
|
||||||
@ -168,7 +166,16 @@
|
|||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</a>
|
</a>
|
||||||
<span v-if="row.status === 'DRAFT' && hasReportEditPermission() && row.returnNum === 0" style="width: 6px; display: inline-block"></span>
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
|
<a
|
||||||
|
v-if="row.status === 'DRAFT' && hasReportEditPermission() && row.returnNum > 0"
|
||||||
|
href="javascript:void(0)"
|
||||||
|
class="el-link el-link--primary"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
重新发起
|
||||||
|
</a>
|
||||||
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
<!-- <a
|
<!-- <a
|
||||||
v-if="row.status === 'APPROVING'"
|
v-if="row.status === 'APPROVING'"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
@ -232,14 +239,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -272,11 +272,6 @@
|
|||||||
label-width="150px"
|
label-width="150px"
|
||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="22">
|
|
||||||
<el-form-item label="流程主题" prop="processTitle">
|
|
||||||
<el-input v-model="createFormData.processTitle" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="标题名称" prop="title">
|
<el-form-item label="标题名称" prop="title">
|
||||||
<el-input v-model="createFormData.title" placeholder="请输入" />
|
<el-input v-model="createFormData.title" placeholder="请输入" />
|
||||||
@ -369,7 +364,7 @@
|
|||||||
选择文件
|
选择文件
|
||||||
</el-button>
|
</el-button>
|
||||||
<div slot="tip" class="el-upload__tip">
|
<div slot="tip" class="el-upload__tip">
|
||||||
支持扩展名: .doc .docx .pdf .xls .xlsx .ppt .pptx,仅支持上传一个文件
|
支持扩展名: .doc .pdf .xls .xlsx .ppt .pptx,仅支持上传一个文件
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -381,6 +376,15 @@
|
|||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- 流程主题 -->
|
||||||
|
<el-form-item label="流程主题" prop="processTitle">
|
||||||
|
<el-input
|
||||||
|
v-model="createFormData.processTitle"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入流程主题"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<!-- 审批环节 -->
|
<!-- 审批环节 -->
|
||||||
<el-form-item label="审批环节" prop="approvalWorkflowSteps">
|
<el-form-item label="审批环节" prop="approvalWorkflowSteps">
|
||||||
<div class="approval-workflow">
|
<div class="approval-workflow">
|
||||||
@ -460,9 +464,7 @@
|
|||||||
>
|
>
|
||||||
<div class="dialog-body-wrapper">
|
<div class="dialog-body-wrapper">
|
||||||
<div class="approval-process-title">
|
<div class="approval-process-title">
|
||||||
<div class="description-label">
|
<div class="description-label"> 流程主题 <span class="required-mark">*</span> </div>
|
||||||
流程主题 <span class="required-mark">*</span>
|
|
||||||
</div>
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="launchProcessTitle"
|
v-model="launchProcessTitle"
|
||||||
maxlength="100"
|
maxlength="100"
|
||||||
@ -618,7 +620,6 @@ export default {
|
|||||||
dialogMode: 'create', // 'create' 表示新增,'edit' 表示修改,'restart' 表示重新发起
|
dialogMode: 'create', // 'create' 表示新增,'edit' 表示修改,'restart' 表示重新发起
|
||||||
currentRestartRow: null, // 当前要重新发起的行数据
|
currentRestartRow: null, // 当前要重新发起的行数据
|
||||||
currentEditRow: null, // 当前要修改的行数据
|
currentEditRow: null, // 当前要修改的行数据
|
||||||
originalProcessTitle: '', // 保存编辑前的原始流程主题
|
|
||||||
launchDialogVisible: false, // 发起弹窗显示状态
|
launchDialogVisible: false, // 发起弹窗显示状态
|
||||||
currentLaunchRow: null, // 当前要发起的行数据
|
currentLaunchRow: null, // 当前要发起的行数据
|
||||||
launchProcessTitle: '',
|
launchProcessTitle: '',
|
||||||
@ -728,8 +729,7 @@ export default {
|
|||||||
currentApprovalRow: null,
|
currentApprovalRow: null,
|
||||||
showReportDetail: false,
|
showReportDetail: false,
|
||||||
currentReportDetail: null,
|
currentReportDetail: null,
|
||||||
downloadingRowId: '',
|
downloadingRowId: ''
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -737,12 +737,12 @@ export default {
|
|||||||
return {
|
return {
|
||||||
rowDraggable: false,
|
rowDraggable: false,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{ prop: 'title', label: '标题', showOverflowTooltip: true, minWidth: '120' },
|
{ prop: 'title', label: '标题', showOverflowTooltip: true, minWidth: '140' },
|
||||||
{
|
{
|
||||||
prop: 'manufacturerName',
|
prop: 'manufacturerName',
|
||||||
label: '厂家名称',
|
label: '厂家名称',
|
||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
minWidth: '140'
|
minWidth: '160'
|
||||||
},
|
},
|
||||||
{ prop: 'productNumber', label: '产品型号', showOverflowTooltip: true, minWidth: '160' },
|
{ prop: 'productNumber', label: '产品型号', showOverflowTooltip: true, minWidth: '160' },
|
||||||
{ prop: 'module', label: '领域/模块', showOverflowTooltip: true, minWidth: '120' },
|
{ prop: 'module', label: '领域/模块', showOverflowTooltip: true, minWidth: '120' },
|
||||||
@ -765,7 +765,7 @@ export default {
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
customSlot: 'options',
|
customSlot: 'options',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200',
|
width: '160',
|
||||||
fixed: 'right'
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -775,35 +775,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
this.loadUserSelfRole()
|
||||||
if (this.hasViewPermission()) {
|
this.loadData()
|
||||||
this.canViewData = true
|
},
|
||||||
this.loadData()
|
mounted() {
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
this.loadUserSelfRole()
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
// 检查是否是管理员(isAdmin === 1)
|
||||||
@ -824,31 +802,6 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "对标报告" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('对标报告')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有报告的编辑权限
|
// 检查是否有报告的编辑权限
|
||||||
hasReportEditPermission() {
|
hasReportEditPermission() {
|
||||||
// 如果是管理员,拥有全部权限
|
// 如果是管理员,拥有全部权限
|
||||||
@ -864,11 +817,15 @@ export default {
|
|||||||
if (!Array.isArray(permissionData)) {
|
if (!Array.isArray(permissionData)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 检查是否有 permissionPath 为 "对标报告" 且 parameterPer 是编辑的权限
|
// 检查是否有 permissionPath 为 "报告" 且 parameterPer 是编辑的权限
|
||||||
|
// parameterPer 可能是数字 2 或字符串 "编辑" 或 "2"
|
||||||
return permissionData.some((perm) => {
|
return permissionData.some((perm) => {
|
||||||
const permissionPath = perm.permissionPath || ''
|
const permissionPath = perm.permissionPath || ''
|
||||||
const parameterPer = perm.parameterPer || ''
|
const parameterPer = perm.parameterPer
|
||||||
return permissionPath === '对标报告' && parameterPer === '编辑'
|
return (
|
||||||
|
permissionPath === '对标报告' &&
|
||||||
|
(parameterPer === 2 || parameterPer === '2' || parameterPer === '编辑')
|
||||||
|
)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('检查报告编辑权限失败:', err)
|
console.error('检查报告编辑权限失败:', err)
|
||||||
@ -884,26 +841,19 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 将权限数据存储到 localStorage
|
// 将权限数据存储到 localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
reject(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
@ -966,8 +916,6 @@ export default {
|
|||||||
this.dialogMode = 'edit'
|
this.dialogMode = 'edit'
|
||||||
this.currentEditRow = row
|
this.currentEditRow = row
|
||||||
this.currentRestartRow = null
|
this.currentRestartRow = null
|
||||||
// 保存原始流程主题
|
|
||||||
this.originalProcessTitle = row.processTitle || ''
|
|
||||||
// 填充当前行的数据到表单
|
// 填充当前行的数据到表单
|
||||||
this.createFormData = {
|
this.createFormData = {
|
||||||
title: row.title || '',
|
title: row.title || '',
|
||||||
@ -1479,34 +1427,10 @@ export default {
|
|||||||
this.currentEditRow &&
|
this.currentEditRow &&
|
||||||
this.currentEditRow.returnNum === 0
|
this.currentEditRow.returnNum === 0
|
||||||
) {
|
) {
|
||||||
// 修改:先检查流程主题是否被修改,如果修改了则先调用 EDIT_APPROVAL_PROCESS_TITLE 接口
|
// 修改:调用 EDIT_REPORT 接口
|
||||||
const reportId = this.currentEditRow.reportId || this.currentEditRow.id
|
const reportId = this.currentEditRow.reportId || this.currentEditRow.id
|
||||||
const currentProcessTitle = (this.createFormData.processTitle || '').trim()
|
// 构建审批环节数据
|
||||||
const originalProcessTitle = (this.originalProcessTitle || '').trim()
|
|
||||||
|
|
||||||
// 如果流程主题被修改,先调用 EDIT_APPROVAL_PROCESS_TITLE 接口
|
|
||||||
if (currentProcessTitle !== originalProcessTitle && this.currentEditRow.flowId) {
|
|
||||||
const updateTitleRequest = {
|
|
||||||
...api.EDIT_APPROVAL_PROCESS_TITLE,
|
|
||||||
params: {
|
|
||||||
flowId: this.currentEditRow.flowId,
|
|
||||||
title: currentProcessTitle
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
// 先调用更新流程主题接口,成功后再调用编辑报告接口
|
|
||||||
await this.$request(updateTitleRequest)
|
|
||||||
.asyncThen(() => {
|
|
||||||
console.log('流程主题更新成功')
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('更新流程主题失败:', err)
|
|
||||||
this.$message.error('更新流程主题失败,请重试')
|
|
||||||
throw err
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建审批环节数据,然后调用 EDIT_REPORT 接口
|
|
||||||
request = {
|
request = {
|
||||||
...api.EDIT_REPORT,
|
...api.EDIT_REPORT,
|
||||||
params: {
|
params: {
|
||||||
@ -1934,13 +1858,10 @@ export default {
|
|||||||
this.showReportDetail = false
|
this.showReportDetail = false
|
||||||
this.currentReportDetail = null
|
this.currentReportDetail = null
|
||||||
},
|
},
|
||||||
handleReportDetailRefresh(payload) {
|
handleReportDetailRefresh() {
|
||||||
// 刷新列表数据
|
// 刷新列表数据
|
||||||
this.loadData()
|
this.loadData()
|
||||||
// 默认关闭详情页;保存场景需要停留在详情页
|
// 关闭详情页
|
||||||
if (payload && payload.keepOpen) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.closeReportDetail()
|
this.closeReportDetail()
|
||||||
},
|
},
|
||||||
currentChange(currentPage) {
|
currentChange(currentPage) {
|
||||||
|
|||||||
@ -26,10 +26,10 @@
|
|||||||
>
|
>
|
||||||
直送
|
直送
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="handleLaunch">
|
<el-button v-else @click="handleLaunch">
|
||||||
发起
|
发起
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="hasOperationPermission()" type="primary" @click="handleEdit">
|
<el-button type="primary" @click="handleEdit">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -42,9 +42,9 @@
|
|||||||
直送
|
直送
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="handleResendApproval">
|
<el-button @click="handleResendApproval">
|
||||||
发起
|
重新发起
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="hasOperationPermission()" type="primary" @click="handleEdit">
|
<el-button type="primary" @click="handleEdit">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -53,7 +53,10 @@
|
|||||||
<el-button @click="handleCancelEdit">
|
<el-button @click="handleCancelEdit">
|
||||||
返回
|
返回
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" :loading="saving" @click="handleSave">
|
<el-button v-if="canResend" type="primary" @click="handleResendApproval">
|
||||||
|
重新发起
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" :loading="saving" @click="handleSave">
|
||||||
保存
|
保存
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -327,12 +330,73 @@
|
|||||||
</template>
|
</template>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- 审批流程 -->
|
||||||
|
<section v-if="reportDetail.status && reportDetail.status !== 'DRAFT' && detail.flowId" class="block-section">
|
||||||
|
<div class="section-title">
|
||||||
|
审批流程
|
||||||
|
</div>
|
||||||
|
<div v-if="timelineNodes && timelineNodes.length > 0" class="approval-timeline">
|
||||||
|
<el-timeline>
|
||||||
|
<el-timeline-item
|
||||||
|
v-for="(node, index) in timelineNodes"
|
||||||
|
:key="index"
|
||||||
|
:color="getTimelineColor(node.result || node.status, index, timelineNodes.length)"
|
||||||
|
>
|
||||||
|
<div class="timeline-item-content">
|
||||||
|
<div class="node-title">
|
||||||
|
{{ node.title }}
|
||||||
|
</div>
|
||||||
|
<div class="node-content">
|
||||||
|
<div class="node-info">
|
||||||
|
<div class="node-user">
|
||||||
|
{{ node.userName || '--' }}
|
||||||
|
<span class="node-time">
|
||||||
|
{{ formatTime(node.operateTime) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="node-status" :class="getStatusClass(node.result || node.status)">
|
||||||
|
{{ setStatusText(node.result || node.status) }}
|
||||||
|
</div>
|
||||||
|
<div v-if="node.opinion" class="node-opinion">
|
||||||
|
审批意见:{{ node.opinion }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-timeline-item>
|
||||||
|
</el-timeline>
|
||||||
|
</div>
|
||||||
|
<div v-else class="empty-progress">
|
||||||
|
<span class="empty-text">暂无审批流程数据</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- 审批环节(草稿状态下显示) -->
|
<!-- 审批环节(草稿状态下显示) -->
|
||||||
<section v-if="reportDetail.status === 'DRAFT' || reportDetail.status === 'REJECTED'" class="block-section">
|
<section v-if="reportDetail.status === 'DRAFT'" class="block-section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
审批环节
|
审批环节
|
||||||
</div>
|
</div>
|
||||||
<div class="approval-workflow">
|
<div class="approval-workflow">
|
||||||
|
<!-- 流程主题 -->
|
||||||
|
<div class="approval-process-title">
|
||||||
|
<div class="description-label">
|
||||||
|
流程主题 <span class="required-mark">*</span>
|
||||||
|
</div>
|
||||||
|
<!-- 只读模式:显示流程主题 -->
|
||||||
|
<template v-if="!isEditMode">
|
||||||
|
<div class="process-title-display">
|
||||||
|
{{ reportDetail.processTitle || showTopDetail.processTitle || editFormData.processTitle || '--' }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<!-- 编辑模式:可编辑的输入框 -->
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
v-model="editFormData.processTitle"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入流程主题"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="workflow-table">
|
<div class="workflow-table">
|
||||||
<table class="workflow-table-content">
|
<table class="workflow-table-content">
|
||||||
<thead>
|
<thead>
|
||||||
@ -397,47 +461,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- 审批流程 -->
|
|
||||||
<section v-if="reportDetail.status && reportDetail.status !== 'DRAFT' && detail.flowId && !isEditMode" class="block-section">
|
|
||||||
<div class="section-title">
|
|
||||||
审批流程
|
|
||||||
</div>
|
|
||||||
<div v-if="timelineNodes && timelineNodes.length > 0" class="approval-timeline">
|
|
||||||
<el-timeline>
|
|
||||||
<el-timeline-item
|
|
||||||
v-for="(node, index) in timelineNodes"
|
|
||||||
:key="index"
|
|
||||||
:color="getTimelineColor(node.result || node.status, index, timelineNodes.length)"
|
|
||||||
>
|
|
||||||
<div class="timeline-item-content">
|
|
||||||
<div class="node-title">
|
|
||||||
{{ node.title }}
|
|
||||||
</div>
|
|
||||||
<div class="node-content">
|
|
||||||
<div class="node-info">
|
|
||||||
<div class="node-user">
|
|
||||||
{{ node.userName || '--' }}
|
|
||||||
<span class="node-time">
|
|
||||||
{{ formatTime(node.operateTime) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="node-status" :class="getStatusClass(node.result || node.status)">
|
|
||||||
{{ setStatusText(node.result || node.status) }}
|
|
||||||
</div>
|
|
||||||
<div v-if="node.opinion" class="node-opinion">
|
|
||||||
审批意见:{{ node.opinion }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-timeline-item>
|
|
||||||
</el-timeline>
|
|
||||||
</div>
|
|
||||||
<div v-else class="empty-progress">
|
|
||||||
<span class="empty-text">暂无审批流程数据</span>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -496,8 +519,8 @@
|
|||||||
>
|
>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<!-- 当选择"编制"节点时,显示意见输入框 -->
|
<!-- 当选择"发起审批"节点时,显示意见输入框 -->
|
||||||
<div v-if="selectedReturnNode === '编制'" class="return-opinion-section">
|
<div v-if="selectedReturnNode === '发起审批'" class="return-opinion-section">
|
||||||
<div class="opinion-label">
|
<div class="opinion-label">
|
||||||
退回意见:
|
退回意见:
|
||||||
</div>
|
</div>
|
||||||
@ -578,7 +601,7 @@ export default {
|
|||||||
returnableNodes: [],
|
returnableNodes: [],
|
||||||
selectedReturnNode: '',
|
selectedReturnNode: '',
|
||||||
returnSubmitting: false,
|
returnSubmitting: false,
|
||||||
returnOpinion: '拒绝', // 退回意见(仅在选择编制节点时使用)
|
returnOpinion: '', // 退回意见(仅在选择发起审批节点时使用)
|
||||||
isEditMode: false, // 编辑模式
|
isEditMode: false, // 编辑模式
|
||||||
editFormData: {
|
editFormData: {
|
||||||
title: '',
|
title: '',
|
||||||
@ -606,10 +629,6 @@ export default {
|
|||||||
saving: false, // 保存中状态
|
saving: false, // 保存中状态
|
||||||
isEditingProcessTitle: false, // 是否正在编辑流程主题
|
isEditingProcessTitle: false, // 是否正在编辑流程主题
|
||||||
editingProcessTitle: '', // 正在编辑的流程主题值
|
editingProcessTitle: '', // 正在编辑的流程主题值
|
||||||
approvalFlowIdFromUsers: '', // 从审批人员接口获取的流程ID
|
|
||||||
approvalCanSend: false, // 审批人员接口返回的是否可继续发起标识
|
|
||||||
// 保存时对比快照(不依赖watch/change)
|
|
||||||
originalEditSnapshot: null, // 进入编辑态并完成回填后的快照
|
|
||||||
approvalWorkflowSteps: [
|
approvalWorkflowSteps: [
|
||||||
{
|
{
|
||||||
name: '校对',
|
name: '校对',
|
||||||
@ -665,7 +684,7 @@ export default {
|
|||||||
let processedNodes = this.flowNodes
|
let processedNodes = this.flowNodes
|
||||||
if (rejectIndex !== -1) {
|
if (rejectIndex !== -1) {
|
||||||
// 如果有 REJECT 节点,删除该节点后面的所有节点
|
// 如果有 REJECT 节点,删除该节点后面的所有节点
|
||||||
// processedNodes = this.flowNodes.slice(0, rejectIndex + 1)
|
processedNodes = this.flowNodes.slice(0, rejectIndex + 1)
|
||||||
} else {
|
} else {
|
||||||
// 如果没有 REJECT,将第一个 result 是"待审批"的节点改为 APPROVING
|
// 如果没有 REJECT,将第一个 result 是"待审批"的节点改为 APPROVING
|
||||||
const stayIndex = processedNodes.findIndex((node) => node.result === '待审批')
|
const stayIndex = processedNodes.findIndex((node) => node.result === '待审批')
|
||||||
@ -726,6 +745,22 @@ export default {
|
|||||||
opinion: opinion
|
opinion: opinion
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
} else if (this.progress && this.progress.length > 0) {
|
||||||
|
// 兼容旧逻辑:如果没有 flowNodes,则使用原来的 progress 数据
|
||||||
|
this.progress.forEach((stage) => {
|
||||||
|
if (stage.steps && stage.steps.length > 0) {
|
||||||
|
stage.steps.forEach((step) => {
|
||||||
|
nodes.push({
|
||||||
|
title: stage.title || '审批节点',
|
||||||
|
userName: step.userName,
|
||||||
|
operateTime: step.approvalTime || step.handleTime || step.createTime,
|
||||||
|
result: step.result || step.status,
|
||||||
|
status: step.result || step.status,
|
||||||
|
opinion: step.opinion || step.remark || step.comment || null
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodes
|
return nodes
|
||||||
@ -782,87 +817,8 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.getReportDetailProcess()
|
// this.getReportDetailProcess()
|
||||||
// 加载用户权限
|
|
||||||
this.loadUserSelfRole()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 加载用户自身角色权限
|
|
||||||
loadUserSelfRole() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_USER_SELF_ROLE,
|
|
||||||
params: {
|
|
||||||
userOrDepID: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 将权限数据存储到 localStorage
|
|
||||||
try {
|
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
|
||||||
} catch (err) {
|
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取用户自身角色失败:', err)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有全局编辑权限(permissionPath 是"对标报告"且 parameterPer 是"编辑")
|
|
||||||
hasGlobalEditPermission() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 permissionPath 为 "对标报告" 且 parameterPer 为 "编辑" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
const parameterPer = perm.parameterPer || ''
|
|
||||||
// 检查 permissionPath 是否等于 "对标报告"(不包含其他路径)
|
|
||||||
return permissionPath === '对标报告' && parameterPer === '编辑'
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查全局编辑权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有操作权限(管理员或全局编辑权限)
|
|
||||||
hasOperationPermission() {
|
|
||||||
// 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// 如果有全局编辑权限,拥有全部权限
|
|
||||||
if (this.hasGlobalEditPermission()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
setStatusText(result) {
|
setStatusText(result) {
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
'PASS': '通过',
|
'PASS': '通过',
|
||||||
@ -1025,16 +981,11 @@ export default {
|
|||||||
templateVersion: data.templateVersion || '',
|
templateVersion: data.templateVersion || '',
|
||||||
contentName: data.contentName || ''
|
contentName: data.contentName || ''
|
||||||
}
|
}
|
||||||
this.reportDetail.processTitle = data.progressTitle
|
|
||||||
// 如果 flowStatus 是 REJECTED,强制设置当前环节为"草稿",当前处理人为创建人
|
// 如果 flowStatus 是 REJECTED,强制设置当前环节为"草稿",当前处理人为创建人
|
||||||
const flowStatus = data.flowStatus || ''
|
const flowStatus = data.flowStatus || ''
|
||||||
const createBy = data.createBy || ''
|
const createBy = data.createBy || ''
|
||||||
if (flowStatus) {
|
|
||||||
// 将报告状态与流程状态保持一致
|
|
||||||
this.$set(this.reportDetail, 'status', flowStatus)
|
|
||||||
}
|
|
||||||
this.showTopDetail = {
|
this.showTopDetail = {
|
||||||
processTitle: data.progressTitle,
|
processTitle: data.progressTitle || '',
|
||||||
createBy: createBy,
|
createBy: createBy,
|
||||||
createTime: data.createTime || '',
|
createTime: data.createTime || '',
|
||||||
currentNode: flowStatus === 'REJECTED' ? '编制' : (data.currentNode || ''),
|
currentNode: flowStatus === 'REJECTED' ? '编制' : (data.currentNode || ''),
|
||||||
@ -1077,35 +1028,30 @@ export default {
|
|||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log(resp)
|
console.log(resp)
|
||||||
// 在列表最前面添加"编制"节点作为默认选项
|
// 在列表最前面添加"发起审批"节点作为默认选项
|
||||||
const nodes = Array.isArray(resp.data) ? resp.data : []
|
const nodes = Array.isArray(resp.data) ? resp.data : []
|
||||||
this.returnableNodes = ['编制', ...nodes]
|
this.returnableNodes = ['发起审批', ...nodes]
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取退回节点失败:', err)
|
console.error('获取退回节点失败:', err)
|
||||||
// 即使获取失败,也添加"编制"节点
|
// 即使获取失败,也添加"发起审批"节点
|
||||||
this.returnableNodes = ['编制']
|
this.returnableNodes = ['发起审批']
|
||||||
})
|
})
|
||||||
this.selectedReturnNode = ''
|
this.selectedReturnNode = ''
|
||||||
this.returnOpinion = '拒绝'
|
this.returnOpinion = ''
|
||||||
this.returnNodeDialogVisible = true
|
this.returnNodeDialogVisible = true
|
||||||
},
|
},
|
||||||
// 关闭退回节点选择弹窗
|
// 关闭退回节点选择弹窗
|
||||||
handleReturnNodeDialogClose() {
|
handleReturnNodeDialogClose() {
|
||||||
this.returnNodeDialogVisible = false
|
this.returnNodeDialogVisible = false
|
||||||
this.selectedReturnNode = ''
|
this.selectedReturnNode = ''
|
||||||
this.returnOpinion = '拒绝'
|
this.returnOpinion = ''
|
||||||
},
|
},
|
||||||
// 处理退回节点选择变化
|
// 处理退回节点选择变化
|
||||||
handleReturnNodeChange() {
|
handleReturnNodeChange() {
|
||||||
// 如果不是"编制"节点,清空意见
|
// 如果不是"发起审批"节点,清空意见
|
||||||
if (this.selectedReturnNode !== '编制') {
|
if (this.selectedReturnNode !== '发起审批') {
|
||||||
this.returnOpinion = ''
|
this.returnOpinion = ''
|
||||||
} else {
|
|
||||||
// 如果选择"编制"节点,设置默认值为"拒绝"
|
|
||||||
if (!this.returnOpinion) {
|
|
||||||
this.returnOpinion = '拒绝'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 提交退回操作
|
// 提交退回操作
|
||||||
@ -1122,8 +1068,8 @@ export default {
|
|||||||
|
|
||||||
this.returnSubmitting = true
|
this.returnSubmitting = true
|
||||||
|
|
||||||
// 如果选择的是"编制"节点,调用拒绝接口
|
// 如果选择的是"发起审批"节点,调用拒绝接口
|
||||||
if (this.selectedReturnNode === '编制') {
|
if (this.selectedReturnNode === '发起审批') {
|
||||||
const submitData = {
|
const submitData = {
|
||||||
flowId: this.detail.flowId,
|
flowId: this.detail.flowId,
|
||||||
userId: getUserId(),
|
userId: getUserId(),
|
||||||
@ -1428,8 +1374,7 @@ export default {
|
|||||||
// 发起功能:直接调用发起接口(按照report.vue的方式)
|
// 发起功能:直接调用发起接口(按照report.vue的方式)
|
||||||
handleLaunch() {
|
handleLaunch() {
|
||||||
const reportId = this.reportDetail.reportId || this.reportDetail.id || this.detail.reportId || this.detail.id
|
const reportId = this.reportDetail.reportId || this.reportDetail.id || this.detail.reportId || this.detail.id
|
||||||
const flowId = this.approvalFlowIdFromUsers || this.detail.flowId || this.reportDetail.flowId
|
const flowId = this.detail.flowId || this.reportDetail.flowId
|
||||||
const canSend = this.canResend
|
|
||||||
|
|
||||||
if (!reportId) {
|
if (!reportId) {
|
||||||
this.$message.error('缺少报告ID,无法发起审批')
|
this.$message.error('缺少报告ID,无法发起审批')
|
||||||
@ -1447,34 +1392,16 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let request = null
|
|
||||||
if (canSend) {
|
|
||||||
// 可继续发起时,调用继续审批接口,使用审批人员接口返回的 flowId
|
|
||||||
const continueFlowId = this.approvalFlowIdFromUsers || flowId
|
|
||||||
if (!continueFlowId) {
|
|
||||||
this.$message.error('缺少流程ID,无法继续发起审批')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
request = {
|
|
||||||
...api.CONTINUE_REPORT_APPROVAL,
|
|
||||||
params: {
|
|
||||||
flowId: continueFlowId,
|
|
||||||
userId: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const submitData = {
|
const submitData = {
|
||||||
reportId: reportId,
|
reportId: reportId,
|
||||||
flowId: flowId,
|
flowId: flowId,
|
||||||
userId: getUserId()
|
userId: getUserId()
|
||||||
}
|
}
|
||||||
request = {
|
const request = {
|
||||||
...api.ADD_REPORT,
|
...api.ADD_REPORT,
|
||||||
params: submitData,
|
params: submitData,
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.launching = true
|
this.launching = true
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
@ -1528,7 +1455,6 @@ export default {
|
|||||||
reportId: reportId,
|
reportId: reportId,
|
||||||
...this.editFormData,
|
...this.editFormData,
|
||||||
flowId: '',
|
flowId: '',
|
||||||
title: this.editingProcessTitle || '',
|
|
||||||
processTitle: this.editFormData.processTitle || '',
|
processTitle: this.editFormData.processTitle || '',
|
||||||
explanation: '',
|
explanation: '',
|
||||||
nodeList: nodeList,
|
nodeList: nodeList,
|
||||||
@ -1573,7 +1499,7 @@ export default {
|
|||||||
// 加载审批人(用于草稿状态显示和编辑模式)
|
// 加载审批人(用于草稿状态显示和编辑模式)
|
||||||
loadApprovalUsers(flowId) {
|
loadApprovalUsers(flowId) {
|
||||||
if (!flowId) {
|
if (!flowId) {
|
||||||
return Promise.resolve()
|
return
|
||||||
}
|
}
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_REPORT_APPROVAL_USERS,
|
...api.GET_REPORT_APPROVAL_USERS,
|
||||||
@ -1582,47 +1508,15 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log('获取审批流程信息:', resp)
|
console.log('获取审批流程信息:', resp)
|
||||||
// 记录可继续发起的标识及流程ID
|
|
||||||
const meta = this.parseApprovalUsersMeta(resp)
|
|
||||||
this.approvalCanSend = !!meta.canSend
|
|
||||||
this.approvalFlowIdFromUsers = meta.flowId || flowId || ''
|
|
||||||
// 同步流程主题(接口返回为准)
|
|
||||||
if (meta.title) {
|
|
||||||
this.reportDetail.processTitle = meta.title
|
|
||||||
this.showTopDetail.processTitle = meta.title
|
|
||||||
// 编辑态下也同步到表单,避免保存后显示旧值
|
|
||||||
if (this.isEditMode) {
|
|
||||||
this.editFormData.processTitle = meta.title
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.fillApprovalUsersData(resp, this.approvalWorkflowSteps)
|
this.fillApprovalUsersData(resp, this.approvalWorkflowSteps)
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取审批流程信息失败:', err)
|
console.error('获取审批流程信息失败:', err)
|
||||||
throw err
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 提取审批人员接口返回的流程ID/流程主题与可发起标识
|
|
||||||
parseApprovalUsersMeta(resp) {
|
|
||||||
const meta = { flowId: '', canSend: false, title: '' }
|
|
||||||
const candidate = resp?.data ?? resp
|
|
||||||
const pickFrom = (obj) => {
|
|
||||||
if (!obj || Array.isArray(obj)) return
|
|
||||||
meta.flowId = meta.flowId || obj.flowId || obj.id || obj.flowid || ''
|
|
||||||
meta.canSend = meta.canSend || obj.canSend || obj.canResend || false
|
|
||||||
meta.title = meta.title || obj.progressTitle || obj.processTitle || obj.title || ''
|
|
||||||
}
|
|
||||||
if (candidate && !Array.isArray(candidate)) {
|
|
||||||
pickFrom(candidate)
|
|
||||||
if (candidate.data && !Array.isArray(candidate.data)) {
|
|
||||||
pickFrom(candidate.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return meta
|
|
||||||
},
|
|
||||||
// 填充审批人数据(按照report.vue的逻辑)
|
// 填充审批人数据(按照report.vue的逻辑)
|
||||||
fillApprovalUsersData(resp, workflowSteps) {
|
fillApprovalUsersData(resp, workflowSteps) {
|
||||||
// 提取节点列表
|
// 提取节点列表
|
||||||
@ -1775,16 +1669,13 @@ export default {
|
|||||||
},
|
},
|
||||||
// 处理人员选择变化(用于编辑模式)
|
// 处理人员选择变化(用于编辑模式)
|
||||||
handleHandlerChange(stepIndex, selectedIds) {
|
handleHandlerChange(stepIndex, selectedIds) {
|
||||||
// 提交时通过快照对比判断是否变化
|
// 处理人员选择变化
|
||||||
},
|
},
|
||||||
// 处理重新发起按钮点击(已拒绝状态)
|
// 处理重新发起按钮点击(已拒绝状态)
|
||||||
handleResendApproval() {
|
handleResendApproval() {
|
||||||
// 直接调用重新发起接口(
|
// 直接调用重新发起接口(
|
||||||
this.handleResatrtLaunch()
|
this.handleResatrtLaunch()
|
||||||
},
|
},
|
||||||
handleProcessTitleChange() {
|
|
||||||
// 提交时通过快照对比判断是否变化
|
|
||||||
},
|
|
||||||
// 加载审批人(用于发起弹窗,草稿和已拒绝状态)
|
// 加载审批人(用于发起弹窗,草稿和已拒绝状态)
|
||||||
loadLaunchApprovalUsers(flowId) {
|
loadLaunchApprovalUsers(flowId) {
|
||||||
if (!flowId) {
|
if (!flowId) {
|
||||||
@ -1809,7 +1700,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 修改功能:进入编辑模式
|
// 修改功能:进入编辑模式
|
||||||
async handleEdit() {
|
handleEdit() {
|
||||||
// 保存原始数据
|
// 保存原始数据
|
||||||
this.originalReportDetail = JSON.parse(JSON.stringify(this.reportDetail))
|
this.originalReportDetail = JSON.parse(JSON.stringify(this.reportDetail))
|
||||||
// 填充表单数据
|
// 填充表单数据
|
||||||
@ -1844,19 +1735,14 @@ export default {
|
|||||||
this.fileList = []
|
this.fileList = []
|
||||||
}
|
}
|
||||||
this.selectedFile = null
|
this.selectedFile = null
|
||||||
this.isEditMode = true
|
// 如果是草稿状态,确保审批人员已加载(如果还没有加载)
|
||||||
// 如果是草稿状态,确保审批人员/流程主题已回填后再记录快照(避免回填触发“误判修改”)
|
|
||||||
if (this.reportDetail.status === 'DRAFT') {
|
if (this.reportDetail.status === 'DRAFT') {
|
||||||
const flowId = this.detail.flowId || this.reportDetail.flowId
|
const flowId = this.detail.flowId || this.reportDetail.flowId
|
||||||
if (flowId) {
|
if (flowId && (!this.approvalWorkflowSteps[0].handlers || this.approvalWorkflowSteps[0].handlers.length === 0)) {
|
||||||
try {
|
this.loadApprovalUsers(flowId)
|
||||||
await this.loadApprovalUsers(flowId)
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
this.isEditMode = true
|
||||||
this.originalEditSnapshot = this.buildEditSnapshot()
|
|
||||||
},
|
},
|
||||||
// 取消编辑:恢复只读状态
|
// 取消编辑:恢复只读状态
|
||||||
handleCancelEdit() {
|
handleCancelEdit() {
|
||||||
@ -1884,7 +1770,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
this.selectedFile = null
|
this.selectedFile = null
|
||||||
this.originalEditSnapshot = null
|
|
||||||
this.isEditMode = false
|
this.isEditMode = false
|
||||||
// 清除表单验证
|
// 清除表单验证
|
||||||
if (this.$refs.editForm) {
|
if (this.$refs.editForm) {
|
||||||
@ -1977,73 +1862,20 @@ export default {
|
|||||||
this.submitEdit()
|
this.submitEdit()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buildEditSnapshot() {
|
|
||||||
const normalize = (v) => (v == null ? '' : v)
|
|
||||||
const normalizeSteps = (steps) =>
|
|
||||||
(steps || []).map((s) => ({
|
|
||||||
name: s.name,
|
|
||||||
handlers: (s.handlers || []).filter(Boolean).slice().sort()
|
|
||||||
}))
|
|
||||||
// 仅用于对比的字段集合
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
title: normalize(this.editFormData?.title),
|
|
||||||
manufacturerName: normalize(this.editFormData?.manufacturerName),
|
|
||||||
modelName: normalize(this.editFormData?.modelName),
|
|
||||||
manufacturerAbbreviation: normalize(this.editFormData?.manufacturerAbbreviation),
|
|
||||||
modelAbbreviation: normalize(this.editFormData?.modelAbbreviation),
|
|
||||||
productNumber: normalize(this.editFormData?.productNumber),
|
|
||||||
module: normalize(this.editFormData?.module),
|
|
||||||
plate: normalize(this.editFormData?.plate),
|
|
||||||
platform: normalize(this.editFormData?.platform),
|
|
||||||
series: normalize(this.editFormData?.series),
|
|
||||||
marketSegment: normalize(this.editFormData?.marketSegment),
|
|
||||||
projectName: normalize(this.editFormData?.projectName),
|
|
||||||
projectNumber: normalize(this.editFormData?.projectNumber),
|
|
||||||
explanation: normalize(this.editFormData?.explanation),
|
|
||||||
fileUrl: normalize(this.editFormData?.fileUrl),
|
|
||||||
fileName: normalize(this.editFormData?.fileName)
|
|
||||||
},
|
|
||||||
processTitle: (this.editFormData?.processTitle || '').trim(),
|
|
||||||
steps: normalizeSteps(this.approvalWorkflowSteps)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
diffEditSnapshot(original, current) {
|
|
||||||
const isSame = (a, b) => JSON.stringify(a) === JSON.stringify(b)
|
|
||||||
const baseChanged =
|
|
||||||
!original ||
|
|
||||||
!isSame(original.form, current.form) ||
|
|
||||||
!!this.selectedFile // 新选中文件一定算基础变更
|
|
||||||
const approvalChanged =
|
|
||||||
!original ||
|
|
||||||
original.processTitle !== current.processTitle ||
|
|
||||||
!isSame(original.steps, current.steps)
|
|
||||||
return { baseChanged, approvalChanged }
|
|
||||||
},
|
|
||||||
hasAnyEditChange() {
|
|
||||||
const current = this.buildEditSnapshot()
|
|
||||||
const { baseChanged, approvalChanged } = this.diffEditSnapshot(this.originalEditSnapshot, current)
|
|
||||||
return baseChanged || approvalChanged
|
|
||||||
},
|
|
||||||
// 提交编辑
|
// 提交编辑
|
||||||
submitEdit() {
|
submitEdit() {
|
||||||
const submitData = async () => {
|
const submitData = async () => {
|
||||||
try {
|
|
||||||
// 没有任何修改时,不调用接口
|
|
||||||
if (!this.hasAnyEditChange()) {
|
|
||||||
this.isEditMode = false
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '未修改,无需保存'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果有新文件,先上传文件获取文件路径
|
// 如果有新文件,先上传文件获取文件路径
|
||||||
if (this.selectedFile) {
|
if (this.selectedFile) {
|
||||||
|
try {
|
||||||
const fileUrl = await this.handleFileUpload()
|
const fileUrl = await this.handleFileUpload()
|
||||||
this.editFormData.fileUrl = fileUrl || ''
|
this.editFormData.fileUrl = fileUrl || ''
|
||||||
this.editFormData.fileName = this.selectedFile.name
|
this.editFormData.fileName = this.selectedFile.name
|
||||||
|
} catch (err) {
|
||||||
|
console.error('文件上传失败:', err)
|
||||||
|
this.$message.error('文件上传失败,请重试')
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const reportId = this.reportDetail.reportId || this.reportDetail.id
|
const reportId = this.reportDetail.reportId || this.reportDetail.id
|
||||||
@ -2052,145 +1884,53 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const includeApprovalInSave = !this.canResend
|
// 如果是草稿状态,需要提交审批环节数据
|
||||||
const shouldUpdateApprovalProcess = this.canResend
|
|
||||||
|
|
||||||
const { processTitle, ...restForm } = this.editFormData
|
|
||||||
const params = {
|
const params = {
|
||||||
reportId: reportId,
|
reportId: reportId,
|
||||||
flowId: this.detail.flowId,
|
flowId: this.detail.flowId,
|
||||||
...restForm,
|
...this.editFormData,
|
||||||
createBy: getUserId(),
|
createBy: getUserId(),
|
||||||
userId: getUserId()
|
userId: getUserId()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeApprovalInSave) {
|
// 如果是草稿状态,添加审批环节数据
|
||||||
params.processTitle = processTitle || ''
|
if (this.reportDetail.status === 'DRAFT') {
|
||||||
params.nodeList = this.approvalWorkflowSteps.map((step, index) => ({
|
|
||||||
nodeName: step.name,
|
|
||||||
assignees: step.handlers,
|
|
||||||
nodeOrder: index + 1
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
this.saving = true
|
|
||||||
// 提交时对比快照判断是否有变化(不依赖watch/change)
|
|
||||||
const currentSnap = this.buildEditSnapshot()
|
|
||||||
const { baseChanged, approvalChanged } = this.diffEditSnapshot(this.originalEditSnapshot, currentSnap)
|
|
||||||
// 当 canResend 为 true 时(shouldUpdateApprovalProcess 为 true),审批环节和流程主题的修改应该走 updateApprovalProcess
|
|
||||||
// 当 canResend 为 false 时(includeApprovalInSave 为 true),审批环节和流程主题的修改应该包含在 EDIT_REPORT 中
|
|
||||||
const needUpdateApprovalProcess =
|
|
||||||
shouldUpdateApprovalProcess && approvalChanged
|
|
||||||
// 判断是否需要调用 EDIT_REPORT:
|
|
||||||
// 1. 如果有基础变化(文件或表单字段),需要调用 EDIT_REPORT
|
|
||||||
// 2. 如果 includeApprovalInSave 为 true 且有审批变化,需要调用 EDIT_REPORT(将审批数据包含在保存中)
|
|
||||||
// 3. 如果 shouldUpdateApprovalProcess 为 true 且只有审批变化(没有基础变化),不应该调用 EDIT_REPORT
|
|
||||||
const shouldOnlyUpdateApprovalProcess = shouldUpdateApprovalProcess && approvalChanged && !baseChanged
|
|
||||||
const needUpdateReportBase =
|
|
||||||
!shouldOnlyUpdateApprovalProcess && (
|
|
||||||
baseChanged ||
|
|
||||||
(includeApprovalInSave && approvalChanged)
|
|
||||||
)
|
|
||||||
|
|
||||||
// 如果是草稿状态(includeApprovalInSave 为 true)且流程主题被修改,先调用 EDIT_APPROVAL_PROCESS_TITLE
|
|
||||||
if (includeApprovalInSave && approvalChanged && this.detail.flowId) {
|
|
||||||
const originalProcessTitle = (this.originalEditSnapshot?.processTitle || '').trim()
|
|
||||||
const currentProcessTitle = (currentSnap.processTitle || '').trim()
|
|
||||||
if (originalProcessTitle !== currentProcessTitle) {
|
|
||||||
const updateTitleRequest = {
|
|
||||||
...api.EDIT_APPROVAL_PROCESS_TITLE,
|
|
||||||
params: {
|
|
||||||
flowId: this.detail.flowId,
|
|
||||||
title: currentProcessTitle
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
// 先调用更新流程主题接口,成功后再调用编辑报告接口
|
|
||||||
await this.$request(updateTitleRequest)
|
|
||||||
.asyncThen(() => {
|
|
||||||
console.log('流程主题更新成功')
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('更新流程主题失败:', err)
|
|
||||||
this.$message.error('更新流程主题失败,请重试')
|
|
||||||
throw err
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needUpdateReportBase) {
|
|
||||||
console.log('needUpdateReportBase', needUpdateReportBase)
|
|
||||||
const request = {
|
|
||||||
...api.EDIT_REPORT,
|
|
||||||
params: params,
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
await this.$request(request).asyncThen(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needUpdateApprovalProcess) {
|
|
||||||
console.log('needUpdateApprovalProcess', needUpdateApprovalProcess)
|
|
||||||
await this.updateApprovalProcess()
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isEditMode = false
|
|
||||||
// 重新加载详情 + 草稿时刷新审批环节/流程主题(对齐 handleResatrtLaunch 的“重新获取”效果)
|
|
||||||
const currentFlowId = this.detail.flowId || this.reportDetail.flowId
|
|
||||||
this.loadReportDetailFromApi(reportId, currentFlowId)
|
|
||||||
if (this.reportDetail.status === 'DRAFT' && currentFlowId) {
|
|
||||||
// 重新获取审批环节与流程主题
|
|
||||||
this.loadApprovalUsers(currentFlowId)
|
|
||||||
}
|
|
||||||
// 更新快照(保存后以当前值为基准)
|
|
||||||
this.originalEditSnapshot = this.buildEditSnapshot()
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '保存成功'
|
|
||||||
})
|
|
||||||
// 触发刷新事件(保存后不返回上一级)
|
|
||||||
this.$emit('refresh', { keepOpen: true })
|
|
||||||
} catch (err) {
|
|
||||||
console.error('保存失败:', err)
|
|
||||||
this.$message.error(err?.message || '保存失败,请重试')
|
|
||||||
} finally {
|
|
||||||
this.saving = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
submitData()
|
|
||||||
},
|
|
||||||
// 更新审批环节(直送模式下单独调用流程修改接口)
|
|
||||||
updateApprovalProcess() {
|
|
||||||
const flowId = this.detail.flowId || this.reportDetail.flowId
|
|
||||||
if (!flowId) {
|
|
||||||
this.$message.error('缺少流程ID,无法保存审批环节')
|
|
||||||
return Promise.reject(new Error('缺少流程ID'))
|
|
||||||
}
|
|
||||||
|
|
||||||
const nodeList = this.approvalWorkflowSteps.map((step, index) => ({
|
const nodeList = this.approvalWorkflowSteps.map((step, index) => ({
|
||||||
nodeName: step.name,
|
nodeName: step.name,
|
||||||
assignees: step.handlers,
|
assignees: step.handlers,
|
||||||
nodeOrder: index + 1
|
nodeOrder: index + 1
|
||||||
}))
|
}))
|
||||||
|
params.nodeList = nodeList
|
||||||
|
}
|
||||||
|
|
||||||
const request = {
|
const request = {
|
||||||
...api.EDIT_APPROVAL_PROCESS,
|
...api.EDIT_REPORT,
|
||||||
params: {
|
params: params,
|
||||||
nodeList: nodeList,
|
|
||||||
flowId: flowId,
|
|
||||||
title: this.editFormData.processTitle || '',
|
|
||||||
userId: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.$request(request)
|
this.saving = true
|
||||||
.asyncThen(() => {})
|
this.$request(request)
|
||||||
.asyncErrorCatch((err) => {
|
.asyncThen((resp) => {
|
||||||
console.error('更新审批环节失败:', err)
|
this.saving = false
|
||||||
this.$message.error(err?.message || '更新审批环节失败,请重试')
|
this.isEditMode = false
|
||||||
throw err
|
// 重新加载详情
|
||||||
|
this.loadReportDetailFromApi(reportId, this.detail.flowId)
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '保存成功'
|
||||||
})
|
})
|
||||||
|
// 触发刷新事件
|
||||||
|
this.$emit('refresh')
|
||||||
|
})
|
||||||
|
.asyncErrorCatch((err) => {
|
||||||
|
console.error('保存失败:', err)
|
||||||
|
this.saving = false
|
||||||
|
this.$message.error('保存失败,请重试')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
submitData()
|
||||||
},
|
},
|
||||||
// 开始编辑流程主题
|
// 开始编辑流程主题
|
||||||
handleEditProcessTitle() {
|
handleEditProcessTitle() {
|
||||||
@ -2666,6 +2406,32 @@ export default {
|
|||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.approval-process-title {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
.description-label {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
.required-mark {
|
||||||
|
color: #f56c6c;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.process-title-display {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #303133;
|
||||||
|
padding: 8px 12px;
|
||||||
|
background: #f5f7fa;
|
||||||
|
border-radius: 4px;
|
||||||
|
min-height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.approval-workflow {
|
.approval-workflow {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<div class="searched-field">
|
<div class="searched-field">
|
||||||
<span class="fielded-label">标题</span>
|
<span class="fielded-label">标题</span>
|
||||||
<el-input v-model="searchPanelValue.templateName" placeholder="请输入" />
|
<el-input v-model="searchPanelValue.template" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<div class="searched-field">
|
<div class="searched-field">
|
||||||
<span class="fielded-label">状态</span>
|
<span class="fielded-label">状态</span>
|
||||||
@ -183,14 +183,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -470,10 +463,10 @@ export default {
|
|||||||
status: ''
|
status: ''
|
||||||
},
|
},
|
||||||
statusOptions: [
|
statusOptions: [
|
||||||
{ id: 'DRAFT', label: '草稿',value: 'DRAFT' },
|
{ id: 'DRAFT', label: '草稿' },
|
||||||
{ id: 'APPROVING', label: '审核中',value: 'APPROVING' },
|
{ id: 'APPROVING', label: '审批中' },
|
||||||
{ id: 'COMPLETE', label: '已完成',value: 'COMPLETE' },
|
{ id: 'COMPLETE', label: '已完成' },
|
||||||
{ id: 'REJECTED', label: '已拒绝',value: 'REJECTED' }
|
{ id: 'REJECTED', label: '已拒绝' }
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
pagination: { currentPage: 1, pageSize: 10, total: 0 },
|
pagination: { currentPage: 1, pageSize: 10, total: 0 },
|
||||||
@ -575,8 +568,7 @@ export default {
|
|||||||
currentApprovalRow: null,
|
currentApprovalRow: null,
|
||||||
showReportDetail: false,
|
showReportDetail: false,
|
||||||
currentReportDetail: null,
|
currentReportDetail: null,
|
||||||
downloadingRowId: '',
|
downloadingRowId: ''
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -615,111 +607,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "对标报告审批流程" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('对标报告审批流程')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
|
||||||
loadUserSelfRole() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_USER_SELF_ROLE,
|
|
||||||
params: {
|
|
||||||
userOrDepID: getUserId()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 将权限数据存储到 localStorage
|
|
||||||
try {
|
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取用户自身角色失败:', err)
|
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.dialogMode = 'create'
|
this.dialogMode = 'create'
|
||||||
this.currentRestartRow = null
|
this.currentRestartRow = null
|
||||||
|
|||||||
@ -1,520 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="role-member-management-page custom-page">
|
|
||||||
<div class="page-header">
|
|
||||||
<div class="header-left">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-arrow-left"
|
|
||||||
class="back-button"
|
|
||||||
@click="handleBack"
|
|
||||||
>
|
|
||||||
返回
|
|
||||||
</el-button>
|
|
||||||
<div class="title-info">
|
|
||||||
<span class="title">人员管理</span>
|
|
||||||
<span class="role-tip">当前选择角色:<span class="role-name">{{ roleName }}</span></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="page-content">
|
|
||||||
<!-- 搜索区域 -->
|
|
||||||
<div class="search-section">
|
|
||||||
<div class="search-form">
|
|
||||||
<div class="search-item">
|
|
||||||
<span class="label">成员名称</span>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.memberName"
|
|
||||||
placeholder="请输入成员名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="search-item">
|
|
||||||
<span class="label">成员编码</span>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.memberCode"
|
|
||||||
placeholder="请输入成员编码"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="search-item">
|
|
||||||
<span class="label">部门</span>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.department"
|
|
||||||
placeholder="请输入部门"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="search-actions">
|
|
||||||
<el-button type="primary" @click="handleSearch">
|
|
||||||
查询
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="handleReset">
|
|
||||||
重置
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 操作区域 -->
|
|
||||||
<div class="action-section">
|
|
||||||
<el-button type="primary" @click="handleAddMember">
|
|
||||||
添加成员
|
|
||||||
</el-button>
|
|
||||||
<el-button :disabled="selectedMembers.length === 0" @click="handleDeleteMember">
|
|
||||||
删除成员
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 表格区域 -->
|
|
||||||
<div class="table-section">
|
|
||||||
<el-table
|
|
||||||
ref="memberTable"
|
|
||||||
:data="tableData"
|
|
||||||
border
|
|
||||||
style="width: 100%"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
|
||||||
<el-table-column prop="username" label="成员名称" min-width="120" align="center" />
|
|
||||||
<el-table-column prop="userNumber" label="成员编码" min-width="120" align="center" />
|
|
||||||
<el-table-column label="部门" min-width="200" align="center" show-overflow-tooltip>
|
|
||||||
<template slot-scope="{ row }">
|
|
||||||
{{ formatDepartment(row) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<div class="pagination-section">
|
|
||||||
<el-pagination
|
|
||||||
:current-page="pagination.currentPage"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="pagination.pageSize"
|
|
||||||
:total="pagination.total"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 添加成员弹窗 -->
|
|
||||||
<el-dialog
|
|
||||||
title="添加成员"
|
|
||||||
:visible.sync="addMemberDialogVisible"
|
|
||||||
width="600px"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
append-to-body
|
|
||||||
@close="handleAddMemberDialogClose"
|
|
||||||
>
|
|
||||||
<el-form ref="addMemberForm" :model="addMemberFormData" label-width="100px">
|
|
||||||
<el-form-item label="搜索人员:">
|
|
||||||
<el-select
|
|
||||||
v-model="addMemberFormData.selectedUsers"
|
|
||||||
filterable
|
|
||||||
remote
|
|
||||||
multiple
|
|
||||||
reserve-keyword
|
|
||||||
placeholder="请输入人员姓名进行搜索"
|
|
||||||
style="width: 100%"
|
|
||||||
:remote-method="queryPerson"
|
|
||||||
:loading="personSearchLoading"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="person in personOptions"
|
|
||||||
:key="person.userNumber"
|
|
||||||
:value="person.userId"
|
|
||||||
:label="person.username"
|
|
||||||
>
|
|
||||||
<span>{{ person.username }}</span>
|
|
||||||
<span style="float: right; color: #8492a6; font-size: 12px">{{ person.userNumber }}</span>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="handleAddMemberDialogClose">
|
|
||||||
取消
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" :loading="addMemberSubmitting" @click="handleAddMemberSubmit">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import api from '@/api'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'RoleMemberManagement',
|
|
||||||
props: {
|
|
||||||
roleId: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
roleName: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchForm: {
|
|
||||||
memberName: '',
|
|
||||||
memberCode: '',
|
|
||||||
department: ''
|
|
||||||
},
|
|
||||||
tableData: [],
|
|
||||||
selectedMembers: [],
|
|
||||||
pagination: {
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0
|
|
||||||
},
|
|
||||||
addMemberDialogVisible: false,
|
|
||||||
addMemberFormData: {
|
|
||||||
selectedUsers: []
|
|
||||||
},
|
|
||||||
personOptions: [],
|
|
||||||
personSearchLoading: false,
|
|
||||||
addMemberSubmitting: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
console.log('人员管理组件 mounted, roleId:', this.roleId, 'roleName:', this.roleName)
|
|
||||||
this.loadMemberList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 格式化部门显示:姓名/工号/部门
|
|
||||||
formatDepartment(row) {
|
|
||||||
const parts = []
|
|
||||||
if (row.username) parts.push(row.username)
|
|
||||||
if (row.userNumber) parts.push(row.userNumber)
|
|
||||||
if (row.department) parts.push(row.department)
|
|
||||||
return parts.join('/')
|
|
||||||
},
|
|
||||||
handleBack() {
|
|
||||||
this.$emit('back')
|
|
||||||
},
|
|
||||||
handleSearch() {
|
|
||||||
this.pagination.currentPage = 1
|
|
||||||
this.loadMemberList()
|
|
||||||
},
|
|
||||||
handleReset() {
|
|
||||||
this.searchForm = {
|
|
||||||
memberName: '',
|
|
||||||
memberCode: '',
|
|
||||||
department: ''
|
|
||||||
}
|
|
||||||
this.pagination.currentPage = 1
|
|
||||||
this.loadMemberList()
|
|
||||||
},
|
|
||||||
handleAddMember() {
|
|
||||||
this.addMemberDialogVisible = true
|
|
||||||
this.addMemberFormData.selectedUsers = []
|
|
||||||
this.personOptions = []
|
|
||||||
},
|
|
||||||
handleDeleteMember() {
|
|
||||||
if (this.selectedMembers.length === 0) {
|
|
||||||
this.$message.warning('请先选择要删除的成员')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$confirm(`确定要删除选中的 ${this.selectedMembers.length} 个成员吗?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.deleteMembers()
|
|
||||||
}).catch(() => {})
|
|
||||||
},
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.selectedMembers = selection
|
|
||||||
},
|
|
||||||
handleSizeChange(size) {
|
|
||||||
this.pagination.pageSize = size
|
|
||||||
this.pagination.currentPage = 1
|
|
||||||
this.loadMemberList()
|
|
||||||
},
|
|
||||||
handleCurrentChange(page) {
|
|
||||||
this.pagination.currentPage = page
|
|
||||||
this.loadMemberList()
|
|
||||||
},
|
|
||||||
loadMemberList() {
|
|
||||||
const request = {
|
|
||||||
...api.CHECK_ROLE_USER_DEPT,
|
|
||||||
params: {
|
|
||||||
roleId: this.roleId
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
if (resp && resp.data) {
|
|
||||||
const respData = resp.data
|
|
||||||
const personArray = respData['人员'] || respData.person || []
|
|
||||||
|
|
||||||
// 解析人员数组
|
|
||||||
// 格式:["周杰-ID:100771324098969075712-userNumber:yc90117846-department:"]
|
|
||||||
const members = []
|
|
||||||
personArray.forEach((personStr) => {
|
|
||||||
if (typeof personStr === 'string') {
|
|
||||||
// 提取用户名(第一个 - 之前)
|
|
||||||
const nameMatch = personStr.match(/^([^-]+)/)
|
|
||||||
const username = nameMatch ? nameMatch[1] : ''
|
|
||||||
|
|
||||||
// 提取ID
|
|
||||||
const idMatch = personStr.match(/ID:([^-]+)/)
|
|
||||||
const userId = idMatch ? idMatch[1] : ''
|
|
||||||
|
|
||||||
// 提取userNumber(成员编码)
|
|
||||||
const userNumberMatch = personStr.match(/userNumber:([^-]+)/)
|
|
||||||
const userNumber = userNumberMatch ? userNumberMatch[1] : ''
|
|
||||||
|
|
||||||
// 提取department(部门)
|
|
||||||
const deptMatch = personStr.match(/department:(.+)$/)
|
|
||||||
const department = deptMatch ? deptMatch[1] : ''
|
|
||||||
|
|
||||||
if (username && userId) {
|
|
||||||
members.push({
|
|
||||||
userId: userId,
|
|
||||||
username: username,
|
|
||||||
userNumber: userNumber, // 成员编码(用户工号)
|
|
||||||
department: department // 部门
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// 应用搜索过滤
|
|
||||||
let filteredMembers = members
|
|
||||||
if (this.searchForm.memberName) {
|
|
||||||
filteredMembers = filteredMembers.filter(m =>
|
|
||||||
m.username && m.username.includes(this.searchForm.memberName)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (this.searchForm.memberCode) {
|
|
||||||
filteredMembers = filteredMembers.filter(m =>
|
|
||||||
m.userNumber && m.userNumber.includes(this.searchForm.memberCode)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (this.searchForm.department) {
|
|
||||||
filteredMembers = filteredMembers.filter(m =>
|
|
||||||
m.department && m.department.includes(this.searchForm.department)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分页处理
|
|
||||||
this.pagination.total = filteredMembers.length
|
|
||||||
const startIndex = (this.pagination.currentPage - 1) * this.pagination.pageSize
|
|
||||||
const endIndex = startIndex + this.pagination.pageSize
|
|
||||||
this.tableData = filteredMembers.slice(startIndex, endIndex)
|
|
||||||
} else {
|
|
||||||
this.tableData = []
|
|
||||||
this.pagination.total = 0
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('加载成员列表失败:', err)
|
|
||||||
this.$message.error('加载成员列表失败,请稍后重试')
|
|
||||||
this.tableData = []
|
|
||||||
this.pagination.total = 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
queryPerson(query) {
|
|
||||||
if (!query || query.trim() === '') {
|
|
||||||
this.personOptions = []
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.personSearchLoading = true
|
|
||||||
const request = {
|
|
||||||
...api.GET_ALLUSERS,
|
|
||||||
params: {
|
|
||||||
name: query.trim()
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
const respData = resp && resp.data
|
|
||||||
let result = []
|
|
||||||
if (Array.isArray(respData)) {
|
|
||||||
result = respData
|
|
||||||
} else if (respData && Array.isArray(respData.result)) {
|
|
||||||
result = respData.result
|
|
||||||
} else if (respData && respData.data && Array.isArray(respData.data)) {
|
|
||||||
result = respData.data
|
|
||||||
}
|
|
||||||
this.personOptions = result.map((user) => ({
|
|
||||||
userId: user.userId || user.id,
|
|
||||||
username: user.username || user.name,
|
|
||||||
userNumber: user.userNumber || user.userId || user.id
|
|
||||||
})).filter((user) => user.userId && user.userNumber)
|
|
||||||
this.personSearchLoading = false
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('搜索人员失败:', err)
|
|
||||||
this.personOptions = []
|
|
||||||
this.personSearchLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleAddMemberDialogClose() {
|
|
||||||
this.addMemberDialogVisible = false
|
|
||||||
this.addMemberFormData.selectedUsers = []
|
|
||||||
this.personOptions = []
|
|
||||||
},
|
|
||||||
handleAddMemberSubmit() {
|
|
||||||
if (!this.addMemberFormData.selectedUsers || this.addMemberFormData.selectedUsers.length === 0) {
|
|
||||||
this.$message.warning('请选择要添加的成员')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addMemberSubmitting = true
|
|
||||||
// 使用现有接口绑定角色和用户
|
|
||||||
const request = {
|
|
||||||
...api.GET_ROLE_PERMISSION_BING,
|
|
||||||
data: {
|
|
||||||
roleID: this.roleId,
|
|
||||||
userIDs: this.addMemberFormData.selectedUsers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
this.$message.success('添加成员成功')
|
|
||||||
this.addMemberSubmitting = false
|
|
||||||
this.handleAddMemberDialogClose()
|
|
||||||
this.loadMemberList()
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('添加成员失败:', err)
|
|
||||||
this.$message.error('添加成员失败')
|
|
||||||
this.addMemberSubmitting = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteMembers() {
|
|
||||||
const userIds = this.selectedMembers.map((member) => member.userId)
|
|
||||||
// 使用现有接口删除角色用户绑定
|
|
||||||
const request = {
|
|
||||||
...api.DELETE_ROLE_PERMISSION,
|
|
||||||
params: {
|
|
||||||
roleID: this.roleId,
|
|
||||||
userIDs: userIds.join(',')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
this.$message.success('删除成员成功')
|
|
||||||
this.loadMemberList()
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('删除成员失败:', err)
|
|
||||||
this.$message.error('删除成员失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.role-member-management-page {
|
|
||||||
.page-header {
|
|
||||||
padding: 20px;
|
|
||||||
background: #fff;
|
|
||||||
border-bottom: 1px solid #ebeef5;
|
|
||||||
|
|
||||||
.header-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
|
|
||||||
.back-button {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #409eff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title-info {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-tip {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
|
|
||||||
.role-name {
|
|
||||||
color: #f56c6c;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-content {
|
|
||||||
padding: 20px;
|
|
||||||
|
|
||||||
.search-section {
|
|
||||||
background: #fff;
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
.search-form {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.search-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
|
|
||||||
.label {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-actions {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-section {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-section {
|
|
||||||
background: #fff;
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 4px;
|
|
||||||
|
|
||||||
.pagination-section {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -49,9 +49,9 @@
|
|||||||
<div class="search-field">
|
<div class="search-field">
|
||||||
<span class="field-label">当前状态</span>
|
<span class="field-label">当前状态</span>
|
||||||
<el-select v-model="searchPanelValue.statusDescription" placeholder="请选择" clearable>
|
<el-select v-model="searchPanelValue.statusDescription" placeholder="请选择" clearable>
|
||||||
<el-option label="审核中" value="审核中" />
|
<el-option label="审批中" value="审批中" />
|
||||||
<el-option label="已通过" value="已通过" />
|
<el-option label="已通过" value="已通过" />
|
||||||
<el-option label="已拒绝" value="已拒绝" />
|
<el-option label="已退回" value="已退回" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-actions">
|
<div class="search-actions">
|
||||||
@ -113,14 +113,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -216,8 +209,7 @@ export default {
|
|||||||
// 申请人搜索相关
|
// 申请人搜索相关
|
||||||
applicantOptions: [],
|
applicantOptions: [],
|
||||||
applicantLoading: false,
|
applicantLoading: false,
|
||||||
applicantSearchTimer: null, // 防抖定时器
|
applicantSearchTimer: null // 防抖定时器
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -284,35 +276,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
this.loadData()
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
this.loadUserSelfRole()
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// 清理定时器
|
// 清理定时器
|
||||||
@ -384,49 +350,6 @@ export default {
|
|||||||
// 如果是提交人,就可以显示撤回按钮
|
// 如果是提交人,就可以显示撤回按钮
|
||||||
return this.isApplicant(row)
|
return this.isApplicant(row)
|
||||||
},
|
},
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
|
||||||
isAdmin() {
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 检查是否有 isAdmin === 1 的记录
|
|
||||||
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查管理员权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "玉柴发动机数据审批流程" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('玉柴发动机数据审批流程')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载用户自身角色权限
|
// 加载用户自身角色权限
|
||||||
loadUserSelfRole() {
|
loadUserSelfRole() {
|
||||||
const request = {
|
const request = {
|
||||||
@ -436,26 +359,19 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 将权限数据存储到 localStorage
|
// 将权限数据存储到 localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
reject(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pageSizeChange(size) {
|
pageSizeChange(size) {
|
||||||
|
|||||||
@ -56,7 +56,6 @@
|
|||||||
<el-option label="已分发" value="已分发" />
|
<el-option label="已分发" value="已分发" />
|
||||||
<el-option label="部分分发" value="部分分发" />
|
<el-option label="部分分发" value="部分分发" />
|
||||||
<el-option label="未分发" value="未分发" />
|
<el-option label="未分发" value="未分发" />
|
||||||
<el-option label="已完成" value="已完成" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-actions">
|
<div class="search-actions">
|
||||||
@ -109,29 +108,14 @@
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
<span
|
<span v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()" class="link-separator"></span>
|
||||||
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
|
||||||
class="link-separator"
|
|
||||||
></span>
|
|
||||||
<a
|
<a
|
||||||
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()"
|
||||||
href="javascript:void(0)"
|
|
||||||
class="el-link el-link--primary"
|
|
||||||
style="margin-left: 5px;"
|
|
||||||
@click.stop="handleRowEdit(row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</a>
|
|
||||||
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
|
||||||
<a
|
|
||||||
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
style="margin-left: 5px;"
|
style="margin-left: 5px;"
|
||||||
@click.stop="handleRowDispatch(row, rowIndex)"
|
@click.stop="handleRowDispatch(row, rowIndex)"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
分发
|
分发
|
||||||
</a>
|
</a>
|
||||||
<span class="link-separator" v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"></span>
|
<span class="link-separator" v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"></span>
|
||||||
@ -155,9 +139,6 @@
|
|||||||
<span v-else-if="row[colConfig.prop] === '未分发'" class="status-tag status-pending">
|
<span v-else-if="row[colConfig.prop] === '未分发'" class="status-tag status-pending">
|
||||||
未分发
|
未分发
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="row[colConfig.prop] === '已完成'" class="status-tag status-done">
|
|
||||||
已完成
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="colConfig.customSlot === 'versionNumber'" :key="index + '' + rowIndex">
|
<div v-if="colConfig.customSlot === 'versionNumber'" :key="index + '' + rowIndex">
|
||||||
V{{ row[colConfig.prop] || '' }}
|
V{{ row[colConfig.prop] || '' }}
|
||||||
@ -166,14 +147,7 @@
|
|||||||
|
|
||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<div class="table-empty">
|
<div class="table-empty">
|
||||||
<template v-if="canViewData">
|
|
||||||
<x-empty-page></x-empty-page>
|
<x-empty-page></x-empty-page>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div style="padding: 40px 0; text-align: center; color: #909399;">
|
|
||||||
<div style="font-size: 14px;">无权限查看</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
@ -275,8 +249,7 @@ export default {
|
|||||||
importing: false,
|
importing: false,
|
||||||
selectedImportFile: null,
|
selectedImportFile: null,
|
||||||
importFileList: [],
|
importFileList: [],
|
||||||
downloadingTemplate: false,
|
downloadingTemplate: false
|
||||||
canViewData: false // 是否有查看数据的权限
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -367,7 +340,7 @@ export default {
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
customSlot: 'options',
|
customSlot: 'options',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200',
|
width: '120',
|
||||||
fixed: 'right'
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -376,35 +349,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 先检查 localStorage 中是否已有权限数据,如果有则先检查权限
|
this.loadUserSelfRole()
|
||||||
if (this.hasViewPermission()) {
|
this.loadData()
|
||||||
this.canViewData = true
|
},
|
||||||
this.loadData()
|
mounted() {
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
// 同时加载最新的权限数据
|
|
||||||
this.loadUserSelfRole()
|
this.loadUserSelfRole()
|
||||||
.then(() => {
|
|
||||||
// 权限加载完成后重新检查权限
|
|
||||||
if (this.hasViewPermission()) {
|
|
||||||
this.canViewData = true
|
|
||||||
// 如果之前没有权限,现在有权限了,则加载数据
|
|
||||||
if (this.tableData.length === 0) {
|
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.canViewData = false
|
|
||||||
// 无权限时不加载数据,显示空列表
|
|
||||||
this.tableData = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 如果加载权限失败,保持当前状态
|
|
||||||
console.error('加载权限数据失败')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否是管理员(isAdmin === 1)
|
// 检查是否是管理员(isAdmin === 1)
|
||||||
@ -425,31 +376,6 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 检查是否有查看数据的权限
|
|
||||||
hasViewPermission() {
|
|
||||||
// 1. 如果是管理员,拥有全部权限
|
|
||||||
if (this.isAdmin()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const permissionDataStr = localStorage.getItem('user_self_role')
|
|
||||||
if (!permissionDataStr) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const permissionData = JSON.parse(permissionDataStr)
|
|
||||||
if (!Array.isArray(permissionData)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 2. 检查是否有 permissionPath 包括 "玉柴发动机数据" 的权限
|
|
||||||
return permissionData.some((perm) => {
|
|
||||||
const permissionPath = perm.permissionPath || ''
|
|
||||||
return permissionPath.includes('玉柴发动机数据')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('检查查看权限失败:', err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 检查是否有玉柴发动机数据的编辑权限
|
// 检查是否有玉柴发动机数据的编辑权限
|
||||||
hasEngineDataEditPermission() {
|
hasEngineDataEditPermission() {
|
||||||
// 如果是管理员,拥有全部权限
|
// 如果是管理员,拥有全部权限
|
||||||
@ -466,10 +392,16 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 检查是否有 permissionPath 为 "玉柴发动机数据" 且 parameterPer 是编辑的权限
|
// 检查是否有 permissionPath 为 "玉柴发动机数据" 且 parameterPer 是编辑的权限
|
||||||
|
// parameterPer 可能是数字 2 或字符串 "编辑" 或 "2"
|
||||||
return permissionData.some((perm) => {
|
return permissionData.some((perm) => {
|
||||||
const permissionPath = perm.permissionPath || ''
|
const permissionPath = perm.permissionPath || ''
|
||||||
const parameterPer = perm.parameterPer || ''
|
const parameterPer = perm.parameterPer
|
||||||
return permissionPath === '玉柴发动机数据' && parameterPer === '编辑'
|
return (
|
||||||
|
permissionPath === '玉柴发动机数据' &&
|
||||||
|
(parameterPer === 2 ||
|
||||||
|
parameterPer === '2' ||
|
||||||
|
parameterPer === '编辑')
|
||||||
|
)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('检查玉柴发动机数据编辑权限失败:', err)
|
console.error('检查玉柴发动机数据编辑权限失败:', err)
|
||||||
@ -485,26 +417,19 @@ export default {
|
|||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 将权限数据存储到 localStorage
|
// 将权限数据存储到 localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
resolve(resp.data)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('存储权限数据到 localStorage 失败:', err)
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
reject(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resolve(null)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleRowDispatch(row, rowIndex) {
|
handleRowDispatch(row, rowIndex) {
|
||||||
@ -786,12 +711,6 @@ export default {
|
|||||||
// 从 selfEnginedata.vue 跳转,设置 ycOrOth 为 "玉柴"
|
// 从 selfEnginedata.vue 跳转,设置 ycOrOth 为 "玉柴"
|
||||||
this.$refs.addEngineModelModal.showModal('玉柴')
|
this.$refs.addEngineModelModal.showModal('玉柴')
|
||||||
},
|
},
|
||||||
handleRowEdit(row) {
|
|
||||||
if (row.distributeStatus !== '未分发') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$refs.addEngineModelModal.showModalForEdit('玉柴', row)
|
|
||||||
},
|
|
||||||
handleAddSuccess() {
|
handleAddSuccess() {
|
||||||
// 子组件已经关闭弹窗,这里只需要刷新列表
|
// 子组件已经关闭弹窗,这里只需要刷新列表
|
||||||
this.loadData()
|
this.loadData()
|
||||||
|
|||||||
@ -43,6 +43,24 @@
|
|||||||
v-for="(colConfig, index) in tableConfig.colConfigs"
|
v-for="(colConfig, index) in tableConfig.colConfigs"
|
||||||
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
|
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
|
||||||
>
|
>
|
||||||
|
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
|
||||||
|
<a
|
||||||
|
href="javascript:void(0)"
|
||||||
|
class="el-link el-link--primary"
|
||||||
|
@click.stop="handleRowView(row)"
|
||||||
|
>查看</a
|
||||||
|
>
|
||||||
|
<!-- <span
|
||||||
|
v-if="row.dataType === '数据维护'"
|
||||||
|
style="width: 6px; display: inline-block"
|
||||||
|
></span>
|
||||||
|
<a
|
||||||
|
href="javascript:void(0)"
|
||||||
|
class="el-link el-link--primary"
|
||||||
|
@click.stop="handleRowBack(row)"
|
||||||
|
>退回</a
|
||||||
|
> -->
|
||||||
|
</div>
|
||||||
<div v-if="colConfig.customSlot === 'processTitle'" :key="'pt' + index + '' + rowIndex">
|
<div v-if="colConfig.customSlot === 'processTitle'" :key="'pt' + index + '' + rowIndex">
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
@ -74,7 +92,6 @@
|
|||||||
:responsible-person-id="responsiblePersonId"
|
:responsible-person-id="responsiblePersonId"
|
||||||
:filled-by="filledBy"
|
:filled-by="filledBy"
|
||||||
:flow-id="flowId"
|
:flow-id="flowId"
|
||||||
:todo-id="todoId"
|
|
||||||
:can-resend="canResend"
|
:can-resend="canResend"
|
||||||
:from-todo="fromTodo"
|
:from-todo="fromTodo"
|
||||||
class="engine-detail-wrapper"
|
class="engine-detail-wrapper"
|
||||||
@ -88,8 +105,8 @@
|
|||||||
:visible="showEngineCheck"
|
:visible="showEngineCheck"
|
||||||
:engine-type="engineType"
|
:engine-type="engineType"
|
||||||
:from-todo="fromTodo"
|
:from-todo="fromTodo"
|
||||||
class="engine-check-wrapper"
|
|
||||||
@refresh="handleBackFromCheck"
|
@refresh="handleBackFromCheck"
|
||||||
|
class="engine-check-wrapper"
|
||||||
@close="handleBackFromCheck"
|
@close="handleBackFromCheck"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -140,7 +157,7 @@ import ApprovalProgressDetail from './approvalProgressDetail.vue'
|
|||||||
import ReportDetail from './reportDetail.vue'
|
import ReportDetail from './reportDetail.vue'
|
||||||
import ModelDetail from './modelDetail.vue'
|
import ModelDetail from './modelDetail.vue'
|
||||||
import { getUserId } from '@/utils'
|
import { getUserId } from '@/utils'
|
||||||
import api from '@/api'
|
import api from '@/api/demo'
|
||||||
export default {
|
export default {
|
||||||
name: 'TodoPage',
|
name: 'TodoPage',
|
||||||
components: {
|
components: {
|
||||||
@ -165,7 +182,6 @@ export default {
|
|||||||
versionList: [],
|
versionList: [],
|
||||||
currentDetail: null,
|
currentDetail: null,
|
||||||
flowId: '',
|
flowId: '',
|
||||||
todoId: '',
|
|
||||||
createdById: '',
|
createdById: '',
|
||||||
templateManagementPermissions: [],
|
templateManagementPermissions: [],
|
||||||
currentModel: '',
|
currentModel: '',
|
||||||
@ -213,9 +229,17 @@ export default {
|
|||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: this.formatDateTime
|
formatter: this.formatDateTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'options',
|
||||||
|
label: '操作',
|
||||||
|
customSlot: 'options',
|
||||||
|
align: 'center',
|
||||||
|
width: '100',
|
||||||
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
seqType: 'normal',
|
seqType: '',
|
||||||
seqConfig: {},
|
seqConfig: {},
|
||||||
layout: 'total, prev, pager, next, jumper, sizes'
|
layout: 'total, prev, pager, next, jumper, sizes'
|
||||||
}
|
}
|
||||||
@ -224,8 +248,6 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.loadData()
|
this.loadData()
|
||||||
this.filterTemplateManagementPermissions()
|
this.filterTemplateManagementPermissions()
|
||||||
// 检查URL中是否有flowId参数
|
|
||||||
this.checkFlowIdFromUrl()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
pageSizeChange(size) {
|
pageSizeChange(size) {
|
||||||
@ -381,7 +403,6 @@ export default {
|
|||||||
} else if (isRejectedApprovalMode) {
|
} else if (isRejectedApprovalMode) {
|
||||||
// 如果是"数据拒绝",打开 engineDetail 页面(类似模板拒绝的处理方式)
|
// 如果是"数据拒绝",打开 engineDetail 页面(类似模板拒绝的处理方式)
|
||||||
this.currentEngineDetail = { ...row, flowId: row.documentNo, id: row.modelId }
|
this.currentEngineDetail = { ...row, flowId: row.documentNo, id: row.modelId }
|
||||||
this.todoId = row.id
|
|
||||||
this.flowId = row.documentNo || ''
|
this.flowId = row.documentNo || ''
|
||||||
this.showEngineDetail = true
|
this.showEngineDetail = true
|
||||||
this.canResend = true
|
this.canResend = true
|
||||||
@ -395,8 +416,7 @@ export default {
|
|||||||
return
|
return
|
||||||
} else if (isInApprovalMode) {
|
} else if (isInApprovalMode) {
|
||||||
// 如果是"数据审批",打开审批页面
|
// 如果是"数据审批",打开审批页面
|
||||||
this.currentEngineDetail = { ...row, flowId: row.documentNo, id: row.documentNo, todoId: row.id }
|
this.currentEngineDetail = { ...row, flowId: row.documentNo, id: row.documentNo }
|
||||||
this.todoId = row.id
|
|
||||||
this.showEngineCheck = true
|
this.showEngineCheck = true
|
||||||
this.showEngineDetail = false
|
this.showEngineDetail = false
|
||||||
this.canResend = false
|
this.canResend = false
|
||||||
@ -451,9 +471,7 @@ export default {
|
|||||||
// 如果是"填写发动机参数值",打开非分发模式(查看模式)
|
// 如果是"填写发动机参数值",打开非分发模式(查看模式)
|
||||||
// 如果是"管理员分发责任人",打开分发模式且是分发填写人(显示填写人列,调用UPDATE_PARAM接口)
|
// 如果是"管理员分发责任人",打开分发模式且是分发填写人(显示填写人列,调用UPDATE_PARAM接口)
|
||||||
// 其他情况打开分发模式且是分发责任人
|
// 其他情况打开分发模式且是分发责任人
|
||||||
// currentNode / ownerId / currentProcessor 会随 row 传入 engineDetail,用于「编制 + 当前处理人为本人」时选择 selectParamListAndModelForFilledBy
|
this.currentEngineDetail = { ...row, id: row.modelId }
|
||||||
this.currentEngineDetail = { ...row, id: row.modelId, todoId: row.id }
|
|
||||||
this.todoId = row.id
|
|
||||||
// 填写发动机参数值:非分发模式(只读),传递 filledBy
|
// 填写发动机参数值:非分发模式(只读),传递 filledBy
|
||||||
this.isDispatchMode = false
|
this.isDispatchMode = false
|
||||||
this.canResend = false
|
this.canResend = false
|
||||||
@ -462,8 +480,7 @@ export default {
|
|||||||
this.flowId = row.documentNo || ''
|
this.flowId = row.documentNo || ''
|
||||||
this.responsiblePersonId = ''
|
this.responsiblePersonId = ''
|
||||||
} else if (isResponsibleDispatchMode) {
|
} else if (isResponsibleDispatchMode) {
|
||||||
this.currentEngineDetail = { ...row, id: row.modelId, todoId: row.id }
|
this.currentEngineDetail = { ...row, id: row.modelId }
|
||||||
this.todoId = row.id
|
|
||||||
// 管理员分发责任人:分发填写人模式(显示填写人列,可编辑),传递 responsiblePersonId
|
// 管理员分发责任人:分发填写人模式(显示填写人列,可编辑),传递 responsiblePersonId
|
||||||
this.isDispatchMode = true
|
this.isDispatchMode = true
|
||||||
this.dispatchType = 'update_param'
|
this.dispatchType = 'update_param'
|
||||||
@ -570,35 +587,6 @@ export default {
|
|||||||
console.error('日期格式化错误:', error)
|
console.error('日期格式化错误:', error)
|
||||||
return cellValue
|
return cellValue
|
||||||
}
|
}
|
||||||
},
|
|
||||||
checkFlowIdFromUrl() {
|
|
||||||
// 检查URL中是否有flowId参数
|
|
||||||
const flowId = this.$route && this.$route.query && this.$route.query.flowId
|
|
||||||
if (flowId) {
|
|
||||||
const request = {
|
|
||||||
...api.GET_YC_TODO_LIST,
|
|
||||||
params: {
|
|
||||||
flowId: flowId
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
// 根据返回值触发handleRowView
|
|
||||||
if (resp && resp.data) {
|
|
||||||
// 尝试多种可能的数据结构
|
|
||||||
const rowData = resp.data.result || resp.data.data || resp.data
|
|
||||||
// 确保rowData有必要的字段
|
|
||||||
if (rowData && (rowData.dataType || rowData.documentNo || rowData.modelId)) {
|
|
||||||
this.handleRowView(rowData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('根据flowId获取待办数据失败:', err)
|
|
||||||
this.$message.error('获取待办数据失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,8 +182,7 @@ export default {
|
|||||||
this.$message.info('下载导入模板功能')
|
this.$message.info('下载导入模板功能')
|
||||||
},
|
},
|
||||||
handleRevert() {
|
handleRevert() {
|
||||||
this.isEditable = true
|
this.$message.info('退回功能')
|
||||||
this.$message.success('已进入编辑模式,可修改数据')
|
|
||||||
},
|
},
|
||||||
handleSave() {
|
handleSave() {
|
||||||
this.$message.info('保存功能')
|
this.$message.info('保存功能')
|
||||||
|
|||||||
@ -18,9 +18,7 @@ import ApaasCustomApprovalManagement from './custom-page/approvalManagement.vue'
|
|||||||
import ApaasCustomTodoList from './custom-page/todo.vue'
|
import ApaasCustomTodoList from './custom-page/todo.vue'
|
||||||
import ApaasCustomMyDone from './custom-page/myDone.vue'
|
import ApaasCustomMyDone from './custom-page/myDone.vue'
|
||||||
import ApaasCustomMySend from './custom-page/mySend.vue'
|
import ApaasCustomMySend from './custom-page/mySend.vue'
|
||||||
import ApaasCustomCheckPersonPermission from './custom-page/checkPersonPermission.vue'
|
|
||||||
import ApaasCustomPermissionManagement from './custom-page/permissionManagement.vue'
|
import ApaasCustomPermissionManagement from './custom-page/permissionManagement.vue'
|
||||||
import ApaasCustomRoleMemberManagement from './custom-page/roleMemberManagement.vue'
|
|
||||||
import ApaasCustomLayout from './custom-layout/custom-layout.vue'
|
import ApaasCustomLayout from './custom-layout/custom-layout.vue'
|
||||||
import { customFormComponentList } from './custom-component/form-component'
|
import { customFormComponentList } from './custom-component/form-component'
|
||||||
import { widgetConfigList } from './custom-component/form-config'
|
import { widgetConfigList } from './custom-component/form-config'
|
||||||
@ -47,9 +45,7 @@ const install = function(Vue, opts) {
|
|||||||
Vue.component('apaas-custom-otherEngineCheck', ApaasOtherEngineCheck)
|
Vue.component('apaas-custom-otherEngineCheck', ApaasOtherEngineCheck)
|
||||||
Vue.component('apaas-custom-myDone', ApaasCustomMyDone)
|
Vue.component('apaas-custom-myDone', ApaasCustomMyDone)
|
||||||
Vue.component('apaas-custom-mySend', ApaasCustomMySend)
|
Vue.component('apaas-custom-mySend', ApaasCustomMySend)
|
||||||
Vue.component('apaas-custom-checkPersonPermission', ApaasCustomCheckPersonPermission)
|
|
||||||
Vue.component('apaas-custom-permissionManagement', ApaasCustomPermissionManagement)
|
Vue.component('apaas-custom-permissionManagement', ApaasCustomPermissionManagement)
|
||||||
Vue.component('apaas-custom-roleMemberManagement', ApaasCustomRoleMemberManagement)
|
|
||||||
Vue.component('apaas-custom-layout', ApaasCustomLayout)
|
Vue.component('apaas-custom-layout', ApaasCustomLayout)
|
||||||
// 安装表单部件
|
// 安装表单部件
|
||||||
// 注册自开发表单组件
|
// 注册自开发表单组件
|
||||||
|
|||||||
@ -36,6 +36,7 @@ const SearchComponentMixin = {
|
|||||||
return this.searchValue
|
return this.searchValue
|
||||||
},
|
},
|
||||||
set: function (value) {
|
set: function (value) {
|
||||||
|
debugger
|
||||||
this.$emit('change', value)
|
this.$emit('change', value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,6 @@ Vue.addInterceptorsRequest('REQUEST_PARAMS_INTERCEPTOR', (e) => {
|
|||||||
const authStore = store.state.authModule
|
const authStore = store.state.authModule
|
||||||
if (authStore.token) {
|
if (authStore.token) {
|
||||||
e.headers['xdaptoken'] = authStore.token
|
e.headers['xdaptoken'] = authStore.token
|
||||||
// e.headers['xdaptoken'] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3ODExNTMxMTIsImlhdCI6MTc4MTE0NTkxMiwieGRhcHVzZXJpZCI6IjEwMDc3MTMyNDA5ODk2OTA3NTcxMiJ9.9OKIAqMyTsrQkBSFX3_KcduxVoSe-Tz0cqlKsyNQD1AziiLVGh2w0uK-qu0y6fz916o2Crw8mJWqyrea8oKpdg '
|
|
||||||
}
|
}
|
||||||
e.headers['xdaptenantid'] = process.env.VUE_APP_TENANT_ID
|
e.headers['xdaptenantid'] = process.env.VUE_APP_TENANT_ID
|
||||||
|
|
||||||
|
|||||||
@ -94,3 +94,4 @@ export function clearUserRole() {
|
|||||||
export function hasUserRole() {
|
export function hasUserRole() {
|
||||||
return localStorage.getItem(USER_ROLE_STORAGE_KEY) !== null
|
return localStorage.getItem(USER_ROLE_STORAGE_KEY) !== null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import Vue from 'vue'
|
|||||||
// import i18n from '@/locale'
|
// import i18n from '@/locale'
|
||||||
export const GLOABL_MENU_ACTION = {
|
export const GLOABL_MENU_ACTION = {
|
||||||
TO_ROUTER: (engine, event) => {
|
TO_ROUTER: (engine, event) => {
|
||||||
|
debugger
|
||||||
const { menu } = event
|
const { menu } = event
|
||||||
let needRefresh = true
|
let needRefresh = true
|
||||||
if (engine.layoutConfig.keepAliveRouter) {
|
if (engine.layoutConfig.keepAliveRouter) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user