79e95008 by xiaomiao
2 parents 6e06adc1 e3e00fb3
1 /* 1 /*
2 * @Description: 引入公共组件 2 * @Description: 引入公共组件
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-04-26 17:26:12 4 * @LastEditTime: 2023-04-28 13:30:31
5 */ 5 */
6 import dialogBox from '@/components/dialogBox/dialogBox.vue' 6 import dialogBox from '@/components/DialogBox/dialogBox.vue'
7 import LbTable from '@/components/LbTable/lb-table.vue' 7 import LbTable from '@/components/LbTable/lb-table.vue'
8 import Theme from '@/components/Theme/theme.vue' 8 import Theme from '@/components/Theme/theme.vue'
9 import Popup from '@/components/Popup/index' 9 import Popup from '@/components/Popup/index'
......
...@@ -47,243 +47,243 @@ ...@@ -47,243 +47,243 @@
47 </template> 47 </template>
48 48
49 <script> 49 <script>
50 import LbColumn from './lb-column' 50 import LbColumn from './lb-column'
51 export default { 51 export default {
52 props: { 52 props: {
53 column: Array, 53 column: Array,
54 data: Array, 54 data: Array,
55 spanMethod: Function, 55 spanMethod: Function,
56 pagination: { 56 pagination: {
57 type: Boolean, 57 type: Boolean,
58 default: true, 58 default: true,
59 },
60 isRadio: {
61 type: Boolean,
62 default: false,
63 },
64 border: {
65 type: Boolean,
66 default: true,
67 },
68 showHeader: {
69 type: Boolean,
70 default: true,
71 },
72 paginationTop: {
73 type: String,
74 default: '0',
75 },
76 heightNum: {
77 type: Number,
78 default: 355,
79 },
80 maxHeight: {
81 type: Number,
82 default: 500
83 },
84 minHeight: {
85 type: Number,
86 default: undefined
87 },
88 heightNumSetting: {
89 type: Boolean,
90 default: false,
91 },
92 customClass: {
93 type: String,
94 default: '',
95 },
96 paginationAlign: {
97 type: String,
98 default: 'left',
99 },
100 calcHeight: {
101 type: Number,
102 default: 170
103 },
104 merge: Array,
59 }, 105 },
60 isRadio: { 106 components: {
61 type: Boolean, 107 LbColumn,
62 default: false,
63 }, 108 },
64 border: { 109 data () {
65 type: Boolean, 110 return {
66 default: true, 111 tableHeight: 'auto',
67 }, 112 mergeLine: {},
68 showHeader: { 113 mergeIndex: {},
69 type: Boolean, 114 selected: ''
70 default: true, 115 }
71 },
72 paginationTop: {
73 type: String,
74 default: '0',
75 },
76 heightNum: {
77 type: Number,
78 default: 355,
79 },
80 maxHeight: {
81 type: Number,
82 default: 500
83 },
84 minHeight: {
85 type: Number,
86 default: undefined
87 },
88 heightNumSetting: {
89 type: Boolean,
90 default: false,
91 },
92 customClass: {
93 type: String,
94 default: '',
95 },
96 paginationAlign: {
97 type: String,
98 default: 'left',
99 },
100 calcHeight: {
101 type: Number,
102 default: 170
103 }, 116 },
104 merge: Array, 117 created () {
105 }, 118 this.getMergeArr(this.data, this.merge)
106 components: { 119 this.getHeight()
107 LbColumn,
108 },
109 data () {
110 return {
111 tableHeight: 'auto',
112 mergeLine: {},
113 mergeIndex: {},
114 selected: ''
115 }
116 },
117 created () {
118 this.getMergeArr(this.data, this.merge)
119 this.getHeight()
120 },
121 computed: {
122 dataLength () {
123 return [] || this.data.length
124 }, 120 },
125 }, 121 computed: {
126 methods: { 122 dataLength () {
127 // 单选 123 return [] || this.data.length
128 singleElection (row) { 124 },
129 this.selected = this.data.indexOf(row);
130 }, 125 },
126 methods: {
127 // 单选
128 singleElection (row) {
129 this.selected = this.data.indexOf(row);
130 },
131 131
132 tableRowClassName ({ row, rowIndex }) { 132 tableRowClassName ({ row, rowIndex }) {
133 if (rowIndex % 2 === 1) { 133 if (rowIndex % 2 === 1) {
134 return 'interlaced'; 134 return 'interlaced';
135 } 135 }
136 }, 136 },
137 getHeight () { 137 getHeight () {
138 if (!this.heightNumSetting) { 138 if (!this.heightNumSetting) {
139 let _this = this 139 let _this = this
140 if (this.heightNum) { 140 if (this.heightNum) {
141 _this.$nextTick(() => { 141 _this.$nextTick(() => {
142 if (document.querySelector(".tags-view-container")) { 142 if (document.querySelector(".tags-view-container")) {
143 window.addEventListener('resize', () => { 143 window.addEventListener('resize', () => {
144 if (_this.calcHeight == 170) {
145 _this.tableHeight = _this.calcHeightx(170)
146 } else {
147 _this.tableHeight = _this.calcHeightx(_this.calcHeight)
148 }
149 });
144 if (_this.calcHeight == 170) { 150 if (_this.calcHeight == 170) {
145 _this.tableHeight = _this.calcHeightx(170) 151 _this.tableHeight = _this.calcHeightx(170)
146 } else { 152 } else {
147 _this.tableHeight = _this.calcHeightx(_this.calcHeight) 153 _this.tableHeight = _this.calcHeightx(_this.calcHeight)
148 } 154 }
149 });
150 if (_this.calcHeight == 170) {
151 _this.tableHeight = _this.calcHeightx(170)
152 } else { 155 } else {
156 window.addEventListener('resize', () => {
157 _this.tableHeight = _this.calcHeightx(_this.calcHeight)
158 });
153 _this.tableHeight = _this.calcHeightx(_this.calcHeight) 159 _this.tableHeight = _this.calcHeightx(_this.calcHeight)
154 } 160 }
155 } else { 161 })
156 window.addEventListener('resize', () => { 162 } else {
157 _this.tableHeight = _this.calcHeightx(_this.calcHeight) 163 _this.tableHeight = window.innerHeight - _this.heightNum
158 }); 164 }
159 _this.tableHeight = _this.calcHeightx(_this.calcHeight)
160 }
161 })
162 } else { 165 } else {
163 _this.tableHeight = window.innerHeight - _this.heightNum 166 // this.tableHeight = this.heightNum
167 this.$nextTick(() => {
168 this.minHeight && (document.getElementById('heightNumSetting').style.minHeight = this.minHeight + 'px')
169 })
164 } 170 }
165 } else { 171 },
166 this.tableHeight = this.heightNum 172 calcHeightx (value, wappered = true) {
167 this.$nextTick(() => { 173 //项目自定义的公共header部分的高度,可忽略
168 this.minHeight && (document.getElementById('heightNumSetting').style.minHeight = this.minHeight + 'px') 174 let header = document.querySelector(".from-clues-header").offsetHeight;
169 })
170 }
171 },
172 calcHeightx (value, wappered = true) {
173 //项目自定义的公共header部分的高度,可忽略
174 let header = document.querySelector(".from-clues-header").offsetHeight;
175 175
176 //value为动态计算table界面高度时,减去的其他空白部分,需自行在调试找到临界值,剩下的就是table表格的高度(包含header+body部分) 176 //value为动态计算table界面高度时,减去的其他空白部分,需自行在调试找到临界值,剩下的就是table表格的高度(包含header+body部分)
177 value = value == undefined ? 100 : value; 177 value = value == undefined ? 100 : value;
178 if (document.querySelector(".tags-view-container")) { 178 if (document.querySelector(".tags-view-container")) {
179 let tagsView = document.querySelector(".tags-view-container").offsetHeight; 179 let tagsView = document.querySelector(".tags-view-container").offsetHeight;
180 var res = window.innerHeight - parseInt(header) - value - parseInt(tagsView); 180 var res = window.innerHeight - parseInt(header) - value - parseInt(tagsView);
181 } else { 181 } else {
182 var res = window.innerHeight - parseInt(header) - value; 182 var res = window.innerHeight - parseInt(header) - value;
183 } 183 }
184 if (wappered) { 184 if (wappered) {
185 //通过原生方法,获取dom节点的高度------获取element-ui table表格body的元素 185 //通过原生方法,获取dom节点的高度------获取element-ui table表格body的元素
186 let wapper = window.document.getElementsByClassName('el-table__body-wrapper'); 186 let wapper = window.document.getElementsByClassName('el-table__body-wrapper');
187 //通过原生方法,获取dom节点的高度------获取element-ui table表格header的元素 187 //通过原生方法,获取dom节点的高度------获取element-ui table表格header的元素
188 let header = window.document.getElementsByClassName('el-table__header-wrapper'); 188 let header = window.document.getElementsByClassName('el-table__header-wrapper');
189 //必须加延时,要不然赋不上去值 189 //必须加延时,要不然赋不上去值
190 setTimeout(() => { 190 setTimeout(() => {
191 //通过上边计算得到的table高度的value值,减去table表格的header高度,剩下的通过dom节点直接强行赋给table表格的body 191 //通过上边计算得到的table高度的value值,减去table表格的header高度,剩下的通过dom节点直接强行赋给table表格的body
192 wapper[0].style.height = (value - header[0].clientHeight) 192 wapper[0].style.height = (value - header[0].clientHeight)
193 }, 100) 193 }, 100)
194 } 194 }
195 return res; 195 return res;
196 }, 196 },
197 clearSelection () { 197 clearSelection () {
198 this.$refs.elTable.clearSelection() 198 this.$refs.elTable.clearSelection()
199 }, 199 },
200 toggleRowSelection (row, selected) { 200 toggleRowSelection (row, selected) {
201 this.$refs.elTable.toggleRowSelection(row, selected) 201 this.$refs.elTable.toggleRowSelection(row, selected)
202 }, 202 },
203 toggleAllSelection () { 203 toggleAllSelection () {
204 this.$refs.elTable.toggleAllSelection() 204 this.$refs.elTable.toggleAllSelection()
205 }, 205 },
206 toggleRowExpansion (row, expanded) { 206 toggleRowExpansion (row, expanded) {
207 this.$refs.elTable.toggleRowExpansion(row, expanded) 207 this.$refs.elTable.toggleRowExpansion(row, expanded)
208 }, 208 },
209 setCurrentRow (row) { 209 setCurrentRow (row) {
210 this.$refs.elTable.setCurrentRow(row) 210 this.$refs.elTable.setCurrentRow(row)
211 }, 211 },
212 clearSort () { 212 clearSort () {
213 this.$refs.elTable.clearSort() 213 this.$refs.elTable.clearSort()
214 }, 214 },
215 clearFilter (columnKey) { 215 clearFilter (columnKey) {
216 this.$refs.elTable.clearFilter(columnKey) 216 this.$refs.elTable.clearFilter(columnKey)
217 }, 217 },
218 doLayout () { 218 doLayout () {
219 this.$refs.elTable.doLayout() 219 this.$refs.elTable.doLayout()
220 }, 220 },
221 sort (prop, order) { 221 sort (prop, order) {
222 this.$refs.elTable.sort(prop, order) 222 this.$refs.elTable.sort(prop, order)
223 }, 223 },
224 paginationCurrentChange (val) { 224 paginationCurrentChange (val) {
225 this.$emit('p-current-change', val) 225 this.$emit('p-current-change', val)
226 }, 226 },
227 getMergeArr (tableData, merge) { 227 getMergeArr (tableData, merge) {
228 if (!merge) return 228 if (!merge) return
229 this.mergeLine = {} 229 this.mergeLine = {}
230 this.mergeIndex = {} 230 this.mergeIndex = {}
231 merge.forEach((item, k) => { 231 merge.forEach((item, k) => {
232 tableData.forEach((data, i) => { 232 tableData.forEach((data, i) => {
233 if (i === 0) { 233 if (i === 0) {
234 this.mergeIndex[item] = this.mergeIndex[item] || [] 234 this.mergeIndex[item] = this.mergeIndex[item] || []
235 this.mergeIndex[item].push(1)
236 this.mergeLine[item] = 0
237 } else {
238 if (data[item] === tableData[i - 1][item]) {
239 this.mergeIndex[item][this.mergeLine[item]] += 1
240 this.mergeIndex[item].push(0)
241 } else {
242 this.mergeIndex[item].push(1) 235 this.mergeIndex[item].push(1)
243 this.mergeLine[item] = i 236 this.mergeLine[item] = 0
237 } else {
238 if (data[item] === tableData[i - 1][item]) {
239 this.mergeIndex[item][this.mergeLine[item]] += 1
240 this.mergeIndex[item].push(0)
241 } else {
242 this.mergeIndex[item].push(1)
243 this.mergeLine[item] = i
244 }
244 } 245 }
245 } 246 })
246 }) 247 })
247 }) 248 },
248 }, 249 mergeMethod ({ row, column, rowIndex, columnIndex }) {
249 mergeMethod ({ row, column, rowIndex, columnIndex }) { 250 const index = this.merge.indexOf(column.property)
250 const index = this.merge.indexOf(column.property) 251 if (index > -1) {
251 if (index > -1) { 252 const _row = this.mergeIndex[this.merge[index]][rowIndex]
252 const _row = this.mergeIndex[this.merge[index]][rowIndex] 253 const _col = _row > 0 ? 1 : 0
253 const _col = _row > 0 ? 1 : 0 254 return {
254 return { 255 rowspan: _row,
255 rowspan: _row, 256 colspan: _col,
256 colspan: _col, 257 }
257 } 258 }
258 } 259 },
259 }, 260 },
260 }, 261 watch: {
261 watch: { 262 merge () {
262 merge () { 263 this.getMergeArr(this.data, this.merge)
263 this.getMergeArr(this.data, this.merge) 264 },
265 dataLength () {
266 this.getMergeArr(this.data, this.merge)
267 }
264 }, 268 },
265 dataLength () { 269 }
266 this.getMergeArr(this.data, this.merge)
267 }
268 },
269 }
270 </script> 270 </script>
271 <style rel="stylesheet/scss" scoped lang="scss"> 271 <style rel="stylesheet/scss" scoped lang="scss">
272 .lb-table { 272 .lb-table {
273 margin-top: 1px; 273 margin-top: 1px;
274 274
275 .interlaced { 275 .interlaced {
276 background: #fafcff; 276 background: #fafcff;
277 border: 1px solid #ebf2fa; 277 border: 1px solid #ebf2fa;
278 }
278 } 279 }
279 }
280 280
281 /deep/.el-table .cell { 281 /deep/.el-table .cell {
282 padding-left: 3px; 282 padding-left: 3px;
283 padding-right: 3px; 283 padding-right: 3px;
284 } 284 }
285 285
286 /deep/.el-radio__label { 286 /deep/.el-radio__label {
287 display: none; 287 display: none;
288 } 288 }
289 </style> 289 </style>
......
1 <template> 1 <template>
2 <lb-table :column="column" :maxHeight="300" heightNumSetting :pagination="false" :key="key" :data="tableData"> 2 <lb-table :column="column" :maxHeight="200" :heightNumSetting="true" :pagination="false" :key="key" :data="tableData">
3 </lb-table> 3 </lb-table>
4 </template> 4 </template>
5 <script> 5 <script>
6 import addQlr from './addQlr.vue' 6 import addQlr from './addQlr.vue'
7 import { mapGetters } from 'vuex' 7 import { mapGetters } from 'vuex'
8 export default { 8 export default {
9 components: { 9 components: {
10 addQlr 10 addQlr
11 }, 11 },
12 computed: { 12 computed: {
13 ...mapGetters(["dictData"]), 13 ...mapGetters(["dictData"]),
14 }, 14 },
15 props: { 15 props: {
16 tableData: { 16 tableData: {
17 type: Array, 17 type: Array,
18 default: function () { 18 default: function () {
19 return [] 19 return []
20 }
21 },
22 gyfs: {
23 type: String,
24 default: '1'
20 } 25 }
21 }, 26 },
22 gyfs: { 27 data () {
23 type: String, 28 return {
24 default: '1' 29 key: 0,
25 } 30 dataIndex: 0,
26 }, 31 dialog: false,
27 data () { 32 details: {},
28 return { 33 tableDataList: [],
29 key: 0, 34 qlrCommonTable: [
30 dataIndex: 0, 35 {
31 dialog: false, 36 label: '序号',
32 details: {}, 37 type: 'index',
33 tableDataList: [], 38 width: '50',
34 qlrCommonTable: [ 39 render: (h, scope) => {
35 { 40 return (
36 label: '序号', 41 <div>
37 type: 'index', 42 {scope.$index + 1}
38 width: '50', 43 </div>
39 render: (h, scope) => { 44 )
40 return ( 45 }
41 <div> 46 },
42 {scope.$index + 1} 47 {
43 </div> 48 prop: "qllxmc",
44 ) 49 label: "权利类型"
50 },
51 {
52 prop: "bdcqzh",
53 label: "不动产权证号"
54 },
55 {
56 prop: "qlrmc",
57 label: "权利人"
58 },
59 {
60 prop: "ytmc",
61 label: "用途"
62 },
63 {
64 prop: "mj",
65 label: "面积"
66 },
67 {
68 prop: "zl",
69 label: "坐落"
70 },
71 ],
72 column: this.qlrCommonTable
73 }
74 },
75 watch: {
76 tableData: {
77 handler: function (val, oldVal) {
78 let that = this
79 if (val.length == 0 || !val) {
80 that.tableDataList = _.cloneDeep([{
81 sqrmc: '',
82 dlrzjlx: '',
83 dlrzjh: '',
84 fr: ''
85 }])
86 } else {
87 that.tableDataList = _.cloneDeep(val)
45 } 88 }
46 }, 89 },
47 { 90 immediate: true,
48 prop: "qllxmc", 91 deep: true
49 label: "权利类型"
50 },
51 {
52 prop: "bdcqzh",
53 label: "不动产权证号"
54 },
55 {
56 prop: "qlrmc",
57 label: "权利人"
58 },
59 {
60 prop: "ytmc",
61 label: "用途"
62 },
63 {
64 prop: "mj",
65 label: "面积"
66 },
67 {
68 prop: "zl",
69 label: "坐落"
70 },
71 ],
72 column: this.qlrCommonTable
73 }
74 },
75 watch: {
76 tableData: {
77 handler: function (val, oldVal) {
78 let that = this
79 if (val.length == 0 || !val) {
80 that.tableDataList = _.cloneDeep([{
81 sqrmc: '',
82 dlrzjlx: '',
83 dlrzjh: '',
84 fr: ''
85 }])
86 } else {
87 that.tableDataList = _.cloneDeep(val)
88 }
89 }, 92 },
90 immediate: true, 93 gyfs: {
91 deep: true 94 handler (newVal, oldValue) {
95 let dataList = _.cloneDeep(this.qlrCommonTable)
96 if (newVal == '1') {
97 this.column = _.cloneDeep(dataList).slice(1, dataList.length)
98 } else if ((newVal == '2')) {
99 this.column = dataList
100 } else {
101 this.column = _.cloneDeep(dataList)
102 this.column.splice(
103 2, 0, {
104 prop: "fs",
105 label: "份数"
106 })
107 }
108 },
109 immediate: true
110 }
92 }, 111 },
93 gyfs: { 112 methods: {
94 handler (newVal, oldValue) {
95 let dataList = _.cloneDeep(this.qlrCommonTable)
96 if (newVal == '1') {
97 this.column = _.cloneDeep(dataList).slice(1, dataList.length)
98 } else if ((newVal == '2')) {
99 this.column = dataList
100 } else {
101 this.column = _.cloneDeep(dataList)
102 this.column.splice(
103 2, 0, {
104 prop: "fs",
105 label: "份数"
106 })
107 }
108 },
109 immediate: true
110 } 113 }
111 },
112 methods: {
113 } 114 }
114 }
115 </script> 115 </script>
116 <style scoped lang='scss'> 116 <style scoped lang='scss'>
117
118 </style> 117 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -154,75 +154,75 @@ ...@@ -154,75 +154,75 @@
154 </div> 154 </div>
155 </template> 155 </template>
156 <script> 156 <script>
157 import cfBdcdyTable from "@/views/workflow/components/cfBdcdyTable"; 157 import cfBdcdyTable from "@/views/workflow/components/cfBdcdyTable";
158 import { BatchInit, batchSaveData } from "@/api/workflow/cfdjFlow.js"; 158 import { BatchInit, batchSaveData } from "@/api/workflow/cfdjFlow.js";
159 import { mapGetters } from "vuex"; 159 import { mapGetters } from "vuex";
160 export default { 160 export default {
161 data () { 161 data () {
162 return { 162 return {
163 disabled: true, 163 disabled: true,
164 flagTop: this.flag ? "top" : "", 164 flagTop: this.flag ? "top" : "",
165 rules: {}, 165 rules: {},
166 //传递参数 166 //传递参数
167 propsParam: {}, 167 propsParam: {},
168 //页面数据 168 //页面数据
169 ruleForm: {}, 169 ruleForm: {
170 isJfOperation: false, 170 slywxx: {},
171 tableData: [] 171 cfdj: {},
172 }; 172 },
173 }, 173 isJfOperation: false,
174 created () { 174 tableData: []
175 this.propsParam = this.$attrs; 175 };
176 var formdata = new FormData(); 176 },
177 if (this.propsParam.djlx == '400') { 177 created () {
178 this.isJfOperation = true; 178 this.propsParam = this.$attrs;
179 } 179 var formdata = new FormData();
180 formdata.append("bsmSlsq", this.$route.query.bsmSlsq); 180 if (this.propsParam.djlx == '400') {
181 formdata.append("djlx", this.propsParam.djlx); 181 this.isJfOperation = true;
182 BatchInit(formdata).then((res) => {
183 if (res.code === 200 && res.result) {
184 this.ruleForm = res.result
185 } 182 }
186 }); 183 formdata.append("bsmSlsq", this.$route.query.bsmSlsq);
187 }, 184 formdata.append("djlx", this.propsParam.djlx);
188 watch: { 185 BatchInit(formdata).then((res) => {
189 186 if (res.code === 200 && res.result) {
190 }, 187 this.ruleForm = res.result
191 components: { cfBdcdyTable }, 188 }
192 props: { 189 })
193 flag: {
194 type: Boolean,
195 default: false,
196 }, 190 },
197 fetch: { 191 components: { cfBdcdyTable },
198 type: Boolean, 192 props: {
199 default: false, 193 flag: {
194 type: Boolean,
195 default: false,
196 },
197 fetch: {
198 type: Boolean,
199 default: false,
200 },
201 },
202 computed: {
203 ...mapGetters(["dictData"]),
200 }, 204 },
201 },
202 computed: {
203 ...mapGetters(["dictData"]),
204 },
205 205
206 methods: { 206 methods: {
207 onSubmit () { 207 onSubmit () {
208 this.ruleForm.bsmSlsq = this.$route.query.bsmSlsq; 208 this.ruleForm.bsmSlsq = this.$route.query.bsmSlsq;
209 batchSaveData(this.ruleForm).then((res) => { 209 batchSaveData(this.ruleForm).then((res) => {
210 if (res.code === 200) { 210 if (res.code === 200) {
211 this.$message.success('保存成功'); 211 this.$message.success('保存成功');
212 } 212 }
213 }); 213 });
214 },
215 changeCflx (e) {
216 let cflxItem = {}
217 cflxItem = this.dictData['A32'].find((item) => {
218 return item.dcode == e
219 })
220 this.ruleForm.cfdj.cflxmc = cflxItem.dname;
221 }
214 }, 222 },
215 changeCflx (e) { 223 };
216 let cflxItem = {}
217 cflxItem = this.dictData['A32'].find((item) => {
218 return item.dcode == e
219 })
220 this.ruleForm.cfdj.cflxmc = cflxItem.dname;
221 }
222 },
223 };
224 </script> 224 </script>
225 <style scoped lang='scss'> 225 <style scoped lang='scss'>
226 @import "~@/styles/public.scss"; 226 @import "~@/styles/public.scss";
227 @import "~@/styles/slxx/slxx.scss"; 227 @import "~@/styles/slxx/slxx.scss";
228 </style> 228 </style>
...\ No newline at end of file ...\ No newline at end of file
......