Commit 75ccd5cdeb3d87e89260adee90f17afe42d85113
1 parent
21d9ec8d
Exists in
master
and in
1 other branch
Scheme支持抽屉弹出框,支持静态数据增删改查
Showing
9 changed files
with
110 additions
and
84 deletions
Show diff stats
examples/components/code-snippet.vue
| @@ -49,9 +49,9 @@ export default { | @@ -49,9 +49,9 @@ export default { | ||
| 49 | text-align: left; | 49 | text-align: left; |
| 50 | // element-ui样式冲突 | 50 | // element-ui样式冲突 |
| 51 | ul > li { | 51 | ul > li { |
| 52 | - list-style-type: none; | ||
| 53 | - margin: 0px; | ||
| 54 | - padding: 0px; | 52 | + list-style-type: none !important; |
| 53 | + margin: 0px !important; | ||
| 54 | + padding: 0px !important; | ||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | .eagle-code-snippet--demo { | 57 | .eagle-code-snippet--demo { |
examples/styles/markdown.scss
examples/views/docs/component/scheme.md
| @@ -10,72 +10,23 @@ Scheme是一个数æ®é©±åŠ¨çš„è§£å†³æ–¹æ¡ˆï¼Œé€šè¿‡æ—¢å®šçš„ä¸šåŠ¡é…ç½®å‚æ•°ï¼ | @@ -10,72 +10,23 @@ Scheme是一个数æ®é©±åŠ¨çš„è§£å†³æ–¹æ¡ˆï¼Œé€šè¿‡æ—¢å®šçš„ä¸šåŠ¡é…ç½®å‚æ•°ï¼ | ||
| 10 | 10 | ||
| 11 | ```html | 11 | ```html |
| 12 | <template> | 12 | <template> |
| 13 | - <eagle-scheme :list="schemeList" :option="{ auto: false }"> | ||
| 14 | - <!-- <div slot="action-bar" slot-scope="{ handleNew }"> | ||
| 15 | - <el-button type="warn" @click="handleNew">新增</el-button> | ||
| 16 | - </div> --> | ||
| 17 | - <el-button slot="action-button" type="success" plain size="small">å¯ç”¨</el-button> | ||
| 18 | - <el-button slot="action-button" type="danger" plain size="small">ç¦ç”¨</el-button> | ||
| 19 | - <el-table-column type="selection" width="50" align="center"></el-table-column> | ||
| 20 | - <template #table-status="{ setDialog }"> | ||
| 21 | - <el-table-column prop="status" label="激活状æ€" min-width="120"> | ||
| 22 | - <el-tag @click="setDialog({ title: 'Status模å¼', type: 'dialog-status' })" slot-scope="{ row: { status } }" :type="status === 'active' ? 'success' : 'danger'">{{ status === 'active' ? '激活' : 'ç¦ç”¨' }}</el-tag> | ||
| 23 | - </el-table-column> | ||
| 24 | - </template> | ||
| 25 | - <template #search-status="{ model }"> | ||
| 26 | - <eagle-select v-model="model.status" :dataSource="dataSource"></eagle-select> | ||
| 27 | - </template> | ||
| 28 | - <template #form-group-setting > | ||
| 29 | - <div style="padding: 10px 0px;margin-bottom: 30px;border-bottom: 1px dashed #aaa;display: flex;justify-content: space-between;"> | ||
| 30 | - <span>哎哟 - 设置 - ä¸é”™å“¦</span> | ||
| 31 | - <el-button size="mini" type="primary">这是一个按钮</el-button> | ||
| 32 | - </div> | ||
| 33 | - </template> | ||
| 34 | - <template #form-item-status="{ model }"> | ||
| 35 | - <el-input-number v-model="model.status"></el-input-number> | ||
| 36 | - </template> | ||
| 37 | - <template #view-item-code="{ model }"> | ||
| 38 | - <el-input disabled :value="model.code"></el-input> | ||
| 39 | - </template> | ||
| 40 | - <!-- <template #dialog-view="{ row }"> | ||
| 41 | - <div>这是一个自定义弹出框内容</div> | ||
| 42 | - <div>{{ row }}</div> | ||
| 43 | - </template> --> | ||
| 44 | - <template #dialog-status> | ||
| 45 | - <div>这是Status的内容</div> | ||
| 46 | - </template> | ||
| 47 | - <!-- 自定义按钮组 --> | ||
| 48 | - <!-- <el-table-column slot="table-operation" prop="$operation" label="æ“作" min-width="140"> | ||
| 49 | - <el-tag>自定义按钮组</el-tag> | ||
| 50 | - </el-table-column> --> | ||
| 51 | - <!-- 在æ“作按钮组å‰åŠ ä¸Šæ–°çš„æŒ‰é’® --> | ||
| 52 | - <!-- <template slot="table-operation-btn"> | ||
| 53 | - <el-button class="eagle-scheme__table-btn" type="text" title="å¯ç”¨">å¯ç”¨</el-button> | ||
| 54 | - <el-button class="eagle-scheme__table-btn" type="text" title="ç¦ç”¨">ç¦ç”¨</el-button> | ||
| 55 | - </template> --> | ||
| 56 | - <!-- 在æ“作按钮组åŽè¿½åŠ æ–°çš„æŒ‰é’® --> | ||
| 57 | - <!-- <template slot="table-operation-btn-append"> | ||
| 58 | - <el-button class="eagle-scheme__table-btn" type="text" title="å¯ç”¨">å¯ç”¨</el-button> | ||
| 59 | - <el-button class="eagle-scheme__table-btn" type="text" title="ç¦ç”¨">ç¦ç”¨</el-button> | ||
| 60 | - </template> --> | ||
| 61 | - </eagle-scheme> | 13 | + <eagle-scheme v-model="tableData" :list="schemeList"></eagle-scheme> |
| 62 | </template> | 14 | </template> |
| 63 | 15 | ||
| 64 | <script> | 16 | <script> |
| 65 | export default { | 17 | export default { |
| 66 | data() { | 18 | data() { |
| 67 | return { | 19 | return { |
| 20 | + tableData: [ | ||
| 21 | + { name: '产å“A', code: 'P0001', type: 'NORMAL', sort: 0, status: '0' }, | ||
| 22 | + { name: '产å“B', code: 'P0002', type: 'BROKEN', sort: 1, status: '1' }, | ||
| 23 | + ], | ||
| 68 | schemeList: [ | 24 | schemeList: [ |
| 69 | { type: 'el-input', key: 'name', label: 'åç§°', rules: [{ required: true, message: '请输入åç§°' }] }, | 25 | { type: 'el-input', key: 'name', label: 'åç§°', rules: [{ required: true, message: '请输入åç§°' }] }, |
| 70 | - { type: 'el-input', key: 'code', label: 'ç¼–ç ', rules: [{ required: true, message: '请输入编ç ' }], | ||
| 71 | - exclude: 'search', group: { label: '设置', key: 'setting', tip: { content: '哇哦', placement: 'left' } }, tip: 'ç¼–ç 为数å—' }, | ||
| 72 | - { type: 'el-input', key: 'type', label: '类型', group: { label: '设置', key: 'setting', icon: 'edit' }, formScheme: { tip: '类型éšä¾¿å¡«' } }, | 26 | + { type: 'el-input', key: 'code', label: 'ç¼–ç ', rules: [{ required: true, message: '请输入编ç ' }], exclude: 'search' }, |
| 27 | + { type: 'el-input', key: 'type', label: '类型' }, | ||
| 73 | { type: 'el-input-number', key: 'sort', label: '排åº', include: ['form', 'table'], sortable: true }, | 28 | { type: 'el-input-number', key: 'sort', label: '排åº', include: ['form', 'table'], sortable: true }, |
| 74 | - { type: 'el-input', key: 'status', label: '状æ€', group: { label: 'ä¿¡æ¯', key: 'info', icon: 'info' }, formScheme: { label: '状æ€ç ' } }, | ||
| 75 | - ], | ||
| 76 | - dataSource: [ | ||
| 77 | - { label: '选项A', value: 'A' }, | ||
| 78 | - { label: '选项B', value: 'B' }, | 29 | + { type: 'el-input', key: 'status', label: '状æ€' }, |
| 79 | ], | 30 | ], |
| 80 | } | 31 | } |
| 81 | }, | 32 | }, |
examples/views/docs/guide/installation.md
| @@ -5,11 +5,13 @@ | @@ -5,11 +5,13 @@ | ||
| 5 | > 注意:由于yunweidashi.com服务器的SSL证书未经过第三方机构签署,因此在使用本私有库时,需要在git中设置忽略ssl验证`git config http.sslVerify "false"` | 5 | > 注意:由于yunweidashi.com服务器的SSL证书未经过第三方机构签署,因此在使用本私有库时,需要在git中设置忽略ssl验证`git config http.sslVerify "false"` |
| 6 | 6 | ||
| 7 | ## npm安装 | 7 | ## npm安装 |
| 8 | + | ||
| 8 | ```bash | 9 | ```bash |
| 9 | -npm install --save git+https://frameworkweb:frame1WorkwEb@git.yunweidashi.com/framework/eagle-web-toolkit.git#{{ appVersion }} | 10 | +npm install --save git+https://frameworkweb:frame1WorkwEb@git.yunweidashi.com/framework/eagle-web-toolkit.git#版本号 |
| 10 | ``` | 11 | ``` |
| 11 | 12 | ||
| 12 | ## yarn安装 | 13 | ## yarn安装 |
| 14 | + | ||
| 13 | ```bash | 15 | ```bash |
| 14 | -yarn add git+https://frameworkweb:frame1WorkwEb@git.yunweidashi.com/framework/eagle-web-toolkit.git#{{ appVersion }} | 16 | +yarn add git+https://frameworkweb:frame1WorkwEb@git.yunweidashi.com/framework/eagle-web-toolkit.git#版本号 |
| 15 | ``` | 17 | ``` |
| 16 | \ No newline at end of file | 18 | \ No newline at end of file |
examples/views/layout/component.vue
| @@ -174,7 +174,6 @@ export default { | @@ -174,7 +174,6 @@ export default { | ||
| 174 | width: 150px !important; | 174 | width: 150px !important; |
| 175 | padding: 30px 0; | 175 | padding: 30px 0; |
| 176 | .anchor { | 176 | .anchor { |
| 177 | - width: 100%; | ||
| 178 | display: inline-block; | 177 | display: inline-block; |
| 179 | font-size: 12px; | 178 | font-size: 12px; |
| 180 | text-decoration: none; | 179 | text-decoration: none; |
package.json
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | "dependencies": { | 11 | "dependencies": { |
| 12 | "axios": "^0.19.0", | 12 | "axios": "^0.19.0", |
| 13 | "core-js": "^2.6.5", | 13 | "core-js": "^2.6.5", |
| 14 | - "element-ui": "^2.10.0", | 14 | + "element-ui": "^2.11.0", |
| 15 | "nprogress": "^0.2.0", | 15 | "nprogress": "^0.2.0", |
| 16 | "vue": "^2.6.10", | 16 | "vue": "^2.6.10", |
| 17 | "vue-router": "^3.0.3", | 17 | "vue-router": "^3.0.3", |
packages/scheme/index.vue
| @@ -127,8 +127,15 @@ | @@ -127,8 +127,15 @@ | ||
| 127 | :page-size="pageSize" :total="totalCount" v-bind="{ 'page-sizes': [10, 20, 50], layout: 'total, sizes, prev, pager, next, jumper', ...paginationProps }"></el-pagination> | 127 | :page-size="pageSize" :total="totalCount" v-bind="{ 'page-sizes': [10, 20, 50], layout: 'total, sizes, prev, pager, next, jumper', ...paginationProps }"></el-pagination> |
| 128 | </div> | 128 | </div> |
| 129 | </div> | 129 | </div> |
| 130 | - <el-dialog v-loading="dialogLoading" element-loading-background="rgba(255, 255, 255, 0.3)" :custom-class="dialogProps['custom-class'] || 'eagle-scheme__dialog'" :title="dialogProps.title || dialogTitle" :visible.sync="dialogVisible" v-bind="{ width: '65%', ...dialogProps }"> | ||
| 131 | - <component :is="_formComponent" v-if="dialogType === 'dialog-form' && !$scopedSlots['dialog-form'] && !$slots['dialog-form']" ref="eagle-form" :list="_formList" v-model="formModel" :params="{ formMode }" :span="formProps.span || 12" :formProps="formProps" @submit="handleSubmit" @cancel="handleCancel"> | 130 | + <!-- 弹出框 --> |
| 131 | + <component :is="dialogComponent || 'el-dialog'" v-loading="dialogLoading" element-loading-background="rgba(255, 255, 255, 0.3)" | ||
| 132 | + :custom-class="dialogProps['custom-class'] || 'eagle-scheme__dialog'" :title="dialogProps.title || dialogTitle" | ||
| 133 | + :visible.sync="dialogVisible" v-bind="{ width: '65%', size: dialogComponent === 'el-drawer' ? '50%' : undefined, ...dialogProps }" | ||
| 134 | + > | ||
| 135 | + <component :is="_formComponent" v-if="dialogType === 'dialog-form' && !$scopedSlots['dialog-form'] && !$slots['dialog-form']" | ||
| 136 | + ref="eagle-form" :list="_formList" v-model="formModel" :params="{ formMode }" :span="formProps.span || 12" :formProps="formProps" | ||
| 137 | + @submit="handleSubmit" @cancel="handleCancel" :style="dialogComponent === 'el-drawer' ? 'padding: 0 50px 0 10px;' : undefined" | ||
| 138 | + > | ||
| 132 | <!-- 表单分组具名插槽 --> | 139 | <!-- 表单分组具名插槽 --> |
| 133 | <template v-for="key in formGroupSlotsKeys"> | 140 | <template v-for="key in formGroupSlotsKeys"> |
| 134 | <slot v-if="$scopedSlots[`form-${key}`] || $slots[`form-${key}`]" :name="`form-${key}`" :slot="key" :model="formModel"></slot> | 141 | <slot v-if="$scopedSlots[`form-${key}`] || $slots[`form-${key}`]" :name="`form-${key}`" :slot="key" :model="formModel"></slot> |
| @@ -139,7 +146,7 @@ | @@ -139,7 +146,7 @@ | ||
| 139 | <slot v-if="$scopedSlots[`form-label-${item.key}`] || $slots[`form-label-${item.key}`]" :name="`form-label-${item.key}`" :slot="`label-${item.key}`" :model="formModel" v-bind="item"></slot> | 146 | <slot v-if="$scopedSlots[`form-label-${item.key}`] || $slots[`form-label-${item.key}`]" :name="`form-label-${item.key}`" :slot="`label-${item.key}`" :model="formModel" v-bind="item"></slot> |
| 140 | </template> | 147 | </template> |
| 141 | </component> | 148 | </component> |
| 142 | - <component :is="_detailComponent" v-else-if="dialogType === 'dialog-view' && !$scopedSlots['dialog-view'] && !$slots['dialog-view']" v-model="formModel" :list="list || detailList || _formList" :span="detailProps.span || 8" :formProps="detailProps"> | 149 | + <component :is="_detailComponent" v-else-if="dialogType === 'dialog-view' && !$scopedSlots['dialog-view'] && !$slots['dialog-view']" v-model="formModel" :list="list || detailList || _formList" :span="detailProps.span || dialogComponent === 'el-drawer' ? 12 : 8" :formProps="detailProps"> |
| 143 | <!-- 表单分组具名插槽 --> | 150 | <!-- 表单分组具名插槽 --> |
| 144 | <template v-for="key in formGroupSlotsKeys"> | 151 | <template v-for="key in formGroupSlotsKeys"> |
| 145 | <slot v-if="$scopedSlots[`view-${key}`] || $slots[`view-${key}`]" :name="`view-${key}`" :slot="key" :model="formModel"></slot> | 152 | <slot v-if="$scopedSlots[`view-${key}`] || $slots[`view-${key}`]" :name="`view-${key}`" :slot="key" :model="formModel"></slot> |
| @@ -151,7 +158,7 @@ | @@ -151,7 +158,7 @@ | ||
| 151 | </component> | 158 | </component> |
| 152 | <!-- 自定义弹出框内容插槽 --> | 159 | <!-- 自定义弹出框内容插槽 --> |
| 153 | <slot v-else :name="dialogType" :row="tableCurrentRow" :hideDialog="hideDialog"></slot> | 160 | <slot v-else :name="dialogType" :row="tableCurrentRow" :hideDialog="hideDialog"></slot> |
| 154 | - </el-dialog> | 161 | + </component> |
| 155 | </div> | 162 | </div> |
| 156 | </template> | 163 | </template> |
| 157 | 164 | ||
| @@ -164,6 +171,12 @@ let _$http = null; | @@ -164,6 +171,12 @@ let _$http = null; | ||
| 164 | export default { | 171 | export default { |
| 165 | name: 'Scheme', | 172 | name: 'Scheme', |
| 166 | props: { | 173 | props: { |
| 174 | + value: { | ||
| 175 | + type: Array, | ||
| 176 | + default: () => { | ||
| 177 | + return []; | ||
| 178 | + } | ||
| 179 | + }, | ||
| 167 | // 配置列表 | 180 | // 配置列表 |
| 168 | list: Array, | 181 | list: Array, |
| 169 | // 配置选项 | 182 | // 配置选项 |
| @@ -209,6 +222,11 @@ export default { | @@ -209,6 +222,11 @@ export default { | ||
| 209 | type: Object, | 222 | type: Object, |
| 210 | default() { return {} } | 223 | default() { return {} } |
| 211 | }, | 224 | }, |
| 225 | + // 弹出框类型 | ||
| 226 | + dialogComponent: { | ||
| 227 | + type: String, | ||
| 228 | + default: 'el-dialog' | ||
| 229 | + }, | ||
| 212 | // 弹出框参数 | 230 | // 弹出框参数 |
| 213 | dialogProps: { | 231 | dialogProps: { |
| 214 | type: Object, | 232 | type: Object, |
| @@ -271,6 +289,9 @@ export default { | @@ -271,6 +289,9 @@ export default { | ||
| 271 | } | 289 | } |
| 272 | }, | 290 | }, |
| 273 | mounted() { | 291 | mounted() { |
| 292 | + this.tableData = this.value; | ||
| 293 | + this.totalCount = this.value.length; | ||
| 294 | + this.tableDataOrigin = this.value; | ||
| 274 | // 设置自动加载数据 | 295 | // 设置自动加载数据 |
| 275 | if (this.option.auto !== false) { | 296 | if (this.option.auto !== false) { |
| 276 | this.handleSearch(); | 297 | this.handleSearch(); |
| @@ -313,6 +334,18 @@ export default { | @@ -313,6 +334,18 @@ export default { | ||
| 313 | } | 334 | } |
| 314 | } | 335 | } |
| 315 | }, | 336 | }, |
| 337 | + watch: { | ||
| 338 | + value(val) { | ||
| 339 | + this.tableData = val; | ||
| 340 | + }, | ||
| 341 | + tableData: { | ||
| 342 | + handler(val) { | ||
| 343 | + this.$emit("input", val); | ||
| 344 | + this.$emit("change", val); | ||
| 345 | + }, | ||
| 346 | + deep: true | ||
| 347 | + } | ||
| 348 | + }, | ||
| 316 | methods: { | 349 | methods: { |
| 317 | // 查询数据 | 350 | // 查询数据 |
| 318 | async handleSearch(value) { | 351 | async handleSearch(value) { |
| @@ -356,14 +389,35 @@ export default { | @@ -356,14 +389,35 @@ export default { | ||
| 356 | }); | 389 | }); |
| 357 | } else { | 390 | } else { |
| 358 | this.tableLoading = true; | 391 | this.tableLoading = true; |
| 359 | - setTimeout(() => { this.tableLoading = false; }, 1500); | 392 | + this.$nextTick(() => { |
| 393 | + let searchModelCount = false; | ||
| 394 | + for (let modelKey in this.searchModel) { | ||
| 395 | + let modelValue = this.searchModel[modelKey]; | ||
| 396 | + if (modelValue) { | ||
| 397 | + searchModelCount += 1; | ||
| 398 | + break; | ||
| 399 | + } | ||
| 400 | + } | ||
| 401 | + this.tableData = searchModelCount > 0 ? this.tableDataOrigin.filter(data => { | ||
| 402 | + let result = false; | ||
| 403 | + for (let modelKey in this.searchModel) { | ||
| 404 | + let modelValue = this.searchModel[modelKey]; | ||
| 405 | + if (data[modelKey] === modelValue) { | ||
| 406 | + result = true; | ||
| 407 | + break; | ||
| 408 | + } | ||
| 409 | + } | ||
| 410 | + return result; | ||
| 411 | + }) : this.tableDataOrigin; | ||
| 412 | + this.tableLoading = false; | ||
| 413 | + }); | ||
| 360 | } | 414 | } |
| 361 | }, | 415 | }, |
| 362 | // 查看按钮 | 416 | // 查看按钮 |
| 363 | - handleView({ row }) { | 417 | + handleView({ row, $index }) { |
| 364 | this.dialogTitle = this.i18n('eagle.scheme.detail') || '详情'; | 418 | this.dialogTitle = this.i18n('eagle.scheme.detail') || '详情'; |
| 365 | this.dialogType = 'dialog-view'; | 419 | this.dialogType = 'dialog-view'; |
| 366 | - this.tableCurrentRow = row; | 420 | + this.tableCurrentRow = { ...row, $index }; |
| 367 | this.resetFormModel(); | 421 | this.resetFormModel(); |
| 368 | this.formMode = "view"; | 422 | this.formMode = "view"; |
| 369 | this.$emit('dialog-change', this.dialogType); | 423 | this.$emit('dialog-change', this.dialogType); |
| @@ -396,7 +450,11 @@ export default { | @@ -396,7 +450,11 @@ export default { | ||
| 396 | this.dialogLoading = false; | 450 | this.dialogLoading = false; |
| 397 | }); | 451 | }); |
| 398 | } else { | 452 | } else { |
| 399 | - this.setFormModel(param); | 453 | + this.dialogLoading = true; |
| 454 | + this.$nextTick(() => { | ||
| 455 | + this.setFormModel(param); | ||
| 456 | + this.dialogLoading = false; | ||
| 457 | + }); | ||
| 400 | } | 458 | } |
| 401 | }, | 459 | }, |
| 402 | // 新增按钮 | 460 | // 新增按钮 |
| @@ -410,10 +468,10 @@ export default { | @@ -410,10 +468,10 @@ export default { | ||
| 410 | this.showDialog(); | 468 | this.showDialog(); |
| 411 | }, | 469 | }, |
| 412 | // 编辑按钮 | 470 | // 编辑按钮 |
| 413 | - async handleEdit({ row }) { | 471 | + async handleEdit({ row, $index }) { |
| 414 | this.dialogTitle = this.i18n('eagle.scheme.edit') || '编辑'; | 472 | this.dialogTitle = this.i18n('eagle.scheme.edit') || '编辑'; |
| 415 | this.dialogType = 'dialog-form'; | 473 | this.dialogType = 'dialog-form'; |
| 416 | - this.tableCurrentRow = row; | 474 | + this.tableCurrentRow = { ...row, $index }; |
| 417 | this.resetFormModel(); | 475 | this.resetFormModel(); |
| 418 | this.formMode = "edit"; | 476 | this.formMode = "edit"; |
| 419 | this.$emit('dialog-change', this.dialogType); | 477 | this.$emit('dialog-change', this.dialogType); |
| @@ -447,14 +505,16 @@ export default { | @@ -447,14 +505,16 @@ export default { | ||
| 447 | }); | 505 | }); |
| 448 | } else { | 506 | } else { |
| 449 | this.dialogLoading = true; | 507 | this.dialogLoading = true; |
| 450 | - this.setFormModel(param); | ||
| 451 | - setTimeout(() => { this.dialogLoading = false; }, 1500); | 508 | + this.$nextTick(() => { |
| 509 | + this.setFormModel(param); | ||
| 510 | + this.dialogLoading = false; | ||
| 511 | + }); | ||
| 452 | } | 512 | } |
| 453 | }, | 513 | }, |
| 454 | // 删除按钮 | 514 | // 删除按钮 |
| 455 | handleDelete(type, scope) { | 515 | handleDelete(type, scope) { |
| 456 | if (type === 'one') { | 516 | if (type === 'one') { |
| 457 | - this.doDelete([scope.row]); | 517 | + this.doDelete([{ ...scope.row, $index: scope['$index'] }]); |
| 458 | } else if (type === 'more') { | 518 | } else if (type === 'more') { |
| 459 | this.$confirm(`${this.i18n('eagle.scheme.mulDeleteConfirm') || '是否删除已选中的'} [ ${this.tableSelection.length} ] ${this.i18n('eagle.scheme.item') || '项'}`, this.i18n('eagle.scheme.tip') || '提示', { | 519 | this.$confirm(`${this.i18n('eagle.scheme.mulDeleteConfirm') || '是否删除已选中的'} [ ${this.tableSelection.length} ] ${this.i18n('eagle.scheme.item') || '项'}`, this.i18n('eagle.scheme.tip') || '提示', { |
| 460 | confirmButtonText: this.i18n('eagle.scheme.confirm') || '确定', | 520 | confirmButtonText: this.i18n('eagle.scheme.confirm') || '确定', |
| @@ -500,6 +560,9 @@ export default { | @@ -500,6 +560,9 @@ export default { | ||
| 500 | .finally(() => { | 560 | .finally(() => { |
| 501 | this.dialogLoading = false; | 561 | this.dialogLoading = false; |
| 502 | }); | 562 | }); |
| 563 | + } else { | ||
| 564 | + this.tableDataOrigin.splice(selection[0].$index, 1); | ||
| 565 | + this.hideDialog(); | ||
| 503 | } | 566 | } |
| 504 | }, | 567 | }, |
| 505 | // 重置表单值 | 568 | // 重置表单值 |
| @@ -577,6 +640,10 @@ export default { | @@ -577,6 +640,10 @@ export default { | ||
| 577 | .finally(() => { | 640 | .finally(() => { |
| 578 | this.dialogLoading = false; | 641 | this.dialogLoading = false; |
| 579 | }); | 642 | }); |
| 643 | + } else { | ||
| 644 | + this.tableDataOrigin.push(param); | ||
| 645 | + this.totalCount = this.tableDataOrigin.length; | ||
| 646 | + this.hideDialog(); | ||
| 580 | } | 647 | } |
| 581 | }, | 648 | }, |
| 582 | // 编辑提交逻辑 | 649 | // 编辑提交逻辑 |
| @@ -609,6 +676,9 @@ export default { | @@ -609,6 +676,9 @@ export default { | ||
| 609 | .finally(() => { | 676 | .finally(() => { |
| 610 | this.dialogLoading = false; | 677 | this.dialogLoading = false; |
| 611 | }); | 678 | }); |
| 679 | + } else { | ||
| 680 | + this.$set(this.tableDataOrigin, this.tableCurrentRow.$index, param); | ||
| 681 | + this.hideDialog(); | ||
| 612 | } | 682 | } |
| 613 | }, | 683 | }, |
| 614 | // 表单取消 | 684 | // 表单取消 |
webpack/markdown-loader.js
| @@ -15,11 +15,11 @@ module.exports = function(source) { | @@ -15,11 +15,11 @@ module.exports = function(source) { | ||
| 15 | // 将markdown中的代码块用hljs高亮显示 | 15 | // 将markdown中的代码块用hljs高亮显示 |
| 16 | highlight: function(str, lang) { | 16 | highlight: function(str, lang) { |
| 17 | if (lang && hljs.getLanguage(lang)) { | 17 | if (lang && hljs.getLanguage(lang)) { |
| 18 | - return `<pre class="hljs" style="white-space: pre-wrap;word-wrap: break-word;"><code>${ | 18 | + return `<pre class="hljs"><code>${ |
| 19 | hljs.highlight(lang, str.replace(/\{\{/g, '{ {').replace(/\}\}/g, '} }'), true).value | 19 | hljs.highlight(lang, str.replace(/\{\{/g, '{ {').replace(/\}\}/g, '} }'), true).value |
| 20 | }</code></pre>`; | 20 | }</code></pre>`; |
| 21 | } | 21 | } |
| 22 | - return `<pre class="hljs" style="white-space: pre-wrap;word-wrap: break-word;"><code>${markdownIt.utils.escapeHtml( | 22 | + return `<pre class="hljs"><code>${markdownIt.utils.escapeHtml( |
| 23 | str.replace(/\{\{/g, '{ {').replace(/\}\}/g, '} }') | 23 | str.replace(/\{\{/g, '{ {').replace(/\}\}/g, '} }') |
| 24 | )}</code></pre>`; | 24 | )}</code></pre>`; |
| 25 | } | 25 | } |
| @@ -114,7 +114,7 @@ module.exports = function(source) { | @@ -114,7 +114,7 @@ module.exports = function(source) { | ||
| 114 | </div> | 114 | </div> |
| 115 | </template> | 115 | </template> |
| 116 | <script> | 116 | <script> |
| 117 | - export default { | 117 | + export default { |
| 118 | name: 'eagle-component-doc', | 118 | name: 'eagle-component-doc', |
| 119 | components: { | 119 | components: { |
| 120 | ${componentCodeList.join(",")} | 120 | ${componentCodeList.join(",")} |
yarn.lock
| @@ -2869,10 +2869,10 @@ electron-to-chromium@^1.3.164: | @@ -2869,10 +2869,10 @@ electron-to-chromium@^1.3.164: | ||
| 2869 | resolved "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.186.tgz#17d87e7661121724ea4c81c9960c3f26a5228c0c" | 2869 | resolved "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.186.tgz#17d87e7661121724ea4c81c9960c3f26a5228c0c" |
| 2870 | integrity sha1-F9h+dmESFyTqTIHJlgw/JqUijAw= | 2870 | integrity sha1-F9h+dmESFyTqTIHJlgw/JqUijAw= |
| 2871 | 2871 | ||
| 2872 | -element-ui@^2.10.0: | ||
| 2873 | - version "2.10.1" | ||
| 2874 | - resolved "https://registry.npm.taobao.org/element-ui/download/element-ui-2.10.1.tgz?cache=0&sync_timestamp=1562053824530&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.10.1.tgz#1011016e50e76f5dae6fbf9c86e53b6e53fcb9eb" | ||
| 2875 | - integrity sha1-EBEBblDnb12ub7+chuU7blP8ues= | 2872 | +element-ui@^2.11.0: |
| 2873 | + version "2.11.1" | ||
| 2874 | + resolved "https://registry.npm.taobao.org/element-ui/download/element-ui-2.11.1.tgz#2b67f9eee3eda2e6884873c1c589cbe30d9a9d60" | ||
| 2875 | + integrity sha1-K2f57uPtouaISHPBxYnL4w2anWA= | ||
| 2876 | dependencies: | 2876 | dependencies: |
| 2877 | async-validator "~1.8.1" | 2877 | async-validator "~1.8.1" |
| 2878 | babel-helper-vue-jsx-merge-props "^2.0.0" | 2878 | babel-helper-vue-jsx-merge-props "^2.0.0" |