|
@@ -61,6 +61,15 @@
|
|
align-items: center;
|
|
align-items: center;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .item-2 {
|
|
|
|
+ /* 禁止换行 - */
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ /* 超出部分隐藏 */
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ /* 超出部分显示省略号 */
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
|
|
+
|
|
.copy-btn {
|
|
.copy-btn {
|
|
color: #409EFF;
|
|
color: #409EFF;
|
|
}
|
|
}
|
|
@@ -116,7 +125,7 @@
|
|
<el-card shadow="hover" class="item-card">
|
|
<el-card shadow="hover" class="item-card">
|
|
<div slot="header" class="item-content">
|
|
<div slot="header" class="item-content">
|
|
<span>{{ item.key }}</span>
|
|
<span>{{ item.key }}</span>
|
|
- <div class="action-buttons" >
|
|
|
|
|
|
+ <div class="action-buttons">
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
class="drag-handle">
|
|
class="drag-handle">
|
|
@@ -134,8 +143,8 @@
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="item-content" >
|
|
|
|
-<!-- 内容第一行,不能换行,用css控制,多余的隐藏-->
|
|
|
|
|
|
+ <div class="item-2">
|
|
|
|
+ <!-- 内容第一行,不能换行,用css控制,多余的隐藏-->
|
|
<span>{{ item.value }}</span>
|
|
<span>{{ item.value }}</span>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
@@ -144,7 +153,7 @@
|
|
|
|
|
|
<div v-if="!readOnly">
|
|
<div v-if="!readOnly">
|
|
<!-- 添加内容项 -->
|
|
<!-- 添加内容项 -->
|
|
- <div class="add-item" >
|
|
|
|
|
|
+ <div class="add-item">
|
|
<el-input
|
|
<el-input
|
|
v-model="newItemKey[activeTab]"
|
|
v-model="newItemKey[activeTab]"
|
|
placeholder="键名"
|
|
placeholder="键名"
|
|
@@ -200,7 +209,7 @@
|
|
<script>
|
|
<script>
|
|
// let all_data = {};
|
|
// let all_data = {};
|
|
let pageManager = new PageManager();
|
|
let pageManager = new PageManager();
|
|
- pageManager.type='copy-page';
|
|
|
|
|
|
+ pageManager.type = 'copy-page';
|
|
|
|
|
|
pageManager.setNameCallBack(() => {
|
|
pageManager.setNameCallBack(() => {
|
|
let title = localStorage.getItem("title");
|
|
let title = localStorage.getItem("title");
|
|
@@ -211,7 +220,7 @@
|
|
let _this = new Vue({
|
|
let _this = new Vue({
|
|
el: '#app',
|
|
el: '#app',
|
|
data: {
|
|
data: {
|
|
- all_data:{},
|
|
|
|
|
|
+ all_data: {},
|
|
activeTab: 'tab1',
|
|
activeTab: 'tab1',
|
|
myObj: {
|
|
myObj: {
|
|
"tab1": [
|
|
"tab1": [
|
|
@@ -239,7 +248,7 @@
|
|
if (res && res.content) {
|
|
if (res && res.content) {
|
|
// 初始化数据
|
|
// 初始化数据
|
|
let showContent = res.content;
|
|
let showContent = res.content;
|
|
- if (pageManager.isBackup){
|
|
|
|
|
|
+ if (pageManager.isBackup) {
|
|
// 如果是备份
|
|
// 如果是备份
|
|
showContent = res.content_back;
|
|
showContent = res.content_back;
|
|
}
|
|
}
|
|
@@ -342,7 +351,7 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
editContentItem(tabName, key, value) {
|
|
editContentItem(tabName, key, value) {
|
|
- this.editingItem = { tabName, key, value };
|
|
|
|
|
|
+ this.editingItem = {tabName, key, value};
|
|
this.editingKey = key;
|
|
this.editingKey = key;
|
|
|
|
|
|
// 保存原始值用于回滚
|
|
// 保存原始值用于回滚
|
|
@@ -356,7 +365,7 @@
|
|
inputPlaceholder: '输入新Key',
|
|
inputPlaceholder: '输入新Key',
|
|
closeOnClickModal: false,
|
|
closeOnClickModal: false,
|
|
inputValue: key
|
|
inputValue: key
|
|
- }).then(({ value: newKey }) => {
|
|
|
|
|
|
+ }).then(({value: newKey}) => {
|
|
// 第二步:修改Value
|
|
// 第二步:修改Value
|
|
return this.$prompt('修改值', '编辑内容', {
|
|
return this.$prompt('修改值', '编辑内容', {
|
|
confirmButtonText: '保存',
|
|
confirmButtonText: '保存',
|
|
@@ -364,7 +373,7 @@
|
|
inputPlaceholder: '输入新值',
|
|
inputPlaceholder: '输入新值',
|
|
closeOnClickModal: false,
|
|
closeOnClickModal: false,
|
|
inputValue: value
|
|
inputValue: value
|
|
- }).then(({ value: newValue }) => {
|
|
|
|
|
|
+ }).then(({value: newValue}) => {
|
|
// 更新数据
|
|
// 更新数据
|
|
const items = this.myObj[tabName];
|
|
const items = this.myObj[tabName];
|
|
const itemIndex = items.findIndex(item => item.key === originalKey);
|
|
const itemIndex = items.findIndex(item => item.key === originalKey);
|