소스 검색

Merge remote-tracking branch 'origin/master'

zhuwei 1 년 전
부모
커밋
7e12f9bc16
4개의 변경된 파일118개의 추가작업 그리고 110개의 파일을 삭제
  1. 2 2
      scripts/server.js
  2. 6 6
      scripts/upload/upload.js
  3. 10 22
      src/views/manager/contractinfo/detail.vue
  4. 100 80
      src/views/system/announcement.vue

+ 2 - 2
scripts/server.js

@@ -58,7 +58,7 @@ function setConfigData() {
             }
             console.log(`----------------------------`)
             console.log(`准备上传到服务器:${name}`);
-            runCommand(`node ./scripts/upload/upload.js ${ip} ${username} ${password} ${file_name} ${path} ${url}`);
+            runCommand(`node ./scripts/upload/upload.js ${ip} ${username} '${password}' ${file_name} ${path} ${url}`);
         }
     } else {
         const index = arrIndex(config, 'name', argv)
@@ -76,7 +76,7 @@ function setConfigData() {
         }
         console.log(`----------------------------`)
         console.log(`准备上传到服务器:${name}`);
-        runCommand(`node ./scripts/upload/upload.js ${ip} ${username} ${password} ${file_name} ${path} ${url}`);
+        runCommand(`node ./scripts/upload/upload.js ${ip} ${username} '${password}' ${file_name} ${path} ${url}`);
     }
     console.log(`----------------------------`)
     console.log(`全部上传并部署完成`);

+ 6 - 6
scripts/upload/upload.js

@@ -51,12 +51,12 @@ function uploadServer() {
     const sshCommand = `cd ${filePath} && rm -rf static && unzip -o ${fileName}`;
     if (process.platform === 'win32') {
         // Windows
-        runCommand(`pscp -P ${sshPort} -pw ${password} -hostkey "${hostKey}" ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
-        runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw ${password} -hostkey "${hostKey}" -batch "${sshCommand}"`);
+        runCommand(`pscp -P ${sshPort} -pw '${password}' -hostkey "${hostKey}" ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
+        runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw '${password}' -hostkey "${hostKey}" -batch "${sshCommand}"`);
     } else {
         // Mac/Linux
-        runCommand(`sshpass -p "${password}" scp -o StrictHostKeyChecking=no -P ${sshPort} ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
-        runCommand(`sshpass -p "${password}" ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
+        runCommand(`sshpass -p '${password}' scp -o StrictHostKeyChecking=no -P ${sshPort} ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
+        runCommand(`sshpass -p '${password}' ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
     }
     console.log('编译打包后自动部署到服务器上完成');
     console.log(`服务器上的地址:${url}`);
@@ -68,10 +68,10 @@ function delPublic(name) {
     const sshCommand = `cd ${filePath} && rm -rf ${name}`;
     if (process.platform === 'win32') {
         // Windows
-        runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw ${password} -hostkey "${hostKey}" -batch "${sshCommand}"`);
+        runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw '${password}' -hostkey "${hostKey}" -batch "${sshCommand}"`);
     } else {
         // Mac/Linux
-        runCommand(`sshpass -p "${password}" ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
+        runCommand(`sshpass -p '${password}' ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
     }
     console.log(`${name} 等目录移除完成`);
 }

+ 10 - 22
src/views/manager/contractinfo/detail.vue

@@ -408,37 +408,25 @@
                     </el-col>
                   </el-row>
                 </el-col>
-                <el-col
-                  :span="12"
-                  v-if="contractForm.contractType==1"
-                >
+                <el-col :span="12" v-if="contractForm.contractType==1">
                   <div class="head-font">附加信息</div>
-                  <el-form-item
-                    label="项目地址"
-                    prop="projectPlace"
-                  >
+                  <el-form-item label="项目地址" prop="projectPlace">
                     <!-- <el-input v-model="contractForm.projectPlace" placeholder="点击后面地图选取地址">
                         <el-button slot="append" icon="el-icon-map-location" @click="mapDialogVisible = true"></el-button>
                       </el-input> -->
-                    <avue-input-map
-                      :params="params"
-                      placeholder="请选择地图"
-                      v-model="flageData"
-                      @change="mapChange"
-                    ></avue-input-map>
+                    <avue-input-map :params="params" placeholder="请选择地图" v-model="flageData" @change="mapChange"></avue-input-map>
                   </el-form-item>
-                  <el-form-item
-                    label="起始桩号"
-                    prop="startStation"
-                  >
+                  <el-form-item label="起始桩号" prop="startStation">
                     <el-input v-model="contractForm.startStation"></el-input>
                   </el-form-item>
-                  <el-form-item
-                    label="结束桩号"
-                    prop="endStation"
-                  >
+                  <el-form-item label="结束桩号" prop="endStation">
                     <el-input v-model="contractForm.endStation"></el-input>
                   </el-form-item>
+                  <el-form-item label="里程">
+                    <el-input v-model="contractForm.projectMileage">
+                      <template slot="append">公里(KM)</template>
+                    </el-input>
+                  </el-form-item>
                 </el-col>
 
 

+ 100 - 80
src/views/system/announcement.vue

@@ -32,28 +32,42 @@
           <el-table ref="tableRef" :data="tableData" border style="width: 100%;" height="100%" @selection-change="tableSelection">
             <el-table-column type="selection" width="50" align="center" fixed="left"></el-table-column>
             <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
-            <el-table-column prop="msgType" label="公告类型" width="140">
+            <el-table-column prop="msgType" label="公告类型" width="100" align="center">
               <template slot-scope="{row}">
                 <span v-if="row.msgType===1">更新公告</span>
                 <span v-if="row.msgType===2">普通公告</span>
               </template>
             </el-table-column>
-            <el-table-column prop="pushSystem" label="推送系统" min-width="120"></el-table-column>
+            <el-table-column prop="pushSystem" label="推送系统" min-width="220"></el-table-column>
             <el-table-column prop="msgContent" label="公告内容" min-width="240"></el-table-column>
-            <el-table-column prop="pushRemark" label="发布备注" width="300"></el-table-column>
-            <el-table-column prop="pushDateTime" label="创建时间" width="180"></el-table-column>
+            <el-table-column prop="pushRemark" label="发布备注"></el-table-column>
+            <el-table-column prop="pushDateTime" label="发布时间" width="160" align="center"></el-table-column>
+            <el-table-column prop="pushDateTime" label="时间配置" width="340">
+              <template slot-scope="{row}">
+                <template v-if="row.msgType===1">
+                  <span>剩余</span>
+                  <el-tag type="danger" size="mini" >{{row.msgWarnTime}}分钟</el-tag>
+                  <span>进行提醒,</span>
+                  <el-tag type="danger" size="mini">{{row.msgCountDownTime}}分钟</el-tag>
+                  <span>开始进入倒计时</span>
+                </template>
+                <template v-else>
+                  <span>-</span>
+                </template>
+              </template>
+            </el-table-column>
             <el-table-column prop="creatUserName" label="创建人" width="100"></el-table-column>
-            <el-table-column prop="cancelDateTime" label="取消时间" width="180"></el-table-column>
-            <el-table-column prop="pushStatus" label="发布状态" width="100" align="center">
+            <el-table-column prop="cancelDateTime" label="取消时间" width="160" align="center"></el-table-column>
+            <el-table-column prop="pushStatus" label="发布状态" width="80" align="center">
               <template slot-scope="{row}">
-                <el-tag type="danger" effect="dark" v-if="row.pushStatus===3">已取消</el-tag>
-                <el-tag type="success" effect="dark" v-if="row.pushStatus===2">已发布</el-tag>
-                <el-tag type="info" effect="dark" v-if="row.pushStatus===1">待发布</el-tag>
+                <el-tag type="danger" effect="dark" size="mini" v-if="row.pushStatus===3">已取消</el-tag>
+                <el-tag type="success" effect="dark" size="mini" v-if="row.pushStatus===2">已发布</el-tag>
+                <el-tag type="info" effect="dark" size="mini" v-if="row.pushStatus===1">待发布</el-tag>
               </template>
             </el-table-column>
             <el-table-column prop="action" label="操作" width="180" align="center" fixed="right">
               <template slot-scope="{row}">
-                <el-button size="mini" @click="handleEdit(row)">编辑</el-button>
+                <el-button size="mini" @click="handleEdit(row)" :disabled="row.pushStatus!==3">编辑</el-button>
                 <el-button size="mini" type="danger" @click="handleCancel(row)" :disabled="row.pushStatus!==1">取消发布</el-button>
               </template>
             </el-table-column>
@@ -64,7 +78,7 @@
             @size-change="handleSizeChange"
             @current-change="handleCurrentChange"
             :current-page="searchForm.current"
-            :page-sizes="[100, 200, 300, 400]"
+            :page-sizes="[20, 30, 40, 50]"
             :page-size="searchForm.size"
             layout="total, prev, pager, next, sizes, jumper"
             :total="searchForm.total"
@@ -159,7 +173,7 @@
       </el-form>
       <div slot="footer">
         <el-button @click="generalCancel">取消</el-button>
-        <el-button type="primary" @click="generalFormSubmit">确定</el-button>
+        <el-button type="primary" @click="generalFormSubmit">发布</el-button>
       </div>
     </el-dialog>
 
@@ -190,23 +204,17 @@
         <el-form-item label="发布配置:" prop="pushDateTime">
           <el-date-picker v-model="updateFormModel.pushDateTime" type="datetime" placeholder="选择日期时间" :picker-options="pickerOptions" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
         </el-form-item>
-        <el-form-item label="时间配置:" prop="key2">
+        <el-form-item label="时间配置:" prop="msgWarnTime">
           <span>剩余</span>
           <span style="margin-left: 5px">
-            <el-select v-model="updateFormModel.key2Val" clearable filterable size="small" style="width: 90px;" placeholder="分钟" disabled>
+            <el-select v-model="updateFormModel.msgWarnTime" clearable filterable size="small" style="width: 90px;" placeholder="分钟">
                 <el-option v-for="i in 60" :label="`${i}分钟`" :value="i"></el-option>
               </el-select>
           </span>
           <span style="margin-left: 5px">进行提醒,</span>
           <span style="margin-left: 5px">
-            <el-select v-model="updateFormModel.key2Val1" clearable filterable size="small" style="width: 70px;" placeholder="时间" disabled>
-                <el-option v-for="i in 60" :label="i" :value="i"></el-option>
-              </el-select>
-          </span>
-          <span style="margin-left: 5px">
-            <el-select v-model="updateFormModel.key2Val2" clearable filterable size="small" style="width: 80px;" placeholder="单位" disabled>
-                <el-option label="分钟" value="1"></el-option>
-                <el-option label="秒钟" value="2"></el-option>
+            <el-select v-model="updateFormModel.msgCountDownTime" clearable filterable size="small" style="width: 90px;" placeholder="时间">
+                <el-option v-for="i in 60" :label="`${i}分钟`" :value="i"></el-option>
               </el-select>
           </span>
           <span style="margin-left: 5px">开始进入倒计时</span>
@@ -219,7 +227,7 @@
       </el-form>
       <div slot="footer">
         <el-button @click="systemUpdateCancel">取消</el-button>
-        <el-button type="primary" @click="updateFormSubmit">确定</el-button>
+        <el-button type="primary" @click="updateFormSubmit">发布</el-button>
       </div>
     </el-dialog>
   </div>
@@ -240,7 +248,10 @@ export default {
       //待发布
       isReleasedShow: false,
       releasedNum: 0,
-      releasedData: {},
+      releasedData: {
+        systemMsg: [],
+        updateMsg: []
+      },
       //普通公告
       isGeneralShow: false,
       generalFormModel: {
@@ -276,8 +287,21 @@ export default {
         updateCodeType: [
           { required: true, message: '请选择更新原因', trigger: 'blur' }
         ],
-        pushDateTime: [
-          { required: true, message: '请选择发布配置', trigger: 'blur' }
+        pushDateTime: [{
+          required: true, trigger: 'blur',
+          validator: (rule, value, callback) => {
+            const {msgCountDownTime} = this.updateFormModel
+            if (!value) {
+              callback(new Error('请选择剩余进行提醒时间'));
+            } else if (!msgCountDownTime) {
+              callback(new Error('请选择进入倒计时时间'));
+            } else {
+              callback();
+            }
+          }
+        }],
+        msgWarnTime: [
+          { required: true, message: '请选择时间配置', trigger: 'blur' }
         ],
         pushSystem: [
           { required: true, message: '请选择涉及系统', trigger: 'blur' }
@@ -325,19 +349,15 @@ export default {
   methods: {
     //获取待发布公告
     async getAwaitMsgApi() {
-      const res = await getAwaitMsg()
-      const {code, data, msg} = res.data || {}
-      if (code!==200) {
-        this.$message.error(msg);
-      }
-      let num = 0
-      const arr = data || {}
-      arr.systemMsg = arr.systemMsg || []
-      arr.updateMsg = arr.updateMsg || []
-      this.releasedData = arr
-      num = num + arr.systemMsg.length
-      num = num + arr.updateMsg.length
-      this.releasedNum = num
+      let _this = this
+      getAwaitMsg().then(({data}) => {
+        const {msgTotal, systemMsg, updateMsg} = data.data || {}
+        _this.releasedData = {
+          systemMsg: systemMsg,
+          updateMsg: updateMsg
+        }
+        _this.releasedNum = msgTotal
+      })
     },
     handleSizeChange(val) {
       this.searchForm.size = val
@@ -388,29 +408,29 @@ export default {
         this.$message.warning('请先勾选数据');
         return
       }
+      //判断是否满足条件
+      const result = arr.every(({ pushStatus }) => {
+        return pushStatus === 3
+      })
+      if (!result) {
+        this.$message.error('请选择已取消的数据');
+        return
+      }
       const ids = arr.flat().map(item => item.id).join(',');
-      const res = await remove(ids)
-      const {code, msg} = res.data || {}
-      if (code === 200) {
-        this.$message.success(msg || '操作成功');
+      remove(ids).then(({data}) => {
+        this.$message.success(data.msg || '操作成功');
         this.tableMultiple = []
         this.searchClick()
         this.getAwaitMsgApi()
-      } else {
-        this.$message.error(msg || '操作失败');
-      }
+      })
     },
     //取消发布
-    async handleCancel(row) {
-      const res = await cancelPush(row.id)
-      const {code, msg} = res.data || {}
-      if (code === 200) {
-        this.$message.success(msg || '操作成功');
+    handleCancel(row) {
+      cancelPush(row.id).then(({data}) => {
+        this.$message.success(data.msg || '操作成功');
         this.searchClick()
         this.getAwaitMsgApi()
-      } else {
-        this.$message.error(msg || '操作失败');
-      }
+      })
     },
     //待发布打开
     releasedShow() {
@@ -434,23 +454,23 @@ export default {
     async generalFormSubmit() {
       const isForm = await this.getFormValidate('generalFormRef')
       if (!isForm) return
-      let form = this.generalFormModel
+      let form = JSON.parse(JSON.stringify(this.generalFormModel))
       form.pushSystem = form.pushSystem.join(',')
       form.msgType = 2
-      let res
       if (form.id) {
-        res = await update(form)
+        update(form).then(({data}) => {
+          this.$message.success(data.msg || '操作成功');
+          this.generalCancel()
+          this.searchClick()
+          this.getAwaitMsgApi()
+        })
       } else {
-        res = await add(form)
-      }
-      const {code, msg} = res.data || {}
-      if (code===200) {
-        this.$message.success(msg || '操作成功');
-        this.generalCancel()
-        this.searchClick()
-        this.getAwaitMsgApi()
-      } else {
-        this.$message.error(msg || '操作失败');
+        add(form).then(({data}) => {
+          this.$message.success(data.msg || '操作成功');
+          this.generalCancel()
+          this.searchClick()
+          this.getAwaitMsgApi()
+        })
       }
     },
     //普通公告关闭
@@ -469,24 +489,24 @@ export default {
     async updateFormSubmit() {
       const isForm = await this.getFormValidate('updateFormRef')
       if (!isForm) return
-      let form = this.updateFormModel
+      let form = JSON.parse(JSON.stringify(this.updateFormModel))
       form.pushSystem = form.pushSystem.join(',')
       form.updateServerType = form.updateServerType.join(',')
       form.msgType = 1
-      let res
       if (form.id) {
-        res = await update(form)
-      } else {
-        res = await add(form)
-      }
-      const {code, msg} = res.data || {}
-      if (code===200) {
-        this.$message.success(msg || '操作成功');
-        this.systemUpdateCancel()
-        this.searchClick()
-        this.getAwaitMsgApi()
+        update(form).then(({data}) => {
+          this.$message.success(data.msg || '操作成功');
+          this.systemUpdateCancel()
+          this.searchClick()
+          this.getAwaitMsgApi()
+        })
       } else {
-        this.$message.error(msg || '操作失败');
+        add(form).then(({data}) => {
+          this.$message.success(data.msg || '操作成功');
+          this.systemUpdateCancel()
+          this.searchClick()
+          this.getAwaitMsgApi()
+        })
       }
     },
     //系统更新公告关闭