|
|
@@ -53,6 +53,37 @@
|
|
|
align="center"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
+ <el-table-column
|
|
|
+ label="设备类型"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ {{ scope.row.async ? '异步盒' : '非异步盒' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="特性"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div class="c-tags">
|
|
|
+ <el-tag
|
|
|
+ v-if="scope.row.detection"
|
|
|
+ type="success"
|
|
|
+ size="medium"
|
|
|
+ >
|
|
|
+ 设备监测
|
|
|
+ </el-tag>
|
|
|
+ <el-tag
|
|
|
+ v-if="scope.row.contentProtection"
|
|
|
+ type="success"
|
|
|
+ size="medium"
|
|
|
+ >
|
|
|
+ 内容保护
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="remark"
|
|
|
label="备注"
|
|
|
@@ -112,6 +143,29 @@
|
|
|
maxlength="50"
|
|
|
show-word-limit
|
|
|
/>
|
|
|
+ <span class="c-grid-form__label">异步盒:</span>
|
|
|
+ <div class="l-flex--row">
|
|
|
+ <el-switch
|
|
|
+ v-model="flag.async"
|
|
|
+ class="c-sibling-item"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ />
|
|
|
+ <span class="c-sibling-item far">支持设备监测:</span>
|
|
|
+ <el-switch
|
|
|
+ v-model="flag.detection"
|
|
|
+ class="c-sibling-item"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ />
|
|
|
+ <span class="c-sibling-item far">支持内容保护:</span>
|
|
|
+ <el-switch
|
|
|
+ v-model="flag.contentProtection"
|
|
|
+ class="c-sibling-item"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<span class="c-grid-form__label">备注:</span>
|
|
|
<el-input
|
|
|
v-model="transmitter.remark"
|
|
|
@@ -127,16 +181,17 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getSendCardManufacturers,
|
|
|
- getSendCards,
|
|
|
- addSendCard,
|
|
|
- updateSendCard,
|
|
|
- deleteSendCard
|
|
|
+ getSendingCardManufacturers,
|
|
|
+ getSendingCards,
|
|
|
+ addSendingCard,
|
|
|
+ updateSendingCard,
|
|
|
+ deleteSendingCard
|
|
|
} from '@/api/external'
|
|
|
+import { Transmitter } from '@/constant'
|
|
|
import { createListOptions } from '@/utils'
|
|
|
|
|
|
export default {
|
|
|
- name: 'Transmitter',
|
|
|
+ name: 'TransmitterList',
|
|
|
data () {
|
|
|
return {
|
|
|
options: createListOptions({ manufacturerKey: void 0 }),
|
|
|
@@ -150,7 +205,8 @@ export default {
|
|
|
{ value: 'sdk', label: 'SDK' }
|
|
|
],
|
|
|
show: false,
|
|
|
- transmitter: {}
|
|
|
+ transmitter: {},
|
|
|
+ flag: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -183,8 +239,14 @@ export default {
|
|
|
const options = this.options
|
|
|
options.error = false
|
|
|
options.loading = true
|
|
|
- return getSendCards(options.params).then(({ data, totalCount }) => {
|
|
|
- options.list = data
|
|
|
+ return getSendingCards(options.params).then(({ data, totalCount }) => {
|
|
|
+ options.list = data.map(transmitter => {
|
|
|
+ const { flag } = transmitter
|
|
|
+ transmitter.async = !!(flag & Transmitter.IS_ASYNC)
|
|
|
+ transmitter.detection = !!(flag & Transmitter.SUPPORT_DETECTION)
|
|
|
+ transmitter.contentProtection = !!(flag & Transmitter.SUPPORT_CONTENT_PROTECTION)
|
|
|
+ return transmitter
|
|
|
+ })
|
|
|
options.totalCount = totalCount
|
|
|
}, () => {
|
|
|
options.error = true
|
|
|
@@ -196,7 +258,7 @@ export default {
|
|
|
getManufacturers (visible) {
|
|
|
if (visible && !this.manufacturers.loading && !this.manufacturers.loaded) {
|
|
|
this.manufacturers.loading = true
|
|
|
- getSendCardManufacturers().then(({ data }) => {
|
|
|
+ getSendingCardManufacturers().then(({ data }) => {
|
|
|
this.manufacturers.list = data.map(({ manufacturerKey, manufacturerName }) => {
|
|
|
return { value: manufacturerKey, label: manufacturerName }
|
|
|
})
|
|
|
@@ -212,14 +274,23 @@ export default {
|
|
|
manufacturerKey: '',
|
|
|
name: '',
|
|
|
type: '',
|
|
|
- flag: 0,
|
|
|
remark: ''
|
|
|
}
|
|
|
+ this.flag = {
|
|
|
+ async: false,
|
|
|
+ detection: false,
|
|
|
+ contentProtection: false
|
|
|
+ }
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
onEdit ({ id, manufacturerKey, manufacturerName, name, type, flag, remark }) {
|
|
|
this.manufacturerName = manufacturerName
|
|
|
- this.transmitter = { id, manufacturerKey, name, type, flag, remark }
|
|
|
+ this.transmitter = { id, manufacturerKey, name, type, remark }
|
|
|
+ this.flag = {
|
|
|
+ async: !!(flag & Transmitter.IS_ASYNC),
|
|
|
+ detection: !!(flag & Transmitter.SUPPORT_DETECTION),
|
|
|
+ contentProtection: !!(flag & Transmitter.SUPPORT_CONTENT_PROTECTION)
|
|
|
+ }
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
onConfirm (done) {
|
|
|
@@ -244,14 +315,30 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (this.transmitter.id) {
|
|
|
- this.onConfirmEdit(done)
|
|
|
+ const { async: isAsync, detection, contentProtection } = this.flag
|
|
|
+ console.log(this.flag)
|
|
|
+ let flag = 0
|
|
|
+ if (isAsync) {
|
|
|
+ flag |= Transmitter.IS_ASYNC
|
|
|
+ }
|
|
|
+ if (detection) {
|
|
|
+ flag |= Transmitter.SUPPORT_DETECTION
|
|
|
+ }
|
|
|
+ if (contentProtection) {
|
|
|
+ flag |= Transmitter.SUPPORT_CONTENT_PROTECTION
|
|
|
+ }
|
|
|
+ const transmitter = {
|
|
|
+ ...this.transmitter,
|
|
|
+ flag
|
|
|
+ }
|
|
|
+ if (transmitter.id) {
|
|
|
+ this.onConfirmEdit(transmitter, done)
|
|
|
} else {
|
|
|
- this.onConfirmAdd(done)
|
|
|
+ this.onConfirmAdd(transmitter, done)
|
|
|
}
|
|
|
},
|
|
|
- onConfirmAdd (done) {
|
|
|
- addSendCard(this.transmitter).then(() => {
|
|
|
+ onConfirmAdd (transmitter, done) {
|
|
|
+ addSendingCard(transmitter).then(() => {
|
|
|
done()
|
|
|
const params = this.options.params
|
|
|
if (params.manufacturerKey && params.manufacturerKey !== this.transmitter.manufacturerKey) {
|
|
|
@@ -260,14 +347,14 @@ export default {
|
|
|
this.search()
|
|
|
})
|
|
|
},
|
|
|
- onConfirmEdit (done) {
|
|
|
- updateSendCard(this.transmitter).then(() => {
|
|
|
+ onConfirmEdit (transmitter, done) {
|
|
|
+ updateSendingCard(transmitter).then(() => {
|
|
|
done()
|
|
|
this.getList()
|
|
|
})
|
|
|
},
|
|
|
onDel (item) {
|
|
|
- deleteSendCard(item).then(() => {
|
|
|
+ deleteSendingCard(item).then(() => {
|
|
|
const options = this.options
|
|
|
if (options.list.length === 1 && options.params.pageNum > 1) {
|
|
|
options.params.pageNum -= 1
|