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

update

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