imatrix-ui 0.2.4-up → 0.2.5-up

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,117 +1,117 @@
1
1
  <template>
2
- <div>
3
- <search-form
4
- v-if="hasLoadedColumns"
5
- v-show="showSearch"
6
- ref="sf"
7
- :columns="columns"
8
- :code="code"
9
- :url="url"
10
- :pagination="pagination"
11
- :query="query"
12
- :search-param="searchFormContent"
13
- :init-search-props="initSearchProps"
14
- :grid-id="gridId"
15
- @search="search"
16
- @reset="resetSearch"
17
- />
18
- <div class="nine-grid-area">
19
- <div
20
- :id="gridId"
21
- :style="'height:' + height + 'px;overflow-y: auto;overflow-x: hidden;'"
22
- >
23
- <el-row :gutter="24">
24
- <el-col
25
- v-if="isHasCreate"
26
- id="_addCardId_"
27
- v-permission="createPermission"
28
- :span="colSpan"
29
- >
30
- <el-card
31
- :body-style="{ padding: '0px' }"
32
- style="
2
+ <div>
3
+ <search-form
4
+ v-if="hasLoadedColumns"
5
+ v-show="showSearch"
6
+ ref="sf"
7
+ :code="code"
8
+ :columns="columns"
9
+ :grid-id="gridId"
10
+ :init-search-props="initSearchProps"
11
+ :pagination="pagination"
12
+ :query="query"
13
+ :search-param="searchFormContent"
14
+ :url="url"
15
+ @reset="resetSearch"
16
+ @search="search"
17
+ />
18
+ <div class="nine-grid-area">
19
+ <div
20
+ :id="gridId"
21
+ :style="'height:' + height + 'px;overflow-y: auto;overflow-x: hidden;'"
22
+ >
23
+ <el-row :gutter="24">
24
+ <el-col
25
+ v-if="isHasCreate"
26
+ id="_addCardId_"
27
+ v-permission="createPermission"
28
+ :span="colSpan"
29
+ >
30
+ <el-card
31
+ :body-style="{ padding: '0px' }"
32
+ style="
33
33
  border-radius: 4px;
34
34
  background: #ffffff;
35
35
  border: 1px solid #e5e8ef;
36
36
  "
37
- >
38
- <div class="add-screen" @click="add">
39
- <em class="el-icon-plus" />
40
- <span style="margin-top: 7px">
37
+ >
38
+ <div class="add-screen" @click="add">
39
+ <em class="el-icon-plus"/>
40
+ <span style="margin-top: 7px">
41
41
  {{ $t('superNineGrid.add') }}</span
42
- >
43
- </div>
44
- </el-card>
45
- </el-col>
46
- <el-col
47
- v-for="(params, index) in gridData"
48
- :key="params.id"
49
- :span="colSpan"
50
- >
51
- <el-card
52
- :body-style="{ padding: '0px' }"
53
- :style="{
42
+ >
43
+ </div>
44
+ </el-card>
45
+ </el-col>
46
+ <el-col
47
+ v-for="(params, index) in gridData"
48
+ :key="params.id"
49
+ :span="colSpan"
50
+ >
51
+ <el-card
52
+ :body-style="{ padding: '0px' }"
53
+ :style="{
54
54
  border:
55
55
  selectionIds.indexOf(params.id) > -1
56
56
  ? '1px solid #005EBA'
57
57
  : '',
58
58
  }"
59
- shadow="hover"
60
- >
61
- <div
62
- style="height: 160px"
63
- @mouseenter="enter(index)"
64
- @mouseleave="leave()"
65
- @click="clickContent(params)"
66
- >
67
- <!-- <transition name="fade">
68
- <div v-if="seen && index === current" class="popContainer">
69
- <div class="else-button">
70
- <template v-for="button in operations">
71
- <template v-if="isShowButton(params, button)">
72
- <el-tooltip v-if="button.icon" :key="button.name" v-permission="button.permission?button.permission:'true'" class="item" effect="dark" :content="button.name" placement="top">
73
- <em :class="button.icon +' icons'" @click.stop="buttonClick(button.event, params)" />
74
- </el-tooltip>
75
- <em v-else :key="button.name" v-permission="button.permission?button.permission:'true'" :class="button.name +' icons'" @click.stop="buttonClick(button.event, params)">{{ button.name }} </em>
76
- </template>
77
- </template>
78
- </div>
79
- </div>
80
- </transition> -->
81
- <!-- <img v-if="props && props.imageUrl && objectPropValue(params, propCloumns.imageUrl, props.imageUrl)" :src="defaultShowImageAction+objectPropValue(params, propCloumns.imageUrl, props.imageUrl)" alt="加载失败" class="image"> -->
82
- <!-- <img v-if="true || (props && props.imageUrl)" :src="defaultShowImageAction+'fa7ae05e-0f0e-4cc0-b24a-69aea4408233'" alt="加载失败" class="image"> -->
83
- <!-- <div v-else class="image" style="padding: 20px; text-align: center;"> -->
84
- <div
85
- class="image"
86
- style="padding: 15px; box-sizing: border-box"
87
- >
88
- <div>
89
- <el-tooltip
90
- effect="dark"
91
- :content="'系统编码:' + params.code"
92
- placement="top-start"
93
- >
94
- <div
95
- v-if="props && props.content"
96
- style="display: inline-block"
97
- >
98
- {{
99
- getPropValue('content', params) +
100
- getLength(params.code)
101
- }}
102
- </div>
103
- <div
104
- v-else-if="props && props.title"
105
- style="display: inline-block"
106
- >
107
- {{
108
- getPropValue('title', params) + getLength(params.code)
109
- }}
110
- </div>
111
- </el-tooltip>
112
- <div
113
- v-if="showEnableButton(params)"
114
- style="
59
+ shadow="hover"
60
+ >
61
+ <div
62
+ style="height: 160px"
63
+ @click="clickContent(params)"
64
+ @mouseenter="enter(index)"
65
+ @mouseleave="leave()"
66
+ >
67
+ <!-- <transition name="fade">
68
+ <div v-if="seen && index === current" class="popContainer">
69
+ <div class="else-button">
70
+ <template v-for="button in operations">
71
+ <template v-if="isShowButton(params, button)">
72
+ <el-tooltip v-if="button.icon" :key="button.name" v-permission="button.permission?button.permission:'true'" class="item" effect="dark" :content="button.name" placement="top">
73
+ <em :class="button.icon +' icons'" @click.stop="buttonClick(button.event, params)" />
74
+ </el-tooltip>
75
+ <em v-else :key="button.name" v-permission="button.permission?button.permission:'true'" :class="button.name +' icons'" @click.stop="buttonClick(button.event, params)">{{ button.name }} </em>
76
+ </template>
77
+ </template>
78
+ </div>
79
+ </div>
80
+ </transition> -->
81
+ <!-- <img v-if="props && props.imageUrl && objectPropValue(params, propCloumns.imageUrl, props.imageUrl)" :src="defaultShowImageAction+objectPropValue(params, propCloumns.imageUrl, props.imageUrl)" alt="加载失败" class="image"> -->
82
+ <!-- <img v-if="true || (props && props.imageUrl)" :src="defaultShowImageAction+'fa7ae05e-0f0e-4cc0-b24a-69aea4408233'" alt="加载失败" class="image"> -->
83
+ <!-- <div v-else class="image" style="padding: 20px; text-align: center;"> -->
84
+ <div
85
+ class="image"
86
+ style="padding: 15px; box-sizing: border-box"
87
+ >
88
+ <div>
89
+ <el-tooltip
90
+ :content="'系统编码:' + params.code"
91
+ effect="dark"
92
+ placement="top-start"
93
+ >
94
+ <div
95
+ v-if="props && props.content"
96
+ style="display: inline-block"
97
+ >
98
+ {{
99
+ getPropValue('content', params) +
100
+ getLength(params.code)
101
+ }}
102
+ </div>
103
+ <div
104
+ v-else-if="props && props.title"
105
+ style="display: inline-block"
106
+ >
107
+ {{
108
+ getPropValue('title', params) + getLength(params.code)
109
+ }}
110
+ </div>
111
+ </el-tooltip>
112
+ <div
113
+ v-if="showEnableButton(params)"
114
+ style="
115
115
  margin-left: 2px;
116
116
  color: #00b42a;
117
117
  background-color: #e8ffea;
@@ -119,1051 +119,1070 @@
119
119
  text-align: center;
120
120
  display: inline-block;
121
121
  "
122
- >
123
- <el-icon><SuccessFilled /></el-icon>
124
- <span
125
- :title="getPropValue('subTitle', params)"
126
- style="margin-left: 4px"
127
- >{{ getPropValue('subTitle', params) }}</span
128
- >
129
- </div>
130
- </div>
131
- <div class="button-style">
132
- 操作
133
- <template v-for="button in operations">
134
- <template v-if="isShowButton(params, button)">
135
- <el-tooltip
136
- v-if="button.icon"
137
- v-permission="
122
+ >
123
+ <el-icon>
124
+ <SuccessFilled/>
125
+ </el-icon>
126
+ <span
127
+ :title="getPropValue('subTitle', params)"
128
+ style="margin-left: 4px"
129
+ >{{ getPropValue('subTitle', params) }}</span
130
+ >
131
+ </div>
132
+ </div>
133
+ <div class="button-style">
134
+ 操作
135
+ <template v-for="button in operations">
136
+ <template v-if="isShowButton(params, button)">
137
+ <el-tooltip
138
+ v-if="button.icon"
139
+ v-permission="
138
140
  button.permission ? button.permission : 'true'
139
141
  "
140
- :content="button.name"
141
- class="item"
142
- effect="dark"
143
- placement="top"
144
- >
145
- <el-icon @click.stop="buttonClick(button.event, params)"><component :is="button.icon"/></el-icon>
146
- <!-- <em
147
- :class="button.icon + ' icons'"
148
- @click.stop="buttonClick(button.event, params)"
149
- />
150
- <el-icon><component :is="button.icon"/></el-icon> -->
151
- </el-tooltip>
152
- <em
153
- v-else
154
- v-permission="
142
+ :content="button.name"
143
+ class="item"
144
+ effect="dark"
145
+ placement="top"
146
+ style="background-color: red"
147
+ >
148
+ <el-icon :class="button.icon + ' icons'" @click.stop="buttonClick(button.event, params)">
149
+ <component :is="button.icon"/>
150
+ </el-icon>
151
+ </el-tooltip>
152
+ <em
153
+ v-else
154
+ v-permission="
155
155
  button.permission ? button.permission : 'true'
156
156
  "
157
- :class="button.name + ' icons'"
158
- @click.stop="buttonClick(button.event, params)"
159
- >{{ button.name }}
160
- </em>
161
- </template>
162
- </template>
163
- </div>
164
- <div
165
- v-if="isShowEnableState"
166
- style="float: right; margin-top: 28px"
167
- >
168
- <el-button
169
- v-if="showEnableButton(params)"
170
- size="mini"
171
- @click.stop="changeState(params)"
172
- >
173
- 禁用
174
- </el-button>
175
- <el-button
176
- v-else
177
- size="mini"
178
- type="primary"
179
- @click.stop="changeState(params)"
180
- >
181
- 启用
182
- </el-button>
183
- </div>
184
- </div>
185
- </div>
186
- <!-- <el-divider />
187
- <div style="padding: 10px 10px 10px 10px;">
188
- <div class="bottom clearfix">
189
- <time class="name">
190
- <span v-if="props && props.title">
191
- <el-checkbox v-if="multiple" :value="selectionModels['select'+params.id]" :true-label="params.id" :false-label="'false-'+params.id" :title="getPropValue('title', params)" style="width: 100%" @change="changeChecked($event, index)">
192
- {{ getPropValue('title', params) }}
193
- <span :style="getTitleStyle(params)"> {{ getPropValue('title', params) }}</span>
194
- </el-checkbox>
195
- <el-radio v-else-if="isShowRadio" v-model="currentId" :label="params.id" :title="getPropValue('title', params)" style="width: 100%" @change="changeSelectWhenRadio($event, index)">
196
- {{ getPropValue('title', params) }}
197
- <span :style="getTitleStyle(params)"> {{ getPropValue('title', params) }}</span>
198
- </el-radio>
199
- <span v-else :style="getTitleStyle(params)" :title="getPropValue('title', params)"> {{ getPropValue('title', params) }}</span>
200
- </span>
201
- <span v-else-if="props && props.content">
202
- <el-checkbox v-if="multiple" :value="selectionModels['select'+params.id]" :true-label="params.id" :false-label="'false-'+params.id" :title="getPropValue('content', params)" style="width: 100%" @change="changeChecked($event, index)">{{ getPropValue('content', params) }}</el-checkbox>
203
- <el-radio v-else-if="isShowRadio" v-model="currentId" :label="params.id" :title="getPropValue('content', params)" style="width: 100%" @change="changeSelectWhenRadio($event, index)">{{ getPropValue('content', params) }}</el-radio>
204
- <span v-else :title="getPropValue('content', params)" style="width: 100%"> {{ getPropValue('content', params) }}</span>
205
- </span>
206
- <span v-else>
207
- <el-checkbox v-if="multiple" :value="selectionModels['select'+params.id]" :true-label="params.id" :false-label="'false-'+params.id" @change="changeChecked($event, index)">{{ index + 1 }}</el-checkbox>
208
- <el-radio v-else-if="isShowRadio" v-model="currentId" :label="params.id" @change="changeSelectWhenRadio($event, index)">{{ index + 1 }}</el-radio>
209
- <span v-else> {{ index + 1 }}</span>
210
- </span>
211
- </time>
212
- <time v-if="props && props.subTitle" class="state">
213
- <span :title="getPropValue('subTitle', params)" style="width: 100%">{{ getPropValue('subTitle', params) }}</span>
214
- </time>
215
- </div>
216
- </div> -->
217
- </el-card>
218
- </el-col>
219
- </el-row>
220
- </div>
221
- <el-pagination
222
- v-if="pagination"
223
- v-model:current-page="currentPage"
224
- :page-sizes="pagination.pageSizes"
225
- :page-size="pagination.pageSize"
226
- :layout="pagination.layout"
227
- :total="pagination.total"
228
- @size-change="handleSizeChange"
229
- @current-change="handleCurrentChange"
230
- />
231
- </div>
232
- </div>
157
+ :class="button.name + ' icons'"
158
+ @click.stop="buttonClick(button.event, params)"
159
+ >{{ button.name }}
160
+ </em>
161
+ </template>
162
+ </template>
163
+ </div>
164
+ <div
165
+ v-if="isShowEnableState"
166
+ style="float: right; margin-top: 28px"
167
+ >
168
+ <el-button
169
+ v-if="showEnableButton(params)"
170
+ size="mini"
171
+ @click.stop="changeState(params)"
172
+ >
173
+ 禁用
174
+ </el-button>
175
+ <el-button
176
+ v-else
177
+ size="mini"
178
+ type="primary"
179
+ @click.stop="changeState(params)"
180
+ >
181
+ 启用
182
+ </el-button>
183
+ </div>
184
+ </div>
185
+ </div>
186
+ <!-- <el-divider />
187
+ <div style="padding: 10px 10px 10px 10px;">
188
+ <div class="bottom clearfix">
189
+ <time class="name">
190
+ <span v-if="props && props.title">
191
+ <el-checkbox v-if="multiple" :value="selectionModels['select'+params.id]" :true-label="params.id" :false-label="'false-'+params.id" :title="getPropValue('title', params)" style="width: 100%" @change="changeChecked($event, index)">
192
+ {{ getPropValue('title', params) }}
193
+ <span :style="getTitleStyle(params)"> {{ getPropValue('title', params) }}</span>
194
+ </el-checkbox>
195
+ <el-radio v-else-if="isShowRadio" v-model="currentId" :label="params.id" :title="getPropValue('title', params)" style="width: 100%" @change="changeSelectWhenRadio($event, index)">
196
+ {{ getPropValue('title', params) }}
197
+ <span :style="getTitleStyle(params)"> {{ getPropValue('title', params) }}</span>
198
+ </el-radio>
199
+ <span v-else :style="getTitleStyle(params)" :title="getPropValue('title', params)"> {{ getPropValue('title', params) }}</span>
200
+ </span>
201
+ <span v-else-if="props && props.content">
202
+ <el-checkbox v-if="multiple" :value="selectionModels['select'+params.id]" :true-label="params.id" :false-label="'false-'+params.id" :title="getPropValue('content', params)" style="width: 100%" @change="changeChecked($event, index)">{{ getPropValue('content', params) }}</el-checkbox>
203
+ <el-radio v-else-if="isShowRadio" v-model="currentId" :label="params.id" :title="getPropValue('content', params)" style="width: 100%" @change="changeSelectWhenRadio($event, index)">{{ getPropValue('content', params) }}</el-radio>
204
+ <span v-else :title="getPropValue('content', params)" style="width: 100%"> {{ getPropValue('content', params) }}</span>
205
+ </span>
206
+ <span v-else>
207
+ <el-checkbox v-if="multiple" :value="selectionModels['select'+params.id]" :true-label="params.id" :false-label="'false-'+params.id" @change="changeChecked($event, index)">{{ index + 1 }}</el-checkbox>
208
+ <el-radio v-else-if="isShowRadio" v-model="currentId" :label="params.id" @change="changeSelectWhenRadio($event, index)">{{ index + 1 }}</el-radio>
209
+ <span v-else> {{ index + 1 }}</span>
210
+ </span>
211
+ </time>
212
+ <time v-if="props && props.subTitle" class="state">
213
+ <span :title="getPropValue('subTitle', params)" style="width: 100%">{{ getPropValue('subTitle', params) }}</span>
214
+ </time>
215
+ </div>
216
+ </div> -->
217
+ </el-card>
218
+ </el-col>
219
+ </el-row>
220
+ </div>
221
+ <el-pagination
222
+ v-if="pagination"
223
+ v-model:current-page="currentPage"
224
+ :layout="pagination.layout"
225
+ :page-size="pagination.pageSize"
226
+ :page-sizes="pagination.pageSizes"
227
+ :total="pagination.total"
228
+ @size-change="handleSizeChange"
229
+ @current-change="handleCurrentChange"
230
+ />
231
+ </div>
232
+ </div>
233
233
  </template>
234
234
 
235
235
  <script>
236
- import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
236
+ import {$emit} from '../../utils/gogocodeTransfer'
237
237
  import customFormatter from './custom-formatter'
238
238
  import SearchForm from './search-form.vue'
239
- import { getGridParams, getTableHeight, isHasOptionFunction } from './utils'
239
+ import {addDynamicProp, getGridParams, getTableHeight, isHasOptionFunction} from './utils'
240
240
  import store from './store'
241
241
  import superGridService from './super-grid-service'
242
242
  import apis from './apis'
243
243
  import Sortable from 'sortablejs'
244
- import { addDynamicProp } from './utils'
245
- import * as Vue from 'vue'
244
+
246
245
  export default {
247
- name: 'SuperNineGrid',
248
- components: {
249
- SearchForm,
250
- },
251
- props: {
252
- code: {
253
- type: String,
254
- default: '',
255
- },
256
- url: {
257
- type: String,
258
- default: '',
259
- },
260
- options: {
261
- type: Object,
262
- default: function () {
263
- return {}
264
- },
265
- },
266
- },
267
- data() {
268
- let mergeFields = []
269
- if (
270
- this.options &&
271
- this.options.mergeFields &&
272
- this.options.mergeFields !== ''
273
- ) {
274
- mergeFields = this.options.mergeFields.split(',')
275
- }
276
- const defaultShowImageAction =
277
- window.$vueApp.config.globalProperties.baseAPI +
278
- '/component/super-form/show-image?serverPath='
279
- const gridId =
280
- this.options && this.options.id ? this.options.id : '_nineGrid'
281
- const storeId = this.code + '~' + gridId
282
- const isShowRadio =
283
- this.options && this.options.showRadio !== undefined
284
- ? this.options.showRadio
285
- : false
286
- return {
287
- isLoading: false,
288
- currentPage: 1,
289
- showColumnConfig: false,
290
- basicInfo: {
291
- summary: 'no',
292
- },
293
- columns: [],
294
- pagination: null,
295
- query: null,
296
- lineEdit: null,
297
- gridData: [],
298
- sortInfo: null,
299
- pageSize: null,
300
- showSearch: false,
301
- height: null,
302
- isSql: false, // 是否是sql查询
303
- hasLoadData: false,
304
- mergeFields,
305
- hasLoadedColumns: false, // 是否已经加载了列配置
306
- seen: false,
307
- current: null,
308
- isHasCreate: true, // 是否需要新建按钮
309
- screenBaseUrl: null,
310
- props: null, // 属性配置
311
- operations: [], // 指向格子时出现的操作按钮集合
312
- propCloumns: null, // 属性字段配置详细信息
313
- multiple: false, // 是否需要多选
314
- createPermission: 'true', // 新建权限编码,默认是有权限的
315
- urlToSaveOrder: null, // 拖动格子后台保存接口路径
316
- selections: [], // 选中的记录集合
317
- selectionIds: [], // 选中的记录id集合
318
- selectionModels: {}, // 选中的记录对象
319
- searchFormContent: null,
320
- initSearchProps: [], // 初始查询的字段属性名集合
321
- defaultShowImageAction, // 显示图片的路径
322
- gridId,
323
- storeId,
324
- currentId: null, // 当前点击的记录id
325
- isShowRadio, // 单选时是否显示单选按钮
326
- titleStyle: null, // 标题的样式对象,格式为:{ color: 'green', fontWeight: 'bold'}
327
- isShowEnableState: false,
328
- colSpan: 6,
329
- }
330
- },
331
- computed: {},
332
- provide() {
333
- return {}
334
- },
335
- created() {
336
- store.set(this.code + '~' + this.gridId, getGridParams())
337
- store.set('_nine_list_code', this.code + '~' + this.gridId)
338
- this.initSetting()
339
- this.initialize()
340
- // this.showDemo()
341
- },
342
- mounted() {
343
- this.$watch(
344
- 'showSearch',
345
- function (newVal, oldVal) {
346
- this.$nextTick(() => {
347
- let tableHeight = getTableHeight(newVal, this.$refs.sf)
348
- const newHeight = this.resizeHeight()
349
- if (newHeight) {
350
- tableHeight = newHeight
351
- }
352
- this.height = tableHeight
353
- })
354
- },
355
- {
356
- immediate: true,
357
- deep: true,
358
- }
359
- )
246
+ name: 'SuperNineGrid',
247
+ components: {
248
+ SearchForm,
249
+ },
250
+ props: {
251
+ code: {
252
+ type: String,
253
+ default: '',
254
+ },
255
+ url: {
256
+ type: String,
257
+ default: '',
258
+ },
259
+ options: {
260
+ type: Object,
261
+ default: function () {
262
+ return {}
263
+ },
264
+ },
265
+ },
266
+ data() {
267
+ let mergeFields = []
268
+ if (
269
+ this.options &&
270
+ this.options.mergeFields &&
271
+ this.options.mergeFields !== ''
272
+ ) {
273
+ mergeFields = this.options.mergeFields.split(',')
274
+ }
275
+ const defaultShowImageAction =
276
+ window.$vueApp.config.globalProperties.baseAPI +
277
+ '/component/super-form/show-image?serverPath='
278
+ const gridId =
279
+ this.options && this.options.id ? this.options.id : '_nineGrid'
280
+ const storeId = this.code + '~' + gridId
281
+ const isShowRadio =
282
+ this.options && this.options.showRadio !== undefined
283
+ ? this.options.showRadio
284
+ : false
285
+ return {
286
+ isLoading: false,
287
+ currentPage: 1,
288
+ showColumnConfig: false,
289
+ basicInfo: {
290
+ summary: 'no',
291
+ },
292
+ columns: [],
293
+ pagination: null,
294
+ query: null,
295
+ lineEdit: null,
296
+ gridData: [],
297
+ sortInfo: null,
298
+ pageSize: null,
299
+ showSearch: false,
300
+ height: null,
301
+ isSql: false, // 是否是sql查询
302
+ hasLoadData: false,
303
+ mergeFields,
304
+ hasLoadedColumns: false, // 是否已经加载了列配置
305
+ seen: false,
306
+ current: null,
307
+ isHasCreate: true, // 是否需要新建按钮
308
+ screenBaseUrl: null,
309
+ props: null, // 属性配置
310
+ operations: [], // 指向格子时出现的操作按钮集合
311
+ propCloumns: null, // 属性字段配置详细信息
312
+ multiple: false, // 是否需要多选
313
+ createPermission: 'true', // 新建权限编码,默认是有权限的
314
+ urlToSaveOrder: null, // 拖动格子后台保存接口路径
315
+ selections: [], // 选中的记录集合
316
+ selectionIds: [], // 选中的记录id集合
317
+ selectionModels: {}, // 选中的记录对象
318
+ searchFormContent: null,
319
+ initSearchProps: [], // 初始查询的字段属性名集合
320
+ defaultShowImageAction, // 显示图片的路径
321
+ gridId,
322
+ storeId,
323
+ currentId: null, // 当前点击的记录id
324
+ isShowRadio, // 单选时是否显示单选按钮
325
+ titleStyle: null, // 标题的样式对象,格式为:{ color: 'green', fontWeight: 'bold'}
326
+ isShowEnableState: false,
327
+ colSpan: 6,
328
+ }
329
+ },
330
+ computed: {},
331
+ provide() {
332
+ return {}
333
+ },
334
+ created() {
335
+ store.set(this.code + '~' + this.gridId, getGridParams())
336
+ store.set('_nine_list_code', this.code + '~' + this.gridId)
337
+ this.initSetting()
338
+ this.initialize()
339
+ // this.showDemo()
340
+ console.log('%c描述-232041', 'color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px', this.operations);
341
+ },
342
+ mounted() {
343
+ this.$watch(
344
+ 'showSearch',
345
+ function (newVal, oldVal) {
346
+ this.$nextTick(() => {
347
+ let tableHeight = getTableHeight(newVal, this.$refs.sf)
348
+ const newHeight = this.resizeHeight()
349
+ if (newHeight) {
350
+ tableHeight = newHeight
351
+ }
352
+ this.height = tableHeight
353
+ })
354
+ },
355
+ {
356
+ immediate: true,
357
+ deep: true,
358
+ }
359
+ )
360
360
 
361
- this.$watch(
362
- 'hasLoadData',
363
- function (newVal, oldVal) {
364
- if (newVal === true) {
365
- this.$nextTick(() => {
366
- this.rowDrop()
367
- const gridParams = store.get(this.storeId)
368
- if (isHasOptionFunction('gridComplete', this.storeId)) {
369
- gridParams.options.gridComplete.call(this, {
370
- gridData: this.gridData,
371
- columns: gridParams.columns,
372
- superGrid: this.$refs.superGrid,
373
- })
374
- }
375
- const newHeight = this.resizeHeight()
376
- if (newHeight) {
377
- this.height = newHeight
378
- }
379
- })
380
- }
381
- },
382
- {
383
- immediate: true,
384
- deep: true,
385
- }
386
- )
387
- },
388
- methods: {
389
- ...superGridService,
390
- ...apis,
391
- ...customFormatter,
392
- getTitleStyle(entity) {
393
- // 九宫格的标题自定义样式
394
- if (this.options && this.options.titleStyle) {
395
- return this.options.titleStyle.call(this, entity)
396
- }
397
- return { width: '100%' }
398
- },
399
- // 获得属性值
400
- getPropValue(type, entity) {
401
- let value = ''
402
- const gridParams = store.get(this.storeId)
403
- if (type === 'content') {
404
- let content = ''
405
- if (isHasOptionFunction('setContent', this.storeId)) {
406
- content = gridParams.options.getContent.call(this, entity)
407
- }
408
- if (content === undefined || content === '') {
409
- if (this.props && this.props.content) {
410
- content = this.objectPropValue(
411
- entity,
412
- this.propCloumns.content,
413
- this.props.content
414
- )
415
- } else if (this.props && this.props.title) {
416
- content = this.objectPropValue(
417
- entity,
418
- this.propCloumns.title,
419
- this.props.title
420
- )
421
- }
422
- }
423
- value = content
424
- } else if (type === 'title') {
425
- let content = ''
426
- if (isHasOptionFunction('setTitle', this.storeId)) {
427
- content = gridParams.options.setTitle.call(this, entity)
428
- }
429
- if (content === undefined || content === '') {
430
- if (this.props && this.props.title) {
431
- content = this.objectPropValue(
432
- entity,
433
- this.propCloumns.title,
434
- this.props.title
435
- )
436
- } else if (this.props && this.props.content) {
437
- content = this.objectPropValue(
438
- entity,
439
- this.propCloumns.content,
440
- this.props.content
441
- )
442
- }
443
- }
444
- value = content
445
- } else if (type === 'subTitle') {
446
- let content = ''
447
- if (isHasOptionFunction('setSubTitle', this.storeId)) {
448
- content = gridParams.options.setSubTitle.call(this, entity)
449
- }
450
- if (content === undefined || content === '') {
451
- if (this.props && this.props.subTitle) {
452
- content = this.objectPropValue(
453
- entity,
454
- this.propCloumns.subTitle,
455
- this.props.subTitle
456
- )
457
- }
458
- }
459
- value = content
460
- }
461
- if (value === undefined) {
462
- value = ''
463
- }
464
- return value
465
- },
466
- resizeHeight() {
467
- const gridParams = store.get(this.storeId)
468
- if (isHasOptionFunction('resizeHeight', this.storeId)) {
469
- let searchHeight = 0
470
- if (this.showSearch === true) {
471
- if (this.$refs.sf) {
472
- // 获得查询区高度
473
- searchHeight = this.$refs.sf.$el.offsetHeight
474
- }
475
- }
476
- return gridParams.options.resizeHeight.call(this, {
477
- code: this.code,
478
- height: this.height,
479
- searchHeight: searchHeight,
480
- })
481
- }
482
- },
483
- enter(index) {
484
- this.seen = true
485
- this.current = index
486
- },
487
- leave() {
488
- this.seen = false
489
- this.current = null
490
- },
491
- initSetting() {
492
- const gridParams = store.get(this.storeId)
493
- if (typeof this.options !== 'undefined') {
494
- Object.assign(gridParams.options, this.options)
495
- } else {
496
- gridParams.options = {}
497
- }
498
- if (this.options && typeof this.options.isHasCreate !== 'undefined') {
499
- this.isHasCreate = this.options.isHasCreate
500
- }
501
- if (this.options && typeof this.options.props !== 'undefined') {
502
- this.props = this.options.props
503
- }
504
- if (this.options && typeof this.options.operations !== 'undefined') {
505
- this.operations = this.options.operations
506
- }
507
- if (
508
- this.options &&
509
- typeof this.options.createPermission !== 'undefined'
510
- ) {
511
- this.createPermission = this.options.createPermission
512
- }
513
- if (this.options && typeof this.options.multiple !== 'undefined') {
514
- this.multiple = this.options.multiple
515
- }
516
- if (
517
- this.options &&
518
- typeof this.options.isShowEnableState !== 'undefined'
519
- ) {
520
- this.isShowEnableState = this.options.isShowEnableState
521
- }
522
- if (this.options && typeof this.options.colSpan !== 'undefined') {
523
- this.colSpan = this.options.colSpan
524
- }
525
- },
526
- // 获得各属性对应的字段配置
527
- getPropColumns() {
528
- if (this.columns && this.columns.length > 0) {
529
- // imageUrl:{column}, content: {column}, title: {}, subTitle:{}
530
- this.propCloumns = {}
531
- this.columns.forEach((column) => {
532
- if (this.props.imageUrl && this.props.imageUrl === column.prop) {
533
- this.propCloumns.imageUrl = column
534
- }
535
- if (this.props.content && this.props.content === column.prop) {
536
- this.propCloumns.content = column
537
- }
538
- if (this.props.title && this.props.title === column.prop) {
539
- this.propCloumns.title = column
540
- }
541
- if (this.props.subTitle && this.props.subTitle === column.prop) {
542
- this.propCloumns.subTitle = column
543
- }
544
- })
545
- }
546
- },
547
- fetchData(searchParam, isSearch) {
548
- return new Promise((resolve, reject) => {
549
- // 获得各属性对应的字段配置
550
- this.getPropColumns()
551
- this.isLoading = true
552
- this.hasLoadData = false
553
- if (isSearch === undefined || isSearch === false) {
554
- // 如果不是查询时才需要从缓存中获得结果
555
- // 如果是刷新当前列表,则需要获得缓存中的window.sessionStorage
556
- const isRefreshList = window.sessionStorage.getItem(
557
- 'refreshList-' + this.storeId
558
- )
559
- // console.log('fetchData--isRefreshList--', isRefreshList)
560
- if (isRefreshList !== undefined && isRefreshList === 'true') {
561
- const searchParamJson = window.sessionStorage.getItem(
562
- 'searchParam-' + this.storeId
563
- )
564
- // console.log('fetchData--searchParamJson--', searchParamJson)
565
- // console.log('fetchData--pagination--', this.pagination)
566
- if (
567
- searchParamJson !== undefined &&
568
- searchParamJson !== null &&
569
- searchParamJson !== ''
570
- ) {
571
- searchParam = JSON.parse(searchParamJson)
572
- const pagination = searchParam.pagination
573
- if (pagination) {
574
- this.currentPage = pagination.currentPage
575
- this.pagination.pageSize = pagination.pageSize
576
- this.pagination.showTotal = pagination.showTotal
577
- }
578
- this.getInitSearchForm(searchParam.searchForm)
579
- // this.searchFormContent = searchParam.searchForm
580
- }
581
- }
582
- }
583
- window.sessionStorage.removeItem('refreshList-' + this.storeId)
584
- if (searchParam === undefined) {
585
- searchParam = this.getSearchParam()
586
- }
587
- const gridParams = store.get(this.storeId)
588
- let param = searchParam
589
- if (gridParams.options.extraParam) {
590
- param = {
591
- searchParam: searchParam,
592
- }
593
- if (gridParams.options.extraParam) {
594
- for (const paramName in gridParams.options.extraParam) {
595
- param[paramName] = gridParams.options.extraParam[paramName]
596
- }
597
- }
598
- }
599
- // 导出需要这两个参数
600
- gridParams.searchParam = searchParam
601
- gridParams.url = this.url
602
- const requestUrl = this.url
603
- // 缓存查询条件及当前页数
604
- window.sessionStorage.setItem(
605
- 'searchParam-' + this.storeId,
606
- JSON.stringify(param)
607
- )
608
- this.$http
609
- .post(requestUrl, param)
610
- .then((data) => {
611
- // 对数据做序列化,比如:处理xss攻击
612
- if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
613
- const gridData = gridParams.options.gridDataLoaded.call(this, {
614
- gridData: data.data,
615
- columns: gridParams.columns,
616
- })
617
- if (gridData) {
618
- this.gridData = gridData
619
- } else {
620
- this.gridData = data.data
621
- }
622
- } else {
623
- this.gridData = data.data
624
- }
625
- if (!this.gridData) {
626
- this.gridData = []
627
- }
361
+ this.$watch(
362
+ 'hasLoadData',
363
+ function (newVal, oldVal) {
364
+ if (newVal === true) {
365
+ this.$nextTick(() => {
366
+ this.rowDrop()
367
+ const gridParams = store.get(this.storeId)
368
+ if (isHasOptionFunction('gridComplete', this.storeId)) {
369
+ gridParams.options.gridComplete.call(this, {
370
+ gridData: this.gridData,
371
+ columns: gridParams.columns,
372
+ superGrid: this.$refs.superGrid,
373
+ })
374
+ }
375
+ const newHeight = this.resizeHeight()
376
+ if (newHeight) {
377
+ this.height = newHeight
378
+ }
379
+ })
380
+ }
381
+ },
382
+ {
383
+ immediate: true,
384
+ deep: true,
385
+ }
386
+ )
387
+ },
388
+ methods: {
389
+ ...superGridService,
390
+ ...apis,
391
+ ...customFormatter,
392
+ getTitleStyle(entity) {
393
+ // 九宫格的标题自定义样式
394
+ if (this.options && this.options.titleStyle) {
395
+ return this.options.titleStyle.call(this, entity)
396
+ }
397
+ return {width: '100%'}
398
+ },
399
+ // 获得属性值
400
+ getPropValue(type, entity) {
401
+ let value = ''
402
+ const gridParams = store.get(this.storeId)
403
+ if (type === 'content') {
404
+ let content = ''
405
+ if (isHasOptionFunction('setContent', this.storeId)) {
406
+ content = gridParams.options.getContent.call(this, entity)
407
+ }
408
+ if (content === undefined || content === '') {
409
+ if (this.props && this.props.content) {
410
+ content = this.objectPropValue(
411
+ entity,
412
+ this.propCloumns.content,
413
+ this.props.content
414
+ )
415
+ } else if (this.props && this.props.title) {
416
+ content = this.objectPropValue(
417
+ entity,
418
+ this.propCloumns.title,
419
+ this.props.title
420
+ )
421
+ }
422
+ }
423
+ value = content
424
+ } else if (type === 'title') {
425
+ let content = ''
426
+ if (isHasOptionFunction('setTitle', this.storeId)) {
427
+ content = gridParams.options.setTitle.call(this, entity)
428
+ }
429
+ if (content === undefined || content === '') {
430
+ if (this.props && this.props.title) {
431
+ content = this.objectPropValue(
432
+ entity,
433
+ this.propCloumns.title,
434
+ this.props.title
435
+ )
436
+ } else if (this.props && this.props.content) {
437
+ content = this.objectPropValue(
438
+ entity,
439
+ this.propCloumns.content,
440
+ this.props.content
441
+ )
442
+ }
443
+ }
444
+ value = content
445
+ } else if (type === 'subTitle') {
446
+ let content = ''
447
+ if (isHasOptionFunction('setSubTitle', this.storeId)) {
448
+ content = gridParams.options.setSubTitle.call(this, entity)
449
+ }
450
+ if (content === undefined || content === '') {
451
+ if (this.props && this.props.subTitle) {
452
+ content = this.objectPropValue(
453
+ entity,
454
+ this.propCloumns.subTitle,
455
+ this.props.subTitle
456
+ )
457
+ }
458
+ }
459
+ value = content
460
+ }
461
+ if (value === undefined) {
462
+ value = ''
463
+ }
464
+ return value
465
+ },
466
+ resizeHeight() {
467
+ const gridParams = store.get(this.storeId)
468
+ if (isHasOptionFunction('resizeHeight', this.storeId)) {
469
+ let searchHeight = 0
470
+ if (this.showSearch === true) {
471
+ if (this.$refs.sf) {
472
+ // 获得查询区高度
473
+ searchHeight = this.$refs.sf.$el.offsetHeight
474
+ }
475
+ }
476
+ return gridParams.options.resizeHeight.call(this, {
477
+ code: this.code,
478
+ height: this.height,
479
+ searchHeight: searchHeight,
480
+ })
481
+ }
482
+ },
483
+ enter(index) {
484
+ this.seen = true
485
+ this.current = index
486
+ },
487
+ leave() {
488
+ this.seen = false
489
+ this.current = null
490
+ },
491
+ initSetting() {
492
+ const gridParams = store.get(this.storeId)
493
+ if (typeof this.options !== 'undefined') {
494
+ Object.assign(gridParams.options, this.options)
495
+ } else {
496
+ gridParams.options = {}
497
+ }
498
+ if (this.options && typeof this.options.isHasCreate !== 'undefined') {
499
+ this.isHasCreate = this.options.isHasCreate
500
+ }
501
+ if (this.options && typeof this.options.props !== 'undefined') {
502
+ this.props = this.options.props
503
+ }
504
+ if (this.options && typeof this.options.operations !== 'undefined') {
505
+ this.operations = this.options.operations
506
+ }
507
+ if (
508
+ this.options &&
509
+ typeof this.options.createPermission !== 'undefined'
510
+ ) {
511
+ this.createPermission = this.options.createPermission
512
+ }
513
+ if (this.options && typeof this.options.multiple !== 'undefined') {
514
+ this.multiple = this.options.multiple
515
+ }
516
+ if (
517
+ this.options &&
518
+ typeof this.options.isShowEnableState !== 'undefined'
519
+ ) {
520
+ this.isShowEnableState = this.options.isShowEnableState
521
+ }
522
+ if (this.options && typeof this.options.colSpan !== 'undefined') {
523
+ this.colSpan = this.options.colSpan
524
+ }
525
+ },
526
+ // 获得各属性对应的字段配置
527
+ getPropColumns() {
528
+ if (this.columns && this.columns.length > 0) {
529
+ // imageUrl:{column}, content: {column}, title: {}, subTitle:{}
530
+ this.propCloumns = {}
531
+ this.columns.forEach((column) => {
532
+ if (this.props.imageUrl && this.props.imageUrl === column.prop) {
533
+ this.propCloumns.imageUrl = column
534
+ }
535
+ if (this.props.content && this.props.content === column.prop) {
536
+ this.propCloumns.content = column
537
+ }
538
+ if (this.props.title && this.props.title === column.prop) {
539
+ this.propCloumns.title = column
540
+ }
541
+ if (this.props.subTitle && this.props.subTitle === column.prop) {
542
+ this.propCloumns.subTitle = column
543
+ }
544
+ })
545
+ }
546
+ },
547
+ fetchData(searchParam, isSearch) {
548
+ return new Promise((resolve, reject) => {
549
+ // 获得各属性对应的字段配置
550
+ this.getPropColumns()
551
+ this.isLoading = true
552
+ this.hasLoadData = false
553
+ if (isSearch === undefined || isSearch === false) {
554
+ // 如果不是查询时才需要从缓存中获得结果
555
+ // 如果是刷新当前列表,则需要获得缓存中的window.sessionStorage
556
+ const isRefreshList = window.sessionStorage.getItem(
557
+ 'refreshList-' + this.storeId
558
+ )
559
+ // console.log('fetchData--isRefreshList--', isRefreshList)
560
+ if (isRefreshList !== undefined && isRefreshList === 'true') {
561
+ const searchParamJson = window.sessionStorage.getItem(
562
+ 'searchParam-' + this.storeId
563
+ )
564
+ // console.log('fetchData--searchParamJson--', searchParamJson)
565
+ // console.log('fetchData--pagination--', this.pagination)
566
+ if (
567
+ searchParamJson !== undefined &&
568
+ searchParamJson !== null &&
569
+ searchParamJson !== ''
570
+ ) {
571
+ searchParam = JSON.parse(searchParamJson)
572
+ const pagination = searchParam.pagination
573
+ if (pagination) {
574
+ this.currentPage = pagination.currentPage
575
+ this.pagination.pageSize = pagination.pageSize
576
+ this.pagination.showTotal = pagination.showTotal
577
+ }
578
+ this.getInitSearchForm(searchParam.searchForm)
579
+ // this.searchFormContent = searchParam.searchForm
580
+ }
581
+ }
582
+ }
583
+ window.sessionStorage.removeItem('refreshList-' + this.storeId)
584
+ if (searchParam === undefined) {
585
+ searchParam = this.getSearchParam()
586
+ }
587
+ const gridParams = store.get(this.storeId)
588
+ let param = searchParam
589
+ if (gridParams.options.extraParam) {
590
+ param = {
591
+ searchParam: searchParam,
592
+ }
593
+ if (gridParams.options.extraParam) {
594
+ for (const paramName in gridParams.options.extraParam) {
595
+ param[paramName] = gridParams.options.extraParam[paramName]
596
+ }
597
+ }
598
+ }
599
+ // 导出需要这两个参数
600
+ gridParams.searchParam = searchParam
601
+ gridParams.url = this.url
602
+ const requestUrl = this.url
603
+ // 缓存查询条件及当前页数
604
+ window.sessionStorage.setItem(
605
+ 'searchParam-' + this.storeId,
606
+ JSON.stringify(param)
607
+ )
608
+ this.$http
609
+ .post(requestUrl, param)
610
+ .then((data) => {
611
+ // 对数据做序列化,比如:处理xss攻击
612
+ if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
613
+ const gridData = gridParams.options.gridDataLoaded.call(this, {
614
+ gridData: data.data,
615
+ columns: gridParams.columns,
616
+ })
617
+ if (gridData) {
618
+ this.gridData = gridData
619
+ } else {
620
+ this.gridData = data.data
621
+ }
622
+ } else {
623
+ this.gridData = data.data
624
+ }
625
+ if (!this.gridData) {
626
+ this.gridData = []
627
+ }
628
628
 
629
- if (this.pagination !== null) {
630
- this.pagination.total = data.total
631
- }
629
+ if (this.pagination !== null) {
630
+ this.pagination.total = data.total
631
+ }
632
632
 
633
- gridParams.gridData = this.gridData
634
- // 完成深拷贝,复制一份对象,行编辑时使用
635
- gridParams.orgGridData = [].concat(
636
- JSON.parse(JSON.stringify(this.gridData))
637
- )
633
+ gridParams.gridData = this.gridData
634
+ // 完成深拷贝,复制一份对象,行编辑时使用
635
+ gridParams.orgGridData = [].concat(
636
+ JSON.parse(JSON.stringify(this.gridData))
637
+ )
638
638
 
639
- gridParams.pagination = this.pagination
640
- gridParams.loaded = true
641
- this.hasLoadData = true
642
- resolve()
643
- })
644
- .catch((error) => {
645
- if (isHasOptionFunction('loadError', this.storeId)) {
646
- gridParams.options.loadError.call(this, this.code, error)
647
- }
648
- reject(error)
649
- })
650
- })
651
- },
652
- getLength(paramsData) {
653
- if (paramsData && paramsData.length > 5) {
654
- return '(' + paramsData.substring(0, 5) + '...' + ')'
655
- } else if (paramsData) {
656
- return '(' + paramsData + ')'
657
- } else {
658
- return ''
659
- }
660
- },
661
- // 获得初始查询条件对象
662
- getInitSearchForm(searchFormArr) {
663
- const gridParams = store.get(this.storeId)
664
- if (searchFormArr && searchFormArr.length > 0) {
665
- this.searchFormContent = {}
666
- searchFormArr.forEach((item) => {
667
- // 获得的是"isDeleted"
668
- let prop = item.propName
669
- // 获得的是“deleted”
670
- const columnProp = item.columnProp
671
- const dataType = item.dataType
672
- if (dataType && dataType === 'BOOLEAN') {
673
- prop = columnProp
674
- }
675
- this.initSearchProps.push(prop)
676
- const propValue = item.propValue
677
- if (prop.indexOf('.') > 0) {
678
- // 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
679
- addDynamicProp(this.searchFormContent, prop, propValue)
680
- } else {
681
- this.searchFormContent[prop] = propValue
682
- }
683
- })
684
- gridParams.searchForm = searchFormArr
685
- // 调用查询api方法,该方法中调用了@showSearch方法,用于控制“查询”按钮改名为“取消查询”
686
- this.showSearchForm()
687
- } else {
688
- gridParams.searchForm = null
689
- }
690
- },
691
- showDemo() {
692
- this.isLoading = true
693
- this.$http
694
- .get(this.url)
695
- .then((data) => {
696
- Object.assign(this, data)
697
- const gridParams = store.get(this.storeId)
639
+ gridParams.pagination = this.pagination
640
+ gridParams.loaded = true
641
+ this.hasLoadData = true
642
+ resolve()
643
+ })
644
+ .catch((error) => {
645
+ if (isHasOptionFunction('loadError', this.storeId)) {
646
+ gridParams.options.loadError.call(this, this.code, error)
647
+ }
648
+ reject(error)
649
+ })
650
+ })
651
+ },
652
+ getLength(paramsData) {
653
+ if (paramsData && paramsData.length > 5) {
654
+ return '(' + paramsData.substring(0, 5) + '...' + ')'
655
+ } else if (paramsData) {
656
+ return '(' + paramsData + ')'
657
+ } else {
658
+ return ''
659
+ }
660
+ },
661
+ // 获得初始查询条件对象
662
+ getInitSearchForm(searchFormArr) {
663
+ const gridParams = store.get(this.storeId)
664
+ if (searchFormArr && searchFormArr.length > 0) {
665
+ this.searchFormContent = {}
666
+ searchFormArr.forEach((item) => {
667
+ // 获得的是"isDeleted"
668
+ let prop = item.propName
669
+ // 获得的是“deleted”
670
+ const columnProp = item.columnProp
671
+ const dataType = item.dataType
672
+ if (dataType && dataType === 'BOOLEAN') {
673
+ prop = columnProp
674
+ }
675
+ this.initSearchProps.push(prop)
676
+ const propValue = item.propValue
677
+ if (prop.indexOf('.') > 0) {
678
+ // 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
679
+ addDynamicProp(this.searchFormContent, prop, propValue)
680
+ } else {
681
+ this.searchFormContent[prop] = propValue
682
+ }
683
+ })
684
+ gridParams.searchForm = searchFormArr
685
+ // 调用查询api方法,该方法中调用了@showSearch方法,用于控制“查询”按钮改名为“取消查询”
686
+ this.showSearchForm()
687
+ } else {
688
+ gridParams.searchForm = null
689
+ }
690
+ },
691
+ showDemo() {
692
+ this.isLoading = true
693
+ this.$http
694
+ .get(this.url)
695
+ .then((data) => {
696
+ Object.assign(this, data)
697
+ const gridParams = store.get(this.storeId)
698
698
 
699
- gridParams.listCode = this.code
699
+ gridParams.listCode = this.code
700
700
 
701
- gridParams.columns = this.columns
702
- if (gridParams.columns && this.options.dynamicColumns) {
703
- for (var i = 0; i < this.options.dynamicColumns.length; i++) {
704
- this.options.dynamicColumns[i].dynamic = true
705
- gridParams.columns.push(this.options.dynamicColumns[i])
706
- }
707
- }
708
- gridParams.lineEdit = this.lineEdit
709
- gridParams.basicInfo = this.basicInfo
710
- gridParams.pagination = this.pagination
711
- gridParams.query = this.query
701
+ gridParams.columns = this.columns
702
+ if (gridParams.columns && this.options.dynamicColumns) {
703
+ for (var i = 0; i < this.options.dynamicColumns.length; i++) {
704
+ this.options.dynamicColumns[i].dynamic = true
705
+ gridParams.columns.push(this.options.dynamicColumns[i])
706
+ }
707
+ }
708
+ gridParams.lineEdit = this.lineEdit
709
+ gridParams.basicInfo = this.basicInfo
710
+ gridParams.pagination = this.pagination
711
+ gridParams.query = this.query
712
712
 
713
- this.gridData = data.gridData
714
- // 对数据做序列化,比如:处理xss攻击
715
- if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
716
- const gridData = gridParams.options.gridDataLoaded.call(
717
- this,
718
- data.gridData
719
- )
720
- if (gridData) {
721
- this.gridData = gridData
722
- } else {
723
- this.gridData = data.gridData
724
- }
725
- } else {
726
- this.gridData = data.gridData
727
- }
713
+ this.gridData = data.gridData
714
+ // 对数据做序列化,比如:处理xss攻击
715
+ if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
716
+ const gridData = gridParams.options.gridDataLoaded.call(
717
+ this,
718
+ data.gridData
719
+ )
720
+ if (gridData) {
721
+ this.gridData = gridData
722
+ } else {
723
+ this.gridData = data.gridData
724
+ }
725
+ } else {
726
+ this.gridData = data.gridData
727
+ }
728
728
 
729
- if (this.pagination != null) {
730
- this.pagination.total = data.total
731
- }
732
- if (!this.gridData) {
733
- this.gridData = []
734
- }
735
- gridParams.gridData = this.gridData
736
- // 完成深拷贝,复制一份对象,行编辑时使用
737
- gridParams.orgGridData = [].concat(
738
- JSON.parse(JSON.stringify(this.gridData))
739
- )
740
- gridParams.pagination = this.pagination
729
+ if (this.pagination != null) {
730
+ this.pagination.total = data.total
731
+ }
732
+ if (!this.gridData) {
733
+ this.gridData = []
734
+ }
735
+ gridParams.gridData = this.gridData
736
+ // 完成深拷贝,复制一份对象,行编辑时使用
737
+ gridParams.orgGridData = [].concat(
738
+ JSON.parse(JSON.stringify(this.gridData))
739
+ )
740
+ gridParams.pagination = this.pagination
741
741
 
742
- if (isHasOptionFunction('gridComplete', this.storeId)) {
743
- gridParams.options.gridComplete.call(
744
- this,
745
- this.gridData,
746
- gridParams.columns
747
- )
748
- }
749
- })
750
- .catch((error) => {
751
- if (isHasOptionFunction('loadError', this.storeId)) {
752
- const gridParams = store.get(this.storeId)
753
- gridParams.options.loadError.call(this, this.code, error)
754
- }
755
- })
756
- },
757
- search(searchForm) {
758
- const vm = this
759
- return new Promise((resolve, reject) => {
760
- const gridParams = store.get(vm.storeId)
761
- if (typeof searchForm !== 'undefined' && searchForm !== null) {
762
- gridParams.searchForm = searchForm
763
- } else {
764
- gridParams.searchForm = null
765
- }
742
+ if (isHasOptionFunction('gridComplete', this.storeId)) {
743
+ gridParams.options.gridComplete.call(
744
+ this,
745
+ this.gridData,
746
+ gridParams.columns
747
+ )
748
+ }
749
+ })
750
+ .catch((error) => {
751
+ if (isHasOptionFunction('loadError', this.storeId)) {
752
+ const gridParams = store.get(this.storeId)
753
+ gridParams.options.loadError.call(this, this.code, error)
754
+ }
755
+ })
756
+ },
757
+ search(searchForm) {
758
+ const vm = this
759
+ return new Promise((resolve, reject) => {
760
+ const gridParams = store.get(vm.storeId)
761
+ if (typeof searchForm !== 'undefined' && searchForm !== null) {
762
+ gridParams.searchForm = searchForm
763
+ } else {
764
+ gridParams.searchForm = null
765
+ }
766
766
 
767
- vm.fetchData(vm.getSearchParam(), true)
768
- .then((data) => {
769
- if (
770
- gridParams.options !== undefined &&
771
- gridParams.options.isHiddenSearchForm !== undefined &&
772
- gridParams.options.isHiddenSearchForm === true
773
- ) {
774
- // 查询时,是否隐藏查询区域,默认是不隐藏查询区域
775
- vm.showSearch = false
776
- $emit(vm, 'cancel-search')
777
- }
778
- if (vm.$refs.sf) {
779
- vm.$refs.sf.loading = false
780
- }
781
- resolve(data)
782
- })
783
- .catch((error) => {
784
- if (vm.$refs.sf) {
785
- vm.$refs.sf.loading = false
786
- }
787
- reject(error)
788
- })
789
- })
790
- },
791
- getSearchParam() {
792
- const searchParam = {
793
- code: this.code,
794
- }
795
- const gridParams = store.get(this.storeId)
796
- if (this.pagination !== null) {
797
- const pagination = {
798
- currentPage: this.currentPage,
799
- pageSize: this.pagination.pageSize,
800
- showTotal: this.pagination.showTotal,
801
- }
802
- if (this.pageSize !== null) {
803
- // 表示更改了每页显示的数据条数
804
- pagination.pageSize = this.pageSize
805
- }
806
- searchParam.pagination = pagination
807
- }
808
- // 排序信息
809
- if (this.sortInfo !== null) {
810
- // 表示更改了排序信息
811
- searchParam.sorts = this.sortInfo
812
- }
813
- if (this.mergeFields && this.mergeFields.length > 0) {
814
- if (!searchParam.sorts) {
815
- searchParam.sorts = []
816
- }
817
- const mergeFieldsArr = []
818
- for (const mergeField of this.mergeFields) {
819
- let flag = true
820
- for (const so of searchParam.sorts) {
821
- if (so.prop === mergeField) {
822
- flag = false
823
- break
824
- }
825
- }
826
- if (flag) {
827
- mergeFieldsArr.push({
828
- prop: mergeField,
829
- order: 'ascending',
830
- })
831
- }
832
- }
833
- mergeFieldsArr.push(...searchParam.sorts)
834
- searchParam.sorts = mergeFieldsArr
835
- }
836
- // 是否有初始过滤条件
837
- if (
838
- gridParams.options &&
839
- typeof gridParams.options.initSearchForm !== 'undefined'
840
- ) {
841
- searchParam.initSearchForm = gridParams.options.initSearchForm
842
- }
843
- if (typeof gridParams.searchForm !== 'undefined') {
844
- searchParam.searchForm = gridParams.searchForm
845
- } else {
846
- searchParam.searchForm = []
847
- }
848
- return searchParam
849
- },
850
- handleSizeChange(val) {
851
- this.pageSize = val
852
- this.fetchData(this.getSearchParam())
853
- },
854
- handleCurrentChange(val) {
855
- this.fetchData(this.getSearchParam())
856
- },
857
- handleSortChange({ column, prop, order }) {
858
- if (prop !== null) {
859
- // 当点击第3次时,prop会是空,表示清空排序字段,还原原顺序
860
- this.sortInfo = [
861
- {
862
- prop: prop,
863
- order: order,
864
- },
865
- ]
866
- } else {
867
- this.sortInfo = null
868
- }
869
- this.fetchData(this.getSearchParam())
870
- $emit(this, 'sort-change', { column, prop, order })
871
- },
872
- resetSearch() {
873
- this.search(null, false)
874
- },
875
- // 新建事件
876
- add() {
877
- $emit(this, 'add')
878
- },
879
- // 操作按钮的点击事件
880
- buttonClick(event, data) {
881
- if (event) {
882
- if (typeof event === 'function') {
883
- event.call(this, data)
884
- } else {
885
- $emit(this, event, data)
886
- }
887
- }
888
- },
889
- // 点击内容区域的事件
890
- clickContent(data) {
891
- this.changeSelect(data)
892
- $emit(this, 'click', data)
893
- },
894
- // 格子拖拽
895
- rowDrop() {
896
- if (this.urlToSaveOrder) {
897
- let urlToSaveOrder = this.urlToSaveOrder
898
- if (
899
- urlToSaveOrder.indexOf('http:') < 0 ||
900
- urlToSaveOrder.indexOf('https:') < 0
901
- ) {
902
- // 表示是相对路径,需要拼接全路径
903
- let baseURL = window.$vueApp.config.globalProperties.baseURL
904
- if (baseURL.lastIndexOf('/') === baseURL.length - 1) {
905
- // 表示以斜线结尾
906
- // 去掉斜线
907
- baseURL = baseURL.substring(0, baseURL.length - 1)
908
- }
909
- if (urlToSaveOrder.indexOf('/') > 0) {
910
- // 表示不是以斜线开头,需要开头加“/”
911
- urlToSaveOrder = '/' + urlToSaveOrder
912
- }
913
- urlToSaveOrder = baseURL + urlToSaveOrder
914
- }
915
- const tbody = document.querySelector('#' + this.gridId + ' .el-row')
916
- if (tbody != null) {
917
- const vm = this
918
- Sortable.create(tbody, {
919
- draggable: '.col-content',
920
- onEnd({ newIndex, oldIndex }) {
921
- const addCardId = document.querySelector(
922
- '#' + vm.gridId + ' #_addCardId_'
923
- )
924
- if (addCardId != null) {
925
- // 表示存在新建区域,则序号需要减1
926
- if (oldIndex > 0) {
927
- oldIndex = oldIndex - 1
928
- }
929
- if (newIndex > 0) {
930
- newIndex = newIndex - 1
931
- }
932
- }
933
- const params = {
934
- oldIndex: oldIndex,
935
- newIndex: newIndex,
936
- gridData: vm.gridData,
937
- }
938
- vm.$http.post(urlToSaveOrder, params).then((data) => {
939
- const currRow = vm.gridData.splice(oldIndex, 1)[0]
940
- vm.gridData.splice(newIndex, 0, currRow)
941
- vm.refresh().then(() => {
942
- $emit(vm, 'afterDrag', params)
943
- })
944
- })
945
- },
946
- })
947
- }
948
- }
949
- },
950
- // 多选按钮的change事件
951
- changeChecked(label, index) {
952
- const entity = this.gridData[index]
953
- if ((label + '').indexOf('false-') >= 0) {
954
- // 表示取消勾选记录
955
- this.unselect(entity)
956
- } else {
957
- // 表示勾选记录
958
- this.select(entity)
959
- }
960
- },
961
- unselect(entity) {
962
- const id = entity.id
963
- const index = this.selectionIds.indexOf(id)
964
- if (index > -1) {
965
- this.selections.splice(index, 1)
966
- this.selectionIds.splice(index, 1)
967
- }
968
- $emit(this, 'unselect', entity, this.selections)
969
- this.selectionModels['select' + id] = 'false-' + id
970
- // console.log('unselect---this.selections=', this.selections)
971
- },
972
- select(entity) {
973
- const id = entity.id
974
- if (this.selectionIds.indexOf(id) < 0) {
975
- this.selectionIds[this.selectionIds.length] = id
976
- this.selections[this.selections.length] = entity
977
- }
978
- $emit(this, 'select', entity, this.selections)
979
- this.selectionModels['select' + id] = id
980
- // console.log('select---this.selections=', this.selections)
981
- },
982
- // 单选按钮的change事件
983
- changeSelectWhenRadio(label, index) {
984
- const entity = this.gridData[index]
985
- this.selectionIds = []
986
- this.selections = []
987
- this.selectionModels = {}
988
- this.select(entity)
989
- },
990
- changeSelect(data) {
991
- const id = data.id
992
- if (this.multiple === true) {
993
- // 多选时
994
- if (this.selectionIds && this.selectionIds.indexOf(id) >= 0) {
995
- // 表示需要取消选中
996
- this.unselect(data)
997
- } else {
998
- // 表示需要选中
999
- this.select(data)
1000
- }
1001
- } else {
1002
- // 单选时
1003
- this.currentId = id
1004
- this.selectionIds = []
1005
- this.selections = []
1006
- this.selectionModels = {}
1007
- this.select(data)
1008
- }
1009
- },
1010
- isShowButton(entity, button) {
1011
- const val = this.isShowButtonFun(entity, button)
1012
- if (val === undefined) {
1013
- return true
1014
- }
1015
- return val
1016
- },
1017
- // 是否显示启用禁用按钮
1018
- showEnableButton(entity) {
1019
- const gridParams = store.get(this.storeId)
1020
- if (isHasOptionFunction('showEnableButton', this.storeId)) {
1021
- return gridParams.options.showEnableButton.call(this, entity)
1022
- }
1023
- return false
1024
- },
1025
- // 启用禁用按钮显示状态
1026
- changeState(entity) {
1027
- const gridParams = store.get(this.storeId)
1028
- if (isHasOptionFunction('changeState', this.storeId)) {
1029
- return gridParams.options.changeState.call(this, entity)
1030
- }
1031
- return false
1032
- },
1033
- },
1034
- emits: [
1035
- 'sort-change',
1036
- ,
1037
- 'click',
1038
- 'afterDrag',
1039
- 'unselect',
1040
- 'select',
1041
- 'cancel-search',
1042
- 'add',
1043
- ,
1044
- ],
767
+ vm.fetchData(vm.getSearchParam(), true)
768
+ .then((data) => {
769
+ if (
770
+ gridParams.options !== undefined &&
771
+ gridParams.options.isHiddenSearchForm !== undefined &&
772
+ gridParams.options.isHiddenSearchForm === true
773
+ ) {
774
+ // 查询时,是否隐藏查询区域,默认是不隐藏查询区域
775
+ vm.showSearch = false
776
+ $emit(vm, 'cancel-search')
777
+ }
778
+ if (vm.$refs.sf) {
779
+ vm.$refs.sf.loading = false
780
+ }
781
+ resolve(data)
782
+ })
783
+ .catch((error) => {
784
+ if (vm.$refs.sf) {
785
+ vm.$refs.sf.loading = false
786
+ }
787
+ reject(error)
788
+ })
789
+ })
790
+ },
791
+ getSearchParam() {
792
+ const searchParam = {
793
+ code: this.code,
794
+ }
795
+ const gridParams = store.get(this.storeId)
796
+ if (this.pagination !== null) {
797
+ const pagination = {
798
+ currentPage: this.currentPage,
799
+ pageSize: this.pagination.pageSize,
800
+ showTotal: this.pagination.showTotal,
801
+ }
802
+ if (this.pageSize !== null) {
803
+ // 表示更改了每页显示的数据条数
804
+ pagination.pageSize = this.pageSize
805
+ }
806
+ searchParam.pagination = pagination
807
+ }
808
+ // 排序信息
809
+ if (this.sortInfo !== null) {
810
+ // 表示更改了排序信息
811
+ searchParam.sorts = this.sortInfo
812
+ }
813
+ if (this.mergeFields && this.mergeFields.length > 0) {
814
+ if (!searchParam.sorts) {
815
+ searchParam.sorts = []
816
+ }
817
+ const mergeFieldsArr = []
818
+ for (const mergeField of this.mergeFields) {
819
+ let flag = true
820
+ for (const so of searchParam.sorts) {
821
+ if (so.prop === mergeField) {
822
+ flag = false
823
+ break
824
+ }
825
+ }
826
+ if (flag) {
827
+ mergeFieldsArr.push({
828
+ prop: mergeField,
829
+ order: 'ascending',
830
+ })
831
+ }
832
+ }
833
+ mergeFieldsArr.push(...searchParam.sorts)
834
+ searchParam.sorts = mergeFieldsArr
835
+ }
836
+ // 是否有初始过滤条件
837
+ if (
838
+ gridParams.options &&
839
+ typeof gridParams.options.initSearchForm !== 'undefined'
840
+ ) {
841
+ searchParam.initSearchForm = gridParams.options.initSearchForm
842
+ }
843
+ if (typeof gridParams.searchForm !== 'undefined') {
844
+ searchParam.searchForm = gridParams.searchForm
845
+ } else {
846
+ searchParam.searchForm = []
847
+ }
848
+ return searchParam
849
+ },
850
+ handleSizeChange(val) {
851
+ this.pageSize = val
852
+ this.fetchData(this.getSearchParam())
853
+ },
854
+ handleCurrentChange(val) {
855
+ this.fetchData(this.getSearchParam())
856
+ },
857
+ handleSortChange({column, prop, order}) {
858
+ if (prop !== null) {
859
+ // 当点击第3次时,prop会是空,表示清空排序字段,还原原顺序
860
+ this.sortInfo = [
861
+ {
862
+ prop: prop,
863
+ order: order,
864
+ },
865
+ ]
866
+ } else {
867
+ this.sortInfo = null
868
+ }
869
+ this.fetchData(this.getSearchParam())
870
+ $emit(this, 'sort-change', {column, prop, order})
871
+ },
872
+ resetSearch() {
873
+ this.search(null, false)
874
+ },
875
+ // 新建事件
876
+ add() {
877
+ $emit(this, 'add')
878
+ },
879
+ // 操作按钮的点击事件
880
+ buttonClick(event, data) {
881
+ if (event) {
882
+ if (typeof event === 'function') {
883
+ event.call(this, data)
884
+ } else {
885
+ $emit(this, event, data)
886
+ }
887
+ }
888
+ },
889
+ // 点击内容区域的事件
890
+ clickContent(data) {
891
+ this.changeSelect(data)
892
+ $emit(this, 'click', data)
893
+ },
894
+ // 格子拖拽
895
+ rowDrop() {
896
+ if (this.urlToSaveOrder) {
897
+ let urlToSaveOrder = this.urlToSaveOrder
898
+ if (
899
+ urlToSaveOrder.indexOf('http:') < 0 ||
900
+ urlToSaveOrder.indexOf('https:') < 0
901
+ ) {
902
+ // 表示是相对路径,需要拼接全路径
903
+ let baseURL = window.$vueApp.config.globalProperties.baseURL
904
+ if (baseURL.lastIndexOf('/') === baseURL.length - 1) {
905
+ // 表示以斜线结尾
906
+ // 去掉斜线
907
+ baseURL = baseURL.substring(0, baseURL.length - 1)
908
+ }
909
+ if (urlToSaveOrder.indexOf('/') > 0) {
910
+ // 表示不是以斜线开头,需要开头加“/”
911
+ urlToSaveOrder = '/' + urlToSaveOrder
912
+ }
913
+ urlToSaveOrder = baseURL + urlToSaveOrder
914
+ }
915
+ const tbody = document.querySelector('#' + this.gridId + ' .el-row')
916
+ if (tbody != null) {
917
+ const vm = this
918
+ Sortable.create(tbody, {
919
+ draggable: '.col-content',
920
+ onEnd({newIndex, oldIndex}) {
921
+ const addCardId = document.querySelector(
922
+ '#' + vm.gridId + ' #_addCardId_'
923
+ )
924
+ if (addCardId != null) {
925
+ // 表示存在新建区域,则序号需要减1
926
+ if (oldIndex > 0) {
927
+ oldIndex = oldIndex - 1
928
+ }
929
+ if (newIndex > 0) {
930
+ newIndex = newIndex - 1
931
+ }
932
+ }
933
+ const params = {
934
+ oldIndex: oldIndex,
935
+ newIndex: newIndex,
936
+ gridData: vm.gridData,
937
+ }
938
+ vm.$http.post(urlToSaveOrder, params).then((data) => {
939
+ const currRow = vm.gridData.splice(oldIndex, 1)[0]
940
+ vm.gridData.splice(newIndex, 0, currRow)
941
+ vm.refresh().then(() => {
942
+ $emit(vm, 'afterDrag', params)
943
+ })
944
+ })
945
+ },
946
+ })
947
+ }
948
+ }
949
+ },
950
+ // 多选按钮的change事件
951
+ changeChecked(label, index) {
952
+ const entity = this.gridData[index]
953
+ if ((label + '').indexOf('false-') >= 0) {
954
+ // 表示取消勾选记录
955
+ this.unselect(entity)
956
+ } else {
957
+ // 表示勾选记录
958
+ this.select(entity)
959
+ }
960
+ },
961
+ unselect(entity) {
962
+ const id = entity.id
963
+ const index = this.selectionIds.indexOf(id)
964
+ if (index > -1) {
965
+ this.selections.splice(index, 1)
966
+ this.selectionIds.splice(index, 1)
967
+ }
968
+ $emit(this, 'unselect', entity, this.selections)
969
+ this.selectionModels['select' + id] = 'false-' + id
970
+ // console.log('unselect---this.selections=', this.selections)
971
+ },
972
+ select(entity) {
973
+ const id = entity.id
974
+ if (this.selectionIds.indexOf(id) < 0) {
975
+ this.selectionIds[this.selectionIds.length] = id
976
+ this.selections[this.selections.length] = entity
977
+ }
978
+ $emit(this, 'select', entity, this.selections)
979
+ this.selectionModels['select' + id] = id
980
+ // console.log('select---this.selections=', this.selections)
981
+ },
982
+ // 单选按钮的change事件
983
+ changeSelectWhenRadio(label, index) {
984
+ const entity = this.gridData[index]
985
+ this.selectionIds = []
986
+ this.selections = []
987
+ this.selectionModels = {}
988
+ this.select(entity)
989
+ },
990
+ changeSelect(data) {
991
+ const id = data.id
992
+ if (this.multiple === true) {
993
+ // 多选时
994
+ if (this.selectionIds && this.selectionIds.indexOf(id) >= 0) {
995
+ // 表示需要取消选中
996
+ this.unselect(data)
997
+ } else {
998
+ // 表示需要选中
999
+ this.select(data)
1000
+ }
1001
+ } else {
1002
+ // 单选时
1003
+ this.currentId = id
1004
+ this.selectionIds = []
1005
+ this.selections = []
1006
+ this.selectionModels = {}
1007
+ this.select(data)
1008
+ }
1009
+ },
1010
+ isShowButton(entity, button) {
1011
+ const val = this.isShowButtonFun(entity, button)
1012
+ if (val === undefined) {
1013
+ return true
1014
+ }
1015
+ return val
1016
+ },
1017
+ // 是否显示启用禁用按钮
1018
+ showEnableButton(entity) {
1019
+ const gridParams = store.get(this.storeId)
1020
+ if (isHasOptionFunction('showEnableButton', this.storeId)) {
1021
+ return gridParams.options.showEnableButton.call(this, entity)
1022
+ }
1023
+ return false
1024
+ },
1025
+ // 启用禁用按钮显示状态
1026
+ changeState(entity) {
1027
+ const gridParams = store.get(this.storeId)
1028
+ if (isHasOptionFunction('changeState', this.storeId)) {
1029
+ return gridParams.options.changeState.call(this, entity)
1030
+ }
1031
+ return false
1032
+ },
1033
+ },
1034
+ emits: [
1035
+ 'sort-change',
1036
+ ,
1037
+ 'click',
1038
+ 'afterDrag',
1039
+ 'unselect',
1040
+ 'select',
1041
+ 'cancel-search',
1042
+ 'add',
1043
+ ,
1044
+ ],
1045
1045
  }
1046
1046
  </script>
1047
1047
 
1048
1048
  <style lang="scss" rel="stylesheet/scss" scoped>
1049
1049
  .nine-grid-area {
1050
- padding: 10px;
1051
- .el-row {
1052
- margin-bottom: 20px;
1053
- &:last-child {
1054
- margin-bottom: 0;
1055
- }
1056
- }
1057
- .el-col-5 {
1058
- width: 20%;
1050
+ padding: 10px;
1051
+
1052
+ .el-row {
1053
+ margin-bottom: 20px;
1054
+
1055
+ &:last-child {
1056
+ margin-bottom: 0;
1057
+ }
1058
+ }
1059
+
1060
+ .el-col-5 {
1061
+ width: 20%;
1059
1062
  max-width: 20%;
1060
- padding-left: 12px;
1063
+ padding-left: 12px;
1061
1064
  padding-right: 12px;
1062
- }
1063
- .el-col {
1064
- border-radius: 4px;
1065
- margin-bottom: 10px;
1066
- }
1067
- .name {
1068
- font-size: 12px;
1069
- color: #555;
1070
- float: left;
1071
- width: 80%;
1072
- text-align: left;
1073
- }
1074
- .bottom {
1075
- // margin-top: 13px;
1076
- line-height: 13px;
1077
- // background: aquamarine;
1078
- }
1079
- .state {
1080
- font-size: 12px;
1081
- margin-top: 1.5px;
1082
- float: right;
1083
- line-height: 1;
1084
- display: flex;
1085
- align-items: right;
1086
- color: #999;
1087
- width: 20%;
1088
- text-align: right;
1089
- }
1090
- .image {
1091
- width: 100%;
1092
- display: block;
1093
- height: 200px;
1094
- }
1095
- .clearfix:before,
1096
- .clearfix:after {
1097
- display: table;
1098
- content: '';
1099
- }
1100
- .clearfix:after {
1101
- clear: both;
1102
- }
1103
- .input-with-select {
1104
- // background-color: #fff;
1105
- width: 200px;
1106
- float: right;
1107
- }
1108
- .popContainer {
1109
- position: absolute;
1110
- width: 23.15%;
1111
- display: block;
1112
- height: 200px;
1113
- background: rgba(0, 0, 0, 0.5);
1114
- text-align: right;
1115
- }
1116
- .fade-enter-active,
1117
- .fade-leave-active {
1118
- transition: opacity 0.5s;
1119
- }
1120
- .fade-enter,
1121
- .fade-leave-to {
1122
- opacity: 0;
1123
- }
1124
- .icons {
1125
- color: #adb5bd;
1126
- margin: 10px 10px 0px 0px;
1127
- cursor: pointer;
1128
- }
1129
- .release-status {
1130
- display: block;
1131
- width: 8px;
1132
- height: 8px;
1133
- margin-right: 8px;
1134
- border-radius: 100%;
1135
- }
1136
- .add-screen {
1137
- display: flex;
1138
- flex-direction: column;
1139
- justify-content: center;
1140
- align-items: center;
1141
- cursor: pointer;
1142
- height: 160px;
1143
- // background-color: #fff;
1144
- // border: 1px solid #7693f5;
1145
- // box-shadow: 0 2px 8px 0 rgba(104,130,218,.4);
1146
- font-size: 12px;
1147
- color: #666666;
1148
- font-family: Source Han Sans CN;
1149
- font-weight: regular;
1150
- font-size: 14px;
1151
- line-height: 14px;
1152
- letter-spacing: 0px;
1153
- text-align: left;
1154
- }
1155
- .el-divider--horizontal {
1156
- margin: 5px 0;
1157
- }
1158
- .button-style {
1159
- margin-top: 28px;
1160
- color: #606266;
1161
- font-family: Source Han Sans CN;
1162
- font-weight: regular;
1163
- font-size: 14px;
1164
- line-height: 14px;
1165
- letter-spacing: 0px;
1166
- text-align: left;
1167
- }
1065
+ }
1066
+
1067
+ .el-col {
1068
+ border-radius: 4px;
1069
+ margin-bottom: 10px;
1070
+ }
1071
+
1072
+ .name {
1073
+ font-size: 12px;
1074
+ color: #555;
1075
+ float: left;
1076
+ width: 80%;
1077
+ text-align: left;
1078
+ }
1079
+
1080
+ .bottom {
1081
+ // margin-top: 13px;
1082
+ line-height: 13px;
1083
+ // background: aquamarine;
1084
+ }
1085
+
1086
+ .state {
1087
+ font-size: 12px;
1088
+ margin-top: 1.5px;
1089
+ float: right;
1090
+ line-height: 1;
1091
+ display: flex;
1092
+ align-items: right;
1093
+ color: #999;
1094
+ width: 20%;
1095
+ text-align: right;
1096
+ }
1097
+
1098
+ .image {
1099
+ width: 100%;
1100
+ display: block;
1101
+ height: 200px;
1102
+ }
1103
+
1104
+ .clearfix:before,
1105
+ .clearfix:after {
1106
+ display: table;
1107
+ content: '';
1108
+ }
1109
+
1110
+ .clearfix:after {
1111
+ clear: both;
1112
+ }
1113
+
1114
+ .input-with-select {
1115
+ // background-color: #fff;
1116
+ width: 200px;
1117
+ float: right;
1118
+ }
1119
+
1120
+ .popContainer {
1121
+ position: absolute;
1122
+ width: 23.15%;
1123
+ display: block;
1124
+ height: 200px;
1125
+ background: rgba(0, 0, 0, 0.5);
1126
+ text-align: right;
1127
+ }
1128
+
1129
+ .fade-enter-active,
1130
+ .fade-leave-active {
1131
+ transition: opacity 0.5s;
1132
+ }
1133
+
1134
+ .fade-enter,
1135
+ .fade-leave-to {
1136
+ opacity: 0;
1137
+ }
1138
+
1139
+ .icons {
1140
+ color: #adb5bd;
1141
+ margin: 10px 10px 0px 0px;
1142
+ cursor: pointer;
1143
+ }
1144
+
1145
+ .release-status {
1146
+ display: block;
1147
+ width: 8px;
1148
+ height: 8px;
1149
+ margin-right: 8px;
1150
+ border-radius: 100%;
1151
+ }
1152
+
1153
+ .add-screen {
1154
+ display: flex;
1155
+ flex-direction: column;
1156
+ justify-content: center;
1157
+ align-items: center;
1158
+ cursor: pointer;
1159
+ height: 160px;
1160
+ // background-color: #fff;
1161
+ // border: 1px solid #7693f5;
1162
+ // box-shadow: 0 2px 8px 0 rgba(104,130,218,.4);
1163
+ font-size: 12px;
1164
+ color: #666666;
1165
+ font-family: Source Han Sans CN;
1166
+ font-weight: regular;
1167
+ font-size: 14px;
1168
+ line-height: 14px;
1169
+ letter-spacing: 0px;
1170
+ text-align: left;
1171
+ }
1172
+
1173
+ .el-divider--horizontal {
1174
+ margin: 5px 0;
1175
+ }
1176
+
1177
+ .button-style {
1178
+ margin-top: 28px;
1179
+ color: #606266;
1180
+ font-family: Source Han Sans CN;
1181
+ font-weight: regular;
1182
+ font-size: 14px;
1183
+ line-height: 14px;
1184
+ letter-spacing: 0px;
1185
+ text-align: left;
1186
+ }
1168
1187
  }
1169
1188
  </style>