dbsd_kczx/src/views/site/tingKeZuJi/list.vue

87 lines
2.4 KiB
Vue
Raw Normal View History

<template>
<!-- <a-list item-layout="horizontal" :data-source="list" :grid="{ gutter: 16, xs: 1, sm: 2, md: 4, lg: 4, xl: 6, xxl: 3, xxxl: 2 }"> -->
<a-list item-layout="horizontal" :data-source="list">
<template #renderItem="{ item }">
<a-list-item>
<a-list-item-meta>
<template #title>
<div class="wenZiJiaCu">
听了&nbsp;&nbsp;&nbsp;&nbsp;{{ item.kkdw }}&nbsp;&nbsp;&nbsp;&nbsp;{{item.skjs}}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.kcmc }}
</div>
</template>
<template #description>
2023-04-09 21:54:59 +08:00
<!-- -{{ item }}- -->
<span v-if="item.score" style="color: #337ab7;" @click="viewModal.view(item)">已评分{{ item.score }}</span>
<span v-else style="color: #337ab7;" @click="tingKeZuJiAddModal.view(item)"><FormOutlined/>填写评价</span>
</template>
<template #avatar>
<div class="wenZiJuZhong">
<TeamOutlined/>
<div>{{ item.shijian }}</div>
<div style="color: #1ab394;">{{ item.tkrq }}</div>
</div>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
2023-04-09 21:54:59 +08:00
<addModalPage ref="tingKeZuJiAddModal"/>
<viewModalPage ref="viewModal"/>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
2023-04-10 23:14:07 +08:00
import { getUserId,getSysConfig } from '/@/views/site/utils/index';
2023-04-09 21:54:59 +08:00
import addModalPage from '/@/views/site/tingKeZuJi/components/addModal.vue';
import viewModalPage from '/@/views/site/tingKeZuJi/components/viewModal.vue';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/kcTingke/kcTingke/findTingKeZuJiBytingketimeAndUserId'
}
2023-04-09 21:54:59 +08:00
const tingKeZuJiAddModal = ref();
const viewModal = ref();
2023-04-12 23:21:42 +08:00
const props = defineProps({
queryParam: { type: Object, default: () => ({}) },
});
/**
* 列表接口
* @param params
*/
const listApi = (params) => defHttp.get({ url: Api.list, params });
const list = ref<any>([]);
onMounted(() => {
2023-04-12 23:21:42 +08:00
init();
});
2023-04-12 23:21:42 +08:00
function init() {
console.log('init');
listApi({ userid: getUserId(), tingketime: getSysConfig().bxqkssj, ...props.queryParam }).then(res => {
list.value = res ?? [];
});
2023-04-12 23:21:42 +08:00
}
function onSearch() {
console.log('onSearch');
init();
}
defineExpose({
onSearch
});
</script>
<style lang="less" scoped>
.wenZiJuZhong {
text-align: center;
}
.wenZiJiaCu {
font-weight: 700;
}
</style>