123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <div class="operating-area">
-
-
- <div class="left-btn-box">
- <a-tooltip title="保存">
- <a v-if="toolbars.includes('save')" @click="$emit('handleSave')">
- <a-icon type="save" />
- <span v-if="showToolbarsText">保存</span>
- </a>
- </a-tooltip>
- <a-tooltip title="预览">
- <a v-if="toolbars.includes('preview')" @click="$emit('handlePreview')">
- <a-icon type="chrome" />
- <span v-if="showToolbarsText">预览</span>
- </a>
- </a-tooltip>
- <a-tooltip title="查询">
- <a v-if="toolbars.includes('preview')" @click="$emit('handleQuery')">
- <a-icon type="search" />
- <span v-if="showToolbarsText">查询</span>
- </a>
- </a-tooltip>
- <a-tooltip title="导入">
- <a
- v-if="toolbars.includes('importJson')"
- @click="$emit('handleOpenImportJsonModal')"
- >
- <a-icon type="upload" />
- <span v-if="showToolbarsText">导入</span>
- </a>
- </a-tooltip>
- <a-tooltip title="生成JSON">
- <a
- v-if="toolbars.includes('exportJson')"
- @click="$emit('handleOpenJsonModal')"
- >
- <a-icon type="credit-card" />
- <span v-if="showToolbarsText">生成JSON</span>
- </a>
- </a-tooltip>
- <a-tooltip title="生成代码">
- <a
- v-if="toolbars.includes('exportCode')"
- @click="$emit('handleOpenCodeModal')"
- >
- <a-icon type="code" />
- <span v-if="showToolbarsText">生成代码</span>
- </a>
- </a-tooltip>
- <a-tooltip title="清空">
- <a v-if="toolbars.includes('reset')" @click="$emit('handleReset')">
- <a-icon type="delete" />
- <span v-if="showToolbarsText">清空</span>
- </a>
- </a-tooltip>
- <a-divider type="vertical" />
- <a-tooltip title="撤销">
- <a
- v-if="toolbars.includes('undo')"
- :class="{ disabled: !(recordList.length > 0) }"
- @click="$emit('handleUndo')"
- >
- <a-icon type="undo" />
- <span v-if="showToolbarsText">撤销</span>
- </a>
- </a-tooltip>
- <a-tooltip title="重做">
- <a
- v-if="toolbars.includes('redo')"
- :class="{ disabled: !(redoList.length > 0) }"
- @click="$emit('handleRedo')"
- >
- <a-icon type="redo" />
- <span v-if="showToolbarsText">重做</span>
- </a>
- </a-tooltip>
-
- <slot name="left-action"></slot>
-
- </div>
-
-
- <div class="right-btn-box">
-
- <slot name="right-action"></slot>
-
- <a-tooltip title="关闭">
- <a v-if="toolbars.includes('close')" @click="$emit('handleClose')">
- <a-icon type="close" />
- </a>
- </a-tooltip>
- </div>
-
-
- </div>
-
- </template>
- <script>
- export default {
- props: {
- toolbars: {
- type: Array,
- default: () => [
- "save",
- "preview",
- "importJson",
- "exportJson",
- "exportCode",
- "reset",
- "close"
- ]
- },
- recordList: {
- type: Array,
- require: true
- },
- redoList: {
- type: Array,
- require: true
- },
- showToolbarsText: {
- type: Boolean,
- default: false
- }
- }
- };
- </script>
|