|
|
@@ -10,31 +10,15 @@
|
|
|
</t-th>
|
|
|
</t-tr>
|
|
|
<t-tr v-for="(item, index) in list.data" :key="item.id">
|
|
|
- <t-td
|
|
|
- v-for="(column, colIndex) in columns"
|
|
|
- :key="colIndex"
|
|
|
- :align="column.align"
|
|
|
- :color="column.color"
|
|
|
- >
|
|
|
+ <t-td v-for="(column, colIndex) in columns" :key="colIndex" :align="column.align" :color="column.color" >
|
|
|
<view v-if="column.custom == 'edit'" class="edit-td">
|
|
|
- <text
|
|
|
- :class="['iconfont', 'iconshangyi', { disabled: index == 0 }]"
|
|
|
- @click.stop="upSortByIndex(item, index)"
|
|
|
- ></text>
|
|
|
- <text
|
|
|
- :class="[
|
|
|
- 'iconfont',
|
|
|
- 'iconxiayi',
|
|
|
- { disabled: index >= dataList.length - 1 }
|
|
|
- ]"
|
|
|
- @click.stop="downSortByIndex(item, index)"
|
|
|
- ></text>
|
|
|
- <text class="iconfont iconbianji" @click.stop="editEvent(item, index)">
|
|
|
- </text>
|
|
|
- <text class="iconfont icondelete" @click.stop="delEvent(item, index)">
|
|
|
- </text>
|
|
|
+ <text v-if="isRank" :class="['iconfont', 'iconshangyi', { disabled: index == 0 }]" @click.stop="upSortByIndex(item, index)"></text>
|
|
|
+ <text v-if="isRank" :class="['iconfont','iconxiayi',{ disabled: index >= dataList.length - 1 }]" @click.stop="downSortByIndex(item, index)"></text>
|
|
|
+ <text v-if="!isRank" class="iconfont iconbianji" @click.stop="addEvent(item, index)"></text>
|
|
|
+ <text v-if="!isRank" class="iconfont icondelete" @click.stop="delEvent(item, index)"></text>
|
|
|
+ <text v-if="!isRank" class="iconfont iconxiangyou" @click.stop="editEvent(item, index)" style="margin:0;font-size: 20rpx"></text>
|
|
|
</view>
|
|
|
- <view v-else>
|
|
|
+ <view v-else @click.stop="editEvent(item, index)">
|
|
|
{{ item[column.dataIndex] || "" }}
|
|
|
</view>
|
|
|
</t-td>
|
|
|
@@ -48,7 +32,10 @@
|
|
|
</scroll-view>
|
|
|
|
|
|
<view class="under-bar">
|
|
|
- <button :class="['admin-button-com']" @click="addEvent">
|
|
|
+ <button class="admin-button-com" :class="isRank?'active':''" @click="isRank = !isRank">
|
|
|
+ {{isRank?'确定排序':'排序'}}
|
|
|
+ </button>
|
|
|
+ <button class="admin-button-com" @click="addEvent">
|
|
|
添加
|
|
|
</button>
|
|
|
</view>
|
|
|
@@ -85,6 +72,7 @@ export default {
|
|
|
mixins: [list],
|
|
|
data() {
|
|
|
return {
|
|
|
+ isRank:false,
|
|
|
showEdit: false,
|
|
|
editInfo: {
|
|
|
name: "",
|
|
|
@@ -221,7 +209,15 @@ export default {
|
|
|
complete: () => {}
|
|
|
});
|
|
|
},
|
|
|
- addEvent() {
|
|
|
+ addEvent(obj) {
|
|
|
+ if(obj){
|
|
|
+ this.editInfo = {
|
|
|
+ name: obj.name,
|
|
|
+ id: obj.id,
|
|
|
+ inTurn: obj.inTurn
|
|
|
+ },
|
|
|
+ console.log(obj)
|
|
|
+ }
|
|
|
this.showEdit = true;
|
|
|
},
|
|
|
closeModal() {
|
|
|
@@ -232,7 +228,11 @@ export default {
|
|
|
};
|
|
|
this.showEdit = false;
|
|
|
},
|
|
|
- async affirmEvent() {
|
|
|
+ async affirmEvent(e) {
|
|
|
+ if(e.index==0){
|
|
|
+ this.closeModal();
|
|
|
+ return
|
|
|
+ }
|
|
|
try {
|
|
|
let params = {
|
|
|
...this.editInfo
|
|
|
@@ -275,8 +275,14 @@ export default {
|
|
|
justify-content: center;
|
|
|
margin: 0 20upx;
|
|
|
// width: 140upx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ background: #0099ff;
|
|
|
height: 70upx;
|
|
|
font-size: 32upx;
|
|
|
+ &.active{
|
|
|
+ background: #ff0000;
|
|
|
+ border:1px solid #ff0000;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.main-view {
|