Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NEW-MT-WD-DESKTOP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶进
NEW-MT-WD-DESKTOP
Commits
2813d7d8
Commit
2813d7d8
authored
Nov 23, 2020
by
陶进
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交一下
parent
528ab007
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
6374 additions
and
5170 deletions
+6374
-5170
src/assist/axios.js
src/assist/axios.js
+5
-9
src/assist/dictionary.js
src/assist/dictionary.js
+1505
-1503
src/assist/loadVue.js
src/assist/loadVue.js
+21
-15
src/static/images/empty.png
src/static/images/empty.png
+0
-0
src/views/main_views/indexManage/components/calculater/calculater.js
...ain_views/indexManage/components/calculater/calculater.js
+908
-924
src/views/main_views/indexManage/components/condition/index.css
...ews/main_views/indexManage/components/condition/index.css
+0
-0
src/views/main_views/indexManage/components/condition/index.js
...iews/main_views/indexManage/components/condition/index.js
+42
-40
src/views/main_views/indexManage/indexManage.css
src/views/main_views/indexManage/indexManage.css
+265
-0
src/views/main_views/indexManage/indexManage.html
src/views/main_views/indexManage/indexManage.html
+58
-21
src/views/main_views/indexManage/indexManage.js
src/views/main_views/indexManage/indexManage.js
+1033
-0
src/views/main_views/indexManage/routers/categoryAudit/categoryAudit.js
..._views/indexManage/routers/categoryAudit/categoryAudit.js
+10
-24
src/views/main_views/indexManage/routers/indexAudit/indexAudit.js
...s/main_views/indexManage/routers/indexAudit/indexAudit.js
+20
-33
src/views/main_views/indexManage/routers/indexRecord/indexRecord.js
...main_views/indexManage/routers/indexRecord/indexRecord.js
+9
-22
src/views/main_views/indexManage/routers/myIndex/myIndex.js
src/views/main_views/indexManage/routers/myIndex/myIndex.js
+24
-40
src/views/main_views/indexManage/routers/myIndex/myIndex.vue
src/views/main_views/indexManage/routers/myIndex/myIndex.vue
+1
-1
src/views/main_views/indexManage/routers/publicIndex/publicIndex.js
...main_views/indexManage/routers/publicIndex/publicIndex.js
+28
-92
src/views/main_views/indexManage/routers/publicIndex/publicIndex.vue
...ain_views/indexManage/routers/publicIndex/publicIndex.vue
+1
-1
src/views/main_views/indexManage/routers/routers.js
src/views/main_views/indexManage/routers/routers.js
+0
-17
src/views/main_views/report/report.html
src/views/main_views/report/report.html
+9
-6
src/views/main_views/report/report.js
src/views/main_views/report/report.js
+1
-1
src/views/main_views/stockMarket/routers/main/main.js
src/views/main_views/stockMarket/routers/main/main.js
+360
-367
src/views/main_views/stockMarket/routers/router.js
src/views/main_views/stockMarket/routers/router.js
+2
-15
src/views/main_views/stockMarket/stockMarket.html
src/views/main_views/stockMarket/stockMarket.html
+39
-24
src/views/main_views/szxData/routers/main/main.js
src/views/main_views/szxData/routers/main/main.js
+1983
-1984
src/views/main_views/szxData/routers/router.js
src/views/main_views/szxData/routers/router.js
+8
-10
src/views/main_views/szxData/szxData.html
src/views/main_views/szxData/szxData.html
+42
-21
No files found.
src/assist/axios.js
View file @
2813d7d8
const
{
app
}
=
require
(
'
electron
'
).
remote
const
axios
=
require
(
'
axios
'
)
const
path
=
app
.
getAppPath
()
const
baseUrl
=
require
(
path
+
'
/build_config/url
'
).
baseUrl
const
{
BrowserWindow
}
=
require
(
'
electron
'
).
remote
const
axios
=
require
(
"
axios
"
)
const
baseUrl
=
require
(
app
.
getAppPath
()
+
'
/build_config/url
'
).
baseUrl
var
info
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userInfo
'
))
console
.
log
(
info
)
var
net
=
axios
.
create
({
baseURL
:
baseUrl
,
timeout
:
1000000
});
var
netPost
=
function
(
url
,
data
)
{
return
net
.
post
(
url
,
{
'
Token
'
:
info
.
token
,
...
...
@@ -77,7 +72,8 @@ net.interceptors.response.use(function (res) {
// 对响应错误做点什么
return
Promise
.
reject
(
error
)
})
module
.
exports
=
{
netPost
function
newHttp
(){
return
{
netPost
:
netPost
}
}
// export default axios
src/assist/dictionary.js
View file @
2813d7d8
module
.
exports
=
{
assetsSheet
:
function
(){
function
getDictionary
()
{
return
{
assetsSheet
:
function
()
{
return
{
F001D
:
[
'
报告年度
'
,
false
,
false
],
ENDDATE
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -114,7 +115,7 @@ module.exports = {
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
]
}
},
basicInfo
:
function
()
{
basicInfo
:
function
()
{
return
[
{
ORGNAME
:
'
机构名称
'
...
...
@@ -161,7 +162,7 @@ module.exports = {
}
]
},
topBrass
:
function
()
{
topBrass
:
function
()
{
return
{
DECLAREDATE
:
'
公告日期
'
,
F002V
:
'
姓名
'
,
...
...
@@ -175,7 +176,7 @@ module.exports = {
F019V
:
'
个人简介
'
}
},
stockChangesHistory
:
function
()
{
stockChangesHistory
:
function
()
{
return
{
VARYDATE
:
'
变动日期
'
,
F003N
:
'
变动后总股本(万股)
'
,
...
...
@@ -186,7 +187,7 @@ module.exports = {
DECLAREDATE
:
'
公告日期
'
}
},
stockChangesDetail
:
function
()
{
stockChangesDetail
:
function
()
{
return
{
VARYDATE
:
[
'
变动日期
'
,
false
,
false
],
F002V
:
[
'
变动原因
'
,
false
,
false
],
...
...
@@ -229,7 +230,7 @@ module.exports = {
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
]
}
},
toppTenHolder
:
function
()
{
toppTenHolder
:
function
()
{
return
{
F001N
:
'
名次
'
,
F002V
:
'
股东名称
'
,
...
...
@@ -239,7 +240,7 @@ module.exports = {
F011V
:
'
股本性质
'
}
},
stockFocus
:
function
()
{
stockFocus
:
function
()
{
return
{
ENDDATE
:
'
截止日期
'
,
F001N
:
'
股东总户数
'
,
...
...
@@ -247,7 +248,7 @@ module.exports = {
F008N
:
'
户均持股比例
'
}
},
holderFrozen
:
function
()
{
holderFrozen
:
function
()
{
return
{
DECLAREDATE
:
'
公告日期
'
,
F010D
:
'
冻结起始日
'
,
...
...
@@ -260,7 +261,7 @@ module.exports = {
// F009V: '冻结事项'
}
},
holderPledge
:
function
()
{
holderPledge
:
function
()
{
return
{
DECLAREDATE
:
'
公告日期
'
,
F009D
:
'
质押起始日
'
,
...
...
@@ -273,7 +274,7 @@ module.exports = {
// F008V: '质押事项'
}
},
controller
:
function
()
{
controller
:
function
()
{
return
{
ENDDATE
:
'
截止日期
'
,
F002V
:
'
实际控制人名称
'
,
...
...
@@ -285,7 +286,7 @@ module.exports = {
F014V
:
'
实际控制人类型
'
}
},
historyPrice
:
function
()
{
historyPrice
:
function
()
{
return
{
TRADEDATE
:
'
交易日期
'
,
F002N
:
'
昨日收盘价
'
,
...
...
@@ -302,7 +303,7 @@ module.exports = {
F021N
:
'
流通股本
'
}
},
historyListPrice
:
function
()
{
historyListPrice
:
function
()
{
return
{
SECNAME
:
'
公司名称
'
,
TRADEDATE
:
'
交易日期
'
,
...
...
@@ -320,7 +321,7 @@ module.exports = {
F021N
:
'
流通股本
'
}
},
financing
:
function
()
{
financing
:
function
()
{
return
{
TRADEDATE
:
[
'
交易日期
'
,
false
],
F001N
:
[
'
融资余额
'
,
true
],
...
...
@@ -331,14 +332,14 @@ module.exports = {
F009N
:
[
'
融资融券余额
'
,
true
]
}
},
specialTip
:
function
()
{
specialTip
:
function
()
{
return
{
F005D
:
'
发生日期
'
,
F004V
:
'
事件种类
'
,
F006V
:
'
事件内容
'
}
},
publicMessage
:
function
()
{
publicMessage
:
function
()
{
return
{
F003C
:
'
交易类型
'
,
F004N
:
'
排名
'
,
...
...
@@ -347,7 +348,7 @@ module.exports = {
F007N
:
'
卖出金额
'
}
},
financialSummary
:
function
()
{
financialSummary
:
function
()
{
return
{
SECCODE
:
[
'
证券代码
'
,
false
,
false
],
SECNAME
:
[
'
证券简称
'
,
false
,
false
],
...
...
@@ -411,7 +412,7 @@ module.exports = {
F060N
:
[
'
每股经营现金流量
'
,
false
,
false
]
}
},
financialSummaryWhere
:
function
()
{
financialSummaryWhere
:
function
()
{
return
{
hs_profit_statement
:
[
'
SECCODE
'
,
'
SECNAME
'
,
'
F001D
'
,
'
F002V
'
,
'
F003V
'
,
'
F035N
'
,
'
F052N
'
,
'
F036N
'
,
'
F018N
'
,
'
F058N
'
,
'
F024N
'
,
'
F027N
'
,
'
F028N
'
,
'
F056N
'
],
hs_balance_sheet
:
[
'
F019N
'
,
'
F025N
'
,
'
F023N
'
,
'
F038N
'
,
'
F056N
'
,
'
F052N
'
,
'
F060N
'
,
'
F061N
'
,
'
F070N
'
,
'
F071N
'
],
...
...
@@ -419,7 +420,7 @@ module.exports = {
hs_financial_target
:
[
'
F081N
'
,
'
F014N
'
,
'
F067N
'
,
'
F068N
'
,
'
F016N
'
,
'
F078N
'
,
'
F017N
'
,
'
F041N
'
,
'
F042N
'
,
'
F052N
'
,
'
F053N
'
,
'
F043N
'
,
'
F023N
'
,
'
F022N
'
,
'
F025N
'
,
'
F076N
'
,
'
F077N
'
,
'
F063N
'
,
'
F004N
'
,
'
F005N
'
,
'
F006N
'
,
'
F008N
'
,
'
F007N
'
,
'
F059N
'
,
'
F060N
'
]
}
},
profitSheet
:
function
()
{
profitSheet
:
function
()
{
return
{
STARTDATE
:
[
'
开始日期
'
,
false
,
false
],
ENDDATE
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -475,7 +476,7 @@ module.exports = {
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
]
}
},
cashSheet
:
function
()
{
cashSheet
:
function
()
{
return
{
STARTDATE
:
[
'
开始日期
'
,
false
,
false
],
ENDDATE
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -570,7 +571,7 @@ module.exports = {
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
]
}
},
financeAssetsSheet
:
function
()
{
financeAssetsSheet
:
function
()
{
return
{
ENDDATE
:
[
'
截止日期
'
,
false
,
false
],
F001D
:
[
'
报告年度
'
,
false
,
false
],
...
...
@@ -677,7 +678,7 @@ module.exports = {
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
]
}
},
financeProfitSheet
:
function
()
{
financeProfitSheet
:
function
()
{
return
{
STARTDATE
:
[
'
开始日期
'
,
false
,
false
],
ENDDATE
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -739,7 +740,7 @@ module.exports = {
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
]
}
},
financeCashSheet
:
function
()
{
financeCashSheet
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -837,7 +838,7 @@ module.exports = {
'
DECLAREDATE
'
:
[
'
公告日期
'
,
false
,
false
]
}
},
everyStockIndex
:
function
()
{
everyStockIndex
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -853,7 +854,7 @@ module.exports = {
'
F010N
'
:
[
'
每股资本公积金
'
,
true
,
false
]
}
},
profitAbility
:
function
()
{
profitAbility
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -872,7 +873,7 @@ module.exports = {
'
F021N
'
:
[
'
三费比重
'
,
true
,
false
]
}
},
operateAbility
:
function
()
{
operateAbility
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -891,7 +892,7 @@ module.exports = {
'
F032N
'
:
[
'
股东权益周转率
'
,
true
,
false
]
}
},
assetsStructure
:
function
()
{
assetsStructure
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -908,7 +909,7 @@ module.exports = {
'
F041N
'
:
[
'
资产负债比率
'
,
true
,
false
]
}
},
debtPayingAbility
:
function
()
{
debtPayingAbility
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -926,7 +927,7 @@ module.exports = {
'
F051N
'
:
[
'
有形资产净值债务率
'
,
true
,
false
]
}
},
growthAbility
:
function
()
{
growthAbility
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -941,7 +942,7 @@ module.exports = {
'
F058N
'
:
[
'
营业利润增长率
'
,
true
,
false
]
}
},
cashFlow
:
function
()
{
cashFlow
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -956,7 +957,7 @@ module.exports = {
'
F065N
'
:
[
'
全部资产现金回收率
'
,
true
,
false
]
}
},
profitQuality
:
function
()
{
profitQuality
:
function
()
{
return
{
'
STARTDATE
'
:
[
'
开始日期
'
,
false
,
false
],
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
...
...
@@ -979,7 +980,7 @@ module.exports = {
'
F088N
'
:
[
'
年化期间费用毛利比
'
,
true
,
false
]
}
},
dividendInfo
:
function
()
{
dividendInfo
:
function
()
{
return
{
'
F001D
'
:
[
'
分红年度
'
,
false
,
false
],
'
F002D
'
:
[
'
董事会预案公告日期
'
,
false
,
false
],
...
...
@@ -1022,7 +1023,7 @@ module.exports = {
'
F041N
'
:
[
'
汇率
'
,
false
,
false
]
}
},
historyDividend
:
function
()
{
historyDividend
:
function
()
{
return
{
F001D
:
'
分红年度
'
,
F017N
:
'
派息金额(人民币)
'
,
...
...
@@ -1031,7 +1032,7 @@ module.exports = {
FF001
:
'
派息比例(%)(计算)
'
}
},
ipo
:
function
()
{
ipo
:
function
()
{
return
{
'
F003N
'
:
[
'
总发行数量
'
,
false
,
false
],
'
F004N
'
:
[
'
公开发行数量
'
,
false
,
false
],
...
...
@@ -1143,7 +1144,7 @@ module.exports = {
'
F123V
'
:
[
'
IPO阶段进展状态
'
,
false
,
false
]
}
},
secondaryOffering
:
function
()
{
secondaryOffering
:
function
()
{
return
[
{
'
DECLAREDATE
'
:
[
'
公告日期
'
,
false
,
false
],
...
...
@@ -1274,7 +1275,7 @@ module.exports = {
}
]
},
rightsIssue
:
function
()
{
rightsIssue
:
function
()
{
return
[
{
'
DECLAREDATE
'
:
[
'
公告日期
'
,
false
,
false
],
...
...
@@ -1349,7 +1350,7 @@ module.exports = {
}
]
},
intermediary
:
function
()
{
intermediary
:
function
()
{
return
{
'
F001D
'
:
'
发行起始日
'
,
'
F003V
'
:
'
发行类别
'
,
...
...
@@ -1360,7 +1361,7 @@ module.exports = {
'
F010D
'
:
'
变更日期
'
}
},
investmentPlan
:
function
()
{
investmentPlan
:
function
()
{
return
{
'
DECLAREDATE
'
:
[
'
发行配股开始日
'
,
false
,
false
],
'
F001N
'
:
[
'
项目序号
'
,
false
,
false
],
...
...
@@ -1382,7 +1383,7 @@ module.exports = {
'
F022V
'
:
[
'
变更情况说明
'
,
false
,
false
]
}
},
totalInvestment
:
function
()
{
totalInvestment
:
function
()
{
return
{
'
DECLAREDATE
'
:
'
公告日期
'
,
'
F003V
'
:
'
发行类别
'
,
...
...
@@ -1392,7 +1393,7 @@ module.exports = {
'
SORTNAME
'
:
'
证券类别
'
}
},
seniorHolderChange
:
function
()
{
seniorHolderChange
:
function
()
{
return
{
'
ENDDATE
'
:
[
'
截止日期
'
,
false
,
false
],
'
DECLAREDATE
'
:
[
'
公告日期
'
,
false
,
false
],
...
...
@@ -1409,7 +1410,7 @@ module.exports = {
'
F010V
'
:
[
'
持股变动原因
'
,
false
,
false
]
}
},
holdersMeeting
:
function
()
{
holdersMeeting
:
function
()
{
return
{
'
DECLAREDATE
'
:
'
公告日期
'
,
'
F001D
'
:
'
会议召开日期
'
,
...
...
@@ -1417,7 +1418,7 @@ module.exports = {
'
F006V
'
:
'
会议召开地点
'
}
},
importantHolderChange
:
function
()
{
importantHolderChange
:
function
()
{
return
{
'
DECLAREDATE
'
:
[
'
公告日期
'
,
false
,
false
],
'
varydate
'
:
[
'
增(减)持截止日
'
,
false
,
false
],
...
...
@@ -1429,7 +1430,7 @@ module.exports = {
'
F007V
'
:
[
'
增(减)持价格上限
'
,
false
,
false
]
}
},
stockUnlimit
:
function
()
{
stockUnlimit
:
function
()
{
return
[
{
'
DECLAREDATE
'
:
'
公告日期
'
,
...
...
@@ -1450,7 +1451,7 @@ module.exports = {
}
]
},
preDisclosureTime
:
function
()
{
preDisclosureTime
:
function
()
{
return
{
'
F001D
'
:
'
报告期
'
,
'
F002D
'
:
'
预约披露日期
'
,
...
...
@@ -1460,7 +1461,7 @@ module.exports = {
'
F006D
'
:
'
实际批露日期
'
}
},
performanceForecast
:
function
()
{
performanceForecast
:
function
()
{
return
{
'
DECLAREDATE
'
:
[
'
公告日期
'
,
false
,
false
],
'
F001D
'
:
[
'
报告年度
'
,
false
,
false
],
...
...
@@ -1474,7 +1475,7 @@ module.exports = {
'
F010N
'
:
[
'
本期净利润增减幅上限
'
,
false
,
false
]
}
},
auditOpinions
:
function
()
{
auditOpinions
:
function
()
{
return
{
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
],
F001D
:
[
'
报告年度
'
,
false
,
false
],
...
...
@@ -1495,7 +1496,7 @@ module.exports = {
F016V
:
[
'
监事会对董事会就上述事项的说明所表示的意见
'
,
false
,
false
]
}
},
performanceShortReport
:
function
()
{
performanceShortReport
:
function
()
{
return
{
DECLAREDATE
:
[
'
公告日期
'
,
false
,
false
],
STARTDATE
:
[
'
开始日期
'
,
false
,
false
],
...
...
@@ -1510,4 +1511,5 @@ module.exports = {
F009N
:
[
'
每股净资产
'
,
false
,
false
]
}
}
}
}
src/assist/loadVue.js
View file @
2813d7d8
module
.
exports
=
(
filename
,
dirname
)
=>
{
console
.
log
(
filename
)
console
.
log
(
dirname
)
const
fs
=
require
(
'
fs
'
)
const
os
=
require
(
'
os
'
)
const
platform
=
os
.
platform
()
const
filePath
=
filename
.
replace
(
'
.js
'
,
'
.vue
'
)
const
dirName
=
dirname
.
replace
(
'
.js
'
,
'
.vue
'
)
var
name
if
(
platform
==
'
darwin
'
){
name
=
dirName
.
split
(
'
/
'
).
pop
()
}
else
{
name
=
dirName
.
split
(
'
\\
'
).
pop
()
}
var
data
=
fs
.
readFileSync
(
filePath
);
const
nodeHttp
=
require
(
'
http
'
)
async
function
getVueFile
(
url
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
nodeHttp
.
get
(
url
,
function
(
req
,
res
)
{
var
html
=
''
;
req
.
on
(
'
data
'
,
(
data
)
=>
{
html
+=
data
})
req
.
on
(
'
end
'
,
()
=>
{
resolve
(
html
)
});
req
.
on
(
'
error
'
,
(
e
)
=>
{
reject
(
e
.
message
);
});
});
});
}
async
function
loadComponent
(
name
,
url
)
{
var
data
=
await
getVueFile
(
url
)
var
str
=
data
.
toString
()
str
=
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
str
=
str
.
replace
(
'
<template>
'
,
''
)
...
...
src/static/images/empty.png
0 → 100644
View file @
2813d7d8
49.7 KB
src/views/main_views/indexManage/components/calculater/calculater.js
View file @
2813d7d8
const
fs
=
require
(
'
fs
'
)
const
os
=
require
(
'
os
'
)
const
platform
=
os
.
platform
()
const
filePath
=
__filename
.
replace
(
'
.js
'
,
'
.vue
'
)
var
name
if
(
platform
==
'
darwin
'
){
name
=
filePath
.
split
(
'
/
'
).
pop
().
replace
(
'
.vue
'
,
''
)
}
else
{
name
=
filePath
.
split
(
'
\\
'
).
pop
().
replace
(
'
.vue
'
,
''
)
}
var
data
=
fs
.
readFileSync
(
filePath
);
var
str
=
data
.
toString
()
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
str
=
str
.
replace
(
'
<template>
'
,
''
)
var
keyBord
=
require
(
'
../../lib/keyBord
'
)
var
merge
=
require
(
'
../../lib/merge
'
)
// const company = require('../../../components/indexConditions/company/company.js')
const
conditionFuns
=
require
(
'
../../lib/conditionFun
'
)
module
.
exports
=
{
name
:
name
,
async
function
getCalculater
()
{
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/components/calculater/calculater.vue
'
)
return
{
name
:
value
.
name
,
data
:
function
()
{
return
{
initIndexId
:
0
,
...
...
@@ -29,7 +11,7 @@ module.exports = {
symbolParams
:
{},
functionParams
:
{},
keybordData
:
[],
mergeTypeData
:
merge
.
mergeData
,
mergeTypeData
:
[
'
合并本期
'
,
'
合并上期
'
,
'
母公司本期
'
,
'
母公司上期
'
]
,
selectedController
:
{},
searchCompanyLoading
:
false
,
companyData
:
[],
...
...
@@ -77,14 +59,14 @@ module.exports = {
}
},
// components: {'company':company },
props
:[
'
treeData
'
,
'
type
'
],
template
:
str
,
props
:
[
'
treeData
'
,
'
type
'
],
template
:
value
.
template
,
computed
:
{
},
watch
:
{
selectedController
:
{
handler
:
function
()
{
handler
:
function
()
{
this
.
setAppointedIndexName
(
this
.
selectedController
)
},
deep
:
true
...
...
@@ -96,14 +78,14 @@ module.exports = {
this
.
setKeyboardData
()
},
methods
:
{
deleteFuncParams
(
index
)
{
deleteFuncParams
(
index
)
{
var
origin
=
this
.
selectedController
.
originParams
.
params
var
value
=
this
.
selectedController
.
paramsValue
origin
.
splice
(
index
,
1
)
value
.
splice
(
index
,
1
)
this
.
resetFuncValue
(
this
.
selectedController
)
},
addMoreParams
()
{
addMoreParams
()
{
var
origin
=
this
.
selectedController
.
originParams
.
params
var
value
=
this
.
selectedController
.
paramsValue
...
...
@@ -112,7 +94,7 @@ module.exports = {
this
.
selectedController
=
Object
.
assign
({},
this
.
selectedController
)
this
.
resetFuncValue
(
this
.
selectedController
)
},
getFuncParamsName
(
arr
)
{
getFuncParamsName
(
arr
)
{
var
obj
=
{
0
:
'
指标
'
,
1
:
'
数字
'
,
...
...
@@ -125,23 +107,23 @@ module.exports = {
})
return
newArr
.
join
(
'
或者
'
)
},
openFunctionParams
(
index
,
type
)
{
openFunctionParams
(
index
,
type
)
{
this
.
editingFuncParamsIndex
=
index
this
.
$parent
.
editFuctionType
=
type
this
.
$parent
.
editFuctionVisible
=
true
},
receiveFunctionParam
(
params
)
{
receiveFunctionParam
(
params
)
{
this
.
selectedController
.
paramsValue
[
this
.
editingFuncParamsIndex
]
=
params
this
.
selectedController
=
Object
.
assign
({},
this
.
selectedController
)
this
.
resetFuncValue
(
this
.
selectedController
)
console
.
log
(
this
.
selectedController
)
},
resetActiveInput
()
{
resetActiveInput
()
{
document
.
getElementById
(
this
.
selectedController
.
id
).
classList
.
add
(
'
active
'
)
},
//重新设置指定id的方法的value
resetFuncValue
(
selectedController
)
{
resetFuncValue
(
selectedController
)
{
var
id
=
selectedController
.
id
var
dom
=
document
.
getElementById
(
id
)
var
arr
=
[]
...
...
@@ -149,39 +131,40 @@ module.exports = {
var
text
=
this
.
getShowDomText
(
item
.
showDom
)
arr
.
push
(
text
)
})
var
name
=
selectedController
.
key
.
replace
(
'
( )
'
,
''
)
var
name
=
selectedController
.
key
.
replace
(
'
( )
'
,
''
)
var
value
=
name
+
'
(
'
+
arr
.
join
(
'
,
'
)
+
'
)
'
dom
.
style
.
width
=
this
.
getInputLength
(
value
)
+
'
px
'
dom
.
setAttribute
(
'
value
'
,
value
)
},
changeFuncParams
(
index
)
{
changeFuncParams
(
index
)
{
console
.
log
(
this
.
selectedController
)
console
.
log
(
index
)
this
.
$parent
.
editFuctionVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
//要先注入参数
this
.
$parent
.
resetFuncParams
(
this
.
selectedController
,
index
)
})
},
getShowDomText
(
html
)
{
getShowDomText
(
html
)
{
var
div
=
document
.
createElement
(
'
div
'
)
if
(
html
)
{
if
(
html
)
{
div
.
innerHTML
=
html
return
div
.
innerText
}
else
{
}
else
{
return
'
未设置
'
}
},
//设置方法的参数
setKeyboardData
()
{
if
(
this
.
type
==
'
index
'
)
{
this
.
keybordData
=
keyBord
.
keybordData
}
else
if
(
this
.
type
==
'
function
'
)
{
this
.
keybordData
=
keyBord
.
functionKeybord
setKeyboardData
()
{
if
(
this
.
type
==
'
index
'
)
{
this
.
keybordData
=
mytools
.
getKeyboard
()
.
keybordData
}
else
if
(
this
.
type
==
'
function
'
)
{
this
.
keybordData
=
mytools
.
getKeyboard
()
.
functionKeybord
}
console
.
log
(
this
.
keybordData
)
},
//向父组件传递数据
sendDataToHost
(
saveData
)
{
sendDataToHost
(
saveData
)
{
var
content
=
document
.
getElementById
(
this
.
contentId
)
var
inputs
=
content
.
getElementsByTagName
(
'
input
'
)
var
params
=
{
...
...
@@ -207,13 +190,13 @@ module.exports = {
})
params
.
dom
=
content
.
innerHTML
params
.
showDom
=
this
.
changeInputToSpan
(
inputs
)
if
(
!
saveData
)
{
if
(
!
saveData
)
{
this
.
initCalData
()
}
return
params
},
//重置所有参数
initCalData
()
{
initCalData
()
{
this
.
indexParams
=
{}
this
.
numParams
=
{}
this
.
dateParams
=
{}
...
...
@@ -224,7 +207,7 @@ module.exports = {
this
.
removeAllActive
()
this
.
selectedController
=
{}
},
changeInputToSpan
(
inputs
)
{
changeInputToSpan
(
inputs
)
{
var
div
=
document
.
createElement
(
'
div
'
)
Array
.
from
(
inputs
).
forEach
(
item
=>
{
var
span
=
document
.
createElement
(
'
span
'
)
...
...
@@ -236,19 +219,19 @@ module.exports = {
this
.
formatShowDom
(
spans
)
return
div
.
innerHTML
},
formatShowDom
(
spans
)
{
formatShowDom
(
spans
)
{
var
brackets
=
[]
var
numArea
=
[]
Array
.
from
(
spans
).
forEach
(
item
=>
{
var
value
=
item
.
innerText
var
br
=
document
.
createElement
(
'
br
'
)
if
(
'
()&&||
'
.
indexOf
(
value
)
>=
0
||
(
item
.
nextSibling
&&
'
()&&||
'
.
indexOf
(
item
.
nextSibling
.
innerText
)
>=
0
))
{
this
.
insertAfter
(
br
,
item
)
if
(
'
()&&||
'
.
indexOf
(
value
)
>=
0
||
(
item
.
nextSibling
&&
'
()&&||
'
.
indexOf
(
item
.
nextSibling
.
innerText
)
>=
0
))
{
this
.
insertAfter
(
br
,
item
)
}
})
Array
.
from
(
spans
).
forEach
((
item
,
index
)
=>
{
var
value
=
item
.
innerText
if
(
value
==
'
(
'
||
value
==
'
)
'
)
{
if
(
value
==
'
(
'
||
value
==
'
)
'
)
{
brackets
.
push
({
indet
:
0
,
from
:
item
,
...
...
@@ -258,28 +241,28 @@ module.exports = {
}
})
brackets
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
brackets
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
item
.
indent
=
0
var
text
=
this
.
createAppointedText
(
item
.
indent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
else
{
}
else
{
var
newIndent
=
brackets
[
index
-
1
].
indent
if
(
brackets
[
index
-
1
].
value
!==
item
.
value
)
{
if
(
brackets
[
index
-
1
].
value
!==
item
.
value
)
{
item
.
indent
=
newIndent
var
text
=
this
.
createAppointedText
(
newIndent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
else
{
if
(
item
.
value
==
'
(
'
)
{
}
else
{
if
(
item
.
value
==
'
(
'
)
{
item
.
indent
=
newIndent
+
4
}
else
{
}
else
{
item
.
indent
=
newIndent
-
4
}
var
text
=
this
.
createAppointedText
(
item
.
indent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
numArea
.
push
({
start
:
brackets
[
index
-
1
].
originIndex
,
start
:
brackets
[
index
-
1
].
originIndex
,
end
:
item
.
originIndex
,
indent
:
brackets
[
index
-
1
].
indent
,
value
:
brackets
[
index
-
1
].
value
...
...
@@ -289,13 +272,13 @@ module.exports = {
Array
.
from
(
spans
).
forEach
((
item
,
index
)
=>
{
var
value
=
item
.
innerText
if
(
value
!==
'
(
'
&&
value
!==
'
)
'
&&
item
.
previousSibling
&&
item
.
previousSibling
.
nodeName
==
'
BR
'
)
{
if
(
value
!==
'
(
'
&&
value
!==
'
)
'
&&
item
.
previousSibling
&&
item
.
previousSibling
.
nodeName
==
'
BR
'
)
{
numArea
.
forEach
(
area
=>
{
if
(
index
>
area
.
start
&&
index
<
area
.
end
)
{
if
(
index
>
area
.
start
&&
index
<
area
.
end
)
{
var
newIndent
if
(
area
.
value
==
'
(
'
)
{
if
(
area
.
value
==
'
(
'
)
{
newIndent
=
area
.
indent
+
4
}
else
{
}
else
{
newIndent
=
area
.
indent
}
var
text
=
this
.
createAppointedText
(
newIndent
)
...
...
@@ -305,7 +288,7 @@ module.exports = {
}
})
},
formatGrammar
()
{
formatGrammar
()
{
var
noOtherContent
=
this
.
emptyOtherText
()
//获取清空多余字段后的内容
this
.
selectAllContent
()
//选中整个输入框
var
formatContent
=
document
.
createElement
(
'
div
'
)
...
...
@@ -315,8 +298,8 @@ module.exports = {
Array
.
from
(
inputs
).
forEach
(
item
=>
{
var
value
=
item
.
value
var
br
=
document
.
createElement
(
'
br
'
)
if
(
'
()&&||+-*/
'
.
indexOf
(
value
)
>=
0
||
(
item
.
nextSibling
&&
'
()&&||+-*/
'
.
indexOf
(
item
.
nextSibling
.
value
)
>=
0
))
{
this
.
insertAfter
(
br
,
item
)
if
(
'
()&&||+-*/
'
.
indexOf
(
value
)
>=
0
||
(
item
.
nextSibling
&&
'
()&&||+-*/
'
.
indexOf
(
item
.
nextSibling
.
value
)
>=
0
))
{
this
.
insertAfter
(
br
,
item
)
}
})
//此时得出一个没有缩进的内容
...
...
@@ -324,12 +307,12 @@ module.exports = {
document
.
execCommand
(
'
insertHTML
'
,
false
,
formatContent
.
innerHTML
)
return
true
},
findAllbrackets
(
inputs
)
{
findAllbrackets
(
inputs
)
{
var
brackets
=
[]
var
numArea
=
[]
Array
.
from
(
inputs
).
forEach
((
item
,
index
)
=>
{
var
value
=
item
.
value
if
(
value
==
'
(
'
||
value
==
'
)
'
)
{
if
(
value
==
'
(
'
||
value
==
'
)
'
)
{
brackets
.
push
({
indet
:
0
,
from
:
item
,
...
...
@@ -338,28 +321,28 @@ module.exports = {
})
}
})
brackets
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
brackets
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
item
.
indent
=
0
var
text
=
this
.
createAppointedText
(
item
.
indent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
else
{
}
else
{
var
newIndent
=
brackets
[
index
-
1
].
indent
if
(
brackets
[
index
-
1
].
value
!==
item
.
value
)
{
if
(
brackets
[
index
-
1
].
value
!==
item
.
value
)
{
item
.
indent
=
newIndent
var
text
=
this
.
createAppointedText
(
newIndent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
else
{
if
(
item
.
value
==
'
(
'
)
{
}
else
{
if
(
item
.
value
==
'
(
'
)
{
item
.
indent
=
newIndent
+
4
}
else
{
}
else
{
item
.
indent
=
newIndent
-
4
}
var
text
=
this
.
createAppointedText
(
item
.
indent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
numArea
.
push
({
start
:
brackets
[
index
-
1
].
originIndex
,
start
:
brackets
[
index
-
1
].
originIndex
,
end
:
item
.
originIndex
,
indent
:
brackets
[
index
-
1
].
indent
,
value
:
brackets
[
index
-
1
].
value
...
...
@@ -369,13 +352,13 @@ module.exports = {
Array
.
from
(
inputs
).
forEach
((
item
,
index
)
=>
{
var
value
=
item
.
value
if
(
value
!==
'
(
'
&&
value
!==
'
)
'
&&
item
.
previousSibling
&&
item
.
previousSibling
.
nodeName
==
'
BR
'
)
{
if
(
value
!==
'
(
'
&&
value
!==
'
)
'
&&
item
.
previousSibling
&&
item
.
previousSibling
.
nodeName
==
'
BR
'
)
{
numArea
.
forEach
(
area
=>
{
if
(
index
>
area
.
start
&&
index
<
area
.
end
)
{
if
(
index
>
area
.
start
&&
index
<
area
.
end
)
{
var
newIndent
if
(
area
.
value
==
'
(
'
)
{
if
(
area
.
value
==
'
(
'
)
{
newIndent
=
area
.
indent
+
4
}
else
{
}
else
{
newIndent
=
area
.
indent
}
var
text
=
this
.
createAppointedText
(
newIndent
)
...
...
@@ -385,35 +368,35 @@ module.exports = {
}
})
},
createAppointedText
(
num
)
{
createAppointedText
(
num
)
{
var
str
=
''
,
text
for
(
var
i
=
0
;
i
<
num
;
i
++
)
{
str
+=
'
\
u00A0
'
for
(
var
i
=
0
;
i
<
num
;
i
++
)
{
str
+=
'
\
u00A0
'
}
text
=
document
.
createTextNode
(
str
)
return
text
},
insertAfter
(
newElement
,
targetElement
)
{
var
parent
=
targetElement
.
parentNode
if
(
parent
.
lastChild
==
targetElement
)
{
if
(
parent
.
lastChild
==
targetElement
)
{
parent
.
appendChild
(
targetElement
)
}
else
{
parent
.
insertBefore
(
newElement
,
targetElement
.
nextSibling
);
}
},
//清空多余字段并返回新的内容
emptyOtherText
()
{
emptyOtherText
()
{
var
content
=
document
.
getElementById
(
this
.
contentId
)
var
newHTML
=
''
var
inputs
=
content
.
getElementsByTagName
(
'
input
'
)
Array
.
from
(
inputs
).
forEach
(
item
=>
{
newHTML
+=
item
.
outerHTML
newHTML
+=
item
.
outerHTML
})
this
.
selectAllContent
()
return
newHTML
},
//选中整个输入框
selectAllContent
()
{
selectAllContent
()
{
var
content
=
document
.
getElementById
(
this
.
contentId
)
var
selection
=
window
.
getSelection
()
var
range
=
document
.
createRange
()
...
...
@@ -421,47 +404,47 @@ module.exports = {
selection
.
removeAllRanges
()
selection
.
addRange
(
range
)
},
setHtml
(
html
)
{
setHtml
(
html
)
{
var
content
=
document
.
getElementById
(
this
.
contentId
)
content
.
innerHTML
=
html
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
removeAllActive
()
})
},
setSelfId
()
{
setSelfId
()
{
this
.
contentId
=
this
.
createIndexId
()
},
//校验语法
checkGrammar
(
type
)
{
checkGrammar
(
type
)
{
var
content
=
document
.
getElementById
(
this
.
contentId
)
var
inputs
=
content
.
getElementsByTagName
(
'
input
'
)
var
code
=
'
var func;
'
Array
.
from
(
inputs
).
forEach
(
item
=>
{
var
str
=
item
.
value
var
type
=
item
.
getAttribute
(
'
type
'
)
if
(
item
.
getAttribute
(
'
type
'
)
==
3
)
{
//数字
str
=
str
.
replace
(
/
\[
.*
?\]
/g
,
''
)
}
else
if
(
type
==
1
)
{
//指标
if
(
item
.
getAttribute
(
'
type
'
)
==
3
)
{
//数字
str
=
str
.
replace
(
/
\[
.*
?\]
/g
,
''
)
}
else
if
(
type
==
1
)
{
//指标
str
=
'
100
'
}
else
if
(
type
==
5
)
{
//函数
}
else
if
(
type
==
5
)
{
//函数
str
=
'
func
'
}
str
.
replace
(
/
\[
.*
?\]
/g
,
''
)
code
+=
str
str
.
replace
(
/
\[
.*
?\]
/g
,
''
)
code
+=
str
})
console
.
log
(
code
)
var
isPass
=
false
setTimeout
(()
=>
{
if
(
isPass
)
{
setTimeout
(()
=>
{
if
(
isPass
)
{
if
(
type
==
'
tip
'
)
{
if
(
type
==
'
tip
'
)
{
this
.
$message
({
message
:
'
语法校验通过
'
,
type
:
'
success
'
})
}
}
else
{
}
else
{
this
.
$message
({
message
:
'
语法校验未通过
'
,
type
:
'
error
'
...
...
@@ -473,7 +456,7 @@ module.exports = {
return
isPass
},
//复制元素
copyIndex
()
{
copyIndex
()
{
this
.
copiedController
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
selectedController
))
this
.
$message
({
message
:
'
当前元素已复制到剪切板
'
,
...
...
@@ -481,7 +464,7 @@ module.exports = {
})
},
//粘贴元素
pasteIndex
()
{
pasteIndex
()
{
switch
(
this
.
copiedController
.
type
)
{
case
1
:
//指标
this
.
insertIndex
(
this
.
copiedController
)
...
...
@@ -500,8 +483,8 @@ module.exports = {
break
;
}
},
pasteFunc
(
copiedController
)
{
var
funcName
=
copiedController
.
key
.
replace
(
'
( )
'
,
''
)
pasteFunc
(
copiedController
)
{
var
funcName
=
copiedController
.
key
.
replace
(
'
( )
'
,
''
)
var
arr
=
[]
copiedController
.
paramsValue
.
forEach
(
item
=>
{
var
text
=
this
.
getShowDomText
(
item
.
showDom
)
...
...
@@ -513,13 +496,13 @@ module.exports = {
this
.
setRange
()
var
id
=
this
.
createIndexId
()
var
width
=
this
.
getInputLength
(
value
)
+
'
px
'
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="5" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
value
+
'
" />
'
))
{
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="5" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
value
+
'
" />
'
))
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
})
}
else
{
}
else
{
var
newFuncObj
=
JSON
.
parse
(
JSON
.
stringify
(
copiedController
))
newFuncObj
.
id
=
id
this
.
functionParams
[
id
]
=
newFuncObj
...
...
@@ -529,12 +512,12 @@ module.exports = {
}
})
},
filterTreeNode
(
value
,
data
)
{
filterTreeNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
Name
.
indexOf
(
value
)
!==
-
1
;
},
//过滤指标
filterIndexText
()
{
filterIndexText
()
{
this
.
$refs
.
tree
.
filter
(
this
.
filterInput
);
},
//搜索公司
...
...
@@ -568,54 +551,54 @@ module.exports = {
that
.
searchCompanyLoading
=
false
})
},
inputKeydown
(
event
)
{
if
(
event
.
code
!==
'
Backspace
'
inputKeydown
(
event
)
{
if
(
event
.
code
!==
'
Backspace
'
&&
event
.
code
!==
'
Space
'
&&
event
.
code
!==
'
ArrowUp
'
&&
event
.
code
!==
'
ArrowDown
'
&&
event
.
code
!==
'
ArrowLeft
'
&&
event
.
code
!==
'
ArrowRight
'
)
{
if
(
event
.
code
==
'
Enter
'
)
{
)
{
if
(
event
.
code
==
'
Enter
'
)
{
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<br>
'
)
event
.
preventDefault
();
}
else
{
}
else
{
event
.
preventDefault
();
}
}
else
{
}
else
{
}
},
//指标点击事件
contentClick
(
e
)
{
if
(
e
.
target
.
classList
.
contains
(
'
cal-index
'
))
{
contentClick
(
e
)
{
if
(
e
.
target
.
classList
.
contains
(
'
cal-index
'
))
{
var
id
=
e
.
target
.
id
var
type
=
e
.
target
.
getAttribute
(
'
type
'
)
this
.
setController
(
id
,
type
)
this
.
removeAllActive
()
e
.
target
.
classList
.
add
(
'
active
'
)
}
else
{
}
else
{
this
.
removeAllActive
()
this
.
selectedController
=
{}
}
},
//设置右侧面板
setController
(
id
,
type
)
{
setController
(
id
,
type
)
{
var
type
=
parseInt
(
type
)
if
(
type
==
1
)
{
if
(
type
==
1
)
{
this
.
selectedController
=
this
.
indexParams
[
id
]
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
this
.
selectedController
=
this
.
dateParams
[
id
]
}
else
if
(
type
==
3
)
{
}
else
if
(
type
==
3
)
{
this
.
selectedController
=
this
.
numParams
[
id
]
}
else
if
(
type
==
4
)
{
}
else
if
(
type
==
4
)
{
this
.
selectedController
=
this
.
symbolParams
[
id
]
}
else
if
(
type
==
5
)
{
}
else
if
(
type
==
5
)
{
this
.
selectedController
=
this
.
functionParams
[
id
]
}
},
//清除所有的active
removeAllActive
()
{
removeAllActive
()
{
var
containers
=
document
.
getElementsByClassName
(
'
calculater-display
'
)
Array
.
from
(
containers
).
forEach
(
item
=>
{
var
indexs
=
item
.
getElementsByClassName
(
'
cal-index
'
)
...
...
@@ -625,9 +608,9 @@ module.exports = {
})
},
//keybord点击事件
clickCalText
(
e
,
item
)
{
clickCalText
(
e
,
item
)
{
var
select
=
window
.
getSelection
()
if
(
select
.
type
==
'
None
'
)
{
if
(
select
.
type
==
'
None
'
)
{
this
.
$message
({
message
:
'
请先定位光标!
'
,
type
:
'
warning
'
...
...
@@ -658,7 +641,7 @@ module.exports = {
break
;
}
},
getNosetFuncValue
(
item
)
{
getNosetFuncValue
(
item
)
{
var
arr
=
[]
// if(item.isLimited){
// item.params.forEach(child => {
...
...
@@ -673,20 +656,20 @@ module.exports = {
return
arr
.
join
(
'
,
'
)
},
//插入方法
insertFunction
(
item
)
{
insertFunction
(
item
)
{
console
.
log
(
item
)
var
funcName
=
item
.
key
.
replace
(
'
( )
'
,
''
)
var
funcName
=
item
.
key
.
replace
(
'
( )
'
,
''
)
var
value
=
funcName
+
'
(
'
+
this
.
getNosetFuncValue
(
item
)
+
'
)
'
this
.
setRange
()
var
id
=
this
.
createIndexId
()
var
width
=
this
.
getInputLength
(
value
)
+
'
px
'
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="5" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
value
+
'
" />
'
))
{
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="5" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
value
+
'
" />
'
))
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
})
}
else
{
}
else
{
this
.
functionParams
[
id
]
=
{
value
:
item
.
key
,
key
:
item
.
key
,
...
...
@@ -695,7 +678,7 @@ module.exports = {
originParams
:
JSON
.
parse
(
JSON
.
stringify
(
item
)),
paramsValue
:
[]
}
item
.
params
.
forEach
((
item
,
index
)
=>
{
item
.
params
.
forEach
((
item
,
index
)
=>
{
this
.
functionParams
[
id
].
paramsValue
[
index
]
=
{}
})
// this.selectedController = this.functionParams[id]
...
...
@@ -706,9 +689,9 @@ module.exports = {
})
},
//指标树点击事件
treeNodeClick
(
obj
)
{
if
(
obj
.
DataType
!==
'
T
'
)
{
var
condition
=
conditionFun
s
.
getIndexType
(
obj
)
treeNodeClick
(
obj
)
{
if
(
obj
.
DataType
!==
'
T
'
)
{
var
condition
=
tool
s
.
getIndexType
(
obj
)
this
.
selectedIndex
=
{
type
:
1
,
name
:
obj
.
Name
,
...
...
@@ -728,23 +711,23 @@ module.exports = {
needReportData
:
condition
.
needReportData
,
needCompany
:
condition
.
needCompany
}
}
else
{
}
else
{
return
false
}
},
//保存光标位置
saveRange
()
{
saveRange
()
{
var
selection
=
window
.
getSelection
()
var
range
=
selection
.
getRangeAt
(
0
)
this
.
range
=
range
.
cloneRange
()
},
//输出光标位置
setRange
()
{
setRange
()
{
var
selection
=
window
.
getSelection
()
selection
.
removeAllRanges
()
if
(
this
.
range
)
{
if
(
this
.
range
)
{
selection
.
addRange
(
this
.
range
)
}
else
{
}
else
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
...
...
@@ -752,18 +735,18 @@ module.exports = {
}
},
//插入指标事件
insertIndex
(
selectedIndex
)
{
insertIndex
(
selectedIndex
)
{
this
.
setRange
()
var
id
=
this
.
createIndexId
()
var
text
=
conditionFun
s
.
getFullIndexName
(
selectedIndex
)
var
text
=
tool
s
.
getFullIndexName
(
selectedIndex
)
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="1" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
))
{
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="1" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
))
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
})
}
else
{
}
else
{
this
.
indexParams
[
id
]
=
JSON
.
parse
(
JSON
.
stringify
(
selectedIndex
))
this
.
indexParams
[
id
].
id
=
id
this
.
selectedController
=
this
.
indexParams
[
id
]
...
...
@@ -774,18 +757,18 @@ module.exports = {
this
.
addIndexVisible
=
false
},
//插入数字
insertNum
(
selectedNum
)
{
insertNum
(
selectedNum
)
{
this
.
setRange
()
var
id
=
this
.
createIndexId
()
var
text
=
selectedNum
+
"
[
"
+
this
.
getFormatValue
(
selectedNum
)
+
"
]
"
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="3" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
))
{
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="3" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
))
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
})
}
else
{
}
else
{
this
.
numParams
[
id
]
=
{
type
:
3
,
value
:
selectedNum
,
...
...
@@ -799,18 +782,18 @@ module.exports = {
this
.
addNumVisible
=
false
},
//插入日期
insertDate
(
selectedDate
)
{
insertDate
(
selectedDate
)
{
this
.
setRange
()
var
id
=
this
.
createIndexId
()
var
text
=
selectedDate
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="2" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
))
{
this
.
$nextTick
(()
=>
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index" type="2" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
))
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
})
}
else
{
}
else
{
this
.
dateParams
[
id
]
=
{
type
:
2
,
value
:
selectedDate
,
...
...
@@ -824,11 +807,11 @@ module.exports = {
this
.
addDateVisible
=
false
},
//插入计算符号
insertSymbol
(
item
)
{
insertSymbol
(
item
)
{
this
.
setRange
()
var
id
=
this
.
createIndexId
()
var
width
=
this
.
getInputLength
(
item
.
key
)
+
'
px
'
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
//加入额外的样式
var
moreClass
=
''
switch
(
item
.
key
)
{
...
...
@@ -838,12 +821,12 @@ module.exports = {
default
:
break
;
}
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index
'
+
moreClass
+
'
" type="4" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
item
.
key
+
'
" />
'
))
{
if
(
!
document
.
execCommand
(
'
insertHTML
'
,
false
,
'
<input readonly class="cal-index
'
+
moreClass
+
'
" type="4" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
item
.
key
+
'
" />
'
))
{
this
.
$message
({
message
:
'
请先在输入区定位光标!
'
,
type
:
'
warning
'
})
}
else
{
}
else
{
this
.
symbolParams
[
id
]
=
{
value
:
item
.
key
,
key
:
item
.
key
,
...
...
@@ -857,18 +840,18 @@ module.exports = {
})
},
//数字格式化
getFormatValue
(
value
)
{
getFormatValue
(
value
)
{
var
unit
=
''
,
num
=
1
if
(
value
<
10000
)
{
if
(
value
<
10000
)
{
unit
=
''
,
num
=
1
}
else
if
(
10000
<=
value
&&
value
<
100000000
)
{
}
else
if
(
10000
<=
value
&&
value
<
100000000
)
{
unit
=
'
万
'
,
num
=
10000
}
else
if
(
100000000
<=
value
&&
value
<
1000000000000
)
{
}
else
if
(
100000000
<=
value
&&
value
<
1000000000000
)
{
unit
=
'
亿
'
,
num
=
100000000
}
else
if
(
value
>=
1000000000000
)
{
}
else
if
(
value
>=
1000000000000
)
{
unit
=
'
万亿
'
,
num
=
1000000000000
}
return
(
value
/
num
).
toFixed
(
0
)
+
unit
return
(
value
/
num
).
toFixed
(
0
)
+
unit
},
// getFullIndexName (index) {
// var indexName = index.name, merge = '', company = '', year = '', quarter = ''
...
...
@@ -892,19 +875,19 @@ module.exports = {
// }
// return indexName + year + quarter + merge + company
// },
setAppointedIndexName
(
index
)
{
setAppointedIndexName
(
index
)
{
var
id
=
index
.
id
var
type
=
index
.
type
var
indexDom
=
document
.
getElementById
(
id
)
switch
(
type
)
{
case
1
:
//1是指标
indexDom
.
setAttribute
(
'
value
'
,
conditionFun
s
.
getFullIndexName
(
index
))
indexDom
.
setAttribute
(
'
value
'
,
tool
s
.
getFullIndexName
(
index
))
var
value
=
indexDom
.
getAttribute
(
'
value
'
)
indexDom
.
style
.
width
=
this
.
getInputLength
(
value
)
+
'
px
'
break
;
case
2
:
//2是日期
indexDom
.
setAttribute
(
'
value
'
,
index
.
value
)
indexDom
.
setAttribute
(
'
value
'
,
index
.
value
)
indexDom
.
style
.
width
=
this
.
getInputLength
(
indexDom
.
value
)
+
'
px
'
break
;
case
3
:
//3是数字
...
...
@@ -912,7 +895,7 @@ module.exports = {
indexDom
.
style
.
width
=
this
.
getInputLength
(
indexDom
.
value
)
+
'
px
'
break
;
case
4
:
//4是符号
indexDom
.
setAttribute
(
'
value
'
,
index
.
value
)
indexDom
.
setAttribute
(
'
value
'
,
index
.
value
)
indexDom
.
style
.
width
=
this
.
getInputLength
(
indexDom
.
value
)
+
'
px
'
break
;
default
:
...
...
@@ -941,30 +924,30 @@ module.exports = {
// return newObj
// },
//判断制表格式
conditionContain
(
array
,
code
)
{
conditionContain
(
array
,
code
)
{
var
has
=
false
array
.
forEach
(
item
=>
{
if
(
item
.
Encode
==
code
)
{
if
(
item
.
Encode
==
code
)
{
has
=
true
}
})
return
has
},
//创建一个id
createIndexId
()
{
createIndexId
()
{
this
.
initIndexId
++
var
id
=
new
Date
().
getTime
()
+
this
.
initIndexId
return
id
},
//获取input的长度
getInputLength
(
text
)
{
getInputLength
(
text
)
{
var
width
=
0
,
span
if
(
!
document
.
getElementById
(
'
invented
'
))
{
if
(
!
document
.
getElementById
(
'
invented
'
))
{
span
=
document
.
createElement
(
'
span
'
)
span
.
id
=
'
invented
'
span
.
innerHTML
=
text
document
.
body
.
appendChild
(
span
)
}
else
{
}
else
{
span
=
document
.
getElementById
(
'
invented
'
)
span
.
innerHTML
=
text
}
...
...
@@ -972,7 +955,7 @@ module.exports = {
return
width
+
4
},
//初始化撤销反撤销
initKeybord
()
{
initKeybord
()
{
document
.
onkeydown
=
function
(
e
)
{
var
ctrlKey
=
e
.
ctrlKey
||
e
.
metaKey
;
if
(
e
.
shiftKey
&&
ctrlKey
&&
e
.
keyCode
==
90
)
{
...
...
@@ -984,4 +967,5 @@ module.exports = {
}
}
}
}
}
\ No newline at end of file
src/views/main_views/indexManage/components/condition/index.css
deleted
100644 → 0
View file @
528ab007
src/views/main_views/indexManage/components/condition/index.js
View file @
2813d7d8
var
init
=
require
(
'
../../lib/init.js
'
)
var
value
=
init
(
__filename
,
__dirname
)
//
var init = require('../../lib/init.js')
//
var value = init(__filename, __dirname)
//以上代码引入vue、css等,初始化
module
.
exports
=
{
async
function
getCondition
()
{
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/components/condition/index.vue
'
)
return
{
name
:
value
.
name
,
data
:
function
()
{
return
{
...
...
@@ -41,4 +42,5 @@ module.exports = {
return
isRequired
}
}
}
}
src/views/main_views/indexManage/indexManage.css
View file @
2813d7d8
...
...
@@ -2012,4 +2012,269 @@
cursor
:
pointer
;
box-sizing
:
border-box
;
}
.calculater-display
{
border-bottom
:
1px
solid
#eaeaea
;
height
:
320px
;
box-sizing
:
border-box
;
padding
:
10px
;
max-width
:
600px
;
overflow
:
scroll
;
overflow-x
:
hidden
;
}
.calculater-keybord
{
font-size
:
0px
;
border-bottom
:
1px
solid
#eaeaea
;
border-top
:
0
;
/* border-bottom: 0; */
box-sizing
:
border-box
;
max-width
:
600px
;
height
:
40px
;
}
.calculater-keybord
.single-bord
:last-child
{
border-right
:
1px
solid
#eaeaea
;
}
.calculater-keybord
.single-bord
{
width
:
40px
;
height
:
40px
;
text-align
:
center
;
line-height
:
40px
;
font-size
:
20px
;
color
:
#333
;
box-sizing
:
border-box
;
cursor
:
pointer
;
user-select
:
none
;
float
:
left
;
border-right
:
1px
solid
#eaeaea
;
}
.calculater-keybord
.single-bord.long
{
width
:
80px
;
}
.calculater-keybord
.single-bord.active
{
color
:
#d0021b
;
background
:
#FFE7E7
;
}
.calculater-keybord
.single-bord.active
:active
{
color
:
#fff
;
background
:
#d0021b
;
}
.calculater-keybord
.single-bord
:active
{
background
:
#FFE7E7
;
}
.calculater-keybord
.single-bord
:hover
{
color
:
#d0021b
;
}
.calculater-keybord
.single-bord
+
.single-bord
{
/* border-left: 1px solid #eaeaea; */
}
.calculater-keybord
.single-bord.text
{
font-size
:
12px
;
}
.calculater-operation
{
margin-top
:
12px
;
}
/* .calculater-tip{
font-size: 12px;
} */
.calculater-operation
span
{
display
:
inline-block
;
padding
:
4px
8px
;
border
:
1px
solid
#eaeaea
;
border-radius
:
4px
;
cursor
:
pointer
;
}
.calculater-operation
span
:active
{
color
:
#d0021b
;
background
:
#FFE7E7
;
}
.calculater-operation
span
:hover
{
background
:
#FFE7E7
;
}
.cal-index-detail
{
border
:
1px
solid
#eaeaea
;
font-size
:
12px
;
padding
:
10px
;
box-sizing
:
border-box
;
margin-left
:
10px
;
height
:
400px
;
overflow
:
overlay
;
min-width
:
240px
;
max-width
:
240px
;
}
#invented
{
position
:
fixed
;
opacity
:
0
;
left
:
0
;
top
:
0
;
z-index
:
-1
;
font-size
:
12px
;
}
.flex
{
display
:
flex
;
}
.calculater-display
input
{
outline
:
0
;
border
:
0
;
cursor
:
pointer
;
font-size
:
12px
;
margin-bottom
:
4px
;
}
.calculater-display
input
:focus
{
outline
:
0
;
}
.calculater-display
.cal-index.brackets
{
background
:
#d0daff
;
}
.cal-index
{
background
:
#FFE7E7
;
margin
:
0
2px
;
}
.cal-index.active
{
color
:
#d0021b
;
}
.calculater-display
:focus
{
outline
:
0
;
}
.index-choose-dialog
.single-column
{
display
:
flex
;
align-items
:
center
;
padding
:
8px
0
;
}
.mini.el-input--mini
.el-input__inner
{
height
:
20px
;
line-height
:
20px
;
/* border-radius: 4px; */
padding
:
0
4px
;
}
.mini.el-input--mini
.el-input-group__append
{
min-width
:
10px
;
text-align
:
center
;
padding
:
0
4px
;
}
.mini.el-select
.el-input--mini
.el-input__inner
{
height
:
20px
;
line-height
:
20px
;
padding-left
:
4px
;
padding-right
:
4px
;
}
.mini.el-select
.el-input
.el-select__caret
{
line-height
:
20px
;
}
.controller-item
+
.controller-item
{
margin-top
:
8px
;
}
.mini
.el-switch__core
{
height
:
14px
;
}
.mini
.el-switch__core
:after
{
height
:
10px
;
width
:
10px
;
}
.mini.el-switch.is-checked
.el-switch__core
::after
{
width
:
10px
;
height
:
10px
;
}
.mini.el-switch.is-checked
.el-switch__core
::after
{
margin-left
:
-11px
;
}
.mini
.el-input__inner
{
height
:
20px
;
line-height
:
20px
;
font-size
:
12px
;
}
.mini
.el-input__icon
{
line-height
:
20px
;
}
.mini.el-input--suffix
.el-input__inner
{
padding-right
:
0
;
}
.mini
.el-input__icon
{
width
:
20px
;
}
.mini
.el-input__inner
{
font-size
:
12px
;
line-height
:
20px
;
height
:
20px
;
}
.mini.el-select
.el-input__inner
{
padding-left
:
4px
;
}
.absolute-operation
{
position
:
absolute
;
right
:
4px
;
top
:
8px
;
font-size
:
14px
;
cursor
:
pointer
;
}
.absolute-operation
:hover
{
color
:
#D0021B
;
}
.index-controller
.column
{
margin-bottom
:
12px
;
}
.index-controller
.column
.column-title
{
color
:
#999
;
margin-bottom
:
6px
;
}
.function-params-item
{
background
:
rgb
(
245
,
247
,
250
);
padding
:
8px
;
border-radius
:
4px
;
position
:
relative
;
}
.function-params-item
.item-title
{
margin-bottom
:
4px
;
}
.func-show-dom
{
padding-bottom
:
4px
;
}
.function-params-item
+
.function-params-item
{
margin-top
:
8px
;
}
.index-choose-dialog-inner
{
display
:
flex
;
}
.index-choose-dialog
.index-detail
{
padding-left
:
20px
;
border-left
:
1px
solid
#EBEEF5
;
flex
:
auto
;
}
.index-detail
{
flex
:
auto
;
padding-left
:
20px
;
display
:
flex
;
flex-direction
:
column
;
/* overflow: scroll; */
position
:
relative
;
}
.index-choose-dialog
.index-list
{
padding-right
:
20px
;
}
.index-list
{
border
:
1px
solid
#f0f0f0
;
background
:
#F9F9F9
;
border-radius
:
2px
;
padding
:
4px
;
}
.index-choose-dialog
.el-dialog__body
{
font-size
:
12px
;
}
.cal-container
{
border
:
1px
solid
#eaeaea
;
}
.index-list-tree
{
overflow
:
scroll
;
overflow-x
:
hidden
;
}
.mini
.el-radio__inner
{
width
:
10px
;
height
:
10px
;
}
.mini
.el-radio__label
{
font-size
:
12px
;
font-weight
:
normal
;
padding-left
:
6px
;
}
.mini
.el-radio
{
margin-right
:
16px
;
}
\ No newline at end of file
src/views/main_views/indexManage/indexManage.html
View file @
2813d7d8
...
...
@@ -14,41 +14,78 @@
<router-view></router-view>
</div>
</body>
<script>
const
{
app
}
=
require
(
'
electron
'
).
remote
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
window
.
global
.
urls
=
require
(
app
.
getAppPath
()
+
'
/build_config/url
'
)
</script>
<script
src=
"../../../static/vue/vue.min.js"
></script>
<script
src=
"../../../static/element/index.js"
></script>
<script
src=
"../../../static/vue-router/vue-router.js"
></script>
<script
src=
'../../../static/xlsx/xlsx.full.min.js'
></script>
<script
src=
"../../../static/plTable/index.js"
></script>
<!-- <script src="../../lib/vue/vue.js"></script>
<script src="../../lib/element/index.js"></script>
<script type="text/javascript" src='../../lib/xlsx/xlsx.full.min.js'></script>
<script src="../../lib/vue-router/vue-router.js"></script>
<script src="../../lib/plTable/index.js"></script>
<script src="../../lib/echarts/echarts.min.js"></script> -->
<script>
const
{
app
}
=
require
(
'
electron
'
).
remote
const
path
=
app
.
getAppPath
()
const
{
routes
}
=
require
(
path
+
'
/src/views/main_views/indexManage/routers/router.js
'
)
const
router
=
new
VueRouter
({
routes
})
const
http
=
require
(
path
+
'
/src/assist/axios.js
'
)
<script
src=
"../../../assist/loadVue.js"
></script>
<script
src=
"./routers/publicIndex/publicIndex.js"
></script>
<script
src=
"./routers/myIndex/myIndex.js"
></script>
<script
src=
"./routers/indexAudit/indexAudit.js"
></script>
<script
src=
"./routers/categoryAudit/categoryAudit.js"
></script>
<script
src=
"./routers/indexRecord/indexRecord.js"
></script>
<script
src=
"./components/condition/index.js"
></script>
<script
src=
"./components/calculater/calculater.js"
></script>
<script
src=
"../../../assist/axios.js"
></script>
<script
src=
"./indexManage.js"
></script>
<script>
var
http
=
newHttp
()
const
mytools
=
new
tools
()
console
.
log
(
mytools
)
var
info
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userInfo
'
))
const
{
splitPane
}
=
require
(
'
vue-splitpane
'
)
Vue
.
component
(
'
split-pane
'
,
splitPane
)
async
function
init
()
{
var
myIndex
=
await
getMyIndex
()
var
indexAudit
=
await
getIndexAudit
()
var
publicIndex
=
await
getPublicIndex
()
var
categoryAudit
=
await
getCategoryAudit
()
var
indexRecord
=
await
getIndexRecord
()
// var component = await getMain()
// var component = await getMain()
// var component = await getMain()
var
routes
=
[
{
path
:
'
/
'
,
component
:
myIndex
},
{
path
:
'
/indexAudit
'
,
component
:
indexAudit
},
{
path
:
'
/publicIndex
'
,
component
:
publicIndex
},
{
path
:
'
/categoryAudit
'
,
component
:
categoryAudit
},
{
path
:
'
/indexRecord
'
,
component
:
indexRecord
}
]
console
.
log
(
routes
)
var
router
=
new
VueRouter
({
routes
})
new
Vue
({
router
,
el
:
'
#app
'
,
data
:
function
()
{
data
:
function
()
{
return
{
hasPadding
:
true
}
},
mounted
()
{
mounted
()
{
},
methods
:
{
}
})
}
init
()
</script>
</html>
\ No newline at end of file
src/views/main_views/indexManage/indexManage.js
View file @
2813d7d8
class
tools
{
constructor
()
{
}
getKeyboardObj
(
keyBord
,
keyboardObj
)
{
var
arr
=
keyBord
.
keybordData
arr
.
forEach
(
item
=>
{
item
.
forEach
(
sub
=>
{
if
(
sub
.
type
==
5
)
{
keyboardObj
[
sub
.
funcId
]
=
sub
}
})
})
}
getIndexs
(
initIndexObj
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/Encode/GetEncodeList
'
,
{
"
Current
"
:
0
,
"
Psize
"
:
100
,
"
Code
"
:
"
B
"
,
'
Name
'
:
''
,
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
this
.
creatIndexObj
(
res
.
data
.
Data
.
Records
,
initIndexObj
)
resolve
()
}
})
})
}
egetKeyboardObj
(
keyBord
,
keyboardObj
)
{
var
arr
=
keyBord
.
keybordData
arr
.
forEach
(
item
=>
{
item
.
forEach
(
sub
=>
{
if
(
sub
.
type
==
5
)
{
keyboardObj
[
sub
.
funcId
]
=
sub
}
})
})
}
getIndexs
(
initIndexObj
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/Encode/GetEncodeList
'
,
{
"
Current
"
:
0
,
"
Psize
"
:
100
,
"
Code
"
:
"
B
"
,
'
Name
'
:
''
,
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
this
.
creatIndexObj
(
res
.
data
.
Data
.
Records
,
initIndexObj
)
resolve
()
}
})
})
}
creatIndexObj
(
initData
,
initIndexObj
)
{
initData
.
forEach
(
element
=>
{
if
(
element
.
Sub
.
length
>
0
)
{
this
.
creatIndexObj
(
element
.
Sub
,
initIndexObj
)
}
else
{
initIndexObj
[
element
.
Code
]
=
element
var
tableName
=
element
.
Origin
?
element
.
Origin
.
TableComment
:
null
var
dbName
=
element
.
Origin
?
element
.
Origin
.
DbComment
:
null
initIndexObj
[
element
.
Code
].
originText
=
tableName
+
'
-
'
+
dbName
}
})
}
getUsedCompany
(
params
,
companyNameObj
)
{
var
codes
=
[]
params
.
forEach
(
item
=>
{
if
(
item
.
OperandType
==
0
&&
item
.
Where
[
2
])
{
codes
.
push
(
item
.
Where
[
2
].
Value
)
}
else
if
(
item
.
OperandType
==
4
)
{
item
.
Args
.
forEach
(
sub
=>
{
sub
.
forEach
(
child
=>
{
if
(
child
.
OperandType
==
0
&&
child
.
Where
[
2
])
{
codes
.
push
(
child
.
Where
[
2
].
Value
)
}
})
})
}
})
var
where
=
[{
"
Encode
"
:
"
F90001V
"
,
"
State
"
:
7
,
"
Value
"
:
codes
.
join
(
'
,
'
),
}]
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/Query/Query
'
,
{
"
List
"
:
[
'
F90001V
'
,
'
F90002V
'
],
"
Where
"
:
where
,
"
Current
"
:
0
,
"
Psize
"
:
100
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
res
.
data
.
Data
.
Records
.
forEach
(
item
=>
{
companyNameObj
[
item
.
F90001V
]
=
item
.
F90002V
})
resolve
()
}
else
if
(
res
.
data
.
Status
==
0
)
{
resolve
()
}
else
{
reject
()
}
})
})
}
getSaveCondition
(
activeIndexCondition
,
condition
,
initIndex
,
initIndexObj
,
companyNameObj
,
keyboardObj
)
{
condition
.
forEach
(
item
=>
{
initIndex
++
var
id
=
new
Date
().
getTime
()
+
initIndex
var
obj
=
{}
var
inputDom
=
''
var
showDom
=
''
var
paramsType
=
''
switch
(
item
.
OperandType
)
{
case
0
:
//指标
var
index
=
initIndexObj
[
item
.
List
[
0
]]
var
condition
=
this
.
getIndexType
(
index
)
var
evalObj
=
this
.
getEval
(
item
.
Where
[
0
])
obj
=
{
code
:
item
.
List
[
0
],
id
:
id
,
inputQuarter
:
evalObj
.
selsetQuarter
,
inputYear
:
evalObj
.
selectYear
,
q
:
evalObj
.
qQuarter
,
t
:
evalObj
.
tYear
,
quarterType
:
evalObj
.
reportQuarterType
,
yearType
:
evalObj
.
reportYearType
,
mergeType
:
item
.
Where
[
1
].
Value
,
type
:
1
,
isAppointCompany
:
item
.
Where
[
2
]
?
true
:
false
,
selectedCompany
:
item
.
Where
[
2
]
?
(
companyNameObj
[
item
.
Where
[
2
].
Value
]
+
'
-
'
+
item
.
Where
[
2
].
Value
)
:
''
,
mark
:
index
.
Mark
,
name
:
index
.
Name
,
needMergeType
:
condition
.
needMergeType
,
needReportData
:
condition
.
needReportData
,
needCompany
:
condition
.
needCompany
,
typeContent
:
index
.
TypeContent
||
[]
}
var
text
=
this
.
getFullIndexName
(
obj
)
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="1" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="1">
'
+
text
+
'
</span>
'
paramsType
=
'
indexParams
'
break
;
case
1
:
//符号
obj
=
{
id
:
id
,
key
:
item
.
Value
,
type
:
4
,
value
:
item
.
Value
}
var
width
=
this
.
getInputLength
(
item
.
Value
)
+
'
px
'
var
moreClass
=
''
switch
(
item
.
Value
)
{
case
'
(
'
:
case
'
)
'
:
moreClass
=
'
brackets
'
break
;
default
:
break
;
}
inputDom
=
'
<input readonly class="cal-index
'
+
moreClass
+
'
" type="4" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
item
.
Value
+
'
" />
'
showDom
=
'
<span type="4">
'
+
item
.
Value
+
'
</span>
'
paramsType
=
'
symbolParams
'
break
;
case
2
:
//数字
obj
=
{
id
:
id
,
type
:
3
,
value
:
item
.
Value
}
var
text
=
item
.
Value
+
"
[
"
+
this
.
getFormatValue
(
item
.
Value
)
+
"
]
"
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="3" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="3">
'
+
text
+
'
</span>
'
paramsType
=
'
numParams
'
break
;
case
3
:
//时间
obj
=
{
id
:
id
,
type
:
2
,
value
:
item
.
Value
}
var
text
=
item
.
Value
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="2" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="2">
'
+
text
+
'
</span>
'
paramsType
=
'
dateParams
'
break
;
case
4
:
var
origin
=
keyboardObj
[
item
.
Action
]
obj
=
{
value
:
origin
.
key
,
key
:
origin
.
key
,
type
:
5
,
id
:
id
,
originParams
:
JSON
.
parse
(
JSON
.
stringify
(
origin
)),
paramsValue
:
[]
}
item
.
Args
.
forEach
((
sub
,
index
)
=>
{
if
(
index
>
origin
.
length
)
{
obj
.
originParams
.
params
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
obj
.
originParams
.
params
[
0
])))
}
obj
.
paramsValue
[
index
]
=
{
indexParams
:
{},
dateParams
:
{},
numParams
:
{},
symbolParams
:
{},
functionParams
:
{},
dom
:
''
,
showDom
:
''
}
initIndex
++
this
.
getSaveCondition
(
obj
.
paramsValue
[
index
],
item
.
Args
[
index
],
initIndex
,
initIndexObj
,
companyNameObj
,
keyboardObj
)
})
// origin.params.forEach((item,index) => {
// this.getFuncCondition(obj.paramsValue[index], item.Args[index])
// })
var
arr
=
[]
obj
.
paramsValue
.
forEach
(
item
=>
{
var
text
=
this
.
getShowDomText
(
item
.
showDom
)
arr
.
push
(
text
)
})
var
name
=
obj
.
key
.
replace
(
'
( )
'
,
''
)
var
value
=
name
+
'
(
'
+
arr
.
join
(
'
,
'
)
+
'
)
'
var
text
=
value
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="5" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="5">
'
+
text
+
'
</span>
'
paramsType
=
'
functionParams
'
break
;
default
:
break
;
}
activeIndexCondition
[
paramsType
][
id
]
=
obj
activeIndexCondition
.
dom
+=
inputDom
activeIndexCondition
.
showDom
+=
showDom
})
if
(
!
activeIndexCondition
.
showDom
)
{
activeIndexCondition
.
showDom
=
'
<span>暂未设置计算公式</span>
'
}
}
getIndexType
(
obj
)
{
var
newObj
=
{
needMergeType
:
false
,
needReportData
:
false
,
needCompany
:
false
}
if
(
obj
.
TypeContent
)
{
obj
.
TypeContent
.
Parameters
.
forEach
(
item
=>
{
if
(
item
.
Encode
==
'
F91997V
'
)
{
newObj
.
needMergeType
=
true
}
if
(
item
.
Encode
==
'
F91996D
'
)
{
newObj
.
needReportData
=
true
}
if
(
item
.
Encode
==
'
F90001V
'
)
{
newObj
.
needCompany
=
true
}
})
}
return
newObj
}
getEval
(
item
)
{
var
newObj
=
{
reportYearType
:
1
,
tYear
:
0
,
selectYear
:
''
,
reportQuarterType
:
1
,
qQuarter
:
0
,
selsetQuarter
:
''
}
switch
(
item
.
Eval
.
length
)
{
case
0
:
newObj
.
reportYearType
=
2
newObj
.
selectYear
=
item
.
Value
.
slice
(
0
,
4
)
newObj
.
reportQuarterType
=
2
newObj
.
qQuarter
=
0
newObj
.
tYear
=
0
newObj
.
selsetQuarter
=
item
.
Value
.
slice
(
5
,
10
)
break
;
case
1
:
if
(
item
.
Eval
[
0
].
EvalOption
==
1
)
{
//年度为t
newObj
.
reportYearType
=
1
newObj
.
tYear
=
item
.
Eval
[
0
].
Value
newObj
.
selectYear
=
item
.
Value
.
slice
(
0
,
4
)
newObj
.
reportQuarterType
=
2
newObj
.
qQuarter
=
0
newObj
.
selsetQuarter
=
item
.
Value
.
slice
(
5
,
10
)
}
else
if
(
item
.
Eval
[
0
].
EvalOption
==
2
)
{
newObj
.
reportYearType
=
2
newObj
.
tYear
=
0
newObj
.
selectYear
=
item
.
Value
.
slice
(
0
,
4
)
newObj
.
reportQuarterType
=
1
newObj
.
qQuarter
=
item
.
Eval
[
0
].
Value
newObj
.
selsetQuarter
=
item
.
Value
.
slice
(
5
,
10
)
}
break
;
case
2
:
newObj
.
reportYearType
=
1
newObj
.
selectYear
=
''
newObj
.
reportQuarterType
=
1
newObj
.
selsetQuarter
=
''
newObj
.
qQuarter
=
item
.
Eval
[
1
].
Value
newObj
.
tYear
=
item
.
Eval
[
0
].
Value
break
;
default
:
break
;
}
return
newObj
}
getFullIndexName
(
index
)
{
var
indexName
=
index
.
name
,
merge
=
''
,
company
=
''
,
year
=
''
,
quarter
=
''
if
(
index
.
needMergeType
)
{
merge
=
'
[
'
+
index
.
mergeType
+
'
]
'
}
if
(
index
.
needReportData
)
{
if
(
index
.
yearType
==
1
)
{
year
=
'
[T:
'
+
index
.
t
+
'
]
'
}
else
{
year
=
'
[T:
'
+
index
.
inputYear
+
'
]
'
}
if
(
index
.
quarterType
==
1
)
{
quarter
=
'
[Q:
'
+
index
.
q
+
'
]
'
}
else
{
quarter
=
'
[Q:
'
+
index
.
inputQuarter
+
'
]
'
}
}
if
(
index
.
needCompany
&&
index
.
isAppointCompany
)
{
company
=
'
[
'
+
index
.
selectedCompany
+
'
]
'
}
return
indexName
+
year
+
quarter
+
merge
+
company
}
getInputLength
(
text
)
{
var
width
=
0
,
span
if
(
!
document
.
getElementById
(
'
invented
'
))
{
span
=
document
.
createElement
(
'
span
'
)
span
.
id
=
'
invented
'
span
.
innerHTML
=
text
document
.
body
.
appendChild
(
span
)
}
else
{
span
=
document
.
getElementById
(
'
invented
'
)
span
.
innerHTML
=
text
}
width
=
span
.
offsetWidth
return
width
+
4
}
getShowDomText
(
html
)
{
var
div
=
document
.
createElement
(
'
div
'
)
if
(
html
)
{
div
.
innerHTML
=
html
return
div
.
innerText
}
else
{
return
'
未设置
'
}
}
insertAfter
(
newElement
,
targetElement
)
{
var
parent
=
targetElement
.
parentNode
if
(
parent
.
lastChild
==
targetElement
)
{
parent
.
appendChild
(
targetElement
)
}
else
{
parent
.
insertBefore
(
newElement
,
targetElement
.
nextSibling
);
}
}
createAppointedText
(
num
)
{
var
str
=
''
,
text
for
(
var
i
=
0
;
i
<
num
;
i
++
)
{
str
+=
'
\
u00A0
'
}
text
=
document
.
createTextNode
(
str
)
return
text
}
formatShowDom
(
spans
)
{
var
brackets
=
[]
var
numArea
=
[]
Array
.
from
(
spans
).
forEach
(
item
=>
{
var
value
=
item
.
innerText
var
br
=
document
.
createElement
(
'
br
'
)
if
(
'
()&&||+-*/
'
.
indexOf
(
value
)
>=
0
||
(
item
.
nextSibling
&&
'
()&&||+-*/
'
.
indexOf
(
item
.
nextSibling
.
innerText
)
>=
0
))
{
this
.
insertAfter
(
br
,
item
)
}
})
Array
.
from
(
spans
).
forEach
((
item
,
index
)
=>
{
var
value
=
item
.
innerText
if
(
value
==
'
(
'
||
value
==
'
)
'
)
{
brackets
.
push
({
indet
:
0
,
from
:
item
,
value
:
value
,
originIndex
:
index
})
}
})
brackets
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
item
.
indent
=
0
var
text
=
this
.
createAppointedText
(
item
.
indent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
else
{
var
newIndent
=
brackets
[
index
-
1
].
indent
if
(
brackets
[
index
-
1
].
value
!==
item
.
value
)
{
item
.
indent
=
newIndent
var
text
=
this
.
createAppointedText
(
newIndent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
else
{
if
(
item
.
value
==
'
(
'
)
{
item
.
indent
=
newIndent
+
4
}
else
{
item
.
indent
=
newIndent
-
4
}
var
text
=
this
.
createAppointedText
(
item
.
indent
)
item
.
from
.
parentNode
.
insertBefore
(
text
,
item
.
from
)
}
numArea
.
push
({
start
:
brackets
[
index
-
1
].
originIndex
,
end
:
item
.
originIndex
,
indent
:
brackets
[
index
-
1
].
indent
,
value
:
brackets
[
index
-
1
].
value
})
}
})
Array
.
from
(
spans
).
forEach
((
item
,
index
)
=>
{
var
value
=
item
.
innerText
if
(
value
!==
'
(
'
&&
value
!==
'
)
'
&&
item
.
previousSibling
&&
item
.
previousSibling
.
nodeName
==
'
BR
'
)
{
numArea
.
forEach
(
area
=>
{
if
(
index
>
area
.
start
&&
index
<
area
.
end
)
{
var
newIndent
if
(
area
.
value
==
'
(
'
)
{
newIndent
=
area
.
indent
+
4
}
else
{
newIndent
=
area
.
indent
}
var
text
=
this
.
createAppointedText
(
newIndent
)
item
.
parentNode
.
insertBefore
(
text
,
item
)
}
})
}
})
}
getKeyboard
()
{
var
keybordData
=
[
[
{
key
:
'
插入指标
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
true
,
isFunction
:
false
,
tip
:
'
插入指标
'
,
type
:
1
,
},
{
key
:
'
插入日期
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
true
,
isFunction
:
false
,
tip
:
'
插入日期
'
,
type
:
2
},
{
key
:
'
插入数字
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
true
,
isFunction
:
false
,
tip
:
'
插入数字
'
,
type
:
3
},
{
key
:
'
Kdp( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
保留小数位函数
'
,
type
:
5
,
funcId
:
0
,
describe
:
'
保留小数位
'
,
case
:
'
Kdp(归属于母公司所有者的净利润[T:0][Q:0][合并本期], 2)
'
,
params
:
[[
0
,
4
],
[
1
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
true
},
{
key
:
'
Abs( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
绝对值函数
'
,
type
:
5
,
funcId
:
1
,
describe
:
'
求指标或计算片段的绝对值
'
,
case
:
'
Abs(归属于母公司所有者的净利润[T:0][Q:0][合并本期])
'
,
params
:
[[
0
,
4
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
true
},
// {
// key: 'Tf( )',
// isActive: false,
// isText: true,
// isLong: false,
// isFunction: true,
// tip: '时间格式化函数',
// type: 5,
// funcId: 2,
// describe: '对时间进行格式化操作',
// case: 'Abs(上市日期, yyyy-MM-dd)',
// params: [[3],[2]], //0指标 1数字 2字符 3时间 4公式
// isLimited: true
// },
{
key
:
'
Ave( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
平均值函数
'
,
type
:
5
,
funcId
:
3
,
describe
:
'
计算一组数据的平均值
'
,
case
:
'
Ave(营业总收入[T:-1][Q:0][合并本期], 营业总收入[T:-2][Q:0][合并本期])
'
,
params
:
[[
0
,
1
,
4
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
false
},
{
key
:
'
Mer( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
当该指标为年报时,用下一年合并上期数据
'
,
type
:
5
,
funcId
:
8
,
describe
:
'
计算下一年年报合并上期
'
,
case
:
'
Mer(营业总收入[T:-1][Q:0][合并本期])
'
,
params
:
[[
0
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
true
}
],
[
{
key
:
'
+
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:加号
'
,
type
:
4
},
{
key
:
'
-
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:减号
'
,
type
:
4
},
{
key
:
'
*
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:乘号
'
,
type
:
4
},
{
key
:
'
/
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:除号
'
,
type
:
4
},
{
key
:
'
(
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:左括号
'
,
type
:
4
},
{
key
:
'
)
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:右括号
'
,
type
:
4
},
{
key
:
'
Sum( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
求和函数
'
,
type
:
5
,
funcId
:
4
,
describe
:
'
计算一组数据的总和
'
,
case
:
'
Sum(营业总收入[T:-1][Q:0][合并本期], 营业总收入[T:-2][Q:0][合并本期])
'
,
params
:
[[
0
,
1
,
4
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
false
},
{
key
:
'
Max( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
最大值函数
'
,
type
:
5
,
funcId
:
5
,
describe
:
'
计算一组数据的最大值
'
,
case
:
'
Max(营业总收入[T:-1][Q:0][合并本期], 营业总收入[T:-2][Q:0][合并本期])
'
,
params
:
[[
0
,
1
,
4
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
false
},
{
key
:
'
Min( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
最小值函数
'
,
type
:
5
,
funcId
:
6
,
describe
:
'
计算一组数据的最小值
'
,
case
:
'
Min(营业总收入[T:-1][Q:0][合并本期], 营业总收入[T:-2][Q:0][合并本期])
'
,
params
:
[[
0
,
1
,
4
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
false
},
{
key
:
'
Fac( )
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
true
,
tip
:
'
阶乘函数
'
,
type
:
5
,
funcId
:
7
,
describe
:
'
计算一组数据的阶乘
'
,
case
:
'
Fac(营业总收入[T:-1][Q:0][合并本期])
'
,
params
:
[[
0
,
1
,
4
]],
//0指标 1数字 2字符 3时间 4公式
isLimited
:
true
}
]
]
//条件上的键盘
var
functionKeybord
=
[
[
{
key
:
'
插入指标
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
true
,
isFunction
:
false
,
tip
:
'
插入指标
'
,
type
:
1
,
},
{
key
:
'
插入日期
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
true
,
isFunction
:
false
,
tip
:
'
插入日期
'
,
type
:
2
},
{
key
:
'
插入数字
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
true
,
isFunction
:
false
,
tip
:
'
插入数字
'
,
type
:
3
}
],
[
{
key
:
'
+
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:加号
'
,
type
:
4
},
{
key
:
'
-
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:减号
'
,
type
:
4
},
{
key
:
'
*
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:乘号
'
,
type
:
4
},
{
key
:
'
/
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:除号
'
,
type
:
4
},
{
key
:
'
(
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:左括号
'
,
type
:
4
},
{
key
:
'
)
'
,
isActive
:
false
,
isText
:
true
,
isLong
:
false
,
isFunction
:
false
,
tip
:
'
计算符号:右括号
'
,
type
:
4
}
]
]
return
{
keybordData
:
keybordData
,
functionKeybord
:
functionKeybord
}
}
//有关于条件的一些方法
getFormatValue
(
value
)
{
var
unit
=
''
,
num
=
1
if
(
value
<
10000
)
{
unit
=
''
,
num
=
1
}
else
if
(
10000
<=
value
&&
value
<
100000000
)
{
unit
=
'
万
'
,
num
=
10000
}
else
if
(
100000000
<=
value
&&
value
<
1000000000000
)
{
unit
=
'
亿
'
,
num
=
100000000
}
else
if
(
value
>=
1000000000000
)
{
unit
=
'
万亿
'
,
num
=
1000000000000
}
return
(
value
/
num
).
toFixed
(
0
)
+
unit
}
getFullIndexName
=
(
index
)
=>
{
var
indexName
=
index
.
name
,
merge
=
''
,
company
=
''
,
year
=
''
,
quarter
=
''
if
(
index
.
needMergeType
)
{
merge
=
'
[
'
+
index
.
mergeType
+
'
]
'
}
if
(
index
.
needReportData
)
{
if
(
index
.
yearType
==
1
)
{
year
=
'
[T:
'
+
index
.
t
+
'
]
'
}
else
{
year
=
'
[T:
'
+
index
.
inputYear
+
'
]
'
}
if
(
index
.
quarterType
==
1
)
{
quarter
=
'
[Q:
'
+
index
.
q
+
'
]
'
}
else
{
quarter
=
'
[Q:
'
+
index
.
inputQuarter
+
'
]
'
}
}
if
(
index
.
needCompany
&&
index
.
isAppointCompany
)
{
company
=
'
[
'
+
index
.
selectedCompany
+
'
]
'
}
return
indexName
+
year
+
quarter
+
merge
+
company
}
getIndexType
=
(
obj
)
=>
{
var
newObj
=
{
needMergeType
:
false
,
needReportData
:
false
,
needCompany
:
false
}
if
(
obj
.
TypeContent
)
{
obj
.
TypeContent
.
Parameters
.
forEach
(
item
=>
{
if
(
item
.
Encode
==
'
F91997V
'
)
{
newObj
.
needMergeType
=
true
}
if
(
item
.
Encode
==
'
F91996D
'
)
{
newObj
.
needReportData
=
true
}
if
(
item
.
Encode
==
'
F90001V
'
)
{
newObj
.
needCompany
=
true
}
})
}
return
newObj
}
setSaveCondition
(
condition
)
{
//格式化保存的条件,原名 getSaveCalCondition
var
operands
=
[]
var
div
=
document
.
createElement
(
'
div
'
)
div
.
innerHTML
=
condition
.
params
.
dom
var
inputs
=
div
.
getElementsByTagName
(
'
input
'
)
//后台的定义 0指标1符号2数字3时间4方法
//前台的定义 1指标2时间3数字4字符5方法
Array
.
from
(
inputs
).
forEach
(
item
=>
{
var
obj
=
{},
id
=
item
.
id
switch
(
parseInt
(
item
.
getAttribute
(
'
type
'
)))
{
case
1
:
//指标
var
param
=
condition
.
params
.
indexParams
[
id
]
var
dateYear
=
'
1900
'
var
dateQuater
=
'
06-30
'
var
evalArray
=
[]
if
(
param
.
yearType
==
1
)
{
evalArray
.
push
({
"
EvalOption
"
:
1
,
"
Value
"
:
param
.
t
})
}
else
if
(
param
.
yearType
==
2
)
{
dateYear
=
param
.
inputYear
}
if
(
param
.
quarterType
==
1
)
{
evalArray
.
push
({
"
EvalOption
"
:
2
,
"
Value
"
:
param
.
q
})
}
else
if
(
param
.
quarterType
==
2
)
{
dateQuater
=
param
.
inputQuarter
}
var
where
=
[
{
"
State
"
:
1
,
"
Encode
"
:
"
F91996D
"
,
"
Value
"
:
dateYear
+
'
-
'
+
dateQuater
,
"
Eval
"
:
evalArray
},
{
"
State
"
:
1
,
"
Value
"
:
param
.
mergeType
,
"
Encode
"
:
"
F91997V
"
,
"
Eval
"
:
[]
}
]
if
(
param
.
isAppointCompany
)
{
where
.
push
({
"
State
"
:
1
,
"
Value
"
:
param
.
selectedCompany
.
split
(
'
-
'
)[
1
],
"
Encode
"
:
"
F90001V
"
,
"
Eval
"
:
[]
})
}
obj
=
{
"
List
"
:
[
param
.
code
],
"
Where
"
:
where
,
"
OperandType
"
:
0
,
}
break
;
case
2
:
//时间
obj
=
{
"
Value
"
:
item
.
value
,
"
OperandType
"
:
3
}
break
;
case
3
:
//数字
obj
=
{
"
Value
"
:
item
.
value
.
replace
(
/
\[
.*
?\]
/g
,
''
),
"
OperandType
"
:
2
}
break
;
case
4
:
//字符
obj
=
{
"
Value
"
:
item
.
value
,
"
OperandType
"
:
1
}
break
;
default
:
break
;
}
operands
.
push
(
obj
)
})
return
operands
}
getFullSaveCondition
(
id
,
conditionContents
,
conditionSignature
,
paramsList
,
initIndexObj
,
companyNameObj
,
getEval
,
initIndex
,
that
)
{
//格式化获取的条件原名 setCalCondition, 启动参数中 setEditCondition, 公司名称 searchCompanyName, 所有指标 getIndexCateGory(initIndexObj)
if
(
conditionSignature
&&
that
.
conditionIndex
<
parseInt
(
conditionSignature
))
{
that
.
conditionIndex
=
parseInt
(
conditionSignature
)
}
if
(
that
)
{
that
.
$set
(
paramsList
,
id
,
{
id
:
id
==
'
start
'
?
'
start
'
:
(
conditionSignature
?
conditionSignature
:
null
),
params
:
{
indexParams
:
{},
dateParams
:
{},
numParams
:
{},
symbolParams
:
{},
dom
:
''
,
showDom
:
''
}
})
}
var
param
=
paramsList
[
id
].
params
conditionContents
.
forEach
(
item
=>
{
initIndex
++
var
id
=
new
Date
().
getTime
()
+
initIndex
var
obj
=
{}
var
inputDom
=
''
var
showDom
=
''
var
paramsType
=
''
switch
(
item
.
OperandType
)
{
case
0
:
//指标
var
index
=
initIndexObj
[
item
.
List
[
0
]]
var
condition
=
this
.
getIndexType
(
index
)
var
evalObj
=
getEval
(
item
.
Where
[
0
])
obj
=
{
code
:
item
.
List
[
0
],
id
:
id
,
inputQuarter
:
evalObj
.
selsetQuarter
,
inputYear
:
evalObj
.
selectYear
,
q
:
evalObj
.
qQuarter
,
t
:
evalObj
.
tYear
,
quarterType
:
evalObj
.
reportQuarterType
,
yearType
:
evalObj
.
reportYearType
,
mergeType
:
item
.
Where
[
1
].
Value
,
type
:
1
,
isAppointCompany
:
item
.
Where
[
2
]
?
true
:
false
,
selectedCompany
:
item
.
Where
[
2
]
?
(
companyNameObj
[
item
.
Where
[
2
].
Value
]
+
'
-
'
+
item
.
Where
[
2
].
Value
)
:
''
,
mark
:
index
.
Mark
,
name
:
index
.
Name
,
needMergeType
:
condition
.
needMergeType
,
needReportData
:
condition
.
needReportData
,
needCompany
:
condition
.
needCompany
,
typeContent
:
index
.
TypeContent
}
var
text
=
this
.
getFullIndexName
(
obj
)
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="1" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="1">
'
+
text
+
'
</span>
'
paramsType
=
'
indexParams
'
break
;
case
1
:
//符号
obj
=
{
id
:
id
,
key
:
item
.
Value
,
type
:
4
,
value
:
item
.
Value
}
var
width
=
this
.
getInputLength
(
item
.
Value
)
+
'
px
'
var
moreClass
=
''
switch
(
item
.
Value
)
{
case
'
(
'
:
case
'
)
'
:
moreClass
=
'
brackets
'
break
;
default
:
break
;
}
inputDom
=
'
<input readonly class="cal-index
'
+
moreClass
+
'
" type="4" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
item
.
Value
+
'
" />
'
showDom
=
'
<span type="4">
'
+
item
.
Value
+
'
</span>
'
paramsType
=
'
symbolParams
'
break
;
case
2
:
//数字
obj
=
{
id
:
id
,
type
:
3
,
value
:
item
.
Value
}
var
text
=
item
.
Value
+
"
[
"
+
getFormatValue
(
item
.
Value
)
+
"
]
"
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="3" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="3">
'
+
text
+
'
</span>
'
paramsType
=
'
numParams
'
break
;
case
3
:
//时间
obj
=
{
id
:
id
,
type
:
2
,
value
:
item
.
Value
}
var
text
=
item
.
Value
var
width
=
this
.
getInputLength
(
text
)
+
'
px
'
inputDom
=
'
<input readonly class="cal-index" type="2" id="
'
+
id
+
'
" style="width:
'
+
width
+
'
" value="
'
+
text
+
'
" />
'
showDom
=
'
<span type="2">
'
+
text
+
'
</span>
'
paramsType
=
'
dateParams
'
break
;
case
4
:
//方法,暂不做处理
break
;
default
:
break
;
}
// param[paramsType] = {}
param
[
paramsType
][
id
]
=
obj
param
.
dom
+=
inputDom
param
.
showDom
+=
showDom
})
if
(
!
param
.
showDom
)
{
param
.
showDom
=
'
<span>暂未设置条件</span>
'
}
}
}
\ No newline at end of file
src/views/main_views/indexManage/routers/categoryAudit/categoryAudit.js
View file @
2813d7d8
const
http
=
require
(
'
../../../lib/axios/axios.js
'
)
const
{
dialog
}
=
require
(
'
electron
'
).
remote
const
officegen
=
require
(
'
officegen
'
)
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
)
const
filePath
=
path
.
resolve
(
__dirname
,
'
./categoryAudit.vue
'
)
let
newTemplate
=
''
var
data
=
fs
.
readFileSync
(
filePath
);
var
str
=
data
.
toString
()
var
newStr
=
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
newTemplate
=
newStr
.
replace
(
'
<template>
'
,
''
)
var
keyBord
=
require
(
'
../../lib/keyBord
'
)
var
tools
=
require
(
'
../../lib/tools.js
'
)
const
condition
=
require
(
'
../../components/condition/index.js
'
)
module
.
exports
=
{
categoryAudit
:
{
async
function
getCategoryAudit
()
{
var
condition
=
await
getCondition
()
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/routers/categoryAudit/categoryAudit.vue
'
)
return
{
data
:
function
()
{
return
{
tableData
:
[],
...
...
@@ -78,10 +64,10 @@ module.exports = {
}
},
components
:
{
condition
},
template
:
newT
emplate
,
template
:
value
.
t
emplate
,
mounted
()
{
this
.
checkPermission
(
48
,
'
indexPermission
'
)
this
.
currentAccount
=
store
.
get
(
'
accountId
'
)
this
.
currentAccount
=
info
.
accountId
this
.
getIndexData
()
this
.
getBadge
(
1
,
'
isDotEdit
'
)
this
.
getBadge
(
2
,
'
isDotSort
'
)
...
...
@@ -98,7 +84,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Account/Account/CheckPermission
'
,
{
"
id
"
:
id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -115,7 +101,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/ViewIndexSort
'
,
{
"
status
"
:
type
==
'
pass
'
?
1
:
2
,
//1通过2拒绝
"
id
"
:
this
.
activeIndex
.
Id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -135,7 +121,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/GetPendingViewIndexSort
'
,
{
"
Current
"
:
(
this
.
pageCurrent
-
1
)
*
this
.
psize
,
"
Psize
"
:
this
.
psize
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -164,7 +150,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetTodoCustomIndexCount
'
,
{
"
countOption
"
:
type
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
src/views/main_views/indexManage/routers/indexAudit/indexAudit.js
View file @
2813d7d8
const
http
=
require
(
'
../../../lib/axios/axios.js
'
)
const
{
dialog
}
=
require
(
'
electron
'
).
remote
const
officegen
=
require
(
'
officegen
'
)
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
)
const
filePath
=
path
.
resolve
(
__dirname
,
'
./indexAudit.vue
'
)
let
newTemplate
=
''
var
data
=
fs
.
readFileSync
(
filePath
);
var
str
=
data
.
toString
()
var
newStr
=
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
newTemplate
=
newStr
.
replace
(
'
<template>
'
,
''
)
var
keyBord
=
require
(
'
../../lib/keyBord
'
)
var
tools
=
require
(
'
../../lib/tools.js
'
)
const
condition
=
require
(
'
../../components/condition/index.js
'
)
module
.
exports
=
{
indexAudit
:
{
async
function
getIndexAudit
()
{
var
condition
=
await
getCondition
()
var
calculater
=
await
getCalculater
()
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/routers/indexAudit/indexAudit.vue
'
)
return
{
data
:
function
()
{
return
{
tableData
:
[],
...
...
@@ -80,13 +67,13 @@ module.exports = {
}
},
components
:
{
condition
},
template
:
newT
emplate
,
template
:
value
.
t
emplate
,
mounted
()
{
this
.
currentAccount
=
store
.
get
(
'
accountId
'
)
this
.
currentAccount
=
info
.
accountId
this
.
getDefaultType
()
this
.
getPublicCategory
()
tools
.
getKeyboardObj
(
keyBord
,
this
.
keyboardObj
)
tools
.
getIndexs
(
this
.
initIndexObj
).
then
(
res
=>
{
mytools
.
getKeyboardObj
(
mytools
.
getKeyboard
()
,
this
.
keyboardObj
)
my
tools
.
getIndexs
(
this
.
initIndexObj
).
then
(
res
=>
{
this
.
getIndexData
()
})
this
.
getZjhIndustryCategoryList
()
...
...
@@ -111,7 +98,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Account/Account/CheckPermission
'
,
{
"
id
"
:
id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -693,7 +680,7 @@ module.exports = {
"
status
"
:
type
==
'
pass
'
?
16
:
32
,
"
id
"
:
this
.
activeIndex
.
Id
,
"
codes
"
:
arr
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -815,7 +802,7 @@ module.exports = {
getDefaultType
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetAllIndexArgs
'
,
{
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -850,7 +837,7 @@ module.exports = {
"
Current
"
:
(
this
.
pageCurrent
-
1
)
*
this
.
psize
,
"
Psize
"
:
this
.
psize
,
"
name
"
:
this
.
searchedName
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -904,7 +891,7 @@ module.exports = {
},
setDetailCondition
(
data
,
id
,
key
)
{
tools
.
getUsedCompany
(
data
.
Algorithm
.
Object
||
data
.
Algorithm
,
this
.
companyNameObj
).
then
(
res
=>
{
my
tools
.
getUsedCompany
(
data
.
Algorithm
.
Object
||
data
.
Algorithm
,
this
.
companyNameObj
).
then
(
res
=>
{
this
[
key
]
=
{
indexParams
:
{},
dateParams
:
{},
...
...
@@ -914,7 +901,7 @@ module.exports = {
dom
:
''
,
showDom
:
''
}
tools
.
getSaveCondition
(
this
[
key
],
data
.
Algorithm
.
Object
||
data
.
Algorithm
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
my
tools
.
getSaveCondition
(
this
[
key
],
data
.
Algorithm
.
Object
||
data
.
Algorithm
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
this
.
$nextTick
(()
=>
{
var
spans
=
document
.
getElementById
(
id
).
getElementsByTagName
(
'
span
'
)
var
html
=
''
...
...
@@ -923,7 +910,7 @@ module.exports = {
})
document
.
getElementById
(
id
).
innerHTML
=
html
var
spans
=
document
.
getElementById
(
id
).
getElementsByTagName
(
'
span
'
)
tools
.
formatShowDom
(
spans
)
my
tools
.
formatShowDom
(
spans
)
})
})
},
...
...
@@ -932,7 +919,7 @@ module.exports = {
this
.
activeIndex
=
data
this
.
showIndexDetail
=
true
tools
.
getUsedCompany
(
data
.
Algorithm
.
Object
,
this
.
companyNameObj
).
then
(
res
=>
{
my
tools
.
getUsedCompany
(
data
.
Algorithm
.
Object
,
this
.
companyNameObj
).
then
(
res
=>
{
this
.
activeIndexCondition
=
{
indexParams
:
{},
dateParams
:
{},
...
...
@@ -943,7 +930,7 @@ module.exports = {
showDom
:
''
}
tools
.
getSaveCondition
(
this
.
activeIndexCondition
,
data
.
Algorithm
.
Object
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
my
tools
.
getSaveCondition
(
this
.
activeIndexCondition
,
data
.
Algorithm
.
Object
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
this
.
$nextTick
(()
=>
{
var
spans
=
document
.
getElementById
(
'
conditionBox
'
).
getElementsByTagName
(
'
span
'
)
...
...
@@ -953,7 +940,7 @@ module.exports = {
})
document
.
getElementById
(
'
conditionBox
'
).
innerHTML
=
html
var
spans
=
document
.
getElementById
(
'
conditionBox
'
).
getElementsByTagName
(
'
span
'
)
tools
.
formatShowDom
(
spans
)
my
tools
.
formatShowDom
(
spans
)
})
})
},
...
...
@@ -961,7 +948,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetTodoCustomIndexCount
'
,
{
"
countOption
"
:
type
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
src/views/main_views/indexManage/routers/indexRecord/indexRecord.js
View file @
2813d7d8
const
http
=
require
(
'
../../../lib/axios/axios.js
'
)
const
{
dialog
}
=
require
(
'
electron
'
).
remote
const
officegen
=
require
(
'
officegen
'
)
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
)
const
filePath
=
path
.
resolve
(
__dirname
,
'
./indexRecord.vue
'
)
let
newTemplate
=
''
var
data
=
fs
.
readFileSync
(
filePath
);
var
str
=
data
.
toString
()
var
newStr
=
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
newTemplate
=
newStr
.
replace
(
'
<template>
'
,
''
)
const
condition
=
require
(
'
../../components/condition/index.js
'
)
module
.
exports
=
{
indexRecord
:
{
async
function
getIndexRecord
()
{
var
condition
=
await
getCondition
()
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/routers/indexRecord/indexRecord.vue
'
)
return
{
data
:
function
()
{
return
{
tableData
:
[],
...
...
@@ -79,10 +66,10 @@ module.exports = {
}
},
components
:
{
condition
},
template
:
newT
emplate
,
template
:
value
.
t
emplate
,
mounted
()
{
this
.
checkPermission
(
48
,
'
indexPermission
'
)
this
.
currentAccount
=
store
.
get
(
'
accountId
'
)
this
.
currentAccount
=
info
.
accountId
this
.
getIndexData
()
this
.
getBadge
(
1
,
'
isDotEdit
'
)
this
.
getBadge
(
2
,
'
isDotSort
'
)
...
...
@@ -99,7 +86,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Account/Account/CheckPermission
'
,
{
"
id
"
:
id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -119,7 +106,7 @@ module.exports = {
"
Current
"
:
(
this
.
pageCurrent
-
1
)
*
this
.
psize
,
"
Psize
"
:
this
.
psize
,
"
name
"
:
this
.
searchName
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -152,7 +139,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetTodoCustomIndexCount
'
,
{
"
countOption
"
:
type
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
src/views/main_views/indexManage/routers/myIndex/myIndex.js
View file @
2813d7d8
const
http
=
require
(
'
../../../lib/axios/axios.js
'
)
const
{
dialog
}
=
require
(
'
electron
'
).
remote
const
officegen
=
require
(
'
officegen
'
)
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
)
const
filePath
=
path
.
resolve
(
__dirname
,
'
./myIndex.vue
'
)
let
newTemplate
=
''
var
data
=
fs
.
readFileSync
(
filePath
);
var
str
=
data
.
toString
()
var
newStr
=
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
newTemplate
=
newStr
.
replace
(
'
<template>
'
,
''
)
// const calculater = require('../components/calculater')
const
calculater
=
require
(
'
../../../components/complexCondition/index
'
)
var
keyBord
=
require
(
'
../../lib/keyBord
'
)
var
tools
=
require
(
'
../../lib/tools.js
'
)
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
const
condition
=
require
(
'
../../components/condition/index.js
'
)
module
.
exports
=
{
myIndex
:
{
async
function
getMyIndex
()
{
var
condition
=
await
getCondition
()
var
calculater
=
await
getCalculater
()
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/routers/myIndex/myIndex.vue
'
)
return
{
data
:
function
()
{
return
{
treeData
:
[],
...
...
@@ -164,7 +148,7 @@ module.exports = {
computed
:
{
},
template
:
newT
emplate
,
template
:
value
.
t
emplate
,
mounted
()
{
var
that
=
this
ipcRenderer
.
on
(
'
copy-multiple-condition-reply
'
,
function
(
event
,
arg
)
{
...
...
@@ -174,7 +158,7 @@ module.exports = {
this
.
getIndexs
().
then
(
res
=>
{
this
.
getIndexCateGory
(
'
init
'
)
this
.
getDefaultType
()
tools
.
getKeyboardObj
(
keyBord
,
this
.
keyboardObj
)
mytools
.
getKeyboardObj
(
mytools
.
getKeyboard
()
,
this
.
keyboardObj
)
})
this
.
getZjhIndustryCategoryList
()
...
...
@@ -201,7 +185,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Account/Account/CheckPermission
'
,
{
"
id
"
:
id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -315,7 +299,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/UnSubmitIndex
'
,
{
"
id
"
:
this
.
activeIndex
.
PublicIndexId
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -852,7 +836,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/RemoveCustomIndex
'
,
{
"
id
"
:
this
.
activeIndex
.
Id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -876,7 +860,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/IndexNameSimilarity
'
,
{
"
customIndexId
"
:
this
.
activeIndex
.
Id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -903,7 +887,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/SubmitIndexToView
'
,
{
"
id
"
:
this
.
activeIndex
.
Id
,
"
archiveCodes
"
:
arr
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -993,7 +977,7 @@ module.exports = {
getDefaultType
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetAllIndexArgs
'
,
{
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1070,7 +1054,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/RemoveArchive
'
,
{
"
Id
"
:
this
.
activeIndex
.
Id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1091,7 +1075,7 @@ module.exports = {
// "Psize": 100,
// "Code": "B",
// 'Name': '',
// "AccountId":
store.get('accountId')
// "AccountId":
info.accountId
// })
// .then((res) => {
// if (res.data.Status == 1) {
...
...
@@ -1113,7 +1097,7 @@ module.exports = {
"
Psize
"
:
100
,
"
Code
"
:
"
B
"
,
'
Name
'
:
''
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1297,7 +1281,7 @@ module.exports = {
dom
:
''
,
showDom
:
''
}
tools
.
getSaveCondition
(
this
.
activeIndexCondition
,
data
.
Algorithm
.
Object
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
my
tools
.
getSaveCondition
(
this
.
activeIndexCondition
,
data
.
Algorithm
.
Object
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
this
.
$nextTick
(()
=>
{
var
spans
=
document
.
getElementById
(
'
conditionBox
'
).
getElementsByTagName
(
'
span
'
)
...
...
@@ -1307,7 +1291,7 @@ module.exports = {
})
document
.
getElementById
(
'
conditionBox
'
).
innerHTML
=
html
var
spans
=
document
.
getElementById
(
'
conditionBox
'
).
getElementsByTagName
(
'
span
'
)
tools
.
formatShowDom
(
spans
)
my
tools
.
formatShowDom
(
spans
)
})
})
this
.
activeIndex
=
data
...
...
@@ -1450,7 +1434,7 @@ module.exports = {
this
.
treeLoading
=
true
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetMyIndexArchivesLight
'
,
{
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1537,7 +1521,7 @@ module.exports = {
"
id
"
:
this
.
addCategoryType
==
'
add
'
?
0
:
this
.
activeIndex
.
Id
,
"
archiveName
"
:
this
.
inputedCategoryName
,
"
parentId
"
:
this
.
addCategoryType
==
'
add
'
?
this
.
activeIndex
.
Id
:
this
.
activeIndex
.
ParentId
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
this
.
createOrChangeCategoryLoading
=
false
...
...
@@ -1595,7 +1579,7 @@ module.exports = {
"
remark
"
:
this
.
editIndexDetail
,
//备注
"
keywordIds
"
:
keywordIds
,
"
dimensionIds
"
:
dimensionIds
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1716,7 +1700,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetMyIndexByIds
'
,
{
"
ids
"
:
ids
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1730,7 +1714,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetTodoCustomIndexCount
'
,
{
"
countOption
"
:
type
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1750,7 +1734,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/Encode/GetEncodeDetailsByCodes
'
,
{
"
codes
"
:
codes
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
src/views/main_views/indexManage/routers/myIndex/myIndex.vue
View file @
2813d7d8
...
...
@@ -251,7 +251,7 @@
<!-- 未选中指标的显示 -->
<div
class=
"detail-container"
v-if=
"!activeIndex.isIndex"
>
<div
class=
"empty-status"
>
<img
src=
"../../
static/image
/empty.png"
alt
/>
<img
src=
"../../
../static/images
/empty.png"
alt
/>
<div
class=
"empty-tip"
>
请从左侧点击指标或者分类
</div>
</div>
</div>
...
...
src/views/main_views/indexManage/routers/publicIndex/publicIndex.js
View file @
2813d7d8
const
http
=
require
(
'
../../../lib/axios/axios.js
'
)
const
{
dialog
}
=
require
(
'
electron
'
).
remote
const
officegen
=
require
(
'
officegen
'
)
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
)
const
filePath
=
path
.
resolve
(
__dirname
,
'
./publicIndex.vue
'
)
let
newTemplate
=
''
var
data
=
fs
.
readFileSync
(
filePath
);
var
str
=
data
.
toString
()
var
newStr
=
str
.
substring
(
0
,
str
.
lastIndexOf
(
'
</template>
'
))
newTemplate
=
newStr
.
replace
(
'
<template>
'
,
''
)
// const calculater = require('../components/calculater')
const
calculater
=
require
(
'
../../../components/complexCondition/index
'
)
var
keyBord
=
require
(
'
../../lib/keyBord
'
)
var
tools
=
require
(
'
../../lib/tools.js
'
)
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
const
condition
=
require
(
'
../../components/condition/index.js
'
)
module
.
exports
=
{
publicIndex
:
{
async
function
getPublicIndex
()
{
var
condition
=
await
getCondition
()
var
calculater
=
await
getCalculater
()
var
value
=
await
loadComponent
(
'
publicIndex
'
,
window
.
global
.
urls
.
loadUrl
+
'
/src/views/main_views/indexManage/routers/publicIndex/publicIndex.vue
'
)
return
{
data
:
function
()
{
return
{
treeData
:
[],
...
...
@@ -190,7 +174,7 @@ module.exports = {
computed
:
{
},
template
:
newT
emplate
,
template
:
value
.
t
emplate
,
mounted
()
{
var
that
=
this
ipcRenderer
.
on
(
'
copy-multiple-condition-reply
'
,
function
(
event
,
arg
)
{
...
...
@@ -200,7 +184,7 @@ module.exports = {
this
.
getIndexs
().
then
(
res
=>
{
this
.
getIndexCateGory
()
this
.
getDefaultType
()
tools
.
getKeyboardObj
(
keyBord
,
this
.
keyboardObj
)
mytools
.
getKeyboardObj
(
mytools
.
getKeyboard
()
,
this
.
keyboardObj
)
})
this
.
getZjhIndustryCategoryList
()
this
.
getSwIndustryCategoryList
()
...
...
@@ -229,7 +213,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Account/Account/CheckPermission
'
,
{
"
id
"
:
id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -305,7 +289,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/SortPublicIndex
'
,
{
"
sortedPublicIndex
"
:
this
.
confirmCopy
(),
"
remark
"
:
this
.
copyIndexMemo
,
"
accountId
"
:
store
.
get
(
'
accountId
'
)
"
accountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -329,7 +313,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/SortPublicIndex
'
,
{
"
sortedPublicIndex
"
:
submitArr
,
"
remark
"
:
this
.
changePositionMemo
,
"
accountId
"
:
store
.
get
(
'
accountId
'
)
"
accountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -440,7 +424,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/CopyPublicToMyCustomIndex
'
,
{
"
id
"
:
this
.
activeIndex
.
Id
,
"
accountId
"
:
store
.
get
(
'
accountId
'
)
"
accountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -463,7 +447,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/EditPublicIndexWiki
'
,
{
"
id
"
:
this
.
activeIndex
.
Id
,
"
wiki
"
:
this
.
editWiki
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -484,7 +468,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Account/Account/CheckPermission
'
,
{
"
id
"
:
id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -503,7 +487,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/UnSubmitIndex
'
,
{
"
id
"
:
this
.
activeIndex
.
PublicIndexId
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1039,7 +1023,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/RemoveCustomIndex
'
,
{
"
id
"
:
this
.
activeIndex
.
Id
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1071,7 +1055,7 @@ module.exports = {
http
.
netPost
(
'
Data/CustomIndex/SubmitIndexToView
'
,
{
"
id
"
:
this
.
activeIndex
.
Id
,
"
archiveCode
"
:
this
.
submitCategory
[
this
.
submitCategory
.
length
-
1
],
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1151,7 +1135,7 @@ module.exports = {
getDefaultType
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetAllIndexArgs
'
,
{
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1249,7 +1233,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/RemoveEmptyPublicIndexArchiveReq
'
,
{
"
code
"
:
this
.
activeIndex
.
Code
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1272,7 +1256,7 @@ module.exports = {
"
Psize
"
:
100
,
"
Code
"
:
"
B
"
,
'
Name
'
:
''
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1413,54 +1397,6 @@ module.exports = {
obj
:
params
}
},
//指标点击
// selecteIndex(value, param) {
// var data = {}, arr = []
// data = value
// arr = value.isIndex?data.Algorithm.Object:[]
// data.status = value.CurrentFlowStatus
// //先恢复初始化
// if (this.detailShowType == 2) {
// return false
// }
// if (data.isIndex) {
// this.activeIndexStatus = data.status
// this.detailShowType = 1
// this.getUsedCompany(arr).then(res => {
// this.activeIndexCondition = {
// indexParams: {},
// dateParams: {},
// numParams: {},
// symbolParams: {},
// functionParams: {},
// dom: '',
// showDom: ''
// }
// tools.getSaveCondition(this.activeIndexCondition, arr, this.initIndex, this.initIndexObj, this.companyNameObj, this.keyboardObj)
// this.$nextTick(() => {
// var spans = document.getElementById('conditionBox').getElementsByTagName('span')
// var html = ''
// Array.from(spans).forEach(span => {
// html += span.outerHTML
// })
// document.getElementById('conditionBox').innerHTML = html
// var spans = document.getElementById('conditionBox').getElementsByTagName('span')
// tools.formatShowDom(spans)
// })
// })
// } else {
// console.log(data)
// this.detailShowType = 3
// if(!data.children || data.children.length == 0){
// data.allowedDelete = true
// }
// }
// this.activeIndex = data
// this.activeIndex.from = this.findPathByLeafId(value.myId, this.myTreeData)
// },
selecteIndex
(
value
,
param
)
{
console
.
log
(
value
)
var
arr
=
[
value
.
Code
]
...
...
@@ -1491,7 +1427,7 @@ module.exports = {
showDom
:
''
}
this
.
initIndex
++
tools
.
getSaveCondition
(
this
.
activeIndexCondition
,
data
.
Algorithm
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
my
tools
.
getSaveCondition
(
this
.
activeIndexCondition
,
data
.
Algorithm
,
this
.
initIndex
,
this
.
initIndexObj
,
this
.
companyNameObj
,
this
.
keyboardObj
)
this
.
$nextTick
(()
=>
{
var
spans
=
document
.
getElementById
(
'
conditionBox
'
).
getElementsByTagName
(
'
span
'
)
...
...
@@ -1501,7 +1437,7 @@ module.exports = {
})
document
.
getElementById
(
'
conditionBox
'
).
innerHTML
=
html
var
spans
=
document
.
getElementById
(
'
conditionBox
'
).
getElementsByTagName
(
'
span
'
)
tools
.
formatShowDom
(
spans
)
my
tools
.
formatShowDom
(
spans
)
})
})
this
.
activeIndex
=
data
...
...
@@ -1631,7 +1567,7 @@ module.exports = {
this
.
treeLoading
=
true
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetPublicCustomIndexLight
'
,
{
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1706,7 +1642,7 @@ module.exports = {
"
code
"
:
this
.
addCategoryType
==
'
add
'
?
""
:
this
.
activeIndex
.
Code
,
"
name
"
:
this
.
inputedCategoryName
,
"
parentCode
"
:
this
.
addCategoryType
==
'
add
'
?
this
.
activeIndex
.
Code
:
this
.
activeIndex
.
ParentCode
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
this
.
createOrChangeCategoryLoading
=
false
...
...
@@ -1770,7 +1706,7 @@ module.exports = {
"
unit
"
:
this
.
editIndexUnit
,
//单位
"
remark
"
:
this
.
editIndexRemark
,
//备注
"
wiki
"
:
this
.
editIndexDetail
,
//百科
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1917,7 +1853,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetPublicCustomIndexDetailsByCodes
'
,
{
"
codes
"
:
ids
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
@@ -1931,7 +1867,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
http
.
netPost
(
'
Data/CustomIndex/GetTodoCustomIndexCount
'
,
{
"
countOption
"
:
type
,
"
AccountId
"
:
store
.
get
(
'
accountId
'
)
"
AccountId
"
:
info
.
accountId
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
...
...
src/views/main_views/indexManage/routers/publicIndex/publicIndex.vue
View file @
2813d7d8
...
...
@@ -217,7 +217,7 @@
<!-- 未选中指标的显示 -->
<div
class=
"detail-container"
v-if=
"!activeIndex.DataType"
>
<div
class=
"empty-status"
>
<img
src=
"../../
static/image
/empty.png"
alt
/>
<img
src=
"../../
../static/images
/empty.png"
alt
/>
<div
class=
"empty-tip"
>
请从左侧点击指标或者分类
</div>
</div>
</div>
...
...
src/views/main_views/indexManage/routers/routers.js
deleted
100644 → 0
View file @
528ab007
const
{
publicIndex
}
=
require
(
'
./publicIndex.js
'
)
const
{
indexAudit
}
=
require
(
'
./indexAudit.js
'
)
const
{
myIndex
}
=
require
(
'
./myIndex.js
'
)
const
{
categoryAudit
}
=
require
(
'
./categoryAudit.js
'
)
const
{
indexRecord
}
=
require
(
'
./indexRecord.js
'
)
const
routes
=
[
{
path
:
'
/
'
,
component
:
myIndex
},
{
path
:
'
/indexAudit
'
,
component
:
indexAudit
},
{
path
:
'
/publicIndex
'
,
component
:
publicIndex
},
{
path
:
'
/categoryAudit
'
,
component
:
categoryAudit
},
{
path
:
'
/indexRecord
'
,
component
:
indexRecord
}
]
module
.
exports
=
{
routes
:
routes
}
\ No newline at end of file
src/views/main_views/report/report.html
View file @
2813d7d8
...
...
@@ -214,22 +214,25 @@
</div>
</body>
<script>
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
const
{
app
}
=
require
(
'
electron
'
).
remote
</script>
<!-- import Vue before Element -->
<script
src=
"../../../static/vue/vue.js"
></script>
<script
src=
"../../../static/element/index.js"
></script>
<script
src=
"../../../assist/axios.js"
></script>
<script
src=
"./report.js"
></script>
<script>
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
const
{
app
}
=
require
(
'
electron
'
).
remote
const
path
=
app
.
getAppPath
()
const
http
=
require
(
path
+
'
/src/assist/axios.js
'
)
const
tools
=
require
(
path
+
'
/src/views/main_views/report/report.js
'
)
const
http
=
newHttp
()
const
{
dialog
}
=
require
(
'
electron
'
).
remote
const
Datastore
=
require
(
'
nedb
'
)
const
{
shell
}
=
require
(
'
electron
'
)
var
info
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userInfo
'
))
var
menu
=
tools
.
hsmenu
()
var
menu
=
hsmenu
()
new
Vue
({
el
:
'
#app
'
,
...
...
src/views/main_views/report/report.js
View file @
2813d7d8
module
.
exports
.
hsmenu
=
()
=>
{
function
hsmenu
()
{
return
[{
label
:
'
全部
'
,
code
:
[]
...
...
src/views/main_views/stockMarket/routers/main/main.js
View file @
2813d7d8
const
{
app
}
=
require
(
'
electron
'
).
remote
const
path
=
app
.
getAppPath
()
const
init
=
require
(
path
+
'
/src/assist/loadVue.js
'
)
var
value
=
init
(
__filename
,
__dirname
)
console
.
log
(
__filename
)
console
.
log
(
__dirname
)
console
.
log
(
value
)
//以上代码引入vue、css等,初始化
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
const
{
historyListPrice
}
=
require
(
path
+
'
/src/assist/dictionary.js
'
)
const
loadUrl
=
window
.
global
.
urls
.
loadUrl
module
.
exports
[
value
.
name
]
=
{
async
function
getMain
()
{
var
value
=
await
loadComponent
(
'
main
'
,
loadUrl
+
'
/src/views/main_views/stockMarket/routers/main/main.vue
'
)
return
{
data
:
function
()
{
return
{
selectType
:
'
1
'
,
...
...
@@ -38,7 +30,7 @@ module.exports[value.name] = {
positionData
:
[],
industryCompany
:
[],
// 新的数据
historyPrice
:
historyListPrice
(),
historyPrice
:
getDictionary
().
historyListPrice
(),
choosedDate
:
'
2019-01-21
'
,
sort
:
[{
'
FieldName
'
:
'
TRADEDATE
'
,
...
...
@@ -159,9 +151,11 @@ module.exports[value.name] = {
'
Psize
'
:
that
.
psize
})
.
then
((
res
)
=>
{
console
.
log
(
res
)
that
.
total
=
res
.
data
.
Data
.
Total
that
.
showTable
=
true
that
.
tableData
=
res
.
data
.
Data
.
Records
console
.
log
(
that
.
tableData
)
})
},
changeDate
()
{
...
...
@@ -397,6 +391,5 @@ module.exports[value.name] = {
this
.
getStockList
()
}
}
}
}
\ No newline at end of file
src/views/main_views/stockMarket/routers/router.js
View file @
2813d7d8
// const { app } = require('electron').remote
// const path = app.getAppPath()
// const { main } = require(path + '/src/views/main_views/stockMarket/routers/main/main.js')
// const routes = [
// { path: '/', component: main }
// ]
// module.exports = {
// routes: routes
// }
class
routers
{
constructor
()
{}
getRouters
()
{
getRouters
(
component
)
{
return
[
{
path
:
'
/
'
,
component
:
'
main
'
}
{
path
:
'
/
'
,
component
:
component
}
]
}
}
...
...
src/views/main_views/stockMarket/stockMarket.html
View file @
2813d7d8
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
...
...
@@ -9,49 +10,63 @@
<link
rel=
"stylesheet"
href=
"./stockMarket.css"
>
</head>
<body>
<div
id=
"app"
class=
"report-page-container"
>
<router-view></router-view>
</div>
</body>
<script
src=
"../../../static/vue/vue.min.js"
></script>
<script
src=
"../../../static/element/index.js"
></script>
<script
src=
"../../../static/vue-router/vue-router.js"
></script>
<script
src=
'../../../static/xlsx/xlsx.full.min.js'
></script>
<script
src=
"../../../static/plTable/index.js"
></script>
<script
src=
"./routers/router.js"
></script>
<script>
<script>
const
{
app
}
=
require
(
'
electron
'
).
remote
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
window
.
global
.
urls
=
require
(
app
.
getAppPath
()
+
'
/build_config/url
'
)
</script>
<script
src=
"../../../static/vue/vue.min.js"
></script>
<script
src=
"../../../static/element/index.js"
></script>
<script
src=
"../../../static/vue-router/vue-router.js"
></script>
<script
src=
'../../../static/xlsx/xlsx.full.min.js'
></script>
<script
src=
"../../../static/plTable/index.js"
></script>
const
path
=
app
.
getAppPath
()
// const { routes } = require('./routers/router.js')
const
routes
=
new
routers
().
getRouters
()
<script
src=
"../../../assist/loadVue.js"
></script>
<script
src=
"./routers/main/main.js"
></script>
<script
src=
"./routers/router.js"
></script>
<script
src=
"../../../assist/axios.js"
></script>
console
.
log
(
routes
)
<script
src=
"../../../assist/dictionary.js"
></script>
const
router
=
new
VueRouter
({
routes
})
const
http
=
require
(
path
+
'
/src/assist/axios.js
'
)
<script>
var
http
=
newHttp
(
)
var
info
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userInfo
'
))
const
{
splitPane
}
=
require
(
'
vue-splitpane
'
)
Vue
.
component
(
'
split-pane
'
,
splitPane
)
async
function
init
()
{
var
component
=
await
getMain
()
var
routes
=
new
routers
().
getRouters
(
component
)
var
router
=
new
VueRouter
({
routes
})
new
Vue
({
router
,
el
:
'
#app
'
,
data
:
function
()
{
data
:
function
()
{
return
{
}
},
mounted
()
{
mounted
()
{
},
methods
:
{
}
})
</script>
}
init
()
</script>
</html>
\ No newline at end of file
src/views/main_views/szxData/routers/main/main.js
View file @
2813d7d8
const
{
app
}
=
require
(
'
electron
'
).
remote
const
path
=
app
.
getAppPath
()
const
init
=
require
(
path
+
'
/src/assist/loadVue.js
'
)
var
value
=
init
(
__filename
,
__dirname
)
console
.
log
(
value
)
const
loadUrl
=
window
.
global
.
urls
.
loadUrl
//以上代码引入vue、css等,初始化
const
officegen
=
require
(
'
officegen
'
)
...
...
@@ -11,7 +6,10 @@ const { dialog } = require('electron').remote
const
fs
=
require
(
'
fs
'
)
const
Excel
=
require
(
'
exceljs
'
);
module
.
exports
[
value
.
name
]
=
{
async
function
getMain
()
{
var
value
=
await
loadComponent
(
'
main
'
,
loadUrl
+
'
/src/views/main_views/szxData/routers/main/main.vue
'
)
return
{
data
:
function
()
{
return
{
treeData
:
[],
...
...
@@ -258,7 +256,7 @@ module.exports[value.name] = {
}
},
classifyFields
:
[
11530
,
11528
,
11541
,
11540
,
11545
,
11562
,
11559
],
classifyFields
:
[
11530
,
11528
,
11541
,
11540
,
11545
,
11562
,
11559
],
basicFields
:
[
14054
,
14068
,
14062
],
middleCheckedIds
:
[],
sameFields
:
[]
...
...
@@ -982,8 +980,8 @@ module.exports[value.name] = {
type
:
item
.
FieldType
})
}
else
{
this
.
sameFields
.
push
(
item
.
Id
+
''
)
}
else
{
this
.
sameFields
.
push
(
item
.
Id
+
''
)
}
})
...
...
@@ -1033,7 +1031,7 @@ module.exports[value.name] = {
}
// this.$set(this, 'tableHeaders', headers)
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
tableHeaders
=
headers
})
// this.tableHeaders = headers
...
...
@@ -1068,7 +1066,7 @@ module.exports[value.name] = {
var
dateArr
=
[],
targetArr
=
[],
directionArr
=
[],
selectionArr
=
[]
this
.
tableHeaders
.
forEach
(
item
=>
{
if
(
item
.
checked
)
{
if
(
item
.
checked
)
{
if
(
item
.
isActiveDate
)
{
dateArr
.
push
(
item
)
}
...
...
@@ -1131,7 +1129,7 @@ module.exports[value.name] = {
this
.
getTableData
(
this
.
currentDB
,
checkedIds
,
where
,
sort
,
this
.
getJoinIds
(
this
.
tableHeaders
))
},
getJoinIds
(
headers
)
{
getJoinIds
(
headers
)
{
console
.
log
(
this
.
sameFields
)
var
classifyDict
=
{},
basicDict
=
{},
classifyArr
=
[],
basicArr
=
[],
Joins
=
[]
...
...
@@ -1147,7 +1145,7 @@ module.exports[value.name] = {
console
.
log
(
classifyArr
)
basicArr
=
headers
.
filter
(
item
=>
basicDict
[
item
.
id
]
&&
(
this
.
sameFields
.
indexOf
(
item
.
id
)
<
0
)).
map
(
item
=>
item
.
id
)
if
(
classifyArr
.
length
>
0
)
{
if
(
classifyArr
.
length
>
0
)
{
Joins
.
push
({
"
JoinOption
"
:
0
,
// 连接类型
"
TableId
"
:
14
,
// 连接表ID,
...
...
@@ -1160,7 +1158,7 @@ module.exports[value.name] = {
]
})
}
if
(
basicArr
.
length
>
0
)
{
if
(
basicArr
.
length
>
0
)
{
Joins
.
push
({
"
JoinOption
"
:
0
,
// 连接类型
"
TableId
"
:
17
,
// 连接表ID,
...
...
@@ -1193,7 +1191,7 @@ module.exports[value.name] = {
"
Psize
"
:
this
.
choosedPsize
}).
then
((
res
)
=>
{
if
(
res
.
data
.
Status
==
1
)
{
if
(
this
.
currentDB
.
JoinTableId
==
data
.
JoinTableId
)
{
if
(
this
.
currentDB
.
JoinTableId
==
data
.
JoinTableId
)
{
this
.
tableData
=
res
.
data
.
Data
.
Records
this
.
totalPage
=
res
.
data
.
Data
.
Total
this
.
$refs
.
dataTable
.
reloadData
(
this
.
tableData
)
...
...
@@ -1202,7 +1200,7 @@ module.exports[value.name] = {
}
else
{
}
if
(
this
.
currentDB
.
JoinTableId
==
data
.
JoinTableId
)
{
if
(
this
.
currentDB
.
JoinTableId
==
data
.
JoinTableId
)
{
this
.
tableLoading
=
false
}
}).
catch
(
err
=>
{
...
...
@@ -1210,11 +1208,11 @@ module.exports[value.name] = {
})
})
},
changeUnit
()
{
changeUnit
()
{
this
.
choosedUnitPopover
=
false
this
.
$refs
.
dataTable
.
reloadData
(
this
.
tableData
)
},
changeDecimal
()
{
changeDecimal
()
{
this
.
$refs
.
dataTable
.
reloadData
(
this
.
tableData
)
},
unitFormatter
(
scop
,
item
)
{
...
...
@@ -1271,7 +1269,7 @@ module.exports[value.name] = {
this
.
tableHeaders
=
[]
this
.
tableData
=
[]
this
.
sameFields
=
[]
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
currentPage
=
1
this
.
reportDateCondition
=
[]
this
.
selectedCompanyData
=
[]
...
...
@@ -1281,7 +1279,7 @@ module.exports[value.name] = {
this
.
getTableHeader
(
data
.
JoinTableId
).
then
(
res
=>
{
this
.
handleCurrentChange
(
1
)
})
},
0
)
},
0
)
},
searchHeader
()
{
this
.
usedSearchInput
=
this
.
headerSearchInput
...
...
@@ -1645,7 +1643,7 @@ module.exports[value.name] = {
var
dateArr
=
[],
targetArr
=
[],
directionArr
=
[],
selectionArr
=
[]
this
.
tableHeaders
.
forEach
(
item
=>
{
if
(
item
.
checked
)
{
if
(
item
.
checked
)
{
if
(
item
.
isActiveDate
)
{
dateArr
.
push
(
item
)
}
...
...
@@ -2158,7 +2156,7 @@ module.exports[value.name] = {
},
setSort
(
item
,
direction
)
{
item
.
sortDirection
==
direction
?
item
.
sortDirection
=
0
:
item
.
sortDirection
=
direction
item
.
sortDirection
==
direction
?
item
.
sortDirection
=
0
:
item
.
sortDirection
=
direction
this
.
handleCurrentChange
(
1
)
},
emptyFilterDate
()
{
...
...
@@ -2180,4 +2178,5 @@ module.exports[value.name] = {
// this.handleCurrentChange(1)
}
}
}
}
src/views/main_views/szxData/routers/router.js
View file @
2813d7d8
const
{
app
}
=
require
(
'
electron
'
).
remote
const
path
=
app
.
getAppPath
()
const
{
main
}
=
require
(
path
+
'
/src/views/main_views/szxData/routers/main/main.js
'
)
const
routes
=
[
{
path
:
'
/
'
,
component
:
main
}
]
module
.
exports
=
{
routes
:
routes
class
routers
{
constructor
()
{}
getRouters
(
component
)
{
return
[
{
path
:
'
/
'
,
component
:
component
}
]
}
}
src/views/main_views/szxData/szxData.html
View file @
2813d7d8
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
...
...
@@ -9,40 +10,60 @@
<link
rel=
"stylesheet"
href=
"./szxData.css"
>
</head>
<body>
<div
id=
"app"
>
<router-view></router-view>
</div>
</body>
<script
src=
"../../../static/vue/vue.min.js"
></script>
<script
src=
"../../../static/element/index.js"
></script>
<script
src=
"../../../static/vue-router/vue-router.js"
></script>
<script
src=
'../../../static/xlsx/xlsx.full.min.js'
></script>
<script
src=
"../../../static/plTable/index.js"
></script>
<script>
<script>
const
{
app
}
=
require
(
'
electron
'
).
remote
const
path
=
app
.
getAppPath
()
const
{
routes
}
=
require
(
path
+
'
/src/views/main_views/szxData/routers/router.js
'
)
const
router
=
new
VueRouter
({
routes
})
const
http
=
require
(
path
+
'
/src/assist/axios.js
'
)
const
{
ipcRenderer
}
=
require
(
'
electron
'
)
window
.
global
.
urls
=
require
(
app
.
getAppPath
()
+
'
/build_config/url
'
)
</script>
<script
src=
"../../../static/vue/vue.min.js"
></script>
<script
src=
"../../../static/element/index.js"
></script>
<script
src=
"../../../static/vue-router/vue-router.js"
></script>
<script
src=
'../../../static/xlsx/xlsx.full.min.js'
></script>
<script
src=
"../../../static/plTable/index.js"
></script>
<script
src=
"../../../assist/loadVue.js"
></script>
<script
src=
"./routers/main/main.js"
></script>
<script
src=
"./routers/router.js"
></script>
<script
src=
"../../../assist/axios.js"
></script>
<script>
var
http
=
newHttp
()
var
info
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userInfo
'
))
const
{
splitPane
}
=
require
(
'
vue-splitpane
'
)
Vue
.
component
(
'
split-pane
'
,
splitPane
)
async
function
init
()
{
var
component
=
await
getMain
()
var
routes
=
new
routers
().
getRouters
(
component
)
var
router
=
new
VueRouter
({
routes
})
new
Vue
({
router
,
el
:
'
#app
'
,
data
:
function
()
{
data
:
function
()
{
return
{
}
},
mounted
()
{
mounted
()
{
},
methods
:
{
}
})
</script>
}
init
()
</script>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment