Commit 9879ace4 authored by 徐来柯's avatar 徐来柯

update

parent 83c9d0fe
......@@ -49,7 +49,7 @@
<el-input type="text" v-model="argKeyWord" placeholder="关键字" ></el-input>
</div>
<div class="search-btn" >查询</div>
<div class="search-btn" @click="getData" >查询</div>
</div>
<!-- 第二部分 table部分 -->
......@@ -58,23 +58,25 @@
height="675"
ref="multipleTable"
:data="innerTableData"
highlight-current-row
:header-cell-style="{ background: '#DCF0F9', color: '#507CE6' }"
class="inner-table"
tooltip-effect="dark"
@current-change="handleCurrentChange"
style="width: 100%">
<el-table-column
label="设备名"
:show-overflow-tooltip="true"
prop="NO">
prop="Device">
</el-table-column>
<el-table-column
label="数据类型"
:show-overflow-tooltip="true"
prop="dataType"
prop="DateType"
>
</el-table-column>
<el-table-column
prop="ProductName"
prop="Name"
label="变量名"
:show-overflow-tooltip="true"
>
......@@ -82,13 +84,13 @@
<el-table-column
label="描述"
:show-overflow-tooltip="true"
prop="ProductType"
prop="Descript"
>
</el-table-column>
<el-table-column
label="变量地址"
:show-overflow-tooltip="true"
prop="PlanType"
prop="Address"
>
</el-table-column>
</el-table>
......@@ -120,6 +122,7 @@ export default {
groupList: [],
cloneData: [],
innerTableData: [],
currentRow: {},
// 分页数据
totalCount: 0,
// pageIndex: 1,
......@@ -150,8 +153,12 @@ export default {
}
},
created () {
this.getData()
this.getDevices()
this.$nextTick(() => {
this.getDevices()
this.getGroups()
this.getTypes()
this.getData()
})
},
methods:{
// guid() {
......@@ -162,35 +169,27 @@ export default {
// },
getData () {
var $this = this
var postData = {
argDevice: this.argDevice,
argGroup: this.argGroup,
argDataType: this.argDataType,
argKeyWord: this.argKeyWord,
argPageSize: 50,
argPageIndex: 1
}
this.$axios({
method:"post",
url:`/api/NewTrendChart/GstVariableList`,
url:`/api/NewTrendChart/GstVariableList?argKeyWord=${this.argKeyWord}&argDevice=${this.argDevice}&argGroup=${this.argGroup}&argDataType=${this.argDataType}&argPageSize=${this.$refs.page.pageSize}&argPageIndex=${this.$refs.page.pageIndex}`,
}).then((res)=>{
if(res.data.data.length != 0 ){
this.AllTableData = res.data.data.map(item => ({
this.AllTableData = res.data.data.DataList.map(item => ({
...item,
UpdateTime: this.$moment(item.UpdateTime).format('YYYY-MM-DD HH:mm:ss')
}))
// 克隆一份tableData数据
this.cloneData= JSON.parse(JSON.stringify(this.AllTableData))
if(this.AllTableData.length > this.$refs.page.pageSize){
this.tableData = this.AllTableData.slice(0, this.$refs.page.pageSize)
this.innerTableData = this.AllTableData.slice(0, this.$refs.page.pageSize)
}else{
this.tableData = this.AllTableData
this.innerTableData = this.AllTableData
}
this.totalCount = this.AllTableData.length
// this.pageIndex = 1
this.totalPage = Math.ceil(this.AllTableData.length / this.$refs.page.pageSize)
}else{
this.tableData = []
this.innerTableData = []
this.totalCount = 0
// this.pageIndex = 1
this.totalPage = 1
......@@ -200,19 +199,25 @@ export default {
console.log('err',err)
})
},
handleCurrentChange (val) {
this.currentRow = val
},
// 分页方法
pageFun(num){
if(num == 1){
this.tableData = this.cloneData.slice(0, this.$refs.page.pageSize)
this.innerTableData = this.cloneData.slice(0, this.$refs.page.pageSize)
}else{
this.tableData = this.cloneData.slice((num-1)*this.$refs.page.pageSize,this.$refs.page.pageSize*num)
this.innerTableData = this.cloneData.slice((num-1)*this.$refs.page.pageSize,this.$refs.page.pageSize*num)
}
},
close(){
this.count = ''
this.value = ''
this.value1 = ''
this.$emit('closeDialog')
this.argDevice = '不限'
this.argGroup = '不限'
this.argDataType = '不限'
this.deviceList = []
this.typeList = []
this.groupList = []
this.$emit('closeDialog')
},
numFun(){
this.count = parseInt(this.count)
......@@ -221,18 +226,9 @@ export default {
}
},
conserve () {
var dialogData = {
count: this.count,
value: this.value,
value1 : this.value1,
}
this.$emit('conserve', dialogData)
this.$emit('conserve', this.currentRow)
},
getDevices () {
this.groupList = []
this.typeList = []
this.argGroup = ''
this.argDataType = ''
this.$axios({
method:"post",
url:`/api/FormulaManage/FormulaManage_GstCondition`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment