|
@@ -116,6 +116,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { updateStatis } from '@/api/public.js'
|
|
|
+
|
|
|
export default {
|
|
|
props: ['editTable', 'loading'],
|
|
|
data() {
|
|
@@ -131,64 +133,96 @@ export default {
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val
|
|
|
},
|
|
|
+ // 编辑图例取消
|
|
|
cancel() {
|
|
|
- this.save()
|
|
|
- // this.$emit('cance')
|
|
|
+ if (this.editNum.length > 0) {
|
|
|
+ this.$confirm('图例中的数据发生变化, 是否需要保存?', {
|
|
|
+ confirmButtonText: '保存',
|
|
|
+ cancelButtonText: '放弃修改',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$emit('saveNum', this.editNum)
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已放弃修改'
|
|
|
+ })
|
|
|
+ this.editNum = []
|
|
|
+ this.$emit('saveNum', this.editNum)
|
|
|
+ this.$store.commit('SETSHOWVIEW', 1)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$store.commit('SETSHOWVIEW', 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 编辑图里保存
|
|
|
+ save() {
|
|
|
+ this.queryEdit(this.editNum)
|
|
|
+ },
|
|
|
+ // 编辑数量
|
|
|
+ queryEdit(val) {
|
|
|
+ let params = {
|
|
|
+ postParams: {
|
|
|
+ Content: val
|
|
|
+ }
|
|
|
+ }
|
|
|
+ updateStatis(params).then(res => {
|
|
|
+ if (res.Result == 'success') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$store.commit('SETSHOWVIEW', 1)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '操作失败',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
+ // 修改图例数量
|
|
|
changeTable(val) {
|
|
|
this.editNum.push(val)
|
|
|
- var obj = {}
|
|
|
- this.editNum = this.editNum.reduce(function(item, next) {
|
|
|
- obj[next.key] ? '' : (obj[next.key] = true && item.push(next))
|
|
|
- return item
|
|
|
- }, [])
|
|
|
+ let result = [],
|
|
|
+ obj = {}
|
|
|
+ for (var i = 0; i < this.editNum.length; i++) {
|
|
|
+ if (!obj[this.editNum[i].GraphElementId]) {
|
|
|
+ result.push(this.editNum[i])
|
|
|
+ obj[this.editNum[i].GraphElementId] = true
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
+ // 修改隐藏为0的项目的开关
|
|
|
changeSwitch(val) {
|
|
|
this.$emit('handleSwich2', val)
|
|
|
- },
|
|
|
- save() {
|
|
|
- this.$emit('saveNum', this.editNum)
|
|
|
- // this.$confirm('图例中的数据发生变化, 是否需要保存?', {
|
|
|
- // confirmButtonText: '保存',
|
|
|
- // cancelButtonText: '放弃修改',
|
|
|
- // type: 'warning'
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // this.$emit('saveNum', this.editNum)
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // this.$message({
|
|
|
- // type: 'info',
|
|
|
- // message: '已放弃修改'
|
|
|
- // })
|
|
|
- // this.editNum = []
|
|
|
- // this.$emit('saveNum', this.editNum)
|
|
|
- // })
|
|
|
- },
|
|
|
- init() {
|
|
|
- this.tbData1 = []
|
|
|
- this.tbData2 = []
|
|
|
- this.tbData3 = []
|
|
|
- if (this.editTable.length > 0) {
|
|
|
- this.tbData1 = this.editTable
|
|
|
- // 以下不要动 不要删
|
|
|
- // let len = this.tableData.length
|
|
|
- // if (len <= 10) {
|
|
|
- // this.tbData1 = this.tableData
|
|
|
- // } else if (len > 10 && len <= 20) {
|
|
|
- // this.tbData1 = this.tableData.slice(0, 10)
|
|
|
- // this.tbData2 = this.tableData.slice(10, len)
|
|
|
- // } else if (len > 10 && len <= 30) {
|
|
|
- // this.tbData1 = this.tableData.slice(0, 10)
|
|
|
- // this.tbData2 = this.tableData.slice(10, 20)
|
|
|
- // this.tbData3 = this.tableData.slice(20, len)
|
|
|
- // } else {
|
|
|
- // this.tbData1 = this.tableData.slice(0, parseInt(len / 3))
|
|
|
- // this.tbData2 = this.tableData.slice(parseInt(len / 3), parseInt(len / 3) * 2)
|
|
|
- // this.tbData3 = this.tableData.slice(parseInt(len / 3) * 2, len)
|
|
|
- // }
|
|
|
- }
|
|
|
}
|
|
|
+ // init() {
|
|
|
+ // this.tbData1 = []
|
|
|
+ // this.tbData2 = []
|
|
|
+ // this.tbData3 = []
|
|
|
+ // if (this.editTable.length > 0) {
|
|
|
+ // this.tbData1 = this.editTable
|
|
|
+ // 以下不要动 不要删
|
|
|
+ // let len = this.tableData.length
|
|
|
+ // if (len <= 10) {
|
|
|
+ // this.tbData1 = this.tableData
|
|
|
+ // } else if (len > 10 && len <= 20) {
|
|
|
+ // this.tbData1 = this.tableData.slice(0, 10)
|
|
|
+ // this.tbData2 = this.tableData.slice(10, len)
|
|
|
+ // } else if (len > 10 && len <= 30) {
|
|
|
+ // this.tbData1 = this.tableData.slice(0, 10)
|
|
|
+ // this.tbData2 = this.tableData.slice(10, 20)
|
|
|
+ // this.tbData3 = this.tableData.slice(20, len)
|
|
|
+ // } else {
|
|
|
+ // this.tbData1 = this.tableData.slice(0, parseInt(len / 3))
|
|
|
+ // this.tbData2 = this.tableData.slice(parseInt(len / 3), parseInt(len / 3) * 2)
|
|
|
+ // this.tbData3 = this.tableData.slice(parseInt(len / 3) * 2, len)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
mounted() {}
|
|
|
}
|