Ver código fonte

Merge branch 'demo_' of http://124.71.196.186:8888/hfxc226/hitch-antd into demo_

whj 2 anos atrás
pai
commit
4a976398ec

BIN
src/assets/green.png


+ 1 - 1
src/views/opc/Opc.vue

@@ -255,7 +255,7 @@ export default {
   position: relative;
 }
 .info{
-  font-size: 14px;
+  font-size: 12px;
   font-weight: bold;
   color: black;
   // transform: scale(0.5);

+ 23 - 3
src/views/opc/OpcInfo.vue

@@ -23,7 +23,7 @@
               {{ item.description + '(' + item.time + ')' }}
             </template>
             <!--            <div class="info" @click="handleInfo(item)" @click.right.prevent="handleView(item)">-->
-            <div class="info" @click="handleInfo(item)">
+            <div v-if="item.type===1" class="info" @click="handleInfo(item)">
               <span :style="{'color':item.warnFirstColor}" v-if="(+item.result)<=item.warnFirst&&item.warnFirst!==null">{{ item.result }}</span>
               <span :style="{'color':item.warnSecondColor}" v-else-if="item.warnFirst<(+item.result)&&(+item.result)<item.warnSecond">{{ item.result }}</span>
               <span :style="{'color':item.warnThirdColor}" v-else-if="item.warnThird<(+item.result)&&(+item.result)<item.warnFour">{{ item.result }}</span>
@@ -33,7 +33,7 @@
           </a-tooltip>
         </VueDragResize>
         <VueDragResize
-          v-if="item.type===2"
+          v-if="item.type===2 && item.fetchFlag===1 "
           v-show="item.result===0||item.result===null"
           :isActive="item.isActive"
           :w="35"
@@ -49,7 +49,27 @@
             <template slot="title">
               {{ item.description }}
             </template>
-            <img src="@/assets/stop.png" alt="" width="35px" height="35px">
+            <img src="@/assets/green.png" alt="" width="35px" height="35px">
+          </a-tooltip>
+        </VueDragResize>
+        <VueDragResize
+          v-if="item.type===2 && item.fetchFlag===0 "
+          v-show="item.result===0||item.result===null"
+          :isActive="item.isActive"
+          :w="35"
+          :h="35"
+          :minh="20"
+          :x="item.imgXPosition"
+          :y="item.imgYPosition"
+          :isDraggable="item.isActive"
+          :isResizable="item.isActive"
+          :stickSize="5"
+        >
+          <a-tooltip>
+            <template slot="title">
+              {{ item.description }}
+            </template>
+            <img style="z-index: 100" src="@/assets/stop.png" alt="" width="35px" height="35px">
           </a-tooltip>
         </VueDragResize>
       </div>

+ 34 - 15
src/views/remote/opc/RemoteOpc.vue

@@ -135,8 +135,14 @@
               :type="2"
               title="是否要删除该条数据?"
               @confirm="batchDelete(record.id)">删除</operation-button>
-            <a-divider type="vertical" />
+            <a-divider
+              v-if="record.type == 2"
+              type="vertical" />
             <a
+              v-if="record.type == 2"
+              @click="handleAddFetch(record)">就地点位
+            </a>
+            <!--            <a
               style="margin-left: 8px"
               @click="doTestAdd(record)">测试写入
             </a>
@@ -149,7 +155,7 @@
             <a
               style="margin-left: 8px"
               @click="doTestSelect(record)">测试查询
-            </a>
+            </a>-->
           </template>
         </span>
       </s-table>
@@ -375,6 +381,32 @@ export default {
         ...this.$route.query
       })
     },
+    handleAddFetch (record) {
+      fetchRemoteOpc({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        const data = res.data
+        data.id = null
+        data.positionNum = null
+        data.sbName = null
+        data.description = null
+        data.fetchFlag = 0
+        data.remark = null
+        modal.base(data)
+      })
+    },
+    handleEdit (record) {
+      fetchRemoteOpc({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      // this.visible = false
+      fetchRemoteOpc({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
     doAddAll () {
       const parameter = {
         ...this.queryParam,
@@ -403,19 +435,6 @@ export default {
         this.$message.info('已查询')
       })
     },
-    handleEdit (record) {
-      fetchRemoteOpc({ id: record.id }).then(res => {
-        const modal = this.$refs.baseModal
-        modal.base(res.data)
-      })
-    },
-    handleView (record) {
-      // this.visible = false
-      fetchRemoteOpc({ id: record.id }).then(res => {
-        const modal = this.$refs.detailModal
-        modal.base(res.data)
-      })
-    },
     handleOk () {
       this.visible = true
       this.$refs.table.refresh()

+ 67 - 4
src/views/remote/opc/modules/BaseForm.vue

@@ -64,7 +64,9 @@
           >
             <a-input
               @blur="checkPoint"
-              v-decorator="['description', {rules: [{required: true, message: '描述不能为空'}]}]"/>
+              style="width: 60%"
+              v-decorator="['description', {rules: [{required: true, message: '点位不能为空'}]}]"/>
+            <a-button type="primary" style="width: 40%" @click="handleAddFetch()">设置就地点位</a-button>
           </a-form-item>
         </row-item>
         <row-item>
@@ -98,7 +100,23 @@
             </a-select>
           </a-form-item>
         </row-item>
-<!--        <row-item>
+        <row-item>
+          <a-form-item
+            label="是否开关点位"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['fetchFlag', {initialValue:1, rules: [{required: true, message: '是否开关点位'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in yesNoMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <!--        <row-item>
 
           <a-form-item
             label="是否模拟量"
@@ -412,6 +430,7 @@ export default {
     return {
       confirmLoading: false,
       modalTitle: null,
+      model: null,
       map: {},
       treeData: [],
       yesNoMap: {},
@@ -448,7 +467,37 @@ export default {
         this.modalTitle = '添加'
         this.$nextTick(() => {
           setFieldsValue(Object.assign(pick(record, [
-            'line'
+            'sbId',
+            'sbName',
+            'positionNum',
+            'type',
+            'line',
+            'description',
+            'result',
+            'ratio',
+            'low',
+            'high',
+            'warnFirst',
+            'warnSecond',
+            'warnThird',
+            'warnFour',
+            'warnFirstColor',
+            'warnSecondColor',
+            'warnThirdColor',
+            'warnFourColor',
+            'xposition',
+            'yposition',
+            'imgXPosition',
+            'imgYPosition',
+            'width',
+            'height',
+            'unit',
+            'avFlag',
+            'portFlag',
+            'createdFlag',
+            'fetchFlag',
+            'positionFlag',
+            'remark'
           ]),
           pick(position, [
             'xposition',
@@ -462,6 +511,7 @@ export default {
       }
       this.modalTitle = '编辑'
       this.type = record.type
+      this.model = record
       // 日期处理
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
@@ -491,9 +541,9 @@ export default {
           'width',
           'height',
           'unit',
-          'avFlag',
           'portFlag',
           'createdFlag',
+          'fetchFlag',
           'positionFlag',
           'remark'
         ])))
@@ -551,6 +601,19 @@ export default {
           })
       })
     },
+    handleAddFetch () {
+      if (this.type === 1) {
+        this.$message.error('只有布尔类型的点位,才可以配置就地点位')
+        return
+      }
+      this.model.id = null
+      this.model.positionNum = null
+      this.model.sbName = null
+      this.model.description = null
+      this.model.fetchFlag = 0
+      this.model.remark = null
+      this.base(this.model)
+    },
     save () {
       const { form: { validateFieldsAndScroll } } = this
       this.confirmLoading = true

+ 1 - 0
src/views/remote/opc/modules/Detail.vue

@@ -104,6 +104,7 @@ export default {
         'avFlag': null,
         'portFlag': null,
         'createdFlag': null,
+        'fetchFlag': null,
         'createdUserId': null,
         'updateUserId': null,
         'updateTime': null