From 63116158434214f23d1318f54b78de1d0f47ab4e Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 15 五月 2024 15:28:39 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master
---
src/components/do/b1-inspect-order-plan/Inspection.vue | 399 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 328 insertions(+), 71 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 28d7580..ca447d2 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -41,8 +41,13 @@
flex-direction: column;
flex-wrap: wrap;
width: 100%;
- /* overflow-x: hidden; */
- overflow-x: scroll;
+ overflow-x: hidden;
+ /* overflow-x: scroll; */
+ cursor: grab;
+ }
+
+ .center-box:active{
+ cursor: grabbing;
}
.tables {
@@ -59,13 +64,16 @@
.content {
display: flex;
- /* width: 100px; */
height: 100%;
align-items: center;
justify-content: left;
padding: 5px;
box-sizing: border-box;
overflow: hidden;
+ user-select: none;
+ }
+
+ .content *{
user-select: none;
}
@@ -133,16 +141,33 @@
color: #303133;
}
- .inspection .el-input-group__append{
+ .inspection .el-input-group__append {
padding: 0 10px;
color: #3A7BFA;
background-color: #fff;
}
- .inspection .center-box .el-input__inner{
+ .inspection .center-box .el-input__inner {
font-size: 12px;
padding: 0 6px;
text-align: center;
+ }
+
+ .inspection .el-textarea__inner {
+ padding: 2px;
+ }
+
+ .inspection .el-textarea__inner::-webkit-scrollbar {
+ width: 0;
+ }
+
+ .inspection .el-select {
+ display: flex;
+ align-items: center;
+ }
+
+ .inspection .el-textarea__inner {
+ min-height: 100% !important;
}
</style>
<template>
@@ -152,7 +177,8 @@
<el-col :span="12" style="text-align: right;">
<el-button size="small" type="primary" @click="sampleVisible=true">鏍峰搧鍒囨崲</el-button>
<el-button size="small" type="primary" @click="taskVisible=true">浠诲姟鍒囨崲</el-button>
- <el-button size="small" type="primary" @click="submit" v-show="state==1" :loading="submitLoading">鎻愪氦</el-button>
+ <el-button size="small" type="primary" @click="addVerifyDia = true" v-show="state==1"
+ :loading="submitLoading">鎻愪氦</el-button>
<!-- 澶嶆牳 -->
<el-button size="medium" type="primary" @click="upInsReview(1)" :loading="reviewLoading"
v-show="state>1">閫氳繃</el-button>
@@ -189,43 +215,71 @@
</el-form>
</div>
<div class="center">
- <div class="center-box">
- <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index"
- :style="`width: ${tableWidth}px;`">
+ <div class="search">
+ <el-radio-group v-model="currentTable" size="small">
+ <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists" :key="index"
+ size="small">{{ item.templateName }}</el-radio-button>
+ </el-radio-group>
+ </div>
+ <div class="center-box" id="nav">
+ <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index">
<tbody>
<tr v-for="(m,i) in item.arr" :key="i">
<td :id='item.templateId+"-"+n.i+"-"+n.r+"-"+n.c' v-for="(n,j) in m" :key="j"
v-if="n.v.mc==undefined || Object.keys(n.v.mc).length === 4" :colspan="n.v.mc&&n.v.mc.cs?n.v.mc.cs:1"
:rowspan="n.v.mc&&n.v.mc.rs?n.v.mc.rs:1"
- :style="`background:${n.v.bg};color:${n.v.fc};font-size:${n.v.fs}px;width:${item.style.columnlen[n.c]}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl?'bold':''};`">
- <div class="content" :class="`content-h-${n.v.ht} content-v-${n.v.vt}`">
+ :style="`background:${n.v.bg};color:${n.v.fc};font-size:${n.v.fs}px;width:${handleWidth(n)}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl?'bold':''};`">
+ <div class="content" :class="`content-h-${n.v.ht} content-v-${n.v.vt}`"
+ :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]}px;`">
<template v-if="n.v.ps!=undefined && n.v.ps.value==='妫�楠屽��' && state==1">
<el-input v-if="getInspectionValueType(n.i) == 1" class="table_input" v-model="n.v.v"
:disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
@change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)">
- <el-button slot="append" type="primary" icon="el-icon-edit" size="mini" v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button>
+ <el-button slot="append" type="primary" icon="el-icon-edit" size="mini"
+ v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button>
</el-input>
<el-input v-else-if="getInspectionValueType(n.i) == 2" class="table_input" type="textarea"
- :autosize="{ minRows: 1}" v-model="n.v.v" :disabled="state>1" />
+ v-model="n.v.v"
+ :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
+ @change="saveInsContext()" />
<el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input" v-model="n.v.v"
- :disabled="state>1">
- <el-option label="鏄�" value="鏄�"></el-option>
- <el-option label="鍚�" value="鍚�"></el-option>
+ :disabled="state>1" @visible-change="e=>getDic(e,n.i)" @change="saveInsContext()">
+ <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
<span :style="`font-family:${n.v.ff} !important;`"
v-else-if="getInspectionValueType(n.i) == 4">/</span>
</template>
<template v-else-if="n.v.ps!=undefined && n.v.ps.value==='缁撹'">
- <span v-if="n.v.v===1" :style="`font-family:${n.v.ff} !important;color: green;`">鍚堟牸</span>
- <span v-else-if="n.v.v===0" :style="`font-family:${n.v.ff} !important;color: red;`">涓嶅悎鏍�</span>
- <span v-else :style="`font-family:${n.v.ff} !important;`">寰呭畾</span>
+ <el-select v-if="(getInspectionValueType(n.i) == 2 || getInspectionValueType(n.i) == 5) && state==1"
+ class="table_input" v-model="n.v.v" @change="saveInsContext()">
+ <el-option label="鍚堟牸" :value="1"></el-option>
+ <el-option label="涓嶅悎鏍�" :value="0"></el-option>
+ </el-select>
+ <template v-else>
+ <span v-if="n.v.v===1" :style="`font-family:${n.v.ff} !important;color: green;`">鍚堟牸</span>
+ <span v-else-if="n.v.v===0" :style="`font-family:${n.v.ff} !important;color: red;`">涓嶅悎鏍�</span>
+ <span v-else :style="`font-family:${n.v.ff} !important;`">寰呭畾</span>
+ </template>
</template>
<template v-else-if="n.v.ps!=undefined && n.v.ps.value==='璁惧缂栫爜' && state==1">
- <el-select v-model="n.v.v" placeholder="璁惧" @visible-change="e=>getEquipOptions(e,n.i)"
- remote @change="(val)=>changeEquip(val, n)">
+ <el-select v-model="n.v.v" placeholder="璁惧" @visible-change="e=>getEquipOptions(e,n.i)" remote
+ @change="(val)=>changeEquip(val, n)">
<el-option v-for="item in equipOptions" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
+ </template>
+ <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='瑕佹眰鍊�' && state==1">
+ <span :style="`font-family:${n.v.ff} !important;`">{{getTell(n.i)}}</span>
+ </template>
+ <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏈�缁堝��' && state==1">
+ <el-input class="table_input" type="textarea"
+ :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
+ v-model="n.v.v" @change="saveInsContext()" v-if="getInspectionValueType(n.i) == 2"></el-input>
+ <el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input" v-model="n.v.v"
+ :disabled="state>1" @visible-change="e=>getDic(e,n.i)" @change="saveInsContext()">
+ <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
+ </el-select>
+ <span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
</template>
<span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
</div>
@@ -265,19 +319,33 @@
</el-drawer>
<el-drawer title="浠诲姟鍒囨崲" :visible.sync="taskVisible" :size="500">
<ValueTable class="value-table" ref="insOrderPlan" :url="$api.insOrderPlan.selectInsOrderPlanList"
- :componentData="componentData" :key="upIndex" />
+ :componentData="componentData" :key="upIndex" style="max-height: 100%;height: inherit;"/>
</el-drawer>
<el-dialog title="妫�楠屽鏍�" :visible.sync="reviewDia" width="500px">
<div class="body" style="display: flex;padding: 10px;" v-if="reviewDia">
<div class="search_label" style="width: 150px;"><span class="required-span">* </span>涓嶉�氳繃鐨勭悊鐢憋細</div>
<div class="search_input" style="width: 100%;">
- <el-input size="small" clearable v-model="noReason" type="textarea"
- :autosize="{ minRows: 4}"></el-input>
+ <el-input size="small" clearable v-model="noReason" type="textarea" :autosize="{ minRows: 4}"></el-input>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="reviewDia = false">鍙� 娑�</el-button>
<el-button type="primary" @click="handleReviewDia" :loading="reviewLoading">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="鎸囧畾澶嶆牳浜哄憳" :visible.sync="addVerifyDia" width="400px">
+ <div class="body" style="display: flex;padding: 10px;align-items: center;">
+ <div class="search_label" style="width: 150px;"><span class="required-span">*</span>澶嶆牳浜�</div>
+ <div class="search_input" style="width: 100%;">
+ <el-select v-model="verifyUser" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" clearable filterable>
+ <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addVerifyDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submit()">纭� 瀹�</el-button>
</span>
</el-dialog>
</div>
@@ -347,7 +415,14 @@
reviewLoading: false,
reviewDia: false,
noReason: '',
- tableWidth: 1000
+ tableWidth: 1000,
+ currentTable: null,
+ tableLists: [],
+ widthList: [],
+ addVerifyDia: false,
+ verifyUser: null,
+ personList: [],
+ enumList: []
}
},
created() {
@@ -359,6 +434,8 @@
this.getTypeDicts()
this.getInsStateDicts()
this.getComparisonList()
+ this.getAuthorizedPerson()
+ this.scrollInit()
},
watch: {
id(val) {
@@ -387,10 +464,22 @@
})
if (this.currentSample.index == undefined) this.currentSample['index'] = 1
this.loading = false
- this.handleTableData()
+ // this.handleTableData()
+ this.getTableLists();
this.componentData.currentId = val;
this.currentKey = 1;
})
+ },
+ currentTable(val1, val0) {
+ if (val0 != null && val1 != val0) {
+ this.tableLists.forEach((m, i) => {
+ if (m.templateId == val1) {
+ this.tableList = null;
+ this.tableList = [(this.tableLists[i])];
+ this.handleTableData()
+ }
+ })
+ }
}
},
methods: {
@@ -407,7 +496,8 @@
insResult: null
}
})
- this.handleTableData()
+ // this.handleTableData()
+ this.getTableLists();
this.sampleVisible = false;
this.currentKey = row.index
},
@@ -460,18 +550,28 @@
this.comparisonList = data;
})
},
+ selectEnumByCategoryOfSelect(val) {
+ this.enumList = []
+ if (val === undefined || val === null) {
+ return
+ }
+ this.$axios.post(this.$api.enums.selectEnumByCategory, {
+ category: val
+ }).then(res => {
+ this.enumList = res.data;
+ })
+ },
tableRowClassName({
row,
rowIndex
}) {
row.index = rowIndex + 1;
},
- handleTableData() {
- this.excelMethodList = []
+ getTableLists() {
const mySet1 = new Set();
- this.tableList = JSON.parse(JSON.stringify(this.currentSample.insProduct)).filter(m => {
+ this.tableLists = this.currentSample.insProduct.filter(m => {
let num0 = mySet1.size;
- if (m.templateId != null) {
+ if (m.templateId != null&&m.template != null) {
mySet1.add(JSON.stringify({
template: m.template,
templateId: m.templateId
@@ -481,7 +581,17 @@
if (num1 > num0) {
return m
}
- })
+ });
+ if (this.tableLists && this.tableLists.length > 0) {
+ this.tableList = null;
+ this.tableList = [this.tableLists[0]]
+ this.currentTable = this.tableLists[0].templateId;
+ this.handleTableData()
+ }
+ },
+ handleTableData() {
+ this.excelMethodList = []
+ this.widthList = this.tableList[0].style.columnlen;
this.tableList.forEach(a => {
let mcList = []
a.template.forEach(b => {
@@ -539,17 +649,20 @@
let count2 = 0
for (let i in this.currentSample.insProduct) {
if (this.currentSample.insProduct[i].templateId === a.templateId && this.currentSample
- .insProduct[i].inspectionItem + this.currentSample.insProduct[i].inspectionItemSubclass === str) {
- ids.push({
- r: b.r,
- id: this.currentSample.insProduct[i].id,
- product: this.currentSample.insProduct[i]
- })
- break
+ .insProduct[i].inspectionItem +
+ (this.currentSample.insProduct[i].inspectionItemSubclass == null ? '' : this.currentSample
+ .insProduct[i].inspectionItemSubclass) ===
+ str) {
+ ids.push({
+ r: b.r,
+ id: this.currentSample.insProduct[i].id,
+ product: this.currentSample.insProduct[i]
+ })
+ break
}
count2++
}
- if(count2 == this.currentSample.insProduct.length){
+ if (count2 == this.currentSample.insProduct.length) {
dels.add(b.r)
}
}
@@ -570,7 +683,8 @@
if (a.template[b].v.ps != undefined && a.template[b].v.ps.value === '鍗曚綅') {
a.template[b].v.v = id.product.unit
}
- if (a.template[b].v.ps != undefined && a.template[b].v.ps.value === '璇曢獙鏂规硶') {
+ if (a.template[b].v.ps != undefined && (a.template[b].v.ps.value === '璇曢獙鏂规硶' || a.template[b].v
+ .ps.value === '妫�娴嬫柟娉�')) {
a.template[b].v.v = id.product.methodS
}
}
@@ -616,19 +730,19 @@
if (b.v.ps != undefined && b.v.ps.value === '妫�楠屽��') {
b.v.v = ''
b.u = ''
- b.i&&this.param[b.i].insValue.push(b)
+ b.i && this.param[b.i].insValue.push(b)
}
if (b.v.ps != undefined && b.v.ps.value === '璁$畻鍊�') {
b.v.v = ''
- b.i&&this.param[b.i].comValue.push(b)
+ b.i && this.param[b.i].comValue.push(b)
}
if (b.v.ps != undefined && b.v.ps.value === '璁惧缂栫爜') {
b.v.v = ''
- b.i&&this.param[b.i].equipValue.push(b)
+ b.i && this.param[b.i].equipValue.push(b)
}
if (b.v.ps != undefined && b.v.ps.value === '璁惧鍚嶇О') {
b.v.v = ''
- b.i&&this.param[b.i].equipName.push(b)
+ b.i && this.param[b.i].equipName.push(b)
}
if (b.v.ps != undefined && b.v.ps.value === '鏈�缁堝��') {
b.v.v = ''
@@ -639,18 +753,20 @@
} else {
this.param[b.i].resValue = b
} */
- if(b.i !== undefined){
+ if (b.i !== undefined) {
this.param[b.i].resValue = b
}
}
if (b.v.ps != undefined && b.v.ps.value === '缁撹') {
- this.param[b.i].insResult = b
- conclusionList.forEach((n, i) => {
- if (n.r == b.r && n.c == b.c) {
- b.v.f =
- `(${this.comparisonList.find(j=>j.value==(finalList[i].c)).label}${finalList[i].r+1})`
- }
- })
+ if (b.i !== undefined) {
+ this.param[b.i].insResult = b
+ conclusionList.forEach((n, i) => {
+ if (n.r == b.r && n.c == b.c) {
+ b.v.f =
+ `(${this.comparisonList.find(j=>j.value==(finalList[i].c)).label}${finalList[i].r+1})`
+ }
+ })
+ }
}
set.add(b.r)
if (b.v.f) {
@@ -742,7 +858,7 @@
}
})
})
- if (item.methodName == '鑷畾涔夋柟娉�' && item.v.ps!=undefined && item.v.ps.value == '缁撹') {
+ if (item.methodName == '鑷畾涔夋柟娉�' && item.v.ps != undefined && item.v.ps.value == '缁撹') {
if (this.currentSample.insProduct.find(m => m.id == item.i)) {
let ask = this.currentSample.insProduct.find(m => m.id == item.i).ask.split('&');
let res = Object.values(comValue)[0]
@@ -806,13 +922,13 @@
valueList.forEach(b => {
str = str.replace(b.name, b.value)
})
- if(item.v.f.includes('/')>-1){
- if(Object.getOwnPropertyNames(comValue).length==valueList.length){
+ if (item.v.f.includes('/') > -1) {
+ if (Object.getOwnPropertyNames(comValue).length == valueList.length) {
comResult = eval(str)
- }else{
+ } else {
comResult = ''
}
- }else{
+ } else {
comResult = eval(str)
}
break;
@@ -821,7 +937,8 @@
if (a[0].r == item.r && comResult != '') {
for (var b in a) {
if (a[b].c == item.c) {
- a[b].v.v = parseFloat(comResult.toFixed(3))
+ let val = parseFloat(comResult.toFixed(3))
+ a[b].v.v = isNaN(val) ? '' : val
break
}
}
@@ -831,6 +948,72 @@
}
}
})
+ this.getCurrentInsProduct(pId)
+ },
+ getCurrentInsProduct(pId) {
+ if (!this.tableList[0].insProductResult) {
+ this.tableList[0].insProductResult = {}
+ }
+ for (let m in this.param[pId]) {
+ let value = this.param[pId][m]
+ switch (m) {
+ case 'comValue':
+ if (value && value.length > 0) {
+ this.tableList[0].insProductResult[m] = [];
+ value.forEach((a, i) => {
+ let obj = {
+ v: a.v.v,
+ }
+ this.tableList[0].insProductResult[m].push(obj);
+ })
+ }
+ this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m])
+ break;
+ case 'insValue':
+ if (value && value.length > 0) {
+ this.tableList[0].insProductResult[m] = [];
+ value.forEach((a, i) => {
+ let obj = {
+ v: a.v.v,
+ u: a.u,
+ }
+ this.tableList[0].insProductResult[m].push(obj);
+ })
+ }
+ this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m])
+ break;
+ case 'equipValue':
+ if (value && value.length > 0) {
+ this.tableList[0].insProductResult[m] = [];
+ value.forEach((a, i) => {
+ let obj = {
+ v: a.v.v,
+ }
+ this.tableList[0].insProductResult[m].push(obj);
+ })
+ }
+ this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m])
+ break;
+ case 'equipName':
+ if (value && value.length > 0) {
+ this.tableList[0].insProductResult[m] = [];
+ value.forEach((a, i) => {
+ let obj = {
+ v: a.v.v,
+ }
+ this.tableList[0].insProductResult[m].push(obj);
+ })
+ }
+ this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m])
+ break;
+ case 'resValue':
+ this.tableList[0].lastValue = value.v.v
+ break;
+ case 'insResult':
+ this.tableList[0].insResult = value.v.v
+ break;
+ }
+ }
},
handleExcelMethod() {
if (this.excelMethodList.length > 0) {
@@ -864,7 +1047,7 @@
let regex = /[=\+\-\*\%\(\)\/\s]/g
let mode = item.v.f.replace(regex, ' ').split(' ');
mode.filter(m => m && !Number(m)).forEach(m => {
- let r = m.replace(/[a-zA-Z]/g, "") - 1
+ let r = m.replace(/[a-zA-Z]/g, "") - 1
let c = this.comparisonList.find(j => j.label == m.split('')[0]).value
valueList.push({
c,
@@ -883,6 +1066,25 @@
return this.currentSample.insProduct[a].inspectionValueType
}
}
+ },
+ getTell(id) {
+ for (var a in this.currentSample.insProduct) {
+ if (this.currentSample.insProduct[a].id == id) {
+ return this.currentSample.insProduct[a].tell
+ }
+ }
+ },
+ handleWidth(n) {
+ let sum = 0;
+ if (n.v.mc && n.v.mc.cs && n.v.mc.c != undefined) {
+ for (let i = 0; i < n.v.mc.cs; i++) {
+ let num = this.widthList[i + n.v.mc.c] ? this.widthList[i + n.v.mc.c] : 100
+ sum += num;
+ }
+ } else {
+ sum = this.widthList[n.c] ? this.widthList[n.c] : 100
+ }
+ return sum
},
getInspectionItemType(id) {
for (var a in this.currentSample.insProduct) {
@@ -924,7 +1126,7 @@
}).then(res => {
if (res.code === 200 && res.data) {
this.equipOptions = res.data.map(m => {
- m.value = m.factoryNo
+ m.value = m.managementNumber
m.label = m.deviceName
return m
})
@@ -932,6 +1134,17 @@
}).catch(error => {
console.error(error)
})
+ }
+ },
+ getDic(e, id) {
+ if (e) {
+ for (var a in this.currentSample.insProduct) {
+ if (this.currentSample.insProduct[a].id == id) {
+ let str = this.currentSample.insProduct[a].dic
+ this.selectEnumByCategoryOfSelect(str)
+ return str
+ }
+ }
}
},
getUserInfo() {
@@ -987,10 +1200,16 @@
}
},
submit() {
+ if (this.verifyUser === null || this.verifyUser === '') {
+ this.$message.error("璇锋寚瀹氬鏍镐汉鍛�")
+ return
+ }
+ this.addVerifyDia = false
this.submitLoading = true;
this.$axios.post(this.$api.insOrderPlan.submitPlan, {
orderId: this.orderId,
laboratory: this.sonLaboratory,
+ verifyUser: this.verifyUser
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -1002,11 +1221,9 @@
this.submitLoading = false;
})
},
- saveInsContext(){
- this.$axios.post(this.$api.insOrderPlan.saveInsContext, this.param, {
- headers: {
- 'Content-Type': 'application/json'
- }
+ saveInsContext() {
+ this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
+ param: JSON.stringify(this.param)
}).then(res => {
if (res.code == 201) {
this.$message.error('淇濆瓨澶辫触')
@@ -1015,16 +1232,56 @@
this.$message.success('宸蹭繚瀛�')
})
},
- changeEquip(val,n){
- for(let i in this.equipOptions){
- if(this.equipOptions[i].value === val){
- for(let i1 in this.param[n.i].equipName){
- if(this.param[n.i].equipName[i1].i === n.i && this.param[n.i].equipName[i1].r === n.r){
+ changeEquip(val, n) {
+ for (let i in this.equipOptions) {
+ if (this.equipOptions[i].value === val) {
+ for (let i1 in this.param[n.i].equipName) {
+ if (this.param[n.i].equipName[i1].i === n.i && this.param[n.i].equipName[i1].r === n.r) {
this.param[n.i].equipName[i1].v.v = this.equipOptions[i].label
}
}
}
}
+ this.saveInsContext()
+ },
+ getAuthorizedPerson() {
+ this.$axios.get(this.$api.user.getUserMenu).then(res => {
+ let data = []
+ res.data.forEach(a => {
+ data.push({
+ label: a.name,
+ value: a.id
+ })
+ })
+ this.personList = data
+ })
+ },
+ scrollInit() {
+ // 鑾峰彇瑕佺粦瀹氫簨浠剁殑鍏冪礌
+ const nav = document.getElementById("nav")
+ var flag; // 榧犳爣鎸変笅
+ var downX; // 榧犳爣鐐瑰嚮鐨剎涓嬫爣
+ var scrollLeft; // 褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲�
+ nav.addEventListener("mousedown", function(event) {
+ flag = true;
+ downX = event.clientX; // 鑾峰彇鍒扮偣鍑荤殑x涓嬫爣
+ scrollLeft = this.scrollLeft; // 鑾峰彇褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲�
+ });
+ nav.addEventListener("mousemove", function(event) {
+ if (flag) { // 鍒ゆ柇鏄惁鏄紶鏍囨寜涓嬫粴鍔ㄥ厓绱犲尯鍩�
+ var moveX = event.clientX; // 鑾峰彇绉诲姩鐨剎杞�
+ var scrollX = moveX - downX; // 褰撳墠绉诲姩鐨剎杞翠笅鏍囧噺鍘诲垰鐐瑰嚮涓嬪幓鐨剎杞翠笅鏍囧緱鍒伴紶鏍囨粦鍔ㄨ窛绂�
+ this.scrollLeft = scrollLeft - scrollX // 榧犳爣鎸変笅鐨勬粴鍔ㄦ潯鍋忕Щ閲忓噺鍘诲綋鍓嶉紶鏍囩殑婊戝姩璺濈
+ }
+ });
+ // 榧犳爣鎶捣鍋滄鎷栧姩
+ nav.addEventListener("mouseup", function() {
+ flag = false;
+ });
+ // 榧犳爣绂诲紑鍏冪礌鍋滄鎷栧姩
+ nav.addEventListener("mouseleave", function(event) {
+ flag = false;
+ });
}
}
}
--
Gitblit v1.9.3