|
@@ -744,8 +744,19 @@
|
|
|
if (res.code == "ok") {
|
|
|
this.allListData = res.data
|
|
|
this.page = 1
|
|
|
-
|
|
|
- this.jieliu_echarts()
|
|
|
+ if(this.user.userNameNeedTranslate == '1' && this.radio == this.$t('lable.department')) {
|
|
|
+ console.log('进入我处理的方法')
|
|
|
+ let arr = []
|
|
|
+ for(var i in this.allListData.costList) {
|
|
|
+ let obj = {}
|
|
|
+ obj.type = this.allListData.costList[i].type
|
|
|
+ obj.id = this.allListData.costList[i].departmentName
|
|
|
+ arr.push(obj)
|
|
|
+ }
|
|
|
+ this.dealWithTranslation(arr)
|
|
|
+ } else {
|
|
|
+ this.jieliu_echarts()
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -760,11 +771,49 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ dealWithTranslation(items) {
|
|
|
+ console.log('进来的值', items)
|
|
|
+
|
|
|
+ if (WWOpenData.initCanvas) {
|
|
|
+ WWOpenData.initCanvas()
|
|
|
+ console.log('成功了吧')
|
|
|
+ }
|
|
|
+
|
|
|
+ const myFunOne = async () => {
|
|
|
+ const result = await new Promise((resolve, reject) => {
|
|
|
+ console.log('我触发了')
|
|
|
+ console.log(WWOpenData)
|
|
|
+ console.log(WWOpenData.prefetch)
|
|
|
+ if(WWOpenData.prefetch) {
|
|
|
+ WWOpenData.prefetch({ items }, (err, data) => {
|
|
|
+ console.log(items)
|
|
|
+ console.log(err)
|
|
|
+ console.log(data)
|
|
|
+ if (err) { return reject(err) }
|
|
|
+ resolve(data)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ console.log(result, '取到的数据')
|
|
|
+ // result.items.map((v)=>{
|
|
|
+ // console.log(v,'返回数据 Echar 图标')
|
|
|
+ // this.dep_name.push(v.data)
|
|
|
+ // })
|
|
|
+ // this.on_analysis() // ECharts 渲染函数
|
|
|
+ let arrList = []
|
|
|
+ for(var i in result) {
|
|
|
+ this.allListData.costList[i].departmentName = result[i].data
|
|
|
+ }
|
|
|
+ console.log(this.allListData, '最终的数据')
|
|
|
+ this.jieliu_echarts()
|
|
|
+ }
|
|
|
+
|
|
|
+ myFunOne()
|
|
|
+ },
|
|
|
jieliu_echarts(){
|
|
|
var _this = this;
|
|
|
// 更具数据的长度去加每个柱子的间距
|
|
|
-
|
|
|
-
|
|
|
var xList = []
|
|
|
var yList = []
|
|
|
var list
|