|
@@ -16,12 +16,21 @@
|
|
<div class="tools">
|
|
<div class="tools">
|
|
<div>
|
|
<div>
|
|
调整比例:{{ Math.round(scalVal*100) }}%
|
|
调整比例:{{ Math.round(scalVal*100) }}%
|
|
- <div><a-button size="small" @click="setScalVal(0)"><a-icon type="minus" /> 缩小</a-button></div>
|
|
|
|
- <div><a-button size="small" @click="setScalVal(1)"><a-icon type="plus" /> 放大</a-button></div>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <a-button size="small" @click="setScalVal(0)"><a-icon type="minus" /> 缩小</a-button>
|
|
|
|
+ <a-button size="small" @click="setScalVal(1)"><a-icon type="plus" /> 放大</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ 选择打印机:
|
|
|
|
+ <div>
|
|
|
|
+ <a-select size="small" style="width:200px;" v-model="printIndex" @change="changePrint" placeholder="选择打印机">
|
|
|
|
+ <a-select-option v-for="item in printList" :key="'print-'+item.value" :value="item.name">
|
|
|
|
+ {{ item.name }}
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <!-- <div>
|
|
|
|
- <div><a-button size="small" @click="handleDownload()"><a-icon type="download" /> 导出pdf</a-button></div>
|
|
|
|
- </div> -->
|
|
|
|
</div>
|
|
</div>
|
|
<vue-scroll :ops="ops" :style="{width: Math.round(scalVal*100)+'%',height: '70vh',margin:'0 auto'}">
|
|
<vue-scroll :ops="ops" :style="{width: Math.round(scalVal*100)+'%',height: '70vh',margin:'0 auto'}">
|
|
<div v-if="loadedRatio > 0 && loadedRatio < 1" style="background-color: green; color: white; text-align: center" :style="{ width: loadedRatio * 100 + '%' }">{{ Math.floor(loadedRatio * 100) }}%</div>
|
|
<div v-if="loadedRatio > 0 && loadedRatio < 1" style="background-color: green; color: white; text-align: center" :style="{ width: loadedRatio * 100 + '%' }">{{ Math.floor(loadedRatio * 100) }}%</div>
|
|
@@ -111,10 +120,19 @@ export default {
|
|
size: '10px',
|
|
size: '10px',
|
|
'overflow-x': 'hidden'
|
|
'overflow-x': 'hidden'
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ printIndex: undefined,
|
|
|
|
+ printList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 选择打印机
|
|
|
|
+ changePrint (v) {
|
|
|
|
+ this.printIndex = v
|
|
|
|
+ this.$store.commit('SET_printDefNeedle', this.printIndex)
|
|
|
|
+ this.$store.state.app.printTaskID = undefined
|
|
|
|
+ },
|
|
|
|
+ // 缩放
|
|
setScalVal (t) {
|
|
setScalVal (t) {
|
|
this.scalVal = this.scalVal + (t ? 0.05 : -0.05)
|
|
this.scalVal = this.scalVal + (t ? 0.05 : -0.05)
|
|
if (this.scalVal > 1) {
|
|
if (this.scalVal > 1) {
|
|
@@ -134,6 +152,9 @@ export default {
|
|
this.src = data[0]
|
|
this.src = data[0]
|
|
this.curpage = 1
|
|
this.curpage = 1
|
|
this.total = data.length
|
|
this.total = data.length
|
|
|
|
+ // 获取打印机列表
|
|
|
|
+ this.printList = getPrintList()
|
|
|
|
+ this.printIndex = this.$store.state.app.printDefNeedle
|
|
},
|
|
},
|
|
error: function (err) {
|
|
error: function (err) {
|
|
console.log(err)
|
|
console.log(err)
|
|
@@ -141,16 +162,14 @@ export default {
|
|
// 确定
|
|
// 确定
|
|
handleCommonOk () {
|
|
handleCommonOk () {
|
|
const _this = this
|
|
const _this = this
|
|
- const printDefNeedle = _this.$store.state.app.printDefNeedle
|
|
|
|
- const hasPrint = getPrintList().find(item => item.name == printDefNeedle)
|
|
|
|
|
|
+ const hasPrint = this.printList.find(item => item.name == this.printIndex)
|
|
// 已选择打印机
|
|
// 已选择打印机
|
|
if (hasPrint) {
|
|
if (hasPrint) {
|
|
hasExitTaskByName(function () {
|
|
hasExitTaskByName(function () {
|
|
pdfPrint(_this.$store.state.app.pdfPrintList, 0)
|
|
pdfPrint(_this.$store.state.app.pdfPrintList, 0)
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- // 选择打印机
|
|
|
|
- _this.$store.commit('SET_showSelectPrint', true)
|
|
|
|
|
|
+ this.$message.info('请选择打印机')
|
|
}
|
|
}
|
|
_this.$emit('ok')
|
|
_this.$emit('ok')
|
|
},
|
|
},
|
|
@@ -195,6 +214,7 @@ export default {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
border-bottom: 1px solid #eee;
|
|
border-bottom: 1px solid #eee;
|
|
|
|
+ background-color: #f8f8f8;
|
|
> div{
|
|
> div{
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|