Ver Fonte

修改连接接口

zs há 8 meses atrás
pai
commit
fba09030ac

+ 0 - 4
src/App.vue

@@ -11,10 +11,6 @@ const appStore = useAppStore()
 </template>
 
 <style lang="scss">
-.w_1200 {
-  // width: 1200px;
-  margin: 0 auto;
-}
 #index {
   width: 100%;
   height: 100%;

+ 2 - 1
src/lang/package/zh-cn/pages.js

@@ -119,7 +119,8 @@ export default {
     addDialogTitle: '新增行业',
     upDialogTitle: '修改行业',
     title: '标题',
-    English: '英文标题',
+    brief: '简介',
+    file: '背景图片',
     href: '路由',
     partner: '合作伙伴',
     is_use: '是否启用',

+ 1 - 1
src/views/achievement/index.vue

@@ -47,7 +47,7 @@
               <el-cascader v-model="form.area" :props="{ value: 'label', label: 'label' }" :options="cityList" style="width: 100%" />
             </template>
             <template #file>
-              <custom-upload model="file" :list="form.file" :limit="1" url="/files/web/template_achievement/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="file" :list="form.file" :limit="1" url="/files/web/cxyy_achievement/upload" @change="onUpload"></custom-upload>
             </template>
             <template #industry>
               <el-option v-for="i in sectorList" :key="i.id" :label="i.title" :value="i.title"></el-option>

+ 1 - 1
src/views/footplate/index.vue

@@ -17,7 +17,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #file>
-              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/template_footplate/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_footplate/upload" @change="onUpload"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>

+ 1 - 1
src/views/journal/index.vue

@@ -13,7 +13,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #file>
-              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/template_journal/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_journal/upload" @change="onUpload"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>

+ 1 - 1
src/views/journal/notes.vue

@@ -16,7 +16,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #file>
-              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/template_notes/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_notes/upload" @change="onUpload"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>

+ 33 - 4
src/views/match/info/index.vue

@@ -8,8 +8,8 @@
         <el-option v-for="i in sectorList" :key="i.id" :label="i.title" :value="i.title"></el-option>
       </template>
     </custom-search-bar>
-    <custom-button-bar :fields="buttonFields" @add="toAdd"></custom-button-bar>
-    <custom-table :data="data" :fields="fields" @query="search" :total="total" :opera="opera" @sign="toSign" @exam="toExam" @edit="toEdit" @delete="toDelete">
+    <custom-button-bar :fields="buttonFields" @add="toAdd" @select="toMoreDelect"></custom-button-bar>
+    <custom-table :data="data" :fields="fields" @query="search" :total="total" :opera="opera" @sign="toSign" @exam="toExam" @edit="toEdit" @delete="toDelete" @toSelect="toSelect" :select="true">
       <template #is_use="{ row }">
         <el-tag v-if="row.is_use == '0'" type="success" @click="toUse(row, '1')">启用</el-tag>
         <el-tag v-else type="info" @click="toUse(row, '0')">禁用</el-tag>
@@ -20,7 +20,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #file>
-              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/template_match/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_match/upload" @change="onUpload"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
@@ -144,7 +144,10 @@ const opera = [
     display: (i) => i.is_use === '1' && i.match_status === '0'
   }
 ]
-const buttonFields = [{ label: t('common.create'), method: 'add' }]
+const buttonFields = [
+  { label: t('common.create'), method: 'add' },
+  { label: t('common.select'), method: 'select', type: 'danger' }
+]
 let skip = 0
 let limit = inject('limit')
 const total = ref(0)
@@ -156,6 +159,8 @@ const matchList = ref([])
 const formList = ref([])
 const tagsList = ref([])
 const sectorList = ref([])
+// 多选列表
+const selectList = ref([])
 // 加载中
 const loading = ref(false)
 const formFields = ref([
@@ -253,6 +258,25 @@ const getDict = (data, model) => {
     return get(res, 'label')
   }
 }
+// 多选
+const toSelect = (val) => {
+  selectList.value = val
+}
+// 批量删除
+const toMoreDelect = () => {
+  if (selectList.value.length > 0) {
+    ElMessageBox.confirm(`确定批量删除数据?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
+      .then(async () => {
+        console.log(selectList.value)
+      })
+      .catch(() => {})
+  } else {
+    ElMessage({
+      message: '未选择要处理的数据!',
+      type: 'warning'
+    })
+  }
+}
 // 添加
 const toAdd = () => {
   dialog.value = { type: '1', show: true, title: t('pages.match.addDialogTitle') }
@@ -328,6 +352,11 @@ const toClose = () => {
   form.value = { rules: {}, file: [] }
   dialog.value = { show: false }
 }
+// 上传图片
+const onUpload = (e) => {
+  const { model, value } = e
+  form.value[model] = value
+}
 </script>
 <style scoped lang="scss">
 .rules {

+ 1 - 1
src/views/platform/news/index.vue

@@ -13,7 +13,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #logo>
-              <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/template_news/upload" @change="onUpload" listType="picture-card"></custom-upload>
+              <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/cxyy_news/upload" @change="onUpload" listType="picture-card"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>

+ 1 - 1
src/views/platform/policy/index.vue

@@ -13,7 +13,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #logo>
-              <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/template_news/upload" @change="onUpload" listType="picture-card"></custom-upload>
+              <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/cxyy_news/upload" @change="onUpload" listType="picture-card"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>

+ 1 - 1
src/views/platform/trends/index.vue

@@ -13,7 +13,7 @@
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
             <template #logo>
-              <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/template_news/upload" @change="onUpload" listType="picture-card"></custom-upload>
+              <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/cxyy_news/upload" @change="onUpload" listType="picture-card"></custom-upload>
             </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>

+ 12 - 2
src/views/support/index.vue

@@ -16,6 +16,9 @@
       <el-row>
         <el-col :span="24" v-if="dialog.type == '1'">
           <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
+            <template #file>
+              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_support/upload" @change="onUpload"></custom-upload>
+            </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
             </template>
@@ -93,6 +96,7 @@ const selectList = ref([])
 // 加载中
 const loading = ref(false)
 const formFields = ref([
+  { label: t('pages.support.file'), model: 'file', custom: true },
   { label: t('pages.support.name'), model: 'name' },
   { label: t('pages.support.tags'), model: 'tags', custom: true },
   { label: t('pages.support.industry'), model: 'industry', type: 'select' },
@@ -107,7 +111,7 @@ const formFields = ref([
 ])
 const rules = reactive({ name: [{ required: true, message: t('pages.support.titleMessage'), trigger: 'blur' }] })
 const dialog = ref({ type: '1', show: false, title: t('pages.support.addDialogTitle') })
-const form = ref({})
+const form = ref({ file: [] })
 // 审核
 const examFormFields = [{ label: t('pages.support.status'), model: 'status', type: 'select' }]
 const examRules = reactive({ status: [{ required: true, message: t('common.statusMessage'), trigger: 'blur' }] })
@@ -184,6 +188,7 @@ const toAdd = () => {
 }
 // 修改
 const toEdit = (data) => {
+  if (!data.file) data.file = []
   form.value = data
   dialog.value = { type: '1', show: true, title: t('pages.support.upDialogTitle') }
 }
@@ -205,6 +210,11 @@ const toSave = async () => {
     toClose()
   }
 }
+// 上传图片
+const onUpload = (e) => {
+  const { model, value } = e
+  form.value[model] = value
+}
 // 审核
 const toExam = (data) => {
   examForm.value = data
@@ -236,7 +246,7 @@ const toReset = async () => {
   await search({ skip, limit })
 }
 const toClose = () => {
-  form.value = {}
+  form.value = { file: [] }
   dialog.value = { show: false }
 }
 </script>

+ 113 - 3
src/views/system/design/index.vue

@@ -11,16 +11,85 @@
               <WangEditor v-model="form.brief" />
             </template>
             <template #logoUrl>
-              <custom-upload model="logoUrl" :list="form.logoUrl" :limit="1" listType="picture-card" url="/files/web/template_design/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="logoUrl" :list="form.logoUrl" :limit="1" listType="picture-card" url="/files/web/cxyy_design/upload" @change="onUpload"></custom-upload>
             </template>
             <template #carouselUrl>
-              <custom-upload model="carouselUrl" :list="form.carouselUrl" :limit="6" listType="picture-card" url="/files/web/template_design/upload" @change="onUpload"></custom-upload>
+              <custom-upload model="carouselUrl" :list="form.carouselUrl" :limit="6" listType="picture-card" url="/files/web/cxyy_design/upload" @change="onUpload"></custom-upload>
+            </template>
+            <template #friend>
+              <el-col :span="24" class="tables">
+                <el-col :span="24" class="tables_1">
+                  <el-button type="primary" @click="addFriend()">添加</el-button>
+                </el-col>
+                <el-col :span="24">
+                  <el-table :data="form.friend" border>
+                    <el-table-column type="index" label="序号" width="80" align="center"> </el-table-column>
+                    <el-table-column prop="url" label="图片" align="center">
+                      <template #default="scope">
+                        <custom-upload model="url" :list="scope.row.url" :limit="1" listType="picture-card" url="/files/web/cxyy_design/upload" @change="onFriendUpload($event, scope.row)"></custom-upload>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="name" label="名称" align="center">
+                      <template #default="scope">
+                        <el-input v-model="scope.row.name" placeholder="请输入名称" />
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="href" label="跳转网址" align="center">
+                      <template #default="scope">
+                        <el-input v-model="scope.row.href" placeholder="请输入跳转网址" />
+                      </template>
+                    </el-table-column>
+                    <el-table-column label="操作" align="center" width="100">
+                      <template #default="scope">
+                        <el-button type="danger" @click="delFriend(scope.row)">删除</el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </el-col>
+              </el-col>
+            </template>
+            <template #friendship>
+              <el-col :span="24" class="tables">
+                <el-col :span="24" class="tables_1">
+                  <el-button type="primary" @click="addFriendship()">添加</el-button>
+                </el-col>
+                <el-col :span="24">
+                  <el-table :data="form.friendship" border>
+                    <el-table-column type="index" label="序号" width="80" align="center"> </el-table-column>
+                    <el-table-column prop="name" label="名称" align="center">
+                      <template #default="scope">
+                        <el-input v-model="scope.row.name" placeholder="请输入名称" />
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="type" label="类型" align="center">
+                      <template #default="scope">
+                        <el-select v-model="scope.row.type" placeholder="请选择类型">
+                          <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value" />
+                        </el-select>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="href" label="跳转网址" align="center">
+                      <template #default="scope">
+                        <el-input v-model="scope.row.href" placeholder="请输入跳转网址" />
+                      </template>
+                    </el-table-column>
+                    <el-table-column label="操作" align="center" width="100">
+                      <template #default="scope">
+                        <el-button type="danger" @click="delFriendship(scope.row)">删除</el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </el-col>
+              </el-col>
             </template>
             <template #footInfo>
               <div class="footInfo">
                 <custom-form v-model="form.footInfo" :fields="footFields" :rules="footRules" :useSave="false">
+                  <template #Logo>
+                    <custom-upload model="Logo" :list="form.footInfo.Logo" listType="picture-card" :limit="1" url="/files/web/cxyy_design/upload" @change="onFUpload"></custom-upload>
+                  </template>
                   <template #Code>
-                    <custom-upload model="Code" :list="form.footInfo.Code" listType="picture-card" :limit="1" url="/files/web/template_design/upload" @change="onFUpload"></custom-upload>
+                    <custom-upload model="Code" :list="form.footInfo.Code" listType="picture-card" :limit="1" url="/files/web/cxyy_design/upload" @change="onFUpload"></custom-upload>
                   </template>
                 </custom-form>
               </div>
@@ -33,6 +102,7 @@
 </template>
 
 <script setup>
+import moment from 'moment'
 import { cloneDeep, get } from 'lodash-es'
 import { DesignStore } from '@/store/api/platform/design'
 const store = DesignStore()
@@ -45,6 +115,8 @@ const fields = ref([
   { label: '标题', model: 'zhTitle' },
   { label: 'logo', model: 'logoUrl', custom: true },
   { label: '轮播图', model: 'carouselUrl', custom: true },
+  { label: '合作伙伴', model: 'friend', custom: true },
+  { label: '友情连接', model: 'friendship', custom: true },
   { label: '网站底部信息', model: 'footInfo', custom: true },
   { label: '使用协议', model: 'agreement', custom: true },
   { label: '关于我们', model: 'brief', custom: true }
@@ -55,6 +127,7 @@ const rules = ref({
   logoUrl: [{ required: false, message: '请上传logo图片' }]
 })
 const footFields = ref([
+  { label: 'LOGO图片', model: 'Logo', custom: true },
   { label: '联系电话', model: 'Phone' },
   { label: '电子邮箱', model: 'Email' },
   { label: '地址', model: 'Address' },
@@ -70,6 +143,11 @@ const footRules = ref({
   Company: [{ required: true, message: '请输入公司' }],
   Code: [{ required: true, message: '请上传二维码图片' }]
 })
+const typeList = ref([
+  { value: '热门高校', label: '热门高校' },
+  { value: '政府部门', label: '政府部门' },
+  { value: '科研机构', label: '科研机构' }
+])
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -100,8 +178,40 @@ const onFUpload = (e) => {
   const { model, value } = e
   form.value.footInfo[model] = value
 }
+// 上传图片
+const onFriendUpload = (e, data) => {
+  const { model, value } = e
+  data[model] = value
+}
+// 合作伙伴添加
+const addFriend = () => {
+  let friend = form.value.friend || []
+  friend.push({ id: moment().valueOf(), url: [], name: '', href: '' })
+  form.value.friend = friend
+}
+// 合作伙伴删除
+const delFriend = (e) => {
+  let friend = form.value.friend.filter((i) => i.id != e.id)
+  form.value.friend = friend
+}
+// 友情连接添加
+const addFriendship = () => {
+  let friendship = form.value.friendship || []
+  friendship.push({ id: moment().valueOf(), name: '', type: '', href: '' })
+  form.value.friendship = friendship
+}
+// 友情连接删除
+const delFriendship = (e) => {
+  let friendship = form.value.friendship.filter((i) => i.id != e.id)
+  form.value.friendship = friendship
+}
 </script>
 <style scoped lang="scss">
+.tables {
+  .tables_1 {
+    margin: 0 0 10px 0;
+  }
+}
 .footInfo {
   width: 100%;
   border: 1px solid #dcdfe6;

+ 17 - 4
src/views/system/sector/index.vue

@@ -30,6 +30,12 @@
                 </el-table>
               </el-col>
             </template>
+            <template #file>
+              <custom-upload model="file" :list="form.file" :limit="1" url="/files/web/cxyy_sector/upload" @change="onUpload" listType="picture-card"></custom-upload>
+            </template>
+            <template #brief>
+              <WangEditor v-model="form.brief" />
+            </template>
             <template #is_use>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
             </template>
@@ -78,18 +84,19 @@ const loading = ref(false)
 const formFields = [
   { label: t('pages.sector.title'), model: 'title' },
   { label: t('pages.sector.href'), model: 'href' },
-  { label: t('pages.sector.English'), model: 'English' },
+  { label: t('pages.sector.file'), model: 'file', custom: true },
   { label: t('pages.sector.partner'), model: 'partner', custom: true },
   { label: t('pages.sector.sort'), model: 'sort', type: 'number' },
   { label: t('pages.sector.is_use'), model: 'is_use', type: 'radio' },
-  { label: t('pages.sector.remark'), model: 'remark', type: 'textarea' }
+  { label: t('pages.sector.remark'), model: 'remark', type: 'textarea' },
+  { label: t('pages.sector.brief'), model: 'brief', custom: true }
 ]
 const rules = reactive({
   title: [{ required: true, message: t('pages.sector.titleMessage'), trigger: 'blur' }],
   sort: [{ required: true, message: t('pages.sector.sortfMessage'), trigger: 'blur' }]
 })
 const dialog = ref({ type: '1', show: false, title: t('pages.sector.dialogTitle'), top: '15vh' })
-const form = ref({ partner: [] })
+const form = ref({ partner: [], file: [] })
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -133,6 +140,7 @@ const toAdd = () => {
 // 修改
 const toEdit = (data) => {
   form.value = data
+  if (!data.file) data.file = []
   dialog.value = { type: '1', show: true, title: t('pages.sector.upDialogTitle'), top: '15vh' }
 }
 // 删除
@@ -157,6 +165,11 @@ const delPartner = (e) => {
   let partner = form.value.partner.filter((i) => i.id != e.id)
   form.value.partner = partner
 }
+// 上传图片
+const onUpload = (e) => {
+  const { model, value } = e
+  form.value[model] = value
+}
 const toSave = async () => {
   const data = cloneDeep(form.value)
   let res
@@ -173,7 +186,7 @@ const toReset = async () => {
   await search({ skip, limit })
 }
 const toClose = () => {
-  form.value = { partner: [] }
+  form.value = { partner: [], file: [] }
   dialog.value = { show: false }
 }
 // 开启或禁用

+ 1 - 1
src/views/user/user/parts/company.vue

@@ -3,7 +3,7 @@
     <el-form ref="ruleFormRef" :model="form" label-width="100px" class="form" label-position="left">
       <el-row>
         <el-form-item label="企业Logo" prop="logo">
-          <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/template_company/upload" @change="onFUpload" listType="picture-card"></custom-upload>
+          <custom-upload model="logo" :list="form.logo" :limit="1" url="/files/web/cxyy_company/upload" @change="onFUpload" listType="picture-card"></custom-upload>
         </el-form-item>
       </el-row>
       <el-row :gutter="20">

+ 1 - 1
src/views/user/user/parts/expert.vue

@@ -3,7 +3,7 @@
     <el-form ref="ruleFormRef" :model="form" label-width="80px" class="form" label-position="left">
       <el-row>
         <el-form-item label="头像" prop="icon">
-          <custom-upload model="icon" :list="form.icon" :limit="1" url="/files/web/template_expert/upload" @change="onUpload" listType="picture-card"></custom-upload>
+          <custom-upload model="icon" :list="form.icon" :limit="1" url="/files/web/cxyy_expert/upload" @change="onUpload" listType="picture-card"></custom-upload>
         </el-form-item>
       </el-row>
       <el-row :gutter="20">

+ 1 - 1
vite.config.js

@@ -33,7 +33,7 @@ export default defineConfig(({ mode }) => {
       open: true,
       proxy: {
         '/files': {
-          target: 'http://192.168.1.197', // https://broadcast.waityou24.cn
+          target: 'http://127.0.0.1:19700', // https://broadcast.waityou24.cn
           changeOrigin: true
         },
         /**