Browse Source

优化调整中

master
李磊 3 years ago
parent
commit
af1c13daad
  1. 4
      src/api/ysjl.js
  2. 2
      src/components/Charts/MixBar.vue
  3. 2
      src/components/Charts/MixChart.vue
  4. 2
      src/components/Charts/MixCharts.vue
  5. 4
      src/controller/ysjlController.js
  6. 0
      src/utils/mixins/resize.js
  7. 7
      src/views/task/list.vue
  8. 385
      src/views/ysjl/3000/common/index.vue
  9. 401
      src/views/ysjl/3000/dj/common/phxsb.vue
  10. 24
      src/views/ysjl/3000/dj/common/table.vue
  11. 127
      src/views/ysjl/3000/dj/common/zdftFb.vue
  12. 2
      src/views/ysjl/3000/dj/yeyin/index.vue
  13. 2
      src/views/ysjl/3000/dj/yy/index.vue
  14. 2
      src/views/ysjl/3000/dj/zdft/index.vue
  15. 2
      src/views/ysjl/3000/jj/wjf-yy/index.vue
  16. 2
      src/views/ysjl/3000/jj/yjf-yy/index.vue
  17. 2
      src/views/ysjl/3000/jj/yy-jj/index.vue

4
src/api/ysjl.js

@ -80,10 +80,10 @@ export default {
},
exportExcel,
/**
* 获取附表
* 查询原始记录检验项目检验项目存储时的所有信息不拼接字典列数据
* @param ysjlId
*/
getYsjlFb: (ysjlId) => {
getJyxmInfoByYsjl: (ysjlId) => {
return api({
url: '/jyxm/getJyxmInfoByYsjl',
method: 'get',

2
src/components/Charts/MixBar.vue

@ -4,7 +4,7 @@
<script>
import * as echarts from 'echarts'
import resize from './mixins/resize'
import resize from '@/utils/mixins/resize'
export default {
name: 'MixBar',

2
src/components/Charts/MixChart.vue

@ -4,7 +4,7 @@
<script>
import * as echarts from 'echarts'
import resize from './mixins/resize'
import resize from '@/utils/mixins/resize'
export default {
mixins: [resize],
props: {

2
src/components/Charts/MixCharts.vue

@ -4,7 +4,7 @@
<script>
import * as echarts from 'echarts'
import resize from './mixins/resize'
import resize from '@/utils/mixins/resize'
export default {
name: 'MixBar',

4
src/controller/ysjlController.js

@ -39,7 +39,7 @@ export default {
getResetRecordsList: (ysjlId) => {
return ysjl.getResetRecordsList(ysjlId)
},
getYsjlFb: (ysjlId) => {
return ysjl.getYsjlFb(ysjlId)
getJyxmInfoByYsjl: (ysjlId) => {
return ysjl.getJyxmInfoByYsjl(ysjlId)
}
}

0
src/components/Charts/mixins/resize.js → src/utils/mixins/resize.js

7
src/views/task/list.vue

@ -305,13 +305,6 @@ export default {
console.log(data.list)
this.list = data.list
this.totalCount = data.total
const messagePush = this.$store.getters.messageCount
for (let i = 0; i < messagePush.length; i++) {
if (messagePush[i].key === 'MyTask') {
messagePush[i].value = this.totalCount
}
this.$store.state.messageCount = messagePush
}
})
},
getListCopy() {

385
src/views/ysjl/3000/common/index.vue

@ -188,7 +188,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 1||fromType==5||fromType==3" :gutter="20">
<el-row v-if="fromType === 1 || fromType === 5 || fromType === 3" :gutter="20">
<el-col :span="18">
<el-form-item label="使用单位名称" prop="shiyongdanwei">
<el-input
@ -199,7 +199,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2 ||fromType == 4" :gutter="20">
<el-row v-if="fromType === 2 || fromType === 4" :gutter="20">
<el-col :span="18">
<el-form-item
label="施工单位名称"
@ -213,7 +213,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2 ||fromType == 4" :gutter="20">
<el-row v-if="fromType === 2 || fromType === 4" :gutter="20">
<el-col :span="9">
<el-form-item
label="施工单位许可证编号"
@ -236,7 +236,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2" :gutter="20">
<el-row v-if="fromType === 2" :gutter="20">
<el-col :span="18">
<el-form-item label="安装地点" prop="anzhuangdidian">
<el-input
@ -290,7 +290,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 1 ||fromType == '5'" :gutter="20">
<el-row v-if="fromType === 1 ||fromType === 5" :gutter="20">
<el-col :span="18">
<el-form-item label="注册代码" prop="zhucedaima">
<el-input
@ -353,7 +353,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2" :gutter="20">
<el-row v-if="fromType === 2" :gutter="20">
<el-col :span="9">
<el-form-item label="联系人" prop="lianxiren">
<el-input
@ -386,7 +386,7 @@
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item v-if="fromType==5" label="维护保养单位电话" prop="weibaodanweiDianhua">
<el-form-item v-if="fromType === 5" label="维护保养单位电话" prop="weibaodanweiDianhua">
<el-input
v-model="ysjl.weibaodanweiDianhua"
type="text"
@ -411,7 +411,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType!=='5'" :gutter="20">
<el-row v-if="fromType !== 5" :gutter="20">
<el-col :span="18">
<el-form-item label="现场检验条件" prop="xianchangjianyantiaojian">
<el-radio-group v-model="ysjl.xianchangjianyantiaojian">
@ -426,7 +426,7 @@
</el-col>
</el-row>
</fieldset>
<fieldset v-if="fromType !=='5'">
<fieldset v-if="fromType !== 5">
<legend>设备技术参数</legend>
<el-row :gutter="20">
<el-col :span="9">
@ -437,7 +437,7 @@
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item v-if="fromType==4" label="额定速度">
<el-form-item v-if="fromType === 4" label="额定速度">
<el-input v-model="param.edingsuduShangxing" type="text">
<span slot="suffix">m/s</span>
</el-input>
@ -478,7 +478,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType==3|| fromType==4" :gutter="20">
<el-row v-if="fromType === 3 || fromType === 4" :gutter="20">
<el-col :span="9">
<el-form-item label="油缸数量" prop="youguanshuliang">
<el-input v-model="param.youguanshuliang" type="text" />
@ -546,6 +546,7 @@
</el-row>
</fieldset>
<fieldset>
<legend>检验信息</legend>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="检验依据" prop="jianyanyiju">
@ -553,15 +554,11 @@
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>主要检验仪器和设备</legend>
<el-row :gutter="20">
<el-col :span="20">
<el-input
v-model="param.gongjuxianghao"
style="width: 450px"
/>
<el-form-item label="主要检验仪器和设备" prop="gongjuxianghao">
<el-input v-model="param.gongjuxianghao" style="width: 100px" />号检验专用工具箱
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
@ -585,18 +582,24 @@
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-col :span="18" style="height: auto;">
<el-form-item label="备注" prop="beizhu">
<el-input
v-model="ysjl.beizhu"
type="textarea"
:autosize="{ minRows: 2, maxRows: 5 }"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin: 20px 0">
<el-col :span="8">
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="检验日期" prop="jianyanjieshuriqi">
<el-input v-model="ysjl.jianyanjieshuriqi" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="现场检验日期" prop="xianchangjianyanriqi">
<el-date-picker
v-model="ysjl.xianchangjianyanriqi"
@ -606,7 +609,9 @@
/>
</el-form-item>
</el-col>
<el-col v-if="fromType!=='5'" :span="8">
</el-row>
<el-row :gutter="20">
<el-col v-if="fromType !== 5" :span="9">
<el-form-item label="检验完成日期" prop="jianyanjieshuriqi">
<el-date-picker
v-model="ysjl.jianyanjieshuriqi"
@ -616,7 +621,7 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="9">
<el-form-item label="下次检验日期" prop="xiacijianyanriqi">
<el-date-picker
v-model="ysjl.xiacijianyanriqi"
@ -629,12 +634,12 @@
</el-row>
<template>
<el-row :gutter="10">
<el-col :span="8">
<el-col :span="9">
<el-form-item label="检验人员" prop="jianyanrenyuan">
<el-input v-model="ysjl.jianyanrenyuan" />
<el-input v-model="ysjl.jianyanrenyuan" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="9">
<sign-name
:jianyanrenyuan="jianyanrenyuan"
:ysjl="ysjl"
@ -642,11 +647,6 @@
@setSignValue="signNameValue"
/>
</el-col>
<el-col :span="8">
<el-form-item label="日期" prop="jianyanjieshuriqi">
<el-input v-model="ysjl.jianyanjieshuriqi" />
</el-form-item>
</el-col>
</el-row>
</template>
</fieldset>
@ -655,102 +655,21 @@
<el-tab-pane label="检验项目" name="second">
<Inspection :bgfy-data="bgfyData" />
</el-tab-pane>
<el-tab-pane v-if="fromType == '5'" label="附表1" name="three">
<Table2 ref="table2" />
</el-tab-pane>
<el-tab-pane
v-for="(item, index) in arrayGroup"
v-else
:key="index"
:label="'附表' + (index + 1)"
:name="'tab' + index"
>
<Table
ref="table3"
:tabel-header="item.header"
:table-data="item.data"
:from-type="fromType"
@addfn="addfn(item)"
/>
<el-tab-pane v-if="fromType === 5" label="附表1" name="three">
<zdft-fb ref="table1" :table-data.sync="fubiao1" />
</el-tab-pane>
<!-- <el-tab-pane v-if="fromType==1" label="附表二" name="four">
<Table ref="table2" :tabel-header="tableHeader1" :table-data="list1"/>
</el-tab-pane> -->
<el-tab-pane v-if="fromType == 1||fromType==3" label="附表3" name="five">
<Table1 ref="table1" :pic="pic" />
</el-tab-pane>
</el-tabs>
<el-dialog
:visible.sync="jyxmrqShow"
title="批量修改日期"
width="500px"
@close="jyxmrqShow = false"
>
<template>
<el-date-picker
v-model="querenriqi"
type="date"
format="yyyy.MM.dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
placeholder="选择日期"
style="width: 100%"
/>
<template v-else>
<el-tab-pane label="附表一" name="four">
<Table ref="table1" :tabel-header="arrayGroup[0].header" :table-data.sync="fubiao1" />
</el-tab-pane>
<el-tab-pane label="附表二" name="five">
<Table ref="table2" :tabel-header="arrayGroup[1].header" :table-data.sync="fubiao2" />
</el-tab-pane>
<el-tab-pane v-if="fromType === 1 || fromType === 3" label="附表3" name="six">
<phxsb ref="table3" :table-data.sync="fubiao3" :pic="pic" />
</el-tab-pane>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="jyxmrqShow = false"> </el-button>
<el-button type="primary" @click="batchUpd"> </el-button>
</span>
</el-dialog>
<el-dialog
title="查看相关鉴证"
:modal-append-to-body="false"
:visible.sync="dialogEnclosureVisible"
>
<enclosure
:relation-id="ysjl.renwuId"
:if-liaison="false"
:view-button="true"
:is-show-hetong="isSysUser"
/>
</el-dialog>
<el-dialog title="编辑权限" :visible.sync="dialogRoleVisible">
<template>
<div class="tag-group">
<span class="tag-group__title">已有权限人员</span>
<el-tag v-for="item in defaultRlr" :key="item" effect="dark">
{{ common.convertCnName(item) }}
</el-tag>
</div>
<br>
<el-select
v-model="renlingren"
multiple
collapse-tags
placeholder="请选择要追加的监检员"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogRoleVisible = false"> </el-button>
<el-button type="primary" @click="updateRenlingren"> </el-button>
</span>
</el-dialog>
<sign-name
v-show="signShow"
ref="qmButton"
:ysjl="ysjl"
:jianyanrenyuan="xmjianyanrenyuan"
field-name="xmqianming"
:custom-clear-sign="customClearSign"
@setSignValue="signNameValue"
/>
</el-tabs>
</div>
</template>
<script>
@ -758,22 +677,18 @@ import Sticky from '@/components/Sticky'
import SignName from '@/views/common/SignName'
import Utils from '@/utils/contact'
import merge from 'webpack-merge'
import Enclosure from '@/views/common/Enclosure'
import Inspection from '@/views/ysjl/3000/common/inspection-items'
import Table from '@/views/ysjl/3000/dj/common/table'
import Table1 from '@/views/ysjl/3000/dj/common/table1'
import Table2 from '@/views/ysjl/3000/dj/common/table2'
import Phxsb from '@/views/ysjl/3000/dj/common/phxsb'
import ZdftFb from '@/views/ysjl/3000/dj/common/zdftFb'
export default {
name: 'BaseInfo',
components: { SignName, Sticky, Enclosure, Inspection, Table, Table1, Table2 },
components: { SignName, Sticky, Inspection, Table, Phxsb, ZdftFb },
props: {
arrayGroup: {
require: true,
type: Array,
default: () => {
return []
}
required: true,
type: Array
},
// /**
// * [{ index: 0, relationIds: [1, 2] }]
@ -784,14 +699,17 @@ export default {
// },
fromType: {
required: true,
type: String
type: Number
},
jlbh1: {
type: String,
default: 'DT'
}
},
data() {
return {
ysjl: {},
param: {},
jlbh1: 'GJ',
jlbh2: '(' + new Date().getFullYear() + ')',
jlbh3: '',
isRepeat: false,
@ -808,9 +726,6 @@ export default {
jyxmrqShow: false,
querenriqi: null,
signShow: false,
xmjianyanrenyuan: '',
xggcList: [],
biliOptions: ['0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1'],
dialogEnclosureVisible: false,
dialogRoleVisible: false,
userList: [],
@ -847,38 +762,28 @@ export default {
return time.getTime() > Date.now()
}
},
pic: ''
pic: '',
fubiao1: [],
fubiao2: [],
fubiao3: []
}
},
created() {
if (this.state === 'create') {
this.initYsjl()
this.getMaxBh()
} else {
this.getYsjl()
this.getParam()
this.getJyxm(1)
this.getFbList()
this.getJyxmInfoByYsjl()
}
this.getDicJyxm(1)
this.getDicData()
this.userList = this.$store.getters.allUser.filter(
(user) => user.departmentId === 74 && user.clientType === 'System'
)
},
methods: {
addfn(item) {
const length = item.data.length
item.data.push({
id: parseInt(length),
D1: '',
D2: '',
D3: '',
D4: '',
D5: '',
D6: '',
D7: ''
})
},
initYsjl() {
this.ysjlController.init(this.$route.query).then((data) => {
this.ysjl = data.ysjl
@ -886,9 +791,8 @@ export default {
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl'
this.ysjl.xianchangjianyantiaojian = '符合'
this.getJyxm(1)
// this.getFbList(); //
// this.getZzdw()
this.getSbList()
})
},
@ -905,10 +809,27 @@ export default {
this.xinghaoList = data
})
},
getFbList() {
this.ysjlController.getYsjlFb(this.ysjlId).then((data) => {
console.log(data)
// this.param = data
getJyxmInfoByYsjl() {
this.ysjlController.getJyxmInfoByYsjl(this.ysjlId).then((data) => {
if (!data.fbjyxm) {
return
}
const fubiao = JSON.parse(data.fbjyxm)
if (!fubiao.length) {
return
}
if (fubiao[0]) {
this.fubiao1 = fubiao[0]
}
if (fubiao[1]) {
this.fubiao2 = fubiao[1]
}
if (fubiao[2]) {
this.fubiao3 = fubiao[2]
}
console.log(this.fubiao1)
console.log(this.fubiao2)
console.log(this.fubiao3)
})
},
getYsjl() {
@ -958,12 +879,12 @@ export default {
if (this.$route.query.state === 'update') {
this.jyxmController.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort).then((data) => {
this.bgfyData = data
this.tableJs.mergeColRows(this.cols, this.rows, data)
this.tableJs.getData(this.cols, this.rows, this.bgfyData)
})
} else {
this.jyxmController.getCyJyxm(this.$route.query.templateId, sort).then((data) => {
this.bgfyData = data
this.tableJs.mergeColRows(this.cols, this.rows, data)
this.tableJs.getData(this.cols, this.rows, this.bgfyData)
})
}
},
@ -976,33 +897,9 @@ export default {
})
})
},
getZzdw() {
this.api({
url: '/dwxx/getById',
method: 'get',
params: {
id: this.ysjl.zzdwId
}
}).then((data) => {
this.jlbh1 += data.zhizaodanweiCode
this.ysjl.zhizaoxukezhengjibie = data.zhizaoxukezhengjibie
this.ysjl.zhizaoxukezhengbianhao = data.zhizaoxukezhengbianhao
this.getMaxBh()
})
},
getDicData() {
this.api({
url: '/dicData/getDicDataByTypeCode',
method: 'get',
params: {
typeCode: 'GL_ZZ_XGGC'
}
}).then((data) => {
this.xggcList = data
})
},
//
/**
* 查询最大记录编号
*/
getMaxBh() {
const aheadPart = this.jlbh1 + this.jlbh2 + '-'
this.api({
@ -1026,63 +923,13 @@ export default {
* @param data
*/
signNameValue(data) {
if (data.fieldName === 'xmqianming') {
for (let i = 0; i < this.$refs.bgfyData.selection.length; i++) {
const jianyanrenyuan = this.$refs.bgfyData.selection[i].jianjianyuan
? this.$refs.bgfyData.selection[i].jianjianyuan.split(',')
: []
if (!jianyanrenyuan.includes(data.name)) {
jianyanrenyuan.push(data.name)
this.$refs.bgfyData.selection[i].jianjianyuan =
jianyanrenyuan.join(',')
}
}
} else {
const isNotHasJyry = !this.ysjl.jianyanrenyuan
this.ysjl.jianyanrenyuan = String(data.id)
this.jianyanrenyuan = data.name
this.common.signName(this.ysjl.id, this.ysjl.jianyanrenyuan)
Utils.$emit('manufacture-list')
//
if (
isNotHasJyry &&
this.jianyanrenyuan &&
this.jianyanrenyuan.split(',').length === 1
) {
this.bgfyData.forEach((jyxm) => {
//
if (
!jyxm.jianjianyuan ||
!jyxm.jianjianyuan
.split(',')
.filter((jjr) => jjr === this.jianyanrenyuan).length
) {
if (jyxm.jianjianyuan) {
const jianjianyuan = jyxm.jianjianyuan.split(',')
jianjianyuan.push(this.jianyanrenyuan)
jyxm.jianjianyuan = jianjianyuan.join(',')
} else {
jyxm.jianjianyuan = this.jianyanrenyuan
}
}
})
}
}
this.ysjl.jianyanrenyuan = String(data.id)
this.jianyanrenyuan = data.name
this.common.signName(this.ysjl.id, this.ysjl.jianyanrenyuan)
},
customClearSign(fieldName) {
if (fieldName === 'xmqianming') {
for (let i = 0; i < this.$refs.bgfyData.selection.length; i++) {
let jyry = this.$refs.bgfyData.selection[i].jianjianyuan || ''
jyry = this.common
.deleteElement(
jyry.split(','),
String(this.$store.getters.nickname)
)
.join(',')
}
} else {
const data = {
id:
const data = {
id:
this.ysjl.jianyanrenyuan &&
this.common
.deleteElement(
@ -1090,7 +937,7 @@ export default {
String(this.$store.getters.userId)
)
.join(','),
name:
name:
this.jianyanrenyuan &&
this.common
.deleteElement(
@ -1098,28 +945,17 @@ export default {
this.$store.getters.nickname
)
.join(','),
fieldName: fieldName
}
this.signNameValue(data)
fieldName: fieldName
}
this.signNameValue(data)
},
saveYsjl(operation) {
const tableData = []
const arr = []
if (this.fromType === '5') {
arr.push(this.$refs.table2.tableData)
let fubiao
if (this.fromType === 5) {
fubiao = [this.$refs.table1.tableData]
} else {
this.arrayGroup.map((item) => {
item.data.forEach(k => {
delete k.id
})
arr.push(item.data)
})
const arr1 = JSON.parse(JSON.stringify(this.$refs.table1.tableData))
arr1.map(item => {
delete item.name
})
arr.push(arr1)
fubiao = [this.fubiao1, this.fubiao2, this.fubiao3]
}
this.bgfyData.forEach((row) => {
tableData.push({
@ -1132,12 +968,11 @@ export default {
sort: row.sort,
orders: row.orders,
cjState: 0
})
})
if (operation === 'add') {
this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + '-' + this.jlbh3
this.save(operation, 'post', tableData, arr)
this.save(operation, 'post', tableData, fubiao)
} else if (operation === 'build') {
this.ysjl.baogaobianhao = this.ysjl.jilubianhao
if (
@ -1168,14 +1003,14 @@ export default {
return false
}
}
this.save(operation, 'put', tableData, arr)
this.save(operation, 'put', tableData, fubiao)
} else if (operation === 'upd') {
this.save(operation, 'put', tableData, arr)
this.save(operation, 'put', tableData, fubiao)
}
},
save(operation, type, jyxm, fb) {
if (this.fromType !== '5') this.ysjl.imagePath = this.$refs.table1.imgPath
save(operation, type, jyxm, fubiao) {
if (this.fromType !== 5) this.ysjl.imagePath = this.$refs.table1.imgPath
//
if (this.isRepeat) {
@ -1194,7 +1029,8 @@ export default {
ysjl: this.ysjl,
param: this.param,
cyJyxm: {
fbjyxm: JSON.stringify(fb)
ysjlId: this.ysjl.id,
fbjyxm: JSON.stringify(fubiao)
},
jdJyxm: jyxm,
flag: operation
@ -1349,13 +1185,4 @@ export default {
}
</style>
<style lang="scss" scoped>
/*.el-table/deep/ td, .el-table/deep/ th.is-leaf,.el-table--border,.el-table--group{
border-color: black;
}*/
// .el-table {
// /deep/tbody tr:hover > td {
// background-color: oldlace;
// }
// }
</style>

401
src/views/ysjl/3000/dj/common/table1.vue → src/views/ysjl/3000/dj/common/phxsb.vue

@ -1,183 +1,218 @@
<template>
<div class="app-container">
<el-table :data="tableData" style="width: 100%" border>
<el-table-column label="电动机电流载重量百分比" prop="name" />
<el-table-column label="30%" prop="D5">
<template slot-scope="scope">
<el-input v-model="scope.row.D5" />
</template>
</el-table-column>
<el-table-column label="40%" prop="D4">
<template slot-scope="scope">
<el-input v-model="scope.row.D4" />
</template>
</el-table-column>
<el-table-column label="45%" prop="D3">
<template slot-scope="scope">
<el-input v-model="scope.row.D3" />
</template>
</el-table-column>
<el-table-column label="50%" prop="D2">
<template slot-scope="scope">
<el-input v-model="scope.row.D2" />
</template>
</el-table-column>
<el-table-column label="60%" prop="D1">
<template slot-scope="scope">
<el-input v-model="scope.row.D1" />
</template>
</el-table-column>
</el-table>
<div id="chart" style="width:600px;height:500px;margin-top:50px" />
</div>
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
export default {
name: 'Table',
components: {},
props: {
tabelHeader: {
type: Array,
require: true,
default: () => {
return []
}
},
tableData: {
type: Array,
require: true,
default: () => {
return []
}
},
pic: {
type: String,
require: true,
default: ''
}
},
data() {
return {
type: '1',
options: [
{
value: '√',
id: '1'
},
{
value: 'X',
id: '2'
},
{
value: '/',
id: '3'
}
],
multipleSelection: [],
data: [],
data1: [],
imgPath: ''
}
},
computed: {},
watch: {
tableData: {
handler: function(val) {
this.data = Object.values(val[0]).slice(1)
this.data1 = Object.values(val[1]).slice(1)
this.initChart()
},
deep: true
}
},
created() {
this.tableData = [
{
name: '上行(A)',
D1: '',
D2: '',
D3: '',
D4: '',
D5: ''
},
{
name: '下行(A)',
D1: '',
D2: '',
D3: '',
D4: '',
D5: ''
}
]
},
mounted() {
this.initChart()
},
methods: {
initChart() {
const myChart = echarts.init(document.getElementById('chart'))
const option = {
title: {
text: '电流(A)'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['上行', '下行']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['0', '10', '20', '30', '40', '45', '50', '60']
},
yAxis: {
type: 'value'
},
series: [
{
name: '上行',
type: 'line',
stack: '总量',
data: this.data
},
{
name: '下行',
type: 'line',
stack: '总量',
data: this.data1
}
]
}
myChart.setOption(option)
this.imgPath = myChart.getDataURL({
type: 'png',
pixelRatio: 1,
backgroundColor: '#fff'
})
}
}
}
</script>
<style scoped>
.searchBox {
display: flex;
flex-direction: row;
margin-bottom: 20px;
}
</style>
<template>
<div class="app-container">
<el-table :data.sync="tableData" style="width: 100%" border>
<el-table-column label="电动机电流载重量百分比" prop="name" />
<el-table-column label="30%" prop="D5">
<template slot-scope="scope">
<el-input v-model="scope.row.D5" />
</template>
</el-table-column>
<el-table-column label="40%" prop="D4">
<template slot-scope="scope">
<el-input v-model="scope.row.D4" />
</template>
</el-table-column>
<el-table-column label="45%" prop="D3">
<template slot-scope="scope">
<el-input v-model="scope.row.D3" />
</template>
</el-table-column>
<el-table-column label="50%" prop="D2">
<template slot-scope="scope">
<el-input v-model="scope.row.D2" />
</template>
</el-table-column>
<el-table-column label="60%" prop="D1">
<template slot-scope="scope">
<el-input v-model="scope.row.D1" />
</template>
</el-table-column>
</el-table>
<div id="chart" style="width:600px;height:500px;margin-top:50px" />
</div>
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from '@/utils/mixins/resize'
export default {
name: 'Phxsb',
mixins: [resize],
props: {
/**
* [ { name: '上行(A)', D1: '', D2: '', D3: '', D4: '', D5: '' }, { name: '下行(A)', D1: '', D2: '', D3: '', D4: '', D5: '' } ]
*/
tableData: {
type: Array,
required: true
},
pic: {
type: String,
default: ''
}
},
data() {
return {
type: '1',
options: [
{
value: '√',
id: '1'
},
{
value: 'X',
id: '2'
},
{
value: '/',
id: '3'
}
],
multipleSelection: [],
chart: undefined,
phxsX: [],
phxsY: [],
imgPath: '',
xAxis: ['30', '40', '45', '50', '60'],
chartDataX: [],
chartDataY: []
}
},
watch: {
tableData: {
handler: function(val) {
this.initTableData()
this.phxsX = []
this.phxsY = []
this.chartDataX = []
this.chartDataY = []
for (let i = 5; i > 0; i--) {
const key = 'D' + i
const xValue = Number(val[0][key])
const yValue = Number(val[1][key])
this.chartDataX.push(xValue)
this.chartDataY.push(yValue)
this.phxsX.push([this.xAxis[5 - i], xValue])
this.phxsY.push([this.xAxis[5 - i], yValue])
}
this.buildPhxs()
this.initChart()
},
deep: true
}
},
created() {
this.initTableData()
},
mounted() {
this.initChart()
},
methods: {
initTableData() {
if (this.tableData.length) {
return
}
this.tableData.push({
name: '上行(A)',
D1: '',
D2: '',
D3: '',
D4: '',
D5: ''
})
this.tableData.push({
name: '下行(A)',
D1: '',
D2: '',
D3: '',
D4: '',
D5: ''
})
},
buildPhxs() {
let phxs = 0
let phxsTemp = 0
for (let i = 0; i < this.phxsX.length - 1; i++) {
phxsTemp = parseInt(this.crossPointX(parseFloat(this.phxsX[i][0]), parseFloat(this.phxsX[i][1]), parseFloat(this.phxsX[i + 1][0]),
parseFloat(this.phxsX[i + 1][1]), parseFloat(this.phxsY[i][0]), parseFloat(this.phxsY[i][1]), parseFloat(this.phxsY[i + 1][0]),
parseFloat(this.phxsY[i + 1][1])))
if (phxsTemp > parseFloat(this.phxsX[i][0]) && phxsTemp < parseFloat(this.phxsX[i + 1][0])) {
phxs = phxsTemp
}
}
console.log('平衡系数', phxs)
this.$emit('loadPhxs', phxs)
},
crossPointX(line1x1, line1y1, line1x2, line1y2, line2x1, line2y1, line2x2, line2y2) {
return (line1x1 * (line1y2 - line1y1) / (line1x2 - line1x1) - line2x1 * (line2y2 - line2y1) / (line2x2 - line2x1) + line2y1 - line1y1) /
((line1y2 - line1y1) / (line1x2 - line1x1) - (line2y2 - line2y1) / (line2x2 - line2x1))
},
initChart() {
let option
if (this.chart) {
option = this.chart.getOption()
option.series[0].data = this.chartDataX
option.series[1].data = this.chartDataY
this.chart.setOption(option)
return
}
this.chart = echarts.init(document.getElementById('chart'))
option = {
title: {
text: '电流(A)'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['上行', '下行']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.xAxis
},
yAxis: {
type: 'value',
min: 0,
max: 30,
splitNumber: 15
},
series: [
{
name: '上行',
type: 'line',
data: this.chartDataX
},
{
name: '下行',
type: 'line',
data: this.chartDataY
}
]
}
this.chart.setOption(option)
this.imgPath = this.chart.getDataURL({
type: 'png',
pixelRatio: 1,
backgroundColor: '#fff'
})
}
}
}
</script>
<style scoped>
</style>

24
src/views/ysjl/3000/dj/common/table.vue

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div class="searchBox">
<el-button type="primary" @click="addtable">
<el-button type="primary" @click="tableJs.addRow($refs.fubiao)">
新增
</el-button>
<el-button type="danger" @click="deleteFn">
@ -10,7 +10,9 @@
</div>
<el-table
:data="tableData"
ref="fubiao"
:data.sync="tableData"
border
style="width: 100%"
@selection-change="handleSelectionChange"
>
@ -24,7 +26,7 @@
:prop="item.prop"
:label="item.label"
>
<template v-if="item.type==1" slot-scope="scope">
<template v-if="item.type === 1" slot-scope="scope">
<el-autocomplete
v-model="scope.row[scope.column.property]"
class="inline-input"
@ -55,21 +57,15 @@ export default {
props: {
tabelHeader: {
type: Array,
require: true,
default: () => {
return []
}
required: true
},
fromType: {
type: String,
default: ''
type: Number,
default: 0
},
tableData: {
type: Array,
require: true,
default: () => {
return []
}
required: true
}
},
data() {
@ -114,7 +110,7 @@ export default {
console.log(item)
},
addtable() {
this.$emit('addfn')
this.tableData.push({})
},
deleteFn() {
if (this.multipleSelection.length === 0) {

127
src/views/ysjl/3000/dj/common/table2.vue → src/views/ysjl/3000/dj/common/zdftFb.vue

@ -1,82 +1,45 @@
<template>
<div class="app-container">
<el-table :data="tableData" style="width: 50%" border>
<el-table-column label="" prop="D2" />
<el-table-column label="制停距离(m)" prop="D1">
<template slot-scope="scope">
<el-input v-model="scope.row.D1" />
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: 'Table2',
components: {},
props: {
tabelHeader: {
type: Array,
require: true,
default: () => {
return []
}
},
tableData: {
type: Array,
require: true,
default: () => {
return []
}
}
},
data() {
return {
options: [
{
value: '√',
id: '1'
},
{
value: 'X',
id: '2'
},
{
value: '/',
id: '3'
}
]
}
},
computed: {},
created() {
this.tableData = [
{
D1: '',
D2: '第一行'
},
{
D1: '',
D2: '第二行'
},
{
D1: '',
D2: '第三行'
}
]
},
mounted() {
},
methods: {
}
}
</script>
<style scoped>
.searchBox {
display: flex;
flex-direction: row;
margin-bottom: 20px;
}
</style>
<template>
<div class="app-container">
<el-table :data="tableData" style="width: 50%">
<el-table-column label="" prop="D2" />
<el-table-column label="制停距离(m)" prop="D1">
<template slot-scope="scope">
<el-input v-model="scope.row.D1" />
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: 'ZdftFb',
components: {},
props: {
tableData: {
type: Array,
required: true
}
},
data() {
return {
options: [
{
value: '√',
id: '1'
},
{
value: 'X',
id: '2'
},
{
value: '/',
id: '3'
}
]
}
}
}
</script>
<style scoped>
</style>

2
src/views/ysjl/3000/dj/yeyin/index.vue

@ -11,7 +11,7 @@ export default {
components: { baseInfo },
data() {
return {
type: '1',
type: 1,
arrayGroup: [
{
header: [

2
src/views/ysjl/3000/dj/yy/index.vue

@ -11,7 +11,7 @@ export default {
components: { baseInfo },
data() {
return {
type: '3',
type: 3,
arrayGroup: [
{
header: [

2
src/views/ysjl/3000/dj/zdft/index.vue

@ -11,7 +11,7 @@ export default {
components: { baseInfo },
data() {
return {
type: '5',
type: 5,
arrayGroup: [
{
header: [

2
src/views/ysjl/3000/jj/wjf-yy/index.vue

@ -11,7 +11,7 @@ export default {
components: { baseInfo },
data() {
return {
type: '2',
type: 2,
arrayGroup: [
{
header: [

2
src/views/ysjl/3000/jj/yjf-yy/index.vue

@ -11,7 +11,7 @@ export default {
components: { baseInfo },
data() {
return {
type: '2'
type: 2
}
},
computed: {

2
src/views/ysjl/3000/jj/yy-jj/index.vue

@ -11,7 +11,7 @@ export default {
components: { baseInfo },
data() {
return {
type: '4',
type: 4,
arrayGroup: [
{
header: [

Loading…
Cancel
Save