liyongli 2 years ago
parent
commit
ae308010ad

BIN
src/assets/img/bl.png


BIN
src/assets/img/bq.png


BIN
src/assets/img/default_user.png


BIN
src/assets/img/dy.png


BIN
src/assets/img/eye.png


BIN
src/assets/img/h5.png


BIN
src/assets/img/hart.png


BIN
src/assets/img/hj.png


BIN
src/assets/img/jd.png


BIN
src/assets/img/logo.png


BIN
src/assets/img/sj.png


+ 1 - 1
src/router/index.js

@@ -7,7 +7,7 @@ import NotFound from "../errorPage/404.vue";
 const router = createRouter({
   history: createWebHashHistory(process.env.BASE_URL),
   routes: [
-    // 搞钱校对-全媒体平台
+    // 稿前校对-全媒体平台
     {
       path: '/Home',
       name: 'Home',

+ 15 - 1
src/utils/request.js

@@ -1,7 +1,7 @@
 import config from '../config/index';
 import { ElMessage, ElLoading } from 'element-plus';
-
 let loading = undefined;
+const origins = location.href.split('#');
 
 function ajax(longRange) {
   return new Promise((resolve, reject) => {
@@ -27,11 +27,14 @@ function ajax(longRange) {
       loading.close();
       var data = JSON.parse(this.responseText || '{}');
       if (this.status !== 200) {
+        // 网络错误
         errorStatus({ ...data, status: this.status });
         return reject({ ...data, status: this.status });
       }
 
       if (!longRange.platfrom && data.code !== 0) {
+        // 业务错误
+        if (data.code === 40001) noLogin();
         errorStatus({ ...data, status: this.status });
         return reject({ ...data, status: this.status });
       }
@@ -58,6 +61,7 @@ function fetch(longRange) {
       .then(res => {
         const json = res.json();
         if (res.status !== 200) {
+          // 网络错误
           errorStatus(res);
           return reject(res);
         }
@@ -66,6 +70,8 @@ function fetch(longRange) {
       .then(res => {
         loading.close();
         if (!longRange.platfrom && res.code !== 0) {
+          // 业务错误
+          if (res.code === 40001) noLogin();
           errorStatus(res);
           return reject(res);
         }
@@ -101,6 +107,14 @@ function errorStatus(err) {
   }
 }
 
+/**
+ * 未登录跳转
+ */
+function noLogin(api = '#/login') {
+  if (location.replace) location.replace(origins[0] + api);
+  else location.href = origins[0] + api;
+}
+
 function bodyGetFunc(body = {}) {
   let search = '?';
   for (const key in body) {

+ 65 - 18
src/view/allMedia/H5Mall.vue

@@ -9,16 +9,9 @@
       >
         <component :is="components[item.type]" :item="item"></component>
         <div class="main_item" v-text="item.title"></div>
-        <div class="body">
-          <img style="width: 20px; float: left" :src="defaultIcon" />
-          <span>
-            <img style="width: 20px" :src="eyeIcon" />
-            <span style="vertical-align: middle" v-text="item.hot"></span>
-          </span>
-        </div>
       </div>
     </div>
-    <el-button @click="showData" class="createPageList"> 已生成页面 </el-button>
+    <el-button @click="showData" class="createPageList"> 已创建页面 </el-button>
     <el-dialog v-model="show" title="已创建页面">
       <el-table :data="localList">
         <el-table-column property="title" label="页面名称" />
@@ -29,7 +22,22 @@
         </el-table-column>
         <el-table-column property="url" label="操作">
           <template #default="scope">
-            <el-button v-if="scope.row.url" type="primary" link @click="() => openurl(scope.row.url)"> 打开 </el-button>
+            <el-button
+              v-if="scope.row.url"
+              type="primary"
+              link
+              @click="() => copyurl(scope.row.url)"
+            >
+              复制链接
+            </el-button>
+            <el-button
+              v-if="scope.row.url"
+              type="primary"
+              link
+              @click="() => openurl(scope.row.url)"
+            >
+              打开
+            </el-button>
             <el-button link type="primary" @click="() => editBL(scope)">
               修改
             </el-button>
@@ -42,9 +50,8 @@
 
 <script setup>
 import { ref } from 'vue';
+import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
-import defaultIcon from '../../assets/img/default_user.png';
-import eyeIcon from '../../assets/img/eye.png';
 import H5 from './components/H5.vue';
 import LONGPAGE from './components/LONGPAGE.vue';
 import POSTER from './components/POSTER.vue';
@@ -94,6 +101,51 @@ const editBL = item => {
 };
 
 const openurl = url => window.open(url);
+
+const copyurl = url => {
+  if (!('clipboard' in navigator)) return;
+  auth().then(res => {
+    if (!res) {
+      // 未授权
+      ElMessage({
+        type: 'error',
+        message: '授权未通过',
+      });
+      return;
+    }
+    navigator.clipboard.writeText(url).then(
+      () => {
+        ElMessage({
+          type: 'success',
+          message: '地址复制成功',
+        });
+      },
+      () => {
+        ElMessage({
+          type: 'error',
+          message: '复制失败',
+        });
+      }
+    );
+  });
+};
+
+const auth = () => {
+  return new Promise((resolve, reject) => {
+    navigator.permissions.query({ name: 'clipboard-read' }).then(
+      result => {
+        if (result.state == 'granted' || result.state == 'prompt') {
+          resolve(true);
+        } else {
+          resolve(false);
+        }
+      },
+      error => {
+        reject(error);
+      }
+    );
+  });
+};
 </script>
 
 <style scoped>
@@ -104,15 +156,14 @@ const openurl = url => window.open(url);
 
 .mainBody {
   font-weight: 500;
-  padding: 1em 0 1em 1em;
+  padding: 2em 0 1em 1em;
 }
 
 .mainBody .item {
   display: inline-block;
   width: 184px;
-  height: 363px;
+  height: 333px;
   transition: all 0.3s;
-  border-radius: 2px;
   vertical-align: middle;
   margin-right: 1em;
   border-radius: 5px;
@@ -140,10 +191,6 @@ const openurl = url => window.open(url);
   margin-top: -15px;
 }
 
-.mainBody .body {
-  padding: 0 5px;
-  text-align: right;
-}
 .mainBody img {
   vertical-align: middle;
 }

+ 12 - 10
src/view/allMedia/convergence.vue

@@ -195,16 +195,16 @@ const btns = [
     platform: 'jinritoutiao',
     class: 'icon-jinritoutiao',
   },
-//   {
-//     text: '闪视频',
-//     platform: 'ssp',
-//     class: 'icon-ssp',
-//   },
-//   {
-//     text: '头条',
-//     platform: 'sxtt',
-//     class: 'icon-sxtt',
-//   },
+  //   {
+  //     text: '闪视频',
+  //     platform: 'ssp',
+  //     class: 'icon-ssp',
+  //   },
+  //   {
+  //     text: '头条',
+  //     platform: 'sxtt',
+  //     class: 'icon-sxtt',
+  //   },
 ];
 
 const manuscriptData = ref({ list: [], total: 0 });
@@ -288,6 +288,7 @@ const getData = () => {
       end,
       page: condition.value.manuscript.page,
       size: condition.value.manuscript.size,
+      match: condition.value.keyword,
     },
   }).then(res => {
     const resData = res || { records: [], total: 0 };
@@ -302,6 +303,7 @@ const getData = () => {
       end,
       page: condition.value.disseminate.page,
       size: condition.value.disseminate.size,
+      match: condition.value.keyword,
     },
   }).then(res => {
     const resData = res || { records: [], total: 0 };

+ 46 - 28
src/view/allMedia/login.vue

@@ -1,21 +1,37 @@
 <template>
   <div class="login">
-    <el-form ref="formEle" :model="form" size="large" class="mo" :rules="rules">
-      <el-form-item label="账号" prop="name">
-        <el-input placeholder="请输入账号" v-model="form.name" />
-      </el-form-item>
-      <el-form-item label="密码" prop="pwd">
-        <el-input placeholder="请输入密码" type="password" v-model="form.pwd" />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" @click="onSubmit">
-          登录
-          <el-icon style="vertical-align: middle" class="el-icon--right">
-            <Right />
-          </el-icon>
-        </el-button>
-      </el-form-item>
-    </el-form>
+    <div class="mo">
+      <el-image style="width: 400px; height: 158px;margin-bottom: 10em;" :src="logo" fit="fill">
+        <template #error>
+          <div class="image-slot">
+            <el-icon><Picture /></el-icon>
+          </div>
+        </template>
+      </el-image>
+      <el-form
+        ref="formEle"
+        :model="form"
+        size="large"
+        class="from"
+        :rules="rules"
+      >
+        <el-form-item label="账号" prop="name">
+          <el-input placeholder="请输入账号" v-model="form.name" />
+        </el-form-item>
+        <el-form-item label="密码" prop="pwd">
+          <el-input
+            placeholder="请输入密码"
+            type="password"
+            v-model="form.pwd"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onSubmit">
+            登  录
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
   </div>
 </template>
 
@@ -24,6 +40,7 @@ import { reactive, ref } from 'vue';
 import sha256 from 'sha256';
 import { useRouter, useRoute } from 'vue-router';
 import { login } from '../../api/index';
+import logo from '../../assets/img/logo.png';
 const router = useRouter();
 const route = useRoute();
 const formEle = ref(null);
@@ -36,6 +53,8 @@ const rules = reactive({
   pwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
 });
 
+document.title = '陕西广电融媒体集团'
+
 async function onSubmit() {
   await formEle.value.validate((valid, fields) => {
     if (!valid) return console.log('error submit!', fields);
@@ -66,35 +85,34 @@ async function onSubmit() {
   height: 100%;
   font-weight: 500;
   font-size: 14px;
-  position: relative;
   background-image: url(../../assets/img/0.jpg);
   background-size: 100% 100%;
   background-repeat: no-repeat;
 }
 
 .login .mo {
-  top: 50%;
-  left: 50%;
+  float: right;
+  height: 100%;
   width: 35%;
   max-width: 500px;
-  position: absolute;
   text-align: center;
-  transform: translate(-50%, -50%);
-  background: #f3f3f399;
-  padding: 1.5em;
-  border-radius: 5px;
+  background: #f3f3f3;
+  padding: 5.5em 1.5em 1.5em 1.5em;
 }
 
-.login .el-form-item:last-child{
-    margin: 0;
+.login .el-form-item:last-child {
+  margin: 0;
 }
-
 </style>
 
 <style>
-.login .el-form-item__label{
+.login .el-form-item__label {
   height: 55px;
   color: #333;
   line-height: 55px;
 }
+
+.login .el-form-item__content .el-button{
+    width: 100%;
+}
 </style>

+ 3 - 3
src/view/allMedia/main.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="mainMaster">
     <div class="menu">
-      <img src="../../assets/img/logo.png" style="width: 100%" alt="" />
+      <img src="../../assets/img/logo.png" style="width: 100%;margin-bottom: 2em;" alt="" />
       <div
         @click="() => selectMenuFunc(item)"
         v-for="(item, index) in menu"
@@ -39,7 +39,7 @@ const menu = ref([
   },
   {
     title: '地域热点',
-    icon: require('../../assets/img/sj.png'),
+    icon: require('../../assets/img/dy.png'),
     path: '/main_home/analysis_map',
   },
   {
@@ -93,7 +93,7 @@ const selectMenuFunc = item => {
   width: 35%;
   max-width: 300px;
   min-width: 200px;
-  padding: 48px 32px 0;
+  padding: 32px 15px 0;
   height: 99.7%;
   flex: 1;
 }