研发图纸文件管理系统-前端项目
he wei
2024-12-03 98ff6711d7fb3d4b37846d62a20bcd5c09e25d07
src/pages/resourceManage/product/list.vue
@@ -41,10 +41,16 @@
                  >新增</a-button
                >
                <a-button type="primary" @click="prodDiff">产品比较</a-button>
                <a-button type="primary" @click="ownerDownloadLog"
                  >我的锁定记录</a-button
                >
              </a-space>
            </template>
            <template slot="enabled" slot-scope="{ record }">
              {{ record.enabled == -1 ? "是" : "否" }}
            </template>
            <template slot="enabled1" slot-scope="{ record }">
              {{ record.enabled == 1 ? "可用" : "不可用" }}
            </template>
            <template slot="isNormal" slot-scope="{ record }">
              {{ record.customCode == "" ? "是" : "否" }}
@@ -62,7 +68,7 @@
                <a-space class="btn-grp" direction="vertical" slot="content">
                  <!-- TODO -->
                  <a-button
                    v-if="isTester && record.enabled == -1"
                    v-if="isTester && record.enabled != 1"
                    type="primary"
                    @click="unLock(record)"
                    >解锁</a-button
@@ -71,7 +77,7 @@
                    >下载日志</a-button
                  >
                  <a-button
                    :disabled="record.version == -1"
                    :disabled="record.version != 1"
                    type="primary"
                    @click="edit(record)"
                    >编辑</a-button
@@ -93,16 +99,22 @@
                  <a-button
                    type="primary"
                    v-if="canFeedback"
                    :disabled="record.version == -1"
                    @click="showFeedback(record)"
                    >反馈</a-button
                  >
                  <a-button
                    type="primary"
                    v-if="record.ecrList.length > 0"
                    @click="showEcrlist(record)"
                    >ecr记录</a-button
                  <a-badge
                    :count="record.ecrList.length"
                    showZero
                    :number-style="{
                      backgroundColor: record.ecrList.length > 0 ? '#090' : '#900',
                    }"
                  >
                    <a-button
                      type="primary"
                      @click="showEcrlist(record)"
                      >ecr记录</a-button
                      >
                  </a-badge>
                </a-space>
                <a>更多</a>
              </a-popover>
@@ -351,7 +363,9 @@
            <div>
              <span class="user">{{ item.owner }}</span> 在
              <span class="time">{{ item.createTime }}</span>
              {{ item.lockFlag ? "锁定" : "激活" }}了版本
              {{
                { "-1": "上传", "0": "激活", "1": "锁定" }[item.lockFlag]
              }}了版本
              <span class="version">{{ item.versionTime }}</span>
            </div>
            <div>操作原因: {{ item.reason ? item.reason : "无" }}</div>
@@ -494,6 +508,19 @@
      :type="12"
      :oprate-info="oprateInfo"
    ></download-logs>
    <a-modal
      :visible="ownerLogVisible"
      title="我的下载记录"
      width="100%"
      :destroyOnClose="true"
      @cancel="ownerLogClose"
      wrapClassName="full-modal"
    >
      <owner-download></owner-download>
      <template v-slot:footer>
        <a-button @click="ownerLogClose">关闭</a-button>
      </template>
    </a-modal>
  </div>
</template>
@@ -532,6 +559,7 @@
import createWs from "@/assets/js/websocket";
import DiffList from "@/pages/components/diffList";
import FeedbackForm from "../components/feedbackForm.vue";
import OwnerDownload from "../components/ownerDownload";
const WSMixin = createWs("product");
export default {
@@ -618,6 +646,7 @@
      },
    ];
    return {
      ownerLogVisible: false,
      reason: "",
      reasonVisible: false,
      oprateInfo: "",
@@ -739,6 +768,15 @@
          width: 100,
          scopedSlots: { customRender: "enabled" },
        },
        {
          title: "是否可用",
          dataIndex: "enabled1",
          dataType: "boolean",
          align: "center",
          searchAble: false,
          width: 100,
          scopedSlots: { customRender: "enabled1" },
        },
        // {
        //   title: "创建时间",
        //   dataIndex: "createTime",
@@ -848,12 +886,16 @@
    FeedbackForm,
    DownloadReason,
    DownloadLogs,
    OwnerDownload,
  },
  methods: {
    rowClassFn(record) {
      let classList = [];
      if (record.enabled == -1) {
        classList.push("locked");
      }
      if (record.enabled == 0) {
        classList.push("unable");
      }
      return classList;
    },
@@ -936,12 +978,12 @@
    },
    handleEmailShow(record, get) {
      let title =
        "[产品发布记录]" + record.parentName + " 版本:" + record.versionTime;
        "[产品发布记录]" + record.parentModel + " 版本:" + record.versionTime;
      let content = [];
      content.push("物料编码: " + record.parentCode);
      content.push("物料名称: " + record.parentName);
      content.push("规格型号: " + record.parentModel);
      content.push("标准机型: " + (record.customCode ? "是" : "否"));
      content.push("标准机型: " + (!record.customCode ? "是" : "否"));
      content.push("定制单号: " + (record.customCode || "无"));
      content.push("版本时间: " + record.versionTime);
      if (get) {
@@ -1165,16 +1207,19 @@
      }
      const { pageCurr, pageSize, conditions, columns } = this;
      let params = {};
      let col, index;
      Object.keys(conditions).forEach((v) => {
        switch (v) {
          case "isNormal":
            if (conditions[v]) {
              params["customCode"] = "";
              columns.forEach((val) => {
              columns.forEach((val, idx) => {
                if (val.dataIndex == "customCode") {
                  val.search.value = "";
                  col = { ...val, search: { value: "", backup: "" } };
                  index = idx;
                }
              });
              this.$set(this.columns, index, col);
            }
            break;
          case "customCode":
@@ -1234,9 +1279,9 @@
        parentName,
      };
      addProduct(param).then((res) => {
        const { code, msg } = res.data;
        const { code, data, msg } = res.data;
        this.$layer.close(loading);
        if (code) {
        if (code && data) {
          this.$message.success(msg);
          this.prodUploadShow = false;
        } else {
@@ -1487,6 +1532,12 @@
      this.oprateInfo = parentCode + "_" + customCode;
      this.downloadlogVisible = true;
    },
    ownerDownloadLog() {
      this.ownerLogVisible = true;
    },
    ownerLogClose() {
      this.ownerLogVisible = false;
    },
  },
  watch: {
    update(n) {
@@ -1726,4 +1777,34 @@
/deep/.locked.locked.locked:hover > td {
  background: #fcd583;
}
/deep/.unable > td {
  background: #f0637b;
}
/deep/.unable.unable.unable.ant-table-row-hover > td,
/deep/.unable.unable.unable:hover > td {
  background: #ff869a;
}
</style>
<style lang="less">
.full-modal {
  height: 100%;
  .ant-modal {
    max-width: 100%;
    height: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    // height: calc(100vh);
  }
  .ant-modal-body {
    flex: 1;
  }
}
</style>