1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
| <template>
| <div class='editable-cell'>
| <div v-if='editable' class='editable-cell-input-wrapper'>
| <a-input :value='value' @change='handleChange' @pressEnter='check' />
| <a-icon
| class='editable-cell-icon-check'
| type='check'
| @click='check'
| />
| </div>
| <div v-else class='editable-cell-text-wrapper'>
| {{ value || ' ' }}
| <a-icon class='editable-cell-icon' type='edit' @click='edit' />
| </div>
| </div>
| </template>
|
| <script>
| import EquipmentModel from './EquipmentModel'
| import { JeecgListMixin } from '@/mixins/JeecgListMixin'
| import JDictSelectTag from '@/components/dict/JDictSelectTag'
| import JInput from '@/components/jeecg/JInput'
| import JEllipsis from '@/components/jeecg/JEllipsis'
|
| export default {
| props: {
| text: String
| },
| name: 'Equipment',
| mixins: [JeecgListMixin],
| components: {
| EquipmentModel,
| JDictSelectTag,
| JInput,
| JEllipsis
| },
| data() {
| return {
| value: this.text,
| editable: false
| }
| },
| watch: {
| projectId: {
| handler(newVal, oldVal) {
| this.loadData()
| this.projectClassify = newVal
| }
| }
| },
| methods: {
| handleChange(e) {
| const value = e.target.value
| this.value = value
| },
| check() {
| this.editable = false
| this.$emit('change', this.value)
| },
| edit() {
| this.editable = true
| }
| }
| }
| </script>
| <style>
| @import '~@assets/less/common.less';
|
| </style>
|
|