xiangpei
2024-08-31 74ae9d9453e245a3249ecb832a7202c275ad6ece
点位新增部级标签、点位导入导出优化
1个文件已修改
34 ■■■■■ 已修改文件
src/views/system/point/index.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/point/index.vue
@@ -34,19 +34,28 @@
      </el-col>
      <el-col :span="1.5">
        <el-popover>
          <p>导入点位只做更新操作</p>
          <div class="bottom_">
            <p>导入点位只做更新操作</p>
          </div>
          <div class="bottom_">
            <el-switch
              v-model="needUpdateUnit"
              active-text="修改运维单位/时间"
              inactive-text="不修改运维单位/时间">
            </el-switch>
          </div>
          <div class="bottom_" v-show="needUpdateUnit">
            <el-select @change="getUnitContractTime" v-model="importUnitId" size="small" placeholder="更换运维单位">
              <el-option v-for="unit in unitList" :key="unit.id" :label="unit.value" :value="unit.id"></el-option>
            </el-select>
          </div>
          <div class="bottom_">
          <div class="bottom_" v-show="needUpdateUnit">
            <el-select @change="showTimeRange" v-model="contractId" size="small" placeholder="运维合同" :disabled="! importUnitId">
              <el-option v-for="(time, index) in timeList" :key="index" :label="time.name" :value="time.id"></el-option>
            </el-select>
            <span style="margin-left: 10px;color: #8a8989" v-show="importUnitId">该单位有{{timeList.length}}个合同</span>
          </div>
          <div class="bottom_">
          <div class="bottom_" v-show="needUpdateUnit">
            <el-date-picker
              :disabled="! contractId"
              size="small"
@@ -94,9 +103,9 @@
          <div>{{ getTagText(scope.row) }}</div>
        </template>
      </el-table-column>
      <el-table-column label="点位开始时间" align="center" prop="startTime" width="140">
      <el-table-column label="运维开始时间" align="center" prop="startTime" width="140">
      </el-table-column>
      <el-table-column label="点位结束时间" align="center" prop="endTime" width="140">
      <el-table-column label="运维结束时间" align="center" prop="endTime" width="140">
      </el-table-column>
      <el-table-column label="运维单位" align="center" prop="unitName" />
      <el-table-column label="监管部门" align="center" prop="deptName" />
@@ -235,6 +244,7 @@
  dicts: ['point_tag'],
  data() {
    return {
      needUpdateUnit: false,
      importantTag: false,
      provinceTag: false,
      importantCommandImageTag: false,
@@ -323,12 +333,13 @@
      let text = '';
      // 检查每个标签,如果为true,则添加到text中
      if (row.importantTag) text += '重点点位 ';
      if (row.provinceTag) text += '省厅点位 ';
      if (row.importantCommandImageTag) text += '重点指挥图像 ';
      if (row.importantTag) text += '重点点位、';
      if (row.provinceTag) text += '省厅点位、';
      if (row.importantCommandImageTag) text += '重点指挥图像、';
      if (row.deptTag) text += '部级、';
      text === '' ? '普通点位' : text
      // 返回拼接后的文本和固定文字
      return text ==='' ? '普通点位' : text
      return text.replace(/、$/, '')
    },
    getUnitContractTime(unitId) {
      this.ywTimes = []
@@ -359,6 +370,7 @@
      formData.append("startTime", this.ywTimes[0] ? this.ywTimes[0] : '')
      formData.append("endTime", this.ywTimes[1] ? this.ywTimes[1] : '')
      formData.append("unitId", this.importUnitId ? this.importUnitId : -1)
      formData.append("needUpdateUnit", this.needUpdateUnit)
      importData(formData).then(res => {
        this.$message.success("导入成功")
        this.upload = false
@@ -537,7 +549,7 @@
<style scoped>
.bottom_ {
  width: 100%;
  margin-bottom: 5px;
  margin-bottom: 8px;
}
.col-item {
  margin: 5px 0;