zs преди 6 месеца
родител
ревизия
7ced1a4dc6
променени са 4 файла, в които са добавени 18 реда и са изтрити 26 реда
  1. 8 20
      src/components/custom/custom-upload.vue
  2. 5 1
      src/views/detail/studyDetail.vue
  3. 4 4
      src/views/twelve/index.vue
  4. 1 1
      vite.config.js

+ 8 - 20
src/components/custom/custom-upload.vue

@@ -1,17 +1,6 @@
 <template>
   <div id="c-upload">
-    <el-upload
-      v-if="url"
-      ref="upload"
-      :action="url"
-      :limit="limit"
-      :accept="accept"
-      :file-list="list"
-      :list-type="listType"
-      :on-exceed="outLimit"
-      :on-preview="filePreview"
-      :on-success="onSuccess"
-      :before-remove="onRemove">
+    <el-upload v-if="url" ref="upload" :action="url" :limit="limit" :accept="accept" :file-list="list" :list-type="listType" :on-exceed="outLimit" :on-preview="filePreview" :on-success="onSuccess" :before-remove="onRemove">
       <el-button type="primary">选择文件</el-button>
       <template #tip v-if="tip">
         <p style="color: #ff0000">{{ tip }}</p>
@@ -57,11 +46,11 @@ const emit = defineEmits(['change'])
 const filePreview = (file) => {
   // this.dialog = { show: true, url: file.url };
   window.open(file.url)
-};
+}
 // 只允许上传多少个文件
 const outLimit = () => {
   ElMessage.error(`只允许上传${limit.value}个文件`)
-};
+}
 // 上传成功,response:成功信息,file:图片信息,fileList:图片列表
 const onSuccess = (response, file) => {
   if (response.errcode !== 0) {
@@ -79,12 +68,11 @@ const onSuccess = (response, file) => {
 }
 // 删除图片
 // file: { id: any; uri: string }, fileList: any
-const onRemove = () => {
-  // let arr: Ref<ListItem[]> = _.cloneDeep(list);
-  // let info = arr.value.filter((f) => f.id != file.id);
-  // emit('change', info);
-  return true
-};
+const onRemove = (uploadFile, uploadFiles) => {
+  console.log(uploadFile, uploadFiles)
+  let info = uploadFiles.filter((f) => f.id != uploadFile.id)
+  emit('change', { model: model.value, value: info })
+}
 
 // #endregion
 </script>

+ 5 - 1
src/views/detail/studyDetail.vue

@@ -6,7 +6,7 @@
         <div class="info_2">
           <div class="info_name">{{ info.name || '暂无' }}</div>
           <div class="info_brief">{{ info.brief || '暂无' }}</div>
-          <div class="info_content" v-if="content">
+          <div class="info_content" v-if="info.content">
             <div v-html="info.content"></div>
           </div>
         </div>
@@ -99,6 +99,10 @@ const search = async () => {
         font-size: $global-font-size-18;
         margin: 10px 0;
       }
+      .info_content {
+        display: flex;
+        justify-content: center;
+      }
     }
   }
   :deep(table) {

+ 4 - 4
src/views/twelve/index.vue

@@ -220,12 +220,12 @@ const user = computed(() => userStore.user)
 // 列表
 const supplyList = ref([])
 let supplyskip = 0
-let supplylimit = 6
+let supplylimit = 3
 const supplytotal = ref(0)
 
 const demandList = ref([])
 let demandskip = 0
-let demandlimit = 6
+let demandlimit = 3
 const demandtotal = ref(0)
 // 加载中
 const loading = ref(true)
@@ -240,11 +240,11 @@ const dataType = ref('0')
 const keyword = ref('')
 
 let oneskip = 0
-let onelimit = 6
+let onelimit = 3
 const oneTotal = ref(0)
 
 let twoskip = 0
-let twolimit = 6
+let twolimit = 3
 const twoTotal = ref(0)
 // 请求
 onMounted(async () => {

+ 1 - 1
vite.config.js

@@ -45,7 +45,7 @@ export default defineConfig(({ mode }) => {
          */
         [env.VITE_APP_ES_API]: {
           changeOrigin: true,
-          target: 'http://192.168.1.197:9701'
+          target: 'http://127.0.0.1:9701'
         },
         /**
          * env.VITE_APP_BASE_API: /dev-api