Compare commits

..

No commits in common. "46b01b45047815b84fd495d718a6a2d8a8e06b22" and "3d7ee782b11eb1d57757efbb6b7640d75f2fed25" have entirely different histories.

239 changed files with 58342 additions and 130207 deletions

View File

@ -1,4 +0,0 @@
{
"clawMode.mode": "editor",
"workbench.activityBar.location": "default"
}

2
.env
View File

@ -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/

View File

@ -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
View File

@ -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
View 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
View 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

View File

@ -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": [

View File

@ -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>

View File

@ -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);
/***/ })
/******/ });

View File

@ -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);
/***/ })
/******/ });
});

View File

@ -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}})}));

View File

@ -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
}
}

View File

@ -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>

View File

@ -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);
/***/ })
/******/ });

View File

@ -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);
/***/ })
/******/ });
});

View File

@ -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}})}));

View File

@ -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>

View File

@ -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);
/***/ })
/******/ });

View File

@ -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);
/***/ })
/******/ });
});

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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
} },
} }

View File

@ -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'
} }
} }

View File

@ -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'
} }
} }

View File

@ -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'
} }
} }

View File

@ -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'
} }
} }

View File

@ -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'
} }
} }

View File

@ -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;
}

View File

@ -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": [

View File

@ -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>

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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 {

View File

@ -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
})
// 2permissionPath """"
//
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 {
// 312 `-`
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
}
// 312 `-`
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) => {
// ""isGlobal10 // ""isGlobal10
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) => {
// ""isGlobal10 // ""isGlobal10
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) => {
// ""isGlobal10 // ""isGlobal10
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;
} }

View File

@ -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

View File

@ -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>

View File

@ -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()
// URLflowId
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() {
// URLflowId
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('获取经办数据失败')
})
}
} }
} }
} }

View File

@ -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()
// URLflowId
this.checkFlowIdFromUrl()
}, },
methods: { methods: {
pageSizeChange(size) { pageSizeChange(size) {
@ -496,35 +486,6 @@ export default {
}) })
} }
console.warn(row) console.warn(row)
},
checkFlowIdFromUrl() {
// URLflowId
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('获取发起数据失败')
})
}
} }
} }
} }

View File

@ -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) {

View File

@ -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>

View File

@ -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('-') : ''
}, },
// idID
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
// IDisDept=0 let userOrDeptId = []
let personIds = (this.personConfigFormData.person || []).filter((id) => id) let isDept = 0
// IDisDept=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 {
// IDperson 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 12 // parameterPer 12
//
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;

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -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>

View File

@ -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) {

View File

@ -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()

View File

@ -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()
// URLflowId
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() {
// URLflowId
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('获取待办数据失败')
})
}
} }
} }
} }

View File

@ -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('保存功能')

View File

@ -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)
// 安装表单部件 // 安装表单部件
// 注册自开发表单组件 // 注册自开发表单组件

View File

@ -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)
} }
} }

View File

@ -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

View File

@ -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
} }

View File

@ -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) {

15514
yarn.lock

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +0,0 @@
编译器终端 npx x-apaas-cli build apaas-custom-mydemo
打包失败是因为Node.js版本过高v24.16.0与webpack 4不兼容。需要设置OpenSSL legacy provider。
方案1降级Node.js版本推荐14
方案2替换node-sass为dart-sass
本地启动 npm run serve