Browse Source

Merge branch 'master' of http://116.63.33.55/git/read_opc

Zt 1 năm trước cách đây
mục cha
commit
24714077ae

+ 9 - 9
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -26,9 +26,9 @@
                 </template>
                 <span :title='data.reportNameTips' style="margin-left: 2px;">{{ data.reportName || data.itemName }}</span>
                 <span v-if="data.id == -1" style="position: absolute; right: 0; background: #646464;">
-                  <el-button type="text" size="mini" style="color: #FFFFFF;" title="新建模板"
+                  <el-button type="text" size="mini" style="color: #FFFFFF;" title="新建报表"
                              @click="addReportEvent" icon="el-icon-document-add"></el-button>
-                  <el-button type="text" size="mini" style="color: #FFFFFF; margin-left: 5px;" title="导入模板"
+                  <el-button type="text" size="mini" style="color: #FFFFFF; margin-left: 5px;" title="导入报表"
                              @click="importReportEvent" icon="el-icon-upload2"></el-button>
                 </span>
               </span>
@@ -76,8 +76,8 @@
     <ul v-show="visibleReportMenu"
         :style="{ left: menuLeft + 'px', top: menuTop + 'px' }"
         class="contextmenu contextmenu-black">
-      <li @click="addReportEvent">新建模板</li>
-      <li @click="importReportEvent">导入模板</li>
+      <li @click="addReportEvent">新建报表</li>
+      <li @click="importReportEvent">导入报表</li>
     </ul>
     <!-- 报表模板列表右键操作 -->
     <ul v-show="visibleReportChildMenu"
@@ -1358,12 +1358,12 @@ export default {
         showAlertMsgWin(this, null, cqcyCode[201])
         return
       }
-      showPromptWin(this, '修改报表模板名称', '请输入报表模板名称', this.chooseReportData.reportName, (val) => {
+      showPromptWin(this, '修改报表名称', '请输入报表名称', this.chooseReportData.reportName, (val) => {
         if (!val || !val.trim()) {
-          return '报表模板名称不能为空'
+          return '报表名称不能为空'
         }
         if (val.length > 20) {
-          return '报表模板名称必须在20字以内'
+          return '报表名称必须在20字以内'
         }
       }, (value) => {
         const loading = showLoading(this, '修改中,请稍候···')
@@ -1392,7 +1392,7 @@ export default {
         showAlertMsgWin(this, null, cqcyCode[201])
         return
       }
-      showConfirmWin(this, null, '您确定要删除该报表模板吗?', () => {
+      showConfirmWin(this, null, '您确定要删除该报表吗?', () => {
         const loading = showLoading(this, '删除中,请稍候···')
         delTableTemplateById(this.chooseReportData.id).then(res => {
           loading.close()
@@ -2034,7 +2034,7 @@ export default {
     /** 报表模板移除 */
     removeReportItem(node, data) {
       this.delFlag = false
-      showConfirmWin(this, null, '您确定要删除该报表模板吗?', () => {
+      showConfirmWin(this, null, '您确定要删除该报表吗?', () => {
         const loading = showLoading(this, '删除中,请稍候···')
         delTableTemplateById(data.id).then(res => {
           loading.close()

+ 33 - 27
chuanyi_client2/src/views/report_template/index.vue

@@ -39,11 +39,11 @@
           <span>关闭</span>
         </div>
         <el-divider></el-divider>
-        <div class="cy-chart-div" @click="templateEvent()">
+        <div class="cy-chart-div" @click="templateEvent()" v-if="templateReportType != 2">
           <svg-icon icon-class="report_template" style="width: 35px;"/>
           <span>模板库</span>
         </div>
-        <div class="cy-chart-div" @click="dataEvent(1)">
+        <div class="cy-chart-div" @click="dataEvent(1)" v-if="templateReportType != 2">
           <svg-icon icon-class="report_basedata" style="width: 35px;"/>
           <span>基础数据项</span>
         </div>
@@ -316,7 +316,6 @@
           </el-select>
           <el-button size="mini" @click="addDataItem" style="width: 100px;margin-top: 4px; margin-left: 10px;">选择数据项</el-button>
           <el-button size="mini" type="primary" @click="multipleDataItemEvent"
-                     v-if="templateReportType != 2"
                      style="width: 100px;margin-top: 4px;">设置数据条件</el-button>
         </div>
         <div style="height: 30vh; margin-top: 10px; overflow: auto;">
@@ -338,19 +337,24 @@
             </el-table-column>
             <el-table-column prop="itemName" label="数据项名称" align="center">
             </el-table-column>
-            <el-table-column v-if="templateReportType != 2" prop="valueTakingMode" label="取值模式" align="center">
+            <el-table-column prop="valueType" label="取值类型" align="center">
+              <template slot-scope="scope">
+                {{ getValByProp(valueTypeList, scope.row.valueType) }}
+              </template>
+            </el-table-column>
+            <el-table-column v-if="templateReportType == 1" prop="valueTakingMode" label="取值模式" align="center">
               <template slot-scope="scope">
                 {{ getValByProp(valueTakingModeList, scope.row.valueTakingMode) }}
               </template>
             </el-table-column>
-            <el-table-column v-if="templateReportType != 2" prop="bucketType" label="取值时间单位" align="center">
+            <el-table-column v-if="templateReportType == 1" prop="bucketType" label="取值时间单位" align="center">
               <template slot-scope="scope">
                 {{ getValByProp(bucketTypeList, scope.row.bucketType) }}
               </template>
             </el-table-column>
-            <el-table-column v-if="templateReportType != 2" prop="bucketValue" label="取值时段间隔" align="center">
+            <el-table-column v-if="templateReportType == 1" prop="bucketValue" label="取值时段间隔" align="center">
             </el-table-column>
-            <template v-if="templateReportType == 0">
+            <template v-if="false">
               <el-table-column prop="startTime" label="取值时段范围" align="center">
                 <template slot-scope="scope">
                   {{ scope.row.startTime }}
@@ -424,23 +428,23 @@
                     v-model="itemConditionForm.valueType"
                     :label="item.value">{{ item.label }}</el-radio>
         </el-form-item>
-        <el-form-item label="取值模式:" prop="valueTakingMode">
+        <el-form-item label="取值模式:" prop="valueTakingMode" v-if="templateReportType == 1">
           <el-radio v-for="item in valueTakingModeList"
                     v-model="itemConditionForm.valueTakingMode"
                     :label="item.value">{{ item.label }}</el-radio>
         </el-form-item>
-        <el-form-item label="时间单位:" prop="bucketType">
+        <el-form-item label="时间单位:" prop="bucketType" v-if="templateReportType == 1">
           <el-radio v-for="item in bucketTypeList"
                     v-model="itemConditionForm.bucketType"
                     :label="item.value">{{ item.label }}</el-radio>
         </el-form-item>
-        <el-form-item label="时段间隔:" prop="bucketValue">
+        <el-form-item label="时段间隔:" prop="bucketValue" v-if="templateReportType == 1">
           <el-input-number label="请输入时段值"
                            v-model="itemConditionForm.bucketValue"
                            :min="1"
                            :max="100"></el-input-number>
         </el-form-item>
-        <template v-if="templateReportType == 0">
+        <template v-if="false">
           <el-form-item label="取值时间:" prop="dateRange">
             <el-date-picker
                 v-model="itemConditionForm.dateRange"
@@ -575,10 +579,10 @@ export default {
       ],
       // 数据项取值条件
       itemConditionForm: {
-        valueType: null, // 0原始值1计算值
-        valueTakingMode: null, // 取值模式0平均值,1最大值,2最小值,3瞬时值
-        bucketType: null, // 时段类型0天,1时,2分,3秒
-        bucketValue: null, // 时段值
+        valueType: 0, // 0原始值1计算值
+        valueTakingMode: 0, // 取值模式0平均值,1最大值,2最小值,3瞬时值
+        bucketType: 1, // 时段类型0天,1时,2分,3秒
+        bucketValue: 1, // 时段值
         dateRange: [], // 取值时间范围,手动报表必填
       },
       itemConditionFormRules: {
@@ -631,6 +635,7 @@ export default {
       reportTemplateItem: this.$store.getters.sessionName.REPORT_TEMPLATE_ITEM,
       reportInterval: null,
       toolChart: [],
+      toolItemChart: [],
       toolItemTable: [],
       luckysheetOption: {
         container: 'luckysheet', // 设定 DOM 容器的 id
@@ -777,6 +782,7 @@ export default {
       this.templateVersion = null
       this.templateName = ''
       this.toolChart = []
+      this.toolItemChart = []
       this.toolItemTable = []
       luckysheet.destroy()
       let locItem = localStorage.getItem(_this.reportTemplateItem)
@@ -845,10 +851,10 @@ export default {
     /** 多选事件 */
     multipleDataItemEvent() {
       // 事件驱动报表
-      if (this.templateReportType == 2) {
-        showAlertMsgWin(this, null, '事件驱动报表不需要设置取值条件!')
-        return
-      }
+      // if (this.templateReportType == 2) {
+      //   showAlertMsgWin(this, null, '事件驱动报表不需要设置取值条件!')
+      //   return
+      // }
       if (!this.selectionDataItems || this.selectionDataItems.length == 0) {
         showAlertMsgWin(this, null, '请至少选择一项数据!')
         return
@@ -857,10 +863,10 @@ export default {
     },
     /** 数据项配置结果集事件 */
     chooseDataItemConfigEvent() {
-      if (this.templateReportType == 0 && (!this.itemConditionForm.dateRange || this.itemConditionForm.dateRange.length == 0)) {
-        showAlertMsgWin(this, null, '取值时间范围不能为空!')
-        return
-      }
+      // if (this.templateReportType == 0 && (!this.itemConditionForm.dateRange || this.itemConditionForm.dateRange.length == 0)) {
+      //   showAlertMsgWin(this, null, '取值时间范围不能为空!')
+      //   return
+      // }
       this.$refs['itemConditionForm'].validate((valid) => {
         if (valid) {
           this.$nextTick(() => {
@@ -1931,10 +1937,10 @@ export default {
     /** 数据项取值配置弹出层关闭事件 */
     dialogDataItemConfigClose(done) {
       this.itemConditionForm = {
-        valueType: null, // 取值模式0平均值,1最大值,2最小值,3瞬时
-        valueTakingMode: null, // 取值模式0平均值,1最大值,2最小值,3瞬时值
-        bucketType: null, // 时段类型0天,1时,2分,3秒
-        bucketValue: null, // 时段值
+        valueType: 0, // 0原始值1计算
+        valueTakingMode: 0, // 取值模式0平均值,1最大值,2最小值,3瞬时值
+        bucketType: 1, // 时段类型0天,1时,2分,3秒
+        bucketValue: 1, // 时段值
         dateRange: [], // 取值时间范围,手动报表必填
       }
       if (typeof(done) === 'function') {