123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <view class="control">
- <view class="update-line">
- <view class="label" :style="{ color: fColor }">
- {{ ctrlModel.funcname }}
- </view>
- <view class="content" :style="{ color: fColor }">
- <block v-if="ctrlModel.inputType == 'switch'">
- {{ switchRes(ctrlModel) }}
- </block>
- <block v-else>
- {{ ctrlModel.paramValue || ctrlModel.params.lastvalue || '暂未设置' }}
- </block>
- <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(ctrlModel)">{{
- ctrlModel.isfeedback ? '待更新' : '更新' }}</view>
- </view>
- </view>
- <view class="update-line" v-for="item in list" :key="item.paramName">
- <view class="label" :style="{ color: fColor }">
- {{ item.funcname }}
- </view>
- <view class="content" :style="{ color: fColor }">
- <block v-if="item.inputType == 'switch'">
- {{ switchRes(item) }}
- </block>
- <block v-else>
- {{ item.paramValue || item.params.lastvalue || '暂未设置' }}
- </block>
- <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(item)">{{
- item.isfeedback ? '待更新' : '更新' }}</view>
- </view>
- </view>
- <My_input ref="MyInput" />
- </view>
- </template>
- <script>
- export default {
- name: "mpattern",
- props: {
- fColor: {
- type: String,
- default: "#FFF"
- }
- },
- data() {
- return {
- ctrlModel: {},
- list: []
- }
- },
- computed: {
- switchRes: function () {
- return item => {
- try {
- if (item.showValue) return item.showValue;
- let value = item.paramValue || item.params.lastvalue,
- res = item.params.options.find(v => v.value == value);
- return res ? res.label : '暂未设置'
- } catch (error) {
- }
- }
- }
- },
- methods: {
- onClick(item) {
- this.$refs.MyInput.openInput(item)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .row {
- position: relative;
- display: flex;
- padding: 4px 6px 0;
- height: 60px;
- box-sizing: border-box;
- background: #fff;
- border-radius: 4px;
- margin-bottom: 5px;
- .box {
- width: 49%;
- .content {
- display: flex;
- margin-top: 10px;
- align-items: flex-end;
- .value {
- width: 0;
- flex: 1;
- color: #333;
- font-size: 16px;
- flex-shrink: 0;
- font-weight: bold;
- }
- .unit {
- font-size: 10px;
- color: #666;
- flex-shrink: 0;
- max-width: 50px;
- }
- }
- }
- .dot {
- position: absolute;
- right: 2px;
- top: 2px;
- width: 10px;
- height: 10px;
- background: #D9001B;
- border-radius: 50%;
- }
- }
- </style>
|