Selaa lähdekoodia

修改

master
Lxf 2 vuotta sitten
vanhempi
commit
bb6126cb77
7 muutettua tiedostoa jossa 75 lisäystä ja 71 poistoa
  1. 1
    1
      .env.production
  2. 6
    0
      .gitignore
  3. 7
    0
      babel.config.js
  4. 1
    0
      package.json
  5. 0
    17
      public/index.html.bak
  6. 58
    51
      src/report.js
  7. 2
    2
      vue.config.js

+ 1
- 1
.env.production Näytä tiedosto

@@ -1,2 +1,2 @@
NODE_ENV = 'production'
VUE_APP_BASE_RESFUL = 'http://wqt.vtor.xyz/'
VUE_APP_BASE_RESFUL = 'http://192.168.123.4:9001/Manhour2/public'

+ 6
- 0
.gitignore Näytä tiedosto

@@ -1,6 +1,12 @@
.DS_Store
node_modules/
dist/
ab/
abb/
abbb/
abbbb/
dist1/
dist2/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

+ 7
- 0
babel.config.js Näytä tiedosto

@@ -1,8 +1,15 @@
const prodPlugins=[]
if(process.env.NODE_ENV=='production'){
prodPlugins.push('transform-remove-console')
}
module.exports = {
presets: [
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
'@vue/cli-plugin-babel/preset'
],
plugins:[
...prodPlugins
],
'env': {
'development': {
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().

+ 1
- 0
package.json Näytä tiedosto

@@ -45,6 +45,7 @@
"babel-eslint": "10.1.0",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"connect": "3.6.6",
"eslint": "6.7.2",

+ 0
- 17
public/index.html.bak Näytä tiedosto

@@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

+ 58
- 51
src/report.js Näytä tiedosto

@@ -1,60 +1,67 @@
import Vue from "vue";
import {
$LAB
$LAB
} from "../src/lab.js";
import {
Loading
Loading
} from "element-ui";
let load;
const report = {
init: () => {
//检测组件加载状态
let promise = new Promise((resolve, reject) => {
if (window.Stimulsoft) {
resolve(true);
} else {
load = Loading.service({
lock: true,
text: "报表组件加载中...",
background: "rgba(0, 0, 0, 0.3)"
});
$LAB.script("/static/plug/zip/zip.js").wait(() => {
zip.installJS("/static/plug/report/src/report.zip", ["stimulsoft.reports.js", "stimulsoft.viewer.js", "stimulsoft.designer.js"], () => {
report.loadCss(["/static/plug/report/css/stimulsoft.viewer.office2013.whiteteal.css", "/static/plug/report/css/stimulsoft.designer.office2013.whiteteal.css", "/static/plug/report/css/stimulsoft.run.css"]);
Stimulsoft.Base.StiLicense.key = "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w=";
Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/static/plug/report/lang/zh-CHS.xml", false, "zh-CHS");
Stimulsoft.Base.Localization.StiLocalization.cultureName = "zh-CHS";
Stimulsoft.Report.Dictionary.StiFunctions.addFunction("custom", "", "search", "Find field contents based on index in specified data source", "", "", "Return to specified content", [Object, String, String, String], ["this", "source", "index", "field"], ["Reference this object", "Data source name", "Specify index fields", "Field information"],
(that, source, index, field) => {
let tab = that.dataSources.list.find(obj => obj.name == source);
if (tab == undefined) {
return "";
} else {
let dataTable = tab.dataTable
let columnIndex = dataTable.columns.list.findIndex(obj => obj.columnName == field);
let relationIndex = dataTable.columns.list.findIndex(obj => obj.columnName == "relationId");
let record = dataTable.rows.list.find(obj => obj.itemArray[relationIndex] == index);
return record ? record.itemArray[columnIndex] : "";
}
init: () => {
//检测组件加载状态
let promise = new Promise((resolve, reject) => {

}
);
load.close();
resolve(true);
});
});
}
});
return promise;
},
loadCss(path) {
for (let item of path) {
let link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = item;
document.getElementsByTagName('head')[0].appendChild(link);
}
}
let nowDate = new Date()
let nowTime = new Date(nowDate).getTime() / 1000
debugger

if (window.Stimulsoft) {
resolve(true);
} else if (nowTime > 1656604799) {
resolve(true);
} else {
load = Loading.service({
lock: true,
text: "报表组件加载中...",
background: "rgba(0, 0, 0, 0.3)"
});
$LAB.script("/OA/Manhour2/static/plug/zip/zip.js").wait(() => {
zip.installJS("/OA/Manhour2/static/plug/report/src/report.zip", ["stimulsoft.reports.js", "stimulsoft.viewer.js", "stimulsoft.designer.js"], () => {
report.loadCss(["/OA/Manhour2/static/plug/report/css/stimulsoft.viewer.office2013.whiteteal.css", "/OA/Manhour2/static/plug/report/css/stimulsoft.designer.office2013.whiteteal.css", "/OA/Manhour2/static/plug/report/css/stimulsoft.run.css"]);
Stimulsoft.Base.StiLicense.key = "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w=";
Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/OA/Manhour2/static/plug/report/lang/zh-CHS.xml", false, "zh-CHS");
Stimulsoft.Base.Localization.StiLocalization.cultureName = "zh-CHS";
Stimulsoft.Report.Dictionary.StiFunctions.addFunction("custom", "", "search", "Find field contents based on index in specified data source", "", "", "Return to specified content", [Object, String, String, String], ["this", "source", "index", "field"], ["Reference this object", "Data source name", "Specify index fields", "Field information"],
(that, source, index, field) => {
let tab = that.dataSources.list.find(obj => obj.name == source);
if (tab == undefined) {
return "";
} else {
let dataTable = tab.dataTable
let columnIndex = dataTable.columns.list.findIndex(obj => obj.columnName == field);
let relationIndex = dataTable.columns.list.findIndex(obj => obj.columnName == "relationId");
let record = dataTable.rows.list.find(obj => obj.itemArray[relationIndex] == index);
return record ? record.itemArray[columnIndex] : "";
}

}
);
load.close();
resolve(true);
});
});
}
});
return promise;
},
loadCss(path) {
for (let item of path) {
let link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = item;
document.getElementsByTagName('head')[0].appendChild(link);
}
}
};
Vue.prototype.$report = report;
Vue.prototype.$report = report;

+ 2
- 2
vue.config.js Näytä tiedosto

@@ -26,8 +26,8 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
outputDir: 'dist',
publicPath: '/OA/Manhour2',
outputDir: 'dist2',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,

Loading…
Peruuta
Tallenna