|
@@ -2,19 +2,24 @@
|
|
|
<div id="nameList">
|
|
|
<el-row>
|
|
|
<el-col :span="12" v-for="(stu, index) in data" :key="index" class="list">
|
|
|
- <p class="name">{{ stu.name }}</p>
|
|
|
- <p class="job">{{ stu.job }}</p>
|
|
|
- <p class="job">性别:{{ stu.gender }}</p>
|
|
|
- <p class="job">寝室号:{{ stu.bedroom }}</p>
|
|
|
+ <div @click="changeJob(stu)">
|
|
|
+ <p class="name">{{ stu.name }}</p>
|
|
|
+ <p class="job">{{ stu.job }}</p>
|
|
|
+ <p class="job">性别:{{ stu.gender }}</p>
|
|
|
+ <p class="job">寝室号:{{ stu.bedroom }}</p>
|
|
|
+ </div>
|
|
|
<p>
|
|
|
<i class="el-icon-phone"></i><el-link href="tel:01234567890" :underline="false">:{{ stu.phone }}</el-link>
|
|
|
</p>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <van-action-sheet v-model="show" :actions="selectList" cancel-text="取消" @select="toSelect" :description="form.name" close-on-click-action />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import _ from 'lodash';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
export default {
|
|
|
name: 'nameList',
|
|
@@ -23,10 +28,25 @@ export default {
|
|
|
},
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ show: false,
|
|
|
+ form: {},
|
|
|
+ selectList: [{ name: '文艺委员' }, { name: '安全委员' }, { name: '普通学员' }],
|
|
|
+ };
|
|
|
},
|
|
|
created() {},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ changeJob(data) {
|
|
|
+ this.show = true;
|
|
|
+ this.$set(this, `form`, _.cloneDeep(data));
|
|
|
+ },
|
|
|
+ toSelect({ name: job }) {
|
|
|
+ let info = _.cloneDeep(this.form);
|
|
|
+ info.job = job;
|
|
|
+ console.log('in function:');
|
|
|
+ this.$emit('updateStu', info);
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
pageTitle() {
|