説明なし

BaseResource.vue 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <router-link class="list-item" :to="'reso_show?id='+itemSingle.id" target="_blank">
  3. <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
  4. <div class="list-info">
  5. <div class="list-tit list-topic">{{itemSingle.name}}</div>
  6. <div class="list-owner">{{ownerName}}<em class="authicon" :class="ownerAuth"></em></div>
  7. <div class="list-desc" v-if="itemSingle.cnt">用途:{{itemSingle.cnt}}</div>
  8. </div>
  9. </router-link>
  10. </template>
  11. <script>
  12. import util from '@/libs/util';
  13. import httpUrl from '@/libs/http';
  14. export default {
  15. props: {
  16. itemSingle: {
  17. type: Object
  18. }
  19. },
  20. data() {
  21. return {
  22. linkway: util.defaultSet.link.resource + this.itemSingle.id,
  23. imgUrl: (this.itemSingle && this.itemSingle.images) ? util.ImageUrl('resource/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.resource,
  24. ownerName: '',
  25. ownerAuth: ''
  26. };
  27. },
  28. created() {
  29. this.ownerByond(this.itemSingle);
  30. },
  31. methods: {
  32. ownerByond(item) {
  33. if (item.otype === '1') {
  34. this.$axios.get(httpUrl.kxQurey.professor.query + item.oid, {
  35. }, (res) => {
  36. if (res.success) {
  37. let $info = res.data;
  38. this.ownerName = $info.name;
  39. this.ownerAuth = util.autho($info.authType, $info.orgAuth, $info.authStatus);
  40. }
  41. });
  42. } else if (item.otype === '2') {
  43. this.$axios.get(httpUrl.kxQurey.org.query + item.oid, {
  44. }, (res) => {
  45. if (res.success) {
  46. let $info = res.data;
  47. this.ownerName = $info.forShort ? $info.forShort : $info.name;
  48. this.ownerAuth = $info.authStatus === '3' ? 'icon-com' : '';
  49. }
  50. });
  51. }
  52. }
  53. }
  54. };
  55. </script>